group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
InterpolationBuffer::Sample Struct Reference

One snapshot's worth of interpolatable state. More...

#include <InterpolationBuffer.hpp>

Collaboration diagram for InterpolationBuffer::Sample:
[legend]

Public Attributes

Uint64 captureNs = 0
 SDL_GetTicksNS() at append time.
glm::vec3 position {0.0f}
 World-space position.
glm::vec3 velocity {0.0f}
 World-space velocity (PR-28).
float yaw = 0.0f
 Player yaw (rad). 0 for non-player entities.
float pitch = 0.0f
 Player pitch (rad, PR-28).
std::uint8_t moveMode = 0
 MoveMode enum cast (PR-28).
std::uint8_t wallRunSide = 0
 WallSide enum cast (PR-28).
bool grounded = false
 PR-28.
bool sprinting = false
 PR-28.
bool crouching = false
 PR-28.
AnimSnapshot anim {}
 PR-29: server-authoritative animation state at this sample's tick.

Detailed Description

One snapshot's worth of interpolatable state.

PR-28: extended beyond (position, yaw) to also carry the inputs the client's CharacterAnimator needs each frame. Pre-PR-28 the renderer interp-delayed the entity's POSITION via this buffer while the animator continued to read the LATEST-snapshot Velocity

  • pitch + PlayerVisState bits — so the animator was poseing at "now" while the body was rendered at "now − cl_interp". At 30+ ms render delay the running-vs-idle, walk-vs-sprint, and air-vs-ground flags would flip ahead of the visible motion, producing the 0.41-median anim-state delta the PR-27a telemetry caught. Storing the animator inputs here and sampling them at the same render time aligns body and pose.

Member Data Documentation

◆ anim

AnimSnapshot InterpolationBuffer::Sample::anim {}

PR-29: server-authoritative animation state at this sample's tick.

Replicated via the Synced tuple, captured here per-snapshot so the renderer can render the body's interp-delayed pose with CharacterAnimator:: renderFromServer(buffered.anim, …) instead of letting the client's animator free-run and accumulate timeRatio drift against the server's authoritative animator.

◆ captureNs

Uint64 InterpolationBuffer::Sample::captureNs = 0

SDL_GetTicksNS() at append time.

◆ crouching

bool InterpolationBuffer::Sample::crouching = false

PR-28.

◆ grounded

bool InterpolationBuffer::Sample::grounded = false

PR-28.

◆ moveMode

std::uint8_t InterpolationBuffer::Sample::moveMode = 0

MoveMode enum cast (PR-28).

◆ pitch

float InterpolationBuffer::Sample::pitch = 0.0f

Player pitch (rad, PR-28).

◆ position

glm::vec3 InterpolationBuffer::Sample::position {0.0f}

World-space position.

◆ sprinting

bool InterpolationBuffer::Sample::sprinting = false

PR-28.

◆ velocity

glm::vec3 InterpolationBuffer::Sample::velocity {0.0f}

World-space velocity (PR-28).

◆ wallRunSide

std::uint8_t InterpolationBuffer::Sample::wallRunSide = 0

WallSide enum cast (PR-28).

◆ yaw

float InterpolationBuffer::Sample::yaw = 0.0f

Player yaw (rad). 0 for non-player entities.


The documentation for this struct was generated from the following file: