mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
Improve floor detection for multi-story buildings
- Increase footprint sampling radius from 0.28 to 0.4 units - Only update floor cache if found floor is close to query height - Prevents caching wrong floor from different stories
This commit is contained in:
parent
e768f5048c
commit
bf6a5ba596
2 changed files with 7 additions and 5 deletions
|
|
@ -1495,8 +1495,10 @@ std::optional<float> WMORenderer::getFloorHeight(float glX, float glY, float glZ
|
|||
}
|
||||
}
|
||||
|
||||
// Cache the result in persistent grid (never expires)
|
||||
if (bestFloor) {
|
||||
// Cache the result in persistent grid.
|
||||
// Only update cache if we found a floor that's close to query height,
|
||||
// to avoid caching wrong floors when player is on different stories.
|
||||
if (bestFloor && *bestFloor >= glZ - 6.0f) {
|
||||
precomputedFloorGrid[gridKey] = *bestFloor;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue