Dead Reckoning
Create DeadReckoning struct that handles extrapolation. The public api is very similar as it was in interpolation, where a replicated property can be registered to use dead reckoning by calling register_property of the DeadReckoningSystem accessible through the index function.
DeadReckoning
- Instanced for each extrapolated property
- Holds the extrapolation function and the maximum extrapolation time
- Performs the extrapolation
- Handles state discrepancy by interpolating to server state if the states diverge enough
DeadReckoningSystem
- public interface to be used by programmers
- Tracks extrapolated properties and updates them with extrapolated values each frame
reflection_distance
Helper function in the utils namespace that returns a distance between two reflection values. Used in DeadReckoning to decide if it should perform correction (dead_reckoning.cpp:17). This will also be useful for client-side prediction, where I will compare state difference (or distance) in the same way I in dead reckoning.
Interpolation
- Can now extrapolate when it runs out of snapshots
- Extrapolation is enabled by providing extrapolation function
InterpolationSystem
- Added api functions that enable programmer to assign extrapolation functions to interpolated properties (which also enables extrapolation on the given property)