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>
71 virtual void update(
double dt);
84 void setPath(
const char* model);
124 void setName(
const std::string& n);
148 const simgear::BVHMaterial** material)
const;
150 SGPropertyNode*
getPositionFromNode(SGPropertyNode* scFileNode,
const std::string& key, SGVec3d& position);
197 template <
typename T>
198 void tie(
const char* aRelPath,
const SGRawValue<T>& aRawValue)
264 std::unique_ptr<FGAIFlightPlan>
fp;
290 bool _initialized =
false;
291 osg::ref_ptr<osg::PagedLOD> _model;
292 osg::ref_ptr<FGAIModelData> _modeldata;
294 SGSharedPtr<FGFX> _fx;
359 static const double e;
516 double az2, distance;
517 geo_inverse_wgs_84(lat, lon, lat2, lon2, &
bearing, &az2, &distance);
518 range = distance * SG_METER_TO_NM;
523 double angle =
bearing - heading;
524 SG_NORMALIZE_RANGE(angle, -180.0, 180.0);
530 double angle =
bearing + heading;
531 SG_NORMALIZE_RANGE(angle, 0.0, 360.0);
538 SG_NORMALIZE_RANGE(angle, 0.0, 360.0);
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};
579 return tgt_ht[
static_cast<int>(_otype)];
SGSharedPtr< FGAIBase > FGAIBasePtr
static const double tgt_ht[]
static const double tgt_length[]
double _getAltitudeAGL(SGGeod inpos, double start)
void setSpeed(double speed_KTAS)
double _getRotation() const
void setName(const std::string &n)
double _get_SubPath() const
void setMaxSpeed(double kts)
SGPropertyNode * getPositionFromNode(SGPropertyNode *scFileNode, const std::string &key, SGVec3d &position)
double _getBearing() const
simgear::TiedPropertyList _tiedProperties
static const double lbs_to_slugs
double _getZOffset() const
void setFallbackModelIndex(const int i)
void setLatitude(double latitude)
virtual void readFromScenario(SGPropertyNode *scFileNode)
virtual double getDefaultModelRadius()
int _fallback_model_index
double _getElevationFt() const
double getTrueHeadingDeg() const
double _getYOffset() const
SGVec3d getCartPos() const
const std::string & getCallSign() const
void setCallSign(const std::string &)
void setImpactElev(double e)
double _getH_offset() const
void setParentName(const std::string &p)
double _getLatitude() const
void _setAltitude(double _alt)
SGVec3d getCartPosAt(const SGVec3d &off) const
void setYoffset(double y_offset)
SGPropertyNode * _getProps() const
double _getCartPosX() const
double _get_speed_north_fps() const
void setFlightPlan(std::unique_ptr< FGAIFlightPlan > f)
virtual int getCollisionLength() const
void setPathLowres(std::string model)
void updateLOD()
update LOD properties of the model
void setCollisionLength(int range)
FGAIBase(object_type ot, bool enableHot)
void setServiceable(bool serviceable)
void setCollisionData(bool i, double lat, double lon, double elev)
bool _getFirstTime() const
const char * _getSMPath() const
double _getImpactElevFt() const
bool getGroundElevationM(const SGGeod &pos, double &elev, const simgear::BVHMaterial **material) const
void setBank(double bank)
SGPropertyNode_ptr _selected_ac
double _getV_offset() const
SGGeod getGeodPos() const
void calcRangeBearing(double lat, double lon, double lat2, double lon2, double &range, double &bearing) const
double _getCartPosY() const
double _getHeading() const
std::string _scenarioPath
virtual bool init(ModelSearchOrder searchOrder)
void setRadius(double radius)
double _getImpactHdg() const
virtual int getCollisionHeight() const
void setAltitude(double altitude_ft)
virtual void update(double dt)
double _getXOffset() const
std::unique_ptr< FGAIFlightPlan > fp
void setImpactLon(double lon)
void setAltitudeAGL(double altitude_agl_ft)
double UpdateRadar(FGAIManager *manager)
void setGeodPos(const SGGeod &pos)
double _getImpactRoll() const
void setZoffset(double z_offset)
static int _newAIModelID()
double _getAltitude() const
double _getCartPosZ() const
SGPropertyNode_ptr model_removed
bool isa(object_type otype)
double _getLongitude() const
void _setLatitude(double latitude)
const char * _getName() const
double calcTrueBearingDeg(double bearing, double heading)
SGPropertyNode_ptr trigger_node
void setImpactData(bool d)
const char * _getCallsign() const
int _getFallbackModelIndex() const
double _getY_shift() const
void setManager(FGAIManager *mgr, SGPropertyNode *p)
void setSMPath(const std::string &p)
const char * _getPath() const
void setLongitude(double longitude)
void setPath(const char *model)
double _getX_shift() const
void setScenarioPath(const std::string &scenarioPath)
double speed_east_deg_sec
void setCollisionHeight(int height)
osg::LOD * getSceneBranch() const
virtual std::string_view getTypeString(void) const
double calcRecipBearingDeg(double bearing)
ModelSearchOrder getSearchOrder() const
double calcRelBearingDeg(double bearing, double heading)
void setImpactLat(double lat)
double _getImpactPitch() const
bool _getServiceable() const
double _getImpactLon() const
void setXoffset(double x_offset)
std::string model_path_lowres
void removeModel()
Cleanly remove the model and let the scenery database pager do the clean-up work.
void setYawoffset(double z_offset)
const char * _getTriggerNode() const
const char * _getSubmodel() const
void _setVS_fps(double _vs)
void setHeading(double heading)
void _setLongitude(double longitude)
double speed_north_deg_sec
double _get_speed_east_fps() const
double _getImpactSpeed() const
double _getVS_fps() const
void setPitch(double newpitch)
ModelSearchOrder _searchOrder
SGPropertyNode_ptr replay_time
void tie(const char *aRelPath, const SGRawValue< T > &aRawValue)
Tied-properties helper, record nodes which are tied for easy un-tie-ing.
void setPitchoffset(double x_offset)
void setRolloffset(double y_offset)
double _getImpactLat() const
Generator for FlightGear model sound effects.