#ifndef _FG_AIMANAGER_HXX
#define _FG_AIMANAGER_HXX
+#include <list>
+
#include <simgear/structure/subsystem_mgr.hxx>
+
#include <Main/fg_props.hxx>
-#include <list>
-#include "AIBase.hxx"
-#include "AIScenario.hxx"
-#include "AIFlightPlan.hxx"
+
+#include <AIModel/AIBase.hxx>
+#include <AIModel/AIScenario.hxx>
+#include <AIModel/AIFlightPlan.hxx>
SG_USING_STD(list);
class FGAIThermal;
ai_list_type ai_list;
ai_list_iterator ai_list_itr;
- // array of already-assigned ID's
- typedef vector <int> id_vector_type;
- id_vector_type ids;
- id_vector_type::iterator id_itr;
-
public:
FGAIManager();
void unbind();
void update(double dt);
- int assignID();
- void freeID(int ID);
-
- int createAircraft( string model_class, // see FGAIAircraft.hxx for possible classes
- string path, // path to exterior model
- double latitude, // in degrees -90 to 90
- double longitude, // in degrees -180 to 180
- double altitude, // in feet
- double heading, // true heading in degrees
- double speed, // in knots true airspeed (KTAS)
- double roll = 0 ); // in degrees
-
- int createAircraft( string model_class, // see FGAIAircraft.hxx for possible classes
- string path, // path to exterior model
- FGAIFlightPlan *flightplan );
-
- int createShip( string path, // path to exterior model
- double latitude, // in degrees -90 to 90
- double longitude, // in degrees -180 to 180
- double altitude, // in feet (ex. for a lake!)
- double heading, // true heading in degrees
- double speed, // in knots true
- double rudder ); // in degrees (right is positive)(0 to 5 works best)
-
- int createShip( string path, // path to exterior model
- FGAIFlightPlan *flightplan );
-
- int createBallistic( string path, // path to exterior model
- double latitude, // in degrees -90 to 90
- double longitude, // in degrees -180 to 180
- double altitude, // in feet
- double azimuth, // in degrees (same as heading)
- double elevation, // in degrees (same as pitch)
- double speed ); // in feet per second
-
- int createStorm( string path, // path to exterior model
- double latitude, // in degrees -90 to 90
- double longitude, // in degrees -180 to 180
- double altitude, // in feet
- double heading, // true heading in degrees
- double speed ); // in knots true airspeed (KTAS)
-
- int createThermal( double latitude, // in degrees -90 to 90
- double longitude, // in degrees -180 to 180
- double strength, // in feet per second
- double diameter ); // in feet
-
- void destroyObject( int ID );
+ void* createBallistic( FGAIModelEntity *entity );
+ void* createAircraft( FGAIModelEntity *entity );
+ void* createThermal( FGAIModelEntity *entity );
+ void* createStorm( FGAIModelEntity *entity );
+ void* createShip( FGAIModelEntity *entity );
+
+ void destroyObject( void* ID );
inline double get_user_latitude() { return user_latitude; }
inline double get_user_longitude() { return user_longitude; }
inline double get_user_yaw() { return user_yaw; }
inline double get_user_speed() {return user_speed; }
+ inline int getNum( FGAIBase::object_type ot ) { return numObjects[ot]; }
+
void processScenario( string filename );
- int getNum( FGAIBase::object_type ot);
private:
bool initDone;
bool enabled;
- int numObjects;
+ int numObjects[FGAIBase::MAX_OBJECTS];
SGPropertyNode* root;
- SGPropertyNode* wind_from_down;
+ SGPropertyNode* wind_from_down_node;
string scenario_filename;
double user_latitude;