From c0d3dafa6f4eb2c31799910514321fc05d09571e Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 20 Jul 2022 01:33:09 +0200 Subject: [PATCH] Update dtNavMeshQuery structure Member 'filter' has been moved out of 'dtNavMeshQuery::dtQueryData'. New offset = 0x60 (after m_openList). Renamed to 'm_queryFilter' to maintain consistency. --- .../recast/Detour/Include/DetourNavMeshQuery.h | 2 +- .../recast/Detour/Source/DetourNavMeshQuery.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/r5dev/thirdparty/recast/Detour/Include/DetourNavMeshQuery.h b/r5dev/thirdparty/recast/Detour/Include/DetourNavMeshQuery.h index efc1a4db..75fe03fc 100644 --- a/r5dev/thirdparty/recast/Detour/Include/DetourNavMeshQuery.h +++ b/r5dev/thirdparty/recast/Detour/Include/DetourNavMeshQuery.h @@ -565,7 +565,6 @@ private: float lastBestNodeCost; dtPolyRef startRef, endRef; float startPos[3], endPos[3]; - const dtQueryFilter* filter; unsigned int options; float raycastLimitSqr; }; @@ -574,6 +573,7 @@ private: class dtNodePool* m_tinyNodePool; ///< Pointer to small node pool. class dtNodePool* m_nodePool; ///< Pointer to node pool. class dtNodeQueue* m_openList; ///< Pointer to open list queue. + const dtQueryFilter* m_queryFilter; ///< Pointer to query filter. }; /// Allocates a query object using the Detour allocator. diff --git a/r5dev/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp b/r5dev/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp index 26a0630f..59c3253a 100644 --- a/r5dev/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp +++ b/r5dev/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp @@ -1219,7 +1219,7 @@ dtStatus dtNavMeshQuery::initSlicedFindPath(dtPolyRef startRef, dtPolyRef endRef dtVcopy(m_query.startPos, startPos); if (endPos) dtVcopy(m_query.endPos, endPos); - m_query.filter = filter; + m_queryFilter = filter; m_query.options = options; m_query.raycastLimitSqr = FLT_MAX; @@ -1363,7 +1363,7 @@ dtStatus dtNavMeshQuery::updateSlicedFindPath(const int maxIter, int* doneIters) const dtPoly* neighbourPoly = 0; m_nav->getTileAndPolyByRefUnsafe(neighbourRef, &neighbourTile, &neighbourPoly); - if (!m_query.filter->passFilter(neighbourRef, neighbourTile, neighbourPoly)) + if (!m_queryFilter->passFilter(neighbourRef, neighbourTile, neighbourPoly)) continue; // get the neighbor node @@ -1395,7 +1395,7 @@ dtStatus dtNavMeshQuery::updateSlicedFindPath(const int maxIter, int* doneIters) rayHit.pathCost = rayHit.t = 0; if (tryLOS) { - raycast(parentRef, parentNode->pos, neighbourNode->pos, m_query.filter, DT_RAYCAST_USE_COSTS, &rayHit, grandpaRef); + raycast(parentRef, parentNode->pos, neighbourNode->pos, m_queryFilter, DT_RAYCAST_USE_COSTS, &rayHit, grandpaRef); foundShortCut = rayHit.t >= 1.0f; } @@ -1408,7 +1408,7 @@ dtStatus dtNavMeshQuery::updateSlicedFindPath(const int maxIter, int* doneIters) else { // No shortcut found. - const float curCost = m_query.filter->getCost(bestNode->pos, neighbourNode->pos, + const float curCost = m_queryFilter->getCost(bestNode->pos, neighbourNode->pos, parentRef, parentTile, parentPoly, bestRef, bestTile, bestPoly, neighbourRef, neighbourTile, neighbourPoly); @@ -1418,7 +1418,7 @@ dtStatus dtNavMeshQuery::updateSlicedFindPath(const int maxIter, int* doneIters) // Special case for last node. if (neighbourRef == m_query.endRef) { - const float endCost = m_query.filter->getCost(neighbourNode->pos, m_query.endPos, + const float endCost = m_queryFilter->getCost(neighbourNode->pos, m_query.endPos, bestRef, bestTile, bestPoly, neighbourRef, neighbourTile, neighbourPoly, 0, 0, 0); @@ -1540,7 +1540,7 @@ dtStatus dtNavMeshQuery::finalizeSlicedFindPath(dtPolyRef* path, int* pathCount, { float t, normal[3]; int m; - status = raycast(node->id, node->pos, next->pos, m_query.filter, &t, normal, path+n, &m, maxPath-n); + status = raycast(node->id, node->pos, next->pos, m_queryFilter, &t, normal, path+n, &m, maxPath-n); n += m; // raycast ends on poly boundary and the path might include the next poly boundary. if (path[n-1] == next->id) @@ -1641,7 +1641,7 @@ dtStatus dtNavMeshQuery::finalizeSlicedFindPathPartial(const dtPolyRef* existing { float t, normal[3]; int m; - status = raycast(node->id, node->pos, next->pos, m_query.filter, &t, normal, path+n, &m, maxPath-n); + status = raycast(node->id, node->pos, next->pos, m_queryFilter, &t, normal, path+n, &m, maxPath-n); n += m; // raycast ends on poly boundary and the path might include the next poly boundary. if (path[n-1] == next->id)