Changed dtNavmeshQuery.getPolyWallSegments() to require max number of segments to store.

This commit is contained in:
Mikko Mononen
2010-10-15 06:35:40 +00:00
parent ab9ada50c5
commit c9df5dc995
7 changed files with 177 additions and 656 deletions

View File

@@ -1118,8 +1118,9 @@ void NavMeshTesterTool::handleRender()
dd.depthMask(true);
}
float segs[DT_VERTS_PER_POLYGON*3*2];
const int nsegs = m_navQuery->getPolyWallSegments(m_polys[i], &m_filter, segs);
static const int MAX_SEGS = DT_VERTS_PER_POLYGON*2;
float segs[MAX_SEGS*6];
const int nsegs = m_navQuery->getPolyWallSegments(m_polys[i], &m_filter, segs, MAX_SEGS);
dd.begin(DU_DRAW_LINES, 2.0f);
for (int j = 0; j < nsegs; ++j)
{