Пример #1
0
 public InterpretedMotionState InqInterpretedMotionState()
 {
     if (MotionInterpreter == null)
     {
         MotionInterpreter = MotionInterp.Create(PhysicsObj, WeenieObj);
         if (PhysicsObj != null)
         {
             MotionInterpreter.enter_default_state();
         }
     }
     return(MotionInterpreter.InterpretedState);
 }
Пример #2
0
 public MotionInterp get_minterp()
 {
     if (MotionInterpreter == null)
     {
         MotionInterpreter = MotionInterp.Create(PhysicsObj, WeenieObj);
         if (PhysicsObj != null)
         {
             MotionInterpreter.enter_default_state();
         }
     }
     return(MotionInterpreter);
 }
Пример #3
0
 public void move_to_interpreted_state(InterpretedMotionState state)
 {
     if (MotionInterpreter == null)
     {
         MotionInterpreter = MotionInterp.Create(PhysicsObj, WeenieObj);
         if (PhysicsObj != null)
         {
             MotionInterpreter.enter_default_state();
         }
     }
     MotionInterpreter.move_to_interpreted_state(state);
 }
Пример #4
0
        public void EnterDefaultState()
        {
            if (PhysicsObj == null)
            {
                return;
            }

            if (MotionInterpreter == null)
            {
                MotionInterpreter = MotionInterp.Create(PhysicsObj, WeenieObj);
            }

            MotionInterpreter.enter_default_state();
        }
Пример #5
0
        public WeenieError PerformMovement(MovementStruct mvs)
        {
            PhysicsObj.set_active(true);

            switch (mvs.Type)
            {
            case MovementType.RawCommand:
            case MovementType.InterpretedCommand:
            case MovementType.StopRawCommand:
            case MovementType.StopInterpretedCommand:
            case MovementType.StopCompletely:

                if (MotionInterpreter == null)
                {
                    MotionInterpreter = MotionInterp.Create(PhysicsObj, WeenieObj);
                    if (PhysicsObj != null)
                    {
                        MotionInterpreter.enter_default_state();
                    }
                }
                return(MotionInterpreter.PerformMovement(mvs));

            case MovementType.MoveToObject:
            case MovementType.MoveToPosition:
            case MovementType.TurnToObject:
            case MovementType.TurnToHeading:

                if (MoveToManager == null)
                {
                    MoveToManager = MoveToManager.Create(PhysicsObj, WeenieObj);
                }

                return(MoveToManager.PerformMovement(mvs));

            default:
                return(WeenieError.GeneralMovementFailure);
            }
        }