summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmix8 <52464204+smix8@users.noreply.github.com>2022-06-03 18:47:54 +0200
committersmix8 <52464204+smix8@users.noreply.github.com>2022-06-03 19:17:49 +0200
commit3066091780150847d117acc5210c937af5e015ab (patch)
tree104a4f166f6a12dfed9f2e4553caed853d77e131
parentf805ecf4e73dc186349784c14862d5519019efed (diff)
Match NavMap and ProjectSettings with NavigationMesh defaults
Match NavMap and ProjectSettings with NavigationMesh defaults since the NavMap edge merging requires a matching cell_size with the NavigationMesh to create connections without issues.
-rw-r--r--doc/classes/ProjectSettings.xml4
-rw-r--r--modules/navigation/nav_map.h4
-rw-r--r--scene/resources/world_3d.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 98205e0e16..2cba7b75e5 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -1375,10 +1375,10 @@
<member name="navigation/2d/default_edge_connection_margin" type="int" setter="" getter="" default="1">
Default edge connection margin for 2D navigation maps. See [method NavigationServer2D.map_set_edge_connection_margin].
</member>
- <member name="navigation/3d/default_cell_size" type="float" setter="" getter="" default="0.3">
+ <member name="navigation/3d/default_cell_size" type="float" setter="" getter="" default="0.25">
Default cell size for 3D navigation maps. See [method NavigationServer3D.map_set_cell_size].
</member>
- <member name="navigation/3d/default_edge_connection_margin" type="float" setter="" getter="" default="0.3">
+ <member name="navigation/3d/default_edge_connection_margin" type="float" setter="" getter="" default="0.25">
Default edge connection margin for 3D navigation maps. See [method NavigationServer3D.map_set_edge_connection_margin].
</member>
<member name="network/limits/debugger/max_chars_per_second" type="int" setter="" getter="" default="32768">
diff --git a/modules/navigation/nav_map.h b/modules/navigation/nav_map.h
index f58a78d4ca..20115dd1b4 100644
--- a/modules/navigation/nav_map.h
+++ b/modules/navigation/nav_map.h
@@ -50,10 +50,10 @@ class NavMap : public NavRid {
/// To find the polygons edges the vertices are displaced in a grid where
/// each cell has the following cell_size.
- real_t cell_size = 0.3;
+ real_t cell_size = 0.25;
/// This value is used to detect the near edges to connect.
- real_t edge_connection_margin = 5.0;
+ real_t edge_connection_margin = 0.25;
bool regenerate_polygons = true;
bool regenerate_links = true;
diff --git a/scene/resources/world_3d.cpp b/scene/resources/world_3d.cpp
index 0088236112..eb0af63975 100644
--- a/scene/resources/world_3d.cpp
+++ b/scene/resources/world_3d.cpp
@@ -150,8 +150,8 @@ World3D::World3D() {
navigation_map = NavigationServer3D::get_singleton()->map_create();
NavigationServer3D::get_singleton()->map_set_active(navigation_map, true);
- NavigationServer3D::get_singleton()->map_set_cell_size(navigation_map, GLOBAL_DEF("navigation/3d/default_cell_size", 0.3));
- NavigationServer3D::get_singleton()->map_set_edge_connection_margin(navigation_map, GLOBAL_DEF("navigation/3d/default_edge_connection_margin", 0.3));
+ NavigationServer3D::get_singleton()->map_set_cell_size(navigation_map, GLOBAL_DEF("navigation/3d/default_cell_size", 0.25));
+ NavigationServer3D::get_singleton()->map_set_edge_connection_margin(navigation_map, GLOBAL_DEF("navigation/3d/default_edge_connection_margin", 0.25));
}
World3D::~World3D() {