XPPlanes
X-Plane plugin to display additional planes based on network data
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Plane Class Reference

#include <Plane.h>

+ Inheritance diagram for Plane:

Public Member Functions

 Plane (ptrFlightDataTy &&from, ptrFlightDataTy &&to)
 Create a new plane from two flight data objects. More...
 
 ~Plane () override
 Destructor cleans up all resources acquired. More...
 
void UpdatePosition (float _elapsedSinceLastCall, int _flCounter) override
 Called by XPMP2 right before updating the aircraft's placement in the world. More...
 
float GetLift () const override
 Lift produced. Either given in wake.lift or simple defaults apply. More...
 
void UpdateFromFlightData (listFlightDataTy &listFD, const tsTy &now)
 Regularly called to update from/to positions from the list of available flight data. More...
 
void DetermineGndAlt (ptrFlightDataTy &fd)
 Determine ground altitude of a given location. More...
 
bool ShallBeRemoved (const tsTy &cutOff) const
 Determines if this plane shall be removed, sets bToBeRemoved if so. More...
 

Protected Member Functions

void TakeOverData (bool bFrom, ptrFlightDataTy &&source)
 Prepare given position for usage after taking over from passed-in smart pointer. More...
 

Static Protected Member Functions

static void OncePerCycle (int _flCounter)
 perform once-per-cycle activities More...
 

Protected Attributes

ptrFlightDataTy fdFrom
 the from-position for interpolation More...
 
ptrFlightDataTy fdTo
 the to-position for interpolation More...
 
XPLMDrawInfo_t diFrom
 the from-position in XP speak More...
 
XPLMDrawInfo_t diTo
 
float f = 0.5f
 
float tTouchDown = NAN
 time since touch down
More...
 

Static Protected Attributes

static int flCounter = -1
 flight loop counter of last update More...
 
static tsTy::rep ticksNow = 0
 'now' timestamp More...
 

Constructor & Destructor Documentation

◆ Plane()

Plane::Plane ( ptrFlightDataTy &&  from,
ptrFlightDataTy &&  to 
)

Create a new plane from two flight data objects.

◆ ~Plane()

Plane::~Plane ( )
override

Destructor cleans up all resources acquired.

Member Function Documentation

◆ DetermineGndAlt()

void Plane::DetermineGndAlt ( ptrFlightDataTy fd)

Determine ground altitude of a given location.

◆ GetLift()

float Plane::GetLift ( ) const
override

Lift produced. Either given in wake.lift or simple defaults apply.

◆ OncePerCycle()

void Plane::OncePerCycle ( int  _flCounter)
staticprotected

perform once-per-cycle activities

◆ ShallBeRemoved()

bool Plane::ShallBeRemoved ( const tsTy cutOff) const

Determines if this plane shall be removed, sets bToBeRemoved if so.

Reasons for removal:

  • no updates for too long
  • too far away from camera

◆ TakeOverData()

void Plane::TakeOverData ( bool  bFrom,
ptrFlightDataTy &&  source 
)
protected

Prepare given position for usage after taking over from passed-in smart pointer.

Parameters
bFromStore into from variables? Otherwise into to
sourceFrom where to take over the data

◆ UpdateFromFlightData()

void Plane::UpdateFromFlightData ( listFlightDataTy listFD,
const tsTy now 
)

Regularly called to update from/to positions from the list of available flight data.

◆ UpdatePosition()

void Plane::UpdatePosition ( float  _elapsedSinceLastCall,
int  _flCounter 
)
override

Called by XPMP2 right before updating the aircraft's placement in the world.

Member Data Documentation

◆ diFrom

XPLMDrawInfo_t Plane::diFrom
protected

the from-position in XP speak

◆ diTo

XPLMDrawInfo_t Plane::diTo
protected

the to-position in XP speak

◆ f

float Plane::f = 0.5f
protected

The factor: increases from 0 to 1 while now is between from and to (->interpolation), and becomes larger than 1 if now increases even beyond to (-> extrapolation)

◆ fdFrom

ptrFlightDataTy Plane::fdFrom
protected

the from-position for interpolation

◆ fdTo

ptrFlightDataTy Plane::fdTo
protected

the to-position for interpolation

◆ flCounter

int Plane::flCounter = -1
staticprotected

flight loop counter of last update

◆ ticksNow

tsTy::rep Plane::ticksNow = 0
staticprotected

'now' timestamp

'now' timestamp in ticks since epoch

◆ tTouchDown

float Plane::tTouchDown = NAN
protected

time since touch down


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