@liquidcars/atlas 0.1.38 → 0.1.39
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 +55 -33
- package/dist/liquidcars-atlas.js +395 -307
- package/dist/liquidcars-atlas.js.map +1 -1
- package/package.json +1 -1
- package/src/liquidcars-atlas.js +141 -21
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
|
}
|
|
@@ -9243,7 +9243,7 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9243
9243
|
let e = Za[w];
|
|
9244
9244
|
O = e.vertexShader, k = e.fragmentShader;
|
|
9245
9245
|
} 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,
|
|
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, 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
9247
|
a.toneMapped && (M === null || M.isXRRenderTarget === !0) && (Se = e.toneMapping);
|
|
9248
9248
|
let Ce = {
|
|
9249
9249
|
shaderID: w,
|
|
@@ -9273,21 +9273,21 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9273
9273
|
aoMap: L,
|
|
9274
9274
|
lightMap: ne,
|
|
9275
9275
|
bumpMap: re,
|
|
9276
|
-
normalMap:
|
|
9277
|
-
displacementMap: f &&
|
|
9278
|
-
emissiveMap:
|
|
9279
|
-
normalMapObjectSpace:
|
|
9280
|
-
normalMapTangentSpace:
|
|
9281
|
-
metalnessMap:
|
|
9282
|
-
roughnessMap:
|
|
9283
|
-
anisotropy:
|
|
9276
|
+
normalMap: ie,
|
|
9277
|
+
displacementMap: f && R,
|
|
9278
|
+
emissiveMap: z,
|
|
9279
|
+
normalMapObjectSpace: ie && a.normalMapType === 1,
|
|
9280
|
+
normalMapTangentSpace: ie && a.normalMapType === 0,
|
|
9281
|
+
metalnessMap: ae,
|
|
9282
|
+
roughnessMap: oe,
|
|
9283
|
+
anisotropy: se,
|
|
9284
9284
|
anisotropyMap: V,
|
|
9285
|
-
clearcoat:
|
|
9285
|
+
clearcoat: ce,
|
|
9286
9286
|
clearcoatMap: H,
|
|
9287
9287
|
clearcoatNormalMap: U,
|
|
9288
9288
|
clearcoatRoughnessMap: fe,
|
|
9289
|
-
dispersion:
|
|
9290
|
-
iridescence:
|
|
9289
|
+
dispersion: le,
|
|
9290
|
+
iridescence: B,
|
|
9291
9291
|
iridescenceMap: W,
|
|
9292
9292
|
iridescenceThicknessMap: G,
|
|
9293
9293
|
sheen: ue,
|
|
@@ -9309,11 +9309,11 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9309
9309
|
aoMapUv: L && h(a.aoMap.channel),
|
|
9310
9310
|
lightMapUv: ne && h(a.lightMap.channel),
|
|
9311
9311
|
bumpMapUv: re && h(a.bumpMap.channel),
|
|
9312
|
-
normalMapUv:
|
|
9313
|
-
displacementMapUv:
|
|
9314
|
-
emissiveMapUv:
|
|
9315
|
-
metalnessMapUv:
|
|
9316
|
-
roughnessMapUv:
|
|
9312
|
+
normalMapUv: ie && h(a.normalMap.channel),
|
|
9313
|
+
displacementMapUv: R && h(a.displacementMap.channel),
|
|
9314
|
+
emissiveMapUv: z && h(a.emissiveMap.channel),
|
|
9315
|
+
metalnessMapUv: ae && h(a.metalnessMap.channel),
|
|
9316
|
+
roughnessMapUv: oe && h(a.roughnessMap.channel),
|
|
9317
9317
|
anisotropyMapUv: V && h(a.anisotropyMap.channel),
|
|
9318
9318
|
clearcoatMapUv: H && h(a.clearcoatMap.channel),
|
|
9319
9319
|
clearcoatNormalMapUv: U && h(a.clearcoatNormalMap.channel),
|
|
@@ -9328,7 +9328,7 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9328
9328
|
transmissionMapUv: he && h(a.transmissionMap.channel),
|
|
9329
9329
|
thicknessMapUv: ge && h(a.thicknessMap.channel),
|
|
9330
9330
|
alphaMapUv: ve && h(a.alphaMap.channel),
|
|
9331
|
-
vertexTangents: !!y.attributes.tangent && (
|
|
9331
|
+
vertexTangents: !!y.attributes.tangent && (ie || se),
|
|
9332
9332
|
vertexColors: a.vertexColors,
|
|
9333
9333
|
vertexAlphas: a.vertexColors === !0 && !!y.attributes.color && y.attributes.color.itemSize === 4,
|
|
9334
9334
|
pointsUvs: _.isPoints === !0 && !!y.attributes.uv && (I || ve),
|
|
@@ -9363,7 +9363,7 @@ function Cc(e, t, n, r, i, a, o) {
|
|
|
9363
9363
|
shadowMapType: e.shadowMap.type,
|
|
9364
9364
|
toneMapping: Se,
|
|
9365
9365
|
decodeVideoTexture: I && a.map.isVideoTexture === !0 && Y.getTransfer(a.map.colorSpace) === "srgb",
|
|
9366
|
-
decodeVideoTextureEmissive:
|
|
9366
|
+
decodeVideoTextureEmissive: z && a.emissiveMap.isVideoTexture === !0 && Y.getTransfer(a.emissiveMap.colorSpace) === "srgb",
|
|
9367
9367
|
premultipliedAlpha: a.premultipliedAlpha,
|
|
9368
9368
|
doubleSided: a.side === 2,
|
|
9369
9369
|
flipSided: a.side === 1,
|
|
@@ -9931,7 +9931,7 @@ function Bc(e, t) {
|
|
|
9931
9931
|
return r;
|
|
9932
9932
|
},
|
|
9933
9933
|
setTest: function(t) {
|
|
9934
|
-
t ?
|
|
9934
|
+
t ? R(e.DEPTH_TEST) : z(e.DEPTH_TEST);
|
|
9935
9935
|
},
|
|
9936
9936
|
setMask: function(t) {
|
|
9937
9937
|
i !== t && !n && (e.depthMask(t), i = t);
|
|
@@ -9983,7 +9983,7 @@ function Bc(e, t) {
|
|
|
9983
9983
|
let t = !1, n = null, r = null, i = null, a = null, o = null, s = null, c = null, l = null;
|
|
9984
9984
|
return {
|
|
9985
9985
|
setTest: function(n) {
|
|
9986
|
-
t || (n ?
|
|
9986
|
+
t || (n ? R(e.STENCIL_TEST) : z(e.STENCIL_TEST));
|
|
9987
9987
|
},
|
|
9988
9988
|
setMask: function(r) {
|
|
9989
9989
|
n !== r && !t && (e.stencilMask(r), n = r);
|
|
@@ -10014,18 +10014,18 @@ function Bc(e, t) {
|
|
|
10014
10014
|
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
10015
|
return o;
|
|
10016
10016
|
}
|
|
10017
|
-
let
|
|
10018
|
-
|
|
10019
|
-
function
|
|
10017
|
+
let ie = {};
|
|
10018
|
+
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);
|
|
10019
|
+
function R(t) {
|
|
10020
10020
|
u[t] !== !0 && (e.enable(t), u[t] = !0);
|
|
10021
10021
|
}
|
|
10022
|
-
function
|
|
10022
|
+
function z(t) {
|
|
10023
10023
|
u[t] !== !1 && (e.disable(t), u[t] = !1);
|
|
10024
10024
|
}
|
|
10025
|
-
function
|
|
10025
|
+
function ae(t, n) {
|
|
10026
10026
|
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
10027
|
}
|
|
10028
|
-
function
|
|
10028
|
+
function oe(t, n) {
|
|
10029
10029
|
let r = p, i = !1;
|
|
10030
10030
|
if (t) {
|
|
10031
10031
|
r = f.get(n), r === void 0 && (r = [], f.set(n, r));
|
|
@@ -10037,16 +10037,16 @@ function Bc(e, t) {
|
|
|
10037
10037
|
} else r[0] !== e.BACK && (r[0] = e.BACK, i = !0);
|
|
10038
10038
|
i && e.drawBuffers(r);
|
|
10039
10039
|
}
|
|
10040
|
-
function
|
|
10040
|
+
function se(t) {
|
|
10041
10041
|
return m !== t && (e.useProgram(t), m = t, !0);
|
|
10042
10042
|
}
|
|
10043
|
-
let
|
|
10043
|
+
let ce = {
|
|
10044
10044
|
100: e.FUNC_ADD,
|
|
10045
10045
|
101: e.FUNC_SUBTRACT,
|
|
10046
10046
|
102: e.FUNC_REVERSE_SUBTRACT
|
|
10047
10047
|
};
|
|
10048
|
-
|
|
10049
|
-
let
|
|
10048
|
+
ce[103] = e.MIN, ce[104] = e.MAX;
|
|
10049
|
+
let le = {
|
|
10050
10050
|
200: e.ZERO,
|
|
10051
10051
|
201: e.ONE,
|
|
10052
10052
|
202: e.SRC_COLOR,
|
|
@@ -10063,12 +10063,12 @@ function Bc(e, t) {
|
|
|
10063
10063
|
213: e.CONSTANT_ALPHA,
|
|
10064
10064
|
214: e.ONE_MINUS_CONSTANT_ALPHA
|
|
10065
10065
|
};
|
|
10066
|
-
function
|
|
10066
|
+
function B(t, n, r, i, a, o, s, c, l, u) {
|
|
10067
10067
|
if (t === 0) {
|
|
10068
|
-
h === !0 && (
|
|
10068
|
+
h === !0 && (z(e.BLEND), h = !1);
|
|
10069
10069
|
return;
|
|
10070
10070
|
}
|
|
10071
|
-
if (h === !1 && (
|
|
10071
|
+
if (h === !1 && (R(e.BLEND), h = !0), t !== 5) {
|
|
10072
10072
|
if (t !== g || u !== T) {
|
|
10073
10073
|
if ((_ !== 100 || b !== 100) && (e.blendEquation(e.FUNC_ADD), _ = 100, b = 100), u) switch (t) {
|
|
10074
10074
|
case 1:
|
|
@@ -10104,29 +10104,29 @@ function Bc(e, t) {
|
|
|
10104
10104
|
}
|
|
10105
10105
|
return;
|
|
10106
10106
|
}
|
|
10107
|
-
a ||= n, o ||= r, s ||= i, (n !== _ || a !== b) && (e.blendEquationSeparate(
|
|
10107
|
+
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
10108
|
}
|
|
10109
10109
|
function ue(t, n) {
|
|
10110
|
-
t.side === 2 ?
|
|
10110
|
+
t.side === 2 ? z(e.CULL_FACE) : R(e.CULL_FACE);
|
|
10111
10111
|
let r = t.side === 1;
|
|
10112
|
-
n && (r = !r), de(r), t.blending === 1 && t.transparent === !1 ?
|
|
10112
|
+
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
10113
|
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 ?
|
|
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 ? R(e.SAMPLE_ALPHA_TO_COVERAGE) : z(e.SAMPLE_ALPHA_TO_COVERAGE);
|
|
10115
10115
|
}
|
|
10116
10116
|
function de(t) {
|
|
10117
10117
|
E !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), E = t);
|
|
10118
10118
|
}
|
|
10119
10119
|
function V(t) {
|
|
10120
|
-
t === 0 ?
|
|
10120
|
+
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
10121
|
}
|
|
10122
10122
|
function H(t) {
|
|
10123
10123
|
t !== O && (M && e.lineWidth(t), O = t);
|
|
10124
10124
|
}
|
|
10125
10125
|
function U(t, n, r) {
|
|
10126
|
-
t ? (
|
|
10126
|
+
t ? (R(e.POLYGON_OFFSET_FILL), (k !== n || A !== r) && (e.polygonOffset(n, r), k = n, A = r)) : z(e.POLYGON_OFFSET_FILL);
|
|
10127
10127
|
}
|
|
10128
10128
|
function fe(t) {
|
|
10129
|
-
t ?
|
|
10129
|
+
t ? R(e.SCISSOR_TEST) : z(e.SCISSOR_TEST);
|
|
10130
10130
|
}
|
|
10131
10131
|
function W(t) {
|
|
10132
10132
|
t === void 0 && (t = e.TEXTURE0 + j - 1), F !== t && (e.activeTexture(t), F = t);
|
|
@@ -10137,7 +10137,7 @@ function Bc(e, t) {
|
|
|
10137
10137
|
i === void 0 && (i = {
|
|
10138
10138
|
type: void 0,
|
|
10139
10139
|
texture: void 0
|
|
10140
|
-
}, I[r] = i), (i.type !== t || i.texture !== n) && (F !== r && (e.activeTexture(r), F = r), e.bindTexture(t, n ||
|
|
10140
|
+
}, 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
10141
|
}
|
|
10142
10142
|
function K() {
|
|
10143
10143
|
let t = I[F];
|
|
@@ -10238,12 +10238,12 @@ function Bc(e, t) {
|
|
|
10238
10238
|
depth: o,
|
|
10239
10239
|
stencil: s
|
|
10240
10240
|
},
|
|
10241
|
-
enable:
|
|
10242
|
-
disable:
|
|
10243
|
-
bindFramebuffer:
|
|
10244
|
-
drawBuffers:
|
|
10245
|
-
useProgram:
|
|
10246
|
-
setBlending:
|
|
10241
|
+
enable: R,
|
|
10242
|
+
disable: z,
|
|
10243
|
+
bindFramebuffer: ae,
|
|
10244
|
+
drawBuffers: oe,
|
|
10245
|
+
useProgram: se,
|
|
10246
|
+
setBlending: B,
|
|
10247
10247
|
setMaterial: ue,
|
|
10248
10248
|
setFlipSided: de,
|
|
10249
10249
|
setCullFace: V,
|
|
@@ -10382,7 +10382,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10382
10382
|
if (r === null) console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");
|
|
10383
10383
|
else if (r.complete === !1) console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");
|
|
10384
10384
|
else {
|
|
10385
|
-
|
|
10385
|
+
B(n, e, t);
|
|
10386
10386
|
return;
|
|
10387
10387
|
}
|
|
10388
10388
|
} else e.isExternalTexture && (n.__webglTexture = e.sourceTexture ? e.sourceTexture : null);
|
|
@@ -10391,7 +10391,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10391
10391
|
function ne(e, t) {
|
|
10392
10392
|
let n = l.get(e);
|
|
10393
10393
|
if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
|
|
10394
|
-
|
|
10394
|
+
B(n, e, t);
|
|
10395
10395
|
return;
|
|
10396
10396
|
}
|
|
10397
10397
|
c.bindTexture(o.TEXTURE_2D_ARRAY, n.__webglTexture, o.TEXTURE0 + t);
|
|
@@ -10399,12 +10399,12 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10399
10399
|
function re(e, t) {
|
|
10400
10400
|
let n = l.get(e);
|
|
10401
10401
|
if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
|
|
10402
|
-
|
|
10402
|
+
B(n, e, t);
|
|
10403
10403
|
return;
|
|
10404
10404
|
}
|
|
10405
10405
|
c.bindTexture(o.TEXTURE_3D, n.__webglTexture, o.TEXTURE0 + t);
|
|
10406
10406
|
}
|
|
10407
|
-
function
|
|
10407
|
+
function ie(e, t) {
|
|
10408
10408
|
let n = l.get(e);
|
|
10409
10409
|
if (e.version > 0 && n.__version !== e.version) {
|
|
10410
10410
|
ue(n, e, t);
|
|
@@ -10412,18 +10412,18 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10412
10412
|
}
|
|
10413
10413
|
c.bindTexture(o.TEXTURE_CUBE_MAP, n.__webglTexture, o.TEXTURE0 + t);
|
|
10414
10414
|
}
|
|
10415
|
-
let
|
|
10415
|
+
let R = {
|
|
10416
10416
|
[e]: o.REPEAT,
|
|
10417
10417
|
[t]: o.CLAMP_TO_EDGE,
|
|
10418
10418
|
[n]: o.MIRRORED_REPEAT
|
|
10419
|
-
},
|
|
10419
|
+
}, z = {
|
|
10420
10420
|
[r]: o.NEAREST,
|
|
10421
10421
|
1004: o.NEAREST_MIPMAP_NEAREST,
|
|
10422
10422
|
1005: o.NEAREST_MIPMAP_LINEAR,
|
|
10423
10423
|
[i]: o.LINEAR,
|
|
10424
10424
|
1007: o.LINEAR_MIPMAP_NEAREST,
|
|
10425
10425
|
[a]: o.LINEAR_MIPMAP_LINEAR
|
|
10426
|
-
},
|
|
10426
|
+
}, ae = {
|
|
10427
10427
|
512: o.NEVER,
|
|
10428
10428
|
519: o.ALWAYS,
|
|
10429
10429
|
513: o.LESS,
|
|
@@ -10433,8 +10433,8 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10433
10433
|
516: o.GREATER,
|
|
10434
10434
|
517: o.NOTEQUAL
|
|
10435
10435
|
};
|
|
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,
|
|
10436
|
+
function oe(e, t) {
|
|
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, 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
10438
|
if (t.magFilter === 1003 || t.minFilter !== 1005 && t.minFilter !== 1008 || t.type === 1015 && s.has("OES_texture_float_linear") === !1) return;
|
|
10439
10439
|
if (t.anisotropy > 1 || l.get(t).__currentAnisotropy) {
|
|
10440
10440
|
let n = s.get("EXT_texture_filter_anisotropic");
|
|
@@ -10442,7 +10442,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10442
10442
|
}
|
|
10443
10443
|
}
|
|
10444
10444
|
}
|
|
10445
|
-
function
|
|
10445
|
+
function se(e, t) {
|
|
10446
10446
|
let n = !1;
|
|
10447
10447
|
e.__webglInit === void 0 && (e.__webglInit = !0, t.addEventListener("dispose", A));
|
|
10448
10448
|
let r = t.source, i = y.get(r);
|
|
@@ -10458,18 +10458,18 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10458
10458
|
}
|
|
10459
10459
|
return n;
|
|
10460
10460
|
}
|
|
10461
|
-
function
|
|
10461
|
+
function ce(e, t, n) {
|
|
10462
10462
|
return Math.floor(Math.floor(e / n) / t);
|
|
10463
10463
|
}
|
|
10464
|
-
function
|
|
10464
|
+
function le(e, t, n, r) {
|
|
10465
10465
|
let i = e.updateRanges;
|
|
10466
10466
|
if (i.length === 0) c.texSubImage2D(o.TEXTURE_2D, 0, 0, 0, t.width, t.height, n, r, t.data);
|
|
10467
10467
|
else {
|
|
10468
10468
|
i.sort((e, t) => e.start - t.start);
|
|
10469
10469
|
let a = 0;
|
|
10470
10470
|
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 &&
|
|
10471
|
+
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);
|
|
10472
|
+
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
10473
|
}
|
|
10474
10474
|
i.length = a + 1;
|
|
10475
10475
|
let s = o.getParameter(o.UNPACK_ROW_LENGTH), l = o.getParameter(o.UNPACK_SKIP_PIXELS), u = o.getParameter(o.UNPACK_SKIP_ROWS);
|
|
@@ -10481,10 +10481,10 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10481
10481
|
e.clearUpdateRanges(), o.pixelStorei(o.UNPACK_ROW_LENGTH, s), o.pixelStorei(o.UNPACK_SKIP_PIXELS, l), o.pixelStorei(o.UNPACK_SKIP_ROWS, u);
|
|
10482
10482
|
}
|
|
10483
10483
|
}
|
|
10484
|
-
function
|
|
10484
|
+
function B(e, t, n) {
|
|
10485
10485
|
let r = o.TEXTURE_2D;
|
|
10486
10486
|
(t.isDataArrayTexture || t.isCompressedArrayTexture) && (r = o.TEXTURE_2D_ARRAY), t.isData3DTexture && (r = o.TEXTURE_3D);
|
|
10487
|
-
let i =
|
|
10487
|
+
let i = se(e, t), a = t.source;
|
|
10488
10488
|
c.bindTexture(r, e.__webglTexture, o.TEXTURE0 + n);
|
|
10489
10489
|
let s = l.get(a);
|
|
10490
10490
|
if (a.version !== s.__version || i === !0) {
|
|
@@ -10494,7 +10494,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10494
10494
|
let m = C(t.image, !1, u.maxTextureSize);
|
|
10495
10495
|
m = ve(t, m);
|
|
10496
10496
|
let h = d.convert(t.format, t.colorSpace), g = d.convert(t.type), _ = D(t.internalFormat, h, g, t.colorSpace, t.isVideoTexture);
|
|
10497
|
-
|
|
10497
|
+
oe(r, t);
|
|
10498
10498
|
let v, y = t.mipmaps, b = t.isVideoTexture !== !0, x = s.__version === void 0 || i === !0, S = a.dataReady, E = k(t, m);
|
|
10499
10499
|
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
10500
|
else if (t.isDataTexture) {
|
|
@@ -10502,7 +10502,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10502
10502
|
b && x && c.texStorage2D(o.TEXTURE_2D, E, _, y[0].width, y[0].height);
|
|
10503
10503
|
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
10504
|
t.generateMipmaps = !1;
|
|
10505
|
-
} else b ? (x && c.texStorage2D(o.TEXTURE_2D, E, _, m.width, m.height), S &&
|
|
10505
|
+
} 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
10506
|
} else if (t.isCompressedTexture) {
|
|
10507
10507
|
if (t.isCompressedArrayTexture) {
|
|
10508
10508
|
b && x && c.texStorage3D(o.TEXTURE_2D_ARRAY, E, _, y[0].width, y[0].height, m.depth);
|
|
@@ -10568,7 +10568,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10568
10568
|
}
|
|
10569
10569
|
function ue(e, t, n) {
|
|
10570
10570
|
if (t.image.length !== 6) return;
|
|
10571
|
-
let r =
|
|
10571
|
+
let r = se(e, t), i = t.source;
|
|
10572
10572
|
c.bindTexture(o.TEXTURE_CUBE_MAP, e.__webglTexture, o.TEXTURE0 + n);
|
|
10573
10573
|
let a = l.get(i);
|
|
10574
10574
|
if (i.version !== a.__version || r === !0) {
|
|
@@ -10578,7 +10578,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10578
10578
|
let f = t.isCompressedTexture || t.image[0].isCompressedTexture, p = t.image[0] && t.image[0].isDataTexture, m = [];
|
|
10579
10579
|
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
10580
|
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
|
-
|
|
10581
|
+
oe(o.TEXTURE_CUBE_MAP, t);
|
|
10582
10582
|
let E;
|
|
10583
10583
|
if (f) {
|
|
10584
10584
|
y && b && c.texStorage2D(o.TEXTURE_CUBE_MAP, S, v, h.width, h.height);
|
|
@@ -10712,19 +10712,19 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10712
10712
|
}
|
|
10713
10713
|
}
|
|
10714
10714
|
if (a) {
|
|
10715
|
-
c.bindTexture(o.TEXTURE_CUBE_MAP, r.__webglTexture),
|
|
10715
|
+
c.bindTexture(o.TEXTURE_CUBE_MAP, r.__webglTexture), oe(o.TEXTURE_CUBE_MAP, t);
|
|
10716
10716
|
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
10717
|
else de(n.__webglFramebuffer[r], e, t, o.COLOR_ATTACHMENT0, o.TEXTURE_CUBE_MAP_POSITIVE_X + r, 0);
|
|
10718
10718
|
w(t) && T(o.TEXTURE_CUBE_MAP), c.unbindTexture();
|
|
10719
10719
|
} else if (s) {
|
|
10720
10720
|
for (let t = 0, r = i.length; t < r; t++) {
|
|
10721
10721
|
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),
|
|
10722
|
+
(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
10723
|
}
|
|
10724
10724
|
c.unbindTexture();
|
|
10725
10725
|
} else {
|
|
10726
10726
|
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),
|
|
10727
|
+
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
10728
|
else de(n.__webglFramebuffer, e, t, o.COLOR_ATTACHMENT0, i, 0);
|
|
10729
10729
|
w(t) && T(i), c.unbindTexture();
|
|
10730
10730
|
}
|
|
@@ -10787,7 +10787,7 @@ function Vc(o, s, c, l, u, d, p) {
|
|
|
10787
10787
|
function ye(e) {
|
|
10788
10788
|
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
10789
|
}
|
|
10790
|
-
this.allocateTextureUnit = ee, this.resetTextureUnits = I, this.setTexture2D = L, this.setTexture2DArray = ne, this.setTexture3D = re, this.setTextureCube =
|
|
10790
|
+
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
10791
|
}
|
|
10792
10792
|
function Hc(e, t) {
|
|
10793
10793
|
function n(n, r = "") {
|
|
@@ -10946,7 +10946,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
10946
10946
|
}
|
|
10947
10947
|
P = null, F = null, b.reset();
|
|
10948
10948
|
for (let e in x) delete x[e];
|
|
10949
|
-
e.setRenderTarget(C), _ = null, g = null, h = null, r = null, w = null,
|
|
10949
|
+
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
10950
|
}
|
|
10951
10951
|
this.setFramebufferScaleFactor = function(e) {
|
|
10952
10952
|
i = e, n.isPresenting === !0 && console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.");
|
|
@@ -11001,7 +11001,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
11001
11001
|
resolveStencilBuffer: _.ignoreDepthValues === !1
|
|
11002
11002
|
});
|
|
11003
11003
|
}
|
|
11004
|
-
w.isXRRenderTarget = !0, this.setFoveation(l), p = null, a = await r.requestReferenceSpace(c),
|
|
11004
|
+
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
11005
|
}
|
|
11006
11006
|
}, this.getEnvironmentBlendMode = function() {
|
|
11007
11007
|
if (r !== null) return r.environmentBlendMode;
|
|
@@ -11039,7 +11039,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
11039
11039
|
e.projectionMatrix.makePerspective(i, a, u, d, t, n), e.projectionMatrixInverse.copy(e.projectionMatrix).invert();
|
|
11040
11040
|
}
|
|
11041
11041
|
}
|
|
11042
|
-
function
|
|
11042
|
+
function ie(e, t) {
|
|
11043
11043
|
t === null ? e.matrixWorld.copy(e.matrix) : e.matrixWorld.multiplyMatrices(t.matrixWorld, e.matrix), e.matrixWorldInverse.copy(e.matrixWorld).invert();
|
|
11044
11044
|
}
|
|
11045
11045
|
this.updateCamera = function(e) {
|
|
@@ -11050,11 +11050,11 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
11050
11050
|
depthFar: N.far
|
|
11051
11051
|
}), 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
11052
|
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),
|
|
11053
|
+
ie(N, i);
|
|
11054
|
+
for (let e = 0; e < a.length; e++) ie(a[e], i);
|
|
11055
|
+
a.length === 2 ? re(N, A, j) : N.projectionMatrix.copy(A.projectionMatrix), R(e, N, i);
|
|
11056
11056
|
};
|
|
11057
|
-
function
|
|
11057
|
+
function R(e, t, n) {
|
|
11058
11058
|
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
11059
|
}
|
|
11060
11060
|
this.getCamera = function() {
|
|
@@ -11070,8 +11070,8 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
11070
11070
|
}, this.getCameraTexture = function(e) {
|
|
11071
11071
|
return x[e];
|
|
11072
11072
|
};
|
|
11073
|
-
let
|
|
11074
|
-
function
|
|
11073
|
+
let z = null;
|
|
11074
|
+
function ae(t, i) {
|
|
11075
11075
|
if (m = i.getViewerPose(p || a), v = i, m !== null) {
|
|
11076
11076
|
let t = m.views;
|
|
11077
11077
|
_ !== null && (e.setRenderTargetFramebuffer(w, _.framebuffer), e.setRenderTarget(w));
|
|
@@ -11110,14 +11110,14 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
|
|
|
11110
11110
|
let t = E[e], n = T[e];
|
|
11111
11111
|
t !== null && n !== void 0 && n.update(t, i, p || a);
|
|
11112
11112
|
}
|
|
11113
|
-
|
|
11113
|
+
z && z(t, i), i.detectedPlanes && n.dispatchEvent({
|
|
11114
11114
|
type: "planesdetected",
|
|
11115
11115
|
data: i
|
|
11116
11116
|
}), v = null;
|
|
11117
11117
|
}
|
|
11118
|
-
let
|
|
11119
|
-
|
|
11120
|
-
|
|
11118
|
+
let oe = new Ya();
|
|
11119
|
+
oe.setAnimationLoop(ae), this.setAnimationLoop = function(e) {
|
|
11120
|
+
z = e;
|
|
11121
11121
|
}, this.dispose = function() {};
|
|
11122
11122
|
}
|
|
11123
11123
|
}, qc = /*@__PURE__*/ new vt(), Jc = /*@__PURE__*/ new ct();
|
|
@@ -11280,7 +11280,7 @@ var Zc = class {
|
|
|
11280
11280
|
}, 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
11281
|
let T = this, E = !1;
|
|
11282
11282
|
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,
|
|
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, 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
11284
|
background: null,
|
|
11285
11285
|
fog: null,
|
|
11286
11286
|
environment: null,
|
|
@@ -11347,17 +11347,17 @@ var Zc = class {
|
|
|
11347
11347
|
}, this.getCurrentViewport = function(e) {
|
|
11348
11348
|
return e.copy(M);
|
|
11349
11349
|
}, this.getViewport = function(e) {
|
|
11350
|
-
return e.copy(
|
|
11350
|
+
return e.copy(ie);
|
|
11351
11351
|
}, this.setViewport = function(e, t, n, r) {
|
|
11352
|
-
e.isVector4 ?
|
|
11352
|
+
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
11353
|
}, this.getScissor = function(e) {
|
|
11354
|
-
return e.copy(
|
|
11354
|
+
return e.copy(R);
|
|
11355
11355
|
}, this.setScissor = function(e, t, n, r) {
|
|
11356
|
-
e.isVector4 ?
|
|
11356
|
+
e.isVector4 ? R.set(e.x, e.y, e.z, e.w) : R.set(e, t, n, r), K.scissor(N.copy(R).multiplyScalar(L).round());
|
|
11357
11357
|
}, this.getScissorTest = function() {
|
|
11358
|
-
return
|
|
11358
|
+
return z;
|
|
11359
11359
|
}, this.setScissorTest = function(e) {
|
|
11360
|
-
K.setScissorTest(
|
|
11360
|
+
K.setScissorTest(z = e);
|
|
11361
11361
|
}, this.setOpaqueSort = function(e) {
|
|
11362
11362
|
ne = e;
|
|
11363
11363
|
}, this.setTransparentSort = function(e) {
|
|
@@ -11505,13 +11505,13 @@ var Zc = class {
|
|
|
11505
11505
|
return;
|
|
11506
11506
|
}
|
|
11507
11507
|
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),
|
|
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), 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
11509
|
let e = T.xr.getDepthSensingMesh();
|
|
11510
11510
|
e !== null && Ze(e, t, -Infinity, T.sortObjects);
|
|
11511
11511
|
}
|
|
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++,
|
|
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++, oe === !0 && Ee.beginShadows();
|
|
11513
11513
|
let n = x.state.shadowsArray;
|
|
11514
|
-
De.render(n, e, t),
|
|
11514
|
+
De.render(n, e, t), oe === !0 && Ee.endShadows(), this.info.autoReset === !0 && this.info.reset();
|
|
11515
11515
|
let r = v.opaque, i = v.transmissive;
|
|
11516
11516
|
if (x.setupLights(), t.isArrayCamera) {
|
|
11517
11517
|
let n = t.cameras;
|
|
@@ -11525,7 +11525,7 @@ var Zc = class {
|
|
|
11525
11525
|
Qe(v, e, r, r.viewport);
|
|
11526
11526
|
}
|
|
11527
11527
|
} 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],
|
|
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], oe === !0 && Ee.setGlobalState(T.clippingPlanes, x.state.camera)) : x = null, S.pop(), v = S.length > 0 ? S[S.length - 1] : null;
|
|
11529
11529
|
};
|
|
11530
11530
|
function Ze(e, t, n, r) {
|
|
11531
11531
|
if (e.visible === !1) return;
|
|
@@ -11534,20 +11534,20 @@ var Zc = class {
|
|
|
11534
11534
|
else if (e.isLOD) e.autoUpdate === !0 && e.update(t);
|
|
11535
11535
|
else if (e.isLight) x.pushLight(e), e.castShadow && x.pushShadow(e);
|
|
11536
11536
|
else if (e.isSprite) {
|
|
11537
|
-
if (!e.frustumCulled ||
|
|
11538
|
-
r &&
|
|
11537
|
+
if (!e.frustumCulled || ae.intersectsSprite(e)) {
|
|
11538
|
+
r && B.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ce);
|
|
11539
11539
|
let t = xe.update(e), i = e.material;
|
|
11540
|
-
i.visible && v.push(e, t, i, n,
|
|
11540
|
+
i.visible && v.push(e, t, i, n, B.z, null);
|
|
11541
11541
|
}
|
|
11542
|
-
} else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled ||
|
|
11542
|
+
} else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || ae.intersectsObject(e))) {
|
|
11543
11543
|
let t = xe.update(e), i = e.material;
|
|
11544
|
-
if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(),
|
|
11544
|
+
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
11545
|
let r = t.groups;
|
|
11546
11546
|
for (let a = 0, o = r.length; a < o; a++) {
|
|
11547
11547
|
let o = r[a], s = i[o.materialIndex];
|
|
11548
|
-
s && s.visible && v.push(e, t, s, n,
|
|
11548
|
+
s && s.visible && v.push(e, t, s, n, B.z, o);
|
|
11549
11549
|
}
|
|
11550
|
-
} else i.visible && v.push(e, t, i, n,
|
|
11550
|
+
} else i.visible && v.push(e, t, i, n, B.z, null);
|
|
11551
11551
|
}
|
|
11552
11552
|
}
|
|
11553
11553
|
let i = e.children;
|
|
@@ -11555,7 +11555,7 @@ var Zc = class {
|
|
|
11555
11555
|
}
|
|
11556
11556
|
function Qe(e, t, n, r) {
|
|
11557
11557
|
let i = e.opaque, a = e.transmissive, o = e.transparent;
|
|
11558
|
-
x.setupLightsView(n),
|
|
11558
|
+
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
11559
|
}
|
|
11560
11560
|
function $e(e, t, n, r) {
|
|
11561
11561
|
if ((n.isScene === !0 ? n.overrideMaterial : null) !== null) return;
|
|
@@ -11576,7 +11576,7 @@ var Zc = class {
|
|
|
11576
11576
|
let p = T.toneMapping;
|
|
11577
11577
|
T.toneMapping = 0;
|
|
11578
11578
|
let m = r.viewport;
|
|
11579
|
-
if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r),
|
|
11579
|
+
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
11580
|
let e = !1;
|
|
11581
11581
|
for (let i = 0, a = t.length; i < a; i++) {
|
|
11582
11582
|
let a = t[i], o = a.object, s = a.geometry, c = a.material, l = a.group;
|
|
@@ -11626,7 +11626,7 @@ var Zc = class {
|
|
|
11626
11626
|
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
11627
|
r.toneMapped && (k === null || k.isXRRenderTarget === !0) && (m = T.toneMapping);
|
|
11628
11628
|
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 (
|
|
11629
|
+
if (oe === !0 && (se === !0 || e !== j)) {
|
|
11630
11630
|
let t = e === j && r.id === A;
|
|
11631
11631
|
Ee.setState(r, e, t);
|
|
11632
11632
|
}
|
|
@@ -11638,7 +11638,7 @@ var Zc = class {
|
|
|
11638
11638
|
if (K.useProgram(S.program) && (C = !0, w = !0, E = !0), r.id !== A && (A = r.id, w = !0), C || j !== e) {
|
|
11639
11639
|
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
11640
|
let t = D.map.cameraPosition;
|
|
11641
|
-
t !== void 0 && t.setValue(H,
|
|
11641
|
+
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
11642
|
}
|
|
11643
11643
|
if (i.isSkinnedMesh) {
|
|
11644
11644
|
D.setOptional(H, i, "bindMatrix"), D.setOptional(H, i, "bindMatrixInverse");
|
|
@@ -11695,7 +11695,7 @@ var Zc = class {
|
|
|
11695
11695
|
(c.isData3DTexture || c.isDataArrayTexture || c.isCompressedArrayTexture) && (o = !0);
|
|
11696
11696
|
let l = q.get(e).__webglFramebuffer;
|
|
11697
11697
|
e.isWebGLCubeRenderTarget ? (i = Array.isArray(l[t]) ? l[t][n] : l[t], a = !0) : i = e.samples > 0 && J.useMultisampledRTT(e) === !1 ? q.get(e).__webglMultisampledFramebuffer : Array.isArray(l) ? l[n] : l, M.copy(e.viewport), N.copy(e.scissor), P = e.scissorTest;
|
|
11698
|
-
} else M.copy(
|
|
11698
|
+
} else M.copy(ie).multiplyScalar(L).floor(), N.copy(R).multiplyScalar(L).floor(), P = z;
|
|
11699
11699
|
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
11700
|
let r = q.get(e.texture);
|
|
11701
11701
|
H.framebufferTexture2D(H.FRAMEBUFFER, H.COLOR_ATTACHMENT0, H.TEXTURE_CUBE_MAP_POSITIVE_X + t, r.__webglTexture, n);
|
|
@@ -11804,7 +11804,7 @@ var Zc = class {
|
|
|
11804
11804
|
}
|
|
11805
11805
|
}, Qc = {
|
|
11806
11806
|
name: "@liquidcars/atlas",
|
|
11807
|
-
version: "0.1.
|
|
11807
|
+
version: "0.1.39",
|
|
11808
11808
|
description: "Reusable 3D conceptual atlas Web Component for LiquidCars-style models",
|
|
11809
11809
|
type: "module",
|
|
11810
11810
|
scripts: {
|
|
@@ -11841,77 +11841,151 @@ var Zc = class {
|
|
|
11841
11841
|
}.version, $c = {
|
|
11842
11842
|
component: "#8ae4d0",
|
|
11843
11843
|
connection: "#f4edba"
|
|
11844
|
-
}, el = .05, tl = 15, nl = /* @__PURE__ */ new Map(), rl = /* @__PURE__ */ new Map();
|
|
11845
|
-
function
|
|
11846
|
-
|
|
11844
|
+
}, el = .05, tl = 15, nl = /* @__PURE__ */ new Map(), rl = /* @__PURE__ */ new Map(), il = /* @__PURE__ */ new Map();
|
|
11845
|
+
function al(e) {
|
|
11846
|
+
return Array.isArray(e) ? e.map(al) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).filter(([, e]) => typeof e != "function" && e !== void 0).map(([e, t]) => [e, al(t)]));
|
|
11847
|
+
}
|
|
11848
|
+
function ol(e) {
|
|
11849
|
+
return (e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { name: e } : al(e)).filter((e) => e && String(e.name || "").trim()).map((e) => ({
|
|
11850
|
+
...e,
|
|
11851
|
+
name: String(e.name).trim()
|
|
11852
|
+
}));
|
|
11853
|
+
}
|
|
11854
|
+
function sl(e) {
|
|
11855
|
+
return [...new Set((e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => String(e || "").trim()).filter(Boolean))];
|
|
11856
|
+
}
|
|
11857
|
+
function cl(e) {
|
|
11858
|
+
return e ? typeof e == "string" ? { spdx: e } : al(e) : null;
|
|
11859
|
+
}
|
|
11860
|
+
function ll(e, t) {
|
|
11861
|
+
let n = al(e || {}), r = String(n.id || `source-${t + 1}`).trim();
|
|
11862
|
+
if (!r) throw TypeError("Geometry pack sources require an id.");
|
|
11847
11863
|
return {
|
|
11848
11864
|
...n,
|
|
11865
|
+
id: r,
|
|
11866
|
+
authors: ol(n.authors ?? n.author),
|
|
11867
|
+
license: cl(n.license)
|
|
11868
|
+
};
|
|
11869
|
+
}
|
|
11870
|
+
function ul(e, t, n) {
|
|
11871
|
+
let r = al(e || {}), i = String(r.id || "").trim();
|
|
11872
|
+
if (!i) throw TypeError(`Geometry pack resource at index ${t} requires an id.`);
|
|
11873
|
+
let a = r.source == null ? null : String(r.source).trim();
|
|
11874
|
+
if (a && !n.has(a)) throw TypeError(`Geometry pack resource '${i}' references unknown source '${a}'.`);
|
|
11875
|
+
return {
|
|
11876
|
+
...r,
|
|
11877
|
+
id: i,
|
|
11878
|
+
kind: String(r.kind || r.type || "asset"),
|
|
11879
|
+
source: a,
|
|
11880
|
+
authors: ol(r.authors ?? r.author),
|
|
11881
|
+
license: cl(r.license)
|
|
11882
|
+
};
|
|
11883
|
+
}
|
|
11884
|
+
function dl(e, t) {
|
|
11885
|
+
let n = (Array.isArray(e.sources) ? e.sources : []).map(ll), r = new Set(n.map((e) => e.id)), i = (Array.isArray(e.resources) ? e.resources : []).map((e, t) => ul(e, t, r));
|
|
11886
|
+
if (new Set(i.map((e) => e.id)).size !== i.length) throw TypeError(`Geometry pack '${t}' contains duplicate resource ids.`);
|
|
11887
|
+
return {
|
|
11888
|
+
namespace: t,
|
|
11889
|
+
name: String(e.name || t),
|
|
11890
|
+
version: String(e.version || "0.0.0"),
|
|
11891
|
+
description: String(e.description || ""),
|
|
11892
|
+
category: String(e.category || e.name || t),
|
|
11893
|
+
homepage: e.homepage ? String(e.homepage) : "",
|
|
11894
|
+
repository: al(e.repository || null),
|
|
11895
|
+
authors: ol(e.authors ?? e.author),
|
|
11896
|
+
license: cl(e.license),
|
|
11897
|
+
attribution: String(e.attribution || ""),
|
|
11898
|
+
collections: al(Array.isArray(e.collections) ? e.collections : []),
|
|
11899
|
+
sources: n,
|
|
11900
|
+
resources: i,
|
|
11901
|
+
geometries: []
|
|
11902
|
+
};
|
|
11903
|
+
}
|
|
11904
|
+
function fl(e) {
|
|
11905
|
+
let { create: t, resourceMap: n, ...r } = e;
|
|
11906
|
+
return {
|
|
11907
|
+
...al(r),
|
|
11849
11908
|
canonicalSize: [...e.canonicalSize],
|
|
11850
|
-
parameters:
|
|
11851
|
-
palette:
|
|
11852
|
-
anchors:
|
|
11909
|
+
parameters: al(e.parameters),
|
|
11910
|
+
palette: al(e.palette),
|
|
11911
|
+
anchors: al(e.anchors)
|
|
11853
11912
|
};
|
|
11854
11913
|
}
|
|
11855
|
-
function
|
|
11914
|
+
function pl(e) {
|
|
11915
|
+
return al(e);
|
|
11916
|
+
}
|
|
11917
|
+
function ml(e) {
|
|
11856
11918
|
if (!e || typeof e != "object") throw TypeError("A geometry pack must be an object.");
|
|
11857
11919
|
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.");
|
|
11920
|
+
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
11921
|
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
|
-
|
|
11922
|
+
let n = dl(e, t), r = Object.freeze(Object.fromEntries(n.resources.map((e) => [e.id, Object.freeze(al(e))]))), i = [];
|
|
11923
|
+
for (let a of e.geometries) {
|
|
11924
|
+
if (!a || typeof a != "object" || !a.id) throw TypeError(`Geometry pack '${t}' contains an invalid geometry.`);
|
|
11925
|
+
let o = String(a.id).includes(".") ? String(a.id).split(".").pop() : String(a.id), s = String(a.id).includes(".") ? String(a.id) : `${t}.${o}`;
|
|
11926
|
+
i.push({
|
|
11927
|
+
...a,
|
|
11928
|
+
id: s,
|
|
11929
|
+
localId: o,
|
|
11867
11930
|
namespace: t,
|
|
11868
|
-
pack:
|
|
11869
|
-
packVersion:
|
|
11870
|
-
category:
|
|
11871
|
-
|
|
11931
|
+
pack: n.name,
|
|
11932
|
+
packVersion: n.version,
|
|
11933
|
+
category: a.category || n.category,
|
|
11934
|
+
collection: a.collection == null ? "" : String(a.collection).trim(),
|
|
11935
|
+
tags: sl(a.tags),
|
|
11936
|
+
keywords: sl(a.keywords),
|
|
11937
|
+
canonicalSize: Array.isArray(a.canonicalSize) && a.canonicalSize.length === 3 ? a.canonicalSize.map(Number) : [
|
|
11872
11938
|
2.5,
|
|
11873
11939
|
1.5,
|
|
11874
11940
|
2.5
|
|
11875
11941
|
],
|
|
11876
|
-
parameters:
|
|
11942
|
+
parameters: a.parameters && typeof a.parameters == "object" ? a.parameters : {},
|
|
11877
11943
|
palette: {
|
|
11878
11944
|
...e.palette || {},
|
|
11879
|
-
...
|
|
11945
|
+
...a.palette || {}
|
|
11880
11946
|
},
|
|
11881
11947
|
anchors: {
|
|
11882
11948
|
...e.anchors || {},
|
|
11883
|
-
...
|
|
11884
|
-
}
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11949
|
+
...a.anchors || {}
|
|
11950
|
+
},
|
|
11951
|
+
resourceMap: r
|
|
11952
|
+
});
|
|
11953
|
+
}
|
|
11954
|
+
hl(t);
|
|
11955
|
+
let a = [];
|
|
11956
|
+
for (let e of i) {
|
|
11957
|
+
nl.set(e.id, e), rl.set(e.id, e.id);
|
|
11958
|
+
for (let t of e.aliases || []) rl.set(String(t), e.id);
|
|
11959
|
+
a.push(e.id);
|
|
11889
11960
|
}
|
|
11961
|
+
n.geometries = [...a], il.set(t, n);
|
|
11962
|
+
let o = pl(n);
|
|
11890
11963
|
return typeof globalThis.dispatchEvent == "function" && typeof CustomEvent == "function" && globalThis.dispatchEvent(new CustomEvent("lc-geometry-registry-change", { detail: {
|
|
11891
11964
|
namespace: t,
|
|
11892
|
-
geometries:
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
geometries: n
|
|
11896
|
-
};
|
|
11965
|
+
geometries: a,
|
|
11966
|
+
pack: o
|
|
11967
|
+
} })), o;
|
|
11897
11968
|
}
|
|
11898
|
-
function
|
|
11969
|
+
function hl(e) {
|
|
11899
11970
|
let t = [];
|
|
11900
11971
|
for (let [n, r] of nl) r.namespace === e && (nl.delete(n), t.push(n));
|
|
11901
11972
|
for (let [e, n] of rl) t.includes(n) && rl.delete(e);
|
|
11902
|
-
return t;
|
|
11973
|
+
return il.delete(e), t;
|
|
11903
11974
|
}
|
|
11904
|
-
function
|
|
11905
|
-
return [...nl.values()].map(
|
|
11975
|
+
function gl() {
|
|
11976
|
+
return [...nl.values()].map(fl);
|
|
11906
11977
|
}
|
|
11907
|
-
function
|
|
11978
|
+
function _l() {
|
|
11979
|
+
return [...il.values()].map(pl);
|
|
11980
|
+
}
|
|
11981
|
+
function vl(e) {
|
|
11908
11982
|
let t = rl.get(e) || e;
|
|
11909
11983
|
return nl.get(t) || null;
|
|
11910
11984
|
}
|
|
11911
|
-
function
|
|
11985
|
+
function yl(e) {
|
|
11912
11986
|
return e === "container" || e === "shell";
|
|
11913
11987
|
}
|
|
11914
|
-
function
|
|
11988
|
+
function bl(e = {}) {
|
|
11915
11989
|
let t = e && typeof e == "object" ? e : {}, n = Number(t.opacity);
|
|
11916
11990
|
return {
|
|
11917
11991
|
mode: t.mode === "connected" ? "connected" : "all",
|
|
@@ -11920,24 +11994,34 @@ function ul(e = {}) {
|
|
|
11920
11994
|
opacity: Number.isFinite(n) ? Math.max(.02, Math.min(.8, n)) : .12
|
|
11921
11995
|
};
|
|
11922
11996
|
}
|
|
11923
|
-
function
|
|
11997
|
+
function xl(e) {
|
|
11924
11998
|
return [
|
|
11925
11999
|
"preserve",
|
|
11926
12000
|
"center",
|
|
11927
12001
|
"fit"
|
|
11928
12002
|
].includes(e) ? e : "preserve";
|
|
11929
12003
|
}
|
|
11930
|
-
function
|
|
12004
|
+
function Sl(e) {
|
|
11931
12005
|
return e === "model" ? "model" : "camera";
|
|
11932
12006
|
}
|
|
11933
|
-
function
|
|
12007
|
+
function Cl(e, t) {
|
|
11934
12008
|
e && e.transparent !== t && (e.transparent = t, e.needsUpdate = !0);
|
|
11935
12009
|
}
|
|
11936
|
-
|
|
12010
|
+
ml({
|
|
11937
12011
|
namespace: "geo",
|
|
11938
12012
|
name: "Geometric primitives",
|
|
11939
12013
|
version: "1",
|
|
12014
|
+
description: "Built-in Atlas geometric primitives.",
|
|
11940
12015
|
category: "Geometric primitives",
|
|
12016
|
+
authors: [{
|
|
12017
|
+
name: "LiquidCars S.L.",
|
|
12018
|
+
url: "https://liquidcars.net"
|
|
12019
|
+
}],
|
|
12020
|
+
license: {
|
|
12021
|
+
spdx: "MIT",
|
|
12022
|
+
url: "https://opensource.org/license/mit"
|
|
12023
|
+
},
|
|
12024
|
+
homepage: "https://github.com/gaelibus/atlas",
|
|
11941
12025
|
geometries: [
|
|
11942
12026
|
"box",
|
|
11943
12027
|
"cylinder",
|
|
@@ -11980,7 +12064,7 @@ al({
|
|
|
11980
12064
|
} } : {}
|
|
11981
12065
|
}))
|
|
11982
12066
|
});
|
|
11983
|
-
var
|
|
12067
|
+
var wl = {
|
|
11984
12068
|
background: {
|
|
11985
12069
|
color: "#0a111a",
|
|
11986
12070
|
glow: "#1c2b39",
|
|
@@ -12025,17 +12109,17 @@ var ml = {
|
|
|
12025
12109
|
hint: !0
|
|
12026
12110
|
}
|
|
12027
12111
|
};
|
|
12028
|
-
function
|
|
12112
|
+
function Tl(e, t) {
|
|
12029
12113
|
let n = { ...e };
|
|
12030
12114
|
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) ?
|
|
12115
|
+
for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ? Tl(e?.[r] || {}, i) : i;
|
|
12032
12116
|
return n;
|
|
12033
12117
|
}
|
|
12034
|
-
function
|
|
12118
|
+
function El(e) {
|
|
12035
12119
|
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 }),
|
|
12120
|
+
return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }), Tl(wl, t);
|
|
12037
12121
|
}
|
|
12038
|
-
function
|
|
12122
|
+
function Dl(e) {
|
|
12039
12123
|
if (!e || typeof e != "object") return "directed";
|
|
12040
12124
|
let t = String(e.mode || e.visual || e.render || e.type || e.direction || "").trim().toLowerCase().replace(/[_\s]+/g, "-");
|
|
12041
12125
|
return e.bidirectional === !0 || [
|
|
@@ -12050,7 +12134,7 @@ function _l(e) {
|
|
|
12050
12134
|
"failed"
|
|
12051
12135
|
].includes(t) ? "broken" : "directed";
|
|
12052
12136
|
}
|
|
12053
|
-
var
|
|
12137
|
+
var Ol = [":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(""), kl = ".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}}", Al = [
|
|
12054
12138
|
".viewport>.atlas-print-snapshot{display:none!important}",
|
|
12055
12139
|
"@media print{",
|
|
12056
12140
|
":host{-webkit-print-color-adjust:exact;print-color-adjust:exact;break-inside:avoid;page-break-inside:avoid}",
|
|
@@ -12059,17 +12143,17 @@ var vl = [":host{display:block;position:relative;height:var(--lc-height,680px);m
|
|
|
12059
12143
|
":host([data-lc-print-ready]) .viewport>canvas:not(.atlas-print-snapshot){display:none!important}",
|
|
12060
12144
|
":host([data-lc-print-ready]) .viewport>.atlas-print-snapshot{display:block!important;width:100%;height:100%}",
|
|
12061
12145
|
"}"
|
|
12062
|
-
].join(""),
|
|
12063
|
-
minus:
|
|
12064
|
-
plus:
|
|
12065
|
-
fit:
|
|
12066
|
-
front:
|
|
12067
|
-
view:
|
|
12068
|
-
relations:
|
|
12069
|
-
focus:
|
|
12070
|
-
chevron:
|
|
12071
|
-
},
|
|
12072
|
-
function
|
|
12146
|
+
].join(""), jl = (e, t = "0 0 24 24") => `<svg viewBox="${t}" aria-hidden="true">${e}</svg>`, Ml = {
|
|
12147
|
+
minus: jl("<path d=\"M6 12h12\"/>"),
|
|
12148
|
+
plus: jl("<path d=\"M12 6v12M6 12h12\"/>"),
|
|
12149
|
+
fit: jl("<path d=\"M9 4H4v5M15 4h5v5M20 15v5h-5M4 15v5h5\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
|
|
12150
|
+
front: jl("<rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"1.5\"/><path d=\"M8 16h8\"/>"),
|
|
12151
|
+
view: jl("<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\"/>"),
|
|
12152
|
+
relations: jl("<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\"/>"),
|
|
12153
|
+
focus: jl("<circle cx=\"12\" cy=\"12\" r=\"7\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3\"/>"),
|
|
12154
|
+
chevron: jl("<path d=\"m8 10 4 4 4-4\"/>")
|
|
12155
|
+
}, Nl = (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>`, Pl = (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>${Ml.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, Fl = `<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">${Ml.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Acercar" title="Acercar">${Ml.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Encuadrar todo el modelo" title="Encuadrar todo el modelo">${Ml.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Vista frontal" title="Vista frontal">${Ml.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${Pl("view", Ml.view, "Vista", "Vista", Nl("labels", "Etiquetas", !0) + Nl("panel", "Información", !0) + Nl("item-facing", "Caras a cámara", !0) + "<div class=\"toolbar-option-separator\"></div>" + Nl("open-all", "Abrir todos") + Nl("close-all", "Cerrar todos"))}</div><div class="toolbar-group" data-toolbar-group="relations">${Pl("relations", Ml.relations, "Relaciones", "Selección", Nl("relations-all", "Todas") + Nl("relations-selected", "Selección", !0) + Nl("relations-none", "Ocultar"))}</div><div class="toolbar-group" data-toolbar-group="focus">${Pl("focus", Ml.focus, "Foco", "Todo", Nl("focus-all", "Todo", !0) + Nl("focus-dim", "Conectados") + Nl("focus-hide", "Aislar") + "<div class=\"toolbar-option-separator\"></div>" + Nl("focus-selection", "Enfocar selección") + Nl("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>`;
|
|
12156
|
+
function Il(e) {
|
|
12073
12157
|
return String(e ?? "").replace(/[&<>"']/g, (e) => ({
|
|
12074
12158
|
"&": "&",
|
|
12075
12159
|
"<": "<",
|
|
@@ -12078,17 +12162,17 @@ function El(e) {
|
|
|
12078
12162
|
"'": "'"
|
|
12079
12163
|
})[e]);
|
|
12080
12164
|
}
|
|
12081
|
-
function
|
|
12165
|
+
function Ll(e) {
|
|
12082
12166
|
let t = String(e ?? "").trim();
|
|
12083
12167
|
if (!t) return "";
|
|
12084
12168
|
try {
|
|
12085
12169
|
let e = new URL(t, globalThis.location?.href);
|
|
12086
|
-
return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" +
|
|
12170
|
+
return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" + Il(e.href) + "\" target=\"_blank\" rel=\"noopener noreferrer\">Open documentation ↗</a>" : "";
|
|
12087
12171
|
} catch {
|
|
12088
12172
|
return "";
|
|
12089
12173
|
}
|
|
12090
12174
|
}
|
|
12091
|
-
function
|
|
12175
|
+
function Rl(e) {
|
|
12092
12176
|
let t = e && typeof e == "object" ? e : {}, n = Array.isArray(t.entities) ? t.entities.map((e) => ({
|
|
12093
12177
|
...e,
|
|
12094
12178
|
p: Array.isArray(e.p) ? e.p : [
|
|
@@ -12105,14 +12189,14 @@ function Ol(e) {
|
|
|
12105
12189
|
from: e[0],
|
|
12106
12190
|
to: e[1],
|
|
12107
12191
|
label: e[2] || "",
|
|
12108
|
-
mode:
|
|
12192
|
+
mode: Dl({ mode: e[3] }),
|
|
12109
12193
|
index: t
|
|
12110
12194
|
} : {
|
|
12111
12195
|
...e,
|
|
12112
12196
|
from: e.from,
|
|
12113
12197
|
to: e.to,
|
|
12114
12198
|
label: e.label || "",
|
|
12115
|
-
mode:
|
|
12199
|
+
mode: Dl(e),
|
|
12116
12200
|
index: t
|
|
12117
12201
|
}) : [];
|
|
12118
12202
|
return {
|
|
@@ -12121,12 +12205,12 @@ function Ol(e) {
|
|
|
12121
12205
|
...$c,
|
|
12122
12206
|
...t.palette || {}
|
|
12123
12207
|
},
|
|
12124
|
-
theme:
|
|
12208
|
+
theme: El(t.theme || t.styles),
|
|
12125
12209
|
entities: n,
|
|
12126
12210
|
relations: r
|
|
12127
12211
|
};
|
|
12128
12212
|
}
|
|
12129
|
-
function
|
|
12213
|
+
function zl(e, t, n = [
|
|
12130
12214
|
1,
|
|
12131
12215
|
1,
|
|
12132
12216
|
1
|
|
@@ -12145,7 +12229,7 @@ function kl(e, t, n = [
|
|
|
12145
12229
|
});
|
|
12146
12230
|
return s.center(), s;
|
|
12147
12231
|
}
|
|
12148
|
-
function
|
|
12232
|
+
function Bl(e, t, n) {
|
|
12149
12233
|
let r = new ui();
|
|
12150
12234
|
for (let t = 0; t < e; t++) {
|
|
12151
12235
|
let n = Math.PI / 2 + t * Math.PI * 2 / e, i = new V(Math.cos(n) * .5, Math.sin(n) * .5);
|
|
@@ -12162,7 +12246,7 @@ function Al(e, t, n) {
|
|
|
12162
12246
|
});
|
|
12163
12247
|
return i.rotateX(Math.PI / 2), i.center(), i;
|
|
12164
12248
|
}
|
|
12165
|
-
function
|
|
12249
|
+
function Vl(e, t, n, r) {
|
|
12166
12250
|
let i = Math.min(.22, Math.max(0, Number(n) || 0));
|
|
12167
12251
|
if (!i) return new Er(t, e, 1, 32);
|
|
12168
12252
|
let a = [new V(0, -.5)];
|
|
@@ -12179,7 +12263,7 @@ function jl(e, t, n, r) {
|
|
|
12179
12263
|
}
|
|
12180
12264
|
return a.push(new V(0, .5)), new Qi(a, 32);
|
|
12181
12265
|
}
|
|
12182
|
-
function
|
|
12266
|
+
function Hl(e, t) {
|
|
12183
12267
|
if (!t) return e;
|
|
12184
12268
|
let n = Math.min(.72, Math.max(0, Number(t) * 3)), r = e.attributes.position;
|
|
12185
12269
|
for (let e = 0; e < r.count; e++) {
|
|
@@ -12188,36 +12272,36 @@ function Ml(e, t) {
|
|
|
12188
12272
|
}
|
|
12189
12273
|
return r.needsUpdate = !0, e.computeVertexNormals(), e;
|
|
12190
12274
|
}
|
|
12191
|
-
function
|
|
12275
|
+
function Ul(e, t = 0, n = 4, r = [
|
|
12192
12276
|
1,
|
|
12193
12277
|
1,
|
|
12194
12278
|
1
|
|
12195
12279
|
]) {
|
|
12196
12280
|
let i = Number(t) || 0, a = Math.max(2, Math.round(Number(n) || 4));
|
|
12197
12281
|
switch (e) {
|
|
12198
|
-
case "cylinder": return i ?
|
|
12199
|
-
case "cone": return i ?
|
|
12282
|
+
case "cylinder": return i ? Vl(.5, .5, i, a) : new Er(.5, .5, 1, 32);
|
|
12283
|
+
case "cone": return i ? Vl(0, .5, i, a) : new Dr(.5, 1, 32);
|
|
12200
12284
|
case "frustum-cone":
|
|
12201
|
-
case "truncated-cone": return i ?
|
|
12285
|
+
case "truncated-cone": return i ? Vl(.28, .5, i, a) : new Er(.28, .5, 1, 32);
|
|
12202
12286
|
case "frustum-pyramid":
|
|
12203
12287
|
case "truncated-pyramid": return new Er(.28, .5, 1, 4);
|
|
12204
12288
|
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 ?
|
|
12289
|
+
case "prism": return i ? Bl(6, i, a) : new Er(.5, .5, 1, 6);
|
|
12290
|
+
case "pyramid-square": return i ? Hl(new Dr(.5, 1, 4), i) : new Dr(.5, 1, 4);
|
|
12291
|
+
case "pyramid-triangle": return i ? Hl(new Dr(.5, 1, 3), i) : new Dr(.5, 1, 3);
|
|
12208
12292
|
case "sphere": return new ta(.5, 24, 16);
|
|
12209
|
-
case "octahedron": return
|
|
12210
|
-
case "dodecahedron": return
|
|
12211
|
-
case "icosahedron": return
|
|
12212
|
-
default: return i ?
|
|
12293
|
+
case "octahedron": return Hl(new $i(.5), i);
|
|
12294
|
+
case "dodecahedron": return Hl(new kr(.5), i);
|
|
12295
|
+
case "icosahedron": return Hl(new Zi(.5), i);
|
|
12296
|
+
default: return i ? zl(i, a, r) : new Nn(1, 1, 1);
|
|
12213
12297
|
}
|
|
12214
12298
|
}
|
|
12215
|
-
function
|
|
12299
|
+
function Wl(e) {
|
|
12216
12300
|
e.computeBoundingBox();
|
|
12217
12301
|
let t = e.boundingBox?.getSize(new U());
|
|
12218
12302
|
return !t || !t.x || !t.y || !t.z ? e : (e.scale(1 / t.x, 1 / t.y, 1 / t.z), e.computeBoundingBox(), e);
|
|
12219
12303
|
}
|
|
12220
|
-
function
|
|
12304
|
+
function Gl(e, t) {
|
|
12221
12305
|
let n = e.geometryOptions || e.geometry_options || e.parameters || {}, r = {};
|
|
12222
12306
|
for (let [e, n] of Object.entries(t?.parameters || {})) n && Object.hasOwn(n, "default") && (r[e] = n.default);
|
|
12223
12307
|
return {
|
|
@@ -12225,10 +12309,10 @@ function Fl(e, t) {
|
|
|
12225
12309
|
...n && typeof n == "object" ? n : {}
|
|
12226
12310
|
};
|
|
12227
12311
|
}
|
|
12228
|
-
function
|
|
12312
|
+
function Kl(e, t, n) {
|
|
12229
12313
|
return typeof e != "string" || !e ? n : t[e] || e;
|
|
12230
12314
|
}
|
|
12231
|
-
function
|
|
12315
|
+
function ql(e, t = "#ffffff", n = "transparent") {
|
|
12232
12316
|
let r = document.createElement("canvas");
|
|
12233
12317
|
r.width = 256, r.height = 256;
|
|
12234
12318
|
let i = r.getContext("2d");
|
|
@@ -12236,27 +12320,28 @@ function Ll(e, t = "#ffffff", n = "transparent") {
|
|
|
12236
12320
|
let a = new Cr(r);
|
|
12237
12321
|
return a.colorSpace = y, a;
|
|
12238
12322
|
}
|
|
12239
|
-
function
|
|
12240
|
-
return e.shape === "plane" ? new ea(1, 1) :
|
|
12323
|
+
function Jl(e) {
|
|
12324
|
+
return e.shape === "plane" ? new ea(1, 1) : Ul(e.shape || e.geometry || "box", e.radius, e.segments, e.size);
|
|
12241
12325
|
}
|
|
12242
|
-
function
|
|
12243
|
-
let a =
|
|
12326
|
+
function Yl(e, t, n, r, i) {
|
|
12327
|
+
let a = Gl(t, e), o = {
|
|
12244
12328
|
...n,
|
|
12245
12329
|
...e.palette || {},
|
|
12246
12330
|
...t.geometryPalette || t.geometry_palette || {}
|
|
12247
12331
|
}, s = typeof e.create == "function" ? e.create({
|
|
12248
12332
|
parameters: { ...a },
|
|
12249
12333
|
colors: { ...o },
|
|
12250
|
-
entity: { ...t }
|
|
12334
|
+
entity: { ...t },
|
|
12335
|
+
resources: e.resourceMap || {}
|
|
12251
12336
|
}) : { parts: e.parts || [] };
|
|
12252
12337
|
Array.isArray(s) && (s = { parts: s });
|
|
12253
12338
|
let c = Array.isArray(s?.parts) ? s.parts : [];
|
|
12254
12339
|
if (!c.length) throw Error(`Geometry '${e.id}' did not produce any parts.`);
|
|
12255
12340
|
let l = new Qn(), u = [], d = [];
|
|
12256
12341
|
for (let a of c) {
|
|
12257
|
-
let s =
|
|
12258
|
-
|
|
12259
|
-
let c = a.color || "component", f =
|
|
12342
|
+
let s = Jl(a);
|
|
12343
|
+
Wl(s);
|
|
12344
|
+
let c = a.color || "component", f = Kl(c, o, n.component || $c.component), p = new ia({
|
|
12260
12345
|
color: f,
|
|
12261
12346
|
roughness: Number.isFinite(Number(a.roughness)) ? Number(a.roughness) : .72,
|
|
12262
12347
|
metalness: Number.isFinite(Number(a.metalness)) ? Number(a.metalness) : .06,
|
|
@@ -12327,7 +12412,7 @@ function zl(e, t, n, r, i) {
|
|
|
12327
12412
|
n.src = g;
|
|
12328
12413
|
}
|
|
12329
12414
|
})(), p.map.colorSpace = y, p.needsUpdate = !0;
|
|
12330
|
-
} else h != null && h !== "" && (p.map =
|
|
12415
|
+
} else h != null && h !== "" && (p.map = ql(h, Kl(a.iconColor || "#ffffff", o, "#ffffff"), Kl(a.iconBackground || "transparent", o, "transparent")), p.transparent = !0, p.needsUpdate = !0);
|
|
12331
12416
|
if (m = new An(s, p), m.position.fromArray(Array.isArray(a.position) ? a.position : [
|
|
12332
12417
|
0,
|
|
12333
12418
|
0,
|
|
@@ -12363,7 +12448,7 @@ function zl(e, t, n, r, i) {
|
|
|
12363
12448
|
descriptor: s
|
|
12364
12449
|
};
|
|
12365
12450
|
}
|
|
12366
|
-
function
|
|
12451
|
+
function Xl(e, t, n, r = "", i = !0) {
|
|
12367
12452
|
let a = document.createElement("canvas"), o = a.getContext("2d"), s = n.x * .88, c = Math.min(.82, n.y * .64);
|
|
12368
12453
|
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
12454
|
let l = a.height * .62;
|
|
@@ -12400,7 +12485,7 @@ function Bl(e, t, n, r = "", i = !0) {
|
|
|
12400
12485
|
let C = new An(b, v);
|
|
12401
12486
|
C.rotation.y = Math.PI, C.position.set(0, n.y / 2 - .09 - c / 2, -n.z / 2 - .012);
|
|
12402
12487
|
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 =
|
|
12488
|
+
w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible = yl(r), x.add(S, C, w);
|
|
12404
12489
|
for (let e of [
|
|
12405
12490
|
S,
|
|
12406
12491
|
C,
|
|
@@ -12408,7 +12493,7 @@ function Bl(e, t, n, r = "", i = !0) {
|
|
|
12408
12493
|
]) e.renderOrder = 20, e.frustumCulled = !1, e.material.depthTest = !0, e.material.depthWrite = !1, e.material.transparent = !0;
|
|
12409
12494
|
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
12495
|
}
|
|
12411
|
-
function
|
|
12496
|
+
function Zl(e, t, n, r = globalThis.document) {
|
|
12412
12497
|
if (!e || !t || !n || !r?.createElement) return null;
|
|
12413
12498
|
try {
|
|
12414
12499
|
e.render(t, n);
|
|
@@ -12430,7 +12515,7 @@ function Vl(e, t, n, r = globalThis.document) {
|
|
|
12430
12515
|
return null;
|
|
12431
12516
|
}
|
|
12432
12517
|
}
|
|
12433
|
-
var
|
|
12518
|
+
var Ql = class extends HTMLElement {
|
|
12434
12519
|
static version = Qc;
|
|
12435
12520
|
static get observedAttributes() {
|
|
12436
12521
|
return [
|
|
@@ -12448,20 +12533,23 @@ var Hl = class extends HTMLElement {
|
|
|
12448
12533
|
];
|
|
12449
12534
|
}
|
|
12450
12535
|
static registerGeometryPack(e) {
|
|
12451
|
-
return
|
|
12536
|
+
return ml(e);
|
|
12452
12537
|
}
|
|
12453
12538
|
static unregisterGeometryPack(e) {
|
|
12454
|
-
return
|
|
12539
|
+
return hl(e);
|
|
12455
12540
|
}
|
|
12456
12541
|
static getGeometryCatalog() {
|
|
12457
|
-
return
|
|
12542
|
+
return gl();
|
|
12543
|
+
}
|
|
12544
|
+
static getGeometryPackCatalog() {
|
|
12545
|
+
return _l();
|
|
12458
12546
|
}
|
|
12459
12547
|
constructor() {
|
|
12460
|
-
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" +
|
|
12548
|
+
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" + Ol + kl + Al + "</style>" + Fl, 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 = El(), this.relationMode = this.getAttribute("relation-mode") || "selected", this.focusFilter = bl({
|
|
12461
12549
|
mode: this.getAttribute("focus-mode"),
|
|
12462
12550
|
effect: this.getAttribute("focus-effect"),
|
|
12463
12551
|
layout: this.getAttribute("focus-layout")
|
|
12464
|
-
}), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation =
|
|
12552
|
+
}), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation = xl(this.getAttribute("selection-navigation")), this.itemFacing = Sl(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
12553
|
this.ready && this.modelData && this._build();
|
|
12466
12554
|
}, this._bindControls(), this._syncFocusToolbar(), this._syncRelationToolbar(), this._syncLabelsToolbar(), this._syncPanelToolbar(), this._syncItemFacingToolbar(), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(this.canvas);
|
|
12467
12555
|
}
|
|
@@ -12473,7 +12561,7 @@ var Hl = class extends HTMLElement {
|
|
|
12473
12561
|
}
|
|
12474
12562
|
attributeChangedCallback(e, t, n) {
|
|
12475
12563
|
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" &&
|
|
12564
|
+
if (e === "height" && this.style.setProperty("--lc-height", n || "680px"), e === "relation-mode" && this.ready && this.setRelationMode(n || "selected"), e === "selection-mode" && this.setSelectionMode(n || "internal"), e === "selection-navigation" && this.setSelectionNavigation(n), e === "item-facing" && Sl(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
12565
|
let e = n !== "false";
|
|
12478
12566
|
e !== this.showShellLabels && (this.showShellLabels = e, this._build({
|
|
12479
12567
|
preserveSelection: this.selected?.id,
|
|
@@ -12516,7 +12604,7 @@ var Hl = class extends HTMLElement {
|
|
|
12516
12604
|
this.setPalette(e);
|
|
12517
12605
|
}
|
|
12518
12606
|
captureFrame() {
|
|
12519
|
-
return
|
|
12607
|
+
return Zl(this.renderer, this.scene, this.camera, this.ownerDocument);
|
|
12520
12608
|
}
|
|
12521
12609
|
prepareForPrint() {
|
|
12522
12610
|
if (this._printState) return this;
|
|
@@ -12621,13 +12709,13 @@ var Hl = class extends HTMLElement {
|
|
|
12621
12709
|
if (!e.size) return null;
|
|
12622
12710
|
for (let t of [...e]) {
|
|
12623
12711
|
let n = this.nodes.get(t);
|
|
12624
|
-
n &&
|
|
12712
|
+
n && yl(n.type) && this._descendantIds(t, e);
|
|
12625
12713
|
}
|
|
12626
12714
|
let t = new Set(e);
|
|
12627
12715
|
for (let n of this.relations) (t.has(n.from) || t.has(n.to)) && (e.add(n.from), e.add(n.to));
|
|
12628
12716
|
for (let t of [...e]) {
|
|
12629
12717
|
let n = this.nodes.get(t);
|
|
12630
|
-
n &&
|
|
12718
|
+
n && yl(n.type) && this._descendantIds(t, e);
|
|
12631
12719
|
}
|
|
12632
12720
|
for (let t of [...e]) {
|
|
12633
12721
|
let n = this.nodes.get(t)?.parent ? this.nodes.get(this.nodes.get(t).parent) : null;
|
|
@@ -12704,7 +12792,7 @@ var Hl = class extends HTMLElement {
|
|
|
12704
12792
|
});
|
|
12705
12793
|
}
|
|
12706
12794
|
setFocusFilter(e = {}, t = {}) {
|
|
12707
|
-
let n =
|
|
12795
|
+
let n = bl({
|
|
12708
12796
|
...this.focusFilter,
|
|
12709
12797
|
...e || {}
|
|
12710
12798
|
}), r = JSON.stringify(n) !== JSON.stringify(this.focusFilter);
|
|
@@ -12722,7 +12810,7 @@ var Hl = class extends HTMLElement {
|
|
|
12722
12810
|
"none"
|
|
12723
12811
|
].includes(e.relationMode) && e.relationMode !== this.relationMode && this.setRelationMode(e.relationMode), Object.hasOwn(e, "selectionMode") && e.selectionMode !== this.selectionMode && this.setSelectionMode(e.selectionMode);
|
|
12724
12812
|
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") &&
|
|
12813
|
+
return t != null && t !== this.selectionNavigation && this.setSelectionNavigation(t), Object.hasOwn(e, "toolbar") && e.toolbar !== !1 !== this.toolbarVisible && this.setToolbarVisible(e.toolbar !== !1), Object.hasOwn(e, "shellLabels") && e.shellLabels !== !1 !== this.showShellLabels && this.setShellLabels(e.shellLabels !== !1), Object.hasOwn(e, "itemFacing") && Sl(e.itemFacing) !== this.itemFacing && this.setItemFacing(e.itemFacing, {
|
|
12726
12814
|
emit: !1,
|
|
12727
12815
|
source: "model"
|
|
12728
12816
|
}), e.focus && this.setFocusFilter(e.focus, { emit: !1 }), this;
|
|
@@ -12735,10 +12823,10 @@ var Hl = class extends HTMLElement {
|
|
|
12735
12823
|
}));
|
|
12736
12824
|
}
|
|
12737
12825
|
_containerEntityIds() {
|
|
12738
|
-
return (this.modelData?.entities || []).filter((e) =>
|
|
12826
|
+
return (this.modelData?.entities || []).filter((e) => yl(e.type)).map((e) => e.id);
|
|
12739
12827
|
}
|
|
12740
12828
|
_declaredOpenContainerIds() {
|
|
12741
|
-
return (this.modelData?.entities || []).filter((e) =>
|
|
12829
|
+
return (this.modelData?.entities || []).filter((e) => yl(e.type) && e.open === !0).map((e) => e.id);
|
|
12742
12830
|
}
|
|
12743
12831
|
_emitContainerStateChange(e, t = {}) {
|
|
12744
12832
|
if (!e?.changed || t.emit === !1) return;
|
|
@@ -12796,7 +12884,7 @@ var Hl = class extends HTMLElement {
|
|
|
12796
12884
|
}
|
|
12797
12885
|
_commitModelChange(e, t = {}, n = {}) {
|
|
12798
12886
|
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 =
|
|
12887
|
+
this.modelData = Rl(this.modelData);
|
|
12800
12888
|
let o = this._syncInitialContainerState({
|
|
12801
12889
|
refresh: !1,
|
|
12802
12890
|
emit: !1,
|
|
@@ -12813,7 +12901,7 @@ var Hl = class extends HTMLElement {
|
|
|
12813
12901
|
}
|
|
12814
12902
|
updateModel(e = {}, t = {}) {
|
|
12815
12903
|
if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("El parche del modelo debe ser un objeto.");
|
|
12816
|
-
let n = this.modelData ||
|
|
12904
|
+
let n = this.modelData || Rl({}), r = JSON.stringify(n.render?.camera || null), i = {
|
|
12817
12905
|
...n,
|
|
12818
12906
|
...e,
|
|
12819
12907
|
palette: e.palette ? {
|
|
@@ -12824,11 +12912,11 @@ var Hl = class extends HTMLElement {
|
|
|
12824
12912
|
entities: Array.isArray(e.entities) ? e.entities : n.entities,
|
|
12825
12913
|
relations: Array.isArray(e.relations) ? e.relations : n.relations
|
|
12826
12914
|
};
|
|
12827
|
-
return this.modelData =
|
|
12915
|
+
return this.modelData = Rl(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
12916
|
}
|
|
12829
12917
|
addEntity(e, t = {}) {
|
|
12830
12918
|
if (!e || typeof e != "object" || !e.id) throw TypeError("La entidad debe incluir un id.");
|
|
12831
|
-
if (this.modelData ||=
|
|
12919
|
+
if (this.modelData ||= Rl({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`Ya existe una entidad con id "${e.id}".`);
|
|
12832
12920
|
if (e.parent && !this.modelData.entities.some((t) => t.id === e.parent)) throw Error(`No existe el contenedor padre "${e.parent}".`);
|
|
12833
12921
|
return this.modelData.entities = [...this.modelData.entities, { ...e }], this._commitModelChange("entity-add", { entity: this._publicEntity(e.id) }, t);
|
|
12834
12922
|
}
|
|
@@ -12908,7 +12996,7 @@ var Hl = class extends HTMLElement {
|
|
|
12908
12996
|
return this.targetZoom = Math.max(el, this.targetZoom / 1.18), this.invalidate(), this;
|
|
12909
12997
|
}
|
|
12910
12998
|
setSelectionNavigation(e) {
|
|
12911
|
-
let t =
|
|
12999
|
+
let t = xl(e);
|
|
12912
13000
|
return this.selectionNavigation = t, this.getAttribute("selection-navigation") !== t && this.setAttribute("selection-navigation", t), this;
|
|
12913
13001
|
}
|
|
12914
13002
|
focusSelection(e = {}) {
|
|
@@ -12921,7 +13009,7 @@ var Hl = class extends HTMLElement {
|
|
|
12921
13009
|
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
13010
|
}
|
|
12923
13011
|
_applySelectionNavigation(e = this.selectionNavigation) {
|
|
12924
|
-
let t =
|
|
13012
|
+
let t = xl(e);
|
|
12925
13013
|
if (t === "preserve") return this;
|
|
12926
13014
|
let n = this.targetZoom;
|
|
12927
13015
|
return this.focusSelection(), t === "center" && (this.targetZoom = n), this;
|
|
@@ -12970,14 +13058,14 @@ var Hl = class extends HTMLElement {
|
|
|
12970
13058
|
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
13059
|
return this.panBy(-e * r, t * r);
|
|
12972
13060
|
}
|
|
12973
|
-
fit() {
|
|
12974
|
-
let
|
|
12975
|
-
for (let
|
|
12976
|
-
let n = this._worldPosition(
|
|
12977
|
-
|
|
13061
|
+
fit(e = {}) {
|
|
13062
|
+
let t = new Fe();
|
|
13063
|
+
for (let e of this.nodes.values()) {
|
|
13064
|
+
let n = this._worldPosition(e), r = new U(e.s[0] / 2, e.s[1] / 2, e.s[2] / 2);
|
|
13065
|
+
t.expandByPoint(n.clone().sub(r)), t.expandByPoint(n.clone().add(r));
|
|
12978
13066
|
}
|
|
12979
|
-
let
|
|
12980
|
-
return this.targetZoom = Math.max(el, Math.min(2.8,
|
|
13067
|
+
let n = t.isEmpty() ? new U() : t.getCenter(new U()), r = t.isEmpty() ? new U(1, 1, 1) : t.getSize(new U()), i = Math.max(1, r.length() / 2), a = de.degToRad(this.camera.fov), o = i / Math.sin(a / 2) * 1.12, s = this._baseCameraDistance();
|
|
13068
|
+
return this.targetZoom = Math.max(el, 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
13069
|
}
|
|
12982
13070
|
frontView() {
|
|
12983
13071
|
return this.yaw = 0, this.pitch = 0, this.invalidate(), this;
|
|
@@ -12993,7 +13081,7 @@ var Hl = class extends HTMLElement {
|
|
|
12993
13081
|
return this.setShellLabels(!this.showShellLabels);
|
|
12994
13082
|
}
|
|
12995
13083
|
setItemFacing(e = "camera", t = {}) {
|
|
12996
|
-
let n =
|
|
13084
|
+
let n = Sl(e), r = n !== this.itemFacing;
|
|
12997
13085
|
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
13086
|
mode: n,
|
|
12999
13087
|
source: t.source || "api"
|
|
@@ -13003,7 +13091,7 @@ var Hl = class extends HTMLElement {
|
|
|
13003
13091
|
return this.setItemFacing(this.itemFacing === "camera" ? "model" : "camera", e);
|
|
13004
13092
|
}
|
|
13005
13093
|
_applyItemFacing() {
|
|
13006
|
-
if (this.camera) for (let e of this.nodes.values()) e.group && !
|
|
13094
|
+
if (this.camera) for (let e of this.nodes.values()) e.group && !yl(e.type) && (this.itemFacing === "camera" ? e.group.quaternion.copy(this.camera.quaternion) : e.group.quaternion.identity());
|
|
13007
13095
|
}
|
|
13008
13096
|
isContainerOpen(e) {
|
|
13009
13097
|
return this._containerEntityIds().includes(e) && this.open.has(e);
|
|
@@ -13018,14 +13106,14 @@ var Hl = class extends HTMLElement {
|
|
|
13018
13106
|
setContainerOpen(e, t = !0, n = {}) {
|
|
13019
13107
|
let r = this.modelData?.entities?.find((t) => t.id === e);
|
|
13020
13108
|
if (!r) throw Error(`No existe una entidad con id "${e}".`);
|
|
13021
|
-
if (!
|
|
13109
|
+
if (!yl(r.type)) throw TypeError(`La entidad "${e}" no es un contenedor.`);
|
|
13022
13110
|
let i = new Set(this.open);
|
|
13023
13111
|
if (t) i.add(e);
|
|
13024
13112
|
else if (i.delete(e), n.closeDescendants !== !1) for (let t of this.modelData.entities) {
|
|
13025
13113
|
let n = t.parent, r = /* @__PURE__ */ new Set();
|
|
13026
13114
|
for (; n && !r.has(n);) {
|
|
13027
13115
|
if (r.add(n), n === e) {
|
|
13028
|
-
|
|
13116
|
+
yl(t.type) && i.delete(t.id);
|
|
13029
13117
|
break;
|
|
13030
13118
|
}
|
|
13031
13119
|
n = this.modelData.entities.find((e) => e.id === n)?.parent || null;
|
|
@@ -13062,13 +13150,13 @@ var Hl = class extends HTMLElement {
|
|
|
13062
13150
|
this.setTheme(e);
|
|
13063
13151
|
}
|
|
13064
13152
|
get theme() {
|
|
13065
|
-
return this._theme ||
|
|
13153
|
+
return this._theme || El();
|
|
13066
13154
|
}
|
|
13067
13155
|
set theme(e) {
|
|
13068
|
-
this._theme =
|
|
13156
|
+
this._theme = El(e), this.shadowRoot && this._applyTheme();
|
|
13069
13157
|
}
|
|
13070
13158
|
setTheme(e = {}) {
|
|
13071
|
-
return this.theme =
|
|
13159
|
+
return this.theme = Tl(this.theme, e), this.modelData && (this.modelData.theme = this.theme), this._applyLighting(), this.invalidate(), this;
|
|
13072
13160
|
}
|
|
13073
13161
|
_applyTheme() {
|
|
13074
13162
|
let e = this.theme, t = this.style;
|
|
@@ -13099,7 +13187,7 @@ var Hl = class extends HTMLElement {
|
|
|
13099
13187
|
this._loading = !0, this._pendingSelection = null;
|
|
13100
13188
|
try {
|
|
13101
13189
|
let t = typeof e == "string" ? await fetch(e).then((e) => e.json()) : e;
|
|
13102
|
-
this.modelData =
|
|
13190
|
+
this.modelData = Rl(t), this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this._initialOpenContainers.clear(), this._pendingPalette &&= (this.modelData.palette = {
|
|
13103
13191
|
...this.modelData.palette,
|
|
13104
13192
|
...this._pendingPalette
|
|
13105
13193
|
}, null), this.theme = this.modelData.theme, this._applyTheme(), this._syncInitialContainerState({
|
|
@@ -13130,9 +13218,9 @@ var Hl = class extends HTMLElement {
|
|
|
13130
13218
|
}
|
|
13131
13219
|
_applyLighting() {
|
|
13132
13220
|
if (!this.ambientLight || !this.directionalLight) return;
|
|
13133
|
-
let e = this.theme?.lighting ||
|
|
13221
|
+
let e = this.theme?.lighting || wl.lighting;
|
|
13134
13222
|
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 :
|
|
13223
|
+
let t = Array.isArray(e.directionalPosition) ? e.directionalPosition : wl.lighting.directionalPosition;
|
|
13136
13224
|
this.directionalLight.position.fromArray(t);
|
|
13137
13225
|
}
|
|
13138
13226
|
_worldPosition(e, t = /* @__PURE__ */ new Set()) {
|
|
@@ -13169,7 +13257,7 @@ var Hl = class extends HTMLElement {
|
|
|
13169
13257
|
...e.geometryPalette || {},
|
|
13170
13258
|
...e.geometryPaletteOverrides || {}
|
|
13171
13259
|
};
|
|
13172
|
-
n.material.color.set(
|
|
13260
|
+
n.material.color.set(Kl(n.value, r, t));
|
|
13173
13261
|
}
|
|
13174
13262
|
}
|
|
13175
13263
|
}
|
|
@@ -13182,19 +13270,19 @@ var Hl = class extends HTMLElement {
|
|
|
13182
13270
|
for (let e of this.modelData.entities) {
|
|
13183
13271
|
let t = this.nodes.get(e.id);
|
|
13184
13272
|
t.group = new Qn(), t.group.position.copy(this._worldPosition(t));
|
|
13185
|
-
let n = e.geometry || "box", r =
|
|
13273
|
+
let n = e.geometry || "box", r = vl(n), i = !r && n.includes("."), a = i ? "#ed8f98" : this.modelData.palette[e.c] || e.c || this.modelData.palette.component;
|
|
13186
13274
|
i && this.dispatchEvent(new CustomEvent("lc-warning", { detail: {
|
|
13187
13275
|
code: "GEOMETRY_NOT_REGISTERED",
|
|
13188
13276
|
geometry: n,
|
|
13189
13277
|
entityId: e.id
|
|
13190
13278
|
} }));
|
|
13191
|
-
let o = r?.primitive || n, s = r && !r.primitive && !
|
|
13279
|
+
let o = r?.primitive || n, s = r && !r.primitive && !yl(e.type);
|
|
13192
13280
|
if (t.geometryDefinition = r || null, t.geometryMissing = i, t.geometryPalette = r?.palette || {}, t.geometryPaletteOverrides = e.geometryPalette || e.geometry_palette || {}, t.ports = {
|
|
13193
13281
|
...r?.anchors || {},
|
|
13194
13282
|
...e.ports || {}
|
|
13195
13283
|
}, s) {
|
|
13196
13284
|
try {
|
|
13197
|
-
let n =
|
|
13285
|
+
let n = Yl(r, e, this.modelData.palette, () => this.invalidate(), (e) => this.dispatchEvent(new CustomEvent("lc-warning", { detail: e })));
|
|
13198
13286
|
n.root.scale.multiply(new U().fromArray(e.s)), t.appearanceMaterials = [], n.root.traverse((e) => {
|
|
13199
13287
|
if (!(e.isMesh || e.isLine || e.isLineSegments || e.isSprite)) return;
|
|
13200
13288
|
e.userData.node = t;
|
|
@@ -13215,7 +13303,7 @@ var Hl = class extends HTMLElement {
|
|
|
13215
13303
|
entityId: e.id,
|
|
13216
13304
|
error: r
|
|
13217
13305
|
} }));
|
|
13218
|
-
let i =
|
|
13306
|
+
let i = Wl(Ul("box"));
|
|
13219
13307
|
t.material = new ia({
|
|
13220
13308
|
color: "#ed8f98",
|
|
13221
13309
|
roughness: .72,
|
|
@@ -13224,13 +13312,13 @@ var Hl = class extends HTMLElement {
|
|
|
13224
13312
|
}
|
|
13225
13313
|
t.labelSize = new U().fromArray(e.s);
|
|
13226
13314
|
} else {
|
|
13227
|
-
let n = o === "box" && Number(e.radius) > 0, r =
|
|
13228
|
-
n ||
|
|
13315
|
+
let n = o === "box" && Number(e.radius) > 0, r = Ul(o, e.radius, e.segments, e.s);
|
|
13316
|
+
n || Wl(r), t.material = new ia({
|
|
13229
13317
|
color: a,
|
|
13230
13318
|
roughness: .72,
|
|
13231
13319
|
metalness: .06,
|
|
13232
13320
|
transparent: !0,
|
|
13233
|
-
opacity:
|
|
13321
|
+
opacity: yl(e.type) ? .96 : 1
|
|
13234
13322
|
}), t.mesh = new An(r, t.material), t.mesh.scale.fromArray(n ? [
|
|
13235
13323
|
1,
|
|
13236
13324
|
1,
|
|
@@ -13245,7 +13333,7 @@ var Hl = class extends HTMLElement {
|
|
|
13245
13333
|
1
|
|
13246
13334
|
] : e.s), t.group.add(t.edge);
|
|
13247
13335
|
}
|
|
13248
|
-
t.label =
|
|
13336
|
+
t.label = Xl(e.name, a, t.labelSize, e.type, this.showShellLabels), t.label.userData.node = t, t.label.traverse((e) => {
|
|
13249
13337
|
e.userData.node = t;
|
|
13250
13338
|
}), t.group.add(t.label), this.scene.add(t.group);
|
|
13251
13339
|
}
|
|
@@ -13292,7 +13380,7 @@ var Hl = class extends HTMLElement {
|
|
|
13292
13380
|
if (!o && this.focusFilter.effect === "hide") continue;
|
|
13293
13381
|
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
13382
|
if (u.lengthSq() < .01) continue;
|
|
13295
|
-
let d =
|
|
13383
|
+
let d = Dl(e), f = r === this.selectedRelationIndex, p = (e, t = .055, n = .88) => {
|
|
13296
13384
|
let r = new rn({
|
|
13297
13385
|
color: e,
|
|
13298
13386
|
transparent: !0,
|
|
@@ -13342,8 +13430,8 @@ var Hl = class extends HTMLElement {
|
|
|
13342
13430
|
if (!this.modelData) return;
|
|
13343
13431
|
let e = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex];
|
|
13344
13432
|
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>" +
|
|
13433
|
+
let t = Dl(e), n = e.text ? "<p>" + Il(e.text) + "</p>" : "", r = Ll(e.url);
|
|
13434
|
+
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button><button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">RELACIÓN</div><h2>" + Il(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + Il(e.from) + " → " + Il(e.to) + "</div>" + n + r + "<h3>MODO</h3><p>" + Il(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
13435
|
return;
|
|
13348
13436
|
}
|
|
13349
13437
|
let t = this.selected;
|
|
@@ -13353,11 +13441,11 @@ var Hl = class extends HTMLElement {
|
|
|
13353
13441
|
}
|
|
13354
13442
|
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
13443
|
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>" +
|
|
13444
|
+
let s = "<nav class=\"crumbs\" aria-label=\"Ruta del modelo\"><button data-action=\"overview\">Modelo</button>" + i.map((e, t) => "<span>/</span><button data-action=\"path\" data-id=\"" + Il(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + Il(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
|
|
13445
|
+
let n = this.relations.indexOf(e), r = e.text ? "<small>" + Il(e.text) + "</small>" : "";
|
|
13446
|
+
return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + Il(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + Il(e.from) + " → " + Il(e.to) + "</small>" + r + "</button>";
|
|
13359
13447
|
}).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\">" +
|
|
13448
|
+
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">" + Il(yl(t.type) ? "CONTENEDOR" : t.type === "actor" ? "ACTOR EXTERNO" : "COMPONENTE") + "</div><h2>" + Il(t.name) + "</h2><div class=\"sub\">" + Il(t.sub || "") + "</div><p>" + Il(t.text || "") + "</p>" + Ll(t.url) + (yl(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
13449
|
this.toggleContainer(t.id, { source: "panel" });
|
|
13362
13450
|
}), this._applyTheme();
|
|
13363
13451
|
}
|
|
@@ -13366,7 +13454,7 @@ var Hl = class extends HTMLElement {
|
|
|
13366
13454
|
if (!n) return this;
|
|
13367
13455
|
let r = new Set(this.open), i = n.parent ? this.nodes.get(n.parent) : null;
|
|
13368
13456
|
for (; i;) r.add(i.id), i = i.parent ? this.nodes.get(i.parent) : null;
|
|
13369
|
-
return this.selected = n, this.selectedRelationIndex = null,
|
|
13457
|
+
return this.selected = n, this.selectedRelationIndex = null, yl(n.type) && r.add(n.id), this._replaceOpenContainers(r, {
|
|
13370
13458
|
refresh: !1,
|
|
13371
13459
|
source: t.source || "api"
|
|
13372
13460
|
}), 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 +13518,19 @@ var Hl = class extends HTMLElement {
|
|
|
13430
13518
|
for (let e of this.nodes.values()) {
|
|
13431
13519
|
let t = this._focusAlpha(e, i), n = this._isVisible(e) && t > 0;
|
|
13432
13520
|
e.group.visible = n;
|
|
13433
|
-
let r =
|
|
13434
|
-
if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material)
|
|
13521
|
+
let r = yl(e.type) && this.open.has(e.id), a = (r ? .12 : 1) * t;
|
|
13522
|
+
if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material) Cl(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
13523
|
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),
|
|
13524
|
+
for (let n of e.appearanceMaterials || []) Object.hasOwn(n.userData, "atlasBaseOpacity") || (n.userData.atlasBaseOpacity = n.opacity ?? 1), Object.hasOwn(n.userData, "atlasBaseTransparent") || (n.userData.atlasBaseTransparent = n.transparent), Object.hasOwn(n.userData, "atlasBaseDepthWrite") || (n.userData.atlasBaseDepthWrite = n.depthWrite), Cl(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
13525
|
e._appearanceSelected = e === this.selected;
|
|
13438
13526
|
}
|
|
13439
13527
|
e.edge?.material && (e.edge.material.opacity = (e === this.selected ? 1 : .65) * t);
|
|
13440
|
-
let o =
|
|
13528
|
+
let o = yl(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
13529
|
e.label.userData.textOffsetY;
|
|
13442
13530
|
let m = e.labelSize || new U().fromArray(e.s);
|
|
13443
13531
|
e.label.visible = n;
|
|
13444
|
-
let h = this._worldPosition(e), g = this.itemFacing === "camera" && !
|
|
13445
|
-
if (
|
|
13532
|
+
let h = this._worldPosition(e), g = this.itemFacing === "camera" && !yl(e.type) || this.camera.position.z >= h.z, _ = this.camera.position.y > h.y + .25;
|
|
13533
|
+
if (yl(e.type)) {
|
|
13446
13534
|
c.visible = g && (!o || s), l.visible = !g && (!o || s), u.visible = s && _;
|
|
13447
13535
|
let e = s ? .52 : 1;
|
|
13448
13536
|
c.scale.setScalar(e), c.position.x = s ? -m.x / 2 + .18 + f * e / 2 - p * e : 0;
|
|
@@ -13461,7 +13549,7 @@ var Hl = class extends HTMLElement {
|
|
|
13461
13549
|
let t = this.canvas.getBoundingClientRect();
|
|
13462
13550
|
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
13551
|
let n = [];
|
|
13464
|
-
for (let e of this.nodes.values()) e.group.visible && (
|
|
13552
|
+
for (let e of this.nodes.values()) e.group.visible && (yl(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
13553
|
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
13554
|
if (r && (!a || r.distance <= a.distance + .12)) {
|
|
13467
13555
|
let e = r.object;
|
|
@@ -13610,11 +13698,11 @@ var Hl = class extends HTMLElement {
|
|
|
13610
13698
|
}
|
|
13611
13699
|
_showError(e) {
|
|
13612
13700
|
let t = this.shadowRoot.querySelector(".viewport"), n = t.querySelector(".error");
|
|
13613
|
-
n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" +
|
|
13701
|
+
n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" + Il(e) + "</div>");
|
|
13614
13702
|
}
|
|
13615
13703
|
};
|
|
13616
|
-
customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas",
|
|
13704
|
+
customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas", Ql);
|
|
13617
13705
|
//#endregion
|
|
13618
|
-
export { Qc as ATLAS_VERSION,
|
|
13706
|
+
export { Qc as ATLAS_VERSION, Ql as LiquidCarsAtlas, Zl as captureRendererFrame, gl as getGeometryCatalog, _l as getGeometryPackCatalog, Rl as normalizeModel, ml as registerGeometryPack, hl as unregisterGeometryPack };
|
|
13619
13707
|
|
|
13620
13708
|
//# sourceMappingURL=liquidcars-atlas.js.map
|