|
group2 0.1.0
CSE 125 Group 2
|
Ring buffer of recent hitbox snapshots for one entity. More...
#include <HitboxHistory.hpp>
Public Attributes | |
| std::array< HitboxHistorySample, k_capacity > | ring {} |
| std::size_t | head = 0 |
| Index where the next push lands. Wraps modulo k_capacity. | |
| std::size_t | count = 0 |
| Number of samples written so far, capped at k_capacity. | |
Static Public Attributes | |
| static constexpr std::size_t | k_capacity = 64 |
| Number of past samples retained per entity. | |
Ring buffer of recent hitbox snapshots for one entity.
PR-12 bumped capacity from 32 → 64 ticks (~500 ms @ 128 Hz) so the ring covers the new worst-case rewind: RTT/2 (capped 200 ms = 25 ticks)
| std::size_t HitboxHistory::count = 0 |
Number of samples written so far, capped at k_capacity.
Used so consumers know which slots are populated before the ring has wrapped around the first time.
| std::size_t HitboxHistory::head = 0 |
Index where the next push lands. Wraps modulo k_capacity.
|
staticconstexpr |
Number of past samples retained per entity.
PR-12: sized so that the highest-allowed compensated lag (k_maxLagCompTicks = 64 ticks ≈ 500 ms @ 128 Hz) fits inside the ring. Power of two for cheap modulo.
| std::array<HitboxHistorySample, k_capacity> HitboxHistory::ring {} |