#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"
-SG_USING_STD(list);
+#include <AIModel/AIBase.hxx>
+#include <AIModel/AIScenario.hxx>
+#include <AIModel/AIFlightPlan.hxx>
- struct PERF_STRUCT {
- double accel;
- double decel;
- double climb_rate;
- double descent_rate;
- double takeoff_speed;
- double climb_speed;
- double cruise_speed;
- double descent_speed;
- double land_speed;
- };
+SG_USING_STD(list);
+class FGAIThermal;
class FGAIManager : public SGSubsystem
public:
- enum object_type { otAircraft, otShip, otBallistic, otRocket };
-
FGAIManager();
~FGAIManager();
void unbind();
void update(double dt);
+ 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_altitude() { return user_altitude; }
+ inline double get_user_heading() { return user_heading; }
+ inline double get_user_pitch() { return user_pitch; }
+ 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 );
private:
bool initDone;
+ bool enabled;
+ int numObjects[FGAIBase::MAX_OBJECTS];
+ SGPropertyNode* root;
+ SGPropertyNode* wind_from_down_node;
+ string scenario_filename;
+
+ double user_latitude;
+ double user_longitude;
+ double user_altitude;
+ double user_heading;
+ double user_pitch;
+ double user_yaw;
+ double user_speed;
+ double _dt;
+ int dt_count;
+ void fetchUserState( void );
+
+ // used by thermals
+ double range_nearest;
+ double strength;
+ void processThermal( FGAIThermal* thermal );
};