diff options
| author | smix8 <52464204+smix8@users.noreply.github.com> | 2022-07-01 18:58:03 +0200 |
|---|---|---|
| committer | smix8 <52464204+smix8@users.noreply.github.com> | 2022-07-29 09:58:41 +0200 |
| commit | c394ea518e48bbce710b251cf20be078505ef8d7 (patch) | |
| tree | 84098d300d6e5106b88571463157fa52c180a593 /editor/editor_node.cpp | |
| parent | afdae67cc381bb340da2e864279da6b836804b7f (diff) | |
| download | redot-engine-c394ea518e48bbce710b251cf20be078505ef8d7.tar.gz | |
Add more detailed Navigation Debug Visualization
- Adds more customization options to ProjectSettings.
- Displays navregion edge connections and navigation polygon edges in editor and at runtime.
- Majority of debug code moved from SceneTree to NavigationServer.
- Removes the irritating debug MeshInstance child node from NavigationRegion3D and replaces it with direct RenderingServer API.
Diffstat (limited to 'editor/editor_node.cpp')
| -rw-r--r-- | editor/editor_node.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index e3caaf93c6..01f7f822b8 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -553,6 +553,19 @@ void EditorNode::_update_from_settings() { tree->set_debug_collision_contact_color(GLOBAL_GET("debug/shapes/collision/contact_color")); tree->set_debug_navigation_color(GLOBAL_GET("debug/shapes/navigation/geometry_color")); tree->set_debug_navigation_disabled_color(GLOBAL_GET("debug/shapes/navigation/disabled_geometry_color")); + +#ifdef DEBUG_ENABLED + NavigationServer3D::get_singleton_mut()->set_debug_navigation_edge_connection_color(GLOBAL_GET("debug/shapes/navigation/edge_connection_color")); + NavigationServer3D::get_singleton_mut()->set_debug_navigation_geometry_edge_color(GLOBAL_GET("debug/shapes/navigation/geometry_edge_color")); + NavigationServer3D::get_singleton_mut()->set_debug_navigation_geometry_face_color(GLOBAL_GET("debug/shapes/navigation/geometry_face_color")); + NavigationServer3D::get_singleton_mut()->set_debug_navigation_geometry_edge_disabled_color(GLOBAL_GET("debug/shapes/navigation/geometry_edge_disabled_color")); + NavigationServer3D::get_singleton_mut()->set_debug_navigation_geometry_face_disabled_color(GLOBAL_GET("debug/shapes/navigation/geometry_face_disabled_color")); + NavigationServer3D::get_singleton_mut()->set_debug_navigation_enable_edge_connections(GLOBAL_GET("debug/shapes/navigation/enable_edge_connections")); + NavigationServer3D::get_singleton_mut()->set_debug_navigation_enable_edge_connections_xray(GLOBAL_GET("debug/shapes/navigation/enable_edge_connections_xray")); + NavigationServer3D::get_singleton_mut()->set_debug_navigation_enable_edge_lines(GLOBAL_GET("debug/shapes/navigation/enable_edge_lines")); + NavigationServer3D::get_singleton_mut()->set_debug_navigation_enable_edge_lines_xray(GLOBAL_GET("debug/shapes/navigation/enable_edge_lines_xray")); + NavigationServer3D::get_singleton_mut()->set_debug_navigation_enable_geometry_face_random_color(GLOBAL_GET("debug/shapes/navigation/enable_geometry_face_random_color")); +#endif // DEBUG_ENABLED } void EditorNode::_select_default_main_screen_plugin() { @@ -5910,7 +5923,11 @@ EditorNode::EditorNode() { RenderingServer::get_singleton()->set_debug_generate_wireframes(true); // No navigation server by default if in editor. - NavigationServer3D::get_singleton()->set_active(false); + if (NavigationServer3D::get_singleton()->get_debug_enabled()) { + NavigationServer3D::get_singleton()->set_active(true); + } else { + NavigationServer3D::get_singleton()->set_active(false); + } // No physics by default if in editor. PhysicsServer3D::get_singleton()->set_active(false); |
