@esotericsoftware/spine-canvas 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.
|
@@ -66,6 +66,8 @@ var spine = (() => {
|
|
|
66
66
|
IkConstraint: () => IkConstraint,
|
|
67
67
|
IkConstraintData: () => IkConstraintData,
|
|
68
68
|
IkConstraintTimeline: () => IkConstraintTimeline,
|
|
69
|
+
Inherit: () => Inherit,
|
|
70
|
+
InheritTimeline: () => InheritTimeline,
|
|
69
71
|
IntSet: () => IntSet,
|
|
70
72
|
Interpolation: () => Interpolation,
|
|
71
73
|
MathUtils: () => MathUtils,
|
|
@@ -109,7 +111,7 @@ var spine = (() => {
|
|
|
109
111
|
ShearTimeline: () => ShearTimeline,
|
|
110
112
|
ShearXTimeline: () => ShearXTimeline,
|
|
111
113
|
ShearYTimeline: () => ShearYTimeline,
|
|
112
|
-
Skeleton: () =>
|
|
114
|
+
Skeleton: () => Skeleton,
|
|
113
115
|
SkeletonBinary: () => SkeletonBinary,
|
|
114
116
|
SkeletonBounds: () => SkeletonBounds,
|
|
115
117
|
SkeletonClipping: () => SkeletonClipping,
|
|
@@ -135,7 +137,6 @@ var spine = (() => {
|
|
|
135
137
|
TransformConstraint: () => TransformConstraint,
|
|
136
138
|
TransformConstraintData: () => TransformConstraintData,
|
|
137
139
|
TransformConstraintTimeline: () => TransformConstraintTimeline,
|
|
138
|
-
TransformMode: () => TransformMode,
|
|
139
140
|
TranslateTimeline: () => TranslateTimeline,
|
|
140
141
|
TranslateXTimeline: () => TranslateXTimeline,
|
|
141
142
|
TranslateYTimeline: () => TranslateYTimeline,
|
|
@@ -774,27 +775,28 @@ var spine = (() => {
|
|
|
774
775
|
scaleY: 4,
|
|
775
776
|
shearX: 5,
|
|
776
777
|
shearY: 6,
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
778
|
+
inherit: 7,
|
|
779
|
+
rgb: 8,
|
|
780
|
+
alpha: 9,
|
|
781
|
+
rgb2: 10,
|
|
782
|
+
attachment: 11,
|
|
783
|
+
deform: 12,
|
|
784
|
+
event: 13,
|
|
785
|
+
drawOrder: 14,
|
|
786
|
+
ikConstraint: 15,
|
|
787
|
+
transformConstraint: 16,
|
|
788
|
+
pathConstraintPosition: 17,
|
|
789
|
+
pathConstraintSpacing: 18,
|
|
790
|
+
pathConstraintMix: 19,
|
|
791
|
+
physicsConstraintInertia: 20,
|
|
792
|
+
physicsConstraintStrength: 21,
|
|
793
|
+
physicsConstraintDamping: 22,
|
|
794
|
+
physicsConstraintMass: 23,
|
|
795
|
+
physicsConstraintWind: 24,
|
|
796
|
+
physicsConstraintGravity: 25,
|
|
797
|
+
physicsConstraintMix: 26,
|
|
798
|
+
physicsConstraintReset: 27,
|
|
799
|
+
sequence: 28
|
|
798
800
|
};
|
|
799
801
|
var Timeline = class {
|
|
800
802
|
propertyIds;
|
|
@@ -1391,7 +1393,7 @@ var spine = (() => {
|
|
|
1391
1393
|
apply(skeleton, lastTime, time, events, alpha, blend, direction) {
|
|
1392
1394
|
let bone = skeleton.bones[this.boneIndex];
|
|
1393
1395
|
if (bone.active)
|
|
1394
|
-
bone.scaleY = this.getScaleValue(time, alpha, blend, direction, bone.
|
|
1396
|
+
bone.scaleY = this.getScaleValue(time, alpha, blend, direction, bone.scaleY, bone.data.scaleY);
|
|
1395
1397
|
}
|
|
1396
1398
|
};
|
|
1397
1399
|
var ShearTimeline = class extends CurveTimeline2 {
|
|
@@ -1520,7 +1522,48 @@ var spine = (() => {
|
|
|
1520
1522
|
apply(skeleton, lastTime, time, events, alpha, blend, direction) {
|
|
1521
1523
|
let bone = skeleton.bones[this.boneIndex];
|
|
1522
1524
|
if (bone.active)
|
|
1523
|
-
bone.shearY = this.getRelativeValue(time, alpha, blend, bone.
|
|
1525
|
+
bone.shearY = this.getRelativeValue(time, alpha, blend, bone.shearY, bone.data.shearY);
|
|
1526
|
+
}
|
|
1527
|
+
};
|
|
1528
|
+
var InheritTimeline = class extends Timeline {
|
|
1529
|
+
boneIndex = 0;
|
|
1530
|
+
constructor(frameCount, boneIndex) {
|
|
1531
|
+
super(frameCount, [Property.inherit + "|" + boneIndex]);
|
|
1532
|
+
this.boneIndex = boneIndex;
|
|
1533
|
+
}
|
|
1534
|
+
getFrameEntries() {
|
|
1535
|
+
return 2;
|
|
1536
|
+
}
|
|
1537
|
+
/** Sets the transform mode for the specified frame.
|
|
1538
|
+
* @param frame Between 0 and <code>frameCount</code>, inclusive.
|
|
1539
|
+
* @param time The frame time in seconds. */
|
|
1540
|
+
setFrame(frame, time, inherit) {
|
|
1541
|
+
frame *= 2;
|
|
1542
|
+
this.frames[frame] = time;
|
|
1543
|
+
this.frames[
|
|
1544
|
+
frame + 1
|
|
1545
|
+
/*INHERIT*/
|
|
1546
|
+
] = inherit;
|
|
1547
|
+
}
|
|
1548
|
+
apply(skeleton, lastTime, time, events, alpha, blend, direction) {
|
|
1549
|
+
let bone = skeleton.bones[this.boneIndex];
|
|
1550
|
+
if (!bone.active)
|
|
1551
|
+
return;
|
|
1552
|
+
let frames = this.frames;
|
|
1553
|
+
if (time < frames[0]) {
|
|
1554
|
+
if (blend == 0 /* setup */ || blend == 1 /* first */)
|
|
1555
|
+
bone.inherit = bone.data.inherit;
|
|
1556
|
+
return;
|
|
1557
|
+
}
|
|
1558
|
+
bone.inherit = this.frames[
|
|
1559
|
+
Timeline.search(
|
|
1560
|
+
frames,
|
|
1561
|
+
time,
|
|
1562
|
+
2
|
|
1563
|
+
/*ENTRIES*/
|
|
1564
|
+
) + 1
|
|
1565
|
+
/*INHERIT*/
|
|
1566
|
+
];
|
|
1524
1567
|
}
|
|
1525
1568
|
};
|
|
1526
1569
|
var RGBATimeline = class extends CurveTimeline {
|
|
@@ -2696,7 +2739,7 @@ var spine = (() => {
|
|
|
2696
2739
|
var DrawOrderTimeline = _DrawOrderTimeline;
|
|
2697
2740
|
__publicField(DrawOrderTimeline, "propertyIds", ["" + Property.drawOrder]);
|
|
2698
2741
|
var IkConstraintTimeline = class extends CurveTimeline {
|
|
2699
|
-
/** The index of the IK constraint in {@link Skeleton#getIkConstraints()} that will be changed when this timeline is */
|
|
2742
|
+
/** The index of the IK constraint in {@link Skeleton#getIkConstraints()} that will be changed when this timeline is applied */
|
|
2700
2743
|
constraintIndex = 0;
|
|
2701
2744
|
constructor(frameCount, bezierCount, ikConstraintIndex) {
|
|
2702
2745
|
super(frameCount, bezierCount, [
|
|
@@ -3881,9 +3924,14 @@ var spine = (() => {
|
|
|
3881
3924
|
this.queue.event(entry, event);
|
|
3882
3925
|
}
|
|
3883
3926
|
let complete = false;
|
|
3884
|
-
if (entry.loop)
|
|
3885
|
-
|
|
3886
|
-
|
|
3927
|
+
if (entry.loop) {
|
|
3928
|
+
if (duration == 0)
|
|
3929
|
+
complete = true;
|
|
3930
|
+
else {
|
|
3931
|
+
const cycles = Math.floor(entry.trackTime / duration);
|
|
3932
|
+
complete = cycles > 0 && cycles > Math.floor(entry.trackTime / duration);
|
|
3933
|
+
}
|
|
3934
|
+
} else
|
|
3887
3935
|
complete = animationTime >= animationEnd && entry.animationLast < animationEnd;
|
|
3888
3936
|
if (complete)
|
|
3889
3937
|
this.queue.complete(entry);
|
|
@@ -5387,7 +5435,7 @@ var spine = (() => {
|
|
|
5387
5435
|
/** The local shearX. */
|
|
5388
5436
|
shearY = 0;
|
|
5389
5437
|
/** The transform mode for how parent world transforms affect this bone. */
|
|
5390
|
-
|
|
5438
|
+
inherit = Inherit.Normal;
|
|
5391
5439
|
/** When true, {@link Skeleton#updateWorldTransform()} only updates this bone if the {@link Skeleton#skin} contains this
|
|
5392
5440
|
* bone.
|
|
5393
5441
|
* @see Skin#bones */
|
|
@@ -5409,14 +5457,14 @@ var spine = (() => {
|
|
|
5409
5457
|
this.parent = parent;
|
|
5410
5458
|
}
|
|
5411
5459
|
};
|
|
5412
|
-
var
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
return
|
|
5419
|
-
})(
|
|
5460
|
+
var Inherit = /* @__PURE__ */ ((Inherit2) => {
|
|
5461
|
+
Inherit2[Inherit2["Normal"] = 0] = "Normal";
|
|
5462
|
+
Inherit2[Inherit2["OnlyTranslation"] = 1] = "OnlyTranslation";
|
|
5463
|
+
Inherit2[Inherit2["NoRotationOrReflection"] = 2] = "NoRotationOrReflection";
|
|
5464
|
+
Inherit2[Inherit2["NoScale"] = 3] = "NoScale";
|
|
5465
|
+
Inherit2[Inherit2["NoScaleOrReflection"] = 4] = "NoScaleOrReflection";
|
|
5466
|
+
return Inherit2;
|
|
5467
|
+
})(Inherit || {});
|
|
5420
5468
|
|
|
5421
5469
|
// spine-core/src/Bone.ts
|
|
5422
5470
|
var Bone = class {
|
|
@@ -5468,6 +5516,7 @@ var spine = (() => {
|
|
|
5468
5516
|
worldY = 0;
|
|
5469
5517
|
/** The world Y position. If changed, {@link #updateAppliedTransform()} should be called. */
|
|
5470
5518
|
worldX = 0;
|
|
5519
|
+
inherit = 0 /* Normal */;
|
|
5471
5520
|
sorted = false;
|
|
5472
5521
|
active = false;
|
|
5473
5522
|
/** @param parent May be null. */
|
|
@@ -5526,7 +5575,7 @@ var spine = (() => {
|
|
|
5526
5575
|
let pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
|
|
5527
5576
|
this.worldX = pa * x + pb * y + parent.worldX;
|
|
5528
5577
|
this.worldY = pc * x + pd * y + parent.worldY;
|
|
5529
|
-
switch (this.
|
|
5578
|
+
switch (this.inherit) {
|
|
5530
5579
|
case 0 /* Normal */: {
|
|
5531
5580
|
const rx = (rotation + shearX) * MathUtils.degRad;
|
|
5532
5581
|
const ry = (rotation + 90 + shearY) * MathUtils.degRad;
|
|
@@ -5588,7 +5637,7 @@ var spine = (() => {
|
|
|
5588
5637
|
za *= s;
|
|
5589
5638
|
zc *= s;
|
|
5590
5639
|
s = Math.sqrt(za * za + zc * zc);
|
|
5591
|
-
if (this.
|
|
5640
|
+
if (this.inherit == 3 /* NoScale */ && pa * pd - pb * pc < 0 != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0))
|
|
5592
5641
|
s = -s;
|
|
5593
5642
|
rotation = Math.PI / 2 + Math.atan2(zc, za);
|
|
5594
5643
|
const zb = Math.cos(rotation) * s;
|
|
@@ -5621,6 +5670,7 @@ var spine = (() => {
|
|
|
5621
5670
|
this.scaleY = data.scaleY;
|
|
5622
5671
|
this.shearX = data.shearX;
|
|
5623
5672
|
this.shearY = data.shearY;
|
|
5673
|
+
this.inherit = data.inherit;
|
|
5624
5674
|
}
|
|
5625
5675
|
/** Computes the applied transform values from the world transform.
|
|
5626
5676
|
*
|
|
@@ -5649,13 +5699,13 @@ var spine = (() => {
|
|
|
5649
5699
|
this.ax = dx * ia - dy * ib;
|
|
5650
5700
|
this.ay = dy * id - dx * ic;
|
|
5651
5701
|
let ra, rb, rc, rd;
|
|
5652
|
-
if (this.
|
|
5702
|
+
if (this.inherit == 1 /* OnlyTranslation */) {
|
|
5653
5703
|
ra = this.a;
|
|
5654
5704
|
rb = this.b;
|
|
5655
5705
|
rc = this.c;
|
|
5656
5706
|
rd = this.d;
|
|
5657
5707
|
} else {
|
|
5658
|
-
switch (this.
|
|
5708
|
+
switch (this.inherit) {
|
|
5659
5709
|
case 2 /* NoRotationOrReflection */: {
|
|
5660
5710
|
let s2 = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);
|
|
5661
5711
|
let sa = pa / this.skeleton.scaleX;
|
|
@@ -5678,7 +5728,7 @@ var spine = (() => {
|
|
|
5678
5728
|
pa *= s;
|
|
5679
5729
|
pc *= s;
|
|
5680
5730
|
s = Math.sqrt(pa * pa + pc * pc);
|
|
5681
|
-
if (this.
|
|
5731
|
+
if (this.inherit == 3 /* NoScale */ && pid < 0 != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0))
|
|
5682
5732
|
s = -s;
|
|
5683
5733
|
let r = MathUtils.PI / 2 + Math.atan2(pc, pa);
|
|
5684
5734
|
pb = Math.cos(r) * s;
|
|
@@ -6192,7 +6242,7 @@ var spine = (() => {
|
|
|
6192
6242
|
throw new Error("IK bone must have parent.");
|
|
6193
6243
|
let pa = p.a, pb = p.b, pc = p.c, pd = p.d;
|
|
6194
6244
|
let rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0;
|
|
6195
|
-
switch (bone.
|
|
6245
|
+
switch (bone.inherit) {
|
|
6196
6246
|
case 1 /* OnlyTranslation */:
|
|
6197
6247
|
tx = (targetX - bone.worldX) * MathUtils.signum(bone.skeleton.scaleX);
|
|
6198
6248
|
ty = (targetY - bone.worldY) * MathUtils.signum(bone.skeleton.scaleY);
|
|
@@ -6224,7 +6274,7 @@ var spine = (() => {
|
|
|
6224
6274
|
rotationIK += 360;
|
|
6225
6275
|
let sx = bone.ascaleX, sy = bone.ascaleY;
|
|
6226
6276
|
if (compress || stretch) {
|
|
6227
|
-
switch (bone.
|
|
6277
|
+
switch (bone.inherit) {
|
|
6228
6278
|
case 3 /* NoScale */:
|
|
6229
6279
|
case 4 /* NoScaleOrReflection */:
|
|
6230
6280
|
tx = targetX - bone.worldX;
|
|
@@ -6254,6 +6304,8 @@ var spine = (() => {
|
|
|
6254
6304
|
/** Applies 2 bone IK. The target is specified in the world coordinate system.
|
|
6255
6305
|
* @param child A direct descendant of the parent bone. */
|
|
6256
6306
|
apply2(parent, child, targetX, targetY, bendDir, stretch, uniform, softness, alpha) {
|
|
6307
|
+
if (parent.inherit != 0 /* Normal */ || child.inherit != 0 /* Normal */)
|
|
6308
|
+
return;
|
|
6257
6309
|
let px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, sx = psx, sy = psy, csx = child.ascaleX;
|
|
6258
6310
|
let os1 = 0, os2 = 0, s2 = 0;
|
|
6259
6311
|
if (psx < 0) {
|
|
@@ -6420,7 +6472,7 @@ var spine = (() => {
|
|
|
6420
6472
|
return this._target;
|
|
6421
6473
|
}
|
|
6422
6474
|
/** Controls the bend direction of the IK bones, either 1 or -1. */
|
|
6423
|
-
bendDirection =
|
|
6475
|
+
bendDirection = 0;
|
|
6424
6476
|
/** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */
|
|
6425
6477
|
compress = false;
|
|
6426
6478
|
/** 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
|
|
@@ -6430,7 +6482,7 @@ var spine = (() => {
|
|
|
6430
6482
|
* is scaled on both the X and Y axes. */
|
|
6431
6483
|
uniform = false;
|
|
6432
6484
|
/** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */
|
|
6433
|
-
mix =
|
|
6485
|
+
mix = 0;
|
|
6434
6486
|
/** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */
|
|
6435
6487
|
softness = 0;
|
|
6436
6488
|
constructor(name) {
|
|
@@ -7034,7 +7086,8 @@ var spine = (() => {
|
|
|
7034
7086
|
case 1 /* reset */:
|
|
7035
7087
|
this.reset();
|
|
7036
7088
|
case 2 /* update */:
|
|
7037
|
-
|
|
7089
|
+
const delta = Math.max(this.skeleton.time - this.lastTime, 0);
|
|
7090
|
+
this.remaining += delta;
|
|
7038
7091
|
this.lastTime = this.skeleton.time;
|
|
7039
7092
|
const bx = bone.worldX, by = bone.worldY;
|
|
7040
7093
|
if (this._reset) {
|
|
@@ -7042,32 +7095,34 @@ var spine = (() => {
|
|
|
7042
7095
|
this.ux = bx;
|
|
7043
7096
|
this.uy = by;
|
|
7044
7097
|
} else {
|
|
7045
|
-
let
|
|
7098
|
+
let a = this.remaining, i = this.inertia, q = this.data.limit * delta, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1;
|
|
7046
7099
|
if (x || y) {
|
|
7047
7100
|
if (x) {
|
|
7048
|
-
|
|
7101
|
+
const u = (this.ux - bx) * i;
|
|
7102
|
+
this.xOffset += u > q ? q : u < -q ? -q : u;
|
|
7049
7103
|
this.ux = bx;
|
|
7050
7104
|
}
|
|
7051
7105
|
if (y) {
|
|
7052
|
-
|
|
7106
|
+
const u = (this.uy - by) * i;
|
|
7107
|
+
this.yOffset += u > q ? q : u < -q ? -q : u;
|
|
7053
7108
|
this.uy = by;
|
|
7054
7109
|
}
|
|
7055
|
-
if (
|
|
7056
|
-
|
|
7057
|
-
const
|
|
7110
|
+
if (a >= t) {
|
|
7111
|
+
d = Math.pow(this.damping, 60 * t);
|
|
7112
|
+
const m = this.massInverse * t, e = this.strength, w = this.wind * f, g = (Skeleton.yDown ? -this.gravity : this.gravity) * f;
|
|
7058
7113
|
do {
|
|
7059
7114
|
if (x) {
|
|
7060
7115
|
this.xVelocity += (w - this.xOffset * e) * m;
|
|
7061
|
-
this.xOffset += this.xVelocity *
|
|
7116
|
+
this.xOffset += this.xVelocity * t;
|
|
7062
7117
|
this.xVelocity *= d;
|
|
7063
7118
|
}
|
|
7064
7119
|
if (y) {
|
|
7065
|
-
this.yVelocity
|
|
7066
|
-
this.yOffset += this.yVelocity *
|
|
7120
|
+
this.yVelocity -= (g + this.yOffset * e) * m;
|
|
7121
|
+
this.yOffset += this.yVelocity * t;
|
|
7067
7122
|
this.yVelocity *= d;
|
|
7068
7123
|
}
|
|
7069
|
-
|
|
7070
|
-
} while (
|
|
7124
|
+
a -= t;
|
|
7125
|
+
} while (a >= t);
|
|
7071
7126
|
}
|
|
7072
7127
|
if (x)
|
|
7073
7128
|
bone.worldX += this.xOffset * mix * this.data.x;
|
|
@@ -7076,9 +7131,18 @@ var spine = (() => {
|
|
|
7076
7131
|
}
|
|
7077
7132
|
if (rotateOrShearX || scaleX) {
|
|
7078
7133
|
let ca = Math.atan2(bone.c, bone.a), c = 0, s = 0, mr = 0;
|
|
7134
|
+
let dx = this.cx - bone.worldX, dy = this.cy - bone.worldY;
|
|
7135
|
+
if (dx > q)
|
|
7136
|
+
dx = q;
|
|
7137
|
+
else if (dx < -q)
|
|
7138
|
+
dx = -q;
|
|
7139
|
+
if (dy > q)
|
|
7140
|
+
dy = q;
|
|
7141
|
+
else if (dy < -q)
|
|
7142
|
+
dy = -q;
|
|
7079
7143
|
if (rotateOrShearX) {
|
|
7080
7144
|
mr = (this.data.rotate + this.data.shearX) * mix;
|
|
7081
|
-
let
|
|
7145
|
+
let r = Math.atan2(dy + this.ty, dx + this.tx) - ca - this.rotateOffset * mr;
|
|
7082
7146
|
this.rotateOffset += (r - Math.ceil(r * MathUtils.invPI2 - 0.5) * MathUtils.PI2) * i;
|
|
7083
7147
|
r = this.rotateOffset * mr + ca;
|
|
7084
7148
|
c = Math.cos(r);
|
|
@@ -7093,34 +7157,35 @@ var spine = (() => {
|
|
|
7093
7157
|
s = Math.sin(ca);
|
|
7094
7158
|
const r = l * bone.getWorldScaleX();
|
|
7095
7159
|
if (r > 0)
|
|
7096
|
-
this.scaleOffset += (
|
|
7160
|
+
this.scaleOffset += (dx * c + dy * s) * i / r;
|
|
7097
7161
|
}
|
|
7098
|
-
|
|
7099
|
-
if (
|
|
7100
|
-
|
|
7101
|
-
|
|
7162
|
+
a = this.remaining;
|
|
7163
|
+
if (a >= t) {
|
|
7164
|
+
if (d == -1)
|
|
7165
|
+
d = Math.pow(this.damping, 60 * t);
|
|
7166
|
+
const m = this.massInverse * t, e = this.strength, w = this.wind, g = Skeleton.yDown ? -this.gravity : this.gravity, h = l / f;
|
|
7102
7167
|
while (true) {
|
|
7103
|
-
|
|
7168
|
+
a -= t;
|
|
7104
7169
|
if (scaleX) {
|
|
7105
7170
|
this.scaleVelocity += (w * c - g * s - this.scaleOffset * e) * m;
|
|
7106
|
-
this.scaleOffset += this.scaleVelocity *
|
|
7171
|
+
this.scaleOffset += this.scaleVelocity * t;
|
|
7107
7172
|
this.scaleVelocity *= d;
|
|
7108
7173
|
}
|
|
7109
7174
|
if (rotateOrShearX) {
|
|
7110
|
-
this.rotateVelocity
|
|
7111
|
-
this.rotateOffset += this.rotateVelocity *
|
|
7175
|
+
this.rotateVelocity -= ((w * s + g * c) * h + this.rotateOffset * e) * m;
|
|
7176
|
+
this.rotateOffset += this.rotateVelocity * t;
|
|
7112
7177
|
this.rotateVelocity *= d;
|
|
7113
|
-
if (
|
|
7178
|
+
if (a < t)
|
|
7114
7179
|
break;
|
|
7115
7180
|
const r = this.rotateOffset * mr + ca;
|
|
7116
7181
|
c = Math.cos(r);
|
|
7117
7182
|
s = Math.sin(r);
|
|
7118
|
-
} else if (
|
|
7183
|
+
} else if (a < t)
|
|
7119
7184
|
break;
|
|
7120
7185
|
}
|
|
7121
7186
|
}
|
|
7122
7187
|
}
|
|
7123
|
-
this.remaining =
|
|
7188
|
+
this.remaining = a;
|
|
7124
7189
|
}
|
|
7125
7190
|
this.cx = bone.worldX;
|
|
7126
7191
|
this.cy = bone.worldY;
|
|
@@ -7172,6 +7237,21 @@ var spine = (() => {
|
|
|
7172
7237
|
}
|
|
7173
7238
|
bone.updateAppliedTransform();
|
|
7174
7239
|
}
|
|
7240
|
+
/** Translates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone moved an additional
|
|
7241
|
+
* amount in world space. */
|
|
7242
|
+
translate(x, y) {
|
|
7243
|
+
this.ux -= x;
|
|
7244
|
+
this.uy -= y;
|
|
7245
|
+
this.cx -= x;
|
|
7246
|
+
this.cy -= y;
|
|
7247
|
+
}
|
|
7248
|
+
/** Rotates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone rotated around the
|
|
7249
|
+
* specified point in world space. */
|
|
7250
|
+
rotate(x, y, degrees) {
|
|
7251
|
+
const r = degrees * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);
|
|
7252
|
+
const dx = this.cx - x, dy = this.cy - y;
|
|
7253
|
+
this.translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy);
|
|
7254
|
+
}
|
|
7175
7255
|
};
|
|
7176
7256
|
|
|
7177
7257
|
// spine-core/src/Slot.ts
|
|
@@ -7431,11 +7511,8 @@ var spine = (() => {
|
|
|
7431
7511
|
for (let i = 0, n = bones.length; i < n; i++) {
|
|
7432
7512
|
let bone = bones[i];
|
|
7433
7513
|
let rotation = bone.arotation;
|
|
7434
|
-
if (mixRotate != 0)
|
|
7435
|
-
|
|
7436
|
-
r -= Math.ceil(r / 360 - 0.5) * 360;
|
|
7437
|
-
rotation += r * mixRotate;
|
|
7438
|
-
}
|
|
7514
|
+
if (mixRotate != 0)
|
|
7515
|
+
rotation += (target.arotation - rotation + this.data.offsetRotation) * mixRotate;
|
|
7439
7516
|
let x = bone.ax, y = bone.ay;
|
|
7440
7517
|
x += (target.ax - x + this.data.offsetX) * mixX;
|
|
7441
7518
|
y += (target.ay - y + this.data.offsetY) * mixY;
|
|
@@ -7445,11 +7522,8 @@ var spine = (() => {
|
|
|
7445
7522
|
if (mixScaleY != 0 && scaleY != 0)
|
|
7446
7523
|
scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY;
|
|
7447
7524
|
let shearY = bone.ashearY;
|
|
7448
|
-
if (mixShearY != 0)
|
|
7449
|
-
|
|
7450
|
-
r -= Math.ceil(r / 360 - 0.5) * 360;
|
|
7451
|
-
shearY += r * mixShearY;
|
|
7452
|
-
}
|
|
7525
|
+
if (mixShearY != 0)
|
|
7526
|
+
shearY += (target.ashearY - shearY + this.data.offsetShearY) * mixShearY;
|
|
7453
7527
|
bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);
|
|
7454
7528
|
}
|
|
7455
7529
|
}
|
|
@@ -7476,7 +7550,7 @@ var spine = (() => {
|
|
|
7476
7550
|
data;
|
|
7477
7551
|
/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */
|
|
7478
7552
|
bones;
|
|
7479
|
-
/** The skeleton's slots. */
|
|
7553
|
+
/** The skeleton's slots in the setup pose draw order. */
|
|
7480
7554
|
slots;
|
|
7481
7555
|
/** The skeleton's slots in the order they should be drawn. The returned array may be modified to change the draw order. */
|
|
7482
7556
|
drawOrder;
|
|
@@ -8028,9 +8102,20 @@ var spine = (() => {
|
|
|
8028
8102
|
update(delta) {
|
|
8029
8103
|
this.time += delta;
|
|
8030
8104
|
}
|
|
8105
|
+
physicsTranslate(x, y) {
|
|
8106
|
+
const physicsConstraints = this.physicsConstraints;
|
|
8107
|
+
for (let i = 0, n = physicsConstraints.length; i < n; i++)
|
|
8108
|
+
physicsConstraints[i].translate(x, y);
|
|
8109
|
+
}
|
|
8110
|
+
/** Calls {@link PhysicsConstraint#rotate(float, float, float)} for each physics constraint. */
|
|
8111
|
+
physicsRotate(x, y, degrees) {
|
|
8112
|
+
const physicsConstraints = this.physicsConstraints;
|
|
8113
|
+
for (let i = 0, n = physicsConstraints.length; i < n; i++)
|
|
8114
|
+
physicsConstraints[i].rotate(x, y, degrees);
|
|
8115
|
+
}
|
|
8031
8116
|
};
|
|
8032
|
-
var
|
|
8033
|
-
__publicField(
|
|
8117
|
+
var Skeleton = _Skeleton;
|
|
8118
|
+
__publicField(Skeleton, "yDown", false);
|
|
8034
8119
|
var Physics = /* @__PURE__ */ ((Physics2) => {
|
|
8035
8120
|
Physics2[Physics2["none"] = 0] = "none";
|
|
8036
8121
|
Physics2[Physics2["reset"] = 1] = "reset";
|
|
@@ -8057,6 +8142,7 @@ var spine = (() => {
|
|
|
8057
8142
|
rotate = 0;
|
|
8058
8143
|
scaleX = 0;
|
|
8059
8144
|
shearX = 0;
|
|
8145
|
+
limit = 0;
|
|
8060
8146
|
step = 0;
|
|
8061
8147
|
inertia = 0;
|
|
8062
8148
|
strength = 0;
|
|
@@ -8085,7 +8171,7 @@ var spine = (() => {
|
|
|
8085
8171
|
/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */
|
|
8086
8172
|
bones = new Array();
|
|
8087
8173
|
// Ordered parents first.
|
|
8088
|
-
/** The skeleton's slots. */
|
|
8174
|
+
/** The skeleton's slots in the setup pose draw order. */
|
|
8089
8175
|
slots = new Array();
|
|
8090
8176
|
// Setup pose draw order.
|
|
8091
8177
|
skins = new Array();
|
|
@@ -8114,6 +8200,9 @@ var spine = (() => {
|
|
|
8114
8200
|
width = 0;
|
|
8115
8201
|
/** The height of the skeleton's axis aligned bounding box in the setup pose. */
|
|
8116
8202
|
height = 0;
|
|
8203
|
+
/** Baseline scale factor for applying distance-dependent effects on non-scalable properties, such as angle or scale. Default
|
|
8204
|
+
* is 100. */
|
|
8205
|
+
referenceScale = 100;
|
|
8117
8206
|
/** The Spine version used to export the skeleton data, or null. */
|
|
8118
8207
|
version = null;
|
|
8119
8208
|
/** The skeleton data hash. This value will change if any of the skeleton data has changed. May be null. */
|
|
@@ -8445,6 +8534,8 @@ var spine = (() => {
|
|
|
8445
8534
|
blendMode = BlendMode.Normal;
|
|
8446
8535
|
/** False if the slot was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */
|
|
8447
8536
|
visible = true;
|
|
8537
|
+
/** The folders for this slot in the draw order, delimited by <code>/</code>, or null if nonessential data was not exported. */
|
|
8538
|
+
path = null;
|
|
8448
8539
|
constructor(index, name, boneData) {
|
|
8449
8540
|
if (index < 0)
|
|
8450
8541
|
throw new Error("index must be >= 0.");
|
|
@@ -8530,6 +8621,7 @@ var spine = (() => {
|
|
|
8530
8621
|
skeletonData.y = input.readFloat();
|
|
8531
8622
|
skeletonData.width = input.readFloat();
|
|
8532
8623
|
skeletonData.height = input.readFloat();
|
|
8624
|
+
skeletonData.referenceScale = input.readFloat() * scale;
|
|
8533
8625
|
let nonessential = input.readBoolean();
|
|
8534
8626
|
if (nonessential) {
|
|
8535
8627
|
skeletonData.fps = input.readFloat();
|
|
@@ -8559,7 +8651,7 @@ var spine = (() => {
|
|
|
8559
8651
|
data.shearX = input.readFloat();
|
|
8560
8652
|
data.shearY = input.readFloat();
|
|
8561
8653
|
data.length = input.readFloat() * scale;
|
|
8562
|
-
data.
|
|
8654
|
+
data.inherit = input.readByte();
|
|
8563
8655
|
data.skinRequired = input.readBoolean();
|
|
8564
8656
|
if (nonessential) {
|
|
8565
8657
|
Color.rgba8888ToColor(data.color, input.readInt32());
|
|
@@ -8573,6 +8665,14 @@ var spine = (() => {
|
|
|
8573
8665
|
let slotName = input.readString();
|
|
8574
8666
|
if (!slotName)
|
|
8575
8667
|
throw new Error("Slot name must not be null.");
|
|
8668
|
+
let path = null;
|
|
8669
|
+
if (nonessential) {
|
|
8670
|
+
const slash = slotName.lastIndexOf("/");
|
|
8671
|
+
if (slash != -1) {
|
|
8672
|
+
path = slotName.substring(0, slash);
|
|
8673
|
+
slotName = slotName.substring(slash + 1);
|
|
8674
|
+
}
|
|
8675
|
+
}
|
|
8576
8676
|
let boneData = skeletonData.bones[input.readInt(true)];
|
|
8577
8677
|
let data = new SlotData(i, slotName, boneData);
|
|
8578
8678
|
Color.rgba8888ToColor(data.color, input.readInt32());
|
|
@@ -8581,8 +8681,10 @@ var spine = (() => {
|
|
|
8581
8681
|
Color.rgb888ToColor(data.darkColor = new Color(), darkColor);
|
|
8582
8682
|
data.attachmentName = input.readStringRef();
|
|
8583
8683
|
data.blendMode = input.readInt(true);
|
|
8584
|
-
if (nonessential)
|
|
8684
|
+
if (nonessential) {
|
|
8585
8685
|
data.visible = input.readBoolean();
|
|
8686
|
+
data.path = path;
|
|
8687
|
+
}
|
|
8586
8688
|
skeletonData.slots.push(data);
|
|
8587
8689
|
}
|
|
8588
8690
|
n = input.readInt(true);
|
|
@@ -8596,14 +8698,16 @@ var spine = (() => {
|
|
|
8596
8698
|
for (let ii = 0; ii < nn; ii++)
|
|
8597
8699
|
data.bones.push(skeletonData.bones[input.readInt(true)]);
|
|
8598
8700
|
data.target = skeletonData.bones[input.readInt(true)];
|
|
8599
|
-
data.mix = input.readFloat();
|
|
8600
|
-
data.softness = input.readFloat() * scale;
|
|
8601
8701
|
let flags = input.readByte();
|
|
8602
8702
|
data.skinRequired = (flags & 1) != 0;
|
|
8603
8703
|
data.bendDirection = (flags & 2) != 0 ? 1 : -1;
|
|
8604
8704
|
data.compress = (flags & 4) != 0;
|
|
8605
8705
|
data.stretch = (flags & 8) != 0;
|
|
8606
8706
|
data.uniform = (flags & 16) != 0;
|
|
8707
|
+
if ((flags & 32) != 0)
|
|
8708
|
+
data.mix = (flags & 64) != 0 ? input.readFloat() : 1;
|
|
8709
|
+
if ((flags & 128) != 0)
|
|
8710
|
+
data.softness = input.readFloat() * scale;
|
|
8607
8711
|
skeletonData.ikConstraints.push(data);
|
|
8608
8712
|
}
|
|
8609
8713
|
n = input.readInt(true);
|
|
@@ -8617,22 +8721,35 @@ var spine = (() => {
|
|
|
8617
8721
|
for (let ii = 0; ii < nn; ii++)
|
|
8618
8722
|
data.bones.push(skeletonData.bones[input.readInt(true)]);
|
|
8619
8723
|
data.target = skeletonData.bones[input.readInt(true)];
|
|
8620
|
-
|
|
8724
|
+
let flags = input.readByte();
|
|
8621
8725
|
data.skinRequired = (flags & 1) != 0;
|
|
8622
8726
|
data.local = (flags & 2) != 0;
|
|
8623
8727
|
data.relative = (flags & 4) != 0;
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8728
|
+
if ((flags & 8) != 0)
|
|
8729
|
+
data.offsetRotation = input.readFloat();
|
|
8730
|
+
if ((flags & 16) != 0)
|
|
8731
|
+
data.offsetX = input.readFloat() * scale;
|
|
8732
|
+
if ((flags & 32) != 0)
|
|
8733
|
+
data.offsetY = input.readFloat() * scale;
|
|
8734
|
+
if ((flags & 64) != 0)
|
|
8735
|
+
data.offsetScaleX = input.readFloat();
|
|
8736
|
+
if ((flags & 128) != 0)
|
|
8737
|
+
data.offsetScaleY = input.readFloat();
|
|
8738
|
+
flags = input.readByte();
|
|
8739
|
+
if ((flags & 1) != 0)
|
|
8740
|
+
data.offsetShearY = input.readFloat();
|
|
8741
|
+
if ((flags & 2) != 0)
|
|
8742
|
+
data.mixRotate = input.readFloat();
|
|
8743
|
+
if ((flags & 4) != 0)
|
|
8744
|
+
data.mixX = input.readFloat();
|
|
8745
|
+
if ((flags & 8) != 0)
|
|
8746
|
+
data.mixY = input.readFloat();
|
|
8747
|
+
if ((flags & 16) != 0)
|
|
8748
|
+
data.mixScaleX = input.readFloat();
|
|
8749
|
+
if ((flags & 32) != 0)
|
|
8750
|
+
data.mixScaleY = input.readFloat();
|
|
8751
|
+
if ((flags & 64) != 0)
|
|
8752
|
+
data.mixShearY = input.readFloat();
|
|
8636
8753
|
skeletonData.transformConstraints.push(data);
|
|
8637
8754
|
}
|
|
8638
8755
|
n = input.readInt(true);
|
|
@@ -8647,10 +8764,12 @@ var spine = (() => {
|
|
|
8647
8764
|
for (let ii = 0; ii < nn; ii++)
|
|
8648
8765
|
data.bones.push(skeletonData.bones[input.readInt(true)]);
|
|
8649
8766
|
data.target = skeletonData.slots[input.readInt(true)];
|
|
8650
|
-
|
|
8651
|
-
data.
|
|
8652
|
-
data.
|
|
8653
|
-
data.
|
|
8767
|
+
const flags = input.readByte();
|
|
8768
|
+
data.positionMode = flags & 1;
|
|
8769
|
+
data.spacingMode = flags >> 1 & 3;
|
|
8770
|
+
data.rotateMode = flags >> 3 & 3;
|
|
8771
|
+
if ((flags & 128) != 0)
|
|
8772
|
+
data.offsetRotation = input.readFloat();
|
|
8654
8773
|
data.position = input.readFloat();
|
|
8655
8774
|
if (data.positionMode == 0 /* Fixed */)
|
|
8656
8775
|
data.position *= scale;
|
|
@@ -8682,14 +8801,14 @@ var spine = (() => {
|
|
|
8682
8801
|
data.scaleX = input.readFloat();
|
|
8683
8802
|
if ((flags & 32) != 0)
|
|
8684
8803
|
data.shearX = input.readFloat();
|
|
8685
|
-
data.
|
|
8804
|
+
data.limit = ((flags & 64) != 0 ? input.readFloat() : 5e3) * scale;
|
|
8805
|
+
data.step = 1 / input.readUnsignedByte();
|
|
8686
8806
|
data.inertia = input.readFloat();
|
|
8687
8807
|
data.strength = input.readFloat();
|
|
8688
8808
|
data.damping = input.readFloat();
|
|
8689
|
-
data.massInverse = input.readFloat();
|
|
8690
|
-
data.wind = input.readFloat()
|
|
8691
|
-
data.gravity = input.readFloat()
|
|
8692
|
-
data.mix = input.readFloat();
|
|
8809
|
+
data.massInverse = (flags & 128) != 0 ? input.readFloat() : 1;
|
|
8810
|
+
data.wind = input.readFloat();
|
|
8811
|
+
data.gravity = input.readFloat();
|
|
8693
8812
|
flags = input.readByte();
|
|
8694
8813
|
if ((flags & 1) != 0)
|
|
8695
8814
|
data.inertiaGlobal = true;
|
|
@@ -8705,6 +8824,7 @@ var spine = (() => {
|
|
|
8705
8824
|
data.gravityGlobal = true;
|
|
8706
8825
|
if ((flags & 64) != 0)
|
|
8707
8826
|
data.mixGlobal = true;
|
|
8827
|
+
data.mix = (flags & 128) != 0 ? input.readFloat() : 1;
|
|
8708
8828
|
skeletonData.physicsConstraints.push(data);
|
|
8709
8829
|
}
|
|
8710
8830
|
let defaultSkin = this.readSkin(input, skeletonData, true, nonessential);
|
|
@@ -8814,7 +8934,7 @@ var spine = (() => {
|
|
|
8814
8934
|
let path = (flags & 16) != 0 ? input.readStringRef() : null;
|
|
8815
8935
|
const color = (flags & 32) != 0 ? input.readInt32() : 4294967295;
|
|
8816
8936
|
const sequence = (flags & 64) != 0 ? this.readSequence(input) : null;
|
|
8817
|
-
let rotation = input.readFloat();
|
|
8937
|
+
let rotation = (flags & 128) != 0 ? input.readFloat() : 0;
|
|
8818
8938
|
let x = input.readFloat();
|
|
8819
8939
|
let y = input.readFloat();
|
|
8820
8940
|
let scaleX = input.readFloat();
|
|
@@ -8973,8 +9093,6 @@ var spine = (() => {
|
|
|
8973
9093
|
return null;
|
|
8974
9094
|
}
|
|
8975
9095
|
readSequence(input) {
|
|
8976
|
-
if (!input.readBoolean())
|
|
8977
|
-
return null;
|
|
8978
9096
|
let sequence = new Sequence(input.readInt(true));
|
|
8979
9097
|
sequence.start = input.readInt(true);
|
|
8980
9098
|
sequence.digits = input.readInt(true);
|
|
@@ -9228,7 +9346,16 @@ var spine = (() => {
|
|
|
9228
9346
|
for (let i = 0, n = input.readInt(true); i < n; i++) {
|
|
9229
9347
|
let boneIndex = input.readInt(true);
|
|
9230
9348
|
for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {
|
|
9231
|
-
let type = input.readByte(), frameCount = input.readInt(true)
|
|
9349
|
+
let type = input.readByte(), frameCount = input.readInt(true);
|
|
9350
|
+
if (type == BONE_INHERIT) {
|
|
9351
|
+
let timeline = new InheritTimeline(frameCount, boneIndex);
|
|
9352
|
+
for (let frame = 0; frame < frameCount; frame++) {
|
|
9353
|
+
timeline.setFrame(frame, input.readFloat(), input.readByte());
|
|
9354
|
+
}
|
|
9355
|
+
timelines.push(timeline);
|
|
9356
|
+
continue;
|
|
9357
|
+
}
|
|
9358
|
+
let bezierCount = input.readInt(true);
|
|
9232
9359
|
switch (type) {
|
|
9233
9360
|
case BONE_ROTATE:
|
|
9234
9361
|
timelines.push(readTimeline1(input, new RotateTimeline(frameCount, bezierCount, boneIndex), 1));
|
|
@@ -9265,20 +9392,21 @@ var spine = (() => {
|
|
|
9265
9392
|
for (let i = 0, n = input.readInt(true); i < n; i++) {
|
|
9266
9393
|
let index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;
|
|
9267
9394
|
let timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index);
|
|
9268
|
-
let
|
|
9395
|
+
let flags = input.readByte();
|
|
9396
|
+
let time = input.readFloat(), mix = (flags & 1) != 0 ? (flags & 2) != 0 ? input.readFloat() : 1 : 0;
|
|
9397
|
+
let softness = (flags & 4) != 0 ? input.readFloat() * scale : 0;
|
|
9269
9398
|
for (let frame = 0, bezier = 0; ; frame++) {
|
|
9270
|
-
|
|
9271
|
-
timeline.setFrame(frame, time, mix, softness, input.readByte(), (flags & 1) != 0, (flags & 2) != 0);
|
|
9399
|
+
timeline.setFrame(frame, time, mix, softness, (flags & 8) != 0 ? 1 : -1, (flags & 16) != 0, (flags & 32) != 0);
|
|
9272
9400
|
if (frame == frameLast)
|
|
9273
9401
|
break;
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9402
|
+
flags = input.readByte();
|
|
9403
|
+
const time2 = input.readFloat(), mix2 = (flags & 1) != 0 ? (flags & 2) != 0 ? input.readFloat() : 1 : 0;
|
|
9404
|
+
const softness2 = (flags & 4) != 0 ? input.readFloat() * scale : 0;
|
|
9405
|
+
if ((flags & 64) != 0) {
|
|
9406
|
+
timeline.setStepped(frame);
|
|
9407
|
+
} else if ((flags & 128) != 0) {
|
|
9408
|
+
setBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1);
|
|
9409
|
+
setBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale);
|
|
9282
9410
|
}
|
|
9283
9411
|
time = time2;
|
|
9284
9412
|
mix = mix2;
|
|
@@ -9389,10 +9517,10 @@ var spine = (() => {
|
|
|
9389
9517
|
timelines.push(readTimeline1(input, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1));
|
|
9390
9518
|
break;
|
|
9391
9519
|
case PHYSICS_WIND:
|
|
9392
|
-
timelines.push(readTimeline1(input, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index),
|
|
9520
|
+
timelines.push(readTimeline1(input, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), 1));
|
|
9393
9521
|
break;
|
|
9394
9522
|
case PHYSICS_GRAVITY:
|
|
9395
|
-
timelines.push(readTimeline1(input, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index),
|
|
9523
|
+
timelines.push(readTimeline1(input, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), 1));
|
|
9396
9524
|
break;
|
|
9397
9525
|
case PHYSICS_MIX:
|
|
9398
9526
|
timelines.push(readTimeline1(input, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1));
|
|
@@ -9700,6 +9828,7 @@ var spine = (() => {
|
|
|
9700
9828
|
var BONE_SHEAR = 7;
|
|
9701
9829
|
var BONE_SHEARX = 8;
|
|
9702
9830
|
var BONE_SHEARY = 9;
|
|
9831
|
+
var BONE_INHERIT = 10;
|
|
9703
9832
|
var SLOT_ATTACHMENT = 0;
|
|
9704
9833
|
var SLOT_RGBA = 1;
|
|
9705
9834
|
var SLOT_RGB = 2;
|
|
@@ -10432,8 +10561,10 @@ var spine = (() => {
|
|
|
10432
10561
|
skeletonData.y = skeletonMap.y;
|
|
10433
10562
|
skeletonData.width = skeletonMap.width;
|
|
10434
10563
|
skeletonData.height = skeletonMap.height;
|
|
10564
|
+
skeletonData.referenceScale = getValue(skeletonMap, "referenceScale", 100) * scale;
|
|
10435
10565
|
skeletonData.fps = skeletonMap.fps;
|
|
10436
|
-
skeletonData.imagesPath = skeletonMap.images;
|
|
10566
|
+
skeletonData.imagesPath = skeletonMap.images ?? null;
|
|
10567
|
+
skeletonData.audioPath = skeletonMap.audio ?? null;
|
|
10437
10568
|
}
|
|
10438
10569
|
if (root.bones) {
|
|
10439
10570
|
for (let i = 0; i < root.bones.length; i++) {
|
|
@@ -10451,7 +10582,7 @@ var spine = (() => {
|
|
|
10451
10582
|
data.scaleY = getValue(boneMap, "scaleY", 1);
|
|
10452
10583
|
data.shearX = getValue(boneMap, "shearX", 0);
|
|
10453
10584
|
data.shearY = getValue(boneMap, "shearY", 0);
|
|
10454
|
-
data.
|
|
10585
|
+
data.inherit = Utils.enumValue(Inherit, getValue(boneMap, "inherit", "Normal"));
|
|
10455
10586
|
data.skinRequired = getValue(boneMap, "skin", false);
|
|
10456
10587
|
let color = getValue(boneMap, "color", null);
|
|
10457
10588
|
if (color)
|
|
@@ -10462,10 +10593,17 @@ var spine = (() => {
|
|
|
10462
10593
|
if (root.slots) {
|
|
10463
10594
|
for (let i = 0; i < root.slots.length; i++) {
|
|
10464
10595
|
let slotMap = root.slots[i];
|
|
10596
|
+
let path = null;
|
|
10597
|
+
let slotName = slotMap.name;
|
|
10598
|
+
const slash = slotName.lastIndexOf("/");
|
|
10599
|
+
if (slash != -1) {
|
|
10600
|
+
path = slotName.substring(0, slash);
|
|
10601
|
+
slotName = slotName.substring(slash + 1);
|
|
10602
|
+
}
|
|
10465
10603
|
let boneData = skeletonData.findBone(slotMap.bone);
|
|
10466
10604
|
if (!boneData)
|
|
10467
|
-
throw new Error(`Couldn't find bone ${slotMap.bone} for slot ${
|
|
10468
|
-
let data = new SlotData(skeletonData.slots.length,
|
|
10605
|
+
throw new Error(`Couldn't find bone ${slotMap.bone} for slot ${slotName}`);
|
|
10606
|
+
let data = new SlotData(skeletonData.slots.length, slotName, boneData);
|
|
10469
10607
|
let color = getValue(slotMap, "color", null);
|
|
10470
10608
|
if (color)
|
|
10471
10609
|
data.color.setFromString(color);
|
|
@@ -10474,6 +10612,8 @@ var spine = (() => {
|
|
|
10474
10612
|
data.darkColor = Color.fromString(dark);
|
|
10475
10613
|
data.attachmentName = getValue(slotMap, "attachment", null);
|
|
10476
10614
|
data.blendMode = Utils.enumValue(BlendMode, getValue(slotMap, "blend", "normal"));
|
|
10615
|
+
data.visible = getValue(slotMap, "visible", true);
|
|
10616
|
+
data.path = path;
|
|
10477
10617
|
skeletonData.slots.push(data);
|
|
10478
10618
|
}
|
|
10479
10619
|
}
|
|
@@ -10588,13 +10728,14 @@ var spine = (() => {
|
|
|
10588
10728
|
data.rotate = getValue(constraintMap, "rotate", 0);
|
|
10589
10729
|
data.scaleX = getValue(constraintMap, "scaleX", 0);
|
|
10590
10730
|
data.shearX = getValue(constraintMap, "shearX", 0);
|
|
10731
|
+
data.limit = getValue(constraintMap, "limit", 5e3) * scale;
|
|
10591
10732
|
data.step = 1 / getValue(constraintMap, "fps", 60);
|
|
10592
10733
|
data.inertia = getValue(constraintMap, "inertia", 1);
|
|
10593
10734
|
data.strength = getValue(constraintMap, "strength", 100);
|
|
10594
10735
|
data.damping = getValue(constraintMap, "damping", 1);
|
|
10595
10736
|
data.massInverse = 1 / getValue(constraintMap, "mass", 1);
|
|
10596
|
-
data.wind = getValue(constraintMap, "wind", 0)
|
|
10597
|
-
data.gravity = getValue(constraintMap, "gravity", 0)
|
|
10737
|
+
data.wind = getValue(constraintMap, "wind", 0);
|
|
10738
|
+
data.gravity = getValue(constraintMap, "gravity", 0);
|
|
10598
10739
|
data.mix = getValue(constraintMap, "mix", 1);
|
|
10599
10740
|
data.inertiaGlobal = getValue(constraintMap, "inertiaGlobal", false);
|
|
10600
10741
|
data.strengthGlobal = getValue(constraintMap, "strengthGlobal", false);
|
|
@@ -11039,6 +11180,13 @@ var spine = (() => {
|
|
|
11039
11180
|
} else if (timelineName === "sheary") {
|
|
11040
11181
|
let timeline = new ShearYTimeline(frames, frames, boneIndex);
|
|
11041
11182
|
timelines.push(readTimeline12(timelineMap, timeline, 0, 1));
|
|
11183
|
+
} else if (timelineName === "inherit") {
|
|
11184
|
+
let timeline = new InheritTimeline(frames, bone.index);
|
|
11185
|
+
for (let frame = 0; frame < timelineMap.length; frame++) {
|
|
11186
|
+
let aFrame = timelineMap[frame];
|
|
11187
|
+
timeline.setFrame(frame, getValue(aFrame, "time", 0), Utils.enumValue(Inherit, getValue(aFrame, "inherit", "Normal")));
|
|
11188
|
+
}
|
|
11189
|
+
timelines.push(timeline);
|
|
11042
11190
|
}
|
|
11043
11191
|
}
|
|
11044
11192
|
}
|
|
@@ -11210,7 +11358,6 @@ var spine = (() => {
|
|
|
11210
11358
|
continue;
|
|
11211
11359
|
}
|
|
11212
11360
|
let timeline;
|
|
11213
|
-
let timelineScale = 1;
|
|
11214
11361
|
if (timelineName == "inertia")
|
|
11215
11362
|
timeline = new PhysicsConstraintInertiaTimeline(frames, frames, constraintIndex);
|
|
11216
11363
|
else if (timelineName == "strength")
|
|
@@ -11219,17 +11366,15 @@ var spine = (() => {
|
|
|
11219
11366
|
timeline = new PhysicsConstraintDampingTimeline(frames, frames, constraintIndex);
|
|
11220
11367
|
else if (timelineName == "mass")
|
|
11221
11368
|
timeline = new PhysicsConstraintMassTimeline(frames, frames, constraintIndex);
|
|
11222
|
-
else if (timelineName == "wind")
|
|
11369
|
+
else if (timelineName == "wind")
|
|
11223
11370
|
timeline = new PhysicsConstraintWindTimeline(frames, frames, constraintIndex);
|
|
11224
|
-
|
|
11225
|
-
} else if (timelineName == "gravity") {
|
|
11371
|
+
else if (timelineName == "gravity")
|
|
11226
11372
|
timeline = new PhysicsConstraintGravityTimeline(frames, frames, constraintIndex);
|
|
11227
|
-
|
|
11228
|
-
} else if (timelineName == "mix")
|
|
11373
|
+
else if (timelineName == "mix")
|
|
11229
11374
|
timeline = new PhysicsConstraintMixTimeline(frames, frames, constraintIndex);
|
|
11230
11375
|
else
|
|
11231
11376
|
continue;
|
|
11232
|
-
timelines.push(readTimeline12(timelineMap, timeline, 0,
|
|
11377
|
+
timelines.push(readTimeline12(timelineMap, timeline, 0, 1));
|
|
11233
11378
|
}
|
|
11234
11379
|
}
|
|
11235
11380
|
}
|