Recast: fix XZ -> XY bug in NavMeshTesterTool

Height was set on the Y plane; changed to Z. Also adjusted a comment in dtPathCorridor::moveTargetPosition to reflect the same changes.
This commit is contained in:
Kawe Mazidjatari 2024-07-02 01:19:13 +02:00
parent 4373d32a3e
commit b0c512151d
2 changed files with 3 additions and 3 deletions

View File

@ -560,7 +560,7 @@ void NavMeshTesterTool::handleToggle()
dtVcopy(m_iterPos, endPos);
float eh = 0.0f;
m_navQuery->getPolyHeight(m_pathIterPolys[0], m_iterPos, &eh);
m_iterPos[1] = eh;
m_iterPos[2] = eh;
}
}

View File

@ -491,9 +491,9 @@ bool dtPathCorridor::moveTargetPosition(const float* npos, dtNavMeshQuery* navqu
m_npath = dtMergeCorridorEndMoved(m_path, m_npath, m_maxPath, visited, nvisited);
// TODO: should we do that?
// Adjust the position to stay on top of the navmesh.
/* float h = m_target[1];
/* float h = m_target[2];
navquery->getPolyHeight(m_path[m_npath-1], result, &h);
result[1] = h;*/
result[2] = h;*/
dtVcopy(m_target, result);