Off-Mesh connections across tile boundaries. Fixed getPolysAround(). Detour links per poly use linked list. Adjusted off-mesh connection tool.

This commit is contained in:
Mikko Mononen
2010-01-26 12:48:58 +00:00
parent e973b71d4b
commit a56bf3ec2d
16 changed files with 4140 additions and 7625 deletions

View File

@@ -311,8 +311,7 @@ void Sample_TileMesh::handleRender()
// Draw mesh
duDebugDrawTriMesh(&dd, m_geom->getMesh()->getVerts(), m_geom->getMesh()->getVertCount(),
m_geom->getMesh()->getTris(), m_geom->getMesh()->getNormals(), m_geom->getMesh()->getTriCount(), 0);
if ((m_navMeshDrawFlags & DU_DRAWNAVMESH_OFFMESHCONS) == 0)
m_geom->drawOffMeshConnections(&dd);
m_geom->drawOffMeshConnections(&dd);
glDepthMask(GL_FALSE);
@@ -363,9 +362,10 @@ void Sample_TileMesh::handleMeshChanged(class InputGeom* geom)
Sample::handleMeshChanged(geom);
cleanup();
delete m_navMesh;
m_navMesh = 0;
if (m_tool)
{
m_tool->reset();
@@ -404,8 +404,6 @@ bool Sample_TileMesh::handleBuild()
if (m_buildAll)
buildAllTiles();
setNavMeshDrawFlags(DU_DRAWNAVMESH_OFFMESHCONS);
if (m_tool)
m_tool->init(this);
@@ -796,10 +794,10 @@ unsigned char* Sample_TileMesh::buildTileMesh(const float* bmin, const float* bm
params.detailVertsCount = m_dmesh->nverts;
params.detailTris = m_dmesh->tris;
params.detailTriCount = m_dmesh->ntris;
params.offMeshConVerts = 0;
params.offMeshConRad = 0;
params.offMeshConDir = 0;
params.offMeshConCount = 0;
params.offMeshConVerts = m_geom->getOffMeshConnectionVerts();
params.offMeshConRad = m_geom->getOffMeshConnectionRads();
params.offMeshConDir = m_geom->getOffMeshConnectionDirs();
params.offMeshConCount = m_geom->getOffMeshConnectionCount();
params.walkableHeight = m_agentHeight;
params.walkableRadius = m_agentRadius;
params.walkableClimb = m_agentMaxClimb;