13#include <simgear/math/SGVec3.hxx>
14#include <simgear/misc/sg_path.hxx>
15#include <simgear/props/props.hxx>
16#include <simgear/structure/SGSharedPtr.hxx>
17#include <simgear/structure/subsystem_mgr.hxx>
38 void update(
double dt)
override;
44 void attach(
const SGSharedPtr<FGAIBase>& model);
65 static SGPropertyNode_ptr
loadScenarioFile(
const std::string&
id, SGPath& outPath);
99 return _radarDebugMode;
112 typedef ai_list_type::iterator ai_list_iterator;
113 typedef ai_list_type::const_iterator ai_list_const_iterator;
115 int getNumAiObjects()
const;
117 void removeDeadItem(
FGAIBase* base);
120 bool loadScenarioCommand(
const SGPropertyNode* args, SGPropertyNode* root);
122 bool unloadScenarioCommand(
const SGPropertyNode* args, SGPropertyNode* root);
123 bool addObjectCommand(
const SGPropertyNode* arg,
const SGPropertyNode* root);
124 bool removeObjectCommand(
const SGPropertyNode* arg,
const SGPropertyNode* root);
126 bool removeObject(
const SGPropertyNode* args);
127 bool unloadScenario(
const std::string& filename);
128 void unloadAllScenarios();
130 SGPropertyNode_ptr root;
131 SGPropertyNode_ptr enabled;
132 SGPropertyNode_ptr thermal_lift_node;
133 SGPropertyNode_ptr user_altitude_agl_node;
134 SGPropertyNode_ptr user_speed_node;
135 SGPropertyNode_ptr wind_from_east_node;
136 SGPropertyNode_ptr wind_from_north_node;
137 SGPropertyNode_ptr _environmentVisiblity;
138 SGPropertyNode_ptr _groundSpeedKts_node;
142 double user_altitude_agl = 0.0;
143 double user_heading = 0.0;
144 double user_pitch = 0.0;
145 double user_roll = 0.0;
146 double user_speed = 0.0;
147 double wind_from_east = 0.0;
148 double wind_from_north = 0.0;
150 void fetchUserState(
double dt);
153 double range_nearest = 0.0;
154 double strength = 0.0;
155 void processThermal(
double dt,
FGAIThermal* thermal);
157 SGPropertyChangeCallback<FGAIManager> cb_ai_bare;
158 SGPropertyChangeCallback<FGAIManager> cb_ai_detailed;
159 SGPropertyChangeCallback<FGAIManager> cb_interior;
162 typedef std::map<std::string, Scenario*> ScenarioDict;
163 ScenarioDict _scenarios;
165 SGSharedPtr<FGAIAircraft> _userAircraft;
167 SGPropertyNode_ptr _simRadarControl,
168 _radarRangeNode, _radarDebugNode;
169 bool _radarEnabled =
true,
170 _radarDebugMode =
false;
171 double _radarRangeM = 0.0;
SGSharedPtr< FGAIBase > FGAIBasePtr
SGSharedPtr< FGAIBase > FGAIBasePtr
static SGPropertyNode_ptr loadScenarioFile(const std::string &id, SGPath &outPath)
bool isRadarEnabled() const
FGAIBasePtr getObjectFromProperty(const SGPropertyNode *aProp) const
given a reference to an /ai/models/<foo>[n] node, return the corresponding AIObject implementation,...
static SGPropertyNode_ptr registerScenarioFile(SGPropertyNode_ptr root, const SGPath &p)
const ai_list_type & get_ai_list() const
bool loadScenario(const std::string &id)
std::vector< FGAIBasePtr > ai_list_type
double get_user_pitch() const
double get_user_agl() const
void updateLOD(SGPropertyNode *node)
update LOD settings of all AI/MP models
FGAIBasePtr addObject(const SGPropertyNode *definition)
double get_wind_from_east() const
void update(double dt) override
const FGAIBase * calcCollision(double alt, double lat, double lon, double fuse_range)
double get_user_speed() const
bool isVisible(const SGGeod &pos) const
static const char * staticSubsystemClassId()
bool enableRadarDebug() const
double get_wind_from_north() const
double radarRangeM() const
double calcRangeFt(const SGVec3d &aCartPos, const FGAIBase *aObject) const
double get_user_heading() const
friend class FGSubmodelMgr
double get_user_roll() const
void attach(const SGSharedPtr< FGAIBase > &model)
static void registerScenarios(SGPropertyNode_ptr root={})
Static helper to register scenarios.
FGAIAircraft * getUserAircraft() const
Retrieve the representation of the user's aircraft in the AI manager the position and velocity of thi...