group2
0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
InputSnapshot.hpp
Go to the documentation of this file.
1
3
4
#pragma once
5
6
#include <cstdint>
7
8
inline
constexpr
std::uint8_t
kInvalidGrenadeSelectIndex
= 0xff;
9
18
struct
InputSnapshot
19
{
20
uint32_t
tick
{0};
21
22
// Movement keys
23
bool
forward
{
false
};
24
bool
back
{
false
};
25
bool
left
{
false
};
26
bool
right
{
false
};
27
bool
jump
{
false
};
28
bool
crouch
{
false
};
29
bool
sprint
{
false
};
30
bool
grapple
{
false
};
31
bool
shooting
{
false
};
32
bool
scoped
{
false
};
33
bool
reload
{
false
};
34
bool
pickup
{
false
};
35
bool
switchToPrimary
{
false
};
36
bool
switchToSecondary
{
false
};
37
bool
refillAmmo
{
false
};
38
bool
killSelf
{
false
};
39
bool
skipRespawn
{
false
};
40
bool
throwGrenade
{
false
};
41
bool
grenadeMenuHeld
{
false
};
42
std::uint8_t
grenadeSelectIndex
{
kInvalidGrenadeSelectIndex
};
43
bool
ability1
{
false
};
44
bool
ability2
{
false
};
45
bool
abilitySelectHeld
{
false
};
46
bool
abilitySelectLeft
{
false
};
47
bool
abilitySelectRight
{
false
};
48
bool
debugGrantAbilityLevel
{
false
};
49
50
float
yaw
{0.0f};
51
float
pitch
{0.0f};
52
float
roll
{0.0f};
53
61
float
prevTickYaw
{0.0f};
62
float
prevTickPitch
{0.0f};
63
};
kInvalidGrenadeSelectIndex
constexpr std::uint8_t kInvalidGrenadeSelectIndex
Definition
InputSnapshot.hpp:8
InputSnapshot
One tick of player input, stamped with the tick it was sampled on.
Definition
InputSnapshot.hpp:19
InputSnapshot::switchToSecondary
bool switchToSecondary
Switch to gun in secondary slot.
Definition
InputSnapshot.hpp:36
InputSnapshot::pickup
bool pickup
Pick Up button (f).
Definition
InputSnapshot.hpp:34
InputSnapshot::killSelf
bool killSelf
Debug: kill self (rising-edge only).
Definition
InputSnapshot.hpp:38
InputSnapshot::grapple
bool grapple
Middle mouse button / E key.
Definition
InputSnapshot.hpp:30
InputSnapshot::switchToPrimary
bool switchToPrimary
Switch to gun in primary slot.
Definition
InputSnapshot.hpp:35
InputSnapshot::tick
uint32_t tick
Physics tick this snapshot was sampled on.
Definition
InputSnapshot.hpp:20
InputSnapshot::jump
bool jump
Space key.
Definition
InputSnapshot.hpp:27
InputSnapshot::prevTickYaw
float prevTickYaw
Yaw/pitch captured at the start of the most-recent physics tick.
Definition
InputSnapshot.hpp:61
InputSnapshot::ability2
bool ability2
Activate ability 2.
Definition
InputSnapshot.hpp:44
InputSnapshot::refillAmmo
bool refillAmmo
Debug: refill all weapons to full ammo.
Definition
InputSnapshot.hpp:37
InputSnapshot::prevTickPitch
float prevTickPitch
Definition
InputSnapshot.hpp:62
InputSnapshot::roll
float roll
Currently always 0; reserved for dynamic movement tilt (wallrun lean, strafe tilt).
Definition
InputSnapshot.hpp:52
InputSnapshot::throwGrenade
bool throwGrenade
Quick G press: throw the selected grenade.
Definition
InputSnapshot.hpp:40
InputSnapshot::abilitySelectRight
bool abilitySelectRight
Choose the right pending ability option (edge-triggered).
Definition
InputSnapshot.hpp:47
InputSnapshot::ability1
bool ability1
Activate ability 1.
Definition
InputSnapshot.hpp:43
InputSnapshot::abilitySelectLeft
bool abilitySelectLeft
Choose the left pending ability option (edge-triggered).
Definition
InputSnapshot.hpp:46
InputSnapshot::skipRespawn
bool skipRespawn
Skip respawn timer (space while dead).
Definition
InputSnapshot.hpp:39
InputSnapshot::right
bool right
D key.
Definition
InputSnapshot.hpp:26
InputSnapshot::forward
bool forward
W key.
Definition
InputSnapshot.hpp:23
InputSnapshot::left
bool left
A key.
Definition
InputSnapshot.hpp:25
InputSnapshot::reload
bool reload
Reload button.
Definition
InputSnapshot.hpp:33
InputSnapshot::yaw
float yaw
Horizontal look angle in radians (accumulated from mouse X deltas).
Definition
InputSnapshot.hpp:50
InputSnapshot::scoped
bool scoped
Right click.
Definition
InputSnapshot.hpp:32
InputSnapshot::crouch
bool crouch
Left Ctrl key.
Definition
InputSnapshot.hpp:28
InputSnapshot::shooting
bool shooting
Primary fire button.
Definition
InputSnapshot.hpp:31
InputSnapshot::pitch
float pitch
Vertical look angle in radians, clamped to [-89°, +89°] by InputSampleSystem.
Definition
InputSnapshot.hpp:51
InputSnapshot::grenadeMenuHeld
bool grenadeMenuHeld
True while the held-G radial menu is open.
Definition
InputSnapshot.hpp:41
InputSnapshot::grenadeSelectIndex
std::uint8_t grenadeSelectIndex
Hovered radial grenade index, or invalid.
Definition
InputSnapshot.hpp:42
InputSnapshot::back
bool back
S key.
Definition
InputSnapshot.hpp:24
InputSnapshot::debugGrantAbilityLevel
bool debugGrantAbilityLevel
Debug: grant the next ability choice threshold.
Definition
InputSnapshot.hpp:48
InputSnapshot::sprint
bool sprint
Left Shift key.
Definition
InputSnapshot.hpp:29
InputSnapshot::abilitySelectHeld
bool abilitySelectHeld
True while holding the ability-selection modifier.
Definition
InputSnapshot.hpp:45
src
ecs
components
InputSnapshot.hpp
Generated by
1.16.1