mirror of
https://github.com/recastnavigation/recastnavigation.git
synced 2026-08-13 08:59:25 +00:00
Fix for Issue 99:Separate Detour mesh queries in to a different class from mesh data
This commit is contained in:
@@ -377,6 +377,7 @@ void Sample_TileMesh::handleSettings()
|
||||
{
|
||||
dtFreeNavMesh(m_navMesh);
|
||||
m_navMesh = loadAll("all_tiles_navmesh.bin");
|
||||
m_navQuery->init(m_navMesh, 2048);
|
||||
}
|
||||
|
||||
char msg[64];
|
||||
@@ -473,7 +474,7 @@ void Sample_TileMesh::handleRender()
|
||||
|
||||
if (m_navMesh)
|
||||
{
|
||||
duDebugDrawNavMesh(&dd, *m_navMesh, m_navMeshDrawFlags);
|
||||
duDebugDrawNavMeshWithClosedList(&dd, *m_navMesh, *m_navQuery, m_navMeshDrawFlags);
|
||||
if (m_drawPortals)
|
||||
duDebugDrawNavMeshPortals(&dd, *m_navMesh);
|
||||
}
|
||||
@@ -544,7 +545,6 @@ bool Sample_TileMesh::handleBuild()
|
||||
params.tileHeight = m_tileSize*m_cellSize;
|
||||
params.maxTiles = m_maxTiles;
|
||||
params.maxPolys = m_maxPolysPerTile;
|
||||
params.maxNodes = 2048;
|
||||
if (!m_navMesh->init(¶ms))
|
||||
{
|
||||
if (rcGetLog())
|
||||
@@ -552,6 +552,13 @@ bool Sample_TileMesh::handleBuild()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_navQuery->init(m_navMesh, 2048))
|
||||
{
|
||||
if (rcGetLog())
|
||||
rcGetLog()->log(RC_LOG_ERROR, "buildTiledNavigation: Could not init Detour navmesh query");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_buildAll)
|
||||
buildAllTiles();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user