shop-components 0.4.28 → 0.4.30
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 +2 -0
- package/dist/dev/src/scene.d.ts +1 -0
- package/dist/shop-components.cjs +4 -4
- package/dist/shop-components.mjs +726 -700
- package/package.json +1 -1
package/dist/shop-components.mjs
CHANGED
|
@@ -10,26 +10,26 @@ var j = (a, e, t) => (vr(a, e, "read from private field"), t ? t.call(a) : e.get
|
|
|
10
10
|
e instanceof WeakSet ? e.add(a) : e.set(a, t);
|
|
11
11
|
}, Fe = (a, e, t, i) => (vr(a, e, "write to private field"), i ? i.call(a, t) : e.set(a, t), t);
|
|
12
12
|
import * as W from "three";
|
|
13
|
-
import { BufferAttribute as ve, BufferGeometry as re, Matrix4 as te, Matrix3 as In, Vector3 as b, Vector4 as ht, MeshBasicMaterial as ze, Mesh as q, ShaderMaterial as Gt, NoBlending as di, WebGLRenderTarget as je, FloatType as xe, RGBAFormat as le, NearestFilter as ae, Vector2 as G, PerspectiveCamera as ss, DataUtils as Ge, DataTexture as qe, HalfFloatType as
|
|
13
|
+
import { BufferAttribute as ve, BufferGeometry as re, Matrix4 as te, Matrix3 as In, Vector3 as b, Vector4 as ht, MeshBasicMaterial as ze, Mesh as q, ShaderMaterial as Gt, NoBlending as di, WebGLRenderTarget as je, FloatType as xe, RGBAFormat as le, NearestFilter as ae, Vector2 as G, PerspectiveCamera as ss, DataUtils as Ge, DataTexture as qe, HalfFloatType as De, LinearFilter as Ie, RepeatWrapping as ct, RedFormat as Fs, ClampToEdgeWrapping as Ze, Source as po, Quaternion as ee, DataArrayTexture as mo, DoubleSide as gi, BackSide as Dn, FrontSide as Bs, Color as X, WebGLArrayRenderTarget as go, UnsignedByteType as nr, NoToneMapping as _o, RGFormat as vo, NormalBlending as Pn, Spherical as yo, EquirectangularReflectionMapping as Xi, LinearMipMapLinearFilter as xo, Clock as rs, Scene as Os, AdditiveBlending as wo, Box3 as J, Sphere as ns, CompressedTexture as bo, Texture as rt, InterleavedBuffer as Ao, InterleavedBufferAttribute as To, TextureLoader as En, MeshStandardMaterial as ji, Group as Pe, LineSegments as zs, LineBasicMaterial as Ws, Object3D as Ee, LineDashedMaterial as Us, RingGeometry as yr, BoxGeometry as So, EdgesGeometry as Mo, SRGBColorSpace as pi, Raycaster as Rn, CircleGeometry as xr, TorusGeometry as wr, OctahedronGeometry as Co, Float32BufferAttribute as Io, Line as Do, EventDispatcher as Po, PlaneGeometry as mi, AxesHelper as cs, AnimationMixer as br, VideoTexture as Eo, LinearMipmapLinearFilter as Ro, MathUtils as Qe, LoopRepeat as Lo, LoopOnce as ko, Plane as or, Line3 as Ye, Triangle as oi, DirectionalLight as Fo, NoColorSpace as Ar, MeshLambertMaterial as Bo, DirectionalLightHelper as Oo, PlaneHelper as zo, UniformsUtils as Wo, WebGLRenderer as Uo, OrthographicCamera as Hs, MeshPhysicalMaterial as Ho, ACESFilmicToneMapping as No, Euler as Vo } from "three";
|
|
14
14
|
import { HDRLoader as Tr } from "three/examples/jsm/loaders/HDRLoader.js";
|
|
15
|
-
import { OrbitControls as
|
|
16
|
-
import { CSS2DObject as Ke, CSS2DRenderer as
|
|
17
|
-
import { Font as
|
|
15
|
+
import { OrbitControls as Go } from "three/examples/jsm/controls/OrbitControls";
|
|
16
|
+
import { CSS2DObject as Ke, CSS2DRenderer as Qo } from "three/examples/jsm/renderers/CSS2DRenderer";
|
|
17
|
+
import { Font as jo } from "three/examples/jsm/loaders/FontLoader";
|
|
18
18
|
import { GLTFLoader as ar } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
19
19
|
import "three/examples/jsm/libs/meshopt_decoder.module.js";
|
|
20
20
|
import "three/examples/jsm/loaders/DRACOLoader.js";
|
|
21
|
-
import { GLTFLoader as
|
|
22
|
-
import { DRACOLoader as
|
|
23
|
-
import { DRACOExporter as
|
|
24
|
-
import { GLTFExporter as
|
|
21
|
+
import { GLTFLoader as qo } from "three/examples/jsm/loaders/GLTFLoader";
|
|
22
|
+
import { DRACOLoader as Yo } from "three/examples/jsm/loaders/DRACOLoader";
|
|
23
|
+
import { DRACOExporter as Ko } from "three/examples/jsm/exporters/DRACOExporter";
|
|
24
|
+
import { GLTFExporter as Zo } from "three/examples/jsm/exporters/GLTFExporter";
|
|
25
25
|
import * as hs from "three/examples/jsm/utils/SkeletonUtils.js";
|
|
26
26
|
import { Line2 as Ln } from "three/examples/jsm/lines/Line2.js";
|
|
27
27
|
import { LineMaterial as kn } from "three/examples/jsm/lines/LineMaterial.js";
|
|
28
28
|
import { LineGeometry as Ns } from "three/examples/jsm/lines/LineGeometry.js";
|
|
29
|
-
import { CSS3DObject as
|
|
29
|
+
import { CSS3DObject as Xo } from "three/examples/jsm/renderers/CSS3DRenderer";
|
|
30
30
|
import "three/examples/jsm/utils/BufferGeometryUtils";
|
|
31
31
|
import { FullScreenQuad as wi } from "three/examples/jsm/postprocessing/Pass";
|
|
32
|
-
import { SAH as
|
|
32
|
+
import { SAH as Jo, MeshBVH as $o, FloatVertexAttributeTexture as ea, MeshBVHUniformStruct as ta, UIntVertexAttributeTexture as ia, BVHShaderGLSL as us } from "three-mesh-bvh";
|
|
33
33
|
import { FullScreenQuad as Ht } from "three/examples/jsm/postprocessing/Pass.js";
|
|
34
34
|
function Fn(a, e, t = 0) {
|
|
35
35
|
if (a.isInterleavedBufferAttribute) {
|
|
@@ -55,7 +55,7 @@ function kt(a, e) {
|
|
|
55
55
|
const t = a.count === e.count, i = a.normalized === e.normalized, s = a.array.constructor === e.array.constructor, r = a.itemSize === e.itemSize;
|
|
56
56
|
return !(!t || !i || !s || !r);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function sa(a) {
|
|
59
59
|
const e = a[0].index !== null, t = new Set(Object.keys(a[0].attributes));
|
|
60
60
|
if (!a[0].getAttribute("position"))
|
|
61
61
|
throw new Error("StaticGeometryGenerator: position attribute is required.");
|
|
@@ -73,34 +73,34 @@ function ia(a) {
|
|
|
73
73
|
throw new Error("StaticGeometryGenerator: All geometries must have the same number of attributes.");
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function ra(a) {
|
|
77
77
|
let e = 0;
|
|
78
78
|
for (let t = 0, i = a.length; t < i; t++)
|
|
79
79
|
e += a[t].getIndex().count;
|
|
80
80
|
return e;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function na(a) {
|
|
83
83
|
let e = 0;
|
|
84
84
|
for (let t = 0, i = a.length; t < i; t++)
|
|
85
85
|
e += a[t].getAttribute("position").count;
|
|
86
86
|
return e;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function oa(a, e, t) {
|
|
89
89
|
a.index && a.index.count !== e && a.setIndex(null);
|
|
90
90
|
const i = a.attributes;
|
|
91
91
|
for (const s in i)
|
|
92
92
|
i[s].count !== t && a.deleteAttribute(s);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function aa(a, e = {}, t = new re()) {
|
|
95
95
|
const {
|
|
96
96
|
useGroups: i = !1,
|
|
97
97
|
forceUpdate: s = !1,
|
|
98
98
|
skipAssigningAttributes: r = [],
|
|
99
99
|
overwriteIndex: o = !0
|
|
100
100
|
} = e;
|
|
101
|
-
|
|
102
|
-
const c = a[0].index !== null, h = c ?
|
|
103
|
-
if (
|
|
101
|
+
sa(a);
|
|
102
|
+
const c = a[0].index !== null, h = c ? ra(a) : -1, u = na(a);
|
|
103
|
+
if (oa(t, h, u), i) {
|
|
104
104
|
let n = 0;
|
|
105
105
|
for (let l = 0, f = a.length; l < f; l++) {
|
|
106
106
|
const m = a[l];
|
|
@@ -138,7 +138,7 @@ function oa(a, e = {}, t = new re()) {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function la(a, e, t) {
|
|
142
142
|
const i = a.index, r = a.attributes.position.count, o = i ? i.count : r;
|
|
143
143
|
let c = a.groups;
|
|
144
144
|
c.length === 0 && (c = [{ count: o, start: 0, materialIndex: 0 }]);
|
|
@@ -156,7 +156,7 @@ function aa(a, e, t) {
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function ca(a, e) {
|
|
160
160
|
if (!a.index) {
|
|
161
161
|
const t = a.attributes.position.count, i = new Array(t);
|
|
162
162
|
for (let s = 0; s < t; s++)
|
|
@@ -209,7 +209,7 @@ function Mr(a) {
|
|
|
209
209
|
const e = a.skeleton;
|
|
210
210
|
return e ? (e.boneTexture || e.computeBoneTexture(), `${lr(e.boneTexture.image.data.buffer)}_${e.boneTexture.uuid}`) : null;
|
|
211
211
|
}
|
|
212
|
-
class
|
|
212
|
+
class ha {
|
|
213
213
|
constructor(e = null) {
|
|
214
214
|
this.matrixWorld = new te(), this.geometryHash = null, this.skeletonHash = null, this.primitiveCount = -1, e !== null && this.updateFrom(e);
|
|
215
215
|
}
|
|
@@ -222,15 +222,15 @@ class ca {
|
|
|
222
222
|
return !(this.matrixWorld.equals(e.matrixWorld) && this.geometryHash === Sr(t) && this.skeletonHash === Mr(e) && this.primitiveCount === i);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
const ft = /* @__PURE__ */ new b(), dt = /* @__PURE__ */ new b(), pt = /* @__PURE__ */ new b(), Cr = /* @__PURE__ */ new ht(), bi = /* @__PURE__ */ new b(), fs = /* @__PURE__ */ new b(), Ir = /* @__PURE__ */ new ht(),
|
|
225
|
+
const ft = /* @__PURE__ */ new b(), dt = /* @__PURE__ */ new b(), pt = /* @__PURE__ */ new b(), Cr = /* @__PURE__ */ new ht(), bi = /* @__PURE__ */ new b(), fs = /* @__PURE__ */ new b(), Ir = /* @__PURE__ */ new ht(), Dr = /* @__PURE__ */ new ht(), Ai = /* @__PURE__ */ new te(), Pr = /* @__PURE__ */ new te();
|
|
226
226
|
function Er(a, e, t) {
|
|
227
227
|
const i = a.skeleton, s = a.geometry, r = i.bones, o = i.boneInverses;
|
|
228
|
-
Ir.fromBufferAttribute(s.attributes.skinIndex, e),
|
|
228
|
+
Ir.fromBufferAttribute(s.attributes.skinIndex, e), Dr.fromBufferAttribute(s.attributes.skinWeight, e), Ai.elements.fill(0);
|
|
229
229
|
for (let c = 0; c < 4; c++) {
|
|
230
|
-
const h =
|
|
230
|
+
const h = Dr.getComponent(c);
|
|
231
231
|
if (h !== 0) {
|
|
232
232
|
const u = Ir.getComponent(c);
|
|
233
|
-
|
|
233
|
+
Pr.multiplyMatrices(r[u].matrixWorld, o[u]), ua(Ai, Pr, h);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
return Ai.multiply(a.bindMatrix).premultiply(a.bindMatrixInverse), t.transformDirection(Ai), t;
|
|
@@ -243,12 +243,12 @@ function ds(a, e, t, i, s) {
|
|
|
243
243
|
}
|
|
244
244
|
s.add(bi);
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function ua(a, e, t) {
|
|
247
247
|
const i = a.elements, s = e.elements;
|
|
248
248
|
for (let r = 0, o = s.length; r < o; r++)
|
|
249
249
|
i[r] += s[r] * t;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function fa(a) {
|
|
252
252
|
const { index: e, attributes: t } = a;
|
|
253
253
|
if (e)
|
|
254
254
|
for (let i = 0, s = e.count; i < s; i += 3) {
|
|
@@ -266,7 +266,7 @@ function ua(a) {
|
|
|
266
266
|
}
|
|
267
267
|
return a;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function da(a, e = {}, t = new re()) {
|
|
270
270
|
e = {
|
|
271
271
|
applyWorldTransforms: !0,
|
|
272
272
|
attributes: [],
|
|
@@ -284,11 +284,11 @@ function fa(a, e = {}, t = new re()) {
|
|
|
284
284
|
const y = e.attributes[v];
|
|
285
285
|
y === "position" || y === "tangent" || y === "normal" || !(y in c) || (h[y] || t.setAttribute(y, ai(c[y])), kt(c[y], h[y]), Fn(c[y], h[y]));
|
|
286
286
|
}
|
|
287
|
-
return a.matrixWorld.determinant() < 0 &&
|
|
287
|
+
return a.matrixWorld.determinant() < 0 && fa(t), t;
|
|
288
288
|
}
|
|
289
|
-
class
|
|
289
|
+
class pa extends re {
|
|
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 ha();
|
|
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 da extends re {
|
|
|
303
303
|
}
|
|
304
304
|
updateFrom(e, t) {
|
|
305
305
|
const i = this._diff;
|
|
306
|
-
return i.didChange(e) ? (
|
|
306
|
+
return i.didChange(e) ? (da(e, t, this), i.updateFrom(e), this.version++, this.hash = `${this.uuid}_${this.version}`, !0) : !1;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
const Vs = 0, Bn = 1, On = 2;
|
|
310
|
-
function
|
|
310
|
+
function ma(a, e) {
|
|
311
311
|
for (let t = 0, i = a.length; t < i; t++)
|
|
312
312
|
a[t].traverseVisible((r) => {
|
|
313
313
|
r.isMesh && e(r);
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function ga(a) {
|
|
317
317
|
const e = [];
|
|
318
318
|
for (let t = 0, i = a.length; t < i; t++) {
|
|
319
319
|
const s = a[t];
|
|
@@ -321,7 +321,7 @@ function ma(a) {
|
|
|
321
321
|
}
|
|
322
322
|
return e;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function _a(a, e, t) {
|
|
325
325
|
if (a.length === 0) {
|
|
326
326
|
e.setIndex(null);
|
|
327
327
|
const i = e.attributes;
|
|
@@ -330,11 +330,11 @@ function ga(a, e, t) {
|
|
|
330
330
|
for (const s in t.attributes)
|
|
331
331
|
e.setAttribute(t.attributes[s], new ve(new Float32Array(0), 4, !1));
|
|
332
332
|
} else
|
|
333
|
-
|
|
333
|
+
aa(a, t, e);
|
|
334
334
|
for (const i in e.attributes)
|
|
335
335
|
e.attributes[i].needsUpdate = !0;
|
|
336
336
|
}
|
|
337
|
-
class
|
|
337
|
+
class va {
|
|
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 _a {
|
|
|
347
347
|
}
|
|
348
348
|
_getMeshes() {
|
|
349
349
|
const e = [];
|
|
350
|
-
return
|
|
350
|
+
return ma(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 _a {
|
|
|
360
360
|
const c = t[r], h = c.uuid;
|
|
361
361
|
i.delete(h);
|
|
362
362
|
let u = e.get(h);
|
|
363
|
-
(!u || !u.isCompatible(c, this.attributes)) && (u && u.dispose(), u = new
|
|
363
|
+
(!u || !u.isCompatible(c, this.attributes)) && (u && u.dispose(), u = new pa(), e.set(h, u)), u.updateFrom(c, s) && this.generateMissingAttributes && ca(u, this.attributes);
|
|
364
364
|
}
|
|
365
365
|
i.forEach((r) => {
|
|
366
366
|
e.delete(r);
|
|
@@ -380,19 +380,19 @@ class _a {
|
|
|
380
380
|
const p = u[l];
|
|
381
381
|
!p || p.uuid !== _.uuid ? (c.push(!1), d = !0) : p.version !== _.version ? c.push(!1) : c.push(!0);
|
|
382
382
|
}
|
|
383
|
-
|
|
383
|
+
_a(h, e, { useGroups: t, forceUpdate: d, skipAssigningAttributes: c, overwriteIndex: i }), d && e.dispose(), r.set(e, h.map((l) => ({
|
|
384
384
|
version: l.version,
|
|
385
385
|
uuid: l.uuid
|
|
386
386
|
})));
|
|
387
387
|
let n = Vs;
|
|
388
388
|
return d ? n = On : c.includes(!1) && (n = Bn), {
|
|
389
389
|
changeType: n,
|
|
390
|
-
materials:
|
|
390
|
+
materials: ga(o),
|
|
391
391
|
geometry: e
|
|
392
392
|
};
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function ya(a) {
|
|
396
396
|
const e = /* @__PURE__ */ new Set();
|
|
397
397
|
for (let t = 0, i = a.length; t < i; t++) {
|
|
398
398
|
const s = a[t];
|
|
@@ -403,7 +403,7 @@ function va(a) {
|
|
|
403
403
|
}
|
|
404
404
|
return Array.from(e);
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function xa(a) {
|
|
407
407
|
const e = [], t = /* @__PURE__ */ new Set();
|
|
408
408
|
for (let s = 0, r = a.length; s < r; s++)
|
|
409
409
|
a[s].traverse((o) => {
|
|
@@ -412,12 +412,12 @@ function ya(a) {
|
|
|
412
412
|
const i = Array.from(t).sort((s, r) => s.uuid < r.uuid ? 1 : s.uuid > r.uuid ? -1 : 0);
|
|
413
413
|
return { lights: e, iesTextures: i };
|
|
414
414
|
}
|
|
415
|
-
class
|
|
415
|
+
class wa {
|
|
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 re(), this.staticGeometryGenerator = new
|
|
420
|
+
this.bvhOptions = {}, this.attributes = ["position", "normal", "tangent", "color", "uv", "uv2"], this.generateBVH = !0, this.bvh = null, this.geometry = new re(), this.staticGeometryGenerator = new va(e), this._bvhWorker = null, this._pendingGenerate = null, this._buildAsync = !1;
|
|
421
421
|
}
|
|
422
422
|
setObjects(e) {
|
|
423
423
|
this.staticGeometryGenerator.setObjects(e);
|
|
@@ -443,19 +443,19 @@ class xa {
|
|
|
443
443
|
l.isSkinnedMesh && l.skeleton && l.skeleton.update();
|
|
444
444
|
});
|
|
445
445
|
});
|
|
446
|
-
const o = t.generate(i), c = o.materials, h =
|
|
447
|
-
if (o.changeType !== Vs &&
|
|
446
|
+
const o = t.generate(i), c = o.materials, h = ya(c), { lights: u, iesTextures: d } = xa(r);
|
|
447
|
+
if (o.changeType !== Vs && la(i, c, c), this.generateBVH) {
|
|
448
448
|
if (this.bvh instanceof Promise)
|
|
449
449
|
throw new Error("PathTracingSceneGenerator: BVH is already building asynchronously.");
|
|
450
450
|
if (o.changeType === On) {
|
|
451
451
|
const n = {
|
|
452
|
-
strategy:
|
|
452
|
+
strategy: Jo,
|
|
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, n) : this.bvh = new
|
|
458
|
+
this._buildAsync ? this.bvh = this._bvhWorker.generate(i, n) : this.bvh = new $o(i, n);
|
|
459
459
|
} else
|
|
460
460
|
o.changeType === Bn && this.bvh.refit();
|
|
461
461
|
}
|
|
@@ -499,7 +499,7 @@ class cr extends Gt {
|
|
|
499
499
|
return !1;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
class
|
|
502
|
+
class ba extends cr {
|
|
503
503
|
constructor(e) {
|
|
504
504
|
super({
|
|
505
505
|
blending: di,
|
|
@@ -645,7 +645,7 @@ const zn = (
|
|
|
645
645
|
}
|
|
646
646
|
|
|
647
647
|
`
|
|
648
|
-
),
|
|
648
|
+
), Aa = (
|
|
649
649
|
/* glsl */
|
|
650
650
|
`
|
|
651
651
|
|
|
@@ -726,7 +726,7 @@ const zn = (
|
|
|
726
726
|
}
|
|
727
727
|
|
|
728
728
|
`
|
|
729
|
-
),
|
|
729
|
+
), Ta = (
|
|
730
730
|
/* glsl */
|
|
731
731
|
`
|
|
732
732
|
|
|
@@ -773,7 +773,7 @@ const zn = (
|
|
|
773
773
|
|
|
774
774
|
`
|
|
775
775
|
);
|
|
776
|
-
class
|
|
776
|
+
class Sa extends cr {
|
|
777
777
|
constructor() {
|
|
778
778
|
super({
|
|
779
779
|
blending: di,
|
|
@@ -798,7 +798,7 @@ class Ta extends cr {
|
|
|
798
798
|
`
|
|
799
799
|
|
|
800
800
|
${zn}
|
|
801
|
-
${
|
|
801
|
+
${Aa}
|
|
802
802
|
|
|
803
803
|
varying vec2 vUv;
|
|
804
804
|
uniform vec2 resolution;
|
|
@@ -813,7 +813,7 @@ class Ta extends cr {
|
|
|
813
813
|
});
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
|
-
class
|
|
816
|
+
class Ma {
|
|
817
817
|
generate(e, t = 256) {
|
|
818
818
|
const i = new je(t, t, {
|
|
819
819
|
type: xe,
|
|
@@ -823,11 +823,11 @@ class Sa {
|
|
|
823
823
|
generateMipmaps: !1
|
|
824
824
|
}), s = e.getRenderTarget();
|
|
825
825
|
e.setRenderTarget(i);
|
|
826
|
-
const r = new Ht(new
|
|
826
|
+
const r = new Ht(new Sa());
|
|
827
827
|
return r.material.resolution.set(t, t), r.render(e), e.setRenderTarget(s), r.dispose(), i;
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
|
-
class
|
|
830
|
+
class Ca extends ss {
|
|
831
831
|
set bokehSize(e) {
|
|
832
832
|
this.fStop = this.getFocalLength() / e;
|
|
833
833
|
}
|
|
@@ -841,12 +841,12 @@ class Ma extends ss {
|
|
|
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 Ia {
|
|
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 Ca ? (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 ps(a) {
|
|
@@ -863,21 +863,21 @@ function Rr(a, e, t = 0, i = a.length) {
|
|
|
863
863
|
}
|
|
864
864
|
return s - t;
|
|
865
865
|
}
|
|
866
|
-
function
|
|
866
|
+
function Da(a, e, t) {
|
|
867
867
|
return 0.2126 * a + 0.7152 * e + 0.0722 * t;
|
|
868
868
|
}
|
|
869
|
-
function Pa(a, e =
|
|
869
|
+
function Pa(a, e = De) {
|
|
870
870
|
const t = a.clone();
|
|
871
871
|
t.source = new po({ ...t.image });
|
|
872
872
|
const { width: i, height: s, data: r } = t.image;
|
|
873
873
|
let o = r;
|
|
874
874
|
if (t.type !== e) {
|
|
875
|
-
e ===
|
|
875
|
+
e === De ? o = new Uint16Array(r.length) : o = new Float32Array(r.length);
|
|
876
876
|
let c;
|
|
877
877
|
r instanceof Int8Array || r instanceof Int16Array || r instanceof Int32Array ? c = 2 ** (8 * r.BYTES_PER_ELEMENT - 1) - 1 : c = 2 ** (8 * r.BYTES_PER_ELEMENT) - 1;
|
|
878
878
|
for (let h = 0, u = r.length; h < u; h++) {
|
|
879
879
|
let d = r[h];
|
|
880
|
-
t.type ===
|
|
880
|
+
t.type === De && (d = Ge.fromHalfFloat(r[h])), t.type !== xe && t.type !== De && (d /= c), e === De && (o[h] = Ge.toHalfFloat(d));
|
|
881
881
|
}
|
|
882
882
|
t.image.data = o, t.type = e;
|
|
883
883
|
}
|
|
@@ -893,14 +893,14 @@ function Pa(a, e = Pe) {
|
|
|
893
893
|
}
|
|
894
894
|
return t;
|
|
895
895
|
}
|
|
896
|
-
class
|
|
896
|
+
class Ea {
|
|
897
897
|
constructor() {
|
|
898
898
|
const e = new qe(ps(new Float32Array([0, 0, 0, 0])), 1, 1);
|
|
899
|
-
e.type =
|
|
899
|
+
e.type = De, e.format = le, e.minFilter = Ie, e.magFilter = Ie, e.wrapS = ct, e.wrapT = ct, e.generateMipmaps = !1, e.needsUpdate = !0;
|
|
900
900
|
const t = new qe(ps(new Float32Array([0, 1])), 1, 2);
|
|
901
|
-
t.type =
|
|
901
|
+
t.type = De, t.format = Fs, t.minFilter = Ie, t.magFilter = Ie, t.generateMipmaps = !1, t.needsUpdate = !0;
|
|
902
902
|
const i = new qe(ps(new Float32Array([0, 0, 1, 1])), 2, 2);
|
|
903
|
-
i.type =
|
|
903
|
+
i.type = De, i.format = Fs, i.minFilter = Ie, i.magFilter = Ie, 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();
|
|
@@ -913,7 +913,7 @@ class Da {
|
|
|
913
913
|
for (let p = 0; p < s; p++) {
|
|
914
914
|
let g = 0;
|
|
915
915
|
for (let v = 0; v < i; v++) {
|
|
916
|
-
const y = p * i + v, x = Ge.fromHalfFloat(r[4 * y + 0]), w = Ge.fromHalfFloat(r[4 * y + 1]), T = Ge.fromHalfFloat(r[4 * y + 2]), M =
|
|
916
|
+
const y = p * i + v, x = Ge.fromHalfFloat(r[4 * y + 0]), w = Ge.fromHalfFloat(r[4 * y + 1]), T = Ge.fromHalfFloat(r[4 * y + 2]), M = Da(x, w, T);
|
|
917
917
|
g += M, d += M, o[y] = M, c[y] = g;
|
|
918
918
|
}
|
|
919
919
|
if (g !== 0)
|
|
@@ -939,8 +939,8 @@ class Da {
|
|
|
939
939
|
m.image = { width: s, height: 1, data: l }, m.needsUpdate = !0, _.image = { width: i, height: s, data: f }, _.needsUpdate = !0, this.totalSum = d, this.map = t;
|
|
940
940
|
}
|
|
941
941
|
}
|
|
942
|
-
const ms = 6,
|
|
943
|
-
class
|
|
942
|
+
const ms = 6, Ra = 0, La = 1, ka = 2, Fa = 3, Ba = 4, Se = new b(), de = new b(), Lr = new te(), wt = new ee(), kr = new b(), bt = new b(), Oa = new b(0, 1, 0);
|
|
943
|
+
class za {
|
|
944
944
|
constructor() {
|
|
945
945
|
const e = new qe(new Float32Array(4), 1, 1);
|
|
946
946
|
e.format = le, e.type = xe, e.wrapS = Ze, e.wrapT = Ze, e.generateMipmaps = !1, e.minFilter = ae, e.magFilter = ae, this.tex = e, this.count = 0;
|
|
@@ -955,12 +955,12 @@ class Oa {
|
|
|
955
955
|
for (let m = 0; m < ms * 4; m++)
|
|
956
956
|
o[n + m] = 0;
|
|
957
957
|
d.getWorldPosition(de), o[n + l++] = de.x, o[n + l++] = de.y, o[n + l++] = de.z;
|
|
958
|
-
let f =
|
|
959
|
-
if (d.isRectAreaLight && d.isCircular ? f =
|
|
958
|
+
let f = Ra;
|
|
959
|
+
if (d.isRectAreaLight && d.isCircular ? f = La : d.isSpotLight ? f = ka : d.isDirectionalLight ? f = Fa : d.isPointLight && (f = Ba), o[n + l++] = f, o[n + l++] = d.color.r, o[n + l++] = d.color.g, o[n + l++] = d.color.b, o[n + l++] = d.intensity, d.getWorldQuaternion(wt), d.isRectAreaLight)
|
|
960
960
|
Se.set(d.width, 0, 0).applyQuaternion(wt), o[n + l++] = Se.x, o[n + l++] = Se.y, o[n + l++] = Se.z, l++, de.set(0, d.height, 0).applyQuaternion(wt), o[n + l++] = de.x, o[n + l++] = de.y, o[n + l++] = de.z, o[n + l++] = Se.cross(de).length() * (d.isCircular ? Math.PI / 4 : 1);
|
|
961
961
|
else if (d.isSpotLight) {
|
|
962
962
|
const m = d.radius || 0;
|
|
963
|
-
kr.setFromMatrixPosition(d.matrixWorld), bt.setFromMatrixPosition(d.target.matrixWorld), Lr.lookAt(kr, bt,
|
|
963
|
+
kr.setFromMatrixPosition(d.matrixWorld), bt.setFromMatrixPosition(d.target.matrixWorld), Lr.lookAt(kr, bt, Oa), wt.setFromRotationMatrix(Lr), Se.set(1, 0, 0).applyQuaternion(wt), o[n + l++] = Se.x, o[n + l++] = Se.y, o[n + l++] = Se.z, l++, de.set(0, 1, 0).applyQuaternion(wt), o[n + l++] = de.x, o[n + l++] = de.y, o[n + l++] = de.z, o[n + l++] = Math.PI * m * m, o[n + l++] = m, o[n + l++] = d.decay, o[n + l++] = d.distance, o[n + l++] = Math.cos(d.angle), o[n + l++] = Math.cos(d.angle * (1 - d.penumbra)), o[n + l++] = d.iesMap ? t.indexOf(d.iesMap) : -1;
|
|
964
964
|
} else if (d.isPointLight) {
|
|
965
965
|
const m = Se.setFromMatrixPosition(d.matrixWorld);
|
|
966
966
|
o[n + l++] = m.x, o[n + l++] = m.y, o[n + l++] = m.z, l++, l += 4, l += 1, o[n + l++] = d.decay, o[n + l++] = d.distance;
|
|
@@ -997,7 +997,7 @@ function Fr(a, e, t, i, s) {
|
|
|
997
997
|
t[s + u + n] = e >= n + 1 ? a[d + n] / c : 0;
|
|
998
998
|
}
|
|
999
999
|
}
|
|
1000
|
-
class
|
|
1000
|
+
class Wa extends mo {
|
|
1001
1001
|
constructor() {
|
|
1002
1002
|
super(), this._textures = [], this.type = xe, this.format = le, this.internalFormat = "RGBA32F";
|
|
1003
1003
|
}
|
|
@@ -1018,7 +1018,7 @@ class za extends mo {
|
|
|
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 n = new
|
|
1021
|
+
const n = new ea();
|
|
1022
1022
|
s.push(n);
|
|
1023
1023
|
}
|
|
1024
1024
|
for (; s.length > i; )
|
|
@@ -1036,7 +1036,7 @@ class za extends mo {
|
|
|
1036
1036
|
this.dispose(), this.needsUpdate = !0;
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
class
|
|
1039
|
+
class Ua extends Wa {
|
|
1040
1040
|
updateNormalAttribute(e) {
|
|
1041
1041
|
this.updateAttribute(0, e);
|
|
1042
1042
|
}
|
|
@@ -1059,7 +1059,7 @@ function hr(a, e) {
|
|
|
1059
1059
|
function Gs(a) {
|
|
1060
1060
|
return `${a.source.uuid}:${a.colorSpace}`;
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1062
|
+
function Ha(a) {
|
|
1063
1063
|
const e = /* @__PURE__ */ new Set(), t = [];
|
|
1064
1064
|
for (let i = 0, s = a.length; i < s; i++) {
|
|
1065
1065
|
const r = a[i], o = Gs(r);
|
|
@@ -1067,11 +1067,11 @@ function Ua(a) {
|
|
|
1067
1067
|
}
|
|
1068
1068
|
return t;
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Na(a) {
|
|
1071
1071
|
const e = a.map((i) => i.iesMap || null).filter((i) => i), t = new Set(e);
|
|
1072
1072
|
return Array.from(t).sort(hr);
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function Va(a) {
|
|
1075
1075
|
const e = /* @__PURE__ */ new Set();
|
|
1076
1076
|
for (let i = 0, s = a.length; i < s; i++) {
|
|
1077
1077
|
const r = a[i];
|
|
@@ -1081,16 +1081,16 @@ function Na(a) {
|
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
1083
|
const t = Array.from(e);
|
|
1084
|
-
return
|
|
1084
|
+
return Ha(t).sort(hr);
|
|
1085
1085
|
}
|
|
1086
|
-
function
|
|
1086
|
+
function Ga(a) {
|
|
1087
1087
|
const e = [];
|
|
1088
1088
|
return a.traverse((t) => {
|
|
1089
1089
|
t.visible && (t.isRectAreaLight || t.isSpotLight || t.isPointLight || t.isDirectionalLight) && e.push(t);
|
|
1090
1090
|
}), e.sort(hr);
|
|
1091
1091
|
}
|
|
1092
1092
|
const Wn = 45, Br = Wn * 4;
|
|
1093
|
-
class
|
|
1093
|
+
class Qa {
|
|
1094
1094
|
constructor() {
|
|
1095
1095
|
this._features = {};
|
|
1096
1096
|
}
|
|
@@ -1104,9 +1104,9 @@ class Ga {
|
|
|
1104
1104
|
this._features = {};
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
|
-
class
|
|
1107
|
+
class ja extends qe {
|
|
1108
1108
|
constructor() {
|
|
1109
|
-
super(new Float32Array(4), 1, 1), this.format = le, this.type = xe, this.wrapS = Ze, this.wrapT = Ze, this.minFilter = ae, this.magFilter = ae, this.generateMipmaps = !1, this.features = new
|
|
1109
|
+
super(new Float32Array(4), 1, 1), this.format = le, this.type = xe, this.wrapS = Ze, this.wrapT = Ze, this.minFilter = ae, this.magFilter = ae, this.generateMipmaps = !1, this.features = new Qa();
|
|
1110
1110
|
}
|
|
1111
1111
|
updateFrom(e, t) {
|
|
1112
1112
|
function i(m, _, p = -1) {
|
|
@@ -1156,7 +1156,7 @@ class Qa extends qe {
|
|
|
1156
1156
|
case Bs:
|
|
1157
1157
|
l[o++] = 1;
|
|
1158
1158
|
break;
|
|
1159
|
-
case
|
|
1159
|
+
case Dn:
|
|
1160
1160
|
l[o++] = -1;
|
|
1161
1161
|
break;
|
|
1162
1162
|
case gi:
|
|
@@ -1170,10 +1170,10 @@ class Qa extends qe {
|
|
|
1170
1170
|
}
|
|
1171
1171
|
}
|
|
1172
1172
|
const Or = new X();
|
|
1173
|
-
function
|
|
1173
|
+
function qa(a) {
|
|
1174
1174
|
return a ? `${a.uuid}:${a.version}` : null;
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1176
|
+
function Ya(a, e) {
|
|
1177
1177
|
for (const t in e)
|
|
1178
1178
|
t in a && (a[t] = e[t]);
|
|
1179
1179
|
}
|
|
@@ -1189,10 +1189,10 @@ class zr extends go {
|
|
|
1189
1189
|
generateMipmaps: !1,
|
|
1190
1190
|
...i
|
|
1191
1191
|
};
|
|
1192
|
-
super(e, t, 1, s),
|
|
1192
|
+
super(e, t, 1, s), Ya(this.texture, s), this.texture.setTextures = (...o) => {
|
|
1193
1193
|
this.setTextures(...o);
|
|
1194
1194
|
}, this.hashes = [null];
|
|
1195
|
-
const r = new Ht(new
|
|
1195
|
+
const r = new Ht(new Ka());
|
|
1196
1196
|
this.fsQuad = r;
|
|
1197
1197
|
}
|
|
1198
1198
|
setTextures(e, t, i = this.width, s = this.height) {
|
|
@@ -1203,7 +1203,7 @@ class zr extends go {
|
|
|
1203
1203
|
const u = this.fsQuad, d = this.hashes;
|
|
1204
1204
|
let n = !1;
|
|
1205
1205
|
for (let l = 0, f = h; l < f; l++) {
|
|
1206
|
-
const m = t[l], _ =
|
|
1206
|
+
const m = t[l], _ = qa(m);
|
|
1207
1207
|
m && (d[l] !== _ || m.isWebGLRenderTarget) && (m.matrixAutoUpdate = !1, m.matrix.identity(), u.material.map = m, e.setRenderTarget(this, l), u.render(e), m.updateMatrix(), m.matrixAutoUpdate = !0, d[l] = _, n = !0);
|
|
1208
1208
|
}
|
|
1209
1209
|
return u.material.map = null, e.setClearColor(Or, c), e.setRenderTarget(r), e.toneMapping = o, n;
|
|
@@ -1212,7 +1212,7 @@ class zr extends go {
|
|
|
1212
1212
|
super.dispose(), this.fsQuad.dispose();
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
|
-
class
|
|
1215
|
+
class Ka extends Gt {
|
|
1216
1216
|
get map() {
|
|
1217
1217
|
return this.uniforms.map.value;
|
|
1218
1218
|
}
|
|
@@ -1251,14 +1251,14 @@ class Ya extends Gt {
|
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1254
|
+
function Za(a, e = Math.random()) {
|
|
1255
1255
|
for (let t = a.length - 1; t > 0; t--) {
|
|
1256
1256
|
const i = Math.floor(e() * (t + 1)), s = a[t];
|
|
1257
1257
|
a[t] = a[i], a[i] = s;
|
|
1258
1258
|
}
|
|
1259
1259
|
return a;
|
|
1260
1260
|
}
|
|
1261
|
-
class
|
|
1261
|
+
class Xa {
|
|
1262
1262
|
constructor(e, t, i = Math.random) {
|
|
1263
1263
|
const s = e ** t, r = new Uint16Array(s);
|
|
1264
1264
|
let o = s;
|
|
@@ -1272,7 +1272,7 @@ class Za {
|
|
|
1272
1272
|
o = 0;
|
|
1273
1273
|
}, this.next = function() {
|
|
1274
1274
|
const { samples: c } = this;
|
|
1275
|
-
o >= r.length && (
|
|
1275
|
+
o >= r.length && (Za(r, i), this.reshuffle());
|
|
1276
1276
|
let h = r[o++];
|
|
1277
1277
|
for (let u = 0; u < t; u++)
|
|
1278
1278
|
c[u] = (h % e + i()) / e, h = Math.floor(h / e);
|
|
@@ -1280,7 +1280,7 @@ class Za {
|
|
|
1280
1280
|
};
|
|
1281
1281
|
}
|
|
1282
1282
|
}
|
|
1283
|
-
class
|
|
1283
|
+
class Ja {
|
|
1284
1284
|
constructor(e, t, i = Math.random) {
|
|
1285
1285
|
let s = 0;
|
|
1286
1286
|
for (const h of t)
|
|
@@ -1288,7 +1288,7 @@ class Xa {
|
|
|
1288
1288
|
const r = new Float32Array(s), o = [];
|
|
1289
1289
|
let c = 0;
|
|
1290
1290
|
for (const h of t) {
|
|
1291
|
-
const u = new
|
|
1291
|
+
const u = new Xa(e, h, i);
|
|
1292
1292
|
u.samples = new Float32Array(r.buffer, c, u.samples.length), c += u.samples.length * 4, o.push(u);
|
|
1293
1293
|
}
|
|
1294
1294
|
this.samples = r, this.strataCount = e, this.next = function() {
|
|
@@ -1304,7 +1304,7 @@ class Xa {
|
|
|
1304
1304
|
};
|
|
1305
1305
|
}
|
|
1306
1306
|
}
|
|
1307
|
-
class
|
|
1307
|
+
class $a {
|
|
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 Ja {
|
|
|
1315
1315
|
return this.nextInt() / (this.m - 1);
|
|
1316
1316
|
}
|
|
1317
1317
|
}
|
|
1318
|
-
class
|
|
1318
|
+
class el extends qe {
|
|
1319
1319
|
constructor(e = 1, t = 1, i = 8) {
|
|
1320
|
-
super(new Float32Array(1), 1, 1, le, xe), this.minFilter = ae, this.magFilter = ae, this.strata = i, this.sampler = null, this.generator = new
|
|
1320
|
+
super(new Float32Array(1), 1, 1, le, xe), this.minFilter = ae, this.magFilter = ae, this.strata = i, this.sampler = null, this.generator = new $a(), 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 r = new Array(e * t).fill(4), o = new
|
|
1326
|
+
const r = new Array(e * t).fill(4), o = new Ja(i, r, this.random);
|
|
1327
1327
|
s.width = t, s.height = e, s.data = o.samples, this.sampler = o, this.dispose(), this.next();
|
|
1328
1328
|
}
|
|
1329
1329
|
next() {
|
|
@@ -1333,13 +1333,13 @@ class $a extends qe {
|
|
|
1333
1333
|
this.sampler.reset(), this.generator.seed = 0;
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
|
-
function
|
|
1336
|
+
function tl(a, e = Math.random) {
|
|
1337
1337
|
for (let t = a.length - 1; t > 0; t--) {
|
|
1338
1338
|
const i = ~~((e() - 1e-6) * t), s = a[t];
|
|
1339
1339
|
a[t] = a[i], a[i] = s;
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1342
|
+
function il(a, e) {
|
|
1343
1343
|
a.fill(0);
|
|
1344
1344
|
for (let t = 0; t < e; t++)
|
|
1345
1345
|
a[t] = 1;
|
|
@@ -1421,7 +1421,7 @@ class Wr {
|
|
|
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 sl {
|
|
1425
1425
|
constructor() {
|
|
1426
1426
|
this.random = Math.random, this.sigma = 1.5, this.size = 64, this.majorityPointsRatio = 0.1, this.samples = new Wr(1), this.savedSamples = new Wr(1);
|
|
1427
1427
|
}
|
|
@@ -1435,7 +1435,7 @@ class il {
|
|
|
1435
1435
|
} = this;
|
|
1436
1436
|
e.resize(r), e.setSigma(i);
|
|
1437
1437
|
const o = Math.floor(r * r * s), c = e.binaryPattern;
|
|
1438
|
-
|
|
1438
|
+
il(c, o), tl(c, this.random);
|
|
1439
1439
|
for (let n = 0, l = c.length; n < l; n++)
|
|
1440
1440
|
c[n] === 1 && e.addPointIndex(n);
|
|
1441
1441
|
for (; ; ) {
|
|
@@ -1467,10 +1467,10 @@ class il {
|
|
|
1467
1467
|
return { data: h, maxValue: d };
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
|
-
function
|
|
1470
|
+
function rl(a) {
|
|
1471
1471
|
return a >= 3 ? 4 : a;
|
|
1472
1472
|
}
|
|
1473
|
-
function
|
|
1473
|
+
function nl(a) {
|
|
1474
1474
|
switch (a) {
|
|
1475
1475
|
case 1:
|
|
1476
1476
|
return Fs;
|
|
@@ -1480,14 +1480,14 @@ function rl(a) {
|
|
|
1480
1480
|
return le;
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
1483
|
-
class
|
|
1483
|
+
class ol extends qe {
|
|
1484
1484
|
constructor(e = 64, t = 1) {
|
|
1485
1485
|
super(new Float32Array(4), 1, 1, le, xe), this.minFilter = ae, this.magFilter = ae, 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 sl();
|
|
1489
1489
|
i.channels = e, i.size = t;
|
|
1490
|
-
const s =
|
|
1490
|
+
const s = rl(e), r = nl(s);
|
|
1491
1491
|
(this.image.width !== t || r !== this.format) && (this.image.width = t, this.image.height = t, this.image.data = new Float32Array(t ** 2 * s), this.format = r, this.dispose());
|
|
1492
1492
|
const o = this.image.data;
|
|
1493
1493
|
for (let c = 0, h = e; c < h; c++) {
|
|
@@ -1500,7 +1500,7 @@ class nl extends qe {
|
|
|
1500
1500
|
this.needsUpdate = !0;
|
|
1501
1501
|
}
|
|
1502
1502
|
}
|
|
1503
|
-
const
|
|
1503
|
+
const al = (
|
|
1504
1504
|
/* glsl */
|
|
1505
1505
|
`
|
|
1506
1506
|
|
|
@@ -1515,7 +1515,7 @@ const ol = (
|
|
|
1515
1515
|
};
|
|
1516
1516
|
|
|
1517
1517
|
`
|
|
1518
|
-
),
|
|
1518
|
+
), ll = (
|
|
1519
1519
|
/* glsl */
|
|
1520
1520
|
`
|
|
1521
1521
|
|
|
@@ -1530,7 +1530,7 @@ const ol = (
|
|
|
1530
1530
|
};
|
|
1531
1531
|
|
|
1532
1532
|
`
|
|
1533
|
-
),
|
|
1533
|
+
), cl = (
|
|
1534
1534
|
/* glsl */
|
|
1535
1535
|
`
|
|
1536
1536
|
|
|
@@ -1619,7 +1619,7 @@ const ol = (
|
|
|
1619
1619
|
}
|
|
1620
1620
|
|
|
1621
1621
|
`
|
|
1622
|
-
),
|
|
1622
|
+
), hl = (
|
|
1623
1623
|
/* glsl */
|
|
1624
1624
|
`
|
|
1625
1625
|
|
|
@@ -1829,7 +1829,7 @@ const ol = (
|
|
|
1829
1829
|
}
|
|
1830
1830
|
|
|
1831
1831
|
`
|
|
1832
|
-
),
|
|
1832
|
+
), ul = (
|
|
1833
1833
|
/* glsl */
|
|
1834
1834
|
`
|
|
1835
1835
|
|
|
@@ -1894,7 +1894,7 @@ const ol = (
|
|
|
1894
1894
|
};
|
|
1895
1895
|
|
|
1896
1896
|
`
|
|
1897
|
-
),
|
|
1897
|
+
), fl = (
|
|
1898
1898
|
/* glsl */
|
|
1899
1899
|
`
|
|
1900
1900
|
|
|
@@ -1964,7 +1964,7 @@ const ol = (
|
|
|
1964
1964
|
|
|
1965
1965
|
}
|
|
1966
1966
|
`
|
|
1967
|
-
),
|
|
1967
|
+
), dl = (
|
|
1968
1968
|
/* glsl */
|
|
1969
1969
|
`
|
|
1970
1970
|
|
|
@@ -2182,7 +2182,7 @@ const ol = (
|
|
|
2182
2182
|
}
|
|
2183
2183
|
|
|
2184
2184
|
`
|
|
2185
|
-
),
|
|
2185
|
+
), pl = (
|
|
2186
2186
|
/* glsl */
|
|
2187
2187
|
`
|
|
2188
2188
|
|
|
@@ -2270,7 +2270,7 @@ const ol = (
|
|
|
2270
2270
|
|
|
2271
2271
|
|
|
2272
2272
|
`
|
|
2273
|
-
),
|
|
2273
|
+
), ml = (
|
|
2274
2274
|
/* glsl */
|
|
2275
2275
|
`
|
|
2276
2276
|
|
|
@@ -2376,7 +2376,7 @@ const ol = (
|
|
|
2376
2376
|
}
|
|
2377
2377
|
|
|
2378
2378
|
`
|
|
2379
|
-
),
|
|
2379
|
+
), gl = (
|
|
2380
2380
|
/* glsl */
|
|
2381
2381
|
`
|
|
2382
2382
|
|
|
@@ -2459,7 +2459,7 @@ const ol = (
|
|
|
2459
2459
|
}
|
|
2460
2460
|
|
|
2461
2461
|
`
|
|
2462
|
-
),
|
|
2462
|
+
), _l = (
|
|
2463
2463
|
/* glsl */
|
|
2464
2464
|
`
|
|
2465
2465
|
|
|
@@ -2523,7 +2523,7 @@ const ol = (
|
|
|
2523
2523
|
}
|
|
2524
2524
|
|
|
2525
2525
|
`
|
|
2526
|
-
),
|
|
2526
|
+
), vl = (
|
|
2527
2527
|
/*glsl */
|
|
2528
2528
|
`
|
|
2529
2529
|
|
|
@@ -2726,7 +2726,7 @@ const ol = (
|
|
|
2726
2726
|
|
|
2727
2727
|
}
|
|
2728
2728
|
`
|
|
2729
|
-
),
|
|
2729
|
+
), yl = (
|
|
2730
2730
|
/* glsl */
|
|
2731
2731
|
`
|
|
2732
2732
|
|
|
@@ -2778,7 +2778,7 @@ const ol = (
|
|
|
2778
2778
|
}
|
|
2779
2779
|
|
|
2780
2780
|
`
|
|
2781
|
-
),
|
|
2781
|
+
), xl = (
|
|
2782
2782
|
/* glsl */
|
|
2783
2783
|
`
|
|
2784
2784
|
|
|
@@ -3219,7 +3219,7 @@ const ol = (
|
|
|
3219
3219
|
}
|
|
3220
3220
|
|
|
3221
3221
|
`
|
|
3222
|
-
),
|
|
3222
|
+
), wl = (
|
|
3223
3223
|
/* glsl */
|
|
3224
3224
|
`
|
|
3225
3225
|
|
|
@@ -3243,7 +3243,7 @@ const ol = (
|
|
|
3243
3243
|
}
|
|
3244
3244
|
|
|
3245
3245
|
`
|
|
3246
|
-
),
|
|
3246
|
+
), bl = (
|
|
3247
3247
|
/* glsl */
|
|
3248
3248
|
`
|
|
3249
3249
|
|
|
@@ -3347,7 +3347,7 @@ const ol = (
|
|
|
3347
3347
|
}
|
|
3348
3348
|
|
|
3349
3349
|
`
|
|
3350
|
-
),
|
|
3350
|
+
), Al = (
|
|
3351
3351
|
/* glsl */
|
|
3352
3352
|
`
|
|
3353
3353
|
|
|
@@ -3484,7 +3484,7 @@ const ol = (
|
|
|
3484
3484
|
}
|
|
3485
3485
|
|
|
3486
3486
|
`
|
|
3487
|
-
),
|
|
3487
|
+
), Tl = (
|
|
3488
3488
|
/* glsl */
|
|
3489
3489
|
`
|
|
3490
3490
|
|
|
@@ -3584,7 +3584,7 @@ const ol = (
|
|
|
3584
3584
|
}
|
|
3585
3585
|
|
|
3586
3586
|
`
|
|
3587
|
-
),
|
|
3587
|
+
), Sl = (
|
|
3588
3588
|
/* glsl */
|
|
3589
3589
|
`
|
|
3590
3590
|
|
|
@@ -3648,7 +3648,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
3648
3648
|
}
|
|
3649
3649
|
|
|
3650
3650
|
`
|
|
3651
|
-
),
|
|
3651
|
+
), Ml = (
|
|
3652
3652
|
/* glsl */
|
|
3653
3653
|
`
|
|
3654
3654
|
|
|
@@ -3828,7 +3828,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
3828
3828
|
}
|
|
3829
3829
|
|
|
3830
3830
|
`
|
|
3831
|
-
),
|
|
3831
|
+
), Cl = (
|
|
3832
3832
|
/* glsl */
|
|
3833
3833
|
`
|
|
3834
3834
|
|
|
@@ -3914,7 +3914,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
3914
3914
|
}
|
|
3915
3915
|
|
|
3916
3916
|
`
|
|
3917
|
-
),
|
|
3917
|
+
), Il = (
|
|
3918
3918
|
/*glsl*/
|
|
3919
3919
|
`
|
|
3920
3920
|
|
|
@@ -4013,7 +4013,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
4013
4013
|
}
|
|
4014
4014
|
|
|
4015
4015
|
`
|
|
4016
|
-
),
|
|
4016
|
+
), Dl = (
|
|
4017
4017
|
/* glsl */
|
|
4018
4018
|
`
|
|
4019
4019
|
|
|
@@ -4390,7 +4390,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
4390
4390
|
}
|
|
4391
4391
|
|
|
4392
4392
|
`
|
|
4393
|
-
),
|
|
4393
|
+
), El = (
|
|
4394
4394
|
/* glsl */
|
|
4395
4395
|
`
|
|
4396
4396
|
|
|
@@ -4441,7 +4441,7 @@ bool bvhIntersectFogVolumeHit(
|
|
|
4441
4441
|
|
|
4442
4442
|
`
|
|
4443
4443
|
);
|
|
4444
|
-
class
|
|
4444
|
+
class Rl extends cr {
|
|
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 El extends cr {
|
|
|
4477
4477
|
transmissiveBounces: { value: 10 },
|
|
4478
4478
|
filterGlossyFactor: { value: 0 },
|
|
4479
4479
|
// camera uniforms
|
|
4480
|
-
physicalCamera: { value: new
|
|
4480
|
+
physicalCamera: { value: new Ia() },
|
|
4481
4481
|
cameraWorldMatrix: { value: new te() },
|
|
4482
4482
|
invProjectionMatrix: { value: new te() },
|
|
4483
4483
|
// scene uniforms
|
|
4484
|
-
bvh: { value: new
|
|
4485
|
-
attributesArray: { value: new
|
|
4486
|
-
materialIndexAttribute: { value: new
|
|
4487
|
-
materials: { value: new
|
|
4484
|
+
bvh: { value: new ta() },
|
|
4485
|
+
attributesArray: { value: new Ua() },
|
|
4486
|
+
materialIndexAttribute: { value: new ia() },
|
|
4487
|
+
materials: { value: new ja() },
|
|
4488
4488
|
textures: { value: new zr().texture },
|
|
4489
4489
|
// light uniforms
|
|
4490
|
-
lights: { value: new
|
|
4490
|
+
lights: { value: new za() },
|
|
4491
4491
|
iesProfiles: { value: new zr(360, 180, {
|
|
4492
|
-
type:
|
|
4492
|
+
type: De,
|
|
4493
4493
|
wrapS: Ze,
|
|
4494
4494
|
wrapT: Ze
|
|
4495
4495
|
}).texture },
|
|
4496
4496
|
environmentIntensity: { value: 1 },
|
|
4497
4497
|
environmentRotation: { value: new te() },
|
|
4498
|
-
envMapInfo: { value: new
|
|
4498
|
+
envMapInfo: { value: new Ea() },
|
|
4499
4499
|
// background uniforms
|
|
4500
4500
|
backgroundBlur: { value: 0 },
|
|
4501
4501
|
backgroundMap: { value: null },
|
|
@@ -4505,8 +4505,8 @@ class El extends cr {
|
|
|
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 el() },
|
|
4509
|
+
stratifiedOffsetTexture: { value: new ol(64, 1) }
|
|
4510
4510
|
},
|
|
4511
4511
|
vertexShader: (
|
|
4512
4512
|
/* glsl */
|
|
@@ -4543,22 +4543,22 @@ class El extends cr {
|
|
|
4543
4543
|
${us.bvh_ray_functions}
|
|
4544
4544
|
|
|
4545
4545
|
// uniform structs
|
|
4546
|
-
${ol}
|
|
4547
|
-
${ll}
|
|
4548
4546
|
${al}
|
|
4549
4547
|
${cl}
|
|
4548
|
+
${ll}
|
|
4550
4549
|
${hl}
|
|
4550
|
+
${ul}
|
|
4551
4551
|
|
|
4552
4552
|
// random
|
|
4553
4553
|
#if RANDOM_TYPE == 2 // Stratified List
|
|
4554
4554
|
|
|
4555
|
-
${
|
|
4555
|
+
${yl}
|
|
4556
4556
|
|
|
4557
4557
|
#elif RANDOM_TYPE == 1 // Sobol
|
|
4558
4558
|
|
|
4559
4559
|
${Ur}
|
|
4560
4560
|
${zn}
|
|
4561
|
-
${
|
|
4561
|
+
${Ta}
|
|
4562
4562
|
|
|
4563
4563
|
#define rand(v) sobol(v)
|
|
4564
4564
|
#define rand2(v) sobol2(v)
|
|
@@ -4583,11 +4583,11 @@ class El extends cr {
|
|
|
4583
4583
|
#endif
|
|
4584
4584
|
|
|
4585
4585
|
// common
|
|
4586
|
-
${
|
|
4587
|
-
${pl}
|
|
4588
|
-
${Un}
|
|
4586
|
+
${vl}
|
|
4589
4587
|
${ml}
|
|
4588
|
+
${Un}
|
|
4590
4589
|
${gl}
|
|
4590
|
+
${_l}
|
|
4591
4591
|
|
|
4592
4592
|
// environment
|
|
4593
4593
|
uniform EquirectHdrInfo envMapInfo;
|
|
@@ -4643,16 +4643,16 @@ class El extends cr {
|
|
|
4643
4643
|
float lightsDenom;
|
|
4644
4644
|
|
|
4645
4645
|
// sampling
|
|
4646
|
-
${
|
|
4647
|
-
${ul}
|
|
4646
|
+
${pl}
|
|
4648
4647
|
${fl}
|
|
4648
|
+
${dl}
|
|
4649
4649
|
|
|
4650
|
+
${Sl}
|
|
4651
|
+
${bl}
|
|
4650
4652
|
${Tl}
|
|
4651
|
-
${wl}
|
|
4652
4653
|
${Al}
|
|
4653
|
-
${
|
|
4654
|
+
${wl}
|
|
4654
4655
|
${xl}
|
|
4655
|
-
${yl}
|
|
4656
4656
|
|
|
4657
4657
|
float applyFilteredGlossy( float roughness, float accumulatedRoughness ) {
|
|
4658
4658
|
|
|
@@ -4685,11 +4685,11 @@ class El extends cr {
|
|
|
4685
4685
|
}
|
|
4686
4686
|
|
|
4687
4687
|
${Pl}
|
|
4688
|
-
${Ml}
|
|
4689
|
-
${Dl}
|
|
4690
|
-
${Sl}
|
|
4691
4688
|
${Cl}
|
|
4689
|
+
${El}
|
|
4690
|
+
${Ml}
|
|
4692
4691
|
${Il}
|
|
4692
|
+
${Dl}
|
|
4693
4693
|
|
|
4694
4694
|
void main() {
|
|
4695
4695
|
|
|
@@ -4986,7 +4986,7 @@ class El extends cr {
|
|
|
4986
4986
|
}), this.setValues(e);
|
|
4987
4987
|
}
|
|
4988
4988
|
}
|
|
4989
|
-
function*
|
|
4989
|
+
function* Ll() {
|
|
4990
4990
|
const {
|
|
4991
4991
|
_renderer: a,
|
|
4992
4992
|
_fsQuad: e,
|
|
@@ -5000,15 +5000,15 @@ function* Rl() {
|
|
|
5000
5000
|
} = this, u = new ht(), d = new ht(), n = t.material;
|
|
5001
5001
|
let [l, f] = s;
|
|
5002
5002
|
for (; ; ) {
|
|
5003
|
-
c ? (n.opacity = this._opacityFactor / (this.samples + 1), h.blending = di, h.opacity = 1) : (h.opacity = this._opacityFactor / (this.samples + 1), h.blending =
|
|
5003
|
+
c ? (n.opacity = this._opacityFactor / (this.samples + 1), h.blending = di, h.opacity = 1) : (h.opacity = this._opacityFactor / (this.samples + 1), h.blending = Pn);
|
|
5004
5004
|
const [m, _, p, g] = o, v = i.width, y = i.height;
|
|
5005
5005
|
h.resolution.set(v * p, y * g), h.sobolTexture = r.texture, h.stratifiedTexture.init(20, h.bounces + h.transmissiveBounces + 5), h.stratifiedTexture.next(), h.seed++;
|
|
5006
|
-
const x = this.tiles.x || 1, w = this.tiles.y || 1, T = x * w, M = Math.ceil(v * p),
|
|
5006
|
+
const x = this.tiles.x || 1, w = this.tiles.y || 1, T = x * w, M = Math.ceil(v * p), D = Math.ceil(y * g), C = Math.floor(m * v), E = Math.floor(_ * y), I = Math.ceil(M / x), A = Math.ceil(D / w);
|
|
5007
5007
|
for (let S = 0; S < w; S++)
|
|
5008
|
-
for (let
|
|
5008
|
+
for (let P = 0; P < x; P++) {
|
|
5009
5009
|
const R = a.getRenderTarget(), k = a.autoClear, F = a.getScissorTest();
|
|
5010
5010
|
a.getScissor(u), a.getViewport(d);
|
|
5011
|
-
let z =
|
|
5011
|
+
let z = P, B = S;
|
|
5012
5012
|
if (!this.stableTiles) {
|
|
5013
5013
|
const U = this._currentTile % (x * w);
|
|
5014
5014
|
z = U % x, B = ~~(U / x), this._currentTile = U + 1;
|
|
@@ -5018,13 +5018,13 @@ function* Rl() {
|
|
|
5018
5018
|
C + z * I,
|
|
5019
5019
|
E + Q * A,
|
|
5020
5020
|
Math.min(I, M - z * I),
|
|
5021
|
-
Math.min(A,
|
|
5021
|
+
Math.min(A, D - Q * A)
|
|
5022
5022
|
), i.viewport.set(
|
|
5023
5023
|
C,
|
|
5024
5024
|
E,
|
|
5025
5025
|
M,
|
|
5026
|
-
|
|
5027
|
-
), a.setRenderTarget(i), a.setScissorTest(!0), a.autoClear = !1, e.render(a), a.setViewport(d), a.setScissor(u), a.setScissorTest(F), a.setRenderTarget(R), a.autoClear = k, c && (n.target1 = l.texture, n.target2 = i.texture, a.setRenderTarget(f), t.render(a), a.setRenderTarget(R)), this.samples += 1 / T,
|
|
5026
|
+
D
|
|
5027
|
+
), a.setRenderTarget(i), a.setScissorTest(!0), a.autoClear = !1, e.render(a), a.setViewport(d), a.setScissor(u), a.setScissorTest(F), a.setRenderTarget(R), a.autoClear = k, c && (n.target1 = l.texture, n.target2 = i.texture, a.setRenderTarget(f), t.render(a), a.setRenderTarget(R)), this.samples += 1 / T, P === x - 1 && S === w - 1 && (this.samples = Math.round(this.samples)), yield;
|
|
5028
5028
|
}
|
|
5029
5029
|
[l, f] = [f, l];
|
|
5030
5030
|
}
|
|
@@ -5050,7 +5050,7 @@ class Nr {
|
|
|
5050
5050
|
return !!this._compilePromise;
|
|
5051
5051
|
}
|
|
5052
5052
|
constructor(e) {
|
|
5053
|
-
this.camera = null, this.tiles = new G(3, 3), this.stableNoise = !1, this.stableTiles = !0, this.samples = 0, this._subframe = new ht(0, 0, 1, 1), this._opacityFactor = 1, this._renderer = e, this._alpha = !1, this._fsQuad = new Ht(new
|
|
5053
|
+
this.camera = null, this.tiles = new G(3, 3), this.stableNoise = !1, this.stableTiles = !0, this.samples = 0, this._subframe = new ht(0, 0, 1, 1), this._opacityFactor = 1, this._renderer = e, this._alpha = !1, this._fsQuad = new Ht(new Rl()), this._blendQuad = new Ht(new ba()), this._task = null, this._currentTile = 0, this._compilePromise = null, this._sobolTarget = new Ma().generate(e), this._primaryTarget = new je(1, 1, {
|
|
5054
5054
|
format: le,
|
|
5055
5055
|
type: xe,
|
|
5056
5056
|
magFilter: ae,
|
|
@@ -5098,11 +5098,11 @@ class Nr {
|
|
|
5098
5098
|
e.getClearColor(Hr), 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(Hr, r), 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 = Ll.call(this)), this._task.next());
|
|
5102
5102
|
}
|
|
5103
5103
|
}
|
|
5104
5104
|
const mt = new G(), Vr = new G(), Mi = new yo(), Ci = new X();
|
|
5105
|
-
class
|
|
5105
|
+
class kl extends qe {
|
|
5106
5106
|
constructor(e = 512, t = 512) {
|
|
5107
5107
|
super(
|
|
5108
5108
|
new Float32Array(e * t * 4),
|
|
@@ -5132,7 +5132,7 @@ class Ll extends qe {
|
|
|
5132
5132
|
}
|
|
5133
5133
|
}
|
|
5134
5134
|
const Gr = new b();
|
|
5135
|
-
class
|
|
5135
|
+
class Fl extends kl {
|
|
5136
5136
|
constructor(e = 512) {
|
|
5137
5137
|
super(e, e), this.topColor = new X().set(16777215), this.bottomColor = new X().set(0), this.exponent = 2, this.generationCallback = (t, i, s, r) => {
|
|
5138
5138
|
Gr.setFromSpherical(t);
|
|
@@ -5144,7 +5144,7 @@ class kl extends Ll {
|
|
|
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 Bl extends Gt {
|
|
5148
5148
|
get map() {
|
|
5149
5149
|
return this.uniforms.map.value;
|
|
5150
5150
|
}
|
|
@@ -5231,7 +5231,7 @@ class Fl extends Gt {
|
|
|
5231
5231
|
}), this.setValues(e);
|
|
5232
5232
|
}
|
|
5233
5233
|
}
|
|
5234
|
-
class
|
|
5234
|
+
class Ol extends Gt {
|
|
5235
5235
|
constructor() {
|
|
5236
5236
|
super({
|
|
5237
5237
|
uniforms: {
|
|
@@ -5276,7 +5276,7 @@ class Bl extends Gt {
|
|
|
5276
5276
|
}
|
|
5277
5277
|
class Qr {
|
|
5278
5278
|
constructor(e) {
|
|
5279
|
-
this._renderer = e, this._quad = new Ht(new
|
|
5279
|
+
this._renderer = e, this._quad = new Ht(new Ol());
|
|
5280
5280
|
}
|
|
5281
5281
|
generate(e, t = null, i = null) {
|
|
5282
5282
|
if (!e.isCubeTexture)
|
|
@@ -5294,18 +5294,18 @@ class Qr {
|
|
|
5294
5294
|
r.readRenderTargetPixels(c, 0, 0, t, i, _), c.dispose();
|
|
5295
5295
|
for (let g = 0, v = _.length; g < v; g++)
|
|
5296
5296
|
m[g] = Ge.toHalfFloat(_[g]);
|
|
5297
|
-
const p = new qe(m, t, i, le,
|
|
5297
|
+
const p = new qe(m, t, i, le, De);
|
|
5298
5298
|
return p.minFilter = xo, p.magFilter = Ie, p.wrapS = ct, p.wrapT = ct, p.mapping = Xi, p.needsUpdate = !0, p;
|
|
5299
5299
|
}
|
|
5300
5300
|
dispose() {
|
|
5301
5301
|
this._quad.dispose();
|
|
5302
5302
|
}
|
|
5303
5303
|
}
|
|
5304
|
-
function
|
|
5304
|
+
function zl(a) {
|
|
5305
5305
|
return a.extensions.get("EXT_float_blend");
|
|
5306
5306
|
}
|
|
5307
5307
|
const At = new G();
|
|
5308
|
-
class
|
|
5308
|
+
class Wl {
|
|
5309
5309
|
get multipleImportanceSampling() {
|
|
5310
5310
|
return !!this._pathTracer.material.defines.FEATURE_MIS;
|
|
5311
5311
|
}
|
|
@@ -5349,7 +5349,7 @@ class zl {
|
|
|
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 wa(), this._pathTracer = new Nr(e), this._queueReset = !1, this._clock = new rs(), this._compilePromise = null, this._lowResPathTracer = new Nr(e), this._lowResPathTracer.tiles.set(1, 1), this._quad = new Ht(new Bl({
|
|
5353
5353
|
map: null,
|
|
5354
5354
|
transparent: !0,
|
|
5355
5355
|
blending: di,
|
|
@@ -5387,11 +5387,11 @@ class zl {
|
|
|
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, r =
|
|
5390
|
+
const e = this._pathTracer.material, t = this._renderer, i = this._materials, s = this.textureSize, r = Va(i);
|
|
5391
5391
|
e.textures.setTextures(t, r, s.x, s.y), e.materials.updateFrom(i, r), 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 = Ga(e), r = Na(s);
|
|
5395
5395
|
i.lights.updateFrom(s, r), i.iesProfiles.setTextures(t, r), this.reset();
|
|
5396
5396
|
}
|
|
5397
5397
|
updateEnvironment() {
|
|
@@ -5399,7 +5399,7 @@ class zl {
|
|
|
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 Fl(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) {
|
|
@@ -5440,7 +5440,7 @@ class zl {
|
|
|
5440
5440
|
const e = this._lowResPathTracer, t = this._pathTracer, i = this._renderer, s = this._clock, r = this._quad;
|
|
5441
5441
|
this._updateScale(), this._queueReset && (t.reset(), e.reset(), this._queueReset = !1, r.material.opacity = 0, s.start());
|
|
5442
5442
|
const o = 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 || !zl(i), e.alpha = t.alpha, this.renderToCanvas) {
|
|
5444
5444
|
const h = this._renderer, u = this.minSamples;
|
|
5445
5445
|
if (c >= this.renderDelay && this.samples >= this.minSamples && (this.fadeDuration !== 0 ? r.material.opacity = Math.min(r.material.opacity + o / this.fadeDuration, 1) : r.material.opacity = 1), !this.enablePathTracing || this.samples < u || r.material.opacity < 1) {
|
|
5446
5446
|
if (this.dynamicLowRes && !this.isCompiling) {
|
|
@@ -5450,7 +5450,7 @@ class zl {
|
|
|
5450
5450
|
}
|
|
5451
5451
|
(!this.dynamicLowRes && this.rasterizeScene || this.dynamicLowRes && this.isCompiling) && this.rasterizeSceneCallback(this.scene, this.camera);
|
|
5452
5452
|
}
|
|
5453
|
-
this.enablePathTracing && r.material.opacity > 0 && (r.material.opacity < 1 && (r.material.blending = this.dynamicLowRes ? wo :
|
|
5453
|
+
this.enablePathTracing && r.material.opacity > 0 && (r.material.opacity < 1 && (r.material.blending = this.dynamicLowRes ? wo : Pn), r.material.map = t.target.texture, this.renderToCanvasCallback(t.target, h, r), r.material.blending = di);
|
|
5454
5454
|
}
|
|
5455
5455
|
}
|
|
5456
5456
|
reset() {
|
|
@@ -5470,15 +5470,15 @@ class zl {
|
|
|
5470
5470
|
}
|
|
5471
5471
|
}
|
|
5472
5472
|
}
|
|
5473
|
-
const
|
|
5474
|
-
globalThis.GLTF_PROGRESSIVE_VERSION =
|
|
5473
|
+
const Ul = "";
|
|
5474
|
+
globalThis.GLTF_PROGRESSIVE_VERSION = Ul;
|
|
5475
5475
|
console.debug("[gltf-progressive] version -");
|
|
5476
|
-
let Hn = "https://www.gstatic.com/draco/versioned/decoders/1.5.7/",
|
|
5477
|
-
const
|
|
5478
|
-
|
|
5479
|
-
const
|
|
5476
|
+
let Hn = "https://www.gstatic.com/draco/versioned/decoders/1.5.7/", Hl = "https://cdn.needle.tools/static/three/0.179.1/basis2/";
|
|
5477
|
+
const Nl = new URL(Hn + "draco_decoder.js");
|
|
5478
|
+
Nl.searchParams.append("range", "true");
|
|
5479
|
+
const Vl = () => ({
|
|
5480
5480
|
dracoDecoderPath: Hn,
|
|
5481
|
-
ktx2TranscoderPath:
|
|
5481
|
+
ktx2TranscoderPath: Hl
|
|
5482
5482
|
});
|
|
5483
5483
|
function Nn(a) {
|
|
5484
5484
|
return { dracoLoader: Gn, meshoptDecoder: Qn };
|
|
@@ -5493,7 +5493,7 @@ function jn(a, e) {
|
|
|
5493
5493
|
t ? t = Object.assign(t, e) : t = e, Qs.set(a, t);
|
|
5494
5494
|
}
|
|
5495
5495
|
const gs = ar.prototype.load;
|
|
5496
|
-
function
|
|
5496
|
+
function Gl(...a) {
|
|
5497
5497
|
const e = Qs.get(this);
|
|
5498
5498
|
let t = a[0];
|
|
5499
5499
|
const i = new URL(t, window.location.href);
|
|
@@ -5503,7 +5503,7 @@ function Vl(...a) {
|
|
|
5503
5503
|
}
|
|
5504
5504
|
return a[0] = t, gs == null ? void 0 : gs.call(this, ...a);
|
|
5505
5505
|
}
|
|
5506
|
-
ar.prototype.load =
|
|
5506
|
+
ar.prototype.load = Gl;
|
|
5507
5507
|
vt("debugprogressive");
|
|
5508
5508
|
function vt(a) {
|
|
5509
5509
|
if (typeof window > "u")
|
|
@@ -5511,7 +5511,7 @@ function vt(a) {
|
|
|
5511
5511
|
const t = new URL(window.location.href).searchParams.get(a);
|
|
5512
5512
|
return t == null || t === "0" || t === "false" ? !1 : t === "" ? !0 : t;
|
|
5513
5513
|
}
|
|
5514
|
-
function
|
|
5514
|
+
function Ql(a, e) {
|
|
5515
5515
|
if (e === void 0 || a === void 0 || e.startsWith("./") || e.startsWith("http") || e.startsWith("data:") || e.startsWith("blob:"))
|
|
5516
5516
|
return e;
|
|
5517
5517
|
const t = a.lastIndexOf("/");
|
|
@@ -5533,7 +5533,7 @@ function jr() {
|
|
|
5533
5533
|
const a = new URL(window.location.href), e = a.hostname === "localhost" || /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(a.hostname);
|
|
5534
5534
|
return a.hostname === "127.0.0.1" || e;
|
|
5535
5535
|
}
|
|
5536
|
-
class
|
|
5536
|
+
class jl {
|
|
5537
5537
|
constructor(e = 100, t = {}) {
|
|
5538
5538
|
L(this, "_running", /* @__PURE__ */ new Map());
|
|
5539
5539
|
L(this, "_queue", []);
|
|
@@ -5567,17 +5567,17 @@ class Ql {
|
|
|
5567
5567
|
}
|
|
5568
5568
|
}
|
|
5569
5569
|
}
|
|
5570
|
-
const
|
|
5570
|
+
const ql = typeof window > "u" && typeof document > "u", js = Symbol("needle:raycast-mesh");
|
|
5571
5571
|
function _i(a) {
|
|
5572
5572
|
return (a == null ? void 0 : a[js]) instanceof re ? a[js] : null;
|
|
5573
5573
|
}
|
|
5574
|
-
function
|
|
5574
|
+
function Yl(a, e) {
|
|
5575
5575
|
if ((a.type === "Mesh" || a.type === "SkinnedMesh") && !_i(a)) {
|
|
5576
|
-
const i =
|
|
5576
|
+
const i = Zl(e);
|
|
5577
5577
|
i.userData = { isRaycastMesh: !0 }, a[js] = i;
|
|
5578
5578
|
}
|
|
5579
5579
|
}
|
|
5580
|
-
function
|
|
5580
|
+
function Kl(a = !0) {
|
|
5581
5581
|
if (a) {
|
|
5582
5582
|
if (qt)
|
|
5583
5583
|
return;
|
|
@@ -5594,7 +5594,7 @@ function Yl(a = !0) {
|
|
|
5594
5594
|
}
|
|
5595
5595
|
}
|
|
5596
5596
|
let qt = null;
|
|
5597
|
-
function
|
|
5597
|
+
function Zl(a) {
|
|
5598
5598
|
const e = new re();
|
|
5599
5599
|
for (const t in a.attributes)
|
|
5600
5600
|
e.setAttribute(t, a.getAttribute(t));
|
|
@@ -5621,16 +5621,16 @@ function Yn(a) {
|
|
|
5621
5621
|
a && "wireframe" in a && (a.wireframe = ci === !0);
|
|
5622
5622
|
}
|
|
5623
5623
|
const Yt = new Array();
|
|
5624
|
-
let
|
|
5625
|
-
const
|
|
5626
|
-
function
|
|
5627
|
-
if (Yt.length <
|
|
5624
|
+
let Xl = 0;
|
|
5625
|
+
const Jl = qn() ? 2 : 10;
|
|
5626
|
+
function $l(a) {
|
|
5627
|
+
if (Yt.length < Jl) {
|
|
5628
5628
|
const i = Yt.length;
|
|
5629
5629
|
V && console.warn(`[Worker] Creating new worker #${i}`);
|
|
5630
5630
|
const s = ur.createWorker(a || {});
|
|
5631
5631
|
return Yt.push(s), s;
|
|
5632
5632
|
}
|
|
5633
|
-
const e =
|
|
5633
|
+
const e = Xl++ % Yt.length;
|
|
5634
5634
|
return Yt[e];
|
|
5635
5635
|
}
|
|
5636
5636
|
class ur {
|
|
@@ -5644,7 +5644,7 @@ class ur {
|
|
|
5644
5644
|
case "loaded-gltf":
|
|
5645
5645
|
for (const r of this._running)
|
|
5646
5646
|
if (r.url === s.result.url) {
|
|
5647
|
-
|
|
5647
|
+
ec(s.result), r.resolve(s.result);
|
|
5648
5648
|
const o = r.url;
|
|
5649
5649
|
o.startsWith("blob:") && URL.revokeObjectURL(o);
|
|
5650
5650
|
}
|
|
@@ -5662,7 +5662,7 @@ class ur {
|
|
|
5662
5662
|
return new ur(t, e);
|
|
5663
5663
|
}
|
|
5664
5664
|
async load(e, t) {
|
|
5665
|
-
const i =
|
|
5665
|
+
const i = Vl();
|
|
5666
5666
|
let s = t == null ? void 0 : t.renderer;
|
|
5667
5667
|
s || (this._webglRenderer ?? (this._webglRenderer = (async () => {
|
|
5668
5668
|
const { WebGLRenderer: u } = await import("three");
|
|
@@ -5685,7 +5685,7 @@ class ur {
|
|
|
5685
5685
|
});
|
|
5686
5686
|
}
|
|
5687
5687
|
}
|
|
5688
|
-
function
|
|
5688
|
+
function ec(a) {
|
|
5689
5689
|
var e, t, i, s, r, o, c, h, u, d, n, l, f, m, _, p;
|
|
5690
5690
|
for (const g of a.geometries) {
|
|
5691
5691
|
const v = g.geometry, y = new re();
|
|
@@ -5771,7 +5771,7 @@ function _s(a) {
|
|
|
5771
5771
|
"isBufferAttribute" in a && a.isBufferAttribute && (e = new ve(a.array, a.itemSize, a.normalized), e.usage = a.usage, e.gpuType = a.gpuType, e.updateRanges = a.updateRanges);
|
|
5772
5772
|
return e;
|
|
5773
5773
|
}
|
|
5774
|
-
const
|
|
5774
|
+
const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipmaps"), vs = Symbol("needle-progressive-texture"), He = "NEEDLE_progressive", N = class N {
|
|
5775
5775
|
constructor(e) {
|
|
5776
5776
|
L(this, "parser");
|
|
5777
5777
|
L(this, "url");
|
|
@@ -5982,7 +5982,7 @@ const ec = vt("gltf-progressive-worker"), tc = vt("gltf-progressive-reduce-mipma
|
|
|
5982
5982
|
if (u && (u == null ? void 0 : u.level) < t)
|
|
5983
5983
|
return V === "verbose" && console.warn("Assigned texture level is already higher: ", u.level, t, i, h, r), null;
|
|
5984
5984
|
}
|
|
5985
|
-
if (
|
|
5985
|
+
if (ic && r.mipmaps) {
|
|
5986
5986
|
const u = r.mipmaps.length;
|
|
5987
5987
|
r.mipmaps.length = Math.min(r.mipmaps.length, 3), u !== r.mipmaps.length && V && console.debug(`Reduced mipmap count from ${u} to ${r.mipmaps.length} for ${r.uuid}: ${(o = r.image) == null ? void 0 : o.width}x${(c = r.image) == null ? void 0 : c.height}.`);
|
|
5988
5988
|
}
|
|
@@ -6067,7 +6067,7 @@ const ec = vt("gltf-progressive-worker"), tc = vt("gltf-progressive-reduce-mipma
|
|
|
6067
6067
|
const l = Array.isArray(o.lods) ? (h = o.lods[t]) == null ? void 0 : h.path : o.lods;
|
|
6068
6068
|
if (!l)
|
|
6069
6069
|
return V && !o["missing:uri"] && (o["missing:uri"] = !0, console.warn("Missing uri for progressive asset for LOD " + t, o)), null;
|
|
6070
|
-
const f =
|
|
6070
|
+
const f = Ql(s.url, l);
|
|
6071
6071
|
if (f.endsWith(".glb") || f.endsWith(".gltf")) {
|
|
6072
6072
|
if (!o.guid)
|
|
6073
6073
|
return console.warn("missing pointer for glb/gltf texture", o), null;
|
|
@@ -6082,18 +6082,18 @@ const ec = vt("gltf-progressive-worker"), tc = vt("gltf-progressive-reduce-mipma
|
|
|
6082
6082
|
if (!_.use)
|
|
6083
6083
|
return V && console.log(`LOD ${t} was aborted: ${f}`), null;
|
|
6084
6084
|
const g = o, v = new Promise(async (x, w) => {
|
|
6085
|
-
if (
|
|
6086
|
-
const A = await (await
|
|
6085
|
+
if (tc) {
|
|
6086
|
+
const A = await (await $l({})).load(f);
|
|
6087
6087
|
if (A.textures.length > 0)
|
|
6088
6088
|
for (const S of A.textures) {
|
|
6089
|
-
let
|
|
6090
|
-
return N.assignLODInformation(s.url,
|
|
6089
|
+
let P = S.texture;
|
|
6090
|
+
return N.assignLODInformation(s.url, P, r, t, void 0), e instanceof rt && (P = this.copySettings(e, P)), P && (P.guid = g.guid), x(P);
|
|
6091
6091
|
}
|
|
6092
6092
|
if (A.geometries.length > 0) {
|
|
6093
6093
|
const S = new Array();
|
|
6094
|
-
for (const
|
|
6095
|
-
const R =
|
|
6096
|
-
N.assignLODInformation(s.url, R, r, t,
|
|
6094
|
+
for (const P of A.geometries) {
|
|
6095
|
+
const R = P.geometry;
|
|
6096
|
+
N.assignLODInformation(s.url, R, r, t, P.primitiveIndex), S.push(R);
|
|
6097
6097
|
}
|
|
6098
6098
|
return x(S);
|
|
6099
6099
|
}
|
|
@@ -6106,16 +6106,16 @@ const ec = vt("gltf-progressive-worker"), tc = vt("gltf-progressive-reduce-mipma
|
|
|
6106
6106
|
const I = g.lods[t];
|
|
6107
6107
|
I.hash && (M += "?v=" + I.hash);
|
|
6108
6108
|
}
|
|
6109
|
-
const
|
|
6109
|
+
const D = await T.loadAsync(M).catch((I) => (console.error(`Error loading LOD ${t} from ${f}
|
|
6110
6110
|
`, I), x(null)));
|
|
6111
|
-
if (!
|
|
6111
|
+
if (!D)
|
|
6112
6112
|
return x(null);
|
|
6113
|
-
const C =
|
|
6113
|
+
const C = D.parser;
|
|
6114
6114
|
i && console.log("Loading finished " + f, g.guid);
|
|
6115
6115
|
let E = 0;
|
|
6116
|
-
if (
|
|
6116
|
+
if (D.parser.json.textures) {
|
|
6117
6117
|
let I = !1;
|
|
6118
|
-
for (const A of
|
|
6118
|
+
for (const A of D.parser.json.textures) {
|
|
6119
6119
|
if (A != null && A.extensions) {
|
|
6120
6120
|
const S = A == null ? void 0 : A.extensions[He];
|
|
6121
6121
|
if (S != null && S.guid && S.guid === g.guid) {
|
|
@@ -6129,11 +6129,11 @@ const ec = vt("gltf-progressive-worker"), tc = vt("gltf-progressive-reduce-mipma
|
|
|
6129
6129
|
let A = await C.getDependency("texture", E);
|
|
6130
6130
|
return A && N.assignLODInformation(s.url, A, r, t, void 0), i && console.log('change "' + e.name + '" → "' + A.name + '"', f, E, A, m), e instanceof rt && (A = this.copySettings(e, A)), A && (A.guid = g.guid), x(A);
|
|
6131
6131
|
} else
|
|
6132
|
-
V && console.warn("Could not find texture with guid", g.guid,
|
|
6132
|
+
V && console.warn("Could not find texture with guid", g.guid, D.parser.json);
|
|
6133
6133
|
}
|
|
6134
|
-
if (E = 0,
|
|
6134
|
+
if (E = 0, D.parser.json.meshes) {
|
|
6135
6135
|
let I = !1;
|
|
6136
|
-
for (const A of
|
|
6136
|
+
for (const A of D.parser.json.meshes) {
|
|
6137
6137
|
if (A != null && A.extensions) {
|
|
6138
6138
|
const S = A == null ? void 0 : A.extensions[He];
|
|
6139
6139
|
if (S != null && S.guid && S.guid === g.guid) {
|
|
@@ -6150,17 +6150,17 @@ const ec = vt("gltf-progressive-worker"), tc = vt("gltf-progressive-reduce-mipma
|
|
|
6150
6150
|
return N.assignLODInformation(s.url, S, r, t, 0), x(S);
|
|
6151
6151
|
} else {
|
|
6152
6152
|
const S = new Array();
|
|
6153
|
-
for (let
|
|
6154
|
-
const R = A.children[
|
|
6153
|
+
for (let P = 0; P < A.children.length; P++) {
|
|
6154
|
+
const R = A.children[P];
|
|
6155
6155
|
if (R.isMesh === !0) {
|
|
6156
6156
|
const k = R.geometry;
|
|
6157
|
-
N.assignLODInformation(s.url, k, r, t,
|
|
6157
|
+
N.assignLODInformation(s.url, k, r, t, P), S.push(k);
|
|
6158
6158
|
}
|
|
6159
6159
|
}
|
|
6160
6160
|
return x(S);
|
|
6161
6161
|
}
|
|
6162
6162
|
} else
|
|
6163
|
-
V && console.warn("Could not find mesh with guid", g.guid,
|
|
6163
|
+
V && console.warn("Could not find mesh with guid", g.guid, D.parser.json);
|
|
6164
6164
|
}
|
|
6165
6165
|
return x(null);
|
|
6166
6166
|
});
|
|
@@ -6177,7 +6177,7 @@ const ec = vt("gltf-progressive-worker"), tc = vt("gltf-progressive-reduce-mipma
|
|
|
6177
6177
|
if (!t)
|
|
6178
6178
|
return;
|
|
6179
6179
|
t.userData || (t.userData = {});
|
|
6180
|
-
const o = new
|
|
6180
|
+
const o = new sc(e, i, s, r);
|
|
6181
6181
|
t.userData.LODS = o, "source" in t && typeof t.source == "object" && (t.source.LODS = o);
|
|
6182
6182
|
}
|
|
6183
6183
|
static getAssignedLODInformation(e) {
|
|
@@ -6219,15 +6219,15 @@ L(N, "registerMesh", (e, t, i, s, r, o) => {
|
|
|
6219
6219
|
}
|
|
6220
6220
|
c.userData || (c.userData = {}), V && console.log("> Progressive: register mesh " + i.name, { index: r, uuid: i.uuid }, o, i), N.assignLODInformation(e, c, t, s, r), N.lodInfos.set(t, o);
|
|
6221
6221
|
let h = N.lowresCache.get(t);
|
|
6222
|
-
h ? h.push(i.geometry) : h = [i.geometry], N.lowresCache.set(t, h), s > 0 && !_i(i) &&
|
|
6222
|
+
h ? h.push(i.geometry) : h = [i.geometry], N.lowresCache.set(t, h), s > 0 && !_i(i) && Yl(i, c);
|
|
6223
6223
|
for (const d of nt)
|
|
6224
6224
|
(u = d.onRegisteredNewMesh) == null || u.call(d, i, o);
|
|
6225
6225
|
}), /** A map of key = asset uuid and value = LOD information */
|
|
6226
6226
|
L(N, "lodInfos", /* @__PURE__ */ new Map()), /** cache of already loaded mesh lods */
|
|
6227
6227
|
L(N, "previouslyLoaded", /* @__PURE__ */ new Map()), /** this contains the geometry/textures that were originally loaded */
|
|
6228
|
-
L(N, "lowresCache", /* @__PURE__ */ new Map()), L(N, "workers", []), L(N, "_workersIndex", 0), L(N, "maxConcurrent", 50), L(N, "queue", new
|
|
6228
|
+
L(N, "lowresCache", /* @__PURE__ */ new Map()), L(N, "workers", []), L(N, "_workersIndex", 0), L(N, "maxConcurrent", 50), L(N, "queue", new jl(N.maxConcurrent, { debug: V != !1 }));
|
|
6229
6229
|
let Oe = N;
|
|
6230
|
-
class
|
|
6230
|
+
class sc {
|
|
6231
6231
|
constructor(e, t, i, s) {
|
|
6232
6232
|
L(this, "url");
|
|
6233
6233
|
/** the key to lookup the LOD information */
|
|
@@ -6317,7 +6317,7 @@ L(qi, "addPromise", (e, t, i, s) => {
|
|
|
6317
6317
|
r.add(e, t, i);
|
|
6318
6318
|
});
|
|
6319
6319
|
});
|
|
6320
|
-
const Me = vt("debugprogressive"),
|
|
6320
|
+
const Me = vt("debugprogressive"), rc = vt("noprogressive"), ys = Symbol("Needle:LODSManager"), xs = Symbol("Needle:LODState"), et = Symbol("Needle:CurrentLOD"), pe = { mesh_lod: -1, texture_lod: -1 };
|
|
6321
6321
|
var _e, Ne, ts, at, Ut, is, Ve;
|
|
6322
6322
|
const K = class K {
|
|
6323
6323
|
// readonly plugins: NEEDLE_progressive_plugin[] = [];
|
|
@@ -6469,7 +6469,7 @@ const K = class K {
|
|
|
6469
6469
|
(c.name === "EffectMaterial" || c.name === "CopyShader") && (o = !1);
|
|
6470
6470
|
}
|
|
6471
6471
|
if ((t.parent && t.parent.type === "CubeCamera" || i >= 1 && t.type === "OrthographicCamera") && (o = !1), o) {
|
|
6472
|
-
if (
|
|
6472
|
+
if (rc || (this.updateInterval === "auto" ? j(this, Ve) < 40 && j(this, _e) < 10 ? (Fe(this, _e, j(this, _e) + 1), Me && console.warn("↓ Reducing LOD updates", j(this, _e), j(this, Ve).toFixed(0))) : j(this, Ve) >= 60 && j(this, _e) > 1 && (Fe(this, _e, j(this, _e) - 1), Me && console.warn("↑ Increasing LOD updates", j(this, _e), j(this, Ve).toFixed(0))) : Fe(this, _e, this.updateInterval), j(this, _e) > 0 && j(this, at) % j(this, _e) != 0))
|
|
6473
6473
|
return;
|
|
6474
6474
|
this.internalUpdate(e, t), this._postprocessPromiseGroups();
|
|
6475
6475
|
}
|
|
@@ -6520,7 +6520,7 @@ const K = class K {
|
|
|
6520
6520
|
var c, h;
|
|
6521
6521
|
i.userData || (i.userData = {});
|
|
6522
6522
|
let r = i[xs];
|
|
6523
|
-
if (r || (r = new
|
|
6523
|
+
if (r || (r = new nc(), i[xs] = r), r.frames++ < 2)
|
|
6524
6524
|
return;
|
|
6525
6525
|
for (const u of nt)
|
|
6526
6526
|
(c = u.onBeforeUpdateLOD) == null || c.call(u, this.renderer, e, t, i);
|
|
@@ -6628,11 +6628,11 @@ const K = class K {
|
|
|
6628
6628
|
return;
|
|
6629
6629
|
}
|
|
6630
6630
|
if (this._tempBox.applyMatrix4(this.projectionScreenMatrix), this.renderer.xr.enabled && x.isPerspectiveCamera && x.fov > 70) {
|
|
6631
|
-
const S = this._tempBox.min,
|
|
6632
|
-
let R = S.x, k = S.y, F =
|
|
6633
|
-
const B = 2, Q = 1.5, U = (S.x +
|
|
6631
|
+
const S = this._tempBox.min, P = this._tempBox.max;
|
|
6632
|
+
let R = S.x, k = S.y, F = P.x, z = P.y;
|
|
6633
|
+
const B = 2, Q = 1.5, U = (S.x + P.x) * 0.5, O = (S.y + P.y) * 0.5;
|
|
6634
6634
|
R = (R - U) * B + U, k = (k - O) * B + O, F = (F - U) * B + U, z = (z - O) * B + O;
|
|
6635
|
-
const Y = R < 0 && F > 0 ? 0 : Math.min(Math.abs(S.x), Math.abs(
|
|
6635
|
+
const Y = R < 0 && F > 0 ? 0 : Math.min(Math.abs(S.x), Math.abs(P.x)), H = k < 0 && z > 0 ? 0 : Math.min(Math.abs(S.y), Math.abs(P.y)), fe = Math.max(Y, H);
|
|
6636
6636
|
i.lastCentrality = (Q - fe) * (Q - fe) * (Q - fe);
|
|
6637
6637
|
} else
|
|
6638
6638
|
i.lastCentrality = 1;
|
|
@@ -6640,20 +6640,20 @@ const K = class K {
|
|
|
6640
6640
|
w.multiplyScalar(0.5), screen.availHeight > 0 && m > 0 && w.multiplyScalar(m / screen.availHeight), e.isPerspectiveCamera ? w.x *= e.aspect : e.isOrthographicCamera;
|
|
6641
6641
|
const T = e.matrixWorldInverse, M = this._tempBox2;
|
|
6642
6642
|
M.copy(_), M.applyMatrix4(t.matrixWorld), M.applyMatrix4(T);
|
|
6643
|
-
const
|
|
6644
|
-
if (Math.max(w.x, w.y) != 0 && C != 0 && (w.z =
|
|
6643
|
+
const D = M.getSize(this._tempBox2Size), C = Math.max(D.x, D.y);
|
|
6644
|
+
if (Math.max(w.x, w.y) != 0 && C != 0 && (w.z = D.z / Math.max(D.x, D.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, Me && K.debugDrawLine) {
|
|
6645
6645
|
const S = this.tempMatrix.copy(this.projectionScreenMatrix);
|
|
6646
6646
|
S.invert();
|
|
6647
|
-
const
|
|
6648
|
-
|
|
6649
|
-
const z = (
|
|
6650
|
-
|
|
6647
|
+
const P = K.corner0, R = K.corner1, k = K.corner2, F = K.corner3;
|
|
6648
|
+
P.copy(this._tempBox.min), R.copy(this._tempBox.max), R.x = P.x, k.copy(this._tempBox.max), k.y = P.y, F.copy(this._tempBox.max);
|
|
6649
|
+
const z = (P.z + F.z) * 0.5;
|
|
6650
|
+
P.z = R.z = k.z = F.z = z, P.applyMatrix4(S), R.applyMatrix4(S), k.applyMatrix4(S), F.applyMatrix4(S), K.debugDrawLine(P, R, 255), K.debugDrawLine(P, k, 255), K.debugDrawLine(R, F, 255), K.debugDrawLine(k, F, 255);
|
|
6651
6651
|
}
|
|
6652
6652
|
let I = 999;
|
|
6653
6653
|
if (u && i.lastScreenCoverage > 0)
|
|
6654
6654
|
for (let S = 0; S < u.length; S++) {
|
|
6655
|
-
const
|
|
6656
|
-
if (d > 0 && jr() && !
|
|
6655
|
+
const P = u[S], k = (((g = P.densities) == null ? void 0 : g[d]) || P.density || 1e-5) / i.lastScreenCoverage;
|
|
6656
|
+
if (d > 0 && jr() && !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.")), k < s) {
|
|
6657
6657
|
I = S;
|
|
6658
6658
|
break;
|
|
6659
6659
|
}
|
|
@@ -6675,15 +6675,15 @@ const K = class K {
|
|
|
6675
6675
|
const w = i.lastScreenspaceVolume.x + i.lastScreenspaceVolume.y + i.lastScreenspaceVolume.z;
|
|
6676
6676
|
let T = i.lastScreenCoverage * 4;
|
|
6677
6677
|
((y = this.context) == null ? void 0 : y.engine) === "model-viewer" && (T *= 1.5);
|
|
6678
|
-
const
|
|
6678
|
+
const D = m / window.devicePixelRatio * T;
|
|
6679
6679
|
let C = !1;
|
|
6680
6680
|
for (let E = l.lods.length - 1; E >= 0; E--) {
|
|
6681
6681
|
const I = l.lods[E];
|
|
6682
|
-
if (!(x && I.max_height >= 2048) && !(qn() && I.max_height > 4096) && (I.max_height >
|
|
6682
|
+
if (!(x && I.max_height >= 2048) && !(qn() && I.max_height > 4096) && (I.max_height > D || !C && E === 0)) {
|
|
6683
6683
|
if (C = !0, r.texture_lod = E, Me && r.texture_lod < i.lastLodLevel_Texture) {
|
|
6684
6684
|
const A = I.max_height;
|
|
6685
6685
|
console.log(`Texture LOD changed: ${i.lastLodLevel_Texture} → ${r.texture_lod} = ${A}px
|
|
6686
|
-
Screensize: ${
|
|
6686
|
+
Screensize: ${D.toFixed(0)}px, Coverage: ${(100 * i.lastScreenCoverage).toFixed(2)}%, Volume ${w.toFixed(1)}
|
|
6687
6687
|
${t.name}`);
|
|
6688
6688
|
}
|
|
6689
6689
|
break;
|
|
@@ -6699,7 +6699,7 @@ _e = new WeakMap(), Ne = new WeakMap(), ts = new WeakMap(), at = new WeakMap(),
|
|
|
6699
6699
|
*/
|
|
6700
6700
|
L(K, "debugDrawLine"), L(K, "corner0", new b()), L(K, "corner1", new b()), L(K, "corner2", new b()), L(K, "corner3", new b()), L(K, "_tempPtInside", new b()), L(K, "skinnedMeshBoundsFrameOffsetCounter", 0), L(K, "$skinnedMeshBoundsOffset", Symbol("gltf-progressive-skinnedMeshBoundsOffset"));
|
|
6701
6701
|
let Nt = K;
|
|
6702
|
-
class
|
|
6702
|
+
class nc {
|
|
6703
6703
|
constructor() {
|
|
6704
6704
|
L(this, "frames", 0);
|
|
6705
6705
|
L(this, "lastLodLevel_Mesh", -1);
|
|
@@ -6712,7 +6712,7 @@ class rc {
|
|
|
6712
6712
|
const qr = Symbol("NEEDLE_mesh_lod"), Ii = Symbol("NEEDLE_texture_lod");
|
|
6713
6713
|
let Kt = null;
|
|
6714
6714
|
function Kn() {
|
|
6715
|
-
const a =
|
|
6715
|
+
const a = oc();
|
|
6716
6716
|
a && (a.mapURLs(function(e) {
|
|
6717
6717
|
return Yr(), e;
|
|
6718
6718
|
}), Yr(), Kt == null || Kt.disconnect(), Kt = new MutationObserver((e) => {
|
|
@@ -6723,7 +6723,7 @@ function Kn() {
|
|
|
6723
6723
|
});
|
|
6724
6724
|
}), Kt.observe(document, { childList: !0, subtree: !0 }));
|
|
6725
6725
|
}
|
|
6726
|
-
function
|
|
6726
|
+
function oc() {
|
|
6727
6727
|
if (typeof customElements > "u")
|
|
6728
6728
|
return null;
|
|
6729
6729
|
const a = customElements.get("model-viewer");
|
|
@@ -6739,11 +6739,11 @@ function Yr() {
|
|
|
6739
6739
|
});
|
|
6740
6740
|
}
|
|
6741
6741
|
const Kr = /* @__PURE__ */ new WeakSet();
|
|
6742
|
-
let
|
|
6742
|
+
let ac = 0;
|
|
6743
6743
|
function Zn(a) {
|
|
6744
6744
|
if (!a || Kr.has(a))
|
|
6745
6745
|
return null;
|
|
6746
|
-
Kr.add(a), console.debug("[gltf-progressive] found new model-viewer..." + ++
|
|
6746
|
+
Kr.add(a), console.debug("[gltf-progressive] found new model-viewer..." + ++ac + `
|
|
6747
6747
|
`, a.getAttribute("src"));
|
|
6748
6748
|
let e = null, t = null, i = null;
|
|
6749
6749
|
for (let s = a; s != null; s = Object.getPrototypeOf(s)) {
|
|
@@ -6764,7 +6764,7 @@ function Zn(a) {
|
|
|
6764
6764
|
};
|
|
6765
6765
|
console.debug("[gltf-progressive] setup model-viewer");
|
|
6766
6766
|
const r = Nt.get(e, { engine: "model-viewer" });
|
|
6767
|
-
return Nt.addPlugin(new
|
|
6767
|
+
return Nt.addPlugin(new lc()), r.enable(), r.addEventListener("changed", () => {
|
|
6768
6768
|
i == null || i.call(a);
|
|
6769
6769
|
}), a.addEventListener("model-visibility", (o) => {
|
|
6770
6770
|
o.detail.visible && (i == null || i.call(a));
|
|
@@ -6776,7 +6776,7 @@ function Zn(a) {
|
|
|
6776
6776
|
}
|
|
6777
6777
|
return null;
|
|
6778
6778
|
}
|
|
6779
|
-
class
|
|
6779
|
+
class lc {
|
|
6780
6780
|
constructor() {
|
|
6781
6781
|
L(this, "_didWarnAboutMissingUrl", !1);
|
|
6782
6782
|
}
|
|
@@ -6871,14 +6871,14 @@ function Xn(...a) {
|
|
|
6871
6871
|
return (s == null ? void 0 : s.enableLODsManager) !== !1 && r.enable(), r;
|
|
6872
6872
|
}
|
|
6873
6873
|
Kn();
|
|
6874
|
-
if (!
|
|
6874
|
+
if (!ql) {
|
|
6875
6875
|
const a = {
|
|
6876
6876
|
gltfProgressive: {
|
|
6877
6877
|
useNeedleProgressive: Xn,
|
|
6878
6878
|
LODsManager: Nt,
|
|
6879
6879
|
configureLoader: jn,
|
|
6880
6880
|
getRaycastMesh: _i,
|
|
6881
|
-
useRaycastMeshes:
|
|
6881
|
+
useRaycastMeshes: Kl
|
|
6882
6882
|
}
|
|
6883
6883
|
};
|
|
6884
6884
|
if (!globalThis.Needle)
|
|
@@ -7278,22 +7278,22 @@ var zt = Object.freeze({
|
|
|
7278
7278
|
typeof i == "string" ? this._valuesStartRepeat[e] = this._valuesStartRepeat[e] + parseFloat(i) : this._valuesStartRepeat[e] = this._valuesEnd[e], this._valuesEnd[e] = t;
|
|
7279
7279
|
}, a;
|
|
7280
7280
|
}()
|
|
7281
|
-
),
|
|
7281
|
+
), cc = "23.1.3", hc = fr.nextId, We = qs, uc = We.getAll.bind(We), fc = We.removeAll.bind(We), dc = We.add.bind(We), pc = We.remove.bind(We), mc = We.update.bind(We), me = {
|
|
7282
7282
|
Easing: zt,
|
|
7283
7283
|
Group: Jn,
|
|
7284
7284
|
Interpolation: _t,
|
|
7285
7285
|
now: Bt,
|
|
7286
7286
|
Sequence: fr,
|
|
7287
|
-
nextId:
|
|
7287
|
+
nextId: hc,
|
|
7288
7288
|
Tween: Ji,
|
|
7289
|
-
VERSION:
|
|
7290
|
-
getAll:
|
|
7291
|
-
removeAll:
|
|
7292
|
-
add:
|
|
7293
|
-
remove:
|
|
7294
|
-
update:
|
|
7289
|
+
VERSION: cc,
|
|
7290
|
+
getAll: uc,
|
|
7291
|
+
removeAll: fc,
|
|
7292
|
+
add: dc,
|
|
7293
|
+
remove: pc,
|
|
7294
|
+
update: mc
|
|
7295
7295
|
}, Zt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
7296
|
-
function
|
|
7296
|
+
function gc(a) {
|
|
7297
7297
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
7298
7298
|
}
|
|
7299
7299
|
var $n = { exports: {} };
|
|
@@ -7407,8 +7407,8 @@ var $n = { exports: {} };
|
|
|
7407
7407
|
return u ? (d = t ? t + u : u, this._events[d] && o(this, d)) : (this._events = new i(), this._eventsCount = 0), this;
|
|
7408
7408
|
}, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = t, c.EventEmitter = c, a.exports = c;
|
|
7409
7409
|
})($n);
|
|
7410
|
-
var
|
|
7411
|
-
const yt = /* @__PURE__ */
|
|
7410
|
+
var _c = $n.exports;
|
|
7411
|
+
const yt = /* @__PURE__ */ gc(_c);
|
|
7412
7412
|
var hi = function() {
|
|
7413
7413
|
var a = 0, e = document.createElement("div");
|
|
7414
7414
|
e.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", e.addEventListener("click", function(n) {
|
|
@@ -7466,18 +7466,18 @@ hi.Panel = function(a, e, t) {
|
|
|
7466
7466
|
}
|
|
7467
7467
|
};
|
|
7468
7468
|
};
|
|
7469
|
-
function
|
|
7469
|
+
function sf(a, e) {
|
|
7470
7470
|
const t = URL.createObjectURL(a), i = document.createElement("a");
|
|
7471
7471
|
i.href = t, i.download = e, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(t);
|
|
7472
7472
|
}
|
|
7473
|
-
function
|
|
7473
|
+
function vc(a) {
|
|
7474
7474
|
return a.length === 0 ? 0 : a.reduce((t, i) => t + i, 0) / a.length;
|
|
7475
7475
|
}
|
|
7476
7476
|
function Zr(a, e) {
|
|
7477
7477
|
const t = new Blob([a], { type: e });
|
|
7478
7478
|
return URL.createObjectURL(t);
|
|
7479
7479
|
}
|
|
7480
|
-
function
|
|
7480
|
+
function yc() {
|
|
7481
7481
|
return /Mac|iPod|iPhone|iPad/.test(navigator == null ? void 0 : navigator.platform) || /Mac OS|iOS/.test(navigator == null ? void 0 : navigator.userAgent);
|
|
7482
7482
|
}
|
|
7483
7483
|
function Xr(a) {
|
|
@@ -7485,7 +7485,7 @@ function Xr(a) {
|
|
|
7485
7485
|
const t = e.getContext("2d");
|
|
7486
7486
|
return e.width = a.width, e.height = a.height, t ? (t.drawImage(a, 0, 0), e.toDataURL("image/png", 0.75)) : void 0;
|
|
7487
7487
|
}
|
|
7488
|
-
function
|
|
7488
|
+
function rf(a, e = 43) {
|
|
7489
7489
|
const t = a * Math.PI / 180;
|
|
7490
7490
|
return e / (2 * Math.tan(t / 2));
|
|
7491
7491
|
}
|
|
@@ -7823,7 +7823,7 @@ var eo = {};
|
|
|
7823
7823
|
f._webAudio && t._autoResume();
|
|
7824
7824
|
var y = Math.max(0, g._seek > 0 ? g._seek : f._sprite[n][0] / 1e3), x = Math.max(0, (f._sprite[n][0] + f._sprite[n][1]) / 1e3 - y), w = x * 1e3 / Math.abs(g._rate), T = f._sprite[n][0] / 1e3, M = (f._sprite[n][0] + f._sprite[n][1]) / 1e3;
|
|
7825
7825
|
g._sprite = n, g._ended = !1;
|
|
7826
|
-
var
|
|
7826
|
+
var D = function() {
|
|
7827
7827
|
g._paused = !1, g._seek = y, g._start = T, g._stop = M, g._loop = !!(g._loop || f._sprite[n][2]);
|
|
7828
7828
|
};
|
|
7829
7829
|
if (y >= M) {
|
|
@@ -7833,9 +7833,9 @@ var eo = {};
|
|
|
7833
7833
|
var C = g._node;
|
|
7834
7834
|
if (f._webAudio) {
|
|
7835
7835
|
var E = function() {
|
|
7836
|
-
f._playLock = !1,
|
|
7837
|
-
var
|
|
7838
|
-
C.gain.setValueAtTime(
|
|
7836
|
+
f._playLock = !1, D(), f._refreshBuffer(g);
|
|
7837
|
+
var P = g._muted || f._muted ? 0 : g._volume;
|
|
7838
|
+
C.gain.setValueAtTime(P, t.ctx.currentTime), g._playStart = t.ctx.currentTime, typeof C.bufferSource.start > "u" ? g._loop ? C.bufferSource.noteGrainOn(0, y, 86400) : C.bufferSource.noteGrainOn(0, y, x) : g._loop ? C.bufferSource.start(0, y, 86400) : C.bufferSource.start(0, y, x), w !== 1 / 0 && (f._endTimers[g._id] = setTimeout(f._ended.bind(f, g), w)), l || setTimeout(function() {
|
|
7839
7839
|
f._emit("play", g._id), f._loadQueue();
|
|
7840
7840
|
}, 0);
|
|
7841
7841
|
};
|
|
@@ -7844,12 +7844,12 @@ var eo = {};
|
|
|
7844
7844
|
var I = function() {
|
|
7845
7845
|
C.currentTime = y, C.muted = g._muted || f._muted || t._muted || C.muted, C.volume = g._volume * t.volume(), C.playbackRate = g._rate;
|
|
7846
7846
|
try {
|
|
7847
|
-
var
|
|
7848
|
-
if (
|
|
7847
|
+
var P = C.play();
|
|
7848
|
+
if (P && typeof Promise < "u" && (P instanceof Promise || typeof P.then == "function") ? (f._playLock = !0, D(), P.then(function() {
|
|
7849
7849
|
f._playLock = !1, C._unlocked = !0, l ? f._loadQueue() : f._emit("play", g._id);
|
|
7850
7850
|
}).catch(function() {
|
|
7851
7851
|
f._playLock = !1, f._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;
|
|
7852
|
-
})) : l || (f._playLock = !1,
|
|
7852
|
+
})) : l || (f._playLock = !1, D(), f._emit("play", g._id)), C.playbackRate = g._rate, C.paused) {
|
|
7853
7853
|
f._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.");
|
|
7854
7854
|
return;
|
|
7855
7855
|
}
|
|
@@ -8694,18 +8694,18 @@ var eo = {};
|
|
|
8694
8694
|
};
|
|
8695
8695
|
})();
|
|
8696
8696
|
})(eo);
|
|
8697
|
-
const
|
|
8698
|
-
let
|
|
8697
|
+
const xc = "data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjQxLjEwMAAAAAAAAAAAAAAA//NwwAAAAAAAAAAAAEluZm8AAAAPAAAAFAAACOAAICAgICwsLCwsNzc3NzdDQ0NDQ09PT09PW1tbW1tmZmZmZnJycnJyfn5+fn6KioqKipWVlZWVoaGhoaGtra2trbm5ubm5xcXFxcXQ0NDQ0Nzc3Nzc6Ojo6Oj09PT09P//////AAAAAExhdmM1OC43NQAAAAAAAAAAAAAAACQCwAAAAAAAAAjgTZykiAAAAAAAAAAAAAAAAAD/80DEABJhFmQCwwYUIDsKrsHAWBMRyeJYliQJBg5RYsWU/W3z/8OLc/3AAAQiIAIjv+7vUCJXd4jucQABAE3lwffiDBD+JC58oCH8H/1h/WH//1HPwTUMFrULH9ELKxULyTodFKYbO//zQsQRFFkScKDSRhyGWpIFpG91I7Fi/F6D2RWwN6TN/t9CiVSG5wMw74ogYcHoEwTFyMmTf4KkxEwmRfjXIYv1tpIOZRv/3O9ibtjR6gYmbGCgQ+Fk0mfSmybOX1cf78g7D6nP6qxCgf/zQMQbF+EacktaSABfy+3JKszHdMgcwwcl/kNFIuAo0I0DD1fWVs/crTSTTRInof3cmIwyLBwGQqCSLq7hyvtRPBB4aFyyXHov9X///7UXKqoIIcgcHict89/0y+n+nf/C0DIjB/+P//NCxBYZU9q0AYpoAHNyXSLn/+EjEbJclC4eJT//8e5aMAWeE4////wvAyAvYjZLjAD0Lg9D0kCU/////zwwBdJcYAehKBIwtYyx6FyXC4XP//////x7l83NDpfqd6gAcA/+wu9A2FGg//NAxAwXCnsq/5M4AhQKAOwmRvQRhjhOe5S8UkAmVHpU8IVU3lwejjIcayXOOceGwjf+D05I8oAu2x382o1ZHHV//31NU4441lmqcv///+RNGrUJKImnTf//iVYK1UZquoZESSy3egH/80LEChchBtMfyzAAk191v20qimbuNqavb211BthJKSJAG2aucbdLeVFVmRjZEVvzOggIwuUFDgvEZA7UeuUqNMLOraDQ5CVCk5m9BsmT3kbNrBdolcFSsqXGwQTWyYUX2wEDEgKkvZb/80DECRYRUpWsikYY1HXLbDZksYxtCHBShdHt/DgYCOM6r8AmUSpfGZYzH7ARMBCj1JtmY/hmwoGio0XBUShoklC5GsNeDR38RQ6d01DyrENtqp6mCJ5GJUckmpUBaIgYK6C0fPjmUf/zQsQLFil+cajTBhydxPRO4mLMWWSGQF2qa1f3PPlHQDJdzCxnwgkzB1SQohrpNRYRgtobv07tBLUFc27jQdWoQY0JNpiMJy654enBVoqnQR571uq/i9rpL1oAqAupJATLLk5L+QT3Kf/zQMQOE9D2bWFaGACZyWQZdt1rd3OVY8s/y2dBlg0m12PFzdFSlYrboY6gMOE1hJp7iFqmDcopF8F2OKEPnktdThRLoy9iuyj//0vD4+qf///++38OsIIFFhpEFZMC4s+gZmilJz1X//NCxBkaW8allZI4AWPWKBoLFWrwfuYvukbk4Rt9tBuJYOBoWpfzfjQaNMp//+OGEzzzDIif3+n/4PBIEt5hjDc9zxv/////nseeNDHGg0MQwxBEFn//////4TpB9d/s9thcHddpssFg//NAxAsVCT8GX5BAAigUAPBBdOBaKEIpaajR1VyCNH/gAwAfjRX8G7B4zfx0HANA8BpjQ6FhfqKxRBQURleGbrufzJywVGVfRdOzp5///ERCxhb//8wqijBAwUYMBCjVWZsv26uwYU3/80LEERRTIuTLwxABmdQgEBGKFNo9amfRWcpnayOUsKJ/UpWo/qyL////sj1b+pc3oarStSWpf/VP+hlotDN/0MVjKMKDAZGL/Ar8QWpCR0msAoVgrMoeT3xHIZd3qARkQge7hzlejQD/80DEGxPQ5sryeYYUBCI58AEvohe5nAMDcPxAbUxN6VCB4xCid97iaTyonF0l4upInmIpD//V0f/OllFls0vEBipVlYYRWhuzlHgpEiJSRmYJQaiptezfqvKm1PBRJKiq7M3s1yoqKv/zQsQmFBEGuojBkAQdCzTSpHY0FSwdboEQKi7pZN986g7UVOkf5ZR6VdbbQwZ+79PW6VoWdwZqA4VT2QGoxuuO0VZgbATjSNkSqqresUZ4lDGM5tfbuZzGHYfri5YKg0eDjgQjhm0Wpf/zQMQxE1jyoqhoxFD16D4jzQUUULEB1QXZhRIdIbHFtSlSvX5anFh11QTHaABkiBXOXoXxGW9galRr4fRiew3yOag/4HjxOydOM9ZyyokPlRKdFBa0CjY1luBiKXXwLw6oeMWEhjoS//NCxD4TUNKKIJpMJNTRh7nf/3kekmjdSWypy9UZXQgZMDh3pnAWB4O2M6nAaelR4r1OmVPFSwoksiWRUE1zc+f1lPc0ZudtdFDr4LLpoSwwGkpVO+oD6Tlb3HsYL7d+R1//td2LQMNF//NAxEwTaP5xYqJMCFlqIwAbEoCJNDEp9/3itYVbV6Yx/v0nuLdzyy50qHQw3cafmKlb6zBo0yXeRMnQG5J4jE7j4PFAkTSpQ9pexojMMsL0PIqP/Z1Xp/TpnVZZ27eWtNWRSSSyWyz/80LEWRSo1nDhWhgAlsstlkskgADyNOHqG5rlhLnSyI0a5oClU7uw0JnJQq2kTMBUYADEskGQ9wdHohh2xMKnCubKTIdyRgT83NEIrcfJpJOL3fV7l9cyXXJwJRDGpJLTZJF1+3OPUX3/80DEYiVyorJfmlgDRVRdYm21rHJXTVH0+ajd35ouiSF1tVcmLGnFummxbrhsXfHNzcf/2qgd/7XhppiSaYkmmQGRpnCsAMAEB4tQrXVA0VOiINSMWfljtMTHsRdZ3iL/V1neW6zvLf/zQsQnDSAiMFXMGADWd4i6zvEX+W/yzud5ZUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==";
|
|
8698
|
+
let wc = class {
|
|
8699
8699
|
constructor() {
|
|
8700
8700
|
this.sound = new eo.Howl({
|
|
8701
|
-
src: [
|
|
8701
|
+
src: [xc]
|
|
8702
8702
|
});
|
|
8703
8703
|
}
|
|
8704
8704
|
play() {
|
|
8705
8705
|
this.sound.play();
|
|
8706
8706
|
}
|
|
8707
8707
|
};
|
|
8708
|
-
function
|
|
8708
|
+
function bc(a, e, t = new J()) {
|
|
8709
8709
|
if (t.makeEmpty(), !a || !e)
|
|
8710
8710
|
return t;
|
|
8711
8711
|
a.updateWorldMatrix(!0, !0), e.updateWorldMatrix(!0, !0);
|
|
@@ -8727,8 +8727,8 @@ function wc(a, e, t = new J()) {
|
|
|
8727
8727
|
n ? n(_, r) : r.fromBufferAttribute(d, _), r.applyMatrix4(s), t.expandByPoint(r), o = !0;
|
|
8728
8728
|
}), (!o || t.isEmpty()) && (t.min.set(0, 0, 0), t.max.set(0, 0, 0)), t;
|
|
8729
8729
|
}
|
|
8730
|
-
function
|
|
8731
|
-
return
|
|
8730
|
+
function Ac(a, e, t = new b()) {
|
|
8731
|
+
return bc(a, e).getSize(t);
|
|
8732
8732
|
}
|
|
8733
8733
|
const Xe = (a) => {
|
|
8734
8734
|
var e, t;
|
|
@@ -8744,22 +8744,22 @@ const Xe = (a) => {
|
|
|
8744
8744
|
} catch {
|
|
8745
8745
|
}
|
|
8746
8746
|
};
|
|
8747
|
-
function
|
|
8747
|
+
function Tc(a) {
|
|
8748
8748
|
return new b(a[0], a[1], a[2]);
|
|
8749
8749
|
}
|
|
8750
|
-
function
|
|
8750
|
+
function Sc() {
|
|
8751
8751
|
let a = 3, e = Math.max(1 / window.devicePixelRatio, 0.5);
|
|
8752
8752
|
return window.innerWidth / window.innerHeight < 0.65 && (a = 4, e = 1 / window.devicePixelRatio), { tiles: a, renderScale: e };
|
|
8753
8753
|
}
|
|
8754
|
-
function
|
|
8754
|
+
function Mc(a) {
|
|
8755
8755
|
let e = !1, t = !1, i = !1, s = 1 / 0, r = 1 / 0, o = 1 / 0, c = -1 / 0, h = -1 / 0, u = -1 / 0, d = 0, n = 0;
|
|
8756
8756
|
return a.traverse((f) => {
|
|
8757
|
-
var
|
|
8757
|
+
var D, C, E;
|
|
8758
8758
|
const m = f;
|
|
8759
8759
|
if (!(m != null && m.isMesh) || !m.geometry || m.userData.ignoreSize)
|
|
8760
8760
|
return;
|
|
8761
8761
|
const _ = m.material;
|
|
8762
|
-
if ((
|
|
8762
|
+
if ((D = _ == null ? void 0 : _.userData) != null && D.isLOGO)
|
|
8763
8763
|
return;
|
|
8764
8764
|
const p = m.geometry, g = (C = p == null ? void 0 : p.attributes) == null ? void 0 : C.position;
|
|
8765
8765
|
if (!g || g.count <= 0)
|
|
@@ -8773,12 +8773,12 @@ function Sc(a) {
|
|
|
8773
8773
|
const S = x[A] || 0;
|
|
8774
8774
|
if (S === 0)
|
|
8775
8775
|
continue;
|
|
8776
|
-
const
|
|
8776
|
+
const P = y[A];
|
|
8777
8777
|
w.push({
|
|
8778
|
-
attr:
|
|
8778
|
+
attr: P,
|
|
8779
8779
|
weight: S,
|
|
8780
|
-
array:
|
|
8781
|
-
itemSize:
|
|
8780
|
+
array: P.array,
|
|
8781
|
+
itemSize: P.itemSize ?? 3
|
|
8782
8782
|
});
|
|
8783
8783
|
}
|
|
8784
8784
|
}
|
|
@@ -8786,8 +8786,8 @@ function Sc(a) {
|
|
|
8786
8786
|
if (T && M >= 3) {
|
|
8787
8787
|
const I = g.count, A = w.length > 0;
|
|
8788
8788
|
for (let S = 0; S < I; S++) {
|
|
8789
|
-
const
|
|
8790
|
-
let R = T[
|
|
8789
|
+
const P = S * M;
|
|
8790
|
+
let R = T[P], k = T[P + 1], F = T[P + 2];
|
|
8791
8791
|
if (A)
|
|
8792
8792
|
for (let B = 0; B < w.length; B++) {
|
|
8793
8793
|
const Q = w[B], U = Q.weight;
|
|
@@ -8804,19 +8804,19 @@ function Sc(a) {
|
|
|
8804
8804
|
return;
|
|
8805
8805
|
}
|
|
8806
8806
|
for (let I = 0; I < g.count; I++) {
|
|
8807
|
-
let A = g.getX(I), S = g.getY(I),
|
|
8807
|
+
let A = g.getX(I), S = g.getY(I), P = g.getZ(I);
|
|
8808
8808
|
if (w.length > 0)
|
|
8809
8809
|
for (let k = 0; k < w.length; k++) {
|
|
8810
8810
|
const F = w[k], z = F.weight;
|
|
8811
|
-
A += F.attr.getX(I) * z, S += F.attr.getY(I) * z,
|
|
8811
|
+
A += F.attr.getX(I) * z, S += F.attr.getY(I) * z, P += F.attr.getZ(I) * z;
|
|
8812
8812
|
}
|
|
8813
|
-
A < s && (s = A), S < r && (r = S),
|
|
8813
|
+
A < s && (s = A), S < r && (r = S), P < o && (o = P), A > c && (c = A), S > h && (h = S), P > u && (u = P), S > n && (n = S);
|
|
8814
8814
|
const R = A * A + S * S;
|
|
8815
8815
|
R > d && (d = R);
|
|
8816
8816
|
}
|
|
8817
8817
|
}), s === 1 / 0 ? { box: new J(new b(0, 0, 0), new b(0, 0, 0)), maxRadius: 0, height: 0, hasWidth: t, hasLength: e, hasHeight: i } : { box: new J(new b(s, r, o), new b(c, h, u)), maxRadius: Math.sqrt(d), height: n, hasWidth: t, hasLength: e, hasHeight: i };
|
|
8818
8818
|
}
|
|
8819
|
-
function
|
|
8819
|
+
function Cc(a, e, t = null) {
|
|
8820
8820
|
let i = 0;
|
|
8821
8821
|
return function() {
|
|
8822
8822
|
let s = t || this, r = arguments;
|
|
@@ -8825,7 +8825,7 @@ function Mc(a, e, t = null) {
|
|
|
8825
8825
|
}, e);
|
|
8826
8826
|
};
|
|
8827
8827
|
}
|
|
8828
|
-
class
|
|
8828
|
+
class Ic {
|
|
8829
8829
|
constructor(e, t, i) {
|
|
8830
8830
|
this.length = e, this.width = t, this.height = i;
|
|
8831
8831
|
}
|
|
@@ -8844,12 +8844,12 @@ function dr() {
|
|
|
8844
8844
|
var e;
|
|
8845
8845
|
if (typeof navigator > "u")
|
|
8846
8846
|
return !1;
|
|
8847
|
-
if (
|
|
8847
|
+
if (Dc())
|
|
8848
8848
|
return !0;
|
|
8849
8849
|
const a = (e = navigator.userAgent) == null ? void 0 : e.toLowerCase();
|
|
8850
8850
|
return /iphone|ipad|ipod|android|mobile|blackberry|iemobile|opera mini/.test(a);
|
|
8851
8851
|
}
|
|
8852
|
-
function
|
|
8852
|
+
function Dc() {
|
|
8853
8853
|
try {
|
|
8854
8854
|
if (typeof wx < "u" && wx.getSystemInfo || typeof my < "u" && my.alert || typeof tt < "u" && tt.getSystemInfo || typeof swan < "u" && swan.getSystemInfo)
|
|
8855
8855
|
return !0;
|
|
@@ -8860,7 +8860,7 @@ function Ic() {
|
|
|
8860
8860
|
function he(a) {
|
|
8861
8861
|
return typeof a == "string" ? a.trim() : "";
|
|
8862
8862
|
}
|
|
8863
|
-
const Pc = new
|
|
8863
|
+
const Pc = new Zo(), Vt = new qo(), os = new Yo();
|
|
8864
8864
|
let Wt = "./draco/";
|
|
8865
8865
|
try {
|
|
8866
8866
|
Wt = new URL("./draco/", import.meta.url).href;
|
|
@@ -8872,8 +8872,8 @@ os.setDecoderConfig({ type: "wasm" });
|
|
|
8872
8872
|
os.setDecoderPath(Wt.endsWith("/") ? Wt : `${Wt}/`);
|
|
8873
8873
|
os.preload();
|
|
8874
8874
|
Vt.setDRACOLoader(os);
|
|
8875
|
-
const
|
|
8876
|
-
function
|
|
8875
|
+
const of = new Ko(), $r = [115, 103, 108, 98];
|
|
8876
|
+
function af(a, e, t) {
|
|
8877
8877
|
const i = JSON.stringify(e), s = new TextEncoder().encode(i), r = new Uint8Array([115, 103, 108, 98]), o = new Uint8Array(2);
|
|
8878
8878
|
o[0] = t >> 8, o[1] = t & 255;
|
|
8879
8879
|
const c = new Uint8Array(4);
|
|
@@ -8882,7 +8882,7 @@ function of(a, e, t) {
|
|
|
8882
8882
|
let n = 0;
|
|
8883
8883
|
return d.set(r, n), n += r.length, d.set(o, n), n += o.length, d.set(c, n), n += c.length, d.set(s, n), n += s.length, d.set(h, n), d.buffer;
|
|
8884
8884
|
}
|
|
8885
|
-
function
|
|
8885
|
+
function Ec(a) {
|
|
8886
8886
|
const e = new Uint8Array(a.slice(0, 4));
|
|
8887
8887
|
let t = !0;
|
|
8888
8888
|
for (let n = 0; n < $r.length; n++)
|
|
@@ -8950,13 +8950,13 @@ class $i {
|
|
|
8950
8950
|
}
|
|
8951
8951
|
}
|
|
8952
8952
|
parse(e) {
|
|
8953
|
-
return
|
|
8953
|
+
return Ec(e);
|
|
8954
8954
|
}
|
|
8955
8955
|
clear() {
|
|
8956
8956
|
[...this.cache.values()];
|
|
8957
8957
|
}
|
|
8958
8958
|
}
|
|
8959
|
-
const Ec = `*{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}`, Rc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGsAAAA7CAYAAAB8MXT7AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGTSURBVHic7dxLbQNBEIThnigADGEhxAwcBoZgCIZgBoZgCIZgCIaQMIgZVC4daw/xXPLoqdX/3fbW0milUtfutMCdpCkiLhEx1U6CLkkvkt4k7atnQYekfR7US/Us6JB0yIOaqmfBA5JWks6SrhzUwCRN+TYdq2dBx+ygDtWzoEPSNg9qVz0LOmZBgsQ3sqUkvufqAf6SpFVEnCPiFhHr1tqteCR8hyBhYrY6OlTPgo5cHX1I2lbPgo6lBInFk3Rc+uroqXqAn8ogcc3H19bae+U8eIDEZ0LSJoMEZeHIWB2ZIPEZoCw0QVlogsRnYlYWsjoaGUHCRK6OOKiRfa2OMvWtqufBAwQJE5SFJmZl4aZ6FnSQ+Azk6mjxZeFv+/fycfbDWrTW1pSFgyLxmcjVEWXh6CgLTZD4DMzKwguro4ERJEywOjIhaUdZaIAgYYKy0ABloQkSnwlxKZUHcSmVBxKfgVwdnSgLB8d35iZIfCYoC01QFpog8Y3rftFWrotO+cilVKMiSJigLDSS30hQFhr4BEcKZN0LNhDxAAAAAElFTkSuQmCC", en = { name: "", isMobile: !1 }, Lc = {
|
|
8959
|
+
const Rc = `*{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.focus.filled{border-color:#00ff95;border-radius:50%}.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}.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.focus.filled{border-color:#00ff95;border-radius:50%}.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}`, Lc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGsAAAA7CAYAAAB8MXT7AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGTSURBVHic7dxLbQNBEIThnigADGEhxAwcBoZgCIZgBoZgCIZgCIaQMIgZVC4daw/xXPLoqdX/3fbW0milUtfutMCdpCkiLhEx1U6CLkkvkt4k7atnQYekfR7US/Us6JB0yIOaqmfBA5JWks6SrhzUwCRN+TYdq2dBx+ygDtWzoEPSNg9qVz0LOmZBgsQ3sqUkvufqAf6SpFVEnCPiFhHr1tqteCR8hyBhYrY6OlTPgo5cHX1I2lbPgo6lBInFk3Rc+uroqXqAn8ogcc3H19bae+U8eIDEZ0LSJoMEZeHIWB2ZIPEZoCw0QVlogsRnYlYWsjoaGUHCRK6OOKiRfa2OMvWtqufBAwQJE5SFJmZl4aZ6FnSQ+Azk6mjxZeFv+/fycfbDWrTW1pSFgyLxmcjVEWXh6CgLTZD4DMzKwguro4ERJEywOjIhaUdZaIAgYYKy0ABloQkSnwlxKZUHcSmVBxKfgVwdnSgLB8d35iZIfCYoC01QFpog8Y3rftFWrotO+cilVKMiSJigLDSS30hQFhr4BEcKZN0LNhDxAAAAAElFTkSuQmCC", en = { name: "", isMobile: !1 }, kc = {
|
|
8960
8960
|
"&": "&",
|
|
8961
8961
|
"<": "<",
|
|
8962
8962
|
">": ">",
|
|
@@ -8964,7 +8964,7 @@ const Ec = `*{box-sizing:border-box}.slot-item-container.is-mobile .main{pointer
|
|
|
8964
8964
|
"'": "'"
|
|
8965
8965
|
};
|
|
8966
8966
|
function Xt(a) {
|
|
8967
|
-
return a == null ? "" : String(a).replace(/[&<>"']/g, (e) =>
|
|
8967
|
+
return a == null ? "" : String(a).replace(/[&<>"']/g, (e) => kc[e]);
|
|
8968
8968
|
}
|
|
8969
8969
|
function tn(...a) {
|
|
8970
8970
|
return a.filter(Boolean).join(" ");
|
|
@@ -9028,12 +9028,12 @@ class to extends HTMLElement {
|
|
|
9028
9028
|
}
|
|
9029
9029
|
set canInstall(e) {
|
|
9030
9030
|
var s;
|
|
9031
|
-
const t = !!e
|
|
9032
|
-
if (
|
|
9033
|
-
e ? i.classList.add("can-install") : i.classList.remove("can-install");
|
|
9031
|
+
const t = !!e;
|
|
9032
|
+
if (this._canInstall === t)
|
|
9034
9033
|
return;
|
|
9035
|
-
|
|
9036
|
-
|
|
9034
|
+
this._canInstall = t;
|
|
9035
|
+
const i = (s = this.shadowRoot) == null ? void 0 : s.querySelector(".main");
|
|
9036
|
+
i ? i.classList.toggle("can-install", t) : this.scheduleRender();
|
|
9037
9037
|
}
|
|
9038
9038
|
get hide() {
|
|
9039
9039
|
return this._hide;
|
|
@@ -9054,12 +9054,12 @@ class to extends HTMLElement {
|
|
|
9054
9054
|
}
|
|
9055
9055
|
set filled(e) {
|
|
9056
9056
|
var s;
|
|
9057
|
-
const t = !!e
|
|
9058
|
-
if (
|
|
9059
|
-
e ? i.classList.add("filled") : i.classList.remove("filled");
|
|
9057
|
+
const t = !!e;
|
|
9058
|
+
if (this._filled === t)
|
|
9060
9059
|
return;
|
|
9061
|
-
|
|
9062
|
-
|
|
9060
|
+
this._filled = t;
|
|
9061
|
+
const i = (s = this.shadowRoot) == null ? void 0 : s.querySelector(".main");
|
|
9062
|
+
i ? i.classList.toggle("filled", t) : this.scheduleRender();
|
|
9063
9063
|
}
|
|
9064
9064
|
get allFunctions() {
|
|
9065
9065
|
return [...this._allFunctions];
|
|
@@ -9090,12 +9090,10 @@ class to extends HTMLElement {
|
|
|
9090
9090
|
}
|
|
9091
9091
|
setSize(e = 12) {
|
|
9092
9092
|
var s;
|
|
9093
|
-
const t = Number.isFinite(e) ? Number(e) : 12
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
}
|
|
9098
|
-
this._size !== t && (this._size = t, this.scheduleRender());
|
|
9093
|
+
const t = Number.isFinite(e) ? Number(e) : 12;
|
|
9094
|
+
this._size = t;
|
|
9095
|
+
const i = (s = this.shadowRoot) == null ? void 0 : s.querySelector(".main");
|
|
9096
|
+
i ? i.style.width = i.style.height = `${t}px` : this.scheduleRender();
|
|
9099
9097
|
}
|
|
9100
9098
|
removeDevice() {
|
|
9101
9099
|
var e, t;
|
|
@@ -9141,11 +9139,11 @@ class to extends HTMLElement {
|
|
|
9141
9139
|
</div>
|
|
9142
9140
|
</div>` : "", c = this._deviceLogo ? `<img class="device-logo" src="${Xt(this._deviceLogo)}" alt="device logo">` : "", h = Xt(((d = this._slot) == null ? void 0 : d.name) ?? this._props.name ?? ""), u = Xt(this._deviceName || "待安装");
|
|
9143
9141
|
this.shadowRoot.innerHTML = `
|
|
9144
|
-
<style>${
|
|
9142
|
+
<style>${Rc}</style>
|
|
9145
9143
|
<div class="${e}">
|
|
9146
9144
|
<div class="${t}" style="width:${this._size}px;height:${this._size}px"></div>
|
|
9147
9145
|
<div class="info">
|
|
9148
|
-
<img alt="" src="${
|
|
9146
|
+
<img alt="" src="${Lc}">
|
|
9149
9147
|
<div class="name">
|
|
9150
9148
|
<div class="name-wrapper">${h}</div>
|
|
9151
9149
|
<div class="functions-wrapper">
|
|
@@ -9211,7 +9209,7 @@ const ne = {
|
|
|
9211
9209
|
class sn extends Ke {
|
|
9212
9210
|
constructor(e) {
|
|
9213
9211
|
const t = document.createElement("div");
|
|
9214
|
-
super(t), this.props = e, this._emitter = new yt(), this._slotContainer = new
|
|
9212
|
+
super(t), this.props = e, this._emitter = new yt(), this._slotContainer = new Pe(), 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 Pe(), this._showSlot = !0, this._isMirror = !1, this.beforeInstall = void 0, this._preventDefaults = (i) => {
|
|
9215
9213
|
i.preventDefault(), i.stopPropagation();
|
|
9216
9214
|
}, this.getWP = this._slotContainer.getWorldPosition.bind(this._slotContainer), t.setAttribute("data-ui-type", "slot"), this._showSlot = typeof e.show == "boolean" ? e.show : !0, this.name = e.name, this._isMirror = e.isMirror, this._slotUI = new to({
|
|
9217
9215
|
name: e.name,
|
|
@@ -9425,10 +9423,10 @@ class sn extends Ke {
|
|
|
9425
9423
|
this._slotUI.setSize(o);
|
|
9426
9424
|
}
|
|
9427
9425
|
clone(e) {
|
|
9428
|
-
return new
|
|
9426
|
+
return new Pe();
|
|
9429
9427
|
}
|
|
9430
9428
|
}
|
|
9431
|
-
class
|
|
9429
|
+
class Fc extends Ke {
|
|
9432
9430
|
constructor(e) {
|
|
9433
9431
|
const t = document.createElement("div");
|
|
9434
9432
|
super(t), this._text = document.createElement("div");
|
|
@@ -9472,7 +9470,7 @@ class kc extends Ke {
|
|
|
9472
9470
|
this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element);
|
|
9473
9471
|
}
|
|
9474
9472
|
}
|
|
9475
|
-
class Yi extends
|
|
9473
|
+
class Yi extends Pe {
|
|
9476
9474
|
constructor(e, t = !0, i = !0) {
|
|
9477
9475
|
super(), this._startWith = e, this._showText = t, this.useStartEnd = i, this._line2Length = 0.01, this._line = new zs(
|
|
9478
9476
|
new re(),
|
|
@@ -9486,7 +9484,7 @@ class Yi extends De {
|
|
|
9486
9484
|
color: "#666",
|
|
9487
9485
|
linewidth: 2
|
|
9488
9486
|
})
|
|
9489
|
-
), this._text = new
|
|
9487
|
+
), this._text = new Fc(""), this._line.frustumCulled = !1, this.add(this._line, this._line2), this._showText && (this.add(this._text), this._text.onPointMove = () => {
|
|
9490
9488
|
this._line.material.color.set("#000"), this._line2.material.color.set("#000");
|
|
9491
9489
|
}, this._text.onPointLeave = () => {
|
|
9492
9490
|
this._line.material.color.set("#666"), this._line2.material.color.set("#666");
|
|
@@ -9526,7 +9524,7 @@ class Yi extends De {
|
|
|
9526
9524
|
class io extends Ee {
|
|
9527
9525
|
// 上一次的角度
|
|
9528
9526
|
constructor(e, t) {
|
|
9529
|
-
super(), this.radius = e, this._text = new
|
|
9527
|
+
super(), this.radius = e, this._text = new Bc(""), this._line = new Yi(void 0, !1, !1), this._box = new q(), this._arc = new Ln(), this._previousPosition = null, this._updateTimer = null, this._updateDelay = 300, this._accumulatedAngle = 0, this._lastAngle = null, this._line.updateMaterial(new Us({
|
|
9530
9528
|
color: "#555",
|
|
9531
9529
|
dashSize: 0.06,
|
|
9532
9530
|
gapSize: 0.06
|
|
@@ -9593,7 +9591,7 @@ class io extends Ee {
|
|
|
9593
9591
|
return h.setPositions(s), h.instanceCount = Math.max(0, s.length / 3 - 1), h;
|
|
9594
9592
|
}
|
|
9595
9593
|
}
|
|
9596
|
-
class
|
|
9594
|
+
class Bc extends Ke {
|
|
9597
9595
|
constructor(e) {
|
|
9598
9596
|
const t = document.createElement("div");
|
|
9599
9597
|
super(t), this._wrapper = document.createElement("div"), this._circle = document.createElement("div");
|
|
@@ -9615,7 +9613,7 @@ class Fc extends Ke {
|
|
|
9615
9613
|
this._circle.style.background = e;
|
|
9616
9614
|
}
|
|
9617
9615
|
}
|
|
9618
|
-
const
|
|
9616
|
+
const Oc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAUCAYAAADY6P5TAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEvSURBVFiFzZdbFYMwEEQroRKQgAQkVEIlICEOkFAJlRAJSIgEJNx+sPS0nGxIaOhyv3nM7mTmwOViDHAFesADD+BqrakKQAcMwMQ3AWis9e1C3HLASJoAdNZ6sxG3/MZQMZy1dhWgFbfWRzDGlFjAwFlyyXdh5OD5OIqykBgBy1yiF0aMUQaJugLclOcEoP3nULmFgQgeyCwOoJGBYrijByspDM98ZIszJAt8Ks8dag/VUFYYLtetjHdruRz5JZf8WBg1Ae7KcgOluaSsMAKJwqgJ6Vz2WzcvhZHjVlFh1ESG1DQ67SYtyGs8OwujNpTkUtw4nVtbyLK1XDafF3aKW90Z3EpBbi5lE0u9n3qoNTKk9rHh3heZqqwA8Vw6a11VkVwuPK31HALzb5pfovYC2xSs5LCDIUcAAAAASUVORK5CYII=", zc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAKCAYAAACngj4SAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAChSURBVDiNrdJbFYMwEIRhJFQCEpCAhEqIhDhBAlKQgAQkIOHrSziHpmkbLvua7P4zO9s0FYUeM0b0NT2nC9FnLQho7wQ9MOwgQ3K4ZPDrrtGmFcKKkL0HTAXXw2HX6HYuFnR/hMWC6ykX+W1AzJqq1abDGguux6LoPK9aUGFOm1Y+F+Bh+7DlsSKehRXgnfdDm5od7GdeN8ADnpuKQ3ldqReHZFd3742nZgAAAABJRU5ErkJggg==", rn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAABsCAYAAACPZlfNAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAdzSURBVHic7Z3hlZs6EIUvW4E7CB3EHcQdxB08OngugVTg8yrwSQVOKnBSwW4qsFOB3cF9PxhZQsYYjEAS1neOD7ssCwPXMxoNIGWIDJJLAAsASwCfAOTyey6bLOQDABf5qJ9P8vkry48sy05j2+ySzLcBjyC5QiXOV1kuWv+hPxcAvwD8BvCBSsRL6394JDjBSC4ArFEJtG7Y5ILqwp4A/JHlxfyoC04yN/4vh/bEz9Dim9uY+/8O4EfI4nmFZEFyz1veSe5Iri0BXB13Icfekjxaxz6TPMixXXt2fJDM5WLZF+og63MPNi1IbsQGW7zyJYUToXZyEUxP8iLSPUS80hLvdYQTobbWN3fHKvMLGpKrBq/bzla4htC3C8mbutIg3JnkxrddzhCvil4omwbhDqy6IPEisV5xJFn4tsk1rDJI8wtZ+rapN+JV73PzqnuwSk7MtvkQzflabdUxGsMdIGFSnfuZZFPHPxysELjnXDOoFsTbzAJA6dumRiyxSt/2+Ma6Hlvf9lyRb9QumjAwIZKQqOLAznvEEbFUcvFS7VVXWO/WvHsTLYnVnSBEM8JgEqsDlmi7qQ++TWL1xxKtnOqgKvs5J7H6I6KdJxFNsh5FygafxLqOxVgHme6b8QIYkWqcZoW6Mr13vvMXhboi8u56x+a34eXKTWMhXSO3SQirgqZi5WSniSvS1ChyFztUoTCcetjMoNGnHbqjTQqF42P1z4pnd7IwssKUwo8Mq/uIz2eN1NWMg3vzxoUWvu3pihEa+zU/4l3RJhoRC/ZcAkKdxkfnXUC8ggE1L+tWILbartW45o1D5IIpL+tWq43du4C4BQNqXlY82jB67wJmIdhSTG/vl1FXkaP1LiB+wQCA+m5+Ya5/s7b7V5a/J7Eq0cZ/svza+FcrHEZd1ZiJh5kp/q0e1D3tqMMhMA/BgFodt1DrzJD4jyx/TmpVoo3vsqyHxTmFQ2BWHpY3ngP1Pa9h5f1AmItgQC1bXAE6JKpXVn94sSrRxocsl4AW7Iss/0xuTuIRKqfQ7dic2i9gdiHxWlu0V8yi/QLmJRhQc6jlG3T7lYboCRfVji3eoMda+mjeNhEAJ1ku31ANYQekhCNklDafTA87eTEl0YWTLHNTsNSGhYvSZvEGPWDkyY8t1xt2ua/jd0Uyah/jYinBcvt+2OTIBTgAOHi6GJ3wbKeOfkaOn09sRNM4VGcXF8N1P0wiwNmyMx+63x7HV48dnuHqpJ40ZMNbBovmUrAGsRSTjuB2PRefgokhZcPFGCSaK8FaxCqf3ecAW66Cea8juhbNhWCBiaXridRtSD61IZZRzkQbKlhIYok9ut5rCOY9Q3Ml2hDBQhNLbKoJdpBfVr4MMnEh2rOChSiW2KWeCHg3X4wO5h2woaI9I1ioYolt6gHf/RuMOpU/k+pkWVYC+GatXmCkTit1p9hOvL6JLb7JZXky+0LTjn/UgWc9rY+HhexZCuqXIzZmfAzyAdJnROsqWAxiAbUnp9bmmxJn34bdo69oXQSLRSwAt10veqwndqVFtKJh21bBWD2WHotYuo5orDzIymAyxSbuiEZbtDbBqN8hCF4soGbv3lwZbOJh00W0e4LFJhZQG81hY67UHbMIeCRak2AxigXU2q+V/QdF7sWynrSJ1nFdDGJd2y/axXnqikfhx7z+tIjWhdK3/Y+gbqpuu1yM9IU+Nt8EfUQU00ex4YU+84/m6Df55NYNgPdDXhOFb3u7wLZwaGwUXVhUdBSt8G1nV9hlvBTjpKPIFm0eiFb4tq8P7No3ZkA3NJ/hjmiFb7v6QN3Nuh8OjY3VCQffib6HJVrh256+GN5Vdtk4ZwS1xUeIaIVvO/rSy7uMf9rF7mWx0su7jH9SD31E7WWxwfoI5v0eO6QuOiYvmwgOGcGcLkZ6TnSG+kGb7m1Xw05UtnVMoXE8WJ8hYljZjL4mKXsh6HIE85SAjAvHmCqFabKcUeAYk+UYO1ePWqXpqBxBXWx3f0vLyhpL5wd4MYyoNd7bnKzX6IJ+wipkOOXUlJN8M2YMfUxNaSUh+SQHnQFWszLtfGxME2/3whJr+j4t09T2nbHE8jO1vRiSRHtAMGIZBi2M8HhO2aNGskGVYOy8i2VCXQ+bLvsJGNYfci1929OIZeQ+qG/UREjE2QcvlsIKA0cGMjrBFFjt1ZGx3EcUww/Gt2w7Z2+T890Z5/seZQJmhcjjHBMSVuW6o3GepW+bBsHqfo/pbYc5hMkGrzpG6VX3YPWWyTl24e4IVfi2axRYZVBm+h+NcKxGHdhZtm9n5VX3EOHKBo8rGVByIt5UUFdzKDbvXkIomzvCKfE2PsQzRDpYNh1lfT61TcEhwq3lItniHSX0FGMIKAKtxWveecueAbVRmW8DbESUNaopHpe4HbDrhGqU6Q9UMyao309qgyzLTsa+7E8O4LMsm/YPVPOo/QTwI8uyoMbzD04wE7ngS/l8AbBC8wUeghL/J4CPLMt+Od6/U4IWrAlpQ5aoPOSTLHNoIRfGzxfoMd9P0J74F5VIlyzLopok6H/tVqA8kSYfTwAAAABJRU5ErkJggg==", Wc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYwAAACsCAYAAABo4pvIAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAzYSURBVHic7d3hcdtIEobhD05gmYGRgbkRLDKwMjiGoBCUgeoi0F0Evo1AdASiIxAcgbkR9P1Aj9mESIm2QMwAeJ8qlihKomeXwHzsHgCsBBTOzGpJK7+pd7/2r3+ceCw69Vh8nkvt/fbW4/H7vaR//H4bfqeNX6uqij8DilPlHgCWxcxW6ibvNFmn+x/DY/Fn0mHyPXVLE7F0ejKOf3/SpRO1B9c55wJNOg6rfrD1/5v7/31pbN97j7WS9lVVnf3vAoZGYGAwPqHW6ia+tbrJce0/Tj+Lk176+k/4/ui2tAnRA/VUaNbqQjXdr8PvtDoOku/xeyoXDIXAwMXMbK1DGHzUcTikiatVN1l9Uy8YmLiG1wuY2r9+0vHrUuvwOux0/PrseF1wKQIDR06EQvw+TTatunexrXgXOwmh+ku31AJc6xAoMUxaESboITAWyoOhVjdhfAr307vQnbpQ2KlrDe2yDBSj8EBJ20S/Qml12B7S/XZp7UIQGLMX3lk2Og6Gnbqd/1u4zySAI+EghRQmH9VtS7W6bWYrKpLFIDBmJFQNf6nbwdOCc6oYvqqrFrY5xof56AXJJ53e3r5J2hIi80FgTFRoIcRwaP32Vb7TUjFgTCdaW426thYhMgMExgT4u7m1Dm2lxn+UqoatCAcUyrffRodqpPEfbcWbm0khMAoUdrBUPTTyUFC3g7UsQmPKvBJpdNzOiq3TLQFSHgKjAKGM/6xDOb+T9Le6d17bXGMDxmJmjY73g1aHRfX/ESD5ERgZhBbTZx2OOCEggOCVAEn7CQEyMgJjJL2Nv9Hxhr/NNS5gKnr7UK0uQNiHMH1mtjKzGzN7MLNnvz34Rg/gHXz/aszs3vetH75/bbyCB8pmZrVvsI/WeTSzWz8/AsCV+L536/vcj7Dv1bnHBvxkZmt/l/MUqogb3uUAefSqjx++X95R3SOLEBK0moDCER4Y3YmQuKfVBEyLh8dd2I8JDwzD+6J3hAQwP2fCo849LkyI9z/TwnVqNxESwIyF8IgL5qxD4jTfYB786KYvZnaTe0wAxudzQTraivVJdE60nDaUpACkn92GuxAed1QdCxSqCY5wAvCm3pFWj8wZM2eHk+p+VhO5xwRgWrzqSCcIPrHWMTMeFGltgmoCwCB6ax33tLMnzM+biG2nOveYAMxPWAulXTU1vUNiuRAZgFGERfJngqNwrE8AKEVoVz0xHxWEoABQqhAczE85ERQApiIEB62qMREUAKaK4BiJH4nwRFAAmDqC40rCeRQEBYBZ8Y5JumZVnXs8k9U7RO0u93gA4Br6cx2nAvyisE5B6gJYBA+OB684uFr2W3rtpzr3eABgbL31jTr3eIoUTq2/yz0WAMjNugsbPpvZbe6xFMOrimfSFACO+fyYzhhvco8nq1BVkKAAcIZXGz/M7D73WEYXqgoWtQHgAr1qo849nlGEvtwm91gAYGoWsbbBEVAAMIxw5YvH2Z23EVpQy+u/AcAV+Hkb9z63rnOPZxBhsWa+5RMAZDKbFlVIvzr3WABgrsbq4ny4xpOm/pqklaQ/q6pqr/HvAAAkn2P/lLSa1FFUIenuco8FAJYmXMiwzj2WVxEWAJBfCI0yF8PN7MYXtze5xwIASxeu+t3kHsuRMLAy0wwAFsjM1kW9kQ9hUeceCwDgWFgq2OQeSPp4wTrrQAAAZ3lo5Ks0QljQhgKAwmVrT1n3iVCEBQBMSAiNcebuUNrwmbMAMDF+ROv11539Ylf5F08AAL8tXH+qvuY/8sgVZwFg+vzkvqdrPfm9mT1e5ckBAKPz604NWwSM1vMCAIxm8HM0wiI3R0QBwMz4kVPDFAS+bjHtD+YAAJzli+DvW3IY5EkAAMV715XGaUUBwHKEOb/+nT/+wudaAMBy+KG2D7/6R42XJ6srjQsAUCCf+y+/kocvdDfXGxIAoETpIysu/eWGhW4AWK6Lz83w6oILCwLAQl1UZaS1i5HGBAAo1JtrGV5dbMYbEgCgRF5lnF6e8EuX/xh5TACAQvUvGfIh/OxW0n/GHhAAoFhbSS/bUp4kzdijAQCU6eS6dvqM7kxjAgAUKhYTqSW1Fu0oAMBLW3UZ0eHMbgDAKUcnc6ejo7huFACgzzPCpK4lVUvaV1W1zzoqAEBxPBt2ZtZ8UNeb2uYdEgCgYK2k9QdJnyR9yzsWAEDBvkr6mFpSbdahAABKtpNXGGtJrF8AAF6zSudhtDlHAQAo2l4hMAAAOGcvaaV0fC0AAOeYmVFhAAAu8kHSPl7vHACAyDOi/aDUmwIA4BUEBgDgLbV0CAwAAM5ZSdp9kJ/Bl3kwAIBy1fI1jO+S/so7FgBAwT5J+pYqjDrvWAAABWvUZUV3QgYfoAQA6IsfspdO3NuKdQwAwEtrSbuqqvYpMP6W9K+MAwIAlOmzuozo+Id8P+cbDwCgRN6OavoPPr94EACwWP1iIl588N+iLQUAOPgs6b8vHjWzmrYUACBJR0el739WGFVVtZJaM9tkGBcAoCCeBbuqqk5fPsrMbqgyAAAXrWv7L21GGREAoDhePDxe8osbqgwAWC4ze7z4qFmqDABYJj+U9u3qIvwBaxkAsDB+3ahfPyfPzB7M7O4qowIAFMfM7szsy+/8Ye3H4NbDDwsAUBIzW79rzve0oTUFADPnC923+Z8EAFAsM7v9pYXuV56o9kUQPi8DAGbm3a2oE0+48dAY5gkBANmFguBm6Ce+N7OnQZ8UAJCNLzncX+vJnzjUFgCmz4uA969bvPIPpPKFRXAAmKiwzLB6+7ff9w9dp+cFALg6v5LHeOfYhVV1jpwCgIkIc3cz9j+8ITQAYBpCWGxyDWAzamkDAPhl4VJPm9wD4RwNAChUWHfe5B6LJNpTAFAib0OVExaJf+hGeQMDgAUKb+TLPKI1pNld7rEAwFKlK40Xv1QQ+mV3uccCAEszmbBIPDSe/FP7rnsmIQAgfbzqg8+9de7x/DK/Vsl0kg4AJih0dq5zIcGx+AdzcP0pALgCn2N/zGaODYvh97SoAGAYs+3ieH/tcbL9NQAoRGhBPcx6PqVFBQC/L1xdYxlzaDiK6nHW6QgAA/F582GWLahLeP9tPos1AHAFYWH7LvdYsvJLilBtAECPVxWPi60qzmFtAwAO/IxtqopzQpo+2tifCAUABVjMEVBDscNnznJpEQCL0FvU3uQez6T4eRvpIlp3BAeAuWKuG0hI3fwfLwgAAwrnVNB+GpIfTcX6BoDJC0HBlS+uieAAMFUhKFinGBPBAWAqCIpChBeC4ABQFIKiUP7CPBEcAHIjKCYitKo4RA3AaPxUgNjx2OQeEy4UguOHB0ede0wA5qd3wt2Dma1zjwm/yV/MdFVc2lUABuFvSh+sw3kUc+Ll4m1Y57ilXQXgV/XXJwiKmeu1q+6pOgC8JlQTqe3U5B4TRmaH61WldhWL5AAk/Wxnx2qCtVB0wjsI1jqABbPuatlfwtpEk3tMKFRY64hHWDW5xwXgesxsHVpOj15Z0G3A5bwkTZcdfiY8gPnwkLin5YTBecuK8AAm7ERI3HPeBK6qFx4caQUUrHeEEyGBfM6FB/1PIA9fh7wJIfFESKA4vuYRF8wf/fs699iAOfNWU9r3LCxc17nHBrzJDhciS4fqplKY6gMYwIlW04NXFuxfV1LlHsBS+BrHWtJnSbWkVtLfknZVVW1zjQuYit4+1Ejain1oVARGBv4OKG74taSd2PiBn3oBsVb3Jmurw36yzzW2pSIwCuABciPpkwgQLNSZgIj7QZtrbOgQGAXyAGkk/aVux1mr23F2kr5J2rLzYMr8iKVah228UVc97CR9VbeNU0EUhsCYgNDCWqvbwRr/0VZdgOzEDoZChe230SEgpMP2uxUtpkkgMCbKDxds1LWxUpjsddgJW1HGY2Qn3tzUOrRYU/XAdjlRBMaMnAkR6bidtZPU8m4O7+VrDisdt06l43Boq6raZRkgBkdgzJyHSOoXx0X1Vl018l2HxUWCBEe8Yqj9tla3DaX7O3XbTmortVQO80ZgLFCYBFKQfAz39+omgr1obS2GL0KndlLaHtJjMRjSGwuqhgUiMHDkREWyCt+3OoRJqkxa8c6yeP66xttH/5pe3/S67tS9tjtJe4IBEYGBi4UwWek4TFLF0uplhbIPj+9peQ0vhMEqfP0Uvq91/Lq0IhTwGwgMDKb3Lnalw7vY9H0tDw4dqhPpUK1IIVy0wIDxduGpWy3pD70MhpWO/1/uJP2jEA5UfxgKgYFRhQmx1vGk99F/JT6WbvverfXf3aubHJM23E+/27//wqUT6htXPk1jTeoz9//Q6UCIf9/q5X/zd/WqNXGQAkZGYKB4YaLuf43300QsvZy8+9+/9fhrzoVP+8pjMdjiY0eBRiWA0v0fPGR4m68wwtkAAAAASUVORK5CYII=";
|
|
9619
9617
|
class nn extends Ke {
|
|
9620
9618
|
constructor(e, t) {
|
|
9621
9619
|
const i = document.createElement("div");
|
|
@@ -9694,11 +9692,11 @@ class nn extends Ke {
|
|
|
9694
9692
|
g.name === n.name && (p = g);
|
|
9695
9693
|
}), p)) {
|
|
9696
9694
|
const g = document.createElement("div");
|
|
9697
|
-
g.style.background = `url(${
|
|
9695
|
+
g.style.background = `url(${Wc}) center no-repeat`, g.style.backgroundSize = "100% auto", g.style.position = "absolute", g.style.top = "-50%", g.style.left = "-50%", g.style.width = s ? "140px" : "160px", g.style.height = s ? "70px" : "80px", g.style.transform = "translateX(-50%) translateY(-50%)", i.append(g);
|
|
9698
9696
|
const v = document.createElement("div");
|
|
9699
|
-
v.style.background = `url(${
|
|
9697
|
+
v.style.background = `url(${zc}) center no-repeat`, v.style.backgroundSize = "100% auto", v.style.width = v.style.height = s ? "20px" : "26px", v.style.position = "absolute", v.style.top = "0", v.style.transform = "translateY(-50%)", v.style.marginBottom = "5px", v.setAttribute("data-direction", "left"), i.append(v);
|
|
9700
9698
|
const y = document.createElement("div");
|
|
9701
|
-
y.style.background = `url(${
|
|
9699
|
+
y.style.background = `url(${Oc}) center no-repeat`, y.style.backgroundSize = "100% auto", y.style.width = y.style.height = s ? "20px" : "26px", y.style.position = "absolute", v.style.left = y.style.right = s ? "62px" : "69px", y.style.top = "0", y.style.transform = "translateY(-50%)", y.style.marginBottom = "5px", y.setAttribute("data-direction", "right"), i.append(y), Array.from([v, y]).forEach((x) => {
|
|
9702
9700
|
s || x.addEventListener("mousemove", () => {
|
|
9703
9701
|
x.style.filter = "invert(100%)";
|
|
9704
9702
|
}), x.addEventListener("mouseleave", () => {
|
|
@@ -9735,7 +9733,7 @@ class nn extends Ke {
|
|
|
9735
9733
|
this._emitter.removeAllListeners(), cancelAnimationFrame(this._looper), this.element.remove();
|
|
9736
9734
|
}
|
|
9737
9735
|
}
|
|
9738
|
-
class
|
|
9736
|
+
class Uc extends Xo {
|
|
9739
9737
|
constructor(e) {
|
|
9740
9738
|
const t = document.createElement("div");
|
|
9741
9739
|
super(t), this.props = e, this._scale = 0.01, this._emitter = new yt(), this.addEventListener = this._emitter.on.bind(this._emitter), this.removeEventListener = this._emitter.on.bind(this._emitter), this._mouseStart = new G(), this._targetSize = new G(), this._caches = [], this._sizeFlag = "width", this._direction = 1, this._lines = [], this._pointerdown = (h) => {
|
|
@@ -9766,7 +9764,7 @@ class Wc extends Zo {
|
|
|
9766
9764
|
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 = [];
|
|
9767
9765
|
}
|
|
9768
9766
|
}
|
|
9769
|
-
class
|
|
9767
|
+
class Hc extends Ee {
|
|
9770
9768
|
constructor() {
|
|
9771
9769
|
super(), this._box3 = new J(), this._line11 = new Yi("长:"), this._line12 = new Yi("宽:"), this._line13 = new Yi("高:"), this._outline = new io(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 = () => {
|
|
9772
9770
|
if (!this._app)
|
|
@@ -9820,7 +9818,7 @@ class Uc extends Ee {
|
|
|
9820
9818
|
update(e = 0) {
|
|
9821
9819
|
if (!this._object)
|
|
9822
9820
|
return;
|
|
9823
|
-
const t = this._object, { box: i, maxRadius: s, hasLength: r, hasHeight: o, hasWidth: c } =
|
|
9821
|
+
const t = this._object, { box: i, maxRadius: s, hasLength: r, hasHeight: o, hasWidth: c } = Mc(t);
|
|
9824
9822
|
this.tail = Math.abs(i.min.x), this.head = Math.abs(i.max.x), this._hasWidthConfig = c, this._hasLengthConfig = r, this._hasHeightConfig = o, this._box3.copy(i), this._radius = s, this.follow && e && (this.originOffset = (this.followOrigin - e) * this.followScale), this._outline.update(this._radius), this._change();
|
|
9825
9823
|
const h = this._box3.min.x, u = this._box3.max.x, d = this._box3.min.z, n = this._box3.max.z, l = this._box3.min.y, f = this._box3.max.y;
|
|
9826
9824
|
let m = 0.2;
|
|
@@ -9885,10 +9883,10 @@ class Be extends q {
|
|
|
9885
9883
|
this.lineSegments = new zs(s, this._lineMaterial), this.add(this.lineSegments), this.lineSegments.geometry.dispose(), this.lineSegments.geometry = s, this.lineSegments.computeLineDistances();
|
|
9886
9884
|
}
|
|
9887
9885
|
}
|
|
9888
|
-
const
|
|
9886
|
+
const Nc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAALSURBVAiZY2AAAgAABQABYlUyiAAAAABJRU5ErkJggg==";
|
|
9889
9887
|
class on {
|
|
9890
9888
|
constructor(e) {
|
|
9891
|
-
this._props = e, this.name = "", this.transparentTexture = so.load(
|
|
9889
|
+
this._props = e, this.name = "", this.transparentTexture = so.load(Nc), this._offscreen = new OffscreenCanvas(0, 0), this._defaults = { ...e }, this.target = e.target, this.parent = this.target.parent, this.reset();
|
|
9892
9890
|
}
|
|
9893
9891
|
get imageSize() {
|
|
9894
9892
|
return this._props.imageSize;
|
|
@@ -10255,20 +10253,20 @@ class an {
|
|
|
10255
10253
|
for (let A = 0; A < this._jointStates.length; A++) {
|
|
10256
10254
|
const S = this._jointStates[A];
|
|
10257
10255
|
if (S.prevAngle = S.currentAngle, S.prevAngles && S.currentAngles)
|
|
10258
|
-
for (let
|
|
10259
|
-
S.prevAngles[
|
|
10256
|
+
for (let P = 0; P < S.currentAngles.length; P++)
|
|
10257
|
+
S.prevAngles[P] = S.currentAngles[P];
|
|
10260
10258
|
}
|
|
10261
|
-
let T = m, M = _,
|
|
10259
|
+
let T = m, M = _, D = 0;
|
|
10262
10260
|
for (let A = 0; A < this.iterations; A++) {
|
|
10263
10261
|
i.getWorldPosition(s);
|
|
10264
|
-
const S = s.distanceToSquared(r),
|
|
10265
|
-
if (
|
|
10262
|
+
const S = s.distanceToSquared(r), P = S < l, R = d ? this._orientationErrorAngle() : 0, k = !d || R <= f;
|
|
10263
|
+
if (P && k)
|
|
10266
10264
|
break;
|
|
10267
10265
|
if (S >= T * 0.9 && (!d || R >= M * 0.5)) {
|
|
10268
|
-
if (
|
|
10266
|
+
if (D++, D >= 2)
|
|
10269
10267
|
break;
|
|
10270
10268
|
} else
|
|
10271
|
-
|
|
10269
|
+
D = 0;
|
|
10272
10270
|
T = S, M = R;
|
|
10273
10271
|
let F = 0, z = d ? t : e === t ? t - 1 : t;
|
|
10274
10272
|
z = Math.max(0, Math.min(this.links.length - 1, z));
|
|
@@ -10319,8 +10317,8 @@ class an {
|
|
|
10319
10317
|
}
|
|
10320
10318
|
}
|
|
10321
10319
|
}
|
|
10322
|
-
const it = new Rn(), Jt = new b(),
|
|
10323
|
-
function
|
|
10320
|
+
const it = new Rn(), Jt = new b(), Vc = new ee(), ln = new b(), cn = new b(), bs = { type: "change" }, hn = { type: "mouseDown", mode: null }, un = { type: "mouseUp", mode: null }, Gc = { type: "objectChange" }, Di = /* @__PURE__ */ new WeakMap(), Pi = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap();
|
|
10321
|
+
function Qc(a) {
|
|
10324
10322
|
if (!this.domElement)
|
|
10325
10323
|
return { x: 0, y: 0, button: a.button };
|
|
10326
10324
|
if (this.domElement.ownerDocument.pointerLockElement)
|
|
@@ -10342,7 +10340,7 @@ function Ei(a, e, t) {
|
|
|
10342
10340
|
function As(a) {
|
|
10343
10341
|
return a === "E" ? "rotate" : a === "XYZ" ? "translate" : null;
|
|
10344
10342
|
}
|
|
10345
|
-
class
|
|
10343
|
+
class jc extends Ee {
|
|
10346
10344
|
constructor(e) {
|
|
10347
10345
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
10348
10346
|
}
|
|
@@ -10426,7 +10424,7 @@ const oe = class oe extends Ee {
|
|
|
10426
10424
|
transparent: !0,
|
|
10427
10425
|
opacity: 0.7
|
|
10428
10426
|
});
|
|
10429
|
-
this._startMarker = new q(r, o), this._startMarker.renderOrder = 1 / 0, this._startMarker.visible = !1, this._endMarker = new q(r, o), this._endMarker.renderOrder = 1 / 0, this._endMarker.visible = !1, this._deltaGeom = new re(), this._deltaGeom.setAttribute("position", new Io(new Float32Array(2 * 3), 3)), this._deltaLine = new
|
|
10427
|
+
this._startMarker = new q(r, o), this._startMarker.renderOrder = 1 / 0, this._startMarker.visible = !1, this._endMarker = new q(r, o), this._endMarker.renderOrder = 1 / 0, this._endMarker.visible = !1, this._deltaGeom = new re(), this._deltaGeom.setAttribute("position", new Io(new Float32Array(2 * 3), 3)), this._deltaLine = new Do(this._deltaGeom, this._matHelper), this._deltaLine.renderOrder = 1 / 0, this._deltaLine.visible = !1, this.helper.add(this._startMarker), this.helper.add(this._endMarker), this.helper.add(this._deltaLine), this.add(this.gizmo), this.add(this.picker), this.add(this.helper);
|
|
10430
10428
|
}
|
|
10431
10429
|
get isExpanded() {
|
|
10432
10430
|
return this._isExpanded;
|
|
@@ -10504,13 +10502,13 @@ const oe = class oe extends Ee {
|
|
|
10504
10502
|
const x = t.pointStart, w = t.pointEnd;
|
|
10505
10503
|
if (x.lengthSq() > 1e-12 && w.lengthSq() > 1e-12) {
|
|
10506
10504
|
ln.set(1, 0, 0).applyQuaternion(t.cameraQuaternion), cn.set(0, 1, 0).applyQuaternion(t.cameraQuaternion);
|
|
10507
|
-
const T = x.dot(ln), M = x.dot(cn),
|
|
10505
|
+
const T = x.dot(ln), M = x.dot(cn), D = Math.atan2(M, T), C = t.rotationAngle;
|
|
10508
10506
|
if (Math.abs(C) < 1e-4)
|
|
10509
10507
|
this._arcLine.visible = !1, this._arcGeom.instanceCount = 0;
|
|
10510
10508
|
else {
|
|
10511
|
-
const E = this._arcSegments, I = Math.max(2, Math.min(E, Math.ceil(Math.abs(C) / (Math.PI * 2) * E))), A = C / I, S = oe.RING_RADIUS,
|
|
10509
|
+
const E = this._arcSegments, I = Math.max(2, Math.min(E, Math.ceil(Math.abs(C) / (Math.PI * 2) * E))), A = C / I, S = oe.RING_RADIUS, P = Math.sign(C) * this._arcStartAngleOffset;
|
|
10512
10510
|
for (let F = 0; F <= I; F++) {
|
|
10513
|
-
const z =
|
|
10511
|
+
const z = D + P + A * F, B = Math.cos(z) * S, Q = Math.sin(z) * S, U = F * 3;
|
|
10514
10512
|
this._arcPositions[U] = B, this._arcPositions[U + 1] = Q, this._arcPositions[U + 2] = 0;
|
|
10515
10513
|
}
|
|
10516
10514
|
for (let F = I + 1; F <= E; F++) {
|
|
@@ -10518,7 +10516,7 @@ const oe = class oe extends Ee {
|
|
|
10518
10516
|
this._arcPositions[z] = 0, this._arcPositions[z + 1] = 0, this._arcPositions[z + 2] = 0;
|
|
10519
10517
|
}
|
|
10520
10518
|
this._arcGeom.setPositions(this._arcPositions), this._arcGeom.instanceCount = I, this._arcLine.computeLineDistances(), this._arcGeom.computeBoundingSphere();
|
|
10521
|
-
const R = Math.cos(
|
|
10519
|
+
const R = Math.cos(D) * oe.RING_RADIUS * this._ringScale, k = Math.sin(D) * oe.RING_RADIUS * this._ringScale;
|
|
10522
10520
|
Jt.set(R, k, 0), Jt.applyQuaternion(t.cameraQuaternion), Jt.multiplyScalar(o), Jt.add(r), this._startMarker.position.copy(Jt);
|
|
10523
10521
|
}
|
|
10524
10522
|
} else
|
|
@@ -10530,7 +10528,7 @@ const oe = class oe extends Ee {
|
|
|
10530
10528
|
};
|
|
10531
10529
|
oe.RING_RADIUS = 0.18, oe.RING_TUBE = 3e-3, oe.PICKER_RING_TUBE = 0.025, oe.MOVE_RADIUS = 0.04, oe.PICKER_MOVE_RADIUS = 0.2;
|
|
10532
10530
|
let Ys = oe;
|
|
10533
|
-
class
|
|
10531
|
+
class qc extends q {
|
|
10534
10532
|
constructor() {
|
|
10535
10533
|
super(
|
|
10536
10534
|
new mi(1e5, 1e5, 2, 2),
|
|
@@ -10551,14 +10549,14 @@ class jc extends q {
|
|
|
10551
10549
|
this.position.copy(i), this.quaternion.copy(t.cameraQuaternion), super.updateMatrixWorld(e);
|
|
10552
10550
|
}
|
|
10553
10551
|
}
|
|
10554
|
-
class
|
|
10552
|
+
class Yc extends Po {
|
|
10555
10553
|
constructor(e, t = null) {
|
|
10556
10554
|
super(), this.domElement = null, this._offset = new b(), this._startNorm = new b(), this._endNorm = new b(), this._cameraScale = new b(), this._parentPosition = new b(), this._parentQuaternion = new ee(), this._parentQuaternionInv = new ee(), this._parentScale = new b(), this._worldScaleStart = new b(), this._worldQuaternionInv = new ee(), this._worldScale = new b(), this._positionStart = new b(), this._quaternionStart = new ee(), this._scaleStart = new b(), this._capturePointerId = null, this._captureDocument = null, this._hoverShieldActive = !1;
|
|
10557
|
-
const i = new
|
|
10555
|
+
const i = new jc(this);
|
|
10558
10556
|
this._root = i;
|
|
10559
10557
|
const s = new Ys(this);
|
|
10560
10558
|
this._gizmo = s, i.add(s);
|
|
10561
|
-
const r = new
|
|
10559
|
+
const r = new qc();
|
|
10562
10560
|
this._plane = r, i.add(r);
|
|
10563
10561
|
const o = this;
|
|
10564
10562
|
function c(h, u) {
|
|
@@ -10572,7 +10570,7 @@ class qc extends Do {
|
|
|
10572
10570
|
}
|
|
10573
10571
|
}), o[h] = u, r[h] = u, s[h] = u;
|
|
10574
10572
|
}
|
|
10575
|
-
c("camera", e), c("object", void 0), c("enabled", !0), c("depthTest", !0), c("axis", null), c("mode", "default"), c("space", "world"), c("size", 0.25), c("dragging", !1), c("gizmoPriority", !0), c("worldPosition", new b()), c("worldPositionStart", new b()), c("worldQuaternion", new ee()), c("worldQuaternionStart", new ee()), c("cameraPosition", new b()), c("cameraQuaternion", new ee()), c("pointStart", new b()), c("pointEnd", new b()), c("rotationAxis", new b()), c("rotationAngle", 0), c("eye", new b()), this._getPointer =
|
|
10573
|
+
c("camera", e), c("object", void 0), c("enabled", !0), c("depthTest", !0), c("axis", null), c("mode", "default"), c("space", "world"), c("size", 0.25), c("dragging", !1), c("gizmoPriority", !0), c("worldPosition", new b()), c("worldPositionStart", new b()), c("worldQuaternion", new ee()), c("worldQuaternionStart", new ee()), c("cameraPosition", new b()), c("cameraQuaternion", new ee()), c("pointStart", new b()), c("pointEnd", new b()), c("rotationAxis", new b()), c("rotationAngle", 0), c("eye", new b()), this._getPointer = Qc.bind(this), this._onPointerDown = this._handlePointerDown.bind(this), this._onPointerHover = this._handlePointerHover.bind(this), this._onPointerMove = this._handlePointerMove.bind(this), this._onPointerUp = this._handlePointerUp.bind(this), this._onPointerDownCapture = this._handlePointerDownCapture.bind(this), this._onPointerMoveCapture = this._handlePointerMoveCapture.bind(this), this._onPointerUpCapture = this._handlePointerUpCapture.bind(this), this._onMouseMoveCapture = this._handleMouseMoveCapture.bind(this), t !== null && this.connect(t);
|
|
10576
10574
|
}
|
|
10577
10575
|
connect(e) {
|
|
10578
10576
|
this.domElement = e, this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
|
|
@@ -10638,8 +10636,8 @@ class qc extends Do {
|
|
|
10638
10636
|
this._hoverShieldActive = !0;
|
|
10639
10637
|
const r = $t.get(t) ?? 0;
|
|
10640
10638
|
$t.set(t, r + 1);
|
|
10641
|
-
let o =
|
|
10642
|
-
o || (o = t.createElement("div"), o.style.position = "fixed", o.style.left = "0", o.style.top = "0", o.style.right = "0", o.style.bottom = "0", o.style.cursor = "grab", o.style.pointerEvents = "auto", o.style.background = "transparent", o.style.zIndex = "2147483647",
|
|
10639
|
+
let o = Pi.get(t);
|
|
10640
|
+
o || (o = t.createElement("div"), o.style.position = "fixed", o.style.left = "0", o.style.top = "0", o.style.right = "0", o.style.bottom = "0", o.style.cursor = "grab", o.style.pointerEvents = "auto", o.style.background = "transparent", o.style.zIndex = "2147483647", Pi.set(t, o)), o.parentElement || t.body.appendChild(o);
|
|
10643
10641
|
return;
|
|
10644
10642
|
}
|
|
10645
10643
|
if (!this._hoverShieldActive)
|
|
@@ -10648,8 +10646,8 @@ class qc extends Do {
|
|
|
10648
10646
|
const i = $t.get(t) ?? 0, s = Math.max(0, i - 1);
|
|
10649
10647
|
if (s === 0) {
|
|
10650
10648
|
$t.delete(t);
|
|
10651
|
-
const r =
|
|
10652
|
-
r != null && r.parentElement && r.parentElement.removeChild(r),
|
|
10649
|
+
const r = Pi.get(t);
|
|
10650
|
+
r != null && r.parentElement && r.parentElement.removeChild(r), Pi.delete(t);
|
|
10653
10651
|
} else
|
|
10654
10652
|
$t.set(t, s);
|
|
10655
10653
|
}
|
|
@@ -10711,7 +10709,7 @@ class qc extends Do {
|
|
|
10711
10709
|
return;
|
|
10712
10710
|
e !== null && it.setFromCamera(e, this.camera);
|
|
10713
10711
|
const r = Ei(this._plane, it, !0);
|
|
10714
|
-
r && (this.pointEnd.copy(r.point).sub(this.worldPositionStart), s === "translate" ? (this._offset.copy(this.pointEnd).sub(this.pointStart), this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), i.position.copy(this._offset).add(this._positionStart)) : s === "rotate" && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1, this.rotationAxis.applyQuaternion(this._parentQuaternionInv), i.quaternion.copy(
|
|
10712
|
+
r && (this.pointEnd.copy(r.point).sub(this.worldPositionStart), s === "translate" ? (this._offset.copy(this.pointEnd).sub(this.pointStart), this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), i.position.copy(this._offset).add(this._positionStart)) : s === "rotate" && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1, this.rotationAxis.applyQuaternion(this._parentQuaternionInv), i.quaternion.copy(Vc.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), i.quaternion.multiply(this._quaternionStart).normalize()), this.dispatchEvent(bs), this.dispatchEvent(Gc));
|
|
10715
10713
|
}
|
|
10716
10714
|
pointerUp(e) {
|
|
10717
10715
|
if (!(e !== null && e.button !== 0)) {
|
|
@@ -10725,22 +10723,22 @@ class qc extends Do {
|
|
|
10725
10723
|
_updateCursor() {
|
|
10726
10724
|
if (!this.domElement)
|
|
10727
10725
|
return;
|
|
10728
|
-
const e =
|
|
10726
|
+
const e = Di.get(this.domElement);
|
|
10729
10727
|
if (this.dragging) {
|
|
10730
|
-
this.domElement.style.cursor = "grabbing",
|
|
10728
|
+
this.domElement.style.cursor = "grabbing", Di.set(this.domElement, this);
|
|
10731
10729
|
return;
|
|
10732
10730
|
}
|
|
10733
10731
|
if (this.axis) {
|
|
10734
|
-
this.domElement.style.cursor = "grab",
|
|
10732
|
+
this.domElement.style.cursor = "grab", Di.set(this.domElement, this);
|
|
10735
10733
|
return;
|
|
10736
10734
|
}
|
|
10737
|
-
e === this && (this.domElement.style.cursor = "",
|
|
10735
|
+
e === this && (this.domElement.style.cursor = "", Di.delete(this.domElement));
|
|
10738
10736
|
}
|
|
10739
10737
|
_isAxisAllowed(e) {
|
|
10740
10738
|
return this.mode === "default" ? e === "XYZ" || e === "E" : this.mode === "translate" ? e === "XYZ" : this.mode === "rotate" ? e === "E" : !1;
|
|
10741
10739
|
}
|
|
10742
10740
|
}
|
|
10743
|
-
class
|
|
10741
|
+
class Kc {
|
|
10744
10742
|
constructor(e, t) {
|
|
10745
10743
|
var n;
|
|
10746
10744
|
this.isController = !0, this._enabled = !0, this._tmpQ = new ee(), this._tmpContainerQ = new ee(), this._tmpV = new b(), this._resetHierarchy = !1, this._defaultPoseQuats = /* @__PURE__ */ new Map(), this._zeroPoseQuats = /* @__PURE__ */ new Map(), this._emitter = new yt(), this.addListener = this._emitter.addListener.bind(this._emitter), this.removeAllListeners = this._emitter.removeAllListeners.bind(this._emitter), this._initialTargetPos = new b(), this._initialTargetQuat = new ee(), this._axesHelpers = [], this._showAxes = !1;
|
|
@@ -10752,7 +10750,7 @@ class Yc {
|
|
|
10752
10750
|
(n = i[l]) != null && n.ikTcp && (h = i[l].object);
|
|
10753
10751
|
this._effector = h ?? c[c.length - 1], this._resetHierarchy && this.setupHierarchy(c), c.forEach((l) => {
|
|
10754
10752
|
l && (this._defaultPoseQuats.has(l.uuid) || this._defaultPoseQuats.set(l.uuid, l.quaternion.clone()));
|
|
10755
|
-
}), this.transformControls = new
|
|
10753
|
+
}), this.transformControls = new Yc(t.camera, t.domElement), this.transformControls.addEventListener("dragging-changed", ({ value: l }) => {
|
|
10756
10754
|
this._emitter.emit("dragging-changed", l), l || this.syncTargetToEffector();
|
|
10757
10755
|
}), this.transformControls.addEventListener("axis-changed", ({ value: l }) => {
|
|
10758
10756
|
this.transformControls.dragging || (this.targetObject.visible = l === "E");
|
|
@@ -10862,12 +10860,12 @@ class Yc {
|
|
|
10862
10860
|
this.transformControls.detach(), this.transformControls.dispose(), this.targetObject.removeFromParent(), this._axesHelpers.forEach((e) => e.removeFromParent()), this._axesHelpers = [];
|
|
10863
10861
|
}
|
|
10864
10862
|
}
|
|
10865
|
-
const
|
|
10863
|
+
const Zc = (a, e, t, i = {}) => {
|
|
10866
10864
|
const s = [], { resetHierarchy: r, onDraggingChanged: o } = i;
|
|
10867
10865
|
return a.forEach((c) => {
|
|
10868
10866
|
if (!(c != null && c.joints) || c.joints.length < 2)
|
|
10869
10867
|
return;
|
|
10870
|
-
const h = new
|
|
10868
|
+
const h = new Kc({
|
|
10871
10869
|
joints: c.joints,
|
|
10872
10870
|
container: e,
|
|
10873
10871
|
context: {
|
|
@@ -10881,9 +10879,9 @@ const Kc = (a, e, t, i = {}) => {
|
|
|
10881
10879
|
}), s;
|
|
10882
10880
|
}, so = new En();
|
|
10883
10881
|
so.crossOrigin = "anonymous";
|
|
10884
|
-
class
|
|
10882
|
+
class Xc extends Ee {
|
|
10885
10883
|
constructor(e) {
|
|
10886
|
-
super(), this._props = e, this._emitter = new yt(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new
|
|
10884
|
+
super(), this._props = e, this._emitter = new yt(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new Pe(), this.lines = new Pe(), this._clips = [], this._actionsMap = /* @__PURE__ */ new Map(), this._animationClock = new rs(), this.sizeBox = new Hc(), this._goodsSize = new Ic(0, 0, 0), this._slots = [], this._logos = [], this._skins = [], this._levels = /* @__PURE__ */ new Map(), this._rollerLevel = /* @__PURE__ */ new Map(), this._liftBrackets = [], this._ikChains = [], this.ikControllers = [], this._ikDraggingControllers = /* @__PURE__ */ new Set(), this._shelfSyncCache = /* @__PURE__ */ new WeakMap(), this._rollerPools = /* @__PURE__ */ new WeakMap(), this._videoCache = /* @__PURE__ */ new Map(), 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.shapeKeyDirty = !1, this._materialsCache = /* @__PURE__ */ new Map(), this.opacityCache = void 0, this.actions = [], this._useCenterModel = !1, this._useLift = !1, this._columnCount = 1, this._columnGap = 0.03, this._rowCount = 1, this._rowGap = 0.01, this._levelCount = 1, 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;
|
|
10887
10885
|
}
|
|
10888
10886
|
get shapeKeys() {
|
|
10889
10887
|
return this._shapeKeys;
|
|
@@ -11120,8 +11118,8 @@ class Zc extends Ee {
|
|
|
11120
11118
|
let o = t;
|
|
11121
11119
|
r.userData[`origin_${e}`] && (o -= r.userData[`origin_${e}`]);
|
|
11122
11120
|
const c = (h = r.morphTargetDictionary) == null ? void 0 : h[e];
|
|
11123
|
-
c !== void 0 && r.morphTargetInfluences && (r.morphTargetInfluences[c] = o)
|
|
11124
|
-
}), i && this._emitter.emit("shape-key-changed", e, t);
|
|
11121
|
+
c !== void 0 && r.morphTargetInfluences && (r.morphTargetInfluences[c] = o);
|
|
11122
|
+
}), i && this._emitter.emit("shape-key-changed", e, t), this.shapeKeyDirty = !0;
|
|
11125
11123
|
}, 0);
|
|
11126
11124
|
}
|
|
11127
11125
|
_generateAmr(e, t) {
|
|
@@ -11163,7 +11161,7 @@ class Zc extends Ee {
|
|
|
11163
11161
|
h || (h = document.createElement("video"), h.src = c, h.crossOrigin = "anonymous", h.loop = !0, h.muted = !0, h.playsInline = !0, h.autoplay = !0, h.preload = "auto", this._videoCache.set(c, h)), h.play().catch(() => {
|
|
11164
11162
|
}), r.material.map && r.material.map.dispose(), r.material.emissiveMap && r.material.emissiveMap.dispose();
|
|
11165
11163
|
const u = new Eo(h);
|
|
11166
|
-
u.colorSpace = pi, r.material.map = u, r.material.emissiveMap = u, r.material.emissive || (r.material.emissive = new X(16777215)), r.material.emissiveIntensity = 1, r.material.needsUpdate = !0;
|
|
11164
|
+
u.colorSpace = pi, u.generateMipmaps = !0, u.minFilter = Ro, r.material.map = u, r.material.emissiveMap = u, r.material.emissive || (r.material.emissive = new X(16777215)), r.material.emissiveIntensity = 1, r.material.needsUpdate = !0;
|
|
11167
11165
|
}
|
|
11168
11166
|
if (r.material.userData.isBreathLight && r.material.emissiveIntensity) {
|
|
11169
11167
|
r.material.emissive || (r.material.emissive = new X(16777215)), r.material.emissiveIntensity = 2, r.material.toneMapped = !1;
|
|
@@ -11243,7 +11241,7 @@ class Zc extends Ee {
|
|
|
11243
11241
|
});
|
|
11244
11242
|
}), this.slots.forEach((r) => {
|
|
11245
11243
|
r.props.mirrorTarget && (r.mirrorTarget = this.slots.find((o) => o.props.slot.name === r.props.mirrorTarget));
|
|
11246
|
-
}), e.updateMatrixWorld(!0), this._container.add(e), this._buildJointChain(e), this._disposeIkControllers(), this._ikChains.length && (this.ikControllers =
|
|
11244
|
+
}), e.updateMatrixWorld(!0), this._container.add(e), this._buildJointChain(e), this._disposeIkControllers(), this._ikChains.length && (this.ikControllers = Zc(
|
|
11247
11245
|
this._ikChains,
|
|
11248
11246
|
this,
|
|
11249
11247
|
{
|
|
@@ -11437,7 +11435,9 @@ class Zc extends Ee {
|
|
|
11437
11435
|
}
|
|
11438
11436
|
setForkHeight(e) {
|
|
11439
11437
|
if (this._fork) {
|
|
11440
|
-
if (e > this._forkMaxHeight && (e = this._forkMaxHeight),
|
|
11438
|
+
if (e > this._forkMaxHeight && (e = this._forkMaxHeight), requestAnimationFrame(() => {
|
|
11439
|
+
this.setShapeKey("forkHeight", e, !1);
|
|
11440
|
+
}), this._fork.position.z = e, this._masts.size === 1) {
|
|
11441
11441
|
const t = this._masts.get(2), i = (t == null ? void 0 : t.userData.startHeight) || 0.1;
|
|
11442
11442
|
t && (t.position.z = (e - i) * 0.5);
|
|
11443
11443
|
}
|
|
@@ -11578,7 +11578,7 @@ class Zc extends Ee {
|
|
|
11578
11578
|
const c = s.children.find((f) => f.userData.isRollerLevelBox && !f.userData.cloned) || s.children.find((f) => f.userData.isRollerLevelBox);
|
|
11579
11579
|
if (!c)
|
|
11580
11580
|
return;
|
|
11581
|
-
const h =
|
|
11581
|
+
const h = Ac(c, s, new b()), u = this._columnGap, n = h.x + u, l = (i - 1) * n / 2;
|
|
11582
11582
|
c.position.x = o - l;
|
|
11583
11583
|
for (let f = 1; f < i; f++) {
|
|
11584
11584
|
const m = c.clone(!0);
|
|
@@ -11716,7 +11716,7 @@ class Zc extends Ee {
|
|
|
11716
11716
|
if (!Object.keys(e.morphTargetDictionary || {}).includes(t))
|
|
11717
11717
|
return;
|
|
11718
11718
|
const s = e.morphTargetDictionary[t];
|
|
11719
|
-
e.morphTargetInfluences && (e.morphTargetInfluences[s] = i),
|
|
11719
|
+
e.morphTargetInfluences && (e.morphTargetInfluences[s] = i), this.shapeKeyDirty = !0;
|
|
11720
11720
|
}
|
|
11721
11721
|
// 设置料箱料斗层数
|
|
11722
11722
|
setShelfLevel(e = 3) {
|
|
@@ -11795,7 +11795,7 @@ class Zc extends Ee {
|
|
|
11795
11795
|
min: s || 0,
|
|
11796
11796
|
max: r || 1
|
|
11797
11797
|
}, o);
|
|
11798
|
-
e.add(c), this.controllers.push(c), c.addListener("change", () => {
|
|
11798
|
+
if (e.add(c), this.controllers.push(c), c.addListener("change", () => {
|
|
11799
11799
|
this.ikControllers.forEach((h) => {
|
|
11800
11800
|
h.enabled = !1;
|
|
11801
11801
|
}), clearTimeout(this._ikControllersTimer), this._ikControllersTimer = setTimeout(() => {
|
|
@@ -11803,15 +11803,19 @@ class Zc extends Ee {
|
|
|
11803
11803
|
h.enabled = !0, h.syncTargetToEffector();
|
|
11804
11804
|
});
|
|
11805
11805
|
}, 100);
|
|
11806
|
-
}),
|
|
11807
|
-
this.
|
|
11808
|
-
|
|
11806
|
+
}), o.userData.isFork || o.userData.isLift || o.userData.isJack) {
|
|
11807
|
+
this._forkMaxHeight = r || 1, this._liftMaxHeight = r || 1, this._jackMaxHeight = r || 1;
|
|
11808
|
+
const h = o.position.z;
|
|
11809
|
+
this.setForkHeight(h), this.setLiftHeight(h), this.setJackHeight(h), c.addListener("change", (u) => {
|
|
11810
|
+
this.setForkHeight(u), this.setLiftHeight(u), this.setJackHeight(u);
|
|
11811
|
+
});
|
|
11812
|
+
}
|
|
11809
11813
|
}
|
|
11810
11814
|
}
|
|
11811
11815
|
}
|
|
11812
11816
|
generateDimension(e, t) {
|
|
11813
11817
|
if (e.userData.isDimension) {
|
|
11814
|
-
const i = e.userData.divider, s =
|
|
11818
|
+
const i = e.userData.divider, s = Tc(e.userData.startOrigin), r = e.userData.axios;
|
|
11815
11819
|
let o, c;
|
|
11816
11820
|
if (r === "x" ? (o = new b(e.userData.start - e.position.x, 0, 0), c = o.clone().setX(e.userData.end - e.position.x)) : r === "z" ? (o = new b(0, e.userData.start - e.position.y, 0), c = o.clone().setY(e.userData.end - e.position.y)) : (o = new b(0, 0, e.userData.start - e.position.z), c = o.clone().setZ(e.userData.end - e.position.z)), !Object.keys(e.userData).flatMap((n) => {
|
|
11817
11821
|
var f;
|
|
@@ -11821,7 +11825,7 @@ class Zc extends Ee {
|
|
|
11821
11825
|
return l ? [l] : [];
|
|
11822
11826
|
}).length)
|
|
11823
11827
|
return;
|
|
11824
|
-
const d = new
|
|
11828
|
+
const d = new Uc({
|
|
11825
11829
|
start: o,
|
|
11826
11830
|
end: c,
|
|
11827
11831
|
startOrigin: s,
|
|
@@ -11923,7 +11927,7 @@ class Zc extends Ee {
|
|
|
11923
11927
|
n !== s && n !== r && (n.stopFading(), n.setEffectiveWeight(0), n.stop());
|
|
11924
11928
|
});
|
|
11925
11929
|
const u = (t == null ? void 0 : t.loop) ?? !1;
|
|
11926
|
-
(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(u ?
|
|
11930
|
+
(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(u ? Lo : ko, u ? 1 / 0 : 1), s.clampWhenFinished = (t == null ? void 0 : t.clampWhenFinished) ?? !u, s.play();
|
|
11927
11931
|
const d = (t == null ? void 0 : t.timeScale) ?? 1;
|
|
11928
11932
|
return h ? (r.stopFading(), r.enabled = !0, r.setEffectiveWeight(1), r.crossFadeTo(s, c, !1)) : c > 0 && s.fadeIn(c), s.setEffectiveTimeScale(d), this._currentAction = s, new Promise((n) => {
|
|
11929
11933
|
this._pendingFinishedCallback && this._mixer && this._mixer.removeEventListener("finished", this._pendingFinishedCallback);
|
|
@@ -11965,20 +11969,30 @@ class Zc extends Ee {
|
|
|
11965
11969
|
}, e * 1e3);
|
|
11966
11970
|
})) : (this._mixer.stopAllAction(), Promise.resolve())) : Promise.resolve();
|
|
11967
11971
|
}
|
|
11972
|
+
/**
|
|
11973
|
+
* 手动触发所有视频纹理的播放。
|
|
11974
|
+
* 移动端浏览器通常禁止自动播放,需要在用户交互(如点击)后调用此方法。
|
|
11975
|
+
*/
|
|
11976
|
+
playVideos() {
|
|
11977
|
+
this._videoCache.forEach((e) => {
|
|
11978
|
+
e.play().catch(() => {
|
|
11979
|
+
});
|
|
11980
|
+
});
|
|
11981
|
+
}
|
|
11968
11982
|
}
|
|
11969
|
-
const ro = 0,
|
|
11970
|
-
function
|
|
11983
|
+
const ro = 0, Jc = 1, $c = 2, fn = 2, Ts = 1.25, dn = 1, ui = 6 * 4 + 4 + 4, as = 65535, eh = Math.pow(2, -24), Ss = Symbol("SKIP_GENERATION");
|
|
11984
|
+
function th(a) {
|
|
11971
11985
|
return a.index ? a.index.count : a.attributes.position.count;
|
|
11972
11986
|
}
|
|
11973
11987
|
function Qt(a) {
|
|
11974
|
-
return
|
|
11988
|
+
return th(a) / 3;
|
|
11975
11989
|
}
|
|
11976
|
-
function
|
|
11990
|
+
function ih(a, e = ArrayBuffer) {
|
|
11977
11991
|
return a > 65535 ? new Uint32Array(new e(4 * a)) : new Uint16Array(new e(2 * a));
|
|
11978
11992
|
}
|
|
11979
|
-
function
|
|
11993
|
+
function sh(a, e) {
|
|
11980
11994
|
if (!a.index) {
|
|
11981
|
-
const t = a.attributes.position.count, i = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, s =
|
|
11995
|
+
const t = a.attributes.position.count, i = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, s = ih(t, i);
|
|
11982
11996
|
a.setIndex(new ve(s, 1));
|
|
11983
11997
|
for (let r = 0; r < t; r++)
|
|
11984
11998
|
s[r] = r;
|
|
@@ -12009,7 +12023,7 @@ function oo(a) {
|
|
|
12009
12023
|
}
|
|
12010
12024
|
return e;
|
|
12011
12025
|
}
|
|
12012
|
-
function
|
|
12026
|
+
function rh(a) {
|
|
12013
12027
|
if (a.groups.length === 0)
|
|
12014
12028
|
return !1;
|
|
12015
12029
|
const e = Qt(a), t = oo(a).sort((r, o) => r.offset - o.offset), i = t[t.length - 1];
|
|
@@ -12022,14 +12036,14 @@ function Ms(a, e, t, i, s) {
|
|
|
12022
12036
|
for (let g = e * 6, v = (e + t) * 6; g < v; g += 6) {
|
|
12023
12037
|
const y = a[g + 0], x = a[g + 1], w = y - x, T = y + x;
|
|
12024
12038
|
w < r && (r = w), T > h && (h = T), y < n && (n = y), y > m && (m = y);
|
|
12025
|
-
const M = a[g + 2],
|
|
12039
|
+
const M = a[g + 2], D = a[g + 3], C = M - D, E = M + D;
|
|
12026
12040
|
C < o && (o = C), E > u && (u = E), M < l && (l = M), M > _ && (_ = M);
|
|
12027
|
-
const I = a[g + 4], A = a[g + 5], S = I - A,
|
|
12028
|
-
S < c && (c = S),
|
|
12041
|
+
const I = a[g + 4], A = a[g + 5], S = I - A, P = I + A;
|
|
12042
|
+
S < c && (c = S), P > d && (d = P), I < f && (f = I), I > p && (p = I);
|
|
12029
12043
|
}
|
|
12030
12044
|
i[0] = r, i[1] = o, i[2] = c, i[3] = h, i[4] = u, i[5] = d, s[0] = n, s[1] = l, s[2] = f, s[3] = m, s[4] = _, s[5] = p;
|
|
12031
12045
|
}
|
|
12032
|
-
function
|
|
12046
|
+
function nh(a, e = null, t = null, i = null) {
|
|
12033
12047
|
const s = a.attributes.position, r = a.index ? a.index.array : null, o = Qt(a), c = s.normalized;
|
|
12034
12048
|
let h;
|
|
12035
12049
|
e === null ? (h = new Float32Array(o * 6 * 4), t = 0, i = o) : (h = e, t = t || 0, i = i || o);
|
|
@@ -12046,10 +12060,10 @@ function rh(a, e = null, t = null, i = null) {
|
|
|
12046
12060
|
c ? (x = s[l[y]](p), w = s[l[y]](g), T = s[l[y]](v)) : (x = u[p + y], w = u[g + y], T = u[v + y]);
|
|
12047
12061
|
let M = x;
|
|
12048
12062
|
w < M && (M = w), T < M && (M = T);
|
|
12049
|
-
let
|
|
12050
|
-
w >
|
|
12051
|
-
const C = (
|
|
12052
|
-
h[_ + E + 0] = M + C, h[_ + E + 1] = C + (Math.abs(M) + C) *
|
|
12063
|
+
let D = x;
|
|
12064
|
+
w > D && (D = w), T > D && (D = T);
|
|
12065
|
+
const C = (D - M) / 2, E = y * 2;
|
|
12066
|
+
h[_ + E + 0] = M + C, h[_ + E + 1] = C + (Math.abs(M) + C) * eh;
|
|
12053
12067
|
}
|
|
12054
12068
|
}
|
|
12055
12069
|
return h;
|
|
@@ -12085,20 +12099,20 @@ function ei(a) {
|
|
|
12085
12099
|
const e = a[3] - a[0], t = a[4] - a[1], i = a[5] - a[2];
|
|
12086
12100
|
return 2 * (e * t + t * i + i * e);
|
|
12087
12101
|
}
|
|
12088
|
-
const Ue = 32,
|
|
12102
|
+
const Ue = 32, oh = (a, e) => a.candidate - e.candidate, st = new Array(Ue).fill().map(() => ({
|
|
12089
12103
|
count: 0,
|
|
12090
12104
|
bounds: new Float32Array(6),
|
|
12091
12105
|
rightCacheBounds: new Float32Array(6),
|
|
12092
12106
|
leftCacheBounds: new Float32Array(6),
|
|
12093
12107
|
candidate: 0
|
|
12094
12108
|
})), Li = new Float32Array(6);
|
|
12095
|
-
function
|
|
12109
|
+
function ah(a, e, t, i, s, r) {
|
|
12096
12110
|
let o = -1, c = 0;
|
|
12097
12111
|
if (r === ro)
|
|
12098
12112
|
o = pn(e), o !== -1 && (c = (e[o] + e[o + 3]) / 2);
|
|
12099
|
-
else if (r ===
|
|
12100
|
-
o = pn(a), o !== -1 && (c =
|
|
12101
|
-
else if (r ===
|
|
12113
|
+
else if (r === Jc)
|
|
12114
|
+
o = pn(a), o !== -1 && (c = lh(t, i, s, o));
|
|
12115
|
+
else if (r === $c) {
|
|
12102
12116
|
const h = ei(a);
|
|
12103
12117
|
let u = Ts * s;
|
|
12104
12118
|
const d = i * 6, n = (i + s) * 6;
|
|
@@ -12114,13 +12128,13 @@ function oh(a, e, t, i, s, r) {
|
|
|
12114
12128
|
const {
|
|
12115
12129
|
bounds: T,
|
|
12116
12130
|
leftCacheBounds: M,
|
|
12117
|
-
rightCacheBounds:
|
|
12131
|
+
rightCacheBounds: D
|
|
12118
12132
|
} = w;
|
|
12119
12133
|
for (let C = 0; C < 3; C++)
|
|
12120
|
-
|
|
12134
|
+
D[C] = 1 / 0, D[C + 3] = -1 / 0, M[C] = 1 / 0, M[C + 3] = -1 / 0, T[C] = 1 / 0, T[C + 3] = -1 / 0;
|
|
12121
12135
|
Ri(x, t, T);
|
|
12122
12136
|
}
|
|
12123
|
-
g.sort(
|
|
12137
|
+
g.sort(oh);
|
|
12124
12138
|
let y = s;
|
|
12125
12139
|
for (let x = 0; x < y; x++) {
|
|
12126
12140
|
const w = g[x];
|
|
@@ -12135,9 +12149,9 @@ function oh(a, e, t, i, s, r) {
|
|
|
12135
12149
|
}
|
|
12136
12150
|
}
|
|
12137
12151
|
for (let x = 0; x < y; x++) {
|
|
12138
|
-
const w = g[x], T = w.count, M = s - w.count,
|
|
12152
|
+
const w = g[x], T = w.count, M = s - w.count, D = w.leftCacheBounds, C = w.rightCacheBounds;
|
|
12139
12153
|
let E = 0;
|
|
12140
|
-
T !== 0 && (E = ei(
|
|
12154
|
+
T !== 0 && (E = ei(D) / h);
|
|
12141
12155
|
let I = 0;
|
|
12142
12156
|
M !== 0 && (I = ei(C) / h);
|
|
12143
12157
|
const A = dn + Ts * (E * T + I * M);
|
|
@@ -12165,12 +12179,12 @@ function oh(a, e, t, i, s, r) {
|
|
|
12165
12179
|
}
|
|
12166
12180
|
let v = 0;
|
|
12167
12181
|
for (let y = 0; y < Ue - 1; y++) {
|
|
12168
|
-
const x = st[y], w = x.count, T = x.bounds,
|
|
12182
|
+
const x = st[y], w = x.count, T = x.bounds, D = st[y + 1].rightCacheBounds;
|
|
12169
12183
|
w !== 0 && (v === 0 ? mn(T, Li) : gn(T, Li, Li)), v += w;
|
|
12170
12184
|
let C = 0, E = 0;
|
|
12171
12185
|
v !== 0 && (C = ei(Li) / h);
|
|
12172
12186
|
const I = s - v;
|
|
12173
|
-
I !== 0 && (E = ei(
|
|
12187
|
+
I !== 0 && (E = ei(D) / h);
|
|
12174
12188
|
const A = dn + Ts * (C * v + E * I);
|
|
12175
12189
|
A < u && (o = l, u = A, c = x.candidate);
|
|
12176
12190
|
}
|
|
@@ -12180,7 +12194,7 @@ function oh(a, e, t, i, s, r) {
|
|
|
12180
12194
|
console.warn(`MeshBVH: Invalid build strategy value ${r} used.`);
|
|
12181
12195
|
return { axis: o, pos: c };
|
|
12182
12196
|
}
|
|
12183
|
-
function
|
|
12197
|
+
function lh(a, e, t, i) {
|
|
12184
12198
|
let s = 0;
|
|
12185
12199
|
for (let r = e, o = e + t; r < o; r++)
|
|
12186
12200
|
s += a[r * 6 + i * 2];
|
|
@@ -12191,7 +12205,7 @@ class Cs {
|
|
|
12191
12205
|
this.boundingData = new Float32Array(6);
|
|
12192
12206
|
}
|
|
12193
12207
|
}
|
|
12194
|
-
function
|
|
12208
|
+
function ch(a, e, t, i, s, r) {
|
|
12195
12209
|
let o = i, c = i + s - 1;
|
|
12196
12210
|
const h = r.pos, u = r.axis * 2;
|
|
12197
12211
|
for (; ; ) {
|
|
@@ -12213,7 +12227,7 @@ function lh(a, e, t, i, s, r) {
|
|
|
12213
12227
|
return o;
|
|
12214
12228
|
}
|
|
12215
12229
|
}
|
|
12216
|
-
function
|
|
12230
|
+
function hh(a, e, t, i, s, r) {
|
|
12217
12231
|
let o = i, c = i + s - 1;
|
|
12218
12232
|
const h = r.pos, u = r.axis * 2;
|
|
12219
12233
|
for (; ; ) {
|
|
@@ -12252,11 +12266,11 @@ function ao(a, e) {
|
|
|
12252
12266
|
return e[a + 7];
|
|
12253
12267
|
}
|
|
12254
12268
|
let lo, li, Ki, co;
|
|
12255
|
-
const
|
|
12269
|
+
const uh = Math.pow(2, 32);
|
|
12256
12270
|
function Ks(a) {
|
|
12257
12271
|
return "count" in a ? 1 : 1 + Ks(a.left) + Ks(a.right);
|
|
12258
12272
|
}
|
|
12259
|
-
function
|
|
12273
|
+
function fh(a, e, t) {
|
|
12260
12274
|
return lo = new Float32Array(t), li = new Uint32Array(t), Ki = new Uint16Array(t), co = new Uint8Array(t), Zs(a, e);
|
|
12261
12275
|
}
|
|
12262
12276
|
function Zs(a, e) {
|
|
@@ -12279,18 +12293,18 @@ function Zs(a, e) {
|
|
|
12279
12293
|
else {
|
|
12280
12294
|
const o = e.left, c = e.right, h = e.splitAxis;
|
|
12281
12295
|
let u;
|
|
12282
|
-
if (u = Zs(a + ui, o), u / 4 >
|
|
12296
|
+
if (u = Zs(a + ui, o), u / 4 > uh)
|
|
12283
12297
|
throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");
|
|
12284
12298
|
return li[t + 6] = u / 4, u = Zs(u, c), li[t + 7] = h, u;
|
|
12285
12299
|
}
|
|
12286
12300
|
}
|
|
12287
|
-
function
|
|
12301
|
+
function dh(a, e) {
|
|
12288
12302
|
const t = (a.index ? a.index.count : a.attributes.position.count) / 3, i = t > 2 ** 16, s = i ? 4 : 2, r = e ? new SharedArrayBuffer(t * s) : new ArrayBuffer(t * s), o = i ? new Uint32Array(r) : new Uint16Array(r);
|
|
12289
12303
|
for (let c = 0, h = o.length; c < h; c++)
|
|
12290
12304
|
o[c] = c;
|
|
12291
12305
|
return o;
|
|
12292
12306
|
}
|
|
12293
|
-
function
|
|
12307
|
+
function ph(a, e, t, i, s) {
|
|
12294
12308
|
const {
|
|
12295
12309
|
maxDepth: r,
|
|
12296
12310
|
verbose: o,
|
|
@@ -12298,17 +12312,17 @@ function dh(a, e, t, i, s) {
|
|
|
12298
12312
|
strategy: h,
|
|
12299
12313
|
onProgress: u,
|
|
12300
12314
|
indirect: d
|
|
12301
|
-
} = s, n = a._indirectBuffer, l = a.geometry, f = l.index ? l.index.array : null, m = d ?
|
|
12315
|
+
} = s, n = a._indirectBuffer, l = a.geometry, f = l.index ? l.index.array : null, m = d ? hh : ch, _ = Qt(l), p = new Float32Array(6);
|
|
12302
12316
|
let g = !1;
|
|
12303
12317
|
const v = new Cs();
|
|
12304
12318
|
return Ms(e, t, i, v.boundingData, p), x(v, t, i, p), v;
|
|
12305
12319
|
function y(w) {
|
|
12306
12320
|
u && u(w / _);
|
|
12307
12321
|
}
|
|
12308
|
-
function x(w, T, M,
|
|
12322
|
+
function x(w, T, M, D = null, C = 0) {
|
|
12309
12323
|
if (!g && C >= r && (g = !0, o && (console.warn(`MeshBVH: Max depth of ${r} reached when generating BVH. Consider increasing maxDepth.`), console.warn(l))), M <= c || C >= r)
|
|
12310
12324
|
return y(T + M), w.offset = T, w.count = M, w;
|
|
12311
|
-
const E =
|
|
12325
|
+
const E = ah(w.boundingData, D, e, T, M, h);
|
|
12312
12326
|
if (E.axis === -1)
|
|
12313
12327
|
return y(T + M), w.offset = T, w.count = M, w;
|
|
12314
12328
|
const I = m(n, f, e, T, M, E);
|
|
@@ -12316,23 +12330,23 @@ function dh(a, e, t, i, s) {
|
|
|
12316
12330
|
y(T + M), w.offset = T, w.count = M;
|
|
12317
12331
|
else {
|
|
12318
12332
|
w.splitAxis = E.axis;
|
|
12319
|
-
const A = new Cs(), S = T,
|
|
12320
|
-
w.left = A, Ms(e, S,
|
|
12321
|
-
const R = new Cs(), k = I, F = M -
|
|
12333
|
+
const A = new Cs(), S = T, P = I - T;
|
|
12334
|
+
w.left = A, Ms(e, S, P, A.boundingData, p), x(A, S, P, p, C + 1);
|
|
12335
|
+
const R = new Cs(), k = I, F = M - P;
|
|
12322
12336
|
w.right = R, Ms(e, k, F, R.boundingData, p), x(R, k, F, p, C + 1);
|
|
12323
12337
|
}
|
|
12324
12338
|
return w;
|
|
12325
12339
|
}
|
|
12326
12340
|
}
|
|
12327
|
-
function
|
|
12341
|
+
function mh(a, e) {
|
|
12328
12342
|
const t = a.geometry;
|
|
12329
|
-
e.indirect && (a._indirectBuffer =
|
|
12343
|
+
e.indirect && (a._indirectBuffer = dh(t, e.useSharedArrayBuffer), rh(t) && !e.verbose && console.warn(
|
|
12330
12344
|
'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.'
|
|
12331
|
-
)), a._indirectBuffer ||
|
|
12332
|
-
const i = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, s =
|
|
12345
|
+
)), a._indirectBuffer || sh(t, e);
|
|
12346
|
+
const i = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, s = nh(t), r = e.indirect ? no(t) : oo(t);
|
|
12333
12347
|
a._roots = r.map((o) => {
|
|
12334
|
-
const c =
|
|
12335
|
-
return
|
|
12348
|
+
const c = ph(a, s, o.offset, o.count, e), h = Ks(c), u = new i(ui * h);
|
|
12349
|
+
return fh(0, c, u), u;
|
|
12336
12350
|
});
|
|
12337
12351
|
}
|
|
12338
12352
|
class Je {
|
|
@@ -12374,7 +12388,7 @@ Je.prototype.setFromBox = function() {
|
|
|
12374
12388
|
this.min = o, this.max = c;
|
|
12375
12389
|
};
|
|
12376
12390
|
}();
|
|
12377
|
-
const
|
|
12391
|
+
const gh = function() {
|
|
12378
12392
|
const a = new b(), e = new b(), t = new b();
|
|
12379
12393
|
return function(s, r, o) {
|
|
12380
12394
|
const c = s.start, h = a, u = r.start, d = e;
|
|
@@ -12386,7 +12400,7 @@ const mh = function() {
|
|
|
12386
12400
|
}(), pr = function() {
|
|
12387
12401
|
const a = new G(), e = new b(), t = new b();
|
|
12388
12402
|
return function(s, r, o, c) {
|
|
12389
|
-
|
|
12403
|
+
gh(s, r, a);
|
|
12390
12404
|
let h = a.x, u = a.y;
|
|
12391
12405
|
if (h >= 0 && h <= 1 && u >= 0 && u <= 1) {
|
|
12392
12406
|
s.at(h, o), r.at(u, c);
|
|
@@ -12412,7 +12426,7 @@ const mh = function() {
|
|
|
12412
12426
|
}
|
|
12413
12427
|
}
|
|
12414
12428
|
};
|
|
12415
|
-
}(),
|
|
12429
|
+
}(), _h = function() {
|
|
12416
12430
|
const a = new b(), e = new b(), t = new or(), i = new Ye();
|
|
12417
12431
|
return function(r, o) {
|
|
12418
12432
|
const { radius: c, center: h } = r, { a: u, b: d, c: n } = o;
|
|
@@ -12426,16 +12440,16 @@ const mh = function() {
|
|
|
12426
12440
|
}
|
|
12427
12441
|
return !1;
|
|
12428
12442
|
};
|
|
12429
|
-
}(),
|
|
12443
|
+
}(), vh = 1e-15;
|
|
12430
12444
|
function Is(a) {
|
|
12431
|
-
return Math.abs(a) <
|
|
12445
|
+
return Math.abs(a) < vh;
|
|
12432
12446
|
}
|
|
12433
12447
|
class Re extends oi {
|
|
12434
12448
|
constructor(...e) {
|
|
12435
12449
|
super(...e), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new b()), this.satBounds = new Array(4).fill().map(() => new Je()), this.points = [this.a, this.b, this.c], this.sphere = new ns(), this.plane = new or(), this.needsUpdate = !0;
|
|
12436
12450
|
}
|
|
12437
12451
|
intersectsSphere(e) {
|
|
12438
|
-
return
|
|
12452
|
+
return _h(e, this);
|
|
12439
12453
|
}
|
|
12440
12454
|
update() {
|
|
12441
12455
|
const e = this.a, t = this.b, i = this.c, s = this.points, r = this.satAxes, o = this.satBounds, c = r[0], h = o[0];
|
|
@@ -12468,15 +12482,15 @@ Re.prototype.intersectsTriangle = function() {
|
|
|
12468
12482
|
for (let w = 0; w < 3; w++) {
|
|
12469
12483
|
const { start: T, end: M } = d;
|
|
12470
12484
|
T.copy(v[w]), M.copy(v[(w + 1) % 3]), d.delta(o);
|
|
12471
|
-
const
|
|
12472
|
-
if (Is(p.normal.dot(o)) &&
|
|
12485
|
+
const D = Is(p.distanceToPoint(T));
|
|
12486
|
+
if (Is(p.normal.dot(o)) && D) {
|
|
12473
12487
|
g.copy(d), y = 2;
|
|
12474
12488
|
break;
|
|
12475
12489
|
}
|
|
12476
12490
|
const C = p.intersectLine(d, f);
|
|
12477
|
-
if (!C &&
|
|
12491
|
+
if (!C && D && f.copy(T), (C || D) && !Is(f.distanceTo(M))) {
|
|
12478
12492
|
if (y <= 1)
|
|
12479
|
-
(y === 1 ? g.start : g.end).copy(f),
|
|
12493
|
+
(y === 1 ? g.start : g.end).copy(f), D && (x = y);
|
|
12480
12494
|
else if (y >= 2) {
|
|
12481
12495
|
(x === 1 ? g.start : g.end).copy(f), y = 2;
|
|
12482
12496
|
break;
|
|
@@ -12498,17 +12512,17 @@ Re.prototype.intersectsTriangle = function() {
|
|
|
12498
12512
|
if (i.setFromPoints(I, t), E.isSeparated(i))
|
|
12499
12513
|
return !1;
|
|
12500
12514
|
}
|
|
12501
|
-
const M = p.satBounds,
|
|
12515
|
+
const M = p.satBounds, D = p.satAxes;
|
|
12502
12516
|
e[0] = this.a, e[1] = this.b, e[2] = this.c;
|
|
12503
12517
|
for (let C = 0; C < 4; C++) {
|
|
12504
|
-
const E = M[C], I =
|
|
12518
|
+
const E = M[C], I = D[C];
|
|
12505
12519
|
if (i.setFromPoints(I, e), E.isSeparated(i))
|
|
12506
12520
|
return !1;
|
|
12507
12521
|
}
|
|
12508
12522
|
for (let C = 0; C < 4; C++) {
|
|
12509
12523
|
const E = T[C];
|
|
12510
12524
|
for (let I = 0; I < 4; I++) {
|
|
12511
|
-
const A =
|
|
12525
|
+
const A = D[I];
|
|
12512
12526
|
if (r.crossVectors(E, A), i.setFromPoints(r, e), s.setFromPoints(r, t), i.isSeparated(s))
|
|
12513
12527
|
return !1;
|
|
12514
12528
|
}
|
|
@@ -12529,8 +12543,8 @@ Re.prototype.intersectsTriangle = function() {
|
|
|
12529
12543
|
let S = l.start;
|
|
12530
12544
|
l.start = l.end, l.end = S;
|
|
12531
12545
|
}
|
|
12532
|
-
const M = n.start.dot(c),
|
|
12533
|
-
return M !== E && C !==
|
|
12546
|
+
const M = n.start.dot(c), D = n.end.dot(c), C = l.start.dot(c), E = l.end.dot(c), I = D < C, A = M < E;
|
|
12547
|
+
return M !== E && C !== D && I === A ? !1 : (g && (u.subVectors(n.start, l.start), u.dot(c) > 0 ? g.start.copy(n.start) : g.start.copy(l.start), u.subVectors(n.end, l.end), u.dot(c) < 0 ? g.end.copy(n.end) : g.end.copy(l.end)), !0);
|
|
12534
12548
|
}
|
|
12535
12549
|
};
|
|
12536
12550
|
}();
|
|
@@ -12668,10 +12682,10 @@ ue.prototype.distanceToBox = function() {
|
|
|
12668
12682
|
for (let p = 0; p < 3; p++)
|
|
12669
12683
|
for (let g = 0; g <= 1; g++)
|
|
12670
12684
|
for (let v = 0; v <= 1; v++) {
|
|
12671
|
-
const y = (p + 1) % 3, x = (p + 2) % 3, w = g << y | v << x, T = 1 << p | g << y | v << x, M = f[w],
|
|
12672
|
-
e[_].set(M,
|
|
12673
|
-
const E = a[p], I = a[y], A = a[x], S = t[_],
|
|
12674
|
-
|
|
12685
|
+
const y = (p + 1) % 3, x = (p + 2) % 3, w = g << y | v << x, T = 1 << p | g << y | v << x, M = f[w], D = f[T];
|
|
12686
|
+
e[_].set(M, D);
|
|
12687
|
+
const E = a[p], I = a[y], A = a[x], S = t[_], P = S.start, R = S.end;
|
|
12688
|
+
P[E] = n[E], P[I] = g ? n[I] : l[I], P[A] = v ? n[A] : l[I], R[E] = l[E], R[I] = g ? n[I] : l[I], R[A] = v ? n[A] : l[I], _++;
|
|
12675
12689
|
}
|
|
12676
12690
|
for (let p = 0; p <= 1; p++)
|
|
12677
12691
|
for (let g = 0; g <= 1; g++)
|
|
@@ -12706,13 +12720,13 @@ class mr {
|
|
|
12706
12720
|
this._primitives.push(e);
|
|
12707
12721
|
}
|
|
12708
12722
|
}
|
|
12709
|
-
class
|
|
12723
|
+
class yh extends mr {
|
|
12710
12724
|
constructor() {
|
|
12711
12725
|
super(() => new Re());
|
|
12712
12726
|
}
|
|
12713
12727
|
}
|
|
12714
|
-
const Te = /* @__PURE__ */ new
|
|
12715
|
-
class
|
|
12728
|
+
const Te = /* @__PURE__ */ new yh();
|
|
12729
|
+
class xh {
|
|
12716
12730
|
constructor() {
|
|
12717
12731
|
this.float32Array = null, this.uint16Array = null, this.uint32Array = null;
|
|
12718
12732
|
const e = [];
|
|
@@ -12724,10 +12738,10 @@ class yh {
|
|
|
12724
12738
|
};
|
|
12725
12739
|
}
|
|
12726
12740
|
}
|
|
12727
|
-
const Z = new
|
|
12741
|
+
const Z = new xh();
|
|
12728
12742
|
let lt, Ot;
|
|
12729
12743
|
const Tt = [], ki = /* @__PURE__ */ new mr(() => new J());
|
|
12730
|
-
function
|
|
12744
|
+
function wh(a, e, t, i, s, r) {
|
|
12731
12745
|
lt = ki.getPrimitive(), Ot = ki.getPrimitive(), Tt.push(lt, Ot), Z.setBuffer(a._roots[e]);
|
|
12732
12746
|
const o = Xs(0, a.geometry, t, i, s, r);
|
|
12733
12747
|
Z.clearBuffer(), ki.releasePrimitive(lt), ki.releasePrimitive(Ot), Tt.pop(), Tt.pop();
|
|
@@ -12742,17 +12756,17 @@ function Xs(a, e, t, i, s = null, r = 0, o = 0) {
|
|
|
12742
12756
|
return $(a, c, lt), i(l, f, !1, o, r + a, lt);
|
|
12743
12757
|
} else {
|
|
12744
12758
|
let E = function(A) {
|
|
12745
|
-
const { uint16Array: S, uint32Array:
|
|
12759
|
+
const { uint16Array: S, uint32Array: P } = Z;
|
|
12746
12760
|
let R = A * 2;
|
|
12747
12761
|
for (; !ge(R, S); )
|
|
12748
12762
|
A = be(A), R = A * 2;
|
|
12749
|
-
return ye(A,
|
|
12763
|
+
return ye(A, P);
|
|
12750
12764
|
}, I = function(A) {
|
|
12751
|
-
const { uint16Array: S, uint32Array:
|
|
12765
|
+
const { uint16Array: S, uint32Array: P } = Z;
|
|
12752
12766
|
let R = A * 2;
|
|
12753
12767
|
for (; !ge(R, S); )
|
|
12754
|
-
A = Ae(A,
|
|
12755
|
-
return ye(A,
|
|
12768
|
+
A = Ae(A, P), R = A * 2;
|
|
12769
|
+
return ye(A, P) + we(R, S);
|
|
12756
12770
|
};
|
|
12757
12771
|
const l = be(a), f = Ae(a, u);
|
|
12758
12772
|
let m = l, _ = f, p, g, v, y;
|
|
@@ -12765,8 +12779,8 @@ function Xs(a, e, t, i, s = null, r = 0, o = 0) {
|
|
|
12765
12779
|
const x = ge(m * 2, h), w = t(v, x, p, o + 1, r + m);
|
|
12766
12780
|
let T;
|
|
12767
12781
|
if (w === fn) {
|
|
12768
|
-
const A = E(m),
|
|
12769
|
-
T = i(A,
|
|
12782
|
+
const A = E(m), P = I(m) - A;
|
|
12783
|
+
T = i(A, P, !0, o + 1, r + m, v);
|
|
12770
12784
|
} else
|
|
12771
12785
|
T = w && Xs(
|
|
12772
12786
|
m,
|
|
@@ -12780,13 +12794,13 @@ function Xs(a, e, t, i, s = null, r = 0, o = 0) {
|
|
|
12780
12794
|
if (T)
|
|
12781
12795
|
return !0;
|
|
12782
12796
|
y = Ot, $(_, c, y);
|
|
12783
|
-
const M = ge(_ * 2, h),
|
|
12797
|
+
const M = ge(_ * 2, h), D = t(y, M, g, o + 1, r + _);
|
|
12784
12798
|
let C;
|
|
12785
|
-
if (
|
|
12786
|
-
const A = E(_),
|
|
12787
|
-
C = i(A,
|
|
12799
|
+
if (D === fn) {
|
|
12800
|
+
const A = E(_), P = I(_) - A;
|
|
12801
|
+
C = i(A, P, !0, o + 1, r + _, y);
|
|
12788
12802
|
} else
|
|
12789
|
-
C =
|
|
12803
|
+
C = D && Xs(
|
|
12790
12804
|
_,
|
|
12791
12805
|
e,
|
|
12792
12806
|
t,
|
|
@@ -12798,8 +12812,8 @@ function Xs(a, e, t, i, s = null, r = 0, o = 0) {
|
|
|
12798
12812
|
return !!C;
|
|
12799
12813
|
}
|
|
12800
12814
|
}
|
|
12801
|
-
const ti = /* @__PURE__ */ new b(),
|
|
12802
|
-
function
|
|
12815
|
+
const ti = /* @__PURE__ */ new b(), Ds = /* @__PURE__ */ new b();
|
|
12816
|
+
function bh(a, e, t = {}, i = 0, s = 1 / 0) {
|
|
12803
12817
|
const r = i * i, o = s * s;
|
|
12804
12818
|
let c = 1 / 0, h = null;
|
|
12805
12819
|
if (a.shapecast(
|
|
@@ -12809,18 +12823,18 @@ function wh(a, e, t = {}, i = 0, s = 1 / 0) {
|
|
|
12809
12823
|
intersectsTriangle: (d, n) => {
|
|
12810
12824
|
d.closestPointToPoint(e, ti);
|
|
12811
12825
|
const l = e.distanceToSquared(ti);
|
|
12812
|
-
return l < c && (
|
|
12826
|
+
return l < c && (Ds.copy(ti), c = l, h = n), l < r;
|
|
12813
12827
|
}
|
|
12814
12828
|
}
|
|
12815
12829
|
), c === 1 / 0)
|
|
12816
12830
|
return null;
|
|
12817
12831
|
const u = Math.sqrt(c);
|
|
12818
|
-
return t.point ? t.point.copy(
|
|
12832
|
+
return t.point ? t.point.copy(Ds) : t.point = Ds.clone(), t.distance = u, t.faceIndex = h, t;
|
|
12819
12833
|
}
|
|
12820
12834
|
const St = /* @__PURE__ */ new b(), Mt = /* @__PURE__ */ new b(), Ct = /* @__PURE__ */ new b(), Fi = /* @__PURE__ */ new G(), Bi = /* @__PURE__ */ new G(), Oi = /* @__PURE__ */ new G(), _n = /* @__PURE__ */ new b(), vn = /* @__PURE__ */ new b(), yn = /* @__PURE__ */ new b(), zi = /* @__PURE__ */ new b();
|
|
12821
|
-
function
|
|
12835
|
+
function Ah(a, e, t, i, s, r, o, c) {
|
|
12822
12836
|
let h;
|
|
12823
|
-
if (r ===
|
|
12837
|
+
if (r === Dn ? h = a.intersectTriangle(i, t, e, !0, s) : h = a.intersectTriangle(e, t, i, r !== gi, s), h === null)
|
|
12824
12838
|
return null;
|
|
12825
12839
|
const u = a.origin.distanceTo(s);
|
|
12826
12840
|
return u < o || u > c ? null : {
|
|
@@ -12828,9 +12842,9 @@ function bh(a, e, t, i, s, r, o, c) {
|
|
|
12828
12842
|
point: s.clone()
|
|
12829
12843
|
};
|
|
12830
12844
|
}
|
|
12831
|
-
function
|
|
12845
|
+
function Th(a, e, t, i, s, r, o, c, h, u, d) {
|
|
12832
12846
|
St.fromBufferAttribute(e, r), Mt.fromBufferAttribute(e, o), Ct.fromBufferAttribute(e, c);
|
|
12833
|
-
const n =
|
|
12847
|
+
const n = Ah(a, St, Mt, Ct, zi, h, u, d);
|
|
12834
12848
|
if (n) {
|
|
12835
12849
|
i && (Fi.fromBufferAttribute(i, r), Bi.fromBufferAttribute(i, o), Oi.fromBufferAttribute(i, c), n.uv = oi.getInterpolation(zi, St, Mt, Ct, Fi, Bi, Oi, new G())), s && (Fi.fromBufferAttribute(s, r), Bi.fromBufferAttribute(s, o), Oi.fromBufferAttribute(s, c), n.uv1 = oi.getInterpolation(zi, St, Mt, Ct, Fi, Bi, Oi, new G())), t && (_n.fromBufferAttribute(t, r), vn.fromBufferAttribute(t, o), yn.fromBufferAttribute(t, c), n.normal = oi.getInterpolation(zi, St, Mt, Ct, _n, vn, yn, new b()), n.normal.dot(a.direction) > 0 && n.normal.multiplyScalar(-1));
|
|
12836
12850
|
const l = {
|
|
@@ -12849,7 +12863,7 @@ function ls(a, e, t, i, s, r, o) {
|
|
|
12849
12863
|
let h = c + 0, u = c + 1, d = c + 2;
|
|
12850
12864
|
const n = a.index;
|
|
12851
12865
|
a.index && (h = n.getX(h), u = n.getX(u), d = n.getX(d));
|
|
12852
|
-
const { position: l, normal: f, uv: m, uv1: _ } = a.attributes, p =
|
|
12866
|
+
const { position: l, normal: f, uv: m, uv1: _ } = a.attributes, p = Th(t, l, f, m, _, h, u, d, e, r, o);
|
|
12853
12867
|
return p ? (p.faceIndex = i, s && s.push(p), p) : null;
|
|
12854
12868
|
}
|
|
12855
12869
|
function ie(a, e, t, i) {
|
|
@@ -12857,12 +12871,12 @@ function ie(a, e, t, i) {
|
|
|
12857
12871
|
let c = e, h = e + 1, u = e + 2;
|
|
12858
12872
|
t && (c = t.getX(c), h = t.getX(h), u = t.getX(u)), s.x = i.getX(c), s.y = i.getY(c), s.z = i.getZ(c), r.x = i.getX(h), r.y = i.getY(h), r.z = i.getZ(h), o.x = i.getX(u), o.y = i.getY(u), o.z = i.getZ(u);
|
|
12859
12873
|
}
|
|
12860
|
-
function
|
|
12874
|
+
function Sh(a, e, t, i, s, r, o, c) {
|
|
12861
12875
|
const { geometry: h, _indirectBuffer: u } = a;
|
|
12862
12876
|
for (let d = i, n = i + s; d < n; d++)
|
|
12863
12877
|
ls(h, e, t, d, r, o, c);
|
|
12864
12878
|
}
|
|
12865
|
-
function
|
|
12879
|
+
function Mh(a, e, t, i, s, r, o) {
|
|
12866
12880
|
const { geometry: c, _indirectBuffer: h } = a;
|
|
12867
12881
|
let u = 1 / 0, d = null;
|
|
12868
12882
|
for (let n = i, l = i + s; n < l; n++) {
|
|
@@ -12871,7 +12885,7 @@ function Sh(a, e, t, i, s, r, o) {
|
|
|
12871
12885
|
}
|
|
12872
12886
|
return d;
|
|
12873
12887
|
}
|
|
12874
|
-
function
|
|
12888
|
+
function Ch(a, e, t, i, s, r, o) {
|
|
12875
12889
|
const { geometry: c } = t, { index: h } = c, u = c.attributes.position;
|
|
12876
12890
|
for (let d = a, n = e + a; d < n; d++) {
|
|
12877
12891
|
let l;
|
|
@@ -12880,7 +12894,7 @@ function Mh(a, e, t, i, s, r, o) {
|
|
|
12880
12894
|
}
|
|
12881
12895
|
return !1;
|
|
12882
12896
|
}
|
|
12883
|
-
function
|
|
12897
|
+
function Ih(a, e = null) {
|
|
12884
12898
|
e && Array.isArray(e) && (e = new Set(e));
|
|
12885
12899
|
const t = a.geometry, i = t.index ? t.index.array : null, s = t.attributes.position;
|
|
12886
12900
|
let r, o, c, h, u = 0;
|
|
@@ -12891,26 +12905,26 @@ function Ch(a, e = null) {
|
|
|
12891
12905
|
const _ = l * 2;
|
|
12892
12906
|
if (c[_ + 15] === as) {
|
|
12893
12907
|
const g = o[l + 6], v = c[_ + 14];
|
|
12894
|
-
let y = 1 / 0, x = 1 / 0, w = 1 / 0, T = -1 / 0, M = -1 / 0,
|
|
12908
|
+
let y = 1 / 0, x = 1 / 0, w = 1 / 0, T = -1 / 0, M = -1 / 0, D = -1 / 0;
|
|
12895
12909
|
for (let C = 3 * g, E = 3 * (g + v); C < E; C++) {
|
|
12896
12910
|
let I = i[C];
|
|
12897
|
-
const A = s.getX(I), S = s.getY(I),
|
|
12898
|
-
A < y && (y = A), A > T && (T = A), S < x && (x = S), S > M && (M = S),
|
|
12911
|
+
const A = s.getX(I), S = s.getY(I), P = s.getZ(I);
|
|
12912
|
+
A < y && (y = A), A > T && (T = A), S < x && (x = S), S > M && (M = S), P < w && (w = P), P > D && (D = P);
|
|
12899
12913
|
}
|
|
12900
|
-
return h[l + 0] !== y || h[l + 1] !== x || h[l + 2] !== w || h[l + 3] !== T || h[l + 4] !== M || h[l + 5] !==
|
|
12914
|
+
return h[l + 0] !== y || h[l + 1] !== x || h[l + 2] !== w || h[l + 3] !== T || h[l + 4] !== M || h[l + 5] !== D ? (h[l + 0] = y, h[l + 1] = x, h[l + 2] = w, h[l + 3] = T, h[l + 4] = M, h[l + 5] = D, !0) : !1;
|
|
12901
12915
|
} else {
|
|
12902
12916
|
const g = l + 8, v = o[l + 6], y = g + f, x = v + f;
|
|
12903
12917
|
let w = m, T = !1, M = !1;
|
|
12904
12918
|
e ? w || (T = e.has(y), M = e.has(x), w = !T && !M) : (T = !0, M = !0);
|
|
12905
|
-
const
|
|
12919
|
+
const D = w || T, C = w || M;
|
|
12906
12920
|
let E = !1;
|
|
12907
|
-
|
|
12921
|
+
D && (E = n(g, f, w));
|
|
12908
12922
|
let I = !1;
|
|
12909
12923
|
C && (I = n(v, f, w));
|
|
12910
12924
|
const A = E || I;
|
|
12911
12925
|
if (A)
|
|
12912
12926
|
for (let S = 0; S < 3; S++) {
|
|
12913
|
-
const
|
|
12927
|
+
const P = g + S, R = v + S, k = h[P], F = h[P + 3], z = h[R], B = h[R + 3];
|
|
12914
12928
|
h[l + S] = k < z ? k : z, h[l + S + 3] = F > B ? F : B;
|
|
12915
12929
|
}
|
|
12916
12930
|
return A;
|
|
@@ -12923,7 +12937,7 @@ function ut(a, e, t, i, s) {
|
|
|
12923
12937
|
let g = e[a], v = e[a + 3], y = e[a + 1], x = e[a + 3 + 1], w = e[a + 2], T = e[a + 3 + 2];
|
|
12924
12938
|
return n >= 0 ? (r = (g - m) * n, o = (v - m) * n) : (r = (v - m) * n, o = (g - m) * n), l >= 0 ? (c = (y - _) * l, h = (x - _) * l) : (c = (x - _) * l, h = (y - _) * l), r > h || c > o || ((c > r || isNaN(r)) && (r = c), (h < o || isNaN(o)) && (o = h), f >= 0 ? (u = (w - p) * f, d = (T - p) * f) : (u = (T - p) * f, d = (w - p) * f), r > d || u > o) ? !1 : ((u > r || r !== r) && (r = u), (d < o || o !== o) && (o = d), r <= s && o >= i);
|
|
12925
12939
|
}
|
|
12926
|
-
function
|
|
12940
|
+
function Dh(a, e, t, i, s, r, o, c) {
|
|
12927
12941
|
const { geometry: h, _indirectBuffer: u } = a;
|
|
12928
12942
|
for (let d = i, n = i + s; d < n; d++) {
|
|
12929
12943
|
let l = u ? u[d] : d;
|
|
@@ -12939,7 +12953,7 @@ function Ph(a, e, t, i, s, r, o) {
|
|
|
12939
12953
|
}
|
|
12940
12954
|
return d;
|
|
12941
12955
|
}
|
|
12942
|
-
function
|
|
12956
|
+
function Eh(a, e, t, i, s, r, o) {
|
|
12943
12957
|
const { geometry: c } = t, { index: h } = c, u = c.attributes.position;
|
|
12944
12958
|
for (let d = a, n = e + a; d < n; d++) {
|
|
12945
12959
|
let l;
|
|
@@ -12948,14 +12962,14 @@ function Dh(a, e, t, i, s, r, o) {
|
|
|
12948
12962
|
}
|
|
12949
12963
|
return !1;
|
|
12950
12964
|
}
|
|
12951
|
-
function
|
|
12965
|
+
function Rh(a, e, t, i, s, r, o) {
|
|
12952
12966
|
Z.setBuffer(a._roots[e]), Js(0, a, t, i, s, r, o), Z.clearBuffer();
|
|
12953
12967
|
}
|
|
12954
12968
|
function Js(a, e, t, i, s, r, o) {
|
|
12955
12969
|
const { float32Array: c, uint16Array: h, uint32Array: u } = Z, d = a * 2;
|
|
12956
12970
|
if (ge(d, h)) {
|
|
12957
12971
|
const l = ye(a, u), f = we(d, h);
|
|
12958
|
-
|
|
12972
|
+
Sh(e, t, i, l, f, s, r, o);
|
|
12959
12973
|
} else {
|
|
12960
12974
|
const l = be(a);
|
|
12961
12975
|
ut(l, c, i, r, o) && Js(l, e, t, i, s, r, o);
|
|
@@ -12963,8 +12977,8 @@ function Js(a, e, t, i, s, r, o) {
|
|
|
12963
12977
|
ut(f, c, i, r, o) && Js(f, e, t, i, s, r, o);
|
|
12964
12978
|
}
|
|
12965
12979
|
}
|
|
12966
|
-
const
|
|
12967
|
-
function
|
|
12980
|
+
const Lh = ["x", "y", "z"];
|
|
12981
|
+
function kh(a, e, t, i, s, r) {
|
|
12968
12982
|
Z.setBuffer(a._roots[e]);
|
|
12969
12983
|
const o = $s(0, a, t, i, s, r);
|
|
12970
12984
|
return Z.clearBuffer(), o;
|
|
@@ -12974,9 +12988,9 @@ function $s(a, e, t, i, s, r) {
|
|
|
12974
12988
|
let u = a * 2;
|
|
12975
12989
|
if (ge(u, c)) {
|
|
12976
12990
|
const n = ye(a, h), l = we(u, c);
|
|
12977
|
-
return
|
|
12991
|
+
return Mh(e, t, i, n, l, s, r);
|
|
12978
12992
|
} else {
|
|
12979
|
-
const n = ao(a, h), l =
|
|
12993
|
+
const n = ao(a, h), l = Lh[n], m = i.direction[l] >= 0;
|
|
12980
12994
|
let _, p;
|
|
12981
12995
|
m ? (_ = be(a), p = Ae(a, h)) : (_ = Ae(a, h), p = be(a));
|
|
12982
12996
|
const v = ut(_, o, i, s, r) ? $s(_, e, t, i, s, r) : null;
|
|
@@ -12992,8 +13006,8 @@ function $s(a, e, t, i, s, r) {
|
|
|
12992
13006
|
return v && x ? v.distance <= x.distance ? v : x : v || x || null;
|
|
12993
13007
|
}
|
|
12994
13008
|
}
|
|
12995
|
-
const Wi = /* @__PURE__ */ new J(), It = /* @__PURE__ */ new Re(),
|
|
12996
|
-
function
|
|
13009
|
+
const Wi = /* @__PURE__ */ new J(), It = /* @__PURE__ */ new Re(), Dt = /* @__PURE__ */ new Re(), ii = /* @__PURE__ */ new te(), xn = /* @__PURE__ */ new ue(), Ui = /* @__PURE__ */ new ue();
|
|
13010
|
+
function Fh(a, e, t, i) {
|
|
12997
13011
|
Z.setBuffer(a._roots[e]);
|
|
12998
13012
|
const s = er(0, a, t, i);
|
|
12999
13013
|
return Z.clearBuffer(), s;
|
|
@@ -13009,7 +13023,7 @@ function er(a, e, t, i, s = null) {
|
|
|
13009
13023
|
intersectsTriangle: (v) => {
|
|
13010
13024
|
v.a.applyMatrix4(i), v.b.applyMatrix4(i), v.c.applyMatrix4(i), v.needsUpdate = !0;
|
|
13011
13025
|
for (let y = _ * 3, x = (p + _) * 3; y < x; y += 3)
|
|
13012
|
-
if (ie(
|
|
13026
|
+
if (ie(Dt, y, n, l), Dt.needsUpdate = !0, v.intersectsTriangle(Dt))
|
|
13013
13027
|
return !0;
|
|
13014
13028
|
return !1;
|
|
13015
13029
|
}
|
|
@@ -13017,7 +13031,7 @@ function er(a, e, t, i, s = null) {
|
|
|
13017
13031
|
for (let g = _ * 3, v = (p + _) * 3; g < v; g += 3) {
|
|
13018
13032
|
ie(It, g, n, l), It.a.applyMatrix4(ii), It.b.applyMatrix4(ii), It.c.applyMatrix4(ii), It.needsUpdate = !0;
|
|
13019
13033
|
for (let y = 0, x = f.count; y < x; y += 3)
|
|
13020
|
-
if (ie(
|
|
13034
|
+
if (ie(Dt, y, f, m), Dt.needsUpdate = !0, It.intersectsTriangle(Dt))
|
|
13021
13035
|
return !0;
|
|
13022
13036
|
}
|
|
13023
13037
|
} else {
|
|
@@ -13025,29 +13039,29 @@ function er(a, e, t, i, s = null) {
|
|
|
13025
13039
|
return $(d, r, Wi), !!(s.intersectsBox(Wi) && er(d, e, t, i, s) || ($(n, r, Wi), s.intersectsBox(Wi) && er(n, e, t, i, s)));
|
|
13026
13040
|
}
|
|
13027
13041
|
}
|
|
13028
|
-
const Hi = /* @__PURE__ */ new te(),
|
|
13029
|
-
function
|
|
13030
|
-
e.boundingBox || e.computeBoundingBox(),
|
|
13042
|
+
const Hi = /* @__PURE__ */ new te(), Ps = /* @__PURE__ */ new ue(), si = /* @__PURE__ */ new ue(), Bh = /* @__PURE__ */ new b(), Oh = /* @__PURE__ */ new b(), zh = /* @__PURE__ */ new b(), Wh = /* @__PURE__ */ new b();
|
|
13043
|
+
function Uh(a, e, t, i = {}, s = {}, r = 0, o = 1 / 0) {
|
|
13044
|
+
e.boundingBox || e.computeBoundingBox(), Ps.set(e.boundingBox.min, e.boundingBox.max, t), Ps.needsUpdate = !0;
|
|
13031
13045
|
const c = a.geometry, h = c.attributes.position, u = c.index, d = e.attributes.position, n = e.index, l = Te.getPrimitive(), f = Te.getPrimitive();
|
|
13032
|
-
let m =
|
|
13033
|
-
s && (p =
|
|
13046
|
+
let m = Bh, _ = Oh, p = null, g = null;
|
|
13047
|
+
s && (p = zh, g = Wh);
|
|
13034
13048
|
let v = 1 / 0, y = null, x = null;
|
|
13035
13049
|
return Hi.copy(t).invert(), si.matrix.copy(Hi), a.shapecast(
|
|
13036
13050
|
{
|
|
13037
|
-
boundsTraverseOrder: (w) =>
|
|
13051
|
+
boundsTraverseOrder: (w) => Ps.distanceToBox(w),
|
|
13038
13052
|
intersectsBounds: (w, T, M) => M < v && M < o ? (T && (si.min.copy(w.min), si.max.copy(w.max), si.needsUpdate = !0), !0) : !1,
|
|
13039
13053
|
intersectsRange: (w, T) => {
|
|
13040
13054
|
if (e.boundsTree)
|
|
13041
13055
|
return e.boundsTree.shapecast({
|
|
13042
|
-
boundsTraverseOrder: (
|
|
13043
|
-
intersectsBounds: (
|
|
13044
|
-
intersectsRange: (
|
|
13045
|
-
for (let E =
|
|
13056
|
+
boundsTraverseOrder: (D) => si.distanceToBox(D),
|
|
13057
|
+
intersectsBounds: (D, C, E) => E < v && E < o,
|
|
13058
|
+
intersectsRange: (D, C) => {
|
|
13059
|
+
for (let E = D, I = D + C; E < I; E++) {
|
|
13046
13060
|
ie(f, 3 * E, n, d), f.a.applyMatrix4(t), f.b.applyMatrix4(t), f.c.applyMatrix4(t), f.needsUpdate = !0;
|
|
13047
13061
|
for (let A = w, S = w + T; A < S; A++) {
|
|
13048
13062
|
ie(l, 3 * A, u, h), l.needsUpdate = !0;
|
|
13049
|
-
const
|
|
13050
|
-
if (
|
|
13063
|
+
const P = l.distanceToTriangle(f, m, p);
|
|
13064
|
+
if (P < v && (_.copy(m), g && g.copy(p), v = P, y = A, x = E), P < r)
|
|
13051
13065
|
return !0;
|
|
13052
13066
|
}
|
|
13053
13067
|
}
|
|
@@ -13055,12 +13069,12 @@ function Wh(a, e, t, i = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
13055
13069
|
});
|
|
13056
13070
|
{
|
|
13057
13071
|
const M = Qt(e);
|
|
13058
|
-
for (let
|
|
13059
|
-
ie(f, 3 *
|
|
13072
|
+
for (let D = 0, C = M; D < C; D++) {
|
|
13073
|
+
ie(f, 3 * D, n, d), f.a.applyMatrix4(t), f.b.applyMatrix4(t), f.c.applyMatrix4(t), f.needsUpdate = !0;
|
|
13060
13074
|
for (let E = w, I = w + T; E < I; E++) {
|
|
13061
13075
|
ie(l, 3 * E, u, h), l.needsUpdate = !0;
|
|
13062
13076
|
const A = l.distanceToTriangle(f, m, p);
|
|
13063
|
-
if (A < v && (_.copy(m), g && g.copy(p), v = A, y = E, x =
|
|
13077
|
+
if (A < v && (_.copy(m), g && g.copy(p), v = A, y = E, x = D), A < r)
|
|
13064
13078
|
return !0;
|
|
13065
13079
|
}
|
|
13066
13080
|
}
|
|
@@ -13069,7 +13083,7 @@ function Wh(a, e, t, i = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
13069
13083
|
}
|
|
13070
13084
|
), Te.releasePrimitive(l), Te.releasePrimitive(f), v === 1 / 0 ? null : (i.point ? i.point.copy(_) : i.point = _.clone(), i.distance = v, i.faceIndex = y, s && (s.point ? s.point.copy(g) : s.point = g.clone(), s.point.applyMatrix4(Hi), _.applyMatrix4(Hi), s.distance = _.sub(s.point).length(), s.faceIndex = x), i);
|
|
13071
13085
|
}
|
|
13072
|
-
function
|
|
13086
|
+
function Hh(a, e = null) {
|
|
13073
13087
|
e && Array.isArray(e) && (e = new Set(e));
|
|
13074
13088
|
const t = a.geometry, i = t.index ? t.index.array : null, s = t.attributes.position;
|
|
13075
13089
|
let r, o, c, h, u = 0;
|
|
@@ -13080,44 +13094,44 @@ function Uh(a, e = null) {
|
|
|
13080
13094
|
const _ = l * 2;
|
|
13081
13095
|
if (c[_ + 15] === as) {
|
|
13082
13096
|
const g = o[l + 6], v = c[_ + 14];
|
|
13083
|
-
let y = 1 / 0, x = 1 / 0, w = 1 / 0, T = -1 / 0, M = -1 / 0,
|
|
13097
|
+
let y = 1 / 0, x = 1 / 0, w = 1 / 0, T = -1 / 0, M = -1 / 0, D = -1 / 0;
|
|
13084
13098
|
for (let C = g, E = g + v; C < E; C++) {
|
|
13085
13099
|
const I = 3 * a.resolveTriangleIndex(C);
|
|
13086
13100
|
for (let A = 0; A < 3; A++) {
|
|
13087
13101
|
let S = I + A;
|
|
13088
13102
|
S = i ? i[S] : S;
|
|
13089
|
-
const
|
|
13090
|
-
|
|
13103
|
+
const P = s.getX(S), R = s.getY(S), k = s.getZ(S);
|
|
13104
|
+
P < y && (y = P), P > T && (T = P), R < x && (x = R), R > M && (M = R), k < w && (w = k), k > D && (D = k);
|
|
13091
13105
|
}
|
|
13092
13106
|
}
|
|
13093
|
-
return h[l + 0] !== y || h[l + 1] !== x || h[l + 2] !== w || h[l + 3] !== T || h[l + 4] !== M || h[l + 5] !==
|
|
13107
|
+
return h[l + 0] !== y || h[l + 1] !== x || h[l + 2] !== w || h[l + 3] !== T || h[l + 4] !== M || h[l + 5] !== D ? (h[l + 0] = y, h[l + 1] = x, h[l + 2] = w, h[l + 3] = T, h[l + 4] = M, h[l + 5] = D, !0) : !1;
|
|
13094
13108
|
} else {
|
|
13095
13109
|
const g = l + 8, v = o[l + 6], y = g + f, x = v + f;
|
|
13096
13110
|
let w = m, T = !1, M = !1;
|
|
13097
13111
|
e ? w || (T = e.has(y), M = e.has(x), w = !T && !M) : (T = !0, M = !0);
|
|
13098
|
-
const
|
|
13112
|
+
const D = w || T, C = w || M;
|
|
13099
13113
|
let E = !1;
|
|
13100
|
-
|
|
13114
|
+
D && (E = n(g, f, w));
|
|
13101
13115
|
let I = !1;
|
|
13102
13116
|
C && (I = n(v, f, w));
|
|
13103
13117
|
const A = E || I;
|
|
13104
13118
|
if (A)
|
|
13105
13119
|
for (let S = 0; S < 3; S++) {
|
|
13106
|
-
const
|
|
13120
|
+
const P = g + S, R = v + S, k = h[P], F = h[P + 3], z = h[R], B = h[R + 3];
|
|
13107
13121
|
h[l + S] = k < z ? k : z, h[l + S + 3] = F > B ? F : B;
|
|
13108
13122
|
}
|
|
13109
13123
|
return A;
|
|
13110
13124
|
}
|
|
13111
13125
|
}
|
|
13112
13126
|
}
|
|
13113
|
-
function
|
|
13127
|
+
function Nh(a, e, t, i, s, r, o) {
|
|
13114
13128
|
Z.setBuffer(a._roots[e]), tr(0, a, t, i, s, r, o), Z.clearBuffer();
|
|
13115
13129
|
}
|
|
13116
13130
|
function tr(a, e, t, i, s, r, o) {
|
|
13117
13131
|
const { float32Array: c, uint16Array: h, uint32Array: u } = Z, d = a * 2;
|
|
13118
13132
|
if (ge(d, h)) {
|
|
13119
13133
|
const l = ye(a, u), f = we(d, h);
|
|
13120
|
-
|
|
13134
|
+
Dh(e, t, i, l, f, s, r, o);
|
|
13121
13135
|
} else {
|
|
13122
13136
|
const l = be(a);
|
|
13123
13137
|
ut(l, c, i, r, o) && tr(l, e, t, i, s, r, o);
|
|
@@ -13125,8 +13139,8 @@ function tr(a, e, t, i, s, r, o) {
|
|
|
13125
13139
|
ut(f, c, i, r, o) && tr(f, e, t, i, s, r, o);
|
|
13126
13140
|
}
|
|
13127
13141
|
}
|
|
13128
|
-
const
|
|
13129
|
-
function
|
|
13142
|
+
const Vh = ["x", "y", "z"];
|
|
13143
|
+
function Gh(a, e, t, i, s, r) {
|
|
13130
13144
|
Z.setBuffer(a._roots[e]);
|
|
13131
13145
|
const o = ir(0, a, t, i, s, r);
|
|
13132
13146
|
return Z.clearBuffer(), o;
|
|
@@ -13138,7 +13152,7 @@ function ir(a, e, t, i, s, r) {
|
|
|
13138
13152
|
const n = ye(a, h), l = we(u, c);
|
|
13139
13153
|
return Ph(e, t, i, n, l, s, r);
|
|
13140
13154
|
} else {
|
|
13141
|
-
const n = ao(a, h), l =
|
|
13155
|
+
const n = ao(a, h), l = Vh[n], m = i.direction[l] >= 0;
|
|
13142
13156
|
let _, p;
|
|
13143
13157
|
m ? (_ = be(a), p = Ae(a, h)) : (_ = Ae(a, h), p = be(a));
|
|
13144
13158
|
const v = ut(_, o, i, s, r) ? ir(_, e, t, i, s, r) : null;
|
|
@@ -13154,8 +13168,8 @@ function ir(a, e, t, i, s, r) {
|
|
|
13154
13168
|
return v && x ? v.distance <= x.distance ? v : x : v || x || null;
|
|
13155
13169
|
}
|
|
13156
13170
|
}
|
|
13157
|
-
const Ni = /* @__PURE__ */ new J(),
|
|
13158
|
-
function
|
|
13171
|
+
const Ni = /* @__PURE__ */ new J(), Pt = /* @__PURE__ */ new Re(), Et = /* @__PURE__ */ new Re(), ri = /* @__PURE__ */ new te(), wn = /* @__PURE__ */ new ue(), Vi = /* @__PURE__ */ new ue();
|
|
13172
|
+
function Qh(a, e, t, i) {
|
|
13159
13173
|
Z.setBuffer(a._roots[e]);
|
|
13160
13174
|
const s = sr(0, a, t, i);
|
|
13161
13175
|
return Z.clearBuffer(), s;
|
|
@@ -13178,9 +13192,9 @@ function sr(a, e, t, i, s = null) {
|
|
|
13178
13192
|
});
|
|
13179
13193
|
for (let g = _, v = p + _; g < v; g++) {
|
|
13180
13194
|
const y = e.resolveTriangleIndex(g);
|
|
13181
|
-
ie(
|
|
13195
|
+
ie(Pt, 3 * y, n, l), Pt.a.applyMatrix4(ri), Pt.b.applyMatrix4(ri), Pt.c.applyMatrix4(ri), Pt.needsUpdate = !0;
|
|
13182
13196
|
for (let x = 0, w = f.count; x < w; x += 3)
|
|
13183
|
-
if (ie(Et, x, f, m), Et.needsUpdate = !0,
|
|
13197
|
+
if (ie(Et, x, f, m), Et.needsUpdate = !0, Pt.intersectsTriangle(Et))
|
|
13184
13198
|
return !0;
|
|
13185
13199
|
}
|
|
13186
13200
|
} else {
|
|
@@ -13188,12 +13202,12 @@ function sr(a, e, t, i, s = null) {
|
|
|
13188
13202
|
return $(d, r, Ni), !!(s.intersectsBox(Ni) && sr(d, e, t, i, s) || ($(n, r, Ni), s.intersectsBox(Ni) && sr(n, e, t, i, s)));
|
|
13189
13203
|
}
|
|
13190
13204
|
}
|
|
13191
|
-
const Gi = /* @__PURE__ */ new te(), Es = /* @__PURE__ */ new ue(), ni = /* @__PURE__ */ new ue(),
|
|
13192
|
-
function
|
|
13205
|
+
const Gi = /* @__PURE__ */ new te(), Es = /* @__PURE__ */ new ue(), ni = /* @__PURE__ */ new ue(), jh = /* @__PURE__ */ new b(), qh = /* @__PURE__ */ new b(), Yh = /* @__PURE__ */ new b(), Kh = /* @__PURE__ */ new b();
|
|
13206
|
+
function Zh(a, e, t, i = {}, s = {}, r = 0, o = 1 / 0) {
|
|
13193
13207
|
e.boundingBox || e.computeBoundingBox(), Es.set(e.boundingBox.min, e.boundingBox.max, t), Es.needsUpdate = !0;
|
|
13194
13208
|
const c = a.geometry, h = c.attributes.position, u = c.index, d = e.attributes.position, n = e.index, l = Te.getPrimitive(), f = Te.getPrimitive();
|
|
13195
|
-
let m =
|
|
13196
|
-
s && (p =
|
|
13209
|
+
let m = jh, _ = qh, p = null, g = null;
|
|
13210
|
+
s && (p = Yh, g = Kh);
|
|
13197
13211
|
let v = 1 / 0, y = null, x = null;
|
|
13198
13212
|
return Gi.copy(t).invert(), ni.matrix.copy(Gi), a.shapecast(
|
|
13199
13213
|
{
|
|
@@ -13203,13 +13217,13 @@ function Kh(a, e, t, i = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
13203
13217
|
if (e.boundsTree) {
|
|
13204
13218
|
const M = e.boundsTree;
|
|
13205
13219
|
return M.shapecast({
|
|
13206
|
-
boundsTraverseOrder: (
|
|
13207
|
-
intersectsBounds: (
|
|
13208
|
-
intersectsRange: (
|
|
13209
|
-
for (let E =
|
|
13220
|
+
boundsTraverseOrder: (D) => ni.distanceToBox(D),
|
|
13221
|
+
intersectsBounds: (D, C, E) => E < v && E < o,
|
|
13222
|
+
intersectsRange: (D, C) => {
|
|
13223
|
+
for (let E = D, I = D + C; E < I; E++) {
|
|
13210
13224
|
const A = M.resolveTriangleIndex(E);
|
|
13211
13225
|
ie(f, 3 * A, n, d), f.a.applyMatrix4(t), f.b.applyMatrix4(t), f.c.applyMatrix4(t), f.needsUpdate = !0;
|
|
13212
|
-
for (let S = w,
|
|
13226
|
+
for (let S = w, P = w + T; S < P; S++) {
|
|
13213
13227
|
const R = a.resolveTriangleIndex(S);
|
|
13214
13228
|
ie(l, 3 * R, u, h), l.needsUpdate = !0;
|
|
13215
13229
|
const k = l.distanceToTriangle(f, m, p);
|
|
@@ -13221,13 +13235,13 @@ function Kh(a, e, t, i = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
13221
13235
|
});
|
|
13222
13236
|
} else {
|
|
13223
13237
|
const M = Qt(e);
|
|
13224
|
-
for (let
|
|
13225
|
-
ie(f, 3 *
|
|
13238
|
+
for (let D = 0, C = M; D < C; D++) {
|
|
13239
|
+
ie(f, 3 * D, n, d), f.a.applyMatrix4(t), f.b.applyMatrix4(t), f.c.applyMatrix4(t), f.needsUpdate = !0;
|
|
13226
13240
|
for (let E = w, I = w + T; E < I; E++) {
|
|
13227
13241
|
const A = a.resolveTriangleIndex(E);
|
|
13228
13242
|
ie(l, 3 * A, u, h), l.needsUpdate = !0;
|
|
13229
13243
|
const S = l.distanceToTriangle(f, m, p);
|
|
13230
|
-
if (S < v && (_.copy(m), g && g.copy(p), v = S, y = E, x =
|
|
13244
|
+
if (S < v && (_.copy(m), g && g.copy(p), v = S, y = E, x = D), S < r)
|
|
13231
13245
|
return !0;
|
|
13232
13246
|
}
|
|
13233
13247
|
}
|
|
@@ -13236,12 +13250,12 @@ function Kh(a, e, t, i = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
13236
13250
|
}
|
|
13237
13251
|
), Te.releasePrimitive(l), Te.releasePrimitive(f), v === 1 / 0 ? null : (i.point ? i.point.copy(_) : i.point = _.clone(), i.distance = v, i.faceIndex = y, s && (s.point ? s.point.copy(g) : s.point = g.clone(), s.point.applyMatrix4(Gi), _.applyMatrix4(Gi), s.distance = _.sub(s.point).length(), s.faceIndex = x), i);
|
|
13238
13252
|
}
|
|
13239
|
-
function
|
|
13253
|
+
function Xh() {
|
|
13240
13254
|
return typeof SharedArrayBuffer < "u";
|
|
13241
13255
|
}
|
|
13242
13256
|
const fi = new Z.constructor(), es = new Z.constructor(), ot = new mr(() => new J()), Rt = new J(), Lt = new J(), Rs = new J(), Ls = new J();
|
|
13243
13257
|
let ks = !1;
|
|
13244
|
-
function
|
|
13258
|
+
function Jh(a, e, t, i) {
|
|
13245
13259
|
if (ks)
|
|
13246
13260
|
throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");
|
|
13247
13261
|
ks = !0;
|
|
@@ -13296,11 +13310,11 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13296
13310
|
o + e
|
|
13297
13311
|
);
|
|
13298
13312
|
else if (T) {
|
|
13299
|
-
const
|
|
13300
|
-
$(e, p,
|
|
13313
|
+
const D = ot.getPrimitive();
|
|
13314
|
+
$(e, p, D), D.applyMatrix4(t);
|
|
13301
13315
|
const C = be(a), E = Ae(a, m);
|
|
13302
13316
|
$(C, f, Rt), $(E, f, Lt);
|
|
13303
|
-
const I =
|
|
13317
|
+
const I = D.intersectsBox(Rt), A = D.intersectsBox(Lt);
|
|
13304
13318
|
M = I && Ce(
|
|
13305
13319
|
e,
|
|
13306
13320
|
C,
|
|
@@ -13311,7 +13325,7 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13311
13325
|
r,
|
|
13312
13326
|
h,
|
|
13313
13327
|
c + 1,
|
|
13314
|
-
|
|
13328
|
+
D,
|
|
13315
13329
|
!d
|
|
13316
13330
|
) || A && Ce(
|
|
13317
13331
|
e,
|
|
@@ -13323,17 +13337,17 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13323
13337
|
r,
|
|
13324
13338
|
h,
|
|
13325
13339
|
c + 1,
|
|
13326
|
-
|
|
13340
|
+
D,
|
|
13327
13341
|
!d
|
|
13328
|
-
), ot.releasePrimitive(
|
|
13342
|
+
), ot.releasePrimitive(D);
|
|
13329
13343
|
} else {
|
|
13330
|
-
const
|
|
13331
|
-
$(
|
|
13344
|
+
const D = be(e), C = Ae(e, g);
|
|
13345
|
+
$(D, p, Rs), $(C, p, Ls);
|
|
13332
13346
|
const E = u.intersectsBox(Rs), I = u.intersectsBox(Ls);
|
|
13333
13347
|
if (E && I)
|
|
13334
13348
|
M = Ce(
|
|
13335
13349
|
a,
|
|
13336
|
-
|
|
13350
|
+
D,
|
|
13337
13351
|
t,
|
|
13338
13352
|
i,
|
|
13339
13353
|
s,
|
|
@@ -13360,7 +13374,7 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13360
13374
|
if (w)
|
|
13361
13375
|
M = Ce(
|
|
13362
13376
|
a,
|
|
13363
|
-
|
|
13377
|
+
D,
|
|
13364
13378
|
t,
|
|
13365
13379
|
i,
|
|
13366
13380
|
s,
|
|
@@ -13374,11 +13388,11 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13374
13388
|
else {
|
|
13375
13389
|
const A = ot.getPrimitive();
|
|
13376
13390
|
A.copy(Rs).applyMatrix4(t);
|
|
13377
|
-
const S = be(a),
|
|
13378
|
-
$(S, f, Rt), $(
|
|
13391
|
+
const S = be(a), P = Ae(a, m);
|
|
13392
|
+
$(S, f, Rt), $(P, f, Lt);
|
|
13379
13393
|
const R = A.intersectsBox(Rt), k = A.intersectsBox(Lt);
|
|
13380
13394
|
M = R && Ce(
|
|
13381
|
-
|
|
13395
|
+
D,
|
|
13382
13396
|
S,
|
|
13383
13397
|
i,
|
|
13384
13398
|
t,
|
|
@@ -13390,8 +13404,8 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13390
13404
|
A,
|
|
13391
13405
|
!d
|
|
13392
13406
|
) || k && Ce(
|
|
13393
|
-
P,
|
|
13394
13407
|
D,
|
|
13408
|
+
P,
|
|
13395
13409
|
i,
|
|
13396
13410
|
t,
|
|
13397
13411
|
s,
|
|
@@ -13421,8 +13435,8 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13421
13435
|
else {
|
|
13422
13436
|
const A = ot.getPrimitive();
|
|
13423
13437
|
A.copy(Ls).applyMatrix4(t);
|
|
13424
|
-
const S = be(a),
|
|
13425
|
-
$(S, f, Rt), $(
|
|
13438
|
+
const S = be(a), P = Ae(a, m);
|
|
13439
|
+
$(S, f, Rt), $(P, f, Lt);
|
|
13426
13440
|
const R = A.intersectsBox(Rt), k = A.intersectsBox(Lt);
|
|
13427
13441
|
M = R && Ce(
|
|
13428
13442
|
C,
|
|
@@ -13438,7 +13452,7 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13438
13452
|
!d
|
|
13439
13453
|
) || k && Ce(
|
|
13440
13454
|
C,
|
|
13441
|
-
|
|
13455
|
+
P,
|
|
13442
13456
|
i,
|
|
13443
13457
|
t,
|
|
13444
13458
|
s,
|
|
@@ -13453,7 +13467,7 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13453
13467
|
}
|
|
13454
13468
|
return M;
|
|
13455
13469
|
}
|
|
13456
|
-
const Qi = /* @__PURE__ */ new ue(), bn = /* @__PURE__ */ new J(),
|
|
13470
|
+
const Qi = /* @__PURE__ */ new ue(), bn = /* @__PURE__ */ new J(), $h = {
|
|
13457
13471
|
strategy: ro,
|
|
13458
13472
|
maxDepth: 40,
|
|
13459
13473
|
maxLeafTris: 10,
|
|
@@ -13508,16 +13522,16 @@ class gr {
|
|
|
13508
13522
|
} else
|
|
13509
13523
|
throw new Error("MeshBVH: Only BufferGeometries are supported.");
|
|
13510
13524
|
if (t = Object.assign({
|
|
13511
|
-
|
|
13525
|
+
...$h,
|
|
13512
13526
|
// undocumented options
|
|
13513
13527
|
// Whether to skip generating the tree. Used for deserialization.
|
|
13514
13528
|
[Ss]: !1
|
|
13515
|
-
}, t), t.useSharedArrayBuffer && !
|
|
13529
|
+
}, t), t.useSharedArrayBuffer && !Xh())
|
|
13516
13530
|
throw new Error("MeshBVH: SharedArrayBuffer is not available.");
|
|
13517
|
-
this.geometry = e, this._roots = null, this._indirectBuffer = null, t[Ss] || (
|
|
13531
|
+
this.geometry = e, this._roots = null, this._indirectBuffer = null, t[Ss] || (mh(this, t), !e.boundingBox && t.setBoundingBox && (e.boundingBox = this.getBoundingBox(new J()))), this.resolveTriangleIndex = t.indirect ? (i) => this._indirectBuffer[i] : (i) => i;
|
|
13518
13532
|
}
|
|
13519
13533
|
refit(e = null) {
|
|
13520
|
-
return (this.indirect ?
|
|
13534
|
+
return (this.indirect ? Hh : Ih)(this, e);
|
|
13521
13535
|
}
|
|
13522
13536
|
traverse(e, t = 0) {
|
|
13523
13537
|
const i = this._roots[t], s = new Uint32Array(i), r = new Uint16Array(i);
|
|
@@ -13535,7 +13549,7 @@ class gr {
|
|
|
13535
13549
|
}
|
|
13536
13550
|
/* Core Cast Functions */
|
|
13537
13551
|
raycast(e, t = Bs, i = 0, s = 1 / 0) {
|
|
13538
|
-
const r = this._roots, o = this.geometry, c = [], h = t.isMaterial, u = Array.isArray(t), d = o.groups, n = h ? t.side : t, l = this.indirect ?
|
|
13552
|
+
const r = this._roots, o = this.geometry, c = [], h = t.isMaterial, u = Array.isArray(t), d = o.groups, n = h ? t.side : t, l = this.indirect ? Nh : Rh;
|
|
13539
13553
|
for (let f = 0, m = r.length; f < m; f++) {
|
|
13540
13554
|
const _ = u ? t[d[f].materialIndex].side : n, p = c.length;
|
|
13541
13555
|
if (l(this, f, _, e, c, i, s), u) {
|
|
@@ -13549,7 +13563,7 @@ class gr {
|
|
|
13549
13563
|
raycastFirst(e, t = Bs, i = 0, s = 1 / 0) {
|
|
13550
13564
|
const r = this._roots, o = this.geometry, c = t.isMaterial, h = Array.isArray(t);
|
|
13551
13565
|
let u = null;
|
|
13552
|
-
const d = o.groups, n = c ? t.side : t, l = this.indirect ?
|
|
13566
|
+
const d = o.groups, n = c ? t.side : t, l = this.indirect ? Gh : kh;
|
|
13553
13567
|
for (let f = 0, m = r.length; f < m; f++) {
|
|
13554
13568
|
const _ = h ? t[d[f].materialIndex].side : n, p = l(this, f, _, e, i, s);
|
|
13555
13569
|
p != null && (u == null || p.distance < u.distance) && (u = p, h && (p.face.materialIndex = d[f].materialIndex));
|
|
@@ -13558,13 +13572,13 @@ class gr {
|
|
|
13558
13572
|
}
|
|
13559
13573
|
intersectsGeometry(e, t) {
|
|
13560
13574
|
let i = !1;
|
|
13561
|
-
const s = this._roots, r = this.indirect ?
|
|
13575
|
+
const s = this._roots, r = this.indirect ? Qh : Fh;
|
|
13562
13576
|
for (let o = 0, c = s.length; o < c && (i = r(this, o, e, t), !i); o++)
|
|
13563
13577
|
;
|
|
13564
13578
|
return i;
|
|
13565
13579
|
}
|
|
13566
13580
|
shapecast(e) {
|
|
13567
|
-
const t = Te.getPrimitive(), i = this.indirect ?
|
|
13581
|
+
const t = Te.getPrimitive(), i = this.indirect ? Eh : Ch;
|
|
13568
13582
|
let {
|
|
13569
13583
|
boundsTraverseOrder: s,
|
|
13570
13584
|
intersectsBounds: r,
|
|
@@ -13580,7 +13594,7 @@ class gr {
|
|
|
13580
13594
|
const d = this._roots;
|
|
13581
13595
|
for (let n = 0, l = d.length; n < l; n++) {
|
|
13582
13596
|
const f = d[n];
|
|
13583
|
-
if (h =
|
|
13597
|
+
if (h = wh(this, n, r, o, s, u), h)
|
|
13584
13598
|
break;
|
|
13585
13599
|
u += f.byteLength;
|
|
13586
13600
|
}
|
|
@@ -13604,7 +13618,7 @@ class gr {
|
|
|
13604
13618
|
};
|
|
13605
13619
|
if (r) {
|
|
13606
13620
|
const m = (_, p, g, v, y, x, w, T) => {
|
|
13607
|
-
for (let M = g,
|
|
13621
|
+
for (let M = g, D = g + v; M < D; M++) {
|
|
13608
13622
|
f(M), d.a.applyMatrix4(t), d.b.applyMatrix4(t), d.c.applyMatrix4(t), d.needsUpdate = !0;
|
|
13609
13623
|
for (let C = _, E = _ + p; C < E; C++)
|
|
13610
13624
|
if (u(C), o.needsUpdate = !0, r(o, d, C, M, y, x, w, T))
|
|
@@ -13620,7 +13634,7 @@ class gr {
|
|
|
13620
13634
|
} else
|
|
13621
13635
|
s = m;
|
|
13622
13636
|
}
|
|
13623
|
-
return
|
|
13637
|
+
return Jh(this, e, t, s);
|
|
13624
13638
|
}
|
|
13625
13639
|
/* Derived Cast Functions */
|
|
13626
13640
|
intersectsBox(e, t) {
|
|
@@ -13640,7 +13654,7 @@ class gr {
|
|
|
13640
13654
|
);
|
|
13641
13655
|
}
|
|
13642
13656
|
closestPointToGeometry(e, t, i = {}, s = {}, r = 0, o = 1 / 0) {
|
|
13643
|
-
return (this.indirect ?
|
|
13657
|
+
return (this.indirect ? Zh : Uh)(
|
|
13644
13658
|
this,
|
|
13645
13659
|
e,
|
|
13646
13660
|
t,
|
|
@@ -13651,7 +13665,7 @@ class gr {
|
|
|
13651
13665
|
);
|
|
13652
13666
|
}
|
|
13653
13667
|
closestPointToPoint(e, t = {}, i = 0, s = 1 / 0) {
|
|
13654
|
-
return
|
|
13668
|
+
return bh(
|
|
13655
13669
|
this,
|
|
13656
13670
|
e,
|
|
13657
13671
|
t,
|
|
@@ -13665,7 +13679,7 @@ class gr {
|
|
|
13665
13679
|
}), e;
|
|
13666
13680
|
}
|
|
13667
13681
|
}
|
|
13668
|
-
class
|
|
13682
|
+
class eu {
|
|
13669
13683
|
constructor(e) {
|
|
13670
13684
|
this.name = "WorkerBase", this.running = !1, this.worker = e, this.worker.onerror = (t) => {
|
|
13671
13685
|
throw t.message ? new Error(`${this.name}: Could not create Web Worker with error "${t.message}"`) : new Error(`${this.name}: Could not create Web Worker.`);
|
|
@@ -13688,7 +13702,7 @@ class $h {
|
|
|
13688
13702
|
this.worker.terminate(), this.worker = null;
|
|
13689
13703
|
}
|
|
13690
13704
|
}
|
|
13691
|
-
class
|
|
13705
|
+
class tu extends eu {
|
|
13692
13706
|
constructor(e) {
|
|
13693
13707
|
const t = new Worker(e || new URL("data:text/javascript;base64,aW1wb3J0IHsKCUJ1ZmZlckdlb21ldHJ5LAoJQnVmZmVyQXR0cmlidXRlLAp9IGZyb20gJ3RocmVlJzsKaW1wb3J0IHsgTWVzaEJWSCB9IGZyb20gJy4uL2NvcmUvTWVzaEJWSC5qcyc7Cgpvbm1lc3NhZ2UgPSAoIHsgZGF0YSB9ICkgPT4gewoKCWxldCBwcmV2VGltZSA9IHBlcmZvcm1hbmNlLm5vdygpOwoJZnVuY3Rpb24gb25Qcm9ncmVzc0NhbGxiYWNrKCBwcm9ncmVzcyApIHsKCgkJLy8gYWNjb3VudCBmb3IgZXJyb3IKCQlwcm9ncmVzcyA9IE1hdGgubWluKCBwcm9ncmVzcywgMSApOwoKCQljb25zdCBjdXJyVGltZSA9IHBlcmZvcm1hbmNlLm5vdygpOwoJCWlmICggY3VyclRpbWUgLSBwcmV2VGltZSA+PSAxMCAmJiBwcm9ncmVzcyAhPT0gMS4wICkgewoKCQkJcG9zdE1lc3NhZ2UoIHsKCgkJCQllcnJvcjogbnVsbCwKCQkJCXNlcmlhbGl6ZWQ6IG51bGwsCgkJCQlwb3NpdGlvbjogbnVsbCwKCQkJCXByb2dyZXNzLAoKCQkJfSApOwoJCQlwcmV2VGltZSA9IGN1cnJUaW1lOwoKCQl9CgoJfQoKCWNvbnN0IHsgaW5kZXgsIHBvc2l0aW9uLCBvcHRpb25zIH0gPSBkYXRhOwoJdHJ5IHsKCgkJY29uc3QgZ2VvbWV0cnkgPSBuZXcgQnVmZmVyR2VvbWV0cnkoKTsKCQlnZW9tZXRyeS5zZXRBdHRyaWJ1dGUoICdwb3NpdGlvbicsIG5ldyBCdWZmZXJBdHRyaWJ1dGUoIHBvc2l0aW9uLCAzLCBmYWxzZSApICk7CgkJaWYgKCBpbmRleCApIHsKCgkJCWdlb21ldHJ5LnNldEluZGV4KCBuZXcgQnVmZmVyQXR0cmlidXRlKCBpbmRleCwgMSwgZmFsc2UgKSApOwoKCQl9CgoJCWlmICggb3B0aW9ucy5pbmNsdWRlZFByb2dyZXNzQ2FsbGJhY2sgKSB7CgoJCQlvcHRpb25zLm9uUHJvZ3Jlc3MgPSBvblByb2dyZXNzQ2FsbGJhY2s7CgoJCX0KCgkJaWYgKCBvcHRpb25zLmdyb3VwcyApIHsKCgkJCWNvbnN0IGdyb3VwcyA9IG9wdGlvbnMuZ3JvdXBzOwoJCQlmb3IgKCBjb25zdCBpIGluIGdyb3VwcyApIHsKCgkJCQljb25zdCBncm91cCA9IGdyb3Vwc1sgaSBdOwoJCQkJZ2VvbWV0cnkuYWRkR3JvdXAoIGdyb3VwLnN0YXJ0LCBncm91cC5jb3VudCwgZ3JvdXAubWF0ZXJpYWxJbmRleCApOwoKCQkJfQoKCQl9CgoJCWNvbnN0IGJ2aCA9IG5ldyBNZXNoQlZIKCBnZW9tZXRyeSwgb3B0aW9ucyApOwoJCWNvbnN0IHNlcmlhbGl6ZWQgPSBNZXNoQlZILnNlcmlhbGl6ZSggYnZoLCB7IGNvcHlJbmRleEJ1ZmZlcjogZmFsc2UgfSApOwoJCWxldCB0b1RyYW5zZmVyID0gWyBwb3NpdGlvbi5idWZmZXIsIC4uLnNlcmlhbGl6ZWQucm9vdHMgXTsKCQlpZiAoIHNlcmlhbGl6ZWQuaW5kZXggKSB7CgoJCQl0b1RyYW5zZmVyLnB1c2goIHNlcmlhbGl6ZWQuaW5kZXguYnVmZmVyICk7CgoJCX0KCgkJdG9UcmFuc2ZlciA9IHRvVHJhbnNmZXIuZmlsdGVyKCB2ID0+ICggdHlwZW9mIFNoYXJlZEFycmF5QnVmZmVyID09PSAndW5kZWZpbmVkJyApIHx8ICEgKCB2IGluc3RhbmNlb2YgU2hhcmVkQXJyYXlCdWZmZXIgKSApOwoKCQlpZiAoIGJ2aC5faW5kaXJlY3RCdWZmZXIgKSB7CgoJCQl0b1RyYW5zZmVyLnB1c2goIHNlcmlhbGl6ZWQuaW5kaXJlY3RCdWZmZXIuYnVmZmVyICk7CgoJCX0KCgkJcG9zdE1lc3NhZ2UoIHsKCgkJCWVycm9yOiBudWxsLAoJCQlzZXJpYWxpemVkLAoJCQlwb3NpdGlvbiwKCQkJcHJvZ3Jlc3M6IDEsCgoJCX0sIHRvVHJhbnNmZXIgKTsKCgl9IGNhdGNoICggZXJyb3IgKSB7CgoJCXBvc3RNZXNzYWdlKCB7CgoJCQllcnJvciwKCQkJc2VyaWFsaXplZDogbnVsbCwKCQkJcG9zaXRpb246IG51bGwsCgkJCXByb2dyZXNzOiAxLAoKCQl9ICk7CgoJfQoKfTsK", import.meta.url), { type: "module" });
|
|
13694
13708
|
super(t), this.name = "GenerateMeshBVHWorker";
|
|
@@ -13732,7 +13746,7 @@ class eu extends $h {
|
|
|
13732
13746
|
});
|
|
13733
13747
|
}
|
|
13734
13748
|
}
|
|
13735
|
-
class
|
|
13749
|
+
class iu {
|
|
13736
13750
|
constructor(e, t) {
|
|
13737
13751
|
this.lock = !1, this.lockX = !1, this.lockY = !1, this.invRotMat = new te(), this.mouse = new b(), this.rotateStart = new G(), this.rotateEnd = new G(), this.rotateDelta = new G(), this.selectedAxis = null, this.isDragging = !1, this.context = null, this.orbitState = !0, this._animator = 0, this._emitter = new yt(), this.addListener = this._emitter.addListener.bind(this._emitter), this.removeAllListeners = this._emitter.removeAllListeners.bind(this._emitter), this._text = document.createElement("div"), this._textTimer = 0, this._update = () => {
|
|
13738
13752
|
this.lock || (this._textTimer && (window.clearTimeout(this._textTimer), this._textTimer = 0), this._textTimer = window.setTimeout(() => {
|
|
@@ -13917,7 +13931,7 @@ class tu {
|
|
|
13917
13931
|
cancelAnimationFrame(this._animator), this.orbit.removeEventListener("change", this._update), this.orbit.enabled = this.orbitState, window.removeEventListener("pointermove", this.onDrag, !1), window.removeEventListener("pointerup", this.onPointerUp, !1), this._emitter.removeAllListeners(), this.domElement.removeEventListener("pointerdown", this.onPointerDown, !1), this.domElement.removeEventListener("pointerenter", this.onPointerEnter, !1), this.domElement.removeEventListener("pointermove", this.onPointerMove, !1), this.domElement.removeEventListener("click", this.onMouseClick, !1), this.domElement.remove(), window.clearTimeout(this._textTimer), this._text.remove();
|
|
13918
13932
|
}
|
|
13919
13933
|
}
|
|
13920
|
-
class
|
|
13934
|
+
class su {
|
|
13921
13935
|
// 阴影是否已完成累计渲染
|
|
13922
13936
|
get isFinished() {
|
|
13923
13937
|
return this.params ? this.framesDone >= this.params.frames : !0;
|
|
@@ -13954,20 +13968,20 @@ class iu {
|
|
|
13954
13968
|
size: c,
|
|
13955
13969
|
displayDelayFrames: Math.max(0, Math.floor(l)),
|
|
13956
13970
|
paused: f
|
|
13957
|
-
}, this.scene = t, this.renderer = e, this.buffer1Active = !1, this.dirLights = [], this.dirLightsHelpers = [], this.clearColor = new X(), this.clearAlpha = 0, this.progress = 0, this.discardMaterial = new
|
|
13971
|
+
}, this.scene = t, this.renderer = e, this.buffer1Active = !1, this.dirLights = [], this.dirLightsHelpers = [], this.clearColor = new X(), this.clearAlpha = 0, this.progress = 0, this.discardMaterial = new nu(), 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._displaySuppressed = !1, this._displayDelayRemaining = 0, this._displayRestoreOpacity = 1, this.shadowMapHistory = [], this.isZUp = Ee.DEFAULT_UP.z === 1, this.progShadowGrp = new Pe(), this.progShadowGrp.name = "progressive_shadow_assets", this.scene.add(this.progShadowGrp), this.lightOrigin = new Pe(), 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 Pe(), this.lightGroup.name = "all_dir_lights", this.progShadowGrp.add(this.lightGroup);
|
|
13958
13972
|
const m = Math.PI;
|
|
13959
13973
|
for (let g = 0; g < o; g++) {
|
|
13960
|
-
const v = new
|
|
13974
|
+
const v = new Fo(16777215, m / o);
|
|
13961
13975
|
v.name = "dir_light_" + g, v.castShadow = !0, v.shadow.bias = r, v.shadow.camera.near = 0.1, v.shadow.camera.far = 50, v.shadow.camera.right = c / 2, v.shadow.camera.left = -c / 2, v.shadow.camera.top = c / 2, v.shadow.camera.bottom = -c / 2, v.shadow.mapSize.width = s, v.shadow.mapSize.height = s, this.dirLights.push(v), this.lightGroup.add(v);
|
|
13962
13976
|
}
|
|
13963
|
-
const _ = /(Android|iPad|iPhone|iPod)/g.test(navigator == null ? void 0 : navigator.userAgent) ?
|
|
13964
|
-
this.progressiveLightMap1 = new je(i, i, { type: _ }), this.progressiveLightMap2 = new je(i, i, { type: _ }), this.progressiveLightMap1.texture.colorSpace = Ar, this.progressiveLightMap2.texture.colorSpace = Ar, this.shadowCatcherMaterial = new
|
|
13977
|
+
const _ = /(Android|iPad|iPhone|iPod)/g.test(navigator == null ? void 0 : navigator.userAgent) ? De : xe;
|
|
13978
|
+
this.progressiveLightMap1 = new je(i, i, { type: _ }), this.progressiveLightMap2 = new je(i, i, { type: _ }), this.progressiveLightMap1.texture.colorSpace = Ar, this.progressiveLightMap2.texture.colorSpace = Ar, this.shadowCatcherMaterial = new ru({
|
|
13965
13979
|
map: this.progressiveLightMap2.texture,
|
|
13966
13980
|
transparent: !0,
|
|
13967
13981
|
opacity: 1
|
|
13968
13982
|
});
|
|
13969
13983
|
const p = new mi(c, c);
|
|
13970
|
-
this.isZUp || p.rotateX(-Math.PI / 2), this.shadowCatcherMesh = new q(p, 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
|
|
13984
|
+
this.isZUp || p.rotateX(-Math.PI / 2), this.shadowCatcherMesh = new q(p, 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 Pe(), this.targetMat = new Bo({ fog: !1 }), this.previousShadowMap = { value: this.progressiveLightMap1.texture }, this.averagingWindow = { value: h }, this.targetMat.onBeforeCompile = (g) => {
|
|
13971
13985
|
g.vertexShader = `varying vec2 vUv;
|
|
13972
13986
|
` + g.vertexShader.slice(0, -1) + "vUv = uv; gl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }";
|
|
13973
13987
|
const v = g.fragmentShader.indexOf("void main() {");
|
|
@@ -14057,10 +14071,10 @@ vec3 texelOld = texture2D(previousShadowMap, vUv).rgb;
|
|
|
14057
14071
|
);
|
|
14058
14072
|
this.isZUp ? t.position.z = this.params.size / 2 : t.position.y = this.params.size / 2;
|
|
14059
14073
|
for (const r of this.dirLights) {
|
|
14060
|
-
const o = new
|
|
14074
|
+
const o = new Oo(r);
|
|
14061
14075
|
this.dirLightsHelpers.push(o);
|
|
14062
14076
|
}
|
|
14063
|
-
const i = this.isZUp ? new b(0, 0, 1) : new b(0, 1, 0), s = new
|
|
14077
|
+
const i = this.isZUp ? new b(0, 0, 1) : new b(0, 1, 0), s = new zo(new or(i, 1e-3), this.params.size, 16776960);
|
|
14064
14078
|
this.debugHelpersGroup.add(t, s, ...this.dirLightsHelpers);
|
|
14065
14079
|
}
|
|
14066
14080
|
e ? (this.progShadowGrp.add(this.debugHelpersGroup), this.dirLightsHelpers.forEach((t) => {
|
|
@@ -14225,7 +14239,7 @@ function ho(a = {}, e, t, i = (s) => {
|
|
|
14225
14239
|
const o = Object.entries(a);
|
|
14226
14240
|
super({
|
|
14227
14241
|
uniforms: o.reduce((c, [h, u]) => {
|
|
14228
|
-
const d =
|
|
14242
|
+
const d = Wo.clone({ [h]: { value: u } });
|
|
14229
14243
|
return {
|
|
14230
14244
|
...c,
|
|
14231
14245
|
...d
|
|
@@ -14243,7 +14257,7 @@ function ho(a = {}, e, t, i = (s) => {
|
|
|
14243
14257
|
};
|
|
14244
14258
|
return s.key = Qe.generateUUID(), s;
|
|
14245
14259
|
}
|
|
14246
|
-
const
|
|
14260
|
+
const ru = ho(
|
|
14247
14261
|
{
|
|
14248
14262
|
transparent: !0,
|
|
14249
14263
|
color: new X(0, 0, 0),
|
|
@@ -14282,14 +14296,14 @@ const su = ho(
|
|
|
14282
14296
|
#include <tonemapping_fragment>
|
|
14283
14297
|
#include <colorspace_fragment>
|
|
14284
14298
|
}`
|
|
14285
|
-
),
|
|
14286
|
-
class
|
|
14299
|
+
), nu = ho({}, "void main() { }", "void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard; }");
|
|
14300
|
+
class ou extends Ke {
|
|
14287
14301
|
constructor(e) {
|
|
14288
14302
|
const t = document.createElement("div");
|
|
14289
14303
|
super(t), this._controls = e;
|
|
14290
14304
|
}
|
|
14291
14305
|
}
|
|
14292
|
-
class
|
|
14306
|
+
class au extends W.ShaderMaterial {
|
|
14293
14307
|
get source() {
|
|
14294
14308
|
return this.uniforms.source.value;
|
|
14295
14309
|
}
|
|
@@ -14369,7 +14383,7 @@ class An extends W.ShaderMaterial {
|
|
|
14369
14383
|
}), this.morphTargets = !0;
|
|
14370
14384
|
}
|
|
14371
14385
|
}
|
|
14372
|
-
class
|
|
14386
|
+
class lu extends W.ShaderMaterial {
|
|
14373
14387
|
get map() {
|
|
14374
14388
|
return this.uniforms.map.value;
|
|
14375
14389
|
}
|
|
@@ -14452,7 +14466,7 @@ class au extends W.ShaderMaterial {
|
|
|
14452
14466
|
});
|
|
14453
14467
|
}
|
|
14454
14468
|
}
|
|
14455
|
-
class
|
|
14469
|
+
class cu extends W.ShaderMaterial {
|
|
14456
14470
|
get source() {
|
|
14457
14471
|
return this.uniforms.source.value;
|
|
14458
14472
|
}
|
|
@@ -14544,7 +14558,7 @@ class lu extends W.ShaderMaterial {
|
|
|
14544
14558
|
});
|
|
14545
14559
|
}
|
|
14546
14560
|
}
|
|
14547
|
-
class
|
|
14561
|
+
class hu {
|
|
14548
14562
|
constructor(e, t, i, s) {
|
|
14549
14563
|
this.params = {
|
|
14550
14564
|
inside: !1,
|
|
@@ -14583,7 +14597,7 @@ class cu {
|
|
|
14583
14597
|
wrapS: W.ClampToEdgeWrapping,
|
|
14584
14598
|
wrapT: W.ClampToEdgeWrapping
|
|
14585
14599
|
})
|
|
14586
|
-
], this.effectQuad = new wi(new
|
|
14600
|
+
], this.effectQuad = new wi(new lu()), this.jfaQuad = new wi(new cu()), this.seedQuad = new wi(this.seedMaterial), this.expandQuad = new wi(new au()), this.setSize(window.innerWidth, window.innerHeight);
|
|
14587
14601
|
}
|
|
14588
14602
|
setSize(e, t) {
|
|
14589
14603
|
const i = this.renderer.getPixelRatio(), s = Math.floor(e * i), r = Math.floor(t * i);
|
|
@@ -14598,8 +14612,8 @@ class cu {
|
|
|
14598
14612
|
let o = !1;
|
|
14599
14613
|
const c = s.layers.mask;
|
|
14600
14614
|
if (e) {
|
|
14601
|
-
const
|
|
14602
|
-
|
|
14615
|
+
const D = Array.isArray(e) ? e : [e];
|
|
14616
|
+
D.length > 0 && (o = !0, this._box.makeEmpty(), D.forEach((C) => {
|
|
14603
14617
|
if (C)
|
|
14604
14618
|
try {
|
|
14605
14619
|
this._box.expandByObject(C), C.traverse((E) => {
|
|
@@ -14612,7 +14626,7 @@ class cu {
|
|
|
14612
14626
|
} else
|
|
14613
14627
|
this._box.setFromObject(i).getBoundingSphere(this._sphere);
|
|
14614
14628
|
this.masks[0].setSize(this.targets[0].width, this.targets[0].height), this.masks[1].setSize(this.masks[0].width, this.masks[0].height), i.overrideMaterial = this.maskMaterial, t.setClearColor(0, 0), t.setRenderTarget(this.masks[0]), t.clear(), t.render(i, s), i.overrideMaterial = null, t.setRenderTarget(null);
|
|
14615
|
-
for (let
|
|
14629
|
+
for (let D = 0; D < 4; D++)
|
|
14616
14630
|
this.expandQuad.material.source = this.masks[0].texture, t.setRenderTarget(this.masks[1]), this.expandQuad.render(t), t.setRenderTarget(null), this.masks.reverse();
|
|
14617
14631
|
this.masks.reverse(), s.updateMatrixWorld();
|
|
14618
14632
|
const h = this._sphere.center.clone();
|
|
@@ -14642,7 +14656,7 @@ class cu {
|
|
|
14642
14656
|
}), s.layers.mask = c);
|
|
14643
14657
|
}
|
|
14644
14658
|
}
|
|
14645
|
-
class
|
|
14659
|
+
class uu extends q {
|
|
14646
14660
|
constructor(e = 200, t = 20, i = 0.8) {
|
|
14647
14661
|
const s = new mi(e, e), r = new Gt({
|
|
14648
14662
|
side: gi,
|
|
@@ -14697,7 +14711,7 @@ class hu extends q {
|
|
|
14697
14711
|
super(s, r), this.position.z = -0.02;
|
|
14698
14712
|
}
|
|
14699
14713
|
}
|
|
14700
|
-
const
|
|
14714
|
+
const fu = "https://cdn2.seer-group.com/libs/hdr/aristea_wreck_512.hdr", du = "https://cdn2.seer-group.com/libs/hdr/lightroom_14b_512.hdr", pu = "https://cdn2.seer-group.com/libs/fonts.type.json", lf = new jo(pu);
|
|
14701
14715
|
class Tn {
|
|
14702
14716
|
constructor(e) {
|
|
14703
14717
|
var i;
|
|
@@ -14732,22 +14746,22 @@ class Tn {
|
|
|
14732
14746
|
e && (e.metalness = this._defaults.metalness, e.roughness = this._defaults.roughness, e.envMapIntensity = this._defaults.envMapIntensity, e.needsUpdate = !0);
|
|
14733
14747
|
}
|
|
14734
14748
|
}
|
|
14735
|
-
var
|
|
14749
|
+
var mu = /* @__PURE__ */ ((a) => (a[a.DEFAULT = 0] = "DEFAULT", a[a.CAN_INSTALL = 1] = "CAN_INSTALL", a))(mu || {});
|
|
14736
14750
|
const Sn = 0.15;
|
|
14737
14751
|
Ee.DEFAULT_UP.set(0, 0, 1);
|
|
14738
14752
|
let Ft, Zi = 0, rr = 0;
|
|
14739
|
-
const
|
|
14753
|
+
const gu = () => {
|
|
14740
14754
|
Ft = void 0, Zi = 0, rr = 0;
|
|
14741
|
-
},
|
|
14742
|
-
class
|
|
14755
|
+
}, _u = new ze({ colorWrite: !1 });
|
|
14756
|
+
class cf {
|
|
14743
14757
|
constructor(e) {
|
|
14744
|
-
this.props = e, this.stats = new hi(), this.scene = new Os(), this.overlayScene = new Os(), this.renderer = new
|
|
14758
|
+
this.props = e, this.stats = new hi(), this.scene = new Os(), this.overlayScene = new Os(), this.renderer = new Uo({
|
|
14745
14759
|
antialias: !0,
|
|
14746
14760
|
alpha: !0,
|
|
14747
14761
|
logarithmicDepthBuffer: !0,
|
|
14748
14762
|
powerPreference: "high-performance",
|
|
14749
14763
|
preserveDrawingBuffer: !0
|
|
14750
|
-
}), this.css2dRenderer = new
|
|
14764
|
+
}), this.css2dRenderer = new Qo(), this.mousePos = new G(), this.mouseCoord = new G(), this.offset = new G(), this.size = new G(), this.amr = new Xc({ showSizeBox: !0, showController: !0 }), this._selectedForOutline = [], this._clock = new rs(!0), this._uiHiddenTime = this._clock.getElapsedTime(), this.camera = new ss(
|
|
14751
14765
|
39.6,
|
|
14752
14766
|
window.innerWidth / window.innerHeight,
|
|
14753
14767
|
0.1,
|
|
@@ -14759,16 +14773,16 @@ class lf {
|
|
|
14759
14773
|
-this.d,
|
|
14760
14774
|
0.1,
|
|
14761
14775
|
1e3
|
|
14762
|
-
), this._axisMoving = !1, this._container = new
|
|
14776
|
+
), this._axisMoving = !1, this._container = new Pe(), this._raycaster = new Rn(), 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 yt(), this.sound = new wc(), this._rafId = null, this._destroyed = !1, this._css2dUiStyleInjected = !1, this._ground = new q(
|
|
14763
14777
|
new mi(100, 100),
|
|
14764
|
-
new
|
|
14778
|
+
new Ho({
|
|
14765
14779
|
color: new X("#eee"),
|
|
14766
14780
|
metalness: 0.4,
|
|
14767
14781
|
roughness: 0.1,
|
|
14768
14782
|
clearcoat: 1,
|
|
14769
14783
|
clearcoatRoughness: 0.1
|
|
14770
14784
|
})
|
|
14771
|
-
), this._sciFiGrid = new
|
|
14785
|
+
), this._sciFiGrid = new uu(18, 40), this._amrRender = new je(1024, 1024, {
|
|
14772
14786
|
format: le,
|
|
14773
14787
|
type: nr,
|
|
14774
14788
|
colorSpace: pi,
|
|
@@ -14797,8 +14811,8 @@ class lf {
|
|
|
14797
14811
|
};
|
|
14798
14812
|
this._pointerDownTimeout = window.setTimeout(h, 200);
|
|
14799
14813
|
}, this._detectTrackpad = () => {
|
|
14800
|
-
Ft || typeof Ft < "u" || (Zi === 0 && (rr = performance.now()), Zi++, performance.now() - rr > 66 && (Zi > 5 ? Ft = !0 : Ft = !1, Ft ? this.controls.zoomSpeed = 0.2 : this.controls.zoomSpeed = 1, setTimeout(
|
|
14801
|
-
}, this.debounceForkHeightChange =
|
|
14814
|
+
Ft || typeof Ft < "u" || (Zi === 0 && (rr = performance.now()), Zi++, performance.now() - rr > 66 && (Zi > 5 ? Ft = !0 : Ft = !1, Ft ? this.controls.zoomSpeed = 0.2 : this.controls.zoomSpeed = 1, setTimeout(gu, 2e3)));
|
|
14815
|
+
}, this.debounceForkHeightChange = Cc(() => {
|
|
14802
14816
|
var c;
|
|
14803
14817
|
this._progressShadow.clear(), (c = this._progressShadow) == null || c.recalculate();
|
|
14804
14818
|
}, 300), this.focusObjects = (c, h) => {
|
|
@@ -14870,13 +14884,13 @@ class lf {
|
|
|
14870
14884
|
new b(-w.x, -w.y, -w.z)
|
|
14871
14885
|
], M = new b(0, 1, 0);
|
|
14872
14886
|
Math.abs(x.dot(M)) > 0.99 && M.set(0, 0, 1);
|
|
14873
|
-
const
|
|
14887
|
+
const D = new b().crossVectors(x, M).normalize(), C = new b().crossVectors(D, x).normalize();
|
|
14874
14888
|
let E = 0;
|
|
14875
14889
|
T.forEach((O) => {
|
|
14876
|
-
const Y = O.dot(
|
|
14890
|
+
const Y = O.dot(D), H = O.dot(C), fe = Math.sqrt(Y * Y + H * H);
|
|
14877
14891
|
E = Math.max(E, fe);
|
|
14878
14892
|
}), E = E / 2 + 0.4;
|
|
14879
|
-
const I = this.camera.fov * Math.PI / 180, A = 2 * Math.atan(Math.tan(I / 2) * this.camera.aspect), S = E / Math.tan(A / 2),
|
|
14893
|
+
const I = this.camera.fov * Math.PI / 180, A = 2 * Math.atan(Math.tan(I / 2) * this.camera.aspect), S = E / Math.tan(A / 2), P = E / Math.tan(I / 2), R = Math.max(S, P), k = g.clone().add(x.multiplyScalar(R)), F = this.camera.position.clone(), z = this.controls.target.clone();
|
|
14880
14894
|
let B = 500;
|
|
14881
14895
|
const Q = F.distanceTo(k) + z.distanceTo(y);
|
|
14882
14896
|
Q > 1e-3 && (B = Math.min(1e3, Math.max(450, Q * 45))), this._animateCamera(F, k, z, y, B);
|
|
@@ -14890,10 +14904,10 @@ class lf {
|
|
|
14890
14904
|
}), this.shadowMode = !1, this._focusRestoreView) {
|
|
14891
14905
|
const I = this._focusRestoreView;
|
|
14892
14906
|
this._focusRestoreView = void 0;
|
|
14893
|
-
const A = this.camera.position.clone(), S = this.controls.target.clone(),
|
|
14907
|
+
const A = this.camera.position.clone(), S = this.controls.target.clone(), P = I.position.clone(), R = I.target.clone();
|
|
14894
14908
|
let k = 500;
|
|
14895
|
-
const F = A.distanceTo(
|
|
14896
|
-
F > 1e-3 && (k = Math.min(1e3, Math.max(450, F * 45))), this._animateCamera(A,
|
|
14909
|
+
const F = A.distanceTo(P) + S.distanceTo(R);
|
|
14910
|
+
F > 1e-3 && (k = Math.min(1e3, Math.max(450, F * 45))), this._animateCamera(A, P, S, R, k, () => {
|
|
14897
14911
|
this.camera.up.copy(I.up);
|
|
14898
14912
|
});
|
|
14899
14913
|
return;
|
|
@@ -14917,14 +14931,14 @@ class lf {
|
|
|
14917
14931
|
const u = h.reduce((I, A) => I.add(A), new b()).multiplyScalar(1 / h.length), d = this.controls.target.clone(), n = this.camera.position.clone().sub(d).normalize();
|
|
14918
14932
|
let l = 0;
|
|
14919
14933
|
for (const I of h) {
|
|
14920
|
-
const A = I.clone().sub(u), S = A.dot(n),
|
|
14921
|
-
|
|
14934
|
+
const A = I.clone().sub(u), S = A.dot(n), P = Math.sqrt(Math.max(0, A.lengthSq() - S * S));
|
|
14935
|
+
P > l && (l = P);
|
|
14922
14936
|
}
|
|
14923
14937
|
l = l + 0.4;
|
|
14924
14938
|
const f = this.camera.fov * Math.PI / 180, m = 2 * Math.atan(Math.tan(f / 2) * this.camera.aspect), _ = l / Math.tan(m / 2), p = l / Math.tan(f / 2), g = Math.max(_, p), v = u.clone(), y = u.clone().add(n.clone().multiplyScalar(g < 1 ? 1 : g)), x = this.camera.position.clone(), w = d.clone(), T = { t: 0 };
|
|
14925
14939
|
let M = 500;
|
|
14926
|
-
const
|
|
14927
|
-
|
|
14940
|
+
const D = x.distanceTo(y) + w.distanceTo(v);
|
|
14941
|
+
D > 1e-3 && (M = Math.min(1e3, Math.max(450, D * 45))), this._lastTarget = v.clone(), this._fitAnimation = new Ji(T).to({ t: 1 }, M).easing(me.Easing.Quadratic.InOut).onStart(() => {
|
|
14928
14942
|
this.controls.enabled = !1;
|
|
14929
14943
|
}).onUpdate(() => {
|
|
14930
14944
|
const I = T.t;
|
|
@@ -14950,8 +14964,8 @@ class lf {
|
|
|
14950
14964
|
];
|
|
14951
14965
|
let _ = 0;
|
|
14952
14966
|
for (const A of m) {
|
|
14953
|
-
const S = A.dot(l),
|
|
14954
|
-
|
|
14967
|
+
const S = A.dot(l), P = Math.sqrt(Math.max(0, A.lengthSq() - S * S));
|
|
14968
|
+
P > _ && (_ = P);
|
|
14955
14969
|
}
|
|
14956
14970
|
_ = _ * 1.05;
|
|
14957
14971
|
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 = _ / Math.tan(p / 2), x = Math.max(v, y), w = u.clone();
|
|
@@ -14959,10 +14973,10 @@ class lf {
|
|
|
14959
14973
|
h.z < h.x && h.z < h.y && (T = h.x * 0.8), h.z > h.x && h.z > h.y && (T = 0), w.z += T;
|
|
14960
14974
|
const M = n.clone().normalize().multiplyScalar(x < 1 ? 1 : x).add(w);
|
|
14961
14975
|
Math.max(h.x * 2, 5);
|
|
14962
|
-
const
|
|
14976
|
+
const D = this.camera.position.clone(), C = this.controls.target.clone();
|
|
14963
14977
|
let E = 600;
|
|
14964
|
-
const I =
|
|
14965
|
-
I > 1e-3 && (E = Math.min(800, Math.max(650, I * 45))), this._animateCamera(
|
|
14978
|
+
const I = D.distanceTo(M) + C.distanceTo(d);
|
|
14979
|
+
I > 1e-3 && (E = Math.min(800, Math.max(650, I * 45))), this._animateCamera(D, M, C, d, E, () => {
|
|
14966
14980
|
this.shadowMode || (this._progressShadow.visible = !0, this._progressShadow.isFinished || this._progressShadow.recalculate());
|
|
14967
14981
|
}), this.controls.minDistance = Math.max(0.2, Math.min(x * 0.25, x - 0.1)), this.controls.maxDistance = x * 4;
|
|
14968
14982
|
}, this.resize = () => {
|
|
@@ -14978,9 +14992,9 @@ class lf {
|
|
|
14978
14992
|
if (this.stats.begin(), this.renderer.domElement.dispatchEvent(new CustomEvent("ticker", {
|
|
14979
14993
|
detail: c
|
|
14980
14994
|
})), this._rafId = requestAnimationFrame(this.ticker), this.renderer.clear(), this.usePathTracing) {
|
|
14981
|
-
this.hideAmrUI(), this.sampleCount < this.maxSample ? this.sampleCount++ : this.pathTracer.pausePathTracing = !0, this.pathTracer.renderSample();
|
|
14995
|
+
this.hideAmrUI(), this.amr.shapeKeyDirty && (this.amr.shapeKeyDirty = !1, this._invalidateMorphGeometries(), this.pathTracer.setScene(this.scene, this.mainCamera), this.sampleCount = 0, this.pathTracer.pausePathTracing = !1), this.sampleCount < this.maxSample ? this.sampleCount++ : this.pathTracer.pausePathTracing = !0, this.pathTracer.renderSample();
|
|
14982
14996
|
const h = this.renderer.autoClear;
|
|
14983
|
-
this.renderer.autoClear = !1, this.scene.overrideMaterial =
|
|
14997
|
+
this.renderer.autoClear = !1, this.scene.overrideMaterial = _u, this.renderer.clearDepth(), this.renderer.render(this.scene, this.mainCamera), this.scene.overrideMaterial = null, this.renderer.render(this.overlayScene, this.mainCamera), this.renderer.autoClear = h;
|
|
14984
14998
|
} else {
|
|
14985
14999
|
this._clock.getElapsedTime() - this._uiHiddenTime > 0.15 ? this.showControls && this.amr.controllers.forEach((d) => d.show()) : this.amr.controllers.forEach((d) => d.hide());
|
|
14986
15000
|
const u = this.stats.fps();
|
|
@@ -14993,12 +15007,12 @@ class lf {
|
|
|
14993
15007
|
}
|
|
14994
15008
|
this.stats.end();
|
|
14995
15009
|
}
|
|
14996
|
-
}, this.stats.showPanel(0), this.hideState(), e.fov && (this.camera.fov = e.fov, this.camera.updateProjectionMatrix()), Xn(Vt, this.renderer), this._ground.visible = !1, this.controls = new
|
|
14997
|
-
const { tiles: t } =
|
|
14998
|
-
this.pathTracer = new
|
|
15010
|
+
}, this.stats.showPanel(0), this.hideState(), e.fov && (this.camera.fov = e.fov, this.camera.updateProjectionMatrix()), Xn(Vt, this.renderer), this._ground.visible = !1, this.controls = new Go(this.camera, this.renderer.domElement), this.controls.enablePan = !0, this.controls.rotateSpeed = this.props.isMobile ? 0.6 : 0.5, this.controls.dampingFactor = Sn, this.controls.enableDamping = !0, this.controls.maxDistance = 10, this.controls.minDistance = 1, this.controls.zoomSpeed = this.props.isMobile ? 0.3 : yc() ? 0.2 : 1, this._cameraPositionUI = new ou(this.controls), this.renderer.setPixelRatio(window.devicePixelRatio || 1), this.renderer.autoClear = !0, this.renderer.toneMapping = No, this.renderer.toneMappingExposure = 1.4, this.renderer.outputColorSpace = pi, 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.css2dRenderer.domElement.setAttribute("data-css2d-root", "1"), this._ensureCss2dUiStyle(), this.camera.position.set(10, -10, 5), this.camera.lookAt(new b());
|
|
15011
|
+
const { tiles: t } = Sc();
|
|
15012
|
+
this.pathTracer = new Wl(this.renderer), this.pathTracer.multipleImportanceSampling = !0, this.pathTracer.filterGlossyFactor = 0.6;
|
|
14999
15013
|
let i = window.devicePixelRatio;
|
|
15000
15014
|
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;
|
|
15001
|
-
const s = new
|
|
15015
|
+
const s = new tu(e.workerUrl), r = typeof navigator < "u" ? navigator.hardwareConcurrency : 4;
|
|
15002
15016
|
s.maxWorkerCount = r, this.pathTracer.setBVHWorker(s), this.orthographicCamera.left = -20, this.orthographicCamera.right = 20, this.orthographicCamera.top = -20, this.orthographicCamera.bottom = 20, this._lastTarget = this.controls.target.clone();
|
|
15003
15017
|
const o = () => {
|
|
15004
15018
|
let c = this._lastTarget.x, h = this._lastTarget.y;
|
|
@@ -15007,16 +15021,16 @@ class lf {
|
|
|
15007
15021
|
this.controls.addEventListener("change", () => {
|
|
15008
15022
|
var c;
|
|
15009
15023
|
this.sampleCount = 0, o(), this._uiHiddenTime = this._clock.getElapsedTime(), this.orthographicCamera.position.copy(this.camera.position), this.orthographicCamera.lookAt(this.controls.target), this.usePathTracing && (this.pathTracer.pausePathTracing = !1, (c = this.pathTracer) == null || c.updateCamera()), this._updateCamera(), !(Math.abs(this.camera.position.x) < 1e-3 || Math.abs(this.camera.position.y) < 1e-3) && (this._axisMoving || (this.mainCamera = this.camera, this.usePathTracing && this.generateBVH().then()));
|
|
15010
|
-
}), this._mainCamera = this.camera, this._progressShadow = new
|
|
15024
|
+
}), this._mainCamera = this.camera, this._progressShadow = new su(this.renderer, this.scene, {
|
|
15011
15025
|
size: 8,
|
|
15012
15026
|
lightCount: 6,
|
|
15013
15027
|
frames: e.isMobile ? 20 : 60,
|
|
15014
15028
|
lightRadius: 2,
|
|
15015
15029
|
ambientWeight: 0.75
|
|
15016
|
-
}), this._progressShadow.lightOrigin.position.set(3, 2.5, 0.6), this._progressShadow.visible = !1, this._container.add(this.amr), this.scene.add(this._container), this.ticker(0), this._loadEnv(), this._initEvents(), this.scene.add(this._cameraPositionUI), this._ground.rotateX(-Math.PI / 2), this.scene.add(this._ground), this._jumpFlood = new
|
|
15030
|
+
}), this._progressShadow.lightOrigin.position.set(3, 2.5, 0.6), this._progressShadow.visible = !1, this._container.add(this.amr), this.scene.add(this._container), this.ticker(0), this._loadEnv(), this._initEvents(), this.scene.add(this._cameraPositionUI), this._ground.rotateX(-Math.PI / 2), this.scene.add(this._ground), this._jumpFlood = new hu(this.renderer, this.scene, this.camera, {
|
|
15017
15031
|
thickness: 4,
|
|
15018
15032
|
color: "#fff"
|
|
15019
|
-
}), (typeof e.useAxisBall != "boolean" || e.useAxisBall) && (this._controlsGizmo = new
|
|
15033
|
+
}), (typeof e.useAxisBall != "boolean" || e.useAxisBall) && (this._controlsGizmo = new iu(this.controls, {
|
|
15020
15034
|
size: 160,
|
|
15021
15035
|
padding: 12,
|
|
15022
15036
|
offset: e.axisBallOffset || new G(10, 10),
|
|
@@ -15036,6 +15050,18 @@ class lf {
|
|
|
15036
15050
|
const e = this.renderer.getRenderTarget();
|
|
15037
15051
|
this.renderer.setRenderTarget(this._amrRender), this.renderer.setClearColor(0, 0), this.renderer.clear(!0, !0, !0), this.renderer.setRenderTarget(e);
|
|
15038
15052
|
}
|
|
15053
|
+
/**
|
|
15054
|
+
* 递增所有含 morphTarget 的 mesh 的 position attribute version,
|
|
15055
|
+
* 使 three-gpu-pathtracer 的 MeshDiff.didChange() 返回 true,触发重新 bake。
|
|
15056
|
+
*/
|
|
15057
|
+
_invalidateMorphGeometries() {
|
|
15058
|
+
this.scene.traverse((e) => {
|
|
15059
|
+
if (e instanceof q && e.morphTargetInfluences && e.morphTargetDictionary) {
|
|
15060
|
+
const t = e.geometry.attributes.position;
|
|
15061
|
+
t && (t.needsUpdate = !0);
|
|
15062
|
+
}
|
|
15063
|
+
});
|
|
15064
|
+
}
|
|
15039
15065
|
get shadowMode() {
|
|
15040
15066
|
return this._shadowMode;
|
|
15041
15067
|
}
|
|
@@ -15043,7 +15069,7 @@ class lf {
|
|
|
15043
15069
|
e ? (this._progressShadow.visible = !1, this.amr.bodyOpacity = 0.2) : (this._progressShadow.visible = !0, this.amr.bodyOpacity = 1, this._progressShadow.isFinished || this._progressShadow.recalculate().then()), this._shadowMode = e;
|
|
15044
15070
|
}
|
|
15045
15071
|
set usePathTracing(e) {
|
|
15046
|
-
this._clearAmrContent(), e ? (this.scene.background = new X("transparent"), this.renderer.toneMappingExposure = 1.8, this.overlayScene.add(this._progressShadow.shadowCatcherMesh), this.amr && (this.amr.bodyOpacity = 1), this.hideAmrUI(), this.pathTracer.renderToCanvas = !0, this.scene.background = null, this._ptEnvMap ? (this.scene.environment = this._ptEnvMap, this.pathTracer.updateEnvironment()) : new Tr().load(
|
|
15072
|
+
this._clearAmrContent(), e ? (this.scene.background = new X("transparent"), this.renderer.toneMappingExposure = 1.8, this.overlayScene.add(this._progressShadow.shadowCatcherMesh), this.amr && (this.amr.bodyOpacity = 1), this.hideAmrUI(), this.pathTracer.renderToCanvas = !0, this.scene.background = null, this._ptEnvMap ? (this.scene.environment = this._ptEnvMap, this.pathTracer.updateEnvironment()) : new Tr().load(du, (t) => {
|
|
15047
15073
|
t.mapping = Xi, this._ptEnvMap = t, this.usePathTracing && (this.scene.environment = t, this.pathTracer.updateEnvironment());
|
|
15048
15074
|
})) : (this.renderer.toneMappingExposure = 1.4, this.scene.add(this._progressShadow.shadowCatcherMesh), this.pathTracer.renderToCanvas = !1, this.amr.logos.forEach((t) => {
|
|
15049
15075
|
var i;
|
|
@@ -15051,7 +15077,7 @@ class lf {
|
|
|
15051
15077
|
}), 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 : Sn, this.sampleCount = 0;
|
|
15052
15078
|
}
|
|
15053
15079
|
get fpsAverage() {
|
|
15054
|
-
return
|
|
15080
|
+
return vc(this._fpsCache);
|
|
15055
15081
|
}
|
|
15056
15082
|
get mainCamera() {
|
|
15057
15083
|
return this._mainCamera;
|
|
@@ -15094,8 +15120,8 @@ class lf {
|
|
|
15094
15120
|
this.orthographicCamera.left = -t * i / 2, this.orthographicCamera.right = t * i / 2, this.orthographicCamera.top = t / 2, this.orthographicCamera.bottom = -t / 2, this.orthographicCamera.updateProjectionMatrix();
|
|
15095
15121
|
}
|
|
15096
15122
|
_loadEnv() {
|
|
15097
|
-
new Tr().load(
|
|
15098
|
-
t.mapping = Xi, this._envMap = t, this._usePathTracing || (this.scene.background = t, this.scene.backgroundBlurriness = 1, this.scene.backgroundIntensity = 1, this.scene.backgroundRotation = new
|
|
15123
|
+
new Tr().load(fu, (t) => {
|
|
15124
|
+
t.mapping = Xi, this._envMap = t, this._usePathTracing || (this.scene.background = t, this.scene.backgroundBlurriness = 1, this.scene.backgroundIntensity = 1, this.scene.backgroundRotation = new Vo(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();
|
|
15099
15125
|
}, () => {
|
|
15100
15126
|
}, () => {
|
|
15101
15127
|
});
|
|
@@ -15153,7 +15179,7 @@ class lf {
|
|
|
15153
15179
|
const t = (e == null ? void 0 : e.subject) ?? this._container;
|
|
15154
15180
|
(o = this._progressShadow) == null || o.visible;
|
|
15155
15181
|
const i = this.scene.background, s = this.showSize;
|
|
15156
|
-
return new
|
|
15182
|
+
return new vu({
|
|
15157
15183
|
renderer: this.renderer,
|
|
15158
15184
|
scene: this.scene,
|
|
15159
15185
|
overlayScene: this.overlayScene,
|
|
@@ -15180,13 +15206,13 @@ class lf {
|
|
|
15180
15206
|
}
|
|
15181
15207
|
async addAMR(e, t = "") {
|
|
15182
15208
|
this.amr.init(this), await this.amr.load(e, t), this.amr.addEventListener("fork-height-change", this.debounceForkHeightChange), this.amr.addEventListener("shape-key-changed", (i, s) => {
|
|
15183
|
-
this.
|
|
15209
|
+
this.overlayScene.traverse((r) => {
|
|
15184
15210
|
if (!Object.keys(r.morphTargetDictionary || {}).includes(i))
|
|
15185
15211
|
return;
|
|
15186
15212
|
let o = s;
|
|
15187
15213
|
r.userData[`origin_${i}`] && (o -= r.userData[`origin_${i}`]);
|
|
15188
15214
|
const c = r.morphTargetDictionary[i];
|
|
15189
|
-
r.morphTargetInfluences && (r.morphTargetInfluences[c] = o)
|
|
15215
|
+
r.morphTargetInfluences && (r.morphTargetInfluences[c] = o);
|
|
15190
15216
|
}), [
|
|
15191
15217
|
"width",
|
|
15192
15218
|
"length",
|
|
@@ -15275,7 +15301,7 @@ class lf {
|
|
|
15275
15301
|
e && ((c = this._resizeObserver) == null || c.unobserve(e)), this.controls.dispose(), this.renderer.domElement.remove(), this.renderer.dispose(), Xe(this.scene), this.scene.clear();
|
|
15276
15302
|
}
|
|
15277
15303
|
}
|
|
15278
|
-
class
|
|
15304
|
+
class vu {
|
|
15279
15305
|
constructor(e) {
|
|
15280
15306
|
this.deps = e, this.canvas = null, this.pixelBuffer = null, this.orthoCamera = new Hs(-1, 1, 1, -1, 0.1, 1e3), this.orthoCamera.position.set(0, 0, 5), this.perspectiveCamera = new ss(45, 1, 0.1, 2e3);
|
|
15281
15307
|
}
|
|
@@ -15365,23 +15391,23 @@ class _u {
|
|
|
15365
15391
|
c.lengthSq() === 0 && c.set(0, 0, 1);
|
|
15366
15392
|
const h = t.up.clone().normalize();
|
|
15367
15393
|
if (Math.abs(h.dot(c)) > 0.999 && (h.set(0, 0, 1), Math.abs(h.dot(c)) > 0.999 && h.set(0, 1, 0)), (t.mode ?? "orthographic") === "perspective") {
|
|
15368
|
-
const x = this.perspectiveCamera, w = t.fov ?? 45, T = Qe.degToRad(w), M = Math.max(Math.tan(T / 2), 1e-4),
|
|
15394
|
+
const x = this.perspectiveCamera, w = t.fov ?? 45, T = Qe.degToRad(w), M = Math.max(Math.tan(T / 2), 1e-4), D = Math.max(M * (i || 1), 1e-4), C = this.getPerspectiveDirection(t, e.size).normalize(), E = new b().crossVectors(C, h).normalize();
|
|
15369
15395
|
E.lengthSq() < 1e-6 && E.set(1, 0, 0);
|
|
15370
|
-
const I = new b().crossVectors(E, C).normalize(), A = Math.max(e.size.x * 0.5, 1e-4), S = Math.max(e.size.y * 0.5, 1e-4),
|
|
15371
|
-
new b(-A, -S, -
|
|
15372
|
-
new b(-A, -S,
|
|
15373
|
-
new b(-A, S, -
|
|
15374
|
-
new b(-A, S,
|
|
15375
|
-
new b(A, -S, -
|
|
15376
|
-
new b(A, -S,
|
|
15377
|
-
new b(A, S, -
|
|
15378
|
-
new b(A, S,
|
|
15396
|
+
const I = new b().crossVectors(E, C).normalize(), A = Math.max(e.size.x * 0.5, 1e-4), S = Math.max(e.size.y * 0.5, 1e-4), P = Math.max(e.size.z * 0.5, 1e-4), R = [
|
|
15397
|
+
new b(-A, -S, -P),
|
|
15398
|
+
new b(-A, -S, P),
|
|
15399
|
+
new b(-A, S, -P),
|
|
15400
|
+
new b(-A, S, P),
|
|
15401
|
+
new b(A, -S, -P),
|
|
15402
|
+
new b(A, -S, P),
|
|
15403
|
+
new b(A, S, -P),
|
|
15404
|
+
new b(A, S, P)
|
|
15379
15405
|
];
|
|
15380
15406
|
let k = 0, F = -1 / 0;
|
|
15381
15407
|
for (const Q of R) {
|
|
15382
15408
|
const U = E.dot(Q), O = I.dot(Q), Y = C.dot(Q);
|
|
15383
15409
|
F = Math.max(F, Y);
|
|
15384
|
-
const H = Y + Math.abs(U) /
|
|
15410
|
+
const H = Y + Math.abs(U) / D, fe = Y + Math.abs(O) / M;
|
|
15385
15411
|
k = Math.max(k, H, fe);
|
|
15386
15412
|
}
|
|
15387
15413
|
k = Math.max(k, F + 0.1);
|
|
@@ -15463,16 +15489,16 @@ class _u {
|
|
|
15463
15489
|
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;
|
|
15464
15490
|
}
|
|
15465
15491
|
}
|
|
15466
|
-
const
|
|
15492
|
+
const yu = "shop-components", xu = "0.4.30", wu = "Shop components", bu = "dist/shop-components.umd.js", Au = "dist/shop-components.mjs", Tu = "dist/main.d.ts", Su = {
|
|
15467
15493
|
dts: "tsc --emitDeclarationOnly & tsc & storybook build -o dist",
|
|
15468
15494
|
dev: "vite dev",
|
|
15469
15495
|
build: "vite build",
|
|
15470
15496
|
"build:web": "BUILD_WEB=1 vite build --outDir dist/web --emptyOutDir",
|
|
15471
15497
|
v: "auto-changelog -p && git add CHANGELOG.md"
|
|
15472
|
-
},
|
|
15498
|
+
}, Mu = [
|
|
15473
15499
|
"dist",
|
|
15474
15500
|
"package.json"
|
|
15475
|
-
],
|
|
15501
|
+
], Cu = [], Iu = "machengda<machengda@seer-group.com>", Du = "ISC", Pu = {
|
|
15476
15502
|
"@needle-tools/gltf-progressive": "^3.3.5",
|
|
15477
15503
|
"auto-changelog": "^2.4.0",
|
|
15478
15504
|
vite: "5.1.6",
|
|
@@ -15480,11 +15506,11 @@ const vu = "shop-components", yu = "0.4.28", xu = "Shop components", wu = "dist/
|
|
|
15480
15506
|
tweakpane: "^4.0.3",
|
|
15481
15507
|
"@tweakpane/core": "^2.0.3",
|
|
15482
15508
|
stylus: "^0.63.0"
|
|
15483
|
-
}, Du = {
|
|
15484
|
-
"string-width": "4.2.3"
|
|
15485
15509
|
}, Eu = {
|
|
15486
|
-
|
|
15510
|
+
"string-width": "4.2.3"
|
|
15487
15511
|
}, Ru = {
|
|
15512
|
+
three: "0.182.0"
|
|
15513
|
+
}, Lu = {
|
|
15488
15514
|
"@tweenjs/tween.js": "^23.1.2",
|
|
15489
15515
|
"@types/howler": "^2.2.11",
|
|
15490
15516
|
"@types/three": "0.182.0",
|
|
@@ -15494,25 +15520,25 @@ const vu = "shop-components", yu = "0.4.28", xu = "Shop components", wu = "dist/
|
|
|
15494
15520
|
"three-gpu-pathtracer": "^0.0.24",
|
|
15495
15521
|
"three-mesh-bvh": "^0.9.5",
|
|
15496
15522
|
"troika-three-text": "^0.49.1"
|
|
15497
|
-
},
|
|
15498
|
-
name:
|
|
15499
|
-
version:
|
|
15500
|
-
description:
|
|
15501
|
-
main:
|
|
15502
|
-
module:
|
|
15503
|
-
types:
|
|
15504
|
-
scripts:
|
|
15505
|
-
files:
|
|
15506
|
-
keywords:
|
|
15507
|
-
author:
|
|
15508
|
-
license:
|
|
15523
|
+
}, ku = {
|
|
15524
|
+
name: yu,
|
|
15525
|
+
version: xu,
|
|
15526
|
+
description: wu,
|
|
15527
|
+
main: bu,
|
|
15528
|
+
module: Au,
|
|
15529
|
+
types: Tu,
|
|
15530
|
+
scripts: Su,
|
|
15531
|
+
files: Mu,
|
|
15532
|
+
keywords: Cu,
|
|
15533
|
+
author: Iu,
|
|
15534
|
+
license: Du,
|
|
15509
15535
|
devDependencies: Pu,
|
|
15510
|
-
resolutions:
|
|
15511
|
-
peerDependencies:
|
|
15512
|
-
dependencies:
|
|
15536
|
+
resolutions: Eu,
|
|
15537
|
+
peerDependencies: Ru,
|
|
15538
|
+
dependencies: Lu
|
|
15513
15539
|
};
|
|
15514
15540
|
function Mn() {
|
|
15515
|
-
const a = "Nebula Engin", e =
|
|
15541
|
+
const a = "Nebula Engin", e = ku.version, t = `%c ${a} %c v${e} `;
|
|
15516
15542
|
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;");
|
|
15517
15543
|
}
|
|
15518
15544
|
const Cn = "__SHOP_COMPONENTS_BANNER_PRINTED__";
|
|
@@ -15523,25 +15549,25 @@ try {
|
|
|
15523
15549
|
Mn();
|
|
15524
15550
|
}
|
|
15525
15551
|
export {
|
|
15526
|
-
|
|
15552
|
+
Xc as Amr,
|
|
15527
15553
|
on as Logo,
|
|
15528
15554
|
$i as SGLBLoader,
|
|
15529
15555
|
ne as SLOT_EVENTS,
|
|
15530
|
-
|
|
15556
|
+
cf as Scene3D,
|
|
15531
15557
|
Tn as Skin,
|
|
15532
15558
|
sn as Slot,
|
|
15533
|
-
|
|
15534
|
-
|
|
15559
|
+
mu as SlotState,
|
|
15560
|
+
vu as TriViewCapture,
|
|
15535
15561
|
Zr as arrayBufferToUrl,
|
|
15536
|
-
|
|
15537
|
-
|
|
15538
|
-
|
|
15539
|
-
|
|
15540
|
-
|
|
15541
|
-
|
|
15562
|
+
vc as calculateArrayAverage,
|
|
15563
|
+
rf as calculateFocalLength,
|
|
15564
|
+
af as createSGLBFile,
|
|
15565
|
+
sf as downloadBlob,
|
|
15566
|
+
of as dracoExporter,
|
|
15567
|
+
lf as font,
|
|
15542
15568
|
Pc as gltfExporter,
|
|
15543
15569
|
Vt as gltfLoader,
|
|
15544
15570
|
Xr as imageBitmapToUrl,
|
|
15545
|
-
|
|
15571
|
+
yc as isAppleDevice,
|
|
15546
15572
|
so as textureLoader
|
|
15547
15573
|
};
|