summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorDavid Sichma <sichmada@gmail.com>2020-10-05 11:03:23 +0200
committerDavid Sichma <sichmada@gmail.com>2020-10-05 12:56:57 +0200
commit770188904846c4395fbffa9d30d0725d604cbfde (patch)
treec5bb4c62dc77f86e0c7df4d92f95d8c039405fff /editor
parent3556bc48a1d357ff0109e2677c2e02b925a3e46b (diff)
aabb change updates bounding box
spatial editor will now update the bounding box if aabb or transform changes
Diffstat (limited to 'editor')
-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 b2fd855834..1ac2268cba 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);