@esotericsoftware/spine-pixi-v8 4.2.69 → 4.2.71

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.
@@ -7162,7 +7162,7 @@ var spine = (() => {
7162
7162
  }
7163
7163
  if (a >= t) {
7164
7164
  d = Math.pow(this.damping, 60 * t);
7165
- const m = this.massInverse * t, e = this.strength, w = this.wind * f, g = (Skeleton.yDown ? -this.gravity : this.gravity) * f;
7165
+ const m = this.massInverse * t, e = this.strength, w = this.wind * f * skeleton.scaleX, g = (Skeleton.yDown ? -this.gravity : this.gravity) * f * skeleton.scaleY;
7166
7166
  do {
7167
7167
  if (x) {
7168
7168
  this.xVelocity += (w - this.xOffset * e) * m;
@@ -11968,7 +11968,7 @@ var spine = (() => {
11968
11968
  } else {
11969
11969
  const url = providedPage ?? import_pixi2.path.normalize([...basePath.split(import_pixi2.path.sep), pageName].join(import_pixi2.path.sep));
11970
11970
  const assetsToLoadIn = {
11971
- src: url,
11971
+ src: (0, import_pixi2.copySearchParams)(url, options.src),
11972
11972
  data: {
11973
11973
  ...metadata.imageMetadata,
11974
11974
  alphaMode: page.pma ? "premultiplied-alpha" : "premultiply-alpha-on-upload"
@@ -12406,6 +12406,8 @@ var spine = (() => {
12406
12406
  const drawOrder = spine.skeleton.drawOrder;
12407
12407
  const roundPixels = this.renderer._roundPixels | spine._roundPixels;
12408
12408
  spine._validateAndTransformAttachments();
12409
+ spine.spineAttachmentsDirty = false;
12410
+ spine.spineTexturesDirty = false;
12409
12411
  for (let i = 0, n = drawOrder.length; i < n; i++) {
12410
12412
  const slot = drawOrder[i];
12411
12413
  const attachment = slot.getAttachment();
@@ -12435,6 +12437,8 @@ var spine = (() => {
12435
12437
  updateRenderable(spine) {
12436
12438
  const gpuSpine = this.gpuSpineData[spine.uid];
12437
12439
  spine._validateAndTransformAttachments();
12440
+ spine.spineAttachmentsDirty = false;
12441
+ spine.spineTexturesDirty = false;
12438
12442
  const drawOrder = spine.skeleton.drawOrder;
12439
12443
  for (let i = 0, n = drawOrder.length; i < n; i++) {
12440
12444
  const slot = drawOrder[i];
@@ -12675,7 +12679,7 @@ var spine = (() => {
12675
12679
  spineAttachmentsDirty = true;
12676
12680
  lastAttachments.length = index;
12677
12681
  }
12678
- this.spineAttachmentsDirty = spineAttachmentsDirty;
12682
+ this.spineAttachmentsDirty ||= spineAttachmentsDirty;
12679
12683
  }
12680
12684
  updateAndSetPixiMask(slot, last) {
12681
12685
  const attachment = slot.attachment;
@@ -12842,7 +12846,8 @@ var spine = (() => {
12842
12846
  }
12843
12847
  updateSlotObject(slotAttachment) {
12844
12848
  const { slot, container } = slotAttachment;
12845
- container.visible = this.skeleton.drawOrder.includes(slot);
12849
+ const followAttachmentValue = slotAttachment.followAttachmentTimeline ? Boolean(slot.attachment) : true;
12850
+ container.visible = this.skeleton.drawOrder.includes(slot) && followAttachmentValue;
12846
12851
  if (container.visible) {
12847
12852
  const bone = slot.bone;
12848
12853
  container.position.set(bone.worldX, bone.worldY);
@@ -12907,8 +12912,10 @@ var spine = (() => {
12907
12912
  *
12908
12913
  * @param container - The container to attach to the slot
12909
12914
  * @param slotRef - The slot id or slot to attach to
12915
+ * @param options - Optional settings for the attachment.
12916
+ * @param options.followAttachmentTimeline - If true, the attachment will follow the slot's attachment timeline.
12910
12917
  */
12911
- addSlotObject(slot, container) {
12918
+ addSlotObject(slot, container, options) {
12912
12919
  slot = this.getSlotFromRef(slot);
12913
12920
  for (const i in this._slotsObject) {
12914
12921
  if (this._slotsObject[i]?.container === container) {
@@ -12918,7 +12925,11 @@ var spine = (() => {
12918
12925
  this.removeSlotObject(slot);
12919
12926
  container.includeInBuild = false;
12920
12927
  this.addChild(container);
12921
- const slotObject = { container, slot };
12928
+ const slotObject = {
12929
+ container,
12930
+ slot,
12931
+ followAttachmentTimeline: options?.followAttachmentTimeline || false
12932
+ };
12922
12933
  this._slotsObject[slot.data.name] = slotObject;
12923
12934
  this.updateSlotObject(slotObject);
12924
12935
  }
@@ -12948,6 +12959,16 @@ var spine = (() => {
12948
12959
  containerToRemove.includeInBuild = true;
12949
12960
  }
12950
12961
  }
12962
+ /**
12963
+ * Removes all PixiJS containers attached to any slot.
12964
+ */
12965
+ removeSlotObjects() {
12966
+ Object.entries(this._slotsObject).forEach(([slotName, slotObject]) => {
12967
+ if (slotObject)
12968
+ slotObject.container.removeFromParent();
12969
+ delete this._slotsObject[slotName];
12970
+ });
12971
+ }
12951
12972
  /**
12952
12973
  * Returns a container attached to a slot, or undefined if no container is attached.
12953
12974
  *