Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
        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;
            }
        }