- fixed issue 203
- fixed debug draw for partial paths
This commit is contained in:
parent
64802ecd0e
commit
a02cc64e4b
@ -423,9 +423,8 @@ void NavMeshTesterTool::handleToggle()
|
|||||||
if (m_pathIterPolyCount)
|
if (m_pathIterPolyCount)
|
||||||
{
|
{
|
||||||
// Iterate over the path to find smooth path on the detail mesh surface.
|
// Iterate over the path to find smooth path on the detail mesh surface.
|
||||||
|
m_navQuery->closestPointOnPoly(m_startRef, m_spos, m_iterPos);
|
||||||
m_navQuery->closestPointOnPolyBoundary(m_startRef, m_spos, m_iterPos);
|
m_navQuery->closestPointOnPoly(m_pathIterPolys[m_pathIterPolyCount-1], m_epos, m_targetPos);
|
||||||
m_navQuery->closestPointOnPolyBoundary(m_pathIterPolys[m_pathIterPolyCount-1], m_epos, m_targetPos);
|
|
||||||
|
|
||||||
m_nsmoothPath = 0;
|
m_nsmoothPath = 0;
|
||||||
|
|
||||||
@ -631,8 +630,8 @@ void NavMeshTesterTool::recalc()
|
|||||||
int npolys = m_npolys;
|
int npolys = m_npolys;
|
||||||
|
|
||||||
float iterPos[3], targetPos[3];
|
float iterPos[3], targetPos[3];
|
||||||
m_navQuery->closestPointOnPolyBoundary(m_startRef, m_spos, iterPos);
|
m_navQuery->closestPointOnPoly(m_startRef, m_spos, iterPos);
|
||||||
m_navQuery->closestPointOnPolyBoundary(polys[npolys-1], m_epos, targetPos);
|
m_navQuery->closestPointOnPoly(polys[npolys-1], m_epos, targetPos);
|
||||||
|
|
||||||
static const float STEP_SIZE = 0.5f;
|
static const float STEP_SIZE = 0.5f;
|
||||||
static const float SLOP = 0.01f;
|
static const float SLOP = 0.01f;
|
||||||
@ -982,9 +981,13 @@ void NavMeshTesterTool::handleRender()
|
|||||||
|
|
||||||
if (m_npolys)
|
if (m_npolys)
|
||||||
{
|
{
|
||||||
for (int i = 1; i < m_npolys-1; ++i)
|
for (int i = 0; i < m_npolys; ++i)
|
||||||
|
{
|
||||||
|
if (m_polys[i] == m_startRef || m_polys[i] == m_endRef)
|
||||||
|
continue;
|
||||||
duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_polys[i], pathCol);
|
duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_polys[i], pathCol);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_nsmoothPath)
|
if (m_nsmoothPath)
|
||||||
{
|
{
|
||||||
@ -1037,9 +1040,13 @@ void NavMeshTesterTool::handleRender()
|
|||||||
|
|
||||||
if (m_npolys)
|
if (m_npolys)
|
||||||
{
|
{
|
||||||
for (int i = 1; i < m_npolys-1; ++i)
|
for (int i = 0; i < m_npolys; ++i)
|
||||||
|
{
|
||||||
|
if (m_polys[i] == m_startRef || m_polys[i] == m_endRef)
|
||||||
|
continue;
|
||||||
duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_polys[i], pathCol);
|
duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_polys[i], pathCol);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_nstraightPath)
|
if (m_nstraightPath)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user