51 #ifndef _XPMPAircraft_h_
52 #define _XPMPAircraft_h_
55 #include "XPLMInstance.h"
56 #include "XPLMCamera.h"
215 std::vector<float>
v;
268 void applyDefaults(
const std::string& _wtc,
bool _bOverwriteAllFields =
true);
355 bool bDestroyInst =
false;
368 Aircraft (
const std::string& _icaoType,
369 const std::string& _icaoAirline,
370 const std::string& _livery,
372 const std::string& _cslId =
"");
391 void Create (
const std::string& _icaoType,
392 const std::string& _icaoAirline,
393 const std::string& _livery,
395 const std::string& _cslId =
"",
406 bool IsRelatedTo (
const std::string& _icaoType)
const;
437 const std::string& _icaoAirline,
438 const std::string& _livery);
510 void SetOnGrnd (
bool on_grnd,
float setTouchDownTime = NAN);
523 void SetLocation (
double lat,
double lon,
double alt_ft,
bool on_grnd,
float setTouchDownTime = NAN) {
529 void SetLocation (
double lat,
double lon,
double alt_ft);
533 void GetLocation (
double& lat,
double& lon,
double& alt_ft)
const;
681 void ContrailRequest (
unsigned num,
unsigned dist_m = 0,
unsigned lifeTime = 0);
695 const float boundsLTRB[4]);
697 void MapDrawIcon (XPLMMapLayerID inLayer,
float acSize);
710 uint64_t
SoundPlay (
const std::string& sndName,
float vol = 1.0f);
811 XPMP2Error (
const char* szFile,
int ln,
const char* szFunc,
const char* szMsg, ...);
814 virtual const char*
what() const noexcept;
Initialization and general control functions for XPMP2.
XPMPTransponderMode mode
current radar mode, if not xpmpTransponderMode_Standby then is plane considered for TCAS display
Definition: XPMPMultiplayer.h:201
unsigned XPMPPlaneID
Unique ID for an aircraft created by a plugin.
Definition: XPMPMultiplayer.h:252
@ xpmpTransponderMode_Standby
transponder is in standby, not currently sending -> aircraft not visible on TCAS
Definition: XPMPMultiplayer.h:189
Textual information of planes to be passed on via shared dataRefs to other plugins.
Definition: XPMPMultiplayer.h:208
defines information about an aircraft visible to radar.
Definition: XPMPMultiplayer.h:198
Actual representation of all aircraft in XPMP2.
Definition: XPMPAircraft.h:178
std::list< XPLMInstanceRef > listContrail
Contrail: list of objects for contrail generation.
Definition: XPMPAircraft.h:250
bool GetLightsBeacon() const
Beacon lights.
Definition: XPMPAircraft.h:583
virtual void UpdatePosition(float _elapsedSinceLastCall, int _flCounter)=0
Called right before updating the aircraft's placement in the world.
SndChTy aSndCh[SND_NUM_EVENTS]
Operational values per sound channel, that is triggered by a standard sound event.
Definition: XPMPAircraft.h:346
float GetGearRatio() const
Gear deploy ratio.
Definition: XPMPAircraft.h:554
void SetLocalLoc(float _x, float _y, float _z)
Sets location in local world coordinates.
Definition: XPMPAircraft.h:536
float GetThrustReversRatio() const
Thrust reversers ratio.
Definition: XPMPAircraft.h:576
float lastDRVal
last observed dataRef value to see if sound is to be triggered
Definition: XPMPAircraft.h:336
std::string label
aircraft label shown in the 3D world next to the plane
Definition: XPMPAircraft.h:218
void SetLightsNav(bool _b)
Navigation lights.
Definition: XPMPAircraft.h:588
float GetNoseWheelAngle() const
Nose Wheel angle in degrees.
Definition: XPMPAircraft.h:556
bool IsRendered() const
Is this plane to be rendered?
Definition: XPMPAircraft.h:480
void SetMass(float _kg)
Mass [kg].
Definition: XPMPAircraft.h:655
float GetVertOfs() const
Vertical offset, ie. the value that needs to be added to drawInfo.y to make the aircraft appear on th...
Definition: Aircraft.cpp:494
float GetSpeedbrakeRatio() const
Speedbrakes deploy ratio.
Definition: XPMPAircraft.h:562
std::string acIcaoType
ICAO aircraft type designator of this plane.
Definition: XPMPAircraft.h:192
float GetRoll() const
roll [degree]
Definition: XPMPAircraft.h:544
bool IsGlider() const
Is this object a glider?
Definition: XPMPAircraft.h:410
CSLModelInfo_t GetModelInfo() const
return an information structure for the CSL model associated with the aircraft
Definition: XPMPAircraft.h:456
XPLMProbeRef hProbe
Y Probe for terrain testing, needed in ground clamping.
Definition: XPMPAircraft.h:309
int GetWakeCat() const
Category between 0=light and 3=Super, derived from WTC.
Definition: Aircraft.cpp:504
void SetSpoilerRatio(float _f)
Spoilers deploy ratio.
Definition: XPMPAircraft.h:561
void MapDrawLabel(XPLMMapLayerID inLayer, float yOfs)
Actually draw the map label.
Definition: Map.cpp:151
bool IsCurrentlyShownAsTcasTarget() const
Is this plane currently also being tracked as a TCAS target, ie. will appear on TCAS?
Definition: XPMPAircraft.h:414
bool IsCurrentlyShownAsAI() const
Is this plane currently also being tracked by X-Plane's classic AI/multiplayer?
Definition: AIMultiplayer.cpp:217
virtual void SetRender(bool _bRender)
Switch rendering of the CSL model on or off.
Definition: Aircraft.cpp:894
float vertOfsRatio
How much of the vertical offset shall be applied? (This allows phasing out the vertical offset in hig...
Definition: XPMPAircraft.h:223
int GetTcasTargetIdx() const
return the current TCAS target index (into sim/cockpit2/tcas/targets), 1-based, -1 if not used
Definition: XPMPAircraft.h:412
int aiPrio
Priority for display in one of the limited number of TCAS target slots.
Definition: XPMPAircraft.h:243
XPMP2::CSLModel * GetModel() const
return a pointer to the CSL model in use (Note: The CSLModel structure is not public....
Definition: XPMPAircraft.h:452
unsigned contrailNum
number of contrails requested
Definition: XPMPAircraft.h:251
void SetEngineRotRpm(float _rpm)
Engine rotation speed [rpm], also sets [rad/s] and engines 1..4.
Definition: Aircraft.cpp:785
float GetEngineRotAngle() const
Engine rotation angle [degree].
Definition: XPMPAircraft.h:603
float GetPropRotAngle() const
Propellor rotation angle [degree].
Definition: XPMPAircraft.h:620
std::string acIcaoAirline
ICAO Airline code of this plane.
Definition: XPMPAircraft.h:193
float GetNoseGearDeflection() const
Vertical nose gear deflection [meter].
Definition: XPMPAircraft.h:590
virtual void ComputeMapLabel()
Put together the map label.
Definition: Map.cpp:165
virtual void SetVisible(bool _bVisible)
Make the plane (in)visible.
Definition: Aircraft.cpp:877
float camDist
Distance to camera in meters (updated internally regularly)
Definition: XPMPAircraft.h:304
virtual std::string GetFlightId() const
Return a value for dataRef .../tcas/target/flight_id.
Definition: Aircraft.cpp:352
float mapX
temporary: map coordinates (NAN = not to be drawn)
Definition: XPMPAircraft.h:314
float camBearing
Bearing from camera in degrees (updated internally regularly)
Definition: XPMPAircraft.h:306
struct XPMP2::Aircraft::wakeTy wake
wake-support data
float v_z
Definition: XPMPAircraft.h:203
bool GetLightsLanding() const
Landing lights.
Definition: XPMPAircraft.h:581
float GetTireRotRpm() const
Tire rotation speed [rpm].
Definition: XPMPAircraft.h:596
unsigned contrailLifeTime
this aircraft's contrail's life time
Definition: XPMPAircraft.h:253
Aircraft()
Default constructor creates an empty, invalid(!) and invisible shell; call XPMP2::Aircraft::Create() ...
Definition: Aircraft.cpp:204
virtual std::string SoundGetName(SoundEventsTy sndEvent, float &volAdj) const
Returns the name of the sound to play per event.
Definition: Sound.cpp:768
uint64_t chnId
id of channel playing the sound currently
Definition: XPMPAircraft.h:335
void ContrailRemove()
Remove all contrail objects.
Definition: Contrail.cpp:102
double alt1s_ft
Definition: XPMPAircraft.h:291
bool GetLightsStrobe() const
Strobe lights.
Definition: XPMPAircraft.h:585
std::list< uint64_t > ChnListTy
List of sound channel ids, also beyond sounds created for SoundEventsTy.
Definition: XPMPAircraft.h:330
float GetEngineRotAngle(size_t idx) const
< Engine rotation angle [degree] for engine idx (1..4)
Definition: XPMPAircraft.h:610
float GetThrustRatio() const
Thrust ratio.
Definition: XPMPAircraft.h:568
void SetGearRatio(float _f)
Gear deploy ratio.
Definition: XPMPAircraft.h:555
float GetSpoilerRatio() const
Spoilers deploy ratio.
Definition: XPMPAircraft.h:560
bool GetTouchDown() const
Moment of touch down.
Definition: XPMPAircraft.h:632
void SetThrustReversRatio(float _f)
Thrust reversers ratio.
Definition: XPMPAircraft.h:577
float GetTireRotAngle() const
Tire rotation angle [degree].
Definition: XPMPAircraft.h:594
float GetCameraBearing() const
Bearing from camera [°].
Definition: XPMPAircraft.h:493
void SetLightsStrobe(bool _b)
Strobe lights.
Definition: XPMPAircraft.h:586
virtual void SetTcasTargetIdx(int _idx)
Define the TCAS target index in use.
Definition: XPMPAircraft.h:769
bool GetLightsTaxi() const
Taxi lights.
Definition: XPMPAircraft.h:579
unsigned contrailDist_m
distance between several contrails and to the aircraft's centerline, in meter
Definition: XPMPAircraft.h:252
SoundEventsTy
Types of sound supported directly by XPMP2.
Definition: XPMPAircraft.h:321
@ SND_FLAPS
Flaps extending/retracting (once per event), bases on GetFlapRatio()
Definition: XPMPAircraft.h:326
@ SND_TIRE
Tires rolling on the ground (continuously while rolling on ground), bases on GetTireRotRpm()
Definition: XPMPAircraft.h:324
@ SND_GEAR
Gear extending/retracting (once per event), bases on GetGearRatio()
Definition: XPMPAircraft.h:325
@ SND_REVERSE_THRUST
Engine sound while reverse thrust (continuously while reversers deployed), bases on GetThrustReversRa...
Definition: XPMPAircraft.h:323
@ SND_ENG
Engine sound (continuously while engine running), bases on GetThrustRatio()
Definition: XPMPAircraft.h:322
@ SND_NUM_EVENTS
Number of events (always last in enum)
Definition: XPMPAircraft.h:327
void SetTireRotRpm(float _rpm)
Definition: XPMPAircraft.h:597
bool bVisible
Shall this plane be drawn at the moment and be visible to TCAS/interfaces?
Definition: XPMPAircraft.h:278
int matchQuality
quality of the match with the CSL model
Definition: XPMPAircraft.h:282
friend size_t AIUpdateTCASTargets()
The modern way: Use TCAS override and update TCAS targets.
Definition: AIMultiplayer.cpp:345
void SetNoseWheelAngle(float _f)
Nose Wheel angle in degrees.
Definition: XPMPAircraft.h:557
XPMPPlaneID GetModeS_ID() const
return the XPMP2 plane id
Definition: XPMPAircraft.h:402
void SetSpeedbrakeRatio(float _f)
Speedbrakes deploy ratio.
Definition: XPMPAircraft.h:563
friend void AIMultiUpdate()
Updates all TCAS target dataRefs, both standard X-Plane, as well as additional shared dataRefs for te...
Definition: AIMultiplayer.cpp:615
bool AssignModel(const std::string &_cslId, CSLModel *_pCSLModel=nullptr)
Assigns the given model.
Definition: Aircraft.cpp:427
void DestroyInstances()
Destroy all instances.
Definition: Aircraft.cpp:700
void SetTireDeflection(float _mtr)
Vertical (main) gear deflection [meter].
Definition: XPMPAircraft.h:593
void SetLightsLanding(bool _b)
Landing lights.
Definition: XPMPAircraft.h:582
uint64_t SoundPlay(const std::string &sndName, float vol=1.0f)
Play a sound; a looping sound plays until explicitely stopped.
Definition: Sound.cpp:718
std::list< XPLMInstanceRef > listInst
X-Plane instance handles for all objects making up the model.
Definition: XPMPAircraft.h:297
bool IsOnGrnd() const
Is the aircraft on the ground?
Definition: XPMPAircraft.h:506
float GetGS_kn() const
Rough estimate of a ground speed based on v_x/z
Definition: XPMPAircraft.h:547
float GetTireDeflection() const
Vertical (main) gear deflection [meter].
Definition: XPMPAircraft.h:592
void SetYokeHeadingRatio(float _f)
Yoke heading ratio.
Definition: XPMPAircraft.h:573
float v_y
Definition: XPMPAircraft.h:203
bool IsRelatedTo(const std::string &_icaoType) const
Is this object "related" to the given ICAO code? (named in the same line in related....
Definition: Aircraft.cpp:340
bool IsInstanciated() const
Are instances created for this aircraft?
Definition: XPMPAircraft.h:483
XPMPPlaneID modeS_id
A plane is uniquely identified by a 24bit number [0x01..0xFFFFFF].
Definition: XPMPAircraft.h:187
void MapPreparePos(XPLMMapProjectionID projection, const float boundsLTRB[4])
Prepare map coordinates.
Definition: Map.cpp:116
int tcasTargetIdx
Which sim/cockpit2/tcas/targets-index does this plane occupy? [1..63], -1 if none.
Definition: XPMPAircraft.h:299
void SetPropRotRpm(float _rpm)
Definition: XPMPAircraft.h:623
void SetFlapRatio(float _f)
Flaps deploy ratio.
Definition: XPMPAircraft.h:559
bool ShowAsAIPlane() const
Is this plane to be drawn on TCAS? (It will if transponder is not switched off)
Definition: XPMPAircraft.h:418
float GetWingArea() const
Wing area [m²].
Definition: XPMPAircraft.h:649
float GetTireRotRad() const
Tire rotation speed [rad/s].
Definition: XPMPAircraft.h:599
void DoMove()
Internal: This puts the instance into XP's sky and makes it move.
Definition: Aircraft.cpp:590
float gearDeflectRatio
By how much of the gear deflection shall the plane's altitude be reduced?
Definition: XPMPAircraft.h:230
void SetLightsBeacon(bool _b)
Beacon lights.
Definition: XPMPAircraft.h:584
virtual float GetLift() const
Lift produced. You should override to blend in/out for take-off/landing, but XPMP2 has no dynamic inf...
Definition: XPMPAircraft.h:659
float GetPropRotRpm() const
Propellor rotation speed [rpm].
Definition: XPMPAircraft.h:622
Aircraft & operator=(const Aircraft &)=delete
Aircraft must not be copied as they reference non-copyable resources like XP instances.
void SoundStop(uint64_t chnId)
Stop a continuously playing sound.
Definition: Sound.cpp:737
void Create(const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="", CSLModel *_pCSLModel=nullptr)
Creates a plane, only a valid operation if object was created using the default constructor.
Definition: Aircraft.cpp:237
void SetPropRotAngle(float _deg)
Propellor rotation angle [degree].
Definition: XPMPAircraft.h:621
void SetSlatRatio(float _f)
Slats deploy ratio.
Definition: XPMPAircraft.h:565
void SetLightsTaxi(bool _b)
Taxi lights.
Definition: XPMPAircraft.h:580
void DoEverySecondUpdates(float now)
Internal: Processes once every second only stuff that doesn't require being computed every flight loo...
Definition: Aircraft.cpp:608
bool IsGroundVehicle() const
Is this object a ground vehicle? (related to glob.carIcaoType)
Definition: Aircraft.cpp:333
static float FlightLoopCB(float, float, int, void *)
Internal: Flight loop callback function controlling update and movement of all planes.
Definition: Aircraft.cpp:510
XPLMDrawInfo_t drawInfo
Holds position (in local coordinates!) and orientation (pitch, heading roll) of the aircraft.
Definition: XPMPAircraft.h:200
float GetYokePitchRatio() const
Yoke pitch ratio.
Definition: XPMPAircraft.h:570
void SetOnGrnd(bool on_grnd, float setTouchDownTime=NAN)
Set if the aircraft is on the ground.
Definition: Aircraft.cpp:729
void SetDrawLabel(bool _b)
Define if this aircraft's label is to be drawn (provided label drawing is enabled globally)
Definition: XPMPAircraft.h:486
int ChangeModel(const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery)
(Potentially) changes the plane's model after doing a new match attempt
Definition: Aircraft.cpp:373
std::vector< float > v
actual dataRef values to be provided to the CSL model
Definition: XPMPAircraft.h:215
float GetFlapRatio() const
Flaps deploy ratio.
Definition: XPMPAircraft.h:558
float v_x
Cartesian velocity in m/s per axis, updated at least once per second.
Definition: XPMPAircraft.h:203
float GetEngineRotRpm(size_t idx) const
< Engine rotation speed [rpm] for engine idx (1..4)
Definition: XPMPAircraft.h:613
float GetEngineRotRad(size_t idx) const
< Engine rotation speed [rad/s] for engine idx (1..4)
Definition: XPMPAircraft.h:616
XPMPInfoTexts_t acInfoTexts
Informational texts passed on via multiplayer shared dataRefs.
Definition: XPMPAircraft.h:274
float GetMass() const
Mass [kg].
Definition: XPMPAircraft.h:654
bool CreateInstances()
Create the instances required to represent the plane, return if successful.
Definition: Aircraft.cpp:663
float prev_y
Definition: XPMPAircraft.h:286
bool bOnGrnd
Is the aircraft on the ground?
Definition: XPMPAircraft.h:206
void SetLocation(double lat, double lon, double alt_ft, bool on_grnd, float setTouchDownTime=NAN)
Converts world coordinates to local coordinates, writes to Aircraft::drawInfo.
Definition: XPMPAircraft.h:523
bool bDrawLabel
Shall this aircraft's label be drawn?
Definition: XPMPAircraft.h:220
const std::string & GetModelName() const
return the name of the CSL model in use
Definition: Aircraft.cpp:484
void UpdateDistBearingCamera(const XPLMCameraPosition_t &posCam)
Internal: Update the plane's distance/bearing from the camera location.
Definition: Aircraft.cpp:652
float GetYokeRollRatio() const
Yoke roll ratio.
Definition: XPMPAircraft.h:574
void ClampToGround()
Clamp to ground: Make sure the plane is not below ground, corrects Aircraft::drawInfo if needed.
Definition: Aircraft.cpp:620
bool bClampToGround
Shall this plane be clamped to ground (ie. never sink below ground)?
Definition: XPMPAircraft.h:237
void ContrailRequest(unsigned num, unsigned dist_m=0, unsigned lifeTime=0)
Request Contrails.
Definition: Contrail.cpp:93
void SetHeading(float _deg)
heading [degree]
Definition: XPMPAircraft.h:543
bool bRender
Shall the CSL model be drawn in 3D world? (if !bRender && bVivile then still visible on TCAS/interfac...
Definition: XPMPAircraft.h:279
double lat1s
ground speed in [kn] based on above v_x/z
Definition: XPMPAircraft.h:291
bool SoundIsMuted() const
Are all sounds currently muted?
Definition: XPMPAircraft.h:724
virtual void SoundRemoveAll()
Remove all sound, e.g. during destruction.
Definition: Sound.cpp:951
void SetWingArea(float _m2)
Wing area [m²].
Definition: XPMPAircraft.h:650
bool bValid
is this object valid? (Will be reset in case of exceptions)
Definition: XPMPAircraft.h:277
void SetTouchDown(bool _b)
Moment of touch down.
Definition: XPMPAircraft.h:633
void SetWingSpan(float _m)
Wing span [m].
Definition: XPMPAircraft.h:647
float prev_x
Definition: XPMPAircraft.h:286
bool ShallDrawLabel() const
Shall this aircraft's label be drawn?
Definition: XPMPAircraft.h:488
void SetNoseGearDeflection(float _mtr)
Vertical nose gear deflection [meter].
Definition: XPMPAircraft.h:591
float GetEngineRotRpm() const
Engine rotation speed [rpm].
Definition: XPMPAircraft.h:605
void MapFindIcon()
Determine which map icon to use for this aircraft.
Definition: Map.cpp:72
float camTimLstUpd
Timestamp of last update of camera dist/bearing.
Definition: XPMPAircraft.h:302
void SetReversDeployRatio(float _f)
Thrust reversers deploy ratio.
Definition: XPMPAircraft.h:630
bool IsValid() const
Is the a/c object valid?
Definition: XPMPAircraft.h:468
float GetEngineRotRad() const
Engine rotation speed [rad/s].
Definition: XPMPAircraft.h:607
void SoundMuteAll(bool bMute)
Mute/Unmute all sounds of the airplane temporarily.
Definition: Sound.cpp:754
void SetYokePitchRatio(float _f)
Yoke pitch ratio.
Definition: XPMPAircraft.h:571
int GetMatchQuality() const
quality of the match with the CSL model
Definition: XPMPAircraft.h:458
XPMPPlaneRadar_t acRadar
Current radar status.
Definition: XPMPAircraft.h:247
float GetWingSpan() const
Wing span [m].
Definition: XPMPAircraft.h:646
void ContrailAutoUpdate()
Internal: (Re)Assess if contrails are to be created.
Definition: Contrail.cpp:209
float volAdj
Volume adjustment, fed from Aircraft::SoundGetName()
Definition: XPMPAircraft.h:337
int acRelGrp
related group, ie. line in related.txt in which this a/c appears, if any
Definition: XPMPAircraft.h:283
void SetPropRotRad(float _rad)
Definition: XPMPAircraft.h:626
float gs_kn
Definition: XPMPAircraft.h:288
virtual ~Aircraft()
Destructor cleans up all resources acquired.
Definition: Aircraft.cpp:212
bool IsVisible() const
Is the plane visible?
Definition: XPMPAircraft.h:475
void ResetTcasTargetIdx()
Reset TCAS target slot index to -1
Definition: XPMPAircraft.h:420
unsigned ContrailTrigger()
Trigger standard contrails as per plane type.
Definition: Contrail.cpp:77
float GetReversDeployRatio() const
Thrust reversers deploy ratio.
Definition: XPMPAircraft.h:629
bool GetLightsNav() const
Navigation lights.
Definition: XPMPAircraft.h:587
float prev_ts
last update of prev_x/y/z in XP's network time
Definition: XPMPAircraft.h:287
void SetRoll(float _deg)
roll [degree]
Definition: XPMPAircraft.h:545
float GetWingSweepRatio() const
Wing sweep ratio.
Definition: XPMPAircraft.h:566
float GetSlatRatio() const
Slats deploy ratio.
Definition: XPMPAircraft.h:564
std::string mapLabel
label for map drawing
Definition: XPMPAircraft.h:316
virtual void SetInvalid()
Mark the plane invalid, e.g. after exceptions occured on the data.
Definition: Aircraft.cpp:857
void SetWingSweepRatio(float _f)
Wing sweep ratio.
Definition: XPMPAircraft.h:567
virtual void SoundSetup()
Sound-related initializations, called by Create() and ChangeModel()
Definition: Sound.cpp:820
float GetHeading() const
heading [degree]
Definition: XPMPAircraft.h:542
void SetPitch(float _deg)
pitch [degree]
Definition: XPMPAircraft.h:541
void SetYokeRollRatio(float _f)
Yoke roll ratio.
Definition: XPMPAircraft.h:575
const XPLMDrawInfo_t & GetLocation() const
Gets all location info (including local coordinates)
Definition: XPMPAircraft.h:538
int mapIconRow
map icon coordinates, row
Definition: XPMPAircraft.h:312
void MapDrawIcon(XPLMMapLayerID inLayer, float acSize)
Actually draw the map icon.
Definition: Map.cpp:135
float GetCameraDist() const
Distance to camera [m].
Definition: XPMPAircraft.h:491
XPMP2::CSLModel * pCSLMdl
the CSL model in use
Definition: XPMPAircraft.h:281
void WakeApplyDefaults(bool _bOverwriteAllFields=true)
Fill in default wake turbulence support data based on Doc8643 wake turbulence category.
Definition: Aircraft.cpp:476
void SetTireRotAngle(float _deg)
Tire rotation angle [degree].
Definition: XPMPAircraft.h:595
void SetThrustRatio(float _f)
Thrust ratio.
Definition: XPMPAircraft.h:569
int skipCounter
Counts how often we skipped expensive computations.
Definition: XPMPAircraft.h:352
float GetPropRotRad() const
Propellor rotation speed [rad/s].
Definition: XPMPAircraft.h:625
float colLabel[4]
label base color (RGB)
Definition: XPMPAircraft.h:219
int sndMinDist
Minimum distance in [m] to play sound in full volume, the larger the 'louder' the aircraft.
Definition: XPMPAircraft.h:342
void ContrailMove()
Internal: Create/move contrails, implemented in Contrail.cpp.
Definition: Contrail.cpp:124
int ReMatchModel()
Finds a match again, using the existing parameters, eg. after more models have been loaded.
Definition: XPMPAircraft.h:442
bool bAuto
Shall this sound event be handled automatically? (Set to false in your constructor or in Aircraft::So...
Definition: XPMPAircraft.h:334
int mapIconCol
map icon coordinates, column
Definition: XPMPAircraft.h:313
void SetEngineRotRad(float _rad)
Engine rotation speed [rad/s], also sets [rpm] and engines 1..4.
Definition: Aircraft.cpp:800
double lon1s
Definition: XPMPAircraft.h:291
Aircraft(const Aircraft &)=delete
Aircraft must not be copied as they reference non-copyable resources like XP instances.
virtual float GetAoA() const
Angle of Attach, returns pitch (but you can override in your class)
Definition: XPMPAircraft.h:658
virtual void SoundUpdate()
Update sound, like position and volume, called once per frame.
Definition: Sound.cpp:838
friend size_t AIUpdateMultiplayerDataRefs()
The old way: Update Multiplayer dataRefs directly.
Definition: AIMultiplayer.cpp:244
ChnListTy chnList
List of channels produced via calls to SoundPlay()
Definition: XPMPAircraft.h:350
float tsResetTouchDown
Set by SetOnGrnd() with the timestamp when to reset SetTouchDown()
Definition: XPMPAircraft.h:294
std::string acLivery
Livery code of this plane.
Definition: XPMPAircraft.h:194
float GetPitch() const
pitch [degree]
Definition: XPMPAircraft.h:540
void SoundVolume(uint64_t chnId, float vol)
Sets the sound's volume (after applying master volume and Sound File's adjustments)
Definition: Sound.cpp:747
float GetYokeHeadingRatio() const
Yoke heading ratio.
Definition: XPMPAircraft.h:572
void SetTireRotRad(float _rad)
Definition: XPMPAircraft.h:600
void SetEngineRotAngle(float _deg)
Engine rotation angle [degree], also sets engines 1..4.
Definition: Aircraft.cpp:775
float prev_z
Definition: XPMPAircraft.h:286
bool bChnMuted
Is sound for this aircraft currently muted?
Definition: XPMPAircraft.h:348
float mapY
temporary: map coordinates (NAN = not to be drawn)
Definition: XPMPAircraft.h:315
Operational values per sound channel, that is triggered by a standard sound event.
Definition: XPMPAircraft.h:333
Represents a CSL model as it is saved on disk.
Definition: CSLModels.h:113
XPMP2 Exception class, e.g. thrown if there are no CSL models or duplicate modeS_ids when creating an...
Definition: XPMPAircraft.h:803
std::string fileName
filename of the line of code where exception occurred
Definition: XPMPAircraft.h:805
virtual const char * what() const noexcept
returns msg.c_str()
Definition: Utilities.cpp:812
std::string msg
additional text message
Definition: XPMPAircraft.h:808
XPMP2Error(const char *szFile, int ln, const char *szFunc, const char *szMsg,...)
Constructor puts together a formatted exception text.
Definition: Utilities.cpp:797
std::string funcName
function of the line of code where exception occurred
Definition: XPMPAircraft.h:807
int ln
line number of the line of code where exception occurred
Definition: XPMPAircraft.h:806
Definition: XPMPAircraft.h:70
constexpr float G_EARTH
standard gravitational acceleration [m/s²]
Definition: XPMPAircraft.h:84
constexpr double KT_per_M_per_S
Convert m/s to knots.
Definition: XPMPAircraft.h:81
Aircraft * AcFindByID(XPMPPlaneID _id)
Find aircraft by its plane ID, can return nullptr.
Definition: Aircraft.cpp:1107
bool AcSetDefaultWakeData(const std::string &_wtc, const Aircraft::wakeTy &_wake)
(Re)Define default wake turbulence values per WTC
Definition: Aircraft.cpp:1120
constexpr float RPM_to_RADs
Defined by XPMP2 internally.
Definition: XPMPAircraft.h:75
DR_VALS
The dataRefs provided by XPMP2 to the CSL models.
Definition: XPMPAircraft.h:87
@ V_ENGINES_ENGINE_ROTATION_SPEED_RAD_SEC3
libxplanemp/engines/engine_rotation_speed_rad_sec3
Definition: XPMPAircraft.h:131
@ V_CONTROLS_YOKE_HEADING_RATIO
libxplanemp/controls/yoke_heading_ratio and sim/cockpit2/tcas/targets/position/yolk_yaw
Definition: XPMPAircraft.h:97
@ V_CONTROLS_THRUST_RATIO
libxplanemp/controls/thrust_ratio and sim/cockpit2/tcas/targets/position/throttle
Definition: XPMPAircraft.h:95
@ V_CONTROLS_WING_SWEEP_RATIO
libxplanemp/controls/wing_sweep_ratio and sim/cockpit2/tcas/targets/position/wing_sweep
Definition: XPMPAircraft.h:94
@ V_CONTROLS_YOKE_PITCH_RATIO
libxplanemp/controls/yoke_pitch_ratio and sim/cockpit2/tcas/targets/position/yolk_pitch
Definition: XPMPAircraft.h:96
@ V_GEAR_TIRE_ROTATION_ANGLE_DEG
libxplanemp/gear/tire_rotation_angle_deg
Definition: XPMPAircraft.h:109
@ V_ENGINES_PROP_ROTATION_SPEED_RAD_SEC
libxplanemp/engines/prop_rotation_speed_rad_sec
Definition: XPMPAircraft.h:118
@ V_ENGINES_ENGINE_ROTATION_SPEED_RAD_SEC1
libxplanemp/engines/engine_rotation_speed_rad_sec1
Definition: XPMPAircraft.h:129
@ V_MISC_TOUCH_DOWN
libxplanemp/misc/touch_down
Definition: XPMPAircraft.h:135
@ V_ENGINES_ENGINE_ROTATION_ANGLE_DEG3
libxplanemp/engines/engine_rotation_angle_deg3
Definition: XPMPAircraft.h:123
@ V_ENGINES_ENGINE_ROTATION_SPEED_RAD_SEC2
libxplanemp/engines/engine_rotation_speed_rad_sec2
Definition: XPMPAircraft.h:130
@ V_GEAR_NOSE_GEAR_DEFLECTION_MTR
libxplanemp/gear/nose_gear_deflection_mtr
Definition: XPMPAircraft.h:107
@ V_COUNT
always last, number of dataRefs XPMP2 pre-defines
Definition: XPMPAircraft.h:137
@ V_ENGINES_ENGINE_ROTATION_SPEED_RAD_SEC4
libxplanemp/engines/engine_rotation_speed_rad_sec4
Definition: XPMPAircraft.h:132
@ V_ENGINES_PROP_ROTATION_ANGLE_DEG
libxplanemp/engines/prop_rotation_angle_deg
Definition: XPMPAircraft.h:116
@ V_CONTROLS_YOKE_ROLL_RATIO
libxplanemp/controls/yoke_roll_ratio and sim/cockpit2/tcas/targets/position/yolk_roll
Definition: XPMPAircraft.h:98
@ V_CONTROLS_SPOILER_RATIO
libxplanemp/controls/spoiler_ratio
Definition: XPMPAircraft.h:91
@ V_CONTROLS_TAXI_LITES_ON
libxplanemp/controls/taxi_lites_on and sim/cockpit2/tcas/targets/position/lights
Definition: XPMPAircraft.h:101
@ V_ENGINES_ENGINE_ROTATION_SPEED_RAD_SEC
libxplanemp/engines/engine_rotation_speed_rad_sec
Definition: XPMPAircraft.h:115
@ V_GEAR_TIRE_VERTICAL_DEFLECTION_MTR
libxplanemp/gear/tire_vertical_deflection_mtr
Definition: XPMPAircraft.h:108
@ V_CONTROLS_NWS_RATIO
libxplanemp/controls/nws_ratio, the nose wheel angle, actually in degrees
Definition: XPMPAircraft.h:89
@ V_ENGINES_ENGINE_ROTATION_ANGLE_DEG4
libxplanemp/engines/engine_rotation_angle_deg4
Definition: XPMPAircraft.h:124
@ V_GEAR_TIRE_ROTATION_SPEED_RPM
libxplanemp/gear/tire_rotation_speed_rpm
Definition: XPMPAircraft.h:110
@ V_ENGINES_ENGINE_ROTATION_ANGLE_DEG1
libxplanemp/engines/engine_rotation_angle_deg1
Definition: XPMPAircraft.h:121
@ V_ENGINES_ENGINE_ROTATION_ANGLE_DEG
libxplanemp/engines/engine_rotation_angle_deg
Definition: XPMPAircraft.h:113
@ V_ENGINES_THRUST_REVERSER_DEPLOY_RATIO
libxplanemp/engines/thrust_reverser_deploy_ratio
Definition: XPMPAircraft.h:119
@ V_CONTROLS_BEACON_LITES_ON
libxplanemp/controls/beacon_lites_on and sim/cockpit2/tcas/targets/position/lights
Definition: XPMPAircraft.h:103
@ V_ENGINES_ENGINE_ROTATION_SPEED_RPM4
libxplanemp/engines/engine_rotation_speed_rpm4
Definition: XPMPAircraft.h:128
@ V_ENGINES_PROP_ROTATION_SPEED_RPM
libxplanemp/engines/prop_rotation_speed_rpm
Definition: XPMPAircraft.h:117
@ V_ENGINES_ENGINE_ROTATION_SPEED_RPM2
libxplanemp/engines/engine_rotation_speed_rpm2
Definition: XPMPAircraft.h:126
@ V_CONTROLS_NAV_LITES_ON
libxplanemp/controls/nav_lites_on and sim/cockpit2/tcas/targets/position/lights
Definition: XPMPAircraft.h:105
@ V_ENGINES_ENGINE_ROTATION_SPEED_RPM
libxplanemp/engines/engine_rotation_speed_rpm
Definition: XPMPAircraft.h:114
@ V_CONTROLS_SLAT_RATIO
libxplanemp/controls/slat_ratio and sim/cockpit2/tcas/targets/position/slat_ratio
Definition: XPMPAircraft.h:93
@ V_ENGINES_ENGINE_ROTATION_SPEED_RPM3
libxplanemp/engines/engine_rotation_speed_rpm3
Definition: XPMPAircraft.h:127
@ V_CONTROLS_THRUST_REVERS
libxplanemp/controls/thrust_revers
Definition: XPMPAircraft.h:99
@ V_GEAR_TIRE_ROTATION_SPEED_RAD_SEC
libxplanemp/gear/tire_rotation_speed_rad_sec
Definition: XPMPAircraft.h:111
@ V_ENGINES_ENGINE_ROTATION_SPEED_RPM1
libxplanemp/engines/engine_rotation_speed_rpm1
Definition: XPMPAircraft.h:125
@ V_ENGINES_ENGINE_ROTATION_ANGLE_DEG2
libxplanemp/engines/engine_rotation_angle_deg2
Definition: XPMPAircraft.h:122
@ V_CONTROLS_FLAP_RATIO
libxplanemp/controls/flap_ratio and sim/cockpit2/tcas/targets/position/flap_ratio and ....
Definition: XPMPAircraft.h:90
@ V_CONTROLS_LANDING_LITES_ON
libxplanemp/controls/landing_lites_on and sim/cockpit2/tcas/targets/position/lights
Definition: XPMPAircraft.h:102
@ V_CONTROLS_GEAR_RATIO
libxplanemp/controls/gear_ratio and sim/cockpit2/tcas/targets/position/gear_deploy
Definition: XPMPAircraft.h:88
@ V_CONTROLS_STROBE_LITES_ON
libxplanemp/controls/strobe_lites_on and sim/cockpit2/tcas/targets/position/lights
Definition: XPMPAircraft.h:104
@ V_CONTROLS_SPEED_BRAKE_RATIO
libxplanemp/controls/speed_brake_ratio and sim/cockpit2/tcas/targets/position/speedbrake_ratio
Definition: XPMPAircraft.h:92
constexpr int M_per_NM
Convert nautical miles to meters.
Definition: XPMPAircraft.h:79
constexpr double M_per_FT
Convert feet to meters, e.g. for altitude calculations.
Definition: XPMPAircraft.h:77
Wake dataRef support.
Definition: XPMPAircraft.h:260
void fillUpFrom(const wakeTy &o)
Copies values only for non-NAN fields.
Definition: Aircraft.cpp:178
void clear()
clear all values to defaults
Definition: XPMPAircraft.h:265
float mass_kg
actual mass of the aircraft creating the wake
Definition: XPMPAircraft.h:263
float wingSpan_m
wing span of the aircraft creating wake turbulence
Definition: XPMPAircraft.h:261
float wingArea_m2
wing area (total area of both wings combined) of the aircraft creating wake turbulence
Definition: XPMPAircraft.h:262
bool needsDefaults() const
Definition: Aircraft.cpp:144
void applyDefaults(const std::string &_wtc, bool _bOverwriteAllFields=true)
based on Doc8643 WTC fill with defaults
Definition: Aircraft.cpp:153
Collates some information on the CSL model.
Definition: XPMPAircraft.h:145
vecMatchCrit_t vecMatchCrit
Definition: XPMPAircraft.h:168
std::string modelName
name, formed by last part of path plus id
Definition: XPMPAircraft.h:149
int xsbAircraftLn
Line number in the xsb_aircraft.txt file where the model definition starts.
Definition: XPMPAircraft.h:153
std::string icaoType
ICAO aircraft type this model represents: xsb_aircraft.txt::ICAO
Definition: XPMPAircraft.h:155
std::string cslId
id, just an arbitrary label read from xsb_aircraft.txt::OBJ8_AIRCRAFT
Definition: XPMPAircraft.h:147
std::string doc8643WTC
Doc8643 information: wake turbulence class, like M, L/M, L, H.
Definition: XPMPAircraft.h:159
std::string doc8643Classification
Doc8643 information: Classification, like L1P, L4J, H1T.
Definition: XPMPAircraft.h:157
std::string xsbAircraftPath
Path to the xsb_aircraft.txt file from where this model is loaded.
Definition: XPMPAircraft.h:151
CSLModelInfo_t()
Default constructor does nothing.
Definition: XPMPAircraft.h:171
std::string livery
special livery (not often used)
Definition: XPMPAircraft.h:164
std::string icaoAirline
ICAO airine/operator code.
Definition: XPMPAircraft.h:163
std::vector< MatchCrit_t > vecMatchCrit_t
Definition: XPMPAircraft.h:166
Any number of airline codes and/or liveries can be assigned to a model for matching purpose.
Definition: XPMPAircraft.h:162