|
group2 0.1.0
CSE 125 Group 2
|
Classes | |
| struct | InterpolatedTransform |
| Result of sampling an entity's interpolation buffer. More... | |
| struct | SampleInputs |
| PR-28: full sample payload. More... | |
Functions | |
| void | appendSample (entt::registry ®istry, entt::entity e, Uint64 captureNs, const SampleInputs &inputs) |
Append a snapshot sample at captureNs into the entity's InterpolationBuffer, creating the component on first call. | |
| InterpolatedTransform | sample (const entt::registry ®istry, entt::entity e, Uint64 renderTimeNs, const glm::vec3 &fallbackPos, float fallbackYaw) |
Look up e's interpolated transform at renderTimeNs. | |
| void entity_interpolation::appendSample | ( | entt::registry & | registry, |
| entt::entity | e, | ||
| Uint64 | captureNs, | ||
| const SampleInputs & | inputs ) |
Append a snapshot sample at captureNs into the entity's InterpolationBuffer, creating the component on first call.
O(1) — single ring slot write. Caller is responsible for excluding the local player (whose render path uses prediction, not interpolation).
| registry | Client registry. |
| e | Entity that just had a snapshot applied to it. |
| captureNs | Wall-clock timestamp (SDL_GetTicksNS()) of the apply. Must be monotonically non-decreasing per-entity for the bracket-search in sample to work correctly; in practice callers pass the same now for every entity they touch in a single dispatchMessage. |
| inputs | Full sample payload — position + velocity + yaw + pitch + animator-relevant PlayerVisState bits. |
| InterpolatedTransform entity_interpolation::sample | ( | const entt::registry & | registry, |
| entt::entity | e, | ||
| Uint64 | renderTimeNs, | ||
| const glm::vec3 & | fallbackPos, | ||
| float | fallbackYaw ) |
Look up e's interpolated transform at renderTimeNs.
Walks the entity's InterpolationBuffer for the two adjacent samples bracketing renderTimeNs and lerps between them. Behaviour at the edges (mirrors Source engine and Phase 5a's freeze-no-extrapolate policy):
O(8) worst case — capacity is fixed at InterpolationBuffer::k_capacity.