Add per-group spatial grid for WMO collision and reduce collision call frequency

Build a 2D triangle grid per WMO group at load time so getFloorHeight and
checkWallCollision only test triangles in nearby cells instead of brute-forcing
all triangles. Also reduce sweep steps (12→4), ground probes (3→1), camera
floor probes (5→2), throttle isInsideWMO to every 10 frames, and early-out
wall collision on first hit.
This commit is contained in:
Kelsi 2026-02-07 15:47:43 -08:00
parent 751e6fdbde
commit 974384c725
4 changed files with 179 additions and 73 deletions

View file

@ -133,6 +133,11 @@ private:
static constexpr float JUMP_BUFFER_TIME = 0.15f; // 150ms input buffer
static constexpr float COYOTE_TIME = 0.10f; // 100ms grace after leaving ground
// Cached isInsideWMO result (throttled to avoid per-frame cost)
bool cachedInsideWMO = false;
int insideWMOCheckCounter = 0;
glm::vec3 lastInsideWMOCheckPos = glm::vec3(0.0f);
// Swimming
bool swimming = false;
bool wasSwimming = false;