mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-25 22:23:42 +08:00
Followers takes gameobject rotation into account.
This commit is contained in:
parent
a20d61ff50
commit
5f3c7c0a4d
@ -903,6 +903,7 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
|
|||||||
const sin = Math.sin(boneGameAngleRad);
|
const sin = Math.sin(boneGameAngleRad);
|
||||||
|
|
||||||
const negateAngle = this.isMirrored !== this.isFlipped;
|
const negateAngle = this.isMirrored !== this.isFlipped;
|
||||||
|
const gameObjectAngleDeg = (this.angle + this.propOffsetAngle) * spine.MathUtils.radDeg;
|
||||||
|
|
||||||
for (const follower of followers) {
|
for (const follower of followers) {
|
||||||
const instance = this.runtime.getInstanceByUid(follower.uid) as IWorldInstance;
|
const instance = this.runtime.getInstanceByUid(follower.uid) as IWorldInstance;
|
||||||
@ -918,7 +919,7 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
|
|||||||
instance.y = y + rotatedOffsetY;
|
instance.y = y + rotatedOffsetY;
|
||||||
|
|
||||||
const angle = boneRotation + follower.offsetAngle;
|
const angle = boneRotation + follower.offsetAngle;
|
||||||
instance.angleDegrees = negateAngle ? -angle : angle;
|
instance.angleDegrees = gameObjectAngleDeg + (negateAngle ? -angle : angle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user