Cafu Engine
DeathMatch::InterpolatorT< T > Class Template Reference

Linearly interpolates a value over a period of time. More...

#include "Interpolator.hpp"

Inheritance diagram for DeathMatch::InterpolatorT< T >:

Public Member Functions

 InterpolatorT (T &v)
 
void ReInit ()
 Used to re-initialize this interpolator at the current value. More...
 
void NotifyOverwriteUpdate ()
 The user calls this method in order to let the interpolator know that the interpolated value was changed externally. More...
 
void UpdateRef (const T &Ref)
 Sets a new reference value: the value that we should interpolate to. More...
 
void Interpolate (float Time)
 Advances the interpolation over the given time. More...
 

Detailed Description

template<class T>
class DeathMatch::InterpolatorT< T >

Linearly interpolates a value over a period of time.

The course of the interpolation is adapted/updated whenever a new reference value is set. This is mostly intended for game entities on clients, where we interpolate from the "current" value towards the reference value of the most recent server update. If the subsequent server update happens to arrives later than the one before it, our interpolation may (briefly) turn into an extrapolation for bridging the gap.

Member Function Documentation

template<class T >
void DeathMatch::InterpolatorT< T >::Interpolate ( float  Time)
inlinevirtual

Advances the interpolation over the given time.

Implements DeathMatch::ApproxBaseT.

template<class T >
void DeathMatch::InterpolatorT< T >::NotifyOverwriteUpdate ( )
inlinevirtual

The user calls this method in order to let the interpolator know that the interpolated value was changed externally.

Implements DeathMatch::ApproxBaseT.

template<class T >
void DeathMatch::InterpolatorT< T >::ReInit ( )
inlinevirtual

Used to re-initialize this interpolator at the current value.

Implements DeathMatch::ApproxBaseT.

template<class T >
void DeathMatch::InterpolatorT< T >::UpdateRef ( const T &  Ref)
inline

Sets a new reference value: the value that we should interpolate to.


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