diff options
author | Andrés Botero <0xafbf@gmail.com> | 2023-06-17 14:28:05 -0500 |
---|---|---|
committer | Andrés Botero <0xafbf@gmail.com> | 2023-10-28 01:23:38 -0500 |
commit | acae38201077c8ee7013d2d9ec608dc8ee5c49c0 (patch) | |
tree | 8e95316c9e9486134dd0044d2f661f4de6cf7e96 /scene/2d/path_2d.cpp | |
parent | f497156e0b37fc4c33ce11c285a8b318b319f7cc (diff) | |
download | redot-engine-acae38201077c8ee7013d2d9ec608dc8ee5c49c0.tar.gz |
Changed the way the rotation of a curve at a point is evaluated to match PathFollow2D
Diffstat (limited to 'scene/2d/path_2d.cpp')
-rw-r--r-- | scene/2d/path_2d.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index ee0ccc42ff..a0e7e4cf25 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -146,8 +146,8 @@ void Path2D::_notification(int p_what) { for (int i = 0; i < sample_count; i++) { const Vector2 p = r[i].get_origin(); - const Vector2 side = r[i].columns[0]; - const Vector2 forward = r[i].columns[1]; + const Vector2 side = r[i].columns[1]; + const Vector2 forward = r[i].columns[0]; // Fish Bone. w[0] = p + (side - forward) * 5; @@ -232,8 +232,8 @@ void PathFollow2D::_update_transform() { if (rotates) { Transform2D xform = c->sample_baked_with_rotation(progress, cubic); - xform.translate_local(v_offset, h_offset); - set_rotation(xform[1].angle()); + xform.translate_local(h_offset, v_offset); + set_rotation(xform[0].angle()); set_position(xform[2]); } else { Vector2 pos = c->sample_baked(progress, cubic); |