[csharp] Port of commit 508e501: Don't wrap angles for transform constraint absolute local.

This commit is contained in:
Harald Csaszar 2024-04-02 16:15:18 +02:00
parent 8b5c66b8f8
commit 1e7350ac7d

View File

@ -247,11 +247,7 @@ namespace Spine {
Bone bone = bones[i];
float rotation = bone.arotation;
if (mixRotate != 0) {
float r = target.arotation - rotation + data.offsetRotation;
r -= (float)Math.Ceiling(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;
@ -264,11 +260,7 @@ namespace Spine {
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.Ceiling(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);
}