@esotericsoftware/spine-core 4.2.35 → 4.2.37
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.d.ts +12 -1
- package/dist/Animation.js +56 -25
- package/dist/AnimationState.js +9 -3
- package/dist/Bone.d.ts +2 -1
- package/dist/Bone.js +17 -15
- package/dist/BoneData.d.ts +2 -2
- package/dist/BoneData.js +10 -10
- package/dist/IkConstraint.js +10 -8
- package/dist/IkConstraintData.js +2 -2
- package/dist/PhysicsConstraint.d.ts +6 -0
- package/dist/PhysicsConstraint.js +55 -27
- package/dist/PhysicsConstraintData.d.ts +1 -0
- package/dist/PhysicsConstraintData.js +2 -1
- package/dist/Skeleton.d.ts +4 -1
- package/dist/Skeleton.js +13 -3
- package/dist/SkeletonBinary.js +84 -45
- package/dist/SkeletonData.d.ts +4 -1
- package/dist/SkeletonData.js +5 -2
- package/dist/SkeletonJson.js +33 -18
- package/dist/SlotData.d.ts +2 -0
- package/dist/SlotData.js +3 -1
- package/dist/TransformConstraint.js +5 -11
- package/dist/iife/spine-core.js +287 -142
- package/dist/iife/spine-core.js.map +3 -3
- package/dist/iife/spine-core.min.js +2 -2
- package/package.json +1 -1
package/dist/iife/spine-core.js
CHANGED
|
@@ -64,6 +64,8 @@ var spine = (() => {
|
|
|
64
64
|
IkConstraint: () => IkConstraint,
|
|
65
65
|
IkConstraintData: () => IkConstraintData,
|
|
66
66
|
IkConstraintTimeline: () => IkConstraintTimeline,
|
|
67
|
+
Inherit: () => Inherit,
|
|
68
|
+
InheritTimeline: () => InheritTimeline,
|
|
67
69
|
IntSet: () => IntSet,
|
|
68
70
|
Interpolation: () => Interpolation,
|
|
69
71
|
MathUtils: () => MathUtils,
|
|
@@ -107,7 +109,7 @@ var spine = (() => {
|
|
|
107
109
|
ShearTimeline: () => ShearTimeline,
|
|
108
110
|
ShearXTimeline: () => ShearXTimeline,
|
|
109
111
|
ShearYTimeline: () => ShearYTimeline,
|
|
110
|
-
Skeleton: () =>
|
|
112
|
+
Skeleton: () => Skeleton,
|
|
111
113
|
SkeletonBinary: () => SkeletonBinary,
|
|
112
114
|
SkeletonBounds: () => SkeletonBounds,
|
|
113
115
|
SkeletonClipping: () => SkeletonClipping,
|
|
@@ -132,7 +134,6 @@ var spine = (() => {
|
|
|
132
134
|
TransformConstraint: () => TransformConstraint,
|
|
133
135
|
TransformConstraintData: () => TransformConstraintData,
|
|
134
136
|
TransformConstraintTimeline: () => TransformConstraintTimeline,
|
|
135
|
-
TransformMode: () => TransformMode,
|
|
136
137
|
TranslateTimeline: () => TranslateTimeline,
|
|
137
138
|
TranslateXTimeline: () => TranslateXTimeline,
|
|
138
139
|
TranslateYTimeline: () => TranslateYTimeline,
|
|
@@ -771,27 +772,28 @@ var spine = (() => {
|
|
|
771
772
|
scaleY: 4,
|
|
772
773
|
shearX: 5,
|
|
773
774
|
shearY: 6,
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
775
|
+
inherit: 7,
|
|
776
|
+
rgb: 8,
|
|
777
|
+
alpha: 9,
|
|
778
|
+
rgb2: 10,
|
|
779
|
+
attachment: 11,
|
|
780
|
+
deform: 12,
|
|
781
|
+
event: 13,
|
|
782
|
+
drawOrder: 14,
|
|
783
|
+
ikConstraint: 15,
|
|
784
|
+
transformConstraint: 16,
|
|
785
|
+
pathConstraintPosition: 17,
|
|
786
|
+
pathConstraintSpacing: 18,
|
|
787
|
+
pathConstraintMix: 19,
|
|
788
|
+
physicsConstraintInertia: 20,
|
|
789
|
+
physicsConstraintStrength: 21,
|
|
790
|
+
physicsConstraintDamping: 22,
|
|
791
|
+
physicsConstraintMass: 23,
|
|
792
|
+
physicsConstraintWind: 24,
|
|
793
|
+
physicsConstraintGravity: 25,
|
|
794
|
+
physicsConstraintMix: 26,
|
|
795
|
+
physicsConstraintReset: 27,
|
|
796
|
+
sequence: 28
|
|
795
797
|
};
|
|
796
798
|
var Timeline = class {
|
|
797
799
|
propertyIds;
|
|
@@ -1388,7 +1390,7 @@ var spine = (() => {
|
|
|
1388
1390
|
apply(skeleton, lastTime, time, events, alpha, blend, direction) {
|
|
1389
1391
|
let bone = skeleton.bones[this.boneIndex];
|
|
1390
1392
|
if (bone.active)
|
|
1391
|
-
bone.scaleY = this.getScaleValue(time, alpha, blend, direction, bone.
|
|
1393
|
+
bone.scaleY = this.getScaleValue(time, alpha, blend, direction, bone.scaleY, bone.data.scaleY);
|
|
1392
1394
|
}
|
|
1393
1395
|
};
|
|
1394
1396
|
var ShearTimeline = class extends CurveTimeline2 {
|
|
@@ -1517,7 +1519,48 @@ var spine = (() => {
|
|
|
1517
1519
|
apply(skeleton, lastTime, time, events, alpha, blend, direction) {
|
|
1518
1520
|
let bone = skeleton.bones[this.boneIndex];
|
|
1519
1521
|
if (bone.active)
|
|
1520
|
-
bone.shearY = this.getRelativeValue(time, alpha, blend, bone.
|
|
1522
|
+
bone.shearY = this.getRelativeValue(time, alpha, blend, bone.shearY, bone.data.shearY);
|
|
1523
|
+
}
|
|
1524
|
+
};
|
|
1525
|
+
var InheritTimeline = class extends Timeline {
|
|
1526
|
+
boneIndex = 0;
|
|
1527
|
+
constructor(frameCount, boneIndex) {
|
|
1528
|
+
super(frameCount, [Property.inherit + "|" + boneIndex]);
|
|
1529
|
+
this.boneIndex = boneIndex;
|
|
1530
|
+
}
|
|
1531
|
+
getFrameEntries() {
|
|
1532
|
+
return 2;
|
|
1533
|
+
}
|
|
1534
|
+
/** Sets the transform mode for the specified frame.
|
|
1535
|
+
* @param frame Between 0 and <code>frameCount</code>, inclusive.
|
|
1536
|
+
* @param time The frame time in seconds. */
|
|
1537
|
+
setFrame(frame, time, inherit) {
|
|
1538
|
+
frame *= 2;
|
|
1539
|
+
this.frames[frame] = time;
|
|
1540
|
+
this.frames[
|
|
1541
|
+
frame + 1
|
|
1542
|
+
/*INHERIT*/
|
|
1543
|
+
] = inherit;
|
|
1544
|
+
}
|
|
1545
|
+
apply(skeleton, lastTime, time, events, alpha, blend, direction) {
|
|
1546
|
+
let bone = skeleton.bones[this.boneIndex];
|
|
1547
|
+
if (!bone.active)
|
|
1548
|
+
return;
|
|
1549
|
+
let frames = this.frames;
|
|
1550
|
+
if (time < frames[0]) {
|
|
1551
|
+
if (blend == 0 /* setup */ || blend == 1 /* first */)
|
|
1552
|
+
bone.inherit = bone.data.inherit;
|
|
1553
|
+
return;
|
|
1554
|
+
}
|
|
1555
|
+
bone.inherit = this.frames[
|
|
1556
|
+
Timeline.search(
|
|
1557
|
+
frames,
|
|
1558
|
+
time,
|
|
1559
|
+
2
|
|
1560
|
+
/*ENTRIES*/
|
|
1561
|
+
) + 1
|
|
1562
|
+
/*INHERIT*/
|
|
1563
|
+
];
|
|
1521
1564
|
}
|
|
1522
1565
|
};
|
|
1523
1566
|
var RGBATimeline = class extends CurveTimeline {
|
|
@@ -2693,7 +2736,7 @@ var spine = (() => {
|
|
|
2693
2736
|
var DrawOrderTimeline = _DrawOrderTimeline;
|
|
2694
2737
|
__publicField(DrawOrderTimeline, "propertyIds", ["" + Property.drawOrder]);
|
|
2695
2738
|
var IkConstraintTimeline = class extends CurveTimeline {
|
|
2696
|
-
/** The index of the IK constraint in {@link Skeleton#getIkConstraints()} that will be changed when this timeline is */
|
|
2739
|
+
/** The index of the IK constraint in {@link Skeleton#getIkConstraints()} that will be changed when this timeline is applied */
|
|
2697
2740
|
constraintIndex = 0;
|
|
2698
2741
|
constructor(frameCount, bezierCount, ikConstraintIndex) {
|
|
2699
2742
|
super(frameCount, bezierCount, [
|
|
@@ -3878,9 +3921,14 @@ var spine = (() => {
|
|
|
3878
3921
|
this.queue.event(entry, event);
|
|
3879
3922
|
}
|
|
3880
3923
|
let complete = false;
|
|
3881
|
-
if (entry.loop)
|
|
3882
|
-
|
|
3883
|
-
|
|
3924
|
+
if (entry.loop) {
|
|
3925
|
+
if (duration == 0)
|
|
3926
|
+
complete = true;
|
|
3927
|
+
else {
|
|
3928
|
+
const cycles = Math.floor(entry.trackTime / duration);
|
|
3929
|
+
complete = cycles > 0 && cycles > Math.floor(entry.trackTime / duration);
|
|
3930
|
+
}
|
|
3931
|
+
} else
|
|
3884
3932
|
complete = animationTime >= animationEnd && entry.animationLast < animationEnd;
|
|
3885
3933
|
if (complete)
|
|
3886
3934
|
this.queue.complete(entry);
|
|
@@ -5384,7 +5432,7 @@ var spine = (() => {
|
|
|
5384
5432
|
/** The local shearX. */
|
|
5385
5433
|
shearY = 0;
|
|
5386
5434
|
/** The transform mode for how parent world transforms affect this bone. */
|
|
5387
|
-
|
|
5435
|
+
inherit = Inherit.Normal;
|
|
5388
5436
|
/** When true, {@link Skeleton#updateWorldTransform()} only updates this bone if the {@link Skeleton#skin} contains this
|
|
5389
5437
|
* bone.
|
|
5390
5438
|
* @see Skin#bones */
|
|
@@ -5406,14 +5454,14 @@ var spine = (() => {
|
|
|
5406
5454
|
this.parent = parent;
|
|
5407
5455
|
}
|
|
5408
5456
|
};
|
|
5409
|
-
var
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
return
|
|
5416
|
-
})(
|
|
5457
|
+
var Inherit = /* @__PURE__ */ ((Inherit2) => {
|
|
5458
|
+
Inherit2[Inherit2["Normal"] = 0] = "Normal";
|
|
5459
|
+
Inherit2[Inherit2["OnlyTranslation"] = 1] = "OnlyTranslation";
|
|
5460
|
+
Inherit2[Inherit2["NoRotationOrReflection"] = 2] = "NoRotationOrReflection";
|
|
5461
|
+
Inherit2[Inherit2["NoScale"] = 3] = "NoScale";
|
|
5462
|
+
Inherit2[Inherit2["NoScaleOrReflection"] = 4] = "NoScaleOrReflection";
|
|
5463
|
+
return Inherit2;
|
|
5464
|
+
})(Inherit || {});
|
|
5417
5465
|
|
|
5418
5466
|
// spine-core/src/Bone.ts
|
|
5419
5467
|
var Bone = class {
|
|
@@ -5465,6 +5513,7 @@ var spine = (() => {
|
|
|
5465
5513
|
worldY = 0;
|
|
5466
5514
|
/** The world Y position. If changed, {@link #updateAppliedTransform()} should be called. */
|
|
5467
5515
|
worldX = 0;
|
|
5516
|
+
inherit = 0 /* Normal */;
|
|
5468
5517
|
sorted = false;
|
|
5469
5518
|
active = false;
|
|
5470
5519
|
/** @param parent May be null. */
|
|
@@ -5523,7 +5572,7 @@ var spine = (() => {
|
|
|
5523
5572
|
let pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
|
|
5524
5573
|
this.worldX = pa * x + pb * y + parent.worldX;
|
|
5525
5574
|
this.worldY = pc * x + pd * y + parent.worldY;
|
|
5526
|
-
switch (this.
|
|
5575
|
+
switch (this.inherit) {
|
|
5527
5576
|
case 0 /* Normal */: {
|
|
5528
5577
|
const rx = (rotation + shearX) * MathUtils.degRad;
|
|
5529
5578
|
const ry = (rotation + 90 + shearY) * MathUtils.degRad;
|
|
@@ -5585,7 +5634,7 @@ var spine = (() => {
|
|
|
5585
5634
|
za *= s;
|
|
5586
5635
|
zc *= s;
|
|
5587
5636
|
s = Math.sqrt(za * za + zc * zc);
|
|
5588
|
-
if (this.
|
|
5637
|
+
if (this.inherit == 3 /* NoScale */ && pa * pd - pb * pc < 0 != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0))
|
|
5589
5638
|
s = -s;
|
|
5590
5639
|
rotation = Math.PI / 2 + Math.atan2(zc, za);
|
|
5591
5640
|
const zb = Math.cos(rotation) * s;
|
|
@@ -5618,6 +5667,7 @@ var spine = (() => {
|
|
|
5618
5667
|
this.scaleY = data.scaleY;
|
|
5619
5668
|
this.shearX = data.shearX;
|
|
5620
5669
|
this.shearY = data.shearY;
|
|
5670
|
+
this.inherit = data.inherit;
|
|
5621
5671
|
}
|
|
5622
5672
|
/** Computes the applied transform values from the world transform.
|
|
5623
5673
|
*
|
|
@@ -5646,13 +5696,13 @@ var spine = (() => {
|
|
|
5646
5696
|
this.ax = dx * ia - dy * ib;
|
|
5647
5697
|
this.ay = dy * id - dx * ic;
|
|
5648
5698
|
let ra, rb, rc, rd;
|
|
5649
|
-
if (this.
|
|
5699
|
+
if (this.inherit == 1 /* OnlyTranslation */) {
|
|
5650
5700
|
ra = this.a;
|
|
5651
5701
|
rb = this.b;
|
|
5652
5702
|
rc = this.c;
|
|
5653
5703
|
rd = this.d;
|
|
5654
5704
|
} else {
|
|
5655
|
-
switch (this.
|
|
5705
|
+
switch (this.inherit) {
|
|
5656
5706
|
case 2 /* NoRotationOrReflection */: {
|
|
5657
5707
|
let s2 = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);
|
|
5658
5708
|
let sa = pa / this.skeleton.scaleX;
|
|
@@ -5675,7 +5725,7 @@ var spine = (() => {
|
|
|
5675
5725
|
pa *= s;
|
|
5676
5726
|
pc *= s;
|
|
5677
5727
|
s = Math.sqrt(pa * pa + pc * pc);
|
|
5678
|
-
if (this.
|
|
5728
|
+
if (this.inherit == 3 /* NoScale */ && pid < 0 != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0))
|
|
5679
5729
|
s = -s;
|
|
5680
5730
|
let r = MathUtils.PI / 2 + Math.atan2(pc, pa);
|
|
5681
5731
|
pb = Math.cos(r) * s;
|
|
@@ -6189,7 +6239,7 @@ var spine = (() => {
|
|
|
6189
6239
|
throw new Error("IK bone must have parent.");
|
|
6190
6240
|
let pa = p.a, pb = p.b, pc = p.c, pd = p.d;
|
|
6191
6241
|
let rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0;
|
|
6192
|
-
switch (bone.
|
|
6242
|
+
switch (bone.inherit) {
|
|
6193
6243
|
case 1 /* OnlyTranslation */:
|
|
6194
6244
|
tx = (targetX - bone.worldX) * MathUtils.signum(bone.skeleton.scaleX);
|
|
6195
6245
|
ty = (targetY - bone.worldY) * MathUtils.signum(bone.skeleton.scaleY);
|
|
@@ -6221,7 +6271,7 @@ var spine = (() => {
|
|
|
6221
6271
|
rotationIK += 360;
|
|
6222
6272
|
let sx = bone.ascaleX, sy = bone.ascaleY;
|
|
6223
6273
|
if (compress || stretch) {
|
|
6224
|
-
switch (bone.
|
|
6274
|
+
switch (bone.inherit) {
|
|
6225
6275
|
case 3 /* NoScale */:
|
|
6226
6276
|
case 4 /* NoScaleOrReflection */:
|
|
6227
6277
|
tx = targetX - bone.worldX;
|
|
@@ -6251,6 +6301,8 @@ var spine = (() => {
|
|
|
6251
6301
|
/** Applies 2 bone IK. The target is specified in the world coordinate system.
|
|
6252
6302
|
* @param child A direct descendant of the parent bone. */
|
|
6253
6303
|
apply2(parent, child, targetX, targetY, bendDir, stretch, uniform, softness, alpha) {
|
|
6304
|
+
if (parent.inherit != 0 /* Normal */ || child.inherit != 0 /* Normal */)
|
|
6305
|
+
return;
|
|
6254
6306
|
let px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, sx = psx, sy = psy, csx = child.ascaleX;
|
|
6255
6307
|
let os1 = 0, os2 = 0, s2 = 0;
|
|
6256
6308
|
if (psx < 0) {
|
|
@@ -6417,7 +6469,7 @@ var spine = (() => {
|
|
|
6417
6469
|
return this._target;
|
|
6418
6470
|
}
|
|
6419
6471
|
/** Controls the bend direction of the IK bones, either 1 or -1. */
|
|
6420
|
-
bendDirection =
|
|
6472
|
+
bendDirection = 0;
|
|
6421
6473
|
/** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */
|
|
6422
6474
|
compress = false;
|
|
6423
6475
|
/** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained
|
|
@@ -6427,7 +6479,7 @@ var spine = (() => {
|
|
|
6427
6479
|
* is scaled on both the X and Y axes. */
|
|
6428
6480
|
uniform = false;
|
|
6429
6481
|
/** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */
|
|
6430
|
-
mix =
|
|
6482
|
+
mix = 0;
|
|
6431
6483
|
/** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */
|
|
6432
6484
|
softness = 0;
|
|
6433
6485
|
constructor(name) {
|
|
@@ -7031,7 +7083,8 @@ var spine = (() => {
|
|
|
7031
7083
|
case 1 /* reset */:
|
|
7032
7084
|
this.reset();
|
|
7033
7085
|
case 2 /* update */:
|
|
7034
|
-
|
|
7086
|
+
const delta = Math.max(this.skeleton.time - this.lastTime, 0);
|
|
7087
|
+
this.remaining += delta;
|
|
7035
7088
|
this.lastTime = this.skeleton.time;
|
|
7036
7089
|
const bx = bone.worldX, by = bone.worldY;
|
|
7037
7090
|
if (this._reset) {
|
|
@@ -7039,32 +7092,34 @@ var spine = (() => {
|
|
|
7039
7092
|
this.ux = bx;
|
|
7040
7093
|
this.uy = by;
|
|
7041
7094
|
} else {
|
|
7042
|
-
let
|
|
7095
|
+
let a = this.remaining, i = this.inertia, q = this.data.limit * delta, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1;
|
|
7043
7096
|
if (x || y) {
|
|
7044
7097
|
if (x) {
|
|
7045
|
-
|
|
7098
|
+
const u = (this.ux - bx) * i;
|
|
7099
|
+
this.xOffset += u > q ? q : u < -q ? -q : u;
|
|
7046
7100
|
this.ux = bx;
|
|
7047
7101
|
}
|
|
7048
7102
|
if (y) {
|
|
7049
|
-
|
|
7103
|
+
const u = (this.uy - by) * i;
|
|
7104
|
+
this.yOffset += u > q ? q : u < -q ? -q : u;
|
|
7050
7105
|
this.uy = by;
|
|
7051
7106
|
}
|
|
7052
|
-
if (
|
|
7053
|
-
|
|
7054
|
-
const
|
|
7107
|
+
if (a >= t) {
|
|
7108
|
+
d = Math.pow(this.damping, 60 * t);
|
|
7109
|
+
const m = this.massInverse * t, e = this.strength, w = this.wind * f, g = (Skeleton.yDown ? -this.gravity : this.gravity) * f;
|
|
7055
7110
|
do {
|
|
7056
7111
|
if (x) {
|
|
7057
7112
|
this.xVelocity += (w - this.xOffset * e) * m;
|
|
7058
|
-
this.xOffset += this.xVelocity *
|
|
7113
|
+
this.xOffset += this.xVelocity * t;
|
|
7059
7114
|
this.xVelocity *= d;
|
|
7060
7115
|
}
|
|
7061
7116
|
if (y) {
|
|
7062
|
-
this.yVelocity
|
|
7063
|
-
this.yOffset += this.yVelocity *
|
|
7117
|
+
this.yVelocity -= (g + this.yOffset * e) * m;
|
|
7118
|
+
this.yOffset += this.yVelocity * t;
|
|
7064
7119
|
this.yVelocity *= d;
|
|
7065
7120
|
}
|
|
7066
|
-
|
|
7067
|
-
} while (
|
|
7121
|
+
a -= t;
|
|
7122
|
+
} while (a >= t);
|
|
7068
7123
|
}
|
|
7069
7124
|
if (x)
|
|
7070
7125
|
bone.worldX += this.xOffset * mix * this.data.x;
|
|
@@ -7073,9 +7128,18 @@ var spine = (() => {
|
|
|
7073
7128
|
}
|
|
7074
7129
|
if (rotateOrShearX || scaleX) {
|
|
7075
7130
|
let ca = Math.atan2(bone.c, bone.a), c = 0, s = 0, mr = 0;
|
|
7131
|
+
let dx = this.cx - bone.worldX, dy = this.cy - bone.worldY;
|
|
7132
|
+
if (dx > q)
|
|
7133
|
+
dx = q;
|
|
7134
|
+
else if (dx < -q)
|
|
7135
|
+
dx = -q;
|
|
7136
|
+
if (dy > q)
|
|
7137
|
+
dy = q;
|
|
7138
|
+
else if (dy < -q)
|
|
7139
|
+
dy = -q;
|
|
7076
7140
|
if (rotateOrShearX) {
|
|
7077
7141
|
mr = (this.data.rotate + this.data.shearX) * mix;
|
|
7078
|
-
let
|
|
7142
|
+
let r = Math.atan2(dy + this.ty, dx + this.tx) - ca - this.rotateOffset * mr;
|
|
7079
7143
|
this.rotateOffset += (r - Math.ceil(r * MathUtils.invPI2 - 0.5) * MathUtils.PI2) * i;
|
|
7080
7144
|
r = this.rotateOffset * mr + ca;
|
|
7081
7145
|
c = Math.cos(r);
|
|
@@ -7090,34 +7154,35 @@ var spine = (() => {
|
|
|
7090
7154
|
s = Math.sin(ca);
|
|
7091
7155
|
const r = l * bone.getWorldScaleX();
|
|
7092
7156
|
if (r > 0)
|
|
7093
|
-
this.scaleOffset += (
|
|
7157
|
+
this.scaleOffset += (dx * c + dy * s) * i / r;
|
|
7094
7158
|
}
|
|
7095
|
-
|
|
7096
|
-
if (
|
|
7097
|
-
|
|
7098
|
-
|
|
7159
|
+
a = this.remaining;
|
|
7160
|
+
if (a >= t) {
|
|
7161
|
+
if (d == -1)
|
|
7162
|
+
d = Math.pow(this.damping, 60 * t);
|
|
7163
|
+
const m = this.massInverse * t, e = this.strength, w = this.wind, g = Skeleton.yDown ? -this.gravity : this.gravity, h = l / f;
|
|
7099
7164
|
while (true) {
|
|
7100
|
-
|
|
7165
|
+
a -= t;
|
|
7101
7166
|
if (scaleX) {
|
|
7102
7167
|
this.scaleVelocity += (w * c - g * s - this.scaleOffset * e) * m;
|
|
7103
|
-
this.scaleOffset += this.scaleVelocity *
|
|
7168
|
+
this.scaleOffset += this.scaleVelocity * t;
|
|
7104
7169
|
this.scaleVelocity *= d;
|
|
7105
7170
|
}
|
|
7106
7171
|
if (rotateOrShearX) {
|
|
7107
|
-
this.rotateVelocity
|
|
7108
|
-
this.rotateOffset += this.rotateVelocity *
|
|
7172
|
+
this.rotateVelocity -= ((w * s + g * c) * h + this.rotateOffset * e) * m;
|
|
7173
|
+
this.rotateOffset += this.rotateVelocity * t;
|
|
7109
7174
|
this.rotateVelocity *= d;
|
|
7110
|
-
if (
|
|
7175
|
+
if (a < t)
|
|
7111
7176
|
break;
|
|
7112
7177
|
const r = this.rotateOffset * mr + ca;
|
|
7113
7178
|
c = Math.cos(r);
|
|
7114
7179
|
s = Math.sin(r);
|
|
7115
|
-
} else if (
|
|
7180
|
+
} else if (a < t)
|
|
7116
7181
|
break;
|
|
7117
7182
|
}
|
|
7118
7183
|
}
|
|
7119
7184
|
}
|
|
7120
|
-
this.remaining =
|
|
7185
|
+
this.remaining = a;
|
|
7121
7186
|
}
|
|
7122
7187
|
this.cx = bone.worldX;
|
|
7123
7188
|
this.cy = bone.worldY;
|
|
@@ -7169,6 +7234,21 @@ var spine = (() => {
|
|
|
7169
7234
|
}
|
|
7170
7235
|
bone.updateAppliedTransform();
|
|
7171
7236
|
}
|
|
7237
|
+
/** Translates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone moved an additional
|
|
7238
|
+
* amount in world space. */
|
|
7239
|
+
translate(x, y) {
|
|
7240
|
+
this.ux -= x;
|
|
7241
|
+
this.uy -= y;
|
|
7242
|
+
this.cx -= x;
|
|
7243
|
+
this.cy -= y;
|
|
7244
|
+
}
|
|
7245
|
+
/** Rotates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone rotated around the
|
|
7246
|
+
* specified point in world space. */
|
|
7247
|
+
rotate(x, y, degrees) {
|
|
7248
|
+
const r = degrees * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);
|
|
7249
|
+
const dx = this.cx - x, dy = this.cy - y;
|
|
7250
|
+
this.translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy);
|
|
7251
|
+
}
|
|
7172
7252
|
};
|
|
7173
7253
|
|
|
7174
7254
|
// spine-core/src/Slot.ts
|
|
@@ -7428,11 +7508,8 @@ var spine = (() => {
|
|
|
7428
7508
|
for (let i = 0, n = bones.length; i < n; i++) {
|
|
7429
7509
|
let bone = bones[i];
|
|
7430
7510
|
let rotation = bone.arotation;
|
|
7431
|
-
if (mixRotate != 0)
|
|
7432
|
-
|
|
7433
|
-
r -= Math.ceil(r / 360 - 0.5) * 360;
|
|
7434
|
-
rotation += r * mixRotate;
|
|
7435
|
-
}
|
|
7511
|
+
if (mixRotate != 0)
|
|
7512
|
+
rotation += (target.arotation - rotation + this.data.offsetRotation) * mixRotate;
|
|
7436
7513
|
let x = bone.ax, y = bone.ay;
|
|
7437
7514
|
x += (target.ax - x + this.data.offsetX) * mixX;
|
|
7438
7515
|
y += (target.ay - y + this.data.offsetY) * mixY;
|
|
@@ -7442,11 +7519,8 @@ var spine = (() => {
|
|
|
7442
7519
|
if (mixScaleY != 0 && scaleY != 0)
|
|
7443
7520
|
scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY;
|
|
7444
7521
|
let shearY = bone.ashearY;
|
|
7445
|
-
if (mixShearY != 0)
|
|
7446
|
-
|
|
7447
|
-
r -= Math.ceil(r / 360 - 0.5) * 360;
|
|
7448
|
-
shearY += r * mixShearY;
|
|
7449
|
-
}
|
|
7522
|
+
if (mixShearY != 0)
|
|
7523
|
+
shearY += (target.ashearY - shearY + this.data.offsetShearY) * mixShearY;
|
|
7450
7524
|
bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);
|
|
7451
7525
|
}
|
|
7452
7526
|
}
|
|
@@ -7473,7 +7547,7 @@ var spine = (() => {
|
|
|
7473
7547
|
data;
|
|
7474
7548
|
/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */
|
|
7475
7549
|
bones;
|
|
7476
|
-
/** The skeleton's slots. */
|
|
7550
|
+
/** The skeleton's slots in the setup pose draw order. */
|
|
7477
7551
|
slots;
|
|
7478
7552
|
/** The skeleton's slots in the order they should be drawn. The returned array may be modified to change the draw order. */
|
|
7479
7553
|
drawOrder;
|
|
@@ -8025,9 +8099,20 @@ var spine = (() => {
|
|
|
8025
8099
|
update(delta) {
|
|
8026
8100
|
this.time += delta;
|
|
8027
8101
|
}
|
|
8102
|
+
physicsTranslate(x, y) {
|
|
8103
|
+
const physicsConstraints = this.physicsConstraints;
|
|
8104
|
+
for (let i = 0, n = physicsConstraints.length; i < n; i++)
|
|
8105
|
+
physicsConstraints[i].translate(x, y);
|
|
8106
|
+
}
|
|
8107
|
+
/** Calls {@link PhysicsConstraint#rotate(float, float, float)} for each physics constraint. */
|
|
8108
|
+
physicsRotate(x, y, degrees) {
|
|
8109
|
+
const physicsConstraints = this.physicsConstraints;
|
|
8110
|
+
for (let i = 0, n = physicsConstraints.length; i < n; i++)
|
|
8111
|
+
physicsConstraints[i].rotate(x, y, degrees);
|
|
8112
|
+
}
|
|
8028
8113
|
};
|
|
8029
|
-
var
|
|
8030
|
-
__publicField(
|
|
8114
|
+
var Skeleton = _Skeleton;
|
|
8115
|
+
__publicField(Skeleton, "yDown", false);
|
|
8031
8116
|
var Physics = /* @__PURE__ */ ((Physics2) => {
|
|
8032
8117
|
Physics2[Physics2["none"] = 0] = "none";
|
|
8033
8118
|
Physics2[Physics2["reset"] = 1] = "reset";
|
|
@@ -8054,6 +8139,7 @@ var spine = (() => {
|
|
|
8054
8139
|
rotate = 0;
|
|
8055
8140
|
scaleX = 0;
|
|
8056
8141
|
shearX = 0;
|
|
8142
|
+
limit = 0;
|
|
8057
8143
|
step = 0;
|
|
8058
8144
|
inertia = 0;
|
|
8059
8145
|
strength = 0;
|
|
@@ -8082,7 +8168,7 @@ var spine = (() => {
|
|
|
8082
8168
|
/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */
|
|
8083
8169
|
bones = new Array();
|
|
8084
8170
|
// Ordered parents first.
|
|
8085
|
-
/** The skeleton's slots. */
|
|
8171
|
+
/** The skeleton's slots in the setup pose draw order. */
|
|
8086
8172
|
slots = new Array();
|
|
8087
8173
|
// Setup pose draw order.
|
|
8088
8174
|
skins = new Array();
|
|
@@ -8111,6 +8197,9 @@ var spine = (() => {
|
|
|
8111
8197
|
width = 0;
|
|
8112
8198
|
/** The height of the skeleton's axis aligned bounding box in the setup pose. */
|
|
8113
8199
|
height = 0;
|
|
8200
|
+
/** Baseline scale factor for applying distance-dependent effects on non-scalable properties, such as angle or scale. Default
|
|
8201
|
+
* is 100. */
|
|
8202
|
+
referenceScale = 100;
|
|
8114
8203
|
/** The Spine version used to export the skeleton data, or null. */
|
|
8115
8204
|
version = null;
|
|
8116
8205
|
/** The skeleton data hash. This value will change if any of the skeleton data has changed. May be null. */
|
|
@@ -8442,6 +8531,8 @@ var spine = (() => {
|
|
|
8442
8531
|
blendMode = BlendMode.Normal;
|
|
8443
8532
|
/** False if the slot was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */
|
|
8444
8533
|
visible = true;
|
|
8534
|
+
/** The folders for this slot in the draw order, delimited by <code>/</code>, or null if nonessential data was not exported. */
|
|
8535
|
+
path = null;
|
|
8445
8536
|
constructor(index, name, boneData) {
|
|
8446
8537
|
if (index < 0)
|
|
8447
8538
|
throw new Error("index must be >= 0.");
|
|
@@ -8527,6 +8618,7 @@ var spine = (() => {
|
|
|
8527
8618
|
skeletonData.y = input.readFloat();
|
|
8528
8619
|
skeletonData.width = input.readFloat();
|
|
8529
8620
|
skeletonData.height = input.readFloat();
|
|
8621
|
+
skeletonData.referenceScale = input.readFloat() * scale;
|
|
8530
8622
|
let nonessential = input.readBoolean();
|
|
8531
8623
|
if (nonessential) {
|
|
8532
8624
|
skeletonData.fps = input.readFloat();
|
|
@@ -8556,7 +8648,7 @@ var spine = (() => {
|
|
|
8556
8648
|
data.shearX = input.readFloat();
|
|
8557
8649
|
data.shearY = input.readFloat();
|
|
8558
8650
|
data.length = input.readFloat() * scale;
|
|
8559
|
-
data.
|
|
8651
|
+
data.inherit = input.readByte();
|
|
8560
8652
|
data.skinRequired = input.readBoolean();
|
|
8561
8653
|
if (nonessential) {
|
|
8562
8654
|
Color.rgba8888ToColor(data.color, input.readInt32());
|
|
@@ -8570,6 +8662,14 @@ var spine = (() => {
|
|
|
8570
8662
|
let slotName = input.readString();
|
|
8571
8663
|
if (!slotName)
|
|
8572
8664
|
throw new Error("Slot name must not be null.");
|
|
8665
|
+
let path = null;
|
|
8666
|
+
if (nonessential) {
|
|
8667
|
+
const slash = slotName.lastIndexOf("/");
|
|
8668
|
+
if (slash != -1) {
|
|
8669
|
+
path = slotName.substring(0, slash);
|
|
8670
|
+
slotName = slotName.substring(slash + 1);
|
|
8671
|
+
}
|
|
8672
|
+
}
|
|
8573
8673
|
let boneData = skeletonData.bones[input.readInt(true)];
|
|
8574
8674
|
let data = new SlotData(i, slotName, boneData);
|
|
8575
8675
|
Color.rgba8888ToColor(data.color, input.readInt32());
|
|
@@ -8578,8 +8678,10 @@ var spine = (() => {
|
|
|
8578
8678
|
Color.rgb888ToColor(data.darkColor = new Color(), darkColor);
|
|
8579
8679
|
data.attachmentName = input.readStringRef();
|
|
8580
8680
|
data.blendMode = input.readInt(true);
|
|
8581
|
-
if (nonessential)
|
|
8681
|
+
if (nonessential) {
|
|
8582
8682
|
data.visible = input.readBoolean();
|
|
8683
|
+
data.path = path;
|
|
8684
|
+
}
|
|
8583
8685
|
skeletonData.slots.push(data);
|
|
8584
8686
|
}
|
|
8585
8687
|
n = input.readInt(true);
|
|
@@ -8593,14 +8695,16 @@ var spine = (() => {
|
|
|
8593
8695
|
for (let ii = 0; ii < nn; ii++)
|
|
8594
8696
|
data.bones.push(skeletonData.bones[input.readInt(true)]);
|
|
8595
8697
|
data.target = skeletonData.bones[input.readInt(true)];
|
|
8596
|
-
data.mix = input.readFloat();
|
|
8597
|
-
data.softness = input.readFloat() * scale;
|
|
8598
8698
|
let flags = input.readByte();
|
|
8599
8699
|
data.skinRequired = (flags & 1) != 0;
|
|
8600
8700
|
data.bendDirection = (flags & 2) != 0 ? 1 : -1;
|
|
8601
8701
|
data.compress = (flags & 4) != 0;
|
|
8602
8702
|
data.stretch = (flags & 8) != 0;
|
|
8603
8703
|
data.uniform = (flags & 16) != 0;
|
|
8704
|
+
if ((flags & 32) != 0)
|
|
8705
|
+
data.mix = (flags & 64) != 0 ? input.readFloat() : 1;
|
|
8706
|
+
if ((flags & 128) != 0)
|
|
8707
|
+
data.softness = input.readFloat() * scale;
|
|
8604
8708
|
skeletonData.ikConstraints.push(data);
|
|
8605
8709
|
}
|
|
8606
8710
|
n = input.readInt(true);
|
|
@@ -8614,22 +8718,35 @@ var spine = (() => {
|
|
|
8614
8718
|
for (let ii = 0; ii < nn; ii++)
|
|
8615
8719
|
data.bones.push(skeletonData.bones[input.readInt(true)]);
|
|
8616
8720
|
data.target = skeletonData.bones[input.readInt(true)];
|
|
8617
|
-
|
|
8721
|
+
let flags = input.readByte();
|
|
8618
8722
|
data.skinRequired = (flags & 1) != 0;
|
|
8619
8723
|
data.local = (flags & 2) != 0;
|
|
8620
8724
|
data.relative = (flags & 4) != 0;
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8725
|
+
if ((flags & 8) != 0)
|
|
8726
|
+
data.offsetRotation = input.readFloat();
|
|
8727
|
+
if ((flags & 16) != 0)
|
|
8728
|
+
data.offsetX = input.readFloat() * scale;
|
|
8729
|
+
if ((flags & 32) != 0)
|
|
8730
|
+
data.offsetY = input.readFloat() * scale;
|
|
8731
|
+
if ((flags & 64) != 0)
|
|
8732
|
+
data.offsetScaleX = input.readFloat();
|
|
8733
|
+
if ((flags & 128) != 0)
|
|
8734
|
+
data.offsetScaleY = input.readFloat();
|
|
8735
|
+
flags = input.readByte();
|
|
8736
|
+
if ((flags & 1) != 0)
|
|
8737
|
+
data.offsetShearY = input.readFloat();
|
|
8738
|
+
if ((flags & 2) != 0)
|
|
8739
|
+
data.mixRotate = input.readFloat();
|
|
8740
|
+
if ((flags & 4) != 0)
|
|
8741
|
+
data.mixX = input.readFloat();
|
|
8742
|
+
if ((flags & 8) != 0)
|
|
8743
|
+
data.mixY = input.readFloat();
|
|
8744
|
+
if ((flags & 16) != 0)
|
|
8745
|
+
data.mixScaleX = input.readFloat();
|
|
8746
|
+
if ((flags & 32) != 0)
|
|
8747
|
+
data.mixScaleY = input.readFloat();
|
|
8748
|
+
if ((flags & 64) != 0)
|
|
8749
|
+
data.mixShearY = input.readFloat();
|
|
8633
8750
|
skeletonData.transformConstraints.push(data);
|
|
8634
8751
|
}
|
|
8635
8752
|
n = input.readInt(true);
|
|
@@ -8644,10 +8761,12 @@ var spine = (() => {
|
|
|
8644
8761
|
for (let ii = 0; ii < nn; ii++)
|
|
8645
8762
|
data.bones.push(skeletonData.bones[input.readInt(true)]);
|
|
8646
8763
|
data.target = skeletonData.slots[input.readInt(true)];
|
|
8647
|
-
|
|
8648
|
-
data.
|
|
8649
|
-
data.
|
|
8650
|
-
data.
|
|
8764
|
+
const flags = input.readByte();
|
|
8765
|
+
data.positionMode = flags & 1;
|
|
8766
|
+
data.spacingMode = flags >> 1 & 3;
|
|
8767
|
+
data.rotateMode = flags >> 3 & 3;
|
|
8768
|
+
if ((flags & 128) != 0)
|
|
8769
|
+
data.offsetRotation = input.readFloat();
|
|
8651
8770
|
data.position = input.readFloat();
|
|
8652
8771
|
if (data.positionMode == 0 /* Fixed */)
|
|
8653
8772
|
data.position *= scale;
|
|
@@ -8679,14 +8798,14 @@ var spine = (() => {
|
|
|
8679
8798
|
data.scaleX = input.readFloat();
|
|
8680
8799
|
if ((flags & 32) != 0)
|
|
8681
8800
|
data.shearX = input.readFloat();
|
|
8682
|
-
data.
|
|
8801
|
+
data.limit = ((flags & 64) != 0 ? input.readFloat() : 5e3) * scale;
|
|
8802
|
+
data.step = 1 / input.readUnsignedByte();
|
|
8683
8803
|
data.inertia = input.readFloat();
|
|
8684
8804
|
data.strength = input.readFloat();
|
|
8685
8805
|
data.damping = input.readFloat();
|
|
8686
|
-
data.massInverse = input.readFloat();
|
|
8687
|
-
data.wind = input.readFloat()
|
|
8688
|
-
data.gravity = input.readFloat()
|
|
8689
|
-
data.mix = input.readFloat();
|
|
8806
|
+
data.massInverse = (flags & 128) != 0 ? input.readFloat() : 1;
|
|
8807
|
+
data.wind = input.readFloat();
|
|
8808
|
+
data.gravity = input.readFloat();
|
|
8690
8809
|
flags = input.readByte();
|
|
8691
8810
|
if ((flags & 1) != 0)
|
|
8692
8811
|
data.inertiaGlobal = true;
|
|
@@ -8702,6 +8821,7 @@ var spine = (() => {
|
|
|
8702
8821
|
data.gravityGlobal = true;
|
|
8703
8822
|
if ((flags & 64) != 0)
|
|
8704
8823
|
data.mixGlobal = true;
|
|
8824
|
+
data.mix = (flags & 128) != 0 ? input.readFloat() : 1;
|
|
8705
8825
|
skeletonData.physicsConstraints.push(data);
|
|
8706
8826
|
}
|
|
8707
8827
|
let defaultSkin = this.readSkin(input, skeletonData, true, nonessential);
|
|
@@ -8811,7 +8931,7 @@ var spine = (() => {
|
|
|
8811
8931
|
let path = (flags & 16) != 0 ? input.readStringRef() : null;
|
|
8812
8932
|
const color = (flags & 32) != 0 ? input.readInt32() : 4294967295;
|
|
8813
8933
|
const sequence = (flags & 64) != 0 ? this.readSequence(input) : null;
|
|
8814
|
-
let rotation = input.readFloat();
|
|
8934
|
+
let rotation = (flags & 128) != 0 ? input.readFloat() : 0;
|
|
8815
8935
|
let x = input.readFloat();
|
|
8816
8936
|
let y = input.readFloat();
|
|
8817
8937
|
let scaleX = input.readFloat();
|
|
@@ -8970,8 +9090,6 @@ var spine = (() => {
|
|
|
8970
9090
|
return null;
|
|
8971
9091
|
}
|
|
8972
9092
|
readSequence(input) {
|
|
8973
|
-
if (!input.readBoolean())
|
|
8974
|
-
return null;
|
|
8975
9093
|
let sequence = new Sequence(input.readInt(true));
|
|
8976
9094
|
sequence.start = input.readInt(true);
|
|
8977
9095
|
sequence.digits = input.readInt(true);
|
|
@@ -9225,7 +9343,16 @@ var spine = (() => {
|
|
|
9225
9343
|
for (let i = 0, n = input.readInt(true); i < n; i++) {
|
|
9226
9344
|
let boneIndex = input.readInt(true);
|
|
9227
9345
|
for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {
|
|
9228
|
-
let type = input.readByte(), frameCount = input.readInt(true)
|
|
9346
|
+
let type = input.readByte(), frameCount = input.readInt(true);
|
|
9347
|
+
if (type == BONE_INHERIT) {
|
|
9348
|
+
let timeline = new InheritTimeline(frameCount, boneIndex);
|
|
9349
|
+
for (let frame = 0; frame < frameCount; frame++) {
|
|
9350
|
+
timeline.setFrame(frame, input.readFloat(), input.readByte());
|
|
9351
|
+
}
|
|
9352
|
+
timelines.push(timeline);
|
|
9353
|
+
continue;
|
|
9354
|
+
}
|
|
9355
|
+
let bezierCount = input.readInt(true);
|
|
9229
9356
|
switch (type) {
|
|
9230
9357
|
case BONE_ROTATE:
|
|
9231
9358
|
timelines.push(readTimeline1(input, new RotateTimeline(frameCount, bezierCount, boneIndex), 1));
|
|
@@ -9262,20 +9389,21 @@ var spine = (() => {
|
|
|
9262
9389
|
for (let i = 0, n = input.readInt(true); i < n; i++) {
|
|
9263
9390
|
let index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;
|
|
9264
9391
|
let timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index);
|
|
9265
|
-
let
|
|
9392
|
+
let flags = input.readByte();
|
|
9393
|
+
let time = input.readFloat(), mix = (flags & 1) != 0 ? (flags & 2) != 0 ? input.readFloat() : 1 : 0;
|
|
9394
|
+
let softness = (flags & 4) != 0 ? input.readFloat() * scale : 0;
|
|
9266
9395
|
for (let frame = 0, bezier = 0; ; frame++) {
|
|
9267
|
-
|
|
9268
|
-
timeline.setFrame(frame, time, mix, softness, input.readByte(), (flags & 1) != 0, (flags & 2) != 0);
|
|
9396
|
+
timeline.setFrame(frame, time, mix, softness, (flags & 8) != 0 ? 1 : -1, (flags & 16) != 0, (flags & 32) != 0);
|
|
9269
9397
|
if (frame == frameLast)
|
|
9270
9398
|
break;
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
|
|
9399
|
+
flags = input.readByte();
|
|
9400
|
+
const time2 = input.readFloat(), mix2 = (flags & 1) != 0 ? (flags & 2) != 0 ? input.readFloat() : 1 : 0;
|
|
9401
|
+
const softness2 = (flags & 4) != 0 ? input.readFloat() * scale : 0;
|
|
9402
|
+
if ((flags & 64) != 0) {
|
|
9403
|
+
timeline.setStepped(frame);
|
|
9404
|
+
} else if ((flags & 128) != 0) {
|
|
9405
|
+
setBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1);
|
|
9406
|
+
setBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale);
|
|
9279
9407
|
}
|
|
9280
9408
|
time = time2;
|
|
9281
9409
|
mix = mix2;
|
|
@@ -9386,10 +9514,10 @@ var spine = (() => {
|
|
|
9386
9514
|
timelines.push(readTimeline1(input, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1));
|
|
9387
9515
|
break;
|
|
9388
9516
|
case PHYSICS_WIND:
|
|
9389
|
-
timelines.push(readTimeline1(input, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index),
|
|
9517
|
+
timelines.push(readTimeline1(input, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), 1));
|
|
9390
9518
|
break;
|
|
9391
9519
|
case PHYSICS_GRAVITY:
|
|
9392
|
-
timelines.push(readTimeline1(input, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index),
|
|
9520
|
+
timelines.push(readTimeline1(input, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), 1));
|
|
9393
9521
|
break;
|
|
9394
9522
|
case PHYSICS_MIX:
|
|
9395
9523
|
timelines.push(readTimeline1(input, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1));
|
|
@@ -9697,6 +9825,7 @@ var spine = (() => {
|
|
|
9697
9825
|
var BONE_SHEAR = 7;
|
|
9698
9826
|
var BONE_SHEARX = 8;
|
|
9699
9827
|
var BONE_SHEARY = 9;
|
|
9828
|
+
var BONE_INHERIT = 10;
|
|
9700
9829
|
var SLOT_ATTACHMENT = 0;
|
|
9701
9830
|
var SLOT_RGBA = 1;
|
|
9702
9831
|
var SLOT_RGB = 2;
|
|
@@ -10429,8 +10558,10 @@ var spine = (() => {
|
|
|
10429
10558
|
skeletonData.y = skeletonMap.y;
|
|
10430
10559
|
skeletonData.width = skeletonMap.width;
|
|
10431
10560
|
skeletonData.height = skeletonMap.height;
|
|
10561
|
+
skeletonData.referenceScale = getValue(skeletonMap, "referenceScale", 100) * scale;
|
|
10432
10562
|
skeletonData.fps = skeletonMap.fps;
|
|
10433
|
-
skeletonData.imagesPath = skeletonMap.images;
|
|
10563
|
+
skeletonData.imagesPath = skeletonMap.images ?? null;
|
|
10564
|
+
skeletonData.audioPath = skeletonMap.audio ?? null;
|
|
10434
10565
|
}
|
|
10435
10566
|
if (root.bones) {
|
|
10436
10567
|
for (let i = 0; i < root.bones.length; i++) {
|
|
@@ -10448,7 +10579,7 @@ var spine = (() => {
|
|
|
10448
10579
|
data.scaleY = getValue(boneMap, "scaleY", 1);
|
|
10449
10580
|
data.shearX = getValue(boneMap, "shearX", 0);
|
|
10450
10581
|
data.shearY = getValue(boneMap, "shearY", 0);
|
|
10451
|
-
data.
|
|
10582
|
+
data.inherit = Utils.enumValue(Inherit, getValue(boneMap, "inherit", "Normal"));
|
|
10452
10583
|
data.skinRequired = getValue(boneMap, "skin", false);
|
|
10453
10584
|
let color = getValue(boneMap, "color", null);
|
|
10454
10585
|
if (color)
|
|
@@ -10459,10 +10590,17 @@ var spine = (() => {
|
|
|
10459
10590
|
if (root.slots) {
|
|
10460
10591
|
for (let i = 0; i < root.slots.length; i++) {
|
|
10461
10592
|
let slotMap = root.slots[i];
|
|
10593
|
+
let path = null;
|
|
10594
|
+
let slotName = slotMap.name;
|
|
10595
|
+
const slash = slotName.lastIndexOf("/");
|
|
10596
|
+
if (slash != -1) {
|
|
10597
|
+
path = slotName.substring(0, slash);
|
|
10598
|
+
slotName = slotName.substring(slash + 1);
|
|
10599
|
+
}
|
|
10462
10600
|
let boneData = skeletonData.findBone(slotMap.bone);
|
|
10463
10601
|
if (!boneData)
|
|
10464
|
-
throw new Error(`Couldn't find bone ${slotMap.bone} for slot ${
|
|
10465
|
-
let data = new SlotData(skeletonData.slots.length,
|
|
10602
|
+
throw new Error(`Couldn't find bone ${slotMap.bone} for slot ${slotName}`);
|
|
10603
|
+
let data = new SlotData(skeletonData.slots.length, slotName, boneData);
|
|
10466
10604
|
let color = getValue(slotMap, "color", null);
|
|
10467
10605
|
if (color)
|
|
10468
10606
|
data.color.setFromString(color);
|
|
@@ -10471,6 +10609,8 @@ var spine = (() => {
|
|
|
10471
10609
|
data.darkColor = Color.fromString(dark);
|
|
10472
10610
|
data.attachmentName = getValue(slotMap, "attachment", null);
|
|
10473
10611
|
data.blendMode = Utils.enumValue(BlendMode, getValue(slotMap, "blend", "normal"));
|
|
10612
|
+
data.visible = getValue(slotMap, "visible", true);
|
|
10613
|
+
data.path = path;
|
|
10474
10614
|
skeletonData.slots.push(data);
|
|
10475
10615
|
}
|
|
10476
10616
|
}
|
|
@@ -10585,13 +10725,14 @@ var spine = (() => {
|
|
|
10585
10725
|
data.rotate = getValue(constraintMap, "rotate", 0);
|
|
10586
10726
|
data.scaleX = getValue(constraintMap, "scaleX", 0);
|
|
10587
10727
|
data.shearX = getValue(constraintMap, "shearX", 0);
|
|
10728
|
+
data.limit = getValue(constraintMap, "limit", 5e3) * scale;
|
|
10588
10729
|
data.step = 1 / getValue(constraintMap, "fps", 60);
|
|
10589
10730
|
data.inertia = getValue(constraintMap, "inertia", 1);
|
|
10590
10731
|
data.strength = getValue(constraintMap, "strength", 100);
|
|
10591
10732
|
data.damping = getValue(constraintMap, "damping", 1);
|
|
10592
10733
|
data.massInverse = 1 / getValue(constraintMap, "mass", 1);
|
|
10593
|
-
data.wind = getValue(constraintMap, "wind", 0)
|
|
10594
|
-
data.gravity = getValue(constraintMap, "gravity", 0)
|
|
10734
|
+
data.wind = getValue(constraintMap, "wind", 0);
|
|
10735
|
+
data.gravity = getValue(constraintMap, "gravity", 0);
|
|
10595
10736
|
data.mix = getValue(constraintMap, "mix", 1);
|
|
10596
10737
|
data.inertiaGlobal = getValue(constraintMap, "inertiaGlobal", false);
|
|
10597
10738
|
data.strengthGlobal = getValue(constraintMap, "strengthGlobal", false);
|
|
@@ -11036,6 +11177,13 @@ var spine = (() => {
|
|
|
11036
11177
|
} else if (timelineName === "sheary") {
|
|
11037
11178
|
let timeline = new ShearYTimeline(frames, frames, boneIndex);
|
|
11038
11179
|
timelines.push(readTimeline12(timelineMap, timeline, 0, 1));
|
|
11180
|
+
} else if (timelineName === "inherit") {
|
|
11181
|
+
let timeline = new InheritTimeline(frames, bone.index);
|
|
11182
|
+
for (let frame = 0; frame < timelineMap.length; frame++) {
|
|
11183
|
+
let aFrame = timelineMap[frame];
|
|
11184
|
+
timeline.setFrame(frame, getValue(aFrame, "time", 0), Utils.enumValue(Inherit, getValue(aFrame, "inherit", "Normal")));
|
|
11185
|
+
}
|
|
11186
|
+
timelines.push(timeline);
|
|
11039
11187
|
}
|
|
11040
11188
|
}
|
|
11041
11189
|
}
|
|
@@ -11207,7 +11355,6 @@ var spine = (() => {
|
|
|
11207
11355
|
continue;
|
|
11208
11356
|
}
|
|
11209
11357
|
let timeline;
|
|
11210
|
-
let timelineScale = 1;
|
|
11211
11358
|
if (timelineName == "inertia")
|
|
11212
11359
|
timeline = new PhysicsConstraintInertiaTimeline(frames, frames, constraintIndex);
|
|
11213
11360
|
else if (timelineName == "strength")
|
|
@@ -11216,17 +11363,15 @@ var spine = (() => {
|
|
|
11216
11363
|
timeline = new PhysicsConstraintDampingTimeline(frames, frames, constraintIndex);
|
|
11217
11364
|
else if (timelineName == "mass")
|
|
11218
11365
|
timeline = new PhysicsConstraintMassTimeline(frames, frames, constraintIndex);
|
|
11219
|
-
else if (timelineName == "wind")
|
|
11366
|
+
else if (timelineName == "wind")
|
|
11220
11367
|
timeline = new PhysicsConstraintWindTimeline(frames, frames, constraintIndex);
|
|
11221
|
-
|
|
11222
|
-
} else if (timelineName == "gravity") {
|
|
11368
|
+
else if (timelineName == "gravity")
|
|
11223
11369
|
timeline = new PhysicsConstraintGravityTimeline(frames, frames, constraintIndex);
|
|
11224
|
-
|
|
11225
|
-
} else if (timelineName == "mix")
|
|
11370
|
+
else if (timelineName == "mix")
|
|
11226
11371
|
timeline = new PhysicsConstraintMixTimeline(frames, frames, constraintIndex);
|
|
11227
11372
|
else
|
|
11228
11373
|
continue;
|
|
11229
|
-
timelines.push(readTimeline12(timelineMap, timeline, 0,
|
|
11374
|
+
timelines.push(readTimeline12(timelineMap, timeline, 0, 1));
|
|
11230
11375
|
}
|
|
11231
11376
|
}
|
|
11232
11377
|
}
|