From d41c0aea10b3957ef520a5f8fd274db31a2ad546 Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Fri, 4 May 2018 15:25:35 -0400 Subject: [PATCH] [scenekit] SCNPhysicsShape's Create should take a SCNMatrix4 array, not SCNVector3 - Fixes #4030: SCNPhysicsShape.Create transforms param is bound incorrectly (https://github.com/xamarin/xamarin-macios/issues/4030) --- src/SceneKit/SCNPhysicsShape.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/SceneKit/SCNPhysicsShape.cs b/src/SceneKit/SCNPhysicsShape.cs index 8bc8b84ee895..83a83fb931f5 100644 --- a/src/SceneKit/SCNPhysicsShape.cs +++ b/src/SceneKit/SCNPhysicsShape.cs @@ -17,6 +17,23 @@ namespace SceneKit { public partial class SCNPhysicsShape { + public static SCNPhysicsShape Create (SCNPhysicsShape [] shapes, SCNMatrix4 [] transforms) + { + if (shapes == null) + throw new ArgumentNullException ("shapes"); + + if (transforms == null) + throw new ArgumentNullException ("transforms"); + + var t = new NSValue [transforms.Length]; + for (var i = 0; i < t.Length; i++) + t [i] = NSValue.FromSCNMatrix4 (transforms [i]); + + return Create (shapes, t); + } + +#if XAMCORE_4_0 + [Obsolete ("Use the 'Create' method that takes a 'SCNMatrix4 []'.")] public static SCNPhysicsShape Create (SCNPhysicsShape [] shapes, SCNVector3 [] transforms) { if (shapes == null) @@ -31,6 +48,7 @@ public static SCNPhysicsShape Create (SCNPhysicsShape [] shapes, SCNVector3 [] t return Create (shapes, t); } +#endif public static SCNPhysicsShape Create (SCNGeometry geometry, SCNPhysicsShapeType? shapeType = null,