mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ts] Port of commit 508e501: Don't wrap angles for transform constraint absolute local.
This commit is contained in:
parent
508e501fdc
commit
8b5c66b8f8
@ -248,11 +248,7 @@ export class TransformConstraint implements Updatable {
|
|||||||
let bone = bones[i];
|
let bone = bones[i];
|
||||||
|
|
||||||
let rotation = bone.arotation;
|
let rotation = bone.arotation;
|
||||||
if (mixRotate != 0) {
|
if (mixRotate != 0) rotation += (target.arotation - rotation + this.data.offsetRotation) * mixRotate;
|
||||||
let r = target.arotation - rotation + this.data.offsetRotation;
|
|
||||||
r -= Math.ceil(r / 360 - 0.5) * 360;
|
|
||||||
rotation += r * mixRotate;
|
|
||||||
}
|
|
||||||
|
|
||||||
let x = bone.ax, y = bone.ay;
|
let x = bone.ax, y = bone.ay;
|
||||||
x += (target.ax - x + this.data.offsetX) * mixX;
|
x += (target.ax - x + this.data.offsetX) * mixX;
|
||||||
@ -265,11 +261,7 @@ export class TransformConstraint implements Updatable {
|
|||||||
scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY;
|
scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY;
|
||||||
|
|
||||||
let shearY = bone.ashearY;
|
let shearY = bone.ashearY;
|
||||||
if (mixShearY != 0) {
|
if (mixShearY != 0) shearY += (target.ashearY - shearY + this.data.offsetShearY) * mixShearY;
|
||||||
let r = target.ashearY - shearY + this.data.offsetShearY;
|
|
||||||
r -= Math.ceil(r / 360 - 0.5) * 360;
|
|
||||||
shearY += r * mixShearY;
|
|
||||||
}
|
|
||||||
|
|
||||||
bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);
|
bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user