diff --git a/server/gameserver/navmeshbuilder.cc b/server/gameserver/navmeshbuilder.cc index ecd6c3d..9660d75 100644 --- a/server/gameserver/navmeshbuilder.cc +++ b/server/gameserver/navmeshbuilder.cc @@ -210,14 +210,15 @@ int NavMeshBuilder::RasterizeTileLayers(BuilderParams& builder_params, // Once all geometry is rasterized, we do initial pass of filtering to // remove unwanted overhangs caused by the conservative rasterization // as well as filter spans where the character cannot possibly stand. - #if 0 - if (m_filterLowHangingObstacles) - rcFilterLowHangingWalkableObstacles(m_ctx, tcfg.walkableClimb, *rc.solid); - if (m_filterLedgeSpans) - rcFilterLedgeSpans(m_ctx, tcfg.walkableHeight, tcfg.walkableClimb, *rc.solid); - if (m_filterWalkableLowHeightSpans) - rcFilterWalkableLowHeightSpans(m_ctx, tcfg.walkableHeight, *rc.solid); - #endif + if (builder_params.kFilterLowHangingObstacles) { + rcFilterLowHangingWalkableObstacles(ctx, tcfg.walkableClimb, *rc.solid); + } + if (builder_params.kFilterLedgeSpans) { + rcFilterLedgeSpans(ctx, tcfg.walkableHeight, tcfg.walkableClimb, *rc.solid); + } + if (builder_params.kFilterWalkableLowHeightSpans) { + rcFilterWalkableLowHeightSpans(ctx, tcfg.walkableHeight, *rc.solid); + } rc.chf = rcAllocCompactHeightfield(); if (!rc.chf) { diff --git a/server/gameserver/navmeshhelper.h b/server/gameserver/navmeshhelper.h index a9eddb9..7ce8df3 100644 --- a/server/gameserver/navmeshhelper.h +++ b/server/gameserver/navmeshhelper.h @@ -290,6 +290,10 @@ struct BuilderParams const int kMaxTiles = 0; const int kMaxPolysPerTile = 0; + const bool kFilterLowHangingObstacles = false; + const bool kFilterLedgeSpans = false; + const bool kFilterWalkableLowHeightSpans = false; + int grid_width = 0; int grid_height = 0; int tile_size = 0;