summaryrefslogtreecommitdiffstats
path: root/modules/navigation/3d
diff options
context:
space:
mode:
authorsmix8 <52464204+smix8@users.noreply.github.com>2024-04-13 01:43:13 +0200
committersmix8 <52464204+smix8@users.noreply.github.com>2024-04-13 03:39:53 +0200
commit8a0f1f19950a4728efc7b6082af7a55e74ddd4df (patch)
tree537e0356588a90b20025cb413d41ffb59a46bff1 /modules/navigation/3d
parent029aadef563fb69cf49aa9795b62f27171f8c3f4 (diff)
downloadredot-engine-8a0f1f19950a4728efc7b6082af7a55e74ddd4df.tar.gz
Use fmod for navigation mesh border size warning
Uses fmod for checking that navigation mesh border size matches the cell size as a multiple of cell size is also valid.
Diffstat (limited to 'modules/navigation/3d')
-rw-r--r--modules/navigation/3d/nav_mesh_generator_3d.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/navigation/3d/nav_mesh_generator_3d.cpp b/modules/navigation/3d/nav_mesh_generator_3d.cpp
index 11f4359146..3d3f4b4679 100644
--- a/modules/navigation/3d/nav_mesh_generator_3d.cpp
+++ b/modules/navigation/3d/nav_mesh_generator_3d.cpp
@@ -700,7 +700,7 @@ void NavMeshGenerator3D::generator_bake_from_source_geometry_data(Ref<Navigation
cfg.detailSampleDist = MAX(p_navigation_mesh->get_cell_size() * p_navigation_mesh->get_detail_sample_distance(), 0.1f);
cfg.detailSampleMaxError = p_navigation_mesh->get_cell_height() * p_navigation_mesh->get_detail_sample_max_error();
- if (p_navigation_mesh->get_border_size() > 0.0 && !Math::is_equal_approx(p_navigation_mesh->get_cell_size(), p_navigation_mesh->get_border_size())) {
+ if (p_navigation_mesh->get_border_size() > 0.0 && Math::fmod(p_navigation_mesh->get_border_size(), p_navigation_mesh->get_cell_size()) != 0.0) {
WARN_PRINT("Property border_size is ceiled to cell_size voxel units and loses precision.");
}
if (!Math::is_equal_approx((float)cfg.walkableHeight * cfg.ch, p_navigation_mesh->get_agent_height())) {