summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-16 15:05:17 +0200
committerGitHub <noreply@github.com>2022-05-16 15:05:17 +0200
commiteaa4e864332878779ff31341a2887a1f4375e61f (patch)
tree8bcaa8058e5d48dce4f92a268e7e7f1604a3fca0 /modules
parent9efb134469b09e3cb893fc9056f8b7e5b1a98e8f (diff)
parente33fa9d8331f38c8c404b9d6ea286eacb503d3bb (diff)
Merge pull request #61061 from smix8/navigation_mesh_sample_distance_range_4.x
Diffstat (limited to 'modules')
-rw-r--r--modules/navigation/navigation_mesh_generator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/navigation/navigation_mesh_generator.cpp b/modules/navigation/navigation_mesh_generator.cpp
index 110a4f5138..5cbaded6c1 100644
--- a/modules/navigation/navigation_mesh_generator.cpp
+++ b/modules/navigation/navigation_mesh_generator.cpp
@@ -445,7 +445,7 @@ void NavigationMeshGenerator::_build_recast_navigation_mesh(
cfg.minRegionArea = (int)(p_nav_mesh->get_region_min_size() * p_nav_mesh->get_region_min_size());
cfg.mergeRegionArea = (int)(p_nav_mesh->get_region_merge_size() * p_nav_mesh->get_region_merge_size());
cfg.maxVertsPerPoly = (int)p_nav_mesh->get_verts_per_poly();
- cfg.detailSampleDist = p_nav_mesh->get_detail_sample_distance() < 0.9f ? 0 : p_nav_mesh->get_cell_size() * p_nav_mesh->get_detail_sample_distance();
+ cfg.detailSampleDist = MAX(p_nav_mesh->get_cell_size() * p_nav_mesh->get_detail_sample_distance(), 0.1f);
cfg.detailSampleMaxError = p_nav_mesh->get_cell_height() * p_nav_mesh->get_detail_sample_max_error();
cfg.bmin[0] = bmin[0];