XPMP2
X-Plane multiplayer library 2 - using instancing
XPMPMultiplayer.h
Go to the documentation of this file.
1 
63 #ifndef _XPLMMultiplayer_h_
64 #define _XPLMMultiplayer_h_
65 
66 #include <string>
67 #include <cmath>
68 #include "XPLMDefs.h"
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73 
74 // defined in XPMPAircraft
75 namespace XPMP2 { class Aircraft; }
76 
77 /************************************************************************************
78  * MARK: PLANE DATA TYPES
79  ************************************************************************************/
80 
89  long size = sizeof(XPMPPlanePosition_t);
90  double lat = 0.0;
91  double lon = 0.0;
92  double elevation = 0.0;
93  float pitch = 0.0f;
94  float roll = 0.0f;
95  float heading = 0.0f;
96  char label[32] = "";
97  float offsetScale = 1.0f;
98  bool clampToGround = false;
99  int aiPrio = 1;
100  float label_color[4] = {1.0f,1.0f,0.0f,1.0f};
101  int multiIdx = 0;
102 };
103 
104 
110 enum {
114 };
115 typedef unsigned int XPMPLightsPattern;
116 
117 
118 #if __GNUC__
119 #pragma GCC diagnostic push
120 #pragma GCC diagnostic ignored "-Wpedantic" // because we don't want to change the anonymous structure following here as that would require code change in legacy plugins
121 #elif _MSC_VER
122 #pragma warning(push)
123 #pragma warning(disable: 4202 4201)
124 #endif
129  unsigned int lightFlags = 0x150000;
130  struct {
131  unsigned int timeOffset : 16;
132 
133  unsigned int taxiLights : 1;
134  unsigned int landLights : 1;
135  unsigned int bcnLights : 1;
136  unsigned int strbLights : 1;
137  unsigned int navLights : 1;
138 
140  XPMPLightsPattern flashPattern : 4;
141  };
142 };
143 #if __GNUC__
144 #pragma GCC diagnostic pop
145 #elif _MSC_VER
146 #pragma warning(pop)
147 #endif
148 
149 
157  long size = sizeof(XPMPPlaneSurfaces_t);
158  float gearPosition = 0.0f;
159  float flapRatio = 0.0f;
160  float spoilerRatio = 0.0f;
161  float speedBrakeRatio = 0.0f;
162  float slatRatio = 0.0f;
163  float wingSweep = 0.0f;
164  float thrust = 0.0f;
165  float yokePitch = 0.0f;
166  float yokeHeading = 0.0f;
167  float yokeRoll = 0.0f;
168 
170 
171  float tireDeflect = 0.0f;
172  float tireRotDegree = 0.0f;
173  float tireRotRpm = 0.0f;
174 
175  float engRotDegree = 0.0f;
176  float engRotRpm = 0.0f;
177  float propRotDegree = 0.0f;
178  float propRotRpm = 0.0f;
179  float reversRatio = 0.0f;
180 
181  bool touchDown = false;
182 };
183 
184 
194 };
195 
196 
199  long size = sizeof(XPMPPlaneRadar_t);
200  long code = 0;
202 };
203 
204 
209  long size = sizeof(XPMPInfoTexts_t);
210  char tailNum[10] = {0};
211  char icaoAcType[5] = {0};
212  char manufacturer[40] = {0};
213  char model[40] = {0};
214  char icaoAirline[4] = {0};
215  char airline[40] = {0};
216  char flightNum [10] = {0};
217  char aptFrom [5] = {0};
218  char aptTo [5] = {0};
219 };
220 
221 
232  xpmpDataType_Radar = 1L << 3,
234 };
235 
236 
241  xpmpData_Unavailable = 0, /* The information has never been specified. */
242  xpmpData_Unchanged = 1, /* The information from the last time the plug-in was asked. */
243  xpmpData_NewData = 2 /* The information has changed this sim cycle. */
244 };
245 
246 
252 typedef unsigned XPMPPlaneID;
253 
255 constexpr XPMPPlaneID MIN_MODE_S_ID = 0x00000001;
257 constexpr XPMPPlaneID MAX_MODE_S_ID = 0x00FFFFFF;
258 
259 
260 /************************************************************************************
261 * MARK: INITIALIZATION
262 ************************************************************************************/
263 
267 #define XPMP_CFG_SEC_MODELS "models"
268 #define XPMP_CFG_SEC_PLANES "planes"
269 #define XPMP_CFG_SEC_SOUND "sound"
270 #define XPMP_CFG_SEC_DEBUG "debug"
272 
276 #define XPMP_CFG_ITM_REPLDATAREFS "replace_datarefs"
277 #define XPMP_CFG_ITM_REPLTEXTURE "replace_texture"
278 #define XPMP_CFG_ITM_CLAMPALL "clamp_all_to_ground"
279 #define XPMP_CFG_ITM_HANDLE_DUP_ID "handle_dup_id"
280 #define XPMP_CFG_ITM_SUPPORT_REMOTE "support_remote"
281 #define XPMP_CFG_ITM_CONTR_MIN_ALT "contrail_min_alt"
282 #define XPMP_CFG_ITM_CONTR_MAX_ALT "contrail_max_alt"
283 #define XPMP_CFG_ITM_CONTR_LIFE "contrail_life_time"
284 #define XPMP_CFG_ITM_CONTR_MULTI "contrail_multiple"
285 #define XPMP_CFG_ITM_ACTIVATE_SOUND "activate_sound"
286 #define XPMP_CFG_ITM_FMOD_INSTANCE "force_fmod_instance"
287 #define XPMP_CFG_ITM_MUTE_ON_PAUSE "mute_on_pause"
288 #define XPMP_CFG_ITM_LOGLEVEL "log_level"
289 #define XPMP_CFG_ITM_MODELMATCHING "model_matching"
291 
318 typedef int (*XPMPIntPrefsFuncTy)(const char* _section, const char* _key, int _default);
319 
322 
328 [[deprecated("Use XPMPMultiplayerInit and XPMPLoadCSLPackages")]]
329 const char * XPMPMultiplayerInitLegacyData(const char* inCSLFolder,
330  const char* inPluginName,
331  const char* resourceDir,
332  XPMPIntPrefsFuncTy inIntPrefsFunc = nullptr,
333  const char* inDefaultICAO = nullptr,
334  const char* inPluginLogAcronym = nullptr);
335 
344 const char * XPMPMultiplayerInit(const char* inPluginName,
345  const char* resourceDir,
346  XPMPIntPrefsFuncTy inIntPrefsFunc = nullptr,
347  const char* inDefaultICAO = nullptr,
348  const char* inPluginLogAcronym = nullptr);
349 
356 void XPMPSetPluginName (const char* inPluginName,
357  const char* inPluginLogAcronym = nullptr);
358 
359 
365 
366 
371 
375 bool XPMPContrailsAvailable ();
376 
379 [[deprecated("Unsupported feature, will always return 'OBJ7 format is no longer supported'")]]
380 const char * XPMPMultiplayerOBJ7SupportEnable(const char * inTexturePath);
381 
383 
384 /************************************************************************************
385 * MARK: Sound
386 ************************************************************************************/
387 
390 
398 bool XPMPSoundEnable (bool bEnable = true);
399 
401 bool XPMPSoundIsEnabled ();
402 
405 void XPMPSoundSetMasterVolume (float fVol = 1.0f);
406 
409 void XPMPSoundMute (bool bMute);
410 
424 const char* XPMPSoundAdd (const char* sName,
425  const char* filePath,
426  bool bLoop,
427  float coneDir = NAN, float conePitch = NAN,
428  float coneInAngle = NAN, float coneOutAngle = NAN,
429  float coneOutVol = NAN);
430 
437 const char* XPMPSoundEnumerate (const char* prevName, const char** ppFilePath = nullptr);
438 
440 
443 
444 // Standard sounds loaded by XPMP2 from XP's `Resource/sounds` folders
445 #define XP_SOUND_ELECTRIC "Electric"
446 #define XP_SOUND_HIBYPASSJET "HiBypassJet"
447 #define XP_SOUND_LOBYPASSJET "LoBypassJet"
448 #define XP_SOUND_TURBOPROP "Turboprop"
449 #define XP_SOUND_PROP_AIRPLANE "PropAirplane"
450 #define XP_SOUND_PROP_HELI "PropHeli"
451 #define XP_SOUND_REVERSE_THRUST "ReverseThrust"
452 #define XP_SOUND_ROLL_RUNWAY "RollRunway"
453 #define XP_SOUND_FLAP "Flap"
454 #define XP_SOUND_GEAR "Gear"
455 
457 
458 /************************************************************************************
459 * MARK: AI / Multiplayer plane control
460 ************************************************************************************/
461 
464 
485 const char * XPMPMultiplayerEnable(void (*_callback)(void*) = nullptr,
486  void* _refCon = nullptr);
487 
488 
494 
495 
499 
501 
502 /************************************************************************************
503 * MARK: CSL Package Handling
504 ************************************************************************************/
505 
508 
527 const char * XPMPLoadCSLPackage(const char * inCSLFolder);
528 
529 
531 [[deprecated("No longer needed, does not do anything.")]]
533 
534 
537 
538 
552 [[deprecated("Unsafe, use XPMPGetModelInfo2() instead.")]]
553 void XPMPGetModelInfo(int inIndex, const char **outModelName, const char **outIcao, const char **outAirline, const char **outLivery);
554 
563 void XPMPGetModelInfo2(int inIndex, std::string& outModelName, std::string& outIcao, std::string& outAirline, std::string& outLivery);
564 
565 
571 int XPMPModelMatchQuality(const char * inICAO,
572  const char * inAirline,
573  const char * inLivery);
574 
575 
577 bool XPMPIsICAOValid(const char * inICAO);
578 
596 size_t XPMPAddModelDataRef (const std::string& dataRef);
597 
599 
600 /************************************************************************************
601  * MARK: PLANE CREATION API
602  ************************************************************************************/
603 
604 
617  XPMPPlaneDataType inDataType,
618  void * ioData,
619  void * inRefcon);
620 
623 
634 [[deprecated("Subclass XPMP2::Aircraft instead")]]
635 XPMPPlaneID XPMPCreatePlane(const char * inICAOCode,
636  const char * inAirline,
637  const char * inLivery,
638  XPMPPlaneData_f inDataFunc,
639  void * inRefcon,
640  XPMPPlaneID inModeS_id = 0);
641 
651 [[deprecated("Subclass XPMP2::Aircraft instead")]]
652 XPMPPlaneID XPMPCreatePlaneWithModelName(const char * inModelName,
653  const char * inICAOCode,
654  const char * inAirline,
655  const char * inLivery,
656  XPMPPlaneData_f inDataFunc,
657  void * inRefcon,
658  XPMPPlaneID inModeS_id = 0);
659 
662 [[deprecated("Delete subclassed XPMP2::Aircraft object instead")]]
663 void XPMPDestroyPlane(XPMPPlaneID _id);
664 
665 
667 void XPMPSetPlaneVisibility(XPMPPlaneID _id, bool _bVisible);
668 
669 
678 int XPMPChangePlaneModel(XPMPPlaneID inPlaneID,
679  const char * inICAOCode,
680  const char * inAirline,
681  const char * inLivery);
682 
683 
695 int XPMPGetPlaneModelName(XPMPPlaneID inPlaneID,
696  char * outTxtBuf,
697  int outTxtBufSize);
698 
699 
705 [[deprecated("Unsafe pointer operations")]]
707  char * outICAOCode, // Can be NULL
708  char * outLivery); // Can be NULL
709 
710 
718 [[deprecated("Unsupported")]]
720  XPMPPlaneDataType inDataType,
721  void * outData);
722 
723 
726 
727 
729 long XPMPCountPlanes(void);
730 
731 
733 XPMPPlaneID XPMPGetNthPlane(long index);
734 
735 
738 
739 
743 void XPMPSetDefaultPlaneICAO(const char* _acIcaoType,
744  const char* _carIcaoType = nullptr);
745 
747 
748 /************************************************************************************
749  * MARK: PLANE OBSERVATION API
750  ************************************************************************************/
751 
752 
758 };
759 
760 
766 typedef void (*XPMPPlaneNotifier_f)(XPMPPlaneID inPlaneID,
767  XPMPPlaneNotification inNotification,
768  void * inRefcon);
769 
772 
778  void * inRefcon);
779 
780 
786  void * inRefcon);
787 
789 
790 /************************************************************************************
791  * MARK: PLANE RENDERING API (unsued in XPMP2)
792  ************************************************************************************/
793 
797 [[deprecated("Unsupported, will not be called")]]
798 typedef void (* XPMPRenderPlanes_f)(
799  int inIsBlend,
800  void * inRef);
801 
804 
808 [[deprecated("Unsupported, doesn't do anything")]]
810  void * inRef);
811 
812 
815 [[deprecated("Unsupported, doesn't do anything")]]
816 void XPMPDumpOneCycle(void);
817 
818 
820 void XPMPEnableAircraftLabels (bool _enable = true);
821 
822 
826 
827 
830 
831 
835 void XPMPSetAircraftLabelDist (float _dist_nm, bool _bCutOffAtVisibility = true);
836 
837 //
838 // MARK: MAP
839 // Enable or disable the drawing of icons on maps
840 //
841 
847 void XPMPEnableMap (bool _bEnable, bool _bLabels = true);
848 
850 
851 #ifdef __cplusplus
852 }
853 #endif
854 
855 
856 #endif
int(* XPMPIntPrefsFuncTy)(const char *_section, const char *_key, int _default)
Definition for the type of configuration callback function.
Definition: XPMPMultiplayer.h:318
void XPMPSetAircraftLabelDist(float _dist_nm, bool _bCutOffAtVisibility=true)
Definition: 2D.cpp:301
bool clampToGround
enables ground-clamping for this aircraft (can be expensive, see XPMP2::Aircraft::bClampToGround)
Definition: XPMPMultiplayer.h:98
@ xpmp_Lights_Pattern_GA
GA: one strobe flash, long beacon (-*-----—*—)
Definition: XPMPMultiplayer.h:113
@ xpmp_Lights_Pattern_EADS
Airbus+EADS: strobe flashes twice (-*-*--—*-*–), short beacon.
Definition: XPMPMultiplayer.h:112
@ xpmp_Lights_Pattern_Default
Jets: one strobe flash, short beacon (-*—*—*—)
Definition: XPMPMultiplayer.h:111
double elevation
current altitude of aircraft [ft above MSL]
Definition: XPMPMultiplayer.h:92
const char * XPMPMultiplayerEnable(void(*_callback)(void *)=nullptr, void *_refCon=nullptr)
Tries to grab control of TCAS targets (formerly known as AI/multiplayer) from X-Plane.
Definition: AIMultiplayer.cpp:1087
XPMPTransponderMode mode
current radar mode, if not xpmpTransponderMode_Standby then is plane considered for TCAS display
Definition: XPMPMultiplayer.h:201
long XPMPCountPlanes(void)
Returns the number of planes in existence.
Definition: XPMPMultiplayer.cpp:487
double lat
current position of aircraft (latitude)
Definition: XPMPMultiplayer.h:90
bool XPMPContrailsAvailable()
Are Contrails available?
Definition: Contrail.cpp:306
float pitch
pitch [degrees, psitive up]
Definition: XPMPMultiplayer.h:93
int XPMPGetPlaneModelName(XPMPPlaneID inPlaneID, char *outTxtBuf, int outTxtBufSize)
Return the name of the model, with which the given plane is rendered.
Definition: XPMPMultiplayer.cpp:437
float engRotRpm
engine rotation speed (rpm)
Definition: XPMPMultiplayer.h:176
XPMPPlaneCallbackResult XPMPGetPlaneData(XPMPPlaneID inPlane, XPMPPlaneDataType inDataType, void *outData)
Unsupported, don't use.
Definition: XPMPMultiplayer.cpp:468
char tailNum[10]
registration, tail number
Definition: XPMPMultiplayer.h:210
float yokePitch
yoke pitch ratio [0..1]
Definition: XPMPMultiplayer.h:165
XPMPPlaneDataType
This enum defines the different categories of aircraft information we can query about.
Definition: XPMPMultiplayer.h:229
@ xpmpDataType_Surfaces
physical appearance in XPMPPlaneSurfaces_t
Definition: XPMPMultiplayer.h:231
@ xpmpDataType_Radar
radar information in XPMPPlaneRadar_t
Definition: XPMPMultiplayer.h:232
@ xpmpDataType_InfoTexts
informational texts in XPMPInfoTexts_t
Definition: XPMPMultiplayer.h:233
@ xpmpDataType_Position
position data in XPMPPlanePosition_t
Definition: XPMPMultiplayer.h:230
float gearPosition
gear position [0..1]
Definition: XPMPMultiplayer.h:158
bool XPMPIsICAOValid(const char *inICAO)
Is inICAO a valid ICAO aircraft type designator?
Definition: XPMPMultiplayer.cpp:342
void XPMPSoundSetMasterVolume(float fVol=1.0f)
Set Master Volume.
Definition: Sound.cpp:1089
void XPMPRegisterPlaneNotifierFunc(XPMPPlaneNotifier_f inFunc, void *inRefcon)
Registers a callback, which is called when one of the events defined in XPMPPlaneNotification happens...
Definition: XPMPMultiplayer.cpp:537
const char * XPMPMultiplayerInit(const char *inPluginName, const char *resourceDir, XPMPIntPrefsFuncTy inIntPrefsFunc=nullptr, const char *inDefaultICAO=nullptr, const char *inPluginLogAcronym=nullptr)
Initializes the XPMP2 library. This shall be your first call to the library.
Definition: XPMPMultiplayer.cpp:129
char label[32]
label to show with the aircraft
Definition: XPMPMultiplayer.h:96
constexpr XPMPPlaneID MIN_MODE_S_ID
Minimum allowed XPMPPlaneID / mode S id.
Definition: XPMPMultiplayer.h:255
const char * XPMPSoundAdd(const char *sName, const char *filePath, bool bLoop, float coneDir=NAN, float conePitch=NAN, float coneInAngle=NAN, float coneOutAngle=NAN, float coneOutVol=NAN)
Add a sound that can later be referenced from an XPMP2::Aircraft.
Definition: Sound.cpp:1105
bool touchDown
just now is moment of touch down?
Definition: XPMPMultiplayer.h:181
void(* XPMPRenderPlanes_f)(int inIsBlend, void *inRef)
The original libxplanemp allowed to override rendering; no longer supported.
Definition: XPMPMultiplayer.h:798
int XPMPModelMatchQuality(const char *inICAO, const char *inAirline, const char *inLivery)
Tests model match quality based on the given parameters.
Definition: XPMPMultiplayer.cpp:330
void XPMPGetPlaneICAOAndLivery(XPMPPlaneID inPlane, char *outICAOCode, char *outLivery)
Returns ICAO aircraft type designator and livery of the given plane.
Definition: XPMPMultiplayer.cpp:455
char aptFrom[5]
Origin airport (ICAO)
Definition: XPMPMultiplayer.h:217
long code
current radar code, published via dataRef sim/cockpit2/tcas/targets/modeC_code
Definition: XPMPMultiplayer.h:200
float tireRotRpm
tire rotation speed (rpm)
Definition: XPMPMultiplayer.h:173
float heading
heading [degrees]
Definition: XPMPMultiplayer.h:95
float yokeRoll
yoke roll ratio [0..1]
Definition: XPMPMultiplayer.h:167
char airline[40]
airline, human readable
Definition: XPMPMultiplayer.h:215
long size
structure size
Definition: XPMPMultiplayer.h:199
float flapRatio
flap extension ratio [0..1]
Definition: XPMPMultiplayer.h:159
constexpr XPMPPlaneID MAX_MODE_S_ID
Maximum allowed XPMPPlaneID / mode S id.
Definition: XPMPMultiplayer.h:257
void XPMPSoundMute(bool bMute)
Mute all sounds (temporarily)
Definition: Sound.cpp:1097
XPMPPlaneID XPMPGetNthPlane(long index)
Returns the plane ID of the Nth plane.
Definition: XPMPMultiplayer.cpp:493
char flightNum[10]
flight number
Definition: XPMPMultiplayer.h:216
char manufacturer[40]
a/c manufacturer, human readable
Definition: XPMPMultiplayer.h:212
float label_color[4]
label base color (RGB), defaults to yellow
Definition: XPMPMultiplayer.h:100
int aiPrio
Priority for AI/TCAS consideration, the lower the earlier.
Definition: XPMPMultiplayer.h:99
void XPMPUnregisterPlaneNotifierFunc(XPMPPlaneNotifier_f inFunc, void *inRefcon)
Unregisters a notification callback. Both function pointer and refcon must match what was registered.
Definition: XPMPMultiplayer.cpp:557
char model[40]
a/c model, human readable
Definition: XPMPMultiplayer.h:213
xpmp_LightStatus lights
status of lights
Definition: XPMPMultiplayer.h:169
float engRotDegree
engine rotation angle (degrees 0..360)
Definition: XPMPMultiplayer.h:175
float reversRatio
thrust reversers ratio
Definition: XPMPMultiplayer.h:179
const char * XPMPSoundEnumerate(const char *prevName, const char **ppFilePath=nullptr)
Enumerate all sounds, including the internal ones.
Definition: Sound.cpp:1131
XPMPPlaneCallbackResult(* XPMPPlaneData_f)(XPMPPlaneID inPlane, XPMPPlaneDataType inDataType, void *ioData, void *inRefcon)
Callback function your plugin provides to return updated plane data.
Definition: XPMPMultiplayer.h:616
void XPMPDisableAircraftLabels()
Disable drawing of labels with the aircraft.
Definition: 2D.cpp:290
void XPMPEnableMap(bool _bEnable, bool _bLabels=true)
Enable or disable the drawing of aircraft icons on X-Plane's map.
Definition: Map.cpp:397
float offsetScale
how much of the surface contact correction offset should be applied [0..1]
Definition: XPMPMultiplayer.h:97
bool XPMPHasControlOfAIAircraft()
Has XPMP2 control of TCAS targets?
Definition: AIMultiplayer.cpp:1210
int XPMPChangePlaneModel(XPMPPlaneID inPlaneID, const char *inICAOCode, const char *inAirline, const char *inLivery)
Perform model matching again and change the CSL model to the resulting match.
Definition: XPMPMultiplayer.cpp:422
XPMPPlaneCallbackResult
Definfes the different responses to asking for information.
Definition: XPMPMultiplayer.h:240
@ xpmpData_Unchanged
Definition: XPMPMultiplayer.h:242
@ xpmpData_Unavailable
Definition: XPMPMultiplayer.h:241
@ xpmpData_NewData
Definition: XPMPMultiplayer.h:243
XPMPPlaneID XPMPCreatePlane(const char *inICAOCode, const char *inAirline, const char *inLivery, XPMPPlaneData_f inDataFunc, void *inRefcon, XPMPPlaneID inModeS_id=0)
Creates a new plane.
Definition: XPMPMultiplayer.cpp:353
char icaoAcType[5]
ICAO aircraft type designator, 3-4 chars.
Definition: XPMPMultiplayer.h:211
XPMPPlaneNotification
Events that trigger a notification callback.
Definition: XPMPMultiplayer.h:754
@ xpmp_PlaneNotification_Destroyed
a plane is about to be destroyed
Definition: XPMPMultiplayer.h:757
@ xpmp_PlaneNotification_ModelChanged
a plane's model changed
Definition: XPMPMultiplayer.h:756
@ xpmp_PlaneNotification_Created
a plane was just created
Definition: XPMPMultiplayer.h:755
unsigned int XPMPLightsPattern
Light flash pattern (unused in XPMP2)
Definition: XPMPMultiplayer.h:115
unsigned XPMPPlaneID
Unique ID for an aircraft created by a plugin.
Definition: XPMPMultiplayer.h:252
const char * XPMPMultiplayerInitLegacyData(const char *inCSLFolder, const char *inPluginName, const char *resourceDir, XPMPIntPrefsFuncTy inIntPrefsFunc=nullptr, const char *inDefaultICAO=nullptr, const char *inPluginLogAcronym=nullptr)
Deprecated legacy initialization of XPMP2.
Definition: XPMPMultiplayer.cpp:105
bool XPMPSoundIsEnabled()
Is Sound enabled?
Definition: Sound.cpp:1083
long size
structure size
Definition: XPMPMultiplayer.h:209
long size
size of structure
Definition: XPMPMultiplayer.h:89
const char * XPMPMultiplayerOBJ7SupportEnable(const char *inTexturePath)
Used to set the light textures for old OBJ7 models.
Definition: XPMPMultiplayer.cpp:234
const char * XPMPLoadCSLPackage(const char *inCSLFolder)
Loads CSL packages from the given folder, searching up to 5 folder levels deep.
Definition: XPMPMultiplayer.cpp:244
float spoilerRatio
spoiler extension ratio [0..1]
Definition: XPMPMultiplayer.h:160
float yokeHeading
yoke heading ratio [0..1]
Definition: XPMPMultiplayer.h:166
void XPMPDestroyPlane(XPMPPlaneID _id)
[Deprecated] Removes a plane previously created with XPMPCreatePlane()
Definition: XPMPMultiplayer.cpp:406
void XPMPSetPlaneVisibility(XPMPPlaneID _id, bool _bVisible)
Show/Hide the aircraft temporarily without destroying the object.
Definition: XPMPMultiplayer.cpp:414
void XPMPSetDefaultPlaneICAO(const char *_acIcaoType, const char *_carIcaoType=nullptr)
Define default aircraft and ground vehicle ICAO types.
Definition: XPMPMultiplayer.cpp:511
unsigned int lightFlags
this defaults to taxi | beacon | nav lights on
Definition: XPMPMultiplayer.h:129
float wingSweep
wing sweep ratio [0..1]
Definition: XPMPMultiplayer.h:163
float propRotDegree
prop rotation angle (degrees 0..360)
Definition: XPMPMultiplayer.h:177
XPMP2::Aircraft * XPMPGetAircraft(XPMPPlaneID _id)
Returns the underlying aircraft object, or nullptr if _id is invalid.
Definition: XPMPMultiplayer.cpp:504
float propRotRpm
prop rotation speed (rpm)
Definition: XPMPMultiplayer.h:178
char icaoAirline[4]
ICAO airline code.
Definition: XPMPMultiplayer.h:214
XPMPPlaneID XPMPCreatePlaneWithModelName(const char *inModelName, const char *inICAOCode, const char *inAirline, const char *inLivery, XPMPPlaneData_f inDataFunc, void *inRefcon, XPMPPlaneID inModeS_id=0)
Creates a new plane, providing a specific CSL model name.
Definition: XPMPMultiplayer.cpp:371
void XPMPGetModelInfo2(int inIndex, std::string &outModelName, std::string &outIcao, std::string &outAirline, std::string &outLivery)
Fetch information about a CSL model identified by an index.
Definition: XPMPMultiplayer.cpp:298
double lon
current position of aircraft (longitude)
Definition: XPMPMultiplayer.h:91
bool XPMPContrailsAutoEnabled()
Are automatic Contrails enabled?
Definition: Contrail.cpp:299
float tireDeflect
tire deflection (meters)
Definition: XPMPMultiplayer.h:171
float thrust
thrust ratio [0..1]
Definition: XPMPMultiplayer.h:164
void XPMPSetPluginName(const char *inPluginName, const char *inPluginLogAcronym=nullptr)
Overrides the plugin's name to be used in Log output.
Definition: XPMPMultiplayer.cpp:207
XPMPTransponderMode
These enumerations define the way the transponder of a given plane is operating.
Definition: XPMPMultiplayer.h:188
@ xpmpTransponderMode_ModeC
transponder is on
Definition: XPMPMultiplayer.h:191
@ xpmpTransponderMode_Mode3A
transponder is on
Definition: XPMPMultiplayer.h:190
@ xpmpTransponderMode_ModeC_Ident
transponder is on
Definition: XPMPMultiplayer.h:193
@ xpmpTransponderMode_ModeC_Low
transponder is on
Definition: XPMPMultiplayer.h:192
@ xpmpTransponderMode_Standby
transponder is in standby, not currently sending -> aircraft not visible on TCAS
Definition: XPMPMultiplayer.h:189
float speedBrakeRatio
speed brake extension ratio [0..1]
Definition: XPMPMultiplayer.h:161
void XPMPMultiplayerCleanup()
Clean up the multiplayer library.
Definition: XPMPMultiplayer.cpp:216
int multiIdx
OUT: set by XPMP2 to inform application about TCAS target index in use [1..63], with [1....
Definition: XPMPMultiplayer.h:101
void(* XPMPPlaneNotifier_f)(XPMPPlaneID inPlaneID, XPMPPlaneNotification inNotification, void *inRefcon)
Type of the callback function you provide, called when one of the events defined in XPMPPlaneNotifica...
Definition: XPMPMultiplayer.h:766
void XPMPDumpOneCycle(void)
Legacy debug-support function, no longer supported.
Definition: XPMPMultiplayer.cpp:593
float roll
roll [degrees, positive right]
Definition: XPMPMultiplayer.h:94
float tireRotDegree
tire rotation angle (degrees 0..360)
Definition: XPMPMultiplayer.h:172
int XPMPGetNumberOfInstalledModels()
Returns the number of loaded CSL models.
Definition: XPMPMultiplayer.cpp:260
void XPMPMultiplayerDisable()
Release TCAS targets control.
Definition: AIMultiplayer.cpp:1175
void XPMPGetModelInfo(int inIndex, const char **outModelName, const char **outIcao, const char **outAirline, const char **outLivery)
Fetch information about a CSL model identified by an index.
Definition: XPMPMultiplayer.cpp:266
bool XPMPSoundEnable(bool bEnable=true)
Enable/Disable Sound.
Definition: Sound.cpp:1068
bool XPMPDrawingAircraftLabels()
Returns if labels are currently configured to be drawn.
Definition: 2D.cpp:295
size_t XPMPAddModelDataRef(const std::string &dataRef)
Add a user-defined dataRef to the list of dataRefs supported by every plane.
Definition: Aircraft.cpp:1141
float slatRatio
slats extension ratio [0..1]
Definition: XPMPMultiplayer.h:162
int XPMPGetPlaneModelQuality(XPMPPlaneID inPlane)
Returns the match quality of the currently used model, or -1 if inPlane is invalid.
Definition: XPMPMultiplayer.cpp:477
void XPMPSetPlaneRenderer(XPMPRenderPlanes_f inRenderer, void *inRef)
The original libxplanemp allowed to override rendering; no longer supported.
Definition: XPMPMultiplayer.cpp:588
long size
structure size
Definition: XPMPMultiplayer.h:157
void XPMPLoadPlanesIfNecessary()
Legacy function only provided for backwards compatibility. Does not actually do anything.
Definition: XPMPMultiplayer.cpp:256
char aptTo[5]
Destination airport (ICAO)
Definition: XPMPMultiplayer.h:218
void XPMPEnableAircraftLabels(bool _enable=true)
Enable or disable drawing of labels with the aircraft.
Definition: 2D.cpp:261
Textual information of planes to be passed on via shared dataRefs to other plugins.
Definition: XPMPMultiplayer.h:208
This data structure contains the basic position info for an aircraft.
Definition: XPMPMultiplayer.h:88
defines information about an aircraft visible to radar.
Definition: XPMPMultiplayer.h:198
External physical configuration of the plane.
Definition: XPMPMultiplayer.h:156
Defines, which lights of the aircraft are on.
Definition: XPMPMultiplayer.h:128
Actual representation of all aircraft in XPMP2.
Definition: XPMPAircraft.h:178
Definition: XPMPAircraft.h:70