PathConstraint needs to take into account flipX/Y or parent scale. Determining handedness of base vectors let's us compensate

This commit is contained in:
badlogic 2016-11-07 12:26:11 +01:00
parent 208f797648
commit f5a6b4bf92

View File

@ -149,7 +149,8 @@ public class PathConstraint implements Constraint {
r = positions[p + 2];
else
r = atan2(dy, dx);
r -= atan2(c, a) - offsetRotation * degRad;
float det = a * d - b * c;
r -= atan2(c, a) + (det > 0 ? -offsetRotation * degRad : offsetRotation * degRad);
if (tip) {
cos = cos(r);
sin = sin(r);