public SimpleFixtureMaterialFactory(SimpleFixture simpleFixture)
            {
                _simpleFixture = simpleFixture;
                var defatulMaterialDescriptor = new MaterialDescriptor();

                defatulMaterialDescriptor.ToDefault();
                WrappedMaterial = simpleFixture._rigidBody.WrappedActor.Scene.CreateMaterial(new MaterialDescription());
                Element         = new Material(simpleFixture._rigidBody, WrappedMaterial, defatulMaterialDescriptor);
            }
 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;
            }
        }
Exemple #4
0
        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;
            }
        }
Exemple #5
0
        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;
            }
        }
Exemple #6
0
        public PlaneShape(RigidBody rigidBody, Matrix4x4 realParentPose, Material material, PlaneShapeDescriptor descriptor)
        {
            var planeShapeDescription = new PlaneShapeDescription(descriptor.Normal.ToPhysX(), descriptor.DistanceFromOrigin) { Material = material._wrappedMaterial };
            _wrappedPlaneShape =
                (StillDesign.PhysX.PlaneShape)
                rigidBody.WrappedActor.CreateShape(planeShapeDescription);
            _normal = descriptor.Normal;
            _distanceFromOrigin = descriptor.DistanceFromOrigin;
            _pose = realParentPose;

            SetRealParentPose(realParentPose);


            UserData = descriptor.UserData;
            if (rigidBody.HasDefaultShape)
            {
                rigidBody.WrappedActor.Shapes[0].Dispose();
                rigidBody.HasDefaultShape = false;
            }
        }
Exemple #7
0
        public PlaneShape(RigidBody rigidBody, Matrix4x4 realParentPose, Material material, PlaneShapeDescriptor descriptor)
        {
            var planeShapeDescription = new PlaneShapeDescription(descriptor.Normal.ToPhysX(), descriptor.DistanceFromOrigin)
            {
                Material = material._wrappedMaterial
            };

            _wrappedPlaneShape =
                (StillDesign.PhysX.PlaneShape)
                rigidBody.WrappedActor.CreateShape(planeShapeDescription);
            _normal             = descriptor.Normal;
            _distanceFromOrigin = descriptor.DistanceFromOrigin;
            _pose = realParentPose;

            SetRealParentPose(realParentPose);


            UserData = descriptor.UserData;
            if (rigidBody.HasDefaultShape)
            {
                rigidBody.WrappedActor.Shapes[0].Dispose();
                rigidBody.HasDefaultShape = false;
            }
        }