/// <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.angularVelocity; return(state); }
/// <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; }