private static void SendRotation( Entity3d target, float delta ) { float s = ( float )Math.Atan2( target.Ahead.Z, target.Ahead.X ); s = Utils.Wrap( s + delta, 0, ( float )( 2 * Math.PI ) ); target.HandleMessage( new RotateXzRequest( s ) ); }
/// <summary> /// Sends a movement message to the specified target /// </summary> private static void SendMovement( Entity3d target, Vector3 move ) { // Turn movement into units per second (irrespective of clock update rate) move *= ( float )TinyTime.ToSeconds( target.CurrentPosition.LastStepInterval ); target.HandleMessage( new MovementXzRequest( move.X, move.Z ) ); }