瀏覽代碼

Merge pull request #17947 from karroffel/animation-scale-rotation-order-fix

fix bone scale/rotation in AnimationPlayers
Rémi Verschelde 7 年之前
父節點
當前提交
6a9622aaa2
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      scene/animation/animation_player.cpp
  2. 1 1
      scene/animation/animation_tree_player.cpp

+ 1 - 1
scene/animation/animation_player.cpp

@@ -590,8 +590,8 @@ void AnimationPlayer::_animation_update_transforms() {
 
 			Transform t;
 			t.origin = nc->loc_accum;
-			t.basis = nc->rot_accum;
 			t.basis.scale(nc->scale_accum);
+			t.basis.rotate(nc->rot_accum.get_euler());
 
 			if (nc->skeleton && nc->bone_idx >= 0) {
 

+ 1 - 1
scene/animation/animation_tree_player.cpp

@@ -895,13 +895,13 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
 		}
 
 		Transform xform;
-		xform.basis = t.rot;
 		xform.origin = t.loc;
 
 		t.scale.x += 1.0;
 		t.scale.y += 1.0;
 		t.scale.z += 1.0;
 		xform.basis.scale(t.scale);
+		xform.basis.rotate(t.rot.get_euler());
 
 		if (t.bone_idx >= 0) {
 			if (t.skeleton)