@esotericsoftware/spine-webgl 4.3.7 → 4.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/spine-webgl.mjs
CHANGED
|
@@ -6286,21 +6286,22 @@ var BonePose = class {
|
|
|
6286
6286
|
modifyLocal(skeleton) {
|
|
6287
6287
|
if (this.local === skeleton._update) this.updateLocalTransform(skeleton);
|
|
6288
6288
|
this.world = 0;
|
|
6289
|
-
this.resetWorld(skeleton._update);
|
|
6289
|
+
this.resetWorld(skeleton, skeleton._update);
|
|
6290
6290
|
}
|
|
6291
|
-
modifyWorld(
|
|
6291
|
+
modifyWorld(skeleton) {
|
|
6292
|
+
const update = skeleton._update;
|
|
6292
6293
|
this.local = update;
|
|
6293
6294
|
this.world = update;
|
|
6294
|
-
this.resetWorld(update);
|
|
6295
|
+
this.resetWorld(skeleton, update);
|
|
6295
6296
|
}
|
|
6296
|
-
resetWorld(update) {
|
|
6297
|
+
resetWorld(skeleton, update) {
|
|
6297
6298
|
const children = this.bone.children;
|
|
6298
6299
|
for (let i = 0, n = children.length; i < n; i++) {
|
|
6299
6300
|
const child = children[i].appliedPose;
|
|
6300
6301
|
if (child.world === update) {
|
|
6302
|
+
if (child.local === update) child.updateLocalTransform(skeleton);
|
|
6301
6303
|
child.world = 0;
|
|
6302
|
-
child.
|
|
6303
|
-
child.resetWorld(update);
|
|
6304
|
+
child.resetWorld(skeleton, update);
|
|
6304
6305
|
}
|
|
6305
6306
|
}
|
|
6306
6307
|
}
|
|
@@ -7093,8 +7094,9 @@ var PathConstraint = class _PathConstraint extends Constraint {
|
|
|
7093
7094
|
const bone = this.slot.bone.appliedPose;
|
|
7094
7095
|
offsetRotation *= bone.a * bone.d - bone.b * bone.c > 0 ? MathUtils.degRad : -MathUtils.degRad;
|
|
7095
7096
|
}
|
|
7096
|
-
for (let i = 0, ip = 3
|
|
7097
|
+
for (let i = 0, ip = 3; i < boneCount; i++, ip += 3) {
|
|
7097
7098
|
const bone = bones[i];
|
|
7099
|
+
bone.modifyWorld(skeleton);
|
|
7098
7100
|
bone.worldX += (boneX - bone.worldX) * mixX;
|
|
7099
7101
|
bone.worldY += (boneY - bone.worldY) * mixY;
|
|
7100
7102
|
const x = positions[ip], y = positions[ip + 1], dx = x - boneX, dy = y - boneY;
|
|
@@ -7138,7 +7140,6 @@ var PathConstraint = class _PathConstraint extends Constraint {
|
|
|
7138
7140
|
bone.c = sin * a + cos * c;
|
|
7139
7141
|
bone.d = sin * b + cos * d;
|
|
7140
7142
|
}
|
|
7141
|
-
bone.modifyWorld(u);
|
|
7142
7143
|
}
|
|
7143
7144
|
}
|
|
7144
7145
|
computeWorldPositions(skeleton, path, spacesCount, tangents) {
|
|
@@ -8051,9 +8052,9 @@ var PhysicsConstraint = class _PhysicsConstraint extends Constraint {
|
|
|
8051
8052
|
const x = this.data.x > 0, y = this.data.y > 0, rotateOrShearX = this.data.rotate > 0 || this.data.shearX > 0, scaleX = this.data.scaleX > 0;
|
|
8052
8053
|
const bone = this.bone;
|
|
8053
8054
|
let l = bone.bone.data.length, t = this.data.step, z = 0;
|
|
8055
|
+
if (physics === 0 /* none */) return;
|
|
8056
|
+
bone.modifyWorld(skeleton);
|
|
8054
8057
|
switch (physics) {
|
|
8055
|
-
case 0 /* none */:
|
|
8056
|
-
return;
|
|
8057
8058
|
// biome-ignore lint/suspicious/noFallthroughSwitchClause: fall through expected
|
|
8058
8059
|
case 1 /* reset */:
|
|
8059
8060
|
this.reset(skeleton);
|
|
@@ -8231,7 +8232,6 @@ var PhysicsConstraint = class _PhysicsConstraint extends Constraint {
|
|
|
8231
8232
|
this.tx = l * bone.a;
|
|
8232
8233
|
this.ty = l * bone.c;
|
|
8233
8234
|
}
|
|
8234
|
-
bone.modifyWorld(skeleton._update);
|
|
8235
8235
|
}
|
|
8236
8236
|
sort(skeleton) {
|
|
8237
8237
|
const bone = this.bone.bone;
|
|
@@ -8798,14 +8798,14 @@ var TransformConstraint = class _TransformConstraint extends Constraint {
|
|
|
8798
8798
|
const source = this.source.appliedPose;
|
|
8799
8799
|
if (localSource) source.validateLocalTransform(skeleton);
|
|
8800
8800
|
const fromItems = data.properties;
|
|
8801
|
-
const fn = data.properties.length
|
|
8801
|
+
const fn = data.properties.length;
|
|
8802
8802
|
const bones = this.bones;
|
|
8803
8803
|
for (let i = 0, n = this.bones.length; i < n; i++) {
|
|
8804
8804
|
const bone = bones[i];
|
|
8805
8805
|
if (localTarget)
|
|
8806
8806
|
bone.modifyLocal(skeleton);
|
|
8807
8807
|
else
|
|
8808
|
-
bone.modifyWorld(
|
|
8808
|
+
bone.modifyWorld(skeleton);
|
|
8809
8809
|
for (let f = 0; f < fn; f++) {
|
|
8810
8810
|
const from = fromItems[f];
|
|
8811
8811
|
const value = from.value(skeleton, source, localSource, offsets) - from.offset;
|