From ba33e46308168169f5ed84ebaf3e41b850e83435 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 13 Jul 2024 21:36:11 +0200 Subject: [PATCH] Recast: clamp min of cell size and cell height Going below a cell size of 12 will cause bad artifacts during the rasterization of the navmesh as the voxel mold would be too detailed. Also clamped the min of the cell height to 0.4 since any value below that will result in no navmesh getting generated on correct topology, so no point going lower. The original min values for size and height were 0.1, but due to the scale differences with our maps and what recast was originally configured with, adjustments had to be made. --- src/naveditor/Editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/naveditor/Editor.cpp b/src/naveditor/Editor.cpp index f8f3d1cc..304451f2 100644 --- a/src/naveditor/Editor.cpp +++ b/src/naveditor/Editor.cpp @@ -206,8 +206,8 @@ void Editor::handleCommonSettings() ImGui::PushItemWidth(180.f); ImGui::Text("Rasterization"); - ImGui::SliderFloat("Cell Size", &m_cellSize, 0.1f, 100.0f); - ImGui::SliderFloat("Cell Height", &m_cellHeight, 0.1f, 100.0f); + ImGui::SliderFloat("Cell Size", &m_cellSize, 12.1f, 100.0f); + ImGui::SliderFloat("Cell Height", &m_cellHeight, 0.4f, 100.0f); if (m_geom) {