@esotericsoftware/spine-pixi-v8 4.2.70 → 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"
@@ -12846,7 +12846,8 @@ var spine = (() => {
12846
12846
  }
12847
12847
  updateSlotObject(slotAttachment) {
12848
12848
  const { slot, container } = slotAttachment;
12849
- 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;
12850
12851
  if (container.visible) {
12851
12852
  const bone = slot.bone;
12852
12853
  container.position.set(bone.worldX, bone.worldY);
@@ -12911,8 +12912,10 @@ var spine = (() => {
12911
12912
  *
12912
12913
  * @param container - The container to attach to the slot
12913
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.
12914
12917
  */
12915
- addSlotObject(slot, container) {
12918
+ addSlotObject(slot, container, options) {
12916
12919
  slot = this.getSlotFromRef(slot);
12917
12920
  for (const i in this._slotsObject) {
12918
12921
  if (this._slotsObject[i]?.container === container) {
@@ -12922,7 +12925,11 @@ var spine = (() => {
12922
12925
  this.removeSlotObject(slot);
12923
12926
  container.includeInBuild = false;
12924
12927
  this.addChild(container);
12925
- const slotObject = { container, slot };
12928
+ const slotObject = {
12929
+ container,
12930
+ slot,
12931
+ followAttachmentTimeline: options?.followAttachmentTimeline || false
12932
+ };
12926
12933
  this._slotsObject[slot.data.name] = slotObject;
12927
12934
  this.updateSlotObject(slotObject);
12928
12935
  }
@@ -12952,6 +12959,16 @@ var spine = (() => {
12952
12959
  containerToRemove.includeInBuild = true;
12953
12960
  }
12954
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
+ }
12955
12972
  /**
12956
12973
  * Returns a container attached to a slot, or undefined if no container is attached.
12957
12974
  *