@esotericsoftware/spine-webgl 4.2.56 → 4.2.57
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/iife/spine-webgl.js
CHANGED
|
@@ -1593,6 +1593,11 @@ var spine = (() => {
|
|
|
1593
1593
|
let bone = skeleton.bones[this.boneIndex];
|
|
1594
1594
|
if (!bone.active)
|
|
1595
1595
|
return;
|
|
1596
|
+
if (direction == 1 /* mixOut */) {
|
|
1597
|
+
if (blend == 0 /* setup */)
|
|
1598
|
+
bone.inherit = bone.data.inherit;
|
|
1599
|
+
return;
|
|
1600
|
+
}
|
|
1596
1601
|
let frames = this.frames;
|
|
1597
1602
|
if (time < frames[0]) {
|
|
1598
1603
|
if (blend == 0 /* setup */ || blend == 1 /* first */)
|
|
@@ -6454,8 +6459,9 @@ var spine = (() => {
|
|
|
6454
6459
|
q = -(c1 + q) * 0.5;
|
|
6455
6460
|
let r0 = q / c2, r1 = c / q;
|
|
6456
6461
|
let r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;
|
|
6457
|
-
|
|
6458
|
-
|
|
6462
|
+
r0 = dd - r * r;
|
|
6463
|
+
if (r0 >= 0) {
|
|
6464
|
+
y = Math.sqrt(r0) * bendDir;
|
|
6459
6465
|
a1 = ta - Math.atan2(y, r);
|
|
6460
6466
|
a2 = Math.atan2(y / psy, (r - l1) / psx);
|
|
6461
6467
|
break outer;
|
|
@@ -7138,25 +7144,28 @@ var spine = (() => {
|
|
|
7138
7144
|
case 1 /* reset */:
|
|
7139
7145
|
this.reset();
|
|
7140
7146
|
case 2 /* update */:
|
|
7147
|
+
const skeleton = this.skeleton;
|
|
7141
7148
|
const delta = Math.max(this.skeleton.time - this.lastTime, 0);
|
|
7142
7149
|
this.remaining += delta;
|
|
7143
|
-
this.lastTime =
|
|
7150
|
+
this.lastTime = skeleton.time;
|
|
7144
7151
|
const bx = bone.worldX, by = bone.worldY;
|
|
7145
7152
|
if (this._reset) {
|
|
7146
7153
|
this._reset = false;
|
|
7147
7154
|
this.ux = bx;
|
|
7148
7155
|
this.uy = by;
|
|
7149
7156
|
} else {
|
|
7150
|
-
let a = this.remaining, i = this.inertia,
|
|
7157
|
+
let a = this.remaining, i = this.inertia, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1;
|
|
7158
|
+
let qx = this.data.limit * delta, qy = qx * Math.abs(skeleton.scaleY);
|
|
7159
|
+
qx *= Math.abs(skeleton.scaleX);
|
|
7151
7160
|
if (x || y) {
|
|
7152
7161
|
if (x) {
|
|
7153
7162
|
const u = (this.ux - bx) * i;
|
|
7154
|
-
this.xOffset += u >
|
|
7163
|
+
this.xOffset += u > qx ? qx : u < -qx ? -qx : u;
|
|
7155
7164
|
this.ux = bx;
|
|
7156
7165
|
}
|
|
7157
7166
|
if (y) {
|
|
7158
7167
|
const u = (this.uy - by) * i;
|
|
7159
|
-
this.yOffset += u >
|
|
7168
|
+
this.yOffset += u > qy ? qy : u < -qy ? -qy : u;
|
|
7160
7169
|
this.uy = by;
|
|
7161
7170
|
}
|
|
7162
7171
|
if (a >= t) {
|
|
@@ -7184,14 +7193,14 @@ var spine = (() => {
|
|
|
7184
7193
|
if (rotateOrShearX || scaleX) {
|
|
7185
7194
|
let ca = Math.atan2(bone.c, bone.a), c = 0, s = 0, mr = 0;
|
|
7186
7195
|
let dx = this.cx - bone.worldX, dy = this.cy - bone.worldY;
|
|
7187
|
-
if (dx >
|
|
7188
|
-
dx =
|
|
7189
|
-
else if (dx < -
|
|
7190
|
-
dx = -
|
|
7191
|
-
if (dy >
|
|
7192
|
-
dy =
|
|
7193
|
-
else if (dy < -
|
|
7194
|
-
dy = -
|
|
7196
|
+
if (dx > qx)
|
|
7197
|
+
dx = qx;
|
|
7198
|
+
else if (dx < -qx)
|
|
7199
|
+
dx = -qx;
|
|
7200
|
+
if (dy > qy)
|
|
7201
|
+
dy = qy;
|
|
7202
|
+
else if (dy < -qy)
|
|
7203
|
+
dy = -qy;
|
|
7195
7204
|
if (rotateOrShearX) {
|
|
7196
7205
|
mr = (this.data.rotate + this.data.shearX) * mix;
|
|
7197
7206
|
let r = Math.atan2(dy + this.ty, dx + this.tx) - ca - this.rotateOffset * mr;
|
|
@@ -10352,7 +10361,28 @@ var spine = (() => {
|
|
|
10352
10361
|
isClipping() {
|
|
10353
10362
|
return this.clipAttachment != null;
|
|
10354
10363
|
}
|
|
10355
|
-
clipTriangles(vertices,
|
|
10364
|
+
clipTriangles(vertices, verticesLengthOrTriangles, trianglesOrTrianglesLength, trianglesLengthOrUvs, uvsOrLight, lightOrDark, darkOrTwoColor, twoColorParam) {
|
|
10365
|
+
let triangles;
|
|
10366
|
+
let trianglesLength;
|
|
10367
|
+
let uvs;
|
|
10368
|
+
let light;
|
|
10369
|
+
let dark;
|
|
10370
|
+
let twoColor;
|
|
10371
|
+
if (typeof verticesLengthOrTriangles === "number") {
|
|
10372
|
+
triangles = trianglesOrTrianglesLength;
|
|
10373
|
+
trianglesLength = trianglesLengthOrUvs;
|
|
10374
|
+
uvs = uvsOrLight;
|
|
10375
|
+
light = lightOrDark;
|
|
10376
|
+
dark = darkOrTwoColor;
|
|
10377
|
+
twoColor = twoColorParam;
|
|
10378
|
+
} else {
|
|
10379
|
+
triangles = verticesLengthOrTriangles;
|
|
10380
|
+
trianglesLength = trianglesOrTrianglesLength;
|
|
10381
|
+
uvs = trianglesLengthOrUvs;
|
|
10382
|
+
light = uvsOrLight;
|
|
10383
|
+
dark = lightOrDark;
|
|
10384
|
+
twoColor = darkOrTwoColor;
|
|
10385
|
+
}
|
|
10356
10386
|
if (uvs && light && dark && typeof twoColor === "boolean")
|
|
10357
10387
|
this.clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor);
|
|
10358
10388
|
else
|