Make RecastDemo colors more meaningful (#254)

Implement a SampleDebugDraw which will color area types meaningfully, for example
color water as blue, grass as green and so on.
This commit is contained in:
Domenico Albani
2017-02-02 20:27:43 +01:00
committed by Jakob Botsch Nielsen
parent 16a7a30ada
commit 03eb2f92f3
13 changed files with 121 additions and 96 deletions

View File

@@ -191,19 +191,17 @@ void Sample_Debug::handleDebugMode()
void Sample_Debug::handleRender()
{
DebugDrawGL dd;
if (m_chf)
{
duDebugDrawCompactHeightfieldRegions(&dd, *m_chf);
duDebugDrawCompactHeightfieldRegions(&m_dd, *m_chf);
// duDebugDrawCompactHeightfieldSolid(&dd, *m_chf);
}
if (m_navMesh)
duDebugDrawNavMesh(&dd, *m_navMesh, DU_DRAWNAVMESH_OFFMESHCONS);
duDebugDrawNavMesh(&m_dd, *m_navMesh, DU_DRAWNAVMESH_OFFMESHCONS);
if (m_ref && m_navMesh)
duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_ref, duRGBA(255,0,0,128));
duDebugDrawNavMeshPoly(&m_dd, *m_navMesh, m_ref, duRGBA(255,0,0,128));
/* float bmin[3], bmax[3];
rcVsub(bmin, m_center, m_ext);
@@ -213,13 +211,13 @@ void Sample_Debug::handleRender()
if (m_cset)
{
duDebugDrawRawContours(&dd, *m_cset, 0.25f);
duDebugDrawContours(&dd, *m_cset);
duDebugDrawRawContours(&m_dd, *m_cset, 0.25f);
duDebugDrawContours(&m_dd, *m_cset);
}
if (m_pmesh)
{
duDebugDrawPolyMesh(&dd, *m_pmesh);
duDebugDrawPolyMesh(&m_dd, *m_pmesh);
}
/*