@liquidcars/atlas 0.1.39 → 0.1.41
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/README.md +32 -3
- package/dist/liquidcars-atlas.js +993 -739
- package/dist/liquidcars-atlas.js.map +1 -1
- package/package.json +1 -1
- package/src/liquidcars-atlas.js +318 -2
package/dist/liquidcars-atlas.js
CHANGED
|
@@ -42,31 +42,31 @@ function M(e, t) {
|
|
|
42
42
|
function N(e, t, n, r, i) {
|
|
43
43
|
return r + (e - t) * (i - r) / (n - t);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function ee(e, t, n) {
|
|
46
46
|
return e === t ? 0 : (n - e) / (t - e);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function P(e, t, n) {
|
|
49
49
|
return (1 - n) * e + n * t;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
51
|
+
function F(e, t, n, r) {
|
|
52
|
+
return P(e, t, 1 - Math.exp(-n * r));
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function te(e, t = 1) {
|
|
55
55
|
return t - Math.abs(M(e, t * 2) - t);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function ne(e, t, n) {
|
|
58
58
|
return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t), e * e * (3 - 2 * e));
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function I(e, t, n) {
|
|
61
61
|
return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t), e * e * e * (e * (e * 6 - 15) + 10));
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function re(e, t) {
|
|
64
64
|
return e + Math.floor(Math.random() * (t - e + 1));
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function ie(e, t) {
|
|
67
67
|
return e + Math.random() * (t - e);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function L(e) {
|
|
70
70
|
return e * (.5 - Math.random());
|
|
71
71
|
}
|
|
72
72
|
function R(e) {
|
|
@@ -113,7 +113,7 @@ function le(e, t, n, r, i) {
|
|
|
113
113
|
default: console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + i);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function ue(e, t) {
|
|
117
117
|
switch (t.constructor) {
|
|
118
118
|
case Float32Array: return e;
|
|
119
119
|
case Uint32Array: return e / 4294967295;
|
|
@@ -125,7 +125,7 @@ function B(e, t) {
|
|
|
125
125
|
default: throw Error("Invalid component type.");
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function B(e, t) {
|
|
129
129
|
switch (t.constructor) {
|
|
130
130
|
case Float32Array: return e;
|
|
131
131
|
case Uint32Array: return Math.round(e * 4294967295);
|
|
@@ -144,15 +144,15 @@ var de = {
|
|
|
144
144
|
clamp: j,
|
|
145
145
|
euclideanModulo: M,
|
|
146
146
|
mapLinear: N,
|
|
147
|
-
inverseLerp:
|
|
148
|
-
lerp:
|
|
149
|
-
damp:
|
|
150
|
-
pingpong:
|
|
151
|
-
smoothstep:
|
|
152
|
-
smootherstep:
|
|
153
|
-
randInt:
|
|
154
|
-
randFloat:
|
|
155
|
-
randFloatSpread:
|
|
147
|
+
inverseLerp: ee,
|
|
148
|
+
lerp: P,
|
|
149
|
+
damp: F,
|
|
150
|
+
pingpong: te,
|
|
151
|
+
smoothstep: ne,
|
|
152
|
+
smootherstep: I,
|
|
153
|
+
randInt: re,
|
|
154
|
+
randFloat: ie,
|
|
155
|
+
randFloatSpread: L,
|
|
156
156
|
seededRandom: R,
|
|
157
157
|
degToRad: z,
|
|
158
158
|
radToDeg: ae,
|
|
@@ -160,8 +160,8 @@ var de = {
|
|
|
160
160
|
ceilPowerOfTwo: se,
|
|
161
161
|
floorPowerOfTwo: ce,
|
|
162
162
|
setQuaternionFromProperEuler: le,
|
|
163
|
-
normalize:
|
|
164
|
-
denormalize:
|
|
163
|
+
normalize: B,
|
|
164
|
+
denormalize: ue
|
|
165
165
|
}, V = class e {
|
|
166
166
|
constructor(t = 0, n = 0) {
|
|
167
167
|
e.prototype.isVector2 = !0, this.x = t, this.y = n;
|
|
@@ -1975,8 +1975,8 @@ var Xe = /*@__PURE__*/ new Fe(), Ze = /*@__PURE__*/ new U(), Qe = /*@__PURE__*/
|
|
|
1975
1975
|
return this.multiplyMatrices(e, this);
|
|
1976
1976
|
}
|
|
1977
1977
|
multiplyMatrices(e, t) {
|
|
1978
|
-
let n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[4], s = n[8], c = n[12], l = n[1], u = n[5], d = n[9], f = n[13], p = n[2], m = n[6], h = n[10], g = n[14], _ = n[3], v = n[7], y = n[11], b = n[15], x = r[0], S = r[4], C = r[8], w = r[12], T = r[1], E = r[5], D = r[9], O = r[13], k = r[2], A = r[6], j = r[10], M = r[14], N = r[3],
|
|
1979
|
-
return i[0] = a * x + o * T + s * k + c * N, i[4] = a * S + o * E + s * A + c *
|
|
1978
|
+
let n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[4], s = n[8], c = n[12], l = n[1], u = n[5], d = n[9], f = n[13], p = n[2], m = n[6], h = n[10], g = n[14], _ = n[3], v = n[7], y = n[11], b = n[15], x = r[0], S = r[4], C = r[8], w = r[12], T = r[1], E = r[5], D = r[9], O = r[13], k = r[2], A = r[6], j = r[10], M = r[14], N = r[3], ee = r[7], P = r[11], F = r[15];
|
|
1979
|
+
return i[0] = a * x + o * T + s * k + c * N, i[4] = a * S + o * E + s * A + c * ee, i[8] = a * C + o * D + s * j + c * P, i[12] = a * w + o * O + s * M + c * F, i[1] = l * x + u * T + d * k + f * N, i[5] = l * S + u * E + d * A + f * ee, i[9] = l * C + u * D + d * j + f * P, i[13] = l * w + u * O + d * M + f * F, i[2] = p * x + m * T + h * k + g * N, i[6] = p * S + m * E + h * A + g * ee, i[10] = p * C + m * D + h * j + g * P, i[14] = p * w + m * O + h * M + g * F, i[3] = _ * x + v * T + y * k + b * N, i[7] = _ * S + v * E + y * A + b * ee, i[11] = _ * C + v * D + y * j + b * P, i[15] = _ * w + v * O + y * M + b * F, this;
|
|
1980
1980
|
}
|
|
1981
1981
|
multiplyScalar(e) {
|
|
1982
1982
|
let t = this.elements;
|
|
@@ -2854,7 +2854,7 @@ var X = class {
|
|
|
2854
2854
|
}
|
|
2855
2855
|
lerpHSL(e, t) {
|
|
2856
2856
|
this.getHSL(Zt), e.getHSL(Qt);
|
|
2857
|
-
let n =
|
|
2857
|
+
let n = P(Zt.h, Qt.h, t), r = P(Zt.s, Qt.s, t), i = P(Zt.l, Qt.l, t);
|
|
2858
2858
|
return this.setHSL(n, r, i), this;
|
|
2859
2859
|
}
|
|
2860
2860
|
setFromVector3(e) {
|
|
@@ -3020,47 +3020,47 @@ var tn = 0, nn = class extends T {
|
|
|
3020
3020
|
}
|
|
3021
3021
|
getComponent(e, t) {
|
|
3022
3022
|
let n = this.array[e * this.itemSize + t];
|
|
3023
|
-
return this.normalized && (n =
|
|
3023
|
+
return this.normalized && (n = ue(n, this.array)), n;
|
|
3024
3024
|
}
|
|
3025
3025
|
setComponent(e, t, n) {
|
|
3026
|
-
return this.normalized && (n =
|
|
3026
|
+
return this.normalized && (n = B(n, this.array)), this.array[e * this.itemSize + t] = n, this;
|
|
3027
3027
|
}
|
|
3028
3028
|
getX(e) {
|
|
3029
3029
|
let t = this.array[e * this.itemSize];
|
|
3030
|
-
return this.normalized && (t =
|
|
3030
|
+
return this.normalized && (t = ue(t, this.array)), t;
|
|
3031
3031
|
}
|
|
3032
3032
|
setX(e, t) {
|
|
3033
|
-
return this.normalized && (t =
|
|
3033
|
+
return this.normalized && (t = B(t, this.array)), this.array[e * this.itemSize] = t, this;
|
|
3034
3034
|
}
|
|
3035
3035
|
getY(e) {
|
|
3036
3036
|
let t = this.array[e * this.itemSize + 1];
|
|
3037
|
-
return this.normalized && (t =
|
|
3037
|
+
return this.normalized && (t = ue(t, this.array)), t;
|
|
3038
3038
|
}
|
|
3039
3039
|
setY(e, t) {
|
|
3040
|
-
return this.normalized && (t =
|
|
3040
|
+
return this.normalized && (t = B(t, this.array)), this.array[e * this.itemSize + 1] = t, this;
|
|
3041
3041
|
}
|
|
3042
3042
|
getZ(e) {
|
|
3043
3043
|
let t = this.array[e * this.itemSize + 2];
|
|
3044
|
-
return this.normalized && (t =
|
|
3044
|
+
return this.normalized && (t = ue(t, this.array)), t;
|
|
3045
3045
|
}
|
|
3046
3046
|
setZ(e, t) {
|
|
3047
|
-
return this.normalized && (t =
|
|
3047
|
+
return this.normalized && (t = B(t, this.array)), this.array[e * this.itemSize + 2] = t, this;
|
|
3048
3048
|
}
|
|
3049
3049
|
getW(e) {
|
|
3050
3050
|
let t = this.array[e * this.itemSize + 3];
|
|
3051
|
-
return this.normalized && (t =
|
|
3051
|
+
return this.normalized && (t = ue(t, this.array)), t;
|
|
3052
3052
|
}
|
|
3053
3053
|
setW(e, t) {
|
|
3054
|
-
return this.normalized && (t =
|
|
3054
|
+
return this.normalized && (t = B(t, this.array)), this.array[e * this.itemSize + 3] = t, this;
|
|
3055
3055
|
}
|
|
3056
3056
|
setXY(e, t, n) {
|
|
3057
|
-
return e *= this.itemSize, this.normalized && (t =
|
|
3057
|
+
return e *= this.itemSize, this.normalized && (t = B(t, this.array), n = B(n, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this;
|
|
3058
3058
|
}
|
|
3059
3059
|
setXYZ(e, t, n, r) {
|
|
3060
|
-
return e *= this.itemSize, this.normalized && (t =
|
|
3060
|
+
return e *= this.itemSize, this.normalized && (t = B(t, this.array), n = B(n, this.array), r = B(r, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this;
|
|
3061
3061
|
}
|
|
3062
3062
|
setXYZW(e, t, n, r, i) {
|
|
3063
|
-
return e *= this.itemSize, this.normalized && (t =
|
|
3063
|
+
return e *= this.itemSize, this.normalized && (t = B(t, this.array), n = B(n, this.array), r = B(r, this.array), i = B(i, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this.array[e + 3] = i, this;
|
|
3064
3064
|
}
|
|
3065
3065
|
onUpload(e) {
|
|
3066
3066
|
return this.onUploadCallback = e, this;
|
|
@@ -5386,22 +5386,22 @@ var Ji = class e extends vn {
|
|
|
5386
5386
|
}
|
|
5387
5387
|
let j = [];
|
|
5388
5388
|
for (let e = 0, t = D.length, n = t - 1, r = e + 1; e < t; e++, n++, r++) n === t && (n = 0), r === t && (r = 0), j[e] = A(D[e], D[n], D[r]);
|
|
5389
|
-
let M = [], N,
|
|
5389
|
+
let M = [], N, ee = j.concat();
|
|
5390
5390
|
for (let e = 0, t = E; e < t; e++) {
|
|
5391
5391
|
let t = w[e];
|
|
5392
5392
|
N = [];
|
|
5393
5393
|
for (let e = 0, n = t.length, r = n - 1, i = e + 1; e < n; e++, r++, i++) r === n && (r = 0), i === n && (i = 0), N[e] = A(t[e], t[r], t[i]);
|
|
5394
|
-
M.push(N),
|
|
5394
|
+
M.push(N), ee = ee.concat(N);
|
|
5395
5395
|
}
|
|
5396
|
-
let
|
|
5397
|
-
if (p === 0)
|
|
5396
|
+
let P;
|
|
5397
|
+
if (p === 0) P = Gi.triangulateShape(D, w);
|
|
5398
5398
|
else {
|
|
5399
5399
|
let e = [], t = [];
|
|
5400
5400
|
for (let n = 0; n < p; n++) {
|
|
5401
5401
|
let r = n / p, i = u * Math.cos(r * Math.PI / 2), a = d * Math.sin(r * Math.PI / 2) + f;
|
|
5402
5402
|
for (let t = 0, n = D.length; t < n; t++) {
|
|
5403
5403
|
let n = O(D[t], j[t], a);
|
|
5404
|
-
|
|
5404
|
+
ie(n.x, n.y, -i), r === 0 && e.push(n);
|
|
5405
5405
|
}
|
|
5406
5406
|
for (let e = 0, n = E; e < n; e++) {
|
|
5407
5407
|
let n = w[e];
|
|
@@ -5409,73 +5409,73 @@ var Ji = class e extends vn {
|
|
|
5409
5409
|
let o = [];
|
|
5410
5410
|
for (let e = 0, t = n.length; e < t; e++) {
|
|
5411
5411
|
let t = O(n[e], N[e], a);
|
|
5412
|
-
|
|
5412
|
+
ie(t.x, t.y, -i), r === 0 && o.push(t);
|
|
5413
5413
|
}
|
|
5414
5414
|
r === 0 && t.push(o);
|
|
5415
5415
|
}
|
|
5416
5416
|
}
|
|
5417
|
-
|
|
5417
|
+
P = Gi.triangulateShape(e, t);
|
|
5418
5418
|
}
|
|
5419
|
-
let
|
|
5419
|
+
let F = P.length, te = d + f;
|
|
5420
5420
|
for (let e = 0; e < k; e++) {
|
|
5421
|
-
let t = l ? O(C[e],
|
|
5422
|
-
_ ? (b.copy(v.normals[0]).multiplyScalar(t.x), y.copy(v.binormals[0]).multiplyScalar(t.y), x.copy(g[0]).add(b).add(y),
|
|
5421
|
+
let t = l ? O(C[e], ee[e], te) : C[e];
|
|
5422
|
+
_ ? (b.copy(v.normals[0]).multiplyScalar(t.x), y.copy(v.binormals[0]).multiplyScalar(t.y), x.copy(g[0]).add(b).add(y), ie(x.x, x.y, x.z)) : ie(t.x, t.y, 0);
|
|
5423
5423
|
}
|
|
5424
5424
|
for (let e = 1; e <= s; e++) for (let t = 0; t < k; t++) {
|
|
5425
|
-
let n = l ? O(C[t],
|
|
5426
|
-
_ ? (b.copy(v.normals[e]).multiplyScalar(n.x), y.copy(v.binormals[e]).multiplyScalar(n.y), x.copy(g[e]).add(b).add(y),
|
|
5425
|
+
let n = l ? O(C[t], ee[t], te) : C[t];
|
|
5426
|
+
_ ? (b.copy(v.normals[e]).multiplyScalar(n.x), y.copy(v.binormals[e]).multiplyScalar(n.y), x.copy(g[e]).add(b).add(y), ie(x.x, x.y, x.z)) : ie(n.x, n.y, c / s * e);
|
|
5427
5427
|
}
|
|
5428
5428
|
for (let e = p - 1; e >= 0; e--) {
|
|
5429
5429
|
let t = e / p, n = u * Math.cos(t * Math.PI / 2), r = d * Math.sin(t * Math.PI / 2) + f;
|
|
5430
5430
|
for (let e = 0, t = D.length; e < t; e++) {
|
|
5431
5431
|
let t = O(D[e], j[e], r);
|
|
5432
|
-
|
|
5432
|
+
ie(t.x, t.y, c + n);
|
|
5433
5433
|
}
|
|
5434
5434
|
for (let e = 0, t = w.length; e < t; e++) {
|
|
5435
5435
|
let t = w[e];
|
|
5436
5436
|
N = M[e];
|
|
5437
5437
|
for (let e = 0, i = t.length; e < i; e++) {
|
|
5438
5438
|
let i = O(t[e], N[e], r);
|
|
5439
|
-
_ ?
|
|
5439
|
+
_ ? ie(i.x, i.y + g[s - 1].y, g[s - 1].x + n) : ie(i.x, i.y, c + n);
|
|
5440
5440
|
}
|
|
5441
5441
|
}
|
|
5442
5442
|
}
|
|
5443
|
-
|
|
5444
|
-
function
|
|
5443
|
+
ne(), I();
|
|
5444
|
+
function ne() {
|
|
5445
5445
|
let e = r.length / 3;
|
|
5446
5446
|
if (l) {
|
|
5447
5447
|
let e = 0, t = k * e;
|
|
5448
|
-
for (let e = 0; e <
|
|
5449
|
-
let n =
|
|
5450
|
-
|
|
5448
|
+
for (let e = 0; e < F; e++) {
|
|
5449
|
+
let n = P[e];
|
|
5450
|
+
L(n[2] + t, n[1] + t, n[0] + t);
|
|
5451
5451
|
}
|
|
5452
5452
|
e = s + p * 2, t = k * e;
|
|
5453
|
-
for (let e = 0; e <
|
|
5454
|
-
let n =
|
|
5455
|
-
|
|
5453
|
+
for (let e = 0; e < F; e++) {
|
|
5454
|
+
let n = P[e];
|
|
5455
|
+
L(n[0] + t, n[1] + t, n[2] + t);
|
|
5456
5456
|
}
|
|
5457
5457
|
} else {
|
|
5458
|
-
for (let e = 0; e <
|
|
5459
|
-
let t =
|
|
5460
|
-
|
|
5458
|
+
for (let e = 0; e < F; e++) {
|
|
5459
|
+
let t = P[e];
|
|
5460
|
+
L(t[2], t[1], t[0]);
|
|
5461
5461
|
}
|
|
5462
|
-
for (let e = 0; e <
|
|
5463
|
-
let t =
|
|
5464
|
-
|
|
5462
|
+
for (let e = 0; e < F; e++) {
|
|
5463
|
+
let t = P[e];
|
|
5464
|
+
L(t[0] + k * s, t[1] + k * s, t[2] + k * s);
|
|
5465
5465
|
}
|
|
5466
5466
|
}
|
|
5467
5467
|
n.addGroup(e, r.length / 3 - e, 0);
|
|
5468
5468
|
}
|
|
5469
|
-
function
|
|
5469
|
+
function I() {
|
|
5470
5470
|
let e = r.length / 3, t = 0;
|
|
5471
|
-
|
|
5471
|
+
re(D, t), t += D.length;
|
|
5472
5472
|
for (let e = 0, n = w.length; e < n; e++) {
|
|
5473
5473
|
let n = w[e];
|
|
5474
|
-
|
|
5474
|
+
re(n, t), t += n.length;
|
|
5475
5475
|
}
|
|
5476
5476
|
n.addGroup(e, r.length / 3 - e, 1);
|
|
5477
5477
|
}
|
|
5478
|
-
function
|
|
5478
|
+
function re(e, t) {
|
|
5479
5479
|
let n = e.length;
|
|
5480
5480
|
for (; --n >= 0;) {
|
|
5481
5481
|
let r = n, i = n - 1;
|
|
@@ -5486,10 +5486,10 @@ var Ji = class e extends vn {
|
|
|
5486
5486
|
}
|
|
5487
5487
|
}
|
|
5488
5488
|
}
|
|
5489
|
-
function
|
|
5489
|
+
function ie(e, t, n) {
|
|
5490
5490
|
a.push(e), a.push(t), a.push(n);
|
|
5491
5491
|
}
|
|
5492
|
-
function
|
|
5492
|
+
function L(e, t, i) {
|
|
5493
5493
|
z(e), z(t), z(i);
|
|
5494
5494
|
let a = r.length / 3, o = h.generateTopUV(n, r, a - 3, a - 2, a - 1);
|
|
5495
5495
|
ae(o[0]), ae(o[1]), ae(o[2]);
|
|
@@ -6630,8 +6630,94 @@ function Ka(e, t, n, r) {
|
|
|
6630
6630
|
for (let e = 0, i = r.length; e < i; e++) Ka(r[e], t, n, !0);
|
|
6631
6631
|
}
|
|
6632
6632
|
}
|
|
6633
|
-
|
|
6634
|
-
|
|
6633
|
+
var qa = class {
|
|
6634
|
+
constructor() {
|
|
6635
|
+
this.type = "ShapePath", this.color = new X(), this.subPaths = [], this.currentPath = null;
|
|
6636
|
+
}
|
|
6637
|
+
moveTo(e, t) {
|
|
6638
|
+
return this.currentPath = new li(), this.subPaths.push(this.currentPath), this.currentPath.moveTo(e, t), this;
|
|
6639
|
+
}
|
|
6640
|
+
lineTo(e, t) {
|
|
6641
|
+
return this.currentPath.lineTo(e, t), this;
|
|
6642
|
+
}
|
|
6643
|
+
quadraticCurveTo(e, t, n, r) {
|
|
6644
|
+
return this.currentPath.quadraticCurveTo(e, t, n, r), this;
|
|
6645
|
+
}
|
|
6646
|
+
bezierCurveTo(e, t, n, r, i, a) {
|
|
6647
|
+
return this.currentPath.bezierCurveTo(e, t, n, r, i, a), this;
|
|
6648
|
+
}
|
|
6649
|
+
splineThru(e) {
|
|
6650
|
+
return this.currentPath.splineThru(e), this;
|
|
6651
|
+
}
|
|
6652
|
+
toShapes(e) {
|
|
6653
|
+
function t(e) {
|
|
6654
|
+
let t = [];
|
|
6655
|
+
for (let n = 0, r = e.length; n < r; n++) {
|
|
6656
|
+
let r = e[n], i = new ui();
|
|
6657
|
+
i.curves = r.curves, t.push(i);
|
|
6658
|
+
}
|
|
6659
|
+
return t;
|
|
6660
|
+
}
|
|
6661
|
+
function n(e, t) {
|
|
6662
|
+
let n = t.length, r = !1;
|
|
6663
|
+
for (let i = n - 1, a = 0; a < n; i = a++) {
|
|
6664
|
+
let n = t[i], o = t[a], s = o.x - n.x, c = o.y - n.y;
|
|
6665
|
+
if (Math.abs(c) > 2 ** -52) {
|
|
6666
|
+
if (c < 0 && (n = t[a], s = -s, o = t[i], c = -c), e.y < n.y || e.y > o.y) continue;
|
|
6667
|
+
if (e.y === n.y) {
|
|
6668
|
+
if (e.x === n.x) return !0;
|
|
6669
|
+
} else {
|
|
6670
|
+
let t = c * (e.x - n.x) - s * (e.y - n.y);
|
|
6671
|
+
if (t === 0) return !0;
|
|
6672
|
+
if (t < 0) continue;
|
|
6673
|
+
r = !r;
|
|
6674
|
+
}
|
|
6675
|
+
} else {
|
|
6676
|
+
if (e.y !== n.y) continue;
|
|
6677
|
+
if (o.x <= e.x && e.x <= n.x || n.x <= e.x && e.x <= o.x) return !0;
|
|
6678
|
+
}
|
|
6679
|
+
}
|
|
6680
|
+
return r;
|
|
6681
|
+
}
|
|
6682
|
+
let r = Gi.isClockWise, i = this.subPaths;
|
|
6683
|
+
if (i.length === 0) return [];
|
|
6684
|
+
let a, o, s, c = [];
|
|
6685
|
+
if (i.length === 1) return o = i[0], s = new ui(), s.curves = o.curves, c.push(s), c;
|
|
6686
|
+
let l = !r(i[0].getPoints());
|
|
6687
|
+
l = e ? !l : l;
|
|
6688
|
+
let u = [], d = [], f = [], p = 0, m;
|
|
6689
|
+
d[p] = void 0, f[p] = [];
|
|
6690
|
+
for (let t = 0, n = i.length; t < n; t++) o = i[t], m = o.getPoints(), a = r(m), a = e ? !a : a, a ? (!l && d[p] && p++, d[p] = {
|
|
6691
|
+
s: new ui(),
|
|
6692
|
+
p: m
|
|
6693
|
+
}, d[p].s.curves = o.curves, l && p++, f[p] = []) : f[p].push({
|
|
6694
|
+
h: o,
|
|
6695
|
+
p: m[0]
|
|
6696
|
+
});
|
|
6697
|
+
if (!d[0]) return t(i);
|
|
6698
|
+
if (d.length > 1) {
|
|
6699
|
+
let e = !1, t = 0;
|
|
6700
|
+
for (let e = 0, t = d.length; e < t; e++) u[e] = [];
|
|
6701
|
+
for (let r = 0, i = d.length; r < i; r++) {
|
|
6702
|
+
let i = f[r];
|
|
6703
|
+
for (let a = 0; a < i.length; a++) {
|
|
6704
|
+
let o = i[a], s = !0;
|
|
6705
|
+
for (let i = 0; i < d.length; i++) n(o.p, d[i].p) && (r !== i && t++, s ? (s = !1, u[i].push(o)) : e = !0);
|
|
6706
|
+
s && u[r].push(o);
|
|
6707
|
+
}
|
|
6708
|
+
}
|
|
6709
|
+
t > 0 && e === !1 && (f = u);
|
|
6710
|
+
}
|
|
6711
|
+
let h;
|
|
6712
|
+
for (let e = 0, t = d.length; e < t; e++) {
|
|
6713
|
+
s = d[e].s, c.push(s), h = f[e];
|
|
6714
|
+
for (let e = 0, t = h.length; e < t; e++) s.holes.push(h[e].h);
|
|
6715
|
+
}
|
|
6716
|
+
return c;
|
|
6717
|
+
}
|
|
6718
|
+
};
|
|
6719
|
+
function Ja(e, t, n, r) {
|
|
6720
|
+
let i = Ya(r);
|
|
6635
6721
|
switch (n) {
|
|
6636
6722
|
case 1021: return e * t;
|
|
6637
6723
|
case 1028: return e * t / i.components * i.byteLength;
|
|
@@ -6676,7 +6762,7 @@ function qa(e, t, n, r) {
|
|
|
6676
6762
|
}
|
|
6677
6763
|
throw Error(`Unable to determine texture byte length for ${n} format.`);
|
|
6678
6764
|
}
|
|
6679
|
-
function
|
|
6765
|
+
function Ya(e) {
|
|
6680
6766
|
switch (e) {
|
|
6681
6767
|
case o:
|
|
6682
6768
|
case 1010: return {
|
|
@@ -6711,7 +6797,7 @@ function Ja(e) {
|
|
|
6711
6797
|
typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { revision: "180" } })), typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = "180");
|
|
6712
6798
|
//#endregion
|
|
6713
6799
|
//#region src/three.module.js
|
|
6714
|
-
function
|
|
6800
|
+
function Xa() {
|
|
6715
6801
|
let e = null, t = !1, n = null, r = null;
|
|
6716
6802
|
function i(t, a) {
|
|
6717
6803
|
n(t, a), r = e.requestAnimationFrame(i);
|
|
@@ -6731,7 +6817,7 @@ function Ya() {
|
|
|
6731
6817
|
}
|
|
6732
6818
|
};
|
|
6733
6819
|
}
|
|
6734
|
-
function
|
|
6820
|
+
function Za(e) {
|
|
6735
6821
|
let t = /* @__PURE__ */ new WeakMap();
|
|
6736
6822
|
function n(t, n) {
|
|
6737
6823
|
let r = t.array, i = t.usage, a = r.byteLength, o = e.createBuffer();
|
|
@@ -7127,7 +7213,7 @@ var Q = {
|
|
|
7127
7213
|
alphaMapTransform: { value: /*@__PURE__*/ new G() },
|
|
7128
7214
|
alphaTest: { value: 0 }
|
|
7129
7215
|
}
|
|
7130
|
-
},
|
|
7216
|
+
}, Qa = {
|
|
7131
7217
|
basic: {
|
|
7132
7218
|
uniforms: /*@__PURE__*/ Fn([
|
|
7133
7219
|
$.common,
|
|
@@ -7332,8 +7418,8 @@ var Q = {
|
|
|
7332
7418
|
fragmentShader: Q.shadow_frag
|
|
7333
7419
|
}
|
|
7334
7420
|
};
|
|
7335
|
-
|
|
7336
|
-
uniforms: /*@__PURE__*/ Fn([
|
|
7421
|
+
Qa.physical = {
|
|
7422
|
+
uniforms: /*@__PURE__*/ Fn([Qa.standard.uniforms, {
|
|
7337
7423
|
clearcoat: { value: 0 },
|
|
7338
7424
|
clearcoatMap: { value: null },
|
|
7339
7425
|
clearcoatMapTransform: { value: /*@__PURE__*/ new G() },
|
|
@@ -7382,12 +7468,12 @@ Za.physical = {
|
|
|
7382
7468
|
vertexShader: Q.meshphysical_vert,
|
|
7383
7469
|
fragmentShader: Q.meshphysical_frag
|
|
7384
7470
|
};
|
|
7385
|
-
var
|
|
7471
|
+
var $a = {
|
|
7386
7472
|
r: 0,
|
|
7387
7473
|
b: 0,
|
|
7388
7474
|
g: 0
|
|
7389
|
-
},
|
|
7390
|
-
function
|
|
7475
|
+
}, eo = /*@__PURE__*/ new vt(), to = /*@__PURE__*/ new ct();
|
|
7476
|
+
function no(e, t, n, r, i, a, o) {
|
|
7391
7477
|
let s = new X(0), c = a === !0 ? 0 : 1, l, u, d = null, f = 0, p = null;
|
|
7392
7478
|
function m(e) {
|
|
7393
7479
|
let r = e.isScene === !0 ? e.background : null;
|
|
@@ -7403,9 +7489,9 @@ function to(e, t, n, r, i, a, o) {
|
|
|
7403
7489
|
let r = m(n);
|
|
7404
7490
|
r && (r.isCubeTexture || r.mapping === 306) ? (u === void 0 && (u = new An(new Nn(1, 1, 1), new Vn({
|
|
7405
7491
|
name: "BackgroundCubeMaterial",
|
|
7406
|
-
uniforms: Pn(
|
|
7407
|
-
vertexShader:
|
|
7408
|
-
fragmentShader:
|
|
7492
|
+
uniforms: Pn(Qa.backgroundCube.uniforms),
|
|
7493
|
+
vertexShader: Qa.backgroundCube.vertexShader,
|
|
7494
|
+
fragmentShader: Qa.backgroundCube.fragmentShader,
|
|
7409
7495
|
side: 1,
|
|
7410
7496
|
depthTest: !1,
|
|
7411
7497
|
depthWrite: !1,
|
|
@@ -7415,11 +7501,11 @@ function to(e, t, n, r, i, a, o) {
|
|
|
7415
7501
|
this.matrixWorld.copyPosition(n.matrixWorld);
|
|
7416
7502
|
}, Object.defineProperty(u.material, "envMap", { get: function() {
|
|
7417
7503
|
return this.uniforms.envMap.value;
|
|
7418
|
-
} }), i.update(u)),
|
|
7504
|
+
} }), i.update(u)), eo.copy(n.backgroundRotation), eo.x *= -1, eo.y *= -1, eo.z *= -1, r.isCubeTexture && r.isRenderTargetTexture === !1 && (eo.y *= -1, eo.z *= -1), u.material.uniforms.envMap.value = r, u.material.uniforms.flipEnvMap.value = r.isCubeTexture && r.isRenderTargetTexture === !1 ? -1 : 1, u.material.uniforms.backgroundBlurriness.value = n.backgroundBlurriness, u.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, u.material.uniforms.backgroundRotation.value.setFromMatrix4(to.makeRotationFromEuler(eo)), u.material.toneMapped = Y.getTransfer(r.colorSpace) !== S, (d !== r || f !== r.version || p !== e.toneMapping) && (u.material.needsUpdate = !0, d = r, f = r.version, p = e.toneMapping), u.layers.enableAll(), t.unshift(u, u.geometry, u.material, 0, 0, null)) : r && r.isTexture && (l === void 0 && (l = new An(new ea(2, 2), new Vn({
|
|
7419
7505
|
name: "BackgroundMaterial",
|
|
7420
|
-
uniforms: Pn(
|
|
7421
|
-
vertexShader:
|
|
7422
|
-
fragmentShader:
|
|
7506
|
+
uniforms: Pn(Qa.background.uniforms),
|
|
7507
|
+
vertexShader: Qa.background.vertexShader,
|
|
7508
|
+
fragmentShader: Qa.background.fragmentShader,
|
|
7423
7509
|
side: 0,
|
|
7424
7510
|
depthTest: !1,
|
|
7425
7511
|
depthWrite: !1,
|
|
@@ -7430,7 +7516,7 @@ function to(e, t, n, r, i, a, o) {
|
|
|
7430
7516
|
} }), i.update(l)), l.material.uniforms.t2D.value = r, l.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, l.material.toneMapped = Y.getTransfer(r.colorSpace) !== S, r.matrixAutoUpdate === !0 && r.updateMatrix(), l.material.uniforms.uvTransform.value.copy(r.matrix), (d !== r || f !== r.version || p !== e.toneMapping) && (l.material.needsUpdate = !0, d = r, f = r.version, p = e.toneMapping), l.layers.enableAll(), t.unshift(l, l.geometry, l.material, 0, 0, null));
|
|
7431
7517
|
}
|
|
7432
7518
|
function _(t, n) {
|
|
7433
|
-
t.getRGB(
|
|
7519
|
+
t.getRGB($a, Ln(e)), r.buffers.color.setClear($a.r, $a.g, $a.b, n, o);
|
|
7434
7520
|
}
|
|
7435
7521
|
function v() {
|
|
7436
7522
|
u !== void 0 && (u.geometry.dispose(), u.material.dispose(), u = void 0), l !== void 0 && (l.geometry.dispose(), l.material.dispose(), l = void 0);
|
|
@@ -7453,7 +7539,7 @@ function to(e, t, n, r, i, a, o) {
|
|
|
7453
7539
|
dispose: v
|
|
7454
7540
|
};
|
|
7455
7541
|
}
|
|
7456
|
-
function
|
|
7542
|
+
function ro(e, t) {
|
|
7457
7543
|
let n = e.getParameter(e.MAX_VERTEX_ATTRIBS), r = {}, i = f(null), a = i, o = !1;
|
|
7458
7544
|
function s(n, r, i, s, c) {
|
|
7459
7545
|
let u = !1, f = d(s, i, r);
|
|
@@ -7623,7 +7709,7 @@ function no(e, t) {
|
|
|
7623
7709
|
disableUnusedAttributes: v
|
|
7624
7710
|
};
|
|
7625
7711
|
}
|
|
7626
|
-
function
|
|
7712
|
+
function io(e, t, n) {
|
|
7627
7713
|
let r;
|
|
7628
7714
|
function i(e) {
|
|
7629
7715
|
r = e;
|
|
@@ -7654,7 +7740,7 @@ function ro(e, t, n) {
|
|
|
7654
7740
|
}
|
|
7655
7741
|
this.setMode = i, this.render = a, this.renderInstances = o, this.renderMultiDraw = s, this.renderMultiDrawInstances = c;
|
|
7656
7742
|
}
|
|
7657
|
-
function
|
|
7743
|
+
function ao(e, t, n, r) {
|
|
7658
7744
|
let i;
|
|
7659
7745
|
function a() {
|
|
7660
7746
|
if (i !== void 0) return i;
|
|
@@ -7702,7 +7788,7 @@ function io(e, t, n, r) {
|
|
|
7702
7788
|
maxSamples: S
|
|
7703
7789
|
};
|
|
7704
7790
|
}
|
|
7705
|
-
function
|
|
7791
|
+
function oo(e) {
|
|
7706
7792
|
let t = this, n = null, r = 0, i = !1, a = !1, o = new ar(), s = new G(), c = {
|
|
7707
7793
|
value: null,
|
|
7708
7794
|
needsUpdate: !1
|
|
@@ -7742,7 +7828,7 @@ function ao(e) {
|
|
|
7742
7828
|
return t.numPlanes = a, t.numIntersection = 0, l;
|
|
7743
7829
|
}
|
|
7744
7830
|
}
|
|
7745
|
-
function
|
|
7831
|
+
function so(e) {
|
|
7746
7832
|
let t = /* @__PURE__ */ new WeakMap();
|
|
7747
7833
|
function n(e, t) {
|
|
7748
7834
|
return t === 303 ? e.mapping = 301 : t === 304 && (e.mapping = 302), e;
|
|
@@ -7781,31 +7867,31 @@ function oo(e) {
|
|
|
7781
7867
|
dispose: a
|
|
7782
7868
|
};
|
|
7783
7869
|
}
|
|
7784
|
-
var
|
|
7870
|
+
var co = 4, lo = [
|
|
7785
7871
|
.125,
|
|
7786
7872
|
.215,
|
|
7787
7873
|
.35,
|
|
7788
7874
|
.446,
|
|
7789
7875
|
.526,
|
|
7790
7876
|
.582
|
|
7791
|
-
],
|
|
7792
|
-
/*@__PURE__*/ new U(-
|
|
7793
|
-
/*@__PURE__*/ new U(
|
|
7794
|
-
/*@__PURE__*/ new U(-
|
|
7795
|
-
/*@__PURE__*/ new U(
|
|
7796
|
-
/*@__PURE__*/ new U(0,
|
|
7797
|
-
/*@__PURE__*/ new U(0,
|
|
7877
|
+
], uo = 20, fo = /*@__PURE__*/ new Da(), po = /*@__PURE__*/ new X(), mo = null, ho = 0, go = 0, _o = !1, vo = (1 + Math.sqrt(5)) / 2, yo = 1 / vo, bo = [
|
|
7878
|
+
/*@__PURE__*/ new U(-vo, yo, 0),
|
|
7879
|
+
/*@__PURE__*/ new U(vo, yo, 0),
|
|
7880
|
+
/*@__PURE__*/ new U(-yo, 0, vo),
|
|
7881
|
+
/*@__PURE__*/ new U(yo, 0, vo),
|
|
7882
|
+
/*@__PURE__*/ new U(0, vo, -yo),
|
|
7883
|
+
/*@__PURE__*/ new U(0, vo, yo),
|
|
7798
7884
|
/*@__PURE__*/ new U(-1, 1, -1),
|
|
7799
7885
|
/*@__PURE__*/ new U(1, 1, -1),
|
|
7800
7886
|
/*@__PURE__*/ new U(-1, 1, 1),
|
|
7801
7887
|
/*@__PURE__*/ new U(1, 1, 1)
|
|
7802
|
-
],
|
|
7888
|
+
], xo = /*@__PURE__*/ new U(), So = class {
|
|
7803
7889
|
constructor(e) {
|
|
7804
7890
|
this._renderer = e, this._pingPongRenderTarget = null, this._lodMax = 0, this._cubeSize = 0, this._lodPlanes = [], this._sizeLods = [], this._sigmas = [], this._blurMaterial = null, this._cubemapMaterial = null, this._equirectMaterial = null, this._compileMaterial(this._blurMaterial);
|
|
7805
7891
|
}
|
|
7806
7892
|
fromScene(e, t = 0, n = .1, r = 100, i = {}) {
|
|
7807
|
-
let { size: a = 256, position: o =
|
|
7808
|
-
|
|
7893
|
+
let { size: a = 256, position: o = xo } = i;
|
|
7894
|
+
mo = this._renderer.getRenderTarget(), ho = this._renderer.getActiveCubeFace(), go = this._renderer.getActiveMipmapLevel(), _o = this._renderer.xr.enabled, this._renderer.xr.enabled = !1, this._setSize(a);
|
|
7809
7895
|
let s = this._allocateTargets();
|
|
7810
7896
|
return s.depthBuffer = !0, this._sceneToCubeUV(e, n, r, s, o), t > 0 && this._blur(s, 0, 0, t), this._applyPMREM(s), this._cleanup(s), s;
|
|
7811
7897
|
}
|
|
@@ -7816,10 +7902,10 @@ var so = 4, co = [
|
|
|
7816
7902
|
return this._fromTexture(e, t);
|
|
7817
7903
|
}
|
|
7818
7904
|
compileCubemapShader() {
|
|
7819
|
-
this._cubemapMaterial === null && (this._cubemapMaterial =
|
|
7905
|
+
this._cubemapMaterial === null && (this._cubemapMaterial = Oo(), this._compileMaterial(this._cubemapMaterial));
|
|
7820
7906
|
}
|
|
7821
7907
|
compileEquirectangularShader() {
|
|
7822
|
-
this._equirectMaterial === null && (this._equirectMaterial =
|
|
7908
|
+
this._equirectMaterial === null && (this._equirectMaterial = Do(), this._compileMaterial(this._equirectMaterial));
|
|
7823
7909
|
}
|
|
7824
7910
|
dispose() {
|
|
7825
7911
|
this._dispose(), this._cubemapMaterial !== null && this._cubemapMaterial.dispose(), this._equirectMaterial !== null && this._equirectMaterial.dispose();
|
|
@@ -7832,10 +7918,10 @@ var so = 4, co = [
|
|
|
7832
7918
|
for (let e = 0; e < this._lodPlanes.length; e++) this._lodPlanes[e].dispose();
|
|
7833
7919
|
}
|
|
7834
7920
|
_cleanup(e) {
|
|
7835
|
-
this._renderer.setRenderTarget(
|
|
7921
|
+
this._renderer.setRenderTarget(mo, ho, go), this._renderer.xr.enabled = _o, e.scissorTest = !1, To(e, 0, 0, e.width, e.height);
|
|
7836
7922
|
}
|
|
7837
7923
|
_fromTexture(e, t) {
|
|
7838
|
-
e.mapping === 301 || e.mapping === 302 ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4),
|
|
7924
|
+
e.mapping === 301 || e.mapping === 302 ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4), mo = this._renderer.getRenderTarget(), ho = this._renderer.getActiveCubeFace(), go = this._renderer.getActiveMipmapLevel(), _o = this._renderer.xr.enabled, this._renderer.xr.enabled = !1;
|
|
7839
7925
|
let n = t || this._allocateTargets();
|
|
7840
7926
|
return this._textureToCubeUV(e, n), this._applyPMREM(n), this._cleanup(n), n;
|
|
7841
7927
|
}
|
|
@@ -7848,17 +7934,17 @@ var so = 4, co = [
|
|
|
7848
7934
|
format: u,
|
|
7849
7935
|
colorSpace: b,
|
|
7850
7936
|
depthBuffer: !1
|
|
7851
|
-
}, r =
|
|
7937
|
+
}, r = wo(e, t, n);
|
|
7852
7938
|
if (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t) {
|
|
7853
|
-
this._pingPongRenderTarget !== null && this._dispose(), this._pingPongRenderTarget =
|
|
7939
|
+
this._pingPongRenderTarget !== null && this._dispose(), this._pingPongRenderTarget = wo(e, t, n);
|
|
7854
7940
|
let { _lodMax: r } = this;
|
|
7855
|
-
({sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas} =
|
|
7941
|
+
({sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas} = Co(r)), this._blurMaterial = Eo(r, e, t);
|
|
7856
7942
|
}
|
|
7857
7943
|
return r;
|
|
7858
7944
|
}
|
|
7859
7945
|
_compileMaterial(e) {
|
|
7860
7946
|
let t = new An(this._lodPlanes[0], e);
|
|
7861
|
-
this._renderer.compile(t,
|
|
7947
|
+
this._renderer.compile(t, fo);
|
|
7862
7948
|
}
|
|
7863
7949
|
_sceneToCubeUV(e, t, n, r, i) {
|
|
7864
7950
|
let a = new Kn(90, 1, t, n), o = [
|
|
@@ -7876,36 +7962,36 @@ var so = 4, co = [
|
|
|
7876
7962
|
-1,
|
|
7877
7963
|
-1
|
|
7878
7964
|
], c = this._renderer, l = c.autoClear, u = c.toneMapping;
|
|
7879
|
-
c.getClearColor(
|
|
7965
|
+
c.getClearColor(po), c.toneMapping = 0, c.autoClear = !1, c.state.buffers.depth.getReversed() && (c.setRenderTarget(r), c.clearDepth(), c.setRenderTarget(null));
|
|
7880
7966
|
let d = new rn({
|
|
7881
7967
|
name: "PMREM.Background",
|
|
7882
7968
|
side: 1,
|
|
7883
7969
|
depthWrite: !1,
|
|
7884
7970
|
depthTest: !1
|
|
7885
7971
|
}), f = new An(new Nn(), d), p = !1, m = e.background;
|
|
7886
|
-
m ? m.isColor && (d.color.copy(m), e.background = null, p = !0) : (d.color.copy(
|
|
7972
|
+
m ? m.isColor && (d.color.copy(m), e.background = null, p = !0) : (d.color.copy(po), p = !0);
|
|
7887
7973
|
for (let t = 0; t < 6; t++) {
|
|
7888
7974
|
let n = t % 3;
|
|
7889
7975
|
n === 0 ? (a.up.set(0, o[t], 0), a.position.set(i.x, i.y, i.z), a.lookAt(i.x + s[t], i.y, i.z)) : n === 1 ? (a.up.set(0, 0, o[t]), a.position.set(i.x, i.y, i.z), a.lookAt(i.x, i.y + s[t], i.z)) : (a.up.set(0, o[t], 0), a.position.set(i.x, i.y, i.z), a.lookAt(i.x, i.y, i.z + s[t]));
|
|
7890
7976
|
let l = this._cubeSize;
|
|
7891
|
-
|
|
7977
|
+
To(r, n * l, t > 2 ? l : 0, l, l), c.setRenderTarget(r), p && c.render(f, a), c.render(e, a);
|
|
7892
7978
|
}
|
|
7893
7979
|
f.geometry.dispose(), f.material.dispose(), c.toneMapping = u, c.autoClear = l, e.background = m;
|
|
7894
7980
|
}
|
|
7895
7981
|
_textureToCubeUV(e, t) {
|
|
7896
7982
|
let n = this._renderer, r = e.mapping === 301 || e.mapping === 302;
|
|
7897
|
-
r ? (this._cubemapMaterial === null && (this._cubemapMaterial =
|
|
7983
|
+
r ? (this._cubemapMaterial === null && (this._cubemapMaterial = Oo()), this._cubemapMaterial.uniforms.flipEnvMap.value = e.isRenderTargetTexture === !1 ? -1 : 1) : this._equirectMaterial === null && (this._equirectMaterial = Do());
|
|
7898
7984
|
let i = r ? this._cubemapMaterial : this._equirectMaterial, a = new An(this._lodPlanes[0], i), o = i.uniforms;
|
|
7899
7985
|
o.envMap.value = e;
|
|
7900
7986
|
let s = this._cubeSize;
|
|
7901
|
-
|
|
7987
|
+
To(t, 0, 0, 3 * s, 2 * s), n.setRenderTarget(t), n.render(a, fo);
|
|
7902
7988
|
}
|
|
7903
7989
|
_applyPMREM(e) {
|
|
7904
7990
|
let t = this._renderer, n = t.autoClear;
|
|
7905
7991
|
t.autoClear = !1;
|
|
7906
7992
|
let r = this._lodPlanes.length;
|
|
7907
7993
|
for (let t = 1; t < r; t++) {
|
|
7908
|
-
let n = Math.sqrt(this._sigmas[t] * this._sigmas[t] - this._sigmas[t - 1] * this._sigmas[t - 1]), i =
|
|
7994
|
+
let n = Math.sqrt(this._sigmas[t] * this._sigmas[t] - this._sigmas[t - 1] * this._sigmas[t - 1]), i = bo[(r - t - 1) % bo.length];
|
|
7909
7995
|
this._blur(e, t - 1, t, n, i);
|
|
7910
7996
|
}
|
|
7911
7997
|
t.autoClear = n;
|
|
@@ -7917,10 +8003,10 @@ var so = 4, co = [
|
|
|
7917
8003
|
_halfBlur(e, t, n, r, i, a, o) {
|
|
7918
8004
|
let s = this._renderer, c = this._blurMaterial;
|
|
7919
8005
|
a !== "latitudinal" && a !== "longitudinal" && console.error("blur direction must be either latitudinal or longitudinal!");
|
|
7920
|
-
let l = new An(this._lodPlanes[r], c), u = c.uniforms, d = this._sizeLods[n] - 1, f = isFinite(i) ? Math.PI / (2 * d) : 2 * Math.PI / 39, p = i / f, m = isFinite(i) ? 1 + Math.floor(3 * p) :
|
|
7921
|
-
m >
|
|
8006
|
+
let l = new An(this._lodPlanes[r], c), u = c.uniforms, d = this._sizeLods[n] - 1, f = isFinite(i) ? Math.PI / (2 * d) : 2 * Math.PI / 39, p = i / f, m = isFinite(i) ? 1 + Math.floor(3 * p) : uo;
|
|
8007
|
+
m > uo && console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${uo}`);
|
|
7922
8008
|
let h = [], g = 0;
|
|
7923
|
-
for (let e = 0; e <
|
|
8009
|
+
for (let e = 0; e < uo; ++e) {
|
|
7924
8010
|
let t = e / p, n = Math.exp(-t * t / 2);
|
|
7925
8011
|
h.push(n), e === 0 ? g += n : e < m && (g += 2 * n);
|
|
7926
8012
|
}
|
|
@@ -7929,16 +8015,16 @@ var so = 4, co = [
|
|
|
7929
8015
|
let { _lodMax: _ } = this;
|
|
7930
8016
|
u.dTheta.value = f, u.mipInt.value = _ - n;
|
|
7931
8017
|
let v = this._sizeLods[r];
|
|
7932
|
-
|
|
8018
|
+
To(t, 3 * v * (r > _ - co ? r - _ + co : 0), 4 * (this._cubeSize - v), 3 * v, 2 * v), s.setRenderTarget(t), s.render(l, fo);
|
|
7933
8019
|
}
|
|
7934
8020
|
};
|
|
7935
|
-
function
|
|
7936
|
-
let t = [], n = [], r = [], i = e, a = e -
|
|
8021
|
+
function Co(e) {
|
|
8022
|
+
let t = [], n = [], r = [], i = e, a = e - co + 1 + lo.length;
|
|
7937
8023
|
for (let o = 0; o < a; o++) {
|
|
7938
8024
|
let a = 2 ** i;
|
|
7939
8025
|
n.push(a);
|
|
7940
8026
|
let s = 1 / a;
|
|
7941
|
-
o > e -
|
|
8027
|
+
o > e - co ? s = lo[o - e + co - 1] : o === 0 && (s = 0), r.push(s);
|
|
7942
8028
|
let c = 1 / (a - 2), l = -c, u = 1 + c, d = [
|
|
7943
8029
|
l,
|
|
7944
8030
|
l,
|
|
@@ -7986,7 +8072,7 @@ function So(e) {
|
|
|
7986
8072
|
m.set(i, 6 * e);
|
|
7987
8073
|
}
|
|
7988
8074
|
let h = new vn();
|
|
7989
|
-
h.setAttribute("position", new cn(f, 3)), h.setAttribute("uv", new cn(p, 2)), h.setAttribute("faceIndex", new cn(m, 1)), t.push(h), i >
|
|
8075
|
+
h.setAttribute("position", new cn(f, 3)), h.setAttribute("uv", new cn(p, 2)), h.setAttribute("faceIndex", new cn(m, 1)), t.push(h), i > co && i--;
|
|
7990
8076
|
}
|
|
7991
8077
|
return {
|
|
7992
8078
|
lodPlanes: t,
|
|
@@ -7994,19 +8080,19 @@ function So(e) {
|
|
|
7994
8080
|
sigmas: r
|
|
7995
8081
|
};
|
|
7996
8082
|
}
|
|
7997
|
-
function
|
|
8083
|
+
function wo(e, t, n) {
|
|
7998
8084
|
let r = new Me(e, t, n);
|
|
7999
8085
|
return r.texture.mapping = 306, r.texture.name = "PMREM.cubeUv", r.scissorTest = !0, r;
|
|
8000
8086
|
}
|
|
8001
|
-
function
|
|
8087
|
+
function To(e, t, n, r, i) {
|
|
8002
8088
|
e.viewport.set(t, n, r, i), e.scissor.set(t, n, r, i);
|
|
8003
8089
|
}
|
|
8004
|
-
function
|
|
8005
|
-
let r = new Float32Array(
|
|
8090
|
+
function Eo(e, t, n) {
|
|
8091
|
+
let r = new Float32Array(uo), i = new U(0, 1, 0);
|
|
8006
8092
|
return new Vn({
|
|
8007
8093
|
name: "SphericalGaussianBlur",
|
|
8008
8094
|
defines: {
|
|
8009
|
-
n:
|
|
8095
|
+
n: uo,
|
|
8010
8096
|
CUBEUV_TEXEL_WIDTH: 1 / t,
|
|
8011
8097
|
CUBEUV_TEXEL_HEIGHT: 1 / n,
|
|
8012
8098
|
CUBEUV_MAX_MIP: `${e}.0`
|
|
@@ -8020,53 +8106,53 @@ function To(e, t, n) {
|
|
|
8020
8106
|
mipInt: { value: 0 },
|
|
8021
8107
|
poleAxis: { value: i }
|
|
8022
8108
|
},
|
|
8023
|
-
vertexShader:
|
|
8109
|
+
vertexShader: ko(),
|
|
8024
8110
|
fragmentShader: "\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n uniform int samples;\n uniform float weights[ n ];\n uniform bool latitudinal;\n uniform float dTheta;\n uniform float mipInt;\n uniform vec3 poleAxis;\n\n #define ENVMAP_TYPE_CUBE_UV\n #include <cube_uv_reflection_fragment>\n\n vec3 getSample( float theta, vec3 axis ) {\n\n float cosTheta = cos( theta );\n // Rodrigues' axis-angle rotation\n vec3 sampleDirection = vOutputDirection * cosTheta\n + cross( axis, vOutputDirection ) * sin( theta )\n + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n return bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n }\n\n void main() {\n\n vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n if ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n }\n\n axis = normalize( axis );\n\n gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n for ( int i = 1; i < n; i++ ) {\n\n if ( i >= samples ) {\n\n break;\n\n }\n\n float theta = dTheta * float( i );\n gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n }\n\n }\n ",
|
|
8025
8111
|
blending: 0,
|
|
8026
8112
|
depthTest: !1,
|
|
8027
8113
|
depthWrite: !1
|
|
8028
8114
|
});
|
|
8029
8115
|
}
|
|
8030
|
-
function
|
|
8116
|
+
function Do() {
|
|
8031
8117
|
return new Vn({
|
|
8032
8118
|
name: "EquirectangularToCubeUV",
|
|
8033
8119
|
uniforms: { envMap: { value: null } },
|
|
8034
|
-
vertexShader:
|
|
8120
|
+
vertexShader: ko(),
|
|
8035
8121
|
fragmentShader: "\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n\n #include <common>\n\n void main() {\n\n vec3 outputDirection = normalize( vOutputDirection );\n vec2 uv = equirectUv( outputDirection );\n\n gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n }\n ",
|
|
8036
8122
|
blending: 0,
|
|
8037
8123
|
depthTest: !1,
|
|
8038
8124
|
depthWrite: !1
|
|
8039
8125
|
});
|
|
8040
8126
|
}
|
|
8041
|
-
function
|
|
8127
|
+
function Oo() {
|
|
8042
8128
|
return new Vn({
|
|
8043
8129
|
name: "CubemapToCubeUV",
|
|
8044
8130
|
uniforms: {
|
|
8045
8131
|
envMap: { value: null },
|
|
8046
8132
|
flipEnvMap: { value: -1 }
|
|
8047
8133
|
},
|
|
8048
|
-
vertexShader:
|
|
8134
|
+
vertexShader: ko(),
|
|
8049
8135
|
fragmentShader: "\n\n precision mediump float;\n precision mediump int;\n\n uniform float flipEnvMap;\n\n varying vec3 vOutputDirection;\n\n uniform samplerCube envMap;\n\n void main() {\n\n gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n }\n ",
|
|
8050
8136
|
blending: 0,
|
|
8051
8137
|
depthTest: !1,
|
|
8052
8138
|
depthWrite: !1
|
|
8053
8139
|
});
|
|
8054
8140
|
}
|
|
8055
|
-
function
|
|
8141
|
+
function ko() {
|
|
8056
8142
|
return "\n\n precision mediump float;\n precision mediump int;\n\n attribute float faceIndex;\n\n varying vec3 vOutputDirection;\n\n // RH coordinate system; PMREM face-indexing convention\n vec3 getDirection( vec2 uv, float face ) {\n\n uv = 2.0 * uv - 1.0;\n\n vec3 direction = vec3( uv, 1.0 );\n\n if ( face == 0.0 ) {\n\n direction = direction.zyx; // ( 1, v, u ) pos x\n\n } else if ( face == 1.0 ) {\n\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n } else if ( face == 2.0 ) {\n\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n\n } else if ( face == 3.0 ) {\n\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n\n } else if ( face == 4.0 ) {\n\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n\n } else if ( face == 5.0 ) {\n\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n\n }\n\n return direction;\n\n }\n\n void main() {\n\n vOutputDirection = getDirection( uv, faceIndex );\n gl_Position = vec4( position, 1.0 );\n\n }\n ";
|
|
8057
8143
|
}
|
|
8058
|
-
function
|
|
8144
|
+
function Ao(e) {
|
|
8059
8145
|
let t = /* @__PURE__ */ new WeakMap(), n = null;
|
|
8060
8146
|
function r(r) {
|
|
8061
8147
|
if (r && r.isTexture) {
|
|
8062
8148
|
let o = r.mapping, s = o === 303 || o === 304, c = o === 301 || o === 302;
|
|
8063
8149
|
if (s || c) {
|
|
8064
8150
|
let o = t.get(r), l = o === void 0 ? 0 : o.texture.pmremVersion;
|
|
8065
|
-
if (r.isRenderTargetTexture && r.pmremVersion !== l) return n === null && (n = new
|
|
8151
|
+
if (r.isRenderTargetTexture && r.pmremVersion !== l) return n === null && (n = new So(e)), o = s ? n.fromEquirectangular(r, o) : n.fromCubemap(r, o), o.texture.pmremVersion = r.pmremVersion, t.set(r, o), o.texture;
|
|
8066
8152
|
if (o !== void 0) return o.texture;
|
|
8067
8153
|
{
|
|
8068
8154
|
let l = r.image;
|
|
8069
|
-
return s && l && l.height > 0 || c && l && i(l) ? (n === null && (n = new
|
|
8155
|
+
return s && l && l.height > 0 || c && l && i(l) ? (n === null && (n = new So(e)), o = s ? n.fromEquirectangular(r) : n.fromCubemap(r), o.texture.pmremVersion = r.pmremVersion, t.set(r, o), r.addEventListener("dispose", a), o.texture) : null;
|
|
8070
8156
|
}
|
|
8071
8157
|
}
|
|
8072
8158
|
}
|
|
@@ -8091,7 +8177,7 @@ function ko(e) {
|
|
|
8091
8177
|
dispose: o
|
|
8092
8178
|
};
|
|
8093
8179
|
}
|
|
8094
|
-
function
|
|
8180
|
+
function jo(e) {
|
|
8095
8181
|
let t = {};
|
|
8096
8182
|
function n(n) {
|
|
8097
8183
|
if (t[n] !== void 0) return t[n];
|
|
@@ -8126,7 +8212,7 @@ function Ao(e) {
|
|
|
8126
8212
|
}
|
|
8127
8213
|
};
|
|
8128
8214
|
}
|
|
8129
|
-
function
|
|
8215
|
+
function Mo(e, t, n, r) {
|
|
8130
8216
|
let i = {}, a = /* @__PURE__ */ new WeakMap();
|
|
8131
8217
|
function o(e) {
|
|
8132
8218
|
let s = e.target;
|
|
@@ -8179,7 +8265,7 @@ function jo(e, t, n, r) {
|
|
|
8179
8265
|
getWireframeAttribute: u
|
|
8180
8266
|
};
|
|
8181
8267
|
}
|
|
8182
|
-
function
|
|
8268
|
+
function No(e, t, n) {
|
|
8183
8269
|
let r;
|
|
8184
8270
|
function i(e) {
|
|
8185
8271
|
r = e;
|
|
@@ -8214,7 +8300,7 @@ function Mo(e, t, n) {
|
|
|
8214
8300
|
}
|
|
8215
8301
|
this.setMode = i, this.setIndex = s, this.render = c, this.renderInstances = l, this.renderMultiDraw = u, this.renderMultiDrawInstances = d;
|
|
8216
8302
|
}
|
|
8217
|
-
function
|
|
8303
|
+
function Po(e) {
|
|
8218
8304
|
let t = {
|
|
8219
8305
|
geometries: 0,
|
|
8220
8306
|
textures: 0
|
|
@@ -8257,7 +8343,7 @@ function No(e) {
|
|
|
8257
8343
|
update: r
|
|
8258
8344
|
};
|
|
8259
8345
|
}
|
|
8260
|
-
function
|
|
8346
|
+
function Fo(e, t, n) {
|
|
8261
8347
|
let r = /* @__PURE__ */ new WeakMap(), i = new Ae();
|
|
8262
8348
|
function a(a, o, s) {
|
|
8263
8349
|
let l = a.morphTargetInfluences, u = o.morphAttributes.position || o.morphAttributes.normal || o.morphAttributes.color, d = u === void 0 ? 0 : u.length, f = r.get(o);
|
|
@@ -8298,7 +8384,7 @@ function Po(e, t, n) {
|
|
|
8298
8384
|
}
|
|
8299
8385
|
return { update: a };
|
|
8300
8386
|
}
|
|
8301
|
-
function
|
|
8387
|
+
function Io(e, t, n, r) {
|
|
8302
8388
|
let i = /* @__PURE__ */ new WeakMap();
|
|
8303
8389
|
function a(a) {
|
|
8304
8390
|
let o = r.render.frame, c = a.geometry, l = t.get(a, c);
|
|
@@ -8320,322 +8406,322 @@ function Fo(e, t, n, r) {
|
|
|
8320
8406
|
dispose: o
|
|
8321
8407
|
};
|
|
8322
8408
|
}
|
|
8323
|
-
var
|
|
8324
|
-
function
|
|
8409
|
+
var Lo = /*@__PURE__*/ new ke(), Ro = /*@__PURE__*/ new wr(1, 1), zo = /*@__PURE__*/ new Ne(), Bo = /*@__PURE__*/ new Pe(), Vo = /*@__PURE__*/ new Xn(), Ho = [], Uo = [], Wo = /* @__PURE__ */ new Float32Array(16), Go = /* @__PURE__ */ new Float32Array(9), Ko = /* @__PURE__ */ new Float32Array(4);
|
|
8410
|
+
function qo(e, t, n) {
|
|
8325
8411
|
let r = e[0];
|
|
8326
8412
|
if (r <= 0 || r > 0) return e;
|
|
8327
|
-
let i = t * n, a =
|
|
8328
|
-
if (a === void 0 && (a = new Float32Array(i),
|
|
8413
|
+
let i = t * n, a = Ho[i];
|
|
8414
|
+
if (a === void 0 && (a = new Float32Array(i), Ho[i] = a), t !== 0) {
|
|
8329
8415
|
r.toArray(a, 0);
|
|
8330
8416
|
for (let r = 1, i = 0; r !== t; ++r) i += n, e[r].toArray(a, i);
|
|
8331
8417
|
}
|
|
8332
8418
|
return a;
|
|
8333
8419
|
}
|
|
8334
|
-
function
|
|
8420
|
+
function Jo(e, t) {
|
|
8335
8421
|
if (e.length !== t.length) return !1;
|
|
8336
8422
|
for (let n = 0, r = e.length; n < r; n++) if (e[n] !== t[n]) return !1;
|
|
8337
8423
|
return !0;
|
|
8338
8424
|
}
|
|
8339
|
-
function
|
|
8425
|
+
function Yo(e, t) {
|
|
8340
8426
|
for (let n = 0, r = t.length; n < r; n++) e[n] = t[n];
|
|
8341
8427
|
}
|
|
8342
|
-
function
|
|
8343
|
-
let n =
|
|
8344
|
-
n === void 0 && (n = new Int32Array(t),
|
|
8428
|
+
function Xo(e, t) {
|
|
8429
|
+
let n = Uo[t];
|
|
8430
|
+
n === void 0 && (n = new Int32Array(t), Uo[t] = n);
|
|
8345
8431
|
for (let r = 0; r !== t; ++r) n[r] = e.allocateTextureUnit();
|
|
8346
8432
|
return n;
|
|
8347
8433
|
}
|
|
8348
|
-
function
|
|
8434
|
+
function Zo(e, t) {
|
|
8349
8435
|
let n = this.cache;
|
|
8350
8436
|
n[0] !== t && (e.uniform1f(this.addr, t), n[0] = t);
|
|
8351
8437
|
}
|
|
8352
|
-
function
|
|
8438
|
+
function Qo(e, t) {
|
|
8353
8439
|
let n = this.cache;
|
|
8354
8440
|
if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y) && (e.uniform2f(this.addr, t.x, t.y), n[0] = t.x, n[1] = t.y);
|
|
8355
8441
|
else {
|
|
8356
|
-
if (
|
|
8357
|
-
e.uniform2fv(this.addr, t),
|
|
8442
|
+
if (Jo(n, t)) return;
|
|
8443
|
+
e.uniform2fv(this.addr, t), Yo(n, t);
|
|
8358
8444
|
}
|
|
8359
8445
|
}
|
|
8360
|
-
function
|
|
8446
|
+
function $o(e, t) {
|
|
8361
8447
|
let n = this.cache;
|
|
8362
8448
|
if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z) && (e.uniform3f(this.addr, t.x, t.y, t.z), n[0] = t.x, n[1] = t.y, n[2] = t.z);
|
|
8363
8449
|
else if (t.r !== void 0) (n[0] !== t.r || n[1] !== t.g || n[2] !== t.b) && (e.uniform3f(this.addr, t.r, t.g, t.b), n[0] = t.r, n[1] = t.g, n[2] = t.b);
|
|
8364
8450
|
else {
|
|
8365
|
-
if (
|
|
8366
|
-
e.uniform3fv(this.addr, t),
|
|
8451
|
+
if (Jo(n, t)) return;
|
|
8452
|
+
e.uniform3fv(this.addr, t), Yo(n, t);
|
|
8367
8453
|
}
|
|
8368
8454
|
}
|
|
8369
|
-
function
|
|
8455
|
+
function es(e, t) {
|
|
8370
8456
|
let n = this.cache;
|
|
8371
8457
|
if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z || n[3] !== t.w) && (e.uniform4f(this.addr, t.x, t.y, t.z, t.w), n[0] = t.x, n[1] = t.y, n[2] = t.z, n[3] = t.w);
|
|
8372
8458
|
else {
|
|
8373
|
-
if (
|
|
8374
|
-
e.uniform4fv(this.addr, t),
|
|
8459
|
+
if (Jo(n, t)) return;
|
|
8460
|
+
e.uniform4fv(this.addr, t), Yo(n, t);
|
|
8375
8461
|
}
|
|
8376
8462
|
}
|
|
8377
|
-
function
|
|
8463
|
+
function ts(e, t) {
|
|
8378
8464
|
let n = this.cache, r = t.elements;
|
|
8379
8465
|
if (r === void 0) {
|
|
8380
|
-
if (
|
|
8381
|
-
e.uniformMatrix2fv(this.addr, !1, t),
|
|
8466
|
+
if (Jo(n, t)) return;
|
|
8467
|
+
e.uniformMatrix2fv(this.addr, !1, t), Yo(n, t);
|
|
8382
8468
|
} else {
|
|
8383
|
-
if (
|
|
8384
|
-
|
|
8469
|
+
if (Jo(n, r)) return;
|
|
8470
|
+
Ko.set(r), e.uniformMatrix2fv(this.addr, !1, Ko), Yo(n, r);
|
|
8385
8471
|
}
|
|
8386
8472
|
}
|
|
8387
|
-
function
|
|
8473
|
+
function ns(e, t) {
|
|
8388
8474
|
let n = this.cache, r = t.elements;
|
|
8389
8475
|
if (r === void 0) {
|
|
8390
|
-
if (
|
|
8391
|
-
e.uniformMatrix3fv(this.addr, !1, t),
|
|
8476
|
+
if (Jo(n, t)) return;
|
|
8477
|
+
e.uniformMatrix3fv(this.addr, !1, t), Yo(n, t);
|
|
8392
8478
|
} else {
|
|
8393
|
-
if (
|
|
8394
|
-
|
|
8479
|
+
if (Jo(n, r)) return;
|
|
8480
|
+
Go.set(r), e.uniformMatrix3fv(this.addr, !1, Go), Yo(n, r);
|
|
8395
8481
|
}
|
|
8396
8482
|
}
|
|
8397
|
-
function
|
|
8483
|
+
function rs(e, t) {
|
|
8398
8484
|
let n = this.cache, r = t.elements;
|
|
8399
8485
|
if (r === void 0) {
|
|
8400
|
-
if (
|
|
8401
|
-
e.uniformMatrix4fv(this.addr, !1, t),
|
|
8486
|
+
if (Jo(n, t)) return;
|
|
8487
|
+
e.uniformMatrix4fv(this.addr, !1, t), Yo(n, t);
|
|
8402
8488
|
} else {
|
|
8403
|
-
if (
|
|
8404
|
-
|
|
8489
|
+
if (Jo(n, r)) return;
|
|
8490
|
+
Wo.set(r), e.uniformMatrix4fv(this.addr, !1, Wo), Yo(n, r);
|
|
8405
8491
|
}
|
|
8406
8492
|
}
|
|
8407
|
-
function
|
|
8493
|
+
function is(e, t) {
|
|
8408
8494
|
let n = this.cache;
|
|
8409
8495
|
n[0] !== t && (e.uniform1i(this.addr, t), n[0] = t);
|
|
8410
8496
|
}
|
|
8411
|
-
function
|
|
8497
|
+
function as(e, t) {
|
|
8412
8498
|
let n = this.cache;
|
|
8413
8499
|
if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y) && (e.uniform2i(this.addr, t.x, t.y), n[0] = t.x, n[1] = t.y);
|
|
8414
8500
|
else {
|
|
8415
|
-
if (
|
|
8416
|
-
e.uniform2iv(this.addr, t),
|
|
8501
|
+
if (Jo(n, t)) return;
|
|
8502
|
+
e.uniform2iv(this.addr, t), Yo(n, t);
|
|
8417
8503
|
}
|
|
8418
8504
|
}
|
|
8419
|
-
function
|
|
8505
|
+
function os(e, t) {
|
|
8420
8506
|
let n = this.cache;
|
|
8421
8507
|
if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z) && (e.uniform3i(this.addr, t.x, t.y, t.z), n[0] = t.x, n[1] = t.y, n[2] = t.z);
|
|
8422
8508
|
else {
|
|
8423
|
-
if (
|
|
8424
|
-
e.uniform3iv(this.addr, t),
|
|
8509
|
+
if (Jo(n, t)) return;
|
|
8510
|
+
e.uniform3iv(this.addr, t), Yo(n, t);
|
|
8425
8511
|
}
|
|
8426
8512
|
}
|
|
8427
|
-
function
|
|
8513
|
+
function ss(e, t) {
|
|
8428
8514
|
let n = this.cache;
|
|
8429
8515
|
if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z || n[3] !== t.w) && (e.uniform4i(this.addr, t.x, t.y, t.z, t.w), n[0] = t.x, n[1] = t.y, n[2] = t.z, n[3] = t.w);
|
|
8430
8516
|
else {
|
|
8431
|
-
if (
|
|
8432
|
-
e.uniform4iv(this.addr, t),
|
|
8517
|
+
if (Jo(n, t)) return;
|
|
8518
|
+
e.uniform4iv(this.addr, t), Yo(n, t);
|
|
8433
8519
|
}
|
|
8434
8520
|
}
|
|
8435
|
-
function
|
|
8521
|
+
function cs(e, t) {
|
|
8436
8522
|
let n = this.cache;
|
|
8437
8523
|
n[0] !== t && (e.uniform1ui(this.addr, t), n[0] = t);
|
|
8438
8524
|
}
|
|
8439
|
-
function
|
|
8525
|
+
function ls(e, t) {
|
|
8440
8526
|
let n = this.cache;
|
|
8441
8527
|
if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y) && (e.uniform2ui(this.addr, t.x, t.y), n[0] = t.x, n[1] = t.y);
|
|
8442
8528
|
else {
|
|
8443
|
-
if (
|
|
8444
|
-
e.uniform2uiv(this.addr, t),
|
|
8529
|
+
if (Jo(n, t)) return;
|
|
8530
|
+
e.uniform2uiv(this.addr, t), Yo(n, t);
|
|
8445
8531
|
}
|
|
8446
8532
|
}
|
|
8447
|
-
function
|
|
8533
|
+
function us(e, t) {
|
|
8448
8534
|
let n = this.cache;
|
|
8449
8535
|
if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z) && (e.uniform3ui(this.addr, t.x, t.y, t.z), n[0] = t.x, n[1] = t.y, n[2] = t.z);
|
|
8450
8536
|
else {
|
|
8451
|
-
if (
|
|
8452
|
-
e.uniform3uiv(this.addr, t),
|
|
8537
|
+
if (Jo(n, t)) return;
|
|
8538
|
+
e.uniform3uiv(this.addr, t), Yo(n, t);
|
|
8453
8539
|
}
|
|
8454
8540
|
}
|
|
8455
|
-
function
|
|
8541
|
+
function ds(e, t) {
|
|
8456
8542
|
let n = this.cache;
|
|
8457
8543
|
if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z || n[3] !== t.w) && (e.uniform4ui(this.addr, t.x, t.y, t.z, t.w), n[0] = t.x, n[1] = t.y, n[2] = t.z, n[3] = t.w);
|
|
8458
8544
|
else {
|
|
8459
|
-
if (
|
|
8460
|
-
e.uniform4uiv(this.addr, t),
|
|
8545
|
+
if (Jo(n, t)) return;
|
|
8546
|
+
e.uniform4uiv(this.addr, t), Yo(n, t);
|
|
8461
8547
|
}
|
|
8462
8548
|
}
|
|
8463
|
-
function
|
|
8549
|
+
function fs(e, t, n) {
|
|
8464
8550
|
let r = this.cache, i = n.allocateTextureUnit();
|
|
8465
8551
|
r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i);
|
|
8466
8552
|
let a;
|
|
8467
|
-
this.type === e.SAMPLER_2D_SHADOW ? (
|
|
8468
|
-
}
|
|
8469
|
-
function fs(e, t, n) {
|
|
8470
|
-
let r = this.cache, i = n.allocateTextureUnit();
|
|
8471
|
-
r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture3D(t || zo, i);
|
|
8553
|
+
this.type === e.SAMPLER_2D_SHADOW ? (Ro.compareFunction = 515, a = Ro) : a = Lo, n.setTexture2D(t || a, i);
|
|
8472
8554
|
}
|
|
8473
8555
|
function ps(e, t, n) {
|
|
8474
8556
|
let r = this.cache, i = n.allocateTextureUnit();
|
|
8475
|
-
r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.
|
|
8557
|
+
r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture3D(t || Bo, i);
|
|
8476
8558
|
}
|
|
8477
8559
|
function ms(e, t, n) {
|
|
8478
8560
|
let r = this.cache, i = n.allocateTextureUnit();
|
|
8479
|
-
r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.
|
|
8561
|
+
r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTextureCube(t || Vo, i);
|
|
8562
|
+
}
|
|
8563
|
+
function hs(e, t, n) {
|
|
8564
|
+
let r = this.cache, i = n.allocateTextureUnit();
|
|
8565
|
+
r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture2DArray(t || zo, i);
|
|
8480
8566
|
}
|
|
8481
|
-
function
|
|
8567
|
+
function gs(e) {
|
|
8482
8568
|
switch (e) {
|
|
8483
|
-
case 5126: return
|
|
8484
|
-
case 35664: return
|
|
8485
|
-
case 35665: return
|
|
8486
|
-
case 35666: return
|
|
8487
|
-
case 35674: return
|
|
8488
|
-
case 35675: return
|
|
8489
|
-
case 35676: return
|
|
8569
|
+
case 5126: return Zo;
|
|
8570
|
+
case 35664: return Qo;
|
|
8571
|
+
case 35665: return $o;
|
|
8572
|
+
case 35666: return es;
|
|
8573
|
+
case 35674: return ts;
|
|
8574
|
+
case 35675: return ns;
|
|
8575
|
+
case 35676: return rs;
|
|
8490
8576
|
case 5124:
|
|
8491
|
-
case 35670: return
|
|
8577
|
+
case 35670: return is;
|
|
8492
8578
|
case 35667:
|
|
8493
|
-
case 35671: return
|
|
8579
|
+
case 35671: return as;
|
|
8494
8580
|
case 35668:
|
|
8495
|
-
case 35672: return
|
|
8581
|
+
case 35672: return os;
|
|
8496
8582
|
case 35669:
|
|
8497
|
-
case 35673: return
|
|
8498
|
-
case 5125: return
|
|
8499
|
-
case 36294: return
|
|
8500
|
-
case 36295: return
|
|
8501
|
-
case 36296: return
|
|
8583
|
+
case 35673: return ss;
|
|
8584
|
+
case 5125: return cs;
|
|
8585
|
+
case 36294: return ls;
|
|
8586
|
+
case 36295: return us;
|
|
8587
|
+
case 36296: return ds;
|
|
8502
8588
|
case 35678:
|
|
8503
8589
|
case 36198:
|
|
8504
8590
|
case 36298:
|
|
8505
8591
|
case 36306:
|
|
8506
|
-
case 35682: return
|
|
8592
|
+
case 35682: return fs;
|
|
8507
8593
|
case 35679:
|
|
8508
8594
|
case 36299:
|
|
8509
|
-
case 36307: return
|
|
8595
|
+
case 36307: return ps;
|
|
8510
8596
|
case 35680:
|
|
8511
8597
|
case 36300:
|
|
8512
8598
|
case 36308:
|
|
8513
|
-
case 36293: return
|
|
8599
|
+
case 36293: return ms;
|
|
8514
8600
|
case 36289:
|
|
8515
8601
|
case 36303:
|
|
8516
8602
|
case 36311:
|
|
8517
|
-
case 36292: return
|
|
8603
|
+
case 36292: return hs;
|
|
8518
8604
|
}
|
|
8519
8605
|
}
|
|
8520
|
-
function
|
|
8606
|
+
function _s(e, t) {
|
|
8521
8607
|
e.uniform1fv(this.addr, t);
|
|
8522
8608
|
}
|
|
8523
|
-
function
|
|
8524
|
-
let n =
|
|
8609
|
+
function vs(e, t) {
|
|
8610
|
+
let n = qo(t, this.size, 2);
|
|
8525
8611
|
e.uniform2fv(this.addr, n);
|
|
8526
8612
|
}
|
|
8527
|
-
function
|
|
8528
|
-
let n =
|
|
8613
|
+
function ys(e, t) {
|
|
8614
|
+
let n = qo(t, this.size, 3);
|
|
8529
8615
|
e.uniform3fv(this.addr, n);
|
|
8530
8616
|
}
|
|
8531
|
-
function
|
|
8532
|
-
let n =
|
|
8617
|
+
function bs(e, t) {
|
|
8618
|
+
let n = qo(t, this.size, 4);
|
|
8533
8619
|
e.uniform4fv(this.addr, n);
|
|
8534
8620
|
}
|
|
8535
|
-
function
|
|
8536
|
-
let n =
|
|
8621
|
+
function xs(e, t) {
|
|
8622
|
+
let n = qo(t, this.size, 4);
|
|
8537
8623
|
e.uniformMatrix2fv(this.addr, !1, n);
|
|
8538
8624
|
}
|
|
8539
|
-
function
|
|
8540
|
-
let n =
|
|
8625
|
+
function Ss(e, t) {
|
|
8626
|
+
let n = qo(t, this.size, 9);
|
|
8541
8627
|
e.uniformMatrix3fv(this.addr, !1, n);
|
|
8542
8628
|
}
|
|
8543
|
-
function
|
|
8544
|
-
let n =
|
|
8629
|
+
function Cs(e, t) {
|
|
8630
|
+
let n = qo(t, this.size, 16);
|
|
8545
8631
|
e.uniformMatrix4fv(this.addr, !1, n);
|
|
8546
8632
|
}
|
|
8547
|
-
function
|
|
8633
|
+
function ws(e, t) {
|
|
8548
8634
|
e.uniform1iv(this.addr, t);
|
|
8549
8635
|
}
|
|
8550
|
-
function
|
|
8636
|
+
function Ts(e, t) {
|
|
8551
8637
|
e.uniform2iv(this.addr, t);
|
|
8552
8638
|
}
|
|
8553
|
-
function
|
|
8639
|
+
function Es(e, t) {
|
|
8554
8640
|
e.uniform3iv(this.addr, t);
|
|
8555
8641
|
}
|
|
8556
|
-
function
|
|
8642
|
+
function Ds(e, t) {
|
|
8557
8643
|
e.uniform4iv(this.addr, t);
|
|
8558
8644
|
}
|
|
8559
|
-
function
|
|
8645
|
+
function Os(e, t) {
|
|
8560
8646
|
e.uniform1uiv(this.addr, t);
|
|
8561
8647
|
}
|
|
8562
|
-
function
|
|
8648
|
+
function ks(e, t) {
|
|
8563
8649
|
e.uniform2uiv(this.addr, t);
|
|
8564
8650
|
}
|
|
8565
|
-
function
|
|
8651
|
+
function As(e, t) {
|
|
8566
8652
|
e.uniform3uiv(this.addr, t);
|
|
8567
8653
|
}
|
|
8568
|
-
function
|
|
8654
|
+
function js(e, t) {
|
|
8569
8655
|
e.uniform4uiv(this.addr, t);
|
|
8570
8656
|
}
|
|
8571
|
-
function js(e, t, n) {
|
|
8572
|
-
let r = this.cache, i = t.length, a = Yo(n, i);
|
|
8573
|
-
qo(r, a) || (e.uniform1iv(this.addr, a), Jo(r, a));
|
|
8574
|
-
for (let e = 0; e !== i; ++e) n.setTexture2D(t[e] || Io, a[e]);
|
|
8575
|
-
}
|
|
8576
8657
|
function Ms(e, t, n) {
|
|
8577
|
-
let r = this.cache, i = t.length, a =
|
|
8578
|
-
|
|
8579
|
-
for (let e = 0; e !== i; ++e) n.
|
|
8658
|
+
let r = this.cache, i = t.length, a = Xo(n, i);
|
|
8659
|
+
Jo(r, a) || (e.uniform1iv(this.addr, a), Yo(r, a));
|
|
8660
|
+
for (let e = 0; e !== i; ++e) n.setTexture2D(t[e] || Lo, a[e]);
|
|
8580
8661
|
}
|
|
8581
8662
|
function Ns(e, t, n) {
|
|
8582
|
-
let r = this.cache, i = t.length, a =
|
|
8583
|
-
|
|
8584
|
-
for (let e = 0; e !== i; ++e) n.
|
|
8663
|
+
let r = this.cache, i = t.length, a = Xo(n, i);
|
|
8664
|
+
Jo(r, a) || (e.uniform1iv(this.addr, a), Yo(r, a));
|
|
8665
|
+
for (let e = 0; e !== i; ++e) n.setTexture3D(t[e] || Bo, a[e]);
|
|
8585
8666
|
}
|
|
8586
8667
|
function Ps(e, t, n) {
|
|
8587
|
-
let r = this.cache, i = t.length, a =
|
|
8588
|
-
|
|
8589
|
-
for (let e = 0; e !== i; ++e) n.
|
|
8668
|
+
let r = this.cache, i = t.length, a = Xo(n, i);
|
|
8669
|
+
Jo(r, a) || (e.uniform1iv(this.addr, a), Yo(r, a));
|
|
8670
|
+
for (let e = 0; e !== i; ++e) n.setTextureCube(t[e] || Vo, a[e]);
|
|
8671
|
+
}
|
|
8672
|
+
function Fs(e, t, n) {
|
|
8673
|
+
let r = this.cache, i = t.length, a = Xo(n, i);
|
|
8674
|
+
Jo(r, a) || (e.uniform1iv(this.addr, a), Yo(r, a));
|
|
8675
|
+
for (let e = 0; e !== i; ++e) n.setTexture2DArray(t[e] || zo, a[e]);
|
|
8590
8676
|
}
|
|
8591
|
-
function
|
|
8677
|
+
function Is(e) {
|
|
8592
8678
|
switch (e) {
|
|
8593
|
-
case 5126: return
|
|
8594
|
-
case 35664: return
|
|
8595
|
-
case 35665: return
|
|
8596
|
-
case 35666: return
|
|
8597
|
-
case 35674: return
|
|
8598
|
-
case 35675: return
|
|
8599
|
-
case 35676: return
|
|
8679
|
+
case 5126: return _s;
|
|
8680
|
+
case 35664: return vs;
|
|
8681
|
+
case 35665: return ys;
|
|
8682
|
+
case 35666: return bs;
|
|
8683
|
+
case 35674: return xs;
|
|
8684
|
+
case 35675: return Ss;
|
|
8685
|
+
case 35676: return Cs;
|
|
8600
8686
|
case 5124:
|
|
8601
|
-
case 35670: return
|
|
8687
|
+
case 35670: return ws;
|
|
8602
8688
|
case 35667:
|
|
8603
|
-
case 35671: return
|
|
8689
|
+
case 35671: return Ts;
|
|
8604
8690
|
case 35668:
|
|
8605
|
-
case 35672: return
|
|
8691
|
+
case 35672: return Es;
|
|
8606
8692
|
case 35669:
|
|
8607
|
-
case 35673: return
|
|
8608
|
-
case 5125: return
|
|
8609
|
-
case 36294: return
|
|
8610
|
-
case 36295: return
|
|
8611
|
-
case 36296: return
|
|
8693
|
+
case 35673: return Ds;
|
|
8694
|
+
case 5125: return Os;
|
|
8695
|
+
case 36294: return ks;
|
|
8696
|
+
case 36295: return As;
|
|
8697
|
+
case 36296: return js;
|
|
8612
8698
|
case 35678:
|
|
8613
8699
|
case 36198:
|
|
8614
8700
|
case 36298:
|
|
8615
8701
|
case 36306:
|
|
8616
|
-
case 35682: return
|
|
8702
|
+
case 35682: return Ms;
|
|
8617
8703
|
case 35679:
|
|
8618
8704
|
case 36299:
|
|
8619
|
-
case 36307: return
|
|
8705
|
+
case 36307: return Ns;
|
|
8620
8706
|
case 35680:
|
|
8621
8707
|
case 36300:
|
|
8622
8708
|
case 36308:
|
|
8623
|
-
case 36293: return
|
|
8709
|
+
case 36293: return Ps;
|
|
8624
8710
|
case 36289:
|
|
8625
8711
|
case 36303:
|
|
8626
8712
|
case 36311:
|
|
8627
|
-
case 36292: return
|
|
8713
|
+
case 36292: return Fs;
|
|
8628
8714
|
}
|
|
8629
8715
|
}
|
|
8630
|
-
var
|
|
8716
|
+
var Ls = class {
|
|
8631
8717
|
constructor(e, t, n) {
|
|
8632
|
-
this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.setValue =
|
|
8718
|
+
this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.setValue = gs(t.type);
|
|
8633
8719
|
}
|
|
8634
|
-
},
|
|
8720
|
+
}, Rs = class {
|
|
8635
8721
|
constructor(e, t, n) {
|
|
8636
|
-
this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.size = t.size, this.setValue =
|
|
8722
|
+
this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.size = t.size, this.setValue = Is(t.type);
|
|
8637
8723
|
}
|
|
8638
|
-
},
|
|
8724
|
+
}, zs = class {
|
|
8639
8725
|
constructor(e) {
|
|
8640
8726
|
this.id = e, this.seq = [], this.map = {};
|
|
8641
8727
|
}
|
|
@@ -8646,31 +8732,31 @@ var Is = class {
|
|
|
8646
8732
|
a.setValue(e, t[a.id], n);
|
|
8647
8733
|
}
|
|
8648
8734
|
}
|
|
8649
|
-
},
|
|
8650
|
-
function
|
|
8735
|
+
}, Bs = /(\w+)(\])?(\[|\.)?/g;
|
|
8736
|
+
function Vs(e, t) {
|
|
8651
8737
|
e.seq.push(t), e.map[t.id] = t;
|
|
8652
8738
|
}
|
|
8653
|
-
function
|
|
8739
|
+
function Hs(e, t, n) {
|
|
8654
8740
|
let r = e.name, i = r.length;
|
|
8655
|
-
for (
|
|
8656
|
-
let a =
|
|
8741
|
+
for (Bs.lastIndex = 0;;) {
|
|
8742
|
+
let a = Bs.exec(r), o = Bs.lastIndex, s = a[1], c = a[2] === "]", l = a[3];
|
|
8657
8743
|
if (c && (s |= 0), l === void 0 || l === "[" && o + 2 === i) {
|
|
8658
|
-
|
|
8744
|
+
Vs(n, l === void 0 ? new Ls(s, e, t) : new Rs(s, e, t));
|
|
8659
8745
|
break;
|
|
8660
8746
|
}
|
|
8661
8747
|
{
|
|
8662
8748
|
let e = n.map[s];
|
|
8663
|
-
e === void 0 && (e = new
|
|
8749
|
+
e === void 0 && (e = new zs(s), Vs(n, e)), n = e;
|
|
8664
8750
|
}
|
|
8665
8751
|
}
|
|
8666
8752
|
}
|
|
8667
|
-
var
|
|
8753
|
+
var Us = class {
|
|
8668
8754
|
constructor(e, t) {
|
|
8669
8755
|
this.seq = [], this.map = {};
|
|
8670
8756
|
let n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS);
|
|
8671
8757
|
for (let r = 0; r < n; ++r) {
|
|
8672
8758
|
let n = e.getActiveUniform(t, r);
|
|
8673
|
-
|
|
8759
|
+
Hs(n, e.getUniformLocation(t, n.name), this);
|
|
8674
8760
|
}
|
|
8675
8761
|
}
|
|
8676
8762
|
setValue(e, t, n, r) {
|
|
@@ -8696,12 +8782,12 @@ var Hs = class {
|
|
|
8696
8782
|
return n;
|
|
8697
8783
|
}
|
|
8698
8784
|
};
|
|
8699
|
-
function
|
|
8785
|
+
function Ws(e, t, n) {
|
|
8700
8786
|
let r = e.createShader(t);
|
|
8701
8787
|
return e.shaderSource(r, n), e.compileShader(r), r;
|
|
8702
8788
|
}
|
|
8703
|
-
var
|
|
8704
|
-
function
|
|
8789
|
+
var Gs = 37297, Ks = 0;
|
|
8790
|
+
function qs(e, t) {
|
|
8705
8791
|
let n = e.split("\n"), r = [], i = Math.max(t - 6, 0), a = Math.min(t + 6, n.length);
|
|
8706
8792
|
for (let e = i; e < a; e++) {
|
|
8707
8793
|
let i = e + 1;
|
|
@@ -8709,35 +8795,35 @@ function Ks(e, t) {
|
|
|
8709
8795
|
}
|
|
8710
8796
|
return r.join("\n");
|
|
8711
8797
|
}
|
|
8712
|
-
var
|
|
8713
|
-
function
|
|
8714
|
-
Y._getMatrix(
|
|
8715
|
-
let t = `mat3( ${
|
|
8798
|
+
var Js = /*@__PURE__*/ new G();
|
|
8799
|
+
function Ys(e) {
|
|
8800
|
+
Y._getMatrix(Js, Y.workingColorSpace, e);
|
|
8801
|
+
let t = `mat3( ${Js.elements.map((e) => e.toFixed(4))} )`;
|
|
8716
8802
|
switch (Y.getTransfer(e)) {
|
|
8717
8803
|
case x: return [t, "LinearTransferOETF"];
|
|
8718
8804
|
case S: return [t, "sRGBTransferOETF"];
|
|
8719
8805
|
default: return console.warn("THREE.WebGLProgram: Unsupported color space: ", e), [t, "LinearTransferOETF"];
|
|
8720
8806
|
}
|
|
8721
8807
|
}
|
|
8722
|
-
function
|
|
8808
|
+
function Xs(e, t, n) {
|
|
8723
8809
|
let r = e.getShaderParameter(t, e.COMPILE_STATUS), i = (e.getShaderInfoLog(t) || "").trim();
|
|
8724
8810
|
if (r && i === "") return "";
|
|
8725
8811
|
let a = /ERROR: 0:(\d+)/.exec(i);
|
|
8726
8812
|
if (a) {
|
|
8727
8813
|
let r = parseInt(a[1]);
|
|
8728
|
-
return n.toUpperCase() + "\n\n" + i + "\n\n" +
|
|
8814
|
+
return n.toUpperCase() + "\n\n" + i + "\n\n" + qs(e.getShaderSource(t), r);
|
|
8729
8815
|
}
|
|
8730
8816
|
return i;
|
|
8731
8817
|
}
|
|
8732
|
-
function
|
|
8733
|
-
let n =
|
|
8818
|
+
function Zs(e, t) {
|
|
8819
|
+
let n = Ys(t);
|
|
8734
8820
|
return [
|
|
8735
8821
|
`vec4 ${e}( vec4 value ) {`,
|
|
8736
8822
|
` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,
|
|
8737
8823
|
"}"
|
|
8738
8824
|
].join("\n");
|
|
8739
8825
|
}
|
|
8740
|
-
function
|
|
8826
|
+
function Qs(e, t) {
|
|
8741
8827
|
let n;
|
|
8742
8828
|
switch (t) {
|
|
8743
8829
|
case 1:
|
|
@@ -8765,19 +8851,19 @@ function Zs(e, t) {
|
|
|
8765
8851
|
}
|
|
8766
8852
|
return "vec3 " + e + "( vec3 color ) { return " + n + "ToneMapping( color ); }";
|
|
8767
8853
|
}
|
|
8768
|
-
var
|
|
8769
|
-
function
|
|
8770
|
-
return Y.getLuminanceCoefficients(
|
|
8854
|
+
var $s = /*@__PURE__*/ new U();
|
|
8855
|
+
function ec() {
|
|
8856
|
+
return Y.getLuminanceCoefficients($s), [
|
|
8771
8857
|
"float luminance( const in vec3 rgb ) {",
|
|
8772
|
-
` const vec3 weights = vec3( ${
|
|
8858
|
+
` const vec3 weights = vec3( ${$s.x.toFixed(4)}, ${$s.y.toFixed(4)}, ${$s.z.toFixed(4)} );`,
|
|
8773
8859
|
" return dot( weights, rgb );",
|
|
8774
8860
|
"}"
|
|
8775
8861
|
].join("\n");
|
|
8776
8862
|
}
|
|
8777
|
-
function ec(e) {
|
|
8778
|
-
return [e.extensionClipCullDistance ? "#extension GL_ANGLE_clip_cull_distance : require" : "", e.extensionMultiDraw ? "#extension GL_ANGLE_multi_draw : require" : ""].filter(rc).join("\n");
|
|
8779
|
-
}
|
|
8780
8863
|
function tc(e) {
|
|
8864
|
+
return [e.extensionClipCullDistance ? "#extension GL_ANGLE_clip_cull_distance : require" : "", e.extensionMultiDraw ? "#extension GL_ANGLE_multi_draw : require" : ""].filter(ic).join("\n");
|
|
8865
|
+
}
|
|
8866
|
+
function nc(e) {
|
|
8781
8867
|
let t = [];
|
|
8782
8868
|
for (let n in e) {
|
|
8783
8869
|
let r = e[n];
|
|
@@ -8785,7 +8871,7 @@ function tc(e) {
|
|
|
8785
8871
|
}
|
|
8786
8872
|
return t.join("\n");
|
|
8787
8873
|
}
|
|
8788
|
-
function
|
|
8874
|
+
function rc(e, t) {
|
|
8789
8875
|
let n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES);
|
|
8790
8876
|
for (let i = 0; i < r; i++) {
|
|
8791
8877
|
let r = e.getActiveAttrib(t, i), a = r.name, o = 1;
|
|
@@ -8797,40 +8883,40 @@ function nc(e, t) {
|
|
|
8797
8883
|
}
|
|
8798
8884
|
return n;
|
|
8799
8885
|
}
|
|
8800
|
-
function
|
|
8886
|
+
function ic(e) {
|
|
8801
8887
|
return e !== "";
|
|
8802
8888
|
}
|
|
8803
|
-
function
|
|
8889
|
+
function ac(e, t) {
|
|
8804
8890
|
let n = t.numSpotLightShadows + t.numSpotLightMaps - t.numSpotLightShadowsWithMaps;
|
|
8805
8891
|
return e.replace(/NUM_DIR_LIGHTS/g, t.numDirLights).replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g, t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g, n).replace(/NUM_RECT_AREA_LIGHTS/g, t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, t.numPointLights).replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g, t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, t.numPointLightShadows);
|
|
8806
8892
|
}
|
|
8807
|
-
function
|
|
8893
|
+
function oc(e, t) {
|
|
8808
8894
|
return e.replace(/NUM_CLIPPING_PLANES/g, t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, t.numClippingPlanes - t.numClipIntersection);
|
|
8809
8895
|
}
|
|
8810
|
-
var
|
|
8811
|
-
function
|
|
8812
|
-
return e.replace(
|
|
8896
|
+
var sc = /^[ \t]*#include +<([\w\d./]+)>/gm;
|
|
8897
|
+
function cc(e) {
|
|
8898
|
+
return e.replace(sc, uc);
|
|
8813
8899
|
}
|
|
8814
|
-
var
|
|
8815
|
-
function
|
|
8900
|
+
var lc = /* @__PURE__ */ new Map();
|
|
8901
|
+
function uc(e, t) {
|
|
8816
8902
|
let n = Q[t];
|
|
8817
8903
|
if (n === void 0) {
|
|
8818
|
-
let e =
|
|
8904
|
+
let e = lc.get(t);
|
|
8819
8905
|
if (e !== void 0) n = Q[e], console.warn("THREE.WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.", t, e);
|
|
8820
8906
|
else throw Error("Can not resolve #include <" + t + ">");
|
|
8821
8907
|
}
|
|
8822
|
-
return
|
|
8908
|
+
return cc(n);
|
|
8823
8909
|
}
|
|
8824
|
-
var
|
|
8825
|
-
function
|
|
8826
|
-
return e.replace(
|
|
8910
|
+
var dc = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;
|
|
8911
|
+
function fc(e) {
|
|
8912
|
+
return e.replace(dc, pc);
|
|
8827
8913
|
}
|
|
8828
|
-
function
|
|
8914
|
+
function pc(e, t, n, r) {
|
|
8829
8915
|
let i = "";
|
|
8830
8916
|
for (let e = parseInt(t); e < parseInt(n); e++) i += r.replace(/\[\s*i\s*\]/g, "[ " + e + " ]").replace(/UNROLLED_LOOP_INDEX/g, e);
|
|
8831
8917
|
return i;
|
|
8832
8918
|
}
|
|
8833
|
-
function
|
|
8919
|
+
function mc(e) {
|
|
8834
8920
|
let t = `precision ${e.precision} float;
|
|
8835
8921
|
precision ${e.precision} int;
|
|
8836
8922
|
precision ${e.precision} sampler2D;
|
|
@@ -8851,11 +8937,11 @@ function pc(e) {
|
|
|
8851
8937
|
`;
|
|
8852
8938
|
return e.precision === "highp" ? t += "\n#define HIGH_PRECISION" : e.precision === "mediump" ? t += "\n#define MEDIUM_PRECISION" : e.precision === "lowp" && (t += "\n#define LOW_PRECISION"), t;
|
|
8853
8939
|
}
|
|
8854
|
-
function
|
|
8940
|
+
function hc(e) {
|
|
8855
8941
|
let t = "SHADOWMAP_TYPE_BASIC";
|
|
8856
8942
|
return e.shadowMapType === 1 ? t = "SHADOWMAP_TYPE_PCF" : e.shadowMapType === 2 ? t = "SHADOWMAP_TYPE_PCF_SOFT" : e.shadowMapType === 3 && (t = "SHADOWMAP_TYPE_VSM"), t;
|
|
8857
8943
|
}
|
|
8858
|
-
function
|
|
8944
|
+
function gc(e) {
|
|
8859
8945
|
let t = "ENVMAP_TYPE_CUBE";
|
|
8860
8946
|
if (e.envMap) switch (e.envMapMode) {
|
|
8861
8947
|
case 301:
|
|
@@ -8866,14 +8952,14 @@ function hc(e) {
|
|
|
8866
8952
|
}
|
|
8867
8953
|
return t;
|
|
8868
8954
|
}
|
|
8869
|
-
function
|
|
8955
|
+
function _c(e) {
|
|
8870
8956
|
let t = "ENVMAP_MODE_REFLECTION";
|
|
8871
8957
|
if (e.envMap) switch (e.envMapMode) {
|
|
8872
8958
|
case 302: t = "ENVMAP_MODE_REFRACTION";
|
|
8873
8959
|
}
|
|
8874
8960
|
return t;
|
|
8875
8961
|
}
|
|
8876
|
-
function
|
|
8962
|
+
function vc(e) {
|
|
8877
8963
|
let t = "ENVMAP_BLENDING_NONE";
|
|
8878
8964
|
if (e.envMap) switch (e.combine) {
|
|
8879
8965
|
case 0:
|
|
@@ -8886,7 +8972,7 @@ function _c(e) {
|
|
|
8886
8972
|
}
|
|
8887
8973
|
return t;
|
|
8888
8974
|
}
|
|
8889
|
-
function
|
|
8975
|
+
function yc(e) {
|
|
8890
8976
|
let t = e.envMapCubeUVHeight;
|
|
8891
8977
|
if (t === null) return null;
|
|
8892
8978
|
let n = Math.log2(t) - 2, r = 1 / t;
|
|
@@ -8896,18 +8982,18 @@ function vc(e) {
|
|
|
8896
8982
|
maxMip: n
|
|
8897
8983
|
};
|
|
8898
8984
|
}
|
|
8899
|
-
function
|
|
8900
|
-
let i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c =
|
|
8985
|
+
function bc(e, t, n, r) {
|
|
8986
|
+
let i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c = hc(n), l = gc(n), u = _c(n), d = vc(n), f = yc(n), p = tc(n), m = nc(a), h = i.createProgram(), g, _, v = n.glslVersion ? "#version " + n.glslVersion + "\n" : "";
|
|
8901
8987
|
n.isRawShaderMaterial ? (g = [
|
|
8902
8988
|
"#define SHADER_TYPE " + n.shaderType,
|
|
8903
8989
|
"#define SHADER_NAME " + n.shaderName,
|
|
8904
8990
|
m
|
|
8905
|
-
].filter(
|
|
8991
|
+
].filter(ic).join("\n"), g.length > 0 && (g += "\n"), _ = [
|
|
8906
8992
|
"#define SHADER_TYPE " + n.shaderType,
|
|
8907
8993
|
"#define SHADER_NAME " + n.shaderName,
|
|
8908
8994
|
m
|
|
8909
|
-
].filter(
|
|
8910
|
-
|
|
8995
|
+
].filter(ic).join("\n"), _.length > 0 && (_ += "\n")) : (g = [
|
|
8996
|
+
mc(n),
|
|
8911
8997
|
"#define SHADER_TYPE " + n.shaderType,
|
|
8912
8998
|
"#define SHADER_NAME " + n.shaderName,
|
|
8913
8999
|
m,
|
|
@@ -9035,8 +9121,8 @@ function yc(e, t, n, r) {
|
|
|
9035
9121
|
" attribute vec4 skinWeight;",
|
|
9036
9122
|
"#endif",
|
|
9037
9123
|
"\n"
|
|
9038
|
-
].filter(
|
|
9039
|
-
|
|
9124
|
+
].filter(ic).join("\n"), _ = [
|
|
9125
|
+
mc(n),
|
|
9040
9126
|
"#define SHADER_TYPE " + n.shaderType,
|
|
9041
9127
|
"#define SHADER_NAME " + n.shaderName,
|
|
9042
9128
|
m,
|
|
@@ -9107,15 +9193,15 @@ function yc(e, t, n, r) {
|
|
|
9107
9193
|
"uniform bool isOrthographic;",
|
|
9108
9194
|
n.toneMapping === 0 ? "" : "#define TONE_MAPPING",
|
|
9109
9195
|
n.toneMapping === 0 ? "" : Q.tonemapping_pars_fragment,
|
|
9110
|
-
n.toneMapping === 0 ? "" :
|
|
9196
|
+
n.toneMapping === 0 ? "" : Qs("toneMapping", n.toneMapping),
|
|
9111
9197
|
n.dithering ? "#define DITHERING" : "",
|
|
9112
9198
|
n.opaque ? "#define OPAQUE" : "",
|
|
9113
9199
|
Q.colorspace_pars_fragment,
|
|
9114
|
-
|
|
9115
|
-
|
|
9200
|
+
Zs("linearToOutputTexel", n.outputColorSpace),
|
|
9201
|
+
ec(),
|
|
9116
9202
|
n.useDepthPacking ? "#define DEPTH_PACKING " + n.depthPacking : "",
|
|
9117
9203
|
"\n"
|
|
9118
|
-
].filter(
|
|
9204
|
+
].filter(ic).join("\n")), o = cc(o), o = ac(o, n), o = oc(o, n), s = cc(s), s = ac(s, n), s = oc(s, n), o = fc(o), s = fc(s), n.isRawShaderMaterial !== !0 && (v = "#version 300 es\n", g = [
|
|
9119
9205
|
p,
|
|
9120
9206
|
"#define attribute in",
|
|
9121
9207
|
"#define varying out",
|
|
@@ -9135,7 +9221,7 @@ function yc(e, t, n, r) {
|
|
|
9135
9221
|
"#define texture2DProjGradEXT textureProjGrad",
|
|
9136
9222
|
"#define textureCubeGradEXT textureGrad"
|
|
9137
9223
|
].join("\n") + "\n" + _);
|
|
9138
|
-
let y = v + g + o, b = v + _ + s, x =
|
|
9224
|
+
let y = v + g + o, b = v + _ + s, x = Ws(i, i.VERTEX_SHADER, y), S = Ws(i, i.FRAGMENT_SHADER, b);
|
|
9139
9225
|
i.attachShader(h, x), i.attachShader(h, S), n.index0AttributeName === void 0 ? n.morphTargets === !0 && i.bindAttribLocation(h, 0, "position") : i.bindAttribLocation(h, 0, n.index0AttributeName), i.linkProgram(h);
|
|
9140
9226
|
function C(t) {
|
|
9141
9227
|
if (e.debug.checkShaderErrors) {
|
|
@@ -9143,7 +9229,7 @@ function yc(e, t, n, r) {
|
|
|
9143
9229
|
if (i.getProgramParameter(h, i.LINK_STATUS) === !1) {
|
|
9144
9230
|
if (l = !1, typeof e.debug.onShaderError == "function") e.debug.onShaderError(i, h, x, S);
|
|
9145
9231
|
else {
|
|
9146
|
-
let e =
|
|
9232
|
+
let e = Xs(i, x, "vertex"), n = Xs(i, S, "fragment");
|
|
9147
9233
|
console.error("THREE.WebGLProgram: Shader Error " + i.getError() + " - VALIDATE_STATUS " + i.getProgramParameter(h, i.VALIDATE_STATUS) + "\n\nMaterial Name: " + t.name + "\nMaterial Type: " + t.type + "\n\nProgram Info Log: " + o + "\n" + e + "\n" + n);
|
|
9148
9234
|
}
|
|
9149
9235
|
} else o === "" ? (s === "" || c === "") && (u = !1) : console.warn("THREE.WebGLProgram: Program Info Log:", o);
|
|
@@ -9160,7 +9246,7 @@ function yc(e, t, n, r) {
|
|
|
9160
9246
|
}
|
|
9161
9247
|
});
|
|
9162
9248
|
}
|
|
9163
|
-
i.deleteShader(x), i.deleteShader(S), w = new
|
|
9249
|
+
i.deleteShader(x), i.deleteShader(S), w = new Us(i, h), T = rc(i, h);
|
|
9164
9250
|
}
|
|
9165
9251
|
let w;
|
|
9166
9252
|
this.getUniforms = function() {
|
|
@@ -9172,12 +9258,12 @@ function yc(e, t, n, r) {
|
|
|
9172
9258
|
};
|
|
9173
9259
|
let E = n.rendererExtensionParallelShaderCompile === !1;
|
|
9174
9260
|
return this.isReady = function() {
|
|
9175
|
-
return E === !1 && (E = i.getProgramParameter(h,
|
|
9261
|
+
return E === !1 && (E = i.getProgramParameter(h, Gs)), E;
|
|
9176
9262
|
}, this.destroy = function() {
|
|
9177
9263
|
r.releaseStatesOfProgram(this), i.deleteProgram(h), this.program = void 0;
|
|
9178
|
-
}, this.type = n.shaderType, this.name = n.shaderName, this.id =
|
|
9264
|
+
}, this.type = n.shaderType, this.name = n.shaderName, this.id = Ks++, this.cacheKey = t, this.usedTimes = 1, this.program = h, this.vertexShader = x, this.fragmentShader = S, this;
|
|
9179
9265
|
}
|
|
9180
|
-
var
|
|
9266
|
+
var xc = 0, Sc = class {
|
|
9181
9267
|
constructor() {
|
|
9182
9268
|
this.shaderCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map();
|
|
9183
9269
|
}
|
|
@@ -9205,15 +9291,15 @@ var bc = 0, xc = class {
|
|
|
9205
9291
|
}
|
|
9206
9292
|
_getShaderStage(e) {
|
|
9207
9293
|
let t = this.shaderCache, n = t.get(e);
|
|
9208
|
-
return n === void 0 && (n = new
|
|
9294
|
+
return n === void 0 && (n = new Cc(e), t.set(e, n)), n;
|
|
9209
9295
|
}
|
|
9210
|
-
},
|
|
9296
|
+
}, Cc = class {
|
|
9211
9297
|
constructor(e) {
|
|
9212
|
-
this.id =
|
|
9298
|
+
this.id = xc++, this.code = e, this.usedTimes = 0;
|
|
9213
9299
|
}
|
|
9214
9300
|
};
|
|
9215
|
-
function
|
|
9216
|
-
let s = new yt(), c = new
|
|
9301
|
+
function wc(e, t, n, r, i, a, o) {
|
|
9302
|
+
let s = new yt(), c = new Sc(), l = /* @__PURE__ */ new Set(), u = [], d = i.logarithmicDepthBuffer, f = i.vertexTextures, p = i.precision, m = {
|
|
9217
9303
|
MeshDepthMaterial: "depth",
|
|
9218
9304
|
MeshDistanceMaterial: "distanceRGBA",
|
|
9219
9305
|
MeshNormalMaterial: "normal",
|
|
@@ -9240,10 +9326,10 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9240
9326
|
y.morphAttributes.position !== void 0 && (D = 1), y.morphAttributes.normal !== void 0 && (D = 2), y.morphAttributes.color !== void 0 && (D = 3);
|
|
9241
9327
|
let O, k, A, j;
|
|
9242
9328
|
if (w) {
|
|
9243
|
-
let e =
|
|
9329
|
+
let e = Qa[w];
|
|
9244
9330
|
O = e.vertexShader, k = e.fragmentShader;
|
|
9245
9331
|
} else O = a.vertexShader, k = a.fragmentShader, c.update(a), A = c.getVertexShaderID(a), j = c.getFragmentShaderID(a);
|
|
9246
|
-
let M = e.getRenderTarget(), N = e.state.buffers.depth.getReversed(),
|
|
9332
|
+
let M = e.getRenderTarget(), N = e.state.buffers.depth.getReversed(), ee = _.isInstancedMesh === !0, P = _.isBatchedMesh === !0, F = !!a.map, te = !!a.matcap, ne = !!S, I = !!a.aoMap, re = !!a.lightMap, ie = !!a.bumpMap, L = !!a.normalMap, R = !!a.displacementMap, z = !!a.emissiveMap, ae = !!a.metalnessMap, oe = !!a.roughnessMap, se = a.anisotropy > 0, ce = a.clearcoat > 0, le = a.dispersion > 0, ue = a.iridescence > 0, B = a.sheen > 0, de = a.transmission > 0, V = se && !!a.anisotropyMap, H = ce && !!a.clearcoatMap, U = ce && !!a.clearcoatNormalMap, fe = ce && !!a.clearcoatRoughnessMap, W = ue && !!a.iridescenceMap, G = ue && !!a.iridescenceThicknessMap, K = B && !!a.sheenColorMap, pe = B && !!a.sheenRoughnessMap, q = !!a.specularMap, me = !!a.specularColorMap, J = !!a.specularIntensityMap, he = de && !!a.transmissionMap, ge = de && !!a.thicknessMap, _e = !!a.gradientMap, ve = !!a.alphaMap, ye = a.alphaTest > 0, be = !!a.alphaHash, xe = !!a.extensions, Se = 0;
|
|
9247
9333
|
a.toneMapped && (M === null || M.isXRRenderTarget === !0) && (Se = e.toneMapping);
|
|
9248
9334
|
let Ce = {
|
|
9249
9335
|
shaderID: w,
|
|
@@ -9257,27 +9343,27 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9257
9343
|
isRawShaderMaterial: a.isRawShaderMaterial === !0,
|
|
9258
9344
|
glslVersion: a.glslVersion,
|
|
9259
9345
|
precision: p,
|
|
9260
|
-
batching:
|
|
9261
|
-
batchingColor:
|
|
9262
|
-
instancing:
|
|
9263
|
-
instancingColor:
|
|
9264
|
-
instancingMorph:
|
|
9346
|
+
batching: P,
|
|
9347
|
+
batchingColor: P && _._colorsTexture !== null,
|
|
9348
|
+
instancing: ee,
|
|
9349
|
+
instancingColor: ee && _.instanceColor !== null,
|
|
9350
|
+
instancingMorph: ee && _.morphTexture !== null,
|
|
9265
9351
|
supportsVertexTextures: f,
|
|
9266
9352
|
outputColorSpace: M === null ? e.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : b,
|
|
9267
9353
|
alphaToCoverage: !!a.alphaToCoverage,
|
|
9268
|
-
map:
|
|
9269
|
-
matcap:
|
|
9270
|
-
envMap:
|
|
9271
|
-
envMapMode:
|
|
9354
|
+
map: F,
|
|
9355
|
+
matcap: te,
|
|
9356
|
+
envMap: ne,
|
|
9357
|
+
envMapMode: ne && S.mapping,
|
|
9272
9358
|
envMapCubeUVHeight: C,
|
|
9273
|
-
aoMap:
|
|
9274
|
-
lightMap:
|
|
9275
|
-
bumpMap:
|
|
9276
|
-
normalMap:
|
|
9359
|
+
aoMap: I,
|
|
9360
|
+
lightMap: re,
|
|
9361
|
+
bumpMap: ie,
|
|
9362
|
+
normalMap: L,
|
|
9277
9363
|
displacementMap: f && R,
|
|
9278
9364
|
emissiveMap: z,
|
|
9279
|
-
normalMapObjectSpace:
|
|
9280
|
-
normalMapTangentSpace:
|
|
9365
|
+
normalMapObjectSpace: L && a.normalMapType === 1,
|
|
9366
|
+
normalMapTangentSpace: L && a.normalMapType === 0,
|
|
9281
9367
|
metalnessMap: ae,
|
|
9282
9368
|
roughnessMap: oe,
|
|
9283
9369
|
anisotropy: se,
|
|
@@ -9287,10 +9373,10 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9287
9373
|
clearcoatNormalMap: U,
|
|
9288
9374
|
clearcoatRoughnessMap: fe,
|
|
9289
9375
|
dispersion: le,
|
|
9290
|
-
iridescence:
|
|
9376
|
+
iridescence: ue,
|
|
9291
9377
|
iridescenceMap: W,
|
|
9292
9378
|
iridescenceThicknessMap: G,
|
|
9293
|
-
sheen:
|
|
9379
|
+
sheen: B,
|
|
9294
9380
|
sheenColorMap: K,
|
|
9295
9381
|
sheenRoughnessMap: pe,
|
|
9296
9382
|
specularMap: q,
|
|
@@ -9305,11 +9391,11 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9305
9391
|
alphaTest: ye,
|
|
9306
9392
|
alphaHash: be,
|
|
9307
9393
|
combine: a.combine,
|
|
9308
|
-
mapUv:
|
|
9309
|
-
aoMapUv:
|
|
9310
|
-
lightMapUv:
|
|
9311
|
-
bumpMapUv:
|
|
9312
|
-
normalMapUv:
|
|
9394
|
+
mapUv: F && h(a.map.channel),
|
|
9395
|
+
aoMapUv: I && h(a.aoMap.channel),
|
|
9396
|
+
lightMapUv: re && h(a.lightMap.channel),
|
|
9397
|
+
bumpMapUv: ie && h(a.bumpMap.channel),
|
|
9398
|
+
normalMapUv: L && h(a.normalMap.channel),
|
|
9313
9399
|
displacementMapUv: R && h(a.displacementMap.channel),
|
|
9314
9400
|
emissiveMapUv: z && h(a.emissiveMap.channel),
|
|
9315
9401
|
metalnessMapUv: ae && h(a.metalnessMap.channel),
|
|
@@ -9328,10 +9414,10 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9328
9414
|
transmissionMapUv: he && h(a.transmissionMap.channel),
|
|
9329
9415
|
thicknessMapUv: ge && h(a.thicknessMap.channel),
|
|
9330
9416
|
alphaMapUv: ve && h(a.alphaMap.channel),
|
|
9331
|
-
vertexTangents: !!y.attributes.tangent && (
|
|
9417
|
+
vertexTangents: !!y.attributes.tangent && (L || se),
|
|
9332
9418
|
vertexColors: a.vertexColors,
|
|
9333
9419
|
vertexAlphas: a.vertexColors === !0 && !!y.attributes.color && y.attributes.color.itemSize === 4,
|
|
9334
|
-
pointsUvs: _.isPoints === !0 && !!y.attributes.uv && (
|
|
9420
|
+
pointsUvs: _.isPoints === !0 && !!y.attributes.uv && (F || ve),
|
|
9335
9421
|
fog: !!v,
|
|
9336
9422
|
useFog: a.fog === !0,
|
|
9337
9423
|
fogExp2: !!v && v.isFogExp2,
|
|
@@ -9362,7 +9448,7 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9362
9448
|
shadowMapEnabled: e.shadowMap.enabled && u.length > 0,
|
|
9363
9449
|
shadowMapType: e.shadowMap.type,
|
|
9364
9450
|
toneMapping: Se,
|
|
9365
|
-
decodeVideoTexture:
|
|
9451
|
+
decodeVideoTexture: F && a.map.isVideoTexture === !0 && Y.getTransfer(a.map.colorSpace) === "srgb",
|
|
9366
9452
|
decodeVideoTextureEmissive: z && a.emissiveMap.isVideoTexture === !0 && Y.getTransfer(a.emissiveMap.colorSpace) === "srgb",
|
|
9367
9453
|
premultipliedAlpha: a.premultipliedAlpha,
|
|
9368
9454
|
doubleSided: a.side === 2,
|
|
@@ -9371,7 +9457,7 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9371
9457
|
depthPacking: a.depthPacking || 0,
|
|
9372
9458
|
index0AttributeName: a.index0AttributeName,
|
|
9373
9459
|
extensionClipCullDistance: xe && a.extensions.clipCullDistance === !0 && r.has("WEBGL_clip_cull_distance"),
|
|
9374
|
-
extensionMultiDraw: (xe && a.extensions.multiDraw === !0 ||
|
|
9460
|
+
extensionMultiDraw: (xe && a.extensions.multiDraw === !0 || P) && r.has("WEBGL_multi_draw"),
|
|
9375
9461
|
rendererExtensionParallelShaderCompile: r.has("KHR_parallel_shader_compile"),
|
|
9376
9462
|
customProgramCacheKey: a.customProgramCacheKey()
|
|
9377
9463
|
};
|
|
@@ -9391,7 +9477,7 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9391
9477
|
function x(e) {
|
|
9392
9478
|
let t = m[e.type], n;
|
|
9393
9479
|
if (t) {
|
|
9394
|
-
let e =
|
|
9480
|
+
let e = Qa[t];
|
|
9395
9481
|
n = Rn.clone(e.uniforms);
|
|
9396
9482
|
} else n = e.uniforms;
|
|
9397
9483
|
return n;
|
|
@@ -9405,7 +9491,7 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9405
9491
|
break;
|
|
9406
9492
|
}
|
|
9407
9493
|
}
|
|
9408
|
-
return r === void 0 && (r = new
|
|
9494
|
+
return r === void 0 && (r = new bc(e, n, t, a), u.push(r)), r;
|
|
9409
9495
|
}
|
|
9410
9496
|
function C(e) {
|
|
9411
9497
|
if (--e.usedTimes === 0) {
|
|
@@ -9430,7 +9516,7 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9430
9516
|
dispose: T
|
|
9431
9517
|
};
|
|
9432
9518
|
}
|
|
9433
|
-
function
|
|
9519
|
+
function Tc() {
|
|
9434
9520
|
let e = /* @__PURE__ */ new WeakMap();
|
|
9435
9521
|
function t(t) {
|
|
9436
9522
|
return e.has(t);
|
|
@@ -9456,13 +9542,13 @@ function wc() {
|
|
|
9456
9542
|
dispose: a
|
|
9457
9543
|
};
|
|
9458
9544
|
}
|
|
9459
|
-
function
|
|
9545
|
+
function Ec(e, t) {
|
|
9460
9546
|
return e.groupOrder === t.groupOrder ? e.renderOrder === t.renderOrder ? e.material.id === t.material.id ? e.z === t.z ? e.id - t.id : e.z - t.z : e.material.id - t.material.id : e.renderOrder - t.renderOrder : e.groupOrder - t.groupOrder;
|
|
9461
9547
|
}
|
|
9462
|
-
function
|
|
9548
|
+
function Dc(e, t) {
|
|
9463
9549
|
return e.groupOrder === t.groupOrder ? e.renderOrder === t.renderOrder ? e.z === t.z ? e.id - t.id : t.z - e.z : e.renderOrder - t.renderOrder : e.groupOrder - t.groupOrder;
|
|
9464
9550
|
}
|
|
9465
|
-
function
|
|
9551
|
+
function Oc() {
|
|
9466
9552
|
let e = [], t = 0, n = [], r = [], i = [];
|
|
9467
9553
|
function a() {
|
|
9468
9554
|
t = 0, n.length = 0, r.length = 0, i.length = 0;
|
|
@@ -9489,7 +9575,7 @@ function Dc() {
|
|
|
9489
9575
|
a.transmission > 0 ? r.unshift(u) : a.transparent === !0 ? i.unshift(u) : n.unshift(u);
|
|
9490
9576
|
}
|
|
9491
9577
|
function l(e, t) {
|
|
9492
|
-
n.length > 1 && n.sort(e ||
|
|
9578
|
+
n.length > 1 && n.sort(e || Ec), r.length > 1 && r.sort(t || Dc), i.length > 1 && i.sort(t || Dc);
|
|
9493
9579
|
}
|
|
9494
9580
|
function u() {
|
|
9495
9581
|
for (let n = t, r = e.length; n < r; n++) {
|
|
@@ -9509,11 +9595,11 @@ function Dc() {
|
|
|
9509
9595
|
sort: l
|
|
9510
9596
|
};
|
|
9511
9597
|
}
|
|
9512
|
-
function
|
|
9598
|
+
function kc() {
|
|
9513
9599
|
let e = /* @__PURE__ */ new WeakMap();
|
|
9514
9600
|
function t(t, n) {
|
|
9515
9601
|
let r = e.get(t), i;
|
|
9516
|
-
return r === void 0 ? (i = new
|
|
9602
|
+
return r === void 0 ? (i = new Oc(), e.set(t, [i])) : n >= r.length ? (i = new Oc(), r.push(i)) : i = r[n], i;
|
|
9517
9603
|
}
|
|
9518
9604
|
function n() {
|
|
9519
9605
|
e = /* @__PURE__ */ new WeakMap();
|
|
@@ -9523,7 +9609,7 @@ function Oc() {
|
|
|
9523
9609
|
dispose: n
|
|
9524
9610
|
};
|
|
9525
9611
|
}
|
|
9526
|
-
function
|
|
9612
|
+
function Ac() {
|
|
9527
9613
|
let e = {};
|
|
9528
9614
|
return { get: function(t) {
|
|
9529
9615
|
if (e[t.id] !== void 0) return e[t.id];
|
|
@@ -9571,7 +9657,7 @@ function kc() {
|
|
|
9571
9657
|
return e[t.id] = n, n;
|
|
9572
9658
|
} };
|
|
9573
9659
|
}
|
|
9574
|
-
function
|
|
9660
|
+
function jc() {
|
|
9575
9661
|
let e = {};
|
|
9576
9662
|
return { get: function(t) {
|
|
9577
9663
|
if (e[t.id] !== void 0) return e[t.id];
|
|
@@ -9608,12 +9694,12 @@ function Ac() {
|
|
|
9608
9694
|
return e[t.id] = n, n;
|
|
9609
9695
|
} };
|
|
9610
9696
|
}
|
|
9611
|
-
var
|
|
9612
|
-
function
|
|
9697
|
+
var Mc = 0;
|
|
9698
|
+
function Nc(e, t) {
|
|
9613
9699
|
return (t.castShadow ? 2 : 0) - (e.castShadow ? 2 : 0) + +!!t.map - !!e.map;
|
|
9614
9700
|
}
|
|
9615
|
-
function
|
|
9616
|
-
let t = new
|
|
9701
|
+
function Pc(e) {
|
|
9702
|
+
let t = new Ac(), n = jc(), r = {
|
|
9617
9703
|
version: 0,
|
|
9618
9704
|
hash: {
|
|
9619
9705
|
directionalLength: -1,
|
|
@@ -9659,7 +9745,7 @@ function Nc(e) {
|
|
|
9659
9745
|
let a = 0, o = 0, s = 0;
|
|
9660
9746
|
for (let e = 0; e < 9; e++) r.probe[e].set(0, 0, 0);
|
|
9661
9747
|
let c = 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = 0, h = 0, g = 0, _ = 0, v = 0;
|
|
9662
|
-
i.sort(
|
|
9748
|
+
i.sort(Nc);
|
|
9663
9749
|
for (let e = 0, y = i.length; e < y; e++) {
|
|
9664
9750
|
let y = i[e], b = y.color, x = y.intensity, S = y.distance, C = y.shadow && y.shadow.map ? y.shadow.map.texture : null;
|
|
9665
9751
|
if (y.isAmbientLight) a += b.r * x, o += b.g * x, s += b.b * x;
|
|
@@ -9699,7 +9785,7 @@ function Nc(e) {
|
|
|
9699
9785
|
}
|
|
9700
9786
|
d > 0 && (e.has("OES_texture_float_linear") === !0 ? (r.rectAreaLTC1 = $.LTC_FLOAT_1, r.rectAreaLTC2 = $.LTC_FLOAT_2) : (r.rectAreaLTC1 = $.LTC_HALF_1, r.rectAreaLTC2 = $.LTC_HALF_2)), r.ambient[0] = a, r.ambient[1] = o, r.ambient[2] = s;
|
|
9701
9787
|
let y = r.hash;
|
|
9702
|
-
(y.directionalLength !== c || y.pointLength !== l || y.spotLength !== u || y.rectAreaLength !== d || y.hemiLength !== f || y.numDirectionalShadows !== p || y.numPointShadows !== m || y.numSpotShadows !== h || y.numSpotMaps !== g || y.numLightProbes !== v) && (r.directional.length = c, r.spot.length = u, r.rectArea.length = d, r.point.length = l, r.hemi.length = f, r.directionalShadow.length = p, r.directionalShadowMap.length = p, r.pointShadow.length = m, r.pointShadowMap.length = m, r.spotShadow.length = h, r.spotShadowMap.length = h, r.directionalShadowMatrix.length = p, r.pointShadowMatrix.length = m, r.spotLightMatrix.length = h + g - _, r.spotLightMap.length = g, r.numSpotLightShadowsWithMaps = _, r.numLightProbes = v, y.directionalLength = c, y.pointLength = l, y.spotLength = u, y.rectAreaLength = d, y.hemiLength = f, y.numDirectionalShadows = p, y.numPointShadows = m, y.numSpotShadows = h, y.numSpotMaps = g, y.numLightProbes = v, r.version =
|
|
9788
|
+
(y.directionalLength !== c || y.pointLength !== l || y.spotLength !== u || y.rectAreaLength !== d || y.hemiLength !== f || y.numDirectionalShadows !== p || y.numPointShadows !== m || y.numSpotShadows !== h || y.numSpotMaps !== g || y.numLightProbes !== v) && (r.directional.length = c, r.spot.length = u, r.rectArea.length = d, r.point.length = l, r.hemi.length = f, r.directionalShadow.length = p, r.directionalShadowMap.length = p, r.pointShadow.length = m, r.pointShadowMap.length = m, r.spotShadow.length = h, r.spotShadowMap.length = h, r.directionalShadowMatrix.length = p, r.pointShadowMatrix.length = m, r.spotLightMatrix.length = h + g - _, r.spotLightMap.length = g, r.numSpotLightShadowsWithMaps = _, r.numLightProbes = v, y.directionalLength = c, y.pointLength = l, y.spotLength = u, y.rectAreaLength = d, y.hemiLength = f, y.numDirectionalShadows = p, y.numPointShadows = m, y.numSpotShadows = h, y.numSpotMaps = g, y.numLightProbes = v, r.version = Mc++);
|
|
9703
9789
|
}
|
|
9704
9790
|
function c(e, t) {
|
|
9705
9791
|
let n = 0, s = 0, c = 0, l = 0, u = 0, d = t.matrixWorldInverse;
|
|
@@ -9729,8 +9815,8 @@ function Nc(e) {
|
|
|
9729
9815
|
state: r
|
|
9730
9816
|
};
|
|
9731
9817
|
}
|
|
9732
|
-
function
|
|
9733
|
-
let t = new
|
|
9818
|
+
function Fc(e) {
|
|
9819
|
+
let t = new Pc(e), n = [], r = [];
|
|
9734
9820
|
function i(e) {
|
|
9735
9821
|
l.camera = e, n.length = 0, r.length = 0;
|
|
9736
9822
|
}
|
|
@@ -9762,11 +9848,11 @@ function Pc(e) {
|
|
|
9762
9848
|
pushShadow: o
|
|
9763
9849
|
};
|
|
9764
9850
|
}
|
|
9765
|
-
function
|
|
9851
|
+
function Ic(e) {
|
|
9766
9852
|
let t = /* @__PURE__ */ new WeakMap();
|
|
9767
9853
|
function n(n, r = 0) {
|
|
9768
9854
|
let i = t.get(n), a;
|
|
9769
|
-
return i === void 0 ? (a = new
|
|
9855
|
+
return i === void 0 ? (a = new Fc(e), t.set(n, [a])) : r >= i.length ? (a = new Fc(e), i.push(a)) : a = i[r], a;
|
|
9770
9856
|
}
|
|
9771
9857
|
function r() {
|
|
9772
9858
|
t = /* @__PURE__ */ new WeakMap();
|
|
@@ -9776,8 +9862,8 @@ function Fc(e) {
|
|
|
9776
9862
|
dispose: r
|
|
9777
9863
|
};
|
|
9778
9864
|
}
|
|
9779
|
-
var
|
|
9780
|
-
function
|
|
9865
|
+
var Lc = "void main() {\n gl_Position = vec4( position, 1.0 );\n}", Rc = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";
|
|
9866
|
+
function zc(e, t, n) {
|
|
9781
9867
|
let i = new lr(), a = new V(), o = new V(), s = new Ae(), c = new aa({ depthPacking: 3201 }), l = new oa(), u = {}, d = n.maxTextureSize, f = {
|
|
9782
9868
|
0: 1,
|
|
9783
9869
|
1: 0,
|
|
@@ -9789,8 +9875,8 @@ function Rc(e, t, n) {
|
|
|
9789
9875
|
resolution: { value: new V() },
|
|
9790
9876
|
radius: { value: 4 }
|
|
9791
9877
|
},
|
|
9792
|
-
vertexShader:
|
|
9793
|
-
fragmentShader:
|
|
9878
|
+
vertexShader: Lc,
|
|
9879
|
+
fragmentShader: Rc
|
|
9794
9880
|
}), m = p.clone();
|
|
9795
9881
|
m.defines.HORIZONTAL_PASS = 1;
|
|
9796
9882
|
let h = new vn();
|
|
@@ -9888,7 +9974,7 @@ function Rc(e, t, n) {
|
|
|
9888
9974
|
}
|
|
9889
9975
|
}
|
|
9890
9976
|
}
|
|
9891
|
-
var
|
|
9977
|
+
var Bc = {
|
|
9892
9978
|
0: 1,
|
|
9893
9979
|
2: 6,
|
|
9894
9980
|
4: 7,
|
|
@@ -9898,7 +9984,7 @@ var zc = {
|
|
|
9898
9984
|
7: 4,
|
|
9899
9985
|
5: 3
|
|
9900
9986
|
};
|
|
9901
|
-
function
|
|
9987
|
+
function Vc(e, t) {
|
|
9902
9988
|
function n() {
|
|
9903
9989
|
let t = !1, n = new Ae(), r = null, i = new Ae(0, 0, 0, 0);
|
|
9904
9990
|
return {
|
|
@@ -9937,7 +10023,7 @@ function Bc(e, t) {
|
|
|
9937
10023
|
i !== t && !n && (e.depthMask(t), i = t);
|
|
9938
10024
|
},
|
|
9939
10025
|
setFunc: function(t) {
|
|
9940
|
-
if (r && (t =
|
|
10026
|
+
if (r && (t = Bc[t]), a !== t) {
|
|
9941
10027
|
switch (t) {
|
|
9942
10028
|
case 0:
|
|
9943
10029
|
e.depthFunc(e.NEVER);
|
|
@@ -10005,17 +10091,17 @@ function Bc(e, t) {
|
|
|
10005
10091
|
}
|
|
10006
10092
|
};
|
|
10007
10093
|
}
|
|
10008
|
-
let a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, j = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), M = !1, N = 0,
|
|
10009
|
-
|
|
10010
|
-
let
|
|
10011
|
-
function
|
|
10094
|
+
let a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, j = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), M = !1, N = 0, ee = e.getParameter(e.VERSION);
|
|
10095
|
+
ee.indexOf("WebGL") === -1 ? ee.indexOf("OpenGL ES") !== -1 && (N = parseFloat(/^OpenGL ES (\d)/.exec(ee)[1]), M = N >= 2) : (N = parseFloat(/^WebGL (\d)/.exec(ee)[1]), M = N >= 1);
|
|
10096
|
+
let P = null, F = {}, te = e.getParameter(e.SCISSOR_BOX), ne = e.getParameter(e.VIEWPORT), I = new Ae().fromArray(te), re = new Ae().fromArray(ne);
|
|
10097
|
+
function ie(t, n, r, i) {
|
|
10012
10098
|
let a = /* @__PURE__ */ new Uint8Array(4), o = e.createTexture();
|
|
10013
10099
|
e.bindTexture(t, o), e.texParameteri(t, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(t, e.TEXTURE_MAG_FILTER, e.NEAREST);
|
|
10014
10100
|
for (let o = 0; o < r; o++) t === e.TEXTURE_3D || t === e.TEXTURE_2D_ARRAY ? e.texImage3D(n, 0, e.RGBA, 1, 1, i, 0, e.RGBA, e.UNSIGNED_BYTE, a) : e.texImage2D(n + o, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, a);
|
|
10015
10101
|
return o;
|
|
10016
10102
|
}
|
|
10017
|
-
let
|
|
10018
|
-
|
|
10103
|
+
let L = {};
|
|
10104
|
+
L[e.TEXTURE_2D] = ie(e.TEXTURE_2D, e.TEXTURE_2D, 1), L[e.TEXTURE_CUBE_MAP] = ie(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), L[e.TEXTURE_2D_ARRAY] = ie(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), L[e.TEXTURE_3D] = ie(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1), a.setClear(0, 0, 0, 1), o.setClear(1), s.setClear(0), R(e.DEPTH_TEST), o.setFunc(3), de(!1), V(1), R(e.CULL_FACE), ue(0);
|
|
10019
10105
|
function R(t) {
|
|
10020
10106
|
u[t] !== !0 && (e.enable(t), u[t] = !0);
|
|
10021
10107
|
}
|
|
@@ -10063,7 +10149,7 @@ function Bc(e, t) {
|
|
|
10063
10149
|
213: e.CONSTANT_ALPHA,
|
|
10064
10150
|
214: e.ONE_MINUS_CONSTANT_ALPHA
|
|
10065
10151
|
};
|
|
10066
|
-
function
|
|
10152
|
+
function ue(t, n, r, i, a, o, s, c, l, u) {
|
|
10067
10153
|
if (t === 0) {
|
|
10068
10154
|
h === !0 && (z(e.BLEND), h = !1);
|
|
10069
10155
|
return;
|
|
@@ -10106,10 +10192,10 @@ function Bc(e, t) {
|
|
|
10106
10192
|
}
|
|
10107
10193
|
a ||= n, o ||= r, s ||= i, (n !== _ || a !== b) && (e.blendEquationSeparate(ce[n], ce[a]), _ = n, b = a), (r !== v || i !== y || o !== x || s !== S) && (e.blendFuncSeparate(le[r], le[i], le[o], le[s]), v = r, y = i, x = o, S = s), (c.equals(C) === !1 || l !== w) && (e.blendColor(c.r, c.g, c.b, l), C.copy(c), w = l), g = t, T = !1;
|
|
10108
10194
|
}
|
|
10109
|
-
function
|
|
10195
|
+
function B(t, n) {
|
|
10110
10196
|
t.side === 2 ? z(e.CULL_FACE) : R(e.CULL_FACE);
|
|
10111
10197
|
let r = t.side === 1;
|
|
10112
|
-
n && (r = !r), de(r), t.blending === 1 && t.transparent === !1 ?
|
|
10198
|
+
n && (r = !r), de(r), t.blending === 1 && t.transparent === !1 ? ue(0) : ue(t.blending, t.blendEquation, t.blendSrc, t.blendDst, t.blendEquationAlpha, t.blendSrcAlpha, t.blendDstAlpha, t.blendColor, t.blendAlpha, t.premultipliedAlpha), o.setFunc(t.depthFunc), o.setTest(t.depthTest), o.setMask(t.depthWrite), a.setMask(t.colorWrite);
|
|
10113
10199
|
let i = t.stencilWrite;
|
|
10114
10200
|
s.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), U(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ? R(e.SAMPLE_ALPHA_TO_COVERAGE) : z(e.SAMPLE_ALPHA_TO_COVERAGE);
|
|
10115
10201
|
}
|
|
@@ -10129,18 +10215,18 @@ function Bc(e, t) {
|
|
|
10129
10215
|
t ? R(e.SCISSOR_TEST) : z(e.SCISSOR_TEST);
|
|
10130
10216
|
}
|
|
10131
10217
|
function W(t) {
|
|
10132
|
-
t === void 0 && (t = e.TEXTURE0 + j - 1),
|
|
10218
|
+
t === void 0 && (t = e.TEXTURE0 + j - 1), P !== t && (e.activeTexture(t), P = t);
|
|
10133
10219
|
}
|
|
10134
10220
|
function G(t, n, r) {
|
|
10135
|
-
r === void 0 && (r =
|
|
10136
|
-
let i =
|
|
10221
|
+
r === void 0 && (r = P === null ? e.TEXTURE0 + j - 1 : P);
|
|
10222
|
+
let i = F[r];
|
|
10137
10223
|
i === void 0 && (i = {
|
|
10138
10224
|
type: void 0,
|
|
10139
10225
|
texture: void 0
|
|
10140
|
-
},
|
|
10226
|
+
}, F[r] = i), (i.type !== t || i.texture !== n) && (P !== r && (e.activeTexture(r), P = r), e.bindTexture(t, n || L[t]), i.type = t, i.texture = n);
|
|
10141
10227
|
}
|
|
10142
10228
|
function K() {
|
|
10143
|
-
let t =
|
|
10229
|
+
let t = F[P];
|
|
10144
10230
|
t !== void 0 && t.type !== void 0 && (e.bindTexture(t.type, null), t.type = void 0, t.texture = void 0);
|
|
10145
10231
|
}
|
|
10146
10232
|
function pe() {
|
|
@@ -10214,10 +10300,10 @@ function Bc(e, t) {
|
|
|
10214
10300
|
}
|
|
10215
10301
|
}
|
|
10216
10302
|
function be(t) {
|
|
10217
|
-
|
|
10303
|
+
I.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), I.copy(t));
|
|
10218
10304
|
}
|
|
10219
10305
|
function xe(t) {
|
|
10220
|
-
|
|
10306
|
+
re.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), re.copy(t));
|
|
10221
10307
|
}
|
|
10222
10308
|
function Se(t, n) {
|
|
10223
10309
|
let r = l.get(n);
|
|
@@ -10230,7 +10316,7 @@ function Bc(e, t) {
|
|
|
10230
10316
|
c.get(n) !== r && (e.uniformBlockBinding(n, r, t.__bindingPointIndex), c.set(n, r));
|
|
10231
10317
|
}
|
|
10232
10318
|
function we() {
|
|
10233
|
-
e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), u = {},
|
|
10319
|
+
e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), u = {}, P = null, F = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, I.set(0, 0, e.canvas.width, e.canvas.height), re.set(0, 0, e.canvas.width, e.canvas.height), a.reset(), o.reset(), s.reset();
|
|
10234
10320
|
}
|
|
10235
10321
|
return {
|
|
10236
10322
|
buffers: {
|
|
@@ -10243,8 +10329,8 @@ function Bc(e, t) {
|
|
|
10243
10329
|
bindFramebuffer: ae,
|
|
10244
10330
|
drawBuffers: oe,
|
|
10245
10331
|
useProgram: se,
|
|
10246
|
-
setBlending:
|
|
10247
|
-
setMaterial:
|
|
10332
|
+
setBlending: ue,
|
|
10333
|
+
setMaterial: B,
|
|
10248
10334
|
setFlipSided: de,
|
|
10249
10335
|
setCullFace: V,
|
|
10250
10336
|
setLineWidth: H,
|
|
@@ -10270,7 +10356,7 @@ function Bc(e, t) {
|
|
|
10270
10356
|
reset: we
|
|
10271
10357
|
};
|
|
10272
10358
|
}
|
|
10273
|
-
function
|
|
10359
|
+
function Hc(o, s, c, l, u, d, p) {
|
|
10274
10360
|
let m = s.has("WEBGL_multisampled_render_to_texture") ? s.get("WEBGL_multisampled_render_to_texture") : null, h = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), g = new V(), _ = /* @__PURE__ */ new WeakMap(), v, y = /* @__PURE__ */ new WeakMap(), b = !1;
|
|
10275
10361
|
try {
|
|
10276
10362
|
b = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
|
|
@@ -10325,7 +10411,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10325
10411
|
}
|
|
10326
10412
|
function j(e) {
|
|
10327
10413
|
let t = e.target;
|
|
10328
|
-
t.removeEventListener("dispose", j),
|
|
10414
|
+
t.removeEventListener("dispose", j), ee(t);
|
|
10329
10415
|
}
|
|
10330
10416
|
function M(e) {
|
|
10331
10417
|
let t = l.get(e);
|
|
@@ -10343,7 +10429,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10343
10429
|
let n = e.source, r = y.get(n);
|
|
10344
10430
|
delete r[t.__cacheKey], p.memory.textures--;
|
|
10345
10431
|
}
|
|
10346
|
-
function
|
|
10432
|
+
function ee(e) {
|
|
10347
10433
|
let t = l.get(e);
|
|
10348
10434
|
if (e.depthTexture && (e.depthTexture.dispose(), l.remove(e.depthTexture)), e.isWebGLCubeRenderTarget) for (let e = 0; e < 6; e++) {
|
|
10349
10435
|
if (Array.isArray(t.__webglFramebuffer[e])) for (let n = 0; n < t.__webglFramebuffer[e].length; n++) o.deleteFramebuffer(t.__webglFramebuffer[e][n]);
|
|
@@ -10363,51 +10449,51 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10363
10449
|
}
|
|
10364
10450
|
l.remove(e);
|
|
10365
10451
|
}
|
|
10366
|
-
let
|
|
10367
|
-
function
|
|
10368
|
-
|
|
10452
|
+
let P = 0;
|
|
10453
|
+
function F() {
|
|
10454
|
+
P = 0;
|
|
10369
10455
|
}
|
|
10370
|
-
function
|
|
10371
|
-
let e =
|
|
10372
|
-
return e >= u.maxTextures && console.warn("THREE.WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + u.maxTextures),
|
|
10456
|
+
function te() {
|
|
10457
|
+
let e = P;
|
|
10458
|
+
return e >= u.maxTextures && console.warn("THREE.WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + u.maxTextures), P += 1, e;
|
|
10373
10459
|
}
|
|
10374
|
-
function
|
|
10460
|
+
function ne(e) {
|
|
10375
10461
|
let t = [];
|
|
10376
10462
|
return t.push(e.wrapS), t.push(e.wrapT), t.push(e.wrapR || 0), t.push(e.magFilter), t.push(e.minFilter), t.push(e.anisotropy), t.push(e.internalFormat), t.push(e.format), t.push(e.type), t.push(e.generateMipmaps), t.push(e.premultiplyAlpha), t.push(e.flipY), t.push(e.unpackAlignment), t.push(e.colorSpace), t.join();
|
|
10377
10463
|
}
|
|
10378
|
-
function
|
|
10464
|
+
function I(e, t) {
|
|
10379
10465
|
let n = l.get(e);
|
|
10380
10466
|
if (e.isVideoTexture && _e(e), e.isRenderTargetTexture === !1 && e.isExternalTexture !== !0 && e.version > 0 && n.__version !== e.version) {
|
|
10381
10467
|
let r = e.image;
|
|
10382
10468
|
if (r === null) console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");
|
|
10383
10469
|
else if (r.complete === !1) console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");
|
|
10384
10470
|
else {
|
|
10385
|
-
|
|
10471
|
+
ue(n, e, t);
|
|
10386
10472
|
return;
|
|
10387
10473
|
}
|
|
10388
10474
|
} else e.isExternalTexture && (n.__webglTexture = e.sourceTexture ? e.sourceTexture : null);
|
|
10389
10475
|
c.bindTexture(o.TEXTURE_2D, n.__webglTexture, o.TEXTURE0 + t);
|
|
10390
10476
|
}
|
|
10391
|
-
function
|
|
10477
|
+
function re(e, t) {
|
|
10392
10478
|
let n = l.get(e);
|
|
10393
10479
|
if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
|
|
10394
|
-
|
|
10480
|
+
ue(n, e, t);
|
|
10395
10481
|
return;
|
|
10396
10482
|
}
|
|
10397
10483
|
c.bindTexture(o.TEXTURE_2D_ARRAY, n.__webglTexture, o.TEXTURE0 + t);
|
|
10398
10484
|
}
|
|
10399
|
-
function
|
|
10485
|
+
function ie(e, t) {
|
|
10400
10486
|
let n = l.get(e);
|
|
10401
10487
|
if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
|
|
10402
|
-
|
|
10488
|
+
ue(n, e, t);
|
|
10403
10489
|
return;
|
|
10404
10490
|
}
|
|
10405
10491
|
c.bindTexture(o.TEXTURE_3D, n.__webglTexture, o.TEXTURE0 + t);
|
|
10406
10492
|
}
|
|
10407
|
-
function
|
|
10493
|
+
function L(e, t) {
|
|
10408
10494
|
let n = l.get(e);
|
|
10409
10495
|
if (e.version > 0 && n.__version !== e.version) {
|
|
10410
|
-
|
|
10496
|
+
B(n, e, t);
|
|
10411
10497
|
return;
|
|
10412
10498
|
}
|
|
10413
10499
|
c.bindTexture(o.TEXTURE_CUBE_MAP, n.__webglTexture, o.TEXTURE0 + t);
|
|
@@ -10447,7 +10533,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10447
10533
|
e.__webglInit === void 0 && (e.__webglInit = !0, t.addEventListener("dispose", A));
|
|
10448
10534
|
let r = t.source, i = y.get(r);
|
|
10449
10535
|
i === void 0 && (i = {}, y.set(r, i));
|
|
10450
|
-
let a =
|
|
10536
|
+
let a = ne(t);
|
|
10451
10537
|
if (a !== e.__cacheKey) {
|
|
10452
10538
|
i[a] === void 0 && (i[a] = {
|
|
10453
10539
|
texture: o.createTexture(),
|
|
@@ -10481,7 +10567,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10481
10567
|
e.clearUpdateRanges(), o.pixelStorei(o.UNPACK_ROW_LENGTH, s), o.pixelStorei(o.UNPACK_SKIP_PIXELS, l), o.pixelStorei(o.UNPACK_SKIP_ROWS, u);
|
|
10482
10568
|
}
|
|
10483
10569
|
}
|
|
10484
|
-
function
|
|
10570
|
+
function ue(e, t, n) {
|
|
10485
10571
|
let r = o.TEXTURE_2D;
|
|
10486
10572
|
(t.isDataArrayTexture || t.isCompressedArrayTexture) && (r = o.TEXTURE_2D_ARRAY), t.isData3DTexture && (r = o.TEXTURE_3D);
|
|
10487
10573
|
let i = se(e, t), a = t.source;
|
|
@@ -10511,7 +10597,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10511
10597
|
if (b) {
|
|
10512
10598
|
if (S) {
|
|
10513
10599
|
if (t.layerUpdates.size > 0) {
|
|
10514
|
-
let n =
|
|
10600
|
+
let n = Ja(v.width, v.height, t.format, t.type);
|
|
10515
10601
|
for (let r of t.layerUpdates) {
|
|
10516
10602
|
let t = v.data.subarray(r * n / v.data.BYTES_PER_ELEMENT, (r + 1) * n / v.data.BYTES_PER_ELEMENT);
|
|
10517
10603
|
c.compressedTexSubImage3D(o.TEXTURE_2D_ARRAY, e, 0, 0, r, v.width, v.height, 1, h, t);
|
|
@@ -10530,7 +10616,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10530
10616
|
if (b) {
|
|
10531
10617
|
if (x && c.texStorage3D(o.TEXTURE_2D_ARRAY, E, _, m.width, m.height, m.depth), S) {
|
|
10532
10618
|
if (t.layerUpdates.size > 0) {
|
|
10533
|
-
let e =
|
|
10619
|
+
let e = Ja(m.width, m.height, t.format, t.type);
|
|
10534
10620
|
for (let n of t.layerUpdates) {
|
|
10535
10621
|
let t = m.data.subarray(n * e / m.data.BYTES_PER_ELEMENT, (n + 1) * e / m.data.BYTES_PER_ELEMENT);
|
|
10536
10622
|
c.texSubImage3D(o.TEXTURE_2D_ARRAY, 0, 0, 0, n, m.width, m.height, 1, h, g, t);
|
|
@@ -10566,7 +10652,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10566
10652
|
}
|
|
10567
10653
|
e.__version = t.version;
|
|
10568
10654
|
}
|
|
10569
|
-
function
|
|
10655
|
+
function B(e, t, n) {
|
|
10570
10656
|
if (t.image.length !== 6) return;
|
|
10571
10657
|
let r = se(e, t), i = t.source;
|
|
10572
10658
|
c.bindTexture(o.TEXTURE_CUBE_MAP, e.__webglTexture, o.TEXTURE0 + n);
|
|
@@ -10638,7 +10724,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10638
10724
|
if (t && t.isWebGLCubeRenderTarget) throw Error("Depth Texture with cube render targets is not supported");
|
|
10639
10725
|
if (c.bindFramebuffer(o.FRAMEBUFFER, e), !(t.depthTexture && t.depthTexture.isDepthTexture)) throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
|
|
10640
10726
|
let n = l.get(t.depthTexture);
|
|
10641
|
-
n.__renderTarget = t, (!n.__webglTexture || t.depthTexture.image.width !== t.width || t.depthTexture.image.height !== t.height) && (t.depthTexture.image.width = t.width, t.depthTexture.image.height = t.height, t.depthTexture.needsUpdate = !0),
|
|
10727
|
+
n.__renderTarget = t, (!n.__webglTexture || t.depthTexture.image.width !== t.width || t.depthTexture.image.height !== t.height) && (t.depthTexture.image.width = t.width, t.depthTexture.image.height = t.height, t.depthTexture.needsUpdate = !0), I(t.depthTexture, 0);
|
|
10642
10728
|
let r = n.__webglTexture, i = he(t);
|
|
10643
10729
|
if (t.depthTexture.format === 1026) ge(t) ? m.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER, o.DEPTH_ATTACHMENT, o.TEXTURE_2D, r, 0, i) : o.framebufferTexture2D(o.FRAMEBUFFER, o.DEPTH_ATTACHMENT, o.TEXTURE_2D, r, 0);
|
|
10644
10730
|
else if (t.depthTexture.format === 1027) ge(t) ? m.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER, o.DEPTH_STENCIL_ATTACHMENT, o.TEXTURE_2D, r, 0, i) : o.framebufferTexture2D(o.FRAMEBUFFER, o.DEPTH_STENCIL_ATTACHMENT, o.TEXTURE_2D, r, 0);
|
|
@@ -10787,9 +10873,9 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10787
10873
|
function ye(e) {
|
|
10788
10874
|
return typeof HTMLImageElement < "u" && e instanceof HTMLImageElement ? (g.width = e.naturalWidth || e.width, g.height = e.naturalHeight || e.height) : typeof VideoFrame < "u" && e instanceof VideoFrame ? (g.width = e.displayWidth, g.height = e.displayHeight) : (g.width = e.width, g.height = e.height), g;
|
|
10789
10875
|
}
|
|
10790
|
-
this.allocateTextureUnit =
|
|
10876
|
+
this.allocateTextureUnit = te, this.resetTextureUnits = F, this.setTexture2D = I, this.setTexture2DArray = re, this.setTexture3D = ie, this.setTextureCube = L, this.rebindTextures = W, this.setupRenderTarget = G, this.updateRenderTargetMipmap = K, this.updateMultisampleRenderTarget = J, this.setupDepthRenderbuffer = fe, this.setupFrameBufferTexture = de, this.useMultisampledRTT = ge;
|
|
10791
10877
|
}
|
|
10792
|
-
function
|
|
10878
|
+
function Uc(e, t) {
|
|
10793
10879
|
function n(n, r = "") {
|
|
10794
10880
|
let i, a = Y.getTransfer(r);
|
|
10795
10881
|
if (n === 1009) return e.UNSIGNED_BYTE;
|
|
@@ -10880,7 +10966,7 @@ function Hc(e, t) {
|
|
|
10880
10966
|
}
|
|
10881
10967
|
return { convert: n };
|
|
10882
10968
|
}
|
|
10883
|
-
var
|
|
10969
|
+
var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n if ( coord.x >= 1.0 ) {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n } else {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n }\n\n}", Kc = class {
|
|
10884
10970
|
constructor() {
|
|
10885
10971
|
this.texture = null, this.mesh = null, this.depthNear = 0, this.depthFar = 0;
|
|
10886
10972
|
}
|
|
@@ -10893,8 +10979,8 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
10893
10979
|
getMesh(e) {
|
|
10894
10980
|
if (this.texture !== null && this.mesh === null) {
|
|
10895
10981
|
let t = e.cameras[0].viewport, n = new Vn({
|
|
10896
|
-
vertexShader:
|
|
10897
|
-
fragmentShader:
|
|
10982
|
+
vertexShader: Wc,
|
|
10983
|
+
fragmentShader: Gc,
|
|
10898
10984
|
uniforms: {
|
|
10899
10985
|
depthColor: { value: this.texture },
|
|
10900
10986
|
depthWidth: { value: t.z },
|
|
@@ -10911,14 +10997,14 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
10911
10997
|
getDepthTexture() {
|
|
10912
10998
|
return this.texture;
|
|
10913
10999
|
}
|
|
10914
|
-
},
|
|
11000
|
+
}, qc = class extends T {
|
|
10915
11001
|
constructor(e, t) {
|
|
10916
11002
|
super();
|
|
10917
|
-
let n = this, r = null, i = 1, a = null, c = "local-floor", l = 1, p = null, m = null, h = null, g = null, _ = null, v = null, y = typeof XRWebGLBinding < "u", b = new
|
|
11003
|
+
let n = this, r = null, i = 1, a = null, c = "local-floor", l = 1, p = null, m = null, h = null, g = null, _ = null, v = null, y = typeof XRWebGLBinding < "u", b = new Kc(), x = {}, S = t.getContextAttributes(), C = null, w = null, T = [], E = [], D = new V(), O = null, A = new Kn();
|
|
10918
11004
|
A.viewport = new Ae();
|
|
10919
11005
|
let j = new Kn();
|
|
10920
11006
|
j.viewport = new Ae();
|
|
10921
|
-
let M = [A, j], N = new Aa(),
|
|
11007
|
+
let M = [A, j], N = new Aa(), ee = null, P = null;
|
|
10922
11008
|
this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(e) {
|
|
10923
11009
|
let t = T[e];
|
|
10924
11010
|
return t === void 0 && (t = new er(), T[e] = t), t.getTargetRaySpace();
|
|
@@ -10929,7 +11015,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
10929
11015
|
let t = T[e];
|
|
10930
11016
|
return t === void 0 && (t = new er(), T[e] = t), t.getHandSpace();
|
|
10931
11017
|
};
|
|
10932
|
-
function
|
|
11018
|
+
function F(e) {
|
|
10933
11019
|
let t = E.indexOf(e.inputSource);
|
|
10934
11020
|
if (t === -1) return;
|
|
10935
11021
|
let n = T[t];
|
|
@@ -10938,13 +11024,13 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
10938
11024
|
data: e.inputSource
|
|
10939
11025
|
}));
|
|
10940
11026
|
}
|
|
10941
|
-
function
|
|
10942
|
-
r.removeEventListener("select",
|
|
11027
|
+
function te() {
|
|
11028
|
+
r.removeEventListener("select", F), r.removeEventListener("selectstart", F), r.removeEventListener("selectend", F), r.removeEventListener("squeeze", F), r.removeEventListener("squeezestart", F), r.removeEventListener("squeezeend", F), r.removeEventListener("end", te), r.removeEventListener("inputsourceschange", ne);
|
|
10943
11029
|
for (let e = 0; e < T.length; e++) {
|
|
10944
11030
|
let t = E[e];
|
|
10945
11031
|
t !== null && (E[e] = null, T[e].disconnect(t));
|
|
10946
11032
|
}
|
|
10947
|
-
|
|
11033
|
+
ee = null, P = null, b.reset();
|
|
10948
11034
|
for (let e in x) delete x[e];
|
|
10949
11035
|
e.setRenderTarget(C), _ = null, g = null, h = null, r = null, w = null, oe.stop(), n.isPresenting = !1, e.setPixelRatio(O), e.setSize(D.width, D.height, !1), n.dispatchEvent({ type: "sessionend" });
|
|
10950
11036
|
}
|
|
@@ -10966,7 +11052,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
10966
11052
|
return r;
|
|
10967
11053
|
}, this.setSession = async function(m) {
|
|
10968
11054
|
if (r = m, r !== null) {
|
|
10969
|
-
if (C = e.getRenderTarget(), r.addEventListener("select",
|
|
11055
|
+
if (C = e.getRenderTarget(), r.addEventListener("select", F), r.addEventListener("selectstart", F), r.addEventListener("selectend", F), r.addEventListener("squeeze", F), r.addEventListener("squeezestart", F), r.addEventListener("squeezeend", F), r.addEventListener("end", te), r.addEventListener("inputsourceschange", ne), S.xrCompatible !== !0 && await t.makeXRCompatible(), O = e.getPixelRatio(), e.getSize(D), y && "createProjectionLayer" in XRWebGLBinding.prototype) {
|
|
10970
11056
|
let n = null, a = null, c = null;
|
|
10971
11057
|
S.depth && (c = S.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, n = S.stencil ? f : d, a = S.stencil ? 1020 : s);
|
|
10972
11058
|
let l = {
|
|
@@ -11008,7 +11094,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
11008
11094
|
}, this.getDepthTexture = function() {
|
|
11009
11095
|
return b.getDepthTexture();
|
|
11010
11096
|
};
|
|
11011
|
-
function
|
|
11097
|
+
function ne(e) {
|
|
11012
11098
|
for (let t = 0; t < e.removed.length; t++) {
|
|
11013
11099
|
let n = e.removed[t], r = E.indexOf(n);
|
|
11014
11100
|
r >= 0 && (E[r] = null, T[r].disconnect(n));
|
|
@@ -11029,30 +11115,30 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
11029
11115
|
i && i.connect(n);
|
|
11030
11116
|
}
|
|
11031
11117
|
}
|
|
11032
|
-
let
|
|
11033
|
-
function
|
|
11034
|
-
|
|
11035
|
-
let r =
|
|
11118
|
+
let I = new U(), re = new U();
|
|
11119
|
+
function ie(e, t, n) {
|
|
11120
|
+
I.setFromMatrixPosition(t.matrixWorld), re.setFromMatrixPosition(n.matrixWorld);
|
|
11121
|
+
let r = I.distanceTo(re), i = t.projectionMatrix.elements, a = n.projectionMatrix.elements, o = i[14] / (i[10] - 1), s = i[14] / (i[10] + 1), c = (i[9] + 1) / i[5], l = (i[9] - 1) / i[5], u = (i[8] - 1) / i[0], d = (a[8] + 1) / a[0], f = o * u, p = o * d, m = r / (-u + d), h = m * -u;
|
|
11036
11122
|
if (t.matrixWorld.decompose(e.position, e.quaternion, e.scale), e.translateX(h), e.translateZ(m), e.matrixWorld.compose(e.position, e.quaternion, e.scale), e.matrixWorldInverse.copy(e.matrixWorld).invert(), i[10] === -1) e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse);
|
|
11037
11123
|
else {
|
|
11038
11124
|
let t = o + m, n = s + m, i = f - h, a = p + (r - h), u = c * s / n * t, d = l * s / n * t;
|
|
11039
11125
|
e.projectionMatrix.makePerspective(i, a, u, d, t, n), e.projectionMatrixInverse.copy(e.projectionMatrix).invert();
|
|
11040
11126
|
}
|
|
11041
11127
|
}
|
|
11042
|
-
function
|
|
11128
|
+
function L(e, t) {
|
|
11043
11129
|
t === null ? e.matrixWorld.copy(e.matrix) : e.matrixWorld.multiplyMatrices(t.matrixWorld, e.matrix), e.matrixWorldInverse.copy(e.matrixWorld).invert();
|
|
11044
11130
|
}
|
|
11045
11131
|
this.updateCamera = function(e) {
|
|
11046
11132
|
if (r === null) return;
|
|
11047
11133
|
let t = e.near, n = e.far;
|
|
11048
|
-
b.texture !== null && (b.depthNear > 0 && (t = b.depthNear), b.depthFar > 0 && (n = b.depthFar)), N.near = j.near = A.near = t, N.far = j.far = A.far = n, (
|
|
11134
|
+
b.texture !== null && (b.depthNear > 0 && (t = b.depthNear), b.depthFar > 0 && (n = b.depthFar)), N.near = j.near = A.near = t, N.far = j.far = A.far = n, (ee !== N.near || P !== N.far) && (r.updateRenderState({
|
|
11049
11135
|
depthNear: N.near,
|
|
11050
11136
|
depthFar: N.far
|
|
11051
|
-
}),
|
|
11137
|
+
}), ee = N.near, P = N.far), N.layers.mask = e.layers.mask | 6, A.layers.mask = N.layers.mask & 3, j.layers.mask = N.layers.mask & 5;
|
|
11052
11138
|
let i = e.parent, a = N.cameras;
|
|
11053
|
-
|
|
11054
|
-
for (let e = 0; e < a.length; e++)
|
|
11055
|
-
a.length === 2 ?
|
|
11139
|
+
L(N, i);
|
|
11140
|
+
for (let e = 0; e < a.length; e++) L(a[e], i);
|
|
11141
|
+
a.length === 2 ? ie(N, A, j) : N.projectionMatrix.copy(A.projectionMatrix), R(e, N, i);
|
|
11056
11142
|
};
|
|
11057
11143
|
function R(e, t, n) {
|
|
11058
11144
|
n === null ? e.matrix.copy(t.matrixWorld) : (e.matrix.copy(n.matrixWorld), e.matrix.invert(), e.matrix.multiply(t.matrixWorld)), e.matrix.decompose(e.position, e.quaternion, e.scale), e.updateMatrixWorld(!0), e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse), e.isPerspectiveCamera && (e.fov = k * 2 * Math.atan(1 / e.projectionMatrix.elements[5]), e.zoom = 1);
|
|
@@ -11115,13 +11201,13 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
11115
11201
|
data: i
|
|
11116
11202
|
}), v = null;
|
|
11117
11203
|
}
|
|
11118
|
-
let oe = new
|
|
11204
|
+
let oe = new Xa();
|
|
11119
11205
|
oe.setAnimationLoop(ae), this.setAnimationLoop = function(e) {
|
|
11120
11206
|
z = e;
|
|
11121
11207
|
}, this.dispose = function() {};
|
|
11122
11208
|
}
|
|
11123
|
-
},
|
|
11124
|
-
function
|
|
11209
|
+
}, Jc = /*@__PURE__*/ new vt(), Yc = /*@__PURE__*/ new ct();
|
|
11210
|
+
function Xc(e, t) {
|
|
11125
11211
|
function n(e, t) {
|
|
11126
11212
|
e.matrixAutoUpdate === !0 && e.updateMatrix(), t.value.copy(e.matrix);
|
|
11127
11213
|
}
|
|
@@ -11134,7 +11220,7 @@ function Yc(e, t) {
|
|
|
11134
11220
|
function a(e, r) {
|
|
11135
11221
|
e.opacity.value = r.opacity, r.color && e.diffuse.value.copy(r.color), r.emissive && e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity), r.map && (e.map.value = r.map, n(r.map, e.mapTransform)), r.alphaMap && (e.alphaMap.value = r.alphaMap, n(r.alphaMap, e.alphaMapTransform)), r.bumpMap && (e.bumpMap.value = r.bumpMap, n(r.bumpMap, e.bumpMapTransform), e.bumpScale.value = r.bumpScale, r.side === 1 && (e.bumpScale.value *= -1)), r.normalMap && (e.normalMap.value = r.normalMap, n(r.normalMap, e.normalMapTransform), e.normalScale.value.copy(r.normalScale), r.side === 1 && e.normalScale.value.negate()), r.displacementMap && (e.displacementMap.value = r.displacementMap, n(r.displacementMap, e.displacementMapTransform), e.displacementScale.value = r.displacementScale, e.displacementBias.value = r.displacementBias), r.emissiveMap && (e.emissiveMap.value = r.emissiveMap, n(r.emissiveMap, e.emissiveMapTransform)), r.specularMap && (e.specularMap.value = r.specularMap, n(r.specularMap, e.specularMapTransform)), r.alphaTest > 0 && (e.alphaTest.value = r.alphaTest);
|
|
11136
11222
|
let i = t.get(r), a = i.envMap, o = i.envMapRotation;
|
|
11137
|
-
a && (e.envMap.value = a,
|
|
11223
|
+
a && (e.envMap.value = a, Jc.copy(o), Jc.x *= -1, Jc.y *= -1, Jc.z *= -1, a.isCubeTexture && a.isRenderTargetTexture === !1 && (Jc.y *= -1, Jc.z *= -1), e.envMapRotation.value.setFromMatrix4(Yc.makeRotationFromEuler(Jc)), e.flipEnvMap.value = a.isCubeTexture && a.isRenderTargetTexture === !1 ? -1 : 1, e.reflectivity.value = r.reflectivity, e.ior.value = r.ior, e.refractionRatio.value = r.refractionRatio), r.lightMap && (e.lightMap.value = r.lightMap, e.lightMapIntensity.value = r.lightMapIntensity, n(r.lightMap, e.lightMapTransform)), r.aoMap && (e.aoMap.value = r.aoMap, e.aoMapIntensity.value = r.aoMapIntensity, n(r.aoMap, e.aoMapTransform));
|
|
11138
11224
|
}
|
|
11139
11225
|
function o(e, t) {
|
|
11140
11226
|
e.diffuse.value.copy(t.color), e.opacity.value = t.opacity, t.map && (e.map.value = t.map, n(t.map, e.mapTransform));
|
|
@@ -11172,7 +11258,7 @@ function Yc(e, t) {
|
|
|
11172
11258
|
refreshMaterialUniforms: i
|
|
11173
11259
|
};
|
|
11174
11260
|
}
|
|
11175
|
-
function
|
|
11261
|
+
function Zc(e, t, n, r) {
|
|
11176
11262
|
let i = {}, a = {}, o = [], s = e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);
|
|
11177
11263
|
function c(e, t) {
|
|
11178
11264
|
let n = t.program;
|
|
@@ -11264,7 +11350,7 @@ function Xc(e, t, n, r) {
|
|
|
11264
11350
|
dispose: _
|
|
11265
11351
|
};
|
|
11266
11352
|
}
|
|
11267
|
-
var
|
|
11353
|
+
var Qc = class {
|
|
11268
11354
|
constructor(e = {}) {
|
|
11269
11355
|
let { canvas: t = me(), context: n = null, depth: r = !0, stencil: i = !1, alpha: s = !1, antialias: c = !1, premultipliedAlpha: u = !0, preserveDrawingBuffer: d = !1, powerPreference: f = "default", failIfMajorPerformanceCaveat: p = !1, reversedDepthBuffer: m = !1 } = e;
|
|
11270
11356
|
this.isWebGLRenderer = !0;
|
|
@@ -11280,7 +11366,7 @@ var Zc = class {
|
|
|
11280
11366
|
}, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = 0, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;
|
|
11281
11367
|
let T = this, E = !1;
|
|
11282
11368
|
this._outputColorSpace = y;
|
|
11283
|
-
let D = 0, O = 0, k = null, A = -1, j = null, M = new Ae(), N = new Ae(),
|
|
11369
|
+
let D = 0, O = 0, k = null, A = -1, j = null, M = new Ae(), N = new Ae(), ee = null, P = new X(0), F = 0, te = t.width, ne = t.height, I = 1, re = null, ie = null, L = new Ae(0, 0, te, ne), R = new Ae(0, 0, te, ne), z = !1, ae = new lr(), oe = !1, se = !1, ce = new ct(), le = new U(), ue = new Ae(), B = {
|
|
11284
11370
|
background: null,
|
|
11285
11371
|
fog: null,
|
|
11286
11372
|
environment: null,
|
|
@@ -11288,7 +11374,7 @@ var Zc = class {
|
|
|
11288
11374
|
isScene: !0
|
|
11289
11375
|
}, de = !1;
|
|
11290
11376
|
function V() {
|
|
11291
|
-
return k === null ?
|
|
11377
|
+
return k === null ? I : 1;
|
|
11292
11378
|
}
|
|
11293
11379
|
let H = n;
|
|
11294
11380
|
function fe(e, n) {
|
|
@@ -11314,10 +11400,10 @@ var Zc = class {
|
|
|
11314
11400
|
}
|
|
11315
11401
|
let W, G, K, pe, q, J, _e, ve, ye, be, xe, Se, Ce, we, Te, Ee, De, Oe, ke, je, Ne, Pe, Fe, Ie;
|
|
11316
11402
|
function Le() {
|
|
11317
|
-
W = new
|
|
11403
|
+
W = new jo(H), W.init(), Pe = new Uc(H, W), G = new ao(H, W, e, Pe), K = new Vc(H, W), G.reversedDepthBuffer && m && K.buffers.depth.setReversed(!0), pe = new Po(H), q = new Tc(), J = new Hc(H, W, K, q, G, Pe, pe), _e = new so(T), ve = new Ao(T), ye = new Za(H), Fe = new ro(H, ye), be = new Mo(H, ye, pe, Fe), xe = new Io(H, be, ye, pe), ke = new Fo(H, G, J), Ee = new oo(q), Se = new wc(T, _e, ve, W, G, Fe, Ee), Ce = new Xc(T, q), we = new kc(), Te = new Ic(W), Oe = new no(T, _e, ve, K, xe, h, u), De = new zc(T, xe, G), Ie = new Zc(H, pe, G, K), je = new io(H, W, pe), Ne = new No(H, W, pe), pe.programs = Se.programs, T.capabilities = G, T.extensions = W, T.properties = q, T.renderLists = we, T.shadowMap = De, T.state = K, T.info = pe;
|
|
11318
11404
|
}
|
|
11319
11405
|
Le();
|
|
11320
|
-
let Re = new
|
|
11406
|
+
let Re = new qc(T, H);
|
|
11321
11407
|
this.xr = Re, this.getContext = function() {
|
|
11322
11408
|
return H;
|
|
11323
11409
|
}, this.getContextAttributes = function() {
|
|
@@ -11329,39 +11415,39 @@ var Zc = class {
|
|
|
11329
11415
|
let e = W.get("WEBGL_lose_context");
|
|
11330
11416
|
e && e.restoreContext();
|
|
11331
11417
|
}, this.getPixelRatio = function() {
|
|
11332
|
-
return
|
|
11418
|
+
return I;
|
|
11333
11419
|
}, this.setPixelRatio = function(e) {
|
|
11334
|
-
e !== void 0 && (
|
|
11420
|
+
e !== void 0 && (I = e, this.setSize(te, ne, !1));
|
|
11335
11421
|
}, this.getSize = function(e) {
|
|
11336
|
-
return e.set(
|
|
11422
|
+
return e.set(te, ne);
|
|
11337
11423
|
}, this.setSize = function(e, n, r = !0) {
|
|
11338
11424
|
if (Re.isPresenting) {
|
|
11339
11425
|
console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");
|
|
11340
11426
|
return;
|
|
11341
11427
|
}
|
|
11342
|
-
|
|
11428
|
+
te = e, ne = n, t.width = Math.floor(e * I), t.height = Math.floor(n * I), r === !0 && (t.style.width = e + "px", t.style.height = n + "px"), this.setViewport(0, 0, e, n);
|
|
11343
11429
|
}, this.getDrawingBufferSize = function(e) {
|
|
11344
|
-
return e.set(
|
|
11430
|
+
return e.set(te * I, ne * I).floor();
|
|
11345
11431
|
}, this.setDrawingBufferSize = function(e, n, r) {
|
|
11346
|
-
|
|
11432
|
+
te = e, ne = n, I = r, t.width = Math.floor(e * r), t.height = Math.floor(n * r), this.setViewport(0, 0, e, n);
|
|
11347
11433
|
}, this.getCurrentViewport = function(e) {
|
|
11348
11434
|
return e.copy(M);
|
|
11349
11435
|
}, this.getViewport = function(e) {
|
|
11350
|
-
return e.copy(
|
|
11436
|
+
return e.copy(L);
|
|
11351
11437
|
}, this.setViewport = function(e, t, n, r) {
|
|
11352
|
-
e.isVector4 ?
|
|
11438
|
+
e.isVector4 ? L.set(e.x, e.y, e.z, e.w) : L.set(e, t, n, r), K.viewport(M.copy(L).multiplyScalar(I).round());
|
|
11353
11439
|
}, this.getScissor = function(e) {
|
|
11354
11440
|
return e.copy(R);
|
|
11355
11441
|
}, this.setScissor = function(e, t, n, r) {
|
|
11356
|
-
e.isVector4 ? R.set(e.x, e.y, e.z, e.w) : R.set(e, t, n, r), K.scissor(N.copy(R).multiplyScalar(
|
|
11442
|
+
e.isVector4 ? R.set(e.x, e.y, e.z, e.w) : R.set(e, t, n, r), K.scissor(N.copy(R).multiplyScalar(I).round());
|
|
11357
11443
|
}, this.getScissorTest = function() {
|
|
11358
11444
|
return z;
|
|
11359
11445
|
}, this.setScissorTest = function(e) {
|
|
11360
11446
|
K.setScissorTest(z = e);
|
|
11361
11447
|
}, this.setOpaqueSort = function(e) {
|
|
11362
|
-
ne = e;
|
|
11363
|
-
}, this.setTransparentSort = function(e) {
|
|
11364
11448
|
re = e;
|
|
11449
|
+
}, this.setTransparentSort = function(e) {
|
|
11450
|
+
ie = e;
|
|
11365
11451
|
}, this.getClearColor = function(e) {
|
|
11366
11452
|
return e.copy(Oe.getClearColor());
|
|
11367
11453
|
}, this.setClearColor = function() {
|
|
@@ -11418,7 +11504,7 @@ var Zc = class {
|
|
|
11418
11504
|
}), e.isShaderMaterial && Se.releaseShaderCache(e));
|
|
11419
11505
|
}
|
|
11420
11506
|
this.renderBufferDirect = function(e, t, n, r, i, a) {
|
|
11421
|
-
t === null && (t =
|
|
11507
|
+
t === null && (t = B);
|
|
11422
11508
|
let o = i.isMesh && i.matrixWorld.determinant() < 0, s = at(e, t, n, r, i);
|
|
11423
11509
|
K.setMaterial(r, o);
|
|
11424
11510
|
let c = n.index, l = 1;
|
|
@@ -11496,7 +11582,7 @@ var Zc = class {
|
|
|
11496
11582
|
function Ye() {
|
|
11497
11583
|
Xe.start();
|
|
11498
11584
|
}
|
|
11499
|
-
let Xe = new
|
|
11585
|
+
let Xe = new Xa();
|
|
11500
11586
|
Xe.setAnimationLoop(qe), typeof self < "u" && Xe.setContext(self), this.setAnimationLoop = function(e) {
|
|
11501
11587
|
Ke = e, Re.setAnimationLoop(e), e === null ? Xe.stop() : Xe.start();
|
|
11502
11588
|
}, Re.addEventListener("sessionstart", Je), Re.addEventListener("sessionend", Ye), this.render = function(e, t) {
|
|
@@ -11509,7 +11595,7 @@ var Zc = class {
|
|
|
11509
11595
|
let e = T.xr.getDepthSensingMesh();
|
|
11510
11596
|
e !== null && Ze(e, t, -Infinity, T.sortObjects);
|
|
11511
11597
|
}
|
|
11512
|
-
Ze(e, t, 0, T.sortObjects), v.finish(), T.sortObjects === !0 && v.sort(
|
|
11598
|
+
Ze(e, t, 0, T.sortObjects), v.finish(), T.sortObjects === !0 && v.sort(re, ie), de = Re.enabled === !1 || Re.isPresenting === !1 || Re.hasDepthSensing() === !1, de && Oe.addToRenderList(v, e), this.info.render.frame++, oe === !0 && Ee.beginShadows();
|
|
11513
11599
|
let n = x.state.shadowsArray;
|
|
11514
11600
|
De.render(n, e, t), oe === !0 && Ee.endShadows(), this.info.autoReset === !0 && this.info.reset();
|
|
11515
11601
|
let r = v.opaque, i = v.transmissive;
|
|
@@ -11535,19 +11621,19 @@ var Zc = class {
|
|
|
11535
11621
|
else if (e.isLight) x.pushLight(e), e.castShadow && x.pushShadow(e);
|
|
11536
11622
|
else if (e.isSprite) {
|
|
11537
11623
|
if (!e.frustumCulled || ae.intersectsSprite(e)) {
|
|
11538
|
-
r &&
|
|
11624
|
+
r && ue.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ce);
|
|
11539
11625
|
let t = xe.update(e), i = e.material;
|
|
11540
|
-
i.visible && v.push(e, t, i, n,
|
|
11626
|
+
i.visible && v.push(e, t, i, n, ue.z, null);
|
|
11541
11627
|
}
|
|
11542
11628
|
} else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || ae.intersectsObject(e))) {
|
|
11543
11629
|
let t = xe.update(e), i = e.material;
|
|
11544
|
-
if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(),
|
|
11630
|
+
if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(), ue.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), ue.copy(e.boundingSphere.center)), ue.applyMatrix4(e.matrixWorld).applyMatrix4(ce)), Array.isArray(i)) {
|
|
11545
11631
|
let r = t.groups;
|
|
11546
11632
|
for (let a = 0, o = r.length; a < o; a++) {
|
|
11547
11633
|
let o = r[a], s = i[o.materialIndex];
|
|
11548
|
-
s && s.visible && v.push(e, t, s, n,
|
|
11634
|
+
s && s.visible && v.push(e, t, s, n, ue.z, o);
|
|
11549
11635
|
}
|
|
11550
|
-
} else i.visible && v.push(e, t, i, n,
|
|
11636
|
+
} else i.visible && v.push(e, t, i, n, ue.z, null);
|
|
11551
11637
|
}
|
|
11552
11638
|
}
|
|
11553
11639
|
let i = e.children;
|
|
@@ -11572,7 +11658,7 @@ var Zc = class {
|
|
|
11572
11658
|
let s = x.state.transmissionRenderTarget[r.id], c = r.viewport || M;
|
|
11573
11659
|
s.setSize(c.z * T.transmissionResolutionScale, c.w * T.transmissionResolutionScale);
|
|
11574
11660
|
let u = T.getRenderTarget(), d = T.getActiveCubeFace(), f = T.getActiveMipmapLevel();
|
|
11575
|
-
T.setRenderTarget(s), T.getClearColor(
|
|
11661
|
+
T.setRenderTarget(s), T.getClearColor(P), F = T.getClearAlpha(), F < 1 && T.setClearColor(16777215, .5), T.clear(), de && Oe.render(n);
|
|
11576
11662
|
let p = T.toneMapping;
|
|
11577
11663
|
T.toneMapping = 0;
|
|
11578
11664
|
let m = r.viewport;
|
|
@@ -11587,7 +11673,7 @@ var Zc = class {
|
|
|
11587
11673
|
}
|
|
11588
11674
|
e === !0 && (J.updateMultisampleRenderTarget(s), J.updateRenderTargetMipmap(s));
|
|
11589
11675
|
}
|
|
11590
|
-
T.setRenderTarget(u, d, f), T.setClearColor(
|
|
11676
|
+
T.setRenderTarget(u, d, f), T.setClearColor(P, F), m !== void 0 && (r.viewport = m), T.toneMapping = p;
|
|
11591
11677
|
}
|
|
11592
11678
|
function et(e, t, n) {
|
|
11593
11679
|
let r = t.isScene === !0 ? t.overrideMaterial : null;
|
|
@@ -11600,7 +11686,7 @@ var Zc = class {
|
|
|
11600
11686
|
e.onBeforeRender(T, t, n, r, i, a), e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse, e.matrixWorld), e.normalMatrix.getNormalMatrix(e.modelViewMatrix), i.onBeforeRender(T, t, n, r, e, a), i.transparent === !0 && i.side === 2 && i.forceSinglePass === !1 ? (i.side = 1, i.needsUpdate = !0, T.renderBufferDirect(n, t, r, i, e, a), i.side = 0, i.needsUpdate = !0, T.renderBufferDirect(n, t, r, i, e, a), i.side = 2) : T.renderBufferDirect(n, t, r, i, e, a), e.onAfterRender(T, t, n, r, i, a);
|
|
11601
11687
|
}
|
|
11602
11688
|
function nt(e, t, n) {
|
|
11603
|
-
t.isScene !== !0 && (t =
|
|
11689
|
+
t.isScene !== !0 && (t = B);
|
|
11604
11690
|
let r = q.get(e), i = x.state.lights, a = x.state.shadowsArray, o = i.state.version, s = Se.getParameters(e, i.state, a, t, n), c = Se.getProgramCacheKey(s), l = r.programs;
|
|
11605
11691
|
r.environment = e.isMeshStandardMaterial ? t.environment : null, r.fog = t.fog, r.envMap = (e.isMeshStandardMaterial ? ve : _e).get(e.envMap || r.environment), r.envMapRotation = r.environment !== null && e.envMap === null ? t.environmentRotation : e.envMapRotation, l === void 0 && (e.addEventListener("dispose", He), l = /* @__PURE__ */ new Map(), r.programs = l);
|
|
11606
11692
|
let u = l.get(c);
|
|
@@ -11613,7 +11699,7 @@ var Zc = class {
|
|
|
11613
11699
|
function rt(e) {
|
|
11614
11700
|
if (e.uniformsList === null) {
|
|
11615
11701
|
let t = e.currentProgram.getUniforms();
|
|
11616
|
-
e.uniformsList =
|
|
11702
|
+
e.uniformsList = Us.seqWithValue(t.seq, e.uniforms);
|
|
11617
11703
|
}
|
|
11618
11704
|
return e.uniformsList;
|
|
11619
11705
|
}
|
|
@@ -11622,7 +11708,7 @@ var Zc = class {
|
|
|
11622
11708
|
n.outputColorSpace = t.outputColorSpace, n.batching = t.batching, n.batchingColor = t.batchingColor, n.instancing = t.instancing, n.instancingColor = t.instancingColor, n.instancingMorph = t.instancingMorph, n.skinning = t.skinning, n.morphTargets = t.morphTargets, n.morphNormals = t.morphNormals, n.morphColors = t.morphColors, n.morphTargetsCount = t.morphTargetsCount, n.numClippingPlanes = t.numClippingPlanes, n.numIntersection = t.numClipIntersection, n.vertexAlphas = t.vertexAlphas, n.vertexTangents = t.vertexTangents, n.toneMapping = t.toneMapping;
|
|
11623
11709
|
}
|
|
11624
11710
|
function at(e, t, n, r, i) {
|
|
11625
|
-
t.isScene !== !0 && (t =
|
|
11711
|
+
t.isScene !== !0 && (t = B), J.resetTextureUnits();
|
|
11626
11712
|
let a = t.fog, o = r.isMeshStandardMaterial ? t.environment : null, s = k === null ? T.outputColorSpace : k.isXRRenderTarget === !0 ? k.texture.colorSpace : b, c = (r.isMeshStandardMaterial ? ve : _e).get(r.envMap || o), l = r.vertexColors === !0 && !!n.attributes.color && n.attributes.color.itemSize === 4, u = !!n.attributes.tangent && (!!r.normalMap || r.anisotropy > 0), d = !!n.morphAttributes.position, f = !!n.morphAttributes.normal, p = !!n.morphAttributes.color, m = 0;
|
|
11627
11713
|
r.toneMapped && (k === null || k.isXRRenderTarget === !0) && (m = T.toneMapping);
|
|
11628
11714
|
let h = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, g = h === void 0 ? 0 : h.length, _ = q.get(r), v = x.state.lights;
|
|
@@ -11647,7 +11733,7 @@ var Zc = class {
|
|
|
11647
11733
|
}
|
|
11648
11734
|
i.isBatchedMesh && (D.setOptional(H, i, "batchingTexture"), D.setValue(H, "batchingTexture", i._matricesTexture, J), D.setOptional(H, i, "batchingIdTexture"), D.setValue(H, "batchingIdTexture", i._indirectTexture, J), D.setOptional(H, i, "batchingColorTexture"), i._colorsTexture !== null && D.setValue(H, "batchingColorTexture", i._colorsTexture, J));
|
|
11649
11735
|
let M = n.morphAttributes;
|
|
11650
|
-
if ((M.position !== void 0 || M.normal !== void 0 || M.color !== void 0) && ke.update(i, n, S), (w || _.receiveShadow !== i.receiveShadow) && (_.receiveShadow = i.receiveShadow, D.setValue(H, "receiveShadow", i.receiveShadow)), r.isMeshGouraudMaterial && r.envMap !== null && (O.envMap.value = c, O.flipEnvMap.value = c.isCubeTexture && c.isRenderTargetTexture === !1 ? -1 : 1), r.isMeshStandardMaterial && r.envMap === null && t.environment !== null && (O.envMapIntensity.value = t.environmentIntensity), w && (D.setValue(H, "toneMappingExposure", T.toneMappingExposure), _.needsLights && ot(O, E), a && r.fog === !0 && Ce.refreshFogUniforms(O, a), Ce.refreshMaterialUniforms(O, r,
|
|
11736
|
+
if ((M.position !== void 0 || M.normal !== void 0 || M.color !== void 0) && ke.update(i, n, S), (w || _.receiveShadow !== i.receiveShadow) && (_.receiveShadow = i.receiveShadow, D.setValue(H, "receiveShadow", i.receiveShadow)), r.isMeshGouraudMaterial && r.envMap !== null && (O.envMap.value = c, O.flipEnvMap.value = c.isCubeTexture && c.isRenderTargetTexture === !1 ? -1 : 1), r.isMeshStandardMaterial && r.envMap === null && t.environment !== null && (O.envMapIntensity.value = t.environmentIntensity), w && (D.setValue(H, "toneMappingExposure", T.toneMappingExposure), _.needsLights && ot(O, E), a && r.fog === !0 && Ce.refreshFogUniforms(O, a), Ce.refreshMaterialUniforms(O, r, I, ne, x.state.transmissionRenderTarget[e.id]), Us.upload(H, rt(_), O, J)), r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (Us.upload(H, rt(_), O, J), r.uniformsNeedUpdate = !1), r.isSpriteMaterial && D.setValue(H, "center", i.center), D.setValue(H, "modelViewMatrix", i.modelViewMatrix), D.setValue(H, "normalMatrix", i.normalMatrix), D.setValue(H, "modelMatrix", i.matrixWorld), r.isShaderMaterial || r.isRawShaderMaterial) {
|
|
11651
11737
|
let e = r.uniformsGroups;
|
|
11652
11738
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
11653
11739
|
let n = e[t];
|
|
@@ -11694,9 +11780,9 @@ var Zc = class {
|
|
|
11694
11780
|
let c = e.texture;
|
|
11695
11781
|
(c.isData3DTexture || c.isDataArrayTexture || c.isCompressedArrayTexture) && (o = !0);
|
|
11696
11782
|
let l = q.get(e).__webglFramebuffer;
|
|
11697
|
-
e.isWebGLCubeRenderTarget ? (i = Array.isArray(l[t]) ? l[t][n] : l[t], a = !0) : i = e.samples > 0 && J.useMultisampledRTT(e) === !1 ? q.get(e).__webglMultisampledFramebuffer : Array.isArray(l) ? l[n] : l, M.copy(e.viewport), N.copy(e.scissor),
|
|
11698
|
-
} else M.copy(
|
|
11699
|
-
if (n !== 0 && (i = lt), K.bindFramebuffer(H.FRAMEBUFFER, i) && r && K.drawBuffers(e, i), K.viewport(M), K.scissor(N), K.setScissorTest(
|
|
11783
|
+
e.isWebGLCubeRenderTarget ? (i = Array.isArray(l[t]) ? l[t][n] : l[t], a = !0) : i = e.samples > 0 && J.useMultisampledRTT(e) === !1 ? q.get(e).__webglMultisampledFramebuffer : Array.isArray(l) ? l[n] : l, M.copy(e.viewport), N.copy(e.scissor), ee = e.scissorTest;
|
|
11784
|
+
} else M.copy(L).multiplyScalar(I).floor(), N.copy(R).multiplyScalar(I).floor(), ee = z;
|
|
11785
|
+
if (n !== 0 && (i = lt), K.bindFramebuffer(H.FRAMEBUFFER, i) && r && K.drawBuffers(e, i), K.viewport(M), K.scissor(N), K.setScissorTest(ee), a) {
|
|
11700
11786
|
let r = q.get(e.texture);
|
|
11701
11787
|
H.framebufferTexture2D(H.FRAMEBUFFER, H.COLOR_ATTACHMENT0, H.TEXTURE_CUBE_MAP_POSITIVE_X + t, r.__webglTexture, n);
|
|
11702
11788
|
} else if (o) {
|
|
@@ -11802,9 +11888,9 @@ var Zc = class {
|
|
|
11802
11888
|
let t = this.getContext();
|
|
11803
11889
|
t.drawingBufferColorSpace = Y._getDrawingBufferColorSpace(e), t.unpackColorSpace = Y._getUnpackColorSpace();
|
|
11804
11890
|
}
|
|
11805
|
-
},
|
|
11891
|
+
}, $c = {
|
|
11806
11892
|
name: "@liquidcars/atlas",
|
|
11807
|
-
version: "0.1.
|
|
11893
|
+
version: "0.1.41",
|
|
11808
11894
|
description: "Reusable 3D conceptual atlas Web Component for LiquidCars-style models",
|
|
11809
11895
|
type: "module",
|
|
11810
11896
|
scripts: {
|
|
@@ -11838,37 +11924,37 @@ var Zc = class {
|
|
|
11838
11924
|
"liquidcars"
|
|
11839
11925
|
],
|
|
11840
11926
|
license: "MIT"
|
|
11841
|
-
}.version,
|
|
11927
|
+
}.version, el = {
|
|
11842
11928
|
component: "#8ae4d0",
|
|
11843
11929
|
connection: "#f4edba"
|
|
11844
|
-
},
|
|
11845
|
-
function al(e) {
|
|
11846
|
-
return Array.isArray(e) ? e.map(al) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).filter(([, e]) => typeof e != "function" && e !== void 0).map(([e, t]) => [e, al(t)]));
|
|
11847
|
-
}
|
|
11930
|
+
}, tl = .05, nl = 15, rl = /* @__PURE__ */ new Map(), il = /* @__PURE__ */ new Map(), al = /* @__PURE__ */ new Map();
|
|
11848
11931
|
function ol(e) {
|
|
11849
|
-
return
|
|
11932
|
+
return Array.isArray(e) ? e.map(ol) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).filter(([, e]) => typeof e != "function" && e !== void 0).map(([e, t]) => [e, ol(t)]));
|
|
11933
|
+
}
|
|
11934
|
+
function sl(e) {
|
|
11935
|
+
return (e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { name: e } : ol(e)).filter((e) => e && String(e.name || "").trim()).map((e) => ({
|
|
11850
11936
|
...e,
|
|
11851
11937
|
name: String(e.name).trim()
|
|
11852
11938
|
}));
|
|
11853
11939
|
}
|
|
11854
|
-
function
|
|
11940
|
+
function cl(e) {
|
|
11855
11941
|
return [...new Set((e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => String(e || "").trim()).filter(Boolean))];
|
|
11856
11942
|
}
|
|
11857
|
-
function
|
|
11858
|
-
return e ? typeof e == "string" ? { spdx: e } :
|
|
11943
|
+
function ll(e) {
|
|
11944
|
+
return e ? typeof e == "string" ? { spdx: e } : ol(e) : null;
|
|
11859
11945
|
}
|
|
11860
|
-
function
|
|
11861
|
-
let n =
|
|
11946
|
+
function ul(e, t) {
|
|
11947
|
+
let n = ol(e || {}), r = String(n.id || `source-${t + 1}`).trim();
|
|
11862
11948
|
if (!r) throw TypeError("Geometry pack sources require an id.");
|
|
11863
11949
|
return {
|
|
11864
11950
|
...n,
|
|
11865
11951
|
id: r,
|
|
11866
|
-
authors:
|
|
11867
|
-
license:
|
|
11952
|
+
authors: sl(n.authors ?? n.author),
|
|
11953
|
+
license: ll(n.license)
|
|
11868
11954
|
};
|
|
11869
11955
|
}
|
|
11870
|
-
function
|
|
11871
|
-
let r =
|
|
11956
|
+
function dl(e, t, n) {
|
|
11957
|
+
let r = ol(e || {}), i = String(r.id || "").trim();
|
|
11872
11958
|
if (!i) throw TypeError(`Geometry pack resource at index ${t} requires an id.`);
|
|
11873
11959
|
let a = r.source == null ? null : String(r.source).trim();
|
|
11874
11960
|
if (a && !n.has(a)) throw TypeError(`Geometry pack resource '${i}' references unknown source '${a}'.`);
|
|
@@ -11877,12 +11963,46 @@ function ul(e, t, n) {
|
|
|
11877
11963
|
id: i,
|
|
11878
11964
|
kind: String(r.kind || r.type || "asset"),
|
|
11879
11965
|
source: a,
|
|
11880
|
-
authors:
|
|
11881
|
-
license:
|
|
11966
|
+
authors: sl(r.authors ?? r.author),
|
|
11967
|
+
license: ll(r.license)
|
|
11882
11968
|
};
|
|
11883
11969
|
}
|
|
11884
|
-
function
|
|
11885
|
-
|
|
11970
|
+
function fl(e, t) {
|
|
11971
|
+
if (!e.showcase || typeof e.showcase != "object") return null;
|
|
11972
|
+
let n = ol(e.showcase), r = Array.isArray(n.groups) ? n.groups : [], i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = r.map((e, n) => {
|
|
11973
|
+
let r = e && typeof e == "object" ? e : {}, o = String(r.id || `group-${n + 1}`).trim();
|
|
11974
|
+
if (!o || i.has(o)) throw TypeError(`Geometry pack '${t}' showcase contains a duplicate or empty group id.`);
|
|
11975
|
+
i.add(o);
|
|
11976
|
+
let s = Array.isArray(r.items) ? r.items : Array.isArray(r.children) ? r.children : [];
|
|
11977
|
+
return {
|
|
11978
|
+
...r,
|
|
11979
|
+
id: o,
|
|
11980
|
+
name: String(r.name || r.title || o),
|
|
11981
|
+
items: s.map((e, n) => {
|
|
11982
|
+
let r = e && typeof e == "object" ? e : {}, i = String(r.geometry || r.kind || "").trim();
|
|
11983
|
+
if (!i) throw TypeError(`Geometry pack '${t}' showcase item ${n + 1} in '${o}' requires a geometry.`);
|
|
11984
|
+
let s = String(r.id || `${o}-${n + 1}`).trim();
|
|
11985
|
+
if (!s || a.has(s)) throw TypeError(`Geometry pack '${t}' showcase contains a duplicate or empty item id.`);
|
|
11986
|
+
return a.add(s), {
|
|
11987
|
+
...r,
|
|
11988
|
+
id: s,
|
|
11989
|
+
geometry: i.includes(".") ? i : `${t}.${i}`,
|
|
11990
|
+
geometryOptions: ol(r.geometryOptions || r.options || r.parameters || {}),
|
|
11991
|
+
geometryPalette: ol(r.geometryPalette || r.palette || {})
|
|
11992
|
+
};
|
|
11993
|
+
})
|
|
11994
|
+
};
|
|
11995
|
+
});
|
|
11996
|
+
return {
|
|
11997
|
+
...n,
|
|
11998
|
+
title: String(n.title || e.name || t),
|
|
11999
|
+
description: String(n.description || ""),
|
|
12000
|
+
groups: o,
|
|
12001
|
+
relations: ol(Array.isArray(n.relations) ? n.relations : [])
|
|
12002
|
+
};
|
|
12003
|
+
}
|
|
12004
|
+
function pl(e, t) {
|
|
12005
|
+
let n = (Array.isArray(e.sources) ? e.sources : []).map(ul), r = new Set(n.map((e) => e.id)), i = (Array.isArray(e.resources) ? e.resources : []).map((e, t) => dl(e, t, r));
|
|
11886
12006
|
if (new Set(i.map((e) => e.id)).size !== i.length) throw TypeError(`Geometry pack '${t}' contains duplicate resource ids.`);
|
|
11887
12007
|
return {
|
|
11888
12008
|
namespace: t,
|
|
@@ -11891,35 +12011,36 @@ function dl(e, t) {
|
|
|
11891
12011
|
description: String(e.description || ""),
|
|
11892
12012
|
category: String(e.category || e.name || t),
|
|
11893
12013
|
homepage: e.homepage ? String(e.homepage) : "",
|
|
11894
|
-
repository:
|
|
11895
|
-
authors:
|
|
11896
|
-
license:
|
|
12014
|
+
repository: ol(e.repository || null),
|
|
12015
|
+
authors: sl(e.authors ?? e.author),
|
|
12016
|
+
license: ll(e.license),
|
|
11897
12017
|
attribution: String(e.attribution || ""),
|
|
11898
|
-
collections:
|
|
12018
|
+
collections: ol(Array.isArray(e.collections) ? e.collections : []),
|
|
12019
|
+
showcase: fl(e, t),
|
|
11899
12020
|
sources: n,
|
|
11900
12021
|
resources: i,
|
|
11901
12022
|
geometries: []
|
|
11902
12023
|
};
|
|
11903
12024
|
}
|
|
11904
|
-
function
|
|
12025
|
+
function ml(e) {
|
|
11905
12026
|
let { create: t, resourceMap: n, ...r } = e;
|
|
11906
12027
|
return {
|
|
11907
|
-
...
|
|
12028
|
+
...ol(r),
|
|
11908
12029
|
canonicalSize: [...e.canonicalSize],
|
|
11909
|
-
parameters:
|
|
11910
|
-
palette:
|
|
11911
|
-
anchors:
|
|
12030
|
+
parameters: ol(e.parameters),
|
|
12031
|
+
palette: ol(e.palette),
|
|
12032
|
+
anchors: ol(e.anchors)
|
|
11912
12033
|
};
|
|
11913
12034
|
}
|
|
11914
|
-
function
|
|
11915
|
-
return
|
|
12035
|
+
function hl(e) {
|
|
12036
|
+
return ol(e);
|
|
11916
12037
|
}
|
|
11917
|
-
function
|
|
12038
|
+
function gl(e) {
|
|
11918
12039
|
if (!e || typeof e != "object") throw TypeError("A geometry pack must be an object.");
|
|
11919
12040
|
let t = String(e.namespace || "").trim();
|
|
11920
12041
|
if (!/^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$/i.test(t)) throw TypeError("A geometry pack requires a valid dot-separated namespace.");
|
|
11921
12042
|
if (!Array.isArray(e.geometries) || !e.geometries.length) throw TypeError("A geometry pack requires at least one geometry.");
|
|
11922
|
-
let n =
|
|
12043
|
+
let n = pl(e, t), r = Object.freeze(Object.fromEntries(n.resources.map((e) => [e.id, Object.freeze(ol(e))]))), i = [];
|
|
11923
12044
|
for (let a of e.geometries) {
|
|
11924
12045
|
if (!a || typeof a != "object" || !a.id) throw TypeError(`Geometry pack '${t}' contains an invalid geometry.`);
|
|
11925
12046
|
let o = String(a.id).includes(".") ? String(a.id).split(".").pop() : String(a.id), s = String(a.id).includes(".") ? String(a.id) : `${t}.${o}`;
|
|
@@ -11932,8 +12053,8 @@ function ml(e) {
|
|
|
11932
12053
|
packVersion: n.version,
|
|
11933
12054
|
category: a.category || n.category,
|
|
11934
12055
|
collection: a.collection == null ? "" : String(a.collection).trim(),
|
|
11935
|
-
tags:
|
|
11936
|
-
keywords:
|
|
12056
|
+
tags: cl(a.tags),
|
|
12057
|
+
keywords: cl(a.keywords),
|
|
11937
12058
|
canonicalSize: Array.isArray(a.canonicalSize) && a.canonicalSize.length === 3 ? a.canonicalSize.map(Number) : [
|
|
11938
12059
|
2.5,
|
|
11939
12060
|
1.5,
|
|
@@ -11951,41 +12072,41 @@ function ml(e) {
|
|
|
11951
12072
|
resourceMap: r
|
|
11952
12073
|
});
|
|
11953
12074
|
}
|
|
11954
|
-
|
|
12075
|
+
_l(t);
|
|
11955
12076
|
let a = [];
|
|
11956
12077
|
for (let e of i) {
|
|
11957
|
-
|
|
11958
|
-
for (let t of e.aliases || [])
|
|
12078
|
+
rl.set(e.id, e), il.set(e.id, e.id);
|
|
12079
|
+
for (let t of e.aliases || []) il.set(String(t), e.id);
|
|
11959
12080
|
a.push(e.id);
|
|
11960
12081
|
}
|
|
11961
|
-
n.geometries = [...a],
|
|
11962
|
-
let o =
|
|
12082
|
+
n.geometries = [...a], al.set(t, n);
|
|
12083
|
+
let o = hl(n);
|
|
11963
12084
|
return typeof globalThis.dispatchEvent == "function" && typeof CustomEvent == "function" && globalThis.dispatchEvent(new CustomEvent("lc-geometry-registry-change", { detail: {
|
|
11964
12085
|
namespace: t,
|
|
11965
12086
|
geometries: a,
|
|
11966
12087
|
pack: o
|
|
11967
12088
|
} })), o;
|
|
11968
12089
|
}
|
|
11969
|
-
function
|
|
12090
|
+
function _l(e) {
|
|
11970
12091
|
let t = [];
|
|
11971
|
-
for (let [n, r] of
|
|
11972
|
-
for (let [e, n] of
|
|
11973
|
-
return
|
|
12092
|
+
for (let [n, r] of rl) r.namespace === e && (rl.delete(n), t.push(n));
|
|
12093
|
+
for (let [e, n] of il) t.includes(n) && il.delete(e);
|
|
12094
|
+
return al.delete(e), t;
|
|
11974
12095
|
}
|
|
11975
|
-
function
|
|
11976
|
-
return [...
|
|
12096
|
+
function vl() {
|
|
12097
|
+
return [...rl.values()].map(ml);
|
|
11977
12098
|
}
|
|
11978
|
-
function
|
|
11979
|
-
return [...
|
|
12099
|
+
function yl() {
|
|
12100
|
+
return [...al.values()].map(hl);
|
|
11980
12101
|
}
|
|
11981
|
-
function
|
|
11982
|
-
let t =
|
|
11983
|
-
return
|
|
12102
|
+
function bl(e) {
|
|
12103
|
+
let t = il.get(e) || e;
|
|
12104
|
+
return rl.get(t) || null;
|
|
11984
12105
|
}
|
|
11985
|
-
function
|
|
12106
|
+
function xl(e) {
|
|
11986
12107
|
return e === "container" || e === "shell";
|
|
11987
12108
|
}
|
|
11988
|
-
function
|
|
12109
|
+
function Sl(e = {}) {
|
|
11989
12110
|
let t = e && typeof e == "object" ? e : {}, n = Number(t.opacity);
|
|
11990
12111
|
return {
|
|
11991
12112
|
mode: t.mode === "connected" ? "connected" : "all",
|
|
@@ -11994,20 +12115,20 @@ function bl(e = {}) {
|
|
|
11994
12115
|
opacity: Number.isFinite(n) ? Math.max(.02, Math.min(.8, n)) : .12
|
|
11995
12116
|
};
|
|
11996
12117
|
}
|
|
11997
|
-
function
|
|
12118
|
+
function Cl(e) {
|
|
11998
12119
|
return [
|
|
11999
12120
|
"preserve",
|
|
12000
12121
|
"center",
|
|
12001
12122
|
"fit"
|
|
12002
12123
|
].includes(e) ? e : "preserve";
|
|
12003
12124
|
}
|
|
12004
|
-
function
|
|
12125
|
+
function wl(e) {
|
|
12005
12126
|
return e === "model" ? "model" : "camera";
|
|
12006
12127
|
}
|
|
12007
|
-
function
|
|
12128
|
+
function Tl(e, t) {
|
|
12008
12129
|
e && e.transparent !== t && (e.transparent = t, e.needsUpdate = !0);
|
|
12009
12130
|
}
|
|
12010
|
-
|
|
12131
|
+
gl({
|
|
12011
12132
|
namespace: "geo",
|
|
12012
12133
|
name: "Geometric primitives",
|
|
12013
12134
|
version: "1",
|
|
@@ -12064,7 +12185,7 @@ ml({
|
|
|
12064
12185
|
} } : {}
|
|
12065
12186
|
}))
|
|
12066
12187
|
});
|
|
12067
|
-
var
|
|
12188
|
+
var El = {
|
|
12068
12189
|
background: {
|
|
12069
12190
|
color: "#0a111a",
|
|
12070
12191
|
glow: "#1c2b39",
|
|
@@ -12109,17 +12230,17 @@ var wl = {
|
|
|
12109
12230
|
hint: !0
|
|
12110
12231
|
}
|
|
12111
12232
|
};
|
|
12112
|
-
function
|
|
12233
|
+
function Dl(e, t) {
|
|
12113
12234
|
let n = { ...e };
|
|
12114
12235
|
if (!t || typeof t != "object") return n;
|
|
12115
|
-
for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ?
|
|
12236
|
+
for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ? Dl(e?.[r] || {}, i) : i;
|
|
12116
12237
|
return n;
|
|
12117
12238
|
}
|
|
12118
|
-
function
|
|
12239
|
+
function Ol(e) {
|
|
12119
12240
|
let t = e && typeof e == "object" ? { ...e } : {};
|
|
12120
|
-
return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }),
|
|
12241
|
+
return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }), Dl(El, t);
|
|
12121
12242
|
}
|
|
12122
|
-
function
|
|
12243
|
+
function kl(e) {
|
|
12123
12244
|
if (!e || typeof e != "object") return "directed";
|
|
12124
12245
|
let t = String(e.mode || e.visual || e.render || e.type || e.direction || "").trim().toLowerCase().replace(/[_\s]+/g, "-");
|
|
12125
12246
|
return e.bidirectional === !0 || [
|
|
@@ -12134,7 +12255,7 @@ function Dl(e) {
|
|
|
12134
12255
|
"failed"
|
|
12135
12256
|
].includes(t) ? "broken" : "directed";
|
|
12136
12257
|
}
|
|
12137
|
-
var
|
|
12258
|
+
var Al = [":host{display:block;position:relative;height:var(--lc-height,680px);min-height:420px;color:var(--lc-panel-title,#e9f0f5);font:14px Inter,system-ui,-apple-system,sans-serif;background:var(--lc-bg,#0a111a);border:1px solid #294252;border-radius:12px;overflow:hidden;contain:content}", "*{box-sizing:border-box}.atlas{display:grid;grid-template-columns:minmax(0,1fr) 300px;height:100%}.atlas[data-panel=hidden]{grid-template-columns:1fr}.viewport{position:relative;min-width:0;overflow:hidden;background:radial-gradient(ellipse at 50% 45%,var(--lc-bg-glow,#1c2b39),var(--lc-bg-fade,#0a111a) 82%)}canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}.toolbar{position:absolute;z-index:10;bottom:28px;left:50%;transform:translateX(-50%);display:flex;gap:3px;padding:6px;background:var(--lc-toolbar-bg,#15232fe8);border:1px solid var(--lc-toolbar-border,#3a5062);border-radius:8px;white-space:nowrap}.toolbar[data-hidden=true],.toolbar[hidden],.panel[data-hidden=true],.panel[hidden],.crumbs[data-hidden=true],.crumbs[hidden],.hint[data-hidden=true],.hint[hidden]{display:none!important}.toolbar button{height:30px;padding:0 9px;border:0;border-radius:5px;background:none;color:var(--lc-toolbar-text,#dbe7ec);cursor:pointer}.toolbar button:hover,.toolbar button.active{background:var(--lc-toolbar-active,#1f3d4b);color:var(--lc-toolbar-active-text,#c5f2e9)}.toolbar i{display:block;width:1px;margin:2px 3px;background:#38515f}.hint{position:absolute;z-index:9;top:8px;bottom:auto;left:0;right:0;text-align:center;padding:2px 8px;font-size:11px;line-height:16px;color:var(--lc-hint,#8da6b8);pointer-events:none}.panel{overflow:auto;padding:24px 20px;background:var(--lc-panel-bg,linear-gradient(140deg,#182633,#0e1925 65%));border-left:1px solid var(--lc-panel-border,#2a3a48)}.panel h2{font-size:26px;line-height:1.12;font-weight:470;margin:12px 0;color:var(--lc-panel-title,#e9f0f5)}.panel h3{font-size:11px;letter-spacing:1.4px;color:#91aabd;margin:24px 0 10px}.panel p{font-size:14px;line-height:1.55;color:var(--lc-panel-text,#b5c6d2)}.panel .eyebrow{font-size:11px;letter-spacing:1.7px;color:#6ad7c0}.panel .sub{font-size:13px;color:#8fa8bd;margin-bottom:16px}.panel .external-link{display:inline-flex;align-items:center;gap:6px;margin:2px 0 12px;color:#6ad7c0;font-size:13px;font-weight:600;text-decoration:none}.panel .external-link:hover{text-decoration:underline}.panel button{display:block;width:100%;padding:10px 0;text-align:left;background:none;border:0;border-bottom:1px solid var(--lc-panel-border,#2a3a48);color:#d9e7eb;cursor:pointer}.panel button:hover{color:#6ad7c0}.panel .relation{padding:10px 0;border-bottom:1px solid var(--lc-panel-border,#2a3a48)}.panel .relation strong{display:block;font-weight:550}.panel .relation small{display:block;color:#86a6b9;font-size:12px;margin-top:4px}.panel .back{color:#9db7c8;font-size:13px}.panel .crumbs{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin:0 0 12px}.panel .crumbs button{display:inline;width:auto;padding:3px 7px;border:0;border-radius:4px;background:var(--lc-crumb-bg,#142733);color:var(--lc-crumb-text,#91b6c7);font-size:12px}.panel .crumbs button.current{background:var(--lc-crumb-active,#1c4a4d);color:var(--lc-crumb-active-text,#c5f2e9)}.panel .note{border-top:1px solid var(--lc-panel-border,#2a3a48);padding-top:16px;margin-top:22px;font-size:12px;color:#7692a6}.error{position:absolute;inset:20%;padding:18px;background:#172b3b;border:1px solid #7896a9;line-height:1.5;z-index:4}@media(max-width:900px){.toolbar{gap:0}.toolbar button{padding:0 6px;font-size:12px}}@media(max-width:760px){:host{height:680px}.atlas{grid-template-columns:1fr;grid-template-rows:minmax(420px,1fr) auto}.panel{max-height:250px;border-left:0;border-top:1px solid var(--lc-panel-border,#2a3a48);padding:18px}.toolbar{bottom:24px}.hint{top:8px;bottom:auto;display:block}}"].join(""), jl = ".toolbar{max-width:calc(100% - 16px);overflow:visible}.toolbar-group{display:flex;align-items:center;gap:2px}.toolbar-group+.toolbar-group{padding-left:6px;border-left:1px solid #38515f}.toolbar .toolbar-icon{display:grid;width:30px;padding:0;place-items:center}.toolbar-icon svg,.toolbar-menu>summary svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.toolbar-menu{position:relative}.toolbar-menu>summary{display:flex;align-items:center;height:30px;padding:0 8px;gap:6px;border-radius:5px;color:var(--lc-toolbar-text,#dbe7ec);cursor:pointer;list-style:none;user-select:none}.toolbar-menu>summary::-webkit-details-marker{display:none}.toolbar-menu>summary:hover,.toolbar-menu[open]>summary{background:var(--lc-toolbar-active,#1f3d4b);color:var(--lc-toolbar-active-text,#c5f2e9)}.toolbar-menu-status{max-width:92px;overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.toolbar-menu-chevron{width:10px;height:10px!important;transition:transform .16s ease}.toolbar-menu[open] .toolbar-menu-chevron{transform:rotate(180deg)}.toolbar-popover{position:absolute;right:0;bottom:calc(100% + 8px);display:grid;min-width:218px;padding:6px;border:1px solid var(--lc-toolbar-border,#3a5062);border-radius:9px;background:var(--lc-toolbar-bg,#15232ff7);box-shadow:0 14px 36px #0009}.toolbar-popover-title{padding:7px 9px 5px;color:var(--lc-hint,#8da6b8);font-size:9px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}.toolbar .toolbar-option{display:grid;grid-template-columns:minmax(0,1fr) 18px;align-items:center;width:100%;height:auto;min-height:34px;padding:7px 9px;text-align:left}.toolbar-option span:first-child{overflow:hidden;text-overflow:ellipsis}.toolbar-option-check{color:var(--lc-toolbar-active-text,#c5f2e9);font-weight:700;text-align:center;visibility:hidden}.toolbar-option.active .toolbar-option-check{visibility:visible}.toolbar-option-separator{height:1px;margin:5px 7px;background:#38515f}.toolbar button[disabled]{opacity:.42;cursor:not-allowed}@media(max-width:620px){.toolbar-menu-status{display:none}.toolbar-menu>summary{width:30px;padding:0;justify-content:center}.toolbar-menu-chevron{display:none}.toolbar-group+.toolbar-group{padding-left:3px}.toolbar-popover{right:-4px}}", Ml = [
|
|
12138
12259
|
".viewport>.atlas-print-snapshot{display:none!important}",
|
|
12139
12260
|
"@media print{",
|
|
12140
12261
|
":host{-webkit-print-color-adjust:exact;print-color-adjust:exact;break-inside:avoid;page-break-inside:avoid}",
|
|
@@ -12143,17 +12264,17 @@ var Ol = [":host{display:block;position:relative;height:var(--lc-height,680px);m
|
|
|
12143
12264
|
":host([data-lc-print-ready]) .viewport>canvas:not(.atlas-print-snapshot){display:none!important}",
|
|
12144
12265
|
":host([data-lc-print-ready]) .viewport>.atlas-print-snapshot{display:block!important;width:100%;height:100%}",
|
|
12145
12266
|
"}"
|
|
12146
|
-
].join(""),
|
|
12147
|
-
minus:
|
|
12148
|
-
plus:
|
|
12149
|
-
fit:
|
|
12150
|
-
front:
|
|
12151
|
-
view:
|
|
12152
|
-
relations:
|
|
12153
|
-
focus:
|
|
12154
|
-
chevron:
|
|
12155
|
-
},
|
|
12156
|
-
function
|
|
12267
|
+
].join(""), Nl = (e, t = "0 0 24 24") => `<svg viewBox="${t}" aria-hidden="true">${e}</svg>`, Pl = {
|
|
12268
|
+
minus: Nl("<path d=\"M6 12h12\"/>"),
|
|
12269
|
+
plus: Nl("<path d=\"M12 6v12M6 12h12\"/>"),
|
|
12270
|
+
fit: Nl("<path d=\"M9 4H4v5M15 4h5v5M20 15v5h-5M4 15v5h5\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
|
|
12271
|
+
front: Nl("<rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"1.5\"/><path d=\"M8 16h8\"/>"),
|
|
12272
|
+
view: Nl("<path d=\"M2.5 12s3.5-5 9.5-5 9.5 5 9.5 5-3.5 5-9.5 5-9.5-5-9.5-5Z\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
|
|
12273
|
+
relations: Nl("<circle cx=\"5\" cy=\"6\" r=\"2\"/><circle cx=\"19\" cy=\"7\" r=\"2\"/><circle cx=\"12\" cy=\"18\" r=\"2\"/><path d=\"m6.8 6.3 10.2.5M6.2 7.7l4.6 8.6m6.8-7.5-4.4 7.5\"/>"),
|
|
12274
|
+
focus: Nl("<circle cx=\"12\" cy=\"12\" r=\"7\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3\"/>"),
|
|
12275
|
+
chevron: Nl("<path d=\"m8 10 4 4 4-4\"/>")
|
|
12276
|
+
}, Fl = (e, t, n = !1) => `<button class="toolbar-option${n ? " active" : ""}" data-action="${e}" aria-pressed="${n}"><span>${t}</span><span class="toolbar-option-check" aria-hidden="true">✓</span></button>`, Il = (e, t, n, r, i) => `<details class="toolbar-menu" data-toolbar-menu="${e}"><summary aria-label="${n}" title="${n}">${t}<span class="toolbar-menu-status" data-toolbar-status="${e}">${r}</span>${Pl.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, Ll = `<div class="atlas"><section class="viewport"><canvas tabindex="0" aria-label="Modelo 3D interactivo"></canvas><div class="toolbar" role="toolbar" aria-label="Controles de la vista"><div class="toolbar-group" data-toolbar-group="camera"><button class="toolbar-icon" data-action="minus" aria-label="Alejar" title="Alejar">${Pl.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Acercar" title="Acercar">${Pl.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Encuadrar todo el modelo" title="Encuadrar todo el modelo">${Pl.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Vista frontal" title="Vista frontal">${Pl.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${Il("view", Pl.view, "Vista", "Vista", Fl("labels", "Etiquetas", !0) + Fl("panel", "Información", !0) + Fl("item-facing", "Caras a cámara", !0) + "<div class=\"toolbar-option-separator\"></div>" + Fl("open-all", "Abrir todos") + Fl("close-all", "Cerrar todos"))}</div><div class="toolbar-group" data-toolbar-group="relations">${Il("relations", Pl.relations, "Relaciones", "Selección", Fl("relations-all", "Todas") + Fl("relations-selected", "Selección", !0) + Fl("relations-none", "Ocultar"))}</div><div class="toolbar-group" data-toolbar-group="focus">${Il("focus", Pl.focus, "Foco", "Todo", Fl("focus-all", "Todo", !0) + Fl("focus-dim", "Conectados") + Fl("focus-hide", "Aislar") + "<div class=\"toolbar-option-separator\"></div>" + Fl("focus-selection", "Enfocar selección") + Fl("focus-layout", "Reorganizar visibles"))}</div></div><div class="hint">Gira: arrastra · Pan: botón derecho / ⇧+arrastra / 2 dedos · Zoom: rueda o pellizco · Selecciona: clic · Enfoca: doble clic</div></section><aside class="panel" aria-live="polite"></aside></div>`;
|
|
12277
|
+
function Rl(e) {
|
|
12157
12278
|
return String(e ?? "").replace(/[&<>"']/g, (e) => ({
|
|
12158
12279
|
"&": "&",
|
|
12159
12280
|
"<": "<",
|
|
@@ -12162,17 +12283,17 @@ function Il(e) {
|
|
|
12162
12283
|
"'": "'"
|
|
12163
12284
|
})[e]);
|
|
12164
12285
|
}
|
|
12165
|
-
function
|
|
12286
|
+
function zl(e) {
|
|
12166
12287
|
let t = String(e ?? "").trim();
|
|
12167
12288
|
if (!t) return "";
|
|
12168
12289
|
try {
|
|
12169
12290
|
let e = new URL(t, globalThis.location?.href);
|
|
12170
|
-
return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" +
|
|
12291
|
+
return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" + Rl(e.href) + "\" target=\"_blank\" rel=\"noopener noreferrer\">Open documentation ↗</a>" : "";
|
|
12171
12292
|
} catch {
|
|
12172
12293
|
return "";
|
|
12173
12294
|
}
|
|
12174
12295
|
}
|
|
12175
|
-
function
|
|
12296
|
+
function Bl(e) {
|
|
12176
12297
|
let t = e && typeof e == "object" ? e : {}, n = Array.isArray(t.entities) ? t.entities.map((e) => ({
|
|
12177
12298
|
...e,
|
|
12178
12299
|
p: Array.isArray(e.p) ? e.p : [
|
|
@@ -12189,28 +12310,28 @@ function Rl(e) {
|
|
|
12189
12310
|
from: e[0],
|
|
12190
12311
|
to: e[1],
|
|
12191
12312
|
label: e[2] || "",
|
|
12192
|
-
mode:
|
|
12313
|
+
mode: kl({ mode: e[3] }),
|
|
12193
12314
|
index: t
|
|
12194
12315
|
} : {
|
|
12195
12316
|
...e,
|
|
12196
12317
|
from: e.from,
|
|
12197
12318
|
to: e.to,
|
|
12198
12319
|
label: e.label || "",
|
|
12199
|
-
mode:
|
|
12320
|
+
mode: kl(e),
|
|
12200
12321
|
index: t
|
|
12201
12322
|
}) : [];
|
|
12202
12323
|
return {
|
|
12203
12324
|
...t,
|
|
12204
12325
|
palette: {
|
|
12205
|
-
|
|
12326
|
+
...el,
|
|
12206
12327
|
...t.palette || {}
|
|
12207
12328
|
},
|
|
12208
|
-
theme:
|
|
12329
|
+
theme: Ol(t.theme || t.styles),
|
|
12209
12330
|
entities: n,
|
|
12210
12331
|
relations: r
|
|
12211
12332
|
};
|
|
12212
12333
|
}
|
|
12213
|
-
function
|
|
12334
|
+
function Vl(e, t, n = [
|
|
12214
12335
|
1,
|
|
12215
12336
|
1,
|
|
12216
12337
|
1
|
|
@@ -12229,7 +12350,7 @@ function zl(e, t, n = [
|
|
|
12229
12350
|
});
|
|
12230
12351
|
return s.center(), s;
|
|
12231
12352
|
}
|
|
12232
|
-
function
|
|
12353
|
+
function Hl(e, t, n) {
|
|
12233
12354
|
let r = new ui();
|
|
12234
12355
|
for (let t = 0; t < e; t++) {
|
|
12235
12356
|
let n = Math.PI / 2 + t * Math.PI * 2 / e, i = new V(Math.cos(n) * .5, Math.sin(n) * .5);
|
|
@@ -12246,7 +12367,7 @@ function Bl(e, t, n) {
|
|
|
12246
12367
|
});
|
|
12247
12368
|
return i.rotateX(Math.PI / 2), i.center(), i;
|
|
12248
12369
|
}
|
|
12249
|
-
function
|
|
12370
|
+
function Ul(e, t, n, r) {
|
|
12250
12371
|
let i = Math.min(.22, Math.max(0, Number(n) || 0));
|
|
12251
12372
|
if (!i) return new Er(t, e, 1, 32);
|
|
12252
12373
|
let a = [new V(0, -.5)];
|
|
@@ -12263,7 +12384,7 @@ function Vl(e, t, n, r) {
|
|
|
12263
12384
|
}
|
|
12264
12385
|
return a.push(new V(0, .5)), new Qi(a, 32);
|
|
12265
12386
|
}
|
|
12266
|
-
function
|
|
12387
|
+
function Wl(e, t) {
|
|
12267
12388
|
if (!t) return e;
|
|
12268
12389
|
let n = Math.min(.72, Math.max(0, Number(t) * 3)), r = e.attributes.position;
|
|
12269
12390
|
for (let e = 0; e < r.count; e++) {
|
|
@@ -12272,36 +12393,36 @@ function Hl(e, t) {
|
|
|
12272
12393
|
}
|
|
12273
12394
|
return r.needsUpdate = !0, e.computeVertexNormals(), e;
|
|
12274
12395
|
}
|
|
12275
|
-
function
|
|
12396
|
+
function Gl(e, t = 0, n = 4, r = [
|
|
12276
12397
|
1,
|
|
12277
12398
|
1,
|
|
12278
12399
|
1
|
|
12279
12400
|
]) {
|
|
12280
12401
|
let i = Number(t) || 0, a = Math.max(2, Math.round(Number(n) || 4));
|
|
12281
12402
|
switch (e) {
|
|
12282
|
-
case "cylinder": return i ?
|
|
12283
|
-
case "cone": return i ?
|
|
12403
|
+
case "cylinder": return i ? Ul(.5, .5, i, a) : new Er(.5, .5, 1, 32);
|
|
12404
|
+
case "cone": return i ? Ul(0, .5, i, a) : new Dr(.5, 1, 32);
|
|
12284
12405
|
case "frustum-cone":
|
|
12285
|
-
case "truncated-cone": return i ?
|
|
12406
|
+
case "truncated-cone": return i ? Ul(.28, .5, i, a) : new Er(.28, .5, 1, 32);
|
|
12286
12407
|
case "frustum-pyramid":
|
|
12287
12408
|
case "truncated-pyramid": return new Er(.28, .5, 1, 4);
|
|
12288
12409
|
case "frustum-triangle": return new Er(.28, .5, 1, 3);
|
|
12289
|
-
case "prism": return i ?
|
|
12290
|
-
case "pyramid-square": return i ?
|
|
12291
|
-
case "pyramid-triangle": return i ?
|
|
12410
|
+
case "prism": return i ? Hl(6, i, a) : new Er(.5, .5, 1, 6);
|
|
12411
|
+
case "pyramid-square": return i ? Wl(new Dr(.5, 1, 4), i) : new Dr(.5, 1, 4);
|
|
12412
|
+
case "pyramid-triangle": return i ? Wl(new Dr(.5, 1, 3), i) : new Dr(.5, 1, 3);
|
|
12292
12413
|
case "sphere": return new ta(.5, 24, 16);
|
|
12293
|
-
case "octahedron": return
|
|
12294
|
-
case "dodecahedron": return
|
|
12295
|
-
case "icosahedron": return
|
|
12296
|
-
default: return i ?
|
|
12414
|
+
case "octahedron": return Wl(new $i(.5), i);
|
|
12415
|
+
case "dodecahedron": return Wl(new kr(.5), i);
|
|
12416
|
+
case "icosahedron": return Wl(new Zi(.5), i);
|
|
12417
|
+
default: return i ? Vl(i, a, r) : new Nn(1, 1, 1);
|
|
12297
12418
|
}
|
|
12298
12419
|
}
|
|
12299
|
-
function
|
|
12420
|
+
function Kl(e) {
|
|
12300
12421
|
e.computeBoundingBox();
|
|
12301
12422
|
let t = e.boundingBox?.getSize(new U());
|
|
12302
12423
|
return !t || !t.x || !t.y || !t.z ? e : (e.scale(1 / t.x, 1 / t.y, 1 / t.z), e.computeBoundingBox(), e);
|
|
12303
12424
|
}
|
|
12304
|
-
function
|
|
12425
|
+
function ql(e, t) {
|
|
12305
12426
|
let n = e.geometryOptions || e.geometry_options || e.parameters || {}, r = {};
|
|
12306
12427
|
for (let [e, n] of Object.entries(t?.parameters || {})) n && Object.hasOwn(n, "default") && (r[e] = n.default);
|
|
12307
12428
|
return {
|
|
@@ -12309,10 +12430,10 @@ function Gl(e, t) {
|
|
|
12309
12430
|
...n && typeof n == "object" ? n : {}
|
|
12310
12431
|
};
|
|
12311
12432
|
}
|
|
12312
|
-
function
|
|
12433
|
+
function Jl(e, t, n) {
|
|
12313
12434
|
return typeof e != "string" || !e ? n : t[e] || e;
|
|
12314
12435
|
}
|
|
12315
|
-
function
|
|
12436
|
+
function Yl(e, t = "#ffffff", n = "transparent") {
|
|
12316
12437
|
let r = document.createElement("canvas");
|
|
12317
12438
|
r.width = 256, r.height = 256;
|
|
12318
12439
|
let i = r.getContext("2d");
|
|
@@ -12320,11 +12441,101 @@ function ql(e, t = "#ffffff", n = "transparent") {
|
|
|
12320
12441
|
let a = new Cr(r);
|
|
12321
12442
|
return a.colorSpace = y, a;
|
|
12322
12443
|
}
|
|
12323
|
-
|
|
12324
|
-
|
|
12444
|
+
var Xl = /^[AaCcHhLlMmQqSsTtVvZz]$/, Zl = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?|[AaCcHhLlMmQqSsTtVvZz]/g;
|
|
12445
|
+
function Ql(e, t, n, r, i, a, o, s, c) {
|
|
12446
|
+
let l = Math.abs(Number(n)), u = Math.abs(Number(r));
|
|
12447
|
+
if (!l || !u || e === s && t === c) return [[s, c]];
|
|
12448
|
+
let d = Number(i || 0) * Math.PI / 180, f = Math.cos(d), p = Math.sin(d), m = (e - s) / 2, h = (t - c) / 2, g = f * m + p * h, _ = -p * m + f * h, v = Math.sqrt(Math.max(1, g * g / (l * l) + _ * _ / (u * u)));
|
|
12449
|
+
l *= v, u *= v;
|
|
12450
|
+
let y = Math.max(0, l * l * u * u - l * l * _ * _ - u * u * g * g), b = Math.max(2 ** -52, l * l * _ * _ + u * u * g * g), x = (!!a == !!o ? -1 : 1) * Math.sqrt(y / b), S = x * l * _ / u, C = x * -u * g / l, w = f * S - p * C + (e + s) / 2, T = p * S + f * C + (t + c) / 2, E = (e, t, n, r) => {
|
|
12451
|
+
let i = Math.max(2 ** -52, Math.hypot(e, t) * Math.hypot(n, r)), a = Math.acos(Math.max(-1, Math.min(1, (e * n + t * r) / i)));
|
|
12452
|
+
return e * r - t * n < 0 ? -a : a;
|
|
12453
|
+
}, D = (g - S) / l, O = (_ - C) / u, k = (-g - S) / l, A = (-_ - C) / u, j = E(1, 0, D, O), M = E(D, O, k, A);
|
|
12454
|
+
!o && M > 0 && (M -= Math.PI * 2), o && M < 0 && (M += Math.PI * 2);
|
|
12455
|
+
let N = Math.max(6, Math.ceil(Math.abs(M) / (Math.PI / 12)));
|
|
12456
|
+
return Array.from({ length: N }, (e, t) => {
|
|
12457
|
+
let n = j + M * (t + 1) / N, r = Math.cos(n), i = Math.sin(n);
|
|
12458
|
+
return [w + f * l * r - p * u * i, T + p * l * r + f * u * i];
|
|
12459
|
+
});
|
|
12460
|
+
}
|
|
12461
|
+
function $l(e) {
|
|
12462
|
+
let t = String(e || "").match(Zl) || [], n = new qa(), r = 0, i = "", a = "", o = 0, s = 0, c = 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = () => r < t.length && !Xl.test(t[r]), h = () => Number(t[r++]), g = () => {
|
|
12463
|
+
let e = t[r];
|
|
12464
|
+
return /^[01].+/.test(e) ? (t[r] = e.slice(1), e[0] === "1") : h() !== 0;
|
|
12465
|
+
}, _ = (e, t, n) => [n ? o + e : e, n ? s + t : t];
|
|
12466
|
+
for (; r < t.length && (Xl.test(t[r]) && (i = t[r++]), i);) {
|
|
12467
|
+
let e = i.toLowerCase(), t = i === e;
|
|
12468
|
+
if (e === "z") {
|
|
12469
|
+
n.currentPath?.closePath(), o = c, s = l, a = i, i = "";
|
|
12470
|
+
continue;
|
|
12471
|
+
}
|
|
12472
|
+
if (!m()) break;
|
|
12473
|
+
if (e === "m") {
|
|
12474
|
+
let e = !0;
|
|
12475
|
+
for (; m();) {
|
|
12476
|
+
let [r, i] = _(h(), h(), t);
|
|
12477
|
+
o = r, s = i, e ? (n.moveTo(o, -s), c = o, l = s, e = !1) : n.lineTo(o, -s);
|
|
12478
|
+
}
|
|
12479
|
+
} else if (e === "l") for (; m();) [o, s] = _(h(), h(), t), n.lineTo(o, -s);
|
|
12480
|
+
else if (e === "h") for (; m();) {
|
|
12481
|
+
let e = h();
|
|
12482
|
+
o = t ? o + e : e, n.lineTo(o, -s);
|
|
12483
|
+
}
|
|
12484
|
+
else if (e === "v") for (; m();) {
|
|
12485
|
+
let e = h();
|
|
12486
|
+
s = t ? s + e : e, n.lineTo(o, -s);
|
|
12487
|
+
}
|
|
12488
|
+
else if (e === "c") for (; m();) {
|
|
12489
|
+
let [e, r] = _(h(), h(), t), [c, l] = _(h(), h(), t), [f, p] = _(h(), h(), t);
|
|
12490
|
+
n.currentPath?.bezierCurveTo(e, -r, c, -l, f, -p), o = f, s = p, u = c, d = l, a = i;
|
|
12491
|
+
}
|
|
12492
|
+
else if (e === "s") for (; m();) {
|
|
12493
|
+
let e = ["c", "s"].includes(a.toLowerCase()) ? o * 2 - u : o, r = ["c", "s"].includes(a.toLowerCase()) ? s * 2 - d : s, [c, l] = _(h(), h(), t), [f, p] = _(h(), h(), t);
|
|
12494
|
+
n.currentPath?.bezierCurveTo(e, -r, c, -l, f, -p), o = f, s = p, u = c, d = l, a = i;
|
|
12495
|
+
}
|
|
12496
|
+
else if (e === "q") for (; m();) {
|
|
12497
|
+
let [e, r] = _(h(), h(), t), [c, l] = _(h(), h(), t);
|
|
12498
|
+
n.currentPath?.quadraticCurveTo(e, -r, c, -l), o = c, s = l, f = e, p = r, a = i;
|
|
12499
|
+
}
|
|
12500
|
+
else if (e === "t") for (; m();) {
|
|
12501
|
+
let e = ["q", "t"].includes(a.toLowerCase()) ? o * 2 - f : o, r = ["q", "t"].includes(a.toLowerCase()) ? s * 2 - p : s, [c, l] = _(h(), h(), t);
|
|
12502
|
+
n.currentPath?.quadraticCurveTo(e, -r, c, -l), o = c, s = l, f = e, p = r, a = i;
|
|
12503
|
+
}
|
|
12504
|
+
else if (e === "a") for (; m();) {
|
|
12505
|
+
let e = h(), r = h(), c = h(), l = g(), u = g(), [d, f] = _(h(), h(), t);
|
|
12506
|
+
for (let [t, i] of Ql(o, s, e, r, c, l, u, d, f)) n.lineTo(t, -i);
|
|
12507
|
+
o = d, s = f, a = i;
|
|
12508
|
+
}
|
|
12509
|
+
else break;
|
|
12510
|
+
a = i;
|
|
12511
|
+
}
|
|
12512
|
+
return n;
|
|
12513
|
+
}
|
|
12514
|
+
function eu(e, t = {}) {
|
|
12515
|
+
let n = String(e || "").match(/<path\b[^>]*>/gi) || [], r = [];
|
|
12516
|
+
for (let e of n) {
|
|
12517
|
+
let t = e.match(/\bd\s*=\s*(["'])([\s\S]*?)\1/i);
|
|
12518
|
+
if (!t) continue;
|
|
12519
|
+
let n = $l(t[2]);
|
|
12520
|
+
r.push(...n.toShapes(!0, !1));
|
|
12521
|
+
}
|
|
12522
|
+
if (!r.length) return new Nn(1, 1, .12);
|
|
12523
|
+
let i = Math.max(0, Math.min(.2, Number(t.bevel) || .055)), a = new Ji(r, {
|
|
12524
|
+
depth: 1,
|
|
12525
|
+
steps: 1,
|
|
12526
|
+
curveSegments: Math.max(2, Math.round(Number(t.curveSegments) || 8)),
|
|
12527
|
+
bevelEnabled: i > 0,
|
|
12528
|
+
bevelSegments: Math.max(1, Math.round(Number(t.bevelSegments) || 2)),
|
|
12529
|
+
bevelSize: i,
|
|
12530
|
+
bevelThickness: i
|
|
12531
|
+
});
|
|
12532
|
+
return a.center(), a;
|
|
12533
|
+
}
|
|
12534
|
+
function tu(e) {
|
|
12535
|
+
return e.shape === "plane" ? new ea(1, 1) : e.shape === "svg-extrude" ? eu(e.svg, e) : Gl(e.shape || e.geometry || "box", e.radius, e.segments, e.size);
|
|
12325
12536
|
}
|
|
12326
|
-
function
|
|
12327
|
-
let a =
|
|
12537
|
+
function nu(e, t, n, r, i) {
|
|
12538
|
+
let a = ql(t, e), o = {
|
|
12328
12539
|
...n,
|
|
12329
12540
|
...e.palette || {},
|
|
12330
12541
|
...t.geometryPalette || t.geometry_palette || {}
|
|
@@ -12339,25 +12550,27 @@ function Yl(e, t, n, r, i) {
|
|
|
12339
12550
|
if (!c.length) throw Error(`Geometry '${e.id}' did not produce any parts.`);
|
|
12340
12551
|
let l = new Qn(), u = [], d = [];
|
|
12341
12552
|
for (let a of c) {
|
|
12342
|
-
let s =
|
|
12343
|
-
|
|
12344
|
-
let c = a.color || "component", f =
|
|
12553
|
+
let s = tu(a);
|
|
12554
|
+
Kl(s);
|
|
12555
|
+
let c = a.color || "component", f = Jl(c, o, n.component || el.component), p = a.emissive || "#000000", m = new ia({
|
|
12345
12556
|
color: f,
|
|
12557
|
+
emissive: Jl(p, o, "#000000"),
|
|
12558
|
+
emissiveIntensity: Number.isFinite(Number(a.emissiveIntensity)) ? Math.max(0, Number(a.emissiveIntensity)) : 0,
|
|
12346
12559
|
roughness: Number.isFinite(Number(a.roughness)) ? Number(a.roughness) : .72,
|
|
12347
12560
|
metalness: Number.isFinite(Number(a.metalness)) ? Number(a.metalness) : .06,
|
|
12348
12561
|
transparent: a.transparent === !0 || Number(a.opacity) < 1,
|
|
12349
12562
|
opacity: Number.isFinite(Number(a.opacity)) ? Number(a.opacity) : 1,
|
|
12350
12563
|
side: a.doubleSided ? 2 : 0
|
|
12351
|
-
}),
|
|
12352
|
-
if (typeof
|
|
12564
|
+
}), h, g = a.icon, _ = a.image;
|
|
12565
|
+
if (typeof _ == "string" && _) {
|
|
12353
12566
|
let n = new Image();
|
|
12354
|
-
n.crossOrigin = "anonymous",
|
|
12355
|
-
let o = !1, s = null, c = /^\s*<svg(?:\s|>)/i.test(
|
|
12567
|
+
n.crossOrigin = "anonymous", m.map = new ke(n);
|
|
12568
|
+
let o = !1, s = null, c = /^\s*<svg(?:\s|>)/i.test(_) || /^data:image\/svg\+xml/i.test(_) || /\.svg(?:[?#]|$)/i.test(_), l = new AbortController(), u = () => {
|
|
12356
12569
|
s &&= (URL.revokeObjectURL(s), null);
|
|
12357
12570
|
}, d = () => {
|
|
12358
|
-
n.removeEventListener("load", f), n.removeEventListener("error",
|
|
12571
|
+
n.removeEventListener("load", f), n.removeEventListener("error", p);
|
|
12359
12572
|
}, f = () => {
|
|
12360
|
-
if (d(), o || !
|
|
12573
|
+
if (d(), o || !m.map) {
|
|
12361
12574
|
u();
|
|
12362
12575
|
return;
|
|
12363
12576
|
}
|
|
@@ -12366,64 +12579,65 @@ function Yl(e, t, n, r, i) {
|
|
|
12366
12579
|
r.width = e >= 1 ? t : Math.max(1, Math.round(t * e)), r.height = e >= 1 ? Math.max(1, Math.round(t / e)) : t;
|
|
12367
12580
|
let i = r.getContext("2d");
|
|
12368
12581
|
if (!i) throw Error("Canvas 2D is unavailable");
|
|
12369
|
-
i.clearRect(0, 0, r.width, r.height), i.drawImage(n, 0, 0, r.width, r.height),
|
|
12582
|
+
i.clearRect(0, 0, r.width, r.height), i.drawImage(n, 0, 0, r.width, r.height), m.map.image = r;
|
|
12370
12583
|
} catch (n) {
|
|
12371
12584
|
i?.({
|
|
12372
12585
|
code: "SVG_RASTERIZE_FAILED",
|
|
12373
12586
|
geometry: e.id,
|
|
12374
12587
|
entityId: t.id,
|
|
12375
|
-
image:
|
|
12588
|
+
image: _,
|
|
12376
12589
|
error: n
|
|
12377
12590
|
});
|
|
12378
12591
|
}
|
|
12379
12592
|
u();
|
|
12380
|
-
let s = a.imageFit || a.fit || "stretch", l = n.naturalWidth / Math.max(1, n.naturalHeight), f = Math.abs(Number(a.size?.[0])) || 1,
|
|
12381
|
-
s === "cover" ? l >
|
|
12382
|
-
},
|
|
12593
|
+
let s = a.imageFit || a.fit || "stretch", l = n.naturalWidth / Math.max(1, n.naturalHeight), f = Math.abs(Number(a.size?.[0])) || 1, p = Math.abs(Number(a.size?.[1])) || 1, g = f / p;
|
|
12594
|
+
s === "cover" ? l > g ? (m.map.repeat.set(g / l, 1), m.map.offset.set((1 - m.map.repeat.x) / 2, 0)) : (m.map.repeat.set(1, l / g), m.map.offset.set(0, (1 - m.map.repeat.y) / 2)) : s === "contain" && h && (l > g ? h.scale.y = f / l : h.scale.x = p * l), m.map.needsUpdate = !0, r?.();
|
|
12595
|
+
}, p = () => {
|
|
12383
12596
|
d(), u(), o || (i?.({
|
|
12384
12597
|
code: "IMAGE_LOAD_FAILED",
|
|
12385
12598
|
geometry: e.id,
|
|
12386
12599
|
entityId: t.id,
|
|
12387
|
-
image:
|
|
12600
|
+
image: _
|
|
12388
12601
|
}), r?.());
|
|
12389
12602
|
};
|
|
12390
|
-
|
|
12603
|
+
m.userData.atlasImageCleanup = () => {
|
|
12391
12604
|
o = !0, l.abort(), d(), u(), n.src = "";
|
|
12392
|
-
}, n.addEventListener("load", f), n.addEventListener("error",
|
|
12393
|
-
if (/^\s*<svg(?:\s|>)/i.test(
|
|
12394
|
-
s = URL.createObjectURL(new Blob([
|
|
12605
|
+
}, n.addEventListener("load", f), n.addEventListener("error", p), (async () => {
|
|
12606
|
+
if (/^\s*<svg(?:\s|>)/i.test(_)) {
|
|
12607
|
+
s = URL.createObjectURL(new Blob([_], { type: "image/svg+xml" })), n.src = s;
|
|
12395
12608
|
return;
|
|
12396
12609
|
}
|
|
12397
|
-
if (/^(?:data|blob):/i.test(
|
|
12398
|
-
n.src =
|
|
12610
|
+
if (/^(?:data|blob):/i.test(_)) {
|
|
12611
|
+
n.src = _;
|
|
12399
12612
|
return;
|
|
12400
12613
|
}
|
|
12401
12614
|
try {
|
|
12402
|
-
let e = await fetch(
|
|
12615
|
+
let e = await fetch(_, {
|
|
12403
12616
|
mode: "cors",
|
|
12404
12617
|
signal: l.signal
|
|
12405
12618
|
});
|
|
12406
12619
|
if (!e.ok) throw Error(`Image request failed with ${e.status}`);
|
|
12407
|
-
let t = await e.blob(), r = e.headers.get("content-type") || t.type, i = /image\/svg\+xml/i.test(r) || /\.svg(?:[?#]|$)/i.test(
|
|
12620
|
+
let t = await e.blob(), r = e.headers.get("content-type") || t.type, i = /image\/svg\+xml/i.test(r) || /\.svg(?:[?#]|$)/i.test(_);
|
|
12408
12621
|
if (c ||= i, i && t.type !== "image/svg+xml" && (t = new Blob([await t.text()], { type: "image/svg+xml" })), o) return;
|
|
12409
12622
|
s = URL.createObjectURL(t), n.src = s;
|
|
12410
12623
|
} catch (e) {
|
|
12411
12624
|
if (o || e?.name === "AbortError") return;
|
|
12412
|
-
n.src =
|
|
12625
|
+
n.src = _;
|
|
12413
12626
|
}
|
|
12414
|
-
})(),
|
|
12415
|
-
} else
|
|
12416
|
-
if (
|
|
12627
|
+
})(), m.map.colorSpace = y, m.needsUpdate = !0;
|
|
12628
|
+
} else g != null && g !== "" && (m.map = Yl(g, Jl(a.iconColor || "#ffffff", o, "#ffffff"), Jl(a.iconBackground || "transparent", o, "transparent")), m.transparent = !0, m.needsUpdate = !0);
|
|
12629
|
+
if (h = new An(s, m), h.position.fromArray(Array.isArray(a.position) ? a.position : [
|
|
12417
12630
|
0,
|
|
12418
12631
|
0,
|
|
12419
12632
|
0
|
|
12420
|
-
]),
|
|
12633
|
+
]), h.scale.fromArray(Array.isArray(a.size) ? a.size : [
|
|
12421
12634
|
1,
|
|
12422
12635
|
1,
|
|
12423
12636
|
1
|
|
12424
|
-
]), Array.isArray(a.rotation) &&
|
|
12425
|
-
material:
|
|
12637
|
+
]), Array.isArray(a.rotation) && h.rotation.set(...a.rotation.map(Number)), l.add(h), d.push(h), u.push({
|
|
12638
|
+
material: m,
|
|
12426
12639
|
value: c,
|
|
12640
|
+
emissiveValue: p,
|
|
12427
12641
|
palette: o
|
|
12428
12642
|
}), a.edges !== !1 && a.shape !== "plane") {
|
|
12429
12643
|
let e = new ur({
|
|
@@ -12431,7 +12645,7 @@ function Yl(e, t, n, r, i) {
|
|
|
12431
12645
|
transparent: !0,
|
|
12432
12646
|
opacity: Number.isFinite(Number(a.edgeOpacity)) ? Number(a.edgeOpacity) : .55
|
|
12433
12647
|
}), t = new Sr(new Pr(s, 22), e);
|
|
12434
|
-
t.position.copy(
|
|
12648
|
+
t.position.copy(h.position), t.rotation.copy(h.rotation), t.scale.copy(h.scale), l.add(t), u.push({
|
|
12435
12649
|
material: e,
|
|
12436
12650
|
value: a.edgeColor || c,
|
|
12437
12651
|
palette: o
|
|
@@ -12448,7 +12662,46 @@ function Yl(e, t, n, r, i) {
|
|
|
12448
12662
|
descriptor: s
|
|
12449
12663
|
};
|
|
12450
12664
|
}
|
|
12451
|
-
|
|
12665
|
+
var ru = Object.freeze([
|
|
12666
|
+
"auto",
|
|
12667
|
+
"top",
|
|
12668
|
+
"bottom",
|
|
12669
|
+
"left",
|
|
12670
|
+
"right"
|
|
12671
|
+
]);
|
|
12672
|
+
function iu(e) {
|
|
12673
|
+
let t = String(e || "auto").trim().toLowerCase();
|
|
12674
|
+
return ru.includes(t) ? t : "auto";
|
|
12675
|
+
}
|
|
12676
|
+
function au(e, t, n, r, i = .025) {
|
|
12677
|
+
let a = iu(e);
|
|
12678
|
+
if (a === "auto") return null;
|
|
12679
|
+
let o = Math.max(0, Number(t?.x) || 0), s = Math.max(0, Number(t?.y) || 0);
|
|
12680
|
+
Math.max(0, Number(n) || 0);
|
|
12681
|
+
let c = Math.max(0, Number(r) || 0), l = Math.max(0, Number(i) || 0);
|
|
12682
|
+
return a === "top" ? {
|
|
12683
|
+
x: 0,
|
|
12684
|
+
y: s / 2 + l + c / 2,
|
|
12685
|
+
frontRotation: 0,
|
|
12686
|
+
backRotation: 0
|
|
12687
|
+
} : a === "bottom" ? {
|
|
12688
|
+
x: 0,
|
|
12689
|
+
y: -s / 2 - l - c / 2,
|
|
12690
|
+
frontRotation: 0,
|
|
12691
|
+
backRotation: 0
|
|
12692
|
+
} : a === "left" ? {
|
|
12693
|
+
x: -o / 2 - l - c / 2,
|
|
12694
|
+
y: 0,
|
|
12695
|
+
frontRotation: Math.PI / 2,
|
|
12696
|
+
backRotation: -Math.PI / 2
|
|
12697
|
+
} : {
|
|
12698
|
+
x: o / 2 + l + c / 2,
|
|
12699
|
+
y: 0,
|
|
12700
|
+
frontRotation: -Math.PI / 2,
|
|
12701
|
+
backRotation: Math.PI / 2
|
|
12702
|
+
};
|
|
12703
|
+
}
|
|
12704
|
+
function ou(e, t, n, r = "", i = !0) {
|
|
12452
12705
|
let a = document.createElement("canvas"), o = a.getContext("2d"), s = n.x * .88, c = Math.min(.82, n.y * .64);
|
|
12453
12706
|
a.width = Math.ceil(s * 320), a.height = Math.ceil(c * 320), o.imageSmoothingEnabled = !0, o.imageSmoothingQuality = "high", o.clearRect(0, 0, a.width, a.height);
|
|
12454
12707
|
let l = a.height * .62;
|
|
@@ -12485,7 +12738,7 @@ function Xl(e, t, n, r = "", i = !0) {
|
|
|
12485
12738
|
let C = new An(b, v);
|
|
12486
12739
|
C.rotation.y = Math.PI, C.position.set(0, n.y / 2 - .09 - c / 2, -n.z / 2 - .012);
|
|
12487
12740
|
let w = new An(b, v.clone());
|
|
12488
|
-
w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible =
|
|
12741
|
+
w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible = xl(r), x.add(S, C, w);
|
|
12489
12742
|
for (let e of [
|
|
12490
12743
|
S,
|
|
12491
12744
|
C,
|
|
@@ -12493,7 +12746,7 @@ function Xl(e, t, n, r = "", i = !0) {
|
|
|
12493
12746
|
]) e.renderOrder = 20, e.frustumCulled = !1, e.material.depthTest = !0, e.material.depthWrite = !1, e.material.transparent = !0;
|
|
12494
12747
|
return x.renderOrder = 20, x.frustumCulled = !1, x.userData.front = S, x.userData.back = C, x.userData.top = w, x.userData.height = c, x.userData.width = s, x.userData.textOffsetX = h, x.userData.textOffsetY = g, x.userData.nodeLabel = !0, x;
|
|
12495
12748
|
}
|
|
12496
|
-
function
|
|
12749
|
+
function su(e, t, n, r = globalThis.document) {
|
|
12497
12750
|
if (!e || !t || !n || !r?.createElement) return null;
|
|
12498
12751
|
try {
|
|
12499
12752
|
e.render(t, n);
|
|
@@ -12515,8 +12768,8 @@ function Zl(e, t, n, r = globalThis.document) {
|
|
|
12515
12768
|
return null;
|
|
12516
12769
|
}
|
|
12517
12770
|
}
|
|
12518
|
-
var
|
|
12519
|
-
static version =
|
|
12771
|
+
var cu = class extends HTMLElement {
|
|
12772
|
+
static version = $c;
|
|
12520
12773
|
static get observedAttributes() {
|
|
12521
12774
|
return [
|
|
12522
12775
|
"height",
|
|
@@ -12533,23 +12786,23 @@ var Ql = class extends HTMLElement {
|
|
|
12533
12786
|
];
|
|
12534
12787
|
}
|
|
12535
12788
|
static registerGeometryPack(e) {
|
|
12536
|
-
return
|
|
12789
|
+
return gl(e);
|
|
12537
12790
|
}
|
|
12538
12791
|
static unregisterGeometryPack(e) {
|
|
12539
|
-
return
|
|
12792
|
+
return _l(e);
|
|
12540
12793
|
}
|
|
12541
12794
|
static getGeometryCatalog() {
|
|
12542
|
-
return
|
|
12795
|
+
return vl();
|
|
12543
12796
|
}
|
|
12544
12797
|
static getGeometryPackCatalog() {
|
|
12545
|
-
return
|
|
12798
|
+
return yl();
|
|
12546
12799
|
}
|
|
12547
12800
|
constructor() {
|
|
12548
|
-
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" +
|
|
12801
|
+
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" + Al + jl + Ml + "</style>" + Ll, this.canvas = this.shadowRoot.querySelector("canvas"), this.panel = this.shadowRoot.querySelector(".panel"), this.scene = new tr(), this.camera = new Kn(30, 1, .1, 2e3), this.cameraPosition = new U(), this.cameraTarget = new U(), this.raycaster = new Wa(), this.pointer = new V(), this.nodes = /* @__PURE__ */ new Map(), this.open = /* @__PURE__ */ new Set(), this._initialOpenContainers = /* @__PURE__ */ new Set(), this.selected = null, this.selectedRelationIndex = null, this.modelData = null, this._loading = !1, this._pendingSelection = null, this._theme = Ol(), this.relationMode = this.getAttribute("relation-mode") || "selected", this.focusFilter = Sl({
|
|
12549
12802
|
mode: this.getAttribute("focus-mode"),
|
|
12550
12803
|
effect: this.getAttribute("focus-effect"),
|
|
12551
12804
|
layout: this.getAttribute("focus-layout")
|
|
12552
|
-
}), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation =
|
|
12805
|
+
}), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation = Cl(this.getAttribute("selection-navigation")), this.itemFacing = wl(this.getAttribute("item-facing")), this.showShellLabels = this.getAttribute("shell-labels") !== "false", this.yaw = .37, this.pitch = .22, this.zoom = 1, this.targetZoom = 1, this.focus = new U(), this.targetFocus = new U(), this.drag = null, this.pointers = /* @__PURE__ */ new Map(), this.relationGroup = new Qn(), this.scene.add(this.relationGroup), this.relations = [], this.animationFrame = 0, this.ready = !1, this._toolbarVisible = this.getAttribute("toolbar") !== "off", this._panelVisible = this.getAttribute("panel") !== "off", this.toolbar = this.shadowRoot.querySelector(".toolbar"), this._printState = null, this._beforePrintListener = () => this.prepareForPrint(), this._afterPrintListener = () => this.restoreAfterPrint(), this._printMedia = globalThis.matchMedia?.("print") || null, this._printMediaListener = (e) => e.matches ? this.prepareForPrint() : this.restoreAfterPrint(), this._geometryRegistryListener = () => {
|
|
12553
12806
|
this.ready && this.modelData && this._build();
|
|
12554
12807
|
}, this._bindControls(), this._syncFocusToolbar(), this._syncRelationToolbar(), this._syncLabelsToolbar(), this._syncPanelToolbar(), this._syncItemFacingToolbar(), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(this.canvas);
|
|
12555
12808
|
}
|
|
@@ -12561,7 +12814,7 @@ var Ql = class extends HTMLElement {
|
|
|
12561
12814
|
}
|
|
12562
12815
|
attributeChangedCallback(e, t, n) {
|
|
12563
12816
|
if (t !== n) {
|
|
12564
|
-
if (e === "height" && this.style.setProperty("--lc-height", n || "680px"), e === "relation-mode" && this.ready && this.setRelationMode(n || "selected"), e === "selection-mode" && this.setSelectionMode(n || "internal"), e === "selection-navigation" && this.setSelectionNavigation(n), e === "item-facing" &&
|
|
12817
|
+
if (e === "height" && this.style.setProperty("--lc-height", n || "680px"), e === "relation-mode" && this.ready && this.setRelationMode(n || "selected"), e === "selection-mode" && this.setSelectionMode(n || "internal"), e === "selection-navigation" && this.setSelectionNavigation(n), e === "item-facing" && wl(n) !== this.itemFacing && this.setItemFacing(n, { source: "attribute" }), e === "focus-mode" && n !== this.focusFilter.mode && this.setFocusFilter({ mode: n }), e === "focus-effect" && n !== this.focusFilter.effect && this.setFocusFilter({ effect: n }), e === "focus-layout" && n !== this.focusFilter.layout && this.setFocusFilter({ layout: n }), e === "shell-labels" && this.ready) {
|
|
12565
12818
|
let e = n !== "false";
|
|
12566
12819
|
e !== this.showShellLabels && (this.showShellLabels = e, this._build({
|
|
12567
12820
|
preserveSelection: this.selected?.id,
|
|
@@ -12598,13 +12851,13 @@ var Ql = class extends HTMLElement {
|
|
|
12598
12851
|
} : null;
|
|
12599
12852
|
}
|
|
12600
12853
|
get palette() {
|
|
12601
|
-
return this.modelData?.palette || {
|
|
12854
|
+
return this.modelData?.palette || { ...el };
|
|
12602
12855
|
}
|
|
12603
12856
|
set palette(e) {
|
|
12604
12857
|
this.setPalette(e);
|
|
12605
12858
|
}
|
|
12606
12859
|
captureFrame() {
|
|
12607
|
-
return
|
|
12860
|
+
return su(this.renderer, this.scene, this.camera, this.ownerDocument);
|
|
12608
12861
|
}
|
|
12609
12862
|
prepareForPrint() {
|
|
12610
12863
|
if (this._printState) return this;
|
|
@@ -12709,13 +12962,13 @@ var Ql = class extends HTMLElement {
|
|
|
12709
12962
|
if (!e.size) return null;
|
|
12710
12963
|
for (let t of [...e]) {
|
|
12711
12964
|
let n = this.nodes.get(t);
|
|
12712
|
-
n &&
|
|
12965
|
+
n && xl(n.type) && this._descendantIds(t, e);
|
|
12713
12966
|
}
|
|
12714
12967
|
let t = new Set(e);
|
|
12715
12968
|
for (let n of this.relations) (t.has(n.from) || t.has(n.to)) && (e.add(n.from), e.add(n.to));
|
|
12716
12969
|
for (let t of [...e]) {
|
|
12717
12970
|
let n = this.nodes.get(t);
|
|
12718
|
-
n &&
|
|
12971
|
+
n && xl(n.type) && this._descendantIds(t, e);
|
|
12719
12972
|
}
|
|
12720
12973
|
for (let t of [...e]) {
|
|
12721
12974
|
let n = this.nodes.get(t)?.parent ? this.nodes.get(this.nodes.get(t).parent) : null;
|
|
@@ -12792,7 +13045,7 @@ var Ql = class extends HTMLElement {
|
|
|
12792
13045
|
});
|
|
12793
13046
|
}
|
|
12794
13047
|
setFocusFilter(e = {}, t = {}) {
|
|
12795
|
-
let n =
|
|
13048
|
+
let n = Sl({
|
|
12796
13049
|
...this.focusFilter,
|
|
12797
13050
|
...e || {}
|
|
12798
13051
|
}), r = JSON.stringify(n) !== JSON.stringify(this.focusFilter);
|
|
@@ -12810,7 +13063,7 @@ var Ql = class extends HTMLElement {
|
|
|
12810
13063
|
"none"
|
|
12811
13064
|
].includes(e.relationMode) && e.relationMode !== this.relationMode && this.setRelationMode(e.relationMode), Object.hasOwn(e, "selectionMode") && e.selectionMode !== this.selectionMode && this.setSelectionMode(e.selectionMode);
|
|
12812
13065
|
let t = e.navigation?.onSelect ?? e.selectionNavigation;
|
|
12813
|
-
return t != null && t !== this.selectionNavigation && this.setSelectionNavigation(t), Object.hasOwn(e, "toolbar") && e.toolbar !== !1 !== this.toolbarVisible && this.setToolbarVisible(e.toolbar !== !1), Object.hasOwn(e, "shellLabels") && e.shellLabels !== !1 !== this.showShellLabels && this.setShellLabels(e.shellLabels !== !1), Object.hasOwn(e, "itemFacing") &&
|
|
13066
|
+
return t != null && t !== this.selectionNavigation && this.setSelectionNavigation(t), Object.hasOwn(e, "toolbar") && e.toolbar !== !1 !== this.toolbarVisible && this.setToolbarVisible(e.toolbar !== !1), Object.hasOwn(e, "shellLabels") && e.shellLabels !== !1 !== this.showShellLabels && this.setShellLabels(e.shellLabels !== !1), Object.hasOwn(e, "itemFacing") && wl(e.itemFacing) !== this.itemFacing && this.setItemFacing(e.itemFacing, {
|
|
12814
13067
|
emit: !1,
|
|
12815
13068
|
source: "model"
|
|
12816
13069
|
}), e.focus && this.setFocusFilter(e.focus, { emit: !1 }), this;
|
|
@@ -12823,10 +13076,10 @@ var Ql = class extends HTMLElement {
|
|
|
12823
13076
|
}));
|
|
12824
13077
|
}
|
|
12825
13078
|
_containerEntityIds() {
|
|
12826
|
-
return (this.modelData?.entities || []).filter((e) =>
|
|
13079
|
+
return (this.modelData?.entities || []).filter((e) => xl(e.type)).map((e) => e.id);
|
|
12827
13080
|
}
|
|
12828
13081
|
_declaredOpenContainerIds() {
|
|
12829
|
-
return (this.modelData?.entities || []).filter((e) =>
|
|
13082
|
+
return (this.modelData?.entities || []).filter((e) => xl(e.type) && e.open === !0).map((e) => e.id);
|
|
12830
13083
|
}
|
|
12831
13084
|
_emitContainerStateChange(e, t = {}) {
|
|
12832
13085
|
if (!e?.changed || t.emit === !1) return;
|
|
@@ -12884,7 +13137,7 @@ var Ql = class extends HTMLElement {
|
|
|
12884
13137
|
}
|
|
12885
13138
|
_commitModelChange(e, t = {}, n = {}) {
|
|
12886
13139
|
let r = n.preserveSelection === !1 ? null : this.selected?.id, i = n.preserveSelection === !1 ? null : this._publicRelation(this.selectedRelationIndex), a = i?.id ?? i?.index ?? null;
|
|
12887
|
-
this.modelData =
|
|
13140
|
+
this.modelData = Bl(this.modelData);
|
|
12888
13141
|
let o = this._syncInitialContainerState({
|
|
12889
13142
|
refresh: !1,
|
|
12890
13143
|
emit: !1,
|
|
@@ -12901,7 +13154,7 @@ var Ql = class extends HTMLElement {
|
|
|
12901
13154
|
}
|
|
12902
13155
|
updateModel(e = {}, t = {}) {
|
|
12903
13156
|
if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("El parche del modelo debe ser un objeto.");
|
|
12904
|
-
let n = this.modelData ||
|
|
13157
|
+
let n = this.modelData || Bl({}), r = JSON.stringify(n.render?.camera || null), i = {
|
|
12905
13158
|
...n,
|
|
12906
13159
|
...e,
|
|
12907
13160
|
palette: e.palette ? {
|
|
@@ -12912,11 +13165,11 @@ var Ql = class extends HTMLElement {
|
|
|
12912
13165
|
entities: Array.isArray(e.entities) ? e.entities : n.entities,
|
|
12913
13166
|
relations: Array.isArray(e.relations) ? e.relations : n.relations
|
|
12914
13167
|
};
|
|
12915
|
-
return this.modelData =
|
|
13168
|
+
return this.modelData = Bl(i), this.theme = this.modelData.theme, this._commitModelChange("model-update", { patch: e }, t), this._applyModelRenderOptions(), JSON.stringify(this.modelData.render?.camera || null) !== r && this.modelData.render?.camera && this.setCameraView(this.modelData.render.camera, { animate: t.animateCamera !== !1 }), this;
|
|
12916
13169
|
}
|
|
12917
13170
|
addEntity(e, t = {}) {
|
|
12918
13171
|
if (!e || typeof e != "object" || !e.id) throw TypeError("La entidad debe incluir un id.");
|
|
12919
|
-
if (this.modelData ||=
|
|
13172
|
+
if (this.modelData ||= Bl({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`Ya existe una entidad con id "${e.id}".`);
|
|
12920
13173
|
if (e.parent && !this.modelData.entities.some((t) => t.id === e.parent)) throw Error(`No existe el contenedor padre "${e.parent}".`);
|
|
12921
13174
|
return this.modelData.entities = [...this.modelData.entities, { ...e }], this._commitModelChange("entity-add", { entity: this._publicEntity(e.id) }, t);
|
|
12922
13175
|
}
|
|
@@ -12993,10 +13246,10 @@ var Ql = class extends HTMLElement {
|
|
|
12993
13246
|
return this.targetZoom = Math.min(2.8, this.targetZoom * 1.18), this.invalidate(), this;
|
|
12994
13247
|
}
|
|
12995
13248
|
zoomOut() {
|
|
12996
|
-
return this.targetZoom = Math.max(
|
|
13249
|
+
return this.targetZoom = Math.max(tl, this.targetZoom / 1.18), this.invalidate(), this;
|
|
12997
13250
|
}
|
|
12998
13251
|
setSelectionNavigation(e) {
|
|
12999
|
-
let t =
|
|
13252
|
+
let t = Cl(e);
|
|
13000
13253
|
return this.selectionNavigation = t, this.getAttribute("selection-navigation") !== t && this.setAttribute("selection-navigation", t), this;
|
|
13001
13254
|
}
|
|
13002
13255
|
focusSelection(e = {}) {
|
|
@@ -13009,7 +13262,7 @@ var Ql = class extends HTMLElement {
|
|
|
13009
13262
|
return t ? (this.targetFocus.copy(t), this.targetZoom = n, e.animate === !1 && (this.focus.copy(this.targetFocus), this.zoom = this.targetZoom), this.invalidate(), this) : this;
|
|
13010
13263
|
}
|
|
13011
13264
|
_applySelectionNavigation(e = this.selectionNavigation) {
|
|
13012
|
-
let t =
|
|
13265
|
+
let t = Cl(e);
|
|
13013
13266
|
if (t === "preserve") return this;
|
|
13014
13267
|
let n = this.targetZoom;
|
|
13015
13268
|
return this.focusSelection(), t === "center" && (this.targetZoom = n), this;
|
|
@@ -13034,7 +13287,7 @@ var Ql = class extends HTMLElement {
|
|
|
13034
13287
|
return Math.max(29, 39.5 / Math.max(this.camera.aspect, .5));
|
|
13035
13288
|
}
|
|
13036
13289
|
getCameraView() {
|
|
13037
|
-
let e = this.focus.clone(), t = this._baseCameraDistance() / Math.max(
|
|
13290
|
+
let e = this.focus.clone(), t = this._baseCameraDistance() / Math.max(tl, this.zoom), n = new U(Math.sin(this.yaw) * Math.cos(this.pitch), Math.sin(this.pitch), Math.cos(this.yaw) * Math.cos(this.pitch)).multiplyScalar(t).add(e), r = (e) => e.map((e) => Number(e.toFixed(3)));
|
|
13038
13291
|
return {
|
|
13039
13292
|
position: r(n.toArray()),
|
|
13040
13293
|
target: r(e.toArray()),
|
|
@@ -13048,7 +13301,7 @@ var Ql = class extends HTMLElement {
|
|
|
13048
13301
|
if (!(a > 1e-6)) return this;
|
|
13049
13302
|
this.yaw = Math.atan2(i.x, i.z), this.pitch = Math.asin(Math.max(-1, Math.min(1, i.y / a)));
|
|
13050
13303
|
let o = Number(e.zoom), s = Number.isFinite(o) && o > 0 ? o : this._baseCameraDistance() / a;
|
|
13051
|
-
return this.targetFocus.copy(r), this.targetZoom = Math.max(
|
|
13304
|
+
return this.targetFocus.copy(r), this.targetZoom = Math.max(tl, Math.min(2.8, s)), t.animate === !1 && (this.focus.copy(this.targetFocus), this.zoom = this.targetZoom), this.invalidate(), this;
|
|
13052
13305
|
}
|
|
13053
13306
|
restoreInitialCamera(e = {}) {
|
|
13054
13307
|
let t = this.modelData?.render?.camera;
|
|
@@ -13065,7 +13318,7 @@ var Ql = class extends HTMLElement {
|
|
|
13065
13318
|
t.expandByPoint(n.clone().sub(r)), t.expandByPoint(n.clone().add(r));
|
|
13066
13319
|
}
|
|
13067
13320
|
let n = t.isEmpty() ? new U() : t.getCenter(new U()), r = t.isEmpty() ? new U(1, 1, 1) : t.getSize(new U()), i = Math.max(1, r.length() / 2), a = de.degToRad(this.camera.fov), o = i / Math.sin(a / 2) * 1.12, s = this._baseCameraDistance();
|
|
13068
|
-
return this.targetZoom = Math.max(
|
|
13321
|
+
return this.targetZoom = Math.max(tl, Math.min(2.8, s / o)), this.targetFocus.copy(n), e.animate === !1 && (this.zoom = this.targetZoom, this.focus.copy(this.targetFocus)), this.invalidate(), this;
|
|
13069
13322
|
}
|
|
13070
13323
|
frontView() {
|
|
13071
13324
|
return this.yaw = 0, this.pitch = 0, this.invalidate(), this;
|
|
@@ -13081,7 +13334,7 @@ var Ql = class extends HTMLElement {
|
|
|
13081
13334
|
return this.setShellLabels(!this.showShellLabels);
|
|
13082
13335
|
}
|
|
13083
13336
|
setItemFacing(e = "camera", t = {}) {
|
|
13084
|
-
let n =
|
|
13337
|
+
let n = wl(e), r = n !== this.itemFacing;
|
|
13085
13338
|
return this.itemFacing = n, this.getAttribute("item-facing") !== n && this.setAttribute("item-facing", n), this._syncItemFacingToolbar(), this._applyItemFacing(), this.invalidate(), r && t.emit !== !1 && this._emit("lc-item-facing-change", {
|
|
13086
13339
|
mode: n,
|
|
13087
13340
|
source: t.source || "api"
|
|
@@ -13091,7 +13344,7 @@ var Ql = class extends HTMLElement {
|
|
|
13091
13344
|
return this.setItemFacing(this.itemFacing === "camera" ? "model" : "camera", e);
|
|
13092
13345
|
}
|
|
13093
13346
|
_applyItemFacing() {
|
|
13094
|
-
if (this.camera) for (let e of this.nodes.values()) e.group && !
|
|
13347
|
+
if (this.camera) for (let e of this.nodes.values()) e.group && !xl(e.type) && (this.itemFacing === "camera" ? e.group.quaternion.copy(this.camera.quaternion) : e.group.quaternion.identity());
|
|
13095
13348
|
}
|
|
13096
13349
|
isContainerOpen(e) {
|
|
13097
13350
|
return this._containerEntityIds().includes(e) && this.open.has(e);
|
|
@@ -13106,14 +13359,14 @@ var Ql = class extends HTMLElement {
|
|
|
13106
13359
|
setContainerOpen(e, t = !0, n = {}) {
|
|
13107
13360
|
let r = this.modelData?.entities?.find((t) => t.id === e);
|
|
13108
13361
|
if (!r) throw Error(`No existe una entidad con id "${e}".`);
|
|
13109
|
-
if (!
|
|
13362
|
+
if (!xl(r.type)) throw TypeError(`La entidad "${e}" no es un contenedor.`);
|
|
13110
13363
|
let i = new Set(this.open);
|
|
13111
13364
|
if (t) i.add(e);
|
|
13112
13365
|
else if (i.delete(e), n.closeDescendants !== !1) for (let t of this.modelData.entities) {
|
|
13113
13366
|
let n = t.parent, r = /* @__PURE__ */ new Set();
|
|
13114
13367
|
for (; n && !r.has(n);) {
|
|
13115
13368
|
if (r.add(n), n === e) {
|
|
13116
|
-
|
|
13369
|
+
xl(t.type) && i.delete(t.id);
|
|
13117
13370
|
break;
|
|
13118
13371
|
}
|
|
13119
13372
|
n = this.modelData.entities.find((e) => e.id === n)?.parent || null;
|
|
@@ -13150,13 +13403,13 @@ var Ql = class extends HTMLElement {
|
|
|
13150
13403
|
this.setTheme(e);
|
|
13151
13404
|
}
|
|
13152
13405
|
get theme() {
|
|
13153
|
-
return this._theme ||
|
|
13406
|
+
return this._theme || Ol();
|
|
13154
13407
|
}
|
|
13155
13408
|
set theme(e) {
|
|
13156
|
-
this._theme =
|
|
13409
|
+
this._theme = Ol(e), this.shadowRoot && this._applyTheme();
|
|
13157
13410
|
}
|
|
13158
13411
|
setTheme(e = {}) {
|
|
13159
|
-
return this.theme =
|
|
13412
|
+
return this.theme = Dl(this.theme, e), this.modelData && (this.modelData.theme = this.theme), this._applyLighting(), this.invalidate(), this;
|
|
13160
13413
|
}
|
|
13161
13414
|
_applyTheme() {
|
|
13162
13415
|
let e = this.theme, t = this.style;
|
|
@@ -13173,7 +13426,7 @@ var Ql = class extends HTMLElement {
|
|
|
13173
13426
|
if (e) return this.load(e);
|
|
13174
13427
|
let t = this.querySelector("script[type=\"application/json\"]");
|
|
13175
13428
|
if (!t) return this.load({
|
|
13176
|
-
palette:
|
|
13429
|
+
palette: el,
|
|
13177
13430
|
entities: [],
|
|
13178
13431
|
relations: []
|
|
13179
13432
|
});
|
|
@@ -13187,7 +13440,7 @@ var Ql = class extends HTMLElement {
|
|
|
13187
13440
|
this._loading = !0, this._pendingSelection = null;
|
|
13188
13441
|
try {
|
|
13189
13442
|
let t = typeof e == "string" ? await fetch(e).then((e) => e.json()) : e;
|
|
13190
|
-
this.modelData =
|
|
13443
|
+
this.modelData = Bl(t), this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this._initialOpenContainers.clear(), this._pendingPalette &&= (this.modelData.palette = {
|
|
13191
13444
|
...this.modelData.palette,
|
|
13192
13445
|
...this._pendingPalette
|
|
13193
13446
|
}, null), this.theme = this.modelData.theme, this._applyTheme(), this._syncInitialContainerState({
|
|
@@ -13206,7 +13459,7 @@ var Ql = class extends HTMLElement {
|
|
|
13206
13459
|
_ensureRenderer() {
|
|
13207
13460
|
if (this.renderer) return !0;
|
|
13208
13461
|
try {
|
|
13209
|
-
return this.renderer = new
|
|
13462
|
+
return this.renderer = new Qc({
|
|
13210
13463
|
canvas: this.canvas,
|
|
13211
13464
|
antialias: !0,
|
|
13212
13465
|
alpha: !0,
|
|
@@ -13218,9 +13471,9 @@ var Ql = class extends HTMLElement {
|
|
|
13218
13471
|
}
|
|
13219
13472
|
_applyLighting() {
|
|
13220
13473
|
if (!this.ambientLight || !this.directionalLight) return;
|
|
13221
|
-
let e = this.theme?.lighting ||
|
|
13474
|
+
let e = this.theme?.lighting || El.lighting;
|
|
13222
13475
|
this.ambientLight.color.set(e.ambientSky), this.ambientLight.groundColor.set(e.ambientGround), this.ambientLight.intensity = Number(e.ambient) || 0, this.directionalLight.color.set(e.directionalColor), this.directionalLight.intensity = Number(e.directional) || 0;
|
|
13223
|
-
let t = Array.isArray(e.directionalPosition) ? e.directionalPosition :
|
|
13476
|
+
let t = Array.isArray(e.directionalPosition) ? e.directionalPosition : El.lighting.directionalPosition;
|
|
13224
13477
|
this.directionalLight.position.fromArray(t);
|
|
13225
13478
|
}
|
|
13226
13479
|
_worldPosition(e, t = /* @__PURE__ */ new Set()) {
|
|
@@ -13257,7 +13510,7 @@ var Ql = class extends HTMLElement {
|
|
|
13257
13510
|
...e.geometryPalette || {},
|
|
13258
13511
|
...e.geometryPaletteOverrides || {}
|
|
13259
13512
|
};
|
|
13260
|
-
n.material.color.set(
|
|
13513
|
+
n.material.color.set(Jl(n.value, r, t)), n.material.emissive && n.emissiveValue && n.material.emissive.set(Jl(n.emissiveValue, r, "#000000"));
|
|
13261
13514
|
}
|
|
13262
13515
|
}
|
|
13263
13516
|
}
|
|
@@ -13270,19 +13523,19 @@ var Ql = class extends HTMLElement {
|
|
|
13270
13523
|
for (let e of this.modelData.entities) {
|
|
13271
13524
|
let t = this.nodes.get(e.id);
|
|
13272
13525
|
t.group = new Qn(), t.group.position.copy(this._worldPosition(t));
|
|
13273
|
-
let n = e.geometry || "box", r =
|
|
13526
|
+
let n = e.geometry || "box", r = bl(n), i = !r && n.includes("."), a = i ? "#ed8f98" : this.modelData.palette[e.c] || e.c || this.modelData.palette.component;
|
|
13274
13527
|
i && this.dispatchEvent(new CustomEvent("lc-warning", { detail: {
|
|
13275
13528
|
code: "GEOMETRY_NOT_REGISTERED",
|
|
13276
13529
|
geometry: n,
|
|
13277
13530
|
entityId: e.id
|
|
13278
13531
|
} }));
|
|
13279
|
-
let o = r?.primitive || n, s = r && !r.primitive && !
|
|
13532
|
+
let o = r?.primitive || n, s = r && !r.primitive && !xl(e.type);
|
|
13280
13533
|
if (t.geometryDefinition = r || null, t.geometryMissing = i, t.geometryPalette = r?.palette || {}, t.geometryPaletteOverrides = e.geometryPalette || e.geometry_palette || {}, t.ports = {
|
|
13281
13534
|
...r?.anchors || {},
|
|
13282
13535
|
...e.ports || {}
|
|
13283
13536
|
}, s) {
|
|
13284
13537
|
try {
|
|
13285
|
-
let n =
|
|
13538
|
+
let n = nu(r, e, this.modelData.palette, () => this.invalidate(), (e) => this.dispatchEvent(new CustomEvent("lc-warning", { detail: e })));
|
|
13286
13539
|
n.root.scale.multiply(new U().fromArray(e.s)), t.appearanceMaterials = [], n.root.traverse((e) => {
|
|
13287
13540
|
if (!(e.isMesh || e.isLine || e.isLineSegments || e.isSprite)) return;
|
|
13288
13541
|
e.userData.node = t;
|
|
@@ -13303,7 +13556,7 @@ var Ql = class extends HTMLElement {
|
|
|
13303
13556
|
entityId: e.id,
|
|
13304
13557
|
error: r
|
|
13305
13558
|
} }));
|
|
13306
|
-
let i =
|
|
13559
|
+
let i = Kl(Gl("box"));
|
|
13307
13560
|
t.material = new ia({
|
|
13308
13561
|
color: "#ed8f98",
|
|
13309
13562
|
roughness: .72,
|
|
@@ -13312,13 +13565,13 @@ var Ql = class extends HTMLElement {
|
|
|
13312
13565
|
}
|
|
13313
13566
|
t.labelSize = new U().fromArray(e.s);
|
|
13314
13567
|
} else {
|
|
13315
|
-
let n = o === "box" && Number(e.radius) > 0, r =
|
|
13316
|
-
n ||
|
|
13568
|
+
let n = o === "box" && Number(e.radius) > 0, r = Gl(o, e.radius, e.segments, e.s);
|
|
13569
|
+
n || Kl(r), t.material = new ia({
|
|
13317
13570
|
color: a,
|
|
13318
13571
|
roughness: .72,
|
|
13319
13572
|
metalness: .06,
|
|
13320
13573
|
transparent: !0,
|
|
13321
|
-
opacity:
|
|
13574
|
+
opacity: xl(e.type) ? .96 : 1
|
|
13322
13575
|
}), t.mesh = new An(r, t.material), t.mesh.scale.fromArray(n ? [
|
|
13323
13576
|
1,
|
|
13324
13577
|
1,
|
|
@@ -13333,7 +13586,7 @@ var Ql = class extends HTMLElement {
|
|
|
13333
13586
|
1
|
|
13334
13587
|
] : e.s), t.group.add(t.edge);
|
|
13335
13588
|
}
|
|
13336
|
-
t.label =
|
|
13589
|
+
t.label = ou(e.name, a, t.labelSize, e.type, this.showShellLabels), t.labelAnchor = iu(e.style?.label?.anchor ?? e.labelAnchor ?? e.label_anchor), t.label.userData.node = t, t.label.traverse((e) => {
|
|
13337
13590
|
e.userData.node = t;
|
|
13338
13591
|
}), t.group.add(t.label), this.scene.add(t.group);
|
|
13339
13592
|
}
|
|
@@ -13372,7 +13625,7 @@ var Ql = class extends HTMLElement {
|
|
|
13372
13625
|
}
|
|
13373
13626
|
_rebuildRelations() {
|
|
13374
13627
|
this._clearRelationGroup();
|
|
13375
|
-
let e = this._activeRelationIndexes(), t = this._focusedEntityIds(), n = new X(this.modelData?.palette.connection ||
|
|
13628
|
+
let e = this._activeRelationIndexes(), t = this._focusedEntityIds(), n = new X(this.modelData?.palette.connection || el.connection);
|
|
13376
13629
|
for (let r of e) {
|
|
13377
13630
|
let e = this.relations[r], i = this.nodes.get(e.from), a = this.nodes.get(e.to);
|
|
13378
13631
|
if (!i || !a) continue;
|
|
@@ -13380,7 +13633,7 @@ var Ql = class extends HTMLElement {
|
|
|
13380
13633
|
if (!o && this.focusFilter.effect === "hide") continue;
|
|
13381
13634
|
let s = o ? 1 : this.focusFilter.opacity, c = this._endpoint(i, a, !0, e), l = this._endpoint(a, i, !1, e), u = l.clone().sub(c);
|
|
13382
13635
|
if (u.lengthSq() < .01) continue;
|
|
13383
|
-
let d =
|
|
13636
|
+
let d = kl(e), f = r === this.selectedRelationIndex, p = (e, t = .055, n = .88) => {
|
|
13384
13637
|
let r = new rn({
|
|
13385
13638
|
color: e,
|
|
13386
13639
|
transparent: !0,
|
|
@@ -13390,7 +13643,7 @@ var Ql = class extends HTMLElement {
|
|
|
13390
13643
|
});
|
|
13391
13644
|
f && (r.color.lerp(new X(16777215), .28), r.opacity = 1);
|
|
13392
13645
|
let i = new An(new ra(new ri(c, l), 10, f ? t * 1.45 : t, 6, !1), r);
|
|
13393
|
-
return i.renderOrder =
|
|
13646
|
+
return i.renderOrder = nl, this.relationGroup.add(i), i;
|
|
13394
13647
|
}, m = new An(new ra(new ri(c, l), 10, .16, 6, !1), new rn({
|
|
13395
13648
|
transparent: !0,
|
|
13396
13649
|
opacity: 0,
|
|
@@ -13409,7 +13662,7 @@ var Ql = class extends HTMLElement {
|
|
|
13409
13662
|
opacity: (f ? 1 : .9) * s,
|
|
13410
13663
|
depthWrite: !1
|
|
13411
13664
|
}));
|
|
13412
|
-
a.userData.relationIndex = r, a.userData.phase = n / 3, a.userData.oscillate = !0, a.userData.start = i.clone().sub(e.clone().multiplyScalar(t)), a.userData.end = i.clone().add(e.clone().multiplyScalar(t)), a.quaternion.setFromUnitVectors(new U(0, 0, 1), e), a.renderOrder =
|
|
13665
|
+
a.userData.relationIndex = r, a.userData.phase = n / 3, a.userData.oscillate = !0, a.userData.start = i.clone().sub(e.clone().multiplyScalar(t)), a.userData.end = i.clone().add(e.clone().multiplyScalar(t)), a.quaternion.setFromUnitVectors(new U(0, 0, 1), e), a.renderOrder = nl, this.relationGroup.add(a);
|
|
13413
13666
|
}
|
|
13414
13667
|
continue;
|
|
13415
13668
|
}
|
|
@@ -13422,7 +13675,7 @@ var Ql = class extends HTMLElement {
|
|
|
13422
13675
|
opacity: (f ? 1 : .9) * s,
|
|
13423
13676
|
depthWrite: !1
|
|
13424
13677
|
}));
|
|
13425
|
-
t.userData.relationIndex = r, t.userData.phase = e / 4, t.userData.direction = d === "bidirectional" && e % 2 ? -1 : 1, t.userData.start = c.clone(), t.userData.end = l.clone(), t.quaternion.setFromUnitVectors(new U(0, 0, 1), h), t.renderOrder =
|
|
13678
|
+
t.userData.relationIndex = r, t.userData.phase = e / 4, t.userData.direction = d === "bidirectional" && e % 2 ? -1 : 1, t.userData.start = c.clone(), t.userData.end = l.clone(), t.quaternion.setFromUnitVectors(new U(0, 0, 1), h), t.renderOrder = nl, this.relationGroup.add(t);
|
|
13426
13679
|
}
|
|
13427
13680
|
}
|
|
13428
13681
|
}
|
|
@@ -13430,8 +13683,8 @@ var Ql = class extends HTMLElement {
|
|
|
13430
13683
|
if (!this.modelData) return;
|
|
13431
13684
|
let e = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex];
|
|
13432
13685
|
if (e) {
|
|
13433
|
-
let t =
|
|
13434
|
-
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button><button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">RELACIÓN</div><h2>" +
|
|
13686
|
+
let t = kl(e), n = e.text ? "<p>" + Rl(e.text) + "</p>" : "", r = zl(e.url);
|
|
13687
|
+
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button><button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">RELACIÓN</div><h2>" + Rl(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + Rl(e.from) + " → " + Rl(e.to) + "</div>" + n + r + "<h3>MODO</h3><p>" + Rl(t) + "</p>", this.panel.querySelector("[data-action=\"overview\"]")?.addEventListener("click", () => this.reset()), this.panel.querySelector("[data-action=\"focus-selection\"]")?.addEventListener("click", () => this.focusSelection()), this._applyTheme();
|
|
13435
13688
|
return;
|
|
13436
13689
|
}
|
|
13437
13690
|
let t = this.selected;
|
|
@@ -13441,11 +13694,11 @@ var Ql = class extends HTMLElement {
|
|
|
13441
13694
|
}
|
|
13442
13695
|
let n = this.relations.filter((e) => e.from === t.id || e.to === t.id), r = this.modelData.entities.filter((e) => e.parent === t.id), i = [], a = /* @__PURE__ */ new Set(), o = t;
|
|
13443
13696
|
for (; o && !a.has(o.id);) a.add(o.id), i.unshift(o), o = o.parent ? this.nodes.get(o.parent) : null;
|
|
13444
|
-
let s = "<nav class=\"crumbs\" aria-label=\"Ruta del modelo\"><button data-action=\"overview\">Modelo</button>" + i.map((e, t) => "<span>/</span><button data-action=\"path\" data-id=\"" +
|
|
13445
|
-
let n = this.relations.indexOf(e), r = e.text ? "<small>" +
|
|
13446
|
-
return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" +
|
|
13697
|
+
let s = "<nav class=\"crumbs\" aria-label=\"Ruta del modelo\"><button data-action=\"overview\">Modelo</button>" + i.map((e, t) => "<span>/</span><button data-action=\"path\" data-id=\"" + Rl(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + Rl(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
|
|
13698
|
+
let n = this.relations.indexOf(e), r = e.text ? "<small>" + Rl(e.text) + "</small>" : "";
|
|
13699
|
+
return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + Rl(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + Rl(e.from) + " → " + Rl(e.to) + "</small>" + r + "</button>";
|
|
13447
13700
|
}).join("");
|
|
13448
|
-
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">" +
|
|
13701
|
+
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">" + Rl(xl(t.type) ? "CONTENEDOR" : t.type === "actor" ? "ACTOR EXTERNO" : "COMPONENTE") + "</div><h2>" + Rl(t.name) + "</h2><div class=\"sub\">" + Rl(t.sub || "") + "</div><p>" + Rl(t.text || "") + "</p>" + zl(t.url) + (xl(t.type) ? "<button data-action=\"toggle-shell\">" + (this.open.has(t.id) ? "Cerrar bloque" : "Abrir bloque") + "</button>" : "") + (r.length ? "<h3>CONTIENE</h3><p>" + r.length + " pieza(s) interna(s).</p>" : "") + "<h3>RELACIONES</h3>" + (c || "<p>No hay relaciones directas.</p>"), this.panel.querySelectorAll("[data-action=\"overview\"]").forEach((e) => e.addEventListener("click", () => this.reset())), this.panel.querySelectorAll("[data-action=\"path\"]").forEach((e) => e.addEventListener("click", () => this.select(e.dataset.id))), this.panel.querySelectorAll("[data-action=\"relation\"]").forEach((e) => e.addEventListener("click", () => this.selectRelation(Number(e.dataset.relationIndex), { source: "panel" }))), this.panel.querySelector("[data-action=\"focus-selection\"]")?.addEventListener("click", () => this.focusSelection()), this.panel.querySelector("[data-action=\"toggle-shell\"]")?.addEventListener("click", () => {
|
|
13449
13702
|
this.toggleContainer(t.id, { source: "panel" });
|
|
13450
13703
|
}), this._applyTheme();
|
|
13451
13704
|
}
|
|
@@ -13454,7 +13707,7 @@ var Ql = class extends HTMLElement {
|
|
|
13454
13707
|
if (!n) return this;
|
|
13455
13708
|
let r = new Set(this.open), i = n.parent ? this.nodes.get(n.parent) : null;
|
|
13456
13709
|
for (; i;) r.add(i.id), i = i.parent ? this.nodes.get(i.parent) : null;
|
|
13457
|
-
return this.selected = n, this.selectedRelationIndex = null,
|
|
13710
|
+
return this.selected = n, this.selectedRelationIndex = null, xl(n.type) && r.add(n.id), this._replaceOpenContainers(r, {
|
|
13458
13711
|
refresh: !1,
|
|
13459
13712
|
source: t.source || "api"
|
|
13460
13713
|
}), this._applySelectionNavigation(t.navigation), this._renderPanel(), this._rebuildRelations(), this._syncFocusToolbar(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
|
|
@@ -13518,25 +13771,26 @@ var Ql = class extends HTMLElement {
|
|
|
13518
13771
|
for (let e of this.nodes.values()) {
|
|
13519
13772
|
let t = this._focusAlpha(e, i), n = this._isVisible(e) && t > 0;
|
|
13520
13773
|
e.group.visible = n;
|
|
13521
|
-
let r =
|
|
13522
|
-
if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material)
|
|
13774
|
+
let r = xl(e.type) && this.open.has(e.id), a = (r ? .12 : 1) * t;
|
|
13775
|
+
if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material) Tl(e.material, !0), e.material.opacity = a, e.material.depthWrite = !r, e.material.emissive?.set(e === this.selected ? e.material.color : 0), e.material.emissiveIntensity = e === this.selected ? .15 : 0;
|
|
13523
13776
|
else {
|
|
13524
|
-
for (let n of e.appearanceMaterials || []) Object.hasOwn(n.userData, "atlasBaseOpacity") || (n.userData.atlasBaseOpacity = n.opacity ?? 1), Object.hasOwn(n.userData, "atlasBaseTransparent") || (n.userData.atlasBaseTransparent = n.transparent), Object.hasOwn(n.userData, "atlasBaseDepthWrite") || (n.userData.atlasBaseDepthWrite = n.depthWrite),
|
|
13777
|
+
for (let n of e.appearanceMaterials || []) Object.hasOwn(n.userData, "atlasBaseOpacity") || (n.userData.atlasBaseOpacity = n.opacity ?? 1), Object.hasOwn(n.userData, "atlasBaseTransparent") || (n.userData.atlasBaseTransparent = n.transparent), Object.hasOwn(n.userData, "atlasBaseDepthWrite") || (n.userData.atlasBaseDepthWrite = n.depthWrite), Tl(n, n.userData.atlasBaseTransparent || t < 1), n.depthWrite = n.userData.atlasBaseDepthWrite, n.opacity = n.userData.atlasBaseOpacity * t, n.emissive?.set(e === this.selected ? n.color : 0), n.emissiveIntensity = e === this.selected ? .15 : 0;
|
|
13525
13778
|
e._appearanceSelected = e === this.selected;
|
|
13526
13779
|
}
|
|
13527
13780
|
e.edge?.material && (e.edge.material.opacity = (e === this.selected ? 1 : .65) * t);
|
|
13528
|
-
let o =
|
|
13781
|
+
let o = xl(e.type) && r, s = o, c = e.label.userData.front, l = e.label.userData.back, u = e.label.userData.top, d = e.label.userData.height, f = e.label.userData.width, p = e.label.userData.textOffsetX || 0;
|
|
13529
13782
|
e.label.userData.textOffsetY;
|
|
13530
|
-
let m = e.labelSize || new U().fromArray(e.s);
|
|
13783
|
+
let m = e.labelSize || new U().fromArray(e.s), h = au(e.labelAnchor, m, f, d);
|
|
13531
13784
|
e.label.visible = n;
|
|
13532
|
-
let
|
|
13533
|
-
if (
|
|
13534
|
-
|
|
13785
|
+
let g = this._worldPosition(e), _ = this.itemFacing === "camera" && !xl(e.type) || this.camera.position.z >= g.z, v = this.camera.position.y > g.y + .25;
|
|
13786
|
+
if (h) c.visible = _, l.visible = !_, u.visible = !1, c.scale.setScalar(1), l.scale.setScalar(1), c.position.set(h.x, h.y, m.z / 2 + .025), l.position.set(h.x, h.y, -m.z / 2 - .025), c.rotation.z = h.frontRotation, l.rotation.z = h.backRotation, c.material.color.set(15923964), l.material.color.set(15923964), c.material.opacity = t, l.material.opacity = t;
|
|
13787
|
+
else if (xl(e.type)) {
|
|
13788
|
+
c.rotation.z = 0, l.rotation.z = 0, c.visible = _ && (!o || s), l.visible = !_ && (!o || s), u.visible = s && v;
|
|
13535
13789
|
let e = s ? .52 : 1;
|
|
13536
13790
|
c.scale.setScalar(e), c.position.x = s ? -m.x / 2 + .18 + f * e / 2 - p * e : 0;
|
|
13537
13791
|
let n = .18;
|
|
13538
13792
|
c.position.y = s ? m.y / 2 - n - d * e / 2 : m.y / 2 - .09 - d / 2, c.position.z = s ? m.z / 2 + .025 : m.z / 2 + .012, l.position.y = s ? m.y / 2 - n - d * e / 2 : m.y / 2 - .09 - d / 2, l.position.z = s ? -m.z / 2 - .025 : -m.z / 2 - .012, c.material.color.set(s ? 10793147 : 15923964), c.material.opacity = (s ? .82 : 1) * t, l.material.color.set(s ? 10793147 : 15923964), l.material.opacity = (s ? .82 : 1) * t, u.scale.setScalar(s ? .55 : 1), u.position.x = s ? -m.x / 2 + .12 + f * .55 / 2 - p * .55 : 0, u.position.z = s ? -m.z / 2 + .12 + d * .55 / 2 : 0, u.material.color.set(s ? 10793147 : 15923964), u.material.opacity = (s ? .82 : 1) * t;
|
|
13539
|
-
} else c.visible =
|
|
13793
|
+
} else c.rotation.z = 0, l.rotation.z = 0, c.visible = _ && !r, l.visible = !_ && !r, u.visible = !1, c.scale.setScalar(1), c.position.x = 0, c.position.y = m.y / 2 - .09 - d / 2, c.position.z = m.z / 2 + .012, l.position.x = 0, l.position.y = m.y / 2 - .09 - d / 2, l.position.z = -m.z / 2 - .012, c.material.color.set(15923964), c.material.opacity = t, l.material.opacity = t;
|
|
13540
13794
|
}
|
|
13541
13795
|
for (let t of this.relationGroup.children) {
|
|
13542
13796
|
if (!t.userData.start) continue;
|
|
@@ -13549,7 +13803,7 @@ var Ql = class extends HTMLElement {
|
|
|
13549
13803
|
let t = this.canvas.getBoundingClientRect();
|
|
13550
13804
|
this.pointer.set((e.clientX - t.left) / t.width * 2 - 1, -(e.clientY - t.top) / t.height * 2 + 1), this.raycaster.setFromCamera(this.pointer, this.camera);
|
|
13551
13805
|
let n = [];
|
|
13552
|
-
for (let e of this.nodes.values()) e.group.visible && (
|
|
13806
|
+
for (let e of this.nodes.values()) e.group.visible && (xl(e.type) && this.open.has(e.id) || n.push(e.pickMesh || e.mesh), e.label?.visible && n.push(...e.label.children.filter((e) => e.visible)));
|
|
13553
13807
|
let r = this.raycaster.intersectObjects(n, !0)[0] || null, i = this.relationMode === "none" ? [] : this.relationGroup.children.filter((e) => e.userData?.relationPick), a = this.raycaster.intersectObjects(i, !1)[0] || null;
|
|
13554
13808
|
if (r && (!a || r.distance <= a.distance + .12)) {
|
|
13555
13809
|
let e = r.object;
|
|
@@ -13622,7 +13876,7 @@ var Ql = class extends HTMLElement {
|
|
|
13622
13876
|
y: e.clientY
|
|
13623
13877
|
}), e.pointerType === "touch" && this.pointers.size >= 2) {
|
|
13624
13878
|
let [e, t] = [...this.pointers.values()], n = (e.x + t.x) / 2, r = (e.y + t.y) / 2, i = Math.max(1, Math.hypot(e.x - t.x, e.y - t.y));
|
|
13625
|
-
this.drag.mode === "touch-pan" ? (this._panByPixels(n - this.drag.x, r - this.drag.y), this.targetZoom = Math.min(2.8, Math.max(
|
|
13879
|
+
this.drag.mode === "touch-pan" ? (this._panByPixels(n - this.drag.x, r - this.drag.y), this.targetZoom = Math.min(2.8, Math.max(tl, this.targetZoom * i / Math.max(1, this.drag.distance))), Object.assign(this.drag, {
|
|
13626
13880
|
x: n,
|
|
13627
13881
|
y: r,
|
|
13628
13882
|
distance: i,
|
|
@@ -13693,16 +13947,16 @@ var Ql = class extends HTMLElement {
|
|
|
13693
13947
|
navigation: "fit"
|
|
13694
13948
|
});
|
|
13695
13949
|
}), this.canvas.addEventListener("wheel", (e) => {
|
|
13696
|
-
e.preventDefault(), this.targetZoom = Math.min(2.8, Math.max(
|
|
13950
|
+
e.preventDefault(), this.targetZoom = Math.min(2.8, Math.max(tl, this.targetZoom * Math.exp(-e.deltaY * .001))), this.invalidate();
|
|
13697
13951
|
}, { passive: !1 });
|
|
13698
13952
|
}
|
|
13699
13953
|
_showError(e) {
|
|
13700
13954
|
let t = this.shadowRoot.querySelector(".viewport"), n = t.querySelector(".error");
|
|
13701
|
-
n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" +
|
|
13955
|
+
n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" + Rl(e) + "</div>");
|
|
13702
13956
|
}
|
|
13703
13957
|
};
|
|
13704
|
-
customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas",
|
|
13958
|
+
customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas", cu);
|
|
13705
13959
|
//#endregion
|
|
13706
|
-
export {
|
|
13960
|
+
export { $c as ATLAS_VERSION, cu as LiquidCarsAtlas, su as captureRendererFrame, eu as createSvgExtrudeGeometry, vl as getGeometryCatalog, yl as getGeometryPackCatalog, au as labelPlacementForAnchor, iu as normalizeLabelAnchor, Bl as normalizeModel, gl as registerGeometryPack, _l as unregisterGeometryPack };
|
|
13707
13961
|
|
|
13708
13962
|
//# sourceMappingURL=liquidcars-atlas.js.map
|