shop-components 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/libs/sglb/index.d.ts +2 -0
- package/dist/dev/src/amr.d.ts +3 -0
- package/dist/shop-components.cjs +52 -52
- package/dist/shop-components.mjs +177 -170
- package/package.json +1 -1
package/dist/shop-components.mjs
CHANGED
|
@@ -10,7 +10,7 @@ var H = (o, e, t) => (rr(o, e, "read from private field"), t ? t.call(o) : e.get
|
|
|
10
10
|
e instanceof WeakSet ? e.add(o) : e.set(o, t);
|
|
11
11
|
}, Ie = (o, e, t, i) => (rr(o, e, "write to private field"), i ? i.call(o, t) : e.set(o, t), t);
|
|
12
12
|
import * as k from "three";
|
|
13
|
-
import { BufferAttribute as fe, BufferGeometry as le, Matrix4 as J, Matrix3 as un, Vector3 as b, Vector4 as it, MeshBasicMaterial as ni, Mesh as X, ShaderMaterial as kt, NoBlending as ri, WebGLRenderTarget as Be, FloatType as pe, RGBAFormat as te, NearestFilter as ee, Vector2 as z, PerspectiveCamera as
|
|
13
|
+
import { BufferAttribute as fe, BufferGeometry as le, Matrix4 as J, Matrix3 as un, Vector3 as b, Vector4 as it, MeshBasicMaterial as ni, Mesh as X, ShaderMaterial as kt, NoBlending as ri, WebGLRenderTarget as Be, FloatType as pe, RGBAFormat as te, NearestFilter as ee, Vector2 as z, PerspectiveCamera as Gi, DataUtils as ke, DataTexture as Oe, HalfFloatType as Se, LinearFilter as Te, RepeatWrapping as et, RedFormat as xs, ClampToEdgeWrapping as He, Source as jn, Quaternion as hn, DataArrayTexture as Qn, DoubleSide as oi, BackSide as fn, FrontSide as ws, Color as K, WebGLArrayRenderTarget as Yn, UnsignedByteType as Vs, NoToneMapping as Zn, RGFormat as Xn, NormalBlending as dn, Spherical as Kn, EquirectangularReflectionMapping as ki, LinearMipMapLinearFilter as Jn, Clock as qi, Scene as bs, AdditiveBlending as $n, Box3 as Y, Sphere as ji, CompressedTexture as eo, Texture as Qe, InterleavedBuffer as to, InterleavedBufferAttribute as io, TextureLoader as pn, MeshStandardMaterial as so, Group as ge, LineSegments as As, LineBasicMaterial as nr, Object3D as Bt, LineDashedMaterial as Ts, RingGeometry as or, BoxGeometry as ro, EdgesGeometry as no, SRGBColorSpace as Bi, AnimationMixer as ar, LoopOnce as oo, Plane as Ns, Line3 as ze, Triangle as Kt, MathUtils as Ye, DirectionalLight as ao, NoColorSpace as lr, PlaneGeometry as Oi, MeshLambertMaterial as lo, DirectionalLightHelper as co, PlaneHelper as uo, UniformsUtils as ho, WebGLRenderer as fo, OrthographicCamera as Ss, Raycaster as po, MeshPhysicalMaterial as mo, ACESFilmicToneMapping as go, Euler as vo } from "three";
|
|
14
14
|
import { HDRLoader as cr } from "three/examples/jsm/loaders/HDRLoader.js";
|
|
15
15
|
import { OrbitControls as _o } from "three/examples/jsm/controls/OrbitControls";
|
|
16
16
|
import { CSS2DObject as Ue, CSS2DRenderer as yo } from "three/examples/jsm/renderers/CSS2DRenderer";
|
|
@@ -22,14 +22,14 @@ import { GLTFLoader as Ao } from "three/examples/jsm/loaders/GLTFLoader";
|
|
|
22
22
|
import { DRACOLoader as To } from "three/examples/jsm/loaders/DRACOLoader";
|
|
23
23
|
import { DRACOExporter as So } from "three/examples/jsm/exporters/DRACOExporter";
|
|
24
24
|
import { GLTFExporter as Mo } from "three/examples/jsm/exporters/GLTFExporter";
|
|
25
|
-
import * as
|
|
25
|
+
import * as Ji from "three/examples/jsm/utils/SkeletonUtils.js";
|
|
26
26
|
import { Line2 as Co } from "three/examples/jsm/lines/Line2.js";
|
|
27
27
|
import { LineMaterial as Io } from "three/examples/jsm/lines/LineMaterial.js";
|
|
28
28
|
import { LineGeometry as ur } from "three/examples/jsm/lines/LineGeometry.js";
|
|
29
29
|
import { CSS3DObject as Ro } 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 Do, MeshBVH as Po, FloatVertexAttributeTexture as Eo, MeshBVHUniformStruct as Lo, UIntVertexAttributeTexture as Fo, BVHShaderGLSL as
|
|
32
|
+
import { SAH as Do, MeshBVH as Po, FloatVertexAttributeTexture as Eo, MeshBVHUniformStruct as Lo, UIntVertexAttributeTexture as Fo, BVHShaderGLSL as $i } from "three-mesh-bvh";
|
|
33
33
|
import { FullScreenQuad as Et } from "three/examples/jsm/postprocessing/Pass.js";
|
|
34
34
|
function mn(o, e, t = 0) {
|
|
35
35
|
if (o.isInterleavedBufferAttribute) {
|
|
@@ -222,7 +222,7 @@ class Vo {
|
|
|
222
222
|
return !(this.matrixWorld.equals(e.matrixWorld) && this.geometryHash === hr(t) && this.skeletonHash === fr(e) && this.primitiveCount === i);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
const rt = /* @__PURE__ */ new b(), nt = /* @__PURE__ */ new b(), ot = /* @__PURE__ */ new b(), dr = /* @__PURE__ */ new it(), ui = /* @__PURE__ */ new b(),
|
|
225
|
+
const rt = /* @__PURE__ */ new b(), nt = /* @__PURE__ */ new b(), ot = /* @__PURE__ */ new b(), dr = /* @__PURE__ */ new it(), ui = /* @__PURE__ */ new b(), es = /* @__PURE__ */ new b(), pr = /* @__PURE__ */ new it(), mr = /* @__PURE__ */ new it(), hi = /* @__PURE__ */ new J(), gr = /* @__PURE__ */ new J();
|
|
226
226
|
function vr(o, e, t) {
|
|
227
227
|
const i = o.skeleton, s = o.geometry, a = i.bones, n = i.boneInverses;
|
|
228
228
|
pr.fromBufferAttribute(s.attributes.skinIndex, e), mr.fromBufferAttribute(s.attributes.skinWeight, e), hi.elements.fill(0);
|
|
@@ -235,11 +235,11 @@ function vr(o, e, t) {
|
|
|
235
235
|
}
|
|
236
236
|
return hi.multiply(o.bindMatrix).premultiply(o.bindMatrixInverse), t.transformDirection(hi), t;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function ts(o, e, t, i, s) {
|
|
239
239
|
ui.set(0, 0, 0);
|
|
240
240
|
for (let a = 0, n = o.length; a < n; a++) {
|
|
241
241
|
const c = e[a], u = o[a];
|
|
242
|
-
c !== 0 && (
|
|
242
|
+
c !== 0 && (es.fromBufferAttribute(u, i), t ? ui.addScaledVector(es, c) : ui.addScaledVector(es.sub(s), c));
|
|
243
243
|
}
|
|
244
244
|
s.add(ui);
|
|
245
245
|
}
|
|
@@ -279,7 +279,7 @@ function qo(o, e = {}, t = new le()) {
|
|
|
279
279
|
const f = c.position, d = a ? c.normal : null, r = n ? c.tangent : null, l = i.morphAttributes.position, h = i.morphAttributes.normal, m = i.morphAttributes.tangent, v = i.morphTargetsRelative, p = o.morphTargetInfluences, g = new un();
|
|
280
280
|
g.getNormalMatrix(o.matrixWorld), i.index && t.index.array.set(i.index.array);
|
|
281
281
|
for (let _ = 0, y = c.position.count; _ < y; _++)
|
|
282
|
-
rt.fromBufferAttribute(f, _), d && nt.fromBufferAttribute(d, _), r && (dr.fromBufferAttribute(r, _), ot.fromBufferAttribute(r, _)), p && (l &&
|
|
282
|
+
rt.fromBufferAttribute(f, _), d && nt.fromBufferAttribute(d, _), r && (dr.fromBufferAttribute(r, _), ot.fromBufferAttribute(r, _)), p && (l && ts(l, p, v, _, rt), h && ts(h, p, v, _, nt), m && ts(m, p, v, _, ot)), o.isSkinnedMesh && (o.applyBoneTransform(_, rt), d && vr(o, _, nt), r && vr(o, _, ot)), s && rt.applyMatrix4(o.matrixWorld), u.position.setXYZ(_, rt.x, rt.y, rt.z), d && (s && nt.applyNormalMatrix(g), u.normal.setXYZ(_, nt.x, nt.y, nt.z)), r && (s && ot.transformDirection(o.matrixWorld), u.tangent.setXYZW(_, ot.x, ot.y, ot.z, dr.w));
|
|
283
283
|
for (const _ in e.attributes) {
|
|
284
284
|
const y = e.attributes[_];
|
|
285
285
|
y === "position" || y === "tangent" || y === "normal" || !(y in c) || (u[y] || t.setAttribute(y, Jt(c[y])), St(c[y], u[y]), mn(c[y], u[y]));
|
|
@@ -306,7 +306,7 @@ class jo extends le {
|
|
|
306
306
|
return i.didChange(e) ? (qo(e, t, this), i.updateFrom(e), this.version++, this.hash = `${this.uuid}_${this.version}`, !0) : !1;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
const
|
|
309
|
+
const Ms = 0, gn = 1, vn = 2;
|
|
310
310
|
function Qo(o, e) {
|
|
311
311
|
for (let t = 0, i = o.length; t < i; t++)
|
|
312
312
|
o[t].traverseVisible((a) => {
|
|
@@ -384,7 +384,7 @@ class Xo {
|
|
|
384
384
|
version: l.version,
|
|
385
385
|
uuid: l.uuid
|
|
386
386
|
})));
|
|
387
|
-
let r =
|
|
387
|
+
let r = Ms;
|
|
388
388
|
return d ? r = vn : c.includes(!1) && (r = gn), {
|
|
389
389
|
changeType: r,
|
|
390
390
|
materials: Yo(n),
|
|
@@ -444,7 +444,7 @@ class $o {
|
|
|
444
444
|
});
|
|
445
445
|
});
|
|
446
446
|
const n = t.generate(i), c = n.materials, u = Ko(c), { lights: f, iesTextures: d } = Jo(a);
|
|
447
|
-
if (n.changeType !==
|
|
447
|
+
if (n.changeType !== Ms && Ho(i, c, c), this.generateBVH) {
|
|
448
448
|
if (this.bvh instanceof Promise)
|
|
449
449
|
throw new Error("PathTracingSceneGenerator: BVH is already building asynchronously.");
|
|
450
450
|
if (n.changeType === vn) {
|
|
@@ -460,7 +460,7 @@ class $o {
|
|
|
460
460
|
n.changeType === gn && this.bvh.refit();
|
|
461
461
|
}
|
|
462
462
|
return {
|
|
463
|
-
bvhChanged: n.changeType !==
|
|
463
|
+
bvhChanged: n.changeType !== Ms,
|
|
464
464
|
bvh: this.bvh,
|
|
465
465
|
lights: f,
|
|
466
466
|
iesTextures: d,
|
|
@@ -827,7 +827,7 @@ class ra {
|
|
|
827
827
|
return a.material.resolution.set(t, t), a.render(e), e.setRenderTarget(s), a.dispose(), i;
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
|
-
class na extends
|
|
830
|
+
class na extends Gi {
|
|
831
831
|
set bokehSize(e) {
|
|
832
832
|
this.fStop = this.getFocalLength() / e;
|
|
833
833
|
}
|
|
@@ -849,7 +849,7 @@ class oa {
|
|
|
849
849
|
e instanceof na ? (this.bokehSize = e.bokehSize, this.apertureBlades = e.apertureBlades, this.apertureRotation = e.apertureRotation, this.focusDistance = e.focusDistance, this.anamorphicRatio = e.anamorphicRatio) : (this.bokehSize = 0, this.apertureRotation = 0, this.apertureBlades = 0, this.focusDistance = 10, this.anamorphicRatio = 1);
|
|
850
850
|
}
|
|
851
851
|
}
|
|
852
|
-
function
|
|
852
|
+
function is(o) {
|
|
853
853
|
const e = new Uint16Array(o.length);
|
|
854
854
|
for (let t = 0, i = o.length; t < i; ++t)
|
|
855
855
|
e[t] = ke.toHalfFloat(o[t]);
|
|
@@ -895,12 +895,12 @@ function la(o, e = Se) {
|
|
|
895
895
|
}
|
|
896
896
|
class ca {
|
|
897
897
|
constructor() {
|
|
898
|
-
const e = new Oe(
|
|
898
|
+
const e = new Oe(is(new Float32Array([0, 0, 0, 0])), 1, 1);
|
|
899
899
|
e.type = Se, e.format = te, e.minFilter = Te, e.magFilter = Te, e.wrapS = et, e.wrapT = et, e.generateMipmaps = !1, e.needsUpdate = !0;
|
|
900
|
-
const t = new Oe(
|
|
901
|
-
t.type = Se, t.format =
|
|
902
|
-
const i = new Oe(
|
|
903
|
-
i.type = Se, i.format =
|
|
900
|
+
const t = new Oe(is(new Float32Array([0, 1])), 1, 2);
|
|
901
|
+
t.type = Se, t.format = xs, t.minFilter = Te, t.magFilter = Te, t.generateMipmaps = !1, t.needsUpdate = !0;
|
|
902
|
+
const i = new Oe(is(new Float32Array([0, 0, 1, 1])), 2, 2);
|
|
903
|
+
i.type = Se, i.format = xs, i.minFilter = Te, i.magFilter = Te, i.generateMipmaps = !1, i.needsUpdate = !0, this.map = e, this.marginalWeights = t, this.conditionalWeights = i, this.totalSum = 0;
|
|
904
904
|
}
|
|
905
905
|
dispose() {
|
|
906
906
|
this.marginalWeights.dispose(), this.conditionalWeights.dispose(), this.map.dispose();
|
|
@@ -939,20 +939,20 @@ class ca {
|
|
|
939
939
|
m.image = { width: s, height: 1, data: l }, m.needsUpdate = !0, v.image = { width: i, height: s, data: h }, v.needsUpdate = !0, this.totalSum = d, this.map = t;
|
|
940
940
|
}
|
|
941
941
|
}
|
|
942
|
-
const
|
|
942
|
+
const ss = 6, ua = 0, ha = 1, fa = 2, da = 3, pa = 4, we = new b(), ne = new b(), yr = new J(), ft = new hn(), xr = new b(), dt = new b(), ma = new b(0, 1, 0);
|
|
943
943
|
class ga {
|
|
944
944
|
constructor() {
|
|
945
945
|
const e = new Oe(new Float32Array(4), 1, 1);
|
|
946
946
|
e.format = te, e.type = pe, e.wrapS = He, e.wrapT = He, e.generateMipmaps = !1, e.minFilter = ee, e.magFilter = ee, this.tex = e, this.count = 0;
|
|
947
947
|
}
|
|
948
948
|
updateFrom(e, t = []) {
|
|
949
|
-
const i = this.tex, s = Math.max(e.length *
|
|
949
|
+
const i = this.tex, s = Math.max(e.length * ss, 1), a = Math.ceil(Math.sqrt(s));
|
|
950
950
|
i.image.width !== a && (i.dispose(), i.image.data = new Float32Array(a * a * 4), i.image.width = a, i.image.height = a);
|
|
951
951
|
const n = i.image.data;
|
|
952
952
|
for (let u = 0, f = e.length; u < f; u++) {
|
|
953
|
-
const d = e[u], r = u *
|
|
953
|
+
const d = e[u], r = u * ss * 4;
|
|
954
954
|
let l = 0;
|
|
955
|
-
for (let m = 0; m <
|
|
955
|
+
for (let m = 0; m < ss * 4; m++)
|
|
956
956
|
n[r + m] = 0;
|
|
957
957
|
d.getWorldPosition(ne), n[r + l++] = ne.x, n[r + l++] = ne.y, n[r + l++] = ne.z;
|
|
958
958
|
let h = ua;
|
|
@@ -1056,13 +1056,13 @@ class _a extends va {
|
|
|
1056
1056
|
function Qs(o, e) {
|
|
1057
1057
|
return o.uuid < e.uuid ? 1 : o.uuid > e.uuid ? -1 : 0;
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1059
|
+
function Cs(o) {
|
|
1060
1060
|
return `${o.source.uuid}:${o.colorSpace}`;
|
|
1061
1061
|
}
|
|
1062
1062
|
function ya(o) {
|
|
1063
1063
|
const e = /* @__PURE__ */ new Set(), t = [];
|
|
1064
1064
|
for (let i = 0, s = o.length; i < s; i++) {
|
|
1065
|
-
const a = o[i], n =
|
|
1065
|
+
const a = o[i], n = Cs(a);
|
|
1066
1066
|
e.has(n) || (e.add(n), t.push(a));
|
|
1067
1067
|
}
|
|
1068
1068
|
return t;
|
|
@@ -1111,7 +1111,7 @@ class Ta extends Oe {
|
|
|
1111
1111
|
updateFrom(e, t) {
|
|
1112
1112
|
function i(m, v, p = -1) {
|
|
1113
1113
|
if (v in m && m[v]) {
|
|
1114
|
-
const g =
|
|
1114
|
+
const g = Cs(m[v]);
|
|
1115
1115
|
return r[g];
|
|
1116
1116
|
} else
|
|
1117
1117
|
return p;
|
|
@@ -1132,7 +1132,7 @@ class Ta extends Oe {
|
|
|
1132
1132
|
let n = 0;
|
|
1133
1133
|
const c = e.length * yn, u = Math.ceil(Math.sqrt(c)) || 1, { image: f, features: d } = this, r = {};
|
|
1134
1134
|
for (let m = 0, v = t.length; m < v; m++)
|
|
1135
|
-
r[
|
|
1135
|
+
r[Cs(t[m])] = m;
|
|
1136
1136
|
f.width !== u && (this.dispose(), f.data = new Float32Array(u * u * 4), f.width = u, f.height = u);
|
|
1137
1137
|
const l = f.data;
|
|
1138
1138
|
d.reset();
|
|
@@ -1153,7 +1153,7 @@ class Ta extends Oe {
|
|
|
1153
1153
|
l[n++] = 0;
|
|
1154
1154
|
else
|
|
1155
1155
|
switch (p.side) {
|
|
1156
|
-
case
|
|
1156
|
+
case ws:
|
|
1157
1157
|
l[n++] = 1;
|
|
1158
1158
|
break;
|
|
1159
1159
|
case fn:
|
|
@@ -1473,7 +1473,7 @@ function Ba(o) {
|
|
|
1473
1473
|
function Oa(o) {
|
|
1474
1474
|
switch (o) {
|
|
1475
1475
|
case 1:
|
|
1476
|
-
return
|
|
1476
|
+
return xs;
|
|
1477
1477
|
case 2:
|
|
1478
1478
|
return Xn;
|
|
1479
1479
|
default:
|
|
@@ -4538,9 +4538,9 @@ class ul extends js {
|
|
|
4538
4538
|
#include <common>
|
|
4539
4539
|
|
|
4540
4540
|
// bvh intersection
|
|
4541
|
-
${
|
|
4542
|
-
${
|
|
4543
|
-
${
|
|
4541
|
+
${$i.common_functions}
|
|
4542
|
+
${$i.bvh_struct_definitions}
|
|
4543
|
+
${$i.bvh_ray_functions}
|
|
4544
4544
|
|
|
4545
4545
|
// uniform structs
|
|
4546
4546
|
${Ua}
|
|
@@ -5349,7 +5349,7 @@ class vl {
|
|
|
5349
5349
|
return !!this._pathTracer.isCompiling;
|
|
5350
5350
|
}
|
|
5351
5351
|
constructor(e) {
|
|
5352
|
-
this._renderer = e, this._generator = new $o(), this._pathTracer = new Ir(e), this._queueReset = !1, this._clock = new
|
|
5352
|
+
this._renderer = e, this._generator = new $o(), this._pathTracer = new Ir(e), this._queueReset = !1, this._clock = new qi(), this._compilePromise = null, this._lowResPathTracer = new Ir(e), this._lowResPathTracer.tiles.set(1, 1), this._quad = new Et(new pl({
|
|
5353
5353
|
map: null,
|
|
5354
5354
|
transparent: !0,
|
|
5355
5355
|
blending: ri,
|
|
@@ -5359,7 +5359,7 @@ class vl {
|
|
|
5359
5359
|
}, this.renderToCanvasCallback = (t, i, s) => {
|
|
5360
5360
|
const a = i.autoClear;
|
|
5361
5361
|
i.autoClear = !1, s.render(i), i.autoClear = a;
|
|
5362
|
-
}, this.setScene(new
|
|
5362
|
+
}, this.setScene(new bs(), new Gi());
|
|
5363
5363
|
}
|
|
5364
5364
|
setBVHWorker(e) {
|
|
5365
5365
|
this._generator.setBVHWorker(e);
|
|
@@ -5473,8 +5473,8 @@ class vl {
|
|
|
5473
5473
|
const _l = "";
|
|
5474
5474
|
globalThis.GLTF_PROGRESSIVE_VERSION = _l;
|
|
5475
5475
|
console.debug("[gltf-progressive] version -");
|
|
5476
|
-
let Me = "https://www.gstatic.com/draco/versioned/decoders/1.5.7/",
|
|
5477
|
-
const yl = Me, xl =
|
|
5476
|
+
let Me = "https://www.gstatic.com/draco/versioned/decoders/1.5.7/", Qi = "https://cdn.needle.tools/static/three/0.179.1/basis2/";
|
|
5477
|
+
const yl = Me, xl = Qi, wn = new URL(Me + "draco_decoder.js");
|
|
5478
5478
|
wn.searchParams.append("range", "true");
|
|
5479
5479
|
fetch(wn, {
|
|
5480
5480
|
method: "GET",
|
|
@@ -5482,19 +5482,19 @@ fetch(wn, {
|
|
|
5482
5482
|
Range: "bytes=0-1"
|
|
5483
5483
|
}
|
|
5484
5484
|
}).catch((o) => {
|
|
5485
|
-
console.debug(`Failed to fetch remote Draco decoder from ${Me} (offline: ${typeof navigator < "u" ? navigator.onLine : "unknown"})`), Me === yl && bl("./include/draco/"),
|
|
5485
|
+
console.debug(`Failed to fetch remote Draco decoder from ${Me} (offline: ${typeof navigator < "u" ? navigator.onLine : "unknown"})`), Me === yl && bl("./include/draco/"), Qi === xl && Al("./include/ktx2/");
|
|
5486
5486
|
}).finally(() => {
|
|
5487
5487
|
An();
|
|
5488
5488
|
});
|
|
5489
5489
|
const wl = () => ({
|
|
5490
5490
|
dracoDecoderPath: Me,
|
|
5491
|
-
ktx2TranscoderPath:
|
|
5491
|
+
ktx2TranscoderPath: Qi
|
|
5492
5492
|
});
|
|
5493
5493
|
function bl(o) {
|
|
5494
|
-
Me = o, he && he[
|
|
5494
|
+
Me = o, he && he[Is] != Me ? (console.debug("Updating Draco decoder path to " + o), he[Is] = Me, he.setDecoderPath(Me), he.preload()) : console.debug("Setting Draco decoder path to " + o);
|
|
5495
5495
|
}
|
|
5496
5496
|
function Al(o) {
|
|
5497
|
-
|
|
5497
|
+
Qi = o;
|
|
5498
5498
|
}
|
|
5499
5499
|
function Ys(o) {
|
|
5500
5500
|
return An(), { dracoLoader: he, meshoptDecoder: zi };
|
|
@@ -5502,26 +5502,26 @@ function Ys(o) {
|
|
|
5502
5502
|
function bn(o) {
|
|
5503
5503
|
o.dracoLoader || o.setDRACOLoader(he), o.meshoptDecoder || o.setMeshoptDecoder(zi);
|
|
5504
5504
|
}
|
|
5505
|
-
const
|
|
5505
|
+
const Is = Symbol("dracoDecoderPath");
|
|
5506
5506
|
let he, zi;
|
|
5507
5507
|
function An() {
|
|
5508
|
-
he || (he = new bo(), he[
|
|
5508
|
+
he || (he = new bo(), he[Is] = Me, he.setDecoderPath(Me), he.setDecoderConfig({ type: "js" }), he.preload()), zi || (zi = wo);
|
|
5509
5509
|
}
|
|
5510
|
-
const
|
|
5510
|
+
const Rs = /* @__PURE__ */ new WeakMap();
|
|
5511
5511
|
function Tn(o, e) {
|
|
5512
|
-
let t =
|
|
5513
|
-
t ? t = Object.assign(t, e) : t = e,
|
|
5512
|
+
let t = Rs.get(o);
|
|
5513
|
+
t ? t = Object.assign(t, e) : t = e, Rs.set(o, t);
|
|
5514
5514
|
}
|
|
5515
|
-
const
|
|
5515
|
+
const rs = Gs.prototype.load;
|
|
5516
5516
|
function Tl(...o) {
|
|
5517
|
-
const e =
|
|
5517
|
+
const e = Rs.get(this);
|
|
5518
5518
|
let t = o[0];
|
|
5519
5519
|
const i = new URL(t, window.location.href);
|
|
5520
5520
|
if (i.hostname.endsWith("needle.tools")) {
|
|
5521
5521
|
const a = (e == null ? void 0 : e.progressive) !== void 0 ? e.progressive : !0, n = e != null && e.usecase ? e.usecase : "default";
|
|
5522
5522
|
a ? this.requestHeader.Accept = `*/*;progressive=allowed;usecase=${n}` : this.requestHeader.Accept = `*/*;usecase=${n}`, t = i.toString();
|
|
5523
5523
|
}
|
|
5524
|
-
return o[0] = t,
|
|
5524
|
+
return o[0] = t, rs == null ? void 0 : rs.call(this, ...o);
|
|
5525
5525
|
}
|
|
5526
5526
|
Gs.prototype.load = Tl;
|
|
5527
5527
|
ut("debugprogressive");
|
|
@@ -5587,14 +5587,14 @@ class Ml {
|
|
|
5587
5587
|
}
|
|
5588
5588
|
}
|
|
5589
5589
|
}
|
|
5590
|
-
const Cl = typeof window > "u" && typeof document > "u",
|
|
5590
|
+
const Cl = typeof window > "u" && typeof document > "u", Ds = Symbol("needle:raycast-mesh");
|
|
5591
5591
|
function ai(o) {
|
|
5592
|
-
return (o == null ? void 0 : o[
|
|
5592
|
+
return (o == null ? void 0 : o[Ds]) instanceof le ? o[Ds] : null;
|
|
5593
5593
|
}
|
|
5594
5594
|
function Il(o, e) {
|
|
5595
5595
|
if ((o.type === "Mesh" || o.type === "SkinnedMesh") && !ai(o)) {
|
|
5596
5596
|
const i = Dl(e);
|
|
5597
|
-
i.userData = { isRaycastMesh: !0 }, o[
|
|
5597
|
+
i.userData = { isRaycastMesh: !0 }, o[Ds] = i;
|
|
5598
5598
|
}
|
|
5599
5599
|
}
|
|
5600
5600
|
function Rl(o = !0) {
|
|
@@ -5711,15 +5711,15 @@ function Fl(o) {
|
|
|
5711
5711
|
const _ = g.geometry, y = new le();
|
|
5712
5712
|
if (y.name = _.name || "", _.index) {
|
|
5713
5713
|
const x = _.index;
|
|
5714
|
-
y.setIndex(
|
|
5714
|
+
y.setIndex(ns(x));
|
|
5715
5715
|
}
|
|
5716
5716
|
for (const x in _.attributes) {
|
|
5717
|
-
const w = _.attributes[x], A =
|
|
5717
|
+
const w = _.attributes[x], A = ns(w);
|
|
5718
5718
|
y.setAttribute(x, A);
|
|
5719
5719
|
}
|
|
5720
5720
|
if (_.morphAttributes)
|
|
5721
5721
|
for (const x in _.morphAttributes) {
|
|
5722
|
-
const A = _.morphAttributes[x].map((S) =>
|
|
5722
|
+
const A = _.morphAttributes[x].map((S) => ns(S));
|
|
5723
5723
|
y.morphAttributes[x] = A;
|
|
5724
5724
|
}
|
|
5725
5725
|
if (y.morphTargetsRelative = _.morphTargetsRelative ?? !1, y.boundingBox = new Y(), y.boundingBox.min = new b(
|
|
@@ -5730,7 +5730,7 @@ function Fl(o) {
|
|
|
5730
5730
|
(s = _.boundingBox) == null ? void 0 : s.max.x,
|
|
5731
5731
|
(a = _.boundingBox) == null ? void 0 : a.max.y,
|
|
5732
5732
|
(n = _.boundingBox) == null ? void 0 : n.max.z
|
|
5733
|
-
), y.boundingSphere = new
|
|
5733
|
+
), y.boundingSphere = new ji(
|
|
5734
5734
|
new b(
|
|
5735
5735
|
(c = _.boundingSphere) == null ? void 0 : c.center.x,
|
|
5736
5736
|
(u = _.boundingSphere) == null ? void 0 : u.center.y,
|
|
@@ -5782,7 +5782,7 @@ function Fl(o) {
|
|
|
5782
5782
|
}
|
|
5783
5783
|
return o;
|
|
5784
5784
|
}
|
|
5785
|
-
function
|
|
5785
|
+
function ns(o) {
|
|
5786
5786
|
let e = o;
|
|
5787
5787
|
if ("isInterleavedBufferAttribute" in o && o.isInterleavedBufferAttribute) {
|
|
5788
5788
|
const t = o.data, i = t.array, s = new to(i, t.stride);
|
|
@@ -5791,7 +5791,7 @@ function rs(o) {
|
|
|
5791
5791
|
"isBufferAttribute" in o && o.isBufferAttribute && (e = new fe(o.array, o.itemSize, o.normalized), e.usage = o.usage, e.gpuType = o.gpuType, e.updateRanges = o.updateRanges);
|
|
5792
5792
|
return e;
|
|
5793
5793
|
}
|
|
5794
|
-
const kl = ut("gltf-progressive-worker"), Bl = ut("gltf-progressive-reduce-mipmaps"),
|
|
5794
|
+
const kl = ut("gltf-progressive-worker"), Bl = ut("gltf-progressive-reduce-mipmaps"), os = Symbol("needle-progressive-texture"), Ee = "NEEDLE_progressive", B = class B {
|
|
5795
5795
|
constructor(e) {
|
|
5796
5796
|
E(this, "parser");
|
|
5797
5797
|
E(this, "url");
|
|
@@ -6073,7 +6073,7 @@ const kl = ut("gltf-progressive-worker"), Bl = ut("gltf-progressive-reduce-mipma
|
|
|
6073
6073
|
let n;
|
|
6074
6074
|
if (e.isTexture === !0) {
|
|
6075
6075
|
const l = e;
|
|
6076
|
-
l.source && l.source[
|
|
6076
|
+
l.source && l.source[os] && (n = l.source[os]);
|
|
6077
6077
|
}
|
|
6078
6078
|
if (n || (n = B.lodInfos.get(a)), !n)
|
|
6079
6079
|
O && console.warn(`Can not load LOD ${t}: no LOD info found for "${a}" ${e.name}`, e.type, B.lodInfos);
|
|
@@ -6224,7 +6224,7 @@ E(B, "registerTexture", (e, t, i, s, a) => {
|
|
|
6224
6224
|
const v = ((c = t.image) == null ? void 0 : c.width) || ((f = (u = t.source) == null ? void 0 : u.data) == null ? void 0 : f.width) || 0, p = ((d = t.image) == null ? void 0 : d.height) || ((l = (r = t.source) == null ? void 0 : r.data) == null ? void 0 : l.height) || 0;
|
|
6225
6225
|
console.log(`> gltf-progressive: register texture[${s}] "${t.name || t.uuid}", Current: ${v}x${p}, Max: ${(h = a.lods[0]) == null ? void 0 : h.width}x${(m = a.lods[0]) == null ? void 0 : m.height}, uuid: ${t.uuid}`, a, t);
|
|
6226
6226
|
}
|
|
6227
|
-
t.source && (t.source[
|
|
6227
|
+
t.source && (t.source[os] = a);
|
|
6228
6228
|
const n = a.guid;
|
|
6229
6229
|
B.assignLODInformation(e, t, n, i, s), B.lodInfos.set(n, a), B.lowresCache.set(n, t);
|
|
6230
6230
|
}), /**
|
|
@@ -6337,8 +6337,8 @@ E(Pi, "addPromise", (e, t, i, s) => {
|
|
|
6337
6337
|
a.add(e, t, i);
|
|
6338
6338
|
});
|
|
6339
6339
|
});
|
|
6340
|
-
const be = ut("debugprogressive"), zl = ut("noprogressive"),
|
|
6341
|
-
var ue, Le,
|
|
6340
|
+
const be = ut("debugprogressive"), zl = ut("noprogressive"), as = Symbol("Needle:LODSManager"), ls = Symbol("Needle:LODState"), qe = Symbol("Needle:CurrentLOD"), oe = { mesh_lod: -1, texture_lod: -1 };
|
|
6341
|
+
var ue, Le, Vi, Ke, Pt, Ni, Fe;
|
|
6342
6342
|
const V = class V {
|
|
6343
6343
|
// readonly plugins: NEEDLE_progressive_plugin[] = [];
|
|
6344
6344
|
constructor(e, t) {
|
|
@@ -6382,14 +6382,14 @@ const V = class V {
|
|
|
6382
6382
|
E(this, "_promiseGroupIds", 0);
|
|
6383
6383
|
E(this, "_lodchangedlisteners", []);
|
|
6384
6384
|
Ge(this, Le, void 0);
|
|
6385
|
-
Ge(this,
|
|
6385
|
+
Ge(this, Vi, new qi());
|
|
6386
6386
|
Ge(this, Ke, 0);
|
|
6387
6387
|
Ge(this, Pt, 0);
|
|
6388
|
-
Ge(this,
|
|
6388
|
+
Ge(this, Ni, 0);
|
|
6389
6389
|
Ge(this, Fe, 0);
|
|
6390
6390
|
E(this, "_fpsBuffer", [60, 60, 60, 60, 60]);
|
|
6391
6391
|
// private testIfLODLevelsAreAvailable() {
|
|
6392
|
-
E(this, "_sphere", new
|
|
6392
|
+
E(this, "_sphere", new ji());
|
|
6393
6393
|
E(this, "_tempBox", new Y());
|
|
6394
6394
|
E(this, "_tempBox2", new Y());
|
|
6395
6395
|
E(this, "tempMatrix", new J());
|
|
@@ -6400,7 +6400,7 @@ const V = class V {
|
|
|
6400
6400
|
}
|
|
6401
6401
|
/** @internal */
|
|
6402
6402
|
static getObjectLODState(e) {
|
|
6403
|
-
return e[
|
|
6403
|
+
return e[ls];
|
|
6404
6404
|
}
|
|
6405
6405
|
static addPlugin(e) {
|
|
6406
6406
|
Ze.push(e);
|
|
@@ -6415,13 +6415,13 @@ const V = class V {
|
|
|
6415
6415
|
* @returns The LODsManager instance.
|
|
6416
6416
|
*/
|
|
6417
6417
|
static get(e, t) {
|
|
6418
|
-
if (e[
|
|
6419
|
-
return console.debug("[gltf-progressive] LODsManager already exists for this renderer"), e[
|
|
6418
|
+
if (e[as])
|
|
6419
|
+
return console.debug("[gltf-progressive] LODsManager already exists for this renderer"), e[as];
|
|
6420
6420
|
const i = new V(e, {
|
|
6421
6421
|
engine: "unknown",
|
|
6422
6422
|
...t
|
|
6423
6423
|
});
|
|
6424
|
-
return e[
|
|
6424
|
+
return e[as] = i, i;
|
|
6425
6425
|
}
|
|
6426
6426
|
/** @deprecated use static `LODsManager.addPlugin()` method. This getter will be removed in later versions */
|
|
6427
6427
|
get plugins() {
|
|
@@ -6468,7 +6468,7 @@ const V = class V {
|
|
|
6468
6468
|
const t = this;
|
|
6469
6469
|
Ys(this.renderer), this.renderer.render = function(i, s) {
|
|
6470
6470
|
const a = t.renderer.getRenderTarget();
|
|
6471
|
-
(a == null || "isXRRenderTarget" in a && a.isXRRenderTarget) && (e = 0, Ie(t, Ke, H(t, Ke) + 1), Ie(t, Pt, H(t,
|
|
6471
|
+
(a == null || "isXRRenderTarget" in a && a.isXRRenderTarget) && (e = 0, Ie(t, Ke, H(t, Ke) + 1), Ie(t, Pt, H(t, Vi).getDelta()), Ie(t, Ni, H(t, Ni) + H(t, Pt)), t._fpsBuffer.shift(), t._fpsBuffer.push(1 / H(t, Pt)), Ie(t, Fe, t._fpsBuffer.reduce((c, u) => c + u) / t._fpsBuffer.length), be && H(t, Ke) % 200 === 0 && console.log("FPS", Math.round(H(t, Fe)), "Interval:", H(t, ue)));
|
|
6472
6472
|
const n = e++;
|
|
6473
6473
|
H(t, Le).call(this, i, s), t.onAfterRender(i, s, n);
|
|
6474
6474
|
};
|
|
@@ -6539,8 +6539,8 @@ const V = class V {
|
|
|
6539
6539
|
updateLODs(e, t, i, s) {
|
|
6540
6540
|
var c, u;
|
|
6541
6541
|
i.userData || (i.userData = {});
|
|
6542
|
-
let a = i[
|
|
6543
|
-
if (a || (a = new Ul(), i[
|
|
6542
|
+
let a = i[ls];
|
|
6543
|
+
if (a || (a = new Ul(), i[ls] = a), a.frames++ < 2)
|
|
6544
6544
|
return;
|
|
6545
6545
|
for (const f of Ze)
|
|
6546
6546
|
(c = f.onBeforeUpdateLOD) == null || c.call(f, this.renderer, e, t, i);
|
|
@@ -6714,7 +6714,7 @@ ${t.name}`);
|
|
|
6714
6714
|
a.texture_lod = 0;
|
|
6715
6715
|
}
|
|
6716
6716
|
};
|
|
6717
|
-
ue = new WeakMap(), Le = new WeakMap(),
|
|
6717
|
+
ue = new WeakMap(), Le = new WeakMap(), Vi = new WeakMap(), Ke = new WeakMap(), Pt = new WeakMap(), Ni = new WeakMap(), Fe = new WeakMap(), /**
|
|
6718
6718
|
* Assign a function to draw debug lines for the LODs. This function will be called with the start and end position of the line and the color of the line when the `debugprogressive` query parameter is set.
|
|
6719
6719
|
*/
|
|
6720
6720
|
E(V, "debugDrawLine"), E(V, "corner0", new b()), E(V, "corner1", new b()), E(V, "corner2", new b()), E(V, "corner3", new b()), E(V, "_tempPtInside", new b()), E(V, "skinnedMeshBoundsFrameOffsetCounter", 0), E(V, "$skinnedMeshBoundsOffset", Symbol("gltf-progressive-skinnedMeshBoundsOffset"));
|
|
@@ -7130,11 +7130,11 @@ var Rt = Object.freeze({
|
|
|
7130
7130
|
return o._nextId++;
|
|
7131
7131
|
}, o._nextId = 0, o;
|
|
7132
7132
|
}()
|
|
7133
|
-
),
|
|
7133
|
+
), Ps = new Dn(), Ui = (
|
|
7134
7134
|
/** @class */
|
|
7135
7135
|
function() {
|
|
7136
7136
|
function o(e, t) {
|
|
7137
|
-
t === void 0 && (t =
|
|
7137
|
+
t === void 0 && (t = Ps), this._object = e, this._group = t, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = Rt.Linear.None, this._interpolationFunction = ct.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = Xs.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1;
|
|
7138
7138
|
}
|
|
7139
7139
|
return o.prototype.getId = function() {
|
|
7140
7140
|
return this._id;
|
|
@@ -7221,7 +7221,7 @@ var Rt = Object.freeze({
|
|
|
7221
7221
|
this._chainedTweens[e].stop();
|
|
7222
7222
|
return this;
|
|
7223
7223
|
}, o.prototype.group = function(e) {
|
|
7224
|
-
return e === void 0 && (e =
|
|
7224
|
+
return e === void 0 && (e = Ps), this._group = e, this;
|
|
7225
7225
|
}, o.prototype.delay = function(e) {
|
|
7226
7226
|
return e === void 0 && (e = 0), this._delayTime = e, this;
|
|
7227
7227
|
}, o.prototype.repeat = function(e) {
|
|
@@ -7298,7 +7298,7 @@ var Rt = Object.freeze({
|
|
|
7298
7298
|
typeof i == "string" ? this._valuesStartRepeat[e] = this._valuesStartRepeat[e] + parseFloat(i) : this._valuesStartRepeat[e] = this._valuesEnd[e], this._valuesEnd[e] = t;
|
|
7299
7299
|
}, o;
|
|
7300
7300
|
}()
|
|
7301
|
-
), Nl = "23.1.3", Gl = Xs.nextId, De =
|
|
7301
|
+
), Nl = "23.1.3", Gl = Xs.nextId, De = Ps, ql = De.getAll.bind(De), jl = De.removeAll.bind(De), Ql = De.add.bind(De), Yl = De.remove.bind(De), Zl = De.update.bind(De), Je = {
|
|
7302
7302
|
Easing: Rt,
|
|
7303
7303
|
Group: Dn,
|
|
7304
7304
|
Interpolation: ct,
|
|
@@ -8812,7 +8812,7 @@ function ac() {
|
|
|
8812
8812
|
}
|
|
8813
8813
|
return !1;
|
|
8814
8814
|
}
|
|
8815
|
-
const lc = new Mo(), Ft = new Ao(),
|
|
8815
|
+
const lc = new Mo(), Ft = new Ao(), Yi = new To();
|
|
8816
8816
|
let Dt = "./draco/";
|
|
8817
8817
|
try {
|
|
8818
8818
|
Dt = new URL("./draco/", import.meta.url).href;
|
|
@@ -8820,10 +8820,10 @@ try {
|
|
|
8820
8820
|
Dt = "./draco/";
|
|
8821
8821
|
}
|
|
8822
8822
|
typeof window < "u" && window.dracoPath && (Dt = window.dracoPath);
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
Ft.setDRACOLoader(
|
|
8823
|
+
Yi.setDecoderConfig({ type: "wasm" });
|
|
8824
|
+
Yi.setDecoderPath(Dt.endsWith("/") ? Dt : `${Dt}/`);
|
|
8825
|
+
Yi.preload();
|
|
8826
|
+
Ft.setDRACOLoader(Yi);
|
|
8827
8827
|
const Rh = new So(), Ur = [115, 103, 108, 98];
|
|
8828
8828
|
function Dh(o, e, t) {
|
|
8829
8829
|
const i = JSON.stringify(e), s = new TextEncoder().encode(i), a = new Uint8Array([115, 103, 108, 98]), n = new Uint8Array(2);
|
|
@@ -8847,7 +8847,7 @@ function cc(o) {
|
|
|
8847
8847
|
const s = new DataView(o, 4, 2).getUint16(0, !1), n = new DataView(o, 6, 4).getUint32(0, !1), c = new Uint8Array(o.slice(10, 10 + n)), u = new TextDecoder().decode(c), f = JSON.parse(u), d = o.slice(10 + n);
|
|
8848
8848
|
return { version: s, jsonDescription: f, glbContent: d };
|
|
8849
8849
|
}
|
|
8850
|
-
class
|
|
8850
|
+
class Hi {
|
|
8851
8851
|
constructor(e) {
|
|
8852
8852
|
this.props = e, this.cache = /* @__PURE__ */ new Map();
|
|
8853
8853
|
}
|
|
@@ -8872,7 +8872,7 @@ class Ps {
|
|
|
8872
8872
|
return;
|
|
8873
8873
|
}
|
|
8874
8874
|
const u = Br(c.glbContent, "model/gltf-binary"), f = await Ft.loadAsync(u);
|
|
8875
|
-
URL.revokeObjectURL(u), c.glbContent = void 0, c.glb = f.scene, n = void 0, this.cache.set(e, c), t(c);
|
|
8875
|
+
URL.revokeObjectURL(u), c.glbContent = void 0, c.glb = f.scene, c.scene = f.scene, c.animations = f.animations, n = void 0, this.cache.set(e, c), t(c);
|
|
8876
8876
|
} catch (c) {
|
|
8877
8877
|
s == null || s(new ErrorEvent("Error", { message: c == null ? void 0 : c.message }));
|
|
8878
8878
|
}
|
|
@@ -8896,7 +8896,7 @@ class Ps {
|
|
|
8896
8896
|
const a = Br(s.glbContent, "model/gltf-binary");
|
|
8897
8897
|
console.log(a);
|
|
8898
8898
|
const n = await Ft.loadAsync(a);
|
|
8899
|
-
return URL.revokeObjectURL(a), s.glbContent = void 0, s.glb = n.scene, this.cache.set(e, s), s;
|
|
8899
|
+
return URL.revokeObjectURL(a), s.glbContent = void 0, s.glb = n.scene, s.scene = n.scene, s.animations = n.animations, this.cache.set(e, s), s;
|
|
8900
8900
|
} catch (t) {
|
|
8901
8901
|
throw t;
|
|
8902
8902
|
}
|
|
@@ -9222,12 +9222,12 @@ class Vr extends Ue {
|
|
|
9222
9222
|
}
|
|
9223
9223
|
}
|
|
9224
9224
|
async loadGlb(e) {
|
|
9225
|
-
const i = await new
|
|
9225
|
+
const i = await new Hi({ useCache: !0 }).loadAsync(e);
|
|
9226
9226
|
if (i.glb)
|
|
9227
9227
|
return i.glb.clone(!0);
|
|
9228
9228
|
}
|
|
9229
9229
|
async installBracket(e) {
|
|
9230
|
-
const i = await new
|
|
9230
|
+
const i = await new Hi({ useCache: !0 }).loadAsync(e);
|
|
9231
9231
|
if (!i.glb)
|
|
9232
9232
|
return;
|
|
9233
9233
|
const s = i.glb.clone(!0);
|
|
@@ -9427,13 +9427,13 @@ class dc extends Ue {
|
|
|
9427
9427
|
}
|
|
9428
9428
|
class Ei extends ge {
|
|
9429
9429
|
constructor(e, t = !0, i = !0) {
|
|
9430
|
-
super(), this._startWith = e, this._showText = t, this.useStartEnd = i, this._line2Length = 0.01, this._line = new
|
|
9430
|
+
super(), this._startWith = e, this._showText = t, this.useStartEnd = i, this._line2Length = 0.01, this._line = new As(
|
|
9431
9431
|
new le(),
|
|
9432
9432
|
new nr({
|
|
9433
9433
|
color: "#666",
|
|
9434
9434
|
linewidth: 2
|
|
9435
9435
|
})
|
|
9436
|
-
), this._line2 = new
|
|
9436
|
+
), this._line2 = new As(
|
|
9437
9437
|
new le(),
|
|
9438
9438
|
new nr({
|
|
9439
9439
|
color: "#666",
|
|
@@ -9479,7 +9479,7 @@ class Ei extends ge {
|
|
|
9479
9479
|
class Fn extends Bt {
|
|
9480
9480
|
// 上一次的角度
|
|
9481
9481
|
constructor(e, t) {
|
|
9482
|
-
super(), this.radius = e, this._text = new pc(""), this._line = new Ei(void 0, !1, !1), this._box = new X(), this._arc = new Co(), this._previousPosition = null, this._updateTimer = null, this._updateDelay = 300, this._accumulatedAngle = 0, this._lastAngle = null, this._line.updateMaterial(new
|
|
9482
|
+
super(), this.radius = e, this._text = new pc(""), this._line = new Ei(void 0, !1, !1), this._box = new X(), this._arc = new Co(), this._previousPosition = null, this._updateTimer = null, this._updateDelay = 300, this._accumulatedAngle = 0, this._lastAngle = null, this._line.updateMaterial(new Ts({
|
|
9483
9483
|
color: "#555",
|
|
9484
9484
|
dashSize: 0.06,
|
|
9485
9485
|
gapSize: 0.06
|
|
@@ -9505,7 +9505,7 @@ class Fn extends Bt {
|
|
|
9505
9505
|
}
|
|
9506
9506
|
update(e) {
|
|
9507
9507
|
var t;
|
|
9508
|
-
this.radius = e, (t = this._box.geometry) == null || t.dispose(), this._box.geometry = new or(e, e + 3e-3, 128), this._line.updateMaterial(new
|
|
9508
|
+
this.radius = e, (t = this._box.geometry) == null || t.dispose(), this._box.geometry = new or(e, e + 3e-3, 128), this._line.updateMaterial(new Ts({
|
|
9509
9509
|
color: "#555",
|
|
9510
9510
|
dashSize: 0.06 * e,
|
|
9511
9511
|
gapSize: 0.06 * e
|
|
@@ -9787,11 +9787,11 @@ class qr extends Bt {
|
|
|
9787
9787
|
})
|
|
9788
9788
|
);
|
|
9789
9789
|
s.geometry.translate(0, 0, i / 2);
|
|
9790
|
-
const a = new no(s.geometry), n = new
|
|
9790
|
+
const a = new no(s.geometry), n = new Ts({
|
|
9791
9791
|
color: new K("#000"),
|
|
9792
9792
|
dashSize: 0.015,
|
|
9793
9793
|
gapSize: 0.015
|
|
9794
|
-
}), c = new
|
|
9794
|
+
}), c = new As(a, n);
|
|
9795
9795
|
c.computeLineDistances(), this.add(s, c);
|
|
9796
9796
|
}
|
|
9797
9797
|
}
|
|
@@ -9855,7 +9855,7 @@ const kn = new pn();
|
|
|
9855
9855
|
kn.crossOrigin = "anonymous";
|
|
9856
9856
|
class bc extends Bt {
|
|
9857
9857
|
constructor(e) {
|
|
9858
|
-
super(), this._props = e, this._emitter = new Ot(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new ge(), this.lines = new ge(), this._clips = [], this._actionsMap = /* @__PURE__ */ new Map(), this._animationClock = new
|
|
9858
|
+
super(), this._props = e, this._emitter = new Ot(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new ge(), this.lines = new ge(), this._clips = [], this._actionsMap = /* @__PURE__ */ new Map(), this._animationClock = new qi(), this.sizeBox = new yc(), this._goodsSize = new oc(0, 0, 0), this._slots = [], this._logos = [], this._skins = [], this._levels = /* @__PURE__ */ new Map(), this._bodyOpacity = 1, this._masts = /* @__PURE__ */ new Map(), this._liftMaxHeight = 0, this._jackMaxHeight = 0, this._forkMaxHeight = 0, this.controllers = [], this.goods = [], this._breathLights = [], this._shelves = /* @__PURE__ */ new Map(), this._shelfMaxLevel = 1, this._url = "", this._showController = !0, this._showSlots = !0, this._shapeKeys = /* @__PURE__ */ new Map(), this._shapeKeyTargets = /* @__PURE__ */ new Map(), this._shapeKeyTimer = 0, this._shapeKeyCache = "", this._materialsCache = /* @__PURE__ */ new Map(), this.opacityCache = void 0, this.actions = [], this._currentAction = null, this._pendingFinishedCallback = null, this._url = e.url || "", this._url && this.load(this._url).then(), this.add(this._container, this.lines), this._props.showSizeBox && this.add(this.sizeBox), this.showController = typeof e.showController == "boolean" ? e.showController : !0, this._showSlots = typeof e.showSlots == "boolean" ? e.showSlots : !0;
|
|
9859
9859
|
}
|
|
9860
9860
|
get shapeKeys() {
|
|
9861
9861
|
return this._shapeKeys;
|
|
@@ -9938,13 +9938,16 @@ class bc extends Bt {
|
|
|
9938
9938
|
!t && i.isSkinnedMesh && (t = i);
|
|
9939
9939
|
}), t;
|
|
9940
9940
|
}
|
|
9941
|
-
async loadAnimation(e, t = "
|
|
9941
|
+
async loadAnimation(e, t = "sglb") {
|
|
9942
9942
|
let i, s;
|
|
9943
9943
|
if (t === "glb" || e.endsWith(".glb")) {
|
|
9944
9944
|
const u = await Ft.loadAsync(e);
|
|
9945
9945
|
i = u.animations || [], s = u.scene;
|
|
9946
|
+
} else if (t === "sglb" || e.endsWith(".sglb")) {
|
|
9947
|
+
const f = await new Hi({ useCache: !0 }).loadAsync(e);
|
|
9948
|
+
i = f.animations || [], s = f.scene;
|
|
9946
9949
|
} else {
|
|
9947
|
-
console.warn("[Amr.loadAnimation] 目前仅支持 glb 动画文件", { url: e, type: t });
|
|
9950
|
+
console.warn("[Amr.loadAnimation] 目前仅支持 glb/sglb 动画文件", { url: e, type: t });
|
|
9948
9951
|
return;
|
|
9949
9952
|
}
|
|
9950
9953
|
if (!i || i.length === 0) {
|
|
@@ -9963,13 +9966,13 @@ class bc extends Bt {
|
|
|
9963
9966
|
(!a || !n) && console.warn("[Amr.loadAnimation] 在动画或目标模型中未找到 SkinnedMesh,使用原始动画 clip", e), this._mixer || (this._mixer = new ar(this._modelRoot));
|
|
9964
9967
|
const c = (
|
|
9965
9968
|
// @ts-ignore SkeletonUtils 可能没有类型定义
|
|
9966
|
-
typeof
|
|
9969
|
+
typeof Ji.retargetClip == "function"
|
|
9967
9970
|
);
|
|
9968
9971
|
i.forEach((u) => {
|
|
9969
9972
|
let f = u;
|
|
9970
9973
|
if (c && a && n)
|
|
9971
9974
|
try {
|
|
9972
|
-
f =
|
|
9975
|
+
f = Ji.retargetClip(
|
|
9973
9976
|
n,
|
|
9974
9977
|
a,
|
|
9975
9978
|
u
|
|
@@ -9989,12 +9992,12 @@ class bc extends Bt {
|
|
|
9989
9992
|
let n = await Ft.loadAsync(e);
|
|
9990
9993
|
i = n.scene, s = n.animations || [];
|
|
9991
9994
|
} else {
|
|
9992
|
-
const c = await new
|
|
9995
|
+
const c = await new Hi({ useCache: !0 }).loadAsync(e);
|
|
9993
9996
|
if (!c.glb)
|
|
9994
9997
|
return;
|
|
9995
9998
|
i = c.glb;
|
|
9996
9999
|
}
|
|
9997
|
-
const a =
|
|
10000
|
+
const a = Ji.clone(i);
|
|
9998
10001
|
this._generateAmr(a, s), i = null, this._emitter.emit("amr-loaded");
|
|
9999
10002
|
}
|
|
10000
10003
|
changeSkin(e, t) {
|
|
@@ -10360,29 +10363,33 @@ class bc extends Bt {
|
|
|
10360
10363
|
}
|
|
10361
10364
|
}
|
|
10362
10365
|
clean() {
|
|
10363
|
-
this._emitter.removeAllListeners(), this.controllers.forEach((e) => e.dispose()), this.controllers = [], We(this._container), this._levels.forEach((e) => e.destroy()), this._levels.clear(), this._slots = [], this._logos = [], this._skins = [], this._materialsCache.clear(), this.opacityCache = void 0, this._breathLights.forEach((e) => e.stop()), this._breathLights = [], this.sizeBox.reset(), this._shapeKeyTargets.clear(), this._shapeKeys.clear(), this._mixer && this._mixer.stopAllAction(), this._mixer = void 0, this._clips = [], this._actionsMap.clear(), this.actions = [], this._app && this._onTicker && this._app.renderer.domElement.removeEventListener("ticker", this._onTicker), this._onTicker = void 0;
|
|
10366
|
+
this._emitter.removeAllListeners(), this.controllers.forEach((e) => e.dispose()), this.controllers = [], We(this._container), this._levels.forEach((e) => e.destroy()), this._levels.clear(), this._slots = [], this._logos = [], this._skins = [], this._materialsCache.clear(), this.opacityCache = void 0, this._breathLights.forEach((e) => e.stop()), this._breathLights = [], this.sizeBox.reset(), this._shapeKeyTargets.clear(), this._shapeKeys.clear(), this._currentAction = null, this._pendingFinishedCallback && this._mixer && (this._mixer.removeEventListener("finished", this._pendingFinishedCallback), this._pendingFinishedCallback = null), this._mixer && (this._mixer.stopAllAction(), this._modelRoot && this._mixer.uncacheRoot(this._modelRoot)), this._mixer = void 0, this._clips = [], this._actionsMap.clear(), this.actions = [], this._app && this._onTicker && this._app.renderer.domElement.removeEventListener("ticker", this._onTicker), this._onTicker = void 0;
|
|
10364
10367
|
}
|
|
10365
10368
|
destroy() {
|
|
10366
10369
|
this.clean(), this.sizeBox.destroy();
|
|
10367
10370
|
}
|
|
10368
10371
|
playAction(e, t = !0, i) {
|
|
10369
10372
|
const s = this._actionsMap.get(e);
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10373
|
+
if (!s || !this._mixer)
|
|
10374
|
+
return Promise.reject(new Error(`Action "${e}" not found or mixer not initialized.`));
|
|
10375
|
+
const a = (i == null ? void 0 : i.fadeIn) ?? (i == null ? void 0 : i.fadeOut) ?? 0.3, n = this._currentAction, c = n && n !== s && n.isRunning();
|
|
10376
|
+
return this._actionsMap.forEach((u) => {
|
|
10377
|
+
u !== s && u !== n && (u.stopFading(), u.setEffectiveWeight(0), u.stop());
|
|
10378
|
+
}), s.enabled = !0, s.setEffectiveTimeScale((i == null ? void 0 : i.timeScale) ?? 1), s.setEffectiveWeight(1), s.time = 0, s.paused = !1, s.setLoop(oo, 0), s.clampWhenFinished = (i == null ? void 0 : i.clampWhenFinished) ?? !0, s.play(), c ? (n.stopFading(), n.enabled = !0, n.setEffectiveTimeScale(1), n.setEffectiveWeight(1), n.crossFadeTo(s, a, !0)) : a > 0 && s.fadeIn(a), this._currentAction = s, new Promise((u) => {
|
|
10379
|
+
this._pendingFinishedCallback && this._mixer && this._mixer.removeEventListener("finished", this._pendingFinishedCallback);
|
|
10380
|
+
const f = (d) => {
|
|
10381
|
+
var r;
|
|
10382
|
+
d.action === s && ((r = this._mixer) == null || r.removeEventListener("finished", f), this._pendingFinishedCallback = null, u());
|
|
10376
10383
|
};
|
|
10377
|
-
this._mixer.addEventListener("finished",
|
|
10378
|
-
})
|
|
10384
|
+
this._pendingFinishedCallback = f, this._mixer.addEventListener("finished", f);
|
|
10385
|
+
});
|
|
10379
10386
|
}
|
|
10380
10387
|
pauseAction(e) {
|
|
10381
10388
|
const t = this._actionsMap.get(e);
|
|
10382
10389
|
t && (t.paused = !0);
|
|
10383
10390
|
}
|
|
10384
10391
|
}
|
|
10385
|
-
const Bn = 0, Ac = 1, Tc = 2, Qr = 2,
|
|
10392
|
+
const Bn = 0, Ac = 1, Tc = 2, Qr = 2, cs = 1.25, Yr = 1, ii = 6 * 4 + 4 + 4, Zi = 65535, Sc = Math.pow(2, -24), us = Symbol("SKIP_GENERATION");
|
|
10386
10393
|
function Mc(o) {
|
|
10387
10394
|
return o.index ? o.index.count : o.attributes.position.count;
|
|
10388
10395
|
}
|
|
@@ -10433,7 +10440,7 @@ function Rc(o) {
|
|
|
10433
10440
|
let s = 0;
|
|
10434
10441
|
return t.forEach(({ count: a }) => s += a), e !== s;
|
|
10435
10442
|
}
|
|
10436
|
-
function
|
|
10443
|
+
function hs(o, e, t, i, s) {
|
|
10437
10444
|
let a = 1 / 0, n = 1 / 0, c = 1 / 0, u = -1 / 0, f = -1 / 0, d = -1 / 0, r = 1 / 0, l = 1 / 0, h = 1 / 0, m = -1 / 0, v = -1 / 0, p = -1 / 0;
|
|
10438
10445
|
for (let g = e * 6, _ = (e + t) * 6; g < _; g += 6) {
|
|
10439
10446
|
const y = o[g + 0], x = o[g + 1], w = y - x, A = y + x;
|
|
@@ -10516,7 +10523,7 @@ function Ec(o, e, t, i, s, a) {
|
|
|
10516
10523
|
n = Zr(o), n !== -1 && (c = Lc(t, i, s, n));
|
|
10517
10524
|
else if (a === Tc) {
|
|
10518
10525
|
const u = qt(o);
|
|
10519
|
-
let f =
|
|
10526
|
+
let f = cs * s;
|
|
10520
10527
|
const d = i * 6, r = (i + s) * 6;
|
|
10521
10528
|
for (let l = 0; l < 3; l++) {
|
|
10522
10529
|
const h = e[l], p = (e[l + 3] - h) / Pe;
|
|
@@ -10556,7 +10563,7 @@ function Ec(o, e, t, i, s, a) {
|
|
|
10556
10563
|
A !== 0 && (R = qt(C) / u);
|
|
10557
10564
|
let D = 0;
|
|
10558
10565
|
S !== 0 && (D = qt(M) / u);
|
|
10559
|
-
const T = Yr +
|
|
10566
|
+
const T = Yr + cs * (R * A + D * S);
|
|
10560
10567
|
T < f && (n = l, f = T, c = w.candidate);
|
|
10561
10568
|
}
|
|
10562
10569
|
} else {
|
|
@@ -10587,7 +10594,7 @@ function Ec(o, e, t, i, s, a) {
|
|
|
10587
10594
|
_ !== 0 && (M = qt(_i) / u);
|
|
10588
10595
|
const D = s - _;
|
|
10589
10596
|
D !== 0 && (R = qt(C) / u);
|
|
10590
|
-
const T = Yr +
|
|
10597
|
+
const T = Yr + cs * (M * _ + R * D);
|
|
10591
10598
|
T < f && (n = l, f = T, c = x.candidate);
|
|
10592
10599
|
}
|
|
10593
10600
|
}
|
|
@@ -10602,7 +10609,7 @@ function Lc(o, e, t, i) {
|
|
|
10602
10609
|
s += o[a * 6 + i * 2];
|
|
10603
10610
|
return s / t;
|
|
10604
10611
|
}
|
|
10605
|
-
class
|
|
10612
|
+
class fs {
|
|
10606
10613
|
constructor() {
|
|
10607
10614
|
this.boundingData = new Float32Array(6);
|
|
10608
10615
|
}
|
|
@@ -10690,7 +10697,7 @@ function Ls(o, e) {
|
|
|
10690
10697
|
return o + n.byteLength;
|
|
10691
10698
|
} else {
|
|
10692
10699
|
const n = e.offset, c = e.count;
|
|
10693
|
-
return $t[t + 6] = n, Li[i + 14] = c, Li[i + 15] =
|
|
10700
|
+
return $t[t + 6] = n, Li[i + 14] = c, Li[i + 15] = Zi, o + ii;
|
|
10694
10701
|
}
|
|
10695
10702
|
else {
|
|
10696
10703
|
const n = e.left, c = e.right, u = e.splitAxis;
|
|
@@ -10716,8 +10723,8 @@ function Uc(o, e, t, i, s) {
|
|
|
10716
10723
|
indirect: d
|
|
10717
10724
|
} = s, r = o._indirectBuffer, l = o.geometry, h = l.index ? l.index.array : null, m = d ? kc : Fc, v = zt(l), p = new Float32Array(6);
|
|
10718
10725
|
let g = !1;
|
|
10719
|
-
const _ = new
|
|
10720
|
-
return
|
|
10726
|
+
const _ = new fs();
|
|
10727
|
+
return hs(e, t, i, _.boundingData, p), x(_, t, i, p), _;
|
|
10721
10728
|
function y(w) {
|
|
10722
10729
|
f && f(w / v);
|
|
10723
10730
|
}
|
|
@@ -10732,10 +10739,10 @@ function Uc(o, e, t, i, s) {
|
|
|
10732
10739
|
y(A + S), w.offset = A, w.count = S;
|
|
10733
10740
|
else {
|
|
10734
10741
|
w.splitAxis = R.axis;
|
|
10735
|
-
const T = new
|
|
10736
|
-
w.left = T,
|
|
10737
|
-
const L = new
|
|
10738
|
-
w.right = L,
|
|
10742
|
+
const T = new fs(), I = A, P = D - A;
|
|
10743
|
+
w.left = T, hs(e, I, P, T.boundingData, p), x(T, I, P, p, M + 1);
|
|
10744
|
+
const L = new fs(), F = D, U = S - P;
|
|
10745
|
+
w.right = L, hs(e, F, U, L.boundingData, p), x(L, F, U, p, M + 1);
|
|
10739
10746
|
}
|
|
10740
10747
|
return w;
|
|
10741
10748
|
}
|
|
@@ -10843,12 +10850,12 @@ const Wc = function() {
|
|
|
10843
10850
|
return !1;
|
|
10844
10851
|
};
|
|
10845
10852
|
}(), Nc = 1e-15;
|
|
10846
|
-
function
|
|
10853
|
+
function ds(o) {
|
|
10847
10854
|
return Math.abs(o) < Nc;
|
|
10848
10855
|
}
|
|
10849
10856
|
class Ce extends Kt {
|
|
10850
10857
|
constructor(...e) {
|
|
10851
|
-
super(...e), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new b()), this.satBounds = new Array(4).fill().map(() => new Ve()), this.points = [this.a, this.b, this.c], this.sphere = new
|
|
10858
|
+
super(...e), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new b()), this.satBounds = new Array(4).fill().map(() => new Ve()), this.points = [this.a, this.b, this.c], this.sphere = new ji(), this.plane = new Ns(), this.needsUpdate = !0;
|
|
10852
10859
|
}
|
|
10853
10860
|
intersectsSphere(e) {
|
|
10854
10861
|
return Vc(e, this);
|
|
@@ -10884,13 +10891,13 @@ Ce.prototype.intersectsTriangle = function() {
|
|
|
10884
10891
|
for (let w = 0; w < 3; w++) {
|
|
10885
10892
|
const { start: A, end: S } = d;
|
|
10886
10893
|
A.copy(_[w]), S.copy(_[(w + 1) % 3]), d.delta(n);
|
|
10887
|
-
const C =
|
|
10888
|
-
if (
|
|
10894
|
+
const C = ds(p.distanceToPoint(A));
|
|
10895
|
+
if (ds(p.normal.dot(n)) && C) {
|
|
10889
10896
|
g.copy(d), y = 2;
|
|
10890
10897
|
break;
|
|
10891
10898
|
}
|
|
10892
10899
|
const M = p.intersectLine(d, h);
|
|
10893
|
-
if (!M && C && h.copy(A), (M || C) && !
|
|
10900
|
+
if (!M && C && h.copy(A), (M || C) && !ds(h.distanceTo(S))) {
|
|
10894
10901
|
if (y <= 1)
|
|
10895
10902
|
(y === 1 ? g.start : g.end).copy(h), C && (x = y);
|
|
10896
10903
|
else if (y >= 2) {
|
|
@@ -11214,7 +11221,7 @@ function Fs(o, e, t, i, s = null, a = 0, n = 0) {
|
|
|
11214
11221
|
return !!M;
|
|
11215
11222
|
}
|
|
11216
11223
|
}
|
|
11217
|
-
const jt = /* @__PURE__ */ new b(),
|
|
11224
|
+
const jt = /* @__PURE__ */ new b(), ps = /* @__PURE__ */ new b();
|
|
11218
11225
|
function Qc(o, e, t = {}, i = 0, s = 1 / 0) {
|
|
11219
11226
|
const a = i * i, n = s * s;
|
|
11220
11227
|
let c = 1 / 0, u = null;
|
|
@@ -11225,13 +11232,13 @@ function Qc(o, e, t = {}, i = 0, s = 1 / 0) {
|
|
|
11225
11232
|
intersectsTriangle: (d, r) => {
|
|
11226
11233
|
d.closestPointToPoint(e, jt);
|
|
11227
11234
|
const l = e.distanceToSquared(jt);
|
|
11228
|
-
return l < c && (
|
|
11235
|
+
return l < c && (ps.copy(jt), c = l, u = r), l < a;
|
|
11229
11236
|
}
|
|
11230
11237
|
}
|
|
11231
11238
|
), c === 1 / 0)
|
|
11232
11239
|
return null;
|
|
11233
11240
|
const f = Math.sqrt(c);
|
|
11234
|
-
return t.point ? t.point.copy(
|
|
11241
|
+
return t.point ? t.point.copy(ps) : t.point = ps.clone(), t.distance = f, t.faceIndex = u, t;
|
|
11235
11242
|
}
|
|
11236
11243
|
const gt = /* @__PURE__ */ new b(), vt = /* @__PURE__ */ new b(), _t = /* @__PURE__ */ new b(), xi = /* @__PURE__ */ new z(), wi = /* @__PURE__ */ new z(), bi = /* @__PURE__ */ new z(), Jr = /* @__PURE__ */ new b(), $r = /* @__PURE__ */ new b(), en = /* @__PURE__ */ new b(), Ai = /* @__PURE__ */ new b();
|
|
11237
11244
|
function Yc(o, e, t, i, s, a, n, c) {
|
|
@@ -11260,7 +11267,7 @@ function Zc(o, e, t, i, s, a, n, c, u, f, d) {
|
|
|
11260
11267
|
}
|
|
11261
11268
|
return r;
|
|
11262
11269
|
}
|
|
11263
|
-
function
|
|
11270
|
+
function Xi(o, e, t, i, s, a, n) {
|
|
11264
11271
|
const c = i * 3;
|
|
11265
11272
|
let u = c + 0, f = c + 1, d = c + 2;
|
|
11266
11273
|
const r = o.index;
|
|
@@ -11276,14 +11283,14 @@ function Z(o, e, t, i) {
|
|
|
11276
11283
|
function Xc(o, e, t, i, s, a, n, c) {
|
|
11277
11284
|
const { geometry: u, _indirectBuffer: f } = o;
|
|
11278
11285
|
for (let d = i, r = i + s; d < r; d++)
|
|
11279
|
-
|
|
11286
|
+
Xi(u, e, t, d, a, n, c);
|
|
11280
11287
|
}
|
|
11281
11288
|
function Kc(o, e, t, i, s, a, n) {
|
|
11282
11289
|
const { geometry: c, _indirectBuffer: u } = o;
|
|
11283
11290
|
let f = 1 / 0, d = null;
|
|
11284
11291
|
for (let r = i, l = i + s; r < l; r++) {
|
|
11285
11292
|
let h;
|
|
11286
|
-
h =
|
|
11293
|
+
h = Xi(c, e, t, r, null, a, n), h && h.distance < f && (d = h, f = h.distance);
|
|
11287
11294
|
}
|
|
11288
11295
|
return d;
|
|
11289
11296
|
}
|
|
@@ -11305,7 +11312,7 @@ function $c(o, e = null) {
|
|
|
11305
11312
|
a = d[l], n = new Uint32Array(a), c = new Uint16Array(a), u = new Float32Array(a), r(0, f), f += a.byteLength;
|
|
11306
11313
|
function r(l, h, m = !1) {
|
|
11307
11314
|
const v = l * 2;
|
|
11308
|
-
if (c[v + 15] ===
|
|
11315
|
+
if (c[v + 15] === Zi) {
|
|
11309
11316
|
const g = n[l + 6], _ = c[v + 14];
|
|
11310
11317
|
let y = 1 / 0, x = 1 / 0, w = 1 / 0, A = -1 / 0, S = -1 / 0, C = -1 / 0;
|
|
11311
11318
|
for (let M = 3 * g, R = 3 * (g + _); M < R; M++) {
|
|
@@ -11343,7 +11350,7 @@ function eu(o, e, t, i, s, a, n, c) {
|
|
|
11343
11350
|
const { geometry: u, _indirectBuffer: f } = o;
|
|
11344
11351
|
for (let d = i, r = i + s; d < r; d++) {
|
|
11345
11352
|
let l = f ? f[d] : d;
|
|
11346
|
-
|
|
11353
|
+
Xi(u, e, t, l, a, n, c);
|
|
11347
11354
|
}
|
|
11348
11355
|
}
|
|
11349
11356
|
function tu(o, e, t, i, s, a, n) {
|
|
@@ -11351,7 +11358,7 @@ function tu(o, e, t, i, s, a, n) {
|
|
|
11351
11358
|
let f = 1 / 0, d = null;
|
|
11352
11359
|
for (let r = i, l = i + s; r < l; r++) {
|
|
11353
11360
|
let h;
|
|
11354
|
-
h =
|
|
11361
|
+
h = Xi(c, e, t, u ? u[r] : r, null, a, n), h && h.distance < f && (d = h, f = h.distance);
|
|
11355
11362
|
}
|
|
11356
11363
|
return d;
|
|
11357
11364
|
}
|
|
@@ -11441,16 +11448,16 @@ function Os(o, e, t, i, s = null) {
|
|
|
11441
11448
|
return j(d, a, Ti), !!(s.intersectsBox(Ti) && Os(d, e, t, i, s) || (j(r, a, Ti), s.intersectsBox(Ti) && Os(r, e, t, i, s)));
|
|
11442
11449
|
}
|
|
11443
11450
|
}
|
|
11444
|
-
const Mi = /* @__PURE__ */ new J(),
|
|
11451
|
+
const Mi = /* @__PURE__ */ new J(), ms = /* @__PURE__ */ new re(), Yt = /* @__PURE__ */ new re(), au = /* @__PURE__ */ new b(), lu = /* @__PURE__ */ new b(), cu = /* @__PURE__ */ new b(), uu = /* @__PURE__ */ new b();
|
|
11445
11452
|
function hu(o, e, t, i = {}, s = {}, a = 0, n = 1 / 0) {
|
|
11446
|
-
e.boundingBox || e.computeBoundingBox(),
|
|
11453
|
+
e.boundingBox || e.computeBoundingBox(), ms.set(e.boundingBox.min, e.boundingBox.max, t), ms.needsUpdate = !0;
|
|
11447
11454
|
const c = o.geometry, u = c.attributes.position, f = c.index, d = e.attributes.position, r = e.index, l = xe.getPrimitive(), h = xe.getPrimitive();
|
|
11448
11455
|
let m = au, v = lu, p = null, g = null;
|
|
11449
11456
|
s && (p = cu, g = uu);
|
|
11450
11457
|
let _ = 1 / 0, y = null, x = null;
|
|
11451
11458
|
return Mi.copy(t).invert(), Yt.matrix.copy(Mi), o.shapecast(
|
|
11452
11459
|
{
|
|
11453
|
-
boundsTraverseOrder: (w) =>
|
|
11460
|
+
boundsTraverseOrder: (w) => ms.distanceToBox(w),
|
|
11454
11461
|
intersectsBounds: (w, A, S) => S < _ && S < n ? (A && (Yt.min.copy(w.min), Yt.max.copy(w.max), Yt.needsUpdate = !0), !0) : !1,
|
|
11455
11462
|
intersectsRange: (w, A) => {
|
|
11456
11463
|
if (e.boundsTree)
|
|
@@ -11494,7 +11501,7 @@ function fu(o, e = null) {
|
|
|
11494
11501
|
a = d[l], n = new Uint32Array(a), c = new Uint16Array(a), u = new Float32Array(a), r(0, f), f += a.byteLength;
|
|
11495
11502
|
function r(l, h, m = !1) {
|
|
11496
11503
|
const v = l * 2;
|
|
11497
|
-
if (c[v + 15] ===
|
|
11504
|
+
if (c[v + 15] === Zi) {
|
|
11498
11505
|
const g = n[l + 6], _ = c[v + 14];
|
|
11499
11506
|
let y = 1 / 0, x = 1 / 0, w = 1 / 0, A = -1 / 0, S = -1 / 0, C = -1 / 0;
|
|
11500
11507
|
for (let M = g, R = g + _; M < R; M++) {
|
|
@@ -11604,16 +11611,16 @@ function Hs(o, e, t, i, s = null) {
|
|
|
11604
11611
|
return j(d, a, Ci), !!(s.intersectsBox(Ci) && Hs(d, e, t, i, s) || (j(r, a, Ci), s.intersectsBox(Ci) && Hs(r, e, t, i, s)));
|
|
11605
11612
|
}
|
|
11606
11613
|
}
|
|
11607
|
-
const Ri = /* @__PURE__ */ new J(),
|
|
11614
|
+
const Ri = /* @__PURE__ */ new J(), gs = /* @__PURE__ */ new re(), Xt = /* @__PURE__ */ new re(), vu = /* @__PURE__ */ new b(), _u = /* @__PURE__ */ new b(), yu = /* @__PURE__ */ new b(), xu = /* @__PURE__ */ new b();
|
|
11608
11615
|
function wu(o, e, t, i = {}, s = {}, a = 0, n = 1 / 0) {
|
|
11609
|
-
e.boundingBox || e.computeBoundingBox(),
|
|
11616
|
+
e.boundingBox || e.computeBoundingBox(), gs.set(e.boundingBox.min, e.boundingBox.max, t), gs.needsUpdate = !0;
|
|
11610
11617
|
const c = o.geometry, u = c.attributes.position, f = c.index, d = e.attributes.position, r = e.index, l = xe.getPrimitive(), h = xe.getPrimitive();
|
|
11611
11618
|
let m = vu, v = _u, p = null, g = null;
|
|
11612
11619
|
s && (p = yu, g = xu);
|
|
11613
11620
|
let _ = 1 / 0, y = null, x = null;
|
|
11614
11621
|
return Ri.copy(t).invert(), Xt.matrix.copy(Ri), o.shapecast(
|
|
11615
11622
|
{
|
|
11616
|
-
boundsTraverseOrder: (w) =>
|
|
11623
|
+
boundsTraverseOrder: (w) => gs.distanceToBox(w),
|
|
11617
11624
|
intersectsBounds: (w, A, S) => S < _ && S < n ? (A && (Xt.min.copy(w.min), Xt.max.copy(w.max), Xt.needsUpdate = !0), !0) : !1,
|
|
11618
11625
|
intersectsRange: (w, A) => {
|
|
11619
11626
|
if (e.boundsTree) {
|
|
@@ -11655,12 +11662,12 @@ function wu(o, e, t, i = {}, s = {}, a = 0, n = 1 / 0) {
|
|
|
11655
11662
|
function bu() {
|
|
11656
11663
|
return typeof SharedArrayBuffer < "u";
|
|
11657
11664
|
}
|
|
11658
|
-
const si = new N.constructor(),
|
|
11659
|
-
let
|
|
11665
|
+
const si = new N.constructor(), Wi = new N.constructor(), Xe = new $s(() => new Y()), At = new Y(), Tt = new Y(), vs = new Y(), _s = new Y();
|
|
11666
|
+
let ys = !1;
|
|
11660
11667
|
function Au(o, e, t, i) {
|
|
11661
|
-
if (
|
|
11668
|
+
if (ys)
|
|
11662
11669
|
throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");
|
|
11663
|
-
|
|
11670
|
+
ys = !0;
|
|
11664
11671
|
const s = o._roots, a = e._roots;
|
|
11665
11672
|
let n, c = 0, u = 0;
|
|
11666
11673
|
const f = new J().copy(t).invert();
|
|
@@ -11668,7 +11675,7 @@ function Au(o, e, t, i) {
|
|
|
11668
11675
|
si.setBuffer(s[d]), u = 0;
|
|
11669
11676
|
const l = Xe.getPrimitive();
|
|
11670
11677
|
j(0, si.float32Array, l), l.applyMatrix4(f);
|
|
11671
|
-
for (let h = 0, m = a.length; h < m && (
|
|
11678
|
+
for (let h = 0, m = a.length; h < m && (Wi.setBuffer(a[d]), n = Ae(
|
|
11672
11679
|
0,
|
|
11673
11680
|
0,
|
|
11674
11681
|
t,
|
|
@@ -11679,16 +11686,16 @@ function Au(o, e, t, i) {
|
|
|
11679
11686
|
0,
|
|
11680
11687
|
0,
|
|
11681
11688
|
l
|
|
11682
|
-
),
|
|
11689
|
+
), Wi.clearBuffer(), u += a[h].length, !n); h++)
|
|
11683
11690
|
;
|
|
11684
11691
|
if (Xe.releasePrimitive(l), si.clearBuffer(), c += s[d].length, n)
|
|
11685
11692
|
break;
|
|
11686
11693
|
}
|
|
11687
|
-
return
|
|
11694
|
+
return ys = !1, n;
|
|
11688
11695
|
}
|
|
11689
11696
|
function Ae(o, e, t, i, s, a = 0, n = 0, c = 0, u = 0, f = null, d = !1) {
|
|
11690
11697
|
let r, l;
|
|
11691
|
-
d ? (r =
|
|
11698
|
+
d ? (r = Wi, l = si) : (r = si, l = Wi);
|
|
11692
11699
|
const h = r.float32Array, m = r.uint32Array, v = r.uint16Array, p = l.float32Array, g = l.uint32Array, _ = l.uint16Array, y = o * 2, x = e * 2, w = ae(y, v), A = ae(x, _);
|
|
11693
11700
|
let S = !1;
|
|
11694
11701
|
if (A && w)
|
|
@@ -11744,8 +11751,8 @@ function Ae(o, e, t, i, s, a = 0, n = 0, c = 0, u = 0, f = null, d = !1) {
|
|
|
11744
11751
|
), Xe.releasePrimitive(C);
|
|
11745
11752
|
} else {
|
|
11746
11753
|
const C = _e(e), M = ye(e, g);
|
|
11747
|
-
j(C, p,
|
|
11748
|
-
const R = f.intersectsBox(
|
|
11754
|
+
j(C, p, vs), j(M, p, _s);
|
|
11755
|
+
const R = f.intersectsBox(vs), D = f.intersectsBox(_s);
|
|
11749
11756
|
if (R && D)
|
|
11750
11757
|
S = Ae(
|
|
11751
11758
|
o,
|
|
@@ -11789,7 +11796,7 @@ function Ae(o, e, t, i, s, a = 0, n = 0, c = 0, u = 0, f = null, d = !1) {
|
|
|
11789
11796
|
);
|
|
11790
11797
|
else {
|
|
11791
11798
|
const T = Xe.getPrimitive();
|
|
11792
|
-
T.copy(
|
|
11799
|
+
T.copy(vs).applyMatrix4(t);
|
|
11793
11800
|
const I = _e(o), P = ye(o, m);
|
|
11794
11801
|
j(I, h, At), j(P, h, Tt);
|
|
11795
11802
|
const L = T.intersectsBox(At), F = T.intersectsBox(Tt);
|
|
@@ -11836,7 +11843,7 @@ function Ae(o, e, t, i, s, a = 0, n = 0, c = 0, u = 0, f = null, d = !1) {
|
|
|
11836
11843
|
);
|
|
11837
11844
|
else {
|
|
11838
11845
|
const T = Xe.getPrimitive();
|
|
11839
|
-
T.copy(
|
|
11846
|
+
T.copy(_s).applyMatrix4(t);
|
|
11840
11847
|
const I = _e(o), P = ye(o, m);
|
|
11841
11848
|
j(I, h, At), j(P, h, Tt);
|
|
11842
11849
|
const L = T.intersectsBox(At), F = T.intersectsBox(Tt);
|
|
@@ -11903,7 +11910,7 @@ class er {
|
|
|
11903
11910
|
indirect: !!e.indirectBuffer,
|
|
11904
11911
|
...i
|
|
11905
11912
|
};
|
|
11906
|
-
const { index: s, roots: a, indirectBuffer: n } = e, c = new er(t, { ...i, [
|
|
11913
|
+
const { index: s, roots: a, indirectBuffer: n } = e, c = new er(t, { ...i, [us]: !0 });
|
|
11907
11914
|
if (c._roots = a, c._indirectBuffer = n || null, i.setIndex) {
|
|
11908
11915
|
const u = t.getIndex();
|
|
11909
11916
|
if (u === null) {
|
|
@@ -11927,10 +11934,10 @@ class er {
|
|
|
11927
11934
|
...Tu,
|
|
11928
11935
|
// undocumented options
|
|
11929
11936
|
// Whether to skip generating the tree. Used for deserialization.
|
|
11930
|
-
[
|
|
11937
|
+
[us]: !1
|
|
11931
11938
|
}, t), t.useSharedArrayBuffer && !bu())
|
|
11932
11939
|
throw new Error("MeshBVH: SharedArrayBuffer is not available.");
|
|
11933
|
-
this.geometry = e, this._roots = null, this._indirectBuffer = null, t[
|
|
11940
|
+
this.geometry = e, this._roots = null, this._indirectBuffer = null, t[us] || (Hc(this, t), !e.boundingBox && t.setBoundingBox && (e.boundingBox = this.getBoundingBox(new Y()))), this.resolveTriangleIndex = t.indirect ? (i) => this._indirectBuffer[i] : (i) => i;
|
|
11934
11941
|
}
|
|
11935
11942
|
refit(e = null) {
|
|
11936
11943
|
return (this.indirect ? fu : $c)(this, e);
|
|
@@ -11939,7 +11946,7 @@ class er {
|
|
|
11939
11946
|
const i = this._roots[t], s = new Uint32Array(i), a = new Uint16Array(i);
|
|
11940
11947
|
n(0);
|
|
11941
11948
|
function n(c, u = 0) {
|
|
11942
|
-
const f = c * 2, d = a[f + 15] ===
|
|
11949
|
+
const f = c * 2, d = a[f + 15] === Zi;
|
|
11943
11950
|
if (d) {
|
|
11944
11951
|
const r = s[c + 6], l = a[f + 14];
|
|
11945
11952
|
e(u, d, new Float32Array(i, c * 4, 6), r, l);
|
|
@@ -11950,7 +11957,7 @@ class er {
|
|
|
11950
11957
|
}
|
|
11951
11958
|
}
|
|
11952
11959
|
/* Core Cast Functions */
|
|
11953
|
-
raycast(e, t =
|
|
11960
|
+
raycast(e, t = ws, i = 0, s = 1 / 0) {
|
|
11954
11961
|
const a = this._roots, n = this.geometry, c = [], u = t.isMaterial, f = Array.isArray(t), d = n.groups, r = u ? t.side : t, l = this.indirect ? du : su;
|
|
11955
11962
|
for (let h = 0, m = a.length; h < m; h++) {
|
|
11956
11963
|
const v = f ? t[d[h].materialIndex].side : r, p = c.length;
|
|
@@ -11962,7 +11969,7 @@ class er {
|
|
|
11962
11969
|
}
|
|
11963
11970
|
return c;
|
|
11964
11971
|
}
|
|
11965
|
-
raycastFirst(e, t =
|
|
11972
|
+
raycastFirst(e, t = ws, i = 0, s = 1 / 0) {
|
|
11966
11973
|
const a = this._roots, n = this.geometry, c = t.isMaterial, u = Array.isArray(t);
|
|
11967
11974
|
let f = null;
|
|
11968
11975
|
const d = n.groups, r = c ? t.side : t, l = this.indirect ? mu : nu;
|
|
@@ -13064,18 +13071,18 @@ const Wu = () => {
|
|
|
13064
13071
|
}, Vu = new ni({ colorWrite: !1 });
|
|
13065
13072
|
class Eh {
|
|
13066
13073
|
constructor(e) {
|
|
13067
|
-
this.props = e, this.stats = new ti(), this.scene = new
|
|
13074
|
+
this.props = e, this.stats = new ti(), this.scene = new bs(), this.overlayScene = new bs(), this.renderer = new fo({
|
|
13068
13075
|
antialias: !0,
|
|
13069
13076
|
alpha: !0,
|
|
13070
13077
|
logarithmicDepthBuffer: !0,
|
|
13071
13078
|
powerPreference: "high-performance",
|
|
13072
13079
|
preserveDrawingBuffer: !0
|
|
13073
|
-
}), this.css2dRenderer = new yo(), this.mousePos = new z(), this.mouseCoord = new z(), this.offset = new z(), this.size = new z(), this.amr = new bc({ showSizeBox: !0, showController: !0 }), this._selectedForOutline = [], this._clock = new
|
|
13080
|
+
}), this.css2dRenderer = new yo(), this.mousePos = new z(), this.mouseCoord = new z(), this.offset = new z(), this.size = new z(), this.amr = new bc({ showSizeBox: !0, showController: !0 }), this._selectedForOutline = [], this._clock = new qi(!0), this._uiHiddenTime = this._clock.getElapsedTime(), this.camera = new Gi(
|
|
13074
13081
|
39.6,
|
|
13075
13082
|
window.innerWidth / window.innerHeight,
|
|
13076
13083
|
0.1,
|
|
13077
13084
|
1e4
|
|
13078
|
-
), this.d = 2, this.orthographicCamera = new
|
|
13085
|
+
), this.d = 2, this.orthographicCamera = new Ss(
|
|
13079
13086
|
-this.d * (window.innerWidth / window.innerHeight),
|
|
13080
13087
|
this.d * (window.innerWidth / window.innerHeight),
|
|
13081
13088
|
this.d,
|
|
@@ -13148,16 +13155,16 @@ class Eh {
|
|
|
13148
13155
|
me.getZ(Ne)
|
|
13149
13156
|
), Nn) {
|
|
13150
13157
|
l.set(0, 0, 0);
|
|
13151
|
-
let
|
|
13158
|
+
let Ki = 0;
|
|
13152
13159
|
for (let ht = 0; ht < ce.length; ht++) {
|
|
13153
13160
|
const li = tr[ht] || 0;
|
|
13154
|
-
li && (
|
|
13161
|
+
li && (Ki += li, h.set(
|
|
13155
13162
|
ce[ht].getX(Ne),
|
|
13156
13163
|
ce[ht].getY(Ne),
|
|
13157
13164
|
ce[ht].getZ(Ne)
|
|
13158
13165
|
), q.morphTargetsRelative, l.addScaledVector(h, li));
|
|
13159
13166
|
}
|
|
13160
|
-
q.morphTargetsRelative ? r.add(l) :
|
|
13167
|
+
q.morphTargetsRelative ? r.add(l) : Ki > 0 && (r.multiplyScalar(1 - Ki), r.add(l));
|
|
13161
13168
|
}
|
|
13162
13169
|
m.copy(r).applyMatrix4(W.matrixWorld), f.expandByPoint(m);
|
|
13163
13170
|
}
|
|
@@ -13378,7 +13385,7 @@ class Eh {
|
|
|
13378
13385
|
return this._mainCamera;
|
|
13379
13386
|
}
|
|
13380
13387
|
set mainCamera(e) {
|
|
13381
|
-
this._mainCamera = e, e instanceof
|
|
13388
|
+
this._mainCamera = e, e instanceof Ss ? this.scene.background = null : this.scene.background = this.scene.environment;
|
|
13382
13389
|
}
|
|
13383
13390
|
showState() {
|
|
13384
13391
|
this.stats.dom.style.display = "block";
|
|
@@ -13580,7 +13587,7 @@ class Eh {
|
|
|
13580
13587
|
}
|
|
13581
13588
|
class Nu {
|
|
13582
13589
|
constructor(e) {
|
|
13583
|
-
this.deps = e, this.canvas = null, this.pixelBuffer = null, this.orthoCamera = new
|
|
13590
|
+
this.deps = e, this.canvas = null, this.pixelBuffer = null, this.orthoCamera = new Ss(-1, 1, 1, -1, 0.1, 1e3), this.orthoCamera.position.set(0, 0, 5), this.perspectiveCamera = new Gi(45, 1, 0.1, 2e3);
|
|
13584
13591
|
}
|
|
13585
13592
|
async capture(e) {
|
|
13586
13593
|
var m, v, p, g, _, y;
|
|
@@ -13651,7 +13658,7 @@ class Nu {
|
|
|
13651
13658
|
];
|
|
13652
13659
|
}
|
|
13653
13660
|
computeBounds(e) {
|
|
13654
|
-
const t = new Y(), i = new Y(), s = new b(), a = new b(), n = new
|
|
13661
|
+
const t = new Y(), i = new Y(), s = new b(), a = new b(), n = new ji();
|
|
13655
13662
|
return e.updateMatrixWorld(!0), e.traverse((c) => {
|
|
13656
13663
|
if (!c.visible)
|
|
13657
13664
|
return;
|
|
@@ -13766,7 +13773,7 @@ class Nu {
|
|
|
13766
13773
|
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;
|
|
13767
13774
|
}
|
|
13768
13775
|
}
|
|
13769
|
-
const Gu = "shop-components", qu = "0.4.
|
|
13776
|
+
const Gu = "shop-components", qu = "0.4.6", ju = "Shop components", Qu = "dist/shop-components.umd.js", Yu = "dist/shop-components.mjs", Zu = "dist/main.d.ts", Xu = {
|
|
13770
13777
|
dts: "tsc --emitDeclarationOnly & tsc & storybook build -o dist",
|
|
13771
13778
|
dev: "vite dev",
|
|
13772
13779
|
build: "vite build",
|
|
@@ -13829,7 +13836,7 @@ try {
|
|
|
13829
13836
|
export {
|
|
13830
13837
|
bc as Amr,
|
|
13831
13838
|
jr as Logo,
|
|
13832
|
-
|
|
13839
|
+
Hi as SGLBLoader,
|
|
13833
13840
|
$ as SLOT_EVENTS,
|
|
13834
13841
|
Eh as Scene3D,
|
|
13835
13842
|
on as Skin,
|