shop-components 0.4.23 → 0.4.24
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/shop-components.cjs +24 -24
- package/dist/shop-components.mjs +349 -355
- package/package.json +1 -1
package/dist/shop-components.mjs
CHANGED
|
@@ -10,7 +10,7 @@ var V = (o, e, t) => (tr(o, e, "read from private field"), t ? t.call(o) : e.get
|
|
|
10
10
|
e instanceof WeakSet ? e.add(o) : e.set(o, t);
|
|
11
11
|
}, Me = (o, e, t, i) => (tr(o, e, "write to private field"), i ? i.call(o, t) : e.set(o, t), t);
|
|
12
12
|
import * as B from "three";
|
|
13
|
-
import { BufferAttribute as ue, BufferGeometry as te, Matrix4 as $, Matrix3 as on, Vector3 as b, Vector4 as $e, MeshBasicMaterial as ri, Mesh as
|
|
13
|
+
import { BufferAttribute as ue, BufferGeometry as te, Matrix4 as $, Matrix3 as on, Vector3 as b, Vector4 as $e, MeshBasicMaterial as ri, Mesh as X, ShaderMaterial as Ft, NoBlending as ii, WebGLRenderTarget as ke, FloatType as de, RGBAFormat as re, NearestFilter as se, Vector2 as U, PerspectiveCamera as Ni, DataUtils as Fe, DataTexture as Be, HalfFloatType as Te, LinearFilter as Ae, RepeatWrapping as Je, RedFormat as ys, ClampToEdgeWrapping as Ue, Source as Gn, Quaternion as an, DataArrayTexture as qn, DoubleSide as ni, BackSide as ln, FrontSide as xs, Color as J, WebGLArrayRenderTarget as jn, UnsignedByteType as Hs, NoToneMapping as Qn, RGFormat as Yn, NormalBlending as cn, Spherical as Kn, EquirectangularReflectionMapping as Bi, LinearMipMapLinearFilter as Zn, Clock as Gi, Scene as ws, AdditiveBlending as Xn, Box3 as Q, Sphere as qi, CompressedTexture as Jn, Texture as je, InterleavedBuffer as $n, InterleavedBufferAttribute as eo, TextureLoader as hn, MeshStandardMaterial as Li, Group as me, LineSegments as bs, LineBasicMaterial as ir, Object3D as oi, LineDashedMaterial as As, RingGeometry as sr, BoxGeometry as to, EdgesGeometry as io, SRGBColorSpace as si, AnimationMixer as rr, VideoTexture as so, LoopRepeat as ro, LoopOnce as no, Plane as Ws, Line3 as Oe, Triangle as Kt, MathUtils as at, DirectionalLight as oo, NoColorSpace as nr, PlaneGeometry as Oi, MeshLambertMaterial as ao, DirectionalLightHelper as lo, PlaneHelper as co, UniformsUtils as ho, WebGLRenderer as uo, OrthographicCamera as Ts, Raycaster as fo, MeshPhysicalMaterial as po, ACESFilmicToneMapping as mo, Euler as go } from "three";
|
|
14
14
|
import { HDRLoader as or } from "three/examples/jsm/loaders/HDRLoader.js";
|
|
15
15
|
import { OrbitControls as vo } from "three/examples/jsm/controls/OrbitControls";
|
|
16
16
|
import { CSS2DObject as ze, CSS2DRenderer as _o } from "three/examples/jsm/renderers/CSS2DRenderer";
|
|
@@ -22,15 +22,15 @@ import { GLTFLoader as xo } from "three/examples/jsm/loaders/GLTFLoader";
|
|
|
22
22
|
import { DRACOLoader as wo } from "three/examples/jsm/loaders/DRACOLoader";
|
|
23
23
|
import { DRACOExporter as bo } from "three/examples/jsm/exporters/DRACOExporter";
|
|
24
24
|
import { GLTFExporter as Ao } from "three/examples/jsm/exporters/GLTFExporter";
|
|
25
|
-
import * as
|
|
25
|
+
import * as Zi from "three/examples/jsm/utils/SkeletonUtils.js";
|
|
26
26
|
import { Line2 as To } from "three/examples/jsm/lines/Line2.js";
|
|
27
27
|
import { LineMaterial as So } from "three/examples/jsm/lines/LineMaterial.js";
|
|
28
28
|
import { LineGeometry as ar } from "three/examples/jsm/lines/LineGeometry.js";
|
|
29
29
|
import { CSS3DObject as Mo } from "three/examples/jsm/renderers/CSS3DRenderer";
|
|
30
30
|
import "three/examples/jsm/utils/BufferGeometryUtils";
|
|
31
31
|
import { FullScreenQuad as ci } from "three/examples/jsm/postprocessing/Pass";
|
|
32
|
-
import { SAH as Co, MeshBVH as Io, FloatVertexAttributeTexture as Ro, MeshBVHUniformStruct as
|
|
33
|
-
import { FullScreenQuad as
|
|
32
|
+
import { SAH as Co, MeshBVH as Io, FloatVertexAttributeTexture as Ro, MeshBVHUniformStruct as Do, UIntVertexAttributeTexture as Lo, BVHShaderGLSL as Xi } from "three-mesh-bvh";
|
|
33
|
+
import { FullScreenQuad as Lt } from "three/examples/jsm/postprocessing/Pass.js";
|
|
34
34
|
function un(o, e, t = 0) {
|
|
35
35
|
if (o.isInterleavedBufferAttribute) {
|
|
36
36
|
const i = o.itemSize;
|
|
@@ -43,7 +43,7 @@ function un(o, e, t = 0) {
|
|
|
43
43
|
new s(i.buffer, a, o.array.length).set(o.array);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Zt(o, e = null) {
|
|
47
47
|
const t = o.array.constructor, i = o.normalized, s = o.itemSize, a = e === null ? o.count : e;
|
|
48
48
|
return new ue(new t(s * a), s, i);
|
|
49
49
|
}
|
|
@@ -128,7 +128,7 @@ function Bo(o, e = {}, t = new te()) {
|
|
|
128
128
|
const m = d[r];
|
|
129
129
|
if (!t.getAttribute(m)) {
|
|
130
130
|
const g = o[0].getAttribute(m);
|
|
131
|
-
t.setAttribute(m,
|
|
131
|
+
t.setAttribute(m, Zt(g, f)), u = !0;
|
|
132
132
|
}
|
|
133
133
|
let _ = 0;
|
|
134
134
|
const p = t.getAttribute(m);
|
|
@@ -275,14 +275,14 @@ function Vo(o, e = {}, t = new te()) {
|
|
|
275
275
|
const i = o.geometry, s = e.applyWorldTransforms, a = e.attributes.includes("normal"), n = e.attributes.includes("tangent"), c = i.attributes, h = t.attributes;
|
|
276
276
|
for (const v in t.attributes)
|
|
277
277
|
(!e.attributes.includes(v) || !(v in i.attributes)) && t.deleteAttribute(v);
|
|
278
|
-
!t.index && i.index && (t.index = i.index.clone()), h.position || t.setAttribute("position",
|
|
278
|
+
!t.index && i.index && (t.index = i.index.clone()), h.position || t.setAttribute("position", Zt(c.position)), a && !h.normal && c.normal && t.setAttribute("normal", Zt(c.normal)), n && !h.tangent && c.tangent && t.setAttribute("tangent", Zt(c.tangent)), Tt(i.index, t.index), Tt(c.position, h.position), a && Tt(c.normal, h.normal), n && Tt(c.tangent, h.tangent);
|
|
279
279
|
const f = c.position, d = a ? c.normal : null, r = n ? c.tangent : null, l = i.morphAttributes.position, u = i.morphAttributes.normal, m = i.morphAttributes.tangent, _ = i.morphTargetsRelative, p = o.morphTargetInfluences, g = new on();
|
|
280
280
|
g.getNormalMatrix(o.matrixWorld), i.index && t.index.array.set(i.index.array);
|
|
281
281
|
for (let v = 0, y = c.position.count; v < y; v++)
|
|
282
282
|
it.fromBufferAttribute(f, v), d && st.fromBufferAttribute(d, v), r && (hr.fromBufferAttribute(r, v), rt.fromBufferAttribute(r, v)), p && (l && $i(l, p, _, v, it), u && $i(u, p, _, v, st), m && $i(m, p, _, v, rt)), o.isSkinnedMesh && (o.applyBoneTransform(v, it), d && pr(o, v, st), r && pr(o, v, rt)), s && it.applyMatrix4(o.matrixWorld), h.position.setXYZ(v, it.x, it.y, it.z), d && (s && st.applyNormalMatrix(g), h.normal.setXYZ(v, st.x, st.y, st.z)), r && (s && rt.transformDirection(o.matrixWorld), h.tangent.setXYZW(v, rt.x, rt.y, rt.z, hr.w));
|
|
283
283
|
for (const v in e.attributes) {
|
|
284
284
|
const y = e.attributes[v];
|
|
285
|
-
y === "position" || y === "tangent" || y === "normal" || !(y in c) || (h[y] || t.setAttribute(y,
|
|
285
|
+
y === "position" || y === "tangent" || y === "normal" || !(y in c) || (h[y] || t.setAttribute(y, Zt(c[y])), Tt(c[y], h[y]), un(c[y], h[y]));
|
|
286
286
|
}
|
|
287
287
|
return o.matrixWorld.determinant() < 0 && Wo(t), t;
|
|
288
288
|
}
|
|
@@ -341,7 +341,7 @@ class Qo {
|
|
|
341
341
|
_getDummyMesh() {
|
|
342
342
|
if (!this._dummyMesh) {
|
|
343
343
|
const e = new ri(), t = new te();
|
|
344
|
-
t.setAttribute("position", new ue(new Float32Array(9), 3)), this._dummyMesh = new
|
|
344
|
+
t.setAttribute("position", new ue(new Float32Array(9), 3)), this._dummyMesh = new X(t, e);
|
|
345
345
|
}
|
|
346
346
|
return this._dummyMesh;
|
|
347
347
|
}
|
|
@@ -412,7 +412,7 @@ function Ko(o) {
|
|
|
412
412
|
const i = Array.from(t).sort((s, a) => s.uuid < a.uuid ? 1 : s.uuid > a.uuid ? -1 : 0);
|
|
413
413
|
return { lights: e, iesTextures: i };
|
|
414
414
|
}
|
|
415
|
-
class
|
|
415
|
+
class Zo {
|
|
416
416
|
get initialized() {
|
|
417
417
|
return !!this.bvh;
|
|
418
418
|
}
|
|
@@ -499,7 +499,7 @@ class Gs extends Ft {
|
|
|
499
499
|
return !1;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
class
|
|
502
|
+
class Xo extends Gs {
|
|
503
503
|
constructor(e) {
|
|
504
504
|
super({
|
|
505
505
|
blending: ii,
|
|
@@ -823,7 +823,7 @@ class ta {
|
|
|
823
823
|
generateMipmaps: !1
|
|
824
824
|
}), s = e.getRenderTarget();
|
|
825
825
|
e.setRenderTarget(i);
|
|
826
|
-
const a = new
|
|
826
|
+
const a = new Lt(new ea());
|
|
827
827
|
return a.material.resolution.set(t, t), a.render(e), e.setRenderTarget(s), a.dispose(), i;
|
|
828
828
|
}
|
|
829
829
|
}
|
|
@@ -1192,7 +1192,7 @@ class wr extends jn {
|
|
|
1192
1192
|
super(e, t, 1, s), Aa(this.texture, s), this.texture.setTextures = (...n) => {
|
|
1193
1193
|
this.setTextures(...n);
|
|
1194
1194
|
}, this.hashes = [null];
|
|
1195
|
-
const a = new
|
|
1195
|
+
const a = new Lt(new Ta());
|
|
1196
1196
|
this.fsQuad = a;
|
|
1197
1197
|
}
|
|
1198
1198
|
setTextures(e, t, i = this.width, s = this.height) {
|
|
@@ -1333,13 +1333,13 @@ class Ra extends Be {
|
|
|
1333
1333
|
this.sampler.reset(), this.generator.seed = 0;
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
|
-
function
|
|
1336
|
+
function Da(o, e = Math.random) {
|
|
1337
1337
|
for (let t = o.length - 1; t > 0; t--) {
|
|
1338
1338
|
const i = ~~((e() - 1e-6) * t), s = o[t];
|
|
1339
1339
|
o[t] = o[i], o[i] = s;
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1342
|
+
function La(o, e) {
|
|
1343
1343
|
o.fill(0);
|
|
1344
1344
|
for (let t = 0; t < e; t++)
|
|
1345
1345
|
o[t] = 1;
|
|
@@ -1435,7 +1435,7 @@ class Pa {
|
|
|
1435
1435
|
} = this;
|
|
1436
1436
|
e.resize(a), e.setSigma(i);
|
|
1437
1437
|
const n = Math.floor(a * a * s), c = e.binaryPattern;
|
|
1438
|
-
|
|
1438
|
+
La(c, n), Da(c, this.random);
|
|
1439
1439
|
for (let r = 0, l = c.length; r < l; r++)
|
|
1440
1440
|
c[r] === 1 && e.addPointIndex(r);
|
|
1441
1441
|
for (; ; ) {
|
|
@@ -3219,7 +3219,7 @@ const Ba = (
|
|
|
3219
3219
|
}
|
|
3220
3220
|
|
|
3221
3221
|
`
|
|
3222
|
-
),
|
|
3222
|
+
), Za = (
|
|
3223
3223
|
/* glsl */
|
|
3224
3224
|
`
|
|
3225
3225
|
|
|
@@ -3243,7 +3243,7 @@ const Ba = (
|
|
|
3243
3243
|
}
|
|
3244
3244
|
|
|
3245
3245
|
`
|
|
3246
|
-
),
|
|
3246
|
+
), Xa = (
|
|
3247
3247
|
/* glsl */
|
|
3248
3248
|
`
|
|
3249
3249
|
|
|
@@ -4481,9 +4481,9 @@ class al extends Gs {
|
|
|
4481
4481
|
cameraWorldMatrix: { value: new $() },
|
|
4482
4482
|
invProjectionMatrix: { value: new $() },
|
|
4483
4483
|
// scene uniforms
|
|
4484
|
-
bvh: { value: new
|
|
4484
|
+
bvh: { value: new Do() },
|
|
4485
4485
|
attributesArray: { value: new ma() },
|
|
4486
|
-
materialIndexAttribute: { value: new
|
|
4486
|
+
materialIndexAttribute: { value: new Lo() },
|
|
4487
4487
|
materials: { value: new wa() },
|
|
4488
4488
|
textures: { value: new wr().texture },
|
|
4489
4489
|
// light uniforms
|
|
@@ -4538,9 +4538,9 @@ class al extends Gs {
|
|
|
4538
4538
|
#include <common>
|
|
4539
4539
|
|
|
4540
4540
|
// bvh intersection
|
|
4541
|
-
${
|
|
4542
|
-
${
|
|
4543
|
-
${
|
|
4541
|
+
${Xi.common_functions}
|
|
4542
|
+
${Xi.bvh_struct_definitions}
|
|
4543
|
+
${Xi.bvh_ray_functions}
|
|
4544
4544
|
|
|
4545
4545
|
// uniform structs
|
|
4546
4546
|
${Ba}
|
|
@@ -4648,10 +4648,10 @@ class al extends Gs {
|
|
|
4648
4648
|
${Va}
|
|
4649
4649
|
|
|
4650
4650
|
${el}
|
|
4651
|
-
${
|
|
4651
|
+
${Xa}
|
|
4652
4652
|
${$a}
|
|
4653
4653
|
${Ja}
|
|
4654
|
-
${
|
|
4654
|
+
${Za}
|
|
4655
4655
|
${Ka}
|
|
4656
4656
|
|
|
4657
4657
|
float applyFilteredGlossy( float roughness, float accumulatedRoughness ) {
|
|
@@ -5003,12 +5003,12 @@ function* ll() {
|
|
|
5003
5003
|
c ? (r.opacity = this._opacityFactor / (this.samples + 1), h.blending = ii, h.opacity = 1) : (h.opacity = this._opacityFactor / (this.samples + 1), h.blending = cn);
|
|
5004
5004
|
const [m, _, p, g] = n, v = i.width, y = i.height;
|
|
5005
5005
|
h.resolution.set(v * p, y * g), h.sobolTexture = a.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, S = Math.ceil(v * p), R = Math.ceil(y * g), C = Math.floor(m * v),
|
|
5006
|
+
const x = this.tiles.x || 1, w = this.tiles.y || 1, T = x * w, S = Math.ceil(v * p), R = Math.ceil(y * g), C = Math.floor(m * v), L = Math.floor(_ * y), I = Math.ceil(S / x), A = Math.ceil(R / w);
|
|
5007
5007
|
for (let M = 0; M < w; M++)
|
|
5008
|
-
for (let
|
|
5008
|
+
for (let D = 0; D < x; D++) {
|
|
5009
5009
|
const P = o.getRenderTarget(), F = o.autoClear, k = o.getScissorTest();
|
|
5010
5010
|
o.getScissor(f), o.getViewport(d);
|
|
5011
|
-
let H =
|
|
5011
|
+
let H = D, G = M;
|
|
5012
5012
|
if (!this.stableTiles) {
|
|
5013
5013
|
const Y = this._currentTile % (x * w);
|
|
5014
5014
|
H = Y % x, G = ~~(Y / x), this._currentTile = Y + 1;
|
|
@@ -5016,15 +5016,15 @@ function* ll() {
|
|
|
5016
5016
|
const N = w - G - 1;
|
|
5017
5017
|
i.scissor.set(
|
|
5018
5018
|
C + H * I,
|
|
5019
|
-
|
|
5019
|
+
L + N * A,
|
|
5020
5020
|
Math.min(I, S - H * I),
|
|
5021
5021
|
Math.min(A, R - N * A)
|
|
5022
5022
|
), i.viewport.set(
|
|
5023
5023
|
C,
|
|
5024
|
-
|
|
5024
|
+
L,
|
|
5025
5025
|
S,
|
|
5026
5026
|
R
|
|
5027
|
-
), o.setRenderTarget(i), o.setScissorTest(!0), o.autoClear = !1, e.render(o), o.setViewport(d), o.setScissor(f), o.setScissorTest(k), o.setRenderTarget(P), o.autoClear = F, c && (r.target1 = l.texture, r.target2 = i.texture, o.setRenderTarget(u), t.render(o), o.setRenderTarget(P)), this.samples += 1 / T,
|
|
5027
|
+
), o.setRenderTarget(i), o.setScissorTest(!0), o.autoClear = !1, e.render(o), o.setViewport(d), o.setScissor(f), o.setScissorTest(k), o.setRenderTarget(P), o.autoClear = F, c && (r.target1 = l.texture, r.target2 = i.texture, o.setRenderTarget(u), t.render(o), o.setRenderTarget(P)), this.samples += 1 / T, D === x - 1 && M === w - 1 && (this.samples = Math.round(this.samples)), yield;
|
|
5028
5028
|
}
|
|
5029
5029
|
[l, u] = [u, l];
|
|
5030
5030
|
}
|
|
@@ -5050,7 +5050,7 @@ class Sr {
|
|
|
5050
5050
|
return !!this._compilePromise;
|
|
5051
5051
|
}
|
|
5052
5052
|
constructor(e) {
|
|
5053
|
-
this.camera = null, this.tiles = new U(3, 3), this.stableNoise = !1, this.stableTiles = !0, this.samples = 0, this._subframe = new $e(0, 0, 1, 1), this._opacityFactor = 1, this._renderer = e, this._alpha = !1, this._fsQuad = new
|
|
5053
|
+
this.camera = null, this.tiles = new U(3, 3), this.stableNoise = !1, this.stableTiles = !0, this.samples = 0, this._subframe = new $e(0, 0, 1, 1), this._opacityFactor = 1, this._renderer = e, this._alpha = !1, this._fsQuad = new Lt(new al()), this._blendQuad = new Lt(new Xo()), this._task = null, this._currentTile = 0, this._compilePromise = null, this._sobolTarget = new ta().generate(e), this._primaryTarget = new ke(1, 1, {
|
|
5054
5054
|
format: re,
|
|
5055
5055
|
type: de,
|
|
5056
5056
|
magFilter: se,
|
|
@@ -5276,7 +5276,7 @@ class fl extends Ft {
|
|
|
5276
5276
|
}
|
|
5277
5277
|
class Ir {
|
|
5278
5278
|
constructor(e) {
|
|
5279
|
-
this._renderer = e, this._quad = new
|
|
5279
|
+
this._renderer = e, this._quad = new Lt(new fl());
|
|
5280
5280
|
}
|
|
5281
5281
|
generate(e, t = null, i = null) {
|
|
5282
5282
|
if (!e.isCubeTexture)
|
|
@@ -5295,7 +5295,7 @@ class Ir {
|
|
|
5295
5295
|
for (let g = 0, v = _.length; g < v; g++)
|
|
5296
5296
|
m[g] = Fe.toHalfFloat(_[g]);
|
|
5297
5297
|
const p = new Be(m, t, i, re, Te);
|
|
5298
|
-
return p.minFilter =
|
|
5298
|
+
return p.minFilter = Zn, p.magFilter = Ae, p.wrapS = Je, p.wrapT = Je, p.mapping = Bi, p.needsUpdate = !0, p;
|
|
5299
5299
|
}
|
|
5300
5300
|
dispose() {
|
|
5301
5301
|
this._quad.dispose();
|
|
@@ -5349,7 +5349,7 @@ class pl {
|
|
|
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 Zo(), this._pathTracer = new Sr(e), this._queueReset = !1, this._clock = new Gi(), this._compilePromise = null, this._lowResPathTracer = new Sr(e), this._lowResPathTracer.tiles.set(1, 1), this._quad = new Lt(new ul({
|
|
5353
5353
|
map: null,
|
|
5354
5354
|
transparent: !0,
|
|
5355
5355
|
blending: ii,
|
|
@@ -5450,7 +5450,7 @@ class pl {
|
|
|
5450
5450
|
}
|
|
5451
5451
|
(!this.dynamicLowRes && this.rasterizeScene || this.dynamicLowRes && this.isCompiling) && this.rasterizeSceneCallback(this.scene, this.camera);
|
|
5452
5452
|
}
|
|
5453
|
-
this.enablePathTracing && a.material.opacity > 0 && (a.material.opacity < 1 && (a.material.blending = this.dynamicLowRes ?
|
|
5453
|
+
this.enablePathTracing && a.material.opacity > 0 && (a.material.opacity < 1 && (a.material.blending = this.dynamicLowRes ? Xn : cn), a.material.map = t.target.texture, this.renderToCanvasCallback(t.target, h, a), a.material.blending = ii);
|
|
5454
5454
|
}
|
|
5455
5455
|
}
|
|
5456
5456
|
reset() {
|
|
@@ -5581,8 +5581,8 @@ function Tl(o = !0) {
|
|
|
5581
5581
|
if (o) {
|
|
5582
5582
|
if (zt)
|
|
5583
5583
|
return;
|
|
5584
|
-
const e = zt =
|
|
5585
|
-
|
|
5584
|
+
const e = zt = X.prototype.raycast;
|
|
5585
|
+
X.prototype.raycast = function(t, i) {
|
|
5586
5586
|
const s = this, a = ai(s);
|
|
5587
5587
|
let n;
|
|
5588
5588
|
a && s.isMesh && (n = s.geometry, s.geometry = a), e.call(this, t, i), n && (s.geometry = n);
|
|
@@ -5590,7 +5590,7 @@ function Tl(o = !0) {
|
|
|
5590
5590
|
} else {
|
|
5591
5591
|
if (!zt)
|
|
5592
5592
|
return;
|
|
5593
|
-
|
|
5593
|
+
X.prototype.raycast = zt, zt = null;
|
|
5594
5594
|
}
|
|
5595
5595
|
}
|
|
5596
5596
|
let zt = null;
|
|
@@ -5771,7 +5771,7 @@ function ss(o) {
|
|
|
5771
5771
|
"isBufferAttribute" in o && o.isBufferAttribute && (e = new ue(o.array, o.itemSize, o.normalized), e.usage = o.usage, e.gpuType = o.gpuType, e.updateRanges = o.updateRanges);
|
|
5772
5772
|
return e;
|
|
5773
5773
|
}
|
|
5774
|
-
const
|
|
5774
|
+
const Dl = ct("gltf-progressive-worker"), Ll = ct("gltf-progressive-reduce-mipmaps"), rs = Symbol("needle-progressive-texture"), Le = "NEEDLE_progressive", O = class O {
|
|
5775
5775
|
constructor(e) {
|
|
5776
5776
|
E(this, "parser");
|
|
5777
5777
|
E(this, "url");
|
|
@@ -5780,7 +5780,7 @@ const Ll = ct("gltf-progressive-worker"), Dl = ct("gltf-progressive-reduce-mipma
|
|
|
5780
5780
|
var i, s;
|
|
5781
5781
|
if (this._isLoadingMesh)
|
|
5782
5782
|
return null;
|
|
5783
|
-
const t = (s = (i = this.parser.json.meshes[e]) == null ? void 0 : i.extensions) == null ? void 0 : s[
|
|
5783
|
+
const t = (s = (i = this.parser.json.meshes[e]) == null ? void 0 : i.extensions) == null ? void 0 : s[Le];
|
|
5784
5784
|
return t ? (this._isLoadingMesh = !0, this.parser.getDependency("mesh", e).then((a) => {
|
|
5785
5785
|
var n;
|
|
5786
5786
|
return this._isLoadingMesh = !1, a && O.registerMesh(this.url, t.guid, a, (n = t.lods) == null ? void 0 : n.length, 0, t), a;
|
|
@@ -5791,7 +5791,7 @@ const Ll = ct("gltf-progressive-worker"), Dl = ct("gltf-progressive-reduce-mipma
|
|
|
5791
5791
|
}
|
|
5792
5792
|
/** The name of the extension */
|
|
5793
5793
|
get name() {
|
|
5794
|
-
return
|
|
5794
|
+
return Le;
|
|
5795
5795
|
}
|
|
5796
5796
|
// #region PUBLIC API
|
|
5797
5797
|
static getMeshLODExtension(e) {
|
|
@@ -5897,7 +5897,7 @@ const Ll = ct("gltf-progressive-worker"), Dl = ct("gltf-progressive-reduce-mipma
|
|
|
5897
5897
|
var i;
|
|
5898
5898
|
if (!e)
|
|
5899
5899
|
return Promise.resolve(null);
|
|
5900
|
-
if (e instanceof
|
|
5900
|
+
if (e instanceof X || e.isMesh === !0) {
|
|
5901
5901
|
const s = e.geometry, a = this.getAssignedLODInformation(s);
|
|
5902
5902
|
if (!a)
|
|
5903
5903
|
return Promise.resolve(null);
|
|
@@ -5982,7 +5982,7 @@ const Ll = ct("gltf-progressive-worker"), Dl = ct("gltf-progressive-reduce-mipma
|
|
|
5982
5982
|
if (f && (f == null ? void 0 : f.level) < t)
|
|
5983
5983
|
return z === "verbose" && console.warn("Assigned texture level is already higher: ", f.level, t, i, h, a), null;
|
|
5984
5984
|
}
|
|
5985
|
-
if (
|
|
5985
|
+
if (Ll && a.mipmaps) {
|
|
5986
5986
|
const f = a.mipmaps.length;
|
|
5987
5987
|
a.mipmaps.length = Math.min(a.mipmaps.length, 3), f !== a.mipmaps.length && z && console.debug(`Reduced mipmap count from ${f} to ${a.mipmaps.length} for ${a.uuid}: ${(n = a.image) == null ? void 0 : n.width}x${(c = a.image) == null ? void 0 : c.height}.`);
|
|
5988
5988
|
}
|
|
@@ -6013,7 +6013,7 @@ const Ll = ct("gltf-progressive-worker"), Dl = ct("gltf-progressive-reduce-mipma
|
|
|
6013
6013
|
return z && console.log("AFTER", this.url, e), (t = this.parser.json.textures) == null || t.forEach((s, a) => {
|
|
6014
6014
|
var n;
|
|
6015
6015
|
if (s != null && s.extensions) {
|
|
6016
|
-
const c = s == null ? void 0 : s.extensions[
|
|
6016
|
+
const c = s == null ? void 0 : s.extensions[Le];
|
|
6017
6017
|
if (c) {
|
|
6018
6018
|
if (!c.lods) {
|
|
6019
6019
|
z && console.warn("Texture has no LODs", c);
|
|
@@ -6033,7 +6033,7 @@ const Ll = ct("gltf-progressive-worker"), Dl = ct("gltf-progressive-reduce-mipma
|
|
|
6033
6033
|
}
|
|
6034
6034
|
}), (i = this.parser.json.meshes) == null || i.forEach((s, a) => {
|
|
6035
6035
|
if (s != null && s.extensions) {
|
|
6036
|
-
const n = s == null ? void 0 : s.extensions[
|
|
6036
|
+
const n = s == null ? void 0 : s.extensions[Le];
|
|
6037
6037
|
if (n && n.lods) {
|
|
6038
6038
|
for (const c of this.parser.associations.keys())
|
|
6039
6039
|
if (c.isMesh) {
|
|
@@ -6082,18 +6082,18 @@ const Ll = ct("gltf-progressive-worker"), Dl = ct("gltf-progressive-reduce-mipma
|
|
|
6082
6082
|
if (!_.use)
|
|
6083
6083
|
return z && console.log(`LOD ${t} was aborted: ${u}`), null;
|
|
6084
6084
|
const g = n, v = new Promise(async (x, w) => {
|
|
6085
|
-
if (
|
|
6085
|
+
if (Dl) {
|
|
6086
6086
|
const A = await (await Il({})).load(u);
|
|
6087
6087
|
if (A.textures.length > 0)
|
|
6088
6088
|
for (const M of A.textures) {
|
|
6089
|
-
let
|
|
6090
|
-
return O.assignLODInformation(s.url,
|
|
6089
|
+
let D = M.texture;
|
|
6090
|
+
return O.assignLODInformation(s.url, D, a, t, void 0), e instanceof je && (D = this.copySettings(e, D)), D && (D.guid = g.guid), x(D);
|
|
6091
6091
|
}
|
|
6092
6092
|
if (A.geometries.length > 0) {
|
|
6093
6093
|
const M = new Array();
|
|
6094
|
-
for (const
|
|
6095
|
-
const P =
|
|
6096
|
-
O.assignLODInformation(s.url, P, a, t,
|
|
6094
|
+
for (const D of A.geometries) {
|
|
6095
|
+
const P = D.geometry;
|
|
6096
|
+
O.assignLODInformation(s.url, P, a, t, D.primitiveIndex), M.push(P);
|
|
6097
6097
|
}
|
|
6098
6098
|
return x(M);
|
|
6099
6099
|
}
|
|
@@ -6112,49 +6112,49 @@ const Ll = ct("gltf-progressive-worker"), Dl = ct("gltf-progressive-reduce-mipma
|
|
|
6112
6112
|
return x(null);
|
|
6113
6113
|
const C = R.parser;
|
|
6114
6114
|
i && console.log("Loading finished " + u, g.guid);
|
|
6115
|
-
let
|
|
6115
|
+
let L = 0;
|
|
6116
6116
|
if (R.parser.json.textures) {
|
|
6117
6117
|
let I = !1;
|
|
6118
6118
|
for (const A of R.parser.json.textures) {
|
|
6119
6119
|
if (A != null && A.extensions) {
|
|
6120
|
-
const M = A == null ? void 0 : A.extensions[
|
|
6120
|
+
const M = A == null ? void 0 : A.extensions[Le];
|
|
6121
6121
|
if (M != null && M.guid && M.guid === g.guid) {
|
|
6122
6122
|
I = !0;
|
|
6123
6123
|
break;
|
|
6124
6124
|
}
|
|
6125
6125
|
}
|
|
6126
|
-
|
|
6126
|
+
L++;
|
|
6127
6127
|
}
|
|
6128
6128
|
if (I) {
|
|
6129
|
-
let A = await C.getDependency("texture",
|
|
6130
|
-
return A && O.assignLODInformation(s.url, A, a, t, void 0), i && console.log('change "' + e.name + '" → "' + A.name + '"', u,
|
|
6129
|
+
let A = await C.getDependency("texture", L);
|
|
6130
|
+
return A && O.assignLODInformation(s.url, A, a, t, void 0), i && console.log('change "' + e.name + '" → "' + A.name + '"', u, L, A, m), e instanceof je && (A = this.copySettings(e, A)), A && (A.guid = g.guid), x(A);
|
|
6131
6131
|
} else
|
|
6132
6132
|
z && console.warn("Could not find texture with guid", g.guid, R.parser.json);
|
|
6133
6133
|
}
|
|
6134
|
-
if (
|
|
6134
|
+
if (L = 0, R.parser.json.meshes) {
|
|
6135
6135
|
let I = !1;
|
|
6136
6136
|
for (const A of R.parser.json.meshes) {
|
|
6137
6137
|
if (A != null && A.extensions) {
|
|
6138
|
-
const M = A == null ? void 0 : A.extensions[
|
|
6138
|
+
const M = A == null ? void 0 : A.extensions[Le];
|
|
6139
6139
|
if (M != null && M.guid && M.guid === g.guid) {
|
|
6140
6140
|
I = !0;
|
|
6141
6141
|
break;
|
|
6142
6142
|
}
|
|
6143
6143
|
}
|
|
6144
|
-
|
|
6144
|
+
L++;
|
|
6145
6145
|
}
|
|
6146
6146
|
if (I) {
|
|
6147
|
-
const A = await C.getDependency("mesh",
|
|
6148
|
-
if (i && console.log(`Loaded Mesh "${A.name}"`, u,
|
|
6147
|
+
const A = await C.getDependency("mesh", L);
|
|
6148
|
+
if (i && console.log(`Loaded Mesh "${A.name}"`, u, L, A, m), A.isMesh === !0) {
|
|
6149
6149
|
const M = A.geometry;
|
|
6150
6150
|
return O.assignLODInformation(s.url, M, a, t, 0), x(M);
|
|
6151
6151
|
} else {
|
|
6152
6152
|
const M = new Array();
|
|
6153
|
-
for (let
|
|
6154
|
-
const P = A.children[
|
|
6153
|
+
for (let D = 0; D < A.children.length; D++) {
|
|
6154
|
+
const P = A.children[D];
|
|
6155
6155
|
if (P.isMesh === !0) {
|
|
6156
6156
|
const F = P.geometry;
|
|
6157
|
-
O.assignLODInformation(s.url, F, a, t,
|
|
6157
|
+
O.assignLODInformation(s.url, F, a, t, D), M.push(F);
|
|
6158
6158
|
}
|
|
6159
6159
|
}
|
|
6160
6160
|
return x(M);
|
|
@@ -6318,7 +6318,7 @@ E(Pi, "addPromise", (e, t, i, s) => {
|
|
|
6318
6318
|
});
|
|
6319
6319
|
});
|
|
6320
6320
|
const we = ct("debugprogressive"), El = ct("noprogressive"), ns = Symbol("Needle:LODSManager"), os = Symbol("Needle:LODState"), Ge = Symbol("Needle:CurrentLOD"), ae = { mesh_lod: -1, texture_lod: -1 };
|
|
6321
|
-
var he, Pe, Wi, Ke,
|
|
6321
|
+
var he, Pe, Wi, Ke, Dt, Vi, Ee;
|
|
6322
6322
|
const q = class q {
|
|
6323
6323
|
// readonly plugins: NEEDLE_progressive_plugin[] = [];
|
|
6324
6324
|
constructor(e, t) {
|
|
@@ -6364,7 +6364,7 @@ const q = class q {
|
|
|
6364
6364
|
Ne(this, Pe, void 0);
|
|
6365
6365
|
Ne(this, Wi, new Gi());
|
|
6366
6366
|
Ne(this, Ke, 0);
|
|
6367
|
-
Ne(this,
|
|
6367
|
+
Ne(this, Dt, 0);
|
|
6368
6368
|
Ne(this, Vi, 0);
|
|
6369
6369
|
Ne(this, Ee, 0);
|
|
6370
6370
|
E(this, "_fpsBuffer", [60, 60, 60, 60, 60]);
|
|
@@ -6448,7 +6448,7 @@ const q = class q {
|
|
|
6448
6448
|
const t = this;
|
|
6449
6449
|
_n(this.renderer), this.renderer.render = function(i, s) {
|
|
6450
6450
|
const a = t.renderer.getRenderTarget();
|
|
6451
|
-
(a == null || "isXRRenderTarget" in a && a.isXRRenderTarget) && (e = 0, Me(t, Ke, V(t, Ke) + 1), Me(t,
|
|
6451
|
+
(a == null || "isXRRenderTarget" in a && a.isXRRenderTarget) && (e = 0, Me(t, Ke, V(t, Ke) + 1), Me(t, Dt, V(t, Wi).getDelta()), Me(t, Vi, V(t, Vi) + V(t, Dt)), t._fpsBuffer.shift(), t._fpsBuffer.push(1 / V(t, Dt)), Me(t, Ee, t._fpsBuffer.reduce((c, h) => c + h) / t._fpsBuffer.length), we && V(t, Ke) % 200 === 0 && console.log("FPS", Math.round(V(t, Ee)), "Interval:", V(t, he)));
|
|
6452
6452
|
const n = e++;
|
|
6453
6453
|
V(t, Pe).call(this, i, s), t.onAfterRender(i, s, n);
|
|
6454
6454
|
};
|
|
@@ -6498,21 +6498,21 @@ const q = class q {
|
|
|
6498
6498
|
}
|
|
6499
6499
|
if (we === "color" && d.material && !d.object.progressive_debug_color) {
|
|
6500
6500
|
d.object.progressive_debug_color = !0;
|
|
6501
|
-
const l = Math.random() * 16777215, u = new
|
|
6501
|
+
const l = Math.random() * 16777215, u = new Li({ color: l });
|
|
6502
6502
|
d.object.material = u;
|
|
6503
6503
|
}
|
|
6504
6504
|
const r = d.object;
|
|
6505
|
-
(r instanceof
|
|
6505
|
+
(r instanceof X || r.isMesh) && this.updateLODs(e, t, r, a);
|
|
6506
6506
|
}
|
|
6507
6507
|
const n = i.transparent;
|
|
6508
6508
|
for (const d of n) {
|
|
6509
6509
|
const r = d.object;
|
|
6510
|
-
(r instanceof
|
|
6510
|
+
(r instanceof X || r.isMesh) && this.updateLODs(e, t, r, a);
|
|
6511
6511
|
}
|
|
6512
6512
|
const c = i.transmissive;
|
|
6513
6513
|
for (const d of c) {
|
|
6514
6514
|
const r = d.object;
|
|
6515
|
-
(r instanceof
|
|
6515
|
+
(r instanceof X || r.isMesh) && this.updateLODs(e, t, r, a);
|
|
6516
6516
|
}
|
|
6517
6517
|
}
|
|
6518
6518
|
/** Update the LOD levels for the renderer. */
|
|
@@ -6628,11 +6628,11 @@ const q = class q {
|
|
|
6628
6628
|
return;
|
|
6629
6629
|
}
|
|
6630
6630
|
if (this._tempBox.applyMatrix4(this.projectionScreenMatrix), this.renderer.xr.enabled && x.isPerspectiveCamera && x.fov > 70) {
|
|
6631
|
-
const M = this._tempBox.min,
|
|
6632
|
-
let P = M.x, F = M.y, k =
|
|
6633
|
-
const G = 2, N = 1.5, Y = (M.x +
|
|
6631
|
+
const M = this._tempBox.min, D = this._tempBox.max;
|
|
6632
|
+
let P = M.x, F = M.y, k = D.x, H = D.y;
|
|
6633
|
+
const G = 2, N = 1.5, Y = (M.x + D.x) * 0.5, W = (M.y + D.y) * 0.5;
|
|
6634
6634
|
P = (P - Y) * G + Y, F = (F - W) * G + W, k = (k - Y) * G + Y, H = (H - W) * G + W;
|
|
6635
|
-
const K = P < 0 && k > 0 ? 0 : Math.min(Math.abs(M.x), Math.abs(
|
|
6635
|
+
const K = P < 0 && k > 0 ? 0 : Math.min(Math.abs(M.x), Math.abs(D.x)), pe = F < 0 && H > 0 ? 0 : Math.min(Math.abs(M.y), Math.abs(D.y)), ce = Math.max(K, pe);
|
|
6636
6636
|
i.lastCentrality = (N - ce) * (N - ce) * (N - ce);
|
|
6637
6637
|
} else
|
|
6638
6638
|
i.lastCentrality = 1;
|
|
@@ -6644,16 +6644,16 @@ const q = class q {
|
|
|
6644
6644
|
if (Math.max(w.x, w.y) != 0 && C != 0 && (w.z = R.z / Math.max(R.x, R.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, we && q.debugDrawLine) {
|
|
6645
6645
|
const M = this.tempMatrix.copy(this.projectionScreenMatrix);
|
|
6646
6646
|
M.invert();
|
|
6647
|
-
const
|
|
6648
|
-
|
|
6649
|
-
const H = (
|
|
6650
|
-
|
|
6647
|
+
const D = q.corner0, P = q.corner1, F = q.corner2, k = q.corner3;
|
|
6648
|
+
D.copy(this._tempBox.min), P.copy(this._tempBox.max), P.x = D.x, F.copy(this._tempBox.max), F.y = D.y, k.copy(this._tempBox.max);
|
|
6649
|
+
const H = (D.z + k.z) * 0.5;
|
|
6650
|
+
D.z = P.z = F.z = k.z = H, D.applyMatrix4(M), P.applyMatrix4(M), F.applyMatrix4(M), k.applyMatrix4(M), q.debugDrawLine(D, P, 255), q.debugDrawLine(D, F, 255), q.debugDrawLine(P, k, 255), q.debugDrawLine(F, k, 255);
|
|
6651
6651
|
}
|
|
6652
6652
|
let I = 999;
|
|
6653
6653
|
if (f && i.lastScreenCoverage > 0)
|
|
6654
6654
|
for (let M = 0; M < f.length; M++) {
|
|
6655
|
-
const
|
|
6656
|
-
if (d > 0 && Rr() && !
|
|
6655
|
+
const D = f[M], F = (((g = D.densities) == null ? void 0 : g[d]) || D.density || 1e-5) / i.lastScreenCoverage;
|
|
6656
|
+
if (d > 0 && Rr() && !D.densities && !globalThis["NEEDLE:MISSING_LOD_PRIMITIVE_DENSITIES"] && (window["NEEDLE:MISSING_LOD_PRIMITIVE_DENSITIES"] = !0, console.warn("[Needle Progressive] Detected usage of mesh without primitive densities. This might cause incorrect LOD level selection: Consider re-optimizing your model by updating your Needle Integration, Needle glTF Pipeline or running optimization again on Needle Cloud.")), F < s) {
|
|
6657
6657
|
I = M;
|
|
6658
6658
|
break;
|
|
6659
6659
|
}
|
|
@@ -6677,10 +6677,10 @@ const q = class q {
|
|
|
6677
6677
|
((y = this.context) == null ? void 0 : y.engine) === "model-viewer" && (T *= 1.5);
|
|
6678
6678
|
const R = m / window.devicePixelRatio * T;
|
|
6679
6679
|
let C = !1;
|
|
6680
|
-
for (let
|
|
6681
|
-
const I = l.lods[
|
|
6682
|
-
if (!(x && I.max_height >= 2048) && !(An() && I.max_height > 4096) && (I.max_height > R || !C &&
|
|
6683
|
-
if (C = !0, a.texture_lod =
|
|
6680
|
+
for (let L = l.lods.length - 1; L >= 0; L--) {
|
|
6681
|
+
const I = l.lods[L];
|
|
6682
|
+
if (!(x && I.max_height >= 2048) && !(An() && I.max_height > 4096) && (I.max_height > R || !C && L === 0)) {
|
|
6683
|
+
if (C = !0, a.texture_lod = L, we && a.texture_lod < i.lastLodLevel_Texture) {
|
|
6684
6684
|
const A = I.max_height;
|
|
6685
6685
|
console.log(`Texture LOD changed: ${i.lastLodLevel_Texture} → ${a.texture_lod} = ${A}px
|
|
6686
6686
|
Screensize: ${R.toFixed(0)}px, Coverage: ${(100 * i.lastScreenCoverage).toFixed(2)}%, Volume ${w.toFixed(1)}
|
|
@@ -6694,7 +6694,7 @@ ${t.name}`);
|
|
|
6694
6694
|
a.texture_lod = 0;
|
|
6695
6695
|
}
|
|
6696
6696
|
};
|
|
6697
|
-
he = new WeakMap(), Pe = new WeakMap(), Wi = new WeakMap(), Ke = new WeakMap(),
|
|
6697
|
+
he = new WeakMap(), Pe = new WeakMap(), Wi = new WeakMap(), Ke = new WeakMap(), Dt = new WeakMap(), Vi = new WeakMap(), Ee = new WeakMap(), /**
|
|
6698
6698
|
* Assign a function to draw debug lines for the LODs. This function will be called with the start and end position of the line and the color of the line when the `debugprogressive` query parameter is set.
|
|
6699
6699
|
*/
|
|
6700
6700
|
E(q, "debugDrawLine"), E(q, "corner0", new b()), E(q, "corner1", new b()), E(q, "corner2", new b()), E(q, "corner3", new b()), E(q, "_tempPtInside", new b()), E(q, "skinnedMeshBoundsFrameOffsetCounter", 0), E(q, "$skinnedMeshBoundsOffset", Symbol("gltf-progressive-skinnedMeshBoundsOffset"));
|
|
@@ -6709,13 +6709,13 @@ class Fl {
|
|
|
6709
6709
|
E(this, "lastCentrality", 0);
|
|
6710
6710
|
}
|
|
6711
6711
|
}
|
|
6712
|
-
const
|
|
6712
|
+
const Dr = Symbol("NEEDLE_mesh_lod"), gi = Symbol("NEEDLE_texture_lod");
|
|
6713
6713
|
let Ht = null;
|
|
6714
6714
|
function Sn() {
|
|
6715
6715
|
const o = kl();
|
|
6716
6716
|
o && (o.mapURLs(function(e) {
|
|
6717
|
-
return
|
|
6718
|
-
}),
|
|
6717
|
+
return Lr(), e;
|
|
6718
|
+
}), Lr(), Ht == null || Ht.disconnect(), Ht = new MutationObserver((e) => {
|
|
6719
6719
|
e.forEach((t) => {
|
|
6720
6720
|
t.addedNodes.forEach((i) => {
|
|
6721
6721
|
i instanceof HTMLElement && i.tagName.toLowerCase() === "model-viewer" && Mn(i);
|
|
@@ -6731,7 +6731,7 @@ function kl() {
|
|
|
6731
6731
|
console.debug("[gltf-progressive] model-viewer defined"), Sn();
|
|
6732
6732
|
}), null);
|
|
6733
6733
|
}
|
|
6734
|
-
function
|
|
6734
|
+
function Lr() {
|
|
6735
6735
|
if (typeof document > "u")
|
|
6736
6736
|
return;
|
|
6737
6737
|
document.querySelectorAll("model-viewer").forEach((e) => {
|
|
@@ -6818,8 +6818,8 @@ class Ol {
|
|
|
6818
6818
|
console.warn("Texture data not found for texture index " + p);
|
|
6819
6819
|
continue;
|
|
6820
6820
|
}
|
|
6821
|
-
if ((l = g == null ? void 0 : g.extensions) != null && l[
|
|
6822
|
-
const v = g.extensions[
|
|
6821
|
+
if ((l = g == null ? void 0 : g.extensions) != null && l[Le]) {
|
|
6822
|
+
const v = g.extensions[Le];
|
|
6823
6823
|
v && a && Ie.registerTexture(a, _, v.lods.length, p, v);
|
|
6824
6824
|
}
|
|
6825
6825
|
}
|
|
@@ -6835,13 +6835,13 @@ class Ol {
|
|
|
6835
6835
|
}
|
|
6836
6836
|
tryParseMeshLOD(e, t) {
|
|
6837
6837
|
var n, c;
|
|
6838
|
-
if (t[
|
|
6838
|
+
if (t[Dr] == !0)
|
|
6839
6839
|
return;
|
|
6840
|
-
t[
|
|
6840
|
+
t[Dr] = !0;
|
|
6841
6841
|
const i = this.tryGetCurrentModelViewer(e), s = this.getUrl(i);
|
|
6842
6842
|
if (!s)
|
|
6843
6843
|
return;
|
|
6844
|
-
const a = (c = (n = t.userData) == null ? void 0 : n.gltfExtensions) == null ? void 0 : c[
|
|
6844
|
+
const a = (c = (n = t.userData) == null ? void 0 : n.gltfExtensions) == null ? void 0 : c[Le];
|
|
6845
6845
|
if (a && s) {
|
|
6846
6846
|
const h = t.uuid;
|
|
6847
6847
|
Ie.registerMesh(s, h, t, 0, a.lods.length, a);
|
|
@@ -7278,7 +7278,7 @@ var It = 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
|
}, o;
|
|
7280
7280
|
}()
|
|
7281
|
-
), zl = "23.1.3", Ul = Qs.nextId, Re = Rs, Hl = Re.getAll.bind(Re), Wl = Re.removeAll.bind(Re), Vl = Re.add.bind(Re), Nl = Re.remove.bind(Re), Gl = Re.update.bind(Re),
|
|
7281
|
+
), zl = "23.1.3", Ul = Qs.nextId, Re = Rs, Hl = Re.getAll.bind(Re), Wl = Re.removeAll.bind(Re), Vl = Re.add.bind(Re), Nl = Re.remove.bind(Re), Gl = Re.update.bind(Re), Ze = {
|
|
7282
7282
|
Easing: It,
|
|
7283
7283
|
Group: In,
|
|
7284
7284
|
Interpolation: lt,
|
|
@@ -7489,7 +7489,7 @@ function Tu(o, e = 43) {
|
|
|
7489
7489
|
const t = o * Math.PI / 180;
|
|
7490
7490
|
return e / (2 * Math.tan(t / 2));
|
|
7491
7491
|
}
|
|
7492
|
-
var
|
|
7492
|
+
var Dn = {};
|
|
7493
7493
|
/*!
|
|
7494
7494
|
* howler.js v2.2.4
|
|
7495
7495
|
* howlerjs.com
|
|
@@ -7832,20 +7832,20 @@ var Ln = {};
|
|
|
7832
7832
|
}
|
|
7833
7833
|
var C = g._node;
|
|
7834
7834
|
if (u._webAudio) {
|
|
7835
|
-
var
|
|
7835
|
+
var L = function() {
|
|
7836
7836
|
u._playLock = !1, R(), u._refreshBuffer(g);
|
|
7837
|
-
var
|
|
7838
|
-
C.gain.setValueAtTime(
|
|
7837
|
+
var D = g._muted || u._muted ? 0 : g._volume;
|
|
7838
|
+
C.gain.setValueAtTime(D, 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 && (u._endTimers[g._id] = setTimeout(u._ended.bind(u, g), w)), l || setTimeout(function() {
|
|
7839
7839
|
u._emit("play", g._id), u._loadQueue();
|
|
7840
7840
|
}, 0);
|
|
7841
7841
|
};
|
|
7842
|
-
t.state === "running" && t.ctx.state !== "interrupted" ?
|
|
7842
|
+
t.state === "running" && t.ctx.state !== "interrupted" ? L() : (u._playLock = !0, u.once("resume", L), u._clearTimer(g._id));
|
|
7843
7843
|
} else {
|
|
7844
7844
|
var I = function() {
|
|
7845
7845
|
C.currentTime = y, C.muted = g._muted || u._muted || t._muted || C.muted, C.volume = g._volume * t.volume(), C.playbackRate = g._rate;
|
|
7846
7846
|
try {
|
|
7847
|
-
var
|
|
7848
|
-
if (
|
|
7847
|
+
var D = C.play();
|
|
7848
|
+
if (D && typeof Promise < "u" && (D instanceof Promise || typeof D.then == "function") ? (u._playLock = !0, R(), D.then(function() {
|
|
7849
7849
|
u._playLock = !1, C._unlocked = !0, l ? u._loadQueue() : u._emit("play", g._id);
|
|
7850
7850
|
}).catch(function() {
|
|
7851
7851
|
u._playLock = !1, u._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;
|
|
@@ -8693,11 +8693,11 @@ var Ln = {};
|
|
|
8693
8693
|
i = i || "spatial", i === "spatial" ? (t._panner = Howler.ctx.createPanner(), t._panner.coneInnerAngle = t._pannerAttr.coneInnerAngle, t._panner.coneOuterAngle = t._pannerAttr.coneOuterAngle, t._panner.coneOuterGain = t._pannerAttr.coneOuterGain, t._panner.distanceModel = t._pannerAttr.distanceModel, t._panner.maxDistance = t._pannerAttr.maxDistance, t._panner.refDistance = t._pannerAttr.refDistance, t._panner.rolloffFactor = t._pannerAttr.rolloffFactor, t._panner.panningModel = t._pannerAttr.panningModel, typeof t._panner.positionX < "u" ? (t._panner.positionX.setValueAtTime(t._pos[0], Howler.ctx.currentTime), t._panner.positionY.setValueAtTime(t._pos[1], Howler.ctx.currentTime), t._panner.positionZ.setValueAtTime(t._pos[2], Howler.ctx.currentTime)) : t._panner.setPosition(t._pos[0], t._pos[1], t._pos[2]), typeof t._panner.orientationX < "u" ? (t._panner.orientationX.setValueAtTime(t._orientation[0], Howler.ctx.currentTime), t._panner.orientationY.setValueAtTime(t._orientation[1], Howler.ctx.currentTime), t._panner.orientationZ.setValueAtTime(t._orientation[2], Howler.ctx.currentTime)) : t._panner.setOrientation(t._orientation[0], t._orientation[1], t._orientation[2])) : (t._panner = Howler.ctx.createStereoPanner(), t._panner.pan.setValueAtTime(t._stereo, Howler.ctx.currentTime)), t._panner.connect(t._node), t._paused || t._parent.pause(t._id, !0).play(t._id, !0);
|
|
8694
8694
|
};
|
|
8695
8695
|
})();
|
|
8696
|
-
})(
|
|
8696
|
+
})(Dn);
|
|
8697
8697
|
const Kl = "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
|
|
8698
|
+
let Zl = class {
|
|
8699
8699
|
constructor() {
|
|
8700
|
-
this.sound = new
|
|
8700
|
+
this.sound = new Dn.Howl({
|
|
8701
8701
|
src: [Kl]
|
|
8702
8702
|
});
|
|
8703
8703
|
}
|
|
@@ -8705,7 +8705,7 @@ let Xl = class {
|
|
|
8705
8705
|
this.sound.play();
|
|
8706
8706
|
}
|
|
8707
8707
|
};
|
|
8708
|
-
function
|
|
8708
|
+
function Xl(o, e, t = new Q()) {
|
|
8709
8709
|
if (t.makeEmpty(), !o || !e)
|
|
8710
8710
|
return t;
|
|
8711
8711
|
o.updateWorldMatrix(!0, !0), e.updateWorldMatrix(!0, !0);
|
|
@@ -8728,7 +8728,7 @@ function Zl(o, e, t = new Q()) {
|
|
|
8728
8728
|
}), (!n || t.isEmpty()) && (t.min.set(0, 0, 0), t.max.set(0, 0, 0)), t;
|
|
8729
8729
|
}
|
|
8730
8730
|
function Jl(o, e, t = new b()) {
|
|
8731
|
-
return
|
|
8731
|
+
return Xl(o, e).getSize(t);
|
|
8732
8732
|
}
|
|
8733
8733
|
const He = (o) => {
|
|
8734
8734
|
var e, t;
|
|
@@ -8738,7 +8738,7 @@ const He = (o) => {
|
|
|
8738
8738
|
}
|
|
8739
8739
|
for (; o.children.length > 0; )
|
|
8740
8740
|
He(o.children[0]), (e = o.children[0]) == null || e.removeFromParent();
|
|
8741
|
-
if (o instanceof
|
|
8741
|
+
if (o instanceof X)
|
|
8742
8742
|
try {
|
|
8743
8743
|
(t = o.geometry) == null || t.dispose();
|
|
8744
8744
|
} catch {
|
|
@@ -8754,7 +8754,7 @@ function ec() {
|
|
|
8754
8754
|
function tc(o) {
|
|
8755
8755
|
let e = !1, t = !1, i = !1, s = 1 / 0, a = 1 / 0, n = 1 / 0, c = -1 / 0, h = -1 / 0, f = -1 / 0, d = 0, r = 0;
|
|
8756
8756
|
return o.traverse((u) => {
|
|
8757
|
-
var R, C,
|
|
8757
|
+
var R, C, L;
|
|
8758
8758
|
const m = u;
|
|
8759
8759
|
if (!(m != null && m.isMesh) || !m.geometry || m.userData.ignoreSize)
|
|
8760
8760
|
return;
|
|
@@ -8766,19 +8766,19 @@ function tc(o) {
|
|
|
8766
8766
|
return;
|
|
8767
8767
|
const v = m.morphTargetDictionary;
|
|
8768
8768
|
v && (v.width !== void 0 && (t = !0), v.length !== void 0 && (e = !0), v.height !== void 0 && (i = !0));
|
|
8769
|
-
const y = (
|
|
8769
|
+
const y = (L = p == null ? void 0 : p.morphAttributes) == null ? void 0 : L.position, x = m.morphTargetInfluences, w = [];
|
|
8770
8770
|
if (y && x && y.length > 0) {
|
|
8771
8771
|
const I = Math.min(y.length, x.length);
|
|
8772
8772
|
for (let A = 0; A < I; A++) {
|
|
8773
8773
|
const M = x[A] || 0;
|
|
8774
8774
|
if (M === 0)
|
|
8775
8775
|
continue;
|
|
8776
|
-
const
|
|
8776
|
+
const D = y[A];
|
|
8777
8777
|
w.push({
|
|
8778
|
-
attr:
|
|
8778
|
+
attr: D,
|
|
8779
8779
|
weight: M,
|
|
8780
|
-
array:
|
|
8781
|
-
itemSize:
|
|
8780
|
+
array: D.array,
|
|
8781
|
+
itemSize: D.itemSize ?? 3
|
|
8782
8782
|
});
|
|
8783
8783
|
}
|
|
8784
8784
|
}
|
|
@@ -8786,8 +8786,8 @@ function tc(o) {
|
|
|
8786
8786
|
if (T && S >= 3) {
|
|
8787
8787
|
const I = g.count, A = w.length > 0;
|
|
8788
8788
|
for (let M = 0; M < I; M++) {
|
|
8789
|
-
const
|
|
8790
|
-
let P = T[
|
|
8789
|
+
const D = M * S;
|
|
8790
|
+
let P = T[D], F = T[D + 1], k = T[D + 2];
|
|
8791
8791
|
if (A)
|
|
8792
8792
|
for (let G = 0; G < w.length; G++) {
|
|
8793
8793
|
const N = w[G], Y = N.weight;
|
|
@@ -8804,13 +8804,13 @@ function tc(o) {
|
|
|
8804
8804
|
return;
|
|
8805
8805
|
}
|
|
8806
8806
|
for (let I = 0; I < g.count; I++) {
|
|
8807
|
-
let A = g.getX(I), M = g.getY(I),
|
|
8807
|
+
let A = g.getX(I), M = g.getY(I), D = g.getZ(I);
|
|
8808
8808
|
if (w.length > 0)
|
|
8809
8809
|
for (let F = 0; F < w.length; F++) {
|
|
8810
8810
|
const k = w[F], H = k.weight;
|
|
8811
|
-
A += k.attr.getX(I) * H, M += k.attr.getY(I) * H,
|
|
8811
|
+
A += k.attr.getX(I) * H, M += k.attr.getY(I) * H, D += k.attr.getZ(I) * H;
|
|
8812
8812
|
}
|
|
8813
|
-
A < s && (s = A), M < a && (a = M),
|
|
8813
|
+
A < s && (s = A), M < a && (a = M), D < n && (n = D), A > c && (c = A), M > h && (h = M), D > f && (f = D), M > r && (r = M);
|
|
8814
8814
|
const P = A * A + M * M;
|
|
8815
8815
|
P > d && (d = P);
|
|
8816
8816
|
}
|
|
@@ -8966,7 +8966,7 @@ function Vt(o) {
|
|
|
8966
8966
|
function zr(...o) {
|
|
8967
8967
|
return o.filter(Boolean).join(" ");
|
|
8968
8968
|
}
|
|
8969
|
-
class
|
|
8969
|
+
class Ln extends HTMLElement {
|
|
8970
8970
|
constructor(e) {
|
|
8971
8971
|
super(), this._size = 12, this._showDialog = !1, this._selected = !1, this._focused = !1, this._toBeInstalled = !1, this._toBeReplaced = !1, this._hasError = !1, this._canInstall = !1, this._hide = !1, this._disable = !1, this._filled = !1, this._allFunctions = [], this._functions = [], this._deviceName = "", this._deviceLogo = "", this._renderQueued = !1, this._needsRender = !0, this.attachShadow({ mode: "open" }), this._props = { ...Or, ...e ?? {} }, this.handleShadowClick = this.handleShadowClick.bind(this), this.shadowRoot.addEventListener("click", this.handleShadowClick), this.render();
|
|
8972
8972
|
}
|
|
@@ -9191,7 +9191,7 @@ class Dn extends HTMLElement {
|
|
|
9191
9191
|
}
|
|
9192
9192
|
}
|
|
9193
9193
|
}
|
|
9194
|
-
customElements.get("slot-item") || customElements.define("slot-item",
|
|
9194
|
+
customElements.get("slot-item") || customElements.define("slot-item", Ln);
|
|
9195
9195
|
const ie = {
|
|
9196
9196
|
ON_DROP: "slot-on-drop",
|
|
9197
9197
|
ON_DEVICE_DELETED: "slot-on-device-deleted",
|
|
@@ -9210,7 +9210,7 @@ class Ur extends ze {
|
|
|
9210
9210
|
const t = document.createElement("div");
|
|
9211
9211
|
super(t), this.props = e, this._emitter = new kt(), this._slotContainer = new me(), 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 me(), this._showSlot = !0, this._isMirror = !1, this.beforeInstall = void 0, this._preventDefaults = (i) => {
|
|
9212
9212
|
i.preventDefault(), i.stopPropagation();
|
|
9213
|
-
}, 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
|
|
9213
|
+
}, 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 Ln({
|
|
9214
9214
|
name: e.name,
|
|
9215
9215
|
isMobile: e.isMobile,
|
|
9216
9216
|
onRemove: () => {
|
|
@@ -9523,7 +9523,7 @@ class Ei extends me {
|
|
|
9523
9523
|
class Pn extends oi {
|
|
9524
9524
|
// 上一次的角度
|
|
9525
9525
|
constructor(e, t) {
|
|
9526
|
-
super(), this.radius = e, this._text = new uc(""), this._line = new Ei(void 0, !1, !1), this._box = new
|
|
9526
|
+
super(), this.radius = e, this._text = new uc(""), this._line = new Ei(void 0, !1, !1), this._box = new X(), this._arc = new To(), this._previousPosition = null, this._updateTimer = null, this._updateDelay = 300, this._accumulatedAngle = 0, this._lastAngle = null, this._line.updateMaterial(new As({
|
|
9527
9527
|
color: "#555",
|
|
9528
9528
|
dashSize: 0.06,
|
|
9529
9529
|
gapSize: 0.06
|
|
@@ -9839,7 +9839,7 @@ class gc extends oi {
|
|
|
9839
9839
|
w.y -= m / 6, this._line13.update(x, w, this._radius);
|
|
9840
9840
|
}
|
|
9841
9841
|
}
|
|
9842
|
-
class Ce extends
|
|
9842
|
+
class Ce extends X {
|
|
9843
9843
|
constructor(e = 0.6, t = 0.4, i = 0.2) {
|
|
9844
9844
|
super(), this.isGoods = !0, this._lineMaterial = new As({
|
|
9845
9845
|
color: new J("#000"),
|
|
@@ -10023,10 +10023,10 @@ class _c extends oi {
|
|
|
10023
10023
|
this._animationClock.getDelta();
|
|
10024
10024
|
}, this._app.renderer.domElement.addEventListener("ticker", this._onTicker), this.addEventListener("shape-key-changed", (t, i) => {
|
|
10025
10025
|
if (this._slots.forEach((s) => s.shapeKeyChanged(t, i)), this.sizeBox.follow === t ? (this.sizeBox.generate(this._container, i), this.sizeBox.originOffset && (this._container.traverse((s) => {
|
|
10026
|
-
s instanceof
|
|
10026
|
+
s instanceof X && !s.userData.isDevice && !s.userData.isBracket && s.geometry.translate(this.sizeBox.originOffset - this.sizeBox.translateCache, 0, 0), s instanceof Ur && !s.props.slot.userData.ignoreOriginChanged && s.parent && s.parent.position.add(new b(this.sizeBox.originOffset - this.sizeBox.translateCache, 0, 0));
|
|
10027
10027
|
}), this.sizeBox.translateCache = this.sizeBox.originOffset, this.sizeBox.generate(this._container))) : this.sizeBox.generate(this._container), ["width", "length", "height"].includes(t) && this._emitter.emit("size-changed", t, i), t === "goodsLength") {
|
|
10028
|
-
const s =
|
|
10029
|
-
this._goodsSize.length = this._layoutLengthToItemLength(
|
|
10028
|
+
const s = i;
|
|
10029
|
+
this._goodsSize.length = this._layoutLengthToItemLength(s), this._applyDerivedSizesFromLayoutGoodsLength(s), this._generateRollers(), this._syncRollerGoodsBoxesFromGoodsSize(), this._syncShelvesFromGoodsSize();
|
|
10030
10030
|
}
|
|
10031
10031
|
t === "goodsWidth" && (this._goodsSize.width = i, this._applyDerivedSizesFromGoodsWidth(i), this._columnCount > 1 && this.setColumns(this._columnCount, !1), this._syncRollerGoodsBoxesFromGoodsSize(), this._syncShelvesFromGoodsSize());
|
|
10032
10032
|
});
|
|
@@ -10065,32 +10065,27 @@ class _c extends oi {
|
|
|
10065
10065
|
});
|
|
10066
10066
|
});
|
|
10067
10067
|
}
|
|
10068
|
-
_syncShelvesFromGoodsSize(
|
|
10069
|
-
const
|
|
10070
|
-
this._shelves.forEach((
|
|
10071
|
-
let
|
|
10072
|
-
|
|
10073
|
-
var
|
|
10074
|
-
if ((
|
|
10075
|
-
const
|
|
10076
|
-
(Object.prototype.hasOwnProperty.call(
|
|
10068
|
+
_syncShelvesFromGoodsSize() {
|
|
10069
|
+
const e = this.shapeKeys.has("goodsLength") || this.shapeKeys.has("goodsWidth"), t = this._getLayoutGoodsLength(this._goodsSize.length);
|
|
10070
|
+
this._shelves.forEach((i) => {
|
|
10071
|
+
let s = this._shelfSyncCache.get(i);
|
|
10072
|
+
s || (s = { container: void 0, morphMeshes: [], goodsBoxes: [] }, i.traverse((c) => {
|
|
10073
|
+
var h;
|
|
10074
|
+
if ((h = c.userData) != null && h.isShelfContainer && (s.container = c), c instanceof Ce && s.goodsBoxes.push(c), as(c)) {
|
|
10075
|
+
const f = c, d = f.morphTargetDictionary || {};
|
|
10076
|
+
(Object.prototype.hasOwnProperty.call(d, "goodsWidth") || Object.prototype.hasOwnProperty.call(d, "goodsLength")) && s.morphMeshes.push(f);
|
|
10077
10077
|
}
|
|
10078
|
-
}), this._shelfSyncCache.set(
|
|
10079
|
-
|
|
10080
|
-
}),
|
|
10081
|
-
this.setShapeKeyToMesh(
|
|
10078
|
+
}), this._shelfSyncCache.set(i, s)), s.goodsBoxes.forEach((c) => {
|
|
10079
|
+
c.updateSize(this._goodsSize.length, this._goodsSize.width, this._goodsSize.height);
|
|
10080
|
+
}), s.morphMeshes.forEach((c) => {
|
|
10081
|
+
this.setShapeKeyToMesh(c, "goodsWidth", this._goodsSize.width), this.setShapeKeyToMesh(c, "goodsLength", t);
|
|
10082
10082
|
});
|
|
10083
|
-
const
|
|
10084
|
-
if (!
|
|
10083
|
+
const a = s.container;
|
|
10084
|
+
if (!a)
|
|
10085
10085
|
return;
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
n.userData.__goodsBaseX = n.position.x - (h || 0) / 2;
|
|
10090
|
-
} else
|
|
10091
|
-
n.userData.__goodsBaseX = n.position.x;
|
|
10092
|
-
const c = n.userData.__goodsBaseX;
|
|
10093
|
-
n.position.x = t ? c + i / 2 : c;
|
|
10086
|
+
typeof a.userData.__goodsBaseX != "number" && (a.userData.__goodsBaseX = a.position.x);
|
|
10087
|
+
const n = a.userData.__goodsBaseX;
|
|
10088
|
+
a.position.x = e ? n + t / 2 : n;
|
|
10094
10089
|
});
|
|
10095
10090
|
}
|
|
10096
10091
|
_findFirstSkinnedMesh(e) {
|
|
@@ -10129,13 +10124,13 @@ class _c extends oi {
|
|
|
10129
10124
|
(!a || !n) && console.warn("[Amr.loadAnimation] 在动画或目标模型中未找到 SkinnedMesh,使用原始动画 clip", e), this._mixer || (this._mixer = new rr(this._modelRoot));
|
|
10130
10125
|
const c = (
|
|
10131
10126
|
// @ts-ignore SkeletonUtils 可能没有类型定义
|
|
10132
|
-
typeof
|
|
10127
|
+
typeof Zi.retargetClip == "function"
|
|
10133
10128
|
);
|
|
10134
10129
|
i.forEach((h) => {
|
|
10135
10130
|
let f = h;
|
|
10136
10131
|
if (c && a && n)
|
|
10137
10132
|
try {
|
|
10138
|
-
f =
|
|
10133
|
+
f = Zi.retargetClip(
|
|
10139
10134
|
n,
|
|
10140
10135
|
a,
|
|
10141
10136
|
h
|
|
@@ -10160,7 +10155,7 @@ class _c extends oi {
|
|
|
10160
10155
|
return;
|
|
10161
10156
|
i = c.glb;
|
|
10162
10157
|
}
|
|
10163
|
-
const a =
|
|
10158
|
+
const a = Zi.clone(i);
|
|
10164
10159
|
this._generateAmr(a, s), i = null, this._emitter.emit("amr-loaded");
|
|
10165
10160
|
}
|
|
10166
10161
|
changeSkin(e, t) {
|
|
@@ -10183,7 +10178,7 @@ class _c extends oi {
|
|
|
10183
10178
|
let n = t;
|
|
10184
10179
|
a.userData[`origin_${e}`] && (n -= a.userData[`origin_${e}`]);
|
|
10185
10180
|
const c = (h = a.morphTargetDictionary) == null ? void 0 : h[e];
|
|
10186
|
-
c !== void 0 && a.morphTargetInfluences && (a.morphTargetInfluences[c] = n), a instanceof
|
|
10181
|
+
c !== void 0 && a.morphTargetInfluences && (a.morphTargetInfluences[c] = n), a instanceof X && a.geometry.translate(0, 0, 1e-9);
|
|
10187
10182
|
}), i && this._emitter.emit("shape-key-changed", e, t);
|
|
10188
10183
|
}, 0);
|
|
10189
10184
|
}
|
|
@@ -10204,7 +10199,7 @@ class _c extends oi {
|
|
|
10204
10199
|
n ? n.push(i) : this._shapeKeyTargets.set(s, [i]);
|
|
10205
10200
|
});
|
|
10206
10201
|
}), e.traverse((i) => {
|
|
10207
|
-
if (i instanceof
|
|
10202
|
+
if (i instanceof X) {
|
|
10208
10203
|
if (i.castShadow = !0, i.receiveShadow = !0, i.material)
|
|
10209
10204
|
if (Array.isArray(i.material))
|
|
10210
10205
|
i.material.forEach((a) => {
|
|
@@ -10224,7 +10219,7 @@ class _c extends oi {
|
|
|
10224
10219
|
}
|
|
10225
10220
|
if (i.material.userData.isBreathLight && i.material.emissiveIntensity) {
|
|
10226
10221
|
i.material.emissive || (i.material.emissive = new J(16777215)), i.material.emissiveIntensity = 2, i.material.toneMapped = !1;
|
|
10227
|
-
const a = 1e3, n = new
|
|
10222
|
+
const a = 1e3, n = new Ze.Tween(i.material).to({ emissiveIntensity: 0.2 }).easing(Ze.Easing.Quintic.InOut).duration(a), c = new Ze.Tween(i.material).to({ emissiveIntensity: 2 }).easing(Ze.Easing.Quintic.InOut).duration(a);
|
|
10228
10223
|
n.onComplete(() => c.start()), c.onComplete(() => n.start()), n.start(), this._breathLights.push(n, c);
|
|
10229
10224
|
}
|
|
10230
10225
|
i.material.userData.changeColor && (this.skins.find((a) => a.name === i.material.userData.name) || this.skins.push(new tn({
|
|
@@ -10399,10 +10394,9 @@ class _c extends oi {
|
|
|
10399
10394
|
const t = Math.max(1, Math.floor(e || 1));
|
|
10400
10395
|
if (t === this._rowCount)
|
|
10401
10396
|
return;
|
|
10402
|
-
const i = this._getLayoutGoodsLength(this._goodsSize.length);
|
|
10403
10397
|
this._rowCount = t;
|
|
10404
|
-
const
|
|
10405
|
-
this.setShapeKey("goodsLength",
|
|
10398
|
+
const i = this._getLayoutGoodsLength(this._goodsSize.length);
|
|
10399
|
+
this.setShapeKey("goodsLength", i, !1), this._applyDerivedSizesFromLayoutGoodsLength(i), this._generateRollers(), this._syncRollerGoodsBoxesFromGoodsSize(), this._syncShelvesFromGoodsSize();
|
|
10406
10400
|
}
|
|
10407
10401
|
_getLayoutGoodsLength(e = this._goodsSize.length) {
|
|
10408
10402
|
const t = Math.max(1, this._rowCount || 1), i = e || 0;
|
|
@@ -10882,10 +10876,10 @@ function hs(o, e, t, i, s) {
|
|
|
10882
10876
|
for (let g = e * 6, v = (e + t) * 6; g < v; g += 6) {
|
|
10883
10877
|
const y = o[g + 0], x = o[g + 1], w = y - x, T = y + x;
|
|
10884
10878
|
w < a && (a = w), T > h && (h = T), y < r && (r = y), y > m && (m = y);
|
|
10885
|
-
const S = o[g + 2], R = o[g + 3], C = S - R,
|
|
10886
|
-
C < n && (n = C),
|
|
10887
|
-
const I = o[g + 4], A = o[g + 5], M = I - A,
|
|
10888
|
-
M < c && (c = M),
|
|
10879
|
+
const S = o[g + 2], R = o[g + 3], C = S - R, L = S + R;
|
|
10880
|
+
C < n && (n = C), L > f && (f = L), S < l && (l = S), S > _ && (_ = S);
|
|
10881
|
+
const I = o[g + 4], A = o[g + 5], M = I - A, D = I + A;
|
|
10882
|
+
M < c && (c = M), D > d && (d = D), I < u && (u = I), I > p && (p = I);
|
|
10889
10883
|
}
|
|
10890
10884
|
i[0] = a, i[1] = n, i[2] = c, i[3] = h, i[4] = f, i[5] = d, s[0] = r, s[1] = l, s[2] = u, s[3] = m, s[4] = _, s[5] = p;
|
|
10891
10885
|
}
|
|
@@ -10908,13 +10902,13 @@ function Mc(o, e = null, t = null, i = null) {
|
|
|
10908
10902
|
w < S && (S = w), T < S && (S = T);
|
|
10909
10903
|
let R = x;
|
|
10910
10904
|
w > R && (R = w), T > R && (R = T);
|
|
10911
|
-
const C = (R - S) / 2,
|
|
10912
|
-
h[_ +
|
|
10905
|
+
const C = (R - S) / 2, L = y * 2;
|
|
10906
|
+
h[_ + L + 0] = S + C, h[_ + L + 1] = C + (Math.abs(S) + C) * wc;
|
|
10913
10907
|
}
|
|
10914
10908
|
}
|
|
10915
10909
|
return h;
|
|
10916
10910
|
}
|
|
10917
|
-
function
|
|
10911
|
+
function Z(o, e, t) {
|
|
10918
10912
|
return t.min.x = e[o], t.min.y = e[o + 1], t.min.z = e[o + 2], t.max.x = e[o + 3], t.max.y = e[o + 4], t.max.z = e[o + 5], t;
|
|
10919
10913
|
}
|
|
10920
10914
|
function qr(o) {
|
|
@@ -10945,7 +10939,7 @@ function Nt(o) {
|
|
|
10945
10939
|
const e = o[3] - o[0], t = o[4] - o[1], i = o[5] - o[2];
|
|
10946
10940
|
return 2 * (e * t + t * i + i * e);
|
|
10947
10941
|
}
|
|
10948
|
-
const
|
|
10942
|
+
const De = 32, Cc = (o, e) => o.candidate - e.candidate, qe = new Array(De).fill().map(() => ({
|
|
10949
10943
|
count: 0,
|
|
10950
10944
|
bounds: new Float32Array(6),
|
|
10951
10945
|
rightCacheBounds: new Float32Array(6),
|
|
@@ -10963,8 +10957,8 @@ function Ic(o, e, t, i, s, a) {
|
|
|
10963
10957
|
let f = ls * s;
|
|
10964
10958
|
const d = i * 6, r = (i + s) * 6;
|
|
10965
10959
|
for (let l = 0; l < 3; l++) {
|
|
10966
|
-
const u = e[l], p = (e[l + 3] - u) /
|
|
10967
|
-
if (s <
|
|
10960
|
+
const u = e[l], p = (e[l + 3] - u) / De;
|
|
10961
|
+
if (s < De / 4) {
|
|
10968
10962
|
const g = [...qe];
|
|
10969
10963
|
g.length = s;
|
|
10970
10964
|
let v = 0;
|
|
@@ -10996,15 +10990,15 @@ function Ic(o, e, t, i, s, a) {
|
|
|
10996
10990
|
}
|
|
10997
10991
|
for (let x = 0; x < y; x++) {
|
|
10998
10992
|
const w = g[x], T = w.count, S = s - w.count, R = w.leftCacheBounds, C = w.rightCacheBounds;
|
|
10999
|
-
let
|
|
11000
|
-
T !== 0 && (
|
|
10993
|
+
let L = 0;
|
|
10994
|
+
T !== 0 && (L = Nt(R) / h);
|
|
11001
10995
|
let I = 0;
|
|
11002
10996
|
S !== 0 && (I = Nt(C) / h);
|
|
11003
|
-
const A = Gr + ls * (
|
|
10997
|
+
const A = Gr + ls * (L * T + I * S);
|
|
11004
10998
|
A < f && (n = l, f = A, c = w.candidate);
|
|
11005
10999
|
}
|
|
11006
11000
|
} else {
|
|
11007
|
-
for (let y = 0; y <
|
|
11001
|
+
for (let y = 0; y < De; y++) {
|
|
11008
11002
|
const x = qe[y];
|
|
11009
11003
|
x.count = 0, x.candidate = u + p + y * p;
|
|
11010
11004
|
const w = x.bounds;
|
|
@@ -11013,25 +11007,25 @@ function Ic(o, e, t, i, s, a) {
|
|
|
11013
11007
|
}
|
|
11014
11008
|
for (let y = d; y < r; y += 6) {
|
|
11015
11009
|
let T = ~~((t[y + 2 * l] - u) / p);
|
|
11016
|
-
T >=
|
|
11010
|
+
T >= De && (T = De - 1);
|
|
11017
11011
|
const S = qe[T];
|
|
11018
11012
|
S.count++, vi(y, t, S.bounds);
|
|
11019
11013
|
}
|
|
11020
|
-
const g = qe[
|
|
11014
|
+
const g = qe[De - 1];
|
|
11021
11015
|
jr(g.bounds, g.rightCacheBounds);
|
|
11022
|
-
for (let y =
|
|
11016
|
+
for (let y = De - 2; y >= 0; y--) {
|
|
11023
11017
|
const x = qe[y], w = qe[y + 1];
|
|
11024
11018
|
Qr(x.bounds, w.rightCacheBounds, x.rightCacheBounds);
|
|
11025
11019
|
}
|
|
11026
11020
|
let v = 0;
|
|
11027
|
-
for (let y = 0; y <
|
|
11021
|
+
for (let y = 0; y < De - 1; y++) {
|
|
11028
11022
|
const x = qe[y], w = x.count, T = x.bounds, R = qe[y + 1].rightCacheBounds;
|
|
11029
11023
|
w !== 0 && (v === 0 ? jr(T, _i) : Qr(T, _i, _i)), v += w;
|
|
11030
|
-
let C = 0,
|
|
11024
|
+
let C = 0, L = 0;
|
|
11031
11025
|
v !== 0 && (C = Nt(_i) / h);
|
|
11032
11026
|
const I = s - v;
|
|
11033
|
-
I !== 0 && (
|
|
11034
|
-
const A = Gr + ls * (C * v +
|
|
11027
|
+
I !== 0 && (L = Nt(R) / h);
|
|
11028
|
+
const A = Gr + ls * (C * v + L * I);
|
|
11035
11029
|
A < f && (n = l, f = A, c = x.candidate);
|
|
11036
11030
|
}
|
|
11037
11031
|
}
|
|
@@ -11051,7 +11045,7 @@ class us {
|
|
|
11051
11045
|
this.boundingData = new Float32Array(6);
|
|
11052
11046
|
}
|
|
11053
11047
|
}
|
|
11054
|
-
function
|
|
11048
|
+
function Dc(o, e, t, i, s, a) {
|
|
11055
11049
|
let n = i, c = i + s - 1;
|
|
11056
11050
|
const h = a.pos, f = a.axis * 2;
|
|
11057
11051
|
for (; ; ) {
|
|
@@ -11073,7 +11067,7 @@ function Lc(o, e, t, i, s, a) {
|
|
|
11073
11067
|
return n;
|
|
11074
11068
|
}
|
|
11075
11069
|
}
|
|
11076
|
-
function
|
|
11070
|
+
function Lc(o, e, t, i, s, a) {
|
|
11077
11071
|
let n = i, c = i + s - 1;
|
|
11078
11072
|
const h = a.pos, f = a.axis * 2;
|
|
11079
11073
|
for (; ; ) {
|
|
@@ -11111,15 +11105,15 @@ function _e(o, e) {
|
|
|
11111
11105
|
function On(o, e) {
|
|
11112
11106
|
return e[o + 7];
|
|
11113
11107
|
}
|
|
11114
|
-
let zn,
|
|
11108
|
+
let zn, Xt, Fi, Un;
|
|
11115
11109
|
const Pc = Math.pow(2, 32);
|
|
11116
|
-
function
|
|
11117
|
-
return "count" in o ? 1 : 1 +
|
|
11110
|
+
function Ds(o) {
|
|
11111
|
+
return "count" in o ? 1 : 1 + Ds(o.left) + Ds(o.right);
|
|
11118
11112
|
}
|
|
11119
11113
|
function Ec(o, e, t) {
|
|
11120
|
-
return zn = new Float32Array(t),
|
|
11114
|
+
return zn = new Float32Array(t), Xt = new Uint32Array(t), Fi = new Uint16Array(t), Un = new Uint8Array(t), Ls(o, e);
|
|
11121
11115
|
}
|
|
11122
|
-
function
|
|
11116
|
+
function Ls(o, e) {
|
|
11123
11117
|
const t = o / 4, i = o / 2, s = "count" in e, a = e.boundingData;
|
|
11124
11118
|
for (let n = 0; n < 6; n++)
|
|
11125
11119
|
zn[t + n] = a[n];
|
|
@@ -11129,19 +11123,19 @@ function Ds(o, e) {
|
|
|
11129
11123
|
Un.set(new Uint8Array(n), o);
|
|
11130
11124
|
for (let c = o, h = o + n.byteLength; c < h; c += ei) {
|
|
11131
11125
|
const f = c / 2;
|
|
11132
|
-
le(f, Fi) || (
|
|
11126
|
+
le(f, Fi) || (Xt[c / 4 + 6] += t);
|
|
11133
11127
|
}
|
|
11134
11128
|
return o + n.byteLength;
|
|
11135
11129
|
} else {
|
|
11136
11130
|
const n = e.offset, c = e.count;
|
|
11137
|
-
return
|
|
11131
|
+
return Xt[t + 6] = n, Fi[i + 14] = c, Fi[i + 15] = Qi, o + ei;
|
|
11138
11132
|
}
|
|
11139
11133
|
else {
|
|
11140
11134
|
const n = e.left, c = e.right, h = e.splitAxis;
|
|
11141
11135
|
let f;
|
|
11142
|
-
if (f =
|
|
11136
|
+
if (f = Ls(o + ei, n), f / 4 > Pc)
|
|
11143
11137
|
throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");
|
|
11144
|
-
return
|
|
11138
|
+
return Xt[t + 6] = f / 4, f = Ls(f, c), Xt[t + 7] = h, f;
|
|
11145
11139
|
}
|
|
11146
11140
|
}
|
|
11147
11141
|
function Fc(o, e) {
|
|
@@ -11158,7 +11152,7 @@ function kc(o, e, t, i, s) {
|
|
|
11158
11152
|
strategy: h,
|
|
11159
11153
|
onProgress: f,
|
|
11160
11154
|
indirect: d
|
|
11161
|
-
} = s, r = o._indirectBuffer, l = o.geometry, u = l.index ? l.index.array : null, m = d ?
|
|
11155
|
+
} = s, r = o._indirectBuffer, l = o.geometry, u = l.index ? l.index.array : null, m = d ? Lc : Dc, _ = Bt(l), p = new Float32Array(6);
|
|
11162
11156
|
let g = !1;
|
|
11163
11157
|
const v = new us();
|
|
11164
11158
|
return hs(e, t, i, v.boundingData, p), x(v, t, i, p), v;
|
|
@@ -11168,17 +11162,17 @@ function kc(o, e, t, i, s) {
|
|
|
11168
11162
|
function x(w, T, S, R = null, C = 0) {
|
|
11169
11163
|
if (!g && C >= a && (g = !0, n && (console.warn(`MeshBVH: Max depth of ${a} reached when generating BVH. Consider increasing maxDepth.`), console.warn(l))), S <= c || C >= a)
|
|
11170
11164
|
return y(T + S), w.offset = T, w.count = S, w;
|
|
11171
|
-
const
|
|
11172
|
-
if (
|
|
11165
|
+
const L = Ic(w.boundingData, R, e, T, S, h);
|
|
11166
|
+
if (L.axis === -1)
|
|
11173
11167
|
return y(T + S), w.offset = T, w.count = S, w;
|
|
11174
|
-
const I = m(r, u, e, T, S,
|
|
11168
|
+
const I = m(r, u, e, T, S, L);
|
|
11175
11169
|
if (I === T || I === T + S)
|
|
11176
11170
|
y(T + S), w.offset = T, w.count = S;
|
|
11177
11171
|
else {
|
|
11178
|
-
w.splitAxis =
|
|
11179
|
-
const A = new us(), M = T,
|
|
11180
|
-
w.left = A, hs(e, M,
|
|
11181
|
-
const P = new us(), F = I, k = S -
|
|
11172
|
+
w.splitAxis = L.axis;
|
|
11173
|
+
const A = new us(), M = T, D = I - T;
|
|
11174
|
+
w.left = A, hs(e, M, D, A.boundingData, p), x(A, M, D, p, C + 1);
|
|
11175
|
+
const P = new us(), F = I, k = S - D;
|
|
11182
11176
|
w.right = P, hs(e, F, k, P.boundingData, p), x(P, F, k, p, C + 1);
|
|
11183
11177
|
}
|
|
11184
11178
|
return w;
|
|
@@ -11191,7 +11185,7 @@ function Bc(o, e) {
|
|
|
11191
11185
|
)), o._indirectBuffer || Tc(t, e);
|
|
11192
11186
|
const i = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, s = Mc(t), a = e.indirect ? kn(t) : Bn(t);
|
|
11193
11187
|
o._roots = a.map((n) => {
|
|
11194
|
-
const c = kc(o, s, n.offset, n.count, e), h =
|
|
11188
|
+
const c = kc(o, s, n.offset, n.count, e), h = Ds(c), f = new i(ei * h);
|
|
11195
11189
|
return Ec(0, c, f), f;
|
|
11196
11190
|
});
|
|
11197
11191
|
}
|
|
@@ -11354,22 +11348,22 @@ Se.prototype.intersectsTriangle = function() {
|
|
|
11354
11348
|
const w = this.satBounds, T = this.satAxes;
|
|
11355
11349
|
t[0] = p.a, t[1] = p.b, t[2] = p.c;
|
|
11356
11350
|
for (let C = 0; C < 4; C++) {
|
|
11357
|
-
const
|
|
11358
|
-
if (i.setFromPoints(I, t),
|
|
11351
|
+
const L = w[C], I = T[C];
|
|
11352
|
+
if (i.setFromPoints(I, t), L.isSeparated(i))
|
|
11359
11353
|
return !1;
|
|
11360
11354
|
}
|
|
11361
11355
|
const S = p.satBounds, R = p.satAxes;
|
|
11362
11356
|
e[0] = this.a, e[1] = this.b, e[2] = this.c;
|
|
11363
11357
|
for (let C = 0; C < 4; C++) {
|
|
11364
|
-
const
|
|
11365
|
-
if (i.setFromPoints(I, e),
|
|
11358
|
+
const L = S[C], I = R[C];
|
|
11359
|
+
if (i.setFromPoints(I, e), L.isSeparated(i))
|
|
11366
11360
|
return !1;
|
|
11367
11361
|
}
|
|
11368
11362
|
for (let C = 0; C < 4; C++) {
|
|
11369
|
-
const
|
|
11363
|
+
const L = T[C];
|
|
11370
11364
|
for (let I = 0; I < 4; I++) {
|
|
11371
11365
|
const A = R[I];
|
|
11372
|
-
if (a.crossVectors(
|
|
11366
|
+
if (a.crossVectors(L, A), i.setFromPoints(a, e), s.setFromPoints(a, t), i.isSeparated(s))
|
|
11373
11367
|
return !1;
|
|
11374
11368
|
}
|
|
11375
11369
|
}
|
|
@@ -11389,8 +11383,8 @@ Se.prototype.intersectsTriangle = function() {
|
|
|
11389
11383
|
let M = l.start;
|
|
11390
11384
|
l.start = l.end, l.end = M;
|
|
11391
11385
|
}
|
|
11392
|
-
const S = r.start.dot(c), R = r.end.dot(c), C = l.start.dot(c),
|
|
11393
|
-
return S !==
|
|
11386
|
+
const S = r.start.dot(c), R = r.end.dot(c), C = l.start.dot(c), L = l.end.dot(c), I = R < C, A = S < L;
|
|
11387
|
+
return S !== L && C !== R && I === A ? !1 : (g && (f.subVectors(r.start, l.start), f.dot(c) > 0 ? g.start.copy(r.start) : g.start.copy(l.start), f.subVectors(r.end, l.end), f.dot(c) < 0 ? g.end.copy(r.end) : g.end.copy(l.end)), !0);
|
|
11394
11388
|
}
|
|
11395
11389
|
};
|
|
11396
11390
|
}();
|
|
@@ -11530,8 +11524,8 @@ ne.prototype.distanceToBox = function() {
|
|
|
11530
11524
|
for (let v = 0; v <= 1; v++) {
|
|
11531
11525
|
const y = (p + 1) % 3, x = (p + 2) % 3, w = g << y | v << x, T = 1 << p | g << y | v << x, S = u[w], R = u[T];
|
|
11532
11526
|
e[_].set(S, R);
|
|
11533
|
-
const
|
|
11534
|
-
L
|
|
11527
|
+
const L = o[p], I = o[y], A = o[x], M = t[_], D = M.start, P = M.end;
|
|
11528
|
+
D[L] = r[L], D[I] = g ? r[I] : l[I], D[A] = v ? r[A] : l[I], P[L] = l[L], P[I] = g ? r[I] : l[I], P[A] = v ? r[A] : l[I], _++;
|
|
11535
11529
|
}
|
|
11536
11530
|
for (let p = 0; p <= 1; p++)
|
|
11537
11531
|
for (let g = 0; g <= 1; g++)
|
|
@@ -11554,7 +11548,7 @@ ne.prototype.distanceToBox = function() {
|
|
|
11554
11548
|
return Math.sqrt(m);
|
|
11555
11549
|
};
|
|
11556
11550
|
}();
|
|
11557
|
-
class
|
|
11551
|
+
class Zs {
|
|
11558
11552
|
constructor(e) {
|
|
11559
11553
|
this._getNewPrimitive = e, this._primitives = [];
|
|
11560
11554
|
}
|
|
@@ -11566,7 +11560,7 @@ class Xs {
|
|
|
11566
11560
|
this._primitives.push(e);
|
|
11567
11561
|
}
|
|
11568
11562
|
}
|
|
11569
|
-
class Hc extends
|
|
11563
|
+
class Hc extends Zs {
|
|
11570
11564
|
constructor() {
|
|
11571
11565
|
super(() => new Se());
|
|
11572
11566
|
}
|
|
@@ -11585,48 +11579,48 @@ class Wc {
|
|
|
11585
11579
|
}
|
|
11586
11580
|
}
|
|
11587
11581
|
const j = new Wc();
|
|
11588
|
-
let
|
|
11589
|
-
const pt = [], yi = /* @__PURE__ */ new
|
|
11582
|
+
let Xe, Ct;
|
|
11583
|
+
const pt = [], yi = /* @__PURE__ */ new Zs(() => new Q());
|
|
11590
11584
|
function Vc(o, e, t, i, s, a) {
|
|
11591
|
-
|
|
11585
|
+
Xe = yi.getPrimitive(), Ct = yi.getPrimitive(), pt.push(Xe, Ct), j.setBuffer(o._roots[e]);
|
|
11592
11586
|
const n = Ps(0, o.geometry, t, i, s, a);
|
|
11593
|
-
j.clearBuffer(), yi.releasePrimitive(
|
|
11587
|
+
j.clearBuffer(), yi.releasePrimitive(Xe), yi.releasePrimitive(Ct), pt.pop(), pt.pop();
|
|
11594
11588
|
const c = pt.length;
|
|
11595
|
-
return c > 0 && (Ct = pt[c - 1],
|
|
11589
|
+
return c > 0 && (Ct = pt[c - 1], Xe = pt[c - 2]), n;
|
|
11596
11590
|
}
|
|
11597
11591
|
function Ps(o, e, t, i, s = null, a = 0, n = 0) {
|
|
11598
11592
|
const { float32Array: c, uint16Array: h, uint32Array: f } = j;
|
|
11599
11593
|
let d = o * 2;
|
|
11600
11594
|
if (le(d, h)) {
|
|
11601
11595
|
const l = fe(o, f), u = ge(d, h);
|
|
11602
|
-
return
|
|
11596
|
+
return Z(o, c, Xe), i(l, u, !1, n, a + o, Xe);
|
|
11603
11597
|
} else {
|
|
11604
|
-
let
|
|
11605
|
-
const { uint16Array: M, uint32Array:
|
|
11598
|
+
let L = function(A) {
|
|
11599
|
+
const { uint16Array: M, uint32Array: D } = j;
|
|
11606
11600
|
let P = A * 2;
|
|
11607
11601
|
for (; !le(P, M); )
|
|
11608
11602
|
A = ve(A), P = A * 2;
|
|
11609
|
-
return fe(A,
|
|
11603
|
+
return fe(A, D);
|
|
11610
11604
|
}, I = function(A) {
|
|
11611
|
-
const { uint16Array: M, uint32Array:
|
|
11605
|
+
const { uint16Array: M, uint32Array: D } = j;
|
|
11612
11606
|
let P = A * 2;
|
|
11613
11607
|
for (; !le(P, M); )
|
|
11614
|
-
A = _e(A,
|
|
11615
|
-
return fe(A,
|
|
11608
|
+
A = _e(A, D), P = A * 2;
|
|
11609
|
+
return fe(A, D) + ge(P, M);
|
|
11616
11610
|
};
|
|
11617
11611
|
const l = ve(o), u = _e(o, f);
|
|
11618
11612
|
let m = l, _ = u, p, g, v, y;
|
|
11619
|
-
if (s && (v =
|
|
11613
|
+
if (s && (v = Xe, y = Ct, Z(m, c, v), Z(_, c, y), p = s(v), g = s(y), g < p)) {
|
|
11620
11614
|
m = u, _ = l;
|
|
11621
11615
|
const A = p;
|
|
11622
11616
|
p = g, g = A, v = y;
|
|
11623
11617
|
}
|
|
11624
|
-
v || (v =
|
|
11618
|
+
v || (v = Xe, Z(m, c, v));
|
|
11625
11619
|
const x = le(m * 2, h), w = t(v, x, p, n + 1, a + m);
|
|
11626
11620
|
let T;
|
|
11627
11621
|
if (w === Nr) {
|
|
11628
|
-
const A =
|
|
11629
|
-
T = i(A,
|
|
11622
|
+
const A = L(m), D = I(m) - A;
|
|
11623
|
+
T = i(A, D, !0, n + 1, a + m, v);
|
|
11630
11624
|
} else
|
|
11631
11625
|
T = w && Ps(
|
|
11632
11626
|
m,
|
|
@@ -11639,12 +11633,12 @@ function Ps(o, e, t, i, s = null, a = 0, n = 0) {
|
|
|
11639
11633
|
);
|
|
11640
11634
|
if (T)
|
|
11641
11635
|
return !0;
|
|
11642
|
-
y = Ct,
|
|
11636
|
+
y = Ct, Z(_, c, y);
|
|
11643
11637
|
const S = le(_ * 2, h), R = t(y, S, g, n + 1, a + _);
|
|
11644
11638
|
let C;
|
|
11645
11639
|
if (R === Nr) {
|
|
11646
|
-
const A =
|
|
11647
|
-
C = i(A,
|
|
11640
|
+
const A = L(_), D = I(_) - A;
|
|
11641
|
+
C = i(A, D, !0, n + 1, a + _, y);
|
|
11648
11642
|
} else
|
|
11649
11643
|
C = R && Ps(
|
|
11650
11644
|
_,
|
|
@@ -11677,7 +11671,7 @@ function Nc(o, e, t = {}, i = 0, s = 1 / 0) {
|
|
|
11677
11671
|
const f = Math.sqrt(c);
|
|
11678
11672
|
return t.point ? t.point.copy(ds) : t.point = ds.clone(), t.distance = f, t.faceIndex = h, t;
|
|
11679
11673
|
}
|
|
11680
|
-
const mt = /* @__PURE__ */ new b(), gt = /* @__PURE__ */ new b(), vt = /* @__PURE__ */ new b(), xi = /* @__PURE__ */ new U(), wi = /* @__PURE__ */ new U(), bi = /* @__PURE__ */ new U(), Yr = /* @__PURE__ */ new b(), Kr = /* @__PURE__ */ new b(),
|
|
11674
|
+
const mt = /* @__PURE__ */ new b(), gt = /* @__PURE__ */ new b(), vt = /* @__PURE__ */ new b(), xi = /* @__PURE__ */ new U(), wi = /* @__PURE__ */ new U(), bi = /* @__PURE__ */ new U(), Yr = /* @__PURE__ */ new b(), Kr = /* @__PURE__ */ new b(), Zr = /* @__PURE__ */ new b(), Ai = /* @__PURE__ */ new b();
|
|
11681
11675
|
function Gc(o, e, t, i, s, a, n, c) {
|
|
11682
11676
|
let h;
|
|
11683
11677
|
if (a === ln ? h = o.intersectTriangle(i, t, e, !0, s) : h = o.intersectTriangle(e, t, i, a !== ni, s), h === null)
|
|
@@ -11692,7 +11686,7 @@ function qc(o, e, t, i, s, a, n, c, h, f, d) {
|
|
|
11692
11686
|
mt.fromBufferAttribute(e, a), gt.fromBufferAttribute(e, n), vt.fromBufferAttribute(e, c);
|
|
11693
11687
|
const r = Gc(o, mt, gt, vt, Ai, h, f, d);
|
|
11694
11688
|
if (r) {
|
|
11695
|
-
i && (xi.fromBufferAttribute(i, a), wi.fromBufferAttribute(i, n), bi.fromBufferAttribute(i, c), r.uv = Kt.getInterpolation(Ai, mt, gt, vt, xi, wi, bi, new U())), s && (xi.fromBufferAttribute(s, a), wi.fromBufferAttribute(s, n), bi.fromBufferAttribute(s, c), r.uv1 = Kt.getInterpolation(Ai, mt, gt, vt, xi, wi, bi, new U())), t && (Yr.fromBufferAttribute(t, a), Kr.fromBufferAttribute(t, n),
|
|
11689
|
+
i && (xi.fromBufferAttribute(i, a), wi.fromBufferAttribute(i, n), bi.fromBufferAttribute(i, c), r.uv = Kt.getInterpolation(Ai, mt, gt, vt, xi, wi, bi, new U())), s && (xi.fromBufferAttribute(s, a), wi.fromBufferAttribute(s, n), bi.fromBufferAttribute(s, c), r.uv1 = Kt.getInterpolation(Ai, mt, gt, vt, xi, wi, bi, new U())), t && (Yr.fromBufferAttribute(t, a), Kr.fromBufferAttribute(t, n), Zr.fromBufferAttribute(t, c), r.normal = Kt.getInterpolation(Ai, mt, gt, vt, Yr, Kr, Zr, new b()), r.normal.dot(o.direction) > 0 && r.normal.multiplyScalar(-1));
|
|
11696
11690
|
const l = {
|
|
11697
11691
|
a,
|
|
11698
11692
|
b: n,
|
|
@@ -11752,10 +11746,10 @@ function Kc(o, e = null) {
|
|
|
11752
11746
|
if (c[_ + 15] === Qi) {
|
|
11753
11747
|
const g = n[l + 6], v = c[_ + 14];
|
|
11754
11748
|
let y = 1 / 0, x = 1 / 0, w = 1 / 0, T = -1 / 0, S = -1 / 0, R = -1 / 0;
|
|
11755
|
-
for (let C = 3 * g,
|
|
11749
|
+
for (let C = 3 * g, L = 3 * (g + v); C < L; C++) {
|
|
11756
11750
|
let I = i[C];
|
|
11757
|
-
const A = s.getX(I), M = s.getY(I),
|
|
11758
|
-
A < y && (y = A), A > T && (T = A), M < x && (x = M), M > S && (S = M),
|
|
11751
|
+
const A = s.getX(I), M = s.getY(I), D = s.getZ(I);
|
|
11752
|
+
A < y && (y = A), A > T && (T = A), M < x && (x = M), M > S && (S = M), D < w && (w = D), D > R && (R = D);
|
|
11759
11753
|
}
|
|
11760
11754
|
return h[l + 0] !== y || h[l + 1] !== x || h[l + 2] !== w || h[l + 3] !== T || h[l + 4] !== S || h[l + 5] !== R ? (h[l + 0] = y, h[l + 1] = x, h[l + 2] = w, h[l + 3] = T, h[l + 4] = S, h[l + 5] = R, !0) : !1;
|
|
11761
11755
|
} else {
|
|
@@ -11763,14 +11757,14 @@ function Kc(o, e = null) {
|
|
|
11763
11757
|
let w = m, T = !1, S = !1;
|
|
11764
11758
|
e ? w || (T = e.has(y), S = e.has(x), w = !T && !S) : (T = !0, S = !0);
|
|
11765
11759
|
const R = w || T, C = w || S;
|
|
11766
|
-
let
|
|
11767
|
-
R && (
|
|
11760
|
+
let L = !1;
|
|
11761
|
+
R && (L = r(g, u, w));
|
|
11768
11762
|
let I = !1;
|
|
11769
11763
|
C && (I = r(v, u, w));
|
|
11770
|
-
const A =
|
|
11764
|
+
const A = L || I;
|
|
11771
11765
|
if (A)
|
|
11772
11766
|
for (let M = 0; M < 3; M++) {
|
|
11773
|
-
const
|
|
11767
|
+
const D = g + M, P = v + M, F = h[D], k = h[D + 3], H = h[P], G = h[P + 3];
|
|
11774
11768
|
h[l + M] = F < H ? F : H, h[l + M + 3] = k > G ? k : G;
|
|
11775
11769
|
}
|
|
11776
11770
|
return A;
|
|
@@ -11783,14 +11777,14 @@ function et(o, e, t, i, s) {
|
|
|
11783
11777
|
let g = e[o], v = e[o + 3], y = e[o + 1], x = e[o + 3 + 1], w = e[o + 2], T = e[o + 3 + 2];
|
|
11784
11778
|
return r >= 0 ? (a = (g - m) * r, n = (v - m) * r) : (a = (v - m) * r, n = (g - m) * r), l >= 0 ? (c = (y - _) * l, h = (x - _) * l) : (c = (x - _) * l, h = (y - _) * l), a > h || c > n || ((c > a || isNaN(a)) && (a = c), (h < n || isNaN(n)) && (n = h), u >= 0 ? (f = (w - p) * u, d = (T - p) * u) : (f = (T - p) * u, d = (w - p) * u), a > d || f > n) ? !1 : ((f > a || a !== a) && (a = f), (d < n || n !== n) && (n = d), a <= s && n >= i);
|
|
11785
11779
|
}
|
|
11786
|
-
function
|
|
11780
|
+
function Zc(o, e, t, i, s, a, n, c) {
|
|
11787
11781
|
const { geometry: h, _indirectBuffer: f } = o;
|
|
11788
11782
|
for (let d = i, r = i + s; d < r; d++) {
|
|
11789
11783
|
let l = f ? f[d] : d;
|
|
11790
11784
|
Yi(h, e, t, l, a, n, c);
|
|
11791
11785
|
}
|
|
11792
11786
|
}
|
|
11793
|
-
function
|
|
11787
|
+
function Xc(o, e, t, i, s, a, n) {
|
|
11794
11788
|
const { geometry: c, _indirectBuffer: h } = o;
|
|
11795
11789
|
let f = 1 / 0, d = null;
|
|
11796
11790
|
for (let r = i, l = i + s; r < l; r++) {
|
|
@@ -11852,7 +11846,7 @@ function Fs(o, e, t, i, s, a) {
|
|
|
11852
11846
|
return v && x ? v.distance <= x.distance ? v : x : v || x || null;
|
|
11853
11847
|
}
|
|
11854
11848
|
}
|
|
11855
|
-
const Ti = /* @__PURE__ */ new Q(), _t = /* @__PURE__ */ new Se(), yt = /* @__PURE__ */ new Se(), qt = /* @__PURE__ */ new $(),
|
|
11849
|
+
const Ti = /* @__PURE__ */ new Q(), _t = /* @__PURE__ */ new Se(), yt = /* @__PURE__ */ new Se(), qt = /* @__PURE__ */ new $(), Xr = /* @__PURE__ */ new ne(), Si = /* @__PURE__ */ new ne();
|
|
11856
11850
|
function ih(o, e, t, i) {
|
|
11857
11851
|
j.setBuffer(o._roots[e]);
|
|
11858
11852
|
const s = ks(0, o, t, i);
|
|
@@ -11861,10 +11855,10 @@ function ih(o, e, t, i) {
|
|
|
11861
11855
|
function ks(o, e, t, i, s = null) {
|
|
11862
11856
|
const { float32Array: a, uint16Array: n, uint32Array: c } = j;
|
|
11863
11857
|
let h = o * 2;
|
|
11864
|
-
if (s === null && (t.boundingBox || t.computeBoundingBox(),
|
|
11858
|
+
if (s === null && (t.boundingBox || t.computeBoundingBox(), Xr.set(t.boundingBox.min, t.boundingBox.max, i), s = Xr), le(h, n)) {
|
|
11865
11859
|
const d = e.geometry, r = d.index, l = d.attributes.position, u = t.index, m = t.attributes.position, _ = fe(o, c), p = ge(h, n);
|
|
11866
11860
|
if (qt.copy(i).invert(), t.boundsTree)
|
|
11867
|
-
return
|
|
11861
|
+
return Z(o, a, Si), Si.matrix.copy(qt), Si.needsUpdate = !0, t.boundsTree.shapecast({
|
|
11868
11862
|
intersectsBounds: (v) => Si.intersectsBox(v),
|
|
11869
11863
|
intersectsTriangle: (v) => {
|
|
11870
11864
|
v.a.applyMatrix4(i), v.b.applyMatrix4(i), v.c.applyMatrix4(i), v.needsUpdate = !0;
|
|
@@ -11882,7 +11876,7 @@ function ks(o, e, t, i, s = null) {
|
|
|
11882
11876
|
}
|
|
11883
11877
|
} else {
|
|
11884
11878
|
const d = o + 8, r = c[o + 6];
|
|
11885
|
-
return
|
|
11879
|
+
return Z(d, a, Ti), !!(s.intersectsBox(Ti) && ks(d, e, t, i, s) || (Z(r, a, Ti), s.intersectsBox(Ti) && ks(r, e, t, i, s)));
|
|
11886
11880
|
}
|
|
11887
11881
|
}
|
|
11888
11882
|
const Mi = /* @__PURE__ */ new $(), ps = /* @__PURE__ */ new ne(), jt = /* @__PURE__ */ new ne(), sh = /* @__PURE__ */ new b(), rh = /* @__PURE__ */ new b(), nh = /* @__PURE__ */ new b(), oh = /* @__PURE__ */ new b();
|
|
@@ -11900,14 +11894,14 @@ function ah(o, e, t, i = {}, s = {}, a = 0, n = 1 / 0) {
|
|
|
11900
11894
|
if (e.boundsTree)
|
|
11901
11895
|
return e.boundsTree.shapecast({
|
|
11902
11896
|
boundsTraverseOrder: (R) => jt.distanceToBox(R),
|
|
11903
|
-
intersectsBounds: (R, C,
|
|
11897
|
+
intersectsBounds: (R, C, L) => L < v && L < n,
|
|
11904
11898
|
intersectsRange: (R, C) => {
|
|
11905
|
-
for (let
|
|
11906
|
-
ee(u, 3 *
|
|
11899
|
+
for (let L = R, I = R + C; L < I; L++) {
|
|
11900
|
+
ee(u, 3 * L, r, d), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
11907
11901
|
for (let A = w, M = w + T; A < M; A++) {
|
|
11908
11902
|
ee(l, 3 * A, f, h), l.needsUpdate = !0;
|
|
11909
|
-
const
|
|
11910
|
-
if (
|
|
11903
|
+
const D = l.distanceToTriangle(u, m, p);
|
|
11904
|
+
if (D < v && (_.copy(m), g && g.copy(p), v = D, y = A, x = L), D < a)
|
|
11911
11905
|
return !0;
|
|
11912
11906
|
}
|
|
11913
11907
|
}
|
|
@@ -11917,10 +11911,10 @@ function ah(o, e, t, i = {}, s = {}, a = 0, n = 1 / 0) {
|
|
|
11917
11911
|
const S = Bt(e);
|
|
11918
11912
|
for (let R = 0, C = S; R < C; R++) {
|
|
11919
11913
|
ee(u, 3 * R, r, d), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
11920
|
-
for (let
|
|
11921
|
-
ee(l, 3 *
|
|
11914
|
+
for (let L = w, I = w + T; L < I; L++) {
|
|
11915
|
+
ee(l, 3 * L, f, h), l.needsUpdate = !0;
|
|
11922
11916
|
const A = l.distanceToTriangle(u, m, p);
|
|
11923
|
-
if (A < v && (_.copy(m), g && g.copy(p), v = A, y =
|
|
11917
|
+
if (A < v && (_.copy(m), g && g.copy(p), v = A, y = L, x = R), A < a)
|
|
11924
11918
|
return !0;
|
|
11925
11919
|
}
|
|
11926
11920
|
}
|
|
@@ -11941,13 +11935,13 @@ function lh(o, e = null) {
|
|
|
11941
11935
|
if (c[_ + 15] === Qi) {
|
|
11942
11936
|
const g = n[l + 6], v = c[_ + 14];
|
|
11943
11937
|
let y = 1 / 0, x = 1 / 0, w = 1 / 0, T = -1 / 0, S = -1 / 0, R = -1 / 0;
|
|
11944
|
-
for (let C = g,
|
|
11938
|
+
for (let C = g, L = g + v; C < L; C++) {
|
|
11945
11939
|
const I = 3 * o.resolveTriangleIndex(C);
|
|
11946
11940
|
for (let A = 0; A < 3; A++) {
|
|
11947
11941
|
let M = I + A;
|
|
11948
11942
|
M = i ? i[M] : M;
|
|
11949
|
-
const
|
|
11950
|
-
|
|
11943
|
+
const D = s.getX(M), P = s.getY(M), F = s.getZ(M);
|
|
11944
|
+
D < y && (y = D), D > T && (T = D), P < x && (x = P), P > S && (S = P), F < w && (w = F), F > R && (R = F);
|
|
11951
11945
|
}
|
|
11952
11946
|
}
|
|
11953
11947
|
return h[l + 0] !== y || h[l + 1] !== x || h[l + 2] !== w || h[l + 3] !== T || h[l + 4] !== S || h[l + 5] !== R ? (h[l + 0] = y, h[l + 1] = x, h[l + 2] = w, h[l + 3] = T, h[l + 4] = S, h[l + 5] = R, !0) : !1;
|
|
@@ -11956,14 +11950,14 @@ function lh(o, e = null) {
|
|
|
11956
11950
|
let w = m, T = !1, S = !1;
|
|
11957
11951
|
e ? w || (T = e.has(y), S = e.has(x), w = !T && !S) : (T = !0, S = !0);
|
|
11958
11952
|
const R = w || T, C = w || S;
|
|
11959
|
-
let
|
|
11960
|
-
R && (
|
|
11953
|
+
let L = !1;
|
|
11954
|
+
R && (L = r(g, u, w));
|
|
11961
11955
|
let I = !1;
|
|
11962
11956
|
C && (I = r(v, u, w));
|
|
11963
|
-
const A =
|
|
11957
|
+
const A = L || I;
|
|
11964
11958
|
if (A)
|
|
11965
11959
|
for (let M = 0; M < 3; M++) {
|
|
11966
|
-
const
|
|
11960
|
+
const D = g + M, P = v + M, F = h[D], k = h[D + 3], H = h[P], G = h[P + 3];
|
|
11967
11961
|
h[l + M] = F < H ? F : H, h[l + M + 3] = k > G ? k : G;
|
|
11968
11962
|
}
|
|
11969
11963
|
return A;
|
|
@@ -11977,7 +11971,7 @@ function Bs(o, e, t, i, s, a, n) {
|
|
|
11977
11971
|
const { float32Array: c, uint16Array: h, uint32Array: f } = j, d = o * 2;
|
|
11978
11972
|
if (le(d, h)) {
|
|
11979
11973
|
const l = fe(o, f), u = ge(d, h);
|
|
11980
|
-
|
|
11974
|
+
Zc(e, t, i, l, u, s, a, n);
|
|
11981
11975
|
} else {
|
|
11982
11976
|
const l = ve(o);
|
|
11983
11977
|
et(l, c, i, a, n) && Bs(l, e, t, i, s, a, n);
|
|
@@ -11996,7 +11990,7 @@ function Os(o, e, t, i, s, a) {
|
|
|
11996
11990
|
let f = o * 2;
|
|
11997
11991
|
if (le(f, c)) {
|
|
11998
11992
|
const r = fe(o, h), l = ge(f, c);
|
|
11999
|
-
return
|
|
11993
|
+
return Xc(e, t, i, r, l, s, a);
|
|
12000
11994
|
} else {
|
|
12001
11995
|
const r = On(o, h), l = hh[r], m = i.direction[l] >= 0;
|
|
12002
11996
|
let _, p;
|
|
@@ -12026,7 +12020,7 @@ function zs(o, e, t, i, s = null) {
|
|
|
12026
12020
|
if (s === null && (t.boundingBox || t.computeBoundingBox(), Jr.set(t.boundingBox.min, t.boundingBox.max, i), s = Jr), le(h, n)) {
|
|
12027
12021
|
const d = e.geometry, r = d.index, l = d.attributes.position, u = t.index, m = t.attributes.position, _ = fe(o, c), p = ge(h, n);
|
|
12028
12022
|
if (Qt.copy(i).invert(), t.boundsTree)
|
|
12029
|
-
return
|
|
12023
|
+
return Z(o, a, Ii), Ii.matrix.copy(Qt), Ii.needsUpdate = !0, t.boundsTree.shapecast({
|
|
12030
12024
|
intersectsBounds: (v) => Ii.intersectsBox(v),
|
|
12031
12025
|
intersectsTriangle: (v) => {
|
|
12032
12026
|
v.a.applyMatrix4(i), v.b.applyMatrix4(i), v.c.applyMatrix4(i), v.needsUpdate = !0;
|
|
@@ -12045,7 +12039,7 @@ function zs(o, e, t, i, s = null) {
|
|
|
12045
12039
|
}
|
|
12046
12040
|
} else {
|
|
12047
12041
|
const d = o + 8, r = c[o + 6];
|
|
12048
|
-
return
|
|
12042
|
+
return Z(d, a, Ci), !!(s.intersectsBox(Ci) && zs(d, e, t, i, s) || (Z(r, a, Ci), s.intersectsBox(Ci) && zs(r, e, t, i, s)));
|
|
12049
12043
|
}
|
|
12050
12044
|
}
|
|
12051
12045
|
const Ri = /* @__PURE__ */ new $(), ms = /* @__PURE__ */ new ne(), Yt = /* @__PURE__ */ new ne(), dh = /* @__PURE__ */ new b(), ph = /* @__PURE__ */ new b(), mh = /* @__PURE__ */ new b(), gh = /* @__PURE__ */ new b();
|
|
@@ -12064,16 +12058,16 @@ function vh(o, e, t, i = {}, s = {}, a = 0, n = 1 / 0) {
|
|
|
12064
12058
|
const S = e.boundsTree;
|
|
12065
12059
|
return S.shapecast({
|
|
12066
12060
|
boundsTraverseOrder: (R) => Yt.distanceToBox(R),
|
|
12067
|
-
intersectsBounds: (R, C,
|
|
12061
|
+
intersectsBounds: (R, C, L) => L < v && L < n,
|
|
12068
12062
|
intersectsRange: (R, C) => {
|
|
12069
|
-
for (let
|
|
12070
|
-
const A = S.resolveTriangleIndex(
|
|
12063
|
+
for (let L = R, I = R + C; L < I; L++) {
|
|
12064
|
+
const A = S.resolveTriangleIndex(L);
|
|
12071
12065
|
ee(u, 3 * A, r, d), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
12072
|
-
for (let M = w,
|
|
12066
|
+
for (let M = w, D = w + T; M < D; M++) {
|
|
12073
12067
|
const P = o.resolveTriangleIndex(M);
|
|
12074
12068
|
ee(l, 3 * P, f, h), l.needsUpdate = !0;
|
|
12075
12069
|
const F = l.distanceToTriangle(u, m, p);
|
|
12076
|
-
if (F < v && (_.copy(m), g && g.copy(p), v = F, y = M, x =
|
|
12070
|
+
if (F < v && (_.copy(m), g && g.copy(p), v = F, y = M, x = L), F < a)
|
|
12077
12071
|
return !0;
|
|
12078
12072
|
}
|
|
12079
12073
|
}
|
|
@@ -12083,11 +12077,11 @@ function vh(o, e, t, i = {}, s = {}, a = 0, n = 1 / 0) {
|
|
|
12083
12077
|
const S = Bt(e);
|
|
12084
12078
|
for (let R = 0, C = S; R < C; R++) {
|
|
12085
12079
|
ee(u, 3 * R, r, d), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
12086
|
-
for (let
|
|
12087
|
-
const A = o.resolveTriangleIndex(
|
|
12080
|
+
for (let L = w, I = w + T; L < I; L++) {
|
|
12081
|
+
const A = o.resolveTriangleIndex(L);
|
|
12088
12082
|
ee(l, 3 * A, f, h), l.needsUpdate = !0;
|
|
12089
12083
|
const M = l.distanceToTriangle(u, m, p);
|
|
12090
|
-
if (M < v && (_.copy(m), g && g.copy(p), v = M, y =
|
|
12084
|
+
if (M < v && (_.copy(m), g && g.copy(p), v = M, y = L, x = R), M < a)
|
|
12091
12085
|
return !0;
|
|
12092
12086
|
}
|
|
12093
12087
|
}
|
|
@@ -12099,7 +12093,7 @@ function vh(o, e, t, i = {}, s = {}, a = 0, n = 1 / 0) {
|
|
|
12099
12093
|
function _h() {
|
|
12100
12094
|
return typeof SharedArrayBuffer < "u";
|
|
12101
12095
|
}
|
|
12102
|
-
const ti = new j.constructor(), Hi = new j.constructor(), Ye = new
|
|
12096
|
+
const ti = new j.constructor(), Hi = new j.constructor(), Ye = new Zs(() => new Q()), bt = new Q(), At = new Q(), gs = new Q(), vs = new Q();
|
|
12103
12097
|
let _s = !1;
|
|
12104
12098
|
function yh(o, e, t, i) {
|
|
12105
12099
|
if (_s)
|
|
@@ -12111,7 +12105,7 @@ function yh(o, e, t, i) {
|
|
|
12111
12105
|
for (let d = 0, r = s.length; d < r; d++) {
|
|
12112
12106
|
ti.setBuffer(s[d]), h = 0;
|
|
12113
12107
|
const l = Ye.getPrimitive();
|
|
12114
|
-
|
|
12108
|
+
Z(0, ti.float32Array, l), l.applyMatrix4(f);
|
|
12115
12109
|
for (let u = 0, m = a.length; u < m && (Hi.setBuffer(a[d]), n = be(
|
|
12116
12110
|
0,
|
|
12117
12111
|
0,
|
|
@@ -12157,9 +12151,9 @@ function be(o, e, t, i, s, a = 0, n = 0, c = 0, h = 0, f = null, d = !1) {
|
|
|
12157
12151
|
);
|
|
12158
12152
|
else if (T) {
|
|
12159
12153
|
const R = Ye.getPrimitive();
|
|
12160
|
-
|
|
12161
|
-
const C = ve(o),
|
|
12162
|
-
|
|
12154
|
+
Z(e, p, R), R.applyMatrix4(t);
|
|
12155
|
+
const C = ve(o), L = _e(o, m);
|
|
12156
|
+
Z(C, u, bt), Z(L, u, At);
|
|
12163
12157
|
const I = R.intersectsBox(bt), A = R.intersectsBox(At);
|
|
12164
12158
|
S = I && be(
|
|
12165
12159
|
e,
|
|
@@ -12175,7 +12169,7 @@ function be(o, e, t, i, s, a = 0, n = 0, c = 0, h = 0, f = null, d = !1) {
|
|
|
12175
12169
|
!d
|
|
12176
12170
|
) || A && be(
|
|
12177
12171
|
e,
|
|
12178
|
-
|
|
12172
|
+
L,
|
|
12179
12173
|
i,
|
|
12180
12174
|
t,
|
|
12181
12175
|
s,
|
|
@@ -12188,9 +12182,9 @@ function be(o, e, t, i, s, a = 0, n = 0, c = 0, h = 0, f = null, d = !1) {
|
|
|
12188
12182
|
), Ye.releasePrimitive(R);
|
|
12189
12183
|
} else {
|
|
12190
12184
|
const R = ve(e), C = _e(e, g);
|
|
12191
|
-
|
|
12192
|
-
const
|
|
12193
|
-
if (
|
|
12185
|
+
Z(R, p, gs), Z(C, p, vs);
|
|
12186
|
+
const L = f.intersectsBox(gs), I = f.intersectsBox(vs);
|
|
12187
|
+
if (L && I)
|
|
12194
12188
|
S = be(
|
|
12195
12189
|
o,
|
|
12196
12190
|
R,
|
|
@@ -12216,7 +12210,7 @@ function be(o, e, t, i, s, a = 0, n = 0, c = 0, h = 0, f = null, d = !1) {
|
|
|
12216
12210
|
f,
|
|
12217
12211
|
d
|
|
12218
12212
|
);
|
|
12219
|
-
else if (
|
|
12213
|
+
else if (L)
|
|
12220
12214
|
if (w)
|
|
12221
12215
|
S = be(
|
|
12222
12216
|
o,
|
|
@@ -12234,8 +12228,8 @@ function be(o, e, t, i, s, a = 0, n = 0, c = 0, h = 0, f = null, d = !1) {
|
|
|
12234
12228
|
else {
|
|
12235
12229
|
const A = Ye.getPrimitive();
|
|
12236
12230
|
A.copy(gs).applyMatrix4(t);
|
|
12237
|
-
const M = ve(o),
|
|
12238
|
-
|
|
12231
|
+
const M = ve(o), D = _e(o, m);
|
|
12232
|
+
Z(M, u, bt), Z(D, u, At);
|
|
12239
12233
|
const P = A.intersectsBox(bt), F = A.intersectsBox(At);
|
|
12240
12234
|
S = P && be(
|
|
12241
12235
|
R,
|
|
@@ -12251,7 +12245,7 @@ function be(o, e, t, i, s, a = 0, n = 0, c = 0, h = 0, f = null, d = !1) {
|
|
|
12251
12245
|
!d
|
|
12252
12246
|
) || F && be(
|
|
12253
12247
|
R,
|
|
12254
|
-
|
|
12248
|
+
D,
|
|
12255
12249
|
i,
|
|
12256
12250
|
t,
|
|
12257
12251
|
s,
|
|
@@ -12281,8 +12275,8 @@ function be(o, e, t, i, s, a = 0, n = 0, c = 0, h = 0, f = null, d = !1) {
|
|
|
12281
12275
|
else {
|
|
12282
12276
|
const A = Ye.getPrimitive();
|
|
12283
12277
|
A.copy(vs).applyMatrix4(t);
|
|
12284
|
-
const M = ve(o),
|
|
12285
|
-
|
|
12278
|
+
const M = ve(o), D = _e(o, m);
|
|
12279
|
+
Z(M, u, bt), Z(D, u, At);
|
|
12286
12280
|
const P = A.intersectsBox(bt), F = A.intersectsBox(At);
|
|
12287
12281
|
S = P && be(
|
|
12288
12282
|
C,
|
|
@@ -12298,7 +12292,7 @@ function be(o, e, t, i, s, a = 0, n = 0, c = 0, h = 0, f = null, d = !1) {
|
|
|
12298
12292
|
!d
|
|
12299
12293
|
) || F && be(
|
|
12300
12294
|
C,
|
|
12301
|
-
|
|
12295
|
+
D,
|
|
12302
12296
|
i,
|
|
12303
12297
|
t,
|
|
12304
12298
|
s,
|
|
@@ -12313,7 +12307,7 @@ function be(o, e, t, i, s, a = 0, n = 0, c = 0, h = 0, f = null, d = !1) {
|
|
|
12313
12307
|
}
|
|
12314
12308
|
return S;
|
|
12315
12309
|
}
|
|
12316
|
-
const
|
|
12310
|
+
const Di = /* @__PURE__ */ new ne(), $r = /* @__PURE__ */ new Q(), xh = {
|
|
12317
12311
|
strategy: Fn,
|
|
12318
12312
|
maxDepth: 40,
|
|
12319
12313
|
maxLeafTris: 10,
|
|
@@ -12323,7 +12317,7 @@ const Li = /* @__PURE__ */ new ne(), $r = /* @__PURE__ */ new Q(), xh = {
|
|
|
12323
12317
|
indirect: !1,
|
|
12324
12318
|
verbose: !0
|
|
12325
12319
|
};
|
|
12326
|
-
class
|
|
12320
|
+
class Xs {
|
|
12327
12321
|
static serialize(e, t = {}) {
|
|
12328
12322
|
t = {
|
|
12329
12323
|
cloneBuffers: !0,
|
|
@@ -12347,7 +12341,7 @@ class Zs {
|
|
|
12347
12341
|
indirect: !!e.indirectBuffer,
|
|
12348
12342
|
...i
|
|
12349
12343
|
};
|
|
12350
|
-
const { index: s, roots: a, indirectBuffer: n } = e, c = new
|
|
12344
|
+
const { index: s, roots: a, indirectBuffer: n } = e, c = new Xs(t, { ...i, [cs]: !0 });
|
|
12351
12345
|
if (c._roots = a, c._indirectBuffer = n || null, i.setIndex) {
|
|
12352
12346
|
const h = t.getIndex();
|
|
12353
12347
|
if (h === null) {
|
|
@@ -12466,7 +12460,7 @@ class Zs {
|
|
|
12466
12460
|
const m = (_, p, g, v, y, x, w, T) => {
|
|
12467
12461
|
for (let S = g, R = g + v; S < R; S++) {
|
|
12468
12462
|
u(S), d.a.applyMatrix4(t), d.b.applyMatrix4(t), d.c.applyMatrix4(t), d.needsUpdate = !0;
|
|
12469
|
-
for (let C = _,
|
|
12463
|
+
for (let C = _, L = _ + p; C < L; C++)
|
|
12470
12464
|
if (f(C), n.needsUpdate = !0, a(n, d, C, S, y, x, w, T))
|
|
12471
12465
|
return !0;
|
|
12472
12466
|
}
|
|
@@ -12484,10 +12478,10 @@ class Zs {
|
|
|
12484
12478
|
}
|
|
12485
12479
|
/* Derived Cast Functions */
|
|
12486
12480
|
intersectsBox(e, t) {
|
|
12487
|
-
return
|
|
12481
|
+
return Di.set(e.min, e.max, t), Di.needsUpdate = !0, this.shapecast(
|
|
12488
12482
|
{
|
|
12489
|
-
intersectsBounds: (i) =>
|
|
12490
|
-
intersectsTriangle: (i) =>
|
|
12483
|
+
intersectsBounds: (i) => Di.intersectsBox(i),
|
|
12484
|
+
intersectsTriangle: (i) => Di.intersectsTriangle(i)
|
|
12491
12485
|
}
|
|
12492
12486
|
);
|
|
12493
12487
|
}
|
|
@@ -12521,7 +12515,7 @@ class Zs {
|
|
|
12521
12515
|
}
|
|
12522
12516
|
getBoundingBox(e) {
|
|
12523
12517
|
return e.makeEmpty(), this._roots.forEach((i) => {
|
|
12524
|
-
|
|
12518
|
+
Z(0, new Float32Array(i), $r), e.union($r);
|
|
12525
12519
|
}), e;
|
|
12526
12520
|
}
|
|
12527
12521
|
}
|
|
@@ -12564,7 +12558,7 @@ class bh extends wh {
|
|
|
12564
12558
|
if (d.error)
|
|
12565
12559
|
a(new Error(d.error)), e.onmessage = null;
|
|
12566
12560
|
else if (d.serialized) {
|
|
12567
|
-
const { serialized: r, position: l } = d, u =
|
|
12561
|
+
const { serialized: r, position: l } = d, u = Xs.deserialize(r, t, { setIndex: !1 }), m = Object.assign({
|
|
12568
12562
|
setBoundingBox: !0
|
|
12569
12563
|
}, i);
|
|
12570
12564
|
if (t.attributes.position.array = l, r.index)
|
|
@@ -12827,7 +12821,7 @@ class Th {
|
|
|
12827
12821
|
opacity: 1
|
|
12828
12822
|
});
|
|
12829
12823
|
const p = new Oi(c, c);
|
|
12830
|
-
this.isZUp || p.rotateX(-Math.PI / 2), this.shadowCatcherMesh = new
|
|
12824
|
+
this.isZUp || p.rotateX(-Math.PI / 2), this.shadowCatcherMesh = new X(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 me(), this.targetMat = new ao({ fog: !1 }), this.previousShadowMap = { value: this.progressiveLightMap1.texture }, this.averagingWindow = { value: h }, this.targetMat.onBeforeCompile = (g) => {
|
|
12831
12825
|
g.vertexShader = `varying vec2 vUv;
|
|
12832
12826
|
` + g.vertexShader.slice(0, -1) + "vUv = uv; gl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }";
|
|
12833
12827
|
const v = g.fragmentShader.indexOf("void main() {");
|
|
@@ -12908,7 +12902,7 @@ vec3 texelOld = texture2D(previousShadowMap, vUv).rgb;
|
|
|
12908
12902
|
*/
|
|
12909
12903
|
showDebugHelpers(e) {
|
|
12910
12904
|
if (!this.debugHelpersGroup.children.length) {
|
|
12911
|
-
const t = new
|
|
12905
|
+
const t = new X(
|
|
12912
12906
|
new Oi(2, 2),
|
|
12913
12907
|
new ri({
|
|
12914
12908
|
map: this.progressiveLightMap1.texture,
|
|
@@ -13312,7 +13306,7 @@ class Rh extends B.ShaderMaterial {
|
|
|
13312
13306
|
});
|
|
13313
13307
|
}
|
|
13314
13308
|
}
|
|
13315
|
-
class
|
|
13309
|
+
class Dh extends B.ShaderMaterial {
|
|
13316
13310
|
get source() {
|
|
13317
13311
|
return this.uniforms.source.value;
|
|
13318
13312
|
}
|
|
@@ -13404,7 +13398,7 @@ class Lh extends B.ShaderMaterial {
|
|
|
13404
13398
|
});
|
|
13405
13399
|
}
|
|
13406
13400
|
}
|
|
13407
|
-
class
|
|
13401
|
+
class Lh {
|
|
13408
13402
|
constructor(e, t, i, s) {
|
|
13409
13403
|
this.params = {
|
|
13410
13404
|
inside: !1,
|
|
@@ -13443,7 +13437,7 @@ class Dh {
|
|
|
13443
13437
|
wrapS: B.ClampToEdgeWrapping,
|
|
13444
13438
|
wrapT: B.ClampToEdgeWrapping
|
|
13445
13439
|
})
|
|
13446
|
-
], this.effectQuad = new ci(new Rh()), this.jfaQuad = new ci(new
|
|
13440
|
+
], this.effectQuad = new ci(new Rh()), this.jfaQuad = new ci(new Dh()), this.seedQuad = new ci(this.seedMaterial), this.expandQuad = new ci(new Ih()), this.setSize(window.innerWidth, window.innerHeight);
|
|
13447
13441
|
}
|
|
13448
13442
|
setSize(e, t) {
|
|
13449
13443
|
const i = this.renderer.getPixelRatio(), s = Math.floor(e * i), a = Math.floor(t * i);
|
|
@@ -13462,11 +13456,11 @@ class Dh {
|
|
|
13462
13456
|
R.length > 0 && (n = !0, this._box.makeEmpty(), R.forEach((C) => {
|
|
13463
13457
|
if (C)
|
|
13464
13458
|
try {
|
|
13465
|
-
this._box.expandByObject(C), C.traverse((
|
|
13466
|
-
|
|
13459
|
+
this._box.expandByObject(C), C.traverse((L) => {
|
|
13460
|
+
L.layers.enable(this._selectionLayer);
|
|
13467
13461
|
});
|
|
13468
|
-
} catch (
|
|
13469
|
-
console.log("eee",
|
|
13462
|
+
} catch (L) {
|
|
13463
|
+
console.log("eee", L);
|
|
13470
13464
|
}
|
|
13471
13465
|
}), this._box.getBoundingSphere(this._sphere), s.layers.set(this._selectionLayer));
|
|
13472
13466
|
} else
|
|
@@ -13496,13 +13490,13 @@ class Dh {
|
|
|
13496
13490
|
w.map = this.targets[0].texture;
|
|
13497
13491
|
const T = this.targets[0].texture.minFilter, S = this.targets[0].texture.magFilter;
|
|
13498
13492
|
this.targets[0].texture.minFilter = B.LinearFilter, this.targets[0].texture.magFilter = B.LinearFilter, this.targets[0].texture.needsUpdate = !0, w.mask = this.masks[1].texture, w.thickness = a.thickness, w.inside = a.inside, w.color.set(a.color), w.transparent = !0, w.blending = B.NormalBlending, w.depthTest = !1, w.depthWrite = !1, this.effectQuad.render(t), this.targets[0].texture.minFilter = T, this.targets[0].texture.magFilter = S, this.targets[0].texture.needsUpdate = !0, t.autoClear = x, t.setScissorTest(!1), n && e && ((Array.isArray(e) ? e : [e]).forEach((C) => {
|
|
13499
|
-
C && C.traverse((
|
|
13500
|
-
|
|
13493
|
+
C && C.traverse((L) => {
|
|
13494
|
+
L.layers.disable(this._selectionLayer);
|
|
13501
13495
|
});
|
|
13502
13496
|
}), s.layers.mask = c);
|
|
13503
13497
|
}
|
|
13504
13498
|
}
|
|
13505
|
-
class Ph extends
|
|
13499
|
+
class Ph extends X {
|
|
13506
13500
|
constructor(e = 200, t = 20, i = 0.8) {
|
|
13507
13501
|
const s = new Oi(e, e), a = new Ft({
|
|
13508
13502
|
side: ni,
|
|
@@ -13571,12 +13565,12 @@ class tn {
|
|
|
13571
13565
|
t && (this.color = this._defaults.color = "#" + ((i = t.color) == null ? void 0 : i.getHexString()), this.metalness = this._defaults.metalness = t.metalness ?? 0, this.roughness = this._defaults.roughness = t.roughness ?? 1, this.envMapIntensity = this._defaults.envMapIntensity = t.envMapIntensity ?? 1);
|
|
13572
13566
|
}
|
|
13573
13567
|
get material() {
|
|
13574
|
-
if (this._props.target instanceof
|
|
13568
|
+
if (this._props.target instanceof Li)
|
|
13575
13569
|
return this._props.target;
|
|
13576
|
-
if (this._props.target instanceof
|
|
13570
|
+
if (this._props.target instanceof X) {
|
|
13577
13571
|
if (Array.isArray(this._props.target.material))
|
|
13578
|
-
return this._props.target.material.find((e) => e instanceof
|
|
13579
|
-
if (this._props.target.material instanceof
|
|
13572
|
+
return this._props.target.material.find((e) => e instanceof Li);
|
|
13573
|
+
if (this._props.target.material instanceof Li)
|
|
13580
13574
|
return this._props.target.material;
|
|
13581
13575
|
}
|
|
13582
13576
|
}
|
|
@@ -13619,7 +13613,7 @@ class Ru {
|
|
|
13619
13613
|
-this.d,
|
|
13620
13614
|
0.1,
|
|
13621
13615
|
1e3
|
|
13622
|
-
), this._axisMoving = !1, this._container = new me(), this._raycaster = new fo(), 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 kt(), this.sound = new
|
|
13616
|
+
), this._axisMoving = !1, this._container = new me(), this._raycaster = new fo(), 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 kt(), this.sound = new Zl(), this._rafId = null, this._destroyed = !1, this._css2dUiStyleInjected = !1, this._ground = new X(
|
|
13623
13617
|
new Oi(100, 100),
|
|
13624
13618
|
new po({
|
|
13625
13619
|
color: new J("#eee"),
|
|
@@ -13702,7 +13696,7 @@ class Ru {
|
|
|
13702
13696
|
if (c.forEach((W) => {
|
|
13703
13697
|
W.traverse((K) => {
|
|
13704
13698
|
if (K.visible) {
|
|
13705
|
-
if (K instanceof
|
|
13699
|
+
if (K instanceof X) {
|
|
13706
13700
|
p(K);
|
|
13707
13701
|
return;
|
|
13708
13702
|
}
|
|
@@ -13731,17 +13725,17 @@ class Ru {
|
|
|
13731
13725
|
], S = new b(0, 1, 0);
|
|
13732
13726
|
Math.abs(x.dot(S)) > 0.99 && S.set(0, 0, 1);
|
|
13733
13727
|
const R = new b().crossVectors(x, S).normalize(), C = new b().crossVectors(R, x).normalize();
|
|
13734
|
-
let
|
|
13728
|
+
let L = 0;
|
|
13735
13729
|
T.forEach((W) => {
|
|
13736
13730
|
const K = W.dot(R), pe = W.dot(C), ce = Math.sqrt(K * K + pe * pe);
|
|
13737
|
-
|
|
13738
|
-
}),
|
|
13739
|
-
const I = this.camera.fov * Math.PI / 180, A = 2 * Math.atan(Math.tan(I / 2) * this.camera.aspect), M =
|
|
13731
|
+
L = Math.max(L, ce);
|
|
13732
|
+
}), L = L / 2 + 0.4;
|
|
13733
|
+
const I = this.camera.fov * Math.PI / 180, A = 2 * Math.atan(Math.tan(I / 2) * this.camera.aspect), M = L / Math.tan(A / 2), D = L / Math.tan(I / 2), P = Math.max(M, D), F = g.clone().add(x.multiplyScalar(P)), k = this.camera.position.clone(), H = this.controls.target.clone();
|
|
13740
13734
|
let G = 500;
|
|
13741
13735
|
const N = k.distanceTo(F) + H.distanceTo(y);
|
|
13742
13736
|
N > 1e-3 && (G = Math.min(1e3, Math.max(450, N * 45))), this._animateCamera(k, F, H, y, G);
|
|
13743
13737
|
}, this.focusSlots = (c) => {
|
|
13744
|
-
var C,
|
|
13738
|
+
var C, L;
|
|
13745
13739
|
if (this.amr.slots.forEach((I) => {
|
|
13746
13740
|
I.focused = !1, I.hide();
|
|
13747
13741
|
}), !c.length)
|
|
@@ -13750,10 +13744,10 @@ class Ru {
|
|
|
13750
13744
|
}), this.shadowMode = !1, this._focusRestoreView) {
|
|
13751
13745
|
const I = this._focusRestoreView;
|
|
13752
13746
|
this._focusRestoreView = void 0;
|
|
13753
|
-
const A = this.camera.position.clone(), M = this.controls.target.clone(),
|
|
13747
|
+
const A = this.camera.position.clone(), M = this.controls.target.clone(), D = I.position.clone(), P = I.target.clone();
|
|
13754
13748
|
let F = 500;
|
|
13755
|
-
const k = A.distanceTo(
|
|
13756
|
-
k > 1e-3 && (F = Math.min(1e3, Math.max(450, k * 45))), this._animateCamera(A,
|
|
13749
|
+
const k = A.distanceTo(D) + M.distanceTo(P);
|
|
13750
|
+
k > 1e-3 && (F = Math.min(1e3, Math.max(450, k * 45))), this._animateCamera(A, D, M, P, F, () => {
|
|
13757
13751
|
this.camera.up.copy(I.up);
|
|
13758
13752
|
});
|
|
13759
13753
|
return;
|
|
@@ -13765,7 +13759,7 @@ class Ru {
|
|
|
13765
13759
|
position: this.camera.position.clone(),
|
|
13766
13760
|
target: new b(0, 0, this.controls.target.z),
|
|
13767
13761
|
up: this.camera.up.clone()
|
|
13768
|
-
}), (
|
|
13762
|
+
}), (L = this._fitAnimation) == null || L.stop(), this.shadowMode = !0;
|
|
13769
13763
|
const h = c.flatMap((I) => {
|
|
13770
13764
|
if (I.show(), I.focused = !0, !I.parent)
|
|
13771
13765
|
return [];
|
|
@@ -13777,14 +13771,14 @@ class Ru {
|
|
|
13777
13771
|
const f = h.reduce((I, A) => I.add(A), new b()).multiplyScalar(1 / h.length), d = this.controls.target.clone(), r = this.camera.position.clone().sub(d).normalize();
|
|
13778
13772
|
let l = 0;
|
|
13779
13773
|
for (const I of h) {
|
|
13780
|
-
const A = I.clone().sub(f), M = A.dot(r),
|
|
13781
|
-
|
|
13774
|
+
const A = I.clone().sub(f), M = A.dot(r), D = Math.sqrt(Math.max(0, A.lengthSq() - M * M));
|
|
13775
|
+
D > l && (l = D);
|
|
13782
13776
|
}
|
|
13783
13777
|
l = l + 0.4;
|
|
13784
13778
|
const u = this.camera.fov * Math.PI / 180, m = 2 * Math.atan(Math.tan(u / 2) * this.camera.aspect), _ = l / Math.tan(m / 2), p = l / Math.tan(u / 2), g = Math.max(_, p), v = f.clone(), y = f.clone().add(r.clone().multiplyScalar(g < 1 ? 1 : g)), x = this.camera.position.clone(), w = d.clone(), T = { t: 0 };
|
|
13785
13779
|
let S = 500;
|
|
13786
13780
|
const R = x.distanceTo(y) + w.distanceTo(v);
|
|
13787
|
-
R > 1e-3 && (S = Math.min(1e3, Math.max(450, R * 45))), this._lastTarget = v.clone(), this._fitAnimation = new zi(T).to({ t: 1 }, S).easing(
|
|
13781
|
+
R > 1e-3 && (S = Math.min(1e3, Math.max(450, R * 45))), this._lastTarget = v.clone(), this._fitAnimation = new zi(T).to({ t: 1 }, S).easing(Ze.Easing.Quadratic.InOut).onStart(() => {
|
|
13788
13782
|
this.controls.enabled = !1;
|
|
13789
13783
|
}).onUpdate(() => {
|
|
13790
13784
|
const I = T.t;
|
|
@@ -13810,8 +13804,8 @@ class Ru {
|
|
|
13810
13804
|
];
|
|
13811
13805
|
let _ = 0;
|
|
13812
13806
|
for (const A of m) {
|
|
13813
|
-
const M = A.dot(l),
|
|
13814
|
-
|
|
13807
|
+
const M = A.dot(l), D = Math.sqrt(Math.max(0, A.lengthSq() - M * M));
|
|
13808
|
+
D > _ && (_ = D);
|
|
13815
13809
|
}
|
|
13816
13810
|
_ = _ * 1.05;
|
|
13817
13811
|
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 = f.clone();
|
|
@@ -13820,9 +13814,9 @@ class Ru {
|
|
|
13820
13814
|
const S = r.clone().normalize().multiplyScalar(x < 1 ? 1 : x).add(w);
|
|
13821
13815
|
Math.max(h.x * 2, 5);
|
|
13822
13816
|
const R = this.camera.position.clone(), C = this.controls.target.clone();
|
|
13823
|
-
let
|
|
13817
|
+
let L = 600;
|
|
13824
13818
|
const I = R.distanceTo(S) + C.distanceTo(d);
|
|
13825
|
-
I > 1e-3 && (
|
|
13819
|
+
I > 1e-3 && (L = Math.min(800, Math.max(650, I * 45))), this._animateCamera(R, S, C, d, L, () => {
|
|
13826
13820
|
this.shadowMode || (this._progressShadow.visible = !0, this._progressShadow.isFinished || this._progressShadow.recalculate());
|
|
13827
13821
|
}), this.controls.minDistance = Math.max(0.2, Math.min(x * 0.25, x - 0.1)), this.controls.maxDistance = x * 4;
|
|
13828
13822
|
}, this.resize = () => {
|
|
@@ -13846,7 +13840,7 @@ class Ru {
|
|
|
13846
13840
|
const f = this.stats.fps();
|
|
13847
13841
|
if (this.usePathTracing || (this._fpsCache.length > this._fpsCacheMax && this._fpsCache.shift(), this._fpsCache.push(f)), this.amr.slots.forEach((d) => {
|
|
13848
13842
|
this._dragging ? d.getCanInstall() && d.render(this) : d.render(this);
|
|
13849
|
-
}),
|
|
13843
|
+
}), Ze.update(), this.controls.update(), this._progressShadow.update(this.mainCamera), this.css2dRenderer.render(this.scene, this.mainCamera), this.updatePosition(), this.scene.overrideMaterial = null, this.renderer.render(this.scene, this.mainCamera), this._jumpFlood && this._selectedForOutline.length > 0) {
|
|
13850
13844
|
const d = this.scene.background;
|
|
13851
13845
|
this.scene.background = null, this._jumpFlood.render(this._selectedForOutline), this.scene.background = d;
|
|
13852
13846
|
}
|
|
@@ -13873,7 +13867,7 @@ class Ru {
|
|
|
13873
13867
|
frames: e.isMobile ? 20 : 60,
|
|
13874
13868
|
lightRadius: 2,
|
|
13875
13869
|
ambientWeight: 0.75
|
|
13876
|
-
}), 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
|
|
13870
|
+
}), 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 Lh(this.renderer, this.scene, this.camera, {
|
|
13877
13871
|
thickness: 4,
|
|
13878
13872
|
color: "#fff"
|
|
13879
13873
|
}), (typeof e.useAxisBall != "boolean" || e.useAxisBall) && (this._controlsGizmo = new Ah(this.controls, {
|
|
@@ -14047,7 +14041,7 @@ class Ru {
|
|
|
14047
14041
|
let n = s;
|
|
14048
14042
|
a.userData[`origin_${i}`] && (n -= a.userData[`origin_${i}`]);
|
|
14049
14043
|
const c = a.morphTargetDictionary[i];
|
|
14050
|
-
a.morphTargetInfluences && (a.morphTargetInfluences[c] = n), a instanceof
|
|
14044
|
+
a.morphTargetInfluences && (a.morphTargetInfluences[c] = n), a instanceof X && a.geometry.translate(0, 0, 1e-5);
|
|
14051
14045
|
}), [
|
|
14052
14046
|
"width",
|
|
14053
14047
|
"length",
|
|
@@ -14060,7 +14054,7 @@ class Ru {
|
|
|
14060
14054
|
_animateCamera(e, t, i, s, a, n) {
|
|
14061
14055
|
var h;
|
|
14062
14056
|
const c = { t: 0 };
|
|
14063
|
-
(h = this._fitAnimation) == null || h.stop(), this._fitAnimation = new zi(c).to({ t: 1 }, a).easing(
|
|
14057
|
+
(h = this._fitAnimation) == null || h.stop(), this._fitAnimation = new zi(c).to({ t: 1 }, a).easing(Ze.Easing.Quadratic.InOut).onStart(() => {
|
|
14064
14058
|
this.controls.enabled = !1;
|
|
14065
14059
|
}).onUpdate(() => {
|
|
14066
14060
|
const f = c.t;
|
|
@@ -14131,7 +14125,7 @@ class Ru {
|
|
|
14131
14125
|
}
|
|
14132
14126
|
destroy() {
|
|
14133
14127
|
var t, i, s, a, n, c;
|
|
14134
|
-
this._destroyed = !0, this._rafId !== null && (cancelAnimationFrame(this._rafId), this._rafId = null), this._clock.stop(), (t = this._controlsGizmo) == null || t.destroy(), this.amr.destroy(), this.amr.removeFromParent(), this._progressShadow.destroy(), (i = this._sciFiGrid) == null || i.removeFromParent(), (s = this._sciFiGrid) == null || s.geometry.dispose(), (a = this._sciFiGrid.material) == null || a.dispose(),
|
|
14128
|
+
this._destroyed = !0, this._rafId !== null && (cancelAnimationFrame(this._rafId), this._rafId = null), this._clock.stop(), (t = this._controlsGizmo) == null || t.destroy(), this.amr.destroy(), this.amr.removeFromParent(), this._progressShadow.destroy(), (i = this._sciFiGrid) == null || i.removeFromParent(), (s = this._sciFiGrid) == null || s.geometry.dispose(), (a = this._sciFiGrid.material) == null || a.dispose(), Ze.removeAll(), this.stats.dom.remove(), this._emitter.removeAllListeners(), (n = this._fitAnimation) == null || n.stop(), window.removeEventListener("drag", this._drag), document.removeEventListener("wheel", this._detectTrackpad), window.removeEventListener("pointermove", this._pointermove), this.renderer.domElement.removeEventListener("pointerdown", this._pointerdown);
|
|
14135
14129
|
const e = this.renderer.domElement.parentElement;
|
|
14136
14130
|
e && ((c = this._resizeObserver) == null || c.unobserve(e)), this.controls.dispose(), this.renderer.domElement.remove(), this.renderer.dispose(), He(this.scene), this.scene.clear();
|
|
14137
14131
|
}
|
|
@@ -14226,21 +14220,21 @@ class Uh {
|
|
|
14226
14220
|
c.lengthSq() === 0 && c.set(0, 0, 1);
|
|
14227
14221
|
const h = t.up.clone().normalize();
|
|
14228
14222
|
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") {
|
|
14229
|
-
const x = this.perspectiveCamera, w = t.fov ?? 45, T = at.degToRad(w), S = Math.max(Math.tan(T / 2), 1e-4), R = Math.max(S * (i || 1), 1e-4), C = this.getPerspectiveDirection(t, e.size).normalize(),
|
|
14230
|
-
|
|
14231
|
-
const I = new b().crossVectors(
|
|
14232
|
-
new b(-A, -M, -
|
|
14233
|
-
new b(-A, -M,
|
|
14234
|
-
new b(-A, M, -
|
|
14235
|
-
new b(-A, M,
|
|
14236
|
-
new b(A, -M, -
|
|
14237
|
-
new b(A, -M,
|
|
14238
|
-
new b(A, M, -
|
|
14239
|
-
new b(A, M,
|
|
14223
|
+
const x = this.perspectiveCamera, w = t.fov ?? 45, T = at.degToRad(w), S = Math.max(Math.tan(T / 2), 1e-4), R = Math.max(S * (i || 1), 1e-4), C = this.getPerspectiveDirection(t, e.size).normalize(), L = new b().crossVectors(C, h).normalize();
|
|
14224
|
+
L.lengthSq() < 1e-6 && L.set(1, 0, 0);
|
|
14225
|
+
const I = new b().crossVectors(L, C).normalize(), A = Math.max(e.size.x * 0.5, 1e-4), M = Math.max(e.size.y * 0.5, 1e-4), D = Math.max(e.size.z * 0.5, 1e-4), P = [
|
|
14226
|
+
new b(-A, -M, -D),
|
|
14227
|
+
new b(-A, -M, D),
|
|
14228
|
+
new b(-A, M, -D),
|
|
14229
|
+
new b(-A, M, D),
|
|
14230
|
+
new b(A, -M, -D),
|
|
14231
|
+
new b(A, -M, D),
|
|
14232
|
+
new b(A, M, -D),
|
|
14233
|
+
new b(A, M, D)
|
|
14240
14234
|
];
|
|
14241
14235
|
let F = 0, k = -1 / 0;
|
|
14242
14236
|
for (const N of P) {
|
|
14243
|
-
const Y =
|
|
14237
|
+
const Y = L.dot(N), W = I.dot(N), K = C.dot(N);
|
|
14244
14238
|
k = Math.max(k, K);
|
|
14245
14239
|
const pe = K + Math.abs(Y) / R, ce = K + Math.abs(W) / S;
|
|
14246
14240
|
F = Math.max(F, pe, ce);
|
|
@@ -14324,7 +14318,7 @@ class Uh {
|
|
|
14324
14318
|
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;
|
|
14325
14319
|
}
|
|
14326
14320
|
}
|
|
14327
|
-
const Hh = "shop-components", Wh = "0.4.
|
|
14321
|
+
const Hh = "shop-components", Wh = "0.4.24", Vh = "Shop components", Nh = "dist/shop-components.umd.js", Gh = "dist/shop-components.mjs", qh = "dist/main.d.ts", jh = {
|
|
14328
14322
|
dts: "tsc --emitDeclarationOnly & tsc & storybook build -o dist",
|
|
14329
14323
|
dev: "vite dev",
|
|
14330
14324
|
build: "vite build",
|
|
@@ -14333,7 +14327,7 @@ const Hh = "shop-components", Wh = "0.4.23", Vh = "Shop components", Nh = "dist/
|
|
|
14333
14327
|
}, Qh = [
|
|
14334
14328
|
"dist",
|
|
14335
14329
|
"package.json"
|
|
14336
|
-
], Yh = [], Kh = "machengda<machengda@seer-group.com>",
|
|
14330
|
+
], Yh = [], Kh = "machengda<machengda@seer-group.com>", Zh = "ISC", Xh = {
|
|
14337
14331
|
"@needle-tools/gltf-progressive": "^3.3.5",
|
|
14338
14332
|
"auto-changelog": "^2.4.0",
|
|
14339
14333
|
vite: "5.1.6",
|
|
@@ -14366,8 +14360,8 @@ const Hh = "shop-components", Wh = "0.4.23", Vh = "Shop components", Nh = "dist/
|
|
|
14366
14360
|
files: Qh,
|
|
14367
14361
|
keywords: Yh,
|
|
14368
14362
|
author: Kh,
|
|
14369
|
-
license:
|
|
14370
|
-
devDependencies:
|
|
14363
|
+
license: Zh,
|
|
14364
|
+
devDependencies: Xh,
|
|
14371
14365
|
resolutions: Jh,
|
|
14372
14366
|
peerDependencies: $h,
|
|
14373
14367
|
dependencies: eu
|