@liquidcars/atlas 0.1.38 → 0.1.40
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 +84 -33
- package/dist/liquidcars-atlas.js +959 -692
- package/dist/liquidcars-atlas.js.map +1 -1
- package/package.json +1 -1
- package/src/liquidcars-atlas.js +370 -22
package/dist/liquidcars-atlas.js
CHANGED
|
@@ -66,30 +66,30 @@ function ne(e, t) {
|
|
|
66
66
|
function re(e, t) {
|
|
67
67
|
return e + Math.random() * (t - e);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function ie(e) {
|
|
70
70
|
return e * (.5 - Math.random());
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function R(e) {
|
|
73
73
|
e !== void 0 && (D = e);
|
|
74
74
|
let t = D += 1831565813;
|
|
75
75
|
return t = Math.imul(t ^ t >>> 15, t | 1), t ^= t + Math.imul(t ^ t >>> 7, t | 61), ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function z(e) {
|
|
78
78
|
return e * O;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function ae(e) {
|
|
81
81
|
return e * k;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function oe(e) {
|
|
84
84
|
return !(e & e - 1) && e !== 0;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function se(e) {
|
|
87
87
|
return 2 ** Math.ceil(Math.log(e) / Math.LN2);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function ce(e) {
|
|
90
90
|
return 2 ** Math.floor(Math.log(e) / Math.LN2);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function le(e, t, n, r, i) {
|
|
93
93
|
let a = Math.cos, o = Math.sin, s = a(n / 2), c = o(n / 2), l = a((t + r) / 2), u = o((t + r) / 2), d = a((t - r) / 2), f = o((t - r) / 2), p = a((r - t) / 2), m = o((r - t) / 2);
|
|
94
94
|
switch (i) {
|
|
95
95
|
case "XYX":
|
|
@@ -113,7 +113,7 @@ function ce(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 B(e, t) {
|
|
117
117
|
switch (t.constructor) {
|
|
118
118
|
case Float32Array: return e;
|
|
119
119
|
case Uint32Array: return e / 4294967295;
|
|
@@ -152,16 +152,16 @@ var de = {
|
|
|
152
152
|
smootherstep: L,
|
|
153
153
|
randInt: ne,
|
|
154
154
|
randFloat: re,
|
|
155
|
-
randFloatSpread:
|
|
156
|
-
seededRandom:
|
|
157
|
-
degToRad:
|
|
158
|
-
radToDeg:
|
|
159
|
-
isPowerOfTwo:
|
|
160
|
-
ceilPowerOfTwo:
|
|
161
|
-
floorPowerOfTwo:
|
|
162
|
-
setQuaternionFromProperEuler:
|
|
155
|
+
randFloatSpread: ie,
|
|
156
|
+
seededRandom: R,
|
|
157
|
+
degToRad: z,
|
|
158
|
+
radToDeg: ae,
|
|
159
|
+
isPowerOfTwo: oe,
|
|
160
|
+
ceilPowerOfTwo: se,
|
|
161
|
+
floorPowerOfTwo: ce,
|
|
162
|
+
setQuaternionFromProperEuler: le,
|
|
163
163
|
normalize: ue,
|
|
164
|
-
denormalize:
|
|
164
|
+
denormalize: B
|
|
165
165
|
}, V = class e {
|
|
166
166
|
constructor(t = 0, n = 0) {
|
|
167
167
|
e.prototype.isVector2 = !0, this.x = t, this.y = n;
|
|
@@ -3020,35 +3020,35 @@ 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 = B(n, this.array)), n;
|
|
3024
3024
|
}
|
|
3025
3025
|
setComponent(e, t, n) {
|
|
3026
3026
|
return this.normalized && (n = ue(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 = B(t, this.array)), t;
|
|
3031
3031
|
}
|
|
3032
3032
|
setX(e, t) {
|
|
3033
3033
|
return this.normalized && (t = ue(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 = B(t, this.array)), t;
|
|
3038
3038
|
}
|
|
3039
3039
|
setY(e, t) {
|
|
3040
3040
|
return this.normalized && (t = ue(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 = B(t, this.array)), t;
|
|
3045
3045
|
}
|
|
3046
3046
|
setZ(e, t) {
|
|
3047
3047
|
return this.normalized && (t = ue(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 = B(t, this.array)), t;
|
|
3052
3052
|
}
|
|
3053
3053
|
setW(e, t) {
|
|
3054
3054
|
return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize + 3] = t, this;
|
|
@@ -5447,21 +5447,21 @@ var Ji = class e extends vn {
|
|
|
5447
5447
|
let e = 0, t = k * e;
|
|
5448
5448
|
for (let e = 0; e < I; e++) {
|
|
5449
5449
|
let n = F[e];
|
|
5450
|
-
|
|
5450
|
+
ie(n[2] + t, n[1] + t, n[0] + t);
|
|
5451
5451
|
}
|
|
5452
5452
|
e = s + p * 2, t = k * e;
|
|
5453
5453
|
for (let e = 0; e < I; e++) {
|
|
5454
5454
|
let n = F[e];
|
|
5455
|
-
|
|
5455
|
+
ie(n[0] + t, n[1] + t, n[2] + t);
|
|
5456
5456
|
}
|
|
5457
5457
|
} else {
|
|
5458
5458
|
for (let e = 0; e < I; e++) {
|
|
5459
5459
|
let t = F[e];
|
|
5460
|
-
|
|
5460
|
+
ie(t[2], t[1], t[0]);
|
|
5461
5461
|
}
|
|
5462
5462
|
for (let e = 0; e < I; e++) {
|
|
5463
5463
|
let t = F[e];
|
|
5464
|
-
|
|
5464
|
+
ie(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);
|
|
@@ -5482,27 +5482,27 @@ var Ji = class e extends vn {
|
|
|
5482
5482
|
i < 0 && (i = e.length - 1);
|
|
5483
5483
|
for (let e = 0, n = s + p * 2; e < n; e++) {
|
|
5484
5484
|
let n = k * e, a = k * (e + 1);
|
|
5485
|
-
|
|
5485
|
+
R(t + r + n, t + i + n, t + i + a, t + r + a);
|
|
5486
5486
|
}
|
|
5487
5487
|
}
|
|
5488
5488
|
}
|
|
5489
5489
|
function re(e, t, n) {
|
|
5490
5490
|
a.push(e), a.push(t), a.push(n);
|
|
5491
5491
|
}
|
|
5492
|
-
function
|
|
5493
|
-
|
|
5492
|
+
function ie(e, t, i) {
|
|
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]);
|
|
5496
5496
|
}
|
|
5497
|
-
function
|
|
5498
|
-
|
|
5497
|
+
function R(e, t, i, a) {
|
|
5498
|
+
z(e), z(t), z(a), z(t), z(i), z(a);
|
|
5499
5499
|
let o = r.length / 3, s = h.generateSideWallUV(n, r, o - 6, o - 3, o - 2, o - 1);
|
|
5500
|
-
|
|
5500
|
+
ae(s[0]), ae(s[1]), ae(s[3]), ae(s[1]), ae(s[2]), ae(s[3]);
|
|
5501
5501
|
}
|
|
5502
|
-
function
|
|
5502
|
+
function z(e) {
|
|
5503
5503
|
r.push(a[e * 3 + 0]), r.push(a[e * 3 + 1]), r.push(a[e * 3 + 2]);
|
|
5504
5504
|
}
|
|
5505
|
-
function
|
|
5505
|
+
function ae(e) {
|
|
5506
5506
|
i.push(e.x), i.push(e.y);
|
|
5507
5507
|
}
|
|
5508
5508
|
}
|
|
@@ -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);
|
|
8480
8562
|
}
|
|
8481
|
-
function hs(e) {
|
|
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);
|
|
8566
|
+
}
|
|
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(), P = _.isInstancedMesh === !0, F = _.isBatchedMesh === !0, I = !!a.map, ee = !!a.matcap, te = !!S, L = !!a.aoMap, ne = !!a.lightMap, re = !!a.bumpMap,
|
|
9332
|
+
let M = e.getRenderTarget(), N = e.state.buffers.depth.getReversed(), P = _.isInstancedMesh === !0, F = _.isBatchedMesh === !0, I = !!a.map, ee = !!a.matcap, te = !!S, L = !!a.aoMap, ne = !!a.lightMap, re = !!a.bumpMap, ie = !!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, B = a.iridescence > 0, ue = a.sheen > 0, de = a.transmission > 0, V = se && !!a.anisotropyMap, H = ce && !!a.clearcoatMap, U = ce && !!a.clearcoatNormalMap, fe = ce && !!a.clearcoatRoughnessMap, W = B && !!a.iridescenceMap, G = B && !!a.iridescenceThicknessMap, K = ue && !!a.sheenColorMap, pe = ue && !!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,
|
|
@@ -9273,21 +9359,21 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9273
9359
|
aoMap: L,
|
|
9274
9360
|
lightMap: ne,
|
|
9275
9361
|
bumpMap: re,
|
|
9276
|
-
normalMap:
|
|
9277
|
-
displacementMap: f &&
|
|
9278
|
-
emissiveMap:
|
|
9279
|
-
normalMapObjectSpace:
|
|
9280
|
-
normalMapTangentSpace:
|
|
9281
|
-
metalnessMap:
|
|
9282
|
-
roughnessMap:
|
|
9283
|
-
anisotropy:
|
|
9362
|
+
normalMap: ie,
|
|
9363
|
+
displacementMap: f && R,
|
|
9364
|
+
emissiveMap: z,
|
|
9365
|
+
normalMapObjectSpace: ie && a.normalMapType === 1,
|
|
9366
|
+
normalMapTangentSpace: ie && a.normalMapType === 0,
|
|
9367
|
+
metalnessMap: ae,
|
|
9368
|
+
roughnessMap: oe,
|
|
9369
|
+
anisotropy: se,
|
|
9284
9370
|
anisotropyMap: V,
|
|
9285
|
-
clearcoat:
|
|
9371
|
+
clearcoat: ce,
|
|
9286
9372
|
clearcoatMap: H,
|
|
9287
9373
|
clearcoatNormalMap: U,
|
|
9288
9374
|
clearcoatRoughnessMap: fe,
|
|
9289
|
-
dispersion:
|
|
9290
|
-
iridescence:
|
|
9375
|
+
dispersion: le,
|
|
9376
|
+
iridescence: B,
|
|
9291
9377
|
iridescenceMap: W,
|
|
9292
9378
|
iridescenceThicknessMap: G,
|
|
9293
9379
|
sheen: ue,
|
|
@@ -9309,11 +9395,11 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9309
9395
|
aoMapUv: L && h(a.aoMap.channel),
|
|
9310
9396
|
lightMapUv: ne && h(a.lightMap.channel),
|
|
9311
9397
|
bumpMapUv: re && h(a.bumpMap.channel),
|
|
9312
|
-
normalMapUv:
|
|
9313
|
-
displacementMapUv:
|
|
9314
|
-
emissiveMapUv:
|
|
9315
|
-
metalnessMapUv:
|
|
9316
|
-
roughnessMapUv:
|
|
9398
|
+
normalMapUv: ie && h(a.normalMap.channel),
|
|
9399
|
+
displacementMapUv: R && h(a.displacementMap.channel),
|
|
9400
|
+
emissiveMapUv: z && h(a.emissiveMap.channel),
|
|
9401
|
+
metalnessMapUv: ae && h(a.metalnessMap.channel),
|
|
9402
|
+
roughnessMapUv: oe && h(a.roughnessMap.channel),
|
|
9317
9403
|
anisotropyMapUv: V && h(a.anisotropyMap.channel),
|
|
9318
9404
|
clearcoatMapUv: H && h(a.clearcoatMap.channel),
|
|
9319
9405
|
clearcoatNormalMapUv: U && h(a.clearcoatNormalMap.channel),
|
|
@@ -9328,7 +9414,7 @@ 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 && (ie || se),
|
|
9332
9418
|
vertexColors: a.vertexColors,
|
|
9333
9419
|
vertexAlphas: a.vertexColors === !0 && !!y.attributes.color && y.attributes.color.itemSize === 4,
|
|
9334
9420
|
pointsUvs: _.isPoints === !0 && !!y.attributes.uv && (I || ve),
|
|
@@ -9363,7 +9449,7 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9363
9449
|
shadowMapType: e.shadowMap.type,
|
|
9364
9450
|
toneMapping: Se,
|
|
9365
9451
|
decodeVideoTexture: I && a.map.isVideoTexture === !0 && Y.getTransfer(a.map.colorSpace) === "srgb",
|
|
9366
|
-
decodeVideoTextureEmissive:
|
|
9452
|
+
decodeVideoTextureEmissive: z && a.emissiveMap.isVideoTexture === !0 && Y.getTransfer(a.emissiveMap.colorSpace) === "srgb",
|
|
9367
9453
|
premultipliedAlpha: a.premultipliedAlpha,
|
|
9368
9454
|
doubleSided: a.side === 2,
|
|
9369
9455
|
flipSided: a.side === 1,
|
|
@@ -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 {
|
|
@@ -9931,13 +10017,13 @@ function Bc(e, t) {
|
|
|
9931
10017
|
return r;
|
|
9932
10018
|
},
|
|
9933
10019
|
setTest: function(t) {
|
|
9934
|
-
t ?
|
|
10020
|
+
t ? R(e.DEPTH_TEST) : z(e.DEPTH_TEST);
|
|
9935
10021
|
},
|
|
9936
10022
|
setMask: function(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);
|
|
@@ -9983,7 +10069,7 @@ function Bc(e, t) {
|
|
|
9983
10069
|
let t = !1, n = null, r = null, i = null, a = null, o = null, s = null, c = null, l = null;
|
|
9984
10070
|
return {
|
|
9985
10071
|
setTest: function(n) {
|
|
9986
|
-
t || (n ?
|
|
10072
|
+
t || (n ? R(e.STENCIL_TEST) : z(e.STENCIL_TEST));
|
|
9987
10073
|
},
|
|
9988
10074
|
setMask: function(r) {
|
|
9989
10075
|
n !== r && !t && (e.stencilMask(r), n = r);
|
|
@@ -10014,18 +10100,18 @@ function Bc(e, t) {
|
|
|
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
|
-
|
|
10019
|
-
function
|
|
10103
|
+
let ie = {};
|
|
10104
|
+
ie[e.TEXTURE_2D] = re(e.TEXTURE_2D, e.TEXTURE_2D, 1), ie[e.TEXTURE_CUBE_MAP] = re(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), ie[e.TEXTURE_2D_ARRAY] = re(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), ie[e.TEXTURE_3D] = re(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), B(0);
|
|
10105
|
+
function R(t) {
|
|
10020
10106
|
u[t] !== !0 && (e.enable(t), u[t] = !0);
|
|
10021
10107
|
}
|
|
10022
|
-
function
|
|
10108
|
+
function z(t) {
|
|
10023
10109
|
u[t] !== !1 && (e.disable(t), u[t] = !1);
|
|
10024
10110
|
}
|
|
10025
|
-
function
|
|
10111
|
+
function ae(t, n) {
|
|
10026
10112
|
return d[t] !== n && (e.bindFramebuffer(t, n), d[t] = n, t === e.DRAW_FRAMEBUFFER && (d[e.FRAMEBUFFER] = n), t === e.FRAMEBUFFER && (d[e.DRAW_FRAMEBUFFER] = n), !0);
|
|
10027
10113
|
}
|
|
10028
|
-
function
|
|
10114
|
+
function oe(t, n) {
|
|
10029
10115
|
let r = p, i = !1;
|
|
10030
10116
|
if (t) {
|
|
10031
10117
|
r = f.get(n), r === void 0 && (r = [], f.set(n, r));
|
|
@@ -10037,16 +10123,16 @@ function Bc(e, t) {
|
|
|
10037
10123
|
} else r[0] !== e.BACK && (r[0] = e.BACK, i = !0);
|
|
10038
10124
|
i && e.drawBuffers(r);
|
|
10039
10125
|
}
|
|
10040
|
-
function
|
|
10126
|
+
function se(t) {
|
|
10041
10127
|
return m !== t && (e.useProgram(t), m = t, !0);
|
|
10042
10128
|
}
|
|
10043
|
-
let
|
|
10129
|
+
let ce = {
|
|
10044
10130
|
100: e.FUNC_ADD,
|
|
10045
10131
|
101: e.FUNC_SUBTRACT,
|
|
10046
10132
|
102: e.FUNC_REVERSE_SUBTRACT
|
|
10047
10133
|
};
|
|
10048
|
-
|
|
10049
|
-
let
|
|
10134
|
+
ce[103] = e.MIN, ce[104] = e.MAX;
|
|
10135
|
+
let le = {
|
|
10050
10136
|
200: e.ZERO,
|
|
10051
10137
|
201: e.ONE,
|
|
10052
10138
|
202: e.SRC_COLOR,
|
|
@@ -10063,12 +10149,12 @@ function Bc(e, t) {
|
|
|
10063
10149
|
213: e.CONSTANT_ALPHA,
|
|
10064
10150
|
214: e.ONE_MINUS_CONSTANT_ALPHA
|
|
10065
10151
|
};
|
|
10066
|
-
function
|
|
10152
|
+
function B(t, n, r, i, a, o, s, c, l, u) {
|
|
10067
10153
|
if (t === 0) {
|
|
10068
|
-
h === !0 && (
|
|
10154
|
+
h === !0 && (z(e.BLEND), h = !1);
|
|
10069
10155
|
return;
|
|
10070
10156
|
}
|
|
10071
|
-
if (h === !1 && (
|
|
10157
|
+
if (h === !1 && (R(e.BLEND), h = !0), t !== 5) {
|
|
10072
10158
|
if (t !== g || u !== T) {
|
|
10073
10159
|
if ((_ !== 100 || b !== 100) && (e.blendEquation(e.FUNC_ADD), _ = 100, b = 100), u) switch (t) {
|
|
10074
10160
|
case 1:
|
|
@@ -10104,29 +10190,29 @@ function Bc(e, t) {
|
|
|
10104
10190
|
}
|
|
10105
10191
|
return;
|
|
10106
10192
|
}
|
|
10107
|
-
a ||= n, o ||= r, s ||= i, (n !== _ || a !== b) && (e.blendEquationSeparate(
|
|
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
10195
|
function ue(t, n) {
|
|
10110
|
-
t.side === 2 ?
|
|
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 ? B(0) : B(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
|
-
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 ?
|
|
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
|
}
|
|
10116
10202
|
function de(t) {
|
|
10117
10203
|
E !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), E = t);
|
|
10118
10204
|
}
|
|
10119
10205
|
function V(t) {
|
|
10120
|
-
t === 0 ?
|
|
10206
|
+
t === 0 ? z(e.CULL_FACE) : (R(e.CULL_FACE), t !== D && (t === 1 ? e.cullFace(e.BACK) : t === 2 ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))), D = t;
|
|
10121
10207
|
}
|
|
10122
10208
|
function H(t) {
|
|
10123
10209
|
t !== O && (M && e.lineWidth(t), O = t);
|
|
10124
10210
|
}
|
|
10125
10211
|
function U(t, n, r) {
|
|
10126
|
-
t ? (
|
|
10212
|
+
t ? (R(e.POLYGON_OFFSET_FILL), (k !== n || A !== r) && (e.polygonOffset(n, r), k = n, A = r)) : z(e.POLYGON_OFFSET_FILL);
|
|
10127
10213
|
}
|
|
10128
10214
|
function fe(t) {
|
|
10129
|
-
t ?
|
|
10215
|
+
t ? R(e.SCISSOR_TEST) : z(e.SCISSOR_TEST);
|
|
10130
10216
|
}
|
|
10131
10217
|
function W(t) {
|
|
10132
10218
|
t === void 0 && (t = e.TEXTURE0 + j - 1), F !== t && (e.activeTexture(t), F = t);
|
|
@@ -10137,7 +10223,7 @@ function Bc(e, t) {
|
|
|
10137
10223
|
i === void 0 && (i = {
|
|
10138
10224
|
type: void 0,
|
|
10139
10225
|
texture: void 0
|
|
10140
|
-
}, I[r] = i), (i.type !== t || i.texture !== n) && (F !== r && (e.activeTexture(r), F = r), e.bindTexture(t, n ||
|
|
10226
|
+
}, I[r] = i), (i.type !== t || i.texture !== n) && (F !== r && (e.activeTexture(r), F = r), e.bindTexture(t, n || ie[t]), i.type = t, i.texture = n);
|
|
10141
10227
|
}
|
|
10142
10228
|
function K() {
|
|
10143
10229
|
let t = I[F];
|
|
@@ -10238,12 +10324,12 @@ function Bc(e, t) {
|
|
|
10238
10324
|
depth: o,
|
|
10239
10325
|
stencil: s
|
|
10240
10326
|
},
|
|
10241
|
-
enable:
|
|
10242
|
-
disable:
|
|
10243
|
-
bindFramebuffer:
|
|
10244
|
-
drawBuffers:
|
|
10245
|
-
useProgram:
|
|
10246
|
-
setBlending:
|
|
10327
|
+
enable: R,
|
|
10328
|
+
disable: z,
|
|
10329
|
+
bindFramebuffer: ae,
|
|
10330
|
+
drawBuffers: oe,
|
|
10331
|
+
useProgram: se,
|
|
10332
|
+
setBlending: B,
|
|
10247
10333
|
setMaterial: ue,
|
|
10248
10334
|
setFlipSided: de,
|
|
10249
10335
|
setCullFace: V,
|
|
@@ -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;
|
|
@@ -10382,7 +10468,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
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
|
+
B(n, e, t);
|
|
10386
10472
|
return;
|
|
10387
10473
|
}
|
|
10388
10474
|
} else e.isExternalTexture && (n.__webglTexture = e.sourceTexture ? e.sourceTexture : null);
|
|
@@ -10391,7 +10477,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10391
10477
|
function ne(e, t) {
|
|
10392
10478
|
let n = l.get(e);
|
|
10393
10479
|
if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
|
|
10394
|
-
|
|
10480
|
+
B(n, e, t);
|
|
10395
10481
|
return;
|
|
10396
10482
|
}
|
|
10397
10483
|
c.bindTexture(o.TEXTURE_2D_ARRAY, n.__webglTexture, o.TEXTURE0 + t);
|
|
@@ -10399,12 +10485,12 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10399
10485
|
function re(e, t) {
|
|
10400
10486
|
let n = l.get(e);
|
|
10401
10487
|
if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
|
|
10402
|
-
|
|
10488
|
+
B(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 ie(e, t) {
|
|
10408
10494
|
let n = l.get(e);
|
|
10409
10495
|
if (e.version > 0 && n.__version !== e.version) {
|
|
10410
10496
|
ue(n, e, t);
|
|
@@ -10412,18 +10498,18 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10412
10498
|
}
|
|
10413
10499
|
c.bindTexture(o.TEXTURE_CUBE_MAP, n.__webglTexture, o.TEXTURE0 + t);
|
|
10414
10500
|
}
|
|
10415
|
-
let
|
|
10501
|
+
let R = {
|
|
10416
10502
|
[e]: o.REPEAT,
|
|
10417
10503
|
[t]: o.CLAMP_TO_EDGE,
|
|
10418
10504
|
[n]: o.MIRRORED_REPEAT
|
|
10419
|
-
},
|
|
10505
|
+
}, z = {
|
|
10420
10506
|
[r]: o.NEAREST,
|
|
10421
10507
|
1004: o.NEAREST_MIPMAP_NEAREST,
|
|
10422
10508
|
1005: o.NEAREST_MIPMAP_LINEAR,
|
|
10423
10509
|
[i]: o.LINEAR,
|
|
10424
10510
|
1007: o.LINEAR_MIPMAP_NEAREST,
|
|
10425
10511
|
[a]: o.LINEAR_MIPMAP_LINEAR
|
|
10426
|
-
},
|
|
10512
|
+
}, ae = {
|
|
10427
10513
|
512: o.NEVER,
|
|
10428
10514
|
519: o.ALWAYS,
|
|
10429
10515
|
513: o.LESS,
|
|
@@ -10433,8 +10519,8 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10433
10519
|
516: o.GREATER,
|
|
10434
10520
|
517: o.NOTEQUAL
|
|
10435
10521
|
};
|
|
10436
|
-
function
|
|
10437
|
-
if (t.type === 1015 && s.has("OES_texture_float_linear") === !1 && (t.magFilter === 1006 || t.magFilter === 1007 || t.magFilter === 1005 || t.magFilter === 1008 || t.minFilter === 1006 || t.minFilter === 1007 || t.minFilter === 1005 || t.minFilter === 1008) && console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), o.texParameteri(e, o.TEXTURE_WRAP_S,
|
|
10522
|
+
function oe(e, t) {
|
|
10523
|
+
if (t.type === 1015 && s.has("OES_texture_float_linear") === !1 && (t.magFilter === 1006 || t.magFilter === 1007 || t.magFilter === 1005 || t.magFilter === 1008 || t.minFilter === 1006 || t.minFilter === 1007 || t.minFilter === 1005 || t.minFilter === 1008) && console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), o.texParameteri(e, o.TEXTURE_WRAP_S, R[t.wrapS]), o.texParameteri(e, o.TEXTURE_WRAP_T, R[t.wrapT]), (e === o.TEXTURE_3D || e === o.TEXTURE_2D_ARRAY) && o.texParameteri(e, o.TEXTURE_WRAP_R, R[t.wrapR]), o.texParameteri(e, o.TEXTURE_MAG_FILTER, z[t.magFilter]), o.texParameteri(e, o.TEXTURE_MIN_FILTER, z[t.minFilter]), t.compareFunction && (o.texParameteri(e, o.TEXTURE_COMPARE_MODE, o.COMPARE_REF_TO_TEXTURE), o.texParameteri(e, o.TEXTURE_COMPARE_FUNC, ae[t.compareFunction])), s.has("EXT_texture_filter_anisotropic") === !0) {
|
|
10438
10524
|
if (t.magFilter === 1003 || t.minFilter !== 1005 && t.minFilter !== 1008 || t.type === 1015 && s.has("OES_texture_float_linear") === !1) return;
|
|
10439
10525
|
if (t.anisotropy > 1 || l.get(t).__currentAnisotropy) {
|
|
10440
10526
|
let n = s.get("EXT_texture_filter_anisotropic");
|
|
@@ -10442,7 +10528,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10442
10528
|
}
|
|
10443
10529
|
}
|
|
10444
10530
|
}
|
|
10445
|
-
function
|
|
10531
|
+
function se(e, t) {
|
|
10446
10532
|
let n = !1;
|
|
10447
10533
|
e.__webglInit === void 0 && (e.__webglInit = !0, t.addEventListener("dispose", A));
|
|
10448
10534
|
let r = t.source, i = y.get(r);
|
|
@@ -10458,18 +10544,18 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10458
10544
|
}
|
|
10459
10545
|
return n;
|
|
10460
10546
|
}
|
|
10461
|
-
function
|
|
10547
|
+
function ce(e, t, n) {
|
|
10462
10548
|
return Math.floor(Math.floor(e / n) / t);
|
|
10463
10549
|
}
|
|
10464
|
-
function
|
|
10550
|
+
function le(e, t, n, r) {
|
|
10465
10551
|
let i = e.updateRanges;
|
|
10466
10552
|
if (i.length === 0) c.texSubImage2D(o.TEXTURE_2D, 0, 0, 0, t.width, t.height, n, r, t.data);
|
|
10467
10553
|
else {
|
|
10468
10554
|
i.sort((e, t) => e.start - t.start);
|
|
10469
10555
|
let a = 0;
|
|
10470
10556
|
for (let e = 1; e < i.length; e++) {
|
|
10471
|
-
let n = i[a], r = i[e], o = n.start + n.count, s =
|
|
10472
|
-
r.start <= o + 1 && s === c &&
|
|
10557
|
+
let n = i[a], r = i[e], o = n.start + n.count, s = ce(r.start, t.width, 4), c = ce(n.start, t.width, 4);
|
|
10558
|
+
r.start <= o + 1 && s === c && ce(r.start + r.count - 1, t.width, 4) === s ? n.count = Math.max(n.count, r.start + r.count - n.start) : (++a, i[a] = r);
|
|
10473
10559
|
}
|
|
10474
10560
|
i.length = a + 1;
|
|
10475
10561
|
let s = o.getParameter(o.UNPACK_ROW_LENGTH), l = o.getParameter(o.UNPACK_SKIP_PIXELS), u = o.getParameter(o.UNPACK_SKIP_ROWS);
|
|
@@ -10481,10 +10567,10 @@ 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 B(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
|
-
let i =
|
|
10573
|
+
let i = se(e, t), a = t.source;
|
|
10488
10574
|
c.bindTexture(r, e.__webglTexture, o.TEXTURE0 + n);
|
|
10489
10575
|
let s = l.get(a);
|
|
10490
10576
|
if (a.version !== s.__version || i === !0) {
|
|
@@ -10494,7 +10580,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10494
10580
|
let m = C(t.image, !1, u.maxTextureSize);
|
|
10495
10581
|
m = ve(t, m);
|
|
10496
10582
|
let h = d.convert(t.format, t.colorSpace), g = d.convert(t.type), _ = D(t.internalFormat, h, g, t.colorSpace, t.isVideoTexture);
|
|
10497
|
-
|
|
10583
|
+
oe(r, t);
|
|
10498
10584
|
let v, y = t.mipmaps, b = t.isVideoTexture !== !0, x = s.__version === void 0 || i === !0, S = a.dataReady, E = k(t, m);
|
|
10499
10585
|
if (t.isDepthTexture) _ = O(t.format === f, t.type), x && (b ? c.texStorage2D(o.TEXTURE_2D, 1, _, m.width, m.height) : c.texImage2D(o.TEXTURE_2D, 0, _, m.width, m.height, 0, h, g, null));
|
|
10500
10586
|
else if (t.isDataTexture) {
|
|
@@ -10502,7 +10588,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10502
10588
|
b && x && c.texStorage2D(o.TEXTURE_2D, E, _, y[0].width, y[0].height);
|
|
10503
10589
|
for (let e = 0, t = y.length; e < t; e++) v = y[e], b ? S && c.texSubImage2D(o.TEXTURE_2D, e, 0, 0, v.width, v.height, h, g, v.data) : c.texImage2D(o.TEXTURE_2D, e, _, v.width, v.height, 0, h, g, v.data);
|
|
10504
10590
|
t.generateMipmaps = !1;
|
|
10505
|
-
} else b ? (x && c.texStorage2D(o.TEXTURE_2D, E, _, m.width, m.height), S &&
|
|
10591
|
+
} else b ? (x && c.texStorage2D(o.TEXTURE_2D, E, _, m.width, m.height), S && le(t, m, h, g)) : c.texImage2D(o.TEXTURE_2D, 0, _, m.width, m.height, 0, h, g, m.data);
|
|
10506
10592
|
} else if (t.isCompressedTexture) {
|
|
10507
10593
|
if (t.isCompressedArrayTexture) {
|
|
10508
10594
|
b && x && c.texStorage3D(o.TEXTURE_2D_ARRAY, E, _, y[0].width, y[0].height, m.depth);
|
|
@@ -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);
|
|
@@ -10568,7 +10654,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10568
10654
|
}
|
|
10569
10655
|
function ue(e, t, n) {
|
|
10570
10656
|
if (t.image.length !== 6) return;
|
|
10571
|
-
let r =
|
|
10657
|
+
let r = se(e, t), i = t.source;
|
|
10572
10658
|
c.bindTexture(o.TEXTURE_CUBE_MAP, e.__webglTexture, o.TEXTURE0 + n);
|
|
10573
10659
|
let a = l.get(i);
|
|
10574
10660
|
if (i.version !== a.__version || r === !0) {
|
|
@@ -10578,7 +10664,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10578
10664
|
let f = t.isCompressedTexture || t.image[0].isCompressedTexture, p = t.image[0] && t.image[0].isDataTexture, m = [];
|
|
10579
10665
|
for (let e = 0; e < 6; e++) !f && !p ? m[e] = C(t.image[e], !0, u.maxCubemapSize) : m[e] = p ? t.image[e].image : t.image[e], m[e] = ve(t, m[e]);
|
|
10580
10666
|
let h = m[0], g = d.convert(t.format, t.colorSpace), _ = d.convert(t.type), v = D(t.internalFormat, g, _, t.colorSpace), y = t.isVideoTexture !== !0, b = a.__version === void 0 || r === !0, x = i.dataReady, S = k(t, h);
|
|
10581
|
-
|
|
10667
|
+
oe(o.TEXTURE_CUBE_MAP, t);
|
|
10582
10668
|
let E;
|
|
10583
10669
|
if (f) {
|
|
10584
10670
|
y && b && c.texStorage2D(o.TEXTURE_CUBE_MAP, S, v, h.width, h.height);
|
|
@@ -10712,19 +10798,19 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10712
10798
|
}
|
|
10713
10799
|
}
|
|
10714
10800
|
if (a) {
|
|
10715
|
-
c.bindTexture(o.TEXTURE_CUBE_MAP, r.__webglTexture),
|
|
10801
|
+
c.bindTexture(o.TEXTURE_CUBE_MAP, r.__webglTexture), oe(o.TEXTURE_CUBE_MAP, t);
|
|
10716
10802
|
for (let r = 0; r < 6; r++) if (t.mipmaps && t.mipmaps.length > 0) for (let i = 0; i < t.mipmaps.length; i++) de(n.__webglFramebuffer[r][i], e, t, o.COLOR_ATTACHMENT0, o.TEXTURE_CUBE_MAP_POSITIVE_X + r, i);
|
|
10717
10803
|
else de(n.__webglFramebuffer[r], e, t, o.COLOR_ATTACHMENT0, o.TEXTURE_CUBE_MAP_POSITIVE_X + r, 0);
|
|
10718
10804
|
w(t) && T(o.TEXTURE_CUBE_MAP), c.unbindTexture();
|
|
10719
10805
|
} else if (s) {
|
|
10720
10806
|
for (let t = 0, r = i.length; t < r; t++) {
|
|
10721
10807
|
let r = i[t], a = l.get(r), s = o.TEXTURE_2D;
|
|
10722
|
-
(e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (s = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(s, a.__webglTexture),
|
|
10808
|
+
(e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (s = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(s, a.__webglTexture), oe(s, r), de(n.__webglFramebuffer, e, r, o.COLOR_ATTACHMENT0 + t, s, 0), w(r) && T(s);
|
|
10723
10809
|
}
|
|
10724
10810
|
c.unbindTexture();
|
|
10725
10811
|
} else {
|
|
10726
10812
|
let i = o.TEXTURE_2D;
|
|
10727
|
-
if ((e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (i = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(i, r.__webglTexture),
|
|
10813
|
+
if ((e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (i = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(i, r.__webglTexture), oe(i, t), t.mipmaps && t.mipmaps.length > 0) for (let r = 0; r < t.mipmaps.length; r++) de(n.__webglFramebuffer[r], e, t, o.COLOR_ATTACHMENT0, i, r);
|
|
10728
10814
|
else de(n.__webglFramebuffer, e, t, o.COLOR_ATTACHMENT0, i, 0);
|
|
10729
10815
|
w(t) && T(i), c.unbindTexture();
|
|
10730
10816
|
}
|
|
@@ -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 = ee, this.resetTextureUnits = I, this.setTexture2D = L, this.setTexture2DArray = ne, this.setTexture3D = re, this.setTextureCube =
|
|
10876
|
+
this.allocateTextureUnit = ee, this.resetTextureUnits = I, this.setTexture2D = L, this.setTexture2DArray = ne, this.setTexture3D = re, this.setTextureCube = ie, 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,10 +10997,10 @@ 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();
|
|
@@ -10946,7 +11032,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
10946
11032
|
}
|
|
10947
11033
|
P = null, F = null, b.reset();
|
|
10948
11034
|
for (let e in x) delete x[e];
|
|
10949
|
-
e.setRenderTarget(C), _ = null, g = null, h = null, r = null, w = null,
|
|
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
|
}
|
|
10951
11037
|
this.setFramebufferScaleFactor = function(e) {
|
|
10952
11038
|
i = e, n.isPresenting === !0 && console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.");
|
|
@@ -11001,7 +11087,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
11001
11087
|
resolveStencilBuffer: _.ignoreDepthValues === !1
|
|
11002
11088
|
});
|
|
11003
11089
|
}
|
|
11004
|
-
w.isXRRenderTarget = !0, this.setFoveation(l), p = null, a = await r.requestReferenceSpace(c),
|
|
11090
|
+
w.isXRRenderTarget = !0, this.setFoveation(l), p = null, a = await r.requestReferenceSpace(c), oe.setContext(r), oe.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
|
|
11005
11091
|
}
|
|
11006
11092
|
}, this.getEnvironmentBlendMode = function() {
|
|
11007
11093
|
if (r !== null) return r.environmentBlendMode;
|
|
@@ -11039,7 +11125,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
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 ie(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) {
|
|
@@ -11050,11 +11136,11 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
11050
11136
|
depthFar: N.far
|
|
11051
11137
|
}), P = N.near, F = 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 ? re(N, A, j) : N.projectionMatrix.copy(A.projectionMatrix),
|
|
11139
|
+
ie(N, i);
|
|
11140
|
+
for (let e = 0; e < a.length; e++) ie(a[e], i);
|
|
11141
|
+
a.length === 2 ? re(N, A, j) : N.projectionMatrix.copy(A.projectionMatrix), R(e, N, i);
|
|
11056
11142
|
};
|
|
11057
|
-
function
|
|
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);
|
|
11059
11145
|
}
|
|
11060
11146
|
this.getCamera = function() {
|
|
@@ -11070,8 +11156,8 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
11070
11156
|
}, this.getCameraTexture = function(e) {
|
|
11071
11157
|
return x[e];
|
|
11072
11158
|
};
|
|
11073
|
-
let
|
|
11074
|
-
function
|
|
11159
|
+
let z = null;
|
|
11160
|
+
function ae(t, i) {
|
|
11075
11161
|
if (m = i.getViewerPose(p || a), v = i, m !== null) {
|
|
11076
11162
|
let t = m.views;
|
|
11077
11163
|
_ !== null && (e.setRenderTargetFramebuffer(w, _.framebuffer), e.setRenderTarget(w));
|
|
@@ -11110,18 +11196,18 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
11110
11196
|
let t = E[e], n = T[e];
|
|
11111
11197
|
t !== null && n !== void 0 && n.update(t, i, p || a);
|
|
11112
11198
|
}
|
|
11113
|
-
|
|
11199
|
+
z && z(t, i), i.detectedPlanes && n.dispatchEvent({
|
|
11114
11200
|
type: "planesdetected",
|
|
11115
11201
|
data: i
|
|
11116
11202
|
}), v = null;
|
|
11117
11203
|
}
|
|
11118
|
-
let
|
|
11119
|
-
|
|
11120
|
-
|
|
11204
|
+
let oe = new Xa();
|
|
11205
|
+
oe.setAnimationLoop(ae), this.setAnimationLoop = function(e) {
|
|
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(), P = null, F = new X(0), I = 0, ee = t.width, te = t.height, L = 1, ne = null, re = null,
|
|
11369
|
+
let D = 0, O = 0, k = null, A = -1, j = null, M = new Ae(), N = new Ae(), P = null, F = new X(0), I = 0, ee = t.width, te = t.height, L = 1, ne = null, re = null, ie = new Ae(0, 0, ee, te), R = new Ae(0, 0, ee, te), z = !1, ae = new lr(), oe = !1, se = !1, ce = new ct(), le = new U(), B = new Ae(), ue = {
|
|
11284
11370
|
background: null,
|
|
11285
11371
|
fog: null,
|
|
11286
11372
|
environment: null,
|
|
@@ -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() {
|
|
@@ -11347,17 +11433,17 @@ var Zc = class {
|
|
|
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(ie);
|
|
11351
11437
|
}, this.setViewport = function(e, t, n, r) {
|
|
11352
|
-
e.isVector4 ?
|
|
11438
|
+
e.isVector4 ? ie.set(e.x, e.y, e.z, e.w) : ie.set(e, t, n, r), K.viewport(M.copy(ie).multiplyScalar(L).round());
|
|
11353
11439
|
}, this.getScissor = function(e) {
|
|
11354
|
-
return e.copy(
|
|
11440
|
+
return e.copy(R);
|
|
11355
11441
|
}, this.setScissor = function(e, t, n, r) {
|
|
11356
|
-
e.isVector4 ?
|
|
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(L).round());
|
|
11357
11443
|
}, this.getScissorTest = function() {
|
|
11358
|
-
return
|
|
11444
|
+
return z;
|
|
11359
11445
|
}, this.setScissorTest = function(e) {
|
|
11360
|
-
K.setScissorTest(
|
|
11446
|
+
K.setScissorTest(z = e);
|
|
11361
11447
|
}, this.setOpaqueSort = function(e) {
|
|
11362
11448
|
ne = e;
|
|
11363
11449
|
}, this.setTransparentSort = function(e) {
|
|
@@ -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) {
|
|
@@ -11505,13 +11591,13 @@ var Zc = class {
|
|
|
11505
11591
|
return;
|
|
11506
11592
|
}
|
|
11507
11593
|
if (E === !0) return;
|
|
11508
|
-
if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Re.enabled === !0 && Re.isPresenting === !0 && (Re.cameraAutoUpdate === !0 && Re.updateCamera(t), t = Re.getCamera()), e.isScene === !0 && e.onBeforeRender(T, e, t, k), x = Te.get(e, C.length), x.init(t), C.push(x),
|
|
11594
|
+
if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Re.enabled === !0 && Re.isPresenting === !0 && (Re.cameraAutoUpdate === !0 && Re.updateCamera(t), t = Re.getCamera()), e.isScene === !0 && e.onBeforeRender(T, e, t, k), x = Te.get(e, C.length), x.init(t), C.push(x), ce.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), ae.setFromProjectionMatrix(ce, w, t.reversedDepth), se = this.localClippingEnabled, oe = Ee.init(this.clippingPlanes, se), v = we.get(e, S.length), v.init(), S.push(v), Re.enabled === !0 && Re.isPresenting === !0) {
|
|
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(ne, re), de = Re.enabled === !1 || Re.isPresenting === !1 || Re.hasDepthSensing() === !1, de && Oe.addToRenderList(v, e), this.info.render.frame++,
|
|
11598
|
+
Ze(e, t, 0, T.sortObjects), v.finish(), T.sortObjects === !0 && v.sort(ne, re), 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
|
-
De.render(n, e, t),
|
|
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;
|
|
11516
11602
|
if (x.setupLights(), t.isArrayCamera) {
|
|
11517
11603
|
let n = t.cameras;
|
|
@@ -11525,7 +11611,7 @@ var Zc = class {
|
|
|
11525
11611
|
Qe(v, e, r, r.viewport);
|
|
11526
11612
|
}
|
|
11527
11613
|
} else i.length > 0 && $e(r, i, e, t), de && Oe.render(e), Qe(v, e, t);
|
|
11528
|
-
k !== null && O === 0 && (J.updateMultisampleRenderTarget(k), J.updateRenderTargetMipmap(k)), e.isScene === !0 && e.onAfterRender(T, e, t), Fe.resetDefaultState(), A = -1, j = null, C.pop(), C.length > 0 ? (x = C[C.length - 1],
|
|
11614
|
+
k !== null && O === 0 && (J.updateMultisampleRenderTarget(k), J.updateRenderTargetMipmap(k)), e.isScene === !0 && e.onAfterRender(T, e, t), Fe.resetDefaultState(), A = -1, j = null, C.pop(), C.length > 0 ? (x = C[C.length - 1], oe === !0 && Ee.setGlobalState(T.clippingPlanes, x.state.camera)) : x = null, S.pop(), v = S.length > 0 ? S[S.length - 1] : null;
|
|
11529
11615
|
};
|
|
11530
11616
|
function Ze(e, t, n, r) {
|
|
11531
11617
|
if (e.visible === !1) return;
|
|
@@ -11534,20 +11620,20 @@ var Zc = class {
|
|
|
11534
11620
|
else if (e.isLOD) e.autoUpdate === !0 && e.update(t);
|
|
11535
11621
|
else if (e.isLight) x.pushLight(e), e.castShadow && x.pushShadow(e);
|
|
11536
11622
|
else if (e.isSprite) {
|
|
11537
|
-
if (!e.frustumCulled ||
|
|
11538
|
-
r &&
|
|
11623
|
+
if (!e.frustumCulled || ae.intersectsSprite(e)) {
|
|
11624
|
+
r && B.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, B.z, null);
|
|
11541
11627
|
}
|
|
11542
|
-
} else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled ||
|
|
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(), B.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), B.copy(e.boundingSphere.center)), B.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, B.z, o);
|
|
11549
11635
|
}
|
|
11550
|
-
} else i.visible && v.push(e, t, i, n,
|
|
11636
|
+
} else i.visible && v.push(e, t, i, n, B.z, null);
|
|
11551
11637
|
}
|
|
11552
11638
|
}
|
|
11553
11639
|
let i = e.children;
|
|
@@ -11555,7 +11641,7 @@ var Zc = class {
|
|
|
11555
11641
|
}
|
|
11556
11642
|
function Qe(e, t, n, r) {
|
|
11557
11643
|
let i = e.opaque, a = e.transmissive, o = e.transparent;
|
|
11558
|
-
x.setupLightsView(n),
|
|
11644
|
+
x.setupLightsView(n), oe === !0 && Ee.setGlobalState(T.clippingPlanes, n), r && K.viewport(M.copy(r)), i.length > 0 && et(i, t, n), a.length > 0 && et(a, t, n), o.length > 0 && et(o, t, n), K.buffers.depth.setTest(!0), K.buffers.depth.setMask(!0), K.buffers.color.setMask(!0), K.setPolygonOffset(!1);
|
|
11559
11645
|
}
|
|
11560
11646
|
function $e(e, t, n, r) {
|
|
11561
11647
|
if ((n.isScene === !0 ? n.overrideMaterial : null) !== null) return;
|
|
@@ -11576,7 +11662,7 @@ var Zc = class {
|
|
|
11576
11662
|
let p = T.toneMapping;
|
|
11577
11663
|
T.toneMapping = 0;
|
|
11578
11664
|
let m = r.viewport;
|
|
11579
|
-
if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r),
|
|
11665
|
+
if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r), oe === !0 && Ee.setGlobalState(T.clippingPlanes, r), et(e, n, r), J.updateMultisampleRenderTarget(s), J.updateRenderTargetMipmap(s), W.has("WEBGL_multisampled_render_to_texture") === !1) {
|
|
11580
11666
|
let e = !1;
|
|
11581
11667
|
for (let i = 0, a = t.length; i < a; i++) {
|
|
11582
11668
|
let a = t[i], o = a.object, s = a.geometry, c = a.material, l = a.group;
|
|
@@ -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
|
}
|
|
@@ -11626,7 +11712,7 @@ var Zc = class {
|
|
|
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;
|
|
11629
|
-
if (
|
|
11715
|
+
if (oe === !0 && (se === !0 || e !== j)) {
|
|
11630
11716
|
let t = e === j && r.id === A;
|
|
11631
11717
|
Ee.setState(r, e, t);
|
|
11632
11718
|
}
|
|
@@ -11638,7 +11724,7 @@ var Zc = class {
|
|
|
11638
11724
|
if (K.useProgram(S.program) && (C = !0, w = !0, E = !0), r.id !== A && (A = r.id, w = !0), C || j !== e) {
|
|
11639
11725
|
K.buffers.depth.getReversed() && e.reversedDepth !== !0 && (e._reversedDepth = !0, e.updateProjectionMatrix()), D.setValue(H, "projectionMatrix", e.projectionMatrix), D.setValue(H, "viewMatrix", e.matrixWorldInverse);
|
|
11640
11726
|
let t = D.map.cameraPosition;
|
|
11641
|
-
t !== void 0 && t.setValue(H,
|
|
11727
|
+
t !== void 0 && t.setValue(H, le.setFromMatrixPosition(e.matrixWorld)), G.logarithmicDepthBuffer && D.setValue(H, "logDepthBufFC", 2 / (Math.log(e.far + 1) / Math.LN2)), (r.isMeshPhongMaterial || r.isMeshToonMaterial || r.isMeshLambertMaterial || r.isMeshBasicMaterial || r.isMeshStandardMaterial || r.isShaderMaterial) && D.setValue(H, "isOrthographic", e.isOrthographicCamera === !0), j !== e && (j = e, w = !0, E = !0);
|
|
11642
11728
|
}
|
|
11643
11729
|
if (i.isSkinnedMesh) {
|
|
11644
11730
|
D.setOptional(H, i, "bindMatrix"), D.setOptional(H, i, "bindMatrixInverse");
|
|
@@ -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, L, te, x.state.transmissionRenderTarget[e.id]),
|
|
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, L, te, 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];
|
|
@@ -11695,7 +11781,7 @@ var Zc = class {
|
|
|
11695
11781
|
(c.isData3DTexture || c.isDataArrayTexture || c.isCompressedArrayTexture) && (o = !0);
|
|
11696
11782
|
let l = q.get(e).__webglFramebuffer;
|
|
11697
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), P = e.scissorTest;
|
|
11698
|
-
} else M.copy(
|
|
11784
|
+
} else M.copy(ie).multiplyScalar(L).floor(), N.copy(R).multiplyScalar(L).floor(), P = z;
|
|
11699
11785
|
if (n !== 0 && (i = lt), K.bindFramebuffer(H.FRAMEBUFFER, i) && r && K.drawBuffers(e, i), K.viewport(M), K.scissor(N), K.setScissorTest(P), 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);
|
|
@@ -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.40",
|
|
11808
11894
|
description: "Reusable 3D conceptual atlas Web Component for LiquidCars-style models",
|
|
11809
11895
|
type: "module",
|
|
11810
11896
|
scripts: {
|
|
@@ -11838,80 +11924,154 @@ 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
|
|
11846
|
-
|
|
11930
|
+
}, tl = .05, nl = 15, rl = /* @__PURE__ */ new Map(), il = /* @__PURE__ */ new Map(), al = /* @__PURE__ */ new Map();
|
|
11931
|
+
function ol(e) {
|
|
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) => ({
|
|
11936
|
+
...e,
|
|
11937
|
+
name: String(e.name).trim()
|
|
11938
|
+
}));
|
|
11939
|
+
}
|
|
11940
|
+
function cl(e) {
|
|
11941
|
+
return [...new Set((e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => String(e || "").trim()).filter(Boolean))];
|
|
11942
|
+
}
|
|
11943
|
+
function ll(e) {
|
|
11944
|
+
return e ? typeof e == "string" ? { spdx: e } : ol(e) : null;
|
|
11945
|
+
}
|
|
11946
|
+
function ul(e, t) {
|
|
11947
|
+
let n = ol(e || {}), r = String(n.id || `source-${t + 1}`).trim();
|
|
11948
|
+
if (!r) throw TypeError("Geometry pack sources require an id.");
|
|
11847
11949
|
return {
|
|
11848
11950
|
...n,
|
|
11951
|
+
id: r,
|
|
11952
|
+
authors: sl(n.authors ?? n.author),
|
|
11953
|
+
license: ll(n.license)
|
|
11954
|
+
};
|
|
11955
|
+
}
|
|
11956
|
+
function dl(e, t, n) {
|
|
11957
|
+
let r = ol(e || {}), i = String(r.id || "").trim();
|
|
11958
|
+
if (!i) throw TypeError(`Geometry pack resource at index ${t} requires an id.`);
|
|
11959
|
+
let a = r.source == null ? null : String(r.source).trim();
|
|
11960
|
+
if (a && !n.has(a)) throw TypeError(`Geometry pack resource '${i}' references unknown source '${a}'.`);
|
|
11961
|
+
return {
|
|
11962
|
+
...r,
|
|
11963
|
+
id: i,
|
|
11964
|
+
kind: String(r.kind || r.type || "asset"),
|
|
11965
|
+
source: a,
|
|
11966
|
+
authors: sl(r.authors ?? r.author),
|
|
11967
|
+
license: ll(r.license)
|
|
11968
|
+
};
|
|
11969
|
+
}
|
|
11970
|
+
function fl(e, t) {
|
|
11971
|
+
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));
|
|
11972
|
+
if (new Set(i.map((e) => e.id)).size !== i.length) throw TypeError(`Geometry pack '${t}' contains duplicate resource ids.`);
|
|
11973
|
+
return {
|
|
11974
|
+
namespace: t,
|
|
11975
|
+
name: String(e.name || t),
|
|
11976
|
+
version: String(e.version || "0.0.0"),
|
|
11977
|
+
description: String(e.description || ""),
|
|
11978
|
+
category: String(e.category || e.name || t),
|
|
11979
|
+
homepage: e.homepage ? String(e.homepage) : "",
|
|
11980
|
+
repository: ol(e.repository || null),
|
|
11981
|
+
authors: sl(e.authors ?? e.author),
|
|
11982
|
+
license: ll(e.license),
|
|
11983
|
+
attribution: String(e.attribution || ""),
|
|
11984
|
+
collections: ol(Array.isArray(e.collections) ? e.collections : []),
|
|
11985
|
+
sources: n,
|
|
11986
|
+
resources: i,
|
|
11987
|
+
geometries: []
|
|
11988
|
+
};
|
|
11989
|
+
}
|
|
11990
|
+
function pl(e) {
|
|
11991
|
+
let { create: t, resourceMap: n, ...r } = e;
|
|
11992
|
+
return {
|
|
11993
|
+
...ol(r),
|
|
11849
11994
|
canonicalSize: [...e.canonicalSize],
|
|
11850
|
-
parameters:
|
|
11851
|
-
palette:
|
|
11852
|
-
anchors:
|
|
11995
|
+
parameters: ol(e.parameters),
|
|
11996
|
+
palette: ol(e.palette),
|
|
11997
|
+
anchors: ol(e.anchors)
|
|
11853
11998
|
};
|
|
11854
11999
|
}
|
|
11855
|
-
function
|
|
12000
|
+
function ml(e) {
|
|
12001
|
+
return ol(e);
|
|
12002
|
+
}
|
|
12003
|
+
function hl(e) {
|
|
11856
12004
|
if (!e || typeof e != "object") throw TypeError("A geometry pack must be an object.");
|
|
11857
12005
|
let t = String(e.namespace || "").trim();
|
|
11858
|
-
if (!/^[a-z][a-z0-9-]*$/i.test(t)) throw TypeError("A geometry pack requires a valid namespace.");
|
|
12006
|
+
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.");
|
|
11859
12007
|
if (!Array.isArray(e.geometries) || !e.geometries.length) throw TypeError("A geometry pack requires at least one geometry.");
|
|
11860
|
-
let n = [];
|
|
11861
|
-
for (let
|
|
11862
|
-
if (!
|
|
11863
|
-
let
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
12008
|
+
let n = fl(e, t), r = Object.freeze(Object.fromEntries(n.resources.map((e) => [e.id, Object.freeze(ol(e))]))), i = [];
|
|
12009
|
+
for (let a of e.geometries) {
|
|
12010
|
+
if (!a || typeof a != "object" || !a.id) throw TypeError(`Geometry pack '${t}' contains an invalid geometry.`);
|
|
12011
|
+
let o = String(a.id).includes(".") ? String(a.id).split(".").pop() : String(a.id), s = String(a.id).includes(".") ? String(a.id) : `${t}.${o}`;
|
|
12012
|
+
i.push({
|
|
12013
|
+
...a,
|
|
12014
|
+
id: s,
|
|
12015
|
+
localId: o,
|
|
11867
12016
|
namespace: t,
|
|
11868
|
-
pack:
|
|
11869
|
-
packVersion:
|
|
11870
|
-
category:
|
|
11871
|
-
|
|
12017
|
+
pack: n.name,
|
|
12018
|
+
packVersion: n.version,
|
|
12019
|
+
category: a.category || n.category,
|
|
12020
|
+
collection: a.collection == null ? "" : String(a.collection).trim(),
|
|
12021
|
+
tags: cl(a.tags),
|
|
12022
|
+
keywords: cl(a.keywords),
|
|
12023
|
+
canonicalSize: Array.isArray(a.canonicalSize) && a.canonicalSize.length === 3 ? a.canonicalSize.map(Number) : [
|
|
11872
12024
|
2.5,
|
|
11873
12025
|
1.5,
|
|
11874
12026
|
2.5
|
|
11875
12027
|
],
|
|
11876
|
-
parameters:
|
|
12028
|
+
parameters: a.parameters && typeof a.parameters == "object" ? a.parameters : {},
|
|
11877
12029
|
palette: {
|
|
11878
12030
|
...e.palette || {},
|
|
11879
|
-
...
|
|
12031
|
+
...a.palette || {}
|
|
11880
12032
|
},
|
|
11881
12033
|
anchors: {
|
|
11882
12034
|
...e.anchors || {},
|
|
11883
|
-
...
|
|
11884
|
-
}
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
for (let e of r.aliases || []) rl.set(String(e), a);
|
|
11888
|
-
n.push(a);
|
|
12035
|
+
...a.anchors || {}
|
|
12036
|
+
},
|
|
12037
|
+
resourceMap: r
|
|
12038
|
+
});
|
|
11889
12039
|
}
|
|
12040
|
+
gl(t);
|
|
12041
|
+
let a = [];
|
|
12042
|
+
for (let e of i) {
|
|
12043
|
+
rl.set(e.id, e), il.set(e.id, e.id);
|
|
12044
|
+
for (let t of e.aliases || []) il.set(String(t), e.id);
|
|
12045
|
+
a.push(e.id);
|
|
12046
|
+
}
|
|
12047
|
+
n.geometries = [...a], al.set(t, n);
|
|
12048
|
+
let o = ml(n);
|
|
11890
12049
|
return typeof globalThis.dispatchEvent == "function" && typeof CustomEvent == "function" && globalThis.dispatchEvent(new CustomEvent("lc-geometry-registry-change", { detail: {
|
|
11891
12050
|
namespace: t,
|
|
11892
|
-
geometries:
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
geometries: n
|
|
11896
|
-
};
|
|
12051
|
+
geometries: a,
|
|
12052
|
+
pack: o
|
|
12053
|
+
} })), o;
|
|
11897
12054
|
}
|
|
11898
|
-
function
|
|
12055
|
+
function gl(e) {
|
|
11899
12056
|
let t = [];
|
|
11900
|
-
for (let [n, r] of
|
|
11901
|
-
for (let [e, n] of
|
|
11902
|
-
return t;
|
|
12057
|
+
for (let [n, r] of rl) r.namespace === e && (rl.delete(n), t.push(n));
|
|
12058
|
+
for (let [e, n] of il) t.includes(n) && il.delete(e);
|
|
12059
|
+
return al.delete(e), t;
|
|
11903
12060
|
}
|
|
11904
|
-
function
|
|
11905
|
-
return [...
|
|
12061
|
+
function _l() {
|
|
12062
|
+
return [...rl.values()].map(pl);
|
|
11906
12063
|
}
|
|
11907
|
-
function
|
|
11908
|
-
|
|
11909
|
-
return nl.get(t) || null;
|
|
12064
|
+
function vl() {
|
|
12065
|
+
return [...al.values()].map(ml);
|
|
11910
12066
|
}
|
|
11911
|
-
function
|
|
12067
|
+
function yl(e) {
|
|
12068
|
+
let t = il.get(e) || e;
|
|
12069
|
+
return rl.get(t) || null;
|
|
12070
|
+
}
|
|
12071
|
+
function bl(e) {
|
|
11912
12072
|
return e === "container" || e === "shell";
|
|
11913
12073
|
}
|
|
11914
|
-
function
|
|
12074
|
+
function xl(e = {}) {
|
|
11915
12075
|
let t = e && typeof e == "object" ? e : {}, n = Number(t.opacity);
|
|
11916
12076
|
return {
|
|
11917
12077
|
mode: t.mode === "connected" ? "connected" : "all",
|
|
@@ -11920,24 +12080,34 @@ function ul(e = {}) {
|
|
|
11920
12080
|
opacity: Number.isFinite(n) ? Math.max(.02, Math.min(.8, n)) : .12
|
|
11921
12081
|
};
|
|
11922
12082
|
}
|
|
11923
|
-
function
|
|
12083
|
+
function Sl(e) {
|
|
11924
12084
|
return [
|
|
11925
12085
|
"preserve",
|
|
11926
12086
|
"center",
|
|
11927
12087
|
"fit"
|
|
11928
12088
|
].includes(e) ? e : "preserve";
|
|
11929
12089
|
}
|
|
11930
|
-
function
|
|
12090
|
+
function Cl(e) {
|
|
11931
12091
|
return e === "model" ? "model" : "camera";
|
|
11932
12092
|
}
|
|
11933
|
-
function
|
|
12093
|
+
function wl(e, t) {
|
|
11934
12094
|
e && e.transparent !== t && (e.transparent = t, e.needsUpdate = !0);
|
|
11935
12095
|
}
|
|
11936
|
-
|
|
12096
|
+
hl({
|
|
11937
12097
|
namespace: "geo",
|
|
11938
12098
|
name: "Geometric primitives",
|
|
11939
12099
|
version: "1",
|
|
12100
|
+
description: "Built-in Atlas geometric primitives.",
|
|
11940
12101
|
category: "Geometric primitives",
|
|
12102
|
+
authors: [{
|
|
12103
|
+
name: "LiquidCars S.L.",
|
|
12104
|
+
url: "https://liquidcars.net"
|
|
12105
|
+
}],
|
|
12106
|
+
license: {
|
|
12107
|
+
spdx: "MIT",
|
|
12108
|
+
url: "https://opensource.org/license/mit"
|
|
12109
|
+
},
|
|
12110
|
+
homepage: "https://github.com/gaelibus/atlas",
|
|
11941
12111
|
geometries: [
|
|
11942
12112
|
"box",
|
|
11943
12113
|
"cylinder",
|
|
@@ -11980,7 +12150,7 @@ al({
|
|
|
11980
12150
|
} } : {}
|
|
11981
12151
|
}))
|
|
11982
12152
|
});
|
|
11983
|
-
var
|
|
12153
|
+
var Tl = {
|
|
11984
12154
|
background: {
|
|
11985
12155
|
color: "#0a111a",
|
|
11986
12156
|
glow: "#1c2b39",
|
|
@@ -12025,17 +12195,17 @@ var ml = {
|
|
|
12025
12195
|
hint: !0
|
|
12026
12196
|
}
|
|
12027
12197
|
};
|
|
12028
|
-
function
|
|
12198
|
+
function El(e, t) {
|
|
12029
12199
|
let n = { ...e };
|
|
12030
12200
|
if (!t || typeof t != "object") return n;
|
|
12031
|
-
for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ?
|
|
12201
|
+
for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ? El(e?.[r] || {}, i) : i;
|
|
12032
12202
|
return n;
|
|
12033
12203
|
}
|
|
12034
|
-
function
|
|
12204
|
+
function Dl(e) {
|
|
12035
12205
|
let t = e && typeof e == "object" ? { ...e } : {};
|
|
12036
|
-
return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }),
|
|
12206
|
+
return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }), El(Tl, t);
|
|
12037
12207
|
}
|
|
12038
|
-
function
|
|
12208
|
+
function Ol(e) {
|
|
12039
12209
|
if (!e || typeof e != "object") return "directed";
|
|
12040
12210
|
let t = String(e.mode || e.visual || e.render || e.type || e.direction || "").trim().toLowerCase().replace(/[_\s]+/g, "-");
|
|
12041
12211
|
return e.bidirectional === !0 || [
|
|
@@ -12050,7 +12220,7 @@ function _l(e) {
|
|
|
12050
12220
|
"failed"
|
|
12051
12221
|
].includes(t) ? "broken" : "directed";
|
|
12052
12222
|
}
|
|
12053
|
-
var
|
|
12223
|
+
var kl = [":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(""), Al = ".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}}", jl = [
|
|
12054
12224
|
".viewport>.atlas-print-snapshot{display:none!important}",
|
|
12055
12225
|
"@media print{",
|
|
12056
12226
|
":host{-webkit-print-color-adjust:exact;print-color-adjust:exact;break-inside:avoid;page-break-inside:avoid}",
|
|
@@ -12059,17 +12229,17 @@ var vl = [":host{display:block;position:relative;height:var(--lc-height,680px);m
|
|
|
12059
12229
|
":host([data-lc-print-ready]) .viewport>canvas:not(.atlas-print-snapshot){display:none!important}",
|
|
12060
12230
|
":host([data-lc-print-ready]) .viewport>.atlas-print-snapshot{display:block!important;width:100%;height:100%}",
|
|
12061
12231
|
"}"
|
|
12062
|
-
].join(""),
|
|
12063
|
-
minus:
|
|
12064
|
-
plus:
|
|
12065
|
-
fit:
|
|
12066
|
-
front:
|
|
12067
|
-
view:
|
|
12068
|
-
relations:
|
|
12069
|
-
focus:
|
|
12070
|
-
chevron:
|
|
12071
|
-
},
|
|
12072
|
-
function
|
|
12232
|
+
].join(""), Ml = (e, t = "0 0 24 24") => `<svg viewBox="${t}" aria-hidden="true">${e}</svg>`, Nl = {
|
|
12233
|
+
minus: Ml("<path d=\"M6 12h12\"/>"),
|
|
12234
|
+
plus: Ml("<path d=\"M12 6v12M6 12h12\"/>"),
|
|
12235
|
+
fit: Ml("<path d=\"M9 4H4v5M15 4h5v5M20 15v5h-5M4 15v5h5\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
|
|
12236
|
+
front: Ml("<rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"1.5\"/><path d=\"M8 16h8\"/>"),
|
|
12237
|
+
view: Ml("<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\"/>"),
|
|
12238
|
+
relations: Ml("<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\"/>"),
|
|
12239
|
+
focus: Ml("<circle cx=\"12\" cy=\"12\" r=\"7\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3\"/>"),
|
|
12240
|
+
chevron: Ml("<path d=\"m8 10 4 4 4-4\"/>")
|
|
12241
|
+
}, Pl = (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>`, Fl = (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>${Nl.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, Il = `<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">${Nl.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Acercar" title="Acercar">${Nl.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Encuadrar todo el modelo" title="Encuadrar todo el modelo">${Nl.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Vista frontal" title="Vista frontal">${Nl.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${Fl("view", Nl.view, "Vista", "Vista", Pl("labels", "Etiquetas", !0) + Pl("panel", "Información", !0) + Pl("item-facing", "Caras a cámara", !0) + "<div class=\"toolbar-option-separator\"></div>" + Pl("open-all", "Abrir todos") + Pl("close-all", "Cerrar todos"))}</div><div class="toolbar-group" data-toolbar-group="relations">${Fl("relations", Nl.relations, "Relaciones", "Selección", Pl("relations-all", "Todas") + Pl("relations-selected", "Selección", !0) + Pl("relations-none", "Ocultar"))}</div><div class="toolbar-group" data-toolbar-group="focus">${Fl("focus", Nl.focus, "Foco", "Todo", Pl("focus-all", "Todo", !0) + Pl("focus-dim", "Conectados") + Pl("focus-hide", "Aislar") + "<div class=\"toolbar-option-separator\"></div>" + Pl("focus-selection", "Enfocar selección") + Pl("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>`;
|
|
12242
|
+
function Ll(e) {
|
|
12073
12243
|
return String(e ?? "").replace(/[&<>"']/g, (e) => ({
|
|
12074
12244
|
"&": "&",
|
|
12075
12245
|
"<": "<",
|
|
@@ -12078,17 +12248,17 @@ function El(e) {
|
|
|
12078
12248
|
"'": "'"
|
|
12079
12249
|
})[e]);
|
|
12080
12250
|
}
|
|
12081
|
-
function
|
|
12251
|
+
function Rl(e) {
|
|
12082
12252
|
let t = String(e ?? "").trim();
|
|
12083
12253
|
if (!t) return "";
|
|
12084
12254
|
try {
|
|
12085
12255
|
let e = new URL(t, globalThis.location?.href);
|
|
12086
|
-
return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" +
|
|
12256
|
+
return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" + Ll(e.href) + "\" target=\"_blank\" rel=\"noopener noreferrer\">Open documentation ↗</a>" : "";
|
|
12087
12257
|
} catch {
|
|
12088
12258
|
return "";
|
|
12089
12259
|
}
|
|
12090
12260
|
}
|
|
12091
|
-
function
|
|
12261
|
+
function zl(e) {
|
|
12092
12262
|
let t = e && typeof e == "object" ? e : {}, n = Array.isArray(t.entities) ? t.entities.map((e) => ({
|
|
12093
12263
|
...e,
|
|
12094
12264
|
p: Array.isArray(e.p) ? e.p : [
|
|
@@ -12105,28 +12275,28 @@ function Ol(e) {
|
|
|
12105
12275
|
from: e[0],
|
|
12106
12276
|
to: e[1],
|
|
12107
12277
|
label: e[2] || "",
|
|
12108
|
-
mode:
|
|
12278
|
+
mode: Ol({ mode: e[3] }),
|
|
12109
12279
|
index: t
|
|
12110
12280
|
} : {
|
|
12111
12281
|
...e,
|
|
12112
12282
|
from: e.from,
|
|
12113
12283
|
to: e.to,
|
|
12114
12284
|
label: e.label || "",
|
|
12115
|
-
mode:
|
|
12285
|
+
mode: Ol(e),
|
|
12116
12286
|
index: t
|
|
12117
12287
|
}) : [];
|
|
12118
12288
|
return {
|
|
12119
12289
|
...t,
|
|
12120
12290
|
palette: {
|
|
12121
|
-
|
|
12291
|
+
...el,
|
|
12122
12292
|
...t.palette || {}
|
|
12123
12293
|
},
|
|
12124
|
-
theme:
|
|
12294
|
+
theme: Dl(t.theme || t.styles),
|
|
12125
12295
|
entities: n,
|
|
12126
12296
|
relations: r
|
|
12127
12297
|
};
|
|
12128
12298
|
}
|
|
12129
|
-
function
|
|
12299
|
+
function Bl(e, t, n = [
|
|
12130
12300
|
1,
|
|
12131
12301
|
1,
|
|
12132
12302
|
1
|
|
@@ -12145,7 +12315,7 @@ function kl(e, t, n = [
|
|
|
12145
12315
|
});
|
|
12146
12316
|
return s.center(), s;
|
|
12147
12317
|
}
|
|
12148
|
-
function
|
|
12318
|
+
function Vl(e, t, n) {
|
|
12149
12319
|
let r = new ui();
|
|
12150
12320
|
for (let t = 0; t < e; t++) {
|
|
12151
12321
|
let n = Math.PI / 2 + t * Math.PI * 2 / e, i = new V(Math.cos(n) * .5, Math.sin(n) * .5);
|
|
@@ -12162,7 +12332,7 @@ function Al(e, t, n) {
|
|
|
12162
12332
|
});
|
|
12163
12333
|
return i.rotateX(Math.PI / 2), i.center(), i;
|
|
12164
12334
|
}
|
|
12165
|
-
function
|
|
12335
|
+
function Hl(e, t, n, r) {
|
|
12166
12336
|
let i = Math.min(.22, Math.max(0, Number(n) || 0));
|
|
12167
12337
|
if (!i) return new Er(t, e, 1, 32);
|
|
12168
12338
|
let a = [new V(0, -.5)];
|
|
@@ -12179,7 +12349,7 @@ function jl(e, t, n, r) {
|
|
|
12179
12349
|
}
|
|
12180
12350
|
return a.push(new V(0, .5)), new Qi(a, 32);
|
|
12181
12351
|
}
|
|
12182
|
-
function
|
|
12352
|
+
function Ul(e, t) {
|
|
12183
12353
|
if (!t) return e;
|
|
12184
12354
|
let n = Math.min(.72, Math.max(0, Number(t) * 3)), r = e.attributes.position;
|
|
12185
12355
|
for (let e = 0; e < r.count; e++) {
|
|
@@ -12188,36 +12358,36 @@ function Ml(e, t) {
|
|
|
12188
12358
|
}
|
|
12189
12359
|
return r.needsUpdate = !0, e.computeVertexNormals(), e;
|
|
12190
12360
|
}
|
|
12191
|
-
function
|
|
12361
|
+
function Wl(e, t = 0, n = 4, r = [
|
|
12192
12362
|
1,
|
|
12193
12363
|
1,
|
|
12194
12364
|
1
|
|
12195
12365
|
]) {
|
|
12196
12366
|
let i = Number(t) || 0, a = Math.max(2, Math.round(Number(n) || 4));
|
|
12197
12367
|
switch (e) {
|
|
12198
|
-
case "cylinder": return i ?
|
|
12199
|
-
case "cone": return i ?
|
|
12368
|
+
case "cylinder": return i ? Hl(.5, .5, i, a) : new Er(.5, .5, 1, 32);
|
|
12369
|
+
case "cone": return i ? Hl(0, .5, i, a) : new Dr(.5, 1, 32);
|
|
12200
12370
|
case "frustum-cone":
|
|
12201
|
-
case "truncated-cone": return i ?
|
|
12371
|
+
case "truncated-cone": return i ? Hl(.28, .5, i, a) : new Er(.28, .5, 1, 32);
|
|
12202
12372
|
case "frustum-pyramid":
|
|
12203
12373
|
case "truncated-pyramid": return new Er(.28, .5, 1, 4);
|
|
12204
12374
|
case "frustum-triangle": return new Er(.28, .5, 1, 3);
|
|
12205
|
-
case "prism": return i ?
|
|
12206
|
-
case "pyramid-square": return i ?
|
|
12207
|
-
case "pyramid-triangle": return i ?
|
|
12375
|
+
case "prism": return i ? Vl(6, i, a) : new Er(.5, .5, 1, 6);
|
|
12376
|
+
case "pyramid-square": return i ? Ul(new Dr(.5, 1, 4), i) : new Dr(.5, 1, 4);
|
|
12377
|
+
case "pyramid-triangle": return i ? Ul(new Dr(.5, 1, 3), i) : new Dr(.5, 1, 3);
|
|
12208
12378
|
case "sphere": return new ta(.5, 24, 16);
|
|
12209
|
-
case "octahedron": return
|
|
12210
|
-
case "dodecahedron": return
|
|
12211
|
-
case "icosahedron": return
|
|
12212
|
-
default: return i ?
|
|
12379
|
+
case "octahedron": return Ul(new $i(.5), i);
|
|
12380
|
+
case "dodecahedron": return Ul(new kr(.5), i);
|
|
12381
|
+
case "icosahedron": return Ul(new Zi(.5), i);
|
|
12382
|
+
default: return i ? Bl(i, a, r) : new Nn(1, 1, 1);
|
|
12213
12383
|
}
|
|
12214
12384
|
}
|
|
12215
|
-
function
|
|
12385
|
+
function Gl(e) {
|
|
12216
12386
|
e.computeBoundingBox();
|
|
12217
12387
|
let t = e.boundingBox?.getSize(new U());
|
|
12218
12388
|
return !t || !t.x || !t.y || !t.z ? e : (e.scale(1 / t.x, 1 / t.y, 1 / t.z), e.computeBoundingBox(), e);
|
|
12219
12389
|
}
|
|
12220
|
-
function
|
|
12390
|
+
function Kl(e, t) {
|
|
12221
12391
|
let n = e.geometryOptions || e.geometry_options || e.parameters || {}, r = {};
|
|
12222
12392
|
for (let [e, n] of Object.entries(t?.parameters || {})) n && Object.hasOwn(n, "default") && (r[e] = n.default);
|
|
12223
12393
|
return {
|
|
@@ -12225,10 +12395,10 @@ function Fl(e, t) {
|
|
|
12225
12395
|
...n && typeof n == "object" ? n : {}
|
|
12226
12396
|
};
|
|
12227
12397
|
}
|
|
12228
|
-
function
|
|
12398
|
+
function ql(e, t, n) {
|
|
12229
12399
|
return typeof e != "string" || !e ? n : t[e] || e;
|
|
12230
12400
|
}
|
|
12231
|
-
function
|
|
12401
|
+
function Jl(e, t = "#ffffff", n = "transparent") {
|
|
12232
12402
|
let r = document.createElement("canvas");
|
|
12233
12403
|
r.width = 256, r.height = 256;
|
|
12234
12404
|
let i = r.getContext("2d");
|
|
@@ -12236,43 +12406,136 @@ function Ll(e, t = "#ffffff", n = "transparent") {
|
|
|
12236
12406
|
let a = new Cr(r);
|
|
12237
12407
|
return a.colorSpace = y, a;
|
|
12238
12408
|
}
|
|
12239
|
-
|
|
12240
|
-
|
|
12409
|
+
var Yl = /^[AaCcHhLlMmQqSsTtVvZz]$/, Xl = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?|[AaCcHhLlMmQqSsTtVvZz]/g;
|
|
12410
|
+
function Zl(e, t, n, r, i, a, o, s, c) {
|
|
12411
|
+
let l = Math.abs(Number(n)), u = Math.abs(Number(r));
|
|
12412
|
+
if (!l || !u || e === s && t === c) return [[s, c]];
|
|
12413
|
+
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)));
|
|
12414
|
+
l *= v, u *= v;
|
|
12415
|
+
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) => {
|
|
12416
|
+
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)));
|
|
12417
|
+
return e * r - t * n < 0 ? -a : a;
|
|
12418
|
+
}, 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);
|
|
12419
|
+
!o && M > 0 && (M -= Math.PI * 2), o && M < 0 && (M += Math.PI * 2);
|
|
12420
|
+
let N = Math.max(6, Math.ceil(Math.abs(M) / (Math.PI / 12)));
|
|
12421
|
+
return Array.from({ length: N }, (e, t) => {
|
|
12422
|
+
let n = j + M * (t + 1) / N, r = Math.cos(n), i = Math.sin(n);
|
|
12423
|
+
return [w + f * l * r - p * u * i, T + p * l * r + f * u * i];
|
|
12424
|
+
});
|
|
12425
|
+
}
|
|
12426
|
+
function Ql(e) {
|
|
12427
|
+
let t = String(e || "").match(Xl) || [], 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 && !Yl.test(t[r]), h = () => Number(t[r++]), g = () => {
|
|
12428
|
+
let e = t[r];
|
|
12429
|
+
return /^[01].+/.test(e) ? (t[r] = e.slice(1), e[0] === "1") : h() !== 0;
|
|
12430
|
+
}, _ = (e, t, n) => [n ? o + e : e, n ? s + t : t];
|
|
12431
|
+
for (; r < t.length && (Yl.test(t[r]) && (i = t[r++]), i);) {
|
|
12432
|
+
let e = i.toLowerCase(), t = i === e;
|
|
12433
|
+
if (e === "z") {
|
|
12434
|
+
n.currentPath?.closePath(), o = c, s = l, a = i, i = "";
|
|
12435
|
+
continue;
|
|
12436
|
+
}
|
|
12437
|
+
if (!m()) break;
|
|
12438
|
+
if (e === "m") {
|
|
12439
|
+
let e = !0;
|
|
12440
|
+
for (; m();) {
|
|
12441
|
+
let [r, i] = _(h(), h(), t);
|
|
12442
|
+
o = r, s = i, e ? (n.moveTo(o, -s), c = o, l = s, e = !1) : n.lineTo(o, -s);
|
|
12443
|
+
}
|
|
12444
|
+
} else if (e === "l") for (; m();) [o, s] = _(h(), h(), t), n.lineTo(o, -s);
|
|
12445
|
+
else if (e === "h") for (; m();) {
|
|
12446
|
+
let e = h();
|
|
12447
|
+
o = t ? o + e : e, n.lineTo(o, -s);
|
|
12448
|
+
}
|
|
12449
|
+
else if (e === "v") for (; m();) {
|
|
12450
|
+
let e = h();
|
|
12451
|
+
s = t ? s + e : e, n.lineTo(o, -s);
|
|
12452
|
+
}
|
|
12453
|
+
else if (e === "c") for (; m();) {
|
|
12454
|
+
let [e, r] = _(h(), h(), t), [c, l] = _(h(), h(), t), [f, p] = _(h(), h(), t);
|
|
12455
|
+
n.currentPath?.bezierCurveTo(e, -r, c, -l, f, -p), o = f, s = p, u = c, d = l, a = i;
|
|
12456
|
+
}
|
|
12457
|
+
else if (e === "s") for (; m();) {
|
|
12458
|
+
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);
|
|
12459
|
+
n.currentPath?.bezierCurveTo(e, -r, c, -l, f, -p), o = f, s = p, u = c, d = l, a = i;
|
|
12460
|
+
}
|
|
12461
|
+
else if (e === "q") for (; m();) {
|
|
12462
|
+
let [e, r] = _(h(), h(), t), [c, l] = _(h(), h(), t);
|
|
12463
|
+
n.currentPath?.quadraticCurveTo(e, -r, c, -l), o = c, s = l, f = e, p = r, a = i;
|
|
12464
|
+
}
|
|
12465
|
+
else if (e === "t") for (; m();) {
|
|
12466
|
+
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);
|
|
12467
|
+
n.currentPath?.quadraticCurveTo(e, -r, c, -l), o = c, s = l, f = e, p = r, a = i;
|
|
12468
|
+
}
|
|
12469
|
+
else if (e === "a") for (; m();) {
|
|
12470
|
+
let e = h(), r = h(), c = h(), l = g(), u = g(), [d, f] = _(h(), h(), t);
|
|
12471
|
+
for (let [t, i] of Zl(o, s, e, r, c, l, u, d, f)) n.lineTo(t, -i);
|
|
12472
|
+
o = d, s = f, a = i;
|
|
12473
|
+
}
|
|
12474
|
+
else break;
|
|
12475
|
+
a = i;
|
|
12476
|
+
}
|
|
12477
|
+
return n;
|
|
12478
|
+
}
|
|
12479
|
+
function $l(e, t = {}) {
|
|
12480
|
+
let n = String(e || "").match(/<path\b[^>]*>/gi) || [], r = [];
|
|
12481
|
+
for (let e of n) {
|
|
12482
|
+
let t = e.match(/\bd\s*=\s*(["'])([\s\S]*?)\1/i);
|
|
12483
|
+
if (!t) continue;
|
|
12484
|
+
let n = Ql(t[2]);
|
|
12485
|
+
r.push(...n.toShapes(!0, !1));
|
|
12486
|
+
}
|
|
12487
|
+
if (!r.length) return new Nn(1, 1, .12);
|
|
12488
|
+
let i = Math.max(0, Math.min(.2, Number(t.bevel) || .055)), a = new Ji(r, {
|
|
12489
|
+
depth: 1,
|
|
12490
|
+
steps: 1,
|
|
12491
|
+
curveSegments: Math.max(2, Math.round(Number(t.curveSegments) || 8)),
|
|
12492
|
+
bevelEnabled: i > 0,
|
|
12493
|
+
bevelSegments: Math.max(1, Math.round(Number(t.bevelSegments) || 2)),
|
|
12494
|
+
bevelSize: i,
|
|
12495
|
+
bevelThickness: i
|
|
12496
|
+
});
|
|
12497
|
+
return a.center(), a;
|
|
12241
12498
|
}
|
|
12242
|
-
function
|
|
12243
|
-
|
|
12499
|
+
function eu(e) {
|
|
12500
|
+
return e.shape === "plane" ? new ea(1, 1) : e.shape === "svg-extrude" ? $l(e.svg, e) : Wl(e.shape || e.geometry || "box", e.radius, e.segments, e.size);
|
|
12501
|
+
}
|
|
12502
|
+
function tu(e, t, n, r, i) {
|
|
12503
|
+
let a = Kl(t, e), o = {
|
|
12244
12504
|
...n,
|
|
12245
12505
|
...e.palette || {},
|
|
12246
12506
|
...t.geometryPalette || t.geometry_palette || {}
|
|
12247
12507
|
}, s = typeof e.create == "function" ? e.create({
|
|
12248
12508
|
parameters: { ...a },
|
|
12249
12509
|
colors: { ...o },
|
|
12250
|
-
entity: { ...t }
|
|
12510
|
+
entity: { ...t },
|
|
12511
|
+
resources: e.resourceMap || {}
|
|
12251
12512
|
}) : { parts: e.parts || [] };
|
|
12252
12513
|
Array.isArray(s) && (s = { parts: s });
|
|
12253
12514
|
let c = Array.isArray(s?.parts) ? s.parts : [];
|
|
12254
12515
|
if (!c.length) throw Error(`Geometry '${e.id}' did not produce any parts.`);
|
|
12255
12516
|
let l = new Qn(), u = [], d = [];
|
|
12256
12517
|
for (let a of c) {
|
|
12257
|
-
let s =
|
|
12258
|
-
|
|
12259
|
-
let c = a.color || "component", f =
|
|
12518
|
+
let s = eu(a);
|
|
12519
|
+
Gl(s);
|
|
12520
|
+
let c = a.color || "component", f = ql(c, o, n.component || el.component), p = a.emissive || "#000000", m = new ia({
|
|
12260
12521
|
color: f,
|
|
12522
|
+
emissive: ql(p, o, "#000000"),
|
|
12523
|
+
emissiveIntensity: Number.isFinite(Number(a.emissiveIntensity)) ? Math.max(0, Number(a.emissiveIntensity)) : 0,
|
|
12261
12524
|
roughness: Number.isFinite(Number(a.roughness)) ? Number(a.roughness) : .72,
|
|
12262
12525
|
metalness: Number.isFinite(Number(a.metalness)) ? Number(a.metalness) : .06,
|
|
12263
12526
|
transparent: a.transparent === !0 || Number(a.opacity) < 1,
|
|
12264
12527
|
opacity: Number.isFinite(Number(a.opacity)) ? Number(a.opacity) : 1,
|
|
12265
12528
|
side: a.doubleSided ? 2 : 0
|
|
12266
|
-
}),
|
|
12267
|
-
if (typeof
|
|
12529
|
+
}), h, g = a.icon, _ = a.image;
|
|
12530
|
+
if (typeof _ == "string" && _) {
|
|
12268
12531
|
let n = new Image();
|
|
12269
|
-
n.crossOrigin = "anonymous",
|
|
12270
|
-
let o = !1, s = null, c = /^\s*<svg(?:\s|>)/i.test(
|
|
12532
|
+
n.crossOrigin = "anonymous", m.map = new ke(n);
|
|
12533
|
+
let o = !1, s = null, c = /^\s*<svg(?:\s|>)/i.test(_) || /^data:image\/svg\+xml/i.test(_) || /\.svg(?:[?#]|$)/i.test(_), l = new AbortController(), u = () => {
|
|
12271
12534
|
s &&= (URL.revokeObjectURL(s), null);
|
|
12272
12535
|
}, d = () => {
|
|
12273
|
-
n.removeEventListener("load", f), n.removeEventListener("error",
|
|
12536
|
+
n.removeEventListener("load", f), n.removeEventListener("error", p);
|
|
12274
12537
|
}, f = () => {
|
|
12275
|
-
if (d(), o || !
|
|
12538
|
+
if (d(), o || !m.map) {
|
|
12276
12539
|
u();
|
|
12277
12540
|
return;
|
|
12278
12541
|
}
|
|
@@ -12281,64 +12544,65 @@ function zl(e, t, n, r, i) {
|
|
|
12281
12544
|
r.width = e >= 1 ? t : Math.max(1, Math.round(t * e)), r.height = e >= 1 ? Math.max(1, Math.round(t / e)) : t;
|
|
12282
12545
|
let i = r.getContext("2d");
|
|
12283
12546
|
if (!i) throw Error("Canvas 2D is unavailable");
|
|
12284
|
-
i.clearRect(0, 0, r.width, r.height), i.drawImage(n, 0, 0, r.width, r.height),
|
|
12547
|
+
i.clearRect(0, 0, r.width, r.height), i.drawImage(n, 0, 0, r.width, r.height), m.map.image = r;
|
|
12285
12548
|
} catch (n) {
|
|
12286
12549
|
i?.({
|
|
12287
12550
|
code: "SVG_RASTERIZE_FAILED",
|
|
12288
12551
|
geometry: e.id,
|
|
12289
12552
|
entityId: t.id,
|
|
12290
|
-
image:
|
|
12553
|
+
image: _,
|
|
12291
12554
|
error: n
|
|
12292
12555
|
});
|
|
12293
12556
|
}
|
|
12294
12557
|
u();
|
|
12295
|
-
let s = a.imageFit || a.fit || "stretch", l = n.naturalWidth / Math.max(1, n.naturalHeight), f = Math.abs(Number(a.size?.[0])) || 1,
|
|
12296
|
-
s === "cover" ? l >
|
|
12297
|
-
},
|
|
12558
|
+
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;
|
|
12559
|
+
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?.();
|
|
12560
|
+
}, p = () => {
|
|
12298
12561
|
d(), u(), o || (i?.({
|
|
12299
12562
|
code: "IMAGE_LOAD_FAILED",
|
|
12300
12563
|
geometry: e.id,
|
|
12301
12564
|
entityId: t.id,
|
|
12302
|
-
image:
|
|
12565
|
+
image: _
|
|
12303
12566
|
}), r?.());
|
|
12304
12567
|
};
|
|
12305
|
-
|
|
12568
|
+
m.userData.atlasImageCleanup = () => {
|
|
12306
12569
|
o = !0, l.abort(), d(), u(), n.src = "";
|
|
12307
|
-
}, n.addEventListener("load", f), n.addEventListener("error",
|
|
12308
|
-
if (/^\s*<svg(?:\s|>)/i.test(
|
|
12309
|
-
s = URL.createObjectURL(new Blob([
|
|
12570
|
+
}, n.addEventListener("load", f), n.addEventListener("error", p), (async () => {
|
|
12571
|
+
if (/^\s*<svg(?:\s|>)/i.test(_)) {
|
|
12572
|
+
s = URL.createObjectURL(new Blob([_], { type: "image/svg+xml" })), n.src = s;
|
|
12310
12573
|
return;
|
|
12311
12574
|
}
|
|
12312
|
-
if (/^(?:data|blob):/i.test(
|
|
12313
|
-
n.src =
|
|
12575
|
+
if (/^(?:data|blob):/i.test(_)) {
|
|
12576
|
+
n.src = _;
|
|
12314
12577
|
return;
|
|
12315
12578
|
}
|
|
12316
12579
|
try {
|
|
12317
|
-
let e = await fetch(
|
|
12580
|
+
let e = await fetch(_, {
|
|
12318
12581
|
mode: "cors",
|
|
12319
12582
|
signal: l.signal
|
|
12320
12583
|
});
|
|
12321
12584
|
if (!e.ok) throw Error(`Image request failed with ${e.status}`);
|
|
12322
|
-
let t = await e.blob(), r = e.headers.get("content-type") || t.type, i = /image\/svg\+xml/i.test(r) || /\.svg(?:[?#]|$)/i.test(
|
|
12585
|
+
let t = await e.blob(), r = e.headers.get("content-type") || t.type, i = /image\/svg\+xml/i.test(r) || /\.svg(?:[?#]|$)/i.test(_);
|
|
12323
12586
|
if (c ||= i, i && t.type !== "image/svg+xml" && (t = new Blob([await t.text()], { type: "image/svg+xml" })), o) return;
|
|
12324
12587
|
s = URL.createObjectURL(t), n.src = s;
|
|
12325
12588
|
} catch (e) {
|
|
12326
12589
|
if (o || e?.name === "AbortError") return;
|
|
12327
|
-
n.src =
|
|
12590
|
+
n.src = _;
|
|
12328
12591
|
}
|
|
12329
|
-
})(),
|
|
12330
|
-
} else
|
|
12331
|
-
if (
|
|
12592
|
+
})(), m.map.colorSpace = y, m.needsUpdate = !0;
|
|
12593
|
+
} else g != null && g !== "" && (m.map = Jl(g, ql(a.iconColor || "#ffffff", o, "#ffffff"), ql(a.iconBackground || "transparent", o, "transparent")), m.transparent = !0, m.needsUpdate = !0);
|
|
12594
|
+
if (h = new An(s, m), h.position.fromArray(Array.isArray(a.position) ? a.position : [
|
|
12332
12595
|
0,
|
|
12333
12596
|
0,
|
|
12334
12597
|
0
|
|
12335
|
-
]),
|
|
12598
|
+
]), h.scale.fromArray(Array.isArray(a.size) ? a.size : [
|
|
12336
12599
|
1,
|
|
12337
12600
|
1,
|
|
12338
12601
|
1
|
|
12339
|
-
]), Array.isArray(a.rotation) &&
|
|
12340
|
-
material:
|
|
12602
|
+
]), Array.isArray(a.rotation) && h.rotation.set(...a.rotation.map(Number)), l.add(h), d.push(h), u.push({
|
|
12603
|
+
material: m,
|
|
12341
12604
|
value: c,
|
|
12605
|
+
emissiveValue: p,
|
|
12342
12606
|
palette: o
|
|
12343
12607
|
}), a.edges !== !1 && a.shape !== "plane") {
|
|
12344
12608
|
let e = new ur({
|
|
@@ -12346,7 +12610,7 @@ function zl(e, t, n, r, i) {
|
|
|
12346
12610
|
transparent: !0,
|
|
12347
12611
|
opacity: Number.isFinite(Number(a.edgeOpacity)) ? Number(a.edgeOpacity) : .55
|
|
12348
12612
|
}), t = new Sr(new Pr(s, 22), e);
|
|
12349
|
-
t.position.copy(
|
|
12613
|
+
t.position.copy(h.position), t.rotation.copy(h.rotation), t.scale.copy(h.scale), l.add(t), u.push({
|
|
12350
12614
|
material: e,
|
|
12351
12615
|
value: a.edgeColor || c,
|
|
12352
12616
|
palette: o
|
|
@@ -12363,7 +12627,7 @@ function zl(e, t, n, r, i) {
|
|
|
12363
12627
|
descriptor: s
|
|
12364
12628
|
};
|
|
12365
12629
|
}
|
|
12366
|
-
function
|
|
12630
|
+
function nu(e, t, n, r = "", i = !0) {
|
|
12367
12631
|
let a = document.createElement("canvas"), o = a.getContext("2d"), s = n.x * .88, c = Math.min(.82, n.y * .64);
|
|
12368
12632
|
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);
|
|
12369
12633
|
let l = a.height * .62;
|
|
@@ -12400,7 +12664,7 @@ function Bl(e, t, n, r = "", i = !0) {
|
|
|
12400
12664
|
let C = new An(b, v);
|
|
12401
12665
|
C.rotation.y = Math.PI, C.position.set(0, n.y / 2 - .09 - c / 2, -n.z / 2 - .012);
|
|
12402
12666
|
let w = new An(b, v.clone());
|
|
12403
|
-
w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible =
|
|
12667
|
+
w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible = bl(r), x.add(S, C, w);
|
|
12404
12668
|
for (let e of [
|
|
12405
12669
|
S,
|
|
12406
12670
|
C,
|
|
@@ -12408,7 +12672,7 @@ function Bl(e, t, n, r = "", i = !0) {
|
|
|
12408
12672
|
]) e.renderOrder = 20, e.frustumCulled = !1, e.material.depthTest = !0, e.material.depthWrite = !1, e.material.transparent = !0;
|
|
12409
12673
|
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;
|
|
12410
12674
|
}
|
|
12411
|
-
function
|
|
12675
|
+
function ru(e, t, n, r = globalThis.document) {
|
|
12412
12676
|
if (!e || !t || !n || !r?.createElement) return null;
|
|
12413
12677
|
try {
|
|
12414
12678
|
e.render(t, n);
|
|
@@ -12430,8 +12694,8 @@ function Vl(e, t, n, r = globalThis.document) {
|
|
|
12430
12694
|
return null;
|
|
12431
12695
|
}
|
|
12432
12696
|
}
|
|
12433
|
-
var
|
|
12434
|
-
static version =
|
|
12697
|
+
var iu = class extends HTMLElement {
|
|
12698
|
+
static version = $c;
|
|
12435
12699
|
static get observedAttributes() {
|
|
12436
12700
|
return [
|
|
12437
12701
|
"height",
|
|
@@ -12448,20 +12712,23 @@ var Hl = class extends HTMLElement {
|
|
|
12448
12712
|
];
|
|
12449
12713
|
}
|
|
12450
12714
|
static registerGeometryPack(e) {
|
|
12451
|
-
return
|
|
12715
|
+
return hl(e);
|
|
12452
12716
|
}
|
|
12453
12717
|
static unregisterGeometryPack(e) {
|
|
12454
|
-
return
|
|
12718
|
+
return gl(e);
|
|
12455
12719
|
}
|
|
12456
12720
|
static getGeometryCatalog() {
|
|
12457
|
-
return
|
|
12721
|
+
return _l();
|
|
12722
|
+
}
|
|
12723
|
+
static getGeometryPackCatalog() {
|
|
12724
|
+
return vl();
|
|
12458
12725
|
}
|
|
12459
12726
|
constructor() {
|
|
12460
|
-
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" +
|
|
12727
|
+
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" + kl + Al + jl + "</style>" + Il, 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 = Dl(), this.relationMode = this.getAttribute("relation-mode") || "selected", this.focusFilter = xl({
|
|
12461
12728
|
mode: this.getAttribute("focus-mode"),
|
|
12462
12729
|
effect: this.getAttribute("focus-effect"),
|
|
12463
12730
|
layout: this.getAttribute("focus-layout")
|
|
12464
|
-
}), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation =
|
|
12731
|
+
}), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation = Sl(this.getAttribute("selection-navigation")), this.itemFacing = Cl(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 = () => {
|
|
12465
12732
|
this.ready && this.modelData && this._build();
|
|
12466
12733
|
}, this._bindControls(), this._syncFocusToolbar(), this._syncRelationToolbar(), this._syncLabelsToolbar(), this._syncPanelToolbar(), this._syncItemFacingToolbar(), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(this.canvas);
|
|
12467
12734
|
}
|
|
@@ -12473,7 +12740,7 @@ var Hl = class extends HTMLElement {
|
|
|
12473
12740
|
}
|
|
12474
12741
|
attributeChangedCallback(e, t, n) {
|
|
12475
12742
|
if (t !== n) {
|
|
12476
|
-
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" &&
|
|
12743
|
+
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" && Cl(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) {
|
|
12477
12744
|
let e = n !== "false";
|
|
12478
12745
|
e !== this.showShellLabels && (this.showShellLabels = e, this._build({
|
|
12479
12746
|
preserveSelection: this.selected?.id,
|
|
@@ -12510,13 +12777,13 @@ var Hl = class extends HTMLElement {
|
|
|
12510
12777
|
} : null;
|
|
12511
12778
|
}
|
|
12512
12779
|
get palette() {
|
|
12513
|
-
return this.modelData?.palette || {
|
|
12780
|
+
return this.modelData?.palette || { ...el };
|
|
12514
12781
|
}
|
|
12515
12782
|
set palette(e) {
|
|
12516
12783
|
this.setPalette(e);
|
|
12517
12784
|
}
|
|
12518
12785
|
captureFrame() {
|
|
12519
|
-
return
|
|
12786
|
+
return ru(this.renderer, this.scene, this.camera, this.ownerDocument);
|
|
12520
12787
|
}
|
|
12521
12788
|
prepareForPrint() {
|
|
12522
12789
|
if (this._printState) return this;
|
|
@@ -12621,13 +12888,13 @@ var Hl = class extends HTMLElement {
|
|
|
12621
12888
|
if (!e.size) return null;
|
|
12622
12889
|
for (let t of [...e]) {
|
|
12623
12890
|
let n = this.nodes.get(t);
|
|
12624
|
-
n &&
|
|
12891
|
+
n && bl(n.type) && this._descendantIds(t, e);
|
|
12625
12892
|
}
|
|
12626
12893
|
let t = new Set(e);
|
|
12627
12894
|
for (let n of this.relations) (t.has(n.from) || t.has(n.to)) && (e.add(n.from), e.add(n.to));
|
|
12628
12895
|
for (let t of [...e]) {
|
|
12629
12896
|
let n = this.nodes.get(t);
|
|
12630
|
-
n &&
|
|
12897
|
+
n && bl(n.type) && this._descendantIds(t, e);
|
|
12631
12898
|
}
|
|
12632
12899
|
for (let t of [...e]) {
|
|
12633
12900
|
let n = this.nodes.get(t)?.parent ? this.nodes.get(this.nodes.get(t).parent) : null;
|
|
@@ -12704,7 +12971,7 @@ var Hl = class extends HTMLElement {
|
|
|
12704
12971
|
});
|
|
12705
12972
|
}
|
|
12706
12973
|
setFocusFilter(e = {}, t = {}) {
|
|
12707
|
-
let n =
|
|
12974
|
+
let n = xl({
|
|
12708
12975
|
...this.focusFilter,
|
|
12709
12976
|
...e || {}
|
|
12710
12977
|
}), r = JSON.stringify(n) !== JSON.stringify(this.focusFilter);
|
|
@@ -12722,7 +12989,7 @@ var Hl = class extends HTMLElement {
|
|
|
12722
12989
|
"none"
|
|
12723
12990
|
].includes(e.relationMode) && e.relationMode !== this.relationMode && this.setRelationMode(e.relationMode), Object.hasOwn(e, "selectionMode") && e.selectionMode !== this.selectionMode && this.setSelectionMode(e.selectionMode);
|
|
12724
12991
|
let t = e.navigation?.onSelect ?? e.selectionNavigation;
|
|
12725
|
-
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") &&
|
|
12992
|
+
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") && Cl(e.itemFacing) !== this.itemFacing && this.setItemFacing(e.itemFacing, {
|
|
12726
12993
|
emit: !1,
|
|
12727
12994
|
source: "model"
|
|
12728
12995
|
}), e.focus && this.setFocusFilter(e.focus, { emit: !1 }), this;
|
|
@@ -12735,10 +13002,10 @@ var Hl = class extends HTMLElement {
|
|
|
12735
13002
|
}));
|
|
12736
13003
|
}
|
|
12737
13004
|
_containerEntityIds() {
|
|
12738
|
-
return (this.modelData?.entities || []).filter((e) =>
|
|
13005
|
+
return (this.modelData?.entities || []).filter((e) => bl(e.type)).map((e) => e.id);
|
|
12739
13006
|
}
|
|
12740
13007
|
_declaredOpenContainerIds() {
|
|
12741
|
-
return (this.modelData?.entities || []).filter((e) =>
|
|
13008
|
+
return (this.modelData?.entities || []).filter((e) => bl(e.type) && e.open === !0).map((e) => e.id);
|
|
12742
13009
|
}
|
|
12743
13010
|
_emitContainerStateChange(e, t = {}) {
|
|
12744
13011
|
if (!e?.changed || t.emit === !1) return;
|
|
@@ -12796,7 +13063,7 @@ var Hl = class extends HTMLElement {
|
|
|
12796
13063
|
}
|
|
12797
13064
|
_commitModelChange(e, t = {}, n = {}) {
|
|
12798
13065
|
let r = n.preserveSelection === !1 ? null : this.selected?.id, i = n.preserveSelection === !1 ? null : this._publicRelation(this.selectedRelationIndex), a = i?.id ?? i?.index ?? null;
|
|
12799
|
-
this.modelData =
|
|
13066
|
+
this.modelData = zl(this.modelData);
|
|
12800
13067
|
let o = this._syncInitialContainerState({
|
|
12801
13068
|
refresh: !1,
|
|
12802
13069
|
emit: !1,
|
|
@@ -12813,7 +13080,7 @@ var Hl = class extends HTMLElement {
|
|
|
12813
13080
|
}
|
|
12814
13081
|
updateModel(e = {}, t = {}) {
|
|
12815
13082
|
if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("El parche del modelo debe ser un objeto.");
|
|
12816
|
-
let n = this.modelData ||
|
|
13083
|
+
let n = this.modelData || zl({}), r = JSON.stringify(n.render?.camera || null), i = {
|
|
12817
13084
|
...n,
|
|
12818
13085
|
...e,
|
|
12819
13086
|
palette: e.palette ? {
|
|
@@ -12824,11 +13091,11 @@ var Hl = class extends HTMLElement {
|
|
|
12824
13091
|
entities: Array.isArray(e.entities) ? e.entities : n.entities,
|
|
12825
13092
|
relations: Array.isArray(e.relations) ? e.relations : n.relations
|
|
12826
13093
|
};
|
|
12827
|
-
return this.modelData =
|
|
13094
|
+
return this.modelData = zl(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;
|
|
12828
13095
|
}
|
|
12829
13096
|
addEntity(e, t = {}) {
|
|
12830
13097
|
if (!e || typeof e != "object" || !e.id) throw TypeError("La entidad debe incluir un id.");
|
|
12831
|
-
if (this.modelData ||=
|
|
13098
|
+
if (this.modelData ||= zl({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`Ya existe una entidad con id "${e.id}".`);
|
|
12832
13099
|
if (e.parent && !this.modelData.entities.some((t) => t.id === e.parent)) throw Error(`No existe el contenedor padre "${e.parent}".`);
|
|
12833
13100
|
return this.modelData.entities = [...this.modelData.entities, { ...e }], this._commitModelChange("entity-add", { entity: this._publicEntity(e.id) }, t);
|
|
12834
13101
|
}
|
|
@@ -12905,10 +13172,10 @@ var Hl = class extends HTMLElement {
|
|
|
12905
13172
|
return this.targetZoom = Math.min(2.8, this.targetZoom * 1.18), this.invalidate(), this;
|
|
12906
13173
|
}
|
|
12907
13174
|
zoomOut() {
|
|
12908
|
-
return this.targetZoom = Math.max(
|
|
13175
|
+
return this.targetZoom = Math.max(tl, this.targetZoom / 1.18), this.invalidate(), this;
|
|
12909
13176
|
}
|
|
12910
13177
|
setSelectionNavigation(e) {
|
|
12911
|
-
let t =
|
|
13178
|
+
let t = Sl(e);
|
|
12912
13179
|
return this.selectionNavigation = t, this.getAttribute("selection-navigation") !== t && this.setAttribute("selection-navigation", t), this;
|
|
12913
13180
|
}
|
|
12914
13181
|
focusSelection(e = {}) {
|
|
@@ -12921,7 +13188,7 @@ var Hl = class extends HTMLElement {
|
|
|
12921
13188
|
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;
|
|
12922
13189
|
}
|
|
12923
13190
|
_applySelectionNavigation(e = this.selectionNavigation) {
|
|
12924
|
-
let t =
|
|
13191
|
+
let t = Sl(e);
|
|
12925
13192
|
if (t === "preserve") return this;
|
|
12926
13193
|
let n = this.targetZoom;
|
|
12927
13194
|
return this.focusSelection(), t === "center" && (this.targetZoom = n), this;
|
|
@@ -12946,7 +13213,7 @@ var Hl = class extends HTMLElement {
|
|
|
12946
13213
|
return Math.max(29, 39.5 / Math.max(this.camera.aspect, .5));
|
|
12947
13214
|
}
|
|
12948
13215
|
getCameraView() {
|
|
12949
|
-
let e = this.focus.clone(), t = this._baseCameraDistance() / Math.max(
|
|
13216
|
+
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)));
|
|
12950
13217
|
return {
|
|
12951
13218
|
position: r(n.toArray()),
|
|
12952
13219
|
target: r(e.toArray()),
|
|
@@ -12960,7 +13227,7 @@ var Hl = class extends HTMLElement {
|
|
|
12960
13227
|
if (!(a > 1e-6)) return this;
|
|
12961
13228
|
this.yaw = Math.atan2(i.x, i.z), this.pitch = Math.asin(Math.max(-1, Math.min(1, i.y / a)));
|
|
12962
13229
|
let o = Number(e.zoom), s = Number.isFinite(o) && o > 0 ? o : this._baseCameraDistance() / a;
|
|
12963
|
-
return this.targetFocus.copy(r), this.targetZoom = Math.max(
|
|
13230
|
+
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;
|
|
12964
13231
|
}
|
|
12965
13232
|
restoreInitialCamera(e = {}) {
|
|
12966
13233
|
let t = this.modelData?.render?.camera;
|
|
@@ -12970,14 +13237,14 @@ var Hl = class extends HTMLElement {
|
|
|
12970
13237
|
let n = this.canvas.getBoundingClientRect(), r = 2 * Math.max(1, this.camera.position.distanceTo(this.focus)) * Math.tan(de.degToRad(this.camera.fov) / 2) / Math.max(1, n.height);
|
|
12971
13238
|
return this.panBy(-e * r, t * r);
|
|
12972
13239
|
}
|
|
12973
|
-
fit() {
|
|
12974
|
-
let
|
|
12975
|
-
for (let
|
|
12976
|
-
let n = this._worldPosition(
|
|
12977
|
-
|
|
13240
|
+
fit(e = {}) {
|
|
13241
|
+
let t = new Fe();
|
|
13242
|
+
for (let e of this.nodes.values()) {
|
|
13243
|
+
let n = this._worldPosition(e), r = new U(e.s[0] / 2, e.s[1] / 2, e.s[2] / 2);
|
|
13244
|
+
t.expandByPoint(n.clone().sub(r)), t.expandByPoint(n.clone().add(r));
|
|
12978
13245
|
}
|
|
12979
|
-
let
|
|
12980
|
-
return this.targetZoom = Math.max(
|
|
13246
|
+
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();
|
|
13247
|
+
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;
|
|
12981
13248
|
}
|
|
12982
13249
|
frontView() {
|
|
12983
13250
|
return this.yaw = 0, this.pitch = 0, this.invalidate(), this;
|
|
@@ -12993,7 +13260,7 @@ var Hl = class extends HTMLElement {
|
|
|
12993
13260
|
return this.setShellLabels(!this.showShellLabels);
|
|
12994
13261
|
}
|
|
12995
13262
|
setItemFacing(e = "camera", t = {}) {
|
|
12996
|
-
let n =
|
|
13263
|
+
let n = Cl(e), r = n !== this.itemFacing;
|
|
12997
13264
|
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", {
|
|
12998
13265
|
mode: n,
|
|
12999
13266
|
source: t.source || "api"
|
|
@@ -13003,7 +13270,7 @@ var Hl = class extends HTMLElement {
|
|
|
13003
13270
|
return this.setItemFacing(this.itemFacing === "camera" ? "model" : "camera", e);
|
|
13004
13271
|
}
|
|
13005
13272
|
_applyItemFacing() {
|
|
13006
|
-
if (this.camera) for (let e of this.nodes.values()) e.group && !
|
|
13273
|
+
if (this.camera) for (let e of this.nodes.values()) e.group && !bl(e.type) && (this.itemFacing === "camera" ? e.group.quaternion.copy(this.camera.quaternion) : e.group.quaternion.identity());
|
|
13007
13274
|
}
|
|
13008
13275
|
isContainerOpen(e) {
|
|
13009
13276
|
return this._containerEntityIds().includes(e) && this.open.has(e);
|
|
@@ -13018,14 +13285,14 @@ var Hl = class extends HTMLElement {
|
|
|
13018
13285
|
setContainerOpen(e, t = !0, n = {}) {
|
|
13019
13286
|
let r = this.modelData?.entities?.find((t) => t.id === e);
|
|
13020
13287
|
if (!r) throw Error(`No existe una entidad con id "${e}".`);
|
|
13021
|
-
if (!
|
|
13288
|
+
if (!bl(r.type)) throw TypeError(`La entidad "${e}" no es un contenedor.`);
|
|
13022
13289
|
let i = new Set(this.open);
|
|
13023
13290
|
if (t) i.add(e);
|
|
13024
13291
|
else if (i.delete(e), n.closeDescendants !== !1) for (let t of this.modelData.entities) {
|
|
13025
13292
|
let n = t.parent, r = /* @__PURE__ */ new Set();
|
|
13026
13293
|
for (; n && !r.has(n);) {
|
|
13027
13294
|
if (r.add(n), n === e) {
|
|
13028
|
-
|
|
13295
|
+
bl(t.type) && i.delete(t.id);
|
|
13029
13296
|
break;
|
|
13030
13297
|
}
|
|
13031
13298
|
n = this.modelData.entities.find((e) => e.id === n)?.parent || null;
|
|
@@ -13062,13 +13329,13 @@ var Hl = class extends HTMLElement {
|
|
|
13062
13329
|
this.setTheme(e);
|
|
13063
13330
|
}
|
|
13064
13331
|
get theme() {
|
|
13065
|
-
return this._theme ||
|
|
13332
|
+
return this._theme || Dl();
|
|
13066
13333
|
}
|
|
13067
13334
|
set theme(e) {
|
|
13068
|
-
this._theme =
|
|
13335
|
+
this._theme = Dl(e), this.shadowRoot && this._applyTheme();
|
|
13069
13336
|
}
|
|
13070
13337
|
setTheme(e = {}) {
|
|
13071
|
-
return this.theme =
|
|
13338
|
+
return this.theme = El(this.theme, e), this.modelData && (this.modelData.theme = this.theme), this._applyLighting(), this.invalidate(), this;
|
|
13072
13339
|
}
|
|
13073
13340
|
_applyTheme() {
|
|
13074
13341
|
let e = this.theme, t = this.style;
|
|
@@ -13085,7 +13352,7 @@ var Hl = class extends HTMLElement {
|
|
|
13085
13352
|
if (e) return this.load(e);
|
|
13086
13353
|
let t = this.querySelector("script[type=\"application/json\"]");
|
|
13087
13354
|
if (!t) return this.load({
|
|
13088
|
-
palette:
|
|
13355
|
+
palette: el,
|
|
13089
13356
|
entities: [],
|
|
13090
13357
|
relations: []
|
|
13091
13358
|
});
|
|
@@ -13099,7 +13366,7 @@ var Hl = class extends HTMLElement {
|
|
|
13099
13366
|
this._loading = !0, this._pendingSelection = null;
|
|
13100
13367
|
try {
|
|
13101
13368
|
let t = typeof e == "string" ? await fetch(e).then((e) => e.json()) : e;
|
|
13102
|
-
this.modelData =
|
|
13369
|
+
this.modelData = zl(t), this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this._initialOpenContainers.clear(), this._pendingPalette &&= (this.modelData.palette = {
|
|
13103
13370
|
...this.modelData.palette,
|
|
13104
13371
|
...this._pendingPalette
|
|
13105
13372
|
}, null), this.theme = this.modelData.theme, this._applyTheme(), this._syncInitialContainerState({
|
|
@@ -13118,7 +13385,7 @@ var Hl = class extends HTMLElement {
|
|
|
13118
13385
|
_ensureRenderer() {
|
|
13119
13386
|
if (this.renderer) return !0;
|
|
13120
13387
|
try {
|
|
13121
|
-
return this.renderer = new
|
|
13388
|
+
return this.renderer = new Qc({
|
|
13122
13389
|
canvas: this.canvas,
|
|
13123
13390
|
antialias: !0,
|
|
13124
13391
|
alpha: !0,
|
|
@@ -13130,9 +13397,9 @@ var Hl = class extends HTMLElement {
|
|
|
13130
13397
|
}
|
|
13131
13398
|
_applyLighting() {
|
|
13132
13399
|
if (!this.ambientLight || !this.directionalLight) return;
|
|
13133
|
-
let e = this.theme?.lighting ||
|
|
13400
|
+
let e = this.theme?.lighting || Tl.lighting;
|
|
13134
13401
|
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;
|
|
13135
|
-
let t = Array.isArray(e.directionalPosition) ? e.directionalPosition :
|
|
13402
|
+
let t = Array.isArray(e.directionalPosition) ? e.directionalPosition : Tl.lighting.directionalPosition;
|
|
13136
13403
|
this.directionalLight.position.fromArray(t);
|
|
13137
13404
|
}
|
|
13138
13405
|
_worldPosition(e, t = /* @__PURE__ */ new Set()) {
|
|
@@ -13169,7 +13436,7 @@ var Hl = class extends HTMLElement {
|
|
|
13169
13436
|
...e.geometryPalette || {},
|
|
13170
13437
|
...e.geometryPaletteOverrides || {}
|
|
13171
13438
|
};
|
|
13172
|
-
n.material.color.set(
|
|
13439
|
+
n.material.color.set(ql(n.value, r, t)), n.material.emissive && n.emissiveValue && n.material.emissive.set(ql(n.emissiveValue, r, "#000000"));
|
|
13173
13440
|
}
|
|
13174
13441
|
}
|
|
13175
13442
|
}
|
|
@@ -13182,19 +13449,19 @@ var Hl = class extends HTMLElement {
|
|
|
13182
13449
|
for (let e of this.modelData.entities) {
|
|
13183
13450
|
let t = this.nodes.get(e.id);
|
|
13184
13451
|
t.group = new Qn(), t.group.position.copy(this._worldPosition(t));
|
|
13185
|
-
let n = e.geometry || "box", r =
|
|
13452
|
+
let n = e.geometry || "box", r = yl(n), i = !r && n.includes("."), a = i ? "#ed8f98" : this.modelData.palette[e.c] || e.c || this.modelData.palette.component;
|
|
13186
13453
|
i && this.dispatchEvent(new CustomEvent("lc-warning", { detail: {
|
|
13187
13454
|
code: "GEOMETRY_NOT_REGISTERED",
|
|
13188
13455
|
geometry: n,
|
|
13189
13456
|
entityId: e.id
|
|
13190
13457
|
} }));
|
|
13191
|
-
let o = r?.primitive || n, s = r && !r.primitive && !
|
|
13458
|
+
let o = r?.primitive || n, s = r && !r.primitive && !bl(e.type);
|
|
13192
13459
|
if (t.geometryDefinition = r || null, t.geometryMissing = i, t.geometryPalette = r?.palette || {}, t.geometryPaletteOverrides = e.geometryPalette || e.geometry_palette || {}, t.ports = {
|
|
13193
13460
|
...r?.anchors || {},
|
|
13194
13461
|
...e.ports || {}
|
|
13195
13462
|
}, s) {
|
|
13196
13463
|
try {
|
|
13197
|
-
let n =
|
|
13464
|
+
let n = tu(r, e, this.modelData.palette, () => this.invalidate(), (e) => this.dispatchEvent(new CustomEvent("lc-warning", { detail: e })));
|
|
13198
13465
|
n.root.scale.multiply(new U().fromArray(e.s)), t.appearanceMaterials = [], n.root.traverse((e) => {
|
|
13199
13466
|
if (!(e.isMesh || e.isLine || e.isLineSegments || e.isSprite)) return;
|
|
13200
13467
|
e.userData.node = t;
|
|
@@ -13215,7 +13482,7 @@ var Hl = class extends HTMLElement {
|
|
|
13215
13482
|
entityId: e.id,
|
|
13216
13483
|
error: r
|
|
13217
13484
|
} }));
|
|
13218
|
-
let i =
|
|
13485
|
+
let i = Gl(Wl("box"));
|
|
13219
13486
|
t.material = new ia({
|
|
13220
13487
|
color: "#ed8f98",
|
|
13221
13488
|
roughness: .72,
|
|
@@ -13224,13 +13491,13 @@ var Hl = class extends HTMLElement {
|
|
|
13224
13491
|
}
|
|
13225
13492
|
t.labelSize = new U().fromArray(e.s);
|
|
13226
13493
|
} else {
|
|
13227
|
-
let n = o === "box" && Number(e.radius) > 0, r =
|
|
13228
|
-
n ||
|
|
13494
|
+
let n = o === "box" && Number(e.radius) > 0, r = Wl(o, e.radius, e.segments, e.s);
|
|
13495
|
+
n || Gl(r), t.material = new ia({
|
|
13229
13496
|
color: a,
|
|
13230
13497
|
roughness: .72,
|
|
13231
13498
|
metalness: .06,
|
|
13232
13499
|
transparent: !0,
|
|
13233
|
-
opacity:
|
|
13500
|
+
opacity: bl(e.type) ? .96 : 1
|
|
13234
13501
|
}), t.mesh = new An(r, t.material), t.mesh.scale.fromArray(n ? [
|
|
13235
13502
|
1,
|
|
13236
13503
|
1,
|
|
@@ -13245,7 +13512,7 @@ var Hl = class extends HTMLElement {
|
|
|
13245
13512
|
1
|
|
13246
13513
|
] : e.s), t.group.add(t.edge);
|
|
13247
13514
|
}
|
|
13248
|
-
t.label =
|
|
13515
|
+
t.label = nu(e.name, a, t.labelSize, e.type, this.showShellLabels), t.label.userData.node = t, t.label.traverse((e) => {
|
|
13249
13516
|
e.userData.node = t;
|
|
13250
13517
|
}), t.group.add(t.label), this.scene.add(t.group);
|
|
13251
13518
|
}
|
|
@@ -13284,7 +13551,7 @@ var Hl = class extends HTMLElement {
|
|
|
13284
13551
|
}
|
|
13285
13552
|
_rebuildRelations() {
|
|
13286
13553
|
this._clearRelationGroup();
|
|
13287
|
-
let e = this._activeRelationIndexes(), t = this._focusedEntityIds(), n = new X(this.modelData?.palette.connection ||
|
|
13554
|
+
let e = this._activeRelationIndexes(), t = this._focusedEntityIds(), n = new X(this.modelData?.palette.connection || el.connection);
|
|
13288
13555
|
for (let r of e) {
|
|
13289
13556
|
let e = this.relations[r], i = this.nodes.get(e.from), a = this.nodes.get(e.to);
|
|
13290
13557
|
if (!i || !a) continue;
|
|
@@ -13292,7 +13559,7 @@ var Hl = class extends HTMLElement {
|
|
|
13292
13559
|
if (!o && this.focusFilter.effect === "hide") continue;
|
|
13293
13560
|
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);
|
|
13294
13561
|
if (u.lengthSq() < .01) continue;
|
|
13295
|
-
let d =
|
|
13562
|
+
let d = Ol(e), f = r === this.selectedRelationIndex, p = (e, t = .055, n = .88) => {
|
|
13296
13563
|
let r = new rn({
|
|
13297
13564
|
color: e,
|
|
13298
13565
|
transparent: !0,
|
|
@@ -13302,7 +13569,7 @@ var Hl = class extends HTMLElement {
|
|
|
13302
13569
|
});
|
|
13303
13570
|
f && (r.color.lerp(new X(16777215), .28), r.opacity = 1);
|
|
13304
13571
|
let i = new An(new ra(new ri(c, l), 10, f ? t * 1.45 : t, 6, !1), r);
|
|
13305
|
-
return i.renderOrder =
|
|
13572
|
+
return i.renderOrder = nl, this.relationGroup.add(i), i;
|
|
13306
13573
|
}, m = new An(new ra(new ri(c, l), 10, .16, 6, !1), new rn({
|
|
13307
13574
|
transparent: !0,
|
|
13308
13575
|
opacity: 0,
|
|
@@ -13321,7 +13588,7 @@ var Hl = class extends HTMLElement {
|
|
|
13321
13588
|
opacity: (f ? 1 : .9) * s,
|
|
13322
13589
|
depthWrite: !1
|
|
13323
13590
|
}));
|
|
13324
|
-
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 =
|
|
13591
|
+
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);
|
|
13325
13592
|
}
|
|
13326
13593
|
continue;
|
|
13327
13594
|
}
|
|
@@ -13334,7 +13601,7 @@ var Hl = class extends HTMLElement {
|
|
|
13334
13601
|
opacity: (f ? 1 : .9) * s,
|
|
13335
13602
|
depthWrite: !1
|
|
13336
13603
|
}));
|
|
13337
|
-
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 =
|
|
13604
|
+
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);
|
|
13338
13605
|
}
|
|
13339
13606
|
}
|
|
13340
13607
|
}
|
|
@@ -13342,8 +13609,8 @@ var Hl = class extends HTMLElement {
|
|
|
13342
13609
|
if (!this.modelData) return;
|
|
13343
13610
|
let e = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex];
|
|
13344
13611
|
if (e) {
|
|
13345
|
-
let t =
|
|
13346
|
-
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>" +
|
|
13612
|
+
let t = Ol(e), n = e.text ? "<p>" + Ll(e.text) + "</p>" : "", r = Rl(e.url);
|
|
13613
|
+
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>" + Ll(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + Ll(e.from) + " → " + Ll(e.to) + "</div>" + n + r + "<h3>MODO</h3><p>" + Ll(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();
|
|
13347
13614
|
return;
|
|
13348
13615
|
}
|
|
13349
13616
|
let t = this.selected;
|
|
@@ -13353,11 +13620,11 @@ var Hl = class extends HTMLElement {
|
|
|
13353
13620
|
}
|
|
13354
13621
|
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;
|
|
13355
13622
|
for (; o && !a.has(o.id);) a.add(o.id), i.unshift(o), o = o.parent ? this.nodes.get(o.parent) : null;
|
|
13356
|
-
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=\"" +
|
|
13357
|
-
let n = this.relations.indexOf(e), r = e.text ? "<small>" +
|
|
13358
|
-
return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" +
|
|
13623
|
+
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=\"" + Ll(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + Ll(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
|
|
13624
|
+
let n = this.relations.indexOf(e), r = e.text ? "<small>" + Ll(e.text) + "</small>" : "";
|
|
13625
|
+
return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + Ll(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + Ll(e.from) + " → " + Ll(e.to) + "</small>" + r + "</button>";
|
|
13359
13626
|
}).join("");
|
|
13360
|
-
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\">" +
|
|
13627
|
+
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\">" + Ll(bl(t.type) ? "CONTENEDOR" : t.type === "actor" ? "ACTOR EXTERNO" : "COMPONENTE") + "</div><h2>" + Ll(t.name) + "</h2><div class=\"sub\">" + Ll(t.sub || "") + "</div><p>" + Ll(t.text || "") + "</p>" + Rl(t.url) + (bl(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", () => {
|
|
13361
13628
|
this.toggleContainer(t.id, { source: "panel" });
|
|
13362
13629
|
}), this._applyTheme();
|
|
13363
13630
|
}
|
|
@@ -13366,7 +13633,7 @@ var Hl = class extends HTMLElement {
|
|
|
13366
13633
|
if (!n) return this;
|
|
13367
13634
|
let r = new Set(this.open), i = n.parent ? this.nodes.get(n.parent) : null;
|
|
13368
13635
|
for (; i;) r.add(i.id), i = i.parent ? this.nodes.get(i.parent) : null;
|
|
13369
|
-
return this.selected = n, this.selectedRelationIndex = null,
|
|
13636
|
+
return this.selected = n, this.selectedRelationIndex = null, bl(n.type) && r.add(n.id), this._replaceOpenContainers(r, {
|
|
13370
13637
|
refresh: !1,
|
|
13371
13638
|
source: t.source || "api"
|
|
13372
13639
|
}), 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", {
|
|
@@ -13430,19 +13697,19 @@ var Hl = class extends HTMLElement {
|
|
|
13430
13697
|
for (let e of this.nodes.values()) {
|
|
13431
13698
|
let t = this._focusAlpha(e, i), n = this._isVisible(e) && t > 0;
|
|
13432
13699
|
e.group.visible = n;
|
|
13433
|
-
let r =
|
|
13434
|
-
if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material)
|
|
13700
|
+
let r = bl(e.type) && this.open.has(e.id), a = (r ? .12 : 1) * t;
|
|
13701
|
+
if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material) wl(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;
|
|
13435
13702
|
else {
|
|
13436
|
-
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),
|
|
13703
|
+
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), wl(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;
|
|
13437
13704
|
e._appearanceSelected = e === this.selected;
|
|
13438
13705
|
}
|
|
13439
13706
|
e.edge?.material && (e.edge.material.opacity = (e === this.selected ? 1 : .65) * t);
|
|
13440
|
-
let o =
|
|
13707
|
+
let o = bl(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;
|
|
13441
13708
|
e.label.userData.textOffsetY;
|
|
13442
13709
|
let m = e.labelSize || new U().fromArray(e.s);
|
|
13443
13710
|
e.label.visible = n;
|
|
13444
|
-
let h = this._worldPosition(e), g = this.itemFacing === "camera" && !
|
|
13445
|
-
if (
|
|
13711
|
+
let h = this._worldPosition(e), g = this.itemFacing === "camera" && !bl(e.type) || this.camera.position.z >= h.z, _ = this.camera.position.y > h.y + .25;
|
|
13712
|
+
if (bl(e.type)) {
|
|
13446
13713
|
c.visible = g && (!o || s), l.visible = !g && (!o || s), u.visible = s && _;
|
|
13447
13714
|
let e = s ? .52 : 1;
|
|
13448
13715
|
c.scale.setScalar(e), c.position.x = s ? -m.x / 2 + .18 + f * e / 2 - p * e : 0;
|
|
@@ -13461,7 +13728,7 @@ var Hl = class extends HTMLElement {
|
|
|
13461
13728
|
let t = this.canvas.getBoundingClientRect();
|
|
13462
13729
|
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);
|
|
13463
13730
|
let n = [];
|
|
13464
|
-
for (let e of this.nodes.values()) e.group.visible && (
|
|
13731
|
+
for (let e of this.nodes.values()) e.group.visible && (bl(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)));
|
|
13465
13732
|
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;
|
|
13466
13733
|
if (r && (!a || r.distance <= a.distance + .12)) {
|
|
13467
13734
|
let e = r.object;
|
|
@@ -13534,7 +13801,7 @@ var Hl = class extends HTMLElement {
|
|
|
13534
13801
|
y: e.clientY
|
|
13535
13802
|
}), e.pointerType === "touch" && this.pointers.size >= 2) {
|
|
13536
13803
|
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));
|
|
13537
|
-
this.drag.mode === "touch-pan" ? (this._panByPixels(n - this.drag.x, r - this.drag.y), this.targetZoom = Math.min(2.8, Math.max(
|
|
13804
|
+
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, {
|
|
13538
13805
|
x: n,
|
|
13539
13806
|
y: r,
|
|
13540
13807
|
distance: i,
|
|
@@ -13605,16 +13872,16 @@ var Hl = class extends HTMLElement {
|
|
|
13605
13872
|
navigation: "fit"
|
|
13606
13873
|
});
|
|
13607
13874
|
}), this.canvas.addEventListener("wheel", (e) => {
|
|
13608
|
-
e.preventDefault(), this.targetZoom = Math.min(2.8, Math.max(
|
|
13875
|
+
e.preventDefault(), this.targetZoom = Math.min(2.8, Math.max(tl, this.targetZoom * Math.exp(-e.deltaY * .001))), this.invalidate();
|
|
13609
13876
|
}, { passive: !1 });
|
|
13610
13877
|
}
|
|
13611
13878
|
_showError(e) {
|
|
13612
13879
|
let t = this.shadowRoot.querySelector(".viewport"), n = t.querySelector(".error");
|
|
13613
|
-
n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" +
|
|
13880
|
+
n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" + Ll(e) + "</div>");
|
|
13614
13881
|
}
|
|
13615
13882
|
};
|
|
13616
|
-
customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas",
|
|
13883
|
+
customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas", iu);
|
|
13617
13884
|
//#endregion
|
|
13618
|
-
export {
|
|
13885
|
+
export { $c as ATLAS_VERSION, iu as LiquidCarsAtlas, ru as captureRendererFrame, $l as createSvgExtrudeGeometry, _l as getGeometryCatalog, vl as getGeometryPackCatalog, zl as normalizeModel, hl as registerGeometryPack, gl as unregisterGeometryPack };
|
|
13619
13886
|
|
|
13620
13887
|
//# sourceMappingURL=liquidcars-atlas.js.map
|