Rebel Fork Framework
Urho3D::NetworkTime Class Reference

#include <Urho3D/Replica/NetworkTime.h>

Public Member Functions

 NetworkTime (NetworkFrame frame, float subFrame=0.0f)
 
NetworkFrame Frame () const
 
float Fraction () const
 
ea::string ToString () const
 
NetworkTimeoperator+= (double rhs)
 
NetworkTimeoperator-= (double rhs)
 
NetworkTime operator+ (double rhs) const
 
NetworkTime operator- (double rhs) const
 
double operator- (const NetworkTime &rhs) const
 
bool operator== (const NetworkTime &rhs) const
 
bool operator!= (const NetworkTime &rhs) const
 

Static Public Member Functions

static NetworkTime FromDouble (double frame)
 

Private Member Functions

void Normalize ()
 
void AddDelta (double delta)
 
double GetDelta (const NetworkTime &origin) const
 

Private Attributes

NetworkFrame frame_ {}
 
float fraction_ {}
 

Detailed Description

Represents network-synchronized time of client and server. Consists of deterministic frame index and approximate sub-frame factor that indicates relative time between the beginning of the frame and the next frame. Sub-frame factor is always in range [0, 1). Overflow of integer frame index is supported. Deltas should be relatively small in order to work as expected: |delta| < 2kkk.


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