|
nanoMMO 0.97.8
Building an MMO: The Engineering Series
|
#include <prediction.h>
Public Member Functions | |
| void | Walk (const Terrain &terrain, uint32_t sequence, float direction_x, float direction_z, bool run, float seconds) |
| void | Correct (const Terrain &terrain, float x, float z, uint32_t acked, float seconds) |
| void | Settle (float seconds) |
| Fades what the last corrections moved, over the frame's time. | |
| float | x () const |
| float | z () const |
| float | shown_x () const |
| float | shown_z () const |
| bool | placed () const |
| std::size_t | pending () const |
| Inputs sent and not yet acked. | |
Where you are before the server says so. Each tick's keys walk you at once, as the server will when they reach it, and each world from the server puts you where it has you, after the last input it applied, and walks you again through the ones it hasn't yet.
Definition at line 17 of file prediction.h.
| void nanommo::Prediction::Correct | ( | const Terrain & | terrain, |
| float | x, | ||
| float | z, | ||
| uint32_t | acked, | ||
| float | seconds ) |
Where the server has you, after the input it acked, and how long each of its ticks is. A small difference from where we had you goes away over a moment, and a large one, such as going through a gate, at once.
Definition at line 37 of file prediction.cc.
|
inline |
Inputs sent and not yet acked.
Definition at line 42 of file prediction.h.
|
inline |
Definition at line 39 of file prediction.h.
| void nanommo::Prediction::Settle | ( | float | seconds | ) |
Fades what the last corrections moved, over the frame's time.
Definition at line 91 of file prediction.cc.
|
inline |
Definition at line 37 of file prediction.h.
|
inline |
Definition at line 38 of file prediction.h.
| void nanommo::Prediction::Walk | ( | const Terrain & | terrain, |
| uint32_t | sequence, | ||
| float | direction_x, | ||
| float | direction_z, | ||
| bool | run, | ||
| float | seconds ) |
A tick of the keys sent with the sequence: a direction, which is zero for standing still, and whether you run.
Definition at line 25 of file prediction.cc.
|
inline |
Where we have you, and where to draw you, with what's left of a correction still to fade.
Definition at line 35 of file prediction.h.
|
inline |
Definition at line 36 of file prediction.h.