From 64de9f6a48a69fafba41a4966f82c2a6a6fc2ec3 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:51:24 +0100 Subject: [PATCH] Recast: use spherical extends to clamp off-mesh link to poly The traversability of off-mesh links is not dictated by the walkable climb in this engine; an off-mesh connection can be higher from the ground due to ziplines. --- src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp b/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp index eb510c34..b75f5b9c 100644 --- a/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp +++ b/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp @@ -555,7 +555,7 @@ dtPolyRef dtNavMesh::clampOffMeshVertToPoly(dtOffMeshConnection* con, dtMeshTile const dtMeshTile* lookupTile, const bool start) { const float* p = start ? &con->pos[0] : &con->pos[3]; - const float halfExtents[3] = { con->rad, con->rad, lookupTile->header->walkableClimb }; + const float halfExtents[3] = { con->rad, con->rad, con->rad }; float nearestPt[3]; dtPolyRef ref = findNearestPolyInTile(lookupTile, p, halfExtents, nearestPt); @@ -656,7 +656,7 @@ dtStatus dtNavMesh::connectOffMeshLinks(const dtTileRef tileRef) return DT_FAILURE | DT_OUT_OF_MEMORY; // connect to land points. - const float halfExtents[3] = { con->rad, con->rad, header->walkableClimb }; + const float halfExtents[3] = { con->rad, con->rad, con->rad }; float bmin[3], bmax[3]; rdVsub(bmin, &con->pos[3], halfExtents); rdVadd(bmax, &con->pos[3], halfExtents);