Changed the way the rotation of a curve at a point is evaluated to match PathFollow2D - #78378
Conversation
|
This breaks |
|
merging this would also benefit this other PR I'm working on #77819 |
You're right, I'll do that now |
|
I fixed the PathFollow2D code, but I have to leave now, I'll come back later to update tests and docs. |
e2beedc to
1eeb039
Compare
|
Well, you need to tell your kids to paint rockets horizontally. In any case, better than in mirrored shape :) |
|
I tested this PR locally (rebased on top of This PR
|
|
IIRC if I tested the initial commit the fish direction path was was ok. |
Where is this actually painted? curve_editor_plugin is a non-functioning piece of code. |
|
It's in Lines 141 to 159 in e74bf83 Fix should be to swap: const Vector2 side = r[i].columns[0];
const Vector2 forward = r[i].columns[1];For: const Vector2 side = r[i].columns[1];
const Vector2 forward = r[i].columns[0];But haven't tested |
|
@0xafbf needs squash and rebase. |
1eeb039 to
bba2956
Compare
bba2956 to
c7830a5
Compare
kleonc
left a comment
There was a problem hiding this comment.
LGTM! 👍
Changed the way the rotation of a curve at a point is evaluated to match PathFollow2D
To precise, this PR rather makes Curve2D::sample_baked_with_rotation1 return a Transform2D compliant with the Godot's 2D coordinate system (previously it was returning a transform with the basis axes swapped). This implicates it makes it compliant with all other things compliant with the Godot's 2D coordinate system, including e.g. PathFollow2D.
All usages of Curve2D::sample_baked_with_rotation within the codebase were changed appropriately (including more tests added).
The previous behavior was documented in #78362, so it can be considered a compatibility breaking change. I do consider this as a bugfix though (a buggy documented behavior is still a bug).
Sure there are probably some users using Curve2D::sample_baked_with_rotation and thus using some workarounds for the previous behavior. Their code would indeed break after merging this PR and thus they would need to get rid of the mentioned workarounds (shouldn't be a big deal).
So in case of merging this PR the change in Curve2D::sample_baked_with_rotation's behavior needs to be clearly stated out in the changelog (or some other relevant place).
@0xafbf Rebasing would be probably a good idea.
Footnotes
-
The changed
Curve2D::_sample_postureis used internally only byCurve2D::sample_baked_with_rotation. ↩
|
Since this changes behavior and might surprise users, I'd prefer waiting for 4.3 so we have enough dev snapshots to get this tested and users to report any unexpected breakage in their projects. |
c7830a5 to
acae382
Compare
|
Rebased :) also took the colon from the docs example as requested. Yeah, too bad this was approved a bit late for this release, but its great that its approved nonetheless 💯 Thanks for your efforts |
|
Thanks! |
…ct-transform Changed the way the rotation of a curve at a point is evaluated to match PathFollow2D
…ct-transform Changed the way the rotation of a curve at a point is evaluated to match PathFollow2D



Fixes #78361