diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-04 00:21:33 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-04 00:21:33 +0100 |
commit | ea5cf7d4b8cf5cf988f32ef736de8a706b96f47b (patch) | |
tree | c43353a23badc0ac2caf02d35f3f1c7129bcebf3 /editor/plugins | |
parent | 2c008ac8c5353a23afb625ed94e8a672cdc35f84 (diff) | |
parent | 7caf08ec75519a237db2ec7777627fee8f594f4c (diff) |
Merge pull request #72655 from smix8/navigationmesh_bake_aabb_fix_4.x
Fix NavigationMesh baking AABB Editor handling and visuals
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/node_3d_editor_gizmos.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/editor/plugins/node_3d_editor_gizmos.cpp b/editor/plugins/node_3d_editor_gizmos.cpp index e48a5bb95d..bcb94b0f32 100644 --- a/editor/plugins/node_3d_editor_gizmos.cpp +++ b/editor/plugins/node_3d_editor_gizmos.cpp @@ -4876,6 +4876,10 @@ NavigationRegion3DGizmoPlugin::NavigationRegion3DGizmoPlugin() { create_material("face_material_disabled", NavigationServer3D::get_singleton()->get_debug_navigation_geometry_face_disabled_color(), false, false, true); create_material("edge_material", NavigationServer3D::get_singleton()->get_debug_navigation_geometry_edge_color()); create_material("edge_material_disabled", NavigationServer3D::get_singleton()->get_debug_navigation_geometry_edge_disabled_color()); + + 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 NavigationRegion3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { @@ -4899,6 +4903,16 @@ void NavigationRegion3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { return; } + AABB baking_aabb = navigationmesh->get_filter_baking_aabb(); + if (baking_aabb.has_volume()) { + Vector3 baking_aabb_offset = navigationmesh->get_filter_baking_aabb_offset(); + + if (p_gizmo->is_selected()) { + Ref<Material> 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); + } + } + Vector<Vector3> vertices = navigationmesh->get_vertices(); const Vector3 *vr = vertices.ptr(); List<Face3> faces; |