![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
Where every player was, for as long as it takes a shot to arrive. More...
#include <rewind.h>
Public Member Functions | |
| void | record (EntityId entity, uint32_t tick, const glm::vec3 &position, const glm::quat &rotation) |
Remember where entity was on tick, in the server's own clock. | |
| bool | poseAt (EntityId entity, double tick, glm::vec3 &position, glm::quat &rotation) const |
Where entity was at tick, which may fall between two. | |
| void | forget (EntityId entity) |
Forget entity, for a seat changing hands. | |
Static Public Attributes | |
| static constexpr size_t | HISTORY_TICKS = 64 |
| Ticks of history kept per player. | |
Where every player was, for as long as it takes a shot to arrive.
A player aims at a moment already past, so the server keeps recent player poses and puts them back for one query. Only players: anything else is judged against the present and can miss for that reason.
| bool Vkm::Engine::NetRewind::poseAt | ( | EntityId | entity, |
| double | tick, | ||
| glm::vec3 & | position, | ||
| glm::quat & | rotation ) const |
Where entity was at tick, which may fall between two.
Fractional: a client's render clock draws between ticks.
| entity | The player asked about. |
| tick | The moment wanted, in the server's own clock. |
| position | Filled with where it was. |
| rotation | Filled with how it was turned. |
| void Vkm::Engine::NetRewind::forget | ( | EntityId | entity | ) |
Forget entity, for a seat changing hands.
A stale ring would rewind the next player to the last one's positions.
| entity | The departed player's entity. |
|
staticconstexpr |
Ticks of history kept per player.
A second at Config::DEFAULT_TICK_RATE, covering a 400 ms round trip plus the interpolation delay.