mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
[ts] Aligned Skeleton updateWorldTransformWith with reference runtime. Close #2695.
This commit is contained in:
parent
8c66239ae5
commit
dc2bcb02e1
@ -398,6 +398,20 @@ export class Skeleton {
|
||||
}
|
||||
|
||||
updateWorldTransformWith (physics: Physics, parent: Bone) {
|
||||
if (!parent) throw new Error("parent cannot be null.");
|
||||
|
||||
let bones = this.bones;
|
||||
for (let i = 1, n = bones.length; i < n; i++) { // Skip root bone.
|
||||
let bone = bones[i];
|
||||
bone.ax = bone.x;
|
||||
bone.ay = bone.y;
|
||||
bone.arotation = bone.rotation;
|
||||
bone.ascaleX = bone.scaleX;
|
||||
bone.ascaleY = bone.scaleY;
|
||||
bone.ashearX = bone.shearX;
|
||||
bone.ashearY = bone.shearY;
|
||||
}
|
||||
|
||||
// Apply the parent bone transform to the root bone. The root bone always inherits scale, rotation and reflection.
|
||||
let rootBone = this.getRootBone();
|
||||
if (!rootBone) throw new Error("Root bone must not be null.");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user