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

Server-only locomotion bookkeeping. More...

#include <PlayerSimState.hpp>

Collaboration diagram for PlayerSimState:
[legend]

Public Attributes

bool canDoubleJump {true}
 Refreshed only after k_doubleJumpGroundedRefreshTime of continuous grounded OnFoot time.
bool jumpedThisTick {false}
 Set during the tick a jump occurs (for lurch setup).
bool jumpHeldLastTick {false}
 Was jump key held on the previous tick (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}
float groundedDuration {0.0f}
 Time continuously grounded (s); resets on leaving ground.
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 direction-change detection).
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.
glm::vec3 wallNormal {0.0f}
 Normal of the wall being run on.
glm::vec3 wallForward {0.0f}
 Direction of travel along the wall.
glm::vec3 wallAnchor {0.0f}
 Closest point on the attached wall surface.
float wallRunTimer {0.0f}
 Time on current wall (s).
float wallRunSpeedTimer {0.0f}
 Timer for the speed-loss delay.
float exitWallTimer {0.0f}
 Remaining exit-wall grace time (s).
uint32_t wallMeshIndex {UINT32_MAX}
 Current static collision mesh under the wall attachment, if any.
uint32_t wallTriId {UINT32_MAX}
 Current mesh triangle under the wall attachment, if any.
physics::TriRegion wallRegion {physics::TriRegion::Face}
 Closest feature on wallMeshIndex / wallTriId.
bool wallAttachmentValid {false}
 True while the wallrun has a collision-backed attachment.
bool wallCornerTransitionActive {false}
 True while carrying a pending external-corner handoff.
glm::vec3 wallCornerAnchor {0.0f}
 Corner/seam point used as the transition clearance origin.
glm::vec3 wallCornerFromNormal {0.0f}
 Wall normal held until the capsule clears the old wall edge.
glm::vec3 wallCornerFromForward {0.0f}
 Old wall tangent held during the corner approach.
glm::vec3 wallCornerToNormal {0.0f}
 Pending wall normal to attach after clearance.
glm::vec3 wallCornerToForward {0.0f}
 Pending wall tangent to use after clearance.
uint32_t wallCornerMeshIndex {UINT32_MAX}
 Pending wall mesh after corner clearance.
uint32_t wallCornerTriId {UINT32_MAX}
 Pending wall triangle after corner clearance.
physics::TriRegion wallCornerRegion {physics::TriRegion::Face}
 Pending wall feature after clearance.
float wallCornerTimer {0.0f}
 Time spent in the active corner transition (s).
glm::vec3 wallCornerIgnoreNormal {0.0f}
 Source wall briefly ignored after a corner commit.
float wallCornerIgnoreTimer {0.0f}
 Remaining time to suppress source-wall backtracking.
bool wallrunBlockerActive {false}
 True while collision is sliding/holding against a non-traversable blocker.
glm::vec3 wallrunBlockerNormal {0.0f}
 Collision normal of the active wallrun blocker.
float wallrunBlockerTimer {0.0f}
 Time since the blocker was last confirmed by KCC.
int wallrunBlockedFrames {0}
 Consecutive frames constrained by the active blocker.
float wallrunCeilingConstrainedTimer {0.0f}
 Short grace after head/ceiling contact while wallrun remains valid.
bool wasWallRunning {false}
 Set briefly after leaving wallrun (coyote wall jump).
glm::vec3 pendingKccCorrection {0.0f}
 One-tick collision-owned correction requested by movement.
physics::KccFrameResult lastKccResult {}
 Last collision feedback frame emitted by KCC.
bool hasLastKccResult {false}
 True after the first KCC frame has been recorded.
glm::vec3 kccPreviousPosBefore {0.0f}
 Previous KCC input position for oscillation detection.
glm::vec3 kccPreviousPosAfter {0.0f}
 Previous KCC output position for oscillation detection.
glm::vec3 kccPreviousDepenDelta {0.0f}
 Previous depenetration push for oscillation detection.
bool kccPreviousFrameValid {false}
 True once previous KCC frame fields are initialized.
int kccOscillationFrames {0}
 Consecutive ABAB-style KCC oscillation detections.
glm::vec3 wallBlacklistNormal {0.0f}
float wallBlacklistHeight {-1e10f}
bool wallBlacklistActive {false}
glm::vec3 lastSafePosition {0.0f}
 Last KCC-verified non-penetrating capsule center.
bool lastSafePositionValid {false}
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 grapplePullDir {0.0f}
 Cached pull direction (toward anchor at fire time).
bool grappleInputLastTick {false}
 Edge detection on the grapple key.

Detailed Description

Server-only locomotion bookkeeping.

Read/written by MovementSystem and CollisionSystem on the server every physics tick. Will be mirrored on the owning client in Phase 5 for prediction; remote clients never see this.

Member Data Documentation

◆ canDoubleJump

bool PlayerSimState::canDoubleJump {true}

Refreshed only after k_doubleJumpGroundedRefreshTime of continuous grounded OnFoot time.

Wall jumps, slidehops, and instant landings do NOT refresh it.

◆ canEnterSlide

bool PlayerSimState::canEnterSlide {true}

Cleared when in air, set on landing.

◆ coyoteTimer

float PlayerSimState::coyoteTimer {0.0f}

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

◆ exitWallTimer

float PlayerSimState::exitWallTimer {0.0f}

Remaining exit-wall grace time (s).

◆ grappleCooldownActive

bool PlayerSimState::grappleCooldownActive {false}

True during cooldown between uses.

◆ grappleCooldownTimer

float PlayerSimState::grappleCooldownTimer {0.0f}

Remaining cooldown time (s).

◆ grappleInputLastTick

bool PlayerSimState::grappleInputLastTick {false}

Edge detection on the grapple key.

◆ grapplePullDir

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

Cached pull direction (toward anchor at fire time).

◆ grapplePullTimer

float PlayerSimState::grapplePullTimer {0.0f}

Time spent being pulled (s).

◆ groundedDuration

float PlayerSimState::groundedDuration {0.0f}

Time continuously grounded (s); resets on leaving ground.

Distinguishes fresh ground jumps (lurch-eligible) from bhop chain continuations.

◆ hasLastKccResult

bool PlayerSimState::hasLastKccResult {false}

True after the first KCC frame has been recorded.

◆ jumpCooldown

float PlayerSimState::jumpCooldown {0.0f}

Minimum time before double jump is available (s).

◆ jumpedThisTick

bool PlayerSimState::jumpedThisTick {false}

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

◆ jumpHeldLastTick

bool PlayerSimState::jumpHeldLastTick {false}

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

◆ jumpLurchEnabled

bool PlayerSimState::jumpLurchEnabled {false}

True during the lurch grace window after jumping.

◆ jumpLurchTimer

float PlayerSimState::jumpLurchTimer {0.0f}

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

◆ kccOscillationFrames

int PlayerSimState::kccOscillationFrames {0}

Consecutive ABAB-style KCC oscillation detections.

◆ kccPreviousDepenDelta

glm::vec3 PlayerSimState::kccPreviousDepenDelta {0.0f}

Previous depenetration push for oscillation detection.

◆ kccPreviousFrameValid

bool PlayerSimState::kccPreviousFrameValid {false}

True once previous KCC frame fields are initialized.

◆ kccPreviousPosAfter

glm::vec3 PlayerSimState::kccPreviousPosAfter {0.0f}

Previous KCC output position for oscillation detection.

◆ kccPreviousPosBefore

glm::vec3 PlayerSimState::kccPreviousPosBefore {0.0f}

Previous KCC input position for oscillation detection.

◆ lastKccResult

physics::KccFrameResult PlayerSimState::lastKccResult {}

Last collision feedback frame emitted by KCC.

◆ lastSafePosition

glm::vec3 PlayerSimState::lastSafePosition {0.0f}

Last KCC-verified non-penetrating capsule center.

◆ lastSafePositionValid

bool PlayerSimState::lastSafePositionValid {false}

◆ moveInputsOnJump

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

WASD direction when jump started (for direction-change detection).

◆ pendingKccCorrection

glm::vec3 PlayerSimState::pendingKccCorrection {0.0f}

One-tick collision-owned correction requested by movement.

◆ slideBoostCooldown

float PlayerSimState::slideBoostCooldown {0.0f}

Remaining cooldown before next slide boost (s).

◆ slideFatigueCounter

int PlayerSimState::slideFatigueCounter {0}

Diminishing returns on consecutive slidehops.

◆ slideFatigueDecayAccum

int PlayerSimState::slideFatigueDecayAccum {0}

Tick accumulator for fatigue recovery.

◆ slideTimer

float PlayerSimState::slideTimer {0.0f}

How long the current slide has lasted (s).

◆ wallAnchor

glm::vec3 PlayerSimState::wallAnchor {0.0f}

Closest point on the attached wall surface.

◆ wallAttachmentValid

bool PlayerSimState::wallAttachmentValid {false}

True while the wallrun has a collision-backed attachment.

◆ wallBlacklistActive

bool PlayerSimState::wallBlacklistActive {false}

◆ wallBlacklistHeight

float PlayerSimState::wallBlacklistHeight {-1e10f}

◆ wallBlacklistNormal

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

◆ wallCornerAnchor

glm::vec3 PlayerSimState::wallCornerAnchor {0.0f}

Corner/seam point used as the transition clearance origin.

◆ wallCornerFromForward

glm::vec3 PlayerSimState::wallCornerFromForward {0.0f}

Old wall tangent held during the corner approach.

◆ wallCornerFromNormal

glm::vec3 PlayerSimState::wallCornerFromNormal {0.0f}

Wall normal held until the capsule clears the old wall edge.

◆ wallCornerIgnoreNormal

glm::vec3 PlayerSimState::wallCornerIgnoreNormal {0.0f}

Source wall briefly ignored after a corner commit.

◆ wallCornerIgnoreTimer

float PlayerSimState::wallCornerIgnoreTimer {0.0f}

Remaining time to suppress source-wall backtracking.

◆ wallCornerMeshIndex

uint32_t PlayerSimState::wallCornerMeshIndex {UINT32_MAX}

Pending wall mesh after corner clearance.

◆ wallCornerRegion

physics::TriRegion PlayerSimState::wallCornerRegion {physics::TriRegion::Face}

Pending wall feature after clearance.

◆ wallCornerTimer

float PlayerSimState::wallCornerTimer {0.0f}

Time spent in the active corner transition (s).

◆ wallCornerToForward

glm::vec3 PlayerSimState::wallCornerToForward {0.0f}

Pending wall tangent to use after clearance.

◆ wallCornerToNormal

glm::vec3 PlayerSimState::wallCornerToNormal {0.0f}

Pending wall normal to attach after clearance.

◆ wallCornerTransitionActive

bool PlayerSimState::wallCornerTransitionActive {false}

True while carrying a pending external-corner handoff.

◆ wallCornerTriId

uint32_t PlayerSimState::wallCornerTriId {UINT32_MAX}

Pending wall triangle after corner clearance.

◆ wallForward

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

Direction of travel along the wall.

◆ wallMeshIndex

uint32_t PlayerSimState::wallMeshIndex {UINT32_MAX}

Current static collision mesh under the wall attachment, if any.

◆ wallNormal

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

Normal of the wall being run on.

◆ wallRegion

physics::TriRegion PlayerSimState::wallRegion {physics::TriRegion::Face}

Closest feature on wallMeshIndex / wallTriId.

◆ wallrunBlockedFrames

int PlayerSimState::wallrunBlockedFrames {0}

Consecutive frames constrained by the active blocker.

◆ wallrunBlockerActive

bool PlayerSimState::wallrunBlockerActive {false}

True while collision is sliding/holding against a non-traversable blocker.

◆ wallrunBlockerNormal

glm::vec3 PlayerSimState::wallrunBlockerNormal {0.0f}

Collision normal of the active wallrun blocker.

◆ wallrunBlockerTimer

float PlayerSimState::wallrunBlockerTimer {0.0f}

Time since the blocker was last confirmed by KCC.

◆ wallrunCeilingConstrainedTimer

float PlayerSimState::wallrunCeilingConstrainedTimer {0.0f}

Short grace after head/ceiling contact while wallrun remains valid.

◆ wallRunSpeedTimer

float PlayerSimState::wallRunSpeedTimer {0.0f}

Timer for the speed-loss delay.

◆ wallRunTimer

float PlayerSimState::wallRunTimer {0.0f}

Time on current wall (s).

◆ wallTriId

uint32_t PlayerSimState::wallTriId {UINT32_MAX}

Current mesh triangle under the wall attachment, if any.

◆ wasGroundedLastTick

bool PlayerSimState::wasGroundedLastTick {false}

◆ wasWallRunning

bool PlayerSimState::wasWallRunning {false}

Set briefly after leaving wallrun (coyote wall jump).


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