diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-04-27 12:41:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-27 12:41:24 +0200 |
commit | f40952e0ba4efc2c2ec89e7492f09a0dea839f12 (patch) | |
tree | 33cb6fcf73a9d60378c07676979acafbfc9f8828 | |
parent | a68049339721215b4a849e71897139b07a555403 (diff) | |
parent | df89969865ffe84d36a666716934089afa16c51f (diff) |
Merge pull request #60349 from TokageItLab/fix-rotated-root-motion-view
-rw-r--r-- | scene/animation/root_motion_view.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scene/animation/root_motion_view.cpp b/scene/animation/root_motion_view.cpp index 42adc1ea02..3192f5f7cd 100644 --- a/scene/animation/root_motion_view.cpp +++ b/scene/animation/root_motion_view.cpp @@ -114,9 +114,8 @@ void RootMotionView::_notification(int p_what) { first = false; transform.orthonormalize(); //don't want scale, too imprecise - transform.affine_invert(); - accumulated = transform * accumulated; + accumulated = accumulated * transform; accumulated.origin.x = Math::fposmod(accumulated.origin.x, cell_size); if (zero_y) { accumulated.origin.y = 0; @@ -134,9 +133,9 @@ void RootMotionView::_notification(int p_what) { Vector3 from(i * cell_size, 0, j * cell_size); Vector3 from_i((i + 1) * cell_size, 0, j * cell_size); Vector3 from_j(i * cell_size, 0, (j + 1) * cell_size); - from = accumulated.xform(from); - from_i = accumulated.xform(from_i); - from_j = accumulated.xform(from_j); + from = accumulated.xform_inv(from); + from_i = accumulated.xform_inv(from_i); + from_j = accumulated.xform_inv(from_j); Color c = color, c_i = color, c_j = color; c.a *= MAX(0, 1.0 - from.length() / radius); |