Add toggles for heightfield filtering

This commit is contained in:
Jonathan Adamczewski
2017-01-10 14:13:20 -08:00
committed by Ben Hymers
parent a2e16b8e6c
commit 12e8950bac
4 changed files with 29 additions and 7 deletions

View File

@@ -42,7 +42,10 @@ Sample::Sample() :
m_crowd(0),
m_navMeshDrawFlags(DU_DRAWNAVMESH_OFFMESHCONS|DU_DRAWNAVMESH_CLOSEDLIST),
m_tool(0),
m_ctx(0)
m_ctx(0),
m_filterLowHangingObstacles(true),
m_filterLedgeSpans(true),
m_filterWalkableLowHeightSpans(true)
{
resetCommonSettings();
m_navQuery = dtAllocNavMeshQuery();
@@ -201,6 +204,15 @@ void Sample::handleCommonSettings()
if (imguiCheck("Layers", m_partitionType == SAMPLE_PARTITION_LAYERS))
m_partitionType = SAMPLE_PARTITION_LAYERS;
imguiSeparator();
imguiLabel("Filtering");
if (imguiCheck("Low Hanging Obstacles", m_filterLowHangingObstacles))
m_filterLowHangingObstacles = !m_filterLowHangingObstacles;
if (imguiCheck("Ledge Spans", m_filterLedgeSpans))
m_filterLedgeSpans= !m_filterLedgeSpans;
if (imguiCheck("Walkable Low Height Spans", m_filterWalkableLowHeightSpans))
m_filterWalkableLowHeightSpans = !m_filterWalkableLowHeightSpans;
imguiSeparator();
imguiLabel("Polygonization");
imguiSlider("Max Edge Length", &m_edgeMaxLen, 0.0f, 50.0f, 1.0f);