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.
bool reload {false}
 Reload button.
bool pickup {false}
 Pick Up button (f).
bool switchToPrimary {false}
 Switch to gun in primary slot.
bool switchToSecondary {false}
 Switch to gun in secondary slot.
bool refillAmmo {false}
 Debug: refill all weapons to full ammo.
bool killSelf {false}
 Debug: kill self (rising-edge only).
bool skipRespawn {false}
 Skip respawn timer (space while dead).
bool flipGravity {false}
 Gravity flip toggle (G key, rising-edge only).
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.

◆ flipGravity

bool InputSnapshot::flipGravity {false}

Gravity flip toggle (G key, rising-edge only).

◆ forward

bool InputSnapshot::forward {false}

W key.

◆ grapple

bool InputSnapshot::grapple {false}

Middle mouse button / E key.

◆ jump

bool InputSnapshot::jump {false}

Space key.

◆ killSelf

bool InputSnapshot::killSelf {false}

Debug: kill self (rising-edge only).

◆ left

bool InputSnapshot::left {false}

A key.

◆ pickup

bool InputSnapshot::pickup {false}

Pick Up button (f).

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

◆ refillAmmo

bool InputSnapshot::refillAmmo {false}

Debug: refill all weapons to full ammo.

◆ reload

bool InputSnapshot::reload {false}

Reload button.

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

◆ skipRespawn

bool InputSnapshot::skipRespawn {false}

Skip respawn timer (space while dead).

◆ sprint

bool InputSnapshot::sprint {false}

Left Shift key.

◆ switchToPrimary

bool InputSnapshot::switchToPrimary {false}

Switch to gun in primary slot.

◆ switchToSecondary

bool InputSnapshot::switchToSecondary {false}

Switch to gun in secondary slot.

◆ 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: