Nebula
Loading...
Searching...
No Matches
Math::Extrapolator< TYPE > Class Template Reference

#include <extrapolator.h>

Detailed Description

template<class TYPE>
class Math::Extrapolator< TYPE >

Extrapolator maintains state about updates for remote entities, and will generate smooth guesses about where those entities will be based on previously received data.

This implementation is based on http://www.mindcontrol.org/~hplus/epic/ Its adapted for use with point and vector class.

Public Member Functions

 Extrapolator ()
 constructor
 
virtual ~Extrapolator ()
 destructor
 
bool AddSample (Timing::Time packetTime, Timing::Time curTime, const TYPE &pos)
 add sample without velocity, velocity is compute from positions
 
bool AddSample (Timing::Time packetTime, Timing::Time curTime, const TYPE &pos, const TYPE &vel)
 add sample with given velocity
 
void Reset (Timing::Time packetTime, Timing::Time curTime, const TYPE &pos)
 Re-set the Extrapolator's idea of time, velocity and position.
 
void Reset (Timing::Time packetTime, Timing::Time curTime, const TYPE &pos, const TYPE &vel)
 Re-set the Extrapolator's idea of time, velocity and position.
 
bool ReadValue (Timing::Time forTime, TYPE &oPos) const
 Return an estimate of the interpolated position at a given global time (which typically will be greater than the curTime passed into AddSample()).
 
bool ReadValue (Timing::Time forTime, TYPE &oPos, TYPE &oVel) const
 Return an estimate of the interpolated position at a given global time (which typically will be greater than the curTime passed into AddSample()).
 
Timing::Time EstimateLatency () const
 
Timing::Time EstimateUpdateTime () const
 

Private Member Functions

bool Estimates (Timing::Time packetTime, Timing::Time curTime)
 is this packet newer than already received
 

Private Attributes

TYPE snapPos
 
TYPE snapVel
 
TYPE aimPos
 
TYPE lastPacketPos
 
Timing::Time snapTime
 
Timing::Time aimTime
 
Timing::Time lastPacketTime
 
Timing::Time latency
 
Timing::Time updateTime
 

Constructor & Destructor Documentation

◆ Extrapolator()

template<class TYPE >
Math::Extrapolator< TYPE >::Extrapolator ( )

constructor

◆ ~Extrapolator()

template<class TYPE >
Math::Extrapolator< TYPE >::~Extrapolator ( )
virtual

destructor

Member Function Documentation

◆ AddSample() [1/2]

template<class TYPE >
bool Math::Extrapolator< TYPE >::AddSample ( Timing::Time packetTime,
Timing::Time curTime,
const TYPE & pos )

add sample without velocity, velocity is compute from positions

◆ AddSample() [2/2]

template<class TYPE >
bool Math::Extrapolator< TYPE >::AddSample ( Timing::Time packetTime,
Timing::Time curTime,
const TYPE & pos,
const TYPE & vel )

add sample with given velocity

◆ EstimateLatency()

template<class TYPE >
Timing::Time Math::Extrapolator< TYPE >::EstimateLatency ( ) const
Returns
the current estimation of latency between the sender and this interpolator.

◆ Estimates()

template<class TYPE >
bool Math::Extrapolator< TYPE >::Estimates ( Timing::Time packetTime,
Timing::Time curTime )
private

is this packet newer than already received

◆ EstimateUpdateTime()

template<class TYPE >
Timing::Time Math::Extrapolator< TYPE >::EstimateUpdateTime ( ) const
Returns
the current estimation of frequency of updates that the sender will send.

◆ ReadValue() [1/2]

template<class TYPE >
bool Math::Extrapolator< TYPE >::ReadValue ( Timing::Time forTime,
TYPE & oPos ) const

Return an estimate of the interpolated position at a given global time (which typically will be greater than the curTime passed into AddSample()).

◆ ReadValue() [2/2]

template<class TYPE >
bool Math::Extrapolator< TYPE >::ReadValue ( Timing::Time forTime,
TYPE & oPos,
TYPE & oVel ) const

Return an estimate of the interpolated position at a given global time (which typically will be greater than the curTime passed into AddSample()).

◆ Reset() [1/2]

template<class TYPE >
void Math::Extrapolator< TYPE >::Reset ( Timing::Time packetTime,
Timing::Time curTime,
const TYPE & pos )

Re-set the Extrapolator's idea of time, velocity and position.

◆ Reset() [2/2]

template<class TYPE >
void Math::Extrapolator< TYPE >::Reset ( Timing::Time packetTime,
Timing::Time curTime,
const TYPE & pos,
const TYPE & vel )

Re-set the Extrapolator's idea of time, velocity and position.

Member Data Documentation

◆ aimPos

template<class TYPE >
TYPE Math::Extrapolator< TYPE >::aimPos
private

◆ aimTime

template<class TYPE >
Timing::Time Math::Extrapolator< TYPE >::aimTime
private

◆ lastPacketPos

template<class TYPE >
TYPE Math::Extrapolator< TYPE >::lastPacketPos
private

◆ lastPacketTime

template<class TYPE >
Timing::Time Math::Extrapolator< TYPE >::lastPacketTime
private

◆ latency

template<class TYPE >
Timing::Time Math::Extrapolator< TYPE >::latency
private

◆ snapPos

template<class TYPE >
TYPE Math::Extrapolator< TYPE >::snapPos
private

◆ snapTime

template<class TYPE >
Timing::Time Math::Extrapolator< TYPE >::snapTime
private

◆ snapVel

template<class TYPE >
TYPE Math::Extrapolator< TYPE >::snapVel
private

◆ updateTime

template<class TYPE >
Timing::Time Math::Extrapolator< TYPE >::updateTime
private

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