Add path height correction on world load

This commit is contained in:
David Markowitz
2023-08-06 15:41:38 -07:00
parent cefdfc696a
commit 8117773c56
4 changed files with 22 additions and 7 deletions

View File

@@ -118,7 +118,7 @@ void dNavMesh::LoadNavmesh() {
m_NavMesh = mesh;
}
float dNavMesh::GetHeightAtPoint(const NiPoint3& location) {
float dNavMesh::GetHeightAtPoint(const NiPoint3& location, const float halfExtentsHeight) const {
if (m_NavMesh == nullptr) {
return location.y;
}
@@ -130,7 +130,7 @@ float dNavMesh::GetHeightAtPoint(const NiPoint3& location) {
pos[2] = location.z;
dtPolyRef nearestRef = 0;
float polyPickExt[3] = { 32.0f, 32.0f, 32.0f };
float polyPickExt[3] = { 32.0f, halfExtentsHeight, 32.0f };
dtQueryFilter filter{};
m_NavQuery->findNearestPoly(pos, polyPickExt, &filter, &nearestRef, 0);