From 56dd3802f81eb32c7670266e6769bb6f26df8181 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 22 Oct 2022 21:46:59 +0200 Subject: [PATCH] Recast & Detour XZY left overs to XYZ Height should be set on the z axis. --- r5dev/naveditor/NavMeshTesterTool.cpp | 2 +- r5dev/naveditor/TestCase.cpp | 2 +- r5dev/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/r5dev/naveditor/NavMeshTesterTool.cpp b/r5dev/naveditor/NavMeshTesterTool.cpp index 7e4405bf..26039ae2 100644 --- a/r5dev/naveditor/NavMeshTesterTool.cpp +++ b/r5dev/naveditor/NavMeshTesterTool.cpp @@ -553,7 +553,7 @@ void NavMeshTesterTool::handleToggle() float h = 0; m_navQuery->getPolyHeight(m_pathIterPolys[0], result, &h); - result[1] = h; + result[2] = h; dtVcopy(m_iterPos, result); // Handle end of path and off-mesh links when close enough. diff --git a/r5dev/naveditor/TestCase.cpp b/r5dev/naveditor/TestCase.cpp index a039d5fe..c818dbb9 100644 --- a/r5dev/naveditor/TestCase.cpp +++ b/r5dev/naveditor/TestCase.cpp @@ -288,7 +288,7 @@ void TestCase::doTests(dtNavMesh* navmesh, dtNavMeshQuery* navquery) { float h = 0; navquery->getPolyHeight(polys[iter->npolys-1], hitPos, &h); - hitPos[1] = h; + hitPos[2] = h; } dtVcopy(&iter->straight[3], hitPos); diff --git a/r5dev/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp b/r5dev/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp index a9030107..2c1c68f4 100644 --- a/r5dev/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp +++ b/r5dev/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp @@ -492,7 +492,7 @@ dtStatus dtNavMeshQuery::findRandomPointAroundCircle(dtPolyRef startRef, const f dtStatus stat = getPolyHeight(randomPolyRef, pt, &h); if (dtStatusFailed(status)) return stat; - pt[1] = h; + pt[2] = h; dtVcopy(randomPt, pt); *randomRef = randomPolyRef;