public BoxShape(RigidBody rigidBody, Matrix4x4 realParentPose, Material material, BoxShapeDescriptor descriptor) { var boxShapeDescription = new BoxShapeDescription(descriptor.WidthX, descriptor.WidthY, descriptor.WidthZ) { Material = material._wrappedMaterial }; _wrappedBoxShape = (StillDesign.PhysX.BoxShape) rigidBody.WrappedActor.CreateShape(boxShapeDescription); SetRealParentPose(realParentPose); UserData = descriptor.UserData; if (rigidBody.HasDefaultShape) { rigidBody.WrappedActor.Shapes[0].Dispose(); rigidBody.HasDefaultShape = false; } }
public BoxShape(RigidBody rigidBody, Matrix4x4 realParentPose, Material material, BoxShapeDescriptor descriptor) { var boxShapeDescription = new BoxShapeDescription(descriptor.WidthX, descriptor.WidthY, descriptor.WidthZ) { Material = material._wrappedMaterial }; _wrappedBoxShape = (StillDesign.PhysX.BoxShape) rigidBody.WrappedActor.CreateShape(boxShapeDescription); SetRealParentPose(realParentPose); UserData = descriptor.UserData; if (rigidBody.HasDefaultShape) { rigidBody.WrappedActor.Shapes[0].Dispose(); rigidBody.HasDefaultShape = false; } }