diff --git a/spine-ts/spine-core/src/Skeleton.ts b/spine-ts/spine-core/src/Skeleton.ts index ddcda904de..e6729840db 100644 --- a/spine-ts/spine-core/src/Skeleton.ts +++ b/spine-ts/spine-core/src/Skeleton.ts @@ -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.");