예제 #1
0
        protected Controller _createCharacterController(Vector3 pose, Scene scene, SimpleShape shape, CharacterControllerDescription description)
        {
            Controller            controller      = null;
            CapsuleControllerDesc controller_desc = new CapsuleControllerDesc();

            controller_desc.ClimbingMode = description.CapsuleEasyClimbing ? CapsuleClimbingModes.Easy : CapsuleClimbingModes.Constrained;
            Vector3 capsule_desc = shape.to_cc_shape();

            controller_desc.Height     = capsule_desc.y;
            controller_desc.Radius     = capsule_desc.x;
            controller_desc.Position   = pose;
            controller_desc.SkinWidth  = description.SkinWidth;
            controller_desc.SlopeLimit = description.SlopeLimit;
            controller_desc.StepOffset = description.StepOffset;
            //controller_desc.s = (NxHeightFieldAxis)(int)description.mUpDirection;
            //controller_desc.Callback = World::getSingleton()->getPhysXCharacterHitReport();
            scene.Physics.ControllerManager.CreateController(scene, controller_desc);
            return(controller);
        }
예제 #2
0
 public void createCharacterController(Vector3 globalPos, SimpleShape shape, CharacterControllerDescription description, Scene scene)
 {
     stepOffset = description.StepOffset;
     skinWidth  = description.SkinWidth;
     controller = _createCharacterController(globalPos, scene, shape, description);
 }
예제 #3
0
 public CharacterController(SimpleShape shape, Vector3 globalPosition, CharacterControllerDescription description, Scene scene)
 {
     createCharacterController(globalPosition, shape, description, scene);
 }