summaryrefslogtreecommitdiff
path: root/scene/3d/navigation_region_3d.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-08-08 22:37:00 +0200
committerGitHub <noreply@github.com>2022-08-08 22:37:00 +0200
commitd9d5990c517b63f41881de05cb4644c36e0c77e0 (patch)
tree70e0885a2d6da2f92083ece62d8202f707b031b1 /scene/3d/navigation_region_3d.cpp
parent35f71461f9af6fec65f6ac8c7d6279c7ca1f4d15 (diff)
parent92c40bcf325ce91279c14f0b6a42c200fe4faf51 (diff)
Merge pull request #64034 from DarkKilauea/fix-nav-region-gizmo
Diffstat (limited to 'scene/3d/navigation_region_3d.cpp')
-rw-r--r--scene/3d/navigation_region_3d.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/3d/navigation_region_3d.cpp b/scene/3d/navigation_region_3d.cpp
index 4150b01651..1edeff034d 100644
--- a/scene/3d/navigation_region_3d.cpp
+++ b/scene/3d/navigation_region_3d.cpp
@@ -418,11 +418,14 @@ void NavigationRegion3D::_update_debug_mesh() {
Ref<StandardMaterial3D> face_material = NavigationServer3D::get_singleton_mut()->get_debug_navigation_geometry_face_material();
Ref<StandardMaterial3D> line_material = NavigationServer3D::get_singleton_mut()->get_debug_navigation_geometry_edge_material();
+ RandomPCG rand;
Color polygon_color = debug_navigation_geometry_face_color;
for (int i = 0; i < polygon_count; i++) {
if (enabled_geometry_face_random_color) {
- polygon_color = debug_navigation_geometry_face_color * (Color(Math::randf(), Math::randf(), Math::randf()));
+ // Generate the polygon color, slightly randomly modified from the settings one.
+ polygon_color.set_hsv(debug_navigation_geometry_face_color.get_h() + rand.random(-1.0, 1.0) * 0.1, debug_navigation_geometry_face_color.get_s(), debug_navigation_geometry_face_color.get_v() + rand.random(-1.0, 1.0) * 0.2);
+ polygon_color.a = debug_navigation_geometry_face_color.a;
}
Vector<int> polygon = navmesh->get_polygon(i);