@esotericsoftware/spine-webgl 4.3.3 → 4.3.5

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.
@@ -4217,16 +4217,16 @@ var AnimationState = class _AnimationState {
4217
4217
  for (let i = 0; i < timelineCount; i++) {
4218
4218
  const timeline = timelines[i];
4219
4219
  const mode = timelineMode[i];
4220
+ const fromSetup = (mode & FIRST) !== 0;
4220
4221
  let alpha = 0;
4221
4222
  if ((mode & HOLD) !== 0) {
4222
4223
  const holdMix = timelineHoldMix[i];
4223
4224
  alpha = holdMix == null ? alphaHold : alphaHold * (1 - holdMix.mix());
4224
4225
  } else {
4225
- if (!drawOrder && timeline instanceof DrawOrderTimeline) continue;
4226
+ if (!drawOrder && timeline instanceof DrawOrderTimeline && !fromSetup) continue;
4226
4227
  alpha = alphaMix;
4227
4228
  }
4228
4229
  from.totalAlpha += alpha;
4229
- const fromSetup = (mode & FIRST) !== 0;
4230
4230
  if (!shortestRotation && timeline instanceof RotateTimeline) {
4231
4231
  this.applyRotateTimeline(timeline, skeleton, applyTime, alpha, fromSetup, timelinesRotation, i << 1, firstFrame);
4232
4232
  } else if (timeline instanceof AttachmentTimeline)
@@ -4778,7 +4778,7 @@ var TrackEntry = class {
4778
4778
  * properties keyed by the animation are set to the setup pose and the track is cleared.
4779
4779
  *
4780
4780
  * Usually you want to use {@link AnimationState.addEmptyAnimation} rather than have the animation
4781
- * abruptly cease being applied. */
4781
+ * abruptly cease being applied, leaving the current pose. */
4782
4782
  trackEnd = 0;
4783
4783
  /** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or
4784
4784
  * faster. Defaults to 1.
@@ -8110,7 +8110,7 @@ var PhysicsConstraintData = class extends ConstraintData {
8110
8110
  gravityGlobal = false;
8111
8111
  /** True when this constraint's mix is controlled by global slider timelines. */
8112
8112
  mixGlobal = false;
8113
- /** Determines how the {@link BonePose.scaleY} changes when {@link PhysicsConstraintData.scaleX} sets
8113
+ /** Determines how the {@link BonePose.scaleY} changes when {@link BonePose.scaleX} sets
8114
8114
  * {@link BonePose.scaleX}. */
8115
8115
  _scaleYMode = 0 /* None */;
8116
8116
  get scaleYMode() {
@@ -8240,6 +8240,9 @@ var SliderData = class extends ConstraintData {
8240
8240
  offset = 0;
8241
8241
  /** When true and a bone is set, the bone's local transform property is read instead of its world transform. */
8242
8242
  local = false;
8243
+ // Nonessential.
8244
+ /** When a bone is set, the maximum slider time for the bone property range, or 0 if nonessential data was not exported. */
8245
+ max = 0;
8243
8246
  constructor(name) {
8244
8247
  super(name, new SliderPose());
8245
8248
  }
@@ -8922,7 +8925,7 @@ var ToShearY = class extends ToProperty {
8922
8925
  if (additive)
8923
8926
  value -= MathUtils.PI / 2;
8924
8927
  else {
8925
- value -= by - Math.atan2(bone.c / sx, bone.a / sy);
8928
+ value -= by - Math.atan2(bone.c / sy, bone.a / sx);
8926
8929
  if (value > MathUtils.PI)
8927
8930
  value -= MathUtils.PI2;
8928
8931
  else if (value < -MathUtils.PI)
@@ -8930,8 +8933,8 @@ var ToShearY = class extends ToProperty {
8930
8933
  }
8931
8934
  value = by + value * pose.mixShearY;
8932
8935
  const s = Math.sqrt(b * b + d * d);
8933
- bone.b = Math.cos(value) * s * sy;
8934
- bone.d = Math.sin(value) * s * sx;
8936
+ bone.b = Math.cos(value) * s * sx;
8937
+ bone.d = Math.sin(value) * s * sy;
8935
8938
  }
8936
8939
  }
8937
8940
  };
@@ -9211,7 +9214,13 @@ var SkeletonBinary = class {
9211
9214
  data.skinRequired = (flags & 1) !== 0;
9212
9215
  data.loop = (flags & 2) !== 0;
9213
9216
  data.additive = (flags & 4) !== 0;
9214
- if ((flags & 8) !== 0) data.setupPose.time = input.readFloat();
9217
+ if ((flags & 8) !== 0) {
9218
+ const value = input.readFloat();
9219
+ if (nonessential && (flags & 64) !== 0)
9220
+ data.max = value;
9221
+ else
9222
+ data.setupPose.time = value;
9223
+ }
9215
9224
  if ((flags & 16) !== 0) data.setupPose.mix = (flags & 32) !== 0 ? input.readFloat() : 1;
9216
9225
  if ((flags & 64) !== 0) {
9217
9226
  data.local = (flags & 128) !== 0;
@@ -11032,6 +11041,9 @@ var SkeletonClipping = class {
11032
11041
  offset += polygonSize;
11033
11042
  }
11034
11043
  }
11044
+ this.clippedVerticesTyped = this._clippedVerticesTyped.subarray(0, this.clippedVerticesLength);
11045
+ this.clippedUVsTyped = this._clippedUVsTyped.subarray(0, this.clippedUVsLength);
11046
+ this.clippedTrianglesTyped = this._clippedTrianglesTyped.subarray(0, this.clippedTrianglesLength);
11035
11047
  return true;
11036
11048
  }
11037
11049
  const clipOutput = this.clipOutput;
@@ -11633,7 +11645,6 @@ var SkeletonJson = class {
11633
11645
  data.skinRequired = skinRequired;
11634
11646
  data.additive = getValue(constraintMap, "additive", false);
11635
11647
  data.loop = getValue(constraintMap, "loop", false);
11636
- data.setupPose.time = getValue(constraintMap, "time", 0);
11637
11648
  data.setupPose.mix = getValue(constraintMap, "mix", 1);
11638
11649
  const boneName = constraintMap.bone;
11639
11650
  if (boneName) {
@@ -11645,8 +11656,10 @@ var SkeletonJson = class {
11645
11656
  data.property.offset = getValue(constraintMap, "from", 0) * propertyScale;
11646
11657
  data.offset = getValue(constraintMap, "to", 0);
11647
11658
  data.scale = getValue(constraintMap, "scale", 1) / propertyScale;
11659
+ data.max = getValue(constraintMap, "max", 0);
11648
11660
  data.local = getValue(constraintMap, "local", false);
11649
- }
11661
+ } else
11662
+ data.setupPose.time = getValue(constraintMap, "time", 0);
11650
11663
  skeletonData.constraints.push(data);
11651
11664
  break;
11652
11665
  }
@@ -12223,7 +12236,7 @@ var SkeletonJson = class {
12223
12236
  let mixRotate = getValue(keyMap, "mixRotate", 1);
12224
12237
  let mixX = getValue(keyMap, "mixX", 1), mixY = getValue(keyMap, "mixY", mixX);
12225
12238
  let mixScaleX = getValue(keyMap, "mixScaleX", 1), mixScaleY = getValue(keyMap, "mixScaleY", 1);
12226
- const mixShearY = getValue(keyMap, "mixShearY", 1);
12239
+ let mixShearY = getValue(keyMap, "mixShearY", 1);
12227
12240
  for (let frame = 0, bezier = 0; ; frame++) {
12228
12241
  timeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);
12229
12242
  const nextMap = timelineMap[frame + 1];
@@ -12251,7 +12264,7 @@ var SkeletonJson = class {
12251
12264
  mixY = mixY2;
12252
12265
  mixScaleX = mixScaleX2;
12253
12266
  mixScaleY = mixScaleY2;
12254
- mixScaleX = mixScaleX2;
12267
+ mixShearY = mixShearY2;
12255
12268
  keyMap = nextMap;
12256
12269
  }
12257
12270
  timelines.push(timeline);