summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-10-10 10:55:52 +0200
committerGitHub <noreply@github.com>2020-10-10 10:55:52 +0200
commitca2c0b8937d287e608448a9a5ba553a8deaf46d9 (patch)
tree7e84a3925b86898c1576a7df50cfbe592093beea /editor/plugins
parent7c4d1e9c650f40de99f959e90795bd8443b7fd3d (diff)
parent770188904846c4395fbffa9d30d0725d604cbfde (diff)
Merge pull request #42568 from DavidSichma/fix-aabb-update
Make AABB change trigger bounding box update
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 8bd6e39252..aecbf817c4 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -2405,18 +2405,18 @@ void Node3DEditorViewport::_notification(int p_what) {
}
Transform t = sp->get_global_gizmo_transform();
+ VisualInstance3D *vi = Object::cast_to<VisualInstance3D>(sp);
+ AABB new_aabb = vi ? vi->get_aabb() : _calculate_spatial_bounds(sp);
exist = true;
- if (se->last_xform == t && !se->last_xform_dirty) {
+ if (se->last_xform == t && se->aabb == new_aabb && !se->last_xform_dirty) {
continue;
}
changed = true;
se->last_xform_dirty = false;
se->last_xform = t;
- VisualInstance3D *vi = Object::cast_to<VisualInstance3D>(sp);
-
- se->aabb = vi ? vi->get_aabb() : _calculate_spatial_bounds(sp);
+ se->aabb = new_aabb;
t.translate(se->aabb.position);