Fixed findStraightPath() to return partial results. Fixed main.cpp FPS throttling. Added initial support for path replanning in DetourCrowd.

This commit is contained in:
Mikko Mononen
2011-08-01 10:48:56 +00:00
parent 2c9a3a0b4f
commit 1b6ca5a94a
17 changed files with 608 additions and 143 deletions

View File

@@ -424,6 +424,26 @@ void duDebugDrawNavMeshPortals(duDebugDraw* dd, const dtNavMesh& mesh)
}
}
void duDebugDrawNavMeshPolysWithFlags(struct duDebugDraw* dd, const dtNavMesh& mesh,
const unsigned short polyFlags, const unsigned int col)
{
if (!dd) return;
for (int i = 0; i < mesh.getMaxTiles(); ++i)
{
const dtMeshTile* tile = mesh.getTile(i);
if (!tile->header) continue;
dtPolyRef base = mesh.getPolyRefBase(tile);
for (int j = 0; j < tile->header->polyCount; ++j)
{
const dtPoly* p = &tile->polys[j];
if ((p->flags & polyFlags) == 0) continue;
duDebugDrawNavMeshPoly(dd, mesh, base|(dtPolyRef)j, col);
}
}
}
void duDebugDrawNavMeshPoly(duDebugDraw* dd, const dtNavMesh& mesh, dtPolyRef ref, const unsigned int col)
{
if (!dd) return;