1 // AIManager.hxx - experimental! - David Culp - based on:
2 // AIMgr.hxx - definition of FGAIMgr
3 // - a global management class for FlightGear generated AI traffic
5 // Written by David Luff, started March 2002.
7 // Copyright (C) 2002 David C Luff - david.luff@nottingham.ac.uk
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef _FG_AIMANAGER_HXX
24 #define _FG_AIMANAGER_HXX
26 #include <simgear/structure/subsystem_mgr.hxx>
27 #include <Main/fg_props.hxx>
35 class FGAIManager : public SGSubsystem
40 // A list of pointers to AI objects
41 typedef list <FGAIBase*> ai_list_type;
42 typedef ai_list_type::iterator ai_list_iterator;
43 typedef ai_list_type::const_iterator ai_list_const_iterator;
45 // Everything put in this list should be created dynamically
46 // on the heap and ***DELETED WHEN REMOVED!!!!!***
48 ai_list_iterator ai_list_itr;
50 // array of already-assigned ID's
51 typedef vector <int> id_vector_type;
53 id_vector_type::iterator id_itr;
63 void update(double dt);
68 int createAircraft( string model_class, // see FGAIAircraft.hxx for possible classes
69 string path, // path to exterior model
70 double latitude, // in degrees -90 to 90
71 double longitude, // in degrees -180 to 180
72 double altitude, // in feet
73 double heading, // true heading in degrees
74 double speed, // in knots true airspeed (KTAS)
75 double pitch = 0, // in degrees
76 double roll = 0 ); // in degrees
78 int createShip( string path, // path to exterior model
79 double latitude, // in degrees -90 to 90
80 double longitude, // in degrees -180 to 180
81 double altitude, // in feet (ex. for a lake!)
82 double heading, // true heading in degrees
83 double speed, // in knots true
84 double rudder ); // in degrees (between 0 and 5 works best)
87 int createBallistic( string path, // path to exterior model
88 double latitude, // in degrees -90 to 90
89 double longitude, // in degrees -180 to 180
90 double altitude, // in feet
91 double azimuth, // in degrees (same as heading)
92 double elevation, // in degrees (same as pitch)
93 double speed ); // in feet per second
95 int createStorm( string path, // path to exterior model
96 double latitude, // in degrees -90 to 90
97 double longitude, // in degrees -180 to 180
98 double altitude, // in feet
99 double heading, // true heading in degrees
100 double speed ); // in knots true airspeed (KTAS)
102 int createThermal( double latitude, // in degrees -90 to 90
103 double longitude, // in degrees -180 to 180
104 double strength, // in feet per second
105 double diameter ); // in feet
107 void destroyObject( int ID );
109 inline double get_user_latitude() { return user_latitude; }
110 inline double get_user_longitude() { return user_longitude; }
111 inline double get_user_altitude() { return user_altitude; }
112 inline double get_user_heading() { return user_heading; }
113 inline double get_user_pitch() { return user_pitch; }
114 inline double get_user_yaw() { return user_yaw; }
115 inline double get_user_speed() {return user_speed; }
121 SGPropertyNode* root;
122 SGPropertyNode* wind_from_down;
124 double user_latitude;
125 double user_longitude;
126 double user_altitude;
133 void fetchUserState( void );
136 double range_nearest;
138 void processThermal( FGAIThermal* thermal );
142 #endif // _FG_AIMANAGER_HXX