@esotericsoftware/spine-core 4.2.2 → 4.2.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.
- package/dist/Animation.js +7 -5
- package/dist/SkeletonBinary.js +2 -2
- package/dist/SkeletonJson.js +2 -2
- package/dist/Slot.js +2 -2
- package/dist/attachments/Attachment.d.ts +1 -1
- package/dist/attachments/Attachment.js +3 -3
- package/dist/attachments/MeshAttachment.js +2 -2
- package/dist/iife/spine-core.js +12 -64
- package/dist/iife/spine-core.js.map +3 -3
- package/dist/iife/spine-core.min.js +2 -2
- package/dist/index.d.ts +0 -3
- package/dist/index.js +1 -4
- package/package.json +1 -1
- package/dist/VertexEffect.d.ts +0 -35
- package/dist/VertexEffect.js +0 -30
- package/dist/vertexeffects/JitterEffect.d.ts +0 -39
- package/dist/vertexeffects/JitterEffect.js +0 -46
- package/dist/vertexeffects/SwirlEffect.d.ts +0 -44
- package/dist/vertexeffects/SwirlEffect.js +0 -61
package/dist/iife/spine-core.js
CHANGED
|
@@ -50,7 +50,6 @@ var spine = (() => {
|
|
|
50
50
|
IkConstraintTimeline: () => IkConstraintTimeline,
|
|
51
51
|
IntSet: () => IntSet,
|
|
52
52
|
Interpolation: () => Interpolation,
|
|
53
|
-
JitterEffect: () => JitterEffect,
|
|
54
53
|
MathUtils: () => MathUtils,
|
|
55
54
|
MeshAttachment: () => MeshAttachment,
|
|
56
55
|
MixBlend: () => MixBlend,
|
|
@@ -94,7 +93,6 @@ var spine = (() => {
|
|
|
94
93
|
SlotData: () => SlotData,
|
|
95
94
|
SpacingMode: () => SpacingMode,
|
|
96
95
|
StringSet: () => StringSet,
|
|
97
|
-
SwirlEffect: () => SwirlEffect,
|
|
98
96
|
Texture: () => Texture,
|
|
99
97
|
TextureAtlas: () => TextureAtlas,
|
|
100
98
|
TextureAtlasPage: () => TextureAtlasPage,
|
|
@@ -513,7 +511,7 @@ var spine = (() => {
|
|
|
513
511
|
this.bones = null;
|
|
514
512
|
this.vertices = [];
|
|
515
513
|
this.worldVerticesLength = 0;
|
|
516
|
-
this.
|
|
514
|
+
this.timelineAttachment = this;
|
|
517
515
|
}
|
|
518
516
|
computeWorldVertices(slot, start, count, worldVertices, offset, stride) {
|
|
519
517
|
count = offset + (count >> 1) * stride;
|
|
@@ -584,7 +582,7 @@ var spine = (() => {
|
|
|
584
582
|
Utils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);
|
|
585
583
|
}
|
|
586
584
|
attachment.worldVerticesLength = this.worldVerticesLength;
|
|
587
|
-
attachment.
|
|
585
|
+
attachment.timelineAttachment = this.timelineAttachment;
|
|
588
586
|
}
|
|
589
587
|
};
|
|
590
588
|
var VertexAttachment = _VertexAttachment;
|
|
@@ -1883,7 +1881,7 @@ var spine = (() => {
|
|
|
1883
1881
|
let slotAttachment = slot.getAttachment();
|
|
1884
1882
|
if (!slotAttachment)
|
|
1885
1883
|
return;
|
|
1886
|
-
if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.
|
|
1884
|
+
if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment != this.attachment)
|
|
1887
1885
|
return;
|
|
1888
1886
|
let deform = slot.deform;
|
|
1889
1887
|
if (deform.length == 0)
|
|
@@ -2462,7 +2460,7 @@ var spine = (() => {
|
|
|
2462
2460
|
let slotAttachment = slot.attachment;
|
|
2463
2461
|
let attachment = this.attachment;
|
|
2464
2462
|
if (slotAttachment != attachment) {
|
|
2465
|
-
if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.
|
|
2463
|
+
if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment != attachment)
|
|
2466
2464
|
return;
|
|
2467
2465
|
}
|
|
2468
2466
|
let frames = this.frames;
|
|
@@ -2475,6 +2473,8 @@ var spine = (() => {
|
|
|
2475
2473
|
let before = frames[i];
|
|
2476
2474
|
let modeAndIndex = frames[i + _SequenceTimeline.MODE];
|
|
2477
2475
|
let delay = frames[i + _SequenceTimeline.DELAY];
|
|
2476
|
+
if (!this.attachment.sequence)
|
|
2477
|
+
return;
|
|
2478
2478
|
let index = modeAndIndex >> 4, count = this.attachment.sequence.regions.length;
|
|
2479
2479
|
let mode = SequenceModeValues[modeAndIndex & 15];
|
|
2480
2480
|
if (mode != SequenceMode.hold) {
|
|
@@ -2488,7 +2488,7 @@ var spine = (() => {
|
|
|
2488
2488
|
break;
|
|
2489
2489
|
case SequenceMode.pingpong: {
|
|
2490
2490
|
let n = (count << 1) - 2;
|
|
2491
|
-
index
|
|
2491
|
+
index = n == 0 ? 0 : index % n;
|
|
2492
2492
|
if (index >= count)
|
|
2493
2493
|
index = n - index;
|
|
2494
2494
|
break;
|
|
@@ -2501,7 +2501,7 @@ var spine = (() => {
|
|
|
2501
2501
|
break;
|
|
2502
2502
|
case SequenceMode.pingpongReverse: {
|
|
2503
2503
|
let n = (count << 1) - 2;
|
|
2504
|
-
index = (index + count - 1) % n;
|
|
2504
|
+
index = n == 0 ? 0 : (index + count - 1) % n;
|
|
2505
2505
|
if (index >= count)
|
|
2506
2506
|
index = n - index;
|
|
2507
2507
|
}
|
|
@@ -3789,7 +3789,7 @@ var spine = (() => {
|
|
|
3789
3789
|
let copy = new MeshAttachment(this.name, this.path);
|
|
3790
3790
|
copy.region = this.region;
|
|
3791
3791
|
copy.color.setFromColor(this.color);
|
|
3792
|
-
copy.
|
|
3792
|
+
copy.timelineAttachment = this.timelineAttachment;
|
|
3793
3793
|
copy.setParentMesh(this.parentMesh ? this.parentMesh : this);
|
|
3794
3794
|
if (copy.region != null)
|
|
3795
3795
|
copy.updateRegion();
|
|
@@ -5437,7 +5437,7 @@ var spine = (() => {
|
|
|
5437
5437
|
setAttachment(attachment) {
|
|
5438
5438
|
if (this.attachment == attachment)
|
|
5439
5439
|
return;
|
|
5440
|
-
if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment) || attachment.
|
|
5440
|
+
if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment) || attachment.timelineAttachment != this.attachment.timelineAttachment) {
|
|
5441
5441
|
this.deform.length = 0;
|
|
5442
5442
|
}
|
|
5443
5443
|
this.attachment = attachment;
|
|
@@ -6643,7 +6643,7 @@ var spine = (() => {
|
|
|
6643
6643
|
let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
|
|
6644
6644
|
if (!parent)
|
|
6645
6645
|
throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);
|
|
6646
|
-
linkedMesh.mesh.
|
|
6646
|
+
linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;
|
|
6647
6647
|
linkedMesh.mesh.setParentMesh(parent);
|
|
6648
6648
|
if (linkedMesh.mesh.region != null)
|
|
6649
6649
|
linkedMesh.mesh.updateRegion();
|
|
@@ -8450,7 +8450,7 @@ var spine = (() => {
|
|
|
8450
8450
|
let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
|
|
8451
8451
|
if (!parent)
|
|
8452
8452
|
throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);
|
|
8453
|
-
linkedMesh.mesh.
|
|
8453
|
+
linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;
|
|
8454
8454
|
linkedMesh.mesh.setParentMesh(parent);
|
|
8455
8455
|
if (linkedMesh.mesh.region != null)
|
|
8456
8456
|
linkedMesh.mesh.updateRegion();
|
|
@@ -9176,58 +9176,6 @@ var spine = (() => {
|
|
|
9176
9176
|
}(new Float32Array(1));
|
|
9177
9177
|
}
|
|
9178
9178
|
})();
|
|
9179
|
-
|
|
9180
|
-
// spine-core/src/vertexeffects/JitterEffect.ts
|
|
9181
|
-
var JitterEffect = class {
|
|
9182
|
-
constructor(jitterX, jitterY) {
|
|
9183
|
-
this.jitterX = 0;
|
|
9184
|
-
this.jitterY = 0;
|
|
9185
|
-
this.jitterX = jitterX;
|
|
9186
|
-
this.jitterY = jitterY;
|
|
9187
|
-
}
|
|
9188
|
-
begin(skeleton) {
|
|
9189
|
-
}
|
|
9190
|
-
transform(position, uv, light, dark) {
|
|
9191
|
-
position.x += MathUtils.randomTriangular(-this.jitterX, this.jitterY);
|
|
9192
|
-
position.y += MathUtils.randomTriangular(-this.jitterX, this.jitterY);
|
|
9193
|
-
}
|
|
9194
|
-
end() {
|
|
9195
|
-
}
|
|
9196
|
-
};
|
|
9197
|
-
|
|
9198
|
-
// spine-core/src/vertexeffects/SwirlEffect.ts
|
|
9199
|
-
var _SwirlEffect = class {
|
|
9200
|
-
constructor(radius) {
|
|
9201
|
-
this.centerX = 0;
|
|
9202
|
-
this.centerY = 0;
|
|
9203
|
-
this.radius = 0;
|
|
9204
|
-
this.angle = 0;
|
|
9205
|
-
this.worldX = 0;
|
|
9206
|
-
this.worldY = 0;
|
|
9207
|
-
this.radius = radius;
|
|
9208
|
-
}
|
|
9209
|
-
begin(skeleton) {
|
|
9210
|
-
this.worldX = skeleton.x + this.centerX;
|
|
9211
|
-
this.worldY = skeleton.y + this.centerY;
|
|
9212
|
-
}
|
|
9213
|
-
transform(position, uv, light, dark) {
|
|
9214
|
-
let radAngle = this.angle * MathUtils.degreesToRadians;
|
|
9215
|
-
let x = position.x - this.worldX;
|
|
9216
|
-
let y = position.y - this.worldY;
|
|
9217
|
-
let dist = Math.sqrt(x * x + y * y);
|
|
9218
|
-
if (dist < this.radius) {
|
|
9219
|
-
let theta = _SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);
|
|
9220
|
-
let cos = Math.cos(theta);
|
|
9221
|
-
let sin = Math.sin(theta);
|
|
9222
|
-
position.x = cos * x - sin * y + this.worldX;
|
|
9223
|
-
position.y = sin * x + cos * y + this.worldY;
|
|
9224
|
-
}
|
|
9225
|
-
}
|
|
9226
|
-
end() {
|
|
9227
|
-
}
|
|
9228
|
-
};
|
|
9229
|
-
var SwirlEffect = _SwirlEffect;
|
|
9230
|
-
SwirlEffect.interpolation = new PowOut(2);
|
|
9231
9179
|
return src_exports;
|
|
9232
9180
|
})();
|
|
9233
9181
|
//# sourceMappingURL=spine-core.js.map
|