shop-components 0.4.9 → 0.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/src/amr.d.ts +15 -0
- package/dist/shop-components.cjs +78 -78
- package/dist/shop-components.mjs +744 -664
- package/dist/test.glb +0 -0
- package/package.json +1 -1
package/dist/shop-components.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var E = (o, e, t) => (
|
|
1
|
+
var qn = Object.defineProperty;
|
|
2
|
+
var jn = (o, e, t) => e in o ? qn(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var E = (o, e, t) => (jn(o, typeof e != "symbol" ? e + "" : e, t), t), rr = (o, e, t) => {
|
|
4
4
|
if (!e.has(o))
|
|
5
5
|
throw TypeError("Cannot " + t);
|
|
6
6
|
};
|
|
@@ -10,28 +10,28 @@ var H = (o, e, t) => (rr(o, e, "read from private field"), t ? t.call(o) : e.get
|
|
|
10
10
|
e instanceof WeakSet ? e.add(o) : e.set(o, t);
|
|
11
11
|
}, Ie = (o, e, t, i) => (rr(o, e, "write to private field"), i ? i.call(o, t) : e.set(o, t), t);
|
|
12
12
|
import * as k from "three";
|
|
13
|
-
import { BufferAttribute as fe, BufferGeometry as le, Matrix4 as J, Matrix3 as
|
|
13
|
+
import { BufferAttribute as fe, BufferGeometry as le, Matrix4 as J, Matrix3 as hn, Vector3 as b, Vector4 as it, MeshBasicMaterial as ni, Mesh as X, ShaderMaterial as kt, NoBlending as ri, WebGLRenderTarget as Oe, FloatType as pe, RGBAFormat as te, NearestFilter as ee, Vector2 as z, PerspectiveCamera as Gi, DataUtils as Be, DataTexture as ze, HalfFloatType as Se, LinearFilter as Te, RepeatWrapping as et, RedFormat as xs, ClampToEdgeWrapping as We, Source as Qn, Quaternion as fn, DataArrayTexture as Yn, DoubleSide as oi, BackSide as dn, FrontSide as ws, Color as K, WebGLArrayRenderTarget as Zn, UnsignedByteType as Vs, NoToneMapping as Xn, RGFormat as Kn, NormalBlending as pn, Spherical as Jn, EquirectangularReflectionMapping as ki, LinearMipMapLinearFilter as $n, Clock as qi, Scene as bs, AdditiveBlending as eo, Box3 as Y, Sphere as ji, CompressedTexture as to, Texture as Qe, InterleavedBuffer as io, InterleavedBufferAttribute as so, TextureLoader as mn, MeshStandardMaterial as ro, Group as ge, LineSegments as As, LineBasicMaterial as nr, Object3D as Bt, LineDashedMaterial as Ts, RingGeometry as or, BoxGeometry as no, EdgesGeometry as oo, SRGBColorSpace as Bi, AnimationMixer as ar, LoopRepeat as ao, LoopOnce as lo, Plane as Ns, Line3 as Ue, Triangle as Kt, MathUtils as Ye, DirectionalLight as co, NoColorSpace as lr, PlaneGeometry as Oi, MeshLambertMaterial as uo, DirectionalLightHelper as ho, PlaneHelper as fo, UniformsUtils as po, WebGLRenderer as mo, OrthographicCamera as Ss, Raycaster as go, MeshPhysicalMaterial as vo, ACESFilmicToneMapping as _o, Euler as yo } from "three";
|
|
14
14
|
import { HDRLoader as cr } from "three/examples/jsm/loaders/HDRLoader.js";
|
|
15
|
-
import { OrbitControls as
|
|
16
|
-
import { CSS2DObject as
|
|
17
|
-
import { Font as
|
|
15
|
+
import { OrbitControls as xo } from "three/examples/jsm/controls/OrbitControls";
|
|
16
|
+
import { CSS2DObject as He, CSS2DRenderer as wo } from "three/examples/jsm/renderers/CSS2DRenderer";
|
|
17
|
+
import { Font as bo } from "three/examples/jsm/loaders/FontLoader";
|
|
18
18
|
import { GLTFLoader as Gs } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
19
|
-
import { MeshoptDecoder as
|
|
20
|
-
import { DRACOLoader as
|
|
21
|
-
import { GLTFLoader as
|
|
22
|
-
import { DRACOLoader as
|
|
23
|
-
import { DRACOExporter as
|
|
24
|
-
import { GLTFExporter as
|
|
19
|
+
import { MeshoptDecoder as Ao } from "three/examples/jsm/libs/meshopt_decoder.module.js";
|
|
20
|
+
import { DRACOLoader as To } from "three/examples/jsm/loaders/DRACOLoader.js";
|
|
21
|
+
import { GLTFLoader as So } from "three/examples/jsm/loaders/GLTFLoader";
|
|
22
|
+
import { DRACOLoader as Mo } from "three/examples/jsm/loaders/DRACOLoader";
|
|
23
|
+
import { DRACOExporter as Co } from "three/examples/jsm/exporters/DRACOExporter";
|
|
24
|
+
import { GLTFExporter as Io } from "three/examples/jsm/exporters/GLTFExporter";
|
|
25
25
|
import * as Ji from "three/examples/jsm/utils/SkeletonUtils.js";
|
|
26
|
-
import { Line2 as
|
|
27
|
-
import { LineMaterial as
|
|
26
|
+
import { Line2 as Ro } from "three/examples/jsm/lines/Line2.js";
|
|
27
|
+
import { LineMaterial as Do } from "three/examples/jsm/lines/LineMaterial.js";
|
|
28
28
|
import { LineGeometry as ur } from "three/examples/jsm/lines/LineGeometry.js";
|
|
29
29
|
import { CSS3DObject as Po } from "three/examples/jsm/renderers/CSS3DRenderer";
|
|
30
30
|
import "three/examples/jsm/utils/BufferGeometryUtils";
|
|
31
31
|
import { FullScreenQuad as ci } from "three/examples/jsm/postprocessing/Pass";
|
|
32
|
-
import { SAH as
|
|
32
|
+
import { SAH as Eo, MeshBVH as Lo, FloatVertexAttributeTexture as Fo, MeshBVHUniformStruct as ko, UIntVertexAttributeTexture as Bo, BVHShaderGLSL as $i } from "three-mesh-bvh";
|
|
33
33
|
import { FullScreenQuad as Et } from "three/examples/jsm/postprocessing/Pass.js";
|
|
34
|
-
function
|
|
34
|
+
function gn(o, e, t = 0) {
|
|
35
35
|
if (o.isInterleavedBufferAttribute) {
|
|
36
36
|
const i = o.itemSize;
|
|
37
37
|
for (let s = 0, a = o.count; s < a; s++) {
|
|
@@ -55,7 +55,7 @@ function St(o, e) {
|
|
|
55
55
|
const t = o.count === e.count, i = o.normalized === e.normalized, s = o.array.constructor === e.array.constructor, a = o.itemSize === e.itemSize;
|
|
56
56
|
return !(!t || !i || !s || !a);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Oo(o) {
|
|
59
59
|
const e = o[0].index !== null, t = new Set(Object.keys(o[0].attributes));
|
|
60
60
|
if (!o[0].getAttribute("position"))
|
|
61
61
|
throw new Error("StaticGeometryGenerator: position attribute is required.");
|
|
@@ -73,34 +73,34 @@ function Bo(o) {
|
|
|
73
73
|
throw new Error("StaticGeometryGenerator: All geometries must have the same number of attributes.");
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function zo(o) {
|
|
77
77
|
let e = 0;
|
|
78
78
|
for (let t = 0, i = o.length; t < i; t++)
|
|
79
79
|
e += o[t].getIndex().count;
|
|
80
80
|
return e;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Uo(o) {
|
|
83
83
|
let e = 0;
|
|
84
84
|
for (let t = 0, i = o.length; t < i; t++)
|
|
85
85
|
e += o[t].getAttribute("position").count;
|
|
86
86
|
return e;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Ho(o, e, t) {
|
|
89
89
|
o.index && o.index.count !== e && o.setIndex(null);
|
|
90
90
|
const i = o.attributes;
|
|
91
91
|
for (const s in i)
|
|
92
92
|
i[s].count !== t && o.deleteAttribute(s);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function Wo(o, e = {}, t = new le()) {
|
|
95
95
|
const {
|
|
96
96
|
useGroups: i = !1,
|
|
97
97
|
forceUpdate: s = !1,
|
|
98
98
|
skipAssigningAttributes: a = [],
|
|
99
99
|
overwriteIndex: n = !0
|
|
100
100
|
} = e;
|
|
101
|
-
|
|
102
|
-
const c = o[0].index !== null, u = c ?
|
|
103
|
-
if (
|
|
101
|
+
Oo(o);
|
|
102
|
+
const c = o[0].index !== null, u = c ? zo(o) : -1, f = Uo(o);
|
|
103
|
+
if (Ho(t, u, f), i) {
|
|
104
104
|
let r = 0;
|
|
105
105
|
for (let l = 0, h = o.length; l < h; l++) {
|
|
106
106
|
const m = o[l];
|
|
@@ -134,11 +134,11 @@ function Ho(o, e = {}, t = new le()) {
|
|
|
134
134
|
const p = t.getAttribute(m);
|
|
135
135
|
for (let g = 0, _ = o.length; g < _; g++) {
|
|
136
136
|
const y = o[g], x = !s && !h && a[g], w = y.getAttribute(m);
|
|
137
|
-
x ||
|
|
137
|
+
x || gn(w, p, v), v += w.count;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function Vo(o, e, t) {
|
|
142
142
|
const i = o.index, a = o.attributes.position.count, n = i ? i.count : a;
|
|
143
143
|
let c = o.groups;
|
|
144
144
|
c.length === 0 && (c = [{ count: n, start: 0, materialIndex: 0 }]);
|
|
@@ -156,7 +156,7 @@ function Wo(o, e, t) {
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function No(o, e) {
|
|
160
160
|
if (!o.index) {
|
|
161
161
|
const t = o.attributes.position.count, i = new Array(t);
|
|
162
162
|
for (let s = 0; s < t; s++)
|
|
@@ -209,7 +209,7 @@ function fr(o) {
|
|
|
209
209
|
const e = o.skeleton;
|
|
210
210
|
return e ? (e.boneTexture || e.computeBoneTexture(), `${qs(e.boneTexture.image.data.buffer)}_${e.boneTexture.uuid}`) : null;
|
|
211
211
|
}
|
|
212
|
-
class
|
|
212
|
+
class Go {
|
|
213
213
|
constructor(e = null) {
|
|
214
214
|
this.matrixWorld = new J(), this.geometryHash = null, this.skeletonHash = null, this.primitiveCount = -1, e !== null && this.updateFrom(e);
|
|
215
215
|
}
|
|
@@ -230,7 +230,7 @@ function vr(o, e, t) {
|
|
|
230
230
|
const u = mr.getComponent(c);
|
|
231
231
|
if (u !== 0) {
|
|
232
232
|
const f = pr.getComponent(c);
|
|
233
|
-
gr.multiplyMatrices(a[f].matrixWorld, n[f]),
|
|
233
|
+
gr.multiplyMatrices(a[f].matrixWorld, n[f]), qo(hi, gr, u);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
return hi.multiply(o.bindMatrix).premultiply(o.bindMatrixInverse), t.transformDirection(hi), t;
|
|
@@ -243,12 +243,12 @@ function ts(o, e, t, i, s) {
|
|
|
243
243
|
}
|
|
244
244
|
s.add(ui);
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function qo(o, e, t) {
|
|
247
247
|
const i = o.elements, s = e.elements;
|
|
248
248
|
for (let a = 0, n = s.length; a < n; a++)
|
|
249
249
|
i[a] += s[a] * t;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function jo(o) {
|
|
252
252
|
const { index: e, attributes: t } = o;
|
|
253
253
|
if (e)
|
|
254
254
|
for (let i = 0, s = e.count; i < s; i += 3) {
|
|
@@ -266,7 +266,7 @@ function qo(o) {
|
|
|
266
266
|
}
|
|
267
267
|
return o;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function Qo(o, e = {}, t = new le()) {
|
|
270
270
|
e = {
|
|
271
271
|
applyWorldTransforms: !0,
|
|
272
272
|
attributes: [],
|
|
@@ -276,19 +276,19 @@ function jo(o, e = {}, t = new le()) {
|
|
|
276
276
|
for (const _ in t.attributes)
|
|
277
277
|
(!e.attributes.includes(_) || !(_ in i.attributes)) && t.deleteAttribute(_);
|
|
278
278
|
!t.index && i.index && (t.index = i.index.clone()), u.position || t.setAttribute("position", Jt(c.position)), a && !u.normal && c.normal && t.setAttribute("normal", Jt(c.normal)), n && !u.tangent && c.tangent && t.setAttribute("tangent", Jt(c.tangent)), St(i.index, t.index), St(c.position, u.position), a && St(c.normal, u.normal), n && St(c.tangent, u.tangent);
|
|
279
|
-
const f = c.position, d = a ? c.normal : null, r = n ? c.tangent : null, l = i.morphAttributes.position, h = i.morphAttributes.normal, m = i.morphAttributes.tangent, v = i.morphTargetsRelative, p = o.morphTargetInfluences, g = new
|
|
279
|
+
const f = c.position, d = a ? c.normal : null, r = n ? c.tangent : null, l = i.morphAttributes.position, h = i.morphAttributes.normal, m = i.morphAttributes.tangent, v = i.morphTargetsRelative, p = o.morphTargetInfluences, g = new hn();
|
|
280
280
|
g.getNormalMatrix(o.matrixWorld), i.index && t.index.array.set(i.index.array);
|
|
281
281
|
for (let _ = 0, y = c.position.count; _ < y; _++)
|
|
282
282
|
rt.fromBufferAttribute(f, _), d && nt.fromBufferAttribute(d, _), r && (dr.fromBufferAttribute(r, _), ot.fromBufferAttribute(r, _)), p && (l && ts(l, p, v, _, rt), h && ts(h, p, v, _, nt), m && ts(m, p, v, _, ot)), o.isSkinnedMesh && (o.applyBoneTransform(_, rt), d && vr(o, _, nt), r && vr(o, _, ot)), s && rt.applyMatrix4(o.matrixWorld), u.position.setXYZ(_, rt.x, rt.y, rt.z), d && (s && nt.applyNormalMatrix(g), u.normal.setXYZ(_, nt.x, nt.y, nt.z)), r && (s && ot.transformDirection(o.matrixWorld), u.tangent.setXYZW(_, ot.x, ot.y, ot.z, dr.w));
|
|
283
283
|
for (const _ in e.attributes) {
|
|
284
284
|
const y = e.attributes[_];
|
|
285
|
-
y === "position" || y === "tangent" || y === "normal" || !(y in c) || (u[y] || t.setAttribute(y, Jt(c[y])), St(c[y], u[y]),
|
|
285
|
+
y === "position" || y === "tangent" || y === "normal" || !(y in c) || (u[y] || t.setAttribute(y, Jt(c[y])), St(c[y], u[y]), gn(c[y], u[y]));
|
|
286
286
|
}
|
|
287
|
-
return o.matrixWorld.determinant() < 0 &&
|
|
287
|
+
return o.matrixWorld.determinant() < 0 && jo(t), t;
|
|
288
288
|
}
|
|
289
|
-
class
|
|
289
|
+
class Yo extends le {
|
|
290
290
|
constructor() {
|
|
291
|
-
super(), this.version = 0, this.hash = null, this._diff = new
|
|
291
|
+
super(), this.version = 0, this.hash = null, this._diff = new Go();
|
|
292
292
|
}
|
|
293
293
|
// returns whether the passed mesh is compatible with this baked geometry
|
|
294
294
|
// such that it can be updated without resizing attributes
|
|
@@ -303,17 +303,17 @@ class Qo extends le {
|
|
|
303
303
|
}
|
|
304
304
|
updateFrom(e, t) {
|
|
305
305
|
const i = this._diff;
|
|
306
|
-
return i.didChange(e) ? (
|
|
306
|
+
return i.didChange(e) ? (Qo(e, t, this), i.updateFrom(e), this.version++, this.hash = `${this.uuid}_${this.version}`, !0) : !1;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
const Ms = 0,
|
|
310
|
-
function
|
|
309
|
+
const Ms = 0, vn = 1, _n = 2;
|
|
310
|
+
function Zo(o, e) {
|
|
311
311
|
for (let t = 0, i = o.length; t < i; t++)
|
|
312
312
|
o[t].traverseVisible((a) => {
|
|
313
313
|
a.isMesh && e(a);
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function Xo(o) {
|
|
317
317
|
const e = [];
|
|
318
318
|
for (let t = 0, i = o.length; t < i; t++) {
|
|
319
319
|
const s = o[t];
|
|
@@ -321,7 +321,7 @@ function Zo(o) {
|
|
|
321
321
|
}
|
|
322
322
|
return e;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Ko(o, e, t) {
|
|
325
325
|
if (o.length === 0) {
|
|
326
326
|
e.setIndex(null);
|
|
327
327
|
const i = e.attributes;
|
|
@@ -330,11 +330,11 @@ function Xo(o, e, t) {
|
|
|
330
330
|
for (const s in t.attributes)
|
|
331
331
|
e.setAttribute(t.attributes[s], new fe(new Float32Array(0), 4, !1));
|
|
332
332
|
} else
|
|
333
|
-
|
|
333
|
+
Wo(o, t, e);
|
|
334
334
|
for (const i in e.attributes)
|
|
335
335
|
e.attributes[i].needsUpdate = !0;
|
|
336
336
|
}
|
|
337
|
-
class
|
|
337
|
+
class Jo {
|
|
338
338
|
constructor(e) {
|
|
339
339
|
this.objects = null, this.useGroups = !0, this.applyWorldTransforms = !0, this.generateMissingAttributes = !0, this.overwriteIndex = !0, this.attributes = ["position", "normal", "color", "tangent", "uv", "uv2"], this._intermediateGeometry = /* @__PURE__ */ new Map(), this._geometryMergeSets = /* @__PURE__ */ new WeakMap(), this._mergeOrder = [], this._dummyMesh = null, this.setObjects(e || []);
|
|
340
340
|
}
|
|
@@ -347,7 +347,7 @@ class Ko {
|
|
|
347
347
|
}
|
|
348
348
|
_getMeshes() {
|
|
349
349
|
const e = [];
|
|
350
|
-
return
|
|
350
|
+
return Zo(this.objects, (t) => {
|
|
351
351
|
e.push(t);
|
|
352
352
|
}), e.sort((t, i) => t.uuid > i.uuid ? 1 : t.uuid < i.uuid ? -1 : 0), e.length === 0 && e.push(this._getDummyMesh()), e;
|
|
353
353
|
}
|
|
@@ -360,7 +360,7 @@ class Ko {
|
|
|
360
360
|
const c = t[a], u = c.uuid;
|
|
361
361
|
i.delete(u);
|
|
362
362
|
let f = e.get(u);
|
|
363
|
-
(!f || !f.isCompatible(c, this.attributes)) && (f && f.dispose(), f = new
|
|
363
|
+
(!f || !f.isCompatible(c, this.attributes)) && (f && f.dispose(), f = new Yo(), e.set(u, f)), f.updateFrom(c, s) && this.generateMissingAttributes && No(f, this.attributes);
|
|
364
364
|
}
|
|
365
365
|
i.forEach((a) => {
|
|
366
366
|
e.delete(a);
|
|
@@ -380,19 +380,19 @@ class Ko {
|
|
|
380
380
|
const p = f[l];
|
|
381
381
|
!p || p.uuid !== v.uuid ? (c.push(!1), d = !0) : p.version !== v.version ? c.push(!1) : c.push(!0);
|
|
382
382
|
}
|
|
383
|
-
|
|
383
|
+
Ko(u, e, { useGroups: t, forceUpdate: d, skipAssigningAttributes: c, overwriteIndex: i }), d && e.dispose(), a.set(e, u.map((l) => ({
|
|
384
384
|
version: l.version,
|
|
385
385
|
uuid: l.uuid
|
|
386
386
|
})));
|
|
387
387
|
let r = Ms;
|
|
388
|
-
return d ? r =
|
|
388
|
+
return d ? r = _n : c.includes(!1) && (r = vn), {
|
|
389
389
|
changeType: r,
|
|
390
|
-
materials:
|
|
390
|
+
materials: Xo(n),
|
|
391
391
|
geometry: e
|
|
392
392
|
};
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function $o(o) {
|
|
396
396
|
const e = /* @__PURE__ */ new Set();
|
|
397
397
|
for (let t = 0, i = o.length; t < i; t++) {
|
|
398
398
|
const s = o[t];
|
|
@@ -403,7 +403,7 @@ function Jo(o) {
|
|
|
403
403
|
}
|
|
404
404
|
return Array.from(e);
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function ea(o) {
|
|
407
407
|
const e = [], t = /* @__PURE__ */ new Set();
|
|
408
408
|
for (let s = 0, a = o.length; s < a; s++)
|
|
409
409
|
o[s].traverse((n) => {
|
|
@@ -412,12 +412,12 @@ function $o(o) {
|
|
|
412
412
|
const i = Array.from(t).sort((s, a) => s.uuid < a.uuid ? 1 : s.uuid > a.uuid ? -1 : 0);
|
|
413
413
|
return { lights: e, iesTextures: i };
|
|
414
414
|
}
|
|
415
|
-
class
|
|
415
|
+
class ta {
|
|
416
416
|
get initialized() {
|
|
417
417
|
return !!this.bvh;
|
|
418
418
|
}
|
|
419
419
|
constructor(e) {
|
|
420
|
-
this.bvhOptions = {}, this.attributes = ["position", "normal", "tangent", "color", "uv", "uv2"], this.generateBVH = !0, this.bvh = null, this.geometry = new le(), this.staticGeometryGenerator = new
|
|
420
|
+
this.bvhOptions = {}, this.attributes = ["position", "normal", "tangent", "color", "uv", "uv2"], this.generateBVH = !0, this.bvh = null, this.geometry = new le(), this.staticGeometryGenerator = new Jo(e), this._bvhWorker = null, this._pendingGenerate = null, this._buildAsync = !1;
|
|
421
421
|
}
|
|
422
422
|
setObjects(e) {
|
|
423
423
|
this.staticGeometryGenerator.setObjects(e);
|
|
@@ -443,21 +443,21 @@ class ea {
|
|
|
443
443
|
l.isSkinnedMesh && l.skeleton && l.skeleton.update();
|
|
444
444
|
});
|
|
445
445
|
});
|
|
446
|
-
const n = t.generate(i), c = n.materials, u =
|
|
447
|
-
if (n.changeType !== Ms &&
|
|
446
|
+
const n = t.generate(i), c = n.materials, u = $o(c), { lights: f, iesTextures: d } = ea(a);
|
|
447
|
+
if (n.changeType !== Ms && Vo(i, c, c), this.generateBVH) {
|
|
448
448
|
if (this.bvh instanceof Promise)
|
|
449
449
|
throw new Error("PathTracingSceneGenerator: BVH is already building asynchronously.");
|
|
450
|
-
if (n.changeType ===
|
|
450
|
+
if (n.changeType === _n) {
|
|
451
451
|
const r = {
|
|
452
|
-
strategy:
|
|
452
|
+
strategy: Eo,
|
|
453
453
|
maxLeafTris: 1,
|
|
454
454
|
indirect: !0,
|
|
455
455
|
onProgress: e,
|
|
456
456
|
...this.bvhOptions
|
|
457
457
|
};
|
|
458
|
-
this._buildAsync ? this.bvh = this._bvhWorker.generate(i, r) : this.bvh = new
|
|
458
|
+
this._buildAsync ? this.bvh = this._bvhWorker.generate(i, r) : this.bvh = new Lo(i, r);
|
|
459
459
|
} else
|
|
460
|
-
n.changeType ===
|
|
460
|
+
n.changeType === vn && this.bvh.refit();
|
|
461
461
|
}
|
|
462
462
|
return {
|
|
463
463
|
bvhChanged: n.changeType !== Ms,
|
|
@@ -499,7 +499,7 @@ class js extends kt {
|
|
|
499
499
|
return !1;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
class
|
|
502
|
+
class ia extends js {
|
|
503
503
|
constructor(e) {
|
|
504
504
|
super({
|
|
505
505
|
blending: ri,
|
|
@@ -619,7 +619,7 @@ function di(o = 1) {
|
|
|
619
619
|
}
|
|
620
620
|
`;
|
|
621
621
|
}
|
|
622
|
-
const
|
|
622
|
+
const yn = (
|
|
623
623
|
/* glsl */
|
|
624
624
|
`
|
|
625
625
|
|
|
@@ -645,7 +645,7 @@ const _n = (
|
|
|
645
645
|
}
|
|
646
646
|
|
|
647
647
|
`
|
|
648
|
-
),
|
|
648
|
+
), sa = (
|
|
649
649
|
/* glsl */
|
|
650
650
|
`
|
|
651
651
|
|
|
@@ -726,7 +726,7 @@ const _n = (
|
|
|
726
726
|
}
|
|
727
727
|
|
|
728
728
|
`
|
|
729
|
-
),
|
|
729
|
+
), ra = (
|
|
730
730
|
/* glsl */
|
|
731
731
|
`
|
|
732
732
|
|
|
@@ -773,7 +773,7 @@ const _n = (
|
|
|
773
773
|
|
|
774
774
|
`
|
|
775
775
|
);
|
|
776
|
-
class
|
|
776
|
+
class na extends js {
|
|
777
777
|
constructor() {
|
|
778
778
|
super({
|
|
779
779
|
blending: ri,
|
|
@@ -797,8 +797,8 @@ class ra extends js {
|
|
|
797
797
|
/* glsl */
|
|
798
798
|
`
|
|
799
799
|
|
|
800
|
-
${
|
|
801
|
-
${
|
|
800
|
+
${yn}
|
|
801
|
+
${sa}
|
|
802
802
|
|
|
803
803
|
varying vec2 vUv;
|
|
804
804
|
uniform vec2 resolution;
|
|
@@ -813,9 +813,9 @@ class ra extends js {
|
|
|
813
813
|
});
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
|
-
class
|
|
816
|
+
class oa {
|
|
817
817
|
generate(e, t = 256) {
|
|
818
|
-
const i = new
|
|
818
|
+
const i = new Oe(t, t, {
|
|
819
819
|
type: pe,
|
|
820
820
|
format: te,
|
|
821
821
|
minFilter: ee,
|
|
@@ -823,11 +823,11 @@ class na {
|
|
|
823
823
|
generateMipmaps: !1
|
|
824
824
|
}), s = e.getRenderTarget();
|
|
825
825
|
e.setRenderTarget(i);
|
|
826
|
-
const a = new Et(new
|
|
826
|
+
const a = new Et(new na());
|
|
827
827
|
return a.material.resolution.set(t, t), a.render(e), e.setRenderTarget(s), a.dispose(), i;
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
|
-
class
|
|
830
|
+
class aa extends Gi {
|
|
831
831
|
set bokehSize(e) {
|
|
832
832
|
this.fStop = this.getFocalLength() / e;
|
|
833
833
|
}
|
|
@@ -841,18 +841,18 @@ class oa extends Gi {
|
|
|
841
841
|
return super.copy(e, t), this.fStop = e.fStop, this.apertureBlades = e.apertureBlades, this.apertureRotation = e.apertureRotation, this.focusDistance = e.focusDistance, this.anamorphicRatio = e.anamorphicRatio, this;
|
|
842
842
|
}
|
|
843
843
|
}
|
|
844
|
-
class
|
|
844
|
+
class la {
|
|
845
845
|
constructor() {
|
|
846
846
|
this.bokehSize = 0, this.apertureBlades = 0, this.apertureRotation = 0, this.focusDistance = 10, this.anamorphicRatio = 1;
|
|
847
847
|
}
|
|
848
848
|
updateFrom(e) {
|
|
849
|
-
e instanceof
|
|
849
|
+
e instanceof aa ? (this.bokehSize = e.bokehSize, this.apertureBlades = e.apertureBlades, this.apertureRotation = e.apertureRotation, this.focusDistance = e.focusDistance, this.anamorphicRatio = e.anamorphicRatio) : (this.bokehSize = 0, this.apertureRotation = 0, this.apertureBlades = 0, this.focusDistance = 10, this.anamorphicRatio = 1);
|
|
850
850
|
}
|
|
851
851
|
}
|
|
852
852
|
function is(o) {
|
|
853
853
|
const e = new Uint16Array(o.length);
|
|
854
854
|
for (let t = 0, i = o.length; t < i; ++t)
|
|
855
|
-
e[t] =
|
|
855
|
+
e[t] = Be.toHalfFloat(o[t]);
|
|
856
856
|
return e;
|
|
857
857
|
}
|
|
858
858
|
function _r(o, e, t = 0, i = o.length) {
|
|
@@ -863,12 +863,12 @@ function _r(o, e, t = 0, i = o.length) {
|
|
|
863
863
|
}
|
|
864
864
|
return s - t;
|
|
865
865
|
}
|
|
866
|
-
function
|
|
866
|
+
function ca(o, e, t) {
|
|
867
867
|
return 0.2126 * o + 0.7152 * e + 0.0722 * t;
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function ua(o, e = Se) {
|
|
870
870
|
const t = o.clone();
|
|
871
|
-
t.source = new
|
|
871
|
+
t.source = new Qn({ ...t.image });
|
|
872
872
|
const { width: i, height: s, data: a } = t.image;
|
|
873
873
|
let n = a;
|
|
874
874
|
if (t.type !== e) {
|
|
@@ -877,7 +877,7 @@ function ca(o, e = Se) {
|
|
|
877
877
|
a instanceof Int8Array || a instanceof Int16Array || a instanceof Int32Array ? c = 2 ** (8 * a.BYTES_PER_ELEMENT - 1) - 1 : c = 2 ** (8 * a.BYTES_PER_ELEMENT) - 1;
|
|
878
878
|
for (let u = 0, f = a.length; u < f; u++) {
|
|
879
879
|
let d = a[u];
|
|
880
|
-
t.type === Se && (d =
|
|
880
|
+
t.type === Se && (d = Be.fromHalfFloat(a[u])), t.type !== pe && t.type !== Se && (d /= c), e === Se && (n[u] = Be.toHalfFloat(d));
|
|
881
881
|
}
|
|
882
882
|
t.image.data = n, t.type = e;
|
|
883
883
|
}
|
|
@@ -893,27 +893,27 @@ function ca(o, e = Se) {
|
|
|
893
893
|
}
|
|
894
894
|
return t;
|
|
895
895
|
}
|
|
896
|
-
class
|
|
896
|
+
class ha {
|
|
897
897
|
constructor() {
|
|
898
|
-
const e = new
|
|
898
|
+
const e = new ze(is(new Float32Array([0, 0, 0, 0])), 1, 1);
|
|
899
899
|
e.type = Se, e.format = te, e.minFilter = Te, e.magFilter = Te, e.wrapS = et, e.wrapT = et, e.generateMipmaps = !1, e.needsUpdate = !0;
|
|
900
|
-
const t = new
|
|
900
|
+
const t = new ze(is(new Float32Array([0, 1])), 1, 2);
|
|
901
901
|
t.type = Se, t.format = xs, t.minFilter = Te, t.magFilter = Te, t.generateMipmaps = !1, t.needsUpdate = !0;
|
|
902
|
-
const i = new
|
|
902
|
+
const i = new ze(is(new Float32Array([0, 0, 1, 1])), 2, 2);
|
|
903
903
|
i.type = Se, i.format = xs, i.minFilter = Te, i.magFilter = Te, i.generateMipmaps = !1, i.needsUpdate = !0, this.map = e, this.marginalWeights = t, this.conditionalWeights = i, this.totalSum = 0;
|
|
904
904
|
}
|
|
905
905
|
dispose() {
|
|
906
906
|
this.marginalWeights.dispose(), this.conditionalWeights.dispose(), this.map.dispose();
|
|
907
907
|
}
|
|
908
908
|
updateFrom(e) {
|
|
909
|
-
const t =
|
|
910
|
-
t.wrapS = et, t.wrapT =
|
|
909
|
+
const t = ua(e);
|
|
910
|
+
t.wrapS = et, t.wrapT = We;
|
|
911
911
|
const { width: i, height: s, data: a } = t.image, n = new Float32Array(i * s), c = new Float32Array(i * s), u = new Float32Array(s), f = new Float32Array(s);
|
|
912
912
|
let d = 0, r = 0;
|
|
913
913
|
for (let p = 0; p < s; p++) {
|
|
914
914
|
let g = 0;
|
|
915
915
|
for (let _ = 0; _ < i; _++) {
|
|
916
|
-
const y = p * i + _, x =
|
|
916
|
+
const y = p * i + _, x = Be.fromHalfFloat(a[4 * y + 0]), w = Be.fromHalfFloat(a[4 * y + 1]), A = Be.fromHalfFloat(a[4 * y + 2]), S = ca(x, w, A);
|
|
917
917
|
g += S, d += S, n[y] = S, c[y] = g;
|
|
918
918
|
}
|
|
919
919
|
if (g !== 0)
|
|
@@ -927,23 +927,23 @@ class ua {
|
|
|
927
927
|
const l = new Uint16Array(s), h = new Uint16Array(i * s);
|
|
928
928
|
for (let p = 0; p < s; p++) {
|
|
929
929
|
const g = (p + 1) / s, _ = _r(f, g);
|
|
930
|
-
l[p] =
|
|
930
|
+
l[p] = Be.toHalfFloat((_ + 0.5) / s);
|
|
931
931
|
}
|
|
932
932
|
for (let p = 0; p < s; p++)
|
|
933
933
|
for (let g = 0; g < i; g++) {
|
|
934
934
|
const _ = p * i + g, y = (g + 1) / i, x = _r(c, y, p * i, i);
|
|
935
|
-
h[_] =
|
|
935
|
+
h[_] = Be.toHalfFloat((x + 0.5) / i);
|
|
936
936
|
}
|
|
937
937
|
this.dispose();
|
|
938
938
|
const { marginalWeights: m, conditionalWeights: v } = this;
|
|
939
939
|
m.image = { width: s, height: 1, data: l }, m.needsUpdate = !0, v.image = { width: i, height: s, data: h }, v.needsUpdate = !0, this.totalSum = d, this.map = t;
|
|
940
940
|
}
|
|
941
941
|
}
|
|
942
|
-
const ss = 6,
|
|
943
|
-
class
|
|
942
|
+
const ss = 6, fa = 0, da = 1, pa = 2, ma = 3, ga = 4, we = new b(), ne = new b(), yr = new J(), ft = new fn(), xr = new b(), dt = new b(), va = new b(0, 1, 0);
|
|
943
|
+
class _a {
|
|
944
944
|
constructor() {
|
|
945
|
-
const e = new
|
|
946
|
-
e.format = te, e.type = pe, e.wrapS =
|
|
945
|
+
const e = new ze(new Float32Array(4), 1, 1);
|
|
946
|
+
e.format = te, e.type = pe, e.wrapS = We, e.wrapT = We, e.generateMipmaps = !1, e.minFilter = ee, e.magFilter = ee, this.tex = e, this.count = 0;
|
|
947
947
|
}
|
|
948
948
|
updateFrom(e, t = []) {
|
|
949
949
|
const i = this.tex, s = Math.max(e.length * ss, 1), a = Math.ceil(Math.sqrt(s));
|
|
@@ -955,12 +955,12 @@ class va {
|
|
|
955
955
|
for (let m = 0; m < ss * 4; m++)
|
|
956
956
|
n[r + m] = 0;
|
|
957
957
|
d.getWorldPosition(ne), n[r + l++] = ne.x, n[r + l++] = ne.y, n[r + l++] = ne.z;
|
|
958
|
-
let h =
|
|
959
|
-
if (d.isRectAreaLight && d.isCircular ? h =
|
|
958
|
+
let h = fa;
|
|
959
|
+
if (d.isRectAreaLight && d.isCircular ? h = da : d.isSpotLight ? h = pa : d.isDirectionalLight ? h = ma : d.isPointLight && (h = ga), n[r + l++] = h, n[r + l++] = d.color.r, n[r + l++] = d.color.g, n[r + l++] = d.color.b, n[r + l++] = d.intensity, d.getWorldQuaternion(ft), d.isRectAreaLight)
|
|
960
960
|
we.set(d.width, 0, 0).applyQuaternion(ft), n[r + l++] = we.x, n[r + l++] = we.y, n[r + l++] = we.z, l++, ne.set(0, d.height, 0).applyQuaternion(ft), n[r + l++] = ne.x, n[r + l++] = ne.y, n[r + l++] = ne.z, n[r + l++] = we.cross(ne).length() * (d.isCircular ? Math.PI / 4 : 1);
|
|
961
961
|
else if (d.isSpotLight) {
|
|
962
962
|
const m = d.radius || 0;
|
|
963
|
-
xr.setFromMatrixPosition(d.matrixWorld), dt.setFromMatrixPosition(d.target.matrixWorld), yr.lookAt(xr, dt,
|
|
963
|
+
xr.setFromMatrixPosition(d.matrixWorld), dt.setFromMatrixPosition(d.target.matrixWorld), yr.lookAt(xr, dt, va), ft.setFromRotationMatrix(yr), we.set(1, 0, 0).applyQuaternion(ft), n[r + l++] = we.x, n[r + l++] = we.y, n[r + l++] = we.z, l++, ne.set(0, 1, 0).applyQuaternion(ft), n[r + l++] = ne.x, n[r + l++] = ne.y, n[r + l++] = ne.z, n[r + l++] = Math.PI * m * m, n[r + l++] = m, n[r + l++] = d.decay, n[r + l++] = d.distance, n[r + l++] = Math.cos(d.angle), n[r + l++] = Math.cos(d.angle * (1 - d.penumbra)), n[r + l++] = d.iesMap ? t.indexOf(d.iesMap) : -1;
|
|
964
964
|
} else if (d.isPointLight) {
|
|
965
965
|
const m = we.setFromMatrixPosition(d.matrixWorld);
|
|
966
966
|
n[r + l++] = m.x, n[r + l++] = m.y, n[r + l++] = m.z, l++, l += 4, l += 1, n[r + l++] = d.decay, n[r + l++] = d.distance;
|
|
@@ -997,7 +997,7 @@ function wr(o, e, t, i, s) {
|
|
|
997
997
|
t[s + f + r] = e >= r + 1 ? o[d + r] / c : 0;
|
|
998
998
|
}
|
|
999
999
|
}
|
|
1000
|
-
class
|
|
1000
|
+
class ya extends Yn {
|
|
1001
1001
|
constructor() {
|
|
1002
1002
|
super(), this._textures = [], this.type = pe, this.format = te, this.internalFormat = "RGBA32F";
|
|
1003
1003
|
}
|
|
@@ -1018,7 +1018,7 @@ class _a extends Qn {
|
|
|
1018
1018
|
throw new Error("FloatAttributeTextureArray: All attributes must have the same item count.");
|
|
1019
1019
|
const s = this._textures;
|
|
1020
1020
|
for (; s.length < i; ) {
|
|
1021
|
-
const r = new
|
|
1021
|
+
const r = new Fo();
|
|
1022
1022
|
s.push(r);
|
|
1023
1023
|
}
|
|
1024
1024
|
for (; s.length > i; )
|
|
@@ -1036,7 +1036,7 @@ class _a extends Qn {
|
|
|
1036
1036
|
this.dispose(), this.needsUpdate = !0;
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
class
|
|
1039
|
+
class xa extends ya {
|
|
1040
1040
|
updateNormalAttribute(e) {
|
|
1041
1041
|
this.updateAttribute(0, e);
|
|
1042
1042
|
}
|
|
@@ -1059,7 +1059,7 @@ function Qs(o, e) {
|
|
|
1059
1059
|
function Cs(o) {
|
|
1060
1060
|
return `${o.source.uuid}:${o.colorSpace}`;
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1062
|
+
function wa(o) {
|
|
1063
1063
|
const e = /* @__PURE__ */ new Set(), t = [];
|
|
1064
1064
|
for (let i = 0, s = o.length; i < s; i++) {
|
|
1065
1065
|
const a = o[i], n = Cs(a);
|
|
@@ -1067,11 +1067,11 @@ function xa(o) {
|
|
|
1067
1067
|
}
|
|
1068
1068
|
return t;
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function ba(o) {
|
|
1071
1071
|
const e = o.map((i) => i.iesMap || null).filter((i) => i), t = new Set(e);
|
|
1072
1072
|
return Array.from(t).sort(Qs);
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function Aa(o) {
|
|
1075
1075
|
const e = /* @__PURE__ */ new Set();
|
|
1076
1076
|
for (let i = 0, s = o.length; i < s; i++) {
|
|
1077
1077
|
const a = o[i];
|
|
@@ -1081,16 +1081,16 @@ function ba(o) {
|
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
1083
|
const t = Array.from(e);
|
|
1084
|
-
return
|
|
1084
|
+
return wa(t).sort(Qs);
|
|
1085
1085
|
}
|
|
1086
|
-
function
|
|
1086
|
+
function Ta(o) {
|
|
1087
1087
|
const e = [];
|
|
1088
1088
|
return o.traverse((t) => {
|
|
1089
1089
|
t.visible && (t.isRectAreaLight || t.isSpotLight || t.isPointLight || t.isDirectionalLight) && e.push(t);
|
|
1090
1090
|
}), e.sort(Qs);
|
|
1091
1091
|
}
|
|
1092
|
-
const
|
|
1093
|
-
class
|
|
1092
|
+
const xn = 45, br = xn * 4;
|
|
1093
|
+
class Sa {
|
|
1094
1094
|
constructor() {
|
|
1095
1095
|
this._features = {};
|
|
1096
1096
|
}
|
|
@@ -1104,9 +1104,9 @@ class Ta {
|
|
|
1104
1104
|
this._features = {};
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
|
-
class
|
|
1107
|
+
class Ma extends ze {
|
|
1108
1108
|
constructor() {
|
|
1109
|
-
super(new Float32Array(4), 1, 1), this.format = te, this.type = pe, this.wrapS =
|
|
1109
|
+
super(new Float32Array(4), 1, 1), this.format = te, this.type = pe, this.wrapS = We, this.wrapT = We, this.minFilter = ee, this.magFilter = ee, this.generateMipmaps = !1, this.features = new Sa();
|
|
1110
1110
|
}
|
|
1111
1111
|
updateFrom(e, t) {
|
|
1112
1112
|
function i(m, v, p = -1) {
|
|
@@ -1130,7 +1130,7 @@ class Sa extends Oe {
|
|
|
1130
1130
|
return 8;
|
|
1131
1131
|
}
|
|
1132
1132
|
let n = 0;
|
|
1133
|
-
const c = e.length *
|
|
1133
|
+
const c = e.length * xn, u = Math.ceil(Math.sqrt(c)) || 1, { image: f, features: d } = this, r = {};
|
|
1134
1134
|
for (let m = 0, v = t.length; m < v; m++)
|
|
1135
1135
|
r[Cs(t[m])] = m;
|
|
1136
1136
|
f.width !== u && (this.dispose(), f.data = new Float32Array(u * u * 4), f.width = u, f.height = u);
|
|
@@ -1156,7 +1156,7 @@ class Sa extends Oe {
|
|
|
1156
1156
|
case ws:
|
|
1157
1157
|
l[n++] = 1;
|
|
1158
1158
|
break;
|
|
1159
|
-
case
|
|
1159
|
+
case dn:
|
|
1160
1160
|
l[n++] = -1;
|
|
1161
1161
|
break;
|
|
1162
1162
|
case oi:
|
|
@@ -1170,14 +1170,14 @@ class Sa extends Oe {
|
|
|
1170
1170
|
}
|
|
1171
1171
|
}
|
|
1172
1172
|
const Ar = new K();
|
|
1173
|
-
function
|
|
1173
|
+
function Ca(o) {
|
|
1174
1174
|
return o ? `${o.uuid}:${o.version}` : null;
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1176
|
+
function Ia(o, e) {
|
|
1177
1177
|
for (const t in e)
|
|
1178
1178
|
t in o && (o[t] = e[t]);
|
|
1179
1179
|
}
|
|
1180
|
-
class Tr extends
|
|
1180
|
+
class Tr extends Zn {
|
|
1181
1181
|
constructor(e, t, i) {
|
|
1182
1182
|
const s = {
|
|
1183
1183
|
format: te,
|
|
@@ -1189,21 +1189,21 @@ class Tr extends Yn {
|
|
|
1189
1189
|
generateMipmaps: !1,
|
|
1190
1190
|
...i
|
|
1191
1191
|
};
|
|
1192
|
-
super(e, t, 1, s),
|
|
1192
|
+
super(e, t, 1, s), Ia(this.texture, s), this.texture.setTextures = (...n) => {
|
|
1193
1193
|
this.setTextures(...n);
|
|
1194
1194
|
}, this.hashes = [null];
|
|
1195
|
-
const a = new Et(new
|
|
1195
|
+
const a = new Et(new Ra());
|
|
1196
1196
|
this.fsQuad = a;
|
|
1197
1197
|
}
|
|
1198
1198
|
setTextures(e, t, i = this.width, s = this.height) {
|
|
1199
1199
|
const a = e.getRenderTarget(), n = e.toneMapping, c = e.getClearAlpha();
|
|
1200
1200
|
e.getClearColor(Ar);
|
|
1201
1201
|
const u = t.length || 1;
|
|
1202
|
-
(i !== this.width || s !== this.height || this.depth !== u) && (this.setSize(i, s, u), this.hashes = new Array(u).fill(null)), e.setClearColor(0, 0), e.toneMapping =
|
|
1202
|
+
(i !== this.width || s !== this.height || this.depth !== u) && (this.setSize(i, s, u), this.hashes = new Array(u).fill(null)), e.setClearColor(0, 0), e.toneMapping = Xn;
|
|
1203
1203
|
const f = this.fsQuad, d = this.hashes;
|
|
1204
1204
|
let r = !1;
|
|
1205
1205
|
for (let l = 0, h = u; l < h; l++) {
|
|
1206
|
-
const m = t[l], v =
|
|
1206
|
+
const m = t[l], v = Ca(m);
|
|
1207
1207
|
m && (d[l] !== v || m.isWebGLRenderTarget) && (m.matrixAutoUpdate = !1, m.matrix.identity(), f.material.map = m, e.setRenderTarget(this, l), f.render(e), m.updateMatrix(), m.matrixAutoUpdate = !0, d[l] = v, r = !0);
|
|
1208
1208
|
}
|
|
1209
1209
|
return f.material.map = null, e.setClearColor(Ar, c), e.setRenderTarget(a), e.toneMapping = n, r;
|
|
@@ -1212,7 +1212,7 @@ class Tr extends Yn {
|
|
|
1212
1212
|
super.dispose(), this.fsQuad.dispose();
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
|
-
class
|
|
1215
|
+
class Ra extends kt {
|
|
1216
1216
|
get map() {
|
|
1217
1217
|
return this.uniforms.map.value;
|
|
1218
1218
|
}
|
|
@@ -1251,7 +1251,7 @@ class Ia extends kt {
|
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1254
|
+
function Da(o, e = Math.random()) {
|
|
1255
1255
|
for (let t = o.length - 1; t > 0; t--) {
|
|
1256
1256
|
const i = Math.floor(e() * (t + 1)), s = o[t];
|
|
1257
1257
|
o[t] = o[i], o[i] = s;
|
|
@@ -1272,7 +1272,7 @@ class Pa {
|
|
|
1272
1272
|
n = 0;
|
|
1273
1273
|
}, this.next = function() {
|
|
1274
1274
|
const { samples: c } = this;
|
|
1275
|
-
n >= a.length && (
|
|
1275
|
+
n >= a.length && (Da(a, i), this.reshuffle());
|
|
1276
1276
|
let u = a[n++];
|
|
1277
1277
|
for (let f = 0; f < t; f++)
|
|
1278
1278
|
c[f] = (u % e + i()) / e, u = Math.floor(u / e);
|
|
@@ -1280,7 +1280,7 @@ class Pa {
|
|
|
1280
1280
|
};
|
|
1281
1281
|
}
|
|
1282
1282
|
}
|
|
1283
|
-
class
|
|
1283
|
+
class Ea {
|
|
1284
1284
|
constructor(e, t, i = Math.random) {
|
|
1285
1285
|
let s = 0;
|
|
1286
1286
|
for (const u of t)
|
|
@@ -1304,7 +1304,7 @@ class Da {
|
|
|
1304
1304
|
};
|
|
1305
1305
|
}
|
|
1306
1306
|
}
|
|
1307
|
-
class
|
|
1307
|
+
class La {
|
|
1308
1308
|
constructor(e = 0) {
|
|
1309
1309
|
this.m = 2147483648, this.a = 1103515245, this.c = 12345, this.seed = e;
|
|
1310
1310
|
}
|
|
@@ -1315,15 +1315,15 @@ class Ea {
|
|
|
1315
1315
|
return this.nextInt() / (this.m - 1);
|
|
1316
1316
|
}
|
|
1317
1317
|
}
|
|
1318
|
-
class
|
|
1318
|
+
class Fa extends ze {
|
|
1319
1319
|
constructor(e = 1, t = 1, i = 8) {
|
|
1320
|
-
super(new Float32Array(1), 1, 1, te, pe), this.minFilter = ee, this.magFilter = ee, this.strata = i, this.sampler = null, this.generator = new
|
|
1320
|
+
super(new Float32Array(1), 1, 1, te, pe), this.minFilter = ee, this.magFilter = ee, this.strata = i, this.sampler = null, this.generator = new La(), this.stableNoise = !1, this.random = () => this.stableNoise ? this.generator.nextFloat() : Math.random(), this.init(e, t, i);
|
|
1321
1321
|
}
|
|
1322
1322
|
init(e = this.image.height, t = this.image.width, i = this.strata) {
|
|
1323
1323
|
const { image: s } = this;
|
|
1324
1324
|
if (s.width === t && s.height === e && this.sampler !== null)
|
|
1325
1325
|
return;
|
|
1326
|
-
const a = new Array(e * t).fill(4), n = new
|
|
1326
|
+
const a = new Array(e * t).fill(4), n = new Ea(i, a, this.random);
|
|
1327
1327
|
s.width = t, s.height = e, s.data = n.samples, this.sampler = n, this.dispose(), this.next();
|
|
1328
1328
|
}
|
|
1329
1329
|
next() {
|
|
@@ -1333,13 +1333,13 @@ class La extends Oe {
|
|
|
1333
1333
|
this.sampler.reset(), this.generator.seed = 0;
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
|
-
function
|
|
1336
|
+
function ka(o, e = Math.random) {
|
|
1337
1337
|
for (let t = o.length - 1; t > 0; t--) {
|
|
1338
1338
|
const i = ~~((e() - 1e-6) * t), s = o[t];
|
|
1339
1339
|
o[t] = o[i], o[i] = s;
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1342
|
+
function Ba(o, e) {
|
|
1343
1343
|
o.fill(0);
|
|
1344
1344
|
for (let t = 0; t < e; t++)
|
|
1345
1345
|
o[t] = 1;
|
|
@@ -1421,7 +1421,7 @@ class Sr {
|
|
|
1421
1421
|
this.resize(e.size), this.score.set(e.score), this.binaryPattern.set(e.binaryPattern), this.setSigma(e.sigma), this.count = e.count;
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
|
-
class
|
|
1424
|
+
class Oa {
|
|
1425
1425
|
constructor() {
|
|
1426
1426
|
this.random = Math.random, this.sigma = 1.5, this.size = 64, this.majorityPointsRatio = 0.1, this.samples = new Sr(1), this.savedSamples = new Sr(1);
|
|
1427
1427
|
}
|
|
@@ -1435,7 +1435,7 @@ class Ba {
|
|
|
1435
1435
|
} = this;
|
|
1436
1436
|
e.resize(a), e.setSigma(i);
|
|
1437
1437
|
const n = Math.floor(a * a * s), c = e.binaryPattern;
|
|
1438
|
-
|
|
1438
|
+
Ba(c, n), ka(c, this.random);
|
|
1439
1439
|
for (let r = 0, l = c.length; r < l; r++)
|
|
1440
1440
|
c[r] === 1 && e.addPointIndex(r);
|
|
1441
1441
|
for (; ; ) {
|
|
@@ -1467,27 +1467,27 @@ class Ba {
|
|
|
1467
1467
|
return { data: u, maxValue: d };
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
|
-
function
|
|
1470
|
+
function za(o) {
|
|
1471
1471
|
return o >= 3 ? 4 : o;
|
|
1472
1472
|
}
|
|
1473
|
-
function
|
|
1473
|
+
function Ua(o) {
|
|
1474
1474
|
switch (o) {
|
|
1475
1475
|
case 1:
|
|
1476
1476
|
return xs;
|
|
1477
1477
|
case 2:
|
|
1478
|
-
return
|
|
1478
|
+
return Kn;
|
|
1479
1479
|
default:
|
|
1480
1480
|
return te;
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
1483
|
-
class
|
|
1483
|
+
class Ha extends ze {
|
|
1484
1484
|
constructor(e = 64, t = 1) {
|
|
1485
1485
|
super(new Float32Array(4), 1, 1, te, pe), this.minFilter = ee, this.magFilter = ee, this.size = e, this.channels = t, this.update();
|
|
1486
1486
|
}
|
|
1487
1487
|
update() {
|
|
1488
|
-
const e = this.channels, t = this.size, i = new
|
|
1488
|
+
const e = this.channels, t = this.size, i = new Oa();
|
|
1489
1489
|
i.channels = e, i.size = t;
|
|
1490
|
-
const s =
|
|
1490
|
+
const s = za(e), a = Ua(s);
|
|
1491
1491
|
(this.image.width !== t || a !== this.format) && (this.image.width = t, this.image.height = t, this.image.data = new Float32Array(t ** 2 * s), this.format = a, this.dispose());
|
|
1492
1492
|
const n = this.image.data;
|
|
1493
1493
|
for (let c = 0, u = e; c < u; c++) {
|
|
@@ -1500,7 +1500,7 @@ class Ua extends Oe {
|
|
|
1500
1500
|
this.needsUpdate = !0;
|
|
1501
1501
|
}
|
|
1502
1502
|
}
|
|
1503
|
-
const
|
|
1503
|
+
const Wa = (
|
|
1504
1504
|
/* glsl */
|
|
1505
1505
|
`
|
|
1506
1506
|
|
|
@@ -1515,7 +1515,7 @@ const Ha = (
|
|
|
1515
1515
|
};
|
|
1516
1516
|
|
|
1517
1517
|
`
|
|
1518
|
-
),
|
|
1518
|
+
), Va = (
|
|
1519
1519
|
/* glsl */
|
|
1520
1520
|
`
|
|
1521
1521
|
|
|
@@ -1530,7 +1530,7 @@ const Ha = (
|
|
|
1530
1530
|
};
|
|
1531
1531
|
|
|
1532
1532
|
`
|
|
1533
|
-
),
|
|
1533
|
+
), Na = (
|
|
1534
1534
|
/* glsl */
|
|
1535
1535
|
`
|
|
1536
1536
|
|
|
@@ -1619,7 +1619,7 @@ const Ha = (
|
|
|
1619
1619
|
}
|
|
1620
1620
|
|
|
1621
1621
|
`
|
|
1622
|
-
),
|
|
1622
|
+
), Ga = (
|
|
1623
1623
|
/* glsl */
|
|
1624
1624
|
`
|
|
1625
1625
|
|
|
@@ -1829,7 +1829,7 @@ const Ha = (
|
|
|
1829
1829
|
}
|
|
1830
1830
|
|
|
1831
1831
|
`
|
|
1832
|
-
),
|
|
1832
|
+
), qa = (
|
|
1833
1833
|
/* glsl */
|
|
1834
1834
|
`
|
|
1835
1835
|
|
|
@@ -1894,7 +1894,7 @@ const Ha = (
|
|
|
1894
1894
|
};
|
|
1895
1895
|
|
|
1896
1896
|
`
|
|
1897
|
-
),
|
|
1897
|
+
), ja = (
|
|
1898
1898
|
/* glsl */
|
|
1899
1899
|
`
|
|
1900
1900
|
|
|
@@ -1964,7 +1964,7 @@ const Ha = (
|
|
|
1964
1964
|
|
|
1965
1965
|
}
|
|
1966
1966
|
`
|
|
1967
|
-
),
|
|
1967
|
+
), Qa = (
|
|
1968
1968
|
/* glsl */
|
|
1969
1969
|
`
|
|
1970
1970
|
|
|
@@ -2182,7 +2182,7 @@ const Ha = (
|
|
|
2182
2182
|
}
|
|
2183
2183
|
|
|
2184
2184
|
`
|
|
2185
|
-
),
|
|
2185
|
+
), Ya = (
|
|
2186
2186
|
/* glsl */
|
|
2187
2187
|
`
|
|
2188
2188
|
|
|
@@ -2270,7 +2270,7 @@ const Ha = (
|
|
|
2270
2270
|
|
|
2271
2271
|
|
|
2272
2272
|
`
|
|
2273
|
-
),
|
|
2273
|
+
), Za = (
|
|
2274
2274
|
/* glsl */
|
|
2275
2275
|
`
|
|
2276
2276
|
|
|
@@ -2376,7 +2376,7 @@ const Ha = (
|
|
|
2376
2376
|
}
|
|
2377
2377
|
|
|
2378
2378
|
`
|
|
2379
|
-
),
|
|
2379
|
+
), Xa = (
|
|
2380
2380
|
/* glsl */
|
|
2381
2381
|
`
|
|
2382
2382
|
|
|
@@ -2459,7 +2459,7 @@ const Ha = (
|
|
|
2459
2459
|
}
|
|
2460
2460
|
|
|
2461
2461
|
`
|
|
2462
|
-
),
|
|
2462
|
+
), Ka = (
|
|
2463
2463
|
/* glsl */
|
|
2464
2464
|
`
|
|
2465
2465
|
|
|
@@ -2523,7 +2523,7 @@ const Ha = (
|
|
|
2523
2523
|
}
|
|
2524
2524
|
|
|
2525
2525
|
`
|
|
2526
|
-
),
|
|
2526
|
+
), Ja = (
|
|
2527
2527
|
/*glsl */
|
|
2528
2528
|
`
|
|
2529
2529
|
|
|
@@ -2549,7 +2549,7 @@ const Ha = (
|
|
|
2549
2549
|
}
|
|
2550
2550
|
|
|
2551
2551
|
`
|
|
2552
|
-
),
|
|
2552
|
+
), wn = (
|
|
2553
2553
|
/* glsl */
|
|
2554
2554
|
`
|
|
2555
2555
|
|
|
@@ -2726,7 +2726,7 @@ const Ha = (
|
|
|
2726
2726
|
|
|
2727
2727
|
}
|
|
2728
2728
|
`
|
|
2729
|
-
),
|
|
2729
|
+
), $a = (
|
|
2730
2730
|
/* glsl */
|
|
2731
2731
|
`
|
|
2732
2732
|
|
|
@@ -2778,7 +2778,7 @@ const Ha = (
|
|
|
2778
2778
|
}
|
|
2779
2779
|
|
|
2780
2780
|
`
|
|
2781
|
-
),
|
|
2781
|
+
), el = (
|
|
2782
2782
|
/* glsl */
|
|
2783
2783
|
`
|
|
2784
2784
|
|
|
@@ -3219,7 +3219,7 @@ const Ha = (
|
|
|
3219
3219
|
}
|
|
3220
3220
|
|
|
3221
3221
|
`
|
|
3222
|
-
),
|
|
3222
|
+
), tl = (
|
|
3223
3223
|
/* glsl */
|
|
3224
3224
|
`
|
|
3225
3225
|
|
|
@@ -3243,7 +3243,7 @@ const Ha = (
|
|
|
3243
3243
|
}
|
|
3244
3244
|
|
|
3245
3245
|
`
|
|
3246
|
-
),
|
|
3246
|
+
), il = (
|
|
3247
3247
|
/* glsl */
|
|
3248
3248
|
`
|
|
3249
3249
|
|
|
@@ -3347,7 +3347,7 @@ const Ha = (
|
|
|
3347
3347
|
}
|
|
3348
3348
|
|
|
3349
3349
|
`
|
|
3350
|
-
),
|
|
3350
|
+
), sl = (
|
|
3351
3351
|
/* glsl */
|
|
3352
3352
|
`
|
|
3353
3353
|
|
|
@@ -3484,7 +3484,7 @@ const Ha = (
|
|
|
3484
3484
|
}
|
|
3485
3485
|
|
|
3486
3486
|
`
|
|
3487
|
-
),
|
|
3487
|
+
), rl = (
|
|
3488
3488
|
/* glsl */
|
|
3489
3489
|
`
|
|
3490
3490
|
|
|
@@ -3584,7 +3584,7 @@ const Ha = (
|
|
|
3584
3584
|
}
|
|
3585
3585
|
|
|
3586
3586
|
`
|
|
3587
|
-
),
|
|
3587
|
+
), nl = (
|
|
3588
3588
|
/* glsl */
|
|
3589
3589
|
`
|
|
3590
3590
|
|
|
@@ -3648,7 +3648,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
3648
3648
|
}
|
|
3649
3649
|
|
|
3650
3650
|
`
|
|
3651
|
-
),
|
|
3651
|
+
), ol = (
|
|
3652
3652
|
/* glsl */
|
|
3653
3653
|
`
|
|
3654
3654
|
|
|
@@ -3828,7 +3828,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
3828
3828
|
}
|
|
3829
3829
|
|
|
3830
3830
|
`
|
|
3831
|
-
),
|
|
3831
|
+
), al = (
|
|
3832
3832
|
/* glsl */
|
|
3833
3833
|
`
|
|
3834
3834
|
|
|
@@ -3914,7 +3914,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
3914
3914
|
}
|
|
3915
3915
|
|
|
3916
3916
|
`
|
|
3917
|
-
),
|
|
3917
|
+
), ll = (
|
|
3918
3918
|
/*glsl*/
|
|
3919
3919
|
`
|
|
3920
3920
|
|
|
@@ -4013,7 +4013,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
4013
4013
|
}
|
|
4014
4014
|
|
|
4015
4015
|
`
|
|
4016
|
-
),
|
|
4016
|
+
), cl = (
|
|
4017
4017
|
/* glsl */
|
|
4018
4018
|
`
|
|
4019
4019
|
|
|
@@ -4338,7 +4338,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
4338
4338
|
|
|
4339
4339
|
}
|
|
4340
4340
|
`
|
|
4341
|
-
),
|
|
4341
|
+
), ul = (
|
|
4342
4342
|
/* glsl */
|
|
4343
4343
|
`
|
|
4344
4344
|
|
|
@@ -4390,7 +4390,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
4390
4390
|
}
|
|
4391
4391
|
|
|
4392
4392
|
`
|
|
4393
|
-
),
|
|
4393
|
+
), hl = (
|
|
4394
4394
|
/* glsl */
|
|
4395
4395
|
`
|
|
4396
4396
|
|
|
@@ -4441,7 +4441,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
4441
4441
|
|
|
4442
4442
|
`
|
|
4443
4443
|
);
|
|
4444
|
-
class
|
|
4444
|
+
class fl extends js {
|
|
4445
4445
|
onBeforeRender() {
|
|
4446
4446
|
this.setDefine("FEATURE_DOF", this.physicalCamera.bokehSize === 0 ? 0 : 1), this.setDefine("FEATURE_BACKGROUND_MAP", this.backgroundMap ? 1 : 0), this.setDefine("FEATURE_FOG", this.materials.features.isUsed("FOG") ? 1 : 0);
|
|
4447
4447
|
}
|
|
@@ -4477,25 +4477,25 @@ class hl extends js {
|
|
|
4477
4477
|
transmissiveBounces: { value: 10 },
|
|
4478
4478
|
filterGlossyFactor: { value: 0 },
|
|
4479
4479
|
// camera uniforms
|
|
4480
|
-
physicalCamera: { value: new
|
|
4480
|
+
physicalCamera: { value: new la() },
|
|
4481
4481
|
cameraWorldMatrix: { value: new J() },
|
|
4482
4482
|
invProjectionMatrix: { value: new J() },
|
|
4483
4483
|
// scene uniforms
|
|
4484
|
-
bvh: { value: new
|
|
4485
|
-
attributesArray: { value: new
|
|
4486
|
-
materialIndexAttribute: { value: new
|
|
4487
|
-
materials: { value: new
|
|
4484
|
+
bvh: { value: new ko() },
|
|
4485
|
+
attributesArray: { value: new xa() },
|
|
4486
|
+
materialIndexAttribute: { value: new Bo() },
|
|
4487
|
+
materials: { value: new Ma() },
|
|
4488
4488
|
textures: { value: new Tr().texture },
|
|
4489
4489
|
// light uniforms
|
|
4490
|
-
lights: { value: new
|
|
4490
|
+
lights: { value: new _a() },
|
|
4491
4491
|
iesProfiles: { value: new Tr(360, 180, {
|
|
4492
4492
|
type: Se,
|
|
4493
|
-
wrapS:
|
|
4494
|
-
wrapT:
|
|
4493
|
+
wrapS: We,
|
|
4494
|
+
wrapT: We
|
|
4495
4495
|
}).texture },
|
|
4496
4496
|
environmentIntensity: { value: 1 },
|
|
4497
4497
|
environmentRotation: { value: new J() },
|
|
4498
|
-
envMapInfo: { value: new
|
|
4498
|
+
envMapInfo: { value: new ha() },
|
|
4499
4499
|
// background uniforms
|
|
4500
4500
|
backgroundBlur: { value: 0 },
|
|
4501
4501
|
backgroundMap: { value: null },
|
|
@@ -4505,8 +4505,8 @@ class hl extends js {
|
|
|
4505
4505
|
// randomness uniforms
|
|
4506
4506
|
seed: { value: 0 },
|
|
4507
4507
|
sobolTexture: { value: null },
|
|
4508
|
-
stratifiedTexture: { value: new
|
|
4509
|
-
stratifiedOffsetTexture: { value: new
|
|
4508
|
+
stratifiedTexture: { value: new Fa() },
|
|
4509
|
+
stratifiedOffsetTexture: { value: new Ha(64, 1) }
|
|
4510
4510
|
},
|
|
4511
4511
|
vertexShader: (
|
|
4512
4512
|
/* glsl */
|
|
@@ -4543,22 +4543,22 @@ class hl extends js {
|
|
|
4543
4543
|
${$i.bvh_ray_functions}
|
|
4544
4544
|
|
|
4545
4545
|
// uniform structs
|
|
4546
|
-
${Ha}
|
|
4547
|
-
${Va}
|
|
4548
4546
|
${Wa}
|
|
4549
4547
|
${Na}
|
|
4548
|
+
${Va}
|
|
4550
4549
|
${Ga}
|
|
4550
|
+
${qa}
|
|
4551
4551
|
|
|
4552
4552
|
// random
|
|
4553
4553
|
#if RANDOM_TYPE == 2 // Stratified List
|
|
4554
4554
|
|
|
4555
|
-
${
|
|
4555
|
+
${$a}
|
|
4556
4556
|
|
|
4557
4557
|
#elif RANDOM_TYPE == 1 // Sobol
|
|
4558
4558
|
|
|
4559
4559
|
${Mr}
|
|
4560
|
-
${
|
|
4561
|
-
${
|
|
4560
|
+
${yn}
|
|
4561
|
+
${ra}
|
|
4562
4562
|
|
|
4563
4563
|
#define rand(v) sobol(v)
|
|
4564
4564
|
#define rand2(v) sobol2(v)
|
|
@@ -4583,11 +4583,11 @@ class hl extends js {
|
|
|
4583
4583
|
#endif
|
|
4584
4584
|
|
|
4585
4585
|
// common
|
|
4586
|
-
${
|
|
4587
|
-
${Ya}
|
|
4588
|
-
${xn}
|
|
4586
|
+
${Ja}
|
|
4589
4587
|
${Za}
|
|
4588
|
+
${wn}
|
|
4590
4589
|
${Xa}
|
|
4590
|
+
${Ka}
|
|
4591
4591
|
|
|
4592
4592
|
// environment
|
|
4593
4593
|
uniform EquirectHdrInfo envMapInfo;
|
|
@@ -4643,16 +4643,16 @@ class hl extends js {
|
|
|
4643
4643
|
float lightsDenom;
|
|
4644
4644
|
|
|
4645
4645
|
// sampling
|
|
4646
|
-
${
|
|
4647
|
-
${qa}
|
|
4646
|
+
${Ya}
|
|
4648
4647
|
${ja}
|
|
4648
|
+
${Qa}
|
|
4649
4649
|
|
|
4650
|
+
${nl}
|
|
4651
|
+
${il}
|
|
4650
4652
|
${rl}
|
|
4651
|
-
${tl}
|
|
4652
4653
|
${sl}
|
|
4653
|
-
${
|
|
4654
|
+
${tl}
|
|
4654
4655
|
${el}
|
|
4655
|
-
${$a}
|
|
4656
4656
|
|
|
4657
4657
|
float applyFilteredGlossy( float roughness, float accumulatedRoughness ) {
|
|
4658
4658
|
|
|
@@ -4684,12 +4684,12 @@ class hl extends js {
|
|
|
4684
4684
|
|
|
4685
4685
|
}
|
|
4686
4686
|
|
|
4687
|
-
${cl}
|
|
4688
|
-
${ol}
|
|
4689
4687
|
${ul}
|
|
4690
|
-
${nl}
|
|
4691
4688
|
${al}
|
|
4689
|
+
${hl}
|
|
4690
|
+
${ol}
|
|
4692
4691
|
${ll}
|
|
4692
|
+
${cl}
|
|
4693
4693
|
|
|
4694
4694
|
void main() {
|
|
4695
4695
|
|
|
@@ -4986,7 +4986,7 @@ class hl extends js {
|
|
|
4986
4986
|
}), this.setValues(e);
|
|
4987
4987
|
}
|
|
4988
4988
|
}
|
|
4989
|
-
function*
|
|
4989
|
+
function* dl() {
|
|
4990
4990
|
const {
|
|
4991
4991
|
_renderer: o,
|
|
4992
4992
|
_fsQuad: e,
|
|
@@ -5000,31 +5000,31 @@ function* fl() {
|
|
|
5000
5000
|
} = this, f = new it(), d = new it(), r = t.material;
|
|
5001
5001
|
let [l, h] = s;
|
|
5002
5002
|
for (; ; ) {
|
|
5003
|
-
c ? (r.opacity = this._opacityFactor / (this.samples + 1), u.blending = ri, u.opacity = 1) : (u.opacity = this._opacityFactor / (this.samples + 1), u.blending =
|
|
5003
|
+
c ? (r.opacity = this._opacityFactor / (this.samples + 1), u.blending = ri, u.opacity = 1) : (u.opacity = this._opacityFactor / (this.samples + 1), u.blending = pn);
|
|
5004
5004
|
const [m, v, p, g] = n, _ = i.width, y = i.height;
|
|
5005
5005
|
u.resolution.set(_ * p, y * g), u.sobolTexture = a.texture, u.stratifiedTexture.init(20, u.bounces + u.transmissiveBounces + 5), u.stratifiedTexture.next(), u.seed++;
|
|
5006
|
-
const x = this.tiles.x || 1, w = this.tiles.y || 1, A = x * w, S = Math.ceil(_ * p), C = Math.ceil(y * g), M = Math.floor(m * _), R = Math.floor(v * y),
|
|
5006
|
+
const x = this.tiles.x || 1, w = this.tiles.y || 1, A = x * w, S = Math.ceil(_ * p), C = Math.ceil(y * g), M = Math.floor(m * _), R = Math.floor(v * y), D = Math.ceil(S / x), T = Math.ceil(C / w);
|
|
5007
5007
|
for (let I = 0; I < w; I++)
|
|
5008
|
-
for (let
|
|
5008
|
+
for (let P = 0; P < x; P++) {
|
|
5009
5009
|
const L = o.getRenderTarget(), F = o.autoClear, U = o.getScissorTest();
|
|
5010
5010
|
o.getScissor(f), o.getViewport(d);
|
|
5011
|
-
let G =
|
|
5011
|
+
let G = P, Q = I;
|
|
5012
5012
|
if (!this.stableTiles) {
|
|
5013
5013
|
const se = this._currentTile % (x * w);
|
|
5014
5014
|
G = se % x, Q = ~~(se / x), this._currentTile = se + 1;
|
|
5015
5015
|
}
|
|
5016
5016
|
const ie = w - Q - 1;
|
|
5017
5017
|
i.scissor.set(
|
|
5018
|
-
M + G *
|
|
5018
|
+
M + G * D,
|
|
5019
5019
|
R + ie * T,
|
|
5020
|
-
Math.min(
|
|
5020
|
+
Math.min(D, S - G * D),
|
|
5021
5021
|
Math.min(T, C - ie * T)
|
|
5022
5022
|
), i.viewport.set(
|
|
5023
5023
|
M,
|
|
5024
5024
|
R,
|
|
5025
5025
|
S,
|
|
5026
5026
|
C
|
|
5027
|
-
), o.setRenderTarget(i), o.setScissorTest(!0), o.autoClear = !1, e.render(o), o.setViewport(d), o.setScissor(f), o.setScissorTest(U), o.setRenderTarget(L), o.autoClear = F, c && (r.target1 = l.texture, r.target2 = i.texture, o.setRenderTarget(h), t.render(o), o.setRenderTarget(L)), this.samples += 1 / A,
|
|
5027
|
+
), o.setRenderTarget(i), o.setScissorTest(!0), o.autoClear = !1, e.render(o), o.setViewport(d), o.setScissor(f), o.setScissorTest(U), o.setRenderTarget(L), o.autoClear = F, c && (r.target1 = l.texture, r.target2 = i.texture, o.setRenderTarget(h), t.render(o), o.setRenderTarget(L)), this.samples += 1 / A, P === x - 1 && I === w - 1 && (this.samples = Math.round(this.samples)), yield;
|
|
5028
5028
|
}
|
|
5029
5029
|
[l, h] = [h, l];
|
|
5030
5030
|
}
|
|
@@ -5050,19 +5050,19 @@ class Ir {
|
|
|
5050
5050
|
return !!this._compilePromise;
|
|
5051
5051
|
}
|
|
5052
5052
|
constructor(e) {
|
|
5053
|
-
this.camera = null, this.tiles = new z(3, 3), this.stableNoise = !1, this.stableTiles = !0, this.samples = 0, this._subframe = new it(0, 0, 1, 1), this._opacityFactor = 1, this._renderer = e, this._alpha = !1, this._fsQuad = new Et(new
|
|
5053
|
+
this.camera = null, this.tiles = new z(3, 3), this.stableNoise = !1, this.stableTiles = !0, this.samples = 0, this._subframe = new it(0, 0, 1, 1), this._opacityFactor = 1, this._renderer = e, this._alpha = !1, this._fsQuad = new Et(new fl()), this._blendQuad = new Et(new ia()), this._task = null, this._currentTile = 0, this._compilePromise = null, this._sobolTarget = new oa().generate(e), this._primaryTarget = new Oe(1, 1, {
|
|
5054
5054
|
format: te,
|
|
5055
5055
|
type: pe,
|
|
5056
5056
|
magFilter: ee,
|
|
5057
5057
|
minFilter: ee
|
|
5058
5058
|
}), this._blendTargets = [
|
|
5059
|
-
new
|
|
5059
|
+
new Oe(1, 1, {
|
|
5060
5060
|
format: te,
|
|
5061
5061
|
type: pe,
|
|
5062
5062
|
magFilter: ee,
|
|
5063
5063
|
minFilter: ee
|
|
5064
5064
|
}),
|
|
5065
|
-
new
|
|
5065
|
+
new Oe(1, 1, {
|
|
5066
5066
|
format: te,
|
|
5067
5067
|
type: pe,
|
|
5068
5068
|
magFilter: ee,
|
|
@@ -5098,11 +5098,11 @@ class Ir {
|
|
|
5098
5098
|
e.getClearColor(Cr), e.setRenderTarget(t), e.setClearColor(0, 0), e.clearColor(), e.setRenderTarget(i[0]), e.setClearColor(0, 0), e.clearColor(), e.setRenderTarget(i[1]), e.setClearColor(0, 0), e.clearColor(), e.setClearColor(Cr, a), e.setRenderTarget(s), this.samples = 0, this._task = null, this.material.stratifiedTexture.stableNoise = this.stableNoise, this.stableNoise && (this.material.seed = 0, this.material.stratifiedTexture.reset());
|
|
5099
5099
|
}
|
|
5100
5100
|
update() {
|
|
5101
|
-
this.material.onBeforeRender(), !this.isCompiling && (this._task || (this._task =
|
|
5101
|
+
this.material.onBeforeRender(), !this.isCompiling && (this._task || (this._task = dl.call(this)), this._task.next());
|
|
5102
5102
|
}
|
|
5103
5103
|
}
|
|
5104
|
-
const at = new z(), Rr = new z(), pi = new
|
|
5105
|
-
class
|
|
5104
|
+
const at = new z(), Rr = new z(), pi = new Jn(), mi = new K();
|
|
5105
|
+
class pl extends ze {
|
|
5106
5106
|
constructor(e = 512, t = 512) {
|
|
5107
5107
|
super(
|
|
5108
5108
|
new Float32Array(e * t * 4),
|
|
@@ -5112,7 +5112,7 @@ class dl extends Oe {
|
|
|
5112
5112
|
pe,
|
|
5113
5113
|
ki,
|
|
5114
5114
|
et,
|
|
5115
|
-
|
|
5115
|
+
We,
|
|
5116
5116
|
Te,
|
|
5117
5117
|
Te
|
|
5118
5118
|
), this.generationCallback = null;
|
|
@@ -5131,12 +5131,12 @@ class dl extends Oe {
|
|
|
5131
5131
|
return super.copy(e), this.generationCallback = e.generationCallback, this;
|
|
5132
5132
|
}
|
|
5133
5133
|
}
|
|
5134
|
-
const
|
|
5135
|
-
class
|
|
5134
|
+
const Dr = new b();
|
|
5135
|
+
class ml extends pl {
|
|
5136
5136
|
constructor(e = 512) {
|
|
5137
5137
|
super(e, e), this.topColor = new K().set(16777215), this.bottomColor = new K().set(0), this.exponent = 2, this.generationCallback = (t, i, s, a) => {
|
|
5138
|
-
|
|
5139
|
-
const n =
|
|
5138
|
+
Dr.setFromSpherical(t);
|
|
5139
|
+
const n = Dr.y * 0.5 + 0.5;
|
|
5140
5140
|
a.lerpColors(this.bottomColor, this.topColor, n ** this.exponent);
|
|
5141
5141
|
};
|
|
5142
5142
|
}
|
|
@@ -5144,7 +5144,7 @@ class pl extends dl {
|
|
|
5144
5144
|
return super.copy(e), this.topColor.copy(e.topColor), this.bottomColor.copy(e.bottomColor), this;
|
|
5145
5145
|
}
|
|
5146
5146
|
}
|
|
5147
|
-
class
|
|
5147
|
+
class gl extends kt {
|
|
5148
5148
|
get map() {
|
|
5149
5149
|
return this.uniforms.map.value;
|
|
5150
5150
|
}
|
|
@@ -5231,7 +5231,7 @@ class ml extends kt {
|
|
|
5231
5231
|
}), this.setValues(e);
|
|
5232
5232
|
}
|
|
5233
5233
|
}
|
|
5234
|
-
class
|
|
5234
|
+
class vl extends kt {
|
|
5235
5235
|
constructor() {
|
|
5236
5236
|
super({
|
|
5237
5237
|
uniforms: {
|
|
@@ -5261,7 +5261,7 @@ class gl extends kt {
|
|
|
5261
5261
|
#include <common>
|
|
5262
5262
|
#include <cube_uv_reflection_fragment>
|
|
5263
5263
|
|
|
5264
|
-
${
|
|
5264
|
+
${wn}
|
|
5265
5265
|
|
|
5266
5266
|
void main() {
|
|
5267
5267
|
|
|
@@ -5274,16 +5274,16 @@ class gl extends kt {
|
|
|
5274
5274
|
}), this.depthWrite = !1, this.depthTest = !1;
|
|
5275
5275
|
}
|
|
5276
5276
|
}
|
|
5277
|
-
class
|
|
5277
|
+
class Pr {
|
|
5278
5278
|
constructor(e) {
|
|
5279
|
-
this._renderer = e, this._quad = new Et(new
|
|
5279
|
+
this._renderer = e, this._quad = new Et(new vl());
|
|
5280
5280
|
}
|
|
5281
5281
|
generate(e, t = null, i = null) {
|
|
5282
5282
|
if (!e.isCubeTexture)
|
|
5283
5283
|
throw new Error("CubeToEquirectMaterial: Source can only be cube textures.");
|
|
5284
5284
|
const s = e.images[0], a = this._renderer, n = this._quad;
|
|
5285
5285
|
t === null && (t = 4 * s.height), i === null && (i = 2 * s.height);
|
|
5286
|
-
const c = new
|
|
5286
|
+
const c = new Oe(t, i, {
|
|
5287
5287
|
type: pe,
|
|
5288
5288
|
colorSpace: s.colorSpace
|
|
5289
5289
|
}), u = s.height, f = Math.log2(u) - 2, d = 1 / u, r = 1 / (3 * Math.max(Math.pow(2, f), 7 * 16));
|
|
@@ -5293,19 +5293,19 @@ class Dr {
|
|
|
5293
5293
|
const m = new Uint16Array(t * i * 4), v = new Float32Array(t * i * 4);
|
|
5294
5294
|
a.readRenderTargetPixels(c, 0, 0, t, i, v), c.dispose();
|
|
5295
5295
|
for (let g = 0, _ = v.length; g < _; g++)
|
|
5296
|
-
m[g] =
|
|
5297
|
-
const p = new
|
|
5298
|
-
return p.minFilter =
|
|
5296
|
+
m[g] = Be.toHalfFloat(v[g]);
|
|
5297
|
+
const p = new ze(m, t, i, te, Se);
|
|
5298
|
+
return p.minFilter = $n, p.magFilter = Te, p.wrapS = et, p.wrapT = et, p.mapping = ki, p.needsUpdate = !0, p;
|
|
5299
5299
|
}
|
|
5300
5300
|
dispose() {
|
|
5301
5301
|
this._quad.dispose();
|
|
5302
5302
|
}
|
|
5303
5303
|
}
|
|
5304
|
-
function
|
|
5304
|
+
function _l(o) {
|
|
5305
5305
|
return o.extensions.get("EXT_float_blend");
|
|
5306
5306
|
}
|
|
5307
5307
|
const pt = new z();
|
|
5308
|
-
class
|
|
5308
|
+
class yl {
|
|
5309
5309
|
get multipleImportanceSampling() {
|
|
5310
5310
|
return !!this._pathTracer.material.defines.FEATURE_MIS;
|
|
5311
5311
|
}
|
|
@@ -5349,7 +5349,7 @@ class _l {
|
|
|
5349
5349
|
return !!this._pathTracer.isCompiling;
|
|
5350
5350
|
}
|
|
5351
5351
|
constructor(e) {
|
|
5352
|
-
this._renderer = e, this._generator = new
|
|
5352
|
+
this._renderer = e, this._generator = new ta(), this._pathTracer = new Ir(e), this._queueReset = !1, this._clock = new qi(), this._compilePromise = null, this._lowResPathTracer = new Ir(e), this._lowResPathTracer.tiles.set(1, 1), this._quad = new Et(new gl({
|
|
5353
5353
|
map: null,
|
|
5354
5354
|
transparent: !0,
|
|
5355
5355
|
blending: ri,
|
|
@@ -5387,11 +5387,11 @@ class _l {
|
|
|
5387
5387
|
e.updateMatrixWorld(), this._pathTracer.setCamera(e), this._lowResPathTracer.setCamera(e), this.reset();
|
|
5388
5388
|
}
|
|
5389
5389
|
updateMaterials() {
|
|
5390
|
-
const e = this._pathTracer.material, t = this._renderer, i = this._materials, s = this.textureSize, a =
|
|
5390
|
+
const e = this._pathTracer.material, t = this._renderer, i = this._materials, s = this.textureSize, a = Aa(i);
|
|
5391
5391
|
e.textures.setTextures(t, a, s.x, s.y), e.materials.updateFrom(i, a), this.reset();
|
|
5392
5392
|
}
|
|
5393
5393
|
updateLights() {
|
|
5394
|
-
const e = this.scene, t = this._renderer, i = this._pathTracer.material, s =
|
|
5394
|
+
const e = this.scene, t = this._renderer, i = this._pathTracer.material, s = Ta(e), a = ba(s);
|
|
5395
5395
|
i.lights.updateFrom(s, a), i.iesProfiles.setTextures(t, a), this.reset();
|
|
5396
5396
|
}
|
|
5397
5397
|
updateEnvironment() {
|
|
@@ -5399,12 +5399,12 @@ class _l {
|
|
|
5399
5399
|
if (this._internalBackground && (this._internalBackground.dispose(), this._internalBackground = null), t.backgroundBlur = e.backgroundBlurriness, t.backgroundIntensity = e.backgroundIntensity ?? 1, t.backgroundRotation.makeRotationFromEuler(e.backgroundRotation).invert(), e.background === null)
|
|
5400
5400
|
t.backgroundMap = null, t.backgroundAlpha = 0;
|
|
5401
5401
|
else if (e.background.isColor) {
|
|
5402
|
-
this._colorBackground = this._colorBackground || new
|
|
5402
|
+
this._colorBackground = this._colorBackground || new ml(16);
|
|
5403
5403
|
const i = this._colorBackground;
|
|
5404
5404
|
i.topColor.equals(e.background) || (i.topColor.set(e.background), i.bottomColor.set(e.background), i.update()), t.backgroundMap = i, t.backgroundAlpha = 1;
|
|
5405
5405
|
} else if (e.background.isCubeTexture) {
|
|
5406
5406
|
if (e.background !== this._previousBackground) {
|
|
5407
|
-
const i = new
|
|
5407
|
+
const i = new Pr(this._renderer).generate(e.background);
|
|
5408
5408
|
this._internalBackground = i, t.backgroundMap = i, t.backgroundAlpha = 1;
|
|
5409
5409
|
}
|
|
5410
5410
|
} else
|
|
@@ -5412,7 +5412,7 @@ class _l {
|
|
|
5412
5412
|
if (t.environmentIntensity = e.environmentIntensity ?? 1, t.environmentRotation.makeRotationFromEuler(e.environmentRotation).invert(), this._previousEnvironment !== e.environment)
|
|
5413
5413
|
if (e.environment !== null)
|
|
5414
5414
|
if (e.environment.isCubeTexture) {
|
|
5415
|
-
const i = new
|
|
5415
|
+
const i = new Pr(this._renderer).generate(e.environment);
|
|
5416
5416
|
t.envMapInfo.updateFrom(i);
|
|
5417
5417
|
} else
|
|
5418
5418
|
t.envMapInfo.updateFrom(e.environment);
|
|
@@ -5440,7 +5440,7 @@ class _l {
|
|
|
5440
5440
|
const e = this._lowResPathTracer, t = this._pathTracer, i = this._renderer, s = this._clock, a = this._quad;
|
|
5441
5441
|
this._updateScale(), this._queueReset && (t.reset(), e.reset(), this._queueReset = !1, a.material.opacity = 0, s.start());
|
|
5442
5442
|
const n = s.getDelta() * 1e3, c = s.getElapsedTime() * 1e3;
|
|
5443
|
-
if (!this.pausePathTracing && this.enablePathTracing && this.renderDelay <= c && !this.isCompiling && t.update(), t.alpha = t.material.backgroundAlpha !== 1 || !
|
|
5443
|
+
if (!this.pausePathTracing && this.enablePathTracing && this.renderDelay <= c && !this.isCompiling && t.update(), t.alpha = t.material.backgroundAlpha !== 1 || !_l(i), e.alpha = t.alpha, this.renderToCanvas) {
|
|
5444
5444
|
const u = this._renderer, f = this.minSamples;
|
|
5445
5445
|
if (c >= this.renderDelay && this.samples >= this.minSamples && (this.fadeDuration !== 0 ? a.material.opacity = Math.min(a.material.opacity + n / this.fadeDuration, 1) : a.material.opacity = 1), !this.enablePathTracing || this.samples < f || a.material.opacity < 1) {
|
|
5446
5446
|
if (this.dynamicLowRes && !this.isCompiling) {
|
|
@@ -5450,7 +5450,7 @@ class _l {
|
|
|
5450
5450
|
}
|
|
5451
5451
|
(!this.dynamicLowRes && this.rasterizeScene || this.dynamicLowRes && this.isCompiling) && this.rasterizeSceneCallback(this.scene, this.camera);
|
|
5452
5452
|
}
|
|
5453
|
-
this.enablePathTracing && a.material.opacity > 0 && (a.material.opacity < 1 && (a.material.blending = this.dynamicLowRes ?
|
|
5453
|
+
this.enablePathTracing && a.material.opacity > 0 && (a.material.opacity < 1 && (a.material.blending = this.dynamicLowRes ? eo : pn), a.material.map = t.target.texture, this.renderToCanvasCallback(t.target, u, a), a.material.blending = ri);
|
|
5454
5454
|
}
|
|
5455
5455
|
}
|
|
5456
5456
|
reset() {
|
|
@@ -5470,50 +5470,50 @@ class _l {
|
|
|
5470
5470
|
}
|
|
5471
5471
|
}
|
|
5472
5472
|
}
|
|
5473
|
-
const
|
|
5474
|
-
globalThis.GLTF_PROGRESSIVE_VERSION =
|
|
5473
|
+
const xl = "";
|
|
5474
|
+
globalThis.GLTF_PROGRESSIVE_VERSION = xl;
|
|
5475
5475
|
console.debug("[gltf-progressive] version -");
|
|
5476
5476
|
let Me = "https://www.gstatic.com/draco/versioned/decoders/1.5.7/", Qi = "https://cdn.needle.tools/static/three/0.179.1/basis2/";
|
|
5477
|
-
const
|
|
5478
|
-
|
|
5479
|
-
fetch(
|
|
5477
|
+
const wl = Me, bl = Qi, bn = new URL(Me + "draco_decoder.js");
|
|
5478
|
+
bn.searchParams.append("range", "true");
|
|
5479
|
+
fetch(bn, {
|
|
5480
5480
|
method: "GET",
|
|
5481
5481
|
headers: {
|
|
5482
5482
|
Range: "bytes=0-1"
|
|
5483
5483
|
}
|
|
5484
5484
|
}).catch((o) => {
|
|
5485
|
-
console.debug(`Failed to fetch remote Draco decoder from ${Me} (offline: ${typeof navigator < "u" ? navigator.onLine : "unknown"})`), Me ===
|
|
5485
|
+
console.debug(`Failed to fetch remote Draco decoder from ${Me} (offline: ${typeof navigator < "u" ? navigator.onLine : "unknown"})`), Me === wl && Tl("./include/draco/"), Qi === bl && Sl("./include/ktx2/");
|
|
5486
5486
|
}).finally(() => {
|
|
5487
|
-
|
|
5487
|
+
Tn();
|
|
5488
5488
|
});
|
|
5489
|
-
const
|
|
5489
|
+
const Al = () => ({
|
|
5490
5490
|
dracoDecoderPath: Me,
|
|
5491
5491
|
ktx2TranscoderPath: Qi
|
|
5492
5492
|
});
|
|
5493
|
-
function
|
|
5493
|
+
function Tl(o) {
|
|
5494
5494
|
Me = o, he && he[Is] != Me ? (console.debug("Updating Draco decoder path to " + o), he[Is] = Me, he.setDecoderPath(Me), he.preload()) : console.debug("Setting Draco decoder path to " + o);
|
|
5495
5495
|
}
|
|
5496
|
-
function
|
|
5496
|
+
function Sl(o) {
|
|
5497
5497
|
Qi = o;
|
|
5498
5498
|
}
|
|
5499
5499
|
function Ys(o) {
|
|
5500
|
-
return
|
|
5500
|
+
return Tn(), { dracoLoader: he, meshoptDecoder: zi };
|
|
5501
5501
|
}
|
|
5502
|
-
function
|
|
5502
|
+
function An(o) {
|
|
5503
5503
|
o.dracoLoader || o.setDRACOLoader(he), o.meshoptDecoder || o.setMeshoptDecoder(zi);
|
|
5504
5504
|
}
|
|
5505
5505
|
const Is = Symbol("dracoDecoderPath");
|
|
5506
5506
|
let he, zi;
|
|
5507
|
-
function
|
|
5508
|
-
he || (he = new
|
|
5507
|
+
function Tn() {
|
|
5508
|
+
he || (he = new To(), he[Is] = Me, he.setDecoderPath(Me), he.setDecoderConfig({ type: "js" }), he.preload()), zi || (zi = Ao);
|
|
5509
5509
|
}
|
|
5510
5510
|
const Rs = /* @__PURE__ */ new WeakMap();
|
|
5511
|
-
function
|
|
5511
|
+
function Sn(o, e) {
|
|
5512
5512
|
let t = Rs.get(o);
|
|
5513
5513
|
t ? t = Object.assign(t, e) : t = e, Rs.set(o, t);
|
|
5514
5514
|
}
|
|
5515
5515
|
const rs = Gs.prototype.load;
|
|
5516
|
-
function
|
|
5516
|
+
function Ml(...o) {
|
|
5517
5517
|
const e = Rs.get(this);
|
|
5518
5518
|
let t = o[0];
|
|
5519
5519
|
const i = new URL(t, window.location.href);
|
|
@@ -5523,7 +5523,7 @@ function Sl(...o) {
|
|
|
5523
5523
|
}
|
|
5524
5524
|
return o[0] = t, rs == null ? void 0 : rs.call(this, ...o);
|
|
5525
5525
|
}
|
|
5526
|
-
Gs.prototype.load =
|
|
5526
|
+
Gs.prototype.load = Ml;
|
|
5527
5527
|
ut("debugprogressive");
|
|
5528
5528
|
function ut(o) {
|
|
5529
5529
|
if (typeof window > "u")
|
|
@@ -5531,7 +5531,7 @@ function ut(o) {
|
|
|
5531
5531
|
const t = new URL(window.location.href).searchParams.get(o);
|
|
5532
5532
|
return t == null || t === "0" || t === "false" ? !1 : t === "" ? !0 : t;
|
|
5533
5533
|
}
|
|
5534
|
-
function
|
|
5534
|
+
function Cl(o, e) {
|
|
5535
5535
|
if (e === void 0 || o === void 0 || e.startsWith("./") || e.startsWith("http") || e.startsWith("data:") || e.startsWith("blob:"))
|
|
5536
5536
|
return e;
|
|
5537
5537
|
const t = o.lastIndexOf("/");
|
|
@@ -5543,7 +5543,7 @@ function Ml(o, e) {
|
|
|
5543
5543
|
}
|
|
5544
5544
|
return e;
|
|
5545
5545
|
}
|
|
5546
|
-
function
|
|
5546
|
+
function Mn() {
|
|
5547
5547
|
return Ut !== void 0 || (Ut = /iPhone|iPad|iPod|Android|IEMobile/i.test(navigator.userAgent), ut("debugprogressive") && console.log("[glTF Progressive]: isMobileDevice", Ut)), Ut;
|
|
5548
5548
|
}
|
|
5549
5549
|
let Ut;
|
|
@@ -5553,7 +5553,7 @@ function Er() {
|
|
|
5553
5553
|
const o = new URL(window.location.href), e = o.hostname === "localhost" || /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(o.hostname);
|
|
5554
5554
|
return o.hostname === "127.0.0.1" || e;
|
|
5555
5555
|
}
|
|
5556
|
-
class
|
|
5556
|
+
class Il {
|
|
5557
5557
|
constructor(e = 100, t = {}) {
|
|
5558
5558
|
E(this, "_running", /* @__PURE__ */ new Map());
|
|
5559
5559
|
E(this, "_queue", []);
|
|
@@ -5587,14 +5587,14 @@ class Cl {
|
|
|
5587
5587
|
}
|
|
5588
5588
|
}
|
|
5589
5589
|
}
|
|
5590
|
-
const
|
|
5590
|
+
const Rl = typeof window > "u" && typeof document > "u", Ds = Symbol("needle:raycast-mesh");
|
|
5591
5591
|
function ai(o) {
|
|
5592
|
-
return (o == null ? void 0 : o[
|
|
5592
|
+
return (o == null ? void 0 : o[Ds]) instanceof le ? o[Ds] : null;
|
|
5593
5593
|
}
|
|
5594
|
-
function
|
|
5594
|
+
function Dl(o, e) {
|
|
5595
5595
|
if ((o.type === "Mesh" || o.type === "SkinnedMesh") && !ai(o)) {
|
|
5596
|
-
const i =
|
|
5597
|
-
i.userData = { isRaycastMesh: !0 }, o[
|
|
5596
|
+
const i = El(e);
|
|
5597
|
+
i.userData = { isRaycastMesh: !0 }, o[Ds] = i;
|
|
5598
5598
|
}
|
|
5599
5599
|
}
|
|
5600
5600
|
function Pl(o = !0) {
|
|
@@ -5614,7 +5614,7 @@ function Pl(o = !0) {
|
|
|
5614
5614
|
}
|
|
5615
5615
|
}
|
|
5616
5616
|
let Ht = null;
|
|
5617
|
-
function
|
|
5617
|
+
function El(o) {
|
|
5618
5618
|
const e = new le();
|
|
5619
5619
|
for (const t in o.attributes)
|
|
5620
5620
|
e.setAttribute(t, o.getAttribute(t));
|
|
@@ -5632,25 +5632,25 @@ if (O) {
|
|
|
5632
5632
|
!isNaN(i) && i >= 0 && (lt = i, console.log(`Set LOD level to [${lt}]`));
|
|
5633
5633
|
});
|
|
5634
5634
|
}
|
|
5635
|
-
function
|
|
5635
|
+
function Cn(o) {
|
|
5636
5636
|
if (O && ei !== void 0)
|
|
5637
5637
|
if (Array.isArray(o))
|
|
5638
5638
|
for (const e of o)
|
|
5639
|
-
|
|
5639
|
+
Cn(e);
|
|
5640
5640
|
else
|
|
5641
5641
|
o && "wireframe" in o && (o.wireframe = ei === !0);
|
|
5642
5642
|
}
|
|
5643
5643
|
const Wt = new Array();
|
|
5644
|
-
let
|
|
5645
|
-
const
|
|
5646
|
-
function
|
|
5647
|
-
if (Wt.length <
|
|
5644
|
+
let Ll = 0;
|
|
5645
|
+
const Fl = Mn() ? 2 : 10;
|
|
5646
|
+
function kl(o) {
|
|
5647
|
+
if (Wt.length < Fl) {
|
|
5648
5648
|
const i = Wt.length;
|
|
5649
5649
|
O && console.warn(`[Worker] Creating new worker #${i}`);
|
|
5650
5650
|
const s = Zs.createWorker(o || {});
|
|
5651
5651
|
return Wt.push(s), s;
|
|
5652
5652
|
}
|
|
5653
|
-
const e =
|
|
5653
|
+
const e = Ll++ % Wt.length;
|
|
5654
5654
|
return Wt[e];
|
|
5655
5655
|
}
|
|
5656
5656
|
class Zs {
|
|
@@ -5664,7 +5664,7 @@ class Zs {
|
|
|
5664
5664
|
case "loaded-gltf":
|
|
5665
5665
|
for (const a of this._running)
|
|
5666
5666
|
if (a.url === s.result.url) {
|
|
5667
|
-
|
|
5667
|
+
Bl(s.result), a.resolve(s.result);
|
|
5668
5668
|
const n = a.url;
|
|
5669
5669
|
n.startsWith("blob:") && URL.revokeObjectURL(n);
|
|
5670
5670
|
}
|
|
@@ -5682,7 +5682,7 @@ class Zs {
|
|
|
5682
5682
|
return new Zs(t, e);
|
|
5683
5683
|
}
|
|
5684
5684
|
async load(e, t) {
|
|
5685
|
-
const i =
|
|
5685
|
+
const i = Al();
|
|
5686
5686
|
let s = t == null ? void 0 : t.renderer;
|
|
5687
5687
|
s || (this._webglRenderer ?? (this._webglRenderer = (async () => {
|
|
5688
5688
|
const { WebGLRenderer: f } = await import("three");
|
|
@@ -5705,7 +5705,7 @@ class Zs {
|
|
|
5705
5705
|
});
|
|
5706
5706
|
}
|
|
5707
5707
|
}
|
|
5708
|
-
function
|
|
5708
|
+
function Bl(o) {
|
|
5709
5709
|
var e, t, i, s, a, n, c, u, f, d, r, l, h, m, v, p;
|
|
5710
5710
|
for (const g of o.geometries) {
|
|
5711
5711
|
const _ = g.geometry, y = new le();
|
|
@@ -5747,7 +5747,7 @@ function kl(o) {
|
|
|
5747
5747
|
let y = null;
|
|
5748
5748
|
if (_.isCompressedTexture) {
|
|
5749
5749
|
const x = _.mipmaps, w = ((r = _.image) == null ? void 0 : r.width) || ((h = (l = _.source) == null ? void 0 : l.data) == null ? void 0 : h.width) || -1, A = ((m = _.image) == null ? void 0 : m.height) || ((p = (v = _.source) == null ? void 0 : v.data) == null ? void 0 : p.height) || -1;
|
|
5750
|
-
y = new
|
|
5750
|
+
y = new to(
|
|
5751
5751
|
x,
|
|
5752
5752
|
w,
|
|
5753
5753
|
A,
|
|
@@ -5773,7 +5773,7 @@ function kl(o) {
|
|
|
5773
5773
|
_.type,
|
|
5774
5774
|
_.anisotropy,
|
|
5775
5775
|
_.colorSpace
|
|
5776
|
-
), y.mipmaps = _.mipmaps, y.channel = _.channel, y.source.data = _.source.data, y.flipY = _.flipY, y.premultiplyAlpha = _.premultiplyAlpha, y.unpackAlignment = _.unpackAlignment, y.matrix = new
|
|
5776
|
+
), y.mipmaps = _.mipmaps, y.channel = _.channel, y.source.data = _.source.data, y.flipY = _.flipY, y.premultiplyAlpha = _.premultiplyAlpha, y.unpackAlignment = _.unpackAlignment, y.matrix = new hn(..._.matrix.elements);
|
|
5777
5777
|
if (!y) {
|
|
5778
5778
|
console.error("[Worker] Failed to create new texture from received data. Texture is not a CompressedTexture or Texture.");
|
|
5779
5779
|
continue;
|
|
@@ -5785,13 +5785,13 @@ function kl(o) {
|
|
|
5785
5785
|
function ns(o) {
|
|
5786
5786
|
let e = o;
|
|
5787
5787
|
if ("isInterleavedBufferAttribute" in o && o.isInterleavedBufferAttribute) {
|
|
5788
|
-
const t = o.data, i = t.array, s = new
|
|
5789
|
-
e = new
|
|
5788
|
+
const t = o.data, i = t.array, s = new io(i, t.stride);
|
|
5789
|
+
e = new so(s, o.itemSize, i.byteOffset, o.normalized), e.offset = o.offset;
|
|
5790
5790
|
} else
|
|
5791
5791
|
"isBufferAttribute" in o && o.isBufferAttribute && (e = new fe(o.array, o.itemSize, o.normalized), e.usage = o.usage, e.gpuType = o.gpuType, e.updateRanges = o.updateRanges);
|
|
5792
5792
|
return e;
|
|
5793
5793
|
}
|
|
5794
|
-
const
|
|
5794
|
+
const Ol = ut("gltf-progressive-worker"), zl = ut("gltf-progressive-reduce-mipmaps"), os = Symbol("needle-progressive-texture"), Le = "NEEDLE_progressive", B = class B {
|
|
5795
5795
|
constructor(e) {
|
|
5796
5796
|
E(this, "parser");
|
|
5797
5797
|
E(this, "url");
|
|
@@ -5800,7 +5800,7 @@ const Bl = ut("gltf-progressive-worker"), Ol = ut("gltf-progressive-reduce-mipma
|
|
|
5800
5800
|
var i, s;
|
|
5801
5801
|
if (this._isLoadingMesh)
|
|
5802
5802
|
return null;
|
|
5803
|
-
const t = (s = (i = this.parser.json.meshes[e]) == null ? void 0 : i.extensions) == null ? void 0 : s[
|
|
5803
|
+
const t = (s = (i = this.parser.json.meshes[e]) == null ? void 0 : i.extensions) == null ? void 0 : s[Le];
|
|
5804
5804
|
return t ? (this._isLoadingMesh = !0, this.parser.getDependency("mesh", e).then((a) => {
|
|
5805
5805
|
var n;
|
|
5806
5806
|
return this._isLoadingMesh = !1, a && B.registerMesh(this.url, t.guid, a, (n = t.lods) == null ? void 0 : n.length, 0, t), a;
|
|
@@ -5811,7 +5811,7 @@ const Bl = ut("gltf-progressive-worker"), Ol = ut("gltf-progressive-reduce-mipma
|
|
|
5811
5811
|
}
|
|
5812
5812
|
/** The name of the extension */
|
|
5813
5813
|
get name() {
|
|
5814
|
-
return
|
|
5814
|
+
return Le;
|
|
5815
5815
|
}
|
|
5816
5816
|
// #region PUBLIC API
|
|
5817
5817
|
static getMeshLODExtension(e) {
|
|
@@ -6002,7 +6002,7 @@ const Bl = ut("gltf-progressive-worker"), Ol = ut("gltf-progressive-reduce-mipma
|
|
|
6002
6002
|
if (f && (f == null ? void 0 : f.level) < t)
|
|
6003
6003
|
return O === "verbose" && console.warn("Assigned texture level is already higher: ", f.level, t, i, u, a), null;
|
|
6004
6004
|
}
|
|
6005
|
-
if (
|
|
6005
|
+
if (zl && a.mipmaps) {
|
|
6006
6006
|
const f = a.mipmaps.length;
|
|
6007
6007
|
a.mipmaps.length = Math.min(a.mipmaps.length, 3), f !== a.mipmaps.length && O && console.debug(`Reduced mipmap count from ${f} to ${a.mipmaps.length} for ${a.uuid}: ${(n = a.image) == null ? void 0 : n.width}x${(c = a.image) == null ? void 0 : c.height}.`);
|
|
6008
6008
|
}
|
|
@@ -6033,7 +6033,7 @@ const Bl = ut("gltf-progressive-worker"), Ol = ut("gltf-progressive-reduce-mipma
|
|
|
6033
6033
|
return O && console.log("AFTER", this.url, e), (t = this.parser.json.textures) == null || t.forEach((s, a) => {
|
|
6034
6034
|
var n;
|
|
6035
6035
|
if (s != null && s.extensions) {
|
|
6036
|
-
const c = s == null ? void 0 : s.extensions[
|
|
6036
|
+
const c = s == null ? void 0 : s.extensions[Le];
|
|
6037
6037
|
if (c) {
|
|
6038
6038
|
if (!c.lods) {
|
|
6039
6039
|
O && console.warn("Texture has no LODs", c);
|
|
@@ -6053,7 +6053,7 @@ const Bl = ut("gltf-progressive-worker"), Ol = ut("gltf-progressive-reduce-mipma
|
|
|
6053
6053
|
}
|
|
6054
6054
|
}), (i = this.parser.json.meshes) == null || i.forEach((s, a) => {
|
|
6055
6055
|
if (s != null && s.extensions) {
|
|
6056
|
-
const n = s == null ? void 0 : s.extensions[
|
|
6056
|
+
const n = s == null ? void 0 : s.extensions[Le];
|
|
6057
6057
|
if (n && n.lods) {
|
|
6058
6058
|
for (const c of this.parser.associations.keys())
|
|
6059
6059
|
if (c.isMesh) {
|
|
@@ -6087,7 +6087,7 @@ const Bl = ut("gltf-progressive-worker"), Ol = ut("gltf-progressive-reduce-mipma
|
|
|
6087
6087
|
const l = Array.isArray(n.lods) ? (u = n.lods[t]) == null ? void 0 : u.path : n.lods;
|
|
6088
6088
|
if (!l)
|
|
6089
6089
|
return O && !n["missing:uri"] && (n["missing:uri"] = !0, console.warn("Missing uri for progressive asset for LOD " + t, n)), null;
|
|
6090
|
-
const h =
|
|
6090
|
+
const h = Cl(s.url, l);
|
|
6091
6091
|
if (h.endsWith(".glb") || h.endsWith(".gltf")) {
|
|
6092
6092
|
if (!n.guid)
|
|
6093
6093
|
return console.warn("missing pointer for glb/gltf texture", n), null;
|
|
@@ -6102,79 +6102,79 @@ const Bl = ut("gltf-progressive-worker"), Ol = ut("gltf-progressive-reduce-mipma
|
|
|
6102
6102
|
if (!v.use)
|
|
6103
6103
|
return O && console.log(`LOD ${t} was aborted: ${h}`), null;
|
|
6104
6104
|
const g = n, _ = new Promise(async (x, w) => {
|
|
6105
|
-
if (
|
|
6106
|
-
const T = await (await
|
|
6105
|
+
if (Ol) {
|
|
6106
|
+
const T = await (await kl({})).load(h);
|
|
6107
6107
|
if (T.textures.length > 0)
|
|
6108
6108
|
for (const I of T.textures) {
|
|
6109
|
-
let
|
|
6110
|
-
return B.assignLODInformation(s.url,
|
|
6109
|
+
let P = I.texture;
|
|
6110
|
+
return B.assignLODInformation(s.url, P, a, t, void 0), e instanceof Qe && (P = this.copySettings(e, P)), P && (P.guid = g.guid), x(P);
|
|
6111
6111
|
}
|
|
6112
6112
|
if (T.geometries.length > 0) {
|
|
6113
6113
|
const I = new Array();
|
|
6114
|
-
for (const
|
|
6115
|
-
const L =
|
|
6116
|
-
B.assignLODInformation(s.url, L, a, t,
|
|
6114
|
+
for (const P of T.geometries) {
|
|
6115
|
+
const L = P.geometry;
|
|
6116
|
+
B.assignLODInformation(s.url, L, a, t, P.primitiveIndex), I.push(L);
|
|
6117
6117
|
}
|
|
6118
6118
|
return x(I);
|
|
6119
6119
|
}
|
|
6120
6120
|
return x(null);
|
|
6121
6121
|
}
|
|
6122
6122
|
const A = new Gs();
|
|
6123
|
-
|
|
6123
|
+
An(A), O && (await new Promise((D) => setTimeout(D, 1e3)), i && console.warn("Start loading (delayed) " + h, g.guid));
|
|
6124
6124
|
let S = h;
|
|
6125
6125
|
if (g && Array.isArray(g.lods)) {
|
|
6126
|
-
const
|
|
6127
|
-
|
|
6126
|
+
const D = g.lods[t];
|
|
6127
|
+
D.hash && (S += "?v=" + D.hash);
|
|
6128
6128
|
}
|
|
6129
|
-
const C = await A.loadAsync(S).catch((
|
|
6130
|
-
`,
|
|
6129
|
+
const C = await A.loadAsync(S).catch((D) => (console.error(`Error loading LOD ${t} from ${h}
|
|
6130
|
+
`, D), x(null)));
|
|
6131
6131
|
if (!C)
|
|
6132
6132
|
return x(null);
|
|
6133
6133
|
const M = C.parser;
|
|
6134
6134
|
i && console.log("Loading finished " + h, g.guid);
|
|
6135
6135
|
let R = 0;
|
|
6136
6136
|
if (C.parser.json.textures) {
|
|
6137
|
-
let
|
|
6137
|
+
let D = !1;
|
|
6138
6138
|
for (const T of C.parser.json.textures) {
|
|
6139
6139
|
if (T != null && T.extensions) {
|
|
6140
|
-
const I = T == null ? void 0 : T.extensions[
|
|
6140
|
+
const I = T == null ? void 0 : T.extensions[Le];
|
|
6141
6141
|
if (I != null && I.guid && I.guid === g.guid) {
|
|
6142
|
-
|
|
6142
|
+
D = !0;
|
|
6143
6143
|
break;
|
|
6144
6144
|
}
|
|
6145
6145
|
}
|
|
6146
6146
|
R++;
|
|
6147
6147
|
}
|
|
6148
|
-
if (
|
|
6148
|
+
if (D) {
|
|
6149
6149
|
let T = await M.getDependency("texture", R);
|
|
6150
6150
|
return T && B.assignLODInformation(s.url, T, a, t, void 0), i && console.log('change "' + e.name + '" → "' + T.name + '"', h, R, T, m), e instanceof Qe && (T = this.copySettings(e, T)), T && (T.guid = g.guid), x(T);
|
|
6151
6151
|
} else
|
|
6152
6152
|
O && console.warn("Could not find texture with guid", g.guid, C.parser.json);
|
|
6153
6153
|
}
|
|
6154
6154
|
if (R = 0, C.parser.json.meshes) {
|
|
6155
|
-
let
|
|
6155
|
+
let D = !1;
|
|
6156
6156
|
for (const T of C.parser.json.meshes) {
|
|
6157
6157
|
if (T != null && T.extensions) {
|
|
6158
|
-
const I = T == null ? void 0 : T.extensions[
|
|
6158
|
+
const I = T == null ? void 0 : T.extensions[Le];
|
|
6159
6159
|
if (I != null && I.guid && I.guid === g.guid) {
|
|
6160
|
-
|
|
6160
|
+
D = !0;
|
|
6161
6161
|
break;
|
|
6162
6162
|
}
|
|
6163
6163
|
}
|
|
6164
6164
|
R++;
|
|
6165
6165
|
}
|
|
6166
|
-
if (
|
|
6166
|
+
if (D) {
|
|
6167
6167
|
const T = await M.getDependency("mesh", R);
|
|
6168
6168
|
if (i && console.log(`Loaded Mesh "${T.name}"`, h, R, T, m), T.isMesh === !0) {
|
|
6169
6169
|
const I = T.geometry;
|
|
6170
6170
|
return B.assignLODInformation(s.url, I, a, t, 0), x(I);
|
|
6171
6171
|
} else {
|
|
6172
6172
|
const I = new Array();
|
|
6173
|
-
for (let
|
|
6174
|
-
const L = T.children[
|
|
6173
|
+
for (let P = 0; P < T.children.length; P++) {
|
|
6174
|
+
const L = T.children[P];
|
|
6175
6175
|
if (L.isMesh === !0) {
|
|
6176
6176
|
const F = L.geometry;
|
|
6177
|
-
B.assignLODInformation(s.url, F, a, t,
|
|
6177
|
+
B.assignLODInformation(s.url, F, a, t, P), I.push(F);
|
|
6178
6178
|
}
|
|
6179
6179
|
}
|
|
6180
6180
|
return x(I);
|
|
@@ -6187,7 +6187,7 @@ const Bl = ut("gltf-progressive-worker"), Ol = ut("gltf-progressive-reduce-mipma
|
|
|
6187
6187
|
return this.previouslyLoaded.set(m, _), v.use(_), await _;
|
|
6188
6188
|
} else if (e instanceof Qe) {
|
|
6189
6189
|
i && console.log("Load texture from uri: " + h);
|
|
6190
|
-
const v = await new
|
|
6190
|
+
const v = await new mn().loadAsync(h);
|
|
6191
6191
|
return v ? (v.guid = n.guid, v.flipY = !1, v.needsUpdate = !0, v.colorSpace = e.colorSpace, i && console.log(n, v)) : O && console.warn("failed loading", h), v;
|
|
6192
6192
|
}
|
|
6193
6193
|
}
|
|
@@ -6197,7 +6197,7 @@ const Bl = ut("gltf-progressive-worker"), Ol = ut("gltf-progressive-reduce-mipma
|
|
|
6197
6197
|
if (!t)
|
|
6198
6198
|
return;
|
|
6199
6199
|
t.userData || (t.userData = {});
|
|
6200
|
-
const n = new
|
|
6200
|
+
const n = new Ul(e, i, s, a);
|
|
6201
6201
|
t.userData.LODS = n, "source" in t && typeof t.source == "object" && (t.source.LODS = n);
|
|
6202
6202
|
}
|
|
6203
6203
|
static getAssignedLODInformation(e) {
|
|
@@ -6239,15 +6239,15 @@ E(B, "registerMesh", (e, t, i, s, a, n) => {
|
|
|
6239
6239
|
}
|
|
6240
6240
|
c.userData || (c.userData = {}), O && console.log("> Progressive: register mesh " + i.name, { index: a, uuid: i.uuid }, n, i), B.assignLODInformation(e, c, t, s, a), B.lodInfos.set(t, n);
|
|
6241
6241
|
let u = B.lowresCache.get(t);
|
|
6242
|
-
u ? u.push(i.geometry) : u = [i.geometry], B.lowresCache.set(t, u), s > 0 && !ai(i) &&
|
|
6242
|
+
u ? u.push(i.geometry) : u = [i.geometry], B.lowresCache.set(t, u), s > 0 && !ai(i) && Dl(i, c);
|
|
6243
6243
|
for (const d of Ze)
|
|
6244
6244
|
(f = d.onRegisteredNewMesh) == null || f.call(d, i, n);
|
|
6245
6245
|
}), /** A map of key = asset uuid and value = LOD information */
|
|
6246
6246
|
E(B, "lodInfos", /* @__PURE__ */ new Map()), /** cache of already loaded mesh lods */
|
|
6247
6247
|
E(B, "previouslyLoaded", /* @__PURE__ */ new Map()), /** this contains the geometry/textures that were originally loaded */
|
|
6248
|
-
E(B, "lowresCache", /* @__PURE__ */ new Map()), E(B, "workers", []), E(B, "_workersIndex", 0), E(B, "maxConcurrent", 50), E(B, "queue", new
|
|
6248
|
+
E(B, "lowresCache", /* @__PURE__ */ new Map()), E(B, "workers", []), E(B, "_workersIndex", 0), E(B, "maxConcurrent", 50), E(B, "queue", new Il(B.maxConcurrent, { debug: O != !1 }));
|
|
6249
6249
|
let Re = B;
|
|
6250
|
-
class
|
|
6250
|
+
class Ul {
|
|
6251
6251
|
constructor(e, t, i, s) {
|
|
6252
6252
|
E(this, "url");
|
|
6253
6253
|
/** the key to lookup the LOD information */
|
|
@@ -6258,7 +6258,7 @@ class zl {
|
|
|
6258
6258
|
this.url = e, this.key = t, this.level = i, s != null && (this.index = s);
|
|
6259
6259
|
}
|
|
6260
6260
|
}
|
|
6261
|
-
class
|
|
6261
|
+
class Pi {
|
|
6262
6262
|
constructor(e, t) {
|
|
6263
6263
|
E(this, "ready");
|
|
6264
6264
|
E(this, "_resolve");
|
|
@@ -6332,13 +6332,13 @@ class Di {
|
|
|
6332
6332
|
});
|
|
6333
6333
|
}
|
|
6334
6334
|
}
|
|
6335
|
-
E(
|
|
6335
|
+
E(Pi, "addPromise", (e, t, i, s) => {
|
|
6336
6336
|
s.forEach((a) => {
|
|
6337
6337
|
a.add(e, t, i);
|
|
6338
6338
|
});
|
|
6339
6339
|
});
|
|
6340
|
-
const be = ut("debugprogressive"),
|
|
6341
|
-
var ue,
|
|
6340
|
+
const be = ut("debugprogressive"), Hl = ut("noprogressive"), as = Symbol("Needle:LODSManager"), ls = Symbol("Needle:LODState"), qe = Symbol("Needle:CurrentLOD"), oe = { mesh_lod: -1, texture_lod: -1 };
|
|
6341
|
+
var ue, Fe, Vi, Ke, Pt, Ni, ke;
|
|
6342
6342
|
const V = class V {
|
|
6343
6343
|
// readonly plugins: NEEDLE_progressive_plugin[] = [];
|
|
6344
6344
|
constructor(e, t) {
|
|
@@ -6381,12 +6381,12 @@ const V = class V {
|
|
|
6381
6381
|
E(this, "_newPromiseGroups", []);
|
|
6382
6382
|
E(this, "_promiseGroupIds", 0);
|
|
6383
6383
|
E(this, "_lodchangedlisteners", []);
|
|
6384
|
-
Ge(this,
|
|
6384
|
+
Ge(this, Fe, void 0);
|
|
6385
6385
|
Ge(this, Vi, new qi());
|
|
6386
6386
|
Ge(this, Ke, 0);
|
|
6387
|
-
Ge(this,
|
|
6387
|
+
Ge(this, Pt, 0);
|
|
6388
6388
|
Ge(this, Ni, 0);
|
|
6389
|
-
Ge(this,
|
|
6389
|
+
Ge(this, ke, 0);
|
|
6390
6390
|
E(this, "_fpsBuffer", [60, 60, 60, 60, 60]);
|
|
6391
6391
|
// private testIfLODLevelsAreAvailable() {
|
|
6392
6392
|
E(this, "_sphere", new ji());
|
|
@@ -6431,7 +6431,7 @@ const V = class V {
|
|
|
6431
6431
|
* Call to await LODs loading during the next render cycle.
|
|
6432
6432
|
*/
|
|
6433
6433
|
awaitLoading(e) {
|
|
6434
|
-
const t = this._promiseGroupIds++, i = new
|
|
6434
|
+
const t = this._promiseGroupIds++, i = new Pi(H(this, Ke), { ...e });
|
|
6435
6435
|
this._newPromiseGroups.push(i);
|
|
6436
6436
|
const s = performance.now();
|
|
6437
6437
|
return i.ready.finally(() => {
|
|
@@ -6460,21 +6460,21 @@ const V = class V {
|
|
|
6460
6460
|
* Enable the LODsManager. This will replace the render method of the renderer with a method that updates the LODs.
|
|
6461
6461
|
*/
|
|
6462
6462
|
enable() {
|
|
6463
|
-
if (H(this,
|
|
6463
|
+
if (H(this, Fe))
|
|
6464
6464
|
return;
|
|
6465
6465
|
console.debug("[gltf-progressive] Enabling LODsManager for renderer");
|
|
6466
6466
|
let e = 0;
|
|
6467
|
-
Ie(this,
|
|
6467
|
+
Ie(this, Fe, this.renderer.render);
|
|
6468
6468
|
const t = this;
|
|
6469
6469
|
Ys(this.renderer), this.renderer.render = function(i, s) {
|
|
6470
6470
|
const a = t.renderer.getRenderTarget();
|
|
6471
|
-
(a == null || "isXRRenderTarget" in a && a.isXRRenderTarget) && (e = 0, Ie(t, Ke, H(t, Ke) + 1), Ie(t,
|
|
6471
|
+
(a == null || "isXRRenderTarget" in a && a.isXRRenderTarget) && (e = 0, Ie(t, Ke, H(t, Ke) + 1), Ie(t, Pt, H(t, Vi).getDelta()), Ie(t, Ni, H(t, Ni) + H(t, Pt)), t._fpsBuffer.shift(), t._fpsBuffer.push(1 / H(t, Pt)), Ie(t, ke, t._fpsBuffer.reduce((c, u) => c + u) / t._fpsBuffer.length), be && H(t, Ke) % 200 === 0 && console.log("FPS", Math.round(H(t, ke)), "Interval:", H(t, ue)));
|
|
6472
6472
|
const n = e++;
|
|
6473
|
-
H(t,
|
|
6473
|
+
H(t, Fe).call(this, i, s), t.onAfterRender(i, s, n);
|
|
6474
6474
|
};
|
|
6475
6475
|
}
|
|
6476
6476
|
disable() {
|
|
6477
|
-
H(this,
|
|
6477
|
+
H(this, Fe) && (console.debug("[gltf-progressive] Disabling LODsManager for renderer"), this.renderer.render = H(this, Fe), Ie(this, Fe, void 0));
|
|
6478
6478
|
}
|
|
6479
6479
|
update(e, t) {
|
|
6480
6480
|
this.internalUpdate(e, t);
|
|
@@ -6489,7 +6489,7 @@ const V = class V {
|
|
|
6489
6489
|
(c.name === "EffectMaterial" || c.name === "CopyShader") && (n = !1);
|
|
6490
6490
|
}
|
|
6491
6491
|
if ((t.parent && t.parent.type === "CubeCamera" || i >= 1 && t.type === "OrthographicCamera") && (n = !1), n) {
|
|
6492
|
-
if (
|
|
6492
|
+
if (Hl || (this.updateInterval === "auto" ? H(this, ke) < 40 && H(this, ue) < 10 ? (Ie(this, ue, H(this, ue) + 1), be && console.warn("↓ Reducing LOD updates", H(this, ue), H(this, ke).toFixed(0))) : H(this, ke) >= 60 && H(this, ue) > 1 && (Ie(this, ue, H(this, ue) - 1), be && console.warn("↑ Increasing LOD updates", H(this, ue), H(this, ke).toFixed(0))) : Ie(this, ue, this.updateInterval), H(this, ue) > 0 && H(this, Ke) % H(this, ue) != 0))
|
|
6493
6493
|
return;
|
|
6494
6494
|
this.internalUpdate(e, t), this._postprocessPromiseGroups();
|
|
6495
6495
|
}
|
|
@@ -6518,7 +6518,7 @@ const V = class V {
|
|
|
6518
6518
|
}
|
|
6519
6519
|
if (be === "color" && d.material && !d.object.progressive_debug_color) {
|
|
6520
6520
|
d.object.progressive_debug_color = !0;
|
|
6521
|
-
const l = Math.random() * 16777215, h = new
|
|
6521
|
+
const l = Math.random() * 16777215, h = new ro({ color: l });
|
|
6522
6522
|
d.object.material = h;
|
|
6523
6523
|
}
|
|
6524
6524
|
const r = d.object;
|
|
@@ -6540,12 +6540,12 @@ const V = class V {
|
|
|
6540
6540
|
var c, u;
|
|
6541
6541
|
i.userData || (i.userData = {});
|
|
6542
6542
|
let a = i[ls];
|
|
6543
|
-
if (a || (a = new
|
|
6543
|
+
if (a || (a = new Wl(), i[ls] = a), a.frames++ < 2)
|
|
6544
6544
|
return;
|
|
6545
6545
|
for (const f of Ze)
|
|
6546
6546
|
(c = f.onBeforeUpdateLOD) == null || c.call(f, this.renderer, e, t, i);
|
|
6547
6547
|
const n = this.overrideLodLevel !== void 0 ? this.overrideLodLevel : lt;
|
|
6548
|
-
n >= 0 ? (oe.mesh_lod = n, oe.texture_lod = n) : (this.calculateLodLevel(t, i, a, s, oe), oe.mesh_lod = Math.round(oe.mesh_lod), oe.texture_lod = Math.round(oe.texture_lod)), oe.mesh_lod >= 0 && this.loadProgressiveMeshes(i, oe.mesh_lod), i.material && oe.texture_lod >= 0 && this.loadProgressiveTextures(i.material, oe.texture_lod, n), O && i.material && !i.isGizmo &&
|
|
6548
|
+
n >= 0 ? (oe.mesh_lod = n, oe.texture_lod = n) : (this.calculateLodLevel(t, i, a, s, oe), oe.mesh_lod = Math.round(oe.mesh_lod), oe.texture_lod = Math.round(oe.texture_lod)), oe.mesh_lod >= 0 && this.loadProgressiveMeshes(i, oe.mesh_lod), i.material && oe.texture_lod >= 0 && this.loadProgressiveTextures(i.material, oe.texture_lod, n), O && i.material && !i.isGizmo && Cn(i.material);
|
|
6549
6549
|
for (const f of Ze)
|
|
6550
6550
|
(u = f.onAfterUpdatedLOD) == null || u.call(f, this.renderer, e, t, i, oe);
|
|
6551
6551
|
a.lastLodLevel_Mesh = oe.mesh_lod, a.lastLodLevel_Texture = oe.texture_lod;
|
|
@@ -6569,7 +6569,7 @@ const V = class V {
|
|
|
6569
6569
|
const a = Re.assignTextureLOD(e, t).then((n) => {
|
|
6570
6570
|
this._lodchangedlisteners.forEach((c) => c({ type: "texture", level: t, object: e }));
|
|
6571
6571
|
});
|
|
6572
|
-
|
|
6572
|
+
Pi.addPromise("texture", e, a, this._newPromiseGroups);
|
|
6573
6573
|
}
|
|
6574
6574
|
}
|
|
6575
6575
|
/** Load progressive meshes for the given mesh
|
|
@@ -6586,7 +6586,7 @@ const V = class V {
|
|
|
6586
6586
|
if (s != null && (i = e[qe] != s, t = s), i) {
|
|
6587
6587
|
e[qe] = t;
|
|
6588
6588
|
const a = e.geometry, n = Re.assignMeshLOD(e, t).then((c) => (c && e[qe] == t && a != e.geometry && this._lodchangedlisteners.forEach((u) => u({ type: "mesh", level: t, object: e })), c));
|
|
6589
|
-
return
|
|
6589
|
+
return Pi.addPromise("mesh", e, n, this._newPromiseGroups), n;
|
|
6590
6590
|
}
|
|
6591
6591
|
return Promise.resolve(null);
|
|
6592
6592
|
}
|
|
@@ -6648,11 +6648,11 @@ const V = class V {
|
|
|
6648
6648
|
return;
|
|
6649
6649
|
}
|
|
6650
6650
|
if (this._tempBox.applyMatrix4(this.projectionScreenMatrix), this.renderer.xr.enabled && x.isPerspectiveCamera && x.fov > 70) {
|
|
6651
|
-
const I = this._tempBox.min,
|
|
6652
|
-
let L = I.x, F = I.y, U =
|
|
6653
|
-
const Q = 2, ie = 1.5, se = (I.x +
|
|
6651
|
+
const I = this._tempBox.min, P = this._tempBox.max;
|
|
6652
|
+
let L = I.x, F = I.y, U = P.x, G = P.y;
|
|
6653
|
+
const Q = 2, ie = 1.5, se = (I.x + P.x) * 0.5, W = (I.y + P.y) * 0.5;
|
|
6654
6654
|
L = (L - se) * Q + se, F = (F - W) * Q + W, U = (U - se) * Q + se, G = (G - W) * Q + W;
|
|
6655
|
-
const q = L < 0 && U > 0 ? 0 : Math.min(Math.abs(I.x), Math.abs(
|
|
6655
|
+
const q = L < 0 && U > 0 ? 0 : Math.min(Math.abs(I.x), Math.abs(P.x)), me = F < 0 && G > 0 ? 0 : Math.min(Math.abs(I.y), Math.abs(P.y)), ce = Math.max(q, me);
|
|
6656
6656
|
i.lastCentrality = (ie - ce) * (ie - ce) * (ie - ce);
|
|
6657
6657
|
} else
|
|
6658
6658
|
i.lastCentrality = 1;
|
|
@@ -6664,21 +6664,21 @@ const V = class V {
|
|
|
6664
6664
|
if (Math.max(w.x, w.y) != 0 && M != 0 && (w.z = C.z / Math.max(C.x, C.y) * Math.max(w.x, w.y)), i.lastScreenCoverage = Math.max(w.x, w.y, w.z), i.lastScreenspaceVolume.copy(w), i.lastScreenCoverage *= i.lastCentrality, be && V.debugDrawLine) {
|
|
6665
6665
|
const I = this.tempMatrix.copy(this.projectionScreenMatrix);
|
|
6666
6666
|
I.invert();
|
|
6667
|
-
const
|
|
6668
|
-
|
|
6669
|
-
const G = (
|
|
6670
|
-
|
|
6667
|
+
const P = V.corner0, L = V.corner1, F = V.corner2, U = V.corner3;
|
|
6668
|
+
P.copy(this._tempBox.min), L.copy(this._tempBox.max), L.x = P.x, F.copy(this._tempBox.max), F.y = P.y, U.copy(this._tempBox.max);
|
|
6669
|
+
const G = (P.z + U.z) * 0.5;
|
|
6670
|
+
P.z = L.z = F.z = U.z = G, P.applyMatrix4(I), L.applyMatrix4(I), F.applyMatrix4(I), U.applyMatrix4(I), V.debugDrawLine(P, L, 255), V.debugDrawLine(P, F, 255), V.debugDrawLine(L, U, 255), V.debugDrawLine(F, U, 255);
|
|
6671
6671
|
}
|
|
6672
|
-
let
|
|
6672
|
+
let D = 999;
|
|
6673
6673
|
if (f && i.lastScreenCoverage > 0)
|
|
6674
6674
|
for (let I = 0; I < f.length; I++) {
|
|
6675
|
-
const
|
|
6676
|
-
if (d > 0 && Er() && !
|
|
6677
|
-
|
|
6675
|
+
const P = f[I], F = (((g = P.densities) == null ? void 0 : g[d]) || P.density || 1e-5) / i.lastScreenCoverage;
|
|
6676
|
+
if (d > 0 && Er() && !P.densities && !globalThis["NEEDLE:MISSING_LOD_PRIMITIVE_DENSITIES"] && (window["NEEDLE:MISSING_LOD_PRIMITIVE_DENSITIES"] = !0, console.warn("[Needle Progressive] Detected usage of mesh without primitive densities. This might cause incorrect LOD level selection: Consider re-optimizing your model by updating your Needle Integration, Needle glTF Pipeline or running optimization again on Needle Cloud.")), F < s) {
|
|
6677
|
+
D = I;
|
|
6678
6678
|
break;
|
|
6679
6679
|
}
|
|
6680
6680
|
}
|
|
6681
|
-
|
|
6681
|
+
D < c && (c = D, u = !0);
|
|
6682
6682
|
}
|
|
6683
6683
|
if (u ? a.mesh_lod = c : a.mesh_lod = i.lastLodLevel_Mesh, be && a.mesh_lod != i.lastLodLevel_Mesh) {
|
|
6684
6684
|
const w = f == null ? void 0 : f[a.mesh_lod];
|
|
@@ -6698,10 +6698,10 @@ const V = class V {
|
|
|
6698
6698
|
const C = m / window.devicePixelRatio * A;
|
|
6699
6699
|
let M = !1;
|
|
6700
6700
|
for (let R = l.lods.length - 1; R >= 0; R--) {
|
|
6701
|
-
const
|
|
6702
|
-
if (!(x &&
|
|
6701
|
+
const D = l.lods[R];
|
|
6702
|
+
if (!(x && D.max_height >= 2048) && !(Mn() && D.max_height > 4096) && (D.max_height > C || !M && R === 0)) {
|
|
6703
6703
|
if (M = !0, a.texture_lod = R, be && a.texture_lod < i.lastLodLevel_Texture) {
|
|
6704
|
-
const T =
|
|
6704
|
+
const T = D.max_height;
|
|
6705
6705
|
console.log(`Texture LOD changed: ${i.lastLodLevel_Texture} → ${a.texture_lod} = ${T}px
|
|
6706
6706
|
Screensize: ${C.toFixed(0)}px, Coverage: ${(100 * i.lastScreenCoverage).toFixed(2)}%, Volume ${w.toFixed(1)}
|
|
6707
6707
|
${t.name}`);
|
|
@@ -6714,12 +6714,12 @@ ${t.name}`);
|
|
|
6714
6714
|
a.texture_lod = 0;
|
|
6715
6715
|
}
|
|
6716
6716
|
};
|
|
6717
|
-
ue = new WeakMap(),
|
|
6717
|
+
ue = new WeakMap(), Fe = new WeakMap(), Vi = new WeakMap(), Ke = new WeakMap(), Pt = new WeakMap(), Ni = new WeakMap(), ke = new WeakMap(), /**
|
|
6718
6718
|
* Assign a function to draw debug lines for the LODs. This function will be called with the start and end position of the line and the color of the line when the `debugprogressive` query parameter is set.
|
|
6719
6719
|
*/
|
|
6720
6720
|
E(V, "debugDrawLine"), E(V, "corner0", new b()), E(V, "corner1", new b()), E(V, "corner2", new b()), E(V, "corner3", new b()), E(V, "_tempPtInside", new b()), E(V, "skinnedMeshBoundsFrameOffsetCounter", 0), E(V, "$skinnedMeshBoundsOffset", Symbol("gltf-progressive-skinnedMeshBoundsOffset"));
|
|
6721
6721
|
let Lt = V;
|
|
6722
|
-
class
|
|
6722
|
+
class Wl {
|
|
6723
6723
|
constructor() {
|
|
6724
6724
|
E(this, "frames", 0);
|
|
6725
6725
|
E(this, "lastLodLevel_Mesh", -1);
|
|
@@ -6731,39 +6731,39 @@ class Hl {
|
|
|
6731
6731
|
}
|
|
6732
6732
|
const Lr = Symbol("NEEDLE_mesh_lod"), gi = Symbol("NEEDLE_texture_lod");
|
|
6733
6733
|
let Vt = null;
|
|
6734
|
-
function
|
|
6735
|
-
const o =
|
|
6734
|
+
function In() {
|
|
6735
|
+
const o = Vl();
|
|
6736
6736
|
o && (o.mapURLs(function(e) {
|
|
6737
6737
|
return Fr(), e;
|
|
6738
6738
|
}), Fr(), Vt == null || Vt.disconnect(), Vt = new MutationObserver((e) => {
|
|
6739
6739
|
e.forEach((t) => {
|
|
6740
6740
|
t.addedNodes.forEach((i) => {
|
|
6741
|
-
i instanceof HTMLElement && i.tagName.toLowerCase() === "model-viewer" &&
|
|
6741
|
+
i instanceof HTMLElement && i.tagName.toLowerCase() === "model-viewer" && Rn(i);
|
|
6742
6742
|
});
|
|
6743
6743
|
});
|
|
6744
6744
|
}), Vt.observe(document, { childList: !0, subtree: !0 }));
|
|
6745
6745
|
}
|
|
6746
|
-
function
|
|
6746
|
+
function Vl() {
|
|
6747
6747
|
if (typeof customElements > "u")
|
|
6748
6748
|
return null;
|
|
6749
6749
|
const o = customElements.get("model-viewer");
|
|
6750
6750
|
return o || (customElements.whenDefined("model-viewer").then(() => {
|
|
6751
|
-
console.debug("[gltf-progressive] model-viewer defined"),
|
|
6751
|
+
console.debug("[gltf-progressive] model-viewer defined"), In();
|
|
6752
6752
|
}), null);
|
|
6753
6753
|
}
|
|
6754
6754
|
function Fr() {
|
|
6755
6755
|
if (typeof document > "u")
|
|
6756
6756
|
return;
|
|
6757
6757
|
document.querySelectorAll("model-viewer").forEach((e) => {
|
|
6758
|
-
|
|
6758
|
+
Rn(e);
|
|
6759
6759
|
});
|
|
6760
6760
|
}
|
|
6761
6761
|
const kr = /* @__PURE__ */ new WeakSet();
|
|
6762
|
-
let
|
|
6763
|
-
function
|
|
6762
|
+
let Nl = 0;
|
|
6763
|
+
function Rn(o) {
|
|
6764
6764
|
if (!o || kr.has(o))
|
|
6765
6765
|
return null;
|
|
6766
|
-
kr.add(o), console.debug("[gltf-progressive] found new model-viewer..." + ++
|
|
6766
|
+
kr.add(o), console.debug("[gltf-progressive] found new model-viewer..." + ++Nl + `
|
|
6767
6767
|
`, o.getAttribute("src"));
|
|
6768
6768
|
let e = null, t = null, i = null;
|
|
6769
6769
|
for (let s = o; s != null; s = Object.getPrototypeOf(s)) {
|
|
@@ -6784,7 +6784,7 @@ function In(o) {
|
|
|
6784
6784
|
};
|
|
6785
6785
|
console.debug("[gltf-progressive] setup model-viewer");
|
|
6786
6786
|
const a = Lt.get(e, { engine: "model-viewer" });
|
|
6787
|
-
return Lt.addPlugin(new
|
|
6787
|
+
return Lt.addPlugin(new Gl()), a.enable(), a.addEventListener("changed", () => {
|
|
6788
6788
|
i == null || i.call(o);
|
|
6789
6789
|
}), o.addEventListener("model-visibility", (n) => {
|
|
6790
6790
|
n.detail.visible && (i == null || i.call(o));
|
|
@@ -6796,7 +6796,7 @@ function In(o) {
|
|
|
6796
6796
|
}
|
|
6797
6797
|
return null;
|
|
6798
6798
|
}
|
|
6799
|
-
class
|
|
6799
|
+
class Gl {
|
|
6800
6800
|
constructor() {
|
|
6801
6801
|
E(this, "_didWarnAboutMissingUrl", !1);
|
|
6802
6802
|
}
|
|
@@ -6838,8 +6838,8 @@ class Nl {
|
|
|
6838
6838
|
console.warn("Texture data not found for texture index " + p);
|
|
6839
6839
|
continue;
|
|
6840
6840
|
}
|
|
6841
|
-
if ((l = g == null ? void 0 : g.extensions) != null && l[
|
|
6842
|
-
const _ = g.extensions[
|
|
6841
|
+
if ((l = g == null ? void 0 : g.extensions) != null && l[Le]) {
|
|
6842
|
+
const _ = g.extensions[Le];
|
|
6843
6843
|
_ && a && Re.registerTexture(a, v, _.lods.length, p, _);
|
|
6844
6844
|
}
|
|
6845
6845
|
}
|
|
@@ -6861,14 +6861,14 @@ class Nl {
|
|
|
6861
6861
|
const i = this.tryGetCurrentModelViewer(e), s = this.getUrl(i);
|
|
6862
6862
|
if (!s)
|
|
6863
6863
|
return;
|
|
6864
|
-
const a = (c = (n = t.userData) == null ? void 0 : n.gltfExtensions) == null ? void 0 : c[
|
|
6864
|
+
const a = (c = (n = t.userData) == null ? void 0 : n.gltfExtensions) == null ? void 0 : c[Le];
|
|
6865
6865
|
if (a && s) {
|
|
6866
6866
|
const u = t.uuid;
|
|
6867
6867
|
Re.registerMesh(s, u, t, 0, a.lods.length, a);
|
|
6868
6868
|
}
|
|
6869
6869
|
}
|
|
6870
6870
|
}
|
|
6871
|
-
function
|
|
6871
|
+
function Dn(...o) {
|
|
6872
6872
|
let e, t, i, s;
|
|
6873
6873
|
switch (o.length) {
|
|
6874
6874
|
case 2:
|
|
@@ -6883,20 +6883,20 @@ function Rn(...o) {
|
|
|
6883
6883
|
default:
|
|
6884
6884
|
throw new Error("Invalid arguments");
|
|
6885
6885
|
}
|
|
6886
|
-
Ys(),
|
|
6886
|
+
Ys(), An(i), Sn(i, {
|
|
6887
6887
|
progressive: !0,
|
|
6888
6888
|
...s == null ? void 0 : s.hints
|
|
6889
6889
|
}), i.register((n) => new Re(n));
|
|
6890
6890
|
const a = Lt.get(t);
|
|
6891
6891
|
return (s == null ? void 0 : s.enableLODsManager) !== !1 && a.enable(), a;
|
|
6892
6892
|
}
|
|
6893
|
-
|
|
6894
|
-
if (!
|
|
6893
|
+
In();
|
|
6894
|
+
if (!Rl) {
|
|
6895
6895
|
const o = {
|
|
6896
6896
|
gltfProgressive: {
|
|
6897
|
-
useNeedleProgressive:
|
|
6897
|
+
useNeedleProgressive: Dn,
|
|
6898
6898
|
LODsManager: Lt,
|
|
6899
|
-
configureLoader:
|
|
6899
|
+
configureLoader: Sn,
|
|
6900
6900
|
getRaycastMesh: ai,
|
|
6901
6901
|
useRaycastMeshes: Pl
|
|
6902
6902
|
}
|
|
@@ -7130,11 +7130,11 @@ var Rt = Object.freeze({
|
|
|
7130
7130
|
return o._nextId++;
|
|
7131
7131
|
}, o._nextId = 0, o;
|
|
7132
7132
|
}()
|
|
7133
|
-
),
|
|
7133
|
+
), Ps = new Pn(), Ui = (
|
|
7134
7134
|
/** @class */
|
|
7135
7135
|
function() {
|
|
7136
7136
|
function o(e, t) {
|
|
7137
|
-
t === void 0 && (t =
|
|
7137
|
+
t === void 0 && (t = Ps), this._object = e, this._group = t, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = Rt.Linear.None, this._interpolationFunction = ct.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = Xs.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1;
|
|
7138
7138
|
}
|
|
7139
7139
|
return o.prototype.getId = function() {
|
|
7140
7140
|
return this._id;
|
|
@@ -7221,7 +7221,7 @@ var Rt = Object.freeze({
|
|
|
7221
7221
|
this._chainedTweens[e].stop();
|
|
7222
7222
|
return this;
|
|
7223
7223
|
}, o.prototype.group = function(e) {
|
|
7224
|
-
return e === void 0 && (e =
|
|
7224
|
+
return e === void 0 && (e = Ps), this._group = e, this;
|
|
7225
7225
|
}, o.prototype.delay = function(e) {
|
|
7226
7226
|
return e === void 0 && (e = 0), this._delayTime = e, this;
|
|
7227
7227
|
}, o.prototype.repeat = function(e) {
|
|
@@ -7298,25 +7298,25 @@ var Rt = Object.freeze({
|
|
|
7298
7298
|
typeof i == "string" ? this._valuesStartRepeat[e] = this._valuesStartRepeat[e] + parseFloat(i) : this._valuesStartRepeat[e] = this._valuesEnd[e], this._valuesEnd[e] = t;
|
|
7299
7299
|
}, o;
|
|
7300
7300
|
}()
|
|
7301
|
-
),
|
|
7301
|
+
), ql = "23.1.3", jl = Xs.nextId, Pe = Ps, Ql = Pe.getAll.bind(Pe), Yl = Pe.removeAll.bind(Pe), Zl = Pe.add.bind(Pe), Xl = Pe.remove.bind(Pe), Kl = Pe.update.bind(Pe), Je = {
|
|
7302
7302
|
Easing: Rt,
|
|
7303
7303
|
Group: Pn,
|
|
7304
7304
|
Interpolation: ct,
|
|
7305
7305
|
now: Ct,
|
|
7306
7306
|
Sequence: Xs,
|
|
7307
|
-
nextId:
|
|
7307
|
+
nextId: jl,
|
|
7308
7308
|
Tween: Ui,
|
|
7309
|
-
VERSION:
|
|
7310
|
-
getAll:
|
|
7311
|
-
removeAll:
|
|
7312
|
-
add:
|
|
7313
|
-
remove:
|
|
7314
|
-
update:
|
|
7309
|
+
VERSION: ql,
|
|
7310
|
+
getAll: Ql,
|
|
7311
|
+
removeAll: Yl,
|
|
7312
|
+
add: Zl,
|
|
7313
|
+
remove: Xl,
|
|
7314
|
+
update: Kl
|
|
7315
7315
|
}, Nt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
7316
|
-
function
|
|
7316
|
+
function Jl(o) {
|
|
7317
7317
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
7318
7318
|
}
|
|
7319
|
-
var
|
|
7319
|
+
var En = { exports: {} };
|
|
7320
7320
|
(function(o) {
|
|
7321
7321
|
var e = Object.prototype.hasOwnProperty, t = "~";
|
|
7322
7322
|
function i() {
|
|
@@ -7426,9 +7426,9 @@ var Dn = { exports: {} };
|
|
|
7426
7426
|
var d;
|
|
7427
7427
|
return f ? (d = t ? t + f : f, this._events[d] && n(this, d)) : (this._events = new i(), this._eventsCount = 0), this;
|
|
7428
7428
|
}, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = t, c.EventEmitter = c, o.exports = c;
|
|
7429
|
-
})(
|
|
7430
|
-
var
|
|
7431
|
-
const Ot = /* @__PURE__ */
|
|
7429
|
+
})(En);
|
|
7430
|
+
var $l = En.exports;
|
|
7431
|
+
const Ot = /* @__PURE__ */ Jl($l);
|
|
7432
7432
|
var ti = function() {
|
|
7433
7433
|
var o = 0, e = document.createElement("div");
|
|
7434
7434
|
e.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", e.addEventListener("click", function(r) {
|
|
@@ -7490,14 +7490,14 @@ function Ch(o, e) {
|
|
|
7490
7490
|
const t = URL.createObjectURL(o), i = document.createElement("a");
|
|
7491
7491
|
i.href = t, i.download = e, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(t);
|
|
7492
7492
|
}
|
|
7493
|
-
function
|
|
7493
|
+
function ec(o) {
|
|
7494
7494
|
return o.length === 0 ? 0 : o.reduce((t, i) => t + i, 0) / o.length;
|
|
7495
7495
|
}
|
|
7496
7496
|
function Br(o, e) {
|
|
7497
7497
|
const t = new Blob([o], { type: e });
|
|
7498
7498
|
return URL.createObjectURL(t);
|
|
7499
7499
|
}
|
|
7500
|
-
function
|
|
7500
|
+
function tc() {
|
|
7501
7501
|
return /Mac|iPod|iPhone|iPad/.test(navigator == null ? void 0 : navigator.platform) || /Mac OS|iOS/.test(navigator == null ? void 0 : navigator.userAgent);
|
|
7502
7502
|
}
|
|
7503
7503
|
function Or(o) {
|
|
@@ -7509,7 +7509,7 @@ function Ih(o, e = 43) {
|
|
|
7509
7509
|
const t = o * Math.PI / 180;
|
|
7510
7510
|
return e / (2 * Math.tan(t / 2));
|
|
7511
7511
|
}
|
|
7512
|
-
var
|
|
7512
|
+
var Ln = {};
|
|
7513
7513
|
/*!
|
|
7514
7514
|
* howler.js v2.2.4
|
|
7515
7515
|
* howlerjs.com
|
|
@@ -7854,18 +7854,18 @@ var En = {};
|
|
|
7854
7854
|
if (h._webAudio) {
|
|
7855
7855
|
var R = function() {
|
|
7856
7856
|
h._playLock = !1, C(), h._refreshBuffer(g);
|
|
7857
|
-
var
|
|
7858
|
-
M.gain.setValueAtTime(
|
|
7857
|
+
var P = g._muted || h._muted ? 0 : g._volume;
|
|
7858
|
+
M.gain.setValueAtTime(P, t.ctx.currentTime), g._playStart = t.ctx.currentTime, typeof M.bufferSource.start > "u" ? g._loop ? M.bufferSource.noteGrainOn(0, y, 86400) : M.bufferSource.noteGrainOn(0, y, x) : g._loop ? M.bufferSource.start(0, y, 86400) : M.bufferSource.start(0, y, x), w !== 1 / 0 && (h._endTimers[g._id] = setTimeout(h._ended.bind(h, g), w)), l || setTimeout(function() {
|
|
7859
7859
|
h._emit("play", g._id), h._loadQueue();
|
|
7860
7860
|
}, 0);
|
|
7861
7861
|
};
|
|
7862
7862
|
t.state === "running" && t.ctx.state !== "interrupted" ? R() : (h._playLock = !0, h.once("resume", R), h._clearTimer(g._id));
|
|
7863
7863
|
} else {
|
|
7864
|
-
var
|
|
7864
|
+
var D = function() {
|
|
7865
7865
|
M.currentTime = y, M.muted = g._muted || h._muted || t._muted || M.muted, M.volume = g._volume * t.volume(), M.playbackRate = g._rate;
|
|
7866
7866
|
try {
|
|
7867
|
-
var
|
|
7868
|
-
if (
|
|
7867
|
+
var P = M.play();
|
|
7868
|
+
if (P && typeof Promise < "u" && (P instanceof Promise || typeof P.then == "function") ? (h._playLock = !0, C(), P.then(function() {
|
|
7869
7869
|
h._playLock = !1, M._unlocked = !0, l ? h._loadQueue() : h._emit("play", g._id);
|
|
7870
7870
|
}).catch(function() {
|
|
7871
7871
|
h._playLock = !1, h._emit("playerror", g._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."), g._ended = !0, g._paused = !0;
|
|
@@ -7883,11 +7883,11 @@ var En = {};
|
|
|
7883
7883
|
M.src === "data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA" && (M.src = h._src, M.load());
|
|
7884
7884
|
var T = window && window.ejecta || !M.readyState && t._navigator.isCocoonJS;
|
|
7885
7885
|
if (M.readyState >= 3 || T)
|
|
7886
|
-
|
|
7886
|
+
D();
|
|
7887
7887
|
else {
|
|
7888
7888
|
h._playLock = !0, h._state = "loading";
|
|
7889
7889
|
var I = function() {
|
|
7890
|
-
h._state = "loaded",
|
|
7890
|
+
h._state = "loaded", D(), M.removeEventListener(t._canPlayEvent, I, !1);
|
|
7891
7891
|
};
|
|
7892
7892
|
M.addEventListener(t._canPlayEvent, I, !1), h._clearTimer(g._id);
|
|
7893
7893
|
}
|
|
@@ -8713,40 +8713,40 @@ var En = {};
|
|
|
8713
8713
|
i = i || "spatial", i === "spatial" ? (t._panner = Howler.ctx.createPanner(), t._panner.coneInnerAngle = t._pannerAttr.coneInnerAngle, t._panner.coneOuterAngle = t._pannerAttr.coneOuterAngle, t._panner.coneOuterGain = t._pannerAttr.coneOuterGain, t._panner.distanceModel = t._pannerAttr.distanceModel, t._panner.maxDistance = t._pannerAttr.maxDistance, t._panner.refDistance = t._pannerAttr.refDistance, t._panner.rolloffFactor = t._pannerAttr.rolloffFactor, t._panner.panningModel = t._pannerAttr.panningModel, typeof t._panner.positionX < "u" ? (t._panner.positionX.setValueAtTime(t._pos[0], Howler.ctx.currentTime), t._panner.positionY.setValueAtTime(t._pos[1], Howler.ctx.currentTime), t._panner.positionZ.setValueAtTime(t._pos[2], Howler.ctx.currentTime)) : t._panner.setPosition(t._pos[0], t._pos[1], t._pos[2]), typeof t._panner.orientationX < "u" ? (t._panner.orientationX.setValueAtTime(t._orientation[0], Howler.ctx.currentTime), t._panner.orientationY.setValueAtTime(t._orientation[1], Howler.ctx.currentTime), t._panner.orientationZ.setValueAtTime(t._orientation[2], Howler.ctx.currentTime)) : t._panner.setOrientation(t._orientation[0], t._orientation[1], t._orientation[2])) : (t._panner = Howler.ctx.createStereoPanner(), t._panner.pan.setValueAtTime(t._stereo, Howler.ctx.currentTime)), t._panner.connect(t._node), t._paused || t._parent.pause(t._id, !0).play(t._id, !0);
|
|
8714
8714
|
};
|
|
8715
8715
|
})();
|
|
8716
|
-
})(
|
|
8717
|
-
const
|
|
8718
|
-
let
|
|
8716
|
+
})(Ln);
|
|
8717
|
+
const ic = "data:audio/mpeg;base64,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";
|
|
8718
|
+
let sc = class {
|
|
8719
8719
|
constructor() {
|
|
8720
|
-
this.sound = new
|
|
8721
|
-
src: [
|
|
8720
|
+
this.sound = new Ln.Howl({
|
|
8721
|
+
src: [ic]
|
|
8722
8722
|
});
|
|
8723
8723
|
}
|
|
8724
8724
|
play() {
|
|
8725
8725
|
this.sound.play();
|
|
8726
8726
|
}
|
|
8727
8727
|
};
|
|
8728
|
-
const
|
|
8728
|
+
const De = (o) => {
|
|
8729
8729
|
var e, t;
|
|
8730
8730
|
if (typeof o.destroy == "function") {
|
|
8731
8731
|
o.destroy();
|
|
8732
8732
|
return;
|
|
8733
8733
|
}
|
|
8734
8734
|
for (; o.children.length > 0; )
|
|
8735
|
-
|
|
8735
|
+
De(o.children[0]), (e = o.children[0]) == null || e.removeFromParent();
|
|
8736
8736
|
if (o instanceof X)
|
|
8737
8737
|
try {
|
|
8738
8738
|
(t = o.geometry) == null || t.dispose();
|
|
8739
8739
|
} catch {
|
|
8740
8740
|
}
|
|
8741
8741
|
};
|
|
8742
|
-
function
|
|
8742
|
+
function rc(o) {
|
|
8743
8743
|
return new b(o[0], o[1], o[2]);
|
|
8744
8744
|
}
|
|
8745
|
-
function
|
|
8745
|
+
function nc() {
|
|
8746
8746
|
let o = 3, e = Math.max(1 / window.devicePixelRatio, 0.5);
|
|
8747
8747
|
return window.innerWidth / window.innerHeight < 0.65 && (o = 4, e = 1 / window.devicePixelRatio), { tiles: o, renderScale: e };
|
|
8748
8748
|
}
|
|
8749
|
-
function
|
|
8749
|
+
function oc(o) {
|
|
8750
8750
|
let e = !1, t = !1, i = !1, s = 1 / 0, a = 1 / 0, n = 1 / 0, c = -1 / 0, u = -1 / 0, f = -1 / 0, d = 0, r = 0;
|
|
8751
8751
|
return o.traverse((h) => {
|
|
8752
8752
|
if (h.isMesh && h.geometry) {
|
|
@@ -8771,7 +8771,7 @@ function nc(o) {
|
|
|
8771
8771
|
}
|
|
8772
8772
|
}), { box: new Y(new b(s, a, n), new b(c, u, f)), maxRadius: d, height: r, hasWidth: t, hasLength: e, hasHeight: i };
|
|
8773
8773
|
}
|
|
8774
|
-
function
|
|
8774
|
+
function ac(o, e, t = null) {
|
|
8775
8775
|
let i = 0;
|
|
8776
8776
|
return function() {
|
|
8777
8777
|
let s = t || this, a = arguments;
|
|
@@ -8780,7 +8780,7 @@ function oc(o, e, t = null) {
|
|
|
8780
8780
|
}, e);
|
|
8781
8781
|
};
|
|
8782
8782
|
}
|
|
8783
|
-
class
|
|
8783
|
+
class lc {
|
|
8784
8784
|
constructor(e, t, i) {
|
|
8785
8785
|
this.length = e, this.width = t, this.height = i;
|
|
8786
8786
|
}
|
|
@@ -8799,12 +8799,12 @@ function Ks() {
|
|
|
8799
8799
|
var e;
|
|
8800
8800
|
if (typeof navigator > "u")
|
|
8801
8801
|
return !1;
|
|
8802
|
-
if (
|
|
8802
|
+
if (cc())
|
|
8803
8803
|
return !0;
|
|
8804
8804
|
const o = (e = navigator.userAgent) == null ? void 0 : e.toLowerCase();
|
|
8805
8805
|
return /iphone|ipad|ipod|android|mobile|blackberry|iemobile|opera mini/.test(o);
|
|
8806
8806
|
}
|
|
8807
|
-
function
|
|
8807
|
+
function cc() {
|
|
8808
8808
|
try {
|
|
8809
8809
|
if (typeof wx < "u" && wx.getSystemInfo || typeof my < "u" && my.alert || typeof tt < "u" && tt.getSystemInfo || typeof swan < "u" && swan.getSystemInfo)
|
|
8810
8810
|
return !0;
|
|
@@ -8812,20 +8812,20 @@ function lc() {
|
|
|
8812
8812
|
}
|
|
8813
8813
|
return !1;
|
|
8814
8814
|
}
|
|
8815
|
-
const
|
|
8816
|
-
let
|
|
8815
|
+
const uc = new Io(), Ft = new So(), Yi = new Mo();
|
|
8816
|
+
let Dt = "./draco/";
|
|
8817
8817
|
try {
|
|
8818
|
-
|
|
8818
|
+
Dt = new URL("./draco/", import.meta.url).href;
|
|
8819
8819
|
} catch {
|
|
8820
|
-
|
|
8820
|
+
Dt = "./draco/";
|
|
8821
8821
|
}
|
|
8822
|
-
typeof window < "u" && window.dracoPath && (
|
|
8822
|
+
typeof window < "u" && window.dracoPath && (Dt = window.dracoPath);
|
|
8823
8823
|
Yi.setDecoderConfig({ type: "wasm" });
|
|
8824
|
-
Yi.setDecoderPath(
|
|
8824
|
+
Yi.setDecoderPath(Dt.endsWith("/") ? Dt : `${Dt}/`);
|
|
8825
8825
|
Yi.preload();
|
|
8826
8826
|
Ft.setDRACOLoader(Yi);
|
|
8827
|
-
const
|
|
8828
|
-
function
|
|
8827
|
+
const Dh = new Co(), Ur = [115, 103, 108, 98];
|
|
8828
|
+
function Ph(o, e, t) {
|
|
8829
8829
|
const i = JSON.stringify(e), s = new TextEncoder().encode(i), a = new Uint8Array([115, 103, 108, 98]), n = new Uint8Array(2);
|
|
8830
8830
|
n[0] = t >> 8, n[1] = t & 255;
|
|
8831
8831
|
const c = new Uint8Array(4);
|
|
@@ -8834,7 +8834,7 @@ function Dh(o, e, t) {
|
|
|
8834
8834
|
let r = 0;
|
|
8835
8835
|
return d.set(a, r), r += a.length, d.set(n, r), r += n.length, d.set(c, r), r += c.length, d.set(s, r), r += s.length, d.set(u, r), d.buffer;
|
|
8836
8836
|
}
|
|
8837
|
-
function
|
|
8837
|
+
function hc(o) {
|
|
8838
8838
|
const e = new Uint8Array(o.slice(0, 4));
|
|
8839
8839
|
let t = !0;
|
|
8840
8840
|
for (let r = 0; r < Ur.length; r++)
|
|
@@ -8902,13 +8902,13 @@ class Hi {
|
|
|
8902
8902
|
}
|
|
8903
8903
|
}
|
|
8904
8904
|
parse(e) {
|
|
8905
|
-
return
|
|
8905
|
+
return hc(e);
|
|
8906
8906
|
}
|
|
8907
8907
|
clear() {
|
|
8908
8908
|
[...this.cache.values()];
|
|
8909
8909
|
}
|
|
8910
8910
|
}
|
|
8911
|
-
const hc = `*{box-sizing:border-box}.slot-item-container.is-mobile .main{pointer-events:none;border-width:1px;opacity:.8}.slot-item-container.is-mobile .main.focus{width:18px!important;height:18px!important;border-width:2px;opacity:1}.slot-item-container.is-mobile .main.filled{opacity:1;border-width:1px;width:14px!important;height:14px!important;background-image:none;border-radius:50%}.slot-item-container.is-mobile .main.to-be-installed{opacity:1;pointer-events:auto;width:38px!important;height:38px!important;border-color:#000;border-width:1px;background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%3e%3cg%3e%3cg%3e%3cpath%20d='M20,10.75L0,10.75L0,9.25L20,9.25L20,10.75Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3cg%20transform='matrix(0,1,1,0,10,-10)'%3e%3cpath%20d='M30,0.75L10,0.75L10,-0.75L30,-0.75L30,0.75Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:20px auto;background-repeat:no-repeat;background-position:center;background-color:#fff9}.slot-item-container.is-mobile .main.to-be-installed+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container.is-mobile .main.to-be-installed.filled{opacity:1;border-width:2px;width:18px!important;height:18px!important;background-image:none;border-radius:50%;border-color:#00ff95}.slot-item-container.is-mobile .main.to-be-installed.to-be-replaced{opacity:1;border-width:1px;pointer-events:auto;width:38px!important;height:38px!important;border-radius:50%;background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%3e%3cdefs%3e%3cclipPath%20id='master_svg0_504_014299'%3e%3crect%20x='0'%20y='0'%20width='40'%20height='40'%20rx='20'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23master_svg0_504_014299)'%3e%3cg%3e%3cg%3e%3cpath%20d='M31.695414,17L26.009501,10.74549544L24.899591,11.75450456L28.304586,15.5L8.75,15.5L8.75,17L31.695414,17Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M8.3045862,23L13.9904997,29.2545042L15.10041,28.2454953L11.6954139,24.5L31.25,24.5L31.25,23L8.3045862,23Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:38px auto;border-color:#000}.slot-item-container.is-mobile .info{left:100%;margin-top:0;margin-left:4px}.slot-item-container.is-mobile .info .name-wrapper{margin-top:0;border-radius:0;background:#000;color:#fff}.slot-item-container.is-mobile .info>img{display:none}.slot-item-container .main{pointer-events:auto;cursor:pointer;font-size:12px;color:#fff;width:22px;height:22px;background:#fff0;border:1.5px solid #fff;border-radius:0;transition:background .2s,width .14s,height .14s,border .14s}.slot-item-container .main.disable{cursor:not-allowed}.slot-item-container .main.drag-over{border-color:red}.slot-item-container .main.can-install{position:relative;width:44px;height:44px;background:#0066ff1a;border-color:#06f}.slot-item-container .main.filled{border-color:#00ff95;border-radius:50%}.slot-item-container .main.selected{border-width:4px}.slot-item-container .main.selected+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .main.focus{border-color:#000}.slot-item-container .main.focus+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .main.has-error{border-color:red}.slot-item-container .main.hidden{display:none}.slot-item-container .main.hidden+.info{display:none}.slot-item-container .main:after{pointer-events:none;content:attr(data-name);transition:all .2s .3s;opacity:0;position:absolute;left:50%;bottom:100%;transform:translate3d(-50%,5px,0);white-space:nowrap;font-size:12px;color:#000;padding:2px 8px;border-radius:2px;background:#fff}.slot-item-container .main:hover{background:#ffffff80}.slot-item-container .main:hover+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .name{position:relative}.slot-item-container .name-wrapper{margin-top:-10px;white-space:nowrap;font-size:12px;color:#fff;padding:2px 8px;background:#000}.slot-item-container .functions-wrapper{z-index:20000;position:absolute;left:0;top:100%}.slot-item-container .functions-wrapper>.functions{display:inline-block;min-width:100px;padding:6px 0;border-left:1px solid #00ff95;border-radius:0 2px 2px 0;background:#0003;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.slot-item-container .functions-wrapper>.functions .btn-add{cursor:pointer;padding:2px 0;margin:0 8px;display:flex;justify-content:center;align-content:center;align-items:center;border:1px dashed #eee;font-size:12px;color:#eee;border-radius:2px;-webkit-backdrop-filter:none;backdrop-filter:none;background:#00050a80}.slot-item-container .functions-wrapper>.functions .btn-add.btn-not-allowed{cursor:not-allowed}.slot-item-container .functions-wrapper>.functions .function{display:flex;justify-content:space-between;white-space:nowrap;margin-bottom:6px;padding:0 8px;font-size:12px;color:#fff}.slot-item-container .functions-wrapper>.functions .function span{margin-right:4px}.slot-item-container .functions-wrapper>.functions .function .btn-remove{pointer-events:none;opacity:0;cursor:pointer;align-self:center;margin-right:0;height:14px;width:14px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAACnSURBVEiJxZaxFcMgDETPTuUtWCWTM4pZAq5RojRpnOfEyEKxSnh3HySeBEhNjZJJTRgUG89GyZWilbKOgJCaKmWtFG2UvFnwQr56jYAcengg3dozELPGIjh96x6hu26/DIa9vD0jq/nUA3nikQEkAOW9nACUGbf7skxlX2mIj1Ob0jK76QdxbYpGFNlk3rPnNndDQltFaLMLbdehAyd8ZP5l6Ed+W17xG7oN9QkytAAAAABJRU5ErkJggg==) center no-repeat;background-size:10px 10px}.slot-item-container .functions-wrapper>.functions .function:hover .btn-remove{pointer-events:auto;opacity:1;transform:scale(1.2)}.slot-item-container .device-name{position:relative;margin:2px 0;display:flex;min-width:120px;align-items:center;align-content:center;justify-content:space-between;white-space:nowrap;height:30px;padding:0 8px;font-size:14px;font-weight:700;color:#000;background:#fff}.slot-item-container .device-name .device-logo{margin-left:-8px;margin-right:4px;width:30px;height:30px;object-fit:contain}.slot-item-container .device-name span{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:250px}.slot-item-container .device-name .btn-close{margin-left:8px;cursor:pointer;height:20px;width:20px;background:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%3e%3cdefs%3e%3cclipPath%20id='master_svg0_504_017509'%3e%3crect%20x='0'%20y='0'%20width='20'%20height='20'%20rx='0'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23master_svg0_504_017509)'%3e%3cg%3e%3cpath%20d='M4.375,16.875L4.375,4.375L15.625,4.375L15.625,16.875L4.375,16.875ZM14.375,5.625L5.625,5.625L5.625,15.625L14.375,15.625L14.375,5.625Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M8.125,12.1875L8.125,8.125L9.375,8.125L9.375,12.1875L8.125,12.1875Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M10.625,12.1875L10.625,8.125L11.875,8.125L11.875,12.1875L10.625,12.1875Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M16.875,5.625L3.125,5.625L3.125,4.375L16.875,4.375L16.875,5.625Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M6.4446528999999995,5.625L13.545177899999999,5.625L11.8665838,2.5L8.15767372,2.5L6.4446528999999995,5.625ZM11.4548223,4.3749999L8.5553472,4.3749999L8.8979512,3.75L11.1191032,3.75L11.4548223,4.3749999Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e") center no-repeat;background-size:100% auto}.slot-item-container .device-name.empty{color:#000c;font-weight:400}.slot-item-container .device-name.empty .btn-close{display:none}.slot-item-container .device-name.empty:before{height:0}.slot-item-container .all-functions{opacity:0;pointer-events:none;min-width:80px;position:absolute;left:-10px;margin-left:100%;bottom:0;padding:6px 0;background:#fff;transition:all .3s}.slot-item-container .all-functions.show{opacity:1;pointer-events:auto;left:16px}.slot-item-container .all-functions label{margin-left:8px;margin-bottom:20px;color:#444e69;font-size:14px}.slot-item-container .all-functions .btn-close{cursor:pointer;position:absolute;right:7px;top:7px;height:16px;width:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAB4SURBVDiNpZPLEYAgDAUXe6MuoK4UpwdBwQkQJDcyb9+QnxORCOC9jyxE4Y78DiWxAIcmISKnxaSrtZhMNSOB+ZeacAS7ngl3k1JOBSBpk1INPib0YHjH+Du2S1DhlSZOYbPJ1iLtrLKrG2a9yJopYzTD8Jx+ArgAylOzjm1WpDwAAAAASUVORK5CYII=) center no-repeat;background-size:10px 10px}.slot-item-container .all-functions .functions{display:inline-block;max-height:200px;overflow-x:hidden;overflow-y:auto}.slot-item-container .all-functions .functions::-webkit-scrollbar{width:4px}.slot-item-container .all-functions .functions::-webkit-scrollbar-track{background-color:#fff}.slot-item-container .all-functions .functions::-webkit-scrollbar-thumb{background:#787878;border-radius:25px}.slot-item-container .all-functions .function{display:flex;justify-content:space-between;white-space:nowrap;padding:5px 10px;font-size:12px;color:#787878}.slot-item-container .all-functions .function span{display:flex;align-content:center;align-items:center;margin-right:4px}.slot-item-container .all-functions .function:hover{background:#444e6933}.slot-item-container .all-functions .btn-add{cursor:pointer;width:16px;font-size:16px;text-align:center;font-style:normal}.slot-item-container .info{overflow:hidden;margin-left:-2px;margin-top:-19px;position:absolute;left:100%;top:50%;transform:translateY(-50%);width:0;display:flex;align-items:flex-start;transition:all .3s}.slot-item-container .info>img{flex:0 0 auto;width:53px;height:29px}`, fc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGsAAAA7CAYAAAB8MXT7AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGTSURBVHic7dxLbQNBEIThnigADGEhxAwcBoZgCIZgBoZgCIZgCIaQMIgZVC4daw/xXPLoqdX/3fbW0milUtfutMCdpCkiLhEx1U6CLkkvkt4k7atnQYekfR7US/Us6JB0yIOaqmfBA5JWks6SrhzUwCRN+TYdq2dBx+ygDtWzoEPSNg9qVz0LOmZBgsQ3sqUkvufqAf6SpFVEnCPiFhHr1tqteCR8hyBhYrY6OlTPgo5cHX1I2lbPgo6lBInFk3Rc+uroqXqAn8ogcc3H19bae+U8eIDEZ0LSJoMEZeHIWB2ZIPEZoCw0QVlogsRnYlYWsjoaGUHCRK6OOKiRfa2OMvWtqufBAwQJE5SFJmZl4aZ6FnSQ+Azk6mjxZeFv+/fycfbDWrTW1pSFgyLxmcjVEWXh6CgLTZD4DMzKwguro4ERJEywOjIhaUdZaIAgYYKy0ABloQkSnwlxKZUHcSmVBxKfgVwdnSgLB8d35iZIfCYoC01QFpog8Y3rftFWrotO+cilVKMiSJigLDSS30hQFhr4BEcKZN0LNhDxAAAAAElFTkSuQmCC", Hr = { name: "", isMobile: !1 }, dc = {
|
|
8911
|
+
const fc = `*{box-sizing:border-box}.slot-item-container.is-mobile .main{pointer-events:none;border-width:1px;opacity:.8}.slot-item-container.is-mobile .main.focus{width:18px!important;height:18px!important;border-width:2px;opacity:1}.slot-item-container.is-mobile .main.filled{opacity:1;border-width:1px;width:14px!important;height:14px!important;background-image:none;border-radius:50%}.slot-item-container.is-mobile .main.to-be-installed{opacity:1;pointer-events:auto;width:38px!important;height:38px!important;border-color:#000;border-width:1px;background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%3e%3cg%3e%3cg%3e%3cpath%20d='M20,10.75L0,10.75L0,9.25L20,9.25L20,10.75Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3cg%20transform='matrix(0,1,1,0,10,-10)'%3e%3cpath%20d='M30,0.75L10,0.75L10,-0.75L30,-0.75L30,0.75Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:20px auto;background-repeat:no-repeat;background-position:center;background-color:#fff9}.slot-item-container.is-mobile .main.to-be-installed+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container.is-mobile .main.to-be-installed.filled{opacity:1;border-width:2px;width:18px!important;height:18px!important;background-image:none;border-radius:50%;border-color:#00ff95}.slot-item-container.is-mobile .main.to-be-installed.to-be-replaced{opacity:1;border-width:1px;pointer-events:auto;width:38px!important;height:38px!important;border-radius:50%;background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%3e%3cdefs%3e%3cclipPath%20id='master_svg0_504_014299'%3e%3crect%20x='0'%20y='0'%20width='40'%20height='40'%20rx='20'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23master_svg0_504_014299)'%3e%3cg%3e%3cg%3e%3cpath%20d='M31.695414,17L26.009501,10.74549544L24.899591,11.75450456L28.304586,15.5L8.75,15.5L8.75,17L31.695414,17Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M8.3045862,23L13.9904997,29.2545042L15.10041,28.2454953L11.6954139,24.5L31.25,24.5L31.25,23L8.3045862,23Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:38px auto;border-color:#000}.slot-item-container.is-mobile .info{left:100%;margin-top:0;margin-left:4px}.slot-item-container.is-mobile .info .name-wrapper{margin-top:0;border-radius:0;background:#000;color:#fff}.slot-item-container.is-mobile .info>img{display:none}.slot-item-container .main{pointer-events:auto;cursor:pointer;font-size:12px;color:#fff;width:22px;height:22px;background:#fff0;border:1.5px solid #fff;border-radius:0;transition:background .2s,width .14s,height .14s,border .14s}.slot-item-container .main.disable{cursor:not-allowed}.slot-item-container .main.drag-over{border-color:red}.slot-item-container .main.can-install{position:relative;width:44px;height:44px;background:#0066ff1a;border-color:#06f}.slot-item-container .main.filled{border-color:#00ff95;border-radius:50%}.slot-item-container .main.selected{border-width:4px}.slot-item-container .main.selected+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .main.focus{border-color:#000}.slot-item-container .main.focus+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .main.has-error{border-color:red}.slot-item-container .main.hidden{display:none}.slot-item-container .main.hidden+.info{display:none}.slot-item-container .main:after{pointer-events:none;content:attr(data-name);transition:all .2s .3s;opacity:0;position:absolute;left:50%;bottom:100%;transform:translate3d(-50%,5px,0);white-space:nowrap;font-size:12px;color:#000;padding:2px 8px;border-radius:2px;background:#fff}.slot-item-container .main:hover{background:#ffffff80}.slot-item-container .main:hover+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .name{position:relative}.slot-item-container .name-wrapper{margin-top:-10px;white-space:nowrap;font-size:12px;color:#fff;padding:2px 8px;background:#000}.slot-item-container .functions-wrapper{z-index:20000;position:absolute;left:0;top:100%}.slot-item-container .functions-wrapper>.functions{display:inline-block;min-width:100px;padding:6px 0;border-left:1px solid #00ff95;border-radius:0 2px 2px 0;background:#0003;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.slot-item-container .functions-wrapper>.functions .btn-add{cursor:pointer;padding:2px 0;margin:0 8px;display:flex;justify-content:center;align-content:center;align-items:center;border:1px dashed #eee;font-size:12px;color:#eee;border-radius:2px;-webkit-backdrop-filter:none;backdrop-filter:none;background:#00050a80}.slot-item-container .functions-wrapper>.functions .btn-add.btn-not-allowed{cursor:not-allowed}.slot-item-container .functions-wrapper>.functions .function{display:flex;justify-content:space-between;white-space:nowrap;margin-bottom:6px;padding:0 8px;font-size:12px;color:#fff}.slot-item-container .functions-wrapper>.functions .function span{margin-right:4px}.slot-item-container .functions-wrapper>.functions .function .btn-remove{pointer-events:none;opacity:0;cursor:pointer;align-self:center;margin-right:0;height:14px;width:14px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAACnSURBVEiJxZaxFcMgDETPTuUtWCWTM4pZAq5RojRpnOfEyEKxSnh3HySeBEhNjZJJTRgUG89GyZWilbKOgJCaKmWtFG2UvFnwQr56jYAcengg3dozELPGIjh96x6hu26/DIa9vD0jq/nUA3nikQEkAOW9nACUGbf7skxlX2mIj1Ob0jK76QdxbYpGFNlk3rPnNndDQltFaLMLbdehAyd8ZP5l6Ed+W17xG7oN9QkytAAAAABJRU5ErkJggg==) center no-repeat;background-size:10px 10px}.slot-item-container .functions-wrapper>.functions .function:hover .btn-remove{pointer-events:auto;opacity:1;transform:scale(1.2)}.slot-item-container .device-name{position:relative;margin:2px 0;display:flex;min-width:120px;align-items:center;align-content:center;justify-content:space-between;white-space:nowrap;height:30px;padding:0 8px;font-size:14px;font-weight:700;color:#000;background:#fff}.slot-item-container .device-name .device-logo{margin-left:-8px;margin-right:4px;width:30px;height:30px;object-fit:contain}.slot-item-container .device-name span{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:250px}.slot-item-container .device-name .btn-close{margin-left:8px;cursor:pointer;height:20px;width:20px;background:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%3e%3cdefs%3e%3cclipPath%20id='master_svg0_504_017509'%3e%3crect%20x='0'%20y='0'%20width='20'%20height='20'%20rx='0'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23master_svg0_504_017509)'%3e%3cg%3e%3cpath%20d='M4.375,16.875L4.375,4.375L15.625,4.375L15.625,16.875L4.375,16.875ZM14.375,5.625L5.625,5.625L5.625,15.625L14.375,15.625L14.375,5.625Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M8.125,12.1875L8.125,8.125L9.375,8.125L9.375,12.1875L8.125,12.1875Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M10.625,12.1875L10.625,8.125L11.875,8.125L11.875,12.1875L10.625,12.1875Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M16.875,5.625L3.125,5.625L3.125,4.375L16.875,4.375L16.875,5.625Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M6.4446528999999995,5.625L13.545177899999999,5.625L11.8665838,2.5L8.15767372,2.5L6.4446528999999995,5.625ZM11.4548223,4.3749999L8.5553472,4.3749999L8.8979512,3.75L11.1191032,3.75L11.4548223,4.3749999Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e") center no-repeat;background-size:100% auto}.slot-item-container .device-name.empty{color:#000c;font-weight:400}.slot-item-container .device-name.empty .btn-close{display:none}.slot-item-container .device-name.empty:before{height:0}.slot-item-container .all-functions{opacity:0;pointer-events:none;min-width:80px;position:absolute;left:-10px;margin-left:100%;bottom:0;padding:6px 0;background:#fff;transition:all .3s}.slot-item-container .all-functions.show{opacity:1;pointer-events:auto;left:16px}.slot-item-container .all-functions label{margin-left:8px;margin-bottom:20px;color:#444e69;font-size:14px}.slot-item-container .all-functions .btn-close{cursor:pointer;position:absolute;right:7px;top:7px;height:16px;width:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAB4SURBVDiNpZPLEYAgDAUXe6MuoK4UpwdBwQkQJDcyb9+QnxORCOC9jyxE4Y78DiWxAIcmISKnxaSrtZhMNSOB+ZeacAS7ngl3k1JOBSBpk1INPib0YHjH+Du2S1DhlSZOYbPJ1iLtrLKrG2a9yJopYzTD8Jx+ArgAylOzjm1WpDwAAAAASUVORK5CYII=) center no-repeat;background-size:10px 10px}.slot-item-container .all-functions .functions{display:inline-block;max-height:200px;overflow-x:hidden;overflow-y:auto}.slot-item-container .all-functions .functions::-webkit-scrollbar{width:4px}.slot-item-container .all-functions .functions::-webkit-scrollbar-track{background-color:#fff}.slot-item-container .all-functions .functions::-webkit-scrollbar-thumb{background:#787878;border-radius:25px}.slot-item-container .all-functions .function{display:flex;justify-content:space-between;white-space:nowrap;padding:5px 10px;font-size:12px;color:#787878}.slot-item-container .all-functions .function span{display:flex;align-content:center;align-items:center;margin-right:4px}.slot-item-container .all-functions .function:hover{background:#444e6933}.slot-item-container .all-functions .btn-add{cursor:pointer;width:16px;font-size:16px;text-align:center;font-style:normal}.slot-item-container .info{overflow:hidden;margin-left:-2px;margin-top:-19px;position:absolute;left:100%;top:50%;transform:translateY(-50%);width:0;display:flex;align-items:flex-start;transition:all .3s}.slot-item-container .info>img{flex:0 0 auto;width:53px;height:29px}`, dc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGsAAAA7CAYAAAB8MXT7AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGTSURBVHic7dxLbQNBEIThnigADGEhxAwcBoZgCIZgBoZgCIZgCIaQMIgZVC4daw/xXPLoqdX/3fbW0milUtfutMCdpCkiLhEx1U6CLkkvkt4k7atnQYekfR7US/Us6JB0yIOaqmfBA5JWks6SrhzUwCRN+TYdq2dBx+ygDtWzoEPSNg9qVz0LOmZBgsQ3sqUkvufqAf6SpFVEnCPiFhHr1tqteCR8hyBhYrY6OlTPgo5cHX1I2lbPgo6lBInFk3Rc+uroqXqAn8ogcc3H19bae+U8eIDEZ0LSJoMEZeHIWB2ZIPEZoCw0QVlogsRnYlYWsjoaGUHCRK6OOKiRfa2OMvWtqufBAwQJE5SFJmZl4aZ6FnSQ+Azk6mjxZeFv+/fycfbDWrTW1pSFgyLxmcjVEWXh6CgLTZD4DMzKwguro4ERJEywOjIhaUdZaIAgYYKy0ABloQkSnwlxKZUHcSmVBxKfgVwdnSgLB8d35iZIfCYoC01QFpog8Y3rftFWrotO+cilVKMiSJigLDSS30hQFhr4BEcKZN0LNhDxAAAAAElFTkSuQmCC", Hr = { name: "", isMobile: !1 }, pc = {
|
|
8912
8912
|
"&": "&",
|
|
8913
8913
|
"<": "<",
|
|
8914
8914
|
">": ">",
|
|
@@ -8916,12 +8916,12 @@ const hc = `*{box-sizing:border-box}.slot-item-container.is-mobile .main{pointer
|
|
|
8916
8916
|
"'": "'"
|
|
8917
8917
|
};
|
|
8918
8918
|
function Gt(o) {
|
|
8919
|
-
return o == null ? "" : String(o).replace(/[&<>"']/g, (e) =>
|
|
8919
|
+
return o == null ? "" : String(o).replace(/[&<>"']/g, (e) => pc[e]);
|
|
8920
8920
|
}
|
|
8921
8921
|
function Wr(...o) {
|
|
8922
8922
|
return o.filter(Boolean).join(" ");
|
|
8923
8923
|
}
|
|
8924
|
-
class
|
|
8924
|
+
class Fn extends HTMLElement {
|
|
8925
8925
|
constructor(e) {
|
|
8926
8926
|
super(), this._size = 12, this._showDialog = !1, this._selected = !1, this._focused = !1, this._toBeInstalled = !1, this._toBeReplaced = !1, this._hasError = !1, this._canInstall = !1, this._hide = !1, this._disable = !1, this._filled = !1, this._allFunctions = [], this._functions = [], this._deviceName = "", this._deviceLogo = "", this._renderQueued = !1, this._needsRender = !0, this.attachShadow({ mode: "open" }), this._props = { ...Hr, ...e ?? {} }, this.handleShadowClick = this.handleShadowClick.bind(this), this.shadowRoot.addEventListener("click", this.handleShadowClick), this.render();
|
|
8927
8927
|
}
|
|
@@ -9093,11 +9093,11 @@ class Ln extends HTMLElement {
|
|
|
9093
9093
|
</div>
|
|
9094
9094
|
</div>` : "", c = this._deviceLogo ? `<img class="device-logo" src="${Gt(this._deviceLogo)}" alt="device logo">` : "", u = Gt(((d = this._slot) == null ? void 0 : d.name) ?? this._props.name ?? ""), f = Gt(this._deviceName || "待安装");
|
|
9095
9095
|
this.shadowRoot.innerHTML = `
|
|
9096
|
-
<style>${
|
|
9096
|
+
<style>${fc}</style>
|
|
9097
9097
|
<div class="${e}">
|
|
9098
9098
|
<div class="${t}" style="width:${this._size}px;height:${this._size}px"></div>
|
|
9099
9099
|
<div class="info">
|
|
9100
|
-
<img alt="" src="${
|
|
9100
|
+
<img alt="" src="${dc}">
|
|
9101
9101
|
<div class="name">
|
|
9102
9102
|
<div class="name-wrapper">${u}</div>
|
|
9103
9103
|
<div class="functions-wrapper">
|
|
@@ -9146,7 +9146,7 @@ class Ln extends HTMLElement {
|
|
|
9146
9146
|
}
|
|
9147
9147
|
}
|
|
9148
9148
|
}
|
|
9149
|
-
customElements.get("slot-item") || customElements.define("slot-item",
|
|
9149
|
+
customElements.get("slot-item") || customElements.define("slot-item", Fn);
|
|
9150
9150
|
const $ = {
|
|
9151
9151
|
ON_DROP: "slot-on-drop",
|
|
9152
9152
|
ON_DEVICE_DELETED: "slot-on-device-deleted",
|
|
@@ -9160,12 +9160,12 @@ const $ = {
|
|
|
9160
9160
|
ON_FUNCTION_REMOVED: "slot-on-function-removed",
|
|
9161
9161
|
ON_FUNCTION_ADDED: "slot-on-function-added"
|
|
9162
9162
|
};
|
|
9163
|
-
class Vr extends
|
|
9163
|
+
class Vr extends He {
|
|
9164
9164
|
constructor(e) {
|
|
9165
9165
|
const t = document.createElement("div");
|
|
9166
9166
|
super(t), this.props = e, this._emitter = new Ot(), this._slotContainer = new ge(), this._bracketSlots = [], this._hasError = !1, this.useBracket = !1, this.addEventListener = this._emitter.addListener.bind(this._emitter), this.removeEventListener = this._emitter.removeListener.bind(this._emitter), this._canInstall = !1, this._loading = !1, this._selected = !1, this._deviceSelected = !1, this._focused = !1, this._toBeInstalled = !1, this._toBeReplaced = !1, this._allFunctions = /* @__PURE__ */ new Set(), this._functions = /* @__PURE__ */ new Set(), this._timer = 0, this._parentPos = new b(), this._wrapper = new ge(), this._showSlot = !0, this._isMirror = !1, this.beforeInstall = void 0, this._preventDefaults = (i) => {
|
|
9167
9167
|
i.preventDefault(), i.stopPropagation();
|
|
9168
|
-
}, this.getWP = this._slotContainer.getWorldPosition.bind(this._slotContainer), this._showSlot = typeof e.show == "boolean" ? e.show : !0, this.name = e.name, this._isMirror = e.isMirror, this._slotUI = new
|
|
9168
|
+
}, this.getWP = this._slotContainer.getWorldPosition.bind(this._slotContainer), this._showSlot = typeof e.show == "boolean" ? e.show : !0, this.name = e.name, this._isMirror = e.isMirror, this._slotUI = new Fn({
|
|
9169
9169
|
name: e.name,
|
|
9170
9170
|
isMobile: e.isMobile,
|
|
9171
9171
|
onRemove: () => {
|
|
@@ -9216,7 +9216,7 @@ class Vr extends Ue {
|
|
|
9216
9216
|
if (s) {
|
|
9217
9217
|
let a = "x";
|
|
9218
9218
|
["height", "mast"].includes(e) ? a = "z" : ["width", "liftOuterWidth"].includes(e) && (a = "y");
|
|
9219
|
-
const n = ((i = this.props.slot) == null ? void 0 : i.position[a]) > 0 ? 1 : -1;
|
|
9219
|
+
const n = ((i = this.props.slot) == null ? void 0 : i.position[a]) - s.origin - t > 0 ? 1 : -1;
|
|
9220
9220
|
this._wrapper.position[a] = (t - s.origin) * s.scale * n;
|
|
9221
9221
|
}
|
|
9222
9222
|
}
|
|
@@ -9298,7 +9298,7 @@ class Vr extends Ue {
|
|
|
9298
9298
|
}
|
|
9299
9299
|
clearSlot() {
|
|
9300
9300
|
this._bracketSlots = [], this._slotContainer.children.forEach((e) => {
|
|
9301
|
-
e.removeFromParent(),
|
|
9301
|
+
e.removeFromParent(), De(e);
|
|
9302
9302
|
}), this._slotUI.filled = !1, this.deviceInfo = void 0, this._slotUI.deviceName = "", this._slotUI.deviceLogo = "", this.holeTarget && (this.holeTarget.visible = !0), this.mirrorTarget && this.mirrorTarget.clearSlot();
|
|
9303
9303
|
}
|
|
9304
9304
|
get disabled() {
|
|
@@ -9363,7 +9363,7 @@ class Vr extends Ue {
|
|
|
9363
9363
|
dispose() {
|
|
9364
9364
|
cancelAnimationFrame(this._timer), ["dragenter", "dragover", "dragleave", "drop"].forEach((e) => {
|
|
9365
9365
|
this.element.addEventListener(e, this._preventDefaults, !1);
|
|
9366
|
-
}), this.clearSlot(), this._emitter.removeAllListeners(),
|
|
9366
|
+
}), this.clearSlot(), this._emitter.removeAllListeners(), De(this._slotContainer), this.element.remove();
|
|
9367
9367
|
}
|
|
9368
9368
|
render(e) {
|
|
9369
9369
|
const t = this.element.style.transform, i = /translate\(-?\d*\.?\d*%?,?\s-?\d*\.?\d*%?\)\s*translate\((-?\d*\.?\d*)px,\s*(-?\d*\.?\d*)px\)/.exec(t);
|
|
@@ -9381,7 +9381,7 @@ class Vr extends Ue {
|
|
|
9381
9381
|
return new ge();
|
|
9382
9382
|
}
|
|
9383
9383
|
}
|
|
9384
|
-
class
|
|
9384
|
+
class mc extends He {
|
|
9385
9385
|
constructor(e) {
|
|
9386
9386
|
const t = document.createElement("div");
|
|
9387
9387
|
super(t), this._text = document.createElement("div");
|
|
@@ -9439,7 +9439,7 @@ class Ei extends ge {
|
|
|
9439
9439
|
color: "#666",
|
|
9440
9440
|
linewidth: 2
|
|
9441
9441
|
})
|
|
9442
|
-
), this._text = new
|
|
9442
|
+
), this._text = new mc(""), this._line.frustumCulled = !1, this.add(this._line, this._line2), this._showText && (this.add(this._text), this._text.onPointMove = () => {
|
|
9443
9443
|
this._line.material.color.set("#000"), this._line2.material.color.set("#000");
|
|
9444
9444
|
}, this._text.onPointLeave = () => {
|
|
9445
9445
|
this._line.material.color.set("#666"), this._line2.material.color.set("#666");
|
|
@@ -9473,20 +9473,20 @@ class Ei extends ge {
|
|
|
9473
9473
|
l.addVectors(e, t).multiplyScalar(0.5), this._text.position.copy(l), this.useStartEnd || (this._line2.visible = !1);
|
|
9474
9474
|
}
|
|
9475
9475
|
destroy() {
|
|
9476
|
-
this._text.dispose(), this.children.forEach((e) =>
|
|
9476
|
+
this._text.dispose(), this.children.forEach((e) => De(e)), this.removeFromParent();
|
|
9477
9477
|
}
|
|
9478
9478
|
}
|
|
9479
|
-
class
|
|
9479
|
+
class kn extends Bt {
|
|
9480
9480
|
// 上一次的角度
|
|
9481
9481
|
constructor(e, t) {
|
|
9482
|
-
super(), this.radius = e, this._text = new
|
|
9482
|
+
super(), this.radius = e, this._text = new gc(""), this._line = new Ei(void 0, !1, !1), this._box = new X(), this._arc = new Ro(), this._previousPosition = null, this._updateTimer = null, this._updateDelay = 300, this._accumulatedAngle = 0, this._lastAngle = null, this._line.updateMaterial(new Ts({
|
|
9483
9483
|
color: "#555",
|
|
9484
9484
|
dashSize: 0.06,
|
|
9485
9485
|
gapSize: 0.06
|
|
9486
9486
|
})), this._line.renderOrder = 0, this._box.geometry = new or(e, e + 3e-3, 128), this._box.material = new ni({
|
|
9487
9487
|
color: "#666",
|
|
9488
9488
|
side: oi
|
|
9489
|
-
}), this._arc.geometry = new ur(), this._arc.geometry.setPositions([0, 0, 0, 0, 0, 0]), this._arc.geometry.instanceCount = 0, this._arc.material = new
|
|
9489
|
+
}), this._arc.geometry = new ur(), this._arc.geometry.setPositions([0, 0, 0, 0, 0, 0]), this._arc.geometry.instanceCount = 0, this._arc.material = new Do({
|
|
9490
9490
|
color: "#eee",
|
|
9491
9491
|
linewidth: 2,
|
|
9492
9492
|
// 像素单位的线宽
|
|
@@ -9546,7 +9546,7 @@ class Fn extends Bt {
|
|
|
9546
9546
|
return u.setPositions(s), u.instanceCount = Math.max(0, s.length / 3 - 1), u;
|
|
9547
9547
|
}
|
|
9548
9548
|
}
|
|
9549
|
-
class
|
|
9549
|
+
class gc extends He {
|
|
9550
9550
|
constructor(e) {
|
|
9551
9551
|
const t = document.createElement("div");
|
|
9552
9552
|
super(t), this._wrapper = document.createElement("div"), this._circle = document.createElement("div");
|
|
@@ -9568,8 +9568,8 @@ class mc extends Ue {
|
|
|
9568
9568
|
this._circle.style.background = e;
|
|
9569
9569
|
}
|
|
9570
9570
|
}
|
|
9571
|
-
const
|
|
9572
|
-
class Gr extends
|
|
9571
|
+
const vc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAUCAYAAADY6P5TAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEvSURBVFiFzZdbFYMwEEQroRKQgAQkVEIlICEOkFAJlRAJSIgEJNx+sPS0nGxIaOhyv3nM7mTmwOViDHAFesADD+BqrakKQAcMwMQ3AWis9e1C3HLASJoAdNZ6sxG3/MZQMZy1dhWgFbfWRzDGlFjAwFlyyXdh5OD5OIqykBgBy1yiF0aMUQaJugLclOcEoP3nULmFgQgeyCwOoJGBYrijByspDM98ZIszJAt8Ks8dag/VUFYYLtetjHdruRz5JZf8WBg1Ae7KcgOluaSsMAKJwqgJ6Vz2WzcvhZHjVlFh1ESG1DQ67SYtyGs8OwujNpTkUtw4nVtbyLK1XDafF3aKW90Z3EpBbi5lE0u9n3qoNTKk9rHh3heZqqwA8Vw6a11VkVwuPK31HALzb5pfovYC2xSs5LCDIUcAAAAASUVORK5CYII=", _c = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAKCAYAAACngj4SAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAChSURBVDiNrdJbFYMwEIRhJFQCEpCAhEqIhDhBAlKQgAQkIOHrSziHpmkbLvua7P4zO9s0FYUeM0b0NT2nC9FnLQho7wQ9MOwgQ3K4ZPDrrtGmFcKKkL0HTAXXw2HX6HYuFnR/hMWC6ykX+W1AzJqq1abDGguux6LoPK9aUGFOm1Y+F+Bh+7DlsSKehRXgnfdDm5od7GdeN8ADnpuKQ3ldqReHZFd3742nZgAAAABJRU5ErkJggg==", Nr = "data:image/png;base64,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", yc = "data:image/png;base64,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";
|
|
9572
|
+
class Gr extends He {
|
|
9573
9573
|
constructor(e, t) {
|
|
9574
9574
|
const i = document.createElement("div");
|
|
9575
9575
|
super(i), this.props = e, this.amr = t, this._direction = 1, this._controllingRotate = !1, this._controlling = !1, this._startAt = 0, this._looper = 0, this._initial = 0, this._canRotate = !1, this._emitter = new Ot(), this.addListener = this._emitter.addListener.bind(this._emitter), this.removeListener = this._emitter.removeListener.bind(this._emitter), this._update = () => {
|
|
@@ -9612,11 +9612,11 @@ class Gr extends Ue {
|
|
|
9612
9612
|
h.name === c.name && (l = h);
|
|
9613
9613
|
}), l)) {
|
|
9614
9614
|
const h = document.createElement("div");
|
|
9615
|
-
h.style.background = `url(${
|
|
9615
|
+
h.style.background = `url(${yc}) center no-repeat`, h.style.backgroundSize = "100% auto", h.style.position = "absolute", h.style.top = "-50%", h.style.left = "-50%", h.style.width = s ? "140px" : "160px", h.style.height = s ? "70px" : "80px", h.style.transform = "translateX(-50%) translateY(-50%)", i.append(h);
|
|
9616
9616
|
const m = document.createElement("div");
|
|
9617
|
-
m.style.background = `url(${
|
|
9617
|
+
m.style.background = `url(${_c}) center no-repeat`, m.style.backgroundSize = "100% auto", m.style.width = m.style.height = s ? "20px" : "26px", m.style.position = "absolute", m.style.top = "0", m.style.transform = "translateY(-50%)", m.style.marginBottom = "5px", m.setAttribute("data-direction", "left"), i.append(m);
|
|
9618
9618
|
const v = document.createElement("div");
|
|
9619
|
-
v.style.background = `url(${
|
|
9619
|
+
v.style.background = `url(${vc}) center no-repeat`, v.style.backgroundSize = "100% auto", v.style.width = v.style.height = s ? "20px" : "26px", v.style.position = "absolute", m.style.left = v.style.right = s ? "62px" : "69px", v.style.top = "0", v.style.transform = "translateY(-50%)", v.style.marginBottom = "5px", v.setAttribute("data-direction", "right"), i.append(v), Array.from([m, v]).forEach((p) => {
|
|
9620
9620
|
s || p.addEventListener("mousemove", () => {
|
|
9621
9621
|
p.style.filter = "invert(100%)";
|
|
9622
9622
|
}), p.addEventListener("mouseleave", () => {
|
|
@@ -9641,19 +9641,19 @@ class Gr extends Ue {
|
|
|
9641
9641
|
}
|
|
9642
9642
|
hide() {
|
|
9643
9643
|
this.element.style.display = "none", this.traverse((e) => {
|
|
9644
|
-
e.visible = !1, e instanceof
|
|
9644
|
+
e.visible = !1, e instanceof He && (e.element.style.visibility = "hidden");
|
|
9645
9645
|
}), this.visible = !1;
|
|
9646
9646
|
}
|
|
9647
9647
|
show() {
|
|
9648
9648
|
this.element.style.display = "auto", this.traverse((e) => {
|
|
9649
|
-
e.visible = !0, e instanceof
|
|
9649
|
+
e.visible = !0, e instanceof He && (e.element.style.visibility = "visible");
|
|
9650
9650
|
}), this.visible = !0;
|
|
9651
9651
|
}
|
|
9652
9652
|
dispose() {
|
|
9653
9653
|
this._emitter.removeAllListeners(), cancelAnimationFrame(this._looper), this.element.remove();
|
|
9654
9654
|
}
|
|
9655
9655
|
}
|
|
9656
|
-
class
|
|
9656
|
+
class xc extends Po {
|
|
9657
9657
|
constructor(e) {
|
|
9658
9658
|
const t = document.createElement("div");
|
|
9659
9659
|
super(t), this.props = e, this._scale = 0.01, this._emitter = new Ot(), this.addEventListener = this._emitter.on.bind(this._emitter), this.removeEventListener = this._emitter.on.bind(this._emitter), this._mouseStart = new z(), this._targetSize = new z(), this._caches = [], this._sizeFlag = "width", this._direction = 1, this._lines = [], this._pointerdown = (u) => {
|
|
@@ -9684,9 +9684,9 @@ class yc extends Po {
|
|
|
9684
9684
|
this._lines.forEach((e) => e.dispose()), this._emitter.removeAllListeners(), this.endNode.removeEventListener("pointerdown", this._pointerdown), this.endNode.removeEventListener("pointermove", this._pointermove), this.endNode.removeEventListener("pointerup", this._pointercancel), this.element.remove(), this._caches.forEach((e) => e.clear()), this._caches = [];
|
|
9685
9685
|
}
|
|
9686
9686
|
}
|
|
9687
|
-
class
|
|
9687
|
+
class wc extends Bt {
|
|
9688
9688
|
constructor() {
|
|
9689
|
-
super(), this._box3 = new Y(), this._line11 = new Ei("长:"), this._line12 = new Ei("宽:"), this._line13 = new Ei("高:"), this._outline = new
|
|
9689
|
+
super(), this._box3 = new Y(), this._line11 = new Ei("长:"), this._line12 = new Ei("宽:"), this._line13 = new Ei("高:"), this._outline = new kn(0, 0), this._radius = 0, this._hasWidthConfig = !1, this._hasLengthConfig = !1, this._hasHeightConfig = !1, this.follow = "", this.followOrigin = 0, this.followScale = 1, this.originOffset = 0, this.translateCache = 0, this.head = 0, this.tail = 0, this._change = () => {
|
|
9690
9690
|
if (!this._app)
|
|
9691
9691
|
return;
|
|
9692
9692
|
const e = this._app.camera;
|
|
@@ -9719,7 +9719,7 @@ class xc extends Bt {
|
|
|
9719
9719
|
const t = [this._line11, this._line12, this._line13];
|
|
9720
9720
|
e && (this.visible = !0, this._outline.visible = !0, this._outline.show(), t.push(this._outline)), t.forEach((i) => {
|
|
9721
9721
|
i.traverse((s) => {
|
|
9722
|
-
s.visible = !0, s instanceof
|
|
9722
|
+
s.visible = !0, s instanceof He && (s.element.style.visibility = "visible");
|
|
9723
9723
|
});
|
|
9724
9724
|
});
|
|
9725
9725
|
}
|
|
@@ -9727,7 +9727,7 @@ class xc extends Bt {
|
|
|
9727
9727
|
const t = [this._line11, this._line12, this._line13];
|
|
9728
9728
|
e && (this.visible = !1, this._outline.visible = !1, this._outline.hide(), t.push(this._outline)), t.forEach((i) => {
|
|
9729
9729
|
i.traverse((s) => {
|
|
9730
|
-
s.visible = !1, s instanceof
|
|
9730
|
+
s.visible = !1, s instanceof He && (s.element.style.visibility = "hidden");
|
|
9731
9731
|
});
|
|
9732
9732
|
});
|
|
9733
9733
|
}
|
|
@@ -9738,7 +9738,7 @@ class xc extends Bt {
|
|
|
9738
9738
|
update(e = 0) {
|
|
9739
9739
|
if (!this._object)
|
|
9740
9740
|
return;
|
|
9741
|
-
const t = this._object, { box: i, maxRadius: s, hasLength: a, hasHeight: n, hasWidth: c } =
|
|
9741
|
+
const t = this._object, { box: i, maxRadius: s, hasLength: a, hasHeight: n, hasWidth: c } = oc(t);
|
|
9742
9742
|
this.tail = Math.abs(i.min.x), this.head = Math.abs(i.max.x), this._hasWidthConfig = c, this._hasLengthConfig = a, this._hasHeightConfig = n, this._box3.copy(i), this._radius = s, this.follow && e && (this.originOffset = (this.followOrigin - e) * this.followScale), this._outline.update(this._radius), this._change();
|
|
9743
9743
|
const u = this._box3.min.x, f = this._box3.max.x, d = this._box3.min.z, r = this._box3.max.z, l = this._box3.min.y, h = this._box3.max.y;
|
|
9744
9744
|
let m = 0.2;
|
|
@@ -9768,7 +9768,7 @@ class qr extends Bt {
|
|
|
9768
9768
|
this._generate(e, t, i);
|
|
9769
9769
|
}
|
|
9770
9770
|
clearAll() {
|
|
9771
|
-
|
|
9771
|
+
De(this);
|
|
9772
9772
|
}
|
|
9773
9773
|
hide() {
|
|
9774
9774
|
this.traverse((e) => e.visible = !1);
|
|
@@ -9779,7 +9779,7 @@ class qr extends Bt {
|
|
|
9779
9779
|
_generate(e, t, i) {
|
|
9780
9780
|
this.clearAll();
|
|
9781
9781
|
const s = new X(
|
|
9782
|
-
new
|
|
9782
|
+
new no(e, t, i),
|
|
9783
9783
|
new ni({
|
|
9784
9784
|
color: new K("#0f5fd5"),
|
|
9785
9785
|
transparent: !0,
|
|
@@ -9787,7 +9787,7 @@ class qr extends Bt {
|
|
|
9787
9787
|
})
|
|
9788
9788
|
);
|
|
9789
9789
|
s.geometry.translate(0, 0, i / 2);
|
|
9790
|
-
const a = new
|
|
9790
|
+
const a = new oo(s.geometry), n = new Ts({
|
|
9791
9791
|
color: new K("#000"),
|
|
9792
9792
|
dashSize: 0.015,
|
|
9793
9793
|
gapSize: 0.015
|
|
@@ -9795,10 +9795,10 @@ class qr extends Bt {
|
|
|
9795
9795
|
c.computeLineDistances(), this.add(s, c);
|
|
9796
9796
|
}
|
|
9797
9797
|
}
|
|
9798
|
-
const
|
|
9798
|
+
const bc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAALSURBVAiZY2AAAgAABQABYlUyiAAAAABJRU5ErkJggg==";
|
|
9799
9799
|
class jr {
|
|
9800
9800
|
constructor(e) {
|
|
9801
|
-
this._props = e, this.name = "", this.transparentTexture =
|
|
9801
|
+
this._props = e, this.name = "", this.transparentTexture = Bn.load(bc), this._offscreen = new OffscreenCanvas(0, 0), this._defaults = { ...e }, this.target = e.target, this.parent = this.target.parent, this.reset();
|
|
9802
9802
|
}
|
|
9803
9803
|
get imageSize() {
|
|
9804
9804
|
return this._props.imageSize;
|
|
@@ -9832,7 +9832,7 @@ class jr {
|
|
|
9832
9832
|
let n = window.devicePixelRatio * 2;
|
|
9833
9833
|
this._offscreen.width = a.width + n, this._offscreen.height = a.height + n;
|
|
9834
9834
|
const c = this._offscreen.getContext("2d");
|
|
9835
|
-
c == null || c.clearRect(0, 0, this._offscreen.width, this._offscreen.height), c == null || c.drawImage(a, n / 2, n / 2, a.width, a.height), s = new Qe(this._offscreen), s.minFilter = 1003, s.colorSpace = Bi, s.wrapS = s.wrapT =
|
|
9835
|
+
c == null || c.clearRect(0, 0, this._offscreen.width, this._offscreen.height), c == null || c.drawImage(a, n / 2, n / 2, a.width, a.height), s = new Qe(this._offscreen), s.minFilter = 1003, s.colorSpace = Bi, s.wrapS = s.wrapT = We, s.repeat.set(1 / t.x, 1 / t.y), s.offset.set(i.x, i.y), s.flipY = !1, s.needsUpdate = !0;
|
|
9836
9836
|
const u = this._props.target;
|
|
9837
9837
|
u.material && ((f = u.material.map) == null || f.dispose(), s ? (u.material.map = s, u.material.opacity = 1) : (u.material.map = this.transparentTexture, u.material.opacity = 0));
|
|
9838
9838
|
};
|
|
@@ -9848,14 +9848,14 @@ class jr {
|
|
|
9848
9848
|
this._offscreen = null;
|
|
9849
9849
|
}
|
|
9850
9850
|
}
|
|
9851
|
-
function
|
|
9851
|
+
function Qr(o) {
|
|
9852
9852
|
return o.type ? o.type === "Mesh" : o.isMesh;
|
|
9853
9853
|
}
|
|
9854
|
-
const
|
|
9855
|
-
|
|
9854
|
+
const Bn = new mn();
|
|
9855
|
+
Bn.crossOrigin = "anonymous";
|
|
9856
9856
|
class Ac extends Bt {
|
|
9857
9857
|
constructor(e) {
|
|
9858
|
-
super(), this._props = e, this._emitter = new Ot(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new ge(), this.lines = new ge(), this._clips = [], this._actionsMap = /* @__PURE__ */ new Map(), this._animationClock = new qi(), this.sizeBox = new
|
|
9858
|
+
super(), this._props = e, this._emitter = new Ot(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new ge(), this.lines = new ge(), this._clips = [], this._actionsMap = /* @__PURE__ */ new Map(), this._animationClock = new qi(), this.sizeBox = new wc(), this._goodsSize = new lc(0, 0, 0), this._slots = [], this._logos = [], this._skins = [], this._levels = /* @__PURE__ */ new Map(), this._rollerLevel = /* @__PURE__ */ new Map(), this._liftBrackets = [], this._rollerColumns = 1, this._bodyOpacity = 1, this._masts = /* @__PURE__ */ new Map(), this._liftMaxHeight = 0, this._jackMaxHeight = 0, this._forkMaxHeight = 0, this.controllers = [], this.goods = [], this._breathLights = [], this._shelves = /* @__PURE__ */ new Map(), this._shelfMaxLevel = 1, this._url = "", this._showController = !0, this._showSlots = !0, this._shapeKeys = /* @__PURE__ */ new Map(), this._shapeKeyTargets = /* @__PURE__ */ new Map(), this._shapeKeyTimer = 0, this._shapeKeyCache = "", this._materialsCache = /* @__PURE__ */ new Map(), this.opacityCache = void 0, this.actions = [], this._currentAction = null, this._pendingFinishedCallback = null, this._url = e.url || "", this._url && this.load(this._url).then(), this.add(this._container, this.lines), this._props.showSizeBox && this.add(this.sizeBox), this.showController = typeof e.showController == "boolean" ? e.showController : !0, this._showSlots = typeof e.showSlots == "boolean" ? e.showSlots : !0;
|
|
9859
9859
|
}
|
|
9860
9860
|
get shapeKeys() {
|
|
9861
9861
|
return this._shapeKeys;
|
|
@@ -9910,6 +9910,13 @@ class Ac extends Bt {
|
|
|
9910
9910
|
get lift() {
|
|
9911
9911
|
return this._lift;
|
|
9912
9912
|
}
|
|
9913
|
+
get useCenterModel() {
|
|
9914
|
+
var e;
|
|
9915
|
+
return ((e = this._centerModel) == null ? void 0 : e.visible) ?? !1;
|
|
9916
|
+
}
|
|
9917
|
+
set useCenterModel(e) {
|
|
9918
|
+
this._centerModel && (this._centerModel.visible = e);
|
|
9919
|
+
}
|
|
9913
9920
|
set bodyOpacity(e) {
|
|
9914
9921
|
this._bodyOpacity = e, e < 1 ? this._materialsCache.forEach((t) => {
|
|
9915
9922
|
t.mat.transparent = !0, t.mat.opacity = e, t.mat.metalness = 0, t.mat.roughness = 1, t.mat.color = new K("#3859be"), t.mat.needsUpdate = !0;
|
|
@@ -9925,9 +9932,30 @@ class Ac extends Bt {
|
|
|
9925
9932
|
} else
|
|
9926
9933
|
this._animationClock.getDelta();
|
|
9927
9934
|
}, this._app.renderer.domElement.addEventListener("ticker", this._onTicker), this.addEventListener("shape-key-changed", (t, i) => {
|
|
9928
|
-
this._slots.forEach((s) => s.shapeKeyChanged(t, i)), this.sizeBox.follow === t ? (this.sizeBox.generate(this._container, i), this.sizeBox.originOffset && (this._container.traverse((s) => {
|
|
9935
|
+
if (this._slots.forEach((s) => s.shapeKeyChanged(t, i)), this.sizeBox.follow === t ? (this.sizeBox.generate(this._container, i), this.sizeBox.originOffset && (this._container.traverse((s) => {
|
|
9929
9936
|
s instanceof X && !s.userData.isDevice && !s.userData.isBracket && s.geometry.translate(this.sizeBox.originOffset - this.sizeBox.translateCache, 0, 0), s instanceof Vr && !s.props.slot.userData.ignoreOriginChanged && s.parent && s.parent.position.add(new b(this.sizeBox.originOffset - this.sizeBox.translateCache, 0, 0));
|
|
9930
|
-
}), this.sizeBox.translateCache = this.sizeBox.originOffset, this.sizeBox.generate(this._container))) : this.sizeBox.generate(this._container), ["width", "length", "height"].includes(t) && this._emitter.emit("size-changed", t, i)
|
|
9937
|
+
}), this.sizeBox.translateCache = this.sizeBox.originOffset, this.sizeBox.generate(this._container))) : this.sizeBox.generate(this._container), ["width", "length", "height"].includes(t) && this._emitter.emit("size-changed", t, i), t === "goodsLength") {
|
|
9938
|
+
const s = i + 0.14 - 0.54;
|
|
9939
|
+
this.setShapeKey("boxLength", s);
|
|
9940
|
+
const a = i + 0.14;
|
|
9941
|
+
if (this.setShapeKey("topLength", a), this.isTopInvert) {
|
|
9942
|
+
const n = i - 0.257;
|
|
9943
|
+
this.setShapeKey("width", n);
|
|
9944
|
+
} else
|
|
9945
|
+
this.setShapeKey("length", a);
|
|
9946
|
+
this._generateRollers();
|
|
9947
|
+
}
|
|
9948
|
+
if (t === "goodsWidth") {
|
|
9949
|
+
const s = i + 0.193;
|
|
9950
|
+
this.setShapeKey("boxWidth", s);
|
|
9951
|
+
const a = i + 0.219;
|
|
9952
|
+
if (this.setShapeKey("topWidth", a), this.isTopInvert) {
|
|
9953
|
+
const n = i + 0.62;
|
|
9954
|
+
this.setShapeKey("length", n);
|
|
9955
|
+
} else
|
|
9956
|
+
this.setShapeKey("width", a);
|
|
9957
|
+
this._generateRollers();
|
|
9958
|
+
}
|
|
9931
9959
|
});
|
|
9932
9960
|
}
|
|
9933
9961
|
_findFirstSkinnedMesh(e) {
|
|
@@ -10016,19 +10044,24 @@ class Ac extends Bt {
|
|
|
10016
10044
|
i && this._shapeKeyTimer && e === this._shapeKeyCache && clearTimeout(this._shapeKeyTimer), this._shapeKeyCache = e, this._shapeKeyTimer = window.setTimeout(() => {
|
|
10017
10045
|
this.getShapeKeyTargets(e).forEach((a) => {
|
|
10018
10046
|
var u;
|
|
10047
|
+
performance.now();
|
|
10019
10048
|
let n = t;
|
|
10020
10049
|
a.userData[`origin_${e}`] && (n -= a.userData[`origin_${e}`]);
|
|
10021
10050
|
const c = (u = a.morphTargetDictionary) == null ? void 0 : u[e];
|
|
10022
|
-
c !== void 0 && a.morphTargetInfluences && (a.morphTargetInfluences[c] = n), a instanceof X && a.geometry.translate(0, 0, 1e-
|
|
10051
|
+
c !== void 0 && a.morphTargetInfluences && (a.morphTargetInfluences[c] = n), a instanceof X && a.geometry.translate(0, 0, 1e-9);
|
|
10023
10052
|
}), i && this._emitter.emit("shape-key-changed", e, t);
|
|
10024
|
-
},
|
|
10053
|
+
}, 0);
|
|
10025
10054
|
}
|
|
10026
10055
|
_generateAmr(e, t) {
|
|
10027
10056
|
this._modelRoot = e, this._actionsMap.clear(), this.actions = [], this._clips = [], t && t.length && (this._mixer = new ar(e), this._clips = t, t.forEach((i) => {
|
|
10028
10057
|
const s = this._mixer.clipAction(i);
|
|
10029
10058
|
this._actionsMap.set(i.name, s);
|
|
10030
10059
|
}), this.actions = t.map((i) => i.name)), this._shapeKeyTargets.clear(), this._shapeKeys.clear(), e.traverse((i) => {
|
|
10031
|
-
i.userData.isShelf && (this._shelf = i), i.userData.isFork && (this._fork = i), i.userData.isMast && i.userData.mastLevel && this._masts.set(i.userData.mastLevel, i), i.userData.isJack && (this._jack = i), i.userData.isLift && (this._lift = i),
|
|
10060
|
+
if (i.userData.isShelf && (this._shelf = i), i.userData.isFork && (this._fork = i), i.userData.isMast && i.userData.mastLevel && this._masts.set(i.userData.mastLevel, i), i.userData.isJack && (this._jack = i), i.userData.isLift && (this._lift = i), i.userData.isRollerLevel) {
|
|
10061
|
+
const s = `1-${i.userData.level || 0}`;
|
|
10062
|
+
this._rollerLevel.set(s, i);
|
|
10063
|
+
}
|
|
10064
|
+
i.userData.isLift && (this._lift = i), i.userData.isCenterModel && (i.visible = !1, this._centerModel = i), i.userData.isSwitch && i.userData.switchName === "top" && (this._rollerTop = i), i.userData.isLiftBracket && this._liftBrackets.push(i), i.userData.isBaffle && (this._rollerBaffle = i, i.visible = !1), i.userData.isRoller && (this._roller = i, this._generateRollers()), i.userData.isRollerLevelBox && (this._rollerGoodsBox = i), Object.keys(i.morphTargetDictionary || {}).forEach((s) => {
|
|
10032
10065
|
let a = i.morphTargetInfluences[i.morphTargetDictionary[s]];
|
|
10033
10066
|
i.userData[`origin_${s}`] && (a += i.userData[`origin_${s}`]), this._shapeKeys.has(s) || this._shapeKeys.set(s, a);
|
|
10034
10067
|
const n = this._shapeKeyTargets.get(s);
|
|
@@ -10039,7 +10072,7 @@ class Ac extends Bt {
|
|
|
10039
10072
|
if (i.castShadow = !0, i.receiveShadow = !0, i.material)
|
|
10040
10073
|
if (Array.isArray(i.material))
|
|
10041
10074
|
i.material.forEach((a) => {
|
|
10042
|
-
a.userData.changeColor && (this.skins.find((n) => n.name === a.userData.name) || this.skins.push(new
|
|
10075
|
+
a.userData.changeColor && (this.skins.find((n) => n.name === a.userData.name) || this.skins.push(new an({
|
|
10043
10076
|
name: a.userData.name,
|
|
10044
10077
|
target: a
|
|
10045
10078
|
})));
|
|
@@ -10050,7 +10083,7 @@ class Ac extends Bt {
|
|
|
10050
10083
|
const a = 1e3, n = new Je.Tween(i.material).to({ emissiveIntensity: 0.2 }).easing(Je.Easing.Quintic.InOut).duration(a), c = new Je.Tween(i.material).to({ emissiveIntensity: 2 }).easing(Je.Easing.Quintic.InOut).duration(a);
|
|
10051
10084
|
n.onComplete(() => c.start()), c.onComplete(() => n.start()), n.start(), this._breathLights.push(n, c);
|
|
10052
10085
|
}
|
|
10053
|
-
i.material.userData.changeColor && (this.skins.find((a) => a.name === i.material.userData.name) || this.skins.push(new
|
|
10086
|
+
i.material.userData.changeColor && (this.skins.find((a) => a.name === i.material.userData.name) || this.skins.push(new an({
|
|
10054
10087
|
name: i.material.userData.name,
|
|
10055
10088
|
target: i.material
|
|
10056
10089
|
})));
|
|
@@ -10183,7 +10216,54 @@ class Ac extends Bt {
|
|
|
10183
10216
|
setLevel(e) {
|
|
10184
10217
|
}
|
|
10185
10218
|
setGoodsSize(e) {
|
|
10186
|
-
this._goodsSize.length = e.length, this._goodsSize.width = e.width, this._goodsSize.height = e.height, this.setShelfLevel(this._shelfMaxLevel);
|
|
10219
|
+
this._goodsSize.length = e.length, this._goodsSize.width = e.width, this._goodsSize.height = e.height, this.setShelfLevel(this._shelfMaxLevel), this.setRoller();
|
|
10220
|
+
}
|
|
10221
|
+
setRoller() {
|
|
10222
|
+
this._goodsSize;
|
|
10223
|
+
}
|
|
10224
|
+
get isTopInvert() {
|
|
10225
|
+
if (this._rollerTop)
|
|
10226
|
+
return Math.abs(this._rollerTop.rotation.z) === Math.PI / 2;
|
|
10227
|
+
}
|
|
10228
|
+
setTopInvert(e = !0) {
|
|
10229
|
+
this._rollerTop && (this._rollerTop.rotation.z = e ? Math.PI / 2 : 0, this.setShapeKey("switch", e ? 1 : 0), this.setShapeKey("goodsWidth", this.goodsSize.length), this.setShapeKey("goodsLength", this.goodsSize.width));
|
|
10230
|
+
}
|
|
10231
|
+
setRollerHeight(e, t) {
|
|
10232
|
+
const i = this._rollerLevel.get(`1-${e}`);
|
|
10233
|
+
i && (i.position.z = t);
|
|
10234
|
+
}
|
|
10235
|
+
_generateRollers() {
|
|
10236
|
+
var d, r;
|
|
10237
|
+
if (!this._roller)
|
|
10238
|
+
return;
|
|
10239
|
+
(((d = this._roller.parent) == null ? void 0 : d.children.filter((l) => l.userData.isCloned)) || []).forEach((l) => {
|
|
10240
|
+
De(l), l.removeFromParent();
|
|
10241
|
+
});
|
|
10242
|
+
let { length: t } = this._goodsSize;
|
|
10243
|
+
t = t || 0.5;
|
|
10244
|
+
const i = 0.05;
|
|
10245
|
+
let s = 0.02;
|
|
10246
|
+
const n = t - s;
|
|
10247
|
+
if (n < 0) {
|
|
10248
|
+
this._roller.visible = !1;
|
|
10249
|
+
return;
|
|
10250
|
+
} else
|
|
10251
|
+
this._roller.visible = !0;
|
|
10252
|
+
const c = i + s;
|
|
10253
|
+
let u = Math.floor(n / c);
|
|
10254
|
+
const f = n % c;
|
|
10255
|
+
if (u > 0) {
|
|
10256
|
+
u > 1 && (s += f / (u + 2));
|
|
10257
|
+
const l = i + s, h = -t / 2 + s + i / 2;
|
|
10258
|
+
for (let m = 0; m < u; m++) {
|
|
10259
|
+
let v = this._roller;
|
|
10260
|
+
m > 0 && (v = this._roller.clone(!0), v.userData.isCloned = !0), v.position.y = h + l * m, (r = this._roller.parent) == null || r.add(v);
|
|
10261
|
+
const p = this._shapeKeyTargets.get("goodsWidth");
|
|
10262
|
+
p && v.traverse((g) => {
|
|
10263
|
+
Qr(g) && p.push(g);
|
|
10264
|
+
});
|
|
10265
|
+
}
|
|
10266
|
+
}
|
|
10187
10267
|
}
|
|
10188
10268
|
getShelfMinHeight() {
|
|
10189
10269
|
const e = this.levelOffset, t = this._shelfMaxLevel, i = this._shelves.get(0);
|
|
@@ -10201,7 +10281,7 @@ class Ac extends Bt {
|
|
|
10201
10281
|
if (!Object.keys(e.morphTargetDictionary || {}).includes(t))
|
|
10202
10282
|
return;
|
|
10203
10283
|
const s = e.morphTargetDictionary[t];
|
|
10204
|
-
e.morphTargetInfluences && (e.morphTargetInfluences[s] = i), e.geometry.translate(0, 0, 1e-
|
|
10284
|
+
e.morphTargetInfluences && (e.morphTargetInfluences[s] = i), e.geometry.translate(0, 0, 1e-9);
|
|
10205
10285
|
}
|
|
10206
10286
|
// 设置料箱料斗层数
|
|
10207
10287
|
setShelfLevel(e = 3) {
|
|
@@ -10211,13 +10291,13 @@ class Ac extends Bt {
|
|
|
10211
10291
|
this._shelfMaxLevel = e;
|
|
10212
10292
|
const t = this.levelOffset;
|
|
10213
10293
|
this._shelves.delete(0), this._shelves.forEach((a) => {
|
|
10214
|
-
|
|
10294
|
+
De(a), a.parent && a.removeFromParent();
|
|
10215
10295
|
}), this.goods = [], this._shelves.clear(), this._shelves.set(0, this._shelf);
|
|
10216
10296
|
for (let a = 1; a < e; a++) {
|
|
10217
10297
|
if (!this._shelf)
|
|
10218
10298
|
return;
|
|
10219
10299
|
this._shelf.traverse((u) => {
|
|
10220
|
-
|
|
10300
|
+
Qr(u) && (this.setShapeKeyToMesh(u, "goodsWidth", this._goodsSize.width), this.setShapeKeyToMesh(u, "goodsLength", this._goodsSize.length));
|
|
10221
10301
|
});
|
|
10222
10302
|
const n = this._shelf.clone(!0);
|
|
10223
10303
|
n.position.z += t * a, this._shelves.set(a, n), (s = this._shelf.parent) == null || s.add(n);
|
|
@@ -10239,7 +10319,7 @@ class Ac extends Bt {
|
|
|
10239
10319
|
this.traverse((e) => {
|
|
10240
10320
|
if (e.userData.isOuterObject) {
|
|
10241
10321
|
const t = this.sizeBox.radius;
|
|
10242
|
-
this._outline ? this._outline.update(t) : (this._outline = new
|
|
10322
|
+
this._outline ? this._outline.update(t) : (this._outline = new kn(t, 0), this.add(this._outline));
|
|
10243
10323
|
}
|
|
10244
10324
|
});
|
|
10245
10325
|
}
|
|
@@ -10283,11 +10363,11 @@ class Ac extends Bt {
|
|
|
10283
10363
|
}
|
|
10284
10364
|
generateDimension(e, t) {
|
|
10285
10365
|
if (e.userData.isDimension) {
|
|
10286
|
-
const i = e.userData.divider, s =
|
|
10366
|
+
const i = e.userData.divider, s = rc(e.userData.startOrigin), a = e.userData.axios;
|
|
10287
10367
|
let n, c;
|
|
10288
10368
|
if (a === "x" ? (n = new b(e.userData.start - e.position.x, 0, 0), c = n.clone().setX(e.userData.end - e.position.x)) : a === "z" ? (n = new b(0, e.userData.start - e.position.y, 0), c = n.clone().setY(e.userData.end - e.position.y)) : (n = new b(0, 0, e.userData.start - e.position.z), c = n.clone().setZ(e.userData.end - e.position.z)), !Object.keys(e.userData).flatMap((r) => r.startsWith("target") ? e.userData[r].name : []).length)
|
|
10289
10369
|
return;
|
|
10290
|
-
const d = new
|
|
10370
|
+
const d = new xc({
|
|
10291
10371
|
start: n,
|
|
10292
10372
|
end: c,
|
|
10293
10373
|
startOrigin: s,
|
|
@@ -10363,7 +10443,7 @@ class Ac extends Bt {
|
|
|
10363
10443
|
}
|
|
10364
10444
|
}
|
|
10365
10445
|
clean() {
|
|
10366
|
-
this._emitter.removeAllListeners(), this.controllers.forEach((e) => e.dispose()), this.controllers = [],
|
|
10446
|
+
this._emitter.removeAllListeners(), this.controllers.forEach((e) => e.dispose()), this.controllers = [], De(this._container), this._levels.forEach((e) => e.destroy()), this._levels.clear(), this._slots = [], this._logos = [], this._skins = [], this._materialsCache.clear(), this.opacityCache = void 0, this._breathLights.forEach((e) => e.stop()), this._breathLights = [], this.sizeBox.reset(), this._shapeKeyTargets.clear(), this._shapeKeys.clear(), this._currentAction = null, this._pendingFinishedCallback && this._mixer && (this._mixer.removeEventListener("finished", this._pendingFinishedCallback), this._pendingFinishedCallback = null), this._mixer && (this._mixer.stopAllAction(), this._modelRoot && this._mixer.uncacheRoot(this._modelRoot)), this._mixer = void 0, this._clips = [], this._actionsMap.clear(), this.actions = [], this._app && this._onTicker && this._app.renderer.domElement.removeEventListener("ticker", this._onTicker), this._onTicker = void 0;
|
|
10367
10447
|
}
|
|
10368
10448
|
destroy() {
|
|
10369
10449
|
this.clean(), this.sizeBox.destroy();
|
|
@@ -10379,7 +10459,7 @@ class Ac extends Bt {
|
|
|
10379
10459
|
r !== s && r !== a && (r.stopFading(), r.setEffectiveWeight(0), r.stop());
|
|
10380
10460
|
});
|
|
10381
10461
|
const f = (t == null ? void 0 : t.loop) ?? !1;
|
|
10382
|
-
(i || !s.isRunning()) && s.reset(), s.enabled = !0, s.setEffectiveTimeScale((t == null ? void 0 : t.timeScale) ?? 1), s.setEffectiveWeight(1), s.paused = !1, s.setLoop(f ?
|
|
10462
|
+
(i || !s.isRunning()) && s.reset(), s.enabled = !0, s.setEffectiveTimeScale((t == null ? void 0 : t.timeScale) ?? 1), s.setEffectiveWeight(1), s.paused = !1, s.setLoop(f ? ao : lo, f ? 1 / 0 : 1), s.clampWhenFinished = (t == null ? void 0 : t.clampWhenFinished) ?? !f, s.play();
|
|
10383
10463
|
const d = (t == null ? void 0 : t.timeScale) ?? 1;
|
|
10384
10464
|
return u ? (a.stopFading(), a.enabled = !0, a.setEffectiveWeight(1), a.crossFadeTo(s, c, !1)) : c > 0 && s.fadeIn(c), s.setEffectiveTimeScale(d), this._currentAction = s, new Promise((r) => {
|
|
10385
10465
|
this._pendingFinishedCallback && this._mixer && this._mixer.removeEventListener("finished", this._pendingFinishedCallback);
|
|
@@ -10422,7 +10502,7 @@ class Ac extends Bt {
|
|
|
10422
10502
|
})) : (this._mixer.stopAllAction(), Promise.resolve())) : Promise.resolve();
|
|
10423
10503
|
}
|
|
10424
10504
|
}
|
|
10425
|
-
const
|
|
10505
|
+
const On = 0, Tc = 1, Sc = 2, Yr = 2, cs = 1.25, Zr = 1, ii = 6 * 4 + 4 + 4, Zi = 65535, Mc = Math.pow(2, -24), us = Symbol("SKIP_GENERATION");
|
|
10426
10506
|
function Cc(o) {
|
|
10427
10507
|
return o.index ? o.index.count : o.attributes.position.count;
|
|
10428
10508
|
}
|
|
@@ -10440,16 +10520,16 @@ function Rc(o, e) {
|
|
|
10440
10520
|
s[a] = a;
|
|
10441
10521
|
}
|
|
10442
10522
|
}
|
|
10443
|
-
function
|
|
10523
|
+
function zn(o) {
|
|
10444
10524
|
const e = zt(o), t = o.drawRange, i = t.start / 3, s = (t.start + t.count) / 3, a = Math.max(0, i), n = Math.min(e, s) - a;
|
|
10445
10525
|
return [{
|
|
10446
10526
|
offset: Math.floor(a),
|
|
10447
10527
|
count: Math.floor(n)
|
|
10448
10528
|
}];
|
|
10449
10529
|
}
|
|
10450
|
-
function
|
|
10530
|
+
function Un(o) {
|
|
10451
10531
|
if (!o.groups || !o.groups.length)
|
|
10452
|
-
return
|
|
10532
|
+
return zn(o);
|
|
10453
10533
|
const e = [], t = /* @__PURE__ */ new Set(), i = o.drawRange, s = i.start / 3, a = (i.start + i.count) / 3;
|
|
10454
10534
|
for (const c of o.groups) {
|
|
10455
10535
|
const u = c.start / 3, f = (c.start + c.count) / 3;
|
|
@@ -10465,10 +10545,10 @@ function zn(o) {
|
|
|
10465
10545
|
}
|
|
10466
10546
|
return e;
|
|
10467
10547
|
}
|
|
10468
|
-
function
|
|
10548
|
+
function Dc(o) {
|
|
10469
10549
|
if (o.groups.length === 0)
|
|
10470
10550
|
return !1;
|
|
10471
|
-
const e = zt(o), t =
|
|
10551
|
+
const e = zt(o), t = Un(o).sort((a, n) => a.offset - n.offset), i = t[t.length - 1];
|
|
10472
10552
|
i.count = Math.min(e - i.offset, i.count);
|
|
10473
10553
|
let s = 0;
|
|
10474
10554
|
return t.forEach(({ count: a }) => s += a), e !== s;
|
|
@@ -10480,12 +10560,12 @@ function hs(o, e, t, i, s) {
|
|
|
10480
10560
|
w < a && (a = w), A > u && (u = A), y < r && (r = y), y > m && (m = y);
|
|
10481
10561
|
const S = o[g + 2], C = o[g + 3], M = S - C, R = S + C;
|
|
10482
10562
|
M < n && (n = M), R > f && (f = R), S < l && (l = S), S > v && (v = S);
|
|
10483
|
-
const
|
|
10484
|
-
I < c && (c = I),
|
|
10563
|
+
const D = o[g + 4], T = o[g + 5], I = D - T, P = D + T;
|
|
10564
|
+
I < c && (c = I), P > d && (d = P), D < h && (h = D), D > p && (p = D);
|
|
10485
10565
|
}
|
|
10486
10566
|
i[0] = a, i[1] = n, i[2] = c, i[3] = u, i[4] = f, i[5] = d, s[0] = r, s[1] = l, s[2] = h, s[3] = m, s[4] = v, s[5] = p;
|
|
10487
10567
|
}
|
|
10488
|
-
function
|
|
10568
|
+
function Pc(o, e = null, t = null, i = null) {
|
|
10489
10569
|
const s = o.attributes.position, a = o.index ? o.index.array : null, n = zt(o), c = s.normalized;
|
|
10490
10570
|
let u;
|
|
10491
10571
|
e === null ? (u = new Float32Array(n * 6 * 4), t = 0, i = n) : (u = e, t = t || 0, i = i || n);
|
|
@@ -10513,7 +10593,7 @@ function Dc(o, e = null, t = null, i = null) {
|
|
|
10513
10593
|
function j(o, e, t) {
|
|
10514
10594
|
return t.min.x = e[o], t.min.y = e[o + 1], t.min.z = e[o + 2], t.max.x = e[o + 3], t.max.y = e[o + 4], t.max.z = e[o + 5], t;
|
|
10515
10595
|
}
|
|
10516
|
-
function
|
|
10596
|
+
function Xr(o) {
|
|
10517
10597
|
let e = -1, t = -1 / 0;
|
|
10518
10598
|
for (let i = 0; i < 3; i++) {
|
|
10519
10599
|
const s = o[i + 3] - o[i];
|
|
@@ -10521,10 +10601,10 @@ function Zr(o) {
|
|
|
10521
10601
|
}
|
|
10522
10602
|
return e;
|
|
10523
10603
|
}
|
|
10524
|
-
function
|
|
10604
|
+
function Kr(o, e) {
|
|
10525
10605
|
e.set(o);
|
|
10526
10606
|
}
|
|
10527
|
-
function
|
|
10607
|
+
function Jr(o, e, t) {
|
|
10528
10608
|
let i, s;
|
|
10529
10609
|
for (let a = 0; a < 3; a++) {
|
|
10530
10610
|
const n = a + 3;
|
|
@@ -10541,7 +10621,7 @@ function qt(o) {
|
|
|
10541
10621
|
const e = o[3] - o[0], t = o[4] - o[1], i = o[5] - o[2];
|
|
10542
10622
|
return 2 * (e * t + t * i + i * e);
|
|
10543
10623
|
}
|
|
10544
|
-
const
|
|
10624
|
+
const Ee = 32, Ec = (o, e) => o.candidate - e.candidate, je = new Array(Ee).fill().map(() => ({
|
|
10545
10625
|
count: 0,
|
|
10546
10626
|
bounds: new Float32Array(6),
|
|
10547
10627
|
rightCacheBounds: new Float32Array(6),
|
|
@@ -10550,17 +10630,17 @@ const De = 32, Ec = (o, e) => o.candidate - e.candidate, je = new Array(De).fill
|
|
|
10550
10630
|
})), _i = new Float32Array(6);
|
|
10551
10631
|
function Lc(o, e, t, i, s, a) {
|
|
10552
10632
|
let n = -1, c = 0;
|
|
10553
|
-
if (a ===
|
|
10554
|
-
n =
|
|
10633
|
+
if (a === On)
|
|
10634
|
+
n = Xr(e), n !== -1 && (c = (e[n] + e[n + 3]) / 2);
|
|
10555
10635
|
else if (a === Tc)
|
|
10556
|
-
n =
|
|
10636
|
+
n = Xr(o), n !== -1 && (c = Fc(t, i, s, n));
|
|
10557
10637
|
else if (a === Sc) {
|
|
10558
10638
|
const u = qt(o);
|
|
10559
10639
|
let f = cs * s;
|
|
10560
10640
|
const d = i * 6, r = (i + s) * 6;
|
|
10561
10641
|
for (let l = 0; l < 3; l++) {
|
|
10562
|
-
const h = e[l], p = (e[l + 3] - h) /
|
|
10563
|
-
if (s <
|
|
10642
|
+
const h = e[l], p = (e[l + 3] - h) / Ee;
|
|
10643
|
+
if (s < Ee / 4) {
|
|
10564
10644
|
const g = [...je];
|
|
10565
10645
|
g.length = s;
|
|
10566
10646
|
let _ = 0;
|
|
@@ -10594,13 +10674,13 @@ function Lc(o, e, t, i, s, a) {
|
|
|
10594
10674
|
const w = g[x], A = w.count, S = s - w.count, C = w.leftCacheBounds, M = w.rightCacheBounds;
|
|
10595
10675
|
let R = 0;
|
|
10596
10676
|
A !== 0 && (R = qt(C) / u);
|
|
10597
|
-
let
|
|
10598
|
-
S !== 0 && (
|
|
10599
|
-
const T =
|
|
10677
|
+
let D = 0;
|
|
10678
|
+
S !== 0 && (D = qt(M) / u);
|
|
10679
|
+
const T = Zr + cs * (R * A + D * S);
|
|
10600
10680
|
T < f && (n = l, f = T, c = w.candidate);
|
|
10601
10681
|
}
|
|
10602
10682
|
} else {
|
|
10603
|
-
for (let y = 0; y <
|
|
10683
|
+
for (let y = 0; y < Ee; y++) {
|
|
10604
10684
|
const x = je[y];
|
|
10605
10685
|
x.count = 0, x.candidate = h + p + y * p;
|
|
10606
10686
|
const w = x.bounds;
|
|
@@ -10609,25 +10689,25 @@ function Lc(o, e, t, i, s, a) {
|
|
|
10609
10689
|
}
|
|
10610
10690
|
for (let y = d; y < r; y += 6) {
|
|
10611
10691
|
let A = ~~((t[y + 2 * l] - h) / p);
|
|
10612
|
-
A >=
|
|
10692
|
+
A >= Ee && (A = Ee - 1);
|
|
10613
10693
|
const S = je[A];
|
|
10614
10694
|
S.count++, vi(y, t, S.bounds);
|
|
10615
10695
|
}
|
|
10616
|
-
const g = je[
|
|
10617
|
-
|
|
10618
|
-
for (let y =
|
|
10696
|
+
const g = je[Ee - 1];
|
|
10697
|
+
Kr(g.bounds, g.rightCacheBounds);
|
|
10698
|
+
for (let y = Ee - 2; y >= 0; y--) {
|
|
10619
10699
|
const x = je[y], w = je[y + 1];
|
|
10620
|
-
|
|
10700
|
+
Jr(x.bounds, w.rightCacheBounds, x.rightCacheBounds);
|
|
10621
10701
|
}
|
|
10622
10702
|
let _ = 0;
|
|
10623
|
-
for (let y = 0; y <
|
|
10703
|
+
for (let y = 0; y < Ee - 1; y++) {
|
|
10624
10704
|
const x = je[y], w = x.count, A = x.bounds, C = je[y + 1].rightCacheBounds;
|
|
10625
|
-
w !== 0 && (_ === 0 ?
|
|
10705
|
+
w !== 0 && (_ === 0 ? Kr(A, _i) : Jr(A, _i, _i)), _ += w;
|
|
10626
10706
|
let M = 0, R = 0;
|
|
10627
10707
|
_ !== 0 && (M = qt(_i) / u);
|
|
10628
|
-
const
|
|
10629
|
-
|
|
10630
|
-
const T =
|
|
10708
|
+
const D = s - _;
|
|
10709
|
+
D !== 0 && (R = qt(C) / u);
|
|
10710
|
+
const T = Zr + cs * (M * _ + R * D);
|
|
10631
10711
|
T < f && (n = l, f = T, c = x.candidate);
|
|
10632
10712
|
}
|
|
10633
10713
|
}
|
|
@@ -10704,25 +10784,25 @@ function _e(o) {
|
|
|
10704
10784
|
function ye(o, e) {
|
|
10705
10785
|
return e[o + 6];
|
|
10706
10786
|
}
|
|
10707
|
-
function
|
|
10787
|
+
function Hn(o, e) {
|
|
10708
10788
|
return e[o + 7];
|
|
10709
10789
|
}
|
|
10710
|
-
let
|
|
10790
|
+
let Wn, $t, Li, Vn;
|
|
10711
10791
|
const Oc = Math.pow(2, 32);
|
|
10712
10792
|
function Es(o) {
|
|
10713
10793
|
return "count" in o ? 1 : 1 + Es(o.left) + Es(o.right);
|
|
10714
10794
|
}
|
|
10715
10795
|
function zc(o, e, t) {
|
|
10716
|
-
return
|
|
10796
|
+
return Wn = new Float32Array(t), $t = new Uint32Array(t), Li = new Uint16Array(t), Vn = new Uint8Array(t), Ls(o, e);
|
|
10717
10797
|
}
|
|
10718
10798
|
function Ls(o, e) {
|
|
10719
10799
|
const t = o / 4, i = o / 2, s = "count" in e, a = e.boundingData;
|
|
10720
10800
|
for (let n = 0; n < 6; n++)
|
|
10721
|
-
|
|
10801
|
+
Wn[t + n] = a[n];
|
|
10722
10802
|
if (s)
|
|
10723
10803
|
if (e.buffer) {
|
|
10724
10804
|
const n = e.buffer;
|
|
10725
|
-
|
|
10805
|
+
Vn.set(new Uint8Array(n), o);
|
|
10726
10806
|
for (let c = o, u = o + n.byteLength; c < u; c += ii) {
|
|
10727
10807
|
const f = c / 2;
|
|
10728
10808
|
ae(f, Li) || ($t[c / 4 + 6] += t);
|
|
@@ -10767,14 +10847,14 @@ function Hc(o, e, t, i, s) {
|
|
|
10767
10847
|
const R = Lc(w.boundingData, C, e, A, S, u);
|
|
10768
10848
|
if (R.axis === -1)
|
|
10769
10849
|
return y(A + S), w.offset = A, w.count = S, w;
|
|
10770
|
-
const
|
|
10771
|
-
if (
|
|
10850
|
+
const D = m(r, h, e, A, S, R);
|
|
10851
|
+
if (D === A || D === A + S)
|
|
10772
10852
|
y(A + S), w.offset = A, w.count = S;
|
|
10773
10853
|
else {
|
|
10774
10854
|
w.splitAxis = R.axis;
|
|
10775
|
-
const T = new fs(), I = A,
|
|
10776
|
-
w.left = T, hs(e, I,
|
|
10777
|
-
const L = new fs(), F =
|
|
10855
|
+
const T = new fs(), I = A, P = D - A;
|
|
10856
|
+
w.left = T, hs(e, I, P, T.boundingData, p), x(T, I, P, p, M + 1);
|
|
10857
|
+
const L = new fs(), F = D, U = S - P;
|
|
10778
10858
|
w.right = L, hs(e, F, U, L.boundingData, p), x(L, F, U, p, M + 1);
|
|
10779
10859
|
}
|
|
10780
10860
|
return w;
|
|
@@ -10782,10 +10862,10 @@ function Hc(o, e, t, i, s) {
|
|
|
10782
10862
|
}
|
|
10783
10863
|
function Wc(o, e) {
|
|
10784
10864
|
const t = o.geometry;
|
|
10785
|
-
e.indirect && (o._indirectBuffer = Uc(t, e.useSharedArrayBuffer),
|
|
10865
|
+
e.indirect && (o._indirectBuffer = Uc(t, e.useSharedArrayBuffer), Dc(t) && !e.verbose && console.warn(
|
|
10786
10866
|
'MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.'
|
|
10787
10867
|
)), o._indirectBuffer || Rc(t, e);
|
|
10788
|
-
const i = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, s =
|
|
10868
|
+
const i = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, s = Pc(t), a = e.indirect ? zn(t) : Un(t);
|
|
10789
10869
|
o._roots = a.map((n) => {
|
|
10790
10870
|
const c = Hc(o, s, n.offset, n.count, e), u = Es(c), f = new i(ii * u);
|
|
10791
10871
|
return zc(0, c, f), f;
|
|
@@ -10869,7 +10949,7 @@ const Vc = function() {
|
|
|
10869
10949
|
}
|
|
10870
10950
|
};
|
|
10871
10951
|
}(), Nc = function() {
|
|
10872
|
-
const o = new b(), e = new b(), t = new Ns(), i = new
|
|
10952
|
+
const o = new b(), e = new b(), t = new Ns(), i = new Ue();
|
|
10873
10953
|
return function(a, n) {
|
|
10874
10954
|
const { radius: c, center: u } = a, { a: f, b: d, c: r } = n;
|
|
10875
10955
|
if (i.start = f, i.end = d, i.closestPointToPoint(u, !0, o).distanceTo(u) <= c || (i.start = f, i.end = r, i.closestPointToPoint(u, !0, o).distanceTo(u) <= c) || (i.start = d, i.end = r, i.closestPointToPoint(u, !0, o).distanceTo(u) <= c))
|
|
@@ -10905,7 +10985,7 @@ class Ce extends Kt {
|
|
|
10905
10985
|
}
|
|
10906
10986
|
}
|
|
10907
10987
|
Ce.prototype.closestPointToSegment = function() {
|
|
10908
|
-
const o = new b(), e = new b(), t = new
|
|
10988
|
+
const o = new b(), e = new b(), t = new Ue();
|
|
10909
10989
|
return function(s, a = null, n = null) {
|
|
10910
10990
|
const { start: c, end: u } = s, f = this.points;
|
|
10911
10991
|
let d, r = 1 / 0;
|
|
@@ -10917,7 +10997,7 @@ Ce.prototype.closestPointToSegment = function() {
|
|
|
10917
10997
|
};
|
|
10918
10998
|
}();
|
|
10919
10999
|
Ce.prototype.intersectsTriangle = function() {
|
|
10920
|
-
const o = new Ce(), e = new Array(3), t = new Array(3), i = new Ve(), s = new Ve(), a = new b(), n = new b(), c = new b(), u = new b(), f = new b(), d = new
|
|
11000
|
+
const o = new Ce(), e = new Array(3), t = new Array(3), i = new Ve(), s = new Ve(), a = new b(), n = new b(), c = new b(), u = new b(), f = new b(), d = new Ue(), r = new Ue(), l = new Ue(), h = new b();
|
|
10921
11001
|
function m(v, p, g) {
|
|
10922
11002
|
const _ = v.points;
|
|
10923
11003
|
let y = 0, x = -1;
|
|
@@ -10950,21 +11030,21 @@ Ce.prototype.intersectsTriangle = function() {
|
|
|
10950
11030
|
const w = this.satBounds, A = this.satAxes;
|
|
10951
11031
|
t[0] = p.a, t[1] = p.b, t[2] = p.c;
|
|
10952
11032
|
for (let M = 0; M < 4; M++) {
|
|
10953
|
-
const R = w[M],
|
|
10954
|
-
if (i.setFromPoints(
|
|
11033
|
+
const R = w[M], D = A[M];
|
|
11034
|
+
if (i.setFromPoints(D, t), R.isSeparated(i))
|
|
10955
11035
|
return !1;
|
|
10956
11036
|
}
|
|
10957
11037
|
const S = p.satBounds, C = p.satAxes;
|
|
10958
11038
|
e[0] = this.a, e[1] = this.b, e[2] = this.c;
|
|
10959
11039
|
for (let M = 0; M < 4; M++) {
|
|
10960
|
-
const R = S[M],
|
|
10961
|
-
if (i.setFromPoints(
|
|
11040
|
+
const R = S[M], D = C[M];
|
|
11041
|
+
if (i.setFromPoints(D, e), R.isSeparated(i))
|
|
10962
11042
|
return !1;
|
|
10963
11043
|
}
|
|
10964
11044
|
for (let M = 0; M < 4; M++) {
|
|
10965
11045
|
const R = A[M];
|
|
10966
|
-
for (let
|
|
10967
|
-
const T = C[
|
|
11046
|
+
for (let D = 0; D < 4; D++) {
|
|
11047
|
+
const T = C[D];
|
|
10968
11048
|
if (a.crossVectors(R, T), i.setFromPoints(a, e), s.setFromPoints(a, t), i.isSeparated(s))
|
|
10969
11049
|
return !1;
|
|
10970
11050
|
}
|
|
@@ -10985,8 +11065,8 @@ Ce.prototype.intersectsTriangle = function() {
|
|
|
10985
11065
|
let I = l.start;
|
|
10986
11066
|
l.start = l.end, l.end = I;
|
|
10987
11067
|
}
|
|
10988
|
-
const S = r.start.dot(c), C = r.end.dot(c), M = l.start.dot(c), R = l.end.dot(c),
|
|
10989
|
-
return S !== R && M !== C &&
|
|
11068
|
+
const S = r.start.dot(c), C = r.end.dot(c), M = l.start.dot(c), R = l.end.dot(c), D = C < M, T = S < R;
|
|
11069
|
+
return S !== R && M !== C && D === T ? !1 : (g && (f.subVectors(r.start, l.start), f.dot(c) > 0 ? g.start.copy(r.start) : g.start.copy(l.start), f.subVectors(r.end, l.end), f.dot(c) < 0 ? g.end.copy(r.end) : g.end.copy(l.end)), !0);
|
|
10990
11070
|
}
|
|
10991
11071
|
};
|
|
10992
11072
|
}();
|
|
@@ -10997,7 +11077,7 @@ Ce.prototype.distanceToPoint = function() {
|
|
|
10997
11077
|
};
|
|
10998
11078
|
}();
|
|
10999
11079
|
Ce.prototype.distanceToTriangle = function() {
|
|
11000
|
-
const o = new b(), e = new b(), t = ["a", "b", "c"], i = new
|
|
11080
|
+
const o = new b(), e = new b(), t = ["a", "b", "c"], i = new Ue(), s = new Ue();
|
|
11001
11081
|
return function(n, c = null, u = null) {
|
|
11002
11082
|
const f = c || u ? i : null;
|
|
11003
11083
|
if (this.intersectsTriangle(n, f))
|
|
@@ -11107,7 +11187,7 @@ re.prototype.distanceToPoint = function() {
|
|
|
11107
11187
|
};
|
|
11108
11188
|
}();
|
|
11109
11189
|
re.prototype.distanceToBox = function() {
|
|
11110
|
-
const o = ["x", "y", "z"], e = new Array(12).fill().map(() => new
|
|
11190
|
+
const o = ["x", "y", "z"], e = new Array(12).fill().map(() => new Ue()), t = new Array(12).fill().map(() => new Ue()), i = new b(), s = new b();
|
|
11111
11191
|
return function(n, c = 0, u = null, f = null) {
|
|
11112
11192
|
if (this.needsUpdate && this.update(), this.intersectsBox(n))
|
|
11113
11193
|
return (u || f) && (n.getCenter(s), this.closestPointToPoint(s, i), n.closestPointToPoint(i, s), u && u.copy(i), f && f.copy(s)), 0;
|
|
@@ -11126,8 +11206,8 @@ re.prototype.distanceToBox = function() {
|
|
|
11126
11206
|
for (let _ = 0; _ <= 1; _++) {
|
|
11127
11207
|
const y = (p + 1) % 3, x = (p + 2) % 3, w = g << y | _ << x, A = 1 << p | g << y | _ << x, S = h[w], C = h[A];
|
|
11128
11208
|
e[v].set(S, C);
|
|
11129
|
-
const R = o[p],
|
|
11130
|
-
|
|
11209
|
+
const R = o[p], D = o[y], T = o[x], I = t[v], P = I.start, L = I.end;
|
|
11210
|
+
P[R] = r[R], P[D] = g ? r[D] : l[D], P[T] = _ ? r[T] : l[D], L[R] = l[R], L[D] = g ? r[D] : l[D], L[T] = _ ? r[T] : l[D], v++;
|
|
11131
11211
|
}
|
|
11132
11212
|
for (let p = 0; p <= 1; p++)
|
|
11133
11213
|
for (let g = 0; g <= 1; g++)
|
|
@@ -11198,17 +11278,17 @@ function Fs(o, e, t, i, s = null, a = 0, n = 0) {
|
|
|
11198
11278
|
return j(o, c, $e), i(l, h, !1, n, a + o, $e);
|
|
11199
11279
|
} else {
|
|
11200
11280
|
let R = function(T) {
|
|
11201
|
-
const { uint16Array: I, uint32Array:
|
|
11281
|
+
const { uint16Array: I, uint32Array: P } = N;
|
|
11202
11282
|
let L = T * 2;
|
|
11203
11283
|
for (; !ae(L, I); )
|
|
11204
11284
|
T = _e(T), L = T * 2;
|
|
11205
|
-
return de(T,
|
|
11206
|
-
},
|
|
11207
|
-
const { uint16Array: I, uint32Array:
|
|
11285
|
+
return de(T, P);
|
|
11286
|
+
}, D = function(T) {
|
|
11287
|
+
const { uint16Array: I, uint32Array: P } = N;
|
|
11208
11288
|
let L = T * 2;
|
|
11209
11289
|
for (; !ae(L, I); )
|
|
11210
|
-
T = ye(T,
|
|
11211
|
-
return de(T,
|
|
11290
|
+
T = ye(T, P), L = T * 2;
|
|
11291
|
+
return de(T, P) + ve(L, I);
|
|
11212
11292
|
};
|
|
11213
11293
|
const l = _e(o), h = ye(o, f);
|
|
11214
11294
|
let m = l, v = h, p, g, _, y;
|
|
@@ -11220,9 +11300,9 @@ function Fs(o, e, t, i, s = null, a = 0, n = 0) {
|
|
|
11220
11300
|
_ || (_ = $e, j(m, c, _));
|
|
11221
11301
|
const x = ae(m * 2, u), w = t(_, x, p, n + 1, a + m);
|
|
11222
11302
|
let A;
|
|
11223
|
-
if (w ===
|
|
11224
|
-
const T = R(m),
|
|
11225
|
-
A = i(T,
|
|
11303
|
+
if (w === Yr) {
|
|
11304
|
+
const T = R(m), P = D(m) - T;
|
|
11305
|
+
A = i(T, P, !0, n + 1, a + m, _);
|
|
11226
11306
|
} else
|
|
11227
11307
|
A = w && Fs(
|
|
11228
11308
|
m,
|
|
@@ -11238,9 +11318,9 @@ function Fs(o, e, t, i, s = null, a = 0, n = 0) {
|
|
|
11238
11318
|
y = It, j(v, c, y);
|
|
11239
11319
|
const S = ae(v * 2, u), C = t(y, S, g, n + 1, a + v);
|
|
11240
11320
|
let M;
|
|
11241
|
-
if (C ===
|
|
11242
|
-
const T = R(v),
|
|
11243
|
-
M = i(T,
|
|
11321
|
+
if (C === Yr) {
|
|
11322
|
+
const T = R(v), P = D(v) - T;
|
|
11323
|
+
M = i(T, P, !0, n + 1, a + v, y);
|
|
11244
11324
|
} else
|
|
11245
11325
|
M = C && Fs(
|
|
11246
11326
|
v,
|
|
@@ -11273,10 +11353,10 @@ function Yc(o, e, t = {}, i = 0, s = 1 / 0) {
|
|
|
11273
11353
|
const f = Math.sqrt(c);
|
|
11274
11354
|
return t.point ? t.point.copy(ps) : t.point = ps.clone(), t.distance = f, t.faceIndex = u, t;
|
|
11275
11355
|
}
|
|
11276
|
-
const gt = /* @__PURE__ */ new b(), vt = /* @__PURE__ */ new b(), _t = /* @__PURE__ */ new b(), xi = /* @__PURE__ */ new z(), wi = /* @__PURE__ */ new z(), bi = /* @__PURE__ */ new z(),
|
|
11356
|
+
const gt = /* @__PURE__ */ new b(), vt = /* @__PURE__ */ new b(), _t = /* @__PURE__ */ new b(), xi = /* @__PURE__ */ new z(), wi = /* @__PURE__ */ new z(), bi = /* @__PURE__ */ new z(), $r = /* @__PURE__ */ new b(), en = /* @__PURE__ */ new b(), tn = /* @__PURE__ */ new b(), Ai = /* @__PURE__ */ new b();
|
|
11277
11357
|
function Zc(o, e, t, i, s, a, n, c) {
|
|
11278
11358
|
let u;
|
|
11279
|
-
if (a ===
|
|
11359
|
+
if (a === dn ? u = o.intersectTriangle(i, t, e, !0, s) : u = o.intersectTriangle(e, t, i, a !== oi, s), u === null)
|
|
11280
11360
|
return null;
|
|
11281
11361
|
const f = o.origin.distanceTo(s);
|
|
11282
11362
|
return f < n || f > c ? null : {
|
|
@@ -11288,7 +11368,7 @@ function Xc(o, e, t, i, s, a, n, c, u, f, d) {
|
|
|
11288
11368
|
gt.fromBufferAttribute(e, a), vt.fromBufferAttribute(e, n), _t.fromBufferAttribute(e, c);
|
|
11289
11369
|
const r = Zc(o, gt, vt, _t, Ai, u, f, d);
|
|
11290
11370
|
if (r) {
|
|
11291
|
-
i && (xi.fromBufferAttribute(i, a), wi.fromBufferAttribute(i, n), bi.fromBufferAttribute(i, c), r.uv = Kt.getInterpolation(Ai, gt, vt, _t, xi, wi, bi, new z())), s && (xi.fromBufferAttribute(s, a), wi.fromBufferAttribute(s, n), bi.fromBufferAttribute(s, c), r.uv1 = Kt.getInterpolation(Ai, gt, vt, _t, xi, wi, bi, new z())), t && (
|
|
11371
|
+
i && (xi.fromBufferAttribute(i, a), wi.fromBufferAttribute(i, n), bi.fromBufferAttribute(i, c), r.uv = Kt.getInterpolation(Ai, gt, vt, _t, xi, wi, bi, new z())), s && (xi.fromBufferAttribute(s, a), wi.fromBufferAttribute(s, n), bi.fromBufferAttribute(s, c), r.uv1 = Kt.getInterpolation(Ai, gt, vt, _t, xi, wi, bi, new z())), t && ($r.fromBufferAttribute(t, a), en.fromBufferAttribute(t, n), tn.fromBufferAttribute(t, c), r.normal = Kt.getInterpolation(Ai, gt, vt, _t, $r, en, tn, new b()), r.normal.dot(o.direction) > 0 && r.normal.multiplyScalar(-1));
|
|
11292
11372
|
const l = {
|
|
11293
11373
|
a,
|
|
11294
11374
|
b: n,
|
|
@@ -11349,9 +11429,9 @@ function eu(o, e = null) {
|
|
|
11349
11429
|
const g = n[l + 6], _ = c[v + 14];
|
|
11350
11430
|
let y = 1 / 0, x = 1 / 0, w = 1 / 0, A = -1 / 0, S = -1 / 0, C = -1 / 0;
|
|
11351
11431
|
for (let M = 3 * g, R = 3 * (g + _); M < R; M++) {
|
|
11352
|
-
let
|
|
11353
|
-
const T = s.getX(
|
|
11354
|
-
T < y && (y = T), T > A && (A = T), I < x && (x = I), I > S && (S = I),
|
|
11432
|
+
let D = i[M];
|
|
11433
|
+
const T = s.getX(D), I = s.getY(D), P = s.getZ(D);
|
|
11434
|
+
T < y && (y = T), T > A && (A = T), I < x && (x = I), I > S && (S = I), P < w && (w = P), P > C && (C = P);
|
|
11355
11435
|
}
|
|
11356
11436
|
return u[l + 0] !== y || u[l + 1] !== x || u[l + 2] !== w || u[l + 3] !== A || u[l + 4] !== S || u[l + 5] !== C ? (u[l + 0] = y, u[l + 1] = x, u[l + 2] = w, u[l + 3] = A, u[l + 4] = S, u[l + 5] = C, !0) : !1;
|
|
11357
11437
|
} else {
|
|
@@ -11361,12 +11441,12 @@ function eu(o, e = null) {
|
|
|
11361
11441
|
const C = w || A, M = w || S;
|
|
11362
11442
|
let R = !1;
|
|
11363
11443
|
C && (R = r(g, h, w));
|
|
11364
|
-
let
|
|
11365
|
-
M && (
|
|
11366
|
-
const T = R ||
|
|
11444
|
+
let D = !1;
|
|
11445
|
+
M && (D = r(_, h, w));
|
|
11446
|
+
const T = R || D;
|
|
11367
11447
|
if (T)
|
|
11368
11448
|
for (let I = 0; I < 3; I++) {
|
|
11369
|
-
const
|
|
11449
|
+
const P = g + I, L = _ + I, F = u[P], U = u[P + 3], G = u[L], Q = u[L + 3];
|
|
11370
11450
|
u[l + I] = F < G ? F : G, u[l + I + 3] = U > Q ? U : Q;
|
|
11371
11451
|
}
|
|
11372
11452
|
return T;
|
|
@@ -11432,7 +11512,7 @@ function Bs(o, e, t, i, s, a) {
|
|
|
11432
11512
|
const r = de(o, u), l = ve(f, c);
|
|
11433
11513
|
return Jc(e, t, i, r, l, s, a);
|
|
11434
11514
|
} else {
|
|
11435
|
-
const r =
|
|
11515
|
+
const r = Hn(o, u), l = nu[r], m = i.direction[l] >= 0;
|
|
11436
11516
|
let v, p;
|
|
11437
11517
|
m ? (v = _e(o), p = ye(o, u)) : (v = ye(o, u), p = _e(o));
|
|
11438
11518
|
const _ = st(v, n, i, s, a) ? Bs(v, e, t, i, s, a) : null;
|
|
@@ -11448,7 +11528,7 @@ function Bs(o, e, t, i, s, a) {
|
|
|
11448
11528
|
return _ && x ? _.distance <= x.distance ? _ : x : _ || x || null;
|
|
11449
11529
|
}
|
|
11450
11530
|
}
|
|
11451
|
-
const Ti = /* @__PURE__ */ new Y(), yt = /* @__PURE__ */ new Ce(), xt = /* @__PURE__ */ new Ce(), Qt = /* @__PURE__ */ new J(),
|
|
11531
|
+
const Ti = /* @__PURE__ */ new Y(), yt = /* @__PURE__ */ new Ce(), xt = /* @__PURE__ */ new Ce(), Qt = /* @__PURE__ */ new J(), sn = /* @__PURE__ */ new re(), Si = /* @__PURE__ */ new re();
|
|
11452
11532
|
function au(o, e, t, i) {
|
|
11453
11533
|
N.setBuffer(o._roots[e]);
|
|
11454
11534
|
const s = Os(0, o, t, i);
|
|
@@ -11457,7 +11537,7 @@ function au(o, e, t, i) {
|
|
|
11457
11537
|
function Os(o, e, t, i, s = null) {
|
|
11458
11538
|
const { float32Array: a, uint16Array: n, uint32Array: c } = N;
|
|
11459
11539
|
let u = o * 2;
|
|
11460
|
-
if (s === null && (t.boundingBox || t.computeBoundingBox(),
|
|
11540
|
+
if (s === null && (t.boundingBox || t.computeBoundingBox(), sn.set(t.boundingBox.min, t.boundingBox.max, i), s = sn), ae(u, n)) {
|
|
11461
11541
|
const d = e.geometry, r = d.index, l = d.attributes.position, h = t.index, m = t.attributes.position, v = de(o, c), p = ve(u, n);
|
|
11462
11542
|
if (Qt.copy(i).invert(), t.boundsTree)
|
|
11463
11543
|
return j(o, a, Si), Si.matrix.copy(Qt), Si.needsUpdate = !0, t.boundsTree.shapecast({
|
|
@@ -11498,12 +11578,12 @@ function fu(o, e, t, i = {}, s = {}, a = 0, n = 1 / 0) {
|
|
|
11498
11578
|
boundsTraverseOrder: (C) => Yt.distanceToBox(C),
|
|
11499
11579
|
intersectsBounds: (C, M, R) => R < _ && R < n,
|
|
11500
11580
|
intersectsRange: (C, M) => {
|
|
11501
|
-
for (let R = C,
|
|
11581
|
+
for (let R = C, D = C + M; R < D; R++) {
|
|
11502
11582
|
Z(h, 3 * R, r, d), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
|
|
11503
11583
|
for (let T = w, I = w + A; T < I; T++) {
|
|
11504
11584
|
Z(l, 3 * T, f, u), l.needsUpdate = !0;
|
|
11505
|
-
const
|
|
11506
|
-
if (
|
|
11585
|
+
const P = l.distanceToTriangle(h, m, p);
|
|
11586
|
+
if (P < _ && (v.copy(m), g && g.copy(p), _ = P, y = T, x = R), P < a)
|
|
11507
11587
|
return !0;
|
|
11508
11588
|
}
|
|
11509
11589
|
}
|
|
@@ -11513,7 +11593,7 @@ function fu(o, e, t, i = {}, s = {}, a = 0, n = 1 / 0) {
|
|
|
11513
11593
|
const S = zt(e);
|
|
11514
11594
|
for (let C = 0, M = S; C < M; C++) {
|
|
11515
11595
|
Z(h, 3 * C, r, d), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
|
|
11516
|
-
for (let R = w,
|
|
11596
|
+
for (let R = w, D = w + A; R < D; R++) {
|
|
11517
11597
|
Z(l, 3 * R, f, u), l.needsUpdate = !0;
|
|
11518
11598
|
const T = l.distanceToTriangle(h, m, p);
|
|
11519
11599
|
if (T < _ && (v.copy(m), g && g.copy(p), _ = T, y = R, x = C), T < a)
|
|
@@ -11538,12 +11618,12 @@ function du(o, e = null) {
|
|
|
11538
11618
|
const g = n[l + 6], _ = c[v + 14];
|
|
11539
11619
|
let y = 1 / 0, x = 1 / 0, w = 1 / 0, A = -1 / 0, S = -1 / 0, C = -1 / 0;
|
|
11540
11620
|
for (let M = g, R = g + _; M < R; M++) {
|
|
11541
|
-
const
|
|
11621
|
+
const D = 3 * o.resolveTriangleIndex(M);
|
|
11542
11622
|
for (let T = 0; T < 3; T++) {
|
|
11543
|
-
let I =
|
|
11623
|
+
let I = D + T;
|
|
11544
11624
|
I = i ? i[I] : I;
|
|
11545
|
-
const
|
|
11546
|
-
|
|
11625
|
+
const P = s.getX(I), L = s.getY(I), F = s.getZ(I);
|
|
11626
|
+
P < y && (y = P), P > A && (A = P), L < x && (x = L), L > S && (S = L), F < w && (w = F), F > C && (C = F);
|
|
11547
11627
|
}
|
|
11548
11628
|
}
|
|
11549
11629
|
return u[l + 0] !== y || u[l + 1] !== x || u[l + 2] !== w || u[l + 3] !== A || u[l + 4] !== S || u[l + 5] !== C ? (u[l + 0] = y, u[l + 1] = x, u[l + 2] = w, u[l + 3] = A, u[l + 4] = S, u[l + 5] = C, !0) : !1;
|
|
@@ -11554,12 +11634,12 @@ function du(o, e = null) {
|
|
|
11554
11634
|
const C = w || A, M = w || S;
|
|
11555
11635
|
let R = !1;
|
|
11556
11636
|
C && (R = r(g, h, w));
|
|
11557
|
-
let
|
|
11558
|
-
M && (
|
|
11559
|
-
const T = R ||
|
|
11637
|
+
let D = !1;
|
|
11638
|
+
M && (D = r(_, h, w));
|
|
11639
|
+
const T = R || D;
|
|
11560
11640
|
if (T)
|
|
11561
11641
|
for (let I = 0; I < 3; I++) {
|
|
11562
|
-
const
|
|
11642
|
+
const P = g + I, L = _ + I, F = u[P], U = u[P + 3], G = u[L], Q = u[L + 3];
|
|
11563
11643
|
u[l + I] = F < G ? F : G, u[l + I + 3] = U > Q ? U : Q;
|
|
11564
11644
|
}
|
|
11565
11645
|
return T;
|
|
@@ -11594,7 +11674,7 @@ function Us(o, e, t, i, s, a) {
|
|
|
11594
11674
|
const r = de(o, u), l = ve(f, c);
|
|
11595
11675
|
return iu(e, t, i, r, l, s, a);
|
|
11596
11676
|
} else {
|
|
11597
|
-
const r =
|
|
11677
|
+
const r = Hn(o, u), l = mu[r], m = i.direction[l] >= 0;
|
|
11598
11678
|
let v, p;
|
|
11599
11679
|
m ? (v = _e(o), p = ye(o, u)) : (v = ye(o, u), p = _e(o));
|
|
11600
11680
|
const _ = st(v, n, i, s, a) ? Us(v, e, t, i, s, a) : null;
|
|
@@ -11610,7 +11690,7 @@ function Us(o, e, t, i, s, a) {
|
|
|
11610
11690
|
return _ && x ? _.distance <= x.distance ? _ : x : _ || x || null;
|
|
11611
11691
|
}
|
|
11612
11692
|
}
|
|
11613
|
-
const Ci = /* @__PURE__ */ new Y(), wt = /* @__PURE__ */ new Ce(), bt = /* @__PURE__ */ new Ce(), Zt = /* @__PURE__ */ new J(),
|
|
11693
|
+
const Ci = /* @__PURE__ */ new Y(), wt = /* @__PURE__ */ new Ce(), bt = /* @__PURE__ */ new Ce(), Zt = /* @__PURE__ */ new J(), rn = /* @__PURE__ */ new re(), Ii = /* @__PURE__ */ new re();
|
|
11614
11694
|
function vu(o, e, t, i) {
|
|
11615
11695
|
N.setBuffer(o._roots[e]);
|
|
11616
11696
|
const s = Hs(0, o, t, i);
|
|
@@ -11619,7 +11699,7 @@ function vu(o, e, t, i) {
|
|
|
11619
11699
|
function Hs(o, e, t, i, s = null) {
|
|
11620
11700
|
const { float32Array: a, uint16Array: n, uint32Array: c } = N;
|
|
11621
11701
|
let u = o * 2;
|
|
11622
|
-
if (s === null && (t.boundingBox || t.computeBoundingBox(),
|
|
11702
|
+
if (s === null && (t.boundingBox || t.computeBoundingBox(), rn.set(t.boundingBox.min, t.boundingBox.max, i), s = rn), ae(u, n)) {
|
|
11623
11703
|
const d = e.geometry, r = d.index, l = d.attributes.position, h = t.index, m = t.attributes.position, v = de(o, c), p = ve(u, n);
|
|
11624
11704
|
if (Zt.copy(i).invert(), t.boundsTree)
|
|
11625
11705
|
return j(o, a, Ii), Ii.matrix.copy(Zt), Ii.needsUpdate = !0, t.boundsTree.shapecast({
|
|
@@ -11662,10 +11742,10 @@ function bu(o, e, t, i = {}, s = {}, a = 0, n = 1 / 0) {
|
|
|
11662
11742
|
boundsTraverseOrder: (C) => Xt.distanceToBox(C),
|
|
11663
11743
|
intersectsBounds: (C, M, R) => R < _ && R < n,
|
|
11664
11744
|
intersectsRange: (C, M) => {
|
|
11665
|
-
for (let R = C,
|
|
11745
|
+
for (let R = C, D = C + M; R < D; R++) {
|
|
11666
11746
|
const T = S.resolveTriangleIndex(R);
|
|
11667
11747
|
Z(h, 3 * T, r, d), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
|
|
11668
|
-
for (let I = w,
|
|
11748
|
+
for (let I = w, P = w + A; I < P; I++) {
|
|
11669
11749
|
const L = o.resolveTriangleIndex(I);
|
|
11670
11750
|
Z(l, 3 * L, f, u), l.needsUpdate = !0;
|
|
11671
11751
|
const F = l.distanceToTriangle(h, m, p);
|
|
@@ -11679,7 +11759,7 @@ function bu(o, e, t, i = {}, s = {}, a = 0, n = 1 / 0) {
|
|
|
11679
11759
|
const S = zt(e);
|
|
11680
11760
|
for (let C = 0, M = S; C < M; C++) {
|
|
11681
11761
|
Z(h, 3 * C, r, d), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
|
|
11682
|
-
for (let R = w,
|
|
11762
|
+
for (let R = w, D = w + A; R < D; R++) {
|
|
11683
11763
|
const T = o.resolveTriangleIndex(R);
|
|
11684
11764
|
Z(l, 3 * T, f, u), l.needsUpdate = !0;
|
|
11685
11765
|
const I = l.distanceToTriangle(h, m, p);
|
|
@@ -11756,8 +11836,8 @@ function Ae(o, e, t, i, s, a = 0, n = 0, c = 0, u = 0, f = null, d = !1) {
|
|
|
11756
11836
|
j(e, p, C), C.applyMatrix4(t);
|
|
11757
11837
|
const M = _e(o), R = ye(o, m);
|
|
11758
11838
|
j(M, h, At), j(R, h, Tt);
|
|
11759
|
-
const
|
|
11760
|
-
S =
|
|
11839
|
+
const D = C.intersectsBox(At), T = C.intersectsBox(Tt);
|
|
11840
|
+
S = D && Ae(
|
|
11761
11841
|
e,
|
|
11762
11842
|
M,
|
|
11763
11843
|
i,
|
|
@@ -11785,8 +11865,8 @@ function Ae(o, e, t, i, s, a = 0, n = 0, c = 0, u = 0, f = null, d = !1) {
|
|
|
11785
11865
|
} else {
|
|
11786
11866
|
const C = _e(e), M = ye(e, g);
|
|
11787
11867
|
j(C, p, vs), j(M, p, _s);
|
|
11788
|
-
const R = f.intersectsBox(vs),
|
|
11789
|
-
if (R &&
|
|
11868
|
+
const R = f.intersectsBox(vs), D = f.intersectsBox(_s);
|
|
11869
|
+
if (R && D)
|
|
11790
11870
|
S = Ae(
|
|
11791
11871
|
o,
|
|
11792
11872
|
C,
|
|
@@ -11830,8 +11910,8 @@ function Ae(o, e, t, i, s, a = 0, n = 0, c = 0, u = 0, f = null, d = !1) {
|
|
|
11830
11910
|
else {
|
|
11831
11911
|
const T = Xe.getPrimitive();
|
|
11832
11912
|
T.copy(vs).applyMatrix4(t);
|
|
11833
|
-
const I = _e(o),
|
|
11834
|
-
j(I, h, At), j(
|
|
11913
|
+
const I = _e(o), P = ye(o, m);
|
|
11914
|
+
j(I, h, At), j(P, h, Tt);
|
|
11835
11915
|
const L = T.intersectsBox(At), F = T.intersectsBox(Tt);
|
|
11836
11916
|
S = L && Ae(
|
|
11837
11917
|
C,
|
|
@@ -11847,7 +11927,7 @@ function Ae(o, e, t, i, s, a = 0, n = 0, c = 0, u = 0, f = null, d = !1) {
|
|
|
11847
11927
|
!d
|
|
11848
11928
|
) || F && Ae(
|
|
11849
11929
|
C,
|
|
11850
|
-
|
|
11930
|
+
P,
|
|
11851
11931
|
i,
|
|
11852
11932
|
t,
|
|
11853
11933
|
s,
|
|
@@ -11859,7 +11939,7 @@ function Ae(o, e, t, i, s, a = 0, n = 0, c = 0, u = 0, f = null, d = !1) {
|
|
|
11859
11939
|
!d
|
|
11860
11940
|
), Xe.releasePrimitive(T);
|
|
11861
11941
|
}
|
|
11862
|
-
else if (
|
|
11942
|
+
else if (D)
|
|
11863
11943
|
if (w)
|
|
11864
11944
|
S = Ae(
|
|
11865
11945
|
o,
|
|
@@ -11877,8 +11957,8 @@ function Ae(o, e, t, i, s, a = 0, n = 0, c = 0, u = 0, f = null, d = !1) {
|
|
|
11877
11957
|
else {
|
|
11878
11958
|
const T = Xe.getPrimitive();
|
|
11879
11959
|
T.copy(_s).applyMatrix4(t);
|
|
11880
|
-
const I = _e(o),
|
|
11881
|
-
j(I, h, At), j(
|
|
11960
|
+
const I = _e(o), P = ye(o, m);
|
|
11961
|
+
j(I, h, At), j(P, h, Tt);
|
|
11882
11962
|
const L = T.intersectsBox(At), F = T.intersectsBox(Tt);
|
|
11883
11963
|
S = L && Ae(
|
|
11884
11964
|
M,
|
|
@@ -11894,7 +11974,7 @@ function Ae(o, e, t, i, s, a = 0, n = 0, c = 0, u = 0, f = null, d = !1) {
|
|
|
11894
11974
|
!d
|
|
11895
11975
|
) || F && Ae(
|
|
11896
11976
|
M,
|
|
11897
|
-
|
|
11977
|
+
P,
|
|
11898
11978
|
i,
|
|
11899
11979
|
t,
|
|
11900
11980
|
s,
|
|
@@ -11909,8 +11989,8 @@ function Ae(o, e, t, i, s, a = 0, n = 0, c = 0, u = 0, f = null, d = !1) {
|
|
|
11909
11989
|
}
|
|
11910
11990
|
return S;
|
|
11911
11991
|
}
|
|
11912
|
-
const
|
|
11913
|
-
strategy:
|
|
11992
|
+
const Di = /* @__PURE__ */ new re(), nn = /* @__PURE__ */ new Y(), Su = {
|
|
11993
|
+
strategy: On,
|
|
11914
11994
|
maxDepth: 40,
|
|
11915
11995
|
maxLeafTris: 10,
|
|
11916
11996
|
useSharedArrayBuffer: !1,
|
|
@@ -12080,10 +12160,10 @@ class er {
|
|
|
12080
12160
|
}
|
|
12081
12161
|
/* Derived Cast Functions */
|
|
12082
12162
|
intersectsBox(e, t) {
|
|
12083
|
-
return
|
|
12163
|
+
return Di.set(e.min, e.max, t), Di.needsUpdate = !0, this.shapecast(
|
|
12084
12164
|
{
|
|
12085
|
-
intersectsBounds: (i) =>
|
|
12086
|
-
intersectsTriangle: (i) =>
|
|
12165
|
+
intersectsBounds: (i) => Di.intersectsBox(i),
|
|
12166
|
+
intersectsTriangle: (i) => Di.intersectsTriangle(i)
|
|
12087
12167
|
}
|
|
12088
12168
|
);
|
|
12089
12169
|
}
|
|
@@ -12117,7 +12197,7 @@ class er {
|
|
|
12117
12197
|
}
|
|
12118
12198
|
getBoundingBox(e) {
|
|
12119
12199
|
return e.makeEmpty(), this._roots.forEach((i) => {
|
|
12120
|
-
j(0, new Float32Array(i),
|
|
12200
|
+
j(0, new Float32Array(i), nn), e.union(nn);
|
|
12121
12201
|
}), e;
|
|
12122
12202
|
}
|
|
12123
12203
|
}
|
|
@@ -12408,20 +12488,20 @@ class Ru {
|
|
|
12408
12488
|
debugHelpers: !1,
|
|
12409
12489
|
size: c,
|
|
12410
12490
|
paused: l
|
|
12411
|
-
}, this.scene = t, this.renderer = e, this.buffer1Active = !1, this.dirLights = [], this.dirLightsHelpers = [], this.clearColor = new K(), this.clearAlpha = 0, this.progress = 0, this.discardMaterial = new
|
|
12491
|
+
}, this.scene = t, this.renderer = e, this.buffer1Active = !1, this.dirLights = [], this.dirLightsHelpers = [], this.clearColor = new K(), this.clearAlpha = 0, this.progress = 0, this.discardMaterial = new Pu(), this.lights = [], this.meshes = [], this.objectsToShow = [], this.autoHiddenObjects = [], this.objectsToShowSet = /* @__PURE__ */ new Set(), this.objectsToShowAncestors = /* @__PURE__ */ new Set(), this.framesDone = 0, this.fixedCamera = null, this.isRendering = !1, this.isZUp = Bt.DEFAULT_UP.z === 1, this.progShadowGrp = new ge(), this.progShadowGrp.name = "progressive_shadow_assets", this.scene.add(this.progShadowGrp), this.lightOrigin = new ge(), this.lightOrigin.name = "light_origin", this.isZUp ? this.lightOrigin.position.set(c, c, c * 1.5) : this.lightOrigin.position.set(c, c, c), this.progShadowGrp.add(this.lightOrigin), this.lightGroup = new ge(), this.lightGroup.name = "all_dir_lights", this.progShadowGrp.add(this.lightGroup);
|
|
12412
12492
|
const h = Math.PI;
|
|
12413
12493
|
for (let p = 0; p < n; p++) {
|
|
12414
|
-
const g = new
|
|
12494
|
+
const g = new co(16777215, h / n);
|
|
12415
12495
|
g.name = "dir_light_" + p, g.castShadow = !0, g.shadow.bias = a, g.shadow.camera.near = 0.1, g.shadow.camera.far = 50, g.shadow.camera.right = c / 2, g.shadow.camera.left = -c / 2, g.shadow.camera.top = c / 2, g.shadow.camera.bottom = -c / 2, g.shadow.mapSize.width = s, g.shadow.mapSize.height = s, this.dirLights.push(g), this.lightGroup.add(g);
|
|
12416
12496
|
}
|
|
12417
12497
|
const m = /(Android|iPad|iPhone|iPod)/g.test(navigator == null ? void 0 : navigator.userAgent) ? Se : pe;
|
|
12418
|
-
this.progressiveLightMap1 = new
|
|
12498
|
+
this.progressiveLightMap1 = new Oe(i, i, { type: m }), this.progressiveLightMap2 = new Oe(i, i, { type: m }), this.progressiveLightMap1.texture.colorSpace = lr, this.progressiveLightMap2.texture.colorSpace = lr, this.shadowCatcherMaterial = new Du({
|
|
12419
12499
|
map: this.progressiveLightMap2.texture,
|
|
12420
12500
|
transparent: !0,
|
|
12421
12501
|
opacity: 1
|
|
12422
12502
|
});
|
|
12423
12503
|
const v = new Oi(c, c);
|
|
12424
|
-
this.isZUp || v.rotateX(-Math.PI / 2), this.shadowCatcherMesh = new X(v, this.shadowCatcherMaterial), this.isZUp ? this.shadowCatcherMesh.position.z = 1e-3 : this.shadowCatcherMesh.position.y = 1e-3, this.shadowCatcherMesh.name = "shadowCatcherMesh", this.shadowCatcherMesh.receiveShadow = !0, this.progShadowGrp.add(this.shadowCatcherMesh), this.addObjectToShow(this.progShadowGrp), this.addObjectToShow(this.lightGroup), this.addObjectToShow(this.lightOrigin), this.addObjectToShow(this.shadowCatcherMesh), this.rebuildObjectsToShowAncestors(), this.debugHelpersGroup = new ge(), this.targetMat = new
|
|
12504
|
+
this.isZUp || v.rotateX(-Math.PI / 2), this.shadowCatcherMesh = new X(v, this.shadowCatcherMaterial), this.isZUp ? this.shadowCatcherMesh.position.z = 1e-3 : this.shadowCatcherMesh.position.y = 1e-3, this.shadowCatcherMesh.name = "shadowCatcherMesh", this.shadowCatcherMesh.receiveShadow = !0, this.progShadowGrp.add(this.shadowCatcherMesh), this.addObjectToShow(this.progShadowGrp), this.addObjectToShow(this.lightGroup), this.addObjectToShow(this.lightOrigin), this.addObjectToShow(this.shadowCatcherMesh), this.rebuildObjectsToShowAncestors(), this.debugHelpersGroup = new ge(), this.targetMat = new uo({ fog: !1 }), this.previousShadowMap = { value: this.progressiveLightMap1.texture }, this.averagingWindow = { value: u }, this.targetMat.onBeforeCompile = (p) => {
|
|
12425
12505
|
p.vertexShader = `varying vec2 vUv;
|
|
12426
12506
|
` + p.vertexShader.slice(0, -1) + "vUv = uv; gl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }";
|
|
12427
12507
|
const g = p.fragmentShader.indexOf("void main() {");
|
|
@@ -12458,10 +12538,10 @@ vec3 texelOld = texture2D(previousShadowMap, vUv).rgb;
|
|
|
12458
12538
|
);
|
|
12459
12539
|
this.isZUp ? t.position.z = this.params.size / 2 : t.position.y = this.params.size / 2;
|
|
12460
12540
|
for (const a of this.dirLights) {
|
|
12461
|
-
const n = new
|
|
12541
|
+
const n = new ho(a);
|
|
12462
12542
|
this.dirLightsHelpers.push(n);
|
|
12463
12543
|
}
|
|
12464
|
-
const i = this.isZUp ? new b(0, 0, 1) : new b(0, 1, 0), s = new
|
|
12544
|
+
const i = this.isZUp ? new b(0, 0, 1) : new b(0, 1, 0), s = new fo(new Ns(i, 1e-3), this.params.size, 16776960);
|
|
12465
12545
|
this.debugHelpersGroup.add(t, s, ...this.dirLightsHelpers);
|
|
12466
12546
|
}
|
|
12467
12547
|
e ? (this.progShadowGrp.add(this.debugHelpersGroup), this.dirLightsHelpers.forEach((t) => {
|
|
@@ -12614,14 +12694,14 @@ vec3 texelOld = texture2D(previousShadowMap, vUv).rgb;
|
|
|
12614
12694
|
}), this.debugHelpersGroup.clear(), this.debugHelpersGroup = null), this.progShadowGrp && (this.progShadowGrp.clear(), this.progShadowGrp = null), this.lightGroup && (this.lightGroup.clear(), this.lightGroup = null), this.lightOrigin && (this.lightOrigin.clear(), this.lightOrigin = null), this.lights = [], this.meshes = [], this.objectsToShow = [], this.autoHiddenObjects = [], this.objectsToShowSet = /* @__PURE__ */ new Set(), this.objectsToShowAncestors = /* @__PURE__ */ new Set(), this.scene = null, this.renderer = null, this.fixedCamera = null, this.clearColor = null, this.previousShadowMap = null, this.averagingWindow = null, this.params = null;
|
|
12615
12695
|
}
|
|
12616
12696
|
}
|
|
12617
|
-
function
|
|
12697
|
+
function Nn(o = {}, e, t, i = (s) => {
|
|
12618
12698
|
}) {
|
|
12619
12699
|
const s = class extends kt {
|
|
12620
12700
|
constructor(a = {}) {
|
|
12621
12701
|
const n = Object.entries(o);
|
|
12622
12702
|
super({
|
|
12623
12703
|
uniforms: n.reduce((c, [u, f]) => {
|
|
12624
|
-
const d =
|
|
12704
|
+
const d = po.clone({ [u]: { value: f } });
|
|
12625
12705
|
return {
|
|
12626
12706
|
...c,
|
|
12627
12707
|
...d
|
|
@@ -12639,7 +12719,7 @@ function Vn(o = {}, e, t, i = (s) => {
|
|
|
12639
12719
|
};
|
|
12640
12720
|
return s.key = Ye.generateUUID(), s;
|
|
12641
12721
|
}
|
|
12642
|
-
const
|
|
12722
|
+
const Du = Nn(
|
|
12643
12723
|
{
|
|
12644
12724
|
transparent: !0,
|
|
12645
12725
|
color: new K(0, 0, 0),
|
|
@@ -12667,8 +12747,8 @@ const Pu = Vn(
|
|
|
12667
12747
|
#include <tonemapping_fragment>
|
|
12668
12748
|
#include <colorspace_fragment>
|
|
12669
12749
|
}`
|
|
12670
|
-
),
|
|
12671
|
-
class Eu extends
|
|
12750
|
+
), Pu = Nn({}, "void main() { }", "void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard; }");
|
|
12751
|
+
class Eu extends He {
|
|
12672
12752
|
constructor(e) {
|
|
12673
12753
|
const t = document.createElement("div");
|
|
12674
12754
|
super(t), this._controls = e;
|
|
@@ -12719,7 +12799,7 @@ class Lu extends k.ShaderMaterial {
|
|
|
12719
12799
|
});
|
|
12720
12800
|
}
|
|
12721
12801
|
}
|
|
12722
|
-
class
|
|
12802
|
+
class on extends k.ShaderMaterial {
|
|
12723
12803
|
get negative() {
|
|
12724
12804
|
return this.uniforms.negative.value === -1;
|
|
12725
12805
|
}
|
|
@@ -12935,7 +13015,7 @@ class Bu {
|
|
|
12935
13015
|
inside: !1,
|
|
12936
13016
|
thickness: 30,
|
|
12937
13017
|
color: new k.Color("#e91e63")
|
|
12938
|
-
}, this._selectionLayer = 31, this._box = new k.Box3(), this._sphere = new k.Sphere(), this.renderer = e, this.scene = t, this.camera = i, (s == null ? void 0 : s.inside) !== void 0 && (this.params.inside = s.inside), (s == null ? void 0 : s.thickness) !== void 0 && (this.params.thickness = s.thickness), (s == null ? void 0 : s.color) !== void 0 && (this.params.color = new k.Color(s.color)), this.seedMaterial = new
|
|
13018
|
+
}, this._selectionLayer = 31, this._box = new k.Box3(), this._sphere = new k.Sphere(), this.renderer = e, this.scene = t, this.camera = i, (s == null ? void 0 : s.inside) !== void 0 && (this.params.inside = s.inside), (s == null ? void 0 : s.thickness) !== void 0 && (this.params.thickness = s.thickness), (s == null ? void 0 : s.color) !== void 0 && (this.params.color = new k.Color(s.color)), this.seedMaterial = new on(), this.seedMaterial.side = k.DoubleSide, this.seedModelMaterial = new on(), this.seedModelMaterial.side = k.DoubleSide, this.maskMaterial = new k.MeshBasicMaterial({
|
|
12939
13019
|
color: 16777215,
|
|
12940
13020
|
side: k.DoubleSide
|
|
12941
13021
|
}), this.maskMaterial.morphTargets = !0, this.targets = [
|
|
@@ -13085,8 +13165,8 @@ class Ou extends X {
|
|
|
13085
13165
|
super(s, a), this.position.z = -0.02;
|
|
13086
13166
|
}
|
|
13087
13167
|
}
|
|
13088
|
-
const zu = "https://cdn2.seer-group.com/libs/hdr/aristea_wreck_512.hdr", Uu = "https://cdn2.seer-group.com/libs/hdr/lightroom_14b_512.hdr", Hu = "https://cdn2.seer-group.com/libs/fonts.type.json", Eh = new
|
|
13089
|
-
class
|
|
13168
|
+
const zu = "https://cdn2.seer-group.com/libs/hdr/aristea_wreck_512.hdr", Uu = "https://cdn2.seer-group.com/libs/hdr/lightroom_14b_512.hdr", Hu = "https://cdn2.seer-group.com/libs/fonts.type.json", Eh = new bo(Hu);
|
|
13169
|
+
class an {
|
|
13090
13170
|
constructor(e) {
|
|
13091
13171
|
var t;
|
|
13092
13172
|
this._props = e, this.name = "", this._defaults = {
|
|
@@ -13102,7 +13182,7 @@ class on {
|
|
|
13102
13182
|
}
|
|
13103
13183
|
}
|
|
13104
13184
|
var Wu = /* @__PURE__ */ ((o) => (o[o.DEFAULT = 0] = "DEFAULT", o[o.CAN_INSTALL = 1] = "CAN_INSTALL", o))(Wu || {});
|
|
13105
|
-
const
|
|
13185
|
+
const ln = 0.15;
|
|
13106
13186
|
Bt.DEFAULT_UP.set(0, 0, 1);
|
|
13107
13187
|
let Mt, Fi = 0, Ws = 0;
|
|
13108
13188
|
const Vu = () => {
|
|
@@ -13110,13 +13190,13 @@ const Vu = () => {
|
|
|
13110
13190
|
}, Nu = new ni({ colorWrite: !1 });
|
|
13111
13191
|
class Lh {
|
|
13112
13192
|
constructor(e) {
|
|
13113
|
-
this.props = e, this.stats = new ti(), this.scene = new bs(), this.overlayScene = new bs(), this.renderer = new
|
|
13193
|
+
this.props = e, this.stats = new ti(), this.scene = new bs(), this.overlayScene = new bs(), this.renderer = new mo({
|
|
13114
13194
|
antialias: !0,
|
|
13115
13195
|
alpha: !0,
|
|
13116
13196
|
logarithmicDepthBuffer: !0,
|
|
13117
13197
|
powerPreference: "high-performance",
|
|
13118
13198
|
preserveDrawingBuffer: !0
|
|
13119
|
-
}), this.css2dRenderer = new
|
|
13199
|
+
}), this.css2dRenderer = new wo(), this.mousePos = new z(), this.mouseCoord = new z(), this.offset = new z(), this.size = new z(), this.amr = new Ac({ showSizeBox: !0, showController: !0 }), this._selectedForOutline = [], this._clock = new qi(!0), this._uiHiddenTime = this._clock.getElapsedTime(), this.camera = new Gi(
|
|
13120
13200
|
39.6,
|
|
13121
13201
|
window.innerWidth / window.innerHeight,
|
|
13122
13202
|
0.1,
|
|
@@ -13128,16 +13208,16 @@ class Lh {
|
|
|
13128
13208
|
-this.d,
|
|
13129
13209
|
0.1,
|
|
13130
13210
|
1e3
|
|
13131
|
-
), this._axisMoving = !1, this._container = new ge(), this._raycaster = new
|
|
13211
|
+
), this._axisMoving = !1, this._container = new ge(), this._raycaster = new go(), this._selected = [], this._pointerDownTimeout = 0, this._dragging = !1, this.maxSample = 1024 * 2, this.sampleCount = 0, this._usePathTracing = !1, this._fpsCache = [], this._fpsCacheMax = 20, this._emitter = new Ot(), this.sound = new sc(), this._rafId = null, this._destroyed = !1, this._ground = new X(
|
|
13132
13212
|
new Oi(100, 100),
|
|
13133
|
-
new
|
|
13213
|
+
new vo({
|
|
13134
13214
|
color: new K("#eee"),
|
|
13135
13215
|
metalness: 0.4,
|
|
13136
13216
|
roughness: 0.1,
|
|
13137
13217
|
clearcoat: 1,
|
|
13138
13218
|
clearcoatRoughness: 0.1
|
|
13139
13219
|
})
|
|
13140
|
-
), this._sciFiGrid = new Ou(18, 40), this._amrRender = new
|
|
13220
|
+
), this._sciFiGrid = new Ou(18, 40), this._amrRender = new Oe(1024, 1024, {
|
|
13141
13221
|
format: te,
|
|
13142
13222
|
type: Vs,
|
|
13143
13223
|
colorSpace: Bi,
|
|
@@ -13167,7 +13247,7 @@ class Lh {
|
|
|
13167
13247
|
this._pointerDownTimeout = window.setTimeout(u, 200);
|
|
13168
13248
|
}, this._detectTrackpad = () => {
|
|
13169
13249
|
Mt || typeof Mt < "u" || (Fi === 0 && (Ws = performance.now()), Fi++, performance.now() - Ws > 66 && (Fi > 5 ? Mt = !0 : Mt = !1, Mt ? this.controls.zoomSpeed = 0.2 : this.controls.zoomSpeed = 1, setTimeout(Vu, 2e3)));
|
|
13170
|
-
}, this.debounceForkHeightChange =
|
|
13250
|
+
}, this.debounceForkHeightChange = ac(() => {
|
|
13171
13251
|
var c;
|
|
13172
13252
|
(c = this._progressShadow) == null || c.recalculate();
|
|
13173
13253
|
}, 300), this.focusObjects = (c, u) => {
|
|
@@ -13186,13 +13266,13 @@ class Lh {
|
|
|
13186
13266
|
v(W);
|
|
13187
13267
|
return;
|
|
13188
13268
|
}
|
|
13189
|
-
const ce = ((sr = q.morphAttributes) == null ? void 0 : sr.position) || [], tr = W.morphTargetInfluences || [],
|
|
13269
|
+
const ce = ((sr = q.morphAttributes) == null ? void 0 : sr.position) || [], tr = W.morphTargetInfluences || [], Gn = ce.length > 0 && tr.length > 0;
|
|
13190
13270
|
for (let Ne = 0; Ne < me.count; Ne++) {
|
|
13191
13271
|
if (r.set(
|
|
13192
13272
|
me.getX(Ne),
|
|
13193
13273
|
me.getY(Ne),
|
|
13194
13274
|
me.getZ(Ne)
|
|
13195
|
-
),
|
|
13275
|
+
), Gn) {
|
|
13196
13276
|
l.set(0, 0, 0);
|
|
13197
13277
|
let Ki = 0;
|
|
13198
13278
|
for (let ht = 0; ht < ce.length; ht++) {
|
|
@@ -13245,25 +13325,25 @@ class Lh {
|
|
|
13245
13325
|
const q = W.dot(C), me = W.dot(M), ce = Math.sqrt(q * q + me * me);
|
|
13246
13326
|
R = Math.max(R, ce);
|
|
13247
13327
|
}), R = R / 2 + 0.4;
|
|
13248
|
-
const
|
|
13328
|
+
const D = this.camera.fov * Math.PI / 180, T = 2 * Math.atan(Math.tan(D / 2) * this.camera.aspect), I = R / Math.tan(T / 2), P = R / Math.tan(D / 2), L = Math.max(I, P), F = g.clone().add(x.multiplyScalar(L)), U = this.camera.position.clone(), G = this.controls.target.clone();
|
|
13249
13329
|
let Q = 500;
|
|
13250
13330
|
const ie = U.distanceTo(F) + G.distanceTo(y);
|
|
13251
13331
|
ie > 1e-3 && (Q = Math.min(1e3, Math.max(450, ie * 45))), this._animateCamera(U, F, G, y, Q);
|
|
13252
13332
|
}, this.focusSlots = (c) => {
|
|
13253
13333
|
var M, R;
|
|
13254
|
-
if (this.amr.slots.forEach((
|
|
13255
|
-
|
|
13334
|
+
if (this.amr.slots.forEach((D) => {
|
|
13335
|
+
D.focused = !1, D.hide();
|
|
13256
13336
|
}), !c.length)
|
|
13257
|
-
if (this._lastTarget.set(0, 0, this._lastTarget.z), this.amr.slots.forEach((
|
|
13258
|
-
|
|
13337
|
+
if (this._lastTarget.set(0, 0, this._lastTarget.z), this.amr.slots.forEach((D) => {
|
|
13338
|
+
D.show();
|
|
13259
13339
|
}), this.shadowMode = !1, this._focusRestoreView) {
|
|
13260
|
-
const
|
|
13340
|
+
const D = this._focusRestoreView;
|
|
13261
13341
|
this._focusRestoreView = void 0;
|
|
13262
|
-
const T = this.camera.position.clone(), I = this.controls.target.clone(),
|
|
13342
|
+
const T = this.camera.position.clone(), I = this.controls.target.clone(), P = D.position.clone(), L = D.target.clone();
|
|
13263
13343
|
let F = 500;
|
|
13264
|
-
const U = T.distanceTo(
|
|
13265
|
-
U > 1e-3 && (F = Math.min(1e3, Math.max(450, U * 45))), this._animateCamera(T,
|
|
13266
|
-
this.camera.up.copy(
|
|
13344
|
+
const U = T.distanceTo(P) + I.distanceTo(L);
|
|
13345
|
+
U > 1e-3 && (F = Math.min(1e3, Math.max(450, U * 45))), this._animateCamera(T, P, I, L, F, () => {
|
|
13346
|
+
this.camera.up.copy(D.up);
|
|
13267
13347
|
});
|
|
13268
13348
|
return;
|
|
13269
13349
|
} else {
|
|
@@ -13275,19 +13355,19 @@ class Lh {
|
|
|
13275
13355
|
target: new b(0, 0, this.controls.target.z),
|
|
13276
13356
|
up: this.camera.up.clone()
|
|
13277
13357
|
}), (R = this._fitAnimation) == null || R.stop(), this.shadowMode = !0;
|
|
13278
|
-
const u = c.flatMap((
|
|
13279
|
-
if (
|
|
13358
|
+
const u = c.flatMap((D) => {
|
|
13359
|
+
if (D.show(), D.focused = !0, !D.parent)
|
|
13280
13360
|
return [];
|
|
13281
13361
|
const T = new b();
|
|
13282
|
-
return
|
|
13362
|
+
return D.parent.getWorldPosition(T), [T];
|
|
13283
13363
|
});
|
|
13284
13364
|
if (!u.length)
|
|
13285
13365
|
return;
|
|
13286
|
-
const f = u.reduce((
|
|
13366
|
+
const f = u.reduce((D, T) => D.add(T), new b()).multiplyScalar(1 / u.length), d = this.controls.target.clone(), r = this.camera.position.clone().sub(d).normalize();
|
|
13287
13367
|
let l = 0;
|
|
13288
|
-
for (const
|
|
13289
|
-
const T =
|
|
13290
|
-
|
|
13368
|
+
for (const D of u) {
|
|
13369
|
+
const T = D.clone().sub(f), I = T.dot(r), P = Math.sqrt(Math.max(0, T.lengthSq() - I * I));
|
|
13370
|
+
P > l && (l = P);
|
|
13291
13371
|
}
|
|
13292
13372
|
l = l + 0.4;
|
|
13293
13373
|
const h = this.camera.fov * Math.PI / 180, m = 2 * Math.atan(Math.tan(h / 2) * this.camera.aspect), v = l / Math.tan(m / 2), p = l / Math.tan(h / 2), g = Math.max(v, p), _ = f.clone(), y = f.clone().add(r.clone().multiplyScalar(g < 1 ? 1 : g)), x = this.camera.position.clone(), w = d.clone(), A = { t: 0 };
|
|
@@ -13296,8 +13376,8 @@ class Lh {
|
|
|
13296
13376
|
C > 1e-3 && (S = Math.min(1e3, Math.max(450, C * 45))), this._lastTarget = _.clone(), this._fitAnimation = new Ui(A).to({ t: 1 }, S).easing(Je.Easing.Quadratic.InOut).onStart(() => {
|
|
13297
13377
|
this.controls.enabled = !1;
|
|
13298
13378
|
}).onUpdate(() => {
|
|
13299
|
-
const
|
|
13300
|
-
this.camera.position.lerpVectors(x, y,
|
|
13379
|
+
const D = A.t;
|
|
13380
|
+
this.camera.position.lerpVectors(x, y, D), this.controls.target.lerpVectors(w, _, D);
|
|
13301
13381
|
}).onComplete(() => {
|
|
13302
13382
|
this.controls.enabled = !0;
|
|
13303
13383
|
}).start();
|
|
@@ -13319,8 +13399,8 @@ class Lh {
|
|
|
13319
13399
|
];
|
|
13320
13400
|
let v = 0;
|
|
13321
13401
|
for (const T of m) {
|
|
13322
|
-
const I = T.dot(l),
|
|
13323
|
-
|
|
13402
|
+
const I = T.dot(l), P = Math.sqrt(Math.max(0, T.lengthSq() - I * I));
|
|
13403
|
+
P > v && (v = P);
|
|
13324
13404
|
}
|
|
13325
13405
|
v = v * 1.05;
|
|
13326
13406
|
const p = this.camera.fov * Math.PI / 180, g = 2 * Math.atan(Math.tan(p / 2) * this.camera.aspect), _ = v / Math.tan(g / 2), y = v / Math.tan(p / 2), x = Math.max(_, y), w = f.clone();
|
|
@@ -13330,8 +13410,8 @@ class Lh {
|
|
|
13330
13410
|
Math.max(u.x * 2, 5);
|
|
13331
13411
|
const C = this.camera.position.clone(), M = this.controls.target.clone();
|
|
13332
13412
|
let R = 600;
|
|
13333
|
-
const
|
|
13334
|
-
|
|
13413
|
+
const D = C.distanceTo(S) + M.distanceTo(d);
|
|
13414
|
+
D > 1e-3 && (R = Math.min(800, Math.max(650, D * 45))), this._animateCamera(C, S, M, d, R, () => {
|
|
13335
13415
|
this.shadowMode || (this._progressShadow.visible = !0, this._progressShadow.isFinished || this._progressShadow.recalculate());
|
|
13336
13416
|
}), this.controls.minDistance = Math.max(0.2, Math.min(x * 0.25, x - 0.1)), this.controls.maxDistance = x * 4;
|
|
13337
13417
|
}, this.resize = () => {
|
|
@@ -13362,9 +13442,9 @@ class Lh {
|
|
|
13362
13442
|
}
|
|
13363
13443
|
this.stats.end();
|
|
13364
13444
|
}
|
|
13365
|
-
}, this.stats.showPanel(0), this.hideState(), e.fov && (this.camera.fov = e.fov, this.camera.updateProjectionMatrix()),
|
|
13366
|
-
const { tiles: t } =
|
|
13367
|
-
this.pathTracer = new
|
|
13445
|
+
}, this.stats.showPanel(0), this.hideState(), e.fov && (this.camera.fov = e.fov, this.camera.updateProjectionMatrix()), Dn(Ft, this.renderer), this._ground.visible = !1, this.controls = new xo(this.camera, this.renderer.domElement), this.controls.enablePan = !0, this.controls.rotateSpeed = this.props.isMobile ? 0.6 : 0.5, this.controls.dampingFactor = ln, this.controls.enableDamping = !0, this.controls.maxDistance = 10, this.controls.minDistance = 1, this.controls.zoomSpeed = this.props.isMobile ? 0.3 : tc() ? 0.2 : 1, this._cameraPositionUI = new Eu(this.controls), this.renderer.setPixelRatio(window.devicePixelRatio || 1), this.renderer.autoClear = !0, this.renderer.toneMapping = _o, this.renderer.toneMappingExposure = 1.4, this.renderer.outputColorSpace = Bi, this.renderer.localClippingEnabled = !0, this.renderer.shadowMap.enabled = !0, this.css2dRenderer.domElement.style.pointerEvents = "none", this.css2dRenderer.domElement.style.position = "absolute", this.css2dRenderer.domElement.style.top = "0px", this.camera.position.set(10, -10, 5), this.camera.lookAt(new b());
|
|
13446
|
+
const { tiles: t } = nc();
|
|
13447
|
+
this.pathTracer = new yl(this.renderer), this.pathTracer.multipleImportanceSampling = !0, this.pathTracer.filterGlossyFactor = 0.6;
|
|
13368
13448
|
let i = window.devicePixelRatio;
|
|
13369
13449
|
i < 2 && (i = 2), this.pathTracer.renderScale = this.props.isMobile ? 1 : i, this.pathTracer.bounces = this.props.isMobile ? 8 : 10, this.pathTracer.transmissiveBounces = this.props.isMobile ? 1 : 3, this.pathTracer.tiles.set(t, t), this.pathTracer.minSamples = 10, this.pathTracer.dynamicLowRes = !0, this.pathTracer.lowResScale = 0.5, this.pathTracer.fadeDuration = 0;
|
|
13370
13450
|
const s = new Cu(e.workerUrl), a = typeof navigator < "u" ? navigator.hardwareConcurrency : 4;
|
|
@@ -13417,10 +13497,10 @@ class Lh {
|
|
|
13417
13497
|
})) : (this.renderer.toneMappingExposure = 1.4, this.scene.add(this._progressShadow.shadowCatcherMesh), this.pathTracer.renderToCanvas = !1, this.amr.logos.forEach((t) => {
|
|
13418
13498
|
var i;
|
|
13419
13499
|
(i = t.parent) == null || i.add(t.target);
|
|
13420
|
-
}), this.showAmrUI(), this.amr && this.amr.opacityCache !== void 0 ? (this.amr.bodyOpacity = this.amr.opacityCache, this.amr.opacityCache = void 0) : this.amr && (this.amr.bodyOpacity = 1), this.pathTracer.reset(), this._ground.visible = !1, this._envMap && (this.scene.background = this._envMap, this.scene.environment = this._envMap)), this._usePathTracing = e, this.controls.dampingFactor = e ? 1 :
|
|
13500
|
+
}), this.showAmrUI(), this.amr && this.amr.opacityCache !== void 0 ? (this.amr.bodyOpacity = this.amr.opacityCache, this.amr.opacityCache = void 0) : this.amr && (this.amr.bodyOpacity = 1), this.pathTracer.reset(), this._ground.visible = !1, this._envMap && (this.scene.background = this._envMap, this.scene.environment = this._envMap)), this._usePathTracing = e, this.controls.dampingFactor = e ? 1 : ln, this.sampleCount = 0;
|
|
13421
13501
|
}
|
|
13422
13502
|
get fpsAverage() {
|
|
13423
|
-
return
|
|
13503
|
+
return ec(this._fpsCache);
|
|
13424
13504
|
}
|
|
13425
13505
|
get mainCamera() {
|
|
13426
13506
|
return this._mainCamera;
|
|
@@ -13464,7 +13544,7 @@ class Lh {
|
|
|
13464
13544
|
}
|
|
13465
13545
|
_loadEnv() {
|
|
13466
13546
|
new cr().load(zu, (t) => {
|
|
13467
|
-
t.mapping = ki, this._envMap = t, this._usePathTracing || (this.scene.background = t, this.scene.backgroundBlurriness = 1, this.scene.backgroundIntensity = 1, this.scene.backgroundRotation = new
|
|
13547
|
+
t.mapping = ki, this._envMap = t, this._usePathTracing || (this.scene.background = t, this.scene.backgroundBlurriness = 1, this.scene.backgroundIntensity = 1, this.scene.backgroundRotation = new yo(Math.PI / 2, 0, Math.PI * 0.98 * 0.8), this.scene.environment = t, this.overlayScene.environment = t, this.scene.environmentRotation = this.scene.backgroundRotation, this.overlayScene.environmentRotation = this.scene.environmentRotation, this.scene.environmentIntensity = 1.4, this.overlayScene.environmentIntensity = this.scene.environmentIntensity), this.pathTracer.updateEnvironment();
|
|
13468
13548
|
}, () => {
|
|
13469
13549
|
}, () => {
|
|
13470
13550
|
});
|
|
@@ -13537,13 +13617,13 @@ class Lh {
|
|
|
13537
13617
|
}).capture(e);
|
|
13538
13618
|
}
|
|
13539
13619
|
clearAMR() {
|
|
13540
|
-
|
|
13620
|
+
De(this.overlayScene), this.amr.clean(), this.usePathTracing = !1;
|
|
13541
13621
|
}
|
|
13542
13622
|
async exportAMR() {
|
|
13543
13623
|
const e = this._container.clone(!0);
|
|
13544
13624
|
return e.traverse((t) => {
|
|
13545
13625
|
t.dispose && (t.dispose(), t.removeFromParent());
|
|
13546
|
-
}), await
|
|
13626
|
+
}), await uc.parseAsync(e, {
|
|
13547
13627
|
onlyVisible: !0,
|
|
13548
13628
|
binary: !0
|
|
13549
13629
|
});
|
|
@@ -13582,7 +13662,7 @@ class Lh {
|
|
|
13582
13662
|
const x = new b().crossVectors(g, _);
|
|
13583
13663
|
if (x.lengthSq() > 1e-3) {
|
|
13584
13664
|
x.normalize();
|
|
13585
|
-
const w = new
|
|
13665
|
+
const w = new fn().setFromAxisAngle(x, y * f), A = g.clone().applyQuaternion(w);
|
|
13586
13666
|
p = d.clone().add(A.multiplyScalar(v));
|
|
13587
13667
|
} else
|
|
13588
13668
|
p = d.clone().add(g.multiplyScalar(v));
|
|
@@ -13623,7 +13703,7 @@ class Lh {
|
|
|
13623
13703
|
var t, i, s, a, n, c;
|
|
13624
13704
|
this._destroyed = !0, this._rafId !== null && (cancelAnimationFrame(this._rafId), this._rafId = null), this._clock.stop(), (t = this._controlsGizmo) == null || t.destroy(), this.amr.destroy(), this.amr.removeFromParent(), this._progressShadow.destroy(), (i = this._sciFiGrid) == null || i.removeFromParent(), (s = this._sciFiGrid) == null || s.geometry.dispose(), (a = this._sciFiGrid.material) == null || a.dispose(), Je.removeAll(), this.stats.dom.remove(), this._emitter.removeAllListeners(), (n = this._fitAnimation) == null || n.stop(), window.removeEventListener("drag", this._drag), document.removeEventListener("wheel", this._detectTrackpad), window.removeEventListener("pointermove", this._pointermove), this.renderer.domElement.removeEventListener("pointerdown", this._pointerdown);
|
|
13625
13705
|
const e = this.renderer.domElement.parentElement;
|
|
13626
|
-
e && ((c = this._resizeObserver) == null || c.unobserve(e)), this.controls.dispose(), this.renderer.domElement.remove(), this.renderer.dispose(),
|
|
13706
|
+
e && ((c = this._resizeObserver) == null || c.unobserve(e)), this.controls.dispose(), this.renderer.domElement.remove(), this.renderer.dispose(), De(this.scene), this.scene.clear();
|
|
13627
13707
|
}
|
|
13628
13708
|
}
|
|
13629
13709
|
class Gu {
|
|
@@ -13637,7 +13717,7 @@ class Gu {
|
|
|
13637
13717
|
throw new Error("TriViewCapture: subject is required.");
|
|
13638
13718
|
const s = new z();
|
|
13639
13719
|
t.getSize(s);
|
|
13640
|
-
const a = ((m = e == null ? void 0 : e.size) == null ? void 0 : m.width) ?? Math.round(s.x), n = ((v = e == null ? void 0 : e.size) == null ? void 0 : v.height) ?? Math.round(s.y), c = (e == null ? void 0 : e.margin) ?? 0.15, u = (e == null ? void 0 : e.includeOverlay) ?? !1, f = a / n || 1, d = this.resolveViews(e == null ? void 0 : e.views), r = new
|
|
13720
|
+
const a = ((m = e == null ? void 0 : e.size) == null ? void 0 : m.width) ?? Math.round(s.x), n = ((v = e == null ? void 0 : e.size) == null ? void 0 : v.height) ?? Math.round(s.y), c = (e == null ? void 0 : e.margin) ?? 0.15, u = (e == null ? void 0 : e.includeOverlay) ?? !1, f = a / n || 1, d = this.resolveViews(e == null ? void 0 : e.views), r = new Oe(a, n, {
|
|
13641
13721
|
format: te,
|
|
13642
13722
|
type: Vs
|
|
13643
13723
|
});
|
|
@@ -13718,19 +13798,19 @@ class Gu {
|
|
|
13718
13798
|
if (Math.abs(u.dot(c)) > 0.999 && (u.set(0, 0, 1), Math.abs(u.dot(c)) > 0.999 && u.set(0, 1, 0)), (t.mode ?? "orthographic") === "perspective") {
|
|
13719
13799
|
const x = this.perspectiveCamera, w = t.fov ?? 45, A = Ye.degToRad(w), S = Math.max(Math.tan(A / 2), 1e-4), C = Math.max(S * (i || 1), 1e-4), M = this.getPerspectiveDirection(t, e.size).normalize(), R = new b().crossVectors(M, u).normalize();
|
|
13720
13800
|
R.lengthSq() < 1e-6 && R.set(1, 0, 0);
|
|
13721
|
-
const
|
|
13722
|
-
new b(-T, -I, -
|
|
13723
|
-
new b(-T, -I,
|
|
13724
|
-
new b(-T, I, -
|
|
13725
|
-
new b(-T, I,
|
|
13726
|
-
new b(T, -I, -
|
|
13727
|
-
new b(T, -I,
|
|
13728
|
-
new b(T, I, -
|
|
13729
|
-
new b(T, I,
|
|
13801
|
+
const D = new b().crossVectors(R, M).normalize(), T = Math.max(e.size.x * 0.5, 1e-4), I = Math.max(e.size.y * 0.5, 1e-4), P = Math.max(e.size.z * 0.5, 1e-4), L = [
|
|
13802
|
+
new b(-T, -I, -P),
|
|
13803
|
+
new b(-T, -I, P),
|
|
13804
|
+
new b(-T, I, -P),
|
|
13805
|
+
new b(-T, I, P),
|
|
13806
|
+
new b(T, -I, -P),
|
|
13807
|
+
new b(T, -I, P),
|
|
13808
|
+
new b(T, I, -P),
|
|
13809
|
+
new b(T, I, P)
|
|
13730
13810
|
];
|
|
13731
13811
|
let F = 0, U = -1 / 0;
|
|
13732
13812
|
for (const ie of L) {
|
|
13733
|
-
const se = R.dot(ie), W =
|
|
13813
|
+
const se = R.dot(ie), W = D.dot(ie), q = M.dot(ie);
|
|
13734
13814
|
U = Math.max(U, q);
|
|
13735
13815
|
const me = q + Math.abs(se) / C, ce = q + Math.abs(W) / S;
|
|
13736
13816
|
F = Math.max(F, me, ce);
|
|
@@ -13742,7 +13822,7 @@ class Gu {
|
|
|
13742
13822
|
const se = M.dot(ie), W = G - se;
|
|
13743
13823
|
W > 1e-3 && (Q = Math.min(Q, W));
|
|
13744
13824
|
}
|
|
13745
|
-
return x.fov = w, x.aspect = i || a / Math.max(n, 1), x.near = Math.max(0.1, Number.isFinite(Q) ? Q * 0.5 : G * 0.1), x.far = Math.max(x.near + 1, G + e.sphere.radius * 3), x.position.copy(e.center).add(M.clone().multiplyScalar(G)), x.up.copy(
|
|
13825
|
+
return x.fov = w, x.aspect = i || a / Math.max(n, 1), x.near = Math.max(0.1, Number.isFinite(Q) ? Q * 0.5 : G * 0.1), x.far = Math.max(x.near + 1, G + e.sphere.radius * 3), x.position.copy(e.center).add(M.clone().multiplyScalar(G)), x.up.copy(D), x.lookAt(e.center), x.updateProjectionMatrix(), x.updateMatrixWorld(!0), x;
|
|
13746
13826
|
}
|
|
13747
13827
|
const d = this.orthoCamera, r = e.size, l = e.center, h = Math.max(r[t.plane.width] * 0.5, 0.01), m = Math.max(r[t.plane.height] * 0.5, 0.01), v = Math.max(r[t.plane.depth] * 0.5, 0.01);
|
|
13748
13828
|
let p = h * (1 + s), g = m * (1 + s);
|
|
@@ -13814,7 +13894,7 @@ class Gu {
|
|
|
13814
13894
|
return this.canvas || (this.canvas = document.createElement("canvas")), (this.canvas.width !== e || this.canvas.height !== t) && (this.canvas.width = e, this.canvas.height = t), this.canvas;
|
|
13815
13895
|
}
|
|
13816
13896
|
}
|
|
13817
|
-
const qu = "shop-components", ju = "0.4.
|
|
13897
|
+
const qu = "shop-components", ju = "0.4.10", Qu = "Shop components", Yu = "dist/shop-components.umd.js", Zu = "dist/shop-components.mjs", Xu = "dist/main.d.ts", Ku = {
|
|
13818
13898
|
dts: "tsc --emitDeclarationOnly & tsc & storybook build -o dist",
|
|
13819
13899
|
dev: "vite dev",
|
|
13820
13900
|
build: "vite build",
|
|
@@ -13863,16 +13943,16 @@ const qu = "shop-components", ju = "0.4.8", Qu = "Shop components", Yu = "dist/s
|
|
|
13863
13943
|
resolutions: sh,
|
|
13864
13944
|
dependencies: rh
|
|
13865
13945
|
};
|
|
13866
|
-
function
|
|
13946
|
+
function cn() {
|
|
13867
13947
|
const o = "Nebular Engin", e = nh.version, t = `%c ${o} %c v${e} `;
|
|
13868
13948
|
console.log(t, "background:#111827;color:#ffffff;padding:4px 10px;border-radius:4px 0 0 4px;font-weight:700;", "background:#10B981;color:#ffffff;padding:4px 10px;border-radius:0 4px 4px 0;font-weight:700;");
|
|
13869
13949
|
}
|
|
13870
|
-
const
|
|
13950
|
+
const un = "__SHOP_COMPONENTS_BANNER_PRINTED__";
|
|
13871
13951
|
try {
|
|
13872
13952
|
const o = globalThis;
|
|
13873
|
-
o[
|
|
13953
|
+
o[un] || (o[un] = !0, cn());
|
|
13874
13954
|
} catch {
|
|
13875
|
-
|
|
13955
|
+
cn();
|
|
13876
13956
|
}
|
|
13877
13957
|
export {
|
|
13878
13958
|
Ac as Amr,
|
|
@@ -13880,20 +13960,20 @@ export {
|
|
|
13880
13960
|
Hi as SGLBLoader,
|
|
13881
13961
|
$ as SLOT_EVENTS,
|
|
13882
13962
|
Lh as Scene3D,
|
|
13883
|
-
|
|
13963
|
+
an as Skin,
|
|
13884
13964
|
Vr as Slot,
|
|
13885
13965
|
Wu as SlotState,
|
|
13886
13966
|
Gu as TriViewCapture,
|
|
13887
13967
|
Br as arrayBufferToUrl,
|
|
13888
|
-
|
|
13968
|
+
ec as calculateArrayAverage,
|
|
13889
13969
|
Ih as calculateFocalLength,
|
|
13890
|
-
|
|
13970
|
+
Ph as createSGLBFile,
|
|
13891
13971
|
Ch as downloadBlob,
|
|
13892
|
-
|
|
13972
|
+
Dh as dracoExporter,
|
|
13893
13973
|
Eh as font,
|
|
13894
|
-
|
|
13974
|
+
uc as gltfExporter,
|
|
13895
13975
|
Ft as gltfLoader,
|
|
13896
13976
|
Or as imageBitmapToUrl,
|
|
13897
|
-
|
|
13898
|
-
|
|
13977
|
+
tc as isAppleDevice,
|
|
13978
|
+
Bn as textureLoader
|
|
13899
13979
|
};
|