From 9b33e1b94e54b364d4fe03489bf21b60de3d1544 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 19 Mar 2022 12:56:22 +0100 Subject: [PATCH] Fix more debugdraw --- r5dev/naveditor/CrowdTool.cpp | 10 +++++----- r5dev/naveditor/OffMeshConnectionTool.cpp | 2 +- .../thirdparty/recast/DebugUtils/Source/DebugDraw.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/r5dev/naveditor/CrowdTool.cpp b/r5dev/naveditor/CrowdTool.cpp index 4802a7fb..c6f98c71 100644 --- a/r5dev/naveditor/CrowdTool.cpp +++ b/r5dev/naveditor/CrowdTool.cpp @@ -355,7 +355,7 @@ void CrowdToolState::handleRender() if (dtTriArea2D(pos, s, s+3) < 0.0f) col = duDarkenCol(col); - duAppendArrow(&dd, s[0],s[1]+0.2f,s[2], s[3],s[4]+0.2f,s[5], 0.0f, 0.3f, col); + duAppendArrow(&dd, s[0],s[1],s[2]+0.2f, s[3],s[4],s[5]+0.2f, 0.0f, 0.3f, col); } dd.end(); } @@ -490,12 +490,12 @@ void CrowdToolState::handleRender() duDebugDrawCircle(&dd, pos[0], pos[1], pos[2]+height, radius, col, 2.0f); - duDebugDrawArrow(&dd, pos[0],pos[1]+height,pos[2], - pos[0]+dvel[0],pos[1]+height+dvel[1],pos[2]+dvel[2], + duDebugDrawArrow(&dd, pos[0],pos[1],pos[2]+height, + pos[0]+dvel[0],pos[1]+dvel[2],pos[2]+height+dvel[1], 0.0f, 0.4f, duRGBA(0,192,255,192), (m_agentDebug.idx == i) ? 2.0f : 1.0f); - duDebugDrawArrow(&dd, pos[0],pos[1]+height,pos[2], - pos[0]+vel[0],pos[1]+height+vel[1],pos[2]+vel[2], + duDebugDrawArrow(&dd, pos[0],pos[1],pos[2]+height, + pos[0]+vel[0],pos[1]+vel[2],pos[2]+height+vel[1], 0.0f, 0.4f, duRGBA(0,0,0,160), 2.0f); } diff --git a/r5dev/naveditor/OffMeshConnectionTool.cpp b/r5dev/naveditor/OffMeshConnectionTool.cpp index 2f4b3874..4b5e6477 100644 --- a/r5dev/naveditor/OffMeshConnectionTool.cpp +++ b/r5dev/naveditor/OffMeshConnectionTool.cpp @@ -134,7 +134,7 @@ void OffMeshConnectionTool::handleRender() const float s = m_sample->getAgentRadius(); if (m_hitPosSet) - duDebugDrawCross(&dd, m_hitPos[0],m_hitPos[1]+0.1f,m_hitPos[2], s, duRGBA(0,0,0,128), 2.0f); + duDebugDrawCross(&dd, m_hitPos[0],m_hitPos[1],m_hitPos[2]+0.1f, s, duRGBA(0,0,0,128), 2.0f); InputGeom* geom = m_sample->getInputGeom(); if (geom) diff --git a/r5dev/thirdparty/recast/DebugUtils/Source/DebugDraw.cpp b/r5dev/thirdparty/recast/DebugUtils/Source/DebugDraw.cpp index 8cfbbfaf..d99cf1b2 100644 --- a/r5dev/thirdparty/recast/DebugUtils/Source/DebugDraw.cpp +++ b/r5dev/thirdparty/recast/DebugUtils/Source/DebugDraw.cpp @@ -407,8 +407,8 @@ inline void evalArc(const float x0, const float y0, const float z0, const float h, const float u, float* res) { res[0] = x0 + dx * u; - res[1] = y0 + dy * u + h * (1-(u*2-1)*(u*2-1)); - res[2] = z0 + dz * u; + res[1] = y0 + dy * u; + res[2] = z0 + dz * u + h * (1 - (u * 2 - 1) * (u * 2 - 1)); }