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 <glm/vec3.hpp>
32
39{
40 // Mode flags
43 int jumpCount{0};
44
45 // Boolean flags (un-packed in Phase 2; bit-packed in Phase 4).
46 bool isDead{false};
47 bool grounded{false};
48 bool crouching{false};
49 bool sprinting{false};
50 bool ads{false};
52 bool pendingUncrouch{false};
53 bool exitingWall{false};
54 bool grappleActive{false};
55 bool gravityFlipped{false};
56
57 // Spatial state needed by client renderer/animator.
58 glm::vec3 groundNormal{0.0f, 1.0f, 0.0f};
59 glm::vec3 grapplePoint{0.0f};
60
61 // Camera effects (read by renderer).
62 float targetCameraTilt{0.0f};
63};
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:39
bool grappleActive
True while being pulled toward the grapple anchor.
Definition PlayerVisState.hpp:54
MoveMode moveMode
Active locomotion mode.
Definition PlayerVisState.hpp:41
glm::vec3 grapplePoint
World-space anchor; renderer draws the cable to here.
Definition PlayerVisState.hpp:59
bool grounded
True when touching a floor surface this tick.
Definition PlayerVisState.hpp:47
int jumpCount
0 = on ground, 1 = first jump, 2 = double jumped.
Definition PlayerVisState.hpp:43
bool sprinting
True when sprint is active.
Definition PlayerVisState.hpp:49
WallSide wallRunSide
Wall side during WallRunning mode.
Definition PlayerVisState.hpp:42
bool gravityFlipped
True when the player's gravity is inverted (walking on ceilings).
Definition PlayerVisState.hpp:55
bool exitingWall
Brief grace window after leaving a wall.
Definition PlayerVisState.hpp:53
bool isDead
True while the player is dead and waiting to respawn.
Definition PlayerVisState.hpp:46
bool crouching
True when crouch input is held.
Definition PlayerVisState.hpp:48
glm::vec3 groundNormal
Normal of the floor surface for foot orientation.
Definition PlayerVisState.hpp:58
bool ads
True when ADS-ing a precision (charge) weapon — caps wish speed to k_adsSpeed.
Definition PlayerVisState.hpp:50
bool pendingUncrouch
Deferred uncrouch (e.g. after slidehop); applied when safe.
Definition PlayerVisState.hpp:52
float targetCameraTilt
Target camera roll for wallrun lean (degrees).
Definition PlayerVisState.hpp:62