FlightGear next
FGAICarrier Class Reference

#include <AICarrier.hxx>

Inherits FGAIShip, and simgear::Emesary::IReceiver.

Public Member Functions

 FGAICarrier ()
 
virtual ~FGAICarrier ()
 
std::string_view getTypeString (void) const override
 
void readFromScenario (SGPropertyNode *scFileNode) override
 
void setSign (const std::string &)
 
void setDeckAltitudeFt (const double altitude_feet)
 
void setTACANChannelID (const std::string &)
 
double getDefaultModelRadius () override
 
void bind () override
 
void UpdateWind (double dt)
 
void setWind_from_east (double fps)
 
void setWind_from_north (double fps)
 
void setMaxLat (double deg)
 
void setMinLat (double deg)
 
void setMaxLong (double deg)
 
void setMinLong (double deg)
 
void setMPControl (bool c)
 
void setAIControl (bool c)
 
void TurnToLaunch ()
 
void TurnToRecover ()
 
void TurnToBase ()
 
void ReturnToBox ()
 
bool OutsideBox ()
 
bool init (ModelSearchOrder searchOrder) override
 
bool getParkPosition (const std::string &id, SGGeod &geodPos, double &hdng, SGVec3d &uvw)
 
bool getFLOLSPositionHeading (SGGeod &pos, double &heading) const
 
double getFLOLFSGlidepathAngleDeg () const
 
double getDeckAltitudeFt () const
 
virtual simgear::Emesary::ReceiptStatus Receive (simgear::Emesary::INotificationPtr n) override
 
- Public Member Functions inherited from FGAIShip
 FGAIShip (object_type ot=object_type::otShip)
 
virtual ~FGAIShip ()=default
 
std::string_view getTypeString (void) const override
 
void readFromScenario (SGPropertyNode *scFileNode) override
 
bool init (ModelSearchOrder searchOrder) override
 
void bind () override
 
void update (double dt) override
 
void reinit () override
 
double getDefaultModelRadius () override
 
void setRudder (float r)
 
void setRoll (double rl)
 
void ProcessFlightPlan (double dt)
 
void AccelTo (double speed)
 
void PitchTo (double angle)
 
void RollTo (double angle)
 
void ClimbTo (double altitude)
 
void TurnTo (double heading)
 
void setCurrName (const std::string &)
 
void setNextName (const std::string &)
 
void setPrevName (const std::string &)
 
void setLeadAngleGain (double g)
 
void setLeadAngleLimit (double l)
 
void setLeadAngleProp (double p)
 
void setRudderConstant (double rc)
 
void setSpeedConstant (double sc)
 
void setFixedTurnRadius (double ft)
 
void setRollFactor (double rf)
 
void setTunnel (bool t)
 
void setInitialTunnel (bool t)
 
void setWPNames ()
 
void setWPPos ()
 
double sign (double x)
 
- Public Member Functions inherited from FGAIBase
 FGAIBase (object_type ot, bool enableHot)
 
virtual ~FGAIBase ()
 
virtual void initModel ()
 
virtual void unbind ()
 
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
 

Static Public Member Functions

static SGSharedPtr< FGAICarrierfindCarrierByNameOrPennant (const std::string &namePennant)
 type-safe wrapper around AIManager::getObjectFromProperty
 
static std::pair< bool, SGGeod > initialPositionForCarrier (const std::string &namePennant)
 
static void extractCarriersFromScenario (SGPropertyNode_ptr xmlNode, SGPropertyNode_ptr scenario)
 for a given scenario node, check for carriers within, and write nodes with names, pennants and initial position into the second argument.
 
- Static Public Member Functions inherited from FGAIBase
static bool _isNight ()
 

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 }
 
- Public Attributes inherited from FGAIShip
bool _hdg_lock = false
 
bool _serviceable = false
 
bool _waiting
 
bool _new_waypoint
 
bool _tunnel
 
bool _initial_tunnel
 
bool _restart
 
double _rudder_constant = 0.0
 
double _speed_constant = 0.0
 
double _hdg_constant
 
double _limit
 
double _elevation_ft
 
double _missed_range = 0.0
 
double _tow_angle
 
double _wait_count = 0.0
 
double _missed_count
 
double _wp_range
 
double _dt_count
 
double _next_run
 
FGAIWaypointprev = nullptr
 
FGAIWaypointcurr = nullptr
 
FGAIWaypointnext = nullptr
 
- Static Public Attributes inherited from FGAIBase
static const double e = 2.71828183
 
static const double lbs_to_slugs = 0.031080950172
 
- 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 ()
 
- Static Protected Member Functions inherited from FGAIBase
static int _newAIModelID ()
 
- 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 25 of file AICarrier.hxx.

Constructor & Destructor Documentation

◆ FGAICarrier()

FGAICarrier::FGAICarrier ( )

Definition at line 28 of file AICarrier.cxx.

◆ ~FGAICarrier()

FGAICarrier::~FGAICarrier ( )
virtual

Definition at line 33 of file AICarrier.cxx.

Member Function Documentation

◆ bind()

void FGAICarrier::bind ( )
overridevirtual

Reimplemented from FGAIBase.

Definition at line 368 of file AICarrier.cxx.

◆ extractCarriersFromScenario()

void FGAICarrier::extractCarriersFromScenario ( SGPropertyNode_ptr xmlNode,
SGPropertyNode_ptr scenario )
static

for a given scenario node, check for carriers within, and write nodes with names, pennants and initial position into the second argument.

This is used to support 'start on a carrier', since we can quickly find the corresponding scenario file to be loaded.

Definition at line 809 of file AICarrier.cxx.

◆ findCarrierByNameOrPennant()

SGSharedPtr< FGAICarrier > FGAICarrier::findCarrierByNameOrPennant ( const std::string & namePennant)
static

type-safe wrapper around AIManager::getObjectFromProperty

Definition at line 790 of file AICarrier.cxx.

◆ getDeckAltitudeFt()

double FGAICarrier::getDeckAltitudeFt ( ) const
inline

Definition at line 77 of file AICarrier.hxx.

◆ getDefaultModelRadius()

double FGAICarrier::getDefaultModelRadius ( )
inlineoverridevirtual

Reimplemented from FGAIBase.

Definition at line 37 of file AICarrier.hxx.

◆ getFLOLFSGlidepathAngleDeg()

double FGAICarrier::getFLOLFSGlidepathAngleDeg ( ) const

Definition at line 499 of file AICarrier.cxx.

◆ getFLOLSPositionHeading()

bool FGAICarrier::getFLOLSPositionHeading ( SGGeod & pos,
double & heading ) const

Definition at line 487 of file AICarrier.cxx.

◆ getParkPosition()

bool FGAICarrier::getParkPosition ( const std::string & id,
SGGeod & geodPos,
double & hdng,
SGVec3d & uvw )

Definition at line 465 of file AICarrier.cxx.

◆ getTypeString()

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

Reimplemented from FGAIBase.

Definition at line 31 of file AICarrier.hxx.

◆ init()

bool FGAICarrier::init ( ModelSearchOrder searchOrder)
overridevirtual

Reimplemented from FGAIBase.

Definition at line 313 of file AICarrier.cxx.

◆ initialPositionForCarrier()

std::pair< bool, SGGeod > FGAICarrier::initialPositionForCarrier ( const std::string & namePennant)
static

Definition at line 756 of file AICarrier.cxx.

◆ OutsideBox()

bool FGAICarrier::OutsideBox ( )

Definition at line 626 of file AICarrier.cxx.

◆ readFromScenario()

void FGAICarrier::readFromScenario ( SGPropertyNode * scFileNode)
overridevirtual

Reimplemented from FGAIBase.

Definition at line 38 of file AICarrier.cxx.

◆ Receive()

simgear::Emesary::ReceiptStatus FGAICarrier::Receive ( simgear::Emesary::INotificationPtr n)
overridevirtual

Definition at line 845 of file AICarrier.cxx.

◆ ReturnToBox()

void FGAICarrier::ReturnToBox ( )

Definition at line 605 of file AICarrier.cxx.

◆ setAIControl()

void FGAICarrier::setAIControl ( bool c)

Definition at line 144 of file AICarrier.cxx.

◆ setDeckAltitudeFt()

void FGAICarrier::setDeckAltitudeFt ( const double altitude_feet)

Definition at line 128 of file AICarrier.cxx.

◆ setMaxLat()

void FGAICarrier::setMaxLat ( double deg)

Definition at line 111 of file AICarrier.cxx.

◆ setMaxLong()

void FGAICarrier::setMaxLong ( double deg)

Definition at line 119 of file AICarrier.cxx.

◆ setMinLat()

void FGAICarrier::setMinLat ( double deg)

Definition at line 115 of file AICarrier.cxx.

◆ setMinLong()

void FGAICarrier::setMinLong ( double deg)

Definition at line 123 of file AICarrier.cxx.

◆ setMPControl()

void FGAICarrier::setMPControl ( bool c)

Definition at line 140 of file AICarrier.cxx.

◆ setSign()

void FGAICarrier::setSign ( const std::string & s)

Definition at line 132 of file AICarrier.cxx.

◆ setTACANChannelID()

void FGAICarrier::setTACANChannelID ( const std::string & id)

Definition at line 136 of file AICarrier.cxx.

◆ setWind_from_east()

void FGAICarrier::setWind_from_east ( double fps)

Definition at line 103 of file AICarrier.cxx.

◆ setWind_from_north()

void FGAICarrier::setWind_from_north ( double fps)

Definition at line 107 of file AICarrier.cxx.

◆ TurnToBase()

void FGAICarrier::TurnToBase ( )

Definition at line 596 of file AICarrier.cxx.

◆ TurnToLaunch()

void FGAICarrier::TurnToLaunch ( )

Definition at line 548 of file AICarrier.cxx.

◆ TurnToRecover()

void FGAICarrier::TurnToRecover ( )

Definition at line 568 of file AICarrier.cxx.

◆ UpdateWind()

void FGAICarrier::UpdateWind ( double dt)

Definition at line 505 of file AICarrier.cxx.


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