diff options
Diffstat (limited to 'servers/navigation_server_3d.cpp')
-rw-r--r-- | servers/navigation_server_3d.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/servers/navigation_server_3d.cpp b/servers/navigation_server_3d.cpp index 783d32641e..cab8816747 100644 --- a/servers/navigation_server_3d.cpp +++ b/servers/navigation_server_3d.cpp @@ -190,12 +190,10 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_geometry_face_m bool enabled_geometry_face_random_color = get_debug_navigation_enable_geometry_face_random_color(); - Color debug_navigation_geometry_face_color = get_debug_navigation_geometry_face_color(); - Ref<StandardMaterial3D> face_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D)); face_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); face_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA); - face_material->set_albedo(debug_navigation_geometry_face_color); + face_material->set_albedo(get_debug_navigation_geometry_face_color()); if (enabled_geometry_face_random_color) { face_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true); face_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); @@ -213,11 +211,9 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_geometry_edge_m bool enabled_edge_lines_xray = get_debug_navigation_enable_edge_lines_xray(); - Color debug_navigation_geometry_edge_color = get_debug_navigation_geometry_edge_color(); - Ref<StandardMaterial3D> line_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D)); line_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); - line_material->set_albedo(debug_navigation_geometry_edge_color); + line_material->set_albedo(get_debug_navigation_geometry_edge_color()); if (enabled_edge_lines_xray) { line_material->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true); } @@ -232,12 +228,10 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_geometry_face_d return debug_navigation_geometry_face_disabled_material; } - Color debug_navigation_geometry_face_disabled_color = get_debug_navigation_geometry_face_disabled_color(); - Ref<StandardMaterial3D> face_disabled_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D)); face_disabled_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); face_disabled_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA); - face_disabled_material->set_albedo(debug_navigation_geometry_face_disabled_color); + face_disabled_material->set_albedo(get_debug_navigation_geometry_face_disabled_color()); debug_navigation_geometry_face_disabled_material = face_disabled_material; @@ -251,11 +245,9 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_geometry_edge_d bool enabled_edge_lines_xray = get_debug_navigation_enable_edge_lines_xray(); - Color debug_navigation_geometry_edge_disabled_color = get_debug_navigation_geometry_edge_disabled_color(); - Ref<StandardMaterial3D> line_disabled_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D)); line_disabled_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); - line_disabled_material->set_albedo(debug_navigation_geometry_edge_disabled_color); + line_disabled_material->set_albedo(get_debug_navigation_geometry_edge_disabled_color()); if (enabled_edge_lines_xray) { line_disabled_material->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true); } @@ -272,11 +264,9 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_edge_connection bool enabled_edge_connections_xray = get_debug_navigation_enable_edge_connections_xray(); - Color debug_navigation_edge_connection_color = get_debug_navigation_edge_connection_color(); - Ref<StandardMaterial3D> edge_connections_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D)); edge_connections_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); - edge_connections_material->set_albedo(debug_navigation_edge_connection_color); + edge_connections_material->set_albedo(get_debug_navigation_edge_connection_color()); if (enabled_edge_connections_xray) { edge_connections_material->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true); } |