mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 02:06:03 +08:00
[csharp] Port of commit 508e501: Don't wrap angles for transform constraint absolute local.
This commit is contained in:
parent
8b5c66b8f8
commit
1e7350ac7d
@ -247,11 +247,7 @@ namespace Spine {
|
|||||||
Bone bone = bones[i];
|
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.Ceiling(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;
|
||||||
@ -264,11 +260,7 @@ namespace Spine {
|
|||||||
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.Ceiling(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