Пример #1
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;
            }
        }
Пример #2
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;
            }
        }