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 scoped {false}
 Right click.
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.
std::int8_t debugSetPrimaryWeapon {-1}
 Debug: replace the weapon in the primary/secondary slot with the given WeaponType ordinal.
std::int8_t debugSetSecondaryWeapon {-1}
bool killSelf {false}
 Debug: kill self (rising-edge only).
bool skipRespawn {false}
 Skip respawn timer (space while dead).
std::int8_t emoteRequest {-1}
 Emote wheel selection to trigger this tick (index into the emote catalog, see EmoteCatalog.hpp).
bool throwGrenade {false}
 Tap-G (no cycle): throw the selected grenade. Edge-pulsed once.
bool grenadeCycleNext {false}
 Hold-G + Shoot: select next grenade type. Edge-pulsed once.
bool grenadeCyclePrev {false}
 Hold-G + Scope: select previous grenade type. Edge-pulsed once.
bool ability1 {false}
 Activate ability 1.
bool ability2 {false}
 Activate ability 2.
bool abilitySelectHeld {false}
 True while holding the ability-selection modifier.
bool abilitySelectLeft {false}
 Choose the left pending ability option (edge-triggered).
bool abilitySelectRight {false}
 Choose the right pending ability option (edge-triggered).
bool debugGrantAbilityLevel {false}
 Debug: grant the next ability choice threshold.
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

◆ ability1

bool InputSnapshot::ability1 {false}

Activate ability 1.

◆ ability2

bool InputSnapshot::ability2 {false}

Activate ability 2.

◆ abilitySelectHeld

bool InputSnapshot::abilitySelectHeld {false}

True while holding the ability-selection modifier.

◆ abilitySelectLeft

bool InputSnapshot::abilitySelectLeft {false}

Choose the left pending ability option (edge-triggered).

◆ abilitySelectRight

bool InputSnapshot::abilitySelectRight {false}

Choose the right pending ability option (edge-triggered).

◆ back

bool InputSnapshot::back {false}

S key.

◆ crouch

bool InputSnapshot::crouch {false}

Left Ctrl key.

◆ debugGrantAbilityLevel

bool InputSnapshot::debugGrantAbilityLevel {false}

Debug: grant the next ability choice threshold.

◆ debugSetPrimaryWeapon

std::int8_t InputSnapshot::debugSetPrimaryWeapon {-1}

Debug: replace the weapon in the primary/secondary slot with the given WeaponType ordinal.

-1 = no change. Consumed (reset to -1) by WeaponSystem.

◆ debugSetSecondaryWeapon

std::int8_t InputSnapshot::debugSetSecondaryWeapon {-1}

◆ emoteRequest

std::int8_t InputSnapshot::emoteRequest {-1}

Emote wheel selection to trigger this tick (index into the emote catalog, see EmoteCatalog.hpp).

-1 = no request. Edge-pulsed once on wheel release; the server starts the emote and the client mirrors it.

◆ forward

bool InputSnapshot::forward {false}

W key.

◆ grapple

bool InputSnapshot::grapple {false}

Middle mouse button / E key.

◆ grenadeCycleNext

bool InputSnapshot::grenadeCycleNext {false}

Hold-G + Shoot: select next grenade type. Edge-pulsed once.

◆ grenadeCyclePrev

bool InputSnapshot::grenadeCyclePrev {false}

Hold-G + Scope: select previous grenade type. Edge-pulsed once.

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

◆ scoped

bool InputSnapshot::scoped {false}

Right click.

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

◆ throwGrenade

bool InputSnapshot::throwGrenade {false}

Tap-G (no cycle): throw the selected grenade. Edge-pulsed once.

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