1 /**************************************************************************
2 * slew.c -- the "slew" flight model
4 * Written by Curtis Olson, started May 1997.
7 * (Log is kept at end of this file)
8 **************************************************************************/
15 #include "../aircraft/aircraft.h"
16 #include "../controls/controls.h"
20 #define PI2 (M_PI + M_PI)
24 /* reset flight params to a specific position */
25 void slew_init(double pos_x, double pos_y, double pos_z, double heading) {
26 struct flight_params *f;
28 f = ¤t_aircraft.flight;
50 /* update position based on inputs, positions, velocities, etc. */
52 struct flight_params *f;
53 struct control_params *c;
55 f = ¤t_aircraft.flight;
56 c = ¤t_aircraft.controls;
61 } else if ( f->Psi < 0 ) {
67 f->pos_x = f->pos_x + (cos(f->Psi) * f->vel_x);
68 f->pos_y = f->pos_y + (sin(f->Psi) * f->vel_x);
73 /* Revision 1.1 1997/05/16 16:04:45 curt