group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
InputSnapshot Struct Reference

One tick of player input, stamped with the tick it was sampled on. More...

#include <InputSnapshot.hpp>

Public Attributes

uint32_t tick {0}
 Physics tick this snapshot was sampled on.
 
bool forward {false}
 W key.
 
bool back {false}
 S key.
 
bool left {false}
 A key.
 
bool right {false}
 D key.
 
bool jump {false}
 Space key.
 
bool crouch {false}
 Left Ctrl key.
 
bool sprint {false}
 Left Shift key.
 
bool grapple {false}
 Middle mouse button / E key.
 
bool shooting {false}
 Primary fire button.
 
float yaw {0.0f}
 Horizontal look angle in radians (accumulated from mouse X deltas).
 
float pitch {0.0f}
 Vertical look angle in radians, clamped to [-89°, +89°] by InputSampleSystem.
 
float roll {0.0f}
 Currently always 0; reserved for dynamic movement tilt (wallrun lean, strafe tilt).
 
float prevTickYaw {0.0f}
 Yaw/pitch captured at the start of the most-recent physics tick.
 
float prevTickPitch {0.0f}
 

Detailed Description

One tick of player input, stamped with the tick it was sampled on.

Sent client → server each tick. Stored in the client's ring buffer for prediction reconciliation.

yaw and pitch are absolute orientations in radians, not deltas. The server needs the full orientation to compute wishDir correctly. pitch is clamped to [-89°, +89°] (~1.5533 rad) by InputSampleSystem.

Member Data Documentation

◆ back

bool InputSnapshot::back {false}

S key.

◆ crouch

bool InputSnapshot::crouch {false}

Left Ctrl key.

◆ forward

bool InputSnapshot::forward {false}

W key.

◆ grapple

bool InputSnapshot::grapple {false}

Middle mouse button / E key.

◆ jump

bool InputSnapshot::jump {false}

Space key.

◆ left

bool InputSnapshot::left {false}

A key.

◆ pitch

float InputSnapshot::pitch {0.0f}

Vertical look angle in radians, clamped to [-89°, +89°] by InputSampleSystem.

◆ prevTickPitch

float InputSnapshot::prevTickPitch {0.0f}

◆ prevTickYaw

float InputSnapshot::prevTickYaw {0.0f}

Yaw/pitch captured at the start of the most-recent physics tick.

Used by the renderer to interpolate orientation with the same alpha as position, keeping camera eye and look-direction on the same timebase. Without this, yaw snaps to the newest value every frame while the eye position lags behind by up to one tick — causing objects to jitter on screen when strafing and rotating simultaneously (orbiting).

◆ right

bool InputSnapshot::right {false}

D key.

◆ roll

float InputSnapshot::roll {0.0f}

Currently always 0; reserved for dynamic movement tilt (wallrun lean, strafe tilt).

◆ shooting

bool InputSnapshot::shooting {false}

Primary fire button.

◆ sprint

bool InputSnapshot::sprint {false}

Left Shift key.

◆ tick

uint32_t InputSnapshot::tick {0}

Physics tick this snapshot was sampled on.

◆ yaw

float InputSnapshot::yaw {0.0f}

Horizontal look angle in radians (accumulated from mouse X deltas).


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