XPMP2
X-Plane multiplayer library 2 - using instancing
XPMPAircraft.h
Go to the documentation of this file.
1 
51 #ifndef _XPMPAircraft_h_
52 #define _XPMPAircraft_h_
53 
54 #include "XPMPMultiplayer.h"
55 #include "XPLMInstance.h"
56 #include "XPLMCamera.h"
57 #include "XPLMMap.h"
58 
59 #include <cstdint>
60 #include <cmath>
61 #include <stdexcept>
62 #include <string>
63 #include <vector>
64 #include <list>
65 
66 //
67 // MARK: XPMP2 New Definitions
68 //
69 
70 namespace XPMP2 {
71 
72 class CSLModel;
73 
75 constexpr float RPM_to_RADs = 0.10471975511966f;
77 constexpr double M_per_FT = 0.3048; // meter per 1 foot
79 constexpr int M_per_NM = 1852; // meter per one nautical mile
81 constexpr double KT_per_M_per_S = 1.94384; // 1m/s = 1.94384kt
84 constexpr float G_EARTH = 9.80665f;
85 
87 enum DR_VALS : std::uint8_t {
100 
106 
112 
120 
133 
134 
136 
137  V_COUNT
138 };
139 
147  std::string cslId;
149  std::string modelName;
151  std::string xsbAircraftPath;
153  int xsbAircraftLn = 0;
155  std::string icaoType;
159  std::string doc8643WTC;
160 
162  struct MatchCrit_t {
163  std::string icaoAirline;
164  std::string livery;
165  };
166  typedef std::vector<MatchCrit_t> vecMatchCrit_t;
167  // List of match criteria defined for the model, can be empty
169 
173  CSLModelInfo_t(const XPMP2::CSLModel& csl);
174 };
175 
178 class Aircraft {
179 
180 public:
181 
182 protected:
188 
189 public:
192  std::string acIcaoType;
193  std::string acIcaoAirline;
194  std::string acLivery;
195 
200  XPLMDrawInfo_t drawInfo;
201 
203  float v_x = 0.0f, v_y = 0.0f, v_z = 0.0f;
204 
206  bool bOnGrnd = false;
207 
215  std::vector<float> v;
216 
218  std::string label;
219  float colLabel[4] = {1.0f,1.0f,0.0f,1.0f};
220  bool bDrawLabel = true;
221 
223  float vertOfsRatio = 1.0f;
224 
230  float gearDeflectRatio = 0.5f;
231 
237  bool bClampToGround = false;
238 
243  int aiPrio = 1;
244 
248 
250  std::list<XPLMInstanceRef> listContrail;
251  unsigned contrailNum = 0;
252  unsigned contrailDist_m = 5;
253  unsigned contrailLifeTime = 25;
254 
260  struct wakeTy {
261  float wingSpan_m = NAN;
262  float wingArea_m2 = NAN;
263  float mass_kg = NAN;
264 
265  void clear() { *this = wakeTy(); }
266  bool needsDefaults() const;
268  void applyDefaults(const std::string& _wtc, bool _bOverwriteAllFields = true);
270  void fillUpFrom(const wakeTy& o);
271  } wake;
272 
275 
276 protected:
277  bool bValid = true;
278  bool bVisible = true;
279  bool bRender = true;
280 
282  int matchQuality = -1;
283  int acRelGrp = 0;
284 
285  // this is data from about a second ago to calculate cartesian velocities
286  float prev_x = 0.0f, prev_y = 0.0f, prev_z = 0.0f;
287  float prev_ts = 0.0f;
288  float gs_kn = 0.0f;
289 
291  double lat1s = NAN, lon1s = NAN, alt1s_ft = NAN;
292 
294  float tsResetTouchDown = NAN;
295 
297  std::list<XPLMInstanceRef> listInst;
299  int tcasTargetIdx = -1;
300 
302  float camTimLstUpd = 0.0f;
304  float camDist = 0.0f;
306  float camBearing = 0.0f;
307 
309  XPLMProbeRef hProbe = nullptr;
310 
311  // Data used for drawing icons in X-Plane's map
312  int mapIconRow = 0;
313  int mapIconCol = 0;
314  float mapX = 0.0f;
315  float mapY = 0.0f;
316  std::string mapLabel;
317 
318  // *** Sound support ***
319 public:
322  SND_ENG = 0,
328  };
330  typedef std::list<uint64_t> ChnListTy;
331 
333  struct SndChTy {
334  bool bAuto = true;
335  uint64_t chnId = 0;
336  float lastDRVal = NAN;
337  float volAdj = 1.0f;
338  };
339 
342  int sndMinDist = 50;
343 
344 protected:
348  bool bChnMuted = false;
352  int skipCounter = 0;
353 
354 private:
355  bool bDestroyInst = false;
356 public:
357 
360 
368  Aircraft (const std::string& _icaoType,
369  const std::string& _icaoAirline,
370  const std::string& _livery,
371  XPMPPlaneID _modeS_id = 0,
372  const std::string& _cslId = "");
374  Aircraft ();
376  virtual ~Aircraft();
377 
379  Aircraft (const Aircraft&) = delete;
381  Aircraft& operator=(const Aircraft&) = delete;
382 
391  void Create (const std::string& _icaoType,
392  const std::string& _icaoAirline,
393  const std::string& _livery,
394  XPMPPlaneID _modeS_id = 0,
395  const std::string& _cslId = "",
396  CSLModel* _pCSLModel = nullptr);
400 
402  XPMPPlaneID GetModeS_ID () const { return modeS_id; }
406  bool IsRelatedTo (const std::string& _icaoType) const;
408  bool IsGroundVehicle() const;
410  bool IsGlider() const { return IsRelatedTo("GLID"); }
412  int GetTcasTargetIdx () const { return tcasTargetIdx; }
414  bool IsCurrentlyShownAsTcasTarget () const { return tcasTargetIdx >= 1; }
416  bool IsCurrentlyShownAsAI () const;
421 
424  virtual std::string GetFlightId() const;
425 
430 
436  int ChangeModel (const std::string& _icaoType,
437  const std::string& _icaoAirline,
438  const std::string& _livery);
439 
443 
448  bool AssignModel (const std::string& _cslId,
449  CSLModel* _pCSLModel = nullptr);
450 
452  XPMP2::CSLModel* GetModel () const { return pCSLMdl; }
454  const std::string& GetModelName () const;
458  int GetMatchQuality () const { return matchQuality; }
459 
463 
465  float GetVertOfs () const;
466 
468  bool IsValid() const { return bValid; }
470  virtual void SetInvalid();
471 
473  virtual void SetVisible (bool _bVisible);
475  bool IsVisible () const { return bVisible && bValid; }
476 
478  virtual void SetRender (bool _bRender);
480  bool IsRendered () const { return bRender && IsVisible(); }
481 
483  bool IsInstanciated () const { return !listInst.empty(); }
484 
486  void SetDrawLabel (bool _b) { bDrawLabel = _b; }
488  bool ShallDrawLabel () const { return bDrawLabel; }
489 
491  float GetCameraDist () const { return camDist; }
493  float GetCameraBearing () const { return camBearing; }
494 
503  virtual void UpdatePosition (float _elapsedSinceLastCall, int _flCounter) = 0;
504 
506  bool IsOnGrnd () const { return bOnGrnd; }
510  void SetOnGrnd (bool on_grnd, float setTouchDownTime = NAN);
511 
515 
523  void SetLocation (double lat, double lon, double alt_ft, bool on_grnd, float setTouchDownTime = NAN) {
524  SetLocation(lat, lon, alt_ft);
525  SetOnGrnd(on_grnd, setTouchDownTime);
526  }
527 
529  void SetLocation (double lat, double lon, double alt_ft);
530 
533  void GetLocation (double& lat, double& lon, double& alt_ft) const;
534 
536  void SetLocalLoc (float _x, float _y, float _z) { drawInfo.x = _x; drawInfo.y = _y; drawInfo.z = _z; }
538  const XPLMDrawInfo_t& GetLocation () const { return drawInfo; }
539 
540  float GetPitch () const { return drawInfo.pitch; }
541  void SetPitch (float _deg) { drawInfo.pitch = _deg; }
542  float GetHeading () const { return drawInfo.heading; }
543  void SetHeading (float _deg) { drawInfo.heading = _deg; }
544  float GetRoll () const { return drawInfo.roll; }
545  void SetRoll (float _deg) { drawInfo.roll = _deg; }
546 
547  float GetGS_kn() const { return gs_kn; }
548 
553 
554  float GetGearRatio () const { return v[V_CONTROLS_GEAR_RATIO]; }
555  void SetGearRatio (float _f) { v[V_CONTROLS_GEAR_RATIO] = _f; }
556  float GetNoseWheelAngle () const { return v[V_CONTROLS_NWS_RATIO]; }
557  void SetNoseWheelAngle (float _f) { v[V_CONTROLS_NWS_RATIO] = _f; }
558  float GetFlapRatio () const { return v[V_CONTROLS_FLAP_RATIO]; }
559  void SetFlapRatio (float _f) { v[V_CONTROLS_FLAP_RATIO] = _f; }
560  float GetSpoilerRatio () const { return v[V_CONTROLS_SPOILER_RATIO]; }
561  void SetSpoilerRatio (float _f) { v[V_CONTROLS_SPOILER_RATIO] = _f; }
562  float GetSpeedbrakeRatio () const { return v[V_CONTROLS_SPEED_BRAKE_RATIO]; }
564  float GetSlatRatio () const { return v[V_CONTROLS_SLAT_RATIO]; }
565  void SetSlatRatio (float _f) { v[V_CONTROLS_SLAT_RATIO] = _f; }
566  float GetWingSweepRatio () const { return v[V_CONTROLS_WING_SWEEP_RATIO]; }
567  void SetWingSweepRatio (float _f) { v[V_CONTROLS_WING_SWEEP_RATIO] = _f; }
568  float GetThrustRatio () const { return v[V_CONTROLS_THRUST_RATIO]; }
569  void SetThrustRatio (float _f) { v[V_CONTROLS_THRUST_RATIO] = _f; }
570  float GetYokePitchRatio () const { return v[V_CONTROLS_YOKE_PITCH_RATIO]; }
571  void SetYokePitchRatio (float _f) { v[V_CONTROLS_YOKE_PITCH_RATIO] = _f; }
574  float GetYokeRollRatio () const { return v[V_CONTROLS_YOKE_ROLL_RATIO]; }
575  void SetYokeRollRatio (float _f) { v[V_CONTROLS_YOKE_ROLL_RATIO] = _f; }
576  float GetThrustReversRatio () const { return v[V_CONTROLS_THRUST_REVERS]; }
578 
579  bool GetLightsTaxi () const { return v[V_CONTROLS_TAXI_LITES_ON] > 0.5f; }
580  void SetLightsTaxi (bool _b) { v[V_CONTROLS_TAXI_LITES_ON] = float(_b); }
581  bool GetLightsLanding () const { return v[V_CONTROLS_LANDING_LITES_ON] > 0.5f; }
582  void SetLightsLanding (bool _b) { v[V_CONTROLS_LANDING_LITES_ON] = float(_b); }
583  bool GetLightsBeacon () const { return v[V_CONTROLS_BEACON_LITES_ON] > 0.5f; }
584  void SetLightsBeacon (bool _b) { v[V_CONTROLS_BEACON_LITES_ON] = float(_b); }
585  bool GetLightsStrobe () const { return v[V_CONTROLS_STROBE_LITES_ON] > 0.5f; }
586  void SetLightsStrobe (bool _b) { v[V_CONTROLS_STROBE_LITES_ON] = float(_b); }
587  bool GetLightsNav () const { return v[V_CONTROLS_NAV_LITES_ON] > 0.5f; }
588  void SetLightsNav (bool _b) { v[V_CONTROLS_NAV_LITES_ON] = float(_b); }
589 
594  float GetTireRotAngle () const { return v[V_GEAR_TIRE_ROTATION_ANGLE_DEG]; }
595  void SetTireRotAngle (float _deg) { v[V_GEAR_TIRE_ROTATION_ANGLE_DEG] = _deg; }
596  float GetTireRotRpm () const { return v[V_GEAR_TIRE_ROTATION_SPEED_RPM]; }
597  void SetTireRotRpm (float _rpm) { v[V_GEAR_TIRE_ROTATION_SPEED_RPM] = _rpm;
600  void SetTireRotRad (float _rad) { v[V_GEAR_TIRE_ROTATION_SPEED_RAD_SEC] = _rad;
602 
604  void SetEngineRotAngle (float _deg);
606  void SetEngineRotRpm (float _rpm);
608  void SetEngineRotRad (float _rad);
609 
610  float GetEngineRotAngle (size_t idx) const
611  { return 1 <= idx && idx <= 4 ? v[V_ENGINES_ENGINE_ROTATION_ANGLE_DEG1+idx-1] : 0.0f; }
612  void SetEngineRotAngle (size_t idx, float _deg);
613  float GetEngineRotRpm (size_t idx) const
614  { return 1 <= idx && idx <= 4 ? v[V_ENGINES_ENGINE_ROTATION_SPEED_RPM1+idx-1] : 0.0f; }
615  void SetEngineRotRpm (size_t idx, float _rpm);
616  float GetEngineRotRad (size_t idx) const
617  { return 1 <= idx && idx <= 4 ? v[V_ENGINES_ENGINE_ROTATION_SPEED_RAD_SEC+idx-1] : 0.0f; }
618  void SetEngineRotRad (size_t idx, float _rad);
619 
621  void SetPropRotAngle (float _deg) { v[V_ENGINES_PROP_ROTATION_ANGLE_DEG] = _deg; }
622  float GetPropRotRpm () const { return v[V_ENGINES_PROP_ROTATION_SPEED_RPM]; }
623  void SetPropRotRpm (float _rpm) { v[V_ENGINES_PROP_ROTATION_SPEED_RPM] = _rpm;
628 
631 
632  bool GetTouchDown () const { return v[V_MISC_TOUCH_DOWN] > 0.5f; }
633  void SetTouchDown (bool _b) { v[V_MISC_TOUCH_DOWN] = float(_b); }
634 
641 
644  void WakeApplyDefaults(bool _bOverwriteAllFields = true);
645 
646  float GetWingSpan () const { return wake.wingSpan_m; }
647  void SetWingSpan (float _m) { wake.wingSpan_m = _m; }
648 
649  float GetWingArea() const { return wake.wingArea_m2; }
650  void SetWingArea (float _m2) { wake.wingArea_m2 = _m2; }
651 
652  int GetWakeCat() const;
653 
654  float GetMass() const { return wake.mass_kg; }
655  void SetMass(float _kg) { wake.mass_kg = _kg; }
656 
657  // Overridables:
658  virtual float GetAoA() const { return GetPitch(); }
659  virtual float GetLift() const { return GetMass() * G_EARTH; }
660 
665 
673  unsigned ContrailTrigger ();
674 
681  void ContrailRequest (unsigned num, unsigned dist_m = 0, unsigned lifeTime = 0);
682 
684  void ContrailRemove ();
685 
690 
692  void MapFindIcon ();
694  void MapPreparePos (XPLMMapProjectionID projection,
695  const float boundsLTRB[4]);
697  void MapDrawIcon (XPLMMapLayerID inLayer, float acSize);
699  void MapDrawLabel (XPLMMapLayerID inLayer, float yOfs);
700 
705 
710  uint64_t SoundPlay (const std::string& sndName, float vol = 1.0f);
711 
714  void SoundStop (uint64_t chnId);
715 
719  void SoundVolume (uint64_t chnId, float vol);
720 
722  void SoundMuteAll (bool bMute);
724  bool SoundIsMuted() const { return bChnMuted; }
725 
734  virtual std::string SoundGetName (SoundEventsTy sndEvent, float& volAdj) const;
735 
736 protected:
737 
739 
741  static float FlightLoopCB (float, float, int, void*);
742 
745 
747  void DoMove ();
749  void DoEverySecondUpdates (float now);
751  void ContrailMove ();
753  void ContrailAutoUpdate ();
755  void UpdateDistBearingCamera (const XPLMCameraPosition_t& posCam);
757  void ClampToGround ();
759  bool CreateInstances ();
761  void DestroyInstances ();
762 
765  virtual void ComputeMapLabel ();
766 
767  // The following functions are implemented in AIMultiplayer.cpp:
769  virtual void SetTcasTargetIdx (int _idx) { tcasTargetIdx = _idx; }
770 
772 
773  // These functions perform the TCAS target / multiplayer data updates
774  friend void AIMultiUpdate ();
775  friend size_t AIUpdateTCASTargets ();
776  friend size_t AIUpdateMultiplayerDataRefs ();
777 
781 
783  virtual void SoundSetup ();
785  virtual void SoundUpdate ();
787  virtual void SoundRemoveAll ();
788 
790 };
791 
793 Aircraft* AcFindByID (XPMPPlaneID _id);
794 
796 bool AcSetDefaultWakeData(const std::string& _wtc, const Aircraft::wakeTy& _wake);
797 
798 //
799 // MARK: XPMP2 Exception class
800 //
801 
803 class XPMP2Error : public std::logic_error {
804 protected:
805  std::string fileName;
806  int ln;
807  std::string funcName;
808  std::string msg;
809 public:
811  XPMP2Error (const char* szFile, int ln, const char* szFunc, const char* szMsg, ...);
812 public:
814  virtual const char* what() const noexcept;
815 
816 public:
817  // copy/move constructor/assignment as per default
818  XPMP2Error (const XPMP2Error& o) = default;
819  XPMP2Error (XPMP2Error&& o) = default;
820  XPMP2Error& operator = (const XPMP2Error& o) = default;
821  XPMP2Error& operator = (XPMP2Error&& o) = default;
822 };
823 
824 
825 
826 } // namespace XPMP2
827 
828 #endif
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