group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
PlayerState Struct Reference

Locomotion state for a player entity. More...

#include <PlayerState.hpp>

Public Attributes

MoveMode moveMode {MoveMode::OnFoot}
 
bool grounded {false}
 True when touching a floor surface this tick.
 
bool crouching {false}
 True when crouch input is held.
 
bool sprinting {false}
 True when sprint is active.
 
bool pendingUncrouch {false}
 Deferred uncrouch (e.g. after slidehop); applied when safe.
 
glm::vec3 groundNormal {0, 1, 0}
 Normal of the floor surface we're standing on.
 
bool canDoubleJump {true}
 Reset on land / wallrun / climb.
 
bool jumpedThisTick {false}
 Set during the tick a jump occurs (for lurch setup).
 
int jumpCount {0}
 0 = on ground, 1 = first jump, 2 = double jumped.
 
bool jumpHeldLastTick {false}
 Was jump key held on the previous tick (for edge detection).
 
float jumpCooldown {0.0f}
 Minimum time before double jump is available (s).
 
float coyoteTimer {0.0f}
 Remaining grace time after leaving ground/wall (s).
 
bool wasGroundedLastTick {false}
 
bool jumpLurchEnabled {false}
 True during the lurch grace window after jumping.
 
float jumpLurchTimer {0.0f}
 Time elapsed since the jump that enabled lurch (s).
 
glm::vec2 moveInputsOnJump {0.0f}
 WASD direction when jump started (for detecting direction change).
 
float slideTimer {0.0f}
 How long the current slide has lasted (s).
 
int slideFatigueCounter {0}
 Diminishing returns on consecutive slidehops.
 
float slideBoostCooldown {0.0f}
 Remaining cooldown before next slide boost (s).
 
int slideFatigueDecayAccum {0}
 Tick accumulator for fatigue recovery.
 
bool canEnterSlide {true}
 Cleared when in air, set on landing.
 
WallSide wallRunSide {WallSide::None}
 
glm::vec3 wallNormal {0.0f}
 Normal of the wall being run on.
 
glm::vec3 wallForward {0.0f}
 Direction of travel along the wall.
 
float wallRunTimer {0.0f}
 Time on current wall (s).
 
float wallRunSpeedTimer {0.0f}
 Timer for the speed-loss delay.
 
bool exitingWall {false}
 True for a brief period after leaving a wall.
 
float exitWallTimer {0.0f}
 Remaining exit-wall time (s).
 
bool wasWallRunning {false}
 Set briefly after leaving wallrun (for coyote wall jump).
 
glm::vec3 wallBlacklistNormal {0.0f}
 
float wallBlacklistHeight {-1e10f}
 
bool wallBlacklistActive {false}
 
glm::vec3 climbWallNormal {0.0f}
 Normal of the wall being climbed.
 
float climbTimer {0.0f}
 Time on current climb (s).
 
bool exitingClimb {false}
 
float exitClimbTimer {0.0f}
 
bool wasClimbing {false}
 
glm::vec3 climbBlacklistNormal {0.0f}
 
float climbBlacklistHeight {-1e10f}
 
bool climbBlacklistActive {false}
 
glm::vec3 ledgePoint {0.0f}
 World-space position of the grabbed ledge.
 
glm::vec3 ledgeNormal {0.0f}
 Wall normal at the ledge.
 
float ledgeHoldTimer {0.0f}
 Time spent holding the ledge (s).
 
bool exitingLedge {false}
 
float exitLedgeTimer {0.0f}
 
bool grappleActive {false}
 True while being pulled toward anchor.
 
bool grappleCooldownActive {false}
 True during cooldown between uses.
 
float grappleCooldownTimer {0.0f}
 Remaining cooldown time (s).
 
float grapplePullTimer {0.0f}
 Time spent being pulled (s).
 
glm::vec3 grapplePoint {0.0f}
 World-space anchor point.
 
glm::vec3 grapplePullDir {0.0f}
 Cached pull direction (toward anchor at fire time).
 
bool grappleInputLastTick {false}
 For edge detection on the grapple key.
 
float targetCameraTilt {0.0f}
 Target camera roll for wallrun lean (degrees).
 

Detailed Description

Locomotion state for a player entity.

Read/written by MovementSystem and CollisionSystem. Extended for Titanfall-style movement mechanics.

Member Data Documentation

◆ canDoubleJump

bool PlayerState::canDoubleJump {true}

Reset on land / wallrun / climb.

◆ canEnterSlide

bool PlayerState::canEnterSlide {true}

Cleared when in air, set on landing.

◆ climbBlacklistActive

bool PlayerState::climbBlacklistActive {false}

◆ climbBlacklistHeight

float PlayerState::climbBlacklistHeight {-1e10f}

◆ climbBlacklistNormal

glm::vec3 PlayerState::climbBlacklistNormal {0.0f}

◆ climbTimer

float PlayerState::climbTimer {0.0f}

Time on current climb (s).

◆ climbWallNormal

glm::vec3 PlayerState::climbWallNormal {0.0f}

Normal of the wall being climbed.

◆ coyoteTimer

float PlayerState::coyoteTimer {0.0f}

Remaining grace time after leaving ground/wall (s).

◆ crouching

bool PlayerState::crouching {false}

True when crouch input is held.

◆ exitClimbTimer

float PlayerState::exitClimbTimer {0.0f}

◆ exitingClimb

bool PlayerState::exitingClimb {false}

◆ exitingLedge

bool PlayerState::exitingLedge {false}

◆ exitingWall

bool PlayerState::exitingWall {false}

True for a brief period after leaving a wall.

◆ exitLedgeTimer

float PlayerState::exitLedgeTimer {0.0f}

◆ exitWallTimer

float PlayerState::exitWallTimer {0.0f}

Remaining exit-wall time (s).

◆ grappleActive

bool PlayerState::grappleActive {false}

True while being pulled toward anchor.

◆ grappleCooldownActive

bool PlayerState::grappleCooldownActive {false}

True during cooldown between uses.

◆ grappleCooldownTimer

float PlayerState::grappleCooldownTimer {0.0f}

Remaining cooldown time (s).

◆ grappleInputLastTick

bool PlayerState::grappleInputLastTick {false}

For edge detection on the grapple key.

◆ grapplePoint

glm::vec3 PlayerState::grapplePoint {0.0f}

World-space anchor point.

◆ grapplePullDir

glm::vec3 PlayerState::grapplePullDir {0.0f}

Cached pull direction (toward anchor at fire time).

◆ grapplePullTimer

float PlayerState::grapplePullTimer {0.0f}

Time spent being pulled (s).

◆ grounded

bool PlayerState::grounded {false}

True when touching a floor surface this tick.

◆ groundNormal

glm::vec3 PlayerState::groundNormal {0, 1, 0}

Normal of the floor surface we're standing on.

◆ jumpCooldown

float PlayerState::jumpCooldown {0.0f}

Minimum time before double jump is available (s).

◆ jumpCount

int PlayerState::jumpCount {0}

0 = on ground, 1 = first jump, 2 = double jumped.

◆ jumpedThisTick

bool PlayerState::jumpedThisTick {false}

Set during the tick a jump occurs (for lurch setup).

◆ jumpHeldLastTick

bool PlayerState::jumpHeldLastTick {false}

Was jump key held on the previous tick (for edge detection).

◆ jumpLurchEnabled

bool PlayerState::jumpLurchEnabled {false}

True during the lurch grace window after jumping.

◆ jumpLurchTimer

float PlayerState::jumpLurchTimer {0.0f}

Time elapsed since the jump that enabled lurch (s).

◆ ledgeHoldTimer

float PlayerState::ledgeHoldTimer {0.0f}

Time spent holding the ledge (s).

◆ ledgeNormal

glm::vec3 PlayerState::ledgeNormal {0.0f}

Wall normal at the ledge.

◆ ledgePoint

glm::vec3 PlayerState::ledgePoint {0.0f}

World-space position of the grabbed ledge.

◆ moveInputsOnJump

glm::vec2 PlayerState::moveInputsOnJump {0.0f}

WASD direction when jump started (for detecting direction change).

◆ moveMode

MoveMode PlayerState::moveMode {MoveMode::OnFoot}

◆ pendingUncrouch

bool PlayerState::pendingUncrouch {false}

Deferred uncrouch (e.g. after slidehop); applied when safe.

◆ slideBoostCooldown

float PlayerState::slideBoostCooldown {0.0f}

Remaining cooldown before next slide boost (s).

◆ slideFatigueCounter

int PlayerState::slideFatigueCounter {0}

Diminishing returns on consecutive slidehops.

◆ slideFatigueDecayAccum

int PlayerState::slideFatigueDecayAccum {0}

Tick accumulator for fatigue recovery.

◆ slideTimer

float PlayerState::slideTimer {0.0f}

How long the current slide has lasted (s).

◆ sprinting

bool PlayerState::sprinting {false}

True when sprint is active.

◆ targetCameraTilt

float PlayerState::targetCameraTilt {0.0f}

Target camera roll for wallrun lean (degrees).

◆ wallBlacklistActive

bool PlayerState::wallBlacklistActive {false}

◆ wallBlacklistHeight

float PlayerState::wallBlacklistHeight {-1e10f}

◆ wallBlacklistNormal

glm::vec3 PlayerState::wallBlacklistNormal {0.0f}

◆ wallForward

glm::vec3 PlayerState::wallForward {0.0f}

Direction of travel along the wall.

◆ wallNormal

glm::vec3 PlayerState::wallNormal {0.0f}

Normal of the wall being run on.

◆ wallRunSide

WallSide PlayerState::wallRunSide {WallSide::None}

◆ wallRunSpeedTimer

float PlayerState::wallRunSpeedTimer {0.0f}

Timer for the speed-loss delay.

◆ wallRunTimer

float PlayerState::wallRunTimer {0.0f}

Time on current wall (s).

◆ wasClimbing

bool PlayerState::wasClimbing {false}

◆ wasGroundedLastTick

bool PlayerState::wasGroundedLastTick {false}

◆ wasWallRunning

bool PlayerState::wasWallRunning {false}

Set briefly after leaving wallrun (for coyote wall jump).


The documentation for this struct was generated from the following file: