public SphereShape(RigidBody rigidBody, Matrix4x4 realParentPose, Material material, SphereShapeDescriptor descriptor) { var sphereShapeDescription = new SphereShapeDescription(descriptor.Radius) {Material = material._wrappedMaterial}; _wrappedSphereShape = (StillDesign.PhysX.SphereShape)rigidBody.WrappedActor.CreateShape(sphereShapeDescription); SetRealParentPose(realParentPose); UserData = descriptor.UserData; if (rigidBody.HasDefaultShape) { rigidBody.WrappedActor.Shapes[0].Dispose(); rigidBody.HasDefaultShape = false; } }
public SphereShape(RigidBody rigidBody, Matrix4x4 realParentPose, Material material, SphereShapeDescriptor descriptor) { var sphereShapeDescription = new SphereShapeDescription(descriptor.Radius) { Material = material._wrappedMaterial }; _wrappedSphereShape = (StillDesign.PhysX.SphereShape)rigidBody.WrappedActor.CreateShape(sphereShapeDescription); SetRealParentPose(realParentPose); UserData = descriptor.UserData; if (rigidBody.HasDefaultShape) { rigidBody.WrappedActor.Shapes[0].Dispose(); rigidBody.HasDefaultShape = false; } }