]> git.mxchange.org Git - flightgear.git/blob - src/AIModel/AIBase.hxx
8e562628fce47c6e7089aa2323587d43249e14da
[flightgear.git] / src / AIModel / AIBase.hxx
1 // FGAIBase - abstract base class for AI objects
2 // Written by David Culp, started Nov 2003, based on
3 // David Luff's FGAIEntity class.
4 // - davidculp2@comcast.net
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License as
8 // published by the Free Software Foundation; either version 2 of the
9 // License, or (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 #ifndef _FG_AIBASE_HXX
21 #define _FG_AIBASE_HXX
22
23 #include <simgear/math/point3d.hxx>
24 #include <simgear/scene/model/placement.hxx>
25 #include <string>
26
27 SG_USING_STD(string);
28
29 class FGAIBase {
30
31 public:
32
33     virtual ~FGAIBase();
34     virtual void update(double dt);
35     inline Point3D GetPos() { return(pos); }
36     virtual bool init();
37
38     void setPath( const char* model );
39     void setSpeed( double speed_KTAS );
40     void setAltitude( double altitude_ft );
41     void setLongitude( double longitude );
42     void setLatitude( double latitude );
43     void setHeading( double heading );
44     void setDie( bool die );
45     inline bool getDie() { return delete_me; }
46
47 protected:
48
49     Point3D pos;        // WGS84 lat & lon in degrees, elev above sea-level in meters
50     double hdg;         // True heading in degrees
51     double roll;        // degrees, left is negative
52     double pitch;       // degrees, nose-down is negative
53     double speed;       // knots true airspeed
54     double altitude;    // meters above sea level
55     double vs;           // vertical speed, feet per minute   
56
57     double tgt_heading;  // target heading, degrees true
58     double tgt_altitude; // target altitude, *feet* above sea level
59     double tgt_speed;    // target speed, KTAS
60     double tgt_roll;
61     double tgt_pitch;
62     double tgt_yaw;
63     double tgt_vs;
64
65
66     string model_path;     //Path to the 3D model
67     SGModelPlacement aip;
68     bool delete_me;
69
70     void Transform();
71 };
72
73 #endif  // _FG_AIBASE_HXX
74