Nebula
|
#include <extrapolator.h>
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 |
Math::Extrapolator< TYPE >::Extrapolator | ( | ) |
constructor
|
virtual |
destructor
bool Math::Extrapolator< TYPE >::AddSample | ( | Timing::Time | packetTime, |
Timing::Time | curTime, | ||
const TYPE & | pos ) |
add sample without velocity, velocity is compute from positions
bool Math::Extrapolator< TYPE >::AddSample | ( | Timing::Time | packetTime, |
Timing::Time | curTime, | ||
const TYPE & | pos, | ||
const TYPE & | vel ) |
add sample with given velocity
Timing::Time Math::Extrapolator< TYPE >::EstimateLatency | ( | ) | const |
|
private |
is this packet newer than already received
Timing::Time Math::Extrapolator< TYPE >::EstimateUpdateTime | ( | ) | const |
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()).
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()).
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.
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.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |