Add steep slope limiting to prevent terrain clipping

Added slope normal checking to reject surfaces too steep to walk.
Prevents character/mount from clipping through steep terrain.

Changes:
- Added MIN_WALKABLE_NORMAL threshold (0.7 = ~45° max slope)
- WMO collision: query surface normal, reject if normalZ < 0.7
- M2 collision: query surface normal, reject if normalZ < 0.7
- Updated M2Renderer::getFloorHeight to output surface normal
- M2 already had internal 0.35 check (~70°), new 0.7 is more restrictive

Steep slopes now block movement instead of allowing clipping.
This commit is contained in:
Kelsi 2026-02-10 20:45:25 -08:00
parent 7e85e0b2ef
commit 73db7768d4
3 changed files with 30 additions and 5 deletions

View file

@ -286,7 +286,7 @@ public:
* @param glY World Y
* @param glZ Query/reference Z (used to ignore unreachable tops)
*/
std::optional<float> getFloorHeight(float glX, float glY, float glZ) const;
std::optional<float> getFloorHeight(float glX, float glY, float glZ, float* outNormalZ = nullptr) const;
/**
* Raycast against M2 bounding boxes for camera collision