![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Dead Reckoning implementation for latency hiding in networked games. More...
Include dependency graph for n_dead_reckoning.c:Go to the source code of this file.
Functions | |
| static DR_VEC3 | cubic_bezier (DR_VEC3 p0, DR_VEC3 p1, DR_VEC3 p2, DR_VEC3 p3, double t) |
| Evaluate a cubic Bezier curve at parameter t in [0, 1]. | |
| bool | dr_entity_check_threshold (const DR_ENTITY *entity, const DR_VEC3 *true_pos, const DR_VEC3 *true_vel, const DR_VEC3 *true_acc, double time) |
| Check whether the owner's true state has diverged from the dead reckoned prediction beyond the configured threshold. | |
| void | dr_entity_compute (DR_ENTITY *entity, double time, DR_VEC3 *out_pos) |
| Compute the dead reckoned display position at a given time. | |
| DR_ENTITY * | dr_entity_create (DR_ALGO algo, DR_BLEND blend_mode, double pos_threshold, double blend_time) |
| Create a new dead reckoning entity. | |
| void | dr_entity_destroy (DR_ENTITY **entity_ptr) |
| Destroy a dead reckoning entity and set the pointer to NULL. | |
| DR_VEC3 | dr_entity_extrapolate (const DR_ENTITY *entity, const DR_STATE *state, double dt) |
| Extrapolate a kinematic state forward by dt seconds. | |
| void | dr_entity_receive_state (DR_ENTITY *entity, const DR_VEC3 *pos, const DR_VEC3 *vel, const DR_VEC3 *acc, double time) |
| Receive a new authoritative state update from the network. | |
| void | dr_entity_set_algo (DR_ENTITY *entity, DR_ALGO algo) |
| Set the extrapolation algorithm. | |
| void | dr_entity_set_blend_mode (DR_ENTITY *entity, DR_BLEND blend_mode) |
| Set the convergence blending mode. | |
| void | dr_entity_set_blend_time (DR_ENTITY *entity, double blend_time) |
| Set the convergence blend duration. | |
| void | dr_entity_set_position (DR_ENTITY *entity, const DR_VEC3 *pos, const DR_VEC3 *vel, const DR_VEC3 *acc, double time) |
| Force-set entity position without triggering convergence blending. | |
| void | dr_entity_set_threshold (DR_ENTITY *entity, double threshold) |
| Set the position error threshold for triggering network updates. | |
Dead Reckoning implementation for latency hiding in networked games.
Implements the algorithms described in:
The three convergence modes:
Definition in file n_dead_reckoning.c.
Evaluate a cubic Bezier curve at parameter t in [0, 1].
B(t) = (1-t)^3 * P0 + 3(1-t)^2*t * P1 + 3(1-t)*t^2 * P2 + t^3 * P3
| p0 | start point |
| p1 | control point 1 |
| p2 | control point 2 |
| p3 | end point |
| t | parameter in [0, 1] |
Definition at line 61 of file n_dead_reckoning.c.
References DR_VEC3::x, DR_VEC3::y, and DR_VEC3::z.
Referenced by dr_entity_compute().
Here is the caller graph for this function: