1 // FGAIMultiplayer - AIBase derived class creates an AI multiplayer aircraft
3 // Written by David Culp, started October 2003.
4 // With additions by Vivian Meazza
6 // Copyright (C) 2003 David P. Culp - davidculp2@comcast.net
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef _FG_AIMultiplayer_HXX
23 #define _FG_AIMultiplayer_HXX
25 #include "AIManager.hxx"
28 //#include <Traffic/SchedFlight.hxx>
29 //#include <Traffic/Schedule.hxx>
35 class FGAIMultiplayer : public FGAIBase {
43 virtual void unbind();
44 void update(double dt);
47 void setSpeedN(double sn);
48 void setSpeedE(double se);
49 void setSpeedD(double sd);
50 void setAccN(double an);
51 void setAccE(double ae);
52 void setAccD(double ad);
53 void setRateH(double rh);
54 void setRateR(double rr);
55 void setRateP(double rp);
56 void setRudder( double r ) { rudder = r;}
57 void setElevator( double e ) { elevator = e; }
58 void setLeftAileron( double la ) { left_aileron = la; }
59 void setRightAileron( double ra ) { right_aileron = ra; }
62 inline SGPropertyNode *FGAIMultiplayer::getProps() { return props; }
64 void setAcType(string ac) { acType = ac; };
65 void setCompany(string comp);
67 virtual const char* getTypeString(void) const { return "multiplayer"; }
70 double speedN, speedE, speedD;
71 double rateH, rateR, rateP;
72 double raw_hdg , raw_roll , raw_pitch ;
73 double raw_speed_north_deg_sec, raw_speed_east_deg_sec;
74 double raw_lat, damp_lat, lat_constant;
75 double raw_lon, damp_lon, lon_constant;
76 double raw_alt, damp_alt, alt_constant;
77 double hdg_constant, roll_constant, pitch_constant;
78 double speed_north_deg_sec_constant, speed_east_deg_sec_constant;
79 double speed_north_deg_sec, speed_east_deg_sec;
80 double accN, accE, accD;
81 double rudder, elevator, left_aileron, right_aileron;
82 double time_stamp, last_time_stamp;
84 SGPropertyNode_ptr _time_node;
87 inline double sign(double x) { return (x < 0.0) ? -1.0 : 1.0; }
93 inline void FGAIMultiplayer::setSpeedN(double sn) { speedN = sn; }
94 inline void FGAIMultiplayer::setSpeedE(double se) { speedE = se; }
95 inline void FGAIMultiplayer::setSpeedD(double sd) { speedD = sd; }
96 inline void FGAIMultiplayer::setAccN(double an) { accN = an; }
97 inline void FGAIMultiplayer::setAccE(double ae) { accE = ae; }
98 inline void FGAIMultiplayer::setAccD(double ad) { accD = ad; }
99 inline void FGAIMultiplayer::setRateH(double rh) { rateH = rh; }
100 inline void FGAIMultiplayer::setRateR(double rr) { rateR = rr; }
101 inline void FGAIMultiplayer::setRateP(double rp) { rateP = rp; }
103 #endif // _FG_AIMultiplayer_HXX