mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-03 20:03:50 +00:00
refactor: name FNV-1a/transport constants, fix dead code, add comments
- vk_context: name FNV-1a hash constants (kFnv1aOffsetBasis/kFnv1aPrime) with why-comment on algorithm choice for sampler cache - transport_manager: collapse redundant if/else that both set looping=false into single unconditional assignment, add why-comment explaining the time-closed path design - transport_manager: hoist duplicate kMinFallbackZOffset constants out of separate if-blocks, add why-comment on icebreaker Z clamping - entity: expand velocity smoothing comment — explain 65/35 EMA ratio and its tradeoff (jitter suppression vs direction change lag)
This commit is contained in:
parent
a940859e6a
commit
8c7db3e6c8
3 changed files with 21 additions and 13 deletions
|
|
@ -93,7 +93,9 @@ public:
|
|||
float impliedVX = (destX - fromX) / durationSec;
|
||||
float impliedVY = (destY - fromY) / durationSec;
|
||||
float impliedVZ = (destZ - fromZ) / durationSec;
|
||||
// Exponentially smooth velocity so jittery packet timing doesn't snap speed.
|
||||
// Exponential moving average on velocity — 65% new sample, 35% previous.
|
||||
// Smooths out jitter from irregular server update intervals (~200-600ms)
|
||||
// without introducing visible lag on direction changes.
|
||||
const float alpha = 0.65f;
|
||||
velX_ = alpha * impliedVX + (1.0f - alpha) * velX_;
|
||||
velY_ = alpha * impliedVY + (1.0f - alpha) * velY_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue