Просмотр исходного кода

Merge pull request #10573 from tagcup/gizmo_aabb_scaling_order

Fix the order of transformations for selection bounding box in spatial editor.
Rémi Verschelde 8 лет назад
Родитель
Сommit
78d9936f8d
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      editor/plugins/spatial_editor_plugin.cpp

+ 5 - 1
editor/plugins/spatial_editor_plugin.cpp

@@ -1756,7 +1756,11 @@ void SpatialEditorViewport::_notification(int p_what) {
 
 
 			Transform t = sp->get_global_transform();
 			Transform t = sp->get_global_transform();
 			t.translate(se->aabb.position);
 			t.translate(se->aabb.position);
-			t.basis.scale(se->aabb.size);
+
+			// apply AABB scaling before item's global transform
+			Basis aabb_s;
+			aabb_s.scale(se->aabb.size);
+			t.basis = t.basis * aabb_s;
 
 
 			exist = true;
 			exist = true;
 			if (se->last_xform == t)
 			if (se->last_xform == t)