XPMP2
X-Plane multiplayer library 2 - using instancing
Namespaces | Macros | Functions | Variables
Contrail.cpp File Reference

Manages contrails for an aircraft. More...

#include "XPMP2.h"

Namespaces

 XPMP2
 

Macros

#define DR_NAME_THRUST   "libxplanemp/controls/thrust_ratio"
 
#define DR_NAME_LIFETIME   "libxplanemp/contrail/lifetime"
 

Functions

float XPMP2::obj_get_float (void *)
 
int XPMP2::obj_get_float_array (void *, float *, int, int inCount)
 See obj_get_float() More...
 
bool XPMP2::ContrailInit ()
 Initialize the Contrail module and load the Contrail object. More...
 
void XPMP2::ContrailCleanup ()
 Graceful shutdown. More...
 
bool XPMPContrailsAutoEnabled ()
 Are automatic Contrails enabled? More...
 
bool XPMPContrailsAvailable ()
 Are Contrails available? More...
 

Variables

XPLMObjectRef XPMP2::ghContrailObj = nullptr
 The one global Contrail object. More...
 
XPLMDataRef XPMP2::ghDrContrailLifeTime = nullptr
 The handle for the registered Contrail LifeTime dataRef. More...
 

Detailed Description

Manages contrails for an aircraft.

Contrails are created using X-Planes particle system. The particle emitter is embedded in one mostly empty object file in Resources/Contrail/Contrail.obj. This object is loaded once and then instanciated for any plane that needs contrails. Rendering particles can eat some FPS, hence it is up to the plugin to tell XPMP2 how many contrails to draw. Realistically, there should be one per engine, but that could dramatically increase the number of particles, so it might be advisable to just have one contrail rendered for a good effect but way less FPS hit.

See also
https://developer.x-plane.com/article/x-plane-11-particle-system/
Author
Birger Hoppe

Macro Definition Documentation

◆ DR_NAME_LIFETIME

#define DR_NAME_LIFETIME   "libxplanemp/contrail/lifetime"

◆ DR_NAME_THRUST

#define DR_NAME_THRUST   "libxplanemp/controls/thrust_ratio"

Function Documentation

◆ XPMPContrailsAutoEnabled()

bool XPMPContrailsAutoEnabled ( )

Are automatic Contrails enabled?

Configured in a consistent way to automatically show contrails? (Max Altitude > Min Altitude) If off, use XPMP2::Aircraft::ContrailTrigger() or XPMP2::Aircraft::ContrailRequest().

◆ XPMPContrailsAvailable()

bool XPMPContrailsAvailable ( )

Are Contrails available?

Could return false e.g. if Resources/Contrail/Contrail.obj could not be found or loaded.