The Nebula Device 3: Math::Extrapolator< TYPE > Class Template Reference

The Nebula Device 3

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.

(C) 2009 Radon Labs GmbH


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
bool ReadValue (Timing::Time forTime, TYPE &oPos, TYPE &oVel) const
Timing::Time EstimateLatency () const
 
Returns:
the current estimation of latency between the sender and this interpolator.

Timing::Time EstimateUpdateTime () const
 
Returns:
the current estimation of frequency of updates that the sender will send.


Member Function Documentation

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()).

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()).