From 4c2f4e39a02649c2e30494ce98f9d1707d03c0fe Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 11 Aug 2024 02:48:28 +0200 Subject: [PATCH] Recast: optimize and improve traverse link renderer Only render the cross at the start as the reverse link will render the 2nd one. Else we render 4 crosses. Also made the alpha of the line around 50%, since we render the forward and reverse link, it will render with 100% opacity, if the reverse link is missing, the crosses will disappear and the line will only render at 50% opacity to make it more clear something is wrong. --- src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp b/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp index 55cb7185..9a9964ef 100644 --- a/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp +++ b/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp @@ -179,7 +179,7 @@ static void drawTraverseLinks(duDebugDraw* dd, const dtNavMesh& mesh, const dtNa query->getEdgeMidPoint(link->ref, mesh.getPolyRefBase(tile) | (dtPolyRef)i, endPos); // Unique color for each type. - const int col = duIntToCol(link->traverseType, 180); + const int col = duIntToCol(link->traverseType, 128); dd->begin(DU_DRAW_LINES, 2.0f, offset); @@ -193,7 +193,6 @@ static void drawTraverseLinks(duDebugDraw* dd, const dtNavMesh& mesh, const dtNa // If the reverse link is set, render white crosses to confirm // the links are set properly. duAppendCross(dd, startPos[0], startPos[1], startPos[2], 10.f, duRGBA(255,255,255,180)); - duAppendCross(dd, endPos[0], endPos[1], endPos[2], 10.f, duRGBA(255,255,255,180)); } dd->end();