FlightGear next
AIBase.hxx
Go to the documentation of this file.
1/*
2 * SPDX-FileName: AIBase.hxx
3 * SPDX-FileComment: abstract base class for AI objects, based on David Luff's FGAIEntity class.
4 * SPDX-FileCopyrightText: Written by David Culp, started Nov 2003 - davidculp2@comcast.net
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#pragma once
9
10#include <string>
11#include <string_view>
12
13#include <osg/ref_ptr>
14
15#include <simgear/constants.h>
16#include <simgear/math/sg_geodesy.hxx>
17#include <simgear/misc/sg_path.hxx>
18#include <simgear/props/tiedpropertylist.hxx>
19#include <simgear/scene/model/placement.hxx>
20#include <simgear/sg_inlines.h>
21#include <simgear/structure/SGReferenced.hxx>
22#include <simgear/structure/SGSharedPtr.hxx>
23
24
25namespace osg {
26class PagedLOD;
27}
28namespace simgear {
29class BVHMaterial;
30}
31
32class FGAIManager;
33class FGAIFlightPlan;
34class FGFX;
35class FGAIModelData; // defined below
36
37
38class FGAIBase : public SGReferenced
39{
40public:
57
58 FGAIBase(object_type ot, bool enableHot);
59 virtual ~FGAIBase();
60
61 virtual void readFromScenario(SGPropertyNode* scFileNode);
62
63 enum class ModelSearchOrder {
64 DATA_ONLY, // don't search AI/ prefix at all
65 PREFER_AI, // search AI first, override other paths
66 PREFER_DATA // search data first but fall back to AI
67 };
68
69 virtual bool init(ModelSearchOrder searchOrder);
70 virtual void initModel();
71 virtual void update(double dt);
72 virtual void bind();
73 virtual void unbind();
74 virtual void reinit() {}
75
76 // default model radius for LOD.
77 virtual double getDefaultModelRadius() { return 20.0; }
78
79 void updateLOD();
80 void updateInterior();
81
82 void setManager(FGAIManager* mgr, SGPropertyNode* p);
83
84 void setPath(const char* model);
85 void setPathLowres(std::string model);
86
87 void setFallbackModelIndex(const int i);
88 void setSMPath(const std::string& p);
89 void setCallSign(const std::string&);
90
91 void setSpeed(double speed_KTAS);
92 void setMaxSpeed(double kts);
93
94 void setAltitude(double altitude_ft);
96 void setHeading(double heading);
97 void setLatitude(double latitude);
98 void setLongitude(double longitude);
99
100 void setBank(double bank);
101 void setPitch(double newpitch);
102 void setRadius(double radius);
103
104 void setXoffset(double x_offset);
105 void setYoffset(double y_offset);
106 void setZoffset(double z_offset);
107
108 void setPitchoffset(double x_offset);
109 void setRolloffset(double y_offset);
110 void setYawoffset(double z_offset);
111
112 void setServiceable(bool serviceable);
113
114 bool getDie();
115 void setDie(bool die);
116 bool isValid() const;
117
118 void setCollisionData(bool i, double lat, double lon, double elev);
119 void setImpactData(bool d);
120 void setImpactLat(double lat);
121 void setImpactLon(double lon);
122 void setImpactElev(double e);
123
124 void setName(const std::string& n);
125 bool setParentNode();
126 void setParentName(const std::string& p);
127
128 void setCollisionLength(int range);
129 void setCollisionHeight(int height);
130
131 void calcRangeBearing(double lat, double lon, double lat2, double lon2,
132 double& range, double& bearing) const;
133 double calcRelBearingDeg(double bearing, double heading);
134 double calcTrueBearingDeg(double bearing, double heading);
135 double calcRecipBearingDeg(double bearing);
136
137 int getID() const;
138 int _getSubID() const;
139
140 void setFlightPlan(std::unique_ptr<FGAIFlightPlan> f);
141
142 SGGeod getGeodPos() const;
143 void setGeodPos(const SGGeod& pos);
144 SGVec3d getCartPosAt(const SGVec3d& off) const;
145 SGVec3d getCartPos() const;
146
147 bool getGroundElevationM(const SGGeod& pos, double& elev,
148 const simgear::BVHMaterial** material) const;
149
150 SGPropertyNode* getPositionFromNode(SGPropertyNode* scFileNode, const std::string& key, SGVec3d& position);
151
152 double getTrueHeadingDeg() const { return hdg; }
153
154 double _getCartPosX() const;
155 double _getCartPosY() const;
156 double _getCartPosZ() const;
157
158 osg::LOD* getSceneBranch() const;
159
160 virtual int getCollisionHeight() const;
161 virtual int getCollisionLength() const;
162
167 bool modelLoaded() const;
168
169 void setScenarioPath(const std::string& scenarioPath);
170
171protected:
172 double _elevation_m = 0.0;
173
174 double _x_offset;
175 double _y_offset;
176 double _z_offset;
177
181
182 double _max_speed = 300.0;
183
186
187 std::string _path;
188 std::string _callsign;
189 std::string _submodel;
190 std::string _name;
191 std::string _parent;
192 std::string _scenarioPath;
193
197 template <typename T>
198 void tie(const char* aRelPath, const SGRawValue<T>& aRawValue)
199 {
200 _tiedProperties.Tie(props->getNode(aRelPath, true), aRawValue);
201 }
202
203 simgear::TiedPropertyList _tiedProperties;
204 SGPropertyNode_ptr _selected_ac;
205 SGPropertyNode_ptr props;
206 SGPropertyNode_ptr trigger_node;
207 SGPropertyNode_ptr replay_time;
208 SGPropertyNode_ptr model_removed; // where to report model removal
210
211 // these describe the model's actual state
212 SGGeod pos; // WGS84 lat & lon in degrees, elev above sea-level in meters
213 double hdg; // True heading in degrees
214 double roll; // degrees, left is negative
215 double pitch; // degrees, nose-down is negative
216 double speed; // knots true airspeed
217 double speed_fps = 0.0; // fps true airspeed
218 double altitude_ft; // feet above sea level
219 double vs_fps; // vertical speed
222 double turn_radius_ft; // turn radius ft at 15 kts rudder angle 15 degrees
223 double altitude_agl_ft = 0.0;
224
227
228 // these describe the model's desired state
229 double tgt_heading; // target heading, degrees true
230 double tgt_altitude_ft; // target altitude, *feet* above sea level
231 double tgt_speed; // target speed, KTAS
232 double tgt_roll;
233 double tgt_pitch;
234 double tgt_yaw;
235 double tgt_vs;
236
237 // these describe radar information for the user
238 bool in_range; // true if in range of the radar, otherwise false
239 double bearing; // true bearing from user to this model
240 double elevation; // elevation in degrees from user to this model
241 double range; // range from user to this model, nm
242 double rdot; // range rate, in knots
243 double horiz_offset; // look left/right from user to me, deg
244 double vert_offset; // look up/down from user to me, deg
245 double x_shift; // value used by radar display instrument
246 double y_shift; // value used by radar display instrument
247 double rotation; // value used by radar display instrument
248 double ht_diff; // value used by radar display instrument
249
250 std::string model_path; // Path to the 3D model
251 std::string model_path_lowres; // Path to optional low res 3D model
252 int _fallback_model_index = 0; // Index into /sim/multiplay/fallback-models[]
253 SGModelPlacement aip;
254
256 bool invisible = false;
259 bool _installed = false;
260 int _subID = 0;
261
262 double life;
263
264 std::unique_ptr<FGAIFlightPlan> fp;
265
269
277
279 void Transform();
281
282 void removeModel();
283 void removeSoundFx();
284
285 static int _newAIModelID();
286
287private:
288 int _refID;
289 object_type _otype;
290 bool _initialized = false;
291 osg::ref_ptr<osg::PagedLOD> _model;
292 osg::ref_ptr<FGAIModelData> _modeldata;
293
294 SGSharedPtr<FGFX> _fx;
295
296 std::vector<std::string> resolveModelPath(ModelSearchOrder searchOrder);
297
298public:
300
301 virtual std::string_view getTypeString(void) const { return "null"; }
302
303 bool isa(object_type otype);
304
305 void _setVS_fps(double _vs);
306 void _setAltitude(double _alt);
307 void _setLongitude(double longitude);
308 void _setLatitude(double latitude);
309 void _setSubID(int s);
310
311 double _getAltitudeAGL(SGGeod inpos, double start);
312
313 double _getVS_fps() const;
314 double _getAltitude() const;
315 double _getLongitude() const;
316 double _getLatitude() const;
317 double _getElevationFt() const;
318 double _getRdot() const;
319 double _getH_offset() const;
320 double _getV_offset() const;
321 double _getX_shift() const;
322 double _getY_shift() const;
323 double _getRotation() const;
324 double _getSpeed() const;
325 double _getRoll() const;
326 double _getPitch() const;
327 double _getHeading() const;
328 double _get_speed_east_fps() const;
329 double _get_speed_north_fps() const;
330 double _get_SubPath() const;
331 double _getImpactLat() const;
332 double _getImpactLon() const;
333 double _getImpactElevFt() const;
334 double _getImpactHdg() const;
335 double _getImpactPitch() const;
336 double _getImpactRoll() const;
337 double _getImpactSpeed() const;
338 double _getXOffset() const;
339 double _getYOffset() const;
340 double _getZOffset() const;
341
342 bool _getServiceable() const;
343 bool _getFirstTime() const;
345 bool _getImpactData();
346 bool _getCollisionData();
347 bool _getExpiryData();
348
349 SGPropertyNode* _getProps() const;
350
351 const char* _getPath() const;
352 const char* _getSMPath() const;
353 const char* _getCallsign() const;
354 const char* _getTriggerNode() const;
355 const char* _getName() const;
356 const char* _getSubmodel() const;
357 int _getFallbackModelIndex() const;
358
359 static const double e;
360 static const double lbs_to_slugs;
361
362 double _getRange() const { return range; }
363 double _getBearing() const { return bearing; }
364
365 static bool _isNight();
366
367 const std::string& getCallSign() const { return _callsign; }
369};
370
371typedef SGSharedPtr<FGAIBase> FGAIBasePtr;
372
373inline void FGAIBase::setManager(FGAIManager* mgr, SGPropertyNode* p)
374{
375 manager = mgr;
376 props = p;
377}
378
379inline void FGAIBase::setPath(const char* model)
380{
381 model_path.append(model);
382}
383
384inline void FGAIBase::setPathLowres(std::string model)
385{
386 model_path_lowres.append(model);
387}
388
389inline void FGAIBase::setFallbackModelIndex(const int i)
390{
392}
393
394inline void FGAIBase::setSMPath(const std::string& p)
395{
396 _path = p;
397}
398
399inline void FGAIBase::setServiceable(bool s)
400{
401 serviceable = s;
402}
403
404inline void FGAIBase::setSpeed(double speed_KTAS)
405{
406 speed = tgt_speed = speed_KTAS;
407}
408
409inline void FGAIBase::setRadius(double radius)
410{
411 turn_radius_ft = radius;
412}
413
414inline void FGAIBase::setHeading(double heading)
415{
416 hdg = tgt_heading = heading;
417}
418
419inline void FGAIBase::setAltitude(double alt_ft)
420{
421 altitude_ft = tgt_altitude_ft = alt_ft;
422 pos.setElevationFt(altitude_ft);
423}
424
425inline void FGAIBase::setAltitudeAGL(double alt_ft)
426{
427 altitude_agl_ft = alt_ft;
428}
429
430inline void FGAIBase::setBank(double bank)
431{
432 roll = tgt_roll = bank;
433 no_roll = false;
434}
435
436inline void FGAIBase::setPitch(double newpitch)
437{
438 pitch = tgt_pitch = newpitch;
439}
440
442{
443 pos.setLongitudeDeg(longitude);
444}
445
447{
448 pos.setLatitudeDeg(latitude);
449}
450
451inline void FGAIBase::setCallSign(const std::string& s)
452{
453 _callsign = s;
454}
455
456inline void FGAIBase::setXoffset(double x)
457{
458 _x_offset = x;
459}
460
461inline void FGAIBase::setYoffset(double y)
462{
463 _y_offset = y;
464}
465
466inline void FGAIBase::setZoffset(double z)
467{
468 _z_offset = z;
469}
470
471inline void FGAIBase::setPitchoffset(double p)
472{
474}
475
476inline void FGAIBase::setRolloffset(double r)
477{
478 _roll_offset = r;
479}
480
481inline void FGAIBase::setYawoffset(double y)
482{
483 _yaw_offset = y;
484}
485
486inline void FGAIBase::setParentName(const std::string& p)
487{
488 _parent = p;
489}
490
491inline void FGAIBase::setName(const std::string& n)
492{
493 _name = n;
494}
495
496inline void FGAIBase::setCollisionLength(int length)
497{
498 collisionLength = length;
499}
500
501inline void FGAIBase::setCollisionHeight(int height)
502{
503 collisionHeight = height;
504}
505
506inline void FGAIBase::setDie(bool die) { delete_me = die; }
507
508inline bool FGAIBase::getDie() { return delete_me; }
509
510inline FGAIBase::object_type FGAIBase::getType() { return _otype; }
511
512inline void FGAIBase::calcRangeBearing(double lat, double lon, double lat2, double lon2,
513 double& range, double& bearing) const
514{
515 // calculate the bearing and range of the second pos from the first
516 double az2, distance;
517 geo_inverse_wgs_84(lat, lon, lat2, lon2, &bearing, &az2, &distance);
518 range = distance * SG_METER_TO_NM;
519}
520
521inline double FGAIBase::calcRelBearingDeg(double bearing, double heading)
522{
523 double angle = bearing - heading;
524 SG_NORMALIZE_RANGE(angle, -180.0, 180.0);
525 return angle;
526}
527
528inline double FGAIBase::calcTrueBearingDeg(double bearing, double heading)
529{
530 double angle = bearing + heading;
531 SG_NORMALIZE_RANGE(angle, 0.0, 360.0);
532 return angle;
533}
534
536{
537 double angle = bearing - 180;
538 SG_NORMALIZE_RANGE(angle, 0.0, 360.0);
539 return angle;
540}
541
542inline void FGAIBase::setMaxSpeed(double m)
543{
544 _max_speed = m;
545}
546
547/*
548 * Default height and lengths for AI submodel collision detection.
549 * The difference in height is used first and then the range must be within
550 * the value specifed in the length field. This effective chops the top and
551 * bottom off the circle - but does not take into account the orientation of the
552 * AI model; so this algorithm is fast but fairly inaccurate.
553 *
554 * Default values:
555 * +---------------+-------------+------------+
556 * | Type | Height(m) | Length(m) |
557 * +---------------+-------------+------------+
558 * | Null | 0 | 0 |
559 * | Aircraft | 50 | 100 |
560 * | Ship | 100 | 200 |
561 * | Carrier | 250 | 750 |
562 * | Ballistic | 0 | 0 |
563 * | Rocket | 100 | 50 |
564 * | Storm | 0 | 0 |
565 * | Thermal | 0 | 0 |
566 * | Static | 50 | 200 |
567 * | Wingman | 50 | 100 |
568 * | GroundVehicle | 20 | 40 |
569 * | Escort | 100 | 200 |
570 * | Multiplayer | 50 | 100 |
571 * +---------------+-------------+------------+
572 */
573const static double tgt_ht[] = {0, 50, 100, 250, 0, 100, 0, 0, 50, 50, 20, 100, 50};
574const static double tgt_length[] = {0, 100, 200, 750, 0, 50, 0, 0, 200, 100, 40, 200, 100};
575
577{
578 if (collisionHeight == 0)
579 return tgt_ht[static_cast<int>(_otype)];
580
581 return collisionHeight;
582}
584{
585 if (collisionLength == 0)
586 return tgt_length[static_cast<int>(_otype)];
587
588 return collisionLength;
589}
double latitude
Definition ADA.cxx:53
double longitude
Definition ADA.cxx:54
SGSharedPtr< FGAIBase > FGAIBasePtr
Definition AIBase.hxx:371
static const double tgt_ht[]
Definition AIBase.hxx:573
static const double tgt_length[]
Definition AIBase.hxx:574
#define p(x)
#define i(x)
std::string _parent
Definition AIBase.hxx:191
double _getAltitudeAGL(SGGeod inpos, double start)
Definition AIBase.cxx:1030
bool _installed
Definition AIBase.hxx:259
void setSpeed(double speed_KTAS)
Definition AIBase.hxx:404
double _getRotation() const
void setName(const std::string &n)
Definition AIBase.hxx:491
double _get_SubPath() const
void setMaxSpeed(double kts)
Definition AIBase.hxx:542
SGPropertyNode * getPositionFromNode(SGPropertyNode *scFileNode, const std::string &key, SGVec3d &position)
Definition AIBase.cxx:910
int _subID
Definition AIBase.hxx:260
double speed_fps
Definition AIBase.hxx:217
double tgt_pitch
Definition AIBase.hxx:233
double _getBearing() const
Definition AIBase.hxx:363
object_type getType()
Definition AIBase.hxx:510
simgear::TiedPropertyList _tiedProperties
Definition AIBase.hxx:203
double tgt_heading
Definition AIBase.hxx:229
static const double lbs_to_slugs
Definition AIBase.hxx:360
double altitude_ft
Definition AIBase.hxx:218
double _getZOffset() const
Definition AIBase.cxx:1124
double turn_radius_ft
Definition AIBase.hxx:222
double vert_offset
Definition AIBase.hxx:244
bool serviceable
Definition AIBase.hxx:258
void setFallbackModelIndex(const int i)
Definition AIBase.hxx:389
SGGeod pos
Definition AIBase.hxx:212
void setLatitude(double latitude)
Definition AIBase.hxx:446
bool _getExpiryData()
Definition AIBase.cxx:1056
virtual void readFromScenario(SGPropertyNode *scFileNode)
Definition AIBase.cxx:249
double tgt_yaw
Definition AIBase.hxx:234
double _yaw_offset
Definition AIBase.hxx:180
virtual double getDefaultModelRadius()
Definition AIBase.hxx:77
int _fallback_model_index
Definition AIBase.hxx:252
bool _getImpact()
double _getElevationFt() const
Definition AIBase.cxx:1002
double ht_diff
Definition AIBase.hxx:248
std::string _callsign
Definition AIBase.hxx:188
double getTrueHeadingDeg() const
Definition AIBase.hxx:152
virtual void unbind()
Definition AIBase.cxx:800
double _getYOffset() const
Definition AIBase.cxx:1120
void setDie(bool die)
Definition AIBase.hxx:506
SGVec3d getCartPos() const
Definition AIBase.cxx:899
const std::string & getCallSign() const
Definition AIBase.hxx:367
void setCallSign(const std::string &)
Definition AIBase.hxx:451
void setImpactElev(double e)
double _getH_offset() const
void setParentName(const std::string &p)
Definition AIBase.hxx:486
double _getLatitude() const
Definition AIBase.cxx:998
void _setAltitude(double _alt)
Definition AIBase.cxx:1044
SGVec3d getCartPosAt(const SGVec3d &off) const
Definition AIBase.cxx:881
void setYoffset(double y_offset)
Definition AIBase.hxx:461
std::string _name
Definition AIBase.hxx:190
SGPropertyNode * _getProps() const
Definition AIBase.cxx:1040
double _getCartPosX() const
Definition AIBase.cxx:926
double _get_speed_north_fps() const
Definition AIBase.cxx:1018
int getID() const
Definition AIBase.cxx:1092
int collisionHeight
Definition AIBase.hxx:184
bool isValid() const
Definition AIBase.cxx:1166
void setFlightPlan(std::unique_ptr< FGAIFlightPlan > f)
Definition AIBase.cxx:1161
virtual int getCollisionLength() const
Definition AIBase.hxx:583
bool invisible
Definition AIBase.hxx:256
double _impact_elev
Definition AIBase.hxx:272
void setPathLowres(std::string model)
Definition AIBase.hxx:384
bool _impact_reported
Definition AIBase.hxx:266
int _getSubID() const
Definition AIBase.cxx:1096
void updateLOD()
update LOD properties of the model
Definition AIBase.cxx:388
void setCollisionLength(int range)
Definition AIBase.hxx:496
FGAIBase(object_type ot, bool enableHot)
Definition AIBase.cxx:146
double rdot
Definition AIBase.hxx:242
void setServiceable(bool serviceable)
Definition AIBase.hxx:399
bool in_range
Definition AIBase.hxx:238
void setCollisionData(bool i, double lat, double lon, double elev)
bool modelLoaded() const
Definition AIBase.cxx:1177
std::string model_path
Definition AIBase.hxx:250
bool _expiry_reported
Definition AIBase.hxx:268
bool _getFirstTime() const
double _pitch_offset
Definition AIBase.hxx:178
const char * _getSMPath() const
Definition AIBase.cxx:1132
double _impact_pitch
Definition AIBase.hxx:274
double _getImpactElevFt() const
Definition AIBase.cxx:1072
bool delete_me
Definition AIBase.hxx:255
bool _getImpactData()
Definition AIBase.cxx:1060
bool getGroundElevationM(const SGGeod &pos, double &elev, const simgear::BVHMaterial **material) const
Definition AIBase.cxx:904
void _setSubID(int s)
Definition AIBase.cxx:949
void setBank(double bank)
Definition AIBase.hxx:430
SGPropertyNode_ptr _selected_ac
Definition AIBase.hxx:204
double _getV_offset() const
SGGeod getGeodPos() const
Definition AIBase.cxx:1182
double _x_offset
Definition AIBase.hxx:174
void calcRangeBearing(double lat, double lon, double lat2, double lon2, double &range, double &bearing) const
Definition AIBase.hxx:512
void updateInterior()
Definition AIBase.cxx:365
double _getCartPosY() const
Definition AIBase.cxx:931
double horiz_offset
Definition AIBase.hxx:243
virtual void initModel()
Definition AIBase.cxx:687
double _getPitch() const
Definition AIBase.cxx:1108
double _getHeading() const
Definition AIBase.cxx:1112
std::string _scenarioPath
Definition AIBase.hxx:192
virtual bool init(ModelSearchOrder searchOrder)
Definition AIBase.cxx:633
void setRadius(double radius)
Definition AIBase.hxx:409
double _getImpactHdg() const
Definition AIBase.cxx:1084
virtual int getCollisionHeight() const
Definition AIBase.hxx:576
void setAltitude(double altitude_ft)
Definition AIBase.hxx:419
virtual void update(double dt)
Definition AIBase.cxx:294
double speed
Definition AIBase.hxx:216
double altitude_agl_ft
Definition AIBase.hxx:223
double bearing
Definition AIBase.hxx:239
double _getXOffset() const
Definition AIBase.cxx:1116
double _getSpeed() const
Definition AIBase.cxx:1100
std::unique_ptr< FGAIFlightPlan > fp
Definition AIBase.hxx:264
static bool _isNight()
Definition AIBase.cxx:1048
void setImpactLon(double lon)
void setAltitudeAGL(double altitude_agl_ft)
Definition AIBase.hxx:425
double _impact_speed
Definition AIBase.hxx:276
bool _collision_reported
Definition AIBase.hxx:267
double _getRdot() const
Definition AIBase.cxx:1006
double UpdateRadar(FGAIManager *manager)
Definition AIBase.cxx:819
void setGeodPos(const SGGeod &pos)
Definition AIBase.cxx:1187
double _getImpactRoll() const
Definition AIBase.cxx:1080
void setZoffset(double z_offset)
Definition AIBase.hxx:466
static int _newAIModelID()
Definition AIBase.cxx:1152
double range
Definition AIBase.hxx:241
double _impact_roll
Definition AIBase.hxx:275
double _getAltitude() const
Definition AIBase.cxx:1026
double _getCartPosZ() const
Definition AIBase.cxx:936
SGPropertyNode_ptr model_removed
Definition AIBase.hxx:208
bool isa(object_type otype)
Definition AIBase.cxx:709
double _getLongitude() const
Definition AIBase.cxx:994
void _setLatitude(double latitude)
Definition AIBase.cxx:945
bool setParentNode()
Definition AIBase.cxx:953
double vs_fps
Definition AIBase.hxx:219
const char * _getName() const
Definition AIBase.cxx:1136
double calcTrueBearingDeg(double bearing, double heading)
Definition AIBase.hxx:528
SGPropertyNode_ptr trigger_node
Definition AIBase.hxx:206
double hdg
Definition AIBase.hxx:213
double elevation
Definition AIBase.hxx:240
void setImpactData(bool d)
const char * _getCallsign() const
Definition AIBase.cxx:1140
double _getRange() const
Definition AIBase.hxx:362
void Transform()
Definition AIBase.cxx:518
double _impact_lat
Definition AIBase.hxx:270
double _max_speed
Definition AIBase.hxx:182
int _getFallbackModelIndex() const
Definition AIBase.cxx:1148
double _impact_lon
Definition AIBase.hxx:271
double _getY_shift() const
bool _getCollisionData()
Definition AIBase.cxx:1052
double x_shift
Definition AIBase.hxx:245
void setManager(FGAIManager *mgr, SGPropertyNode *p)
Definition AIBase.hxx:373
static const double e
Definition AIBase.hxx:359
void setSMPath(const std::string &p)
Definition AIBase.hxx:394
double tgt_speed
Definition AIBase.hxx:231
double _z_offset
Definition AIBase.hxx:176
double pitch
Definition AIBase.hxx:215
SGModelPlacement aip
Definition AIBase.hxx:253
std::string _path
Definition AIBase.hxx:187
const char * _getPath() const
Definition AIBase.cxx:1128
double ft_per_deg_lon
Definition AIBase.hxx:225
void setLongitude(double longitude)
Definition AIBase.hxx:441
void setPath(const char *model)
Definition AIBase.hxx:379
double y_shift
Definition AIBase.hxx:246
void removeSoundFx()
Definition AIBase.cxx:808
double _getX_shift() const
void setScenarioPath(const std::string &scenarioPath)
Definition AIBase.cxx:244
double speed_east_deg_sec
Definition AIBase.hxx:221
int collisionLength
Definition AIBase.hxx:185
ModelSearchOrder
Definition AIBase.hxx:63
std::string _submodel
Definition AIBase.hxx:189
void setCollisionHeight(int height)
Definition AIBase.hxx:501
osg::LOD * getSceneBranch() const
Definition AIBase.cxx:1172
virtual std::string_view getTypeString(void) const
Definition AIBase.hxx:301
double calcRecipBearingDeg(double bearing)
Definition AIBase.hxx:535
ModelSearchOrder getSearchOrder() const
Definition AIBase.hxx:368
double _y_offset
Definition AIBase.hxx:175
double calcRelBearingDeg(double bearing, double heading)
Definition AIBase.hxx:521
void setImpactLat(double lat)
double _getImpactPitch() const
Definition AIBase.cxx:1076
bool _getServiceable() const
Definition AIBase.cxx:1036
double ft_per_deg_lat
Definition AIBase.hxx:226
double _getImpactLon() const
Definition AIBase.cxx:1068
bool getDie()
Definition AIBase.hxx:508
void setXoffset(double x_offset)
Definition AIBase.hxx:456
double _elevation_m
Definition AIBase.hxx:172
double life
Definition AIBase.hxx:262
std::string model_path_lowres
Definition AIBase.hxx:251
void removeModel()
Cleanly remove the model and let the scenery database pager do the clean-up work.
Definition AIBase.cxx:218
void setYawoffset(double z_offset)
Definition AIBase.hxx:481
double tgt_altitude_ft
Definition AIBase.hxx:230
double _impact_hdg
Definition AIBase.hxx:273
const char * _getTriggerNode() const
const char * _getSubmodel() const
Definition AIBase.cxx:1144
void _setVS_fps(double _vs)
Definition AIBase.cxx:1022
double rotation
Definition AIBase.hxx:247
void setHeading(double heading)
Definition AIBase.hxx:414
double _getRoll() const
Definition AIBase.cxx:1104
void _setLongitude(double longitude)
Definition AIBase.cxx:941
virtual ~FGAIBase()
Definition AIBase.cxx:200
double speed_north_deg_sec
Definition AIBase.hxx:220
double _get_speed_east_fps() const
Definition AIBase.cxx:1014
double _getImpactSpeed() const
Definition AIBase.cxx:1088
double _getVS_fps() const
Definition AIBase.cxx:1010
void setPitch(double newpitch)
Definition AIBase.hxx:436
double tgt_roll
Definition AIBase.hxx:232
double _roll_offset
Definition AIBase.hxx:179
virtual void reinit()
Definition AIBase.hxx:74
ModelSearchOrder _searchOrder
Definition AIBase.hxx:278
SGPropertyNode_ptr replay_time
Definition AIBase.hxx:207
double roll
Definition AIBase.hxx:214
void tie(const char *aRelPath, const SGRawValue< T > &aRawValue)
Tied-properties helper, record nodes which are tied for easy un-tie-ing.
Definition AIBase.hxx:198
SGPropertyNode_ptr props
Definition AIBase.hxx:205
FGAIManager * manager
Definition AIBase.hxx:209
virtual void bind()
Definition AIBase.cxx:713
void setPitchoffset(double x_offset)
Definition AIBase.hxx:471
double tgt_vs
Definition AIBase.hxx:235
void setRolloffset(double y_offset)
Definition AIBase.hxx:476
double _getImpactLat() const
Definition AIBase.cxx:1064
bool no_roll
Definition AIBase.hxx:257
Generator for FlightGear model sound effects.
Definition fg_fx.hxx:48
Definition AIBase.hxx:25