Beispiel #1
0
        /// <summary>
        /// Returns all the state information of the mover that is pertinent for simulation
        /// </summary>
        public PhysicsMoverState GetState()
        {
            PhysicsMoverState state = new PhysicsMoverState();

            state.Position        = TransientPosition;
            state.Rotation        = TransientRotation;
            state.Velocity        = Rigidbody.velocity;
            state.AngularVelocity = Rigidbody.velocity;

            return(state);
        }
Beispiel #2
0
 /// <summary>
 /// Applies a mover state instantly
 /// </summary>
 public void ApplyState(PhysicsMoverState state)
 {
     SetPositionAndRotation(state.Position, state.Rotation);
     Rigidbody.velocity        = state.Velocity;
     Rigidbody.angularVelocity = state.AngularVelocity;
 }