Skip to content

Commit

Permalink
[libgdx] Don't wrap angles for transform constraint absolute local.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Apr 2, 2024
1 parent 2dc7335 commit 508e501
Showing 1 changed file with 2 additions and 10 deletions.
Expand Up @@ -249,11 +249,7 @@ private void applyAbsoluteLocal () {
Bone bone = (Bone)bones[i];

float rotation = bone.arotation;
if (mixRotate != 0) {
float r = target.arotation - rotation + data.offsetRotation;
r -= (float)Math.ceil(r / 360 - 0.5f) * 360;
rotation += r * mixRotate;
}
if (mixRotate != 0) rotation += (target.arotation - rotation + data.offsetRotation) * mixRotate;

float x = bone.ax, y = bone.ay;
x += (target.ax - x + data.offsetX) * mixX;
Expand All @@ -266,11 +262,7 @@ private void applyAbsoluteLocal () {
scaleY = (scaleY + (target.ascaleY - scaleY + data.offsetScaleY) * mixScaleY) / scaleY;

float shearY = bone.ashearY;
if (mixShearY != 0) {
float r = target.ashearY - shearY + data.offsetShearY;
r -= (float)Math.ceil(r / 360 - 0.5f) * 360;
shearY += r * mixShearY;
}
if (mixShearY != 0) shearY += (target.ashearY - shearY + data.offsetShearY) * mixShearY;

bone.updateWorldTransform(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);
}
Expand Down

0 comments on commit 508e501

Please sign in to comment.