mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-26 00:40:15 +00:00
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:
parent
751e6fdbde
commit
974384c725
4 changed files with 179 additions and 73 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue