group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
EntityInterpolation.hpp File Reference

Append + lookup helpers for the per-entity InterpolationBuffer. More...

#include "ecs/components/InterpolationBuffer.hpp"
#include <SDL3/SDL_stdinc.h>
#include <entt/entity/fwd.hpp>
#include <glm/vec3.hpp>
Include dependency graph for EntityInterpolation.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  entity_interpolation::InterpolatedTransform
 Result of sampling an entity's interpolation buffer. More...
struct  entity_interpolation::SampleInputs
 PR-28: full sample payload. More...

Namespaces

namespace  entity_interpolation

Functions

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.
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.

Detailed Description

Append + lookup helpers for the per-entity InterpolationBuffer.

PR-11 (server-perf): client-side render-delay interpolation. Network thread calls appendSample after each snapshot apply; the renderer calls sample to read back the (position, yaw) the entity should be drawn at for the current frame's "delayed-now" timestamp.

The two helpers are decoupled from Client so they can be unit-tested in isolation and reused if other places (e.g. replay scrubber) want to drive interpolation timestamps manually.