group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
PlayerVisState.hpp
Go to the documentation of this file.
1
26
27#pragma once
28
29#include "PlayerStateEnums.hpp"
30
31#include <cstdint>
32#include <glm/vec3.hpp>
33
40{
41 // Mode flags
44 int jumpCount{0};
45
46 // Boolean flags (un-packed in Phase 2; bit-packed in Phase 4).
47 bool isDead{false};
48 bool grounded{false};
49 bool crouching{false};
50 bool sprinting{false};
51 bool ads{false};
53 bool pendingUncrouch{false};
54 bool exitingWall{false};
55 bool grappleActive{false};
56 bool gravityFlipped{false};
57
58 // Spatial state needed by client renderer/animator.
59 glm::vec3 groundNormal{0.0f, 1.0f, 0.0f};
60 glm::vec3 grapplePoint{0.0f};
61
62 // Cosmetic emote (full-body dance/taunt). Server-authoritative: set from
63 // InputSnapshot::emoteRequest, cleared on movement/combat input or death.
64 // Drives the server animator's override clip so the resulting AnimSnapshot
65 // makes every remote client see the emote. -1 = not emoting.
66 std::int8_t activeEmote{-1};
67
68 // Camera effects (read by renderer).
69 float targetCameraTilt{0.0f};
70
71 // Spawn facing. Set by the server at (re)spawn to the spawn point's authored
72 // yaw; the local client snaps its view to this on the dead→alive edge so the
73 // player doesn't respawn looking into a wall.
74 float spawnViewYaw{0.0f};
75};
Locomotion mode + wall-side enums shared by PlayerVisState and PlayerSimState.
MoveMode
Movement mode — mutually exclusive locomotion states.
Definition PlayerStateEnums.hpp:17
@ OnFoot
Normal ground/air movement (walk, sprint, crouch, airborne).
Definition PlayerStateEnums.hpp:18
WallSide
Which side a wall is on relative to the player.
Definition PlayerStateEnums.hpp:25
@ None
Definition PlayerStateEnums.hpp:26
Replicated subset of player locomotion state.
Definition PlayerVisState.hpp:40
bool grappleActive
True while being pulled toward the grapple anchor.
Definition PlayerVisState.hpp:55
MoveMode moveMode
Active locomotion mode.
Definition PlayerVisState.hpp:42
float spawnViewYaw
Authored spawn facing (radians); applied to local view on respawn.
Definition PlayerVisState.hpp:74
glm::vec3 grapplePoint
World-space anchor; renderer draws the cable to here.
Definition PlayerVisState.hpp:60
bool grounded
True when touching a floor surface this tick.
Definition PlayerVisState.hpp:48
int jumpCount
0 = on ground, 1 = first jump, 2 = double jumped.
Definition PlayerVisState.hpp:44
bool sprinting
True when sprint is active.
Definition PlayerVisState.hpp:50
std::int8_t activeEmote
Active emote index (EmoteCatalog), or -1.
Definition PlayerVisState.hpp:66
WallSide wallRunSide
Wall side during WallRunning mode.
Definition PlayerVisState.hpp:43
bool gravityFlipped
True when the player's gravity is inverted (walking on ceilings).
Definition PlayerVisState.hpp:56
bool exitingWall
Brief grace window after leaving a wall.
Definition PlayerVisState.hpp:54
bool isDead
True while the player is dead and waiting to respawn.
Definition PlayerVisState.hpp:47
bool crouching
True when crouch input is held.
Definition PlayerVisState.hpp:49
glm::vec3 groundNormal
Normal of the floor surface for foot orientation.
Definition PlayerVisState.hpp:59
bool ads
True when ADS-ing a precision (charge) weapon — caps wish speed to k_adsSpeed.
Definition PlayerVisState.hpp:51
bool pendingUncrouch
Deferred uncrouch (e.g. after slidehop); applied when safe.
Definition PlayerVisState.hpp:53
float targetCameraTilt
Target camera roll for wallrun lean (degrees).
Definition PlayerVisState.hpp:69