Browse Source

Merge pull request #42568 from DavidSichma/fix-aabb-update

Make AABB change trigger bounding box update
Rémi Verschelde 4 năm trước cách đây
mục cha
commit
ca2c0b8937
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      editor/plugins/node_3d_editor_plugin.cpp

+ 4 - 4
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);