1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Create default World navigation maps on demand only

Changes that the default navigation maps of World resources are only created on first use.
This commit is contained in:
smix8
2023-01-30 01:50:46 +01:00
parent d01ac9c736
commit 1bc2c7cb12
5 changed files with 30 additions and 19 deletions

View File

@@ -30,9 +30,7 @@
#include "navigation_server_3d.h"
#ifdef DEBUG_ENABLED
#include "core/config/project_settings.h"
#endif // DEBUG_ENABLED
NavigationServer3D *NavigationServer3D::singleton = nullptr;
@@ -145,6 +143,14 @@ NavigationServer3D::NavigationServer3D() {
ERR_FAIL_COND(singleton != nullptr);
singleton = this;
GLOBAL_DEF("navigation/2d/default_cell_size", 1);
GLOBAL_DEF("navigation/2d/default_edge_connection_margin", 1);
GLOBAL_DEF("navigation/2d/default_link_connection_radius", 4);
GLOBAL_DEF("navigation/3d/default_cell_size", 0.25);
GLOBAL_DEF("navigation/3d/default_edge_connection_margin", 0.25);
GLOBAL_DEF("navigation/3d/default_link_connection_radius", 1.0);
#ifdef DEBUG_ENABLED
debug_navigation_edge_connection_color = GLOBAL_DEF("debug/shapes/navigation/edge_connection_color", Color(1.0, 0.0, 1.0, 1.0));
debug_navigation_geometry_edge_color = GLOBAL_DEF("debug/shapes/navigation/geometry_edge_color", Color(0.5, 1.0, 1.0, 1.0));