mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[libgdx] Don't wrap angles for transform constraint absolute local.
EsotericSoftware/spine-editor#729
This commit is contained in:
parent
2dc7335b4e
commit
508e501fdc
@ -249,11 +249,7 @@ public class TransformConstraint implements Updatable {
|
|||||||
Bone bone = (Bone)bones[i];
|
Bone bone = (Bone)bones[i];
|
||||||
|
|
||||||
float rotation = bone.arotation;
|
float rotation = bone.arotation;
|
||||||
if (mixRotate != 0) {
|
if (mixRotate != 0) rotation += (target.arotation - rotation + data.offsetRotation) * mixRotate;
|
||||||
float r = target.arotation - rotation + data.offsetRotation;
|
|
||||||
r -= (float)Math.ceil(r / 360 - 0.5f) * 360;
|
|
||||||
rotation += r * mixRotate;
|
|
||||||
}
|
|
||||||
|
|
||||||
float x = bone.ax, y = bone.ay;
|
float x = bone.ax, y = bone.ay;
|
||||||
x += (target.ax - x + data.offsetX) * mixX;
|
x += (target.ax - x + data.offsetX) * mixX;
|
||||||
@ -266,11 +262,7 @@ public class TransformConstraint implements Updatable {
|
|||||||
scaleY = (scaleY + (target.ascaleY - scaleY + data.offsetScaleY) * mixScaleY) / scaleY;
|
scaleY = (scaleY + (target.ascaleY - scaleY + data.offsetScaleY) * mixScaleY) / scaleY;
|
||||||
|
|
||||||
float shearY = bone.ashearY;
|
float shearY = bone.ashearY;
|
||||||
if (mixShearY != 0) {
|
if (mixShearY != 0) shearY += (target.ashearY - shearY + data.offsetShearY) * mixShearY;
|
||||||
float r = target.ashearY - shearY + data.offsetShearY;
|
|
||||||
r -= (float)Math.ceil(r / 360 - 0.5f) * 360;
|
|
||||||
shearY += r * mixShearY;
|
|
||||||
}
|
|
||||||
|
|
||||||
bone.updateWorldTransform(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);
|
bone.updateWorldTransform(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user