diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index ec879e6f0..fea050f57 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -31,8 +31,8 @@ #include "spatial_editor_gizmos.h" #include "core/containers/list.h" -#include "core/containers/rb_map.h" #include "core/containers/pool_vector.h" +#include "core/containers/rb_map.h" #include "core/containers/rid.h" #include "core/error/error_list.h" #include "core/error/error_macros.h" @@ -3545,6 +3545,10 @@ NavigationMeshSpatialGizmoPlugin::NavigationMeshSpatialGizmoPlugin() { create_material("navigation_edge_material_disabled", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_edge_disabled", Color(0.7, 0.7, 0.7))); create_material("navigation_solid_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_solid", Color(0.5, 1, 1, 0.4))); create_material("navigation_solid_material_disabled", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_solid_disabled", Color(0.7, 0.7, 0.7, 0.4))); + + Color baking_aabb_material_color = Color(0.8, 0.5, 0.7); + baking_aabb_material_color.a = 0.1; + create_material("baking_aabb_material", baking_aabb_material_color); } bool NavigationMeshSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) { @@ -3573,6 +3577,15 @@ void NavigationMeshSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { return; } + AABB baking_aabb = navmeshie->get_filter_baking_aabb(); + if (!baking_aabb.has_no_volume()) { + Vector3 baking_aabb_offset = navmeshie->get_filter_baking_aabb_offset(); + if (p_gizmo->is_selected()) { + Ref material = get_material("baking_aabb_material", p_gizmo); + p_gizmo->add_solid_box(material, baking_aabb.get_size(), baking_aabb.get_center() + baking_aabb_offset); + } + } + PoolVector vertices = navmeshie->get_vertices(); PoolVector::Read vr = vertices.read(); List faces; diff --git a/scene/resources/navigation_mesh.cpp b/scene/resources/navigation_mesh.cpp index 526b527af..bfd39321b 100644 --- a/scene/resources/navigation_mesh.cpp +++ b/scene/resources/navigation_mesh.cpp @@ -274,7 +274,7 @@ bool NavigationMesh::get_filter_walkable_low_height_spans() const { void NavigationMesh::set_filter_baking_aabb(const AABB &p_aabb) { filter_baking_aabb = p_aabb; - property_list_changed_notify(); + emit_changed(); } AABB NavigationMesh::get_filter_baking_aabb() const { @@ -283,7 +283,7 @@ AABB NavigationMesh::get_filter_baking_aabb() const { void NavigationMesh::set_filter_baking_aabb_offset(const Vector3 &p_aabb_offset) { filter_baking_aabb_offset = p_aabb_offset; - property_list_changed_notify(); + emit_changed(); } Vector3 NavigationMesh::get_filter_baking_aabb_offset() const {