Rebel Fork Framework
Urho3D::NetworkValueSampler< T, Traits > Class Template Reference

#include <Urho3D/Replica/NetworkValue.h>

Classes

struct  InterpolationCache
 
struct  TimeAndValue
 

Public Types

using NetworkValueType = NetworkValue< T, Traits >
 
using InternalType = typename Traits::InternalType
 
using ReturnType = typename Traits::ReturnType
 

Public Member Functions

void Setup (unsigned maxExtrapolation, float smoothingConstant, float snapThreshold)
 Update sampler settings.
 
ea::optional< ReturnType > UpdateAndSample (const NetworkValueType &value, const NetworkTime &time, float timeStep)
 Update sampler state for new time and return current value.
 

Private Member Functions

float GetExtrapolationFactor (const NetworkTime &time, NetworkFrame baseFrame, unsigned maxExtrapolation) const
 
void UpdateCorrection (const NetworkValueType &value, float timeStep)
 
void UpdateCache (const NetworkValueType &value, NetworkFrame frame)
 
ReturnType CalculateValueFromCache (const NetworkValueType &value, const NetworkTime &time)
 

Private Attributes

unsigned maxExtrapolation_ {}
 
float smoothingConstant_ {}
 
float snapThreshold_ {M_LARGE_VALUE}
 
ea::optional< InterpolationCacheinterpolationCache_
 
ea::optional< TimeAndValuepreviousValue_
 
ea::optional< NetworkFrameextrapolationFrame_
 
ReturnType valueCorrection_ {}
 

Detailed Description

template<class T, class Traits = NetworkValueTraits<T>>
class Urho3D::NetworkValueSampler< T, Traits >

Helper class that manages continuous sampling of NetworkValue on the client side. Performs extrapolation and error smoothing.


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