FlightGear next
FGAIAircraft Class Reference

#include <AIAircraft.hxx>

Inherits FGAIBaseAircraft.

Inherited by FGAITanker.

Public Member Functions

 FGAIAircraft (FGAISchedule *ref=0)
 
virtual ~FGAIAircraft ()
 
std::string_view getTypeString (void) const override
 
void readFromScenario (SGPropertyNode *scFileNode) override
 
void bind () override
 
void update (double dt) override
 
void unbind () override
 
void setPerformance (const std::string &acType, const std::string &perfString)
 
void setFlightPlan (const std::string &fp, bool repat=false)
 
FGAIFlightPlanGetFlightPlan () const
 
void ProcessFlightPlan (double dt, time_t now)
 
time_t checkForArrivalTime (const std::string &wptName)
 
time_t calcDeparture ()
 
void AccelTo (double speed)
 
void PitchTo (double angle)
 
void RollTo (double angle)
 
void ClimbTo (double altitude)
 
void TurnTo (double heading)
 
void getGroundElev (double dt)
 
void doGroundAltitude ()
 
bool loadNextLeg (double dist=0)
 
void resetPositionFromFlightPlan ()
 
double getBearing (double crse)
 Returns a normalised bearing.
 
void setAcType (const std::string &ac)
 
const std::string & getAcType () const
 
const std::string & getCompany () const
 
void setCompany (const std::string &comp)
 
void announcePositionToController ()
 
void processATC (const FGATCInstruction &instruction)
 Process ATC instructions and report back.
 
void setTaxiClearanceRequest (bool arg)
 
bool getTaxiClearanceRequest ()
 
FGAISchedulegetTrafficRef ()
 
void setTrafficRef (FGAISchedule *ref)
 
void scheduleForATCTowerRunwayControl ()
 
const std::string & GetTransponderCode ()
 
void SetTransponderCode (const std::string &tc)
 
PerformanceDatagetPerformance ()
 
bool onGround () const
 
double getSpeed () const
 
double getRoll () const
 
double getPitch () const
 
double getAltitude () const
 
double getVerticalSpeedFPM () const
 
double altitudeAGL () const
 
double airspeed () const
 
const std::string & atGate ()
 
void checkTcas ()
 
double calcVerticalSpeed (double vert_ft, double dist_m, double speed, double error)
 
FGATCControllergetATCController ()
 
void clearATCController ()
 
bool isBlockedBy (FGAIAircraft *other)
 
void dumpCSVHeader (const std::unique_ptr< sg_ofstream > &o)
 
void dumpCSV (const std::unique_ptr< sg_ofstream > &o, int lineIndex)
 
- Public Member Functions inherited from FGAIBaseAircraft
 FGAIBaseAircraft (object_type otype=object_type::otAircraft)
 
void bind () override
 
void GearPos (double pos)
 
void FlapsPos (double pos)
 
void SpoilerPos (double pos)
 
void SpeedBrakePos (double pos)
 
void BeaconLight (bool light)
 
void LandingLight (bool light)
 
void NavLight (bool light)
 
void StrobeLight (bool light)
 
void TaxiLight (bool light)
 
void CabinLight (bool light)
 
double GearPos () const
 
double FlapsPos () const
 
double SpoilerPos () const
 
double SpeedBrakePos () const
 
bool BeaconLight () const
 
bool LandingLight () const
 
bool NavLight () const
 
bool StrobeLight () const
 
bool TaxiLight () const
 
bool CabinLight () const
 
- Public Member Functions inherited from FGAIBase
 FGAIBase (object_type ot, bool enableHot)
 
virtual ~FGAIBase ()
 
virtual bool init (ModelSearchOrder searchOrder)
 
virtual void initModel ()
 
virtual void reinit ()
 
virtual double getDefaultModelRadius ()
 
void updateLOD ()
 update LOD properties of the model
 
void updateInterior ()
 
void setManager (FGAIManager *mgr, SGPropertyNode *p)
 
void setPath (const char *model)
 
void setPathLowres (std::string model)
 
void setFallbackModelIndex (const int i)
 
void setSMPath (const std::string &p)
 
void setCallSign (const std::string &)
 
void setSpeed (double speed_KTAS)
 
void setMaxSpeed (double kts)
 
void setAltitude (double altitude_ft)
 
void setAltitudeAGL (double altitude_agl_ft)
 
void setHeading (double heading)
 
void setLatitude (double latitude)
 
void setLongitude (double longitude)
 
void setBank (double bank)
 
void setPitch (double newpitch)
 
void setRadius (double radius)
 
void setXoffset (double x_offset)
 
void setYoffset (double y_offset)
 
void setZoffset (double z_offset)
 
void setPitchoffset (double x_offset)
 
void setRolloffset (double y_offset)
 
void setYawoffset (double z_offset)
 
void setServiceable (bool serviceable)
 
bool getDie ()
 
void setDie (bool die)
 
bool isValid () const
 
void setCollisionData (bool i, double lat, double lon, double elev)
 
void setImpactData (bool d)
 
void setImpactLat (double lat)
 
void setImpactLon (double lon)
 
void setImpactElev (double e)
 
void setName (const std::string &n)
 
bool setParentNode ()
 
void setParentName (const std::string &p)
 
void setCollisionLength (int range)
 
void setCollisionHeight (int height)
 
void calcRangeBearing (double lat, double lon, double lat2, double lon2, double &range, double &bearing) const
 
double calcRelBearingDeg (double bearing, double heading)
 
double calcTrueBearingDeg (double bearing, double heading)
 
double calcRecipBearingDeg (double bearing)
 
int getID () const
 
int _getSubID () const
 
void setFlightPlan (std::unique_ptr< FGAIFlightPlan > f)
 
SGGeod getGeodPos () const
 
void setGeodPos (const SGGeod &pos)
 
SGVec3d getCartPosAt (const SGVec3d &off) const
 
SGVec3d getCartPos () const
 
bool getGroundElevationM (const SGGeod &pos, double &elev, const simgear::BVHMaterial **material) const
 
SGPropertyNode * getPositionFromNode (SGPropertyNode *scFileNode, const std::string &key, SGVec3d &position)
 
double getTrueHeadingDeg () const
 
double _getCartPosX () const
 
double _getCartPosY () const
 
double _getCartPosZ () const
 
osg::LOD * getSceneBranch () const
 
virtual int getCollisionHeight () const
 
virtual int getCollisionLength () const
 
bool modelLoaded () const
 
void setScenarioPath (const std::string &scenarioPath)
 
object_type getType ()
 
bool isa (object_type otype)
 
void _setVS_fps (double _vs)
 
void _setAltitude (double _alt)
 
void _setLongitude (double longitude)
 
void _setLatitude (double latitude)
 
void _setSubID (int s)
 
double _getAltitudeAGL (SGGeod inpos, double start)
 
double _getVS_fps () const
 
double _getAltitude () const
 
double _getLongitude () const
 
double _getLatitude () const
 
double _getElevationFt () const
 
double _getRdot () const
 
double _getH_offset () const
 
double _getV_offset () const
 
double _getX_shift () const
 
double _getY_shift () const
 
double _getRotation () const
 
double _getSpeed () const
 
double _getRoll () const
 
double _getPitch () const
 
double _getHeading () const
 
double _get_speed_east_fps () const
 
double _get_speed_north_fps () const
 
double _get_SubPath () const
 
double _getImpactLat () const
 
double _getImpactLon () const
 
double _getImpactElevFt () const
 
double _getImpactHdg () const
 
double _getImpactPitch () const
 
double _getImpactRoll () const
 
double _getImpactSpeed () const
 
double _getXOffset () const
 
double _getYOffset () const
 
double _getZOffset () const
 
bool _getServiceable () const
 
bool _getFirstTime () const
 
bool _getImpact ()
 
bool _getImpactData ()
 
bool _getCollisionData ()
 
bool _getExpiryData ()
 
SGPropertyNode * _getProps () const
 
const char * _getPath () const
 
const char * _getSMPath () const
 
const char * _getCallsign () const
 
const char * _getTriggerNode () const
 
const char * _getName () const
 
const char * _getSubmodel () const
 
int _getFallbackModelIndex () const
 
double _getRange () const
 
double _getBearing () const
 
const std::string & getCallSign () const
 
ModelSearchOrder getSearchOrder () const
 

Public Attributes

std::string acwakecategory
 

Protected Member Functions

void Run (double dt)
 
- Protected Member Functions inherited from FGAIBase
template<typename T>
void tie (const char *aRelPath, const SGRawValue< T > &aRawValue)
 Tied-properties helper, record nodes which are tied for easy un-tie-ing.
 
void Transform ()
 
double UpdateRadar (FGAIManager *manager)
 
void removeModel ()
 Cleanly remove the model and let the scenery database pager do the clean-up work.
 
void removeSoundFx ()
 

Additional Inherited Members

- Public Types inherited from FGAIBase
enum class  object_type {
  otNull = 0 , otAircraft , otShip , otCarrier ,
  otBallistic , otRocket , otStorm , otThermal ,
  otStatic , otWingman , otGroundVehicle , otEscort ,
  otMultiplayer , MAX_OBJECTS
}
 
enum class  ModelSearchOrder { DATA_ONLY , PREFER_AI , PREFER_DATA }
 
- Static Public Member Functions inherited from FGAIBase
static bool _isNight ()
 
- Static Public Attributes inherited from FGAIBase
static const double e = 2.71828183
 
static const double lbs_to_slugs = 0.031080950172
 
- Static Protected Member Functions inherited from FGAIBase
static int _newAIModelID ()
 
- Protected Attributes inherited from FGAIBaseAircraft
double m_gearPos
 
double m_flapsPos
 
double m_spoilerPos
 
double m_speedbrakePos
 
bool m_beaconLight
 
bool m_cabinLight
 
bool m_landingLight
 
bool m_navLight
 
bool m_strobeLight
 
bool m_taxiLight
 
- Protected Attributes inherited from FGAIBase
double _elevation_m = 0.0
 
double _x_offset
 
double _y_offset
 
double _z_offset
 
double _pitch_offset
 
double _roll_offset
 
double _yaw_offset
 
double _max_speed = 300.0
 
int collisionHeight = 0
 
int collisionLength = 0
 
std::string _path
 
std::string _callsign
 
std::string _submodel
 
std::string _name
 
std::string _parent
 
std::string _scenarioPath
 
simgear::TiedPropertyList _tiedProperties
 
SGPropertyNode_ptr _selected_ac
 
SGPropertyNode_ptr props
 
SGPropertyNode_ptr trigger_node
 
SGPropertyNode_ptr replay_time
 
SGPropertyNode_ptr model_removed
 
FGAIManagermanager = nullptr
 
SGGeod pos
 
double hdg
 
double roll
 
double pitch
 
double speed
 
double speed_fps = 0.0
 
double altitude_ft
 
double vs_fps
 
double speed_north_deg_sec
 
double speed_east_deg_sec
 
double turn_radius_ft
 
double altitude_agl_ft = 0.0
 
double ft_per_deg_lon
 
double ft_per_deg_lat
 
double tgt_heading
 
double tgt_altitude_ft
 
double tgt_speed
 
double tgt_roll
 
double tgt_pitch
 
double tgt_yaw
 
double tgt_vs
 
bool in_range
 
double bearing
 
double elevation
 
double range
 
double rdot
 
double horiz_offset
 
double vert_offset
 
double x_shift
 
double y_shift
 
double rotation
 
double ht_diff
 
std::string model_path
 
std::string model_path_lowres
 
int _fallback_model_index = 0
 
SGModelPlacement aip
 
bool delete_me
 
bool invisible = false
 
bool no_roll
 
bool serviceable
 
bool _installed = false
 
int _subID = 0
 
double life
 
std::unique_ptr< FGAIFlightPlanfp
 
bool _impact_reported
 
bool _collision_reported
 
bool _expiry_reported
 
double _impact_lat
 
double _impact_lon
 
double _impact_elev
 
double _impact_hdg
 
double _impact_pitch
 
double _impact_roll
 
double _impact_speed
 
ModelSearchOrder _searchOrder = ModelSearchOrder::DATA_ONLY
 

Detailed Description

Definition at line 26 of file AIAircraft.hxx.

Constructor & Destructor Documentation

◆ FGAIAircraft()

FGAIAircraft::FGAIAircraft ( FGAISchedule * ref = 0)
explicit

Definition at line 41 of file AIAircraft.cxx.

◆ ~FGAIAircraft()

FGAIAircraft::~FGAIAircraft ( )
virtual

Definition at line 111 of file AIAircraft.cxx.

Member Function Documentation

◆ AccelTo()

void FGAIAircraft::AccelTo ( double speed)

Definition at line 224 of file AIAircraft.cxx.

◆ airspeed()

double FGAIAircraft::airspeed ( ) const
inline

Definition at line 99 of file AIAircraft.hxx.

◆ altitudeAGL()

double FGAIAircraft::altitudeAGL ( ) const
inline

Definition at line 98 of file AIAircraft.hxx.

◆ announcePositionToController()

void FGAIAircraft::announcePositionToController ( )

Definition at line 679 of file AIAircraft.cxx.

◆ atGate()

const std::string & FGAIAircraft::atGate ( )

Definition at line 1440 of file AIAircraft.cxx.

◆ bind()

void FGAIAircraft::bind ( )
overridevirtual

Reimplemented from FGAIBase.

Reimplemented in FGAITanker.

Definition at line 138 of file AIAircraft.cxx.

◆ calcDeparture()

time_t FGAIAircraft::calcDeparture ( )

Definition at line 1672 of file AIAircraft.cxx.

◆ calcVerticalSpeed()

double FGAIAircraft::calcVerticalSpeed ( double vert_ft,
double dist_m,
double speed,
double error )

Definition at line 480 of file AIAircraft.cxx.

◆ checkForArrivalTime()

time_t FGAIAircraft::checkForArrivalTime ( const std::string & wptName)

Definition at line 1642 of file AIAircraft.cxx.

◆ checkTcas()

void FGAIAircraft::checkTcas ( void )

Definition at line 534 of file AIAircraft.cxx.

◆ clearATCController()

void FGAIAircraft::clearATCController ( )

Definition at line 494 of file AIAircraft.cxx.

◆ ClimbTo()

void FGAIAircraft::ClimbTo ( double altitude)

Definition at line 254 of file AIAircraft.cxx.

◆ doGroundAltitude()

void FGAIAircraft::doGroundAltitude ( )

Definition at line 664 of file AIAircraft.cxx.

◆ dumpCSV()

void FGAIAircraft::dumpCSV ( const std::unique_ptr< sg_ofstream > & o,
int lineIndex )

Definition at line 1784 of file AIAircraft.cxx.

◆ dumpCSVHeader()

void FGAIAircraft::dumpCSVHeader ( const std::unique_ptr< sg_ofstream > & o)

Definition at line 1737 of file AIAircraft.cxx.

◆ getAcType()

const std::string & FGAIAircraft::getAcType ( ) const
inline

Definition at line 73 of file AIAircraft.hxx.

◆ getAltitude()

double FGAIAircraft::getAltitude ( ) const
inline

Definition at line 96 of file AIAircraft.hxx.

◆ getATCController()

FGATCController * FGAIAircraft::getATCController ( )
inline

Definition at line 106 of file AIAircraft.hxx.

◆ getBearing()

double FGAIAircraft::getBearing ( double crse)

Returns a normalised bearing.

Definition at line 1634 of file AIAircraft.cxx.

◆ getCompany()

const std::string & FGAIAircraft::getCompany ( ) const
inline

Definition at line 75 of file AIAircraft.hxx.

◆ GetFlightPlan()

FGAIFlightPlan * FGAIAircraft::GetFlightPlan ( ) const
inline

Definition at line 47 of file AIAircraft.hxx.

◆ getGroundElev()

void FGAIAircraft::getGroundElev ( double dt)

Definition at line 630 of file AIAircraft.cxx.

◆ getPerformance()

PerformanceData * FGAIAircraft::getPerformance ( )
inline

Definition at line 91 of file AIAircraft.hxx.

◆ getPitch()

double FGAIAircraft::getPitch ( ) const
inline

Definition at line 95 of file AIAircraft.hxx.

◆ getRoll()

double FGAIAircraft::getRoll ( ) const
inline

Definition at line 94 of file AIAircraft.hxx.

◆ getSpeed()

double FGAIAircraft::getSpeed ( ) const
inline

Definition at line 93 of file AIAircraft.hxx.

◆ getTaxiClearanceRequest()

bool FGAIAircraft::getTaxiClearanceRequest ( )
inline

Definition at line 82 of file AIAircraft.hxx.

◆ getTrafficRef()

FGAISchedule * FGAIAircraft::getTrafficRef ( )
inline

Definition at line 83 of file AIAircraft.hxx.

◆ GetTransponderCode()

const std::string & FGAIAircraft::GetTransponderCode ( )
inline

Definition at line 87 of file AIAircraft.hxx.

◆ getTypeString()

std::string_view FGAIAircraft::getTypeString ( void ) const
inlineoverridevirtual

Reimplemented from FGAIBase.

Reimplemented in FGAITanker.

Definition at line 32 of file AIAircraft.hxx.

◆ getVerticalSpeedFPM()

double FGAIAircraft::getVerticalSpeedFPM ( ) const
inline

Definition at line 97 of file AIAircraft.hxx.

◆ isBlockedBy()

bool FGAIAircraft::isBlockedBy ( FGAIAircraft * other)

Definition at line 506 of file AIAircraft.cxx.

◆ loadNextLeg()

bool FGAIAircraft::loadNextLeg ( double dist = 0)

Definition at line 568 of file AIAircraft.cxx.

◆ onGround()

bool FGAIAircraft::onGround ( ) const
inline

Definition at line 92 of file AIAircraft.hxx.

◆ PitchTo()

void FGAIAircraft::PitchTo ( double angle)

Definition at line 233 of file AIAircraft.cxx.

◆ processATC()

void FGAIAircraft::processATC ( const FGATCInstruction & instruction)

Process ATC instructions and report back.

Definition at line 798 of file AIAircraft.cxx.

◆ ProcessFlightPlan()

void FGAIAircraft::ProcessFlightPlan ( double dt,
time_t now )

The angle of the next turn.

Definition at line 299 of file AIAircraft.cxx.

◆ readFromScenario()

void FGAIAircraft::readFromScenario ( SGPropertyNode * scFileNode)
overridevirtual

Reimplemented from FGAIBase.

Reimplemented in FGAITanker.

Definition at line 123 of file AIAircraft.cxx.

◆ resetPositionFromFlightPlan()

void FGAIAircraft::resetPositionFromFlightPlan ( )

Definition at line 1602 of file AIAircraft.cxx.

◆ RollTo()

void FGAIAircraft::RollTo ( double angle)

Definition at line 240 of file AIAircraft.cxx.

◆ Run()

void FGAIAircraft::Run ( double dt)
protected

Definition at line 184 of file AIAircraft.cxx.

◆ scheduleForATCTowerRunwayControl()

void FGAIAircraft::scheduleForATCTowerRunwayControl ( )

Definition at line 790 of file AIAircraft.cxx.

◆ setAcType()

void FGAIAircraft::setAcType ( const std::string & ac)
inline

Definition at line 72 of file AIAircraft.hxx.

◆ setCompany()

void FGAIAircraft::setCompany ( const std::string & comp)
inline

Definition at line 76 of file AIAircraft.hxx.

◆ setFlightPlan()

void FGAIAircraft::setFlightPlan ( const std::string & fp,
bool repat = false )

Definition at line 283 of file AIAircraft.cxx.

◆ setPerformance()

void FGAIAircraft::setPerformance ( const std::string & acType,
const std::string & perfString )

Definition at line 171 of file AIAircraft.cxx.

◆ setTaxiClearanceRequest()

void FGAIAircraft::setTaxiClearanceRequest ( bool arg)
inline

Definition at line 81 of file AIAircraft.hxx.

◆ setTrafficRef()

void FGAIAircraft::setTrafficRef ( FGAISchedule * ref)
inline

Definition at line 84 of file AIAircraft.hxx.

◆ SetTransponderCode()

void FGAIAircraft::SetTransponderCode ( const std::string & tc)
inline

Definition at line 88 of file AIAircraft.hxx.

◆ TurnTo()

void FGAIAircraft::TurnTo ( double heading)

Definition at line 261 of file AIAircraft.cxx.

◆ unbind()

void FGAIAircraft::unbind ( )
overridevirtual

Reimplemented from FGAIBase.

Definition at line 165 of file AIAircraft.cxx.

◆ update()

void FGAIAircraft::update ( double dt)
overridevirtual

Reimplemented from FGAIBase.

Definition at line 147 of file AIAircraft.cxx.

Member Data Documentation

◆ acwakecategory

std::string FGAIAircraft::acwakecategory

Definition at line 101 of file AIAircraft.hxx.

◆ finalWptName

std::string FGAIAircraft::finalWptName

Definition at line 225 of file AIAircraft.hxx.

◆ remainingLength

double FGAIAircraft::remainingLength

Definition at line 223 of file AIAircraft.hxx.

◆ startWptName

std::string FGAIAircraft::startWptName

Definition at line 224 of file AIAircraft.hxx.


The documentation for this class was generated from the following files: