shop-components 0.4.30 → 0.4.31
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.mjs
CHANGED
|
@@ -4,13 +4,13 @@ var L = (a, e, t) => (fo(a, typeof e != "symbol" ? e + "" : e, t), t), vr = (a,
|
|
|
4
4
|
if (!e.has(a))
|
|
5
5
|
throw TypeError("Cannot " + t);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var Q = (a, e, t) => (vr(a, e, "read from private field"), t ? t.call(a) : e.get(a)), et = (a, e, t) => {
|
|
8
8
|
if (e.has(a))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
e instanceof WeakSet ? e.add(a) : e.set(a, t);
|
|
11
11
|
}, Fe = (a, e, t, i) => (vr(a, e, "write to private field"), i ? i.call(a, t) : e.set(a, t), t);
|
|
12
12
|
import * as W from "three";
|
|
13
|
-
import { BufferAttribute as ve, BufferGeometry as re, Matrix4 as te, Matrix3 as In, Vector3 as b, Vector4 as
|
|
13
|
+
import { BufferAttribute as ve, BufferGeometry as re, Matrix4 as te, Matrix3 as In, Vector3 as b, Vector4 as ut, MeshBasicMaterial as ze, Mesh as q, ShaderMaterial as Gt, NoBlending as di, WebGLRenderTarget as je, FloatType as xe, RGBAFormat as ce, NearestFilter as le, Vector2 as V, PerspectiveCamera as ss, DataUtils as Ge, DataTexture as qe, HalfFloatType as Pe, LinearFilter as De, RepeatWrapping as ht, RedFormat as Fs, ClampToEdgeWrapping as Ze, Source as po, Quaternion as ee, DataArrayTexture as mo, DoubleSide as gi, BackSide as Dn, FrontSide as Bs, Color as X, WebGLArrayRenderTarget as go, UnsignedByteType as nr, NoToneMapping as _o, RGFormat as vo, NormalBlending as Pn, Spherical as yo, EquirectangularReflectionMapping as Xi, LinearMipMapLinearFilter as xo, Clock as rs, Scene as Os, AdditiveBlending as wo, Box3 as J, Sphere as ns, CompressedTexture as bo, Texture as nt, InterleavedBuffer as Ao, InterleavedBufferAttribute as To, TextureLoader as En, MeshStandardMaterial as ji, Group as Ee, LineSegments as zs, LineBasicMaterial as Ws, Object3D as Re, LineDashedMaterial as Us, RingGeometry as yr, BoxGeometry as So, EdgesGeometry as Mo, SRGBColorSpace as pi, Raycaster as Rn, CircleGeometry as xr, TorusGeometry as wr, OctahedronGeometry as Co, Float32BufferAttribute as Io, Line as Do, EventDispatcher as Po, PlaneGeometry as mi, AxesHelper as cs, AnimationMixer as br, VideoTexture as Eo, LinearMipmapLinearFilter as Ro, MathUtils as Qe, LoopRepeat as Lo, LoopOnce as ko, Plane as or, Line3 as Ye, Triangle as oi, DirectionalLight as Fo, NoColorSpace as Ar, MeshLambertMaterial as Bo, DirectionalLightHelper as Oo, PlaneHelper as zo, UniformsUtils as Wo, WebGLRenderer as Uo, OrthographicCamera as Hs, MeshPhysicalMaterial as Ho, ACESFilmicToneMapping as No, Euler as Vo } from "three";
|
|
14
14
|
import { HDRLoader as Tr } from "three/examples/jsm/loaders/HDRLoader.js";
|
|
15
15
|
import { OrbitControls as Go } from "three/examples/jsm/controls/OrbitControls";
|
|
16
16
|
import { CSS2DObject as Ke, CSS2DRenderer as Qo } from "three/examples/jsm/renderers/CSS2DRenderer";
|
|
@@ -222,7 +222,7 @@ class ha {
|
|
|
222
222
|
return !(this.matrixWorld.equals(e.matrixWorld) && this.geometryHash === Sr(t) && this.skeletonHash === Mr(e) && this.primitiveCount === i);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
const
|
|
225
|
+
const dt = /* @__PURE__ */ new b(), pt = /* @__PURE__ */ new b(), mt = /* @__PURE__ */ new b(), Cr = /* @__PURE__ */ new ut(), bi = /* @__PURE__ */ new b(), fs = /* @__PURE__ */ new b(), Ir = /* @__PURE__ */ new ut(), Dr = /* @__PURE__ */ new ut(), Ai = /* @__PURE__ */ new te(), Pr = /* @__PURE__ */ new te();
|
|
226
226
|
function Er(a, e, t) {
|
|
227
227
|
const i = a.skeleton, s = a.geometry, r = i.bones, o = i.boneInverses;
|
|
228
228
|
Ir.fromBufferAttribute(s.attributes.skinIndex, e), Dr.fromBufferAttribute(s.attributes.skinWeight, e), Ai.elements.fill(0);
|
|
@@ -279,7 +279,7 @@ function da(a, e = {}, t = new re()) {
|
|
|
279
279
|
const u = c.position, d = r ? c.normal : null, n = o ? c.tangent : null, l = i.morphAttributes.position, f = i.morphAttributes.normal, m = i.morphAttributes.tangent, _ = i.morphTargetsRelative, p = a.morphTargetInfluences, g = new In();
|
|
280
280
|
g.getNormalMatrix(a.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
|
+
dt.fromBufferAttribute(u, v), d && pt.fromBufferAttribute(d, v), n && (Cr.fromBufferAttribute(n, v), mt.fromBufferAttribute(n, v)), p && (l && ds(l, p, _, v, dt), f && ds(f, p, _, v, pt), m && ds(m, p, _, v, mt)), a.isSkinnedMesh && (a.applyBoneTransform(v, dt), d && Er(a, v, pt), n && Er(a, v, mt)), s && dt.applyMatrix4(a.matrixWorld), h.position.setXYZ(v, dt.x, dt.y, dt.z), d && (s && pt.applyNormalMatrix(g), h.normal.setXYZ(v, pt.x, pt.y, pt.z)), n && (s && mt.transformDirection(a.matrixWorld), h.tangent.setXYZW(v, mt.x, mt.y, mt.z, Cr.w));
|
|
283
283
|
for (const v in e.attributes) {
|
|
284
284
|
const y = e.attributes[v];
|
|
285
285
|
y === "position" || y === "tangent" || y === "normal" || !(y in c) || (h[y] || t.setAttribute(y, ai(c[y])), kt(c[y], h[y]), Fn(c[y], h[y]));
|
|
@@ -778,7 +778,7 @@ class Sa extends cr {
|
|
|
778
778
|
super({
|
|
779
779
|
blending: di,
|
|
780
780
|
uniforms: {
|
|
781
|
-
resolution: { value: new
|
|
781
|
+
resolution: { value: new V() }
|
|
782
782
|
},
|
|
783
783
|
vertexShader: (
|
|
784
784
|
/* glsl */
|
|
@@ -817,9 +817,9 @@ class Ma {
|
|
|
817
817
|
generate(e, t = 256) {
|
|
818
818
|
const i = new je(t, t, {
|
|
819
819
|
type: xe,
|
|
820
|
-
format:
|
|
821
|
-
minFilter:
|
|
822
|
-
magFilter:
|
|
820
|
+
format: ce,
|
|
821
|
+
minFilter: le,
|
|
822
|
+
magFilter: le,
|
|
823
823
|
generateMipmaps: !1
|
|
824
824
|
}), s = e.getRenderTarget();
|
|
825
825
|
e.setRenderTarget(i);
|
|
@@ -866,18 +866,18 @@ function Rr(a, e, t = 0, i = a.length) {
|
|
|
866
866
|
function Da(a, e, t) {
|
|
867
867
|
return 0.2126 * a + 0.7152 * e + 0.0722 * t;
|
|
868
868
|
}
|
|
869
|
-
function Pa(a, e =
|
|
869
|
+
function Pa(a, e = Pe) {
|
|
870
870
|
const t = a.clone();
|
|
871
871
|
t.source = new po({ ...t.image });
|
|
872
872
|
const { width: i, height: s, data: r } = t.image;
|
|
873
873
|
let o = r;
|
|
874
874
|
if (t.type !== e) {
|
|
875
|
-
e ===
|
|
875
|
+
e === Pe ? o = new Uint16Array(r.length) : o = new Float32Array(r.length);
|
|
876
876
|
let c;
|
|
877
877
|
r instanceof Int8Array || r instanceof Int16Array || r instanceof Int32Array ? c = 2 ** (8 * r.BYTES_PER_ELEMENT - 1) - 1 : c = 2 ** (8 * r.BYTES_PER_ELEMENT) - 1;
|
|
878
878
|
for (let h = 0, u = r.length; h < u; h++) {
|
|
879
879
|
let d = r[h];
|
|
880
|
-
t.type ===
|
|
880
|
+
t.type === Pe && (d = Ge.fromHalfFloat(r[h])), t.type !== xe && t.type !== Pe && (d /= c), e === Pe && (o[h] = Ge.toHalfFloat(d));
|
|
881
881
|
}
|
|
882
882
|
t.image.data = o, t.type = e;
|
|
883
883
|
}
|
|
@@ -896,25 +896,25 @@ function Pa(a, e = De) {
|
|
|
896
896
|
class Ea {
|
|
897
897
|
constructor() {
|
|
898
898
|
const e = new qe(ps(new Float32Array([0, 0, 0, 0])), 1, 1);
|
|
899
|
-
e.type =
|
|
899
|
+
e.type = Pe, e.format = ce, e.minFilter = De, e.magFilter = De, e.wrapS = ht, e.wrapT = ht, e.generateMipmaps = !1, e.needsUpdate = !0;
|
|
900
900
|
const t = new qe(ps(new Float32Array([0, 1])), 1, 2);
|
|
901
|
-
t.type =
|
|
901
|
+
t.type = Pe, t.format = Fs, t.minFilter = De, t.magFilter = De, t.generateMipmaps = !1, t.needsUpdate = !0;
|
|
902
902
|
const i = new qe(ps(new Float32Array([0, 0, 1, 1])), 2, 2);
|
|
903
|
-
i.type =
|
|
903
|
+
i.type = Pe, i.format = Fs, i.minFilter = De, i.magFilter = De, i.generateMipmaps = !1, i.needsUpdate = !0, this.map = e, this.marginalWeights = t, this.conditionalWeights = i, this.totalSum = 0;
|
|
904
904
|
}
|
|
905
905
|
dispose() {
|
|
906
906
|
this.marginalWeights.dispose(), this.conditionalWeights.dispose(), this.map.dispose();
|
|
907
907
|
}
|
|
908
908
|
updateFrom(e) {
|
|
909
909
|
const t = Pa(e);
|
|
910
|
-
t.wrapS =
|
|
910
|
+
t.wrapS = ht, t.wrapT = Ze;
|
|
911
911
|
const { width: i, height: s, data: r } = t.image, o = new Float32Array(i * s), c = new Float32Array(i * s), h = new Float32Array(s), u = new Float32Array(s);
|
|
912
912
|
let d = 0, n = 0;
|
|
913
913
|
for (let p = 0; p < s; p++) {
|
|
914
914
|
let g = 0;
|
|
915
915
|
for (let v = 0; v < i; v++) {
|
|
916
|
-
const y = p * i + v, x = Ge.fromHalfFloat(r[4 * y + 0]), w = Ge.fromHalfFloat(r[4 * y + 1]),
|
|
917
|
-
g +=
|
|
916
|
+
const y = p * i + v, x = Ge.fromHalfFloat(r[4 * y + 0]), w = Ge.fromHalfFloat(r[4 * y + 1]), S = Ge.fromHalfFloat(r[4 * y + 2]), C = Da(x, w, S);
|
|
917
|
+
g += C, d += C, o[y] = C, c[y] = g;
|
|
918
918
|
}
|
|
919
919
|
if (g !== 0)
|
|
920
920
|
for (let v = p * i, y = p * i + i; v < y; v++)
|
|
@@ -939,11 +939,11 @@ class Ea {
|
|
|
939
939
|
m.image = { width: s, height: 1, data: l }, m.needsUpdate = !0, _.image = { width: i, height: s, data: f }, _.needsUpdate = !0, this.totalSum = d, this.map = t;
|
|
940
940
|
}
|
|
941
941
|
}
|
|
942
|
-
const ms = 6, Ra = 0, La = 1, ka = 2, Fa = 3, Ba = 4,
|
|
942
|
+
const ms = 6, Ra = 0, La = 1, ka = 2, Fa = 3, Ba = 4, Me = new b(), de = new b(), Lr = new te(), wt = new ee(), kr = new b(), bt = new b(), Oa = new b(0, 1, 0);
|
|
943
943
|
class za {
|
|
944
944
|
constructor() {
|
|
945
945
|
const e = new qe(new Float32Array(4), 1, 1);
|
|
946
|
-
e.format =
|
|
946
|
+
e.format = ce, e.type = xe, e.wrapS = Ze, e.wrapT = Ze, e.generateMipmaps = !1, e.minFilter = le, e.magFilter = le, this.tex = e, this.count = 0;
|
|
947
947
|
}
|
|
948
948
|
updateFrom(e, t = []) {
|
|
949
949
|
const i = this.tex, s = Math.max(e.length * ms, 1), r = Math.ceil(Math.sqrt(s));
|
|
@@ -957,15 +957,15 @@ class za {
|
|
|
957
957
|
d.getWorldPosition(de), o[n + l++] = de.x, o[n + l++] = de.y, o[n + l++] = de.z;
|
|
958
958
|
let f = Ra;
|
|
959
959
|
if (d.isRectAreaLight && d.isCircular ? f = La : d.isSpotLight ? f = ka : d.isDirectionalLight ? f = Fa : d.isPointLight && (f = Ba), o[n + l++] = f, o[n + l++] = d.color.r, o[n + l++] = d.color.g, o[n + l++] = d.color.b, o[n + l++] = d.intensity, d.getWorldQuaternion(wt), d.isRectAreaLight)
|
|
960
|
-
|
|
960
|
+
Me.set(d.width, 0, 0).applyQuaternion(wt), o[n + l++] = Me.x, o[n + l++] = Me.y, o[n + l++] = Me.z, l++, de.set(0, d.height, 0).applyQuaternion(wt), o[n + l++] = de.x, o[n + l++] = de.y, o[n + l++] = de.z, o[n + l++] = Me.cross(de).length() * (d.isCircular ? Math.PI / 4 : 1);
|
|
961
961
|
else if (d.isSpotLight) {
|
|
962
962
|
const m = d.radius || 0;
|
|
963
|
-
kr.setFromMatrixPosition(d.matrixWorld), bt.setFromMatrixPosition(d.target.matrixWorld), Lr.lookAt(kr, bt, Oa), wt.setFromRotationMatrix(Lr),
|
|
963
|
+
kr.setFromMatrixPosition(d.matrixWorld), bt.setFromMatrixPosition(d.target.matrixWorld), Lr.lookAt(kr, bt, Oa), wt.setFromRotationMatrix(Lr), Me.set(1, 0, 0).applyQuaternion(wt), o[n + l++] = Me.x, o[n + l++] = Me.y, o[n + l++] = Me.z, l++, de.set(0, 1, 0).applyQuaternion(wt), o[n + l++] = de.x, o[n + l++] = de.y, o[n + l++] = de.z, o[n + l++] = Math.PI * m * m, o[n + l++] = m, o[n + l++] = d.decay, o[n + l++] = d.distance, o[n + l++] = Math.cos(d.angle), o[n + l++] = Math.cos(d.angle * (1 - d.penumbra)), o[n + l++] = d.iesMap ? t.indexOf(d.iesMap) : -1;
|
|
964
964
|
} else if (d.isPointLight) {
|
|
965
|
-
const m =
|
|
965
|
+
const m = Me.setFromMatrixPosition(d.matrixWorld);
|
|
966
966
|
o[n + l++] = m.x, o[n + l++] = m.y, o[n + l++] = m.z, l++, l += 4, l += 1, o[n + l++] = d.decay, o[n + l++] = d.distance;
|
|
967
967
|
} else if (d.isDirectionalLight) {
|
|
968
|
-
const m =
|
|
968
|
+
const m = Me.setFromMatrixPosition(d.matrixWorld), _ = de.setFromMatrixPosition(d.target.matrixWorld);
|
|
969
969
|
bt.subVectors(m, _).normalize(), o[n + l++] = bt.x, o[n + l++] = bt.y, o[n + l++] = bt.z;
|
|
970
970
|
}
|
|
971
971
|
}
|
|
@@ -999,7 +999,7 @@ function Fr(a, e, t, i, s) {
|
|
|
999
999
|
}
|
|
1000
1000
|
class Wa extends mo {
|
|
1001
1001
|
constructor() {
|
|
1002
|
-
super(), this._textures = [], this.type = xe, this.format =
|
|
1002
|
+
super(), this._textures = [], this.type = xe, this.format = ce, this.internalFormat = "RGBA32F";
|
|
1003
1003
|
}
|
|
1004
1004
|
updateAttribute(e, t) {
|
|
1005
1005
|
const i = this._textures[e];
|
|
@@ -1106,7 +1106,7 @@ class Qa {
|
|
|
1106
1106
|
}
|
|
1107
1107
|
class ja extends qe {
|
|
1108
1108
|
constructor() {
|
|
1109
|
-
super(new Float32Array(4), 1, 1), this.format =
|
|
1109
|
+
super(new Float32Array(4), 1, 1), this.format = ce, this.type = xe, this.wrapS = Ze, this.wrapT = Ze, this.minFilter = le, this.magFilter = le, this.generateMipmaps = !1, this.features = new Qa();
|
|
1110
1110
|
}
|
|
1111
1111
|
updateFrom(e, t) {
|
|
1112
1112
|
function i(m, _, p = -1) {
|
|
@@ -1180,12 +1180,12 @@ function Ya(a, e) {
|
|
|
1180
1180
|
class zr extends go {
|
|
1181
1181
|
constructor(e, t, i) {
|
|
1182
1182
|
const s = {
|
|
1183
|
-
format:
|
|
1183
|
+
format: ce,
|
|
1184
1184
|
type: nr,
|
|
1185
|
-
minFilter:
|
|
1186
|
-
magFilter:
|
|
1187
|
-
wrapS:
|
|
1188
|
-
wrapT:
|
|
1185
|
+
minFilter: De,
|
|
1186
|
+
magFilter: De,
|
|
1187
|
+
wrapS: ht,
|
|
1188
|
+
wrapT: ht,
|
|
1189
1189
|
generateMipmaps: !1,
|
|
1190
1190
|
...i
|
|
1191
1191
|
};
|
|
@@ -1317,7 +1317,7 @@ class $a {
|
|
|
1317
1317
|
}
|
|
1318
1318
|
class el extends qe {
|
|
1319
1319
|
constructor(e = 1, t = 1, i = 8) {
|
|
1320
|
-
super(new Float32Array(1), 1, 1,
|
|
1320
|
+
super(new Float32Array(1), 1, 1, ce, xe), this.minFilter = le, this.magFilter = le, this.strata = i, this.sampler = null, this.generator = new $a(), this.stableNoise = !1, this.random = () => this.stableNoise ? this.generator.nextFloat() : Math.random(), this.init(e, t, i);
|
|
1321
1321
|
}
|
|
1322
1322
|
init(e = this.image.height, t = this.image.width, i = this.strata) {
|
|
1323
1323
|
const { image: s } = this;
|
|
@@ -1477,12 +1477,12 @@ function nl(a) {
|
|
|
1477
1477
|
case 2:
|
|
1478
1478
|
return vo;
|
|
1479
1479
|
default:
|
|
1480
|
-
return
|
|
1480
|
+
return ce;
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
1483
1483
|
class ol extends qe {
|
|
1484
1484
|
constructor(e = 64, t = 1) {
|
|
1485
|
-
super(new Float32Array(4), 1, 1,
|
|
1485
|
+
super(new Float32Array(4), 1, 1, ce, xe), this.minFilter = le, this.magFilter = le, this.size = e, this.channels = t, this.update();
|
|
1486
1486
|
}
|
|
1487
1487
|
update() {
|
|
1488
1488
|
const e = this.channels, t = this.size, i = new sl();
|
|
@@ -4471,7 +4471,7 @@ class Rl extends cr {
|
|
|
4471
4471
|
},
|
|
4472
4472
|
uniforms: {
|
|
4473
4473
|
// path trace uniforms
|
|
4474
|
-
resolution: { value: new
|
|
4474
|
+
resolution: { value: new V() },
|
|
4475
4475
|
opacity: { value: 1 },
|
|
4476
4476
|
bounces: { value: 10 },
|
|
4477
4477
|
transmissiveBounces: { value: 10 },
|
|
@@ -4489,7 +4489,7 @@ class Rl extends cr {
|
|
|
4489
4489
|
// light uniforms
|
|
4490
4490
|
lights: { value: new za() },
|
|
4491
4491
|
iesProfiles: { value: new zr(360, 180, {
|
|
4492
|
-
type:
|
|
4492
|
+
type: Pe,
|
|
4493
4493
|
wrapS: Ze,
|
|
4494
4494
|
wrapT: Ze
|
|
4495
4495
|
}).texture },
|
|
@@ -4997,34 +4997,34 @@ function* Ll() {
|
|
|
4997
4997
|
_subframe: o,
|
|
4998
4998
|
alpha: c,
|
|
4999
4999
|
material: h
|
|
5000
|
-
} = this, u = new
|
|
5000
|
+
} = this, u = new ut(), d = new ut(), n = t.material;
|
|
5001
5001
|
let [l, f] = s;
|
|
5002
5002
|
for (; ; ) {
|
|
5003
5003
|
c ? (n.opacity = this._opacityFactor / (this.samples + 1), h.blending = di, h.opacity = 1) : (h.opacity = this._opacityFactor / (this.samples + 1), h.blending = Pn);
|
|
5004
5004
|
const [m, _, p, g] = o, v = i.width, y = i.height;
|
|
5005
5005
|
h.resolution.set(v * p, y * g), h.sobolTexture = r.texture, h.stratifiedTexture.init(20, h.bounces + h.transmissiveBounces + 5), h.stratifiedTexture.next(), h.seed++;
|
|
5006
|
-
const x = this.tiles.x || 1, w = this.tiles.y || 1,
|
|
5007
|
-
for (let
|
|
5008
|
-
for (let
|
|
5006
|
+
const x = this.tiles.x || 1, w = this.tiles.y || 1, S = x * w, C = Math.ceil(v * p), D = Math.ceil(y * g), T = Math.floor(m * v), P = Math.floor(_ * y), I = Math.ceil(C / x), A = Math.ceil(D / w);
|
|
5007
|
+
for (let M = 0; M < w; M++)
|
|
5008
|
+
for (let E = 0; E < x; E++) {
|
|
5009
5009
|
const R = a.getRenderTarget(), k = a.autoClear, F = a.getScissorTest();
|
|
5010
5010
|
a.getScissor(u), a.getViewport(d);
|
|
5011
|
-
let z =
|
|
5011
|
+
let z = E, B = M;
|
|
5012
5012
|
if (!this.stableTiles) {
|
|
5013
|
-
const
|
|
5014
|
-
z =
|
|
5013
|
+
const G = this._currentTile % (x * w);
|
|
5014
|
+
z = G % x, B = ~~(G / x), this._currentTile = G + 1;
|
|
5015
5015
|
}
|
|
5016
|
-
const
|
|
5016
|
+
const j = w - B - 1;
|
|
5017
5017
|
i.scissor.set(
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
Math.min(I,
|
|
5021
|
-
Math.min(A, D -
|
|
5018
|
+
T + z * I,
|
|
5019
|
+
P + j * A,
|
|
5020
|
+
Math.min(I, C - z * I),
|
|
5021
|
+
Math.min(A, D - j * A)
|
|
5022
5022
|
), i.viewport.set(
|
|
5023
|
+
T,
|
|
5024
|
+
P,
|
|
5023
5025
|
C,
|
|
5024
|
-
E,
|
|
5025
|
-
M,
|
|
5026
5026
|
D
|
|
5027
|
-
), a.setRenderTarget(i), a.setScissorTest(!0), a.autoClear = !1, e.render(a), a.setViewport(d), a.setScissor(u), a.setScissorTest(F), a.setRenderTarget(R), a.autoClear = k, c && (n.target1 = l.texture, n.target2 = i.texture, a.setRenderTarget(f), t.render(a), a.setRenderTarget(R)), this.samples += 1 /
|
|
5027
|
+
), a.setRenderTarget(i), a.setScissorTest(!0), a.autoClear = !1, e.render(a), a.setViewport(d), a.setScissor(u), a.setScissorTest(F), a.setRenderTarget(R), a.autoClear = k, c && (n.target1 = l.texture, n.target2 = i.texture, a.setRenderTarget(f), t.render(a), a.setRenderTarget(R)), this.samples += 1 / S, E === x - 1 && M === w - 1 && (this.samples = Math.round(this.samples)), yield;
|
|
5028
5028
|
}
|
|
5029
5029
|
[l, f] = [f, l];
|
|
5030
5030
|
}
|
|
@@ -5050,23 +5050,23 @@ class Nr {
|
|
|
5050
5050
|
return !!this._compilePromise;
|
|
5051
5051
|
}
|
|
5052
5052
|
constructor(e) {
|
|
5053
|
-
this.camera = null, this.tiles = new
|
|
5054
|
-
format:
|
|
5053
|
+
this.camera = null, this.tiles = new V(3, 3), this.stableNoise = !1, this.stableTiles = !0, this.samples = 0, this._subframe = new ut(0, 0, 1, 1), this._opacityFactor = 1, this._renderer = e, this._alpha = !1, this._fsQuad = new Ht(new Rl()), this._blendQuad = new Ht(new ba()), this._task = null, this._currentTile = 0, this._compilePromise = null, this._sobolTarget = new Ma().generate(e), this._primaryTarget = new je(1, 1, {
|
|
5054
|
+
format: ce,
|
|
5055
5055
|
type: xe,
|
|
5056
|
-
magFilter:
|
|
5057
|
-
minFilter:
|
|
5056
|
+
magFilter: le,
|
|
5057
|
+
minFilter: le
|
|
5058
5058
|
}), this._blendTargets = [
|
|
5059
5059
|
new je(1, 1, {
|
|
5060
|
-
format:
|
|
5060
|
+
format: ce,
|
|
5061
5061
|
type: xe,
|
|
5062
|
-
magFilter:
|
|
5063
|
-
minFilter:
|
|
5062
|
+
magFilter: le,
|
|
5063
|
+
minFilter: le
|
|
5064
5064
|
}),
|
|
5065
5065
|
new je(1, 1, {
|
|
5066
|
-
format:
|
|
5066
|
+
format: ce,
|
|
5067
5067
|
type: xe,
|
|
5068
|
-
magFilter:
|
|
5069
|
-
minFilter:
|
|
5068
|
+
magFilter: le,
|
|
5069
|
+
minFilter: le
|
|
5070
5070
|
})
|
|
5071
5071
|
], this._compileFunction = () => {
|
|
5072
5072
|
const t = this.compileMaterial(this._fsQuad._mesh);
|
|
@@ -5101,20 +5101,20 @@ class Nr {
|
|
|
5101
5101
|
this.material.onBeforeRender(), !this.isCompiling && (this._task || (this._task = Ll.call(this)), this._task.next());
|
|
5102
5102
|
}
|
|
5103
5103
|
}
|
|
5104
|
-
const
|
|
5104
|
+
const gt = new V(), Vr = new V(), Mi = new yo(), Ci = new X();
|
|
5105
5105
|
class kl extends qe {
|
|
5106
5106
|
constructor(e = 512, t = 512) {
|
|
5107
5107
|
super(
|
|
5108
5108
|
new Float32Array(e * t * 4),
|
|
5109
5109
|
e,
|
|
5110
5110
|
t,
|
|
5111
|
-
|
|
5111
|
+
ce,
|
|
5112
5112
|
xe,
|
|
5113
5113
|
Xi,
|
|
5114
|
-
|
|
5114
|
+
ht,
|
|
5115
5115
|
Ze,
|
|
5116
|
-
|
|
5117
|
-
|
|
5116
|
+
De,
|
|
5117
|
+
De
|
|
5118
5118
|
), this.generationCallback = null;
|
|
5119
5119
|
}
|
|
5120
5120
|
update() {
|
|
@@ -5122,7 +5122,7 @@ class kl extends qe {
|
|
|
5122
5122
|
const { data: e, width: t, height: i } = this.image;
|
|
5123
5123
|
for (let s = 0; s < t; s++)
|
|
5124
5124
|
for (let r = 0; r < i; r++) {
|
|
5125
|
-
Vr.set(t, i),
|
|
5125
|
+
Vr.set(t, i), gt.set(s / t, r / i), gt.x -= 0.5, gt.y = 1 - gt.y, Mi.theta = gt.x * 2 * Math.PI, Mi.phi = gt.y * Math.PI, Mi.radius = 1, this.generationCallback(Mi, gt, Vr, Ci);
|
|
5126
5126
|
const c = 4 * (r * t + s);
|
|
5127
5127
|
e[c + 0] = Ci.r, e[c + 1] = Ci.g, e[c + 2] = Ci.b, e[c + 3] = 1;
|
|
5128
5128
|
}
|
|
@@ -5294,8 +5294,8 @@ class Qr {
|
|
|
5294
5294
|
r.readRenderTargetPixels(c, 0, 0, t, i, _), c.dispose();
|
|
5295
5295
|
for (let g = 0, v = _.length; g < v; g++)
|
|
5296
5296
|
m[g] = Ge.toHalfFloat(_[g]);
|
|
5297
|
-
const p = new qe(m, t, i,
|
|
5298
|
-
return p.minFilter = xo, p.magFilter =
|
|
5297
|
+
const p = new qe(m, t, i, ce, Pe);
|
|
5298
|
+
return p.minFilter = xo, p.magFilter = De, p.wrapS = ht, p.wrapT = ht, p.mapping = Xi, p.needsUpdate = !0, p;
|
|
5299
5299
|
}
|
|
5300
5300
|
dispose() {
|
|
5301
5301
|
this._quad.dispose();
|
|
@@ -5304,7 +5304,7 @@ class Qr {
|
|
|
5304
5304
|
function zl(a) {
|
|
5305
5305
|
return a.extensions.get("EXT_float_blend");
|
|
5306
5306
|
}
|
|
5307
|
-
const At = new
|
|
5307
|
+
const At = new V();
|
|
5308
5308
|
class Wl {
|
|
5309
5309
|
get multipleImportanceSampling() {
|
|
5310
5310
|
return !!this._pathTracer.material.defines.FEATURE_MIS;
|
|
@@ -5354,7 +5354,7 @@ class Wl {
|
|
|
5354
5354
|
transparent: !0,
|
|
5355
5355
|
blending: di,
|
|
5356
5356
|
premultipliedAlpha: e.getContextAttributes().premultipliedAlpha
|
|
5357
|
-
})), this._materials = null, this._previousEnvironment = null, this._previousBackground = null, this._internalBackground = null, this.renderDelay = 100, this.minSamples = 5, this.fadeDuration = 500, this.enablePathTracing = !0, this.pausePathTracing = !1, this.dynamicLowRes = !1, this.lowResScale = 0.25, this.renderScale = 1, this.synchronizeRenderSize = !0, this.rasterizeScene = !0, this.renderToCanvas = !0, this.textureSize = new
|
|
5357
|
+
})), this._materials = null, this._previousEnvironment = null, this._previousBackground = null, this._internalBackground = null, this.renderDelay = 100, this.minSamples = 5, this.fadeDuration = 500, this.enablePathTracing = !0, this.pausePathTracing = !1, this.dynamicLowRes = !1, this.lowResScale = 0.25, this.renderScale = 1, this.synchronizeRenderSize = !0, this.rasterizeScene = !0, this.renderToCanvas = !0, this.textureSize = new V(1024, 1024), this.rasterizeSceneCallback = (t, i) => {
|
|
5358
5358
|
this._renderer.render(t, i);
|
|
5359
5359
|
}, this.renderToCanvasCallback = (t, i, s) => {
|
|
5360
5360
|
const r = i.autoClear;
|
|
@@ -5504,8 +5504,8 @@ function Gl(...a) {
|
|
|
5504
5504
|
return a[0] = t, gs == null ? void 0 : gs.call(this, ...a);
|
|
5505
5505
|
}
|
|
5506
5506
|
ar.prototype.load = Gl;
|
|
5507
|
-
|
|
5508
|
-
function
|
|
5507
|
+
yt("debugprogressive");
|
|
5508
|
+
function yt(a) {
|
|
5509
5509
|
if (typeof window > "u")
|
|
5510
5510
|
return !1;
|
|
5511
5511
|
const t = new URL(window.location.href).searchParams.get(a);
|
|
@@ -5524,7 +5524,7 @@ function Ql(a, e) {
|
|
|
5524
5524
|
return e;
|
|
5525
5525
|
}
|
|
5526
5526
|
function qn() {
|
|
5527
|
-
return jt !== void 0 || (jt = /iPhone|iPad|iPod|Android|IEMobile/i.test(navigator.userAgent),
|
|
5527
|
+
return jt !== void 0 || (jt = /iPhone|iPad|iPod|Android|IEMobile/i.test(navigator.userAgent), yt("debugprogressive") && console.log("[glTF Progressive]: isMobileDevice", jt)), jt;
|
|
5528
5528
|
}
|
|
5529
5529
|
let jt;
|
|
5530
5530
|
function jr() {
|
|
@@ -5600,20 +5600,20 @@ function Zl(a) {
|
|
|
5600
5600
|
e.setAttribute(t, a.getAttribute(t));
|
|
5601
5601
|
return e.setIndex(a.getIndex()), e;
|
|
5602
5602
|
}
|
|
5603
|
-
const
|
|
5604
|
-
let ci,
|
|
5605
|
-
if (
|
|
5603
|
+
const ot = new Array(), N = yt("debugprogressive");
|
|
5604
|
+
let ci, _t = -1;
|
|
5605
|
+
if (N) {
|
|
5606
5606
|
let a = function() {
|
|
5607
|
-
|
|
5607
|
+
_t += 1, _t >= e && (_t = -1), console.log(`Toggle LOD level [${_t}]`);
|
|
5608
5608
|
}, e = 6;
|
|
5609
5609
|
window.addEventListener("keyup", (t) => {
|
|
5610
5610
|
t.key === "p" && a(), t.key === "w" && (ci = !ci, console.log(`Toggle wireframe [${ci}]`));
|
|
5611
5611
|
const i = parseInt(t.key);
|
|
5612
|
-
!isNaN(i) && i >= 0 && (
|
|
5612
|
+
!isNaN(i) && i >= 0 && (_t = i, console.log(`Set LOD level to [${_t}]`));
|
|
5613
5613
|
});
|
|
5614
5614
|
}
|
|
5615
5615
|
function Yn(a) {
|
|
5616
|
-
if (
|
|
5616
|
+
if (N && ci !== void 0)
|
|
5617
5617
|
if (Array.isArray(a))
|
|
5618
5618
|
for (const e of a)
|
|
5619
5619
|
Yn(e);
|
|
@@ -5626,7 +5626,7 @@ const Jl = qn() ? 2 : 10;
|
|
|
5626
5626
|
function $l(a) {
|
|
5627
5627
|
if (Yt.length < Jl) {
|
|
5628
5628
|
const i = Yt.length;
|
|
5629
|
-
|
|
5629
|
+
N && console.warn(`[Worker] Creating new worker #${i}`);
|
|
5630
5630
|
const s = ur.createWorker(a || {});
|
|
5631
5631
|
return Yt.push(s), s;
|
|
5632
5632
|
}
|
|
@@ -5694,13 +5694,13 @@ function ec(a) {
|
|
|
5694
5694
|
y.setIndex(_s(x));
|
|
5695
5695
|
}
|
|
5696
5696
|
for (const x in v.attributes) {
|
|
5697
|
-
const w = v.attributes[x],
|
|
5698
|
-
y.setAttribute(x,
|
|
5697
|
+
const w = v.attributes[x], S = _s(w);
|
|
5698
|
+
y.setAttribute(x, S);
|
|
5699
5699
|
}
|
|
5700
5700
|
if (v.morphAttributes)
|
|
5701
5701
|
for (const x in v.morphAttributes) {
|
|
5702
|
-
const
|
|
5703
|
-
y.morphAttributes[x] =
|
|
5702
|
+
const S = v.morphAttributes[x].map((C) => _s(C));
|
|
5703
|
+
y.morphAttributes[x] = S;
|
|
5704
5704
|
}
|
|
5705
5705
|
if (y.morphTargetsRelative = v.morphTargetsRelative ?? !1, y.boundingBox = new J(), y.boundingBox.min = new b(
|
|
5706
5706
|
(e = v.boundingBox) == null ? void 0 : e.min.x,
|
|
@@ -5726,11 +5726,11 @@ function ec(a) {
|
|
|
5726
5726
|
const v = g.texture;
|
|
5727
5727
|
let y = null;
|
|
5728
5728
|
if (v.isCompressedTexture) {
|
|
5729
|
-
const x = v.mipmaps, w = ((n = v.image) == null ? void 0 : n.width) || ((f = (l = v.source) == null ? void 0 : l.data) == null ? void 0 : f.width) || -1,
|
|
5729
|
+
const x = v.mipmaps, w = ((n = v.image) == null ? void 0 : n.width) || ((f = (l = v.source) == null ? void 0 : l.data) == null ? void 0 : f.width) || -1, S = ((m = v.image) == null ? void 0 : m.height) || ((p = (_ = v.source) == null ? void 0 : _.data) == null ? void 0 : p.height) || -1;
|
|
5730
5730
|
y = new bo(
|
|
5731
5731
|
x,
|
|
5732
5732
|
w,
|
|
5733
|
-
|
|
5733
|
+
S,
|
|
5734
5734
|
v.format,
|
|
5735
5735
|
v.type,
|
|
5736
5736
|
v.mapping,
|
|
@@ -5742,7 +5742,7 @@ function ec(a) {
|
|
|
5742
5742
|
v.colorSpace
|
|
5743
5743
|
);
|
|
5744
5744
|
} else
|
|
5745
|
-
y = new
|
|
5745
|
+
y = new nt(
|
|
5746
5746
|
v.image,
|
|
5747
5747
|
v.mapping,
|
|
5748
5748
|
v.wrapS,
|
|
@@ -5771,7 +5771,7 @@ function _s(a) {
|
|
|
5771
5771
|
"isBufferAttribute" in a && a.isBufferAttribute && (e = new ve(a.array, a.itemSize, a.normalized), e.usage = a.usage, e.gpuType = a.gpuType, e.updateRanges = a.updateRanges);
|
|
5772
5772
|
return e;
|
|
5773
5773
|
}
|
|
5774
|
-
const tc =
|
|
5774
|
+
const tc = yt("gltf-progressive-worker"), ic = yt("gltf-progressive-reduce-mipmaps"), vs = Symbol("needle-progressive-texture"), He = "NEEDLE_progressive", H = class H {
|
|
5775
5775
|
constructor(e) {
|
|
5776
5776
|
L(this, "parser");
|
|
5777
5777
|
L(this, "url");
|
|
@@ -5783,11 +5783,11 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
5783
5783
|
const t = (s = (i = this.parser.json.meshes[e]) == null ? void 0 : i.extensions) == null ? void 0 : s[He];
|
|
5784
5784
|
return t ? (this._isLoadingMesh = !0, this.parser.getDependency("mesh", e).then((r) => {
|
|
5785
5785
|
var o;
|
|
5786
|
-
return this._isLoadingMesh = !1, r &&
|
|
5786
|
+
return this._isLoadingMesh = !1, r && H.registerMesh(this.url, t.guid, r, (o = t.lods) == null ? void 0 : o.length, 0, t), r;
|
|
5787
5787
|
})) : null;
|
|
5788
5788
|
});
|
|
5789
5789
|
const t = e.options.path;
|
|
5790
|
-
|
|
5790
|
+
N && console.log("Progressive extension registered for", t), this.parser = e, this.url = t;
|
|
5791
5791
|
}
|
|
5792
5792
|
/** The name of the extension */
|
|
5793
5793
|
get name() {
|
|
@@ -5816,7 +5816,7 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
5816
5816
|
this.getMaterialMinMaxLODsCount(c, t);
|
|
5817
5817
|
return e[s] = t, t;
|
|
5818
5818
|
}
|
|
5819
|
-
if (
|
|
5819
|
+
if (N === "verbose" && console.log("getMaterialMinMaxLODsCount", e), e.type === "ShaderMaterial" || e.type === "RawShaderMaterial") {
|
|
5820
5820
|
const c = e;
|
|
5821
5821
|
for (const h of Object.keys(c.uniforms)) {
|
|
5822
5822
|
const u = c.uniforms[h].value;
|
|
@@ -5828,7 +5828,7 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
5828
5828
|
(h == null ? void 0 : h.isTexture) === !0 && o(h, t);
|
|
5829
5829
|
}
|
|
5830
5830
|
else
|
|
5831
|
-
|
|
5831
|
+
N && console.warn(`[getMaterialMinMaxLODsCount] Unsupported material type: ${e.type}`);
|
|
5832
5832
|
return e[s] = t, t;
|
|
5833
5833
|
function o(c, h) {
|
|
5834
5834
|
const u = i.getAssignedLODInformation(c);
|
|
@@ -5901,17 +5901,17 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
5901
5901
|
const s = e.geometry, r = this.getAssignedLODInformation(s);
|
|
5902
5902
|
if (!r)
|
|
5903
5903
|
return Promise.resolve(null);
|
|
5904
|
-
for (const o of
|
|
5904
|
+
for (const o of ot)
|
|
5905
5905
|
(i = o.onBeforeGetLODMesh) == null || i.call(o, e, t);
|
|
5906
|
-
return e["LOD:requested level"] = t,
|
|
5906
|
+
return e["LOD:requested level"] = t, H.getOrLoadLOD(s, t).then((o) => {
|
|
5907
5907
|
if (Array.isArray(o)) {
|
|
5908
5908
|
const c = r.index || 0;
|
|
5909
5909
|
o = o[c];
|
|
5910
5910
|
}
|
|
5911
|
-
return e["LOD:requested level"] === t && (delete e["LOD:requested level"], o && s != o && ((o == null ? void 0 : o.isBufferGeometry) ? e.geometry = o :
|
|
5911
|
+
return e["LOD:requested level"] === t && (delete e["LOD:requested level"], o && s != o && ((o == null ? void 0 : o.isBufferGeometry) ? e.geometry = o : N && console.error("Invalid LOD geometry", o))), o;
|
|
5912
5912
|
}).catch((o) => (console.error("Error loading mesh LOD", e, o), null));
|
|
5913
5913
|
} else
|
|
5914
|
-
|
|
5914
|
+
N && console.error("Invalid call to assignMeshLOD: Request mesh LOD but the object is not a mesh", e);
|
|
5915
5915
|
return Promise.resolve(null);
|
|
5916
5916
|
}
|
|
5917
5917
|
static assignTextureLOD(e, t = 0) {
|
|
@@ -5962,7 +5962,7 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
5962
5962
|
return c;
|
|
5963
5963
|
});
|
|
5964
5964
|
}
|
|
5965
|
-
if (e instanceof
|
|
5965
|
+
if (e instanceof nt || e.isTexture === !0) {
|
|
5966
5966
|
const i = e;
|
|
5967
5967
|
return this.assignTextureLODForSlot(i, t, null, null);
|
|
5968
5968
|
}
|
|
@@ -5970,27 +5970,27 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
5970
5970
|
}
|
|
5971
5971
|
// #region INTERNAL
|
|
5972
5972
|
static assignTextureLODForSlot(e, t, i, s) {
|
|
5973
|
-
return (e == null ? void 0 : e.isTexture) !== !0 ? Promise.resolve(null) : s === "glyphMap" ? Promise.resolve(e) :
|
|
5973
|
+
return (e == null ? void 0 : e.isTexture) !== !0 ? Promise.resolve(null) : s === "glyphMap" ? Promise.resolve(e) : H.getOrLoadLOD(e, t).then((r) => {
|
|
5974
5974
|
var o, c;
|
|
5975
5975
|
if (Array.isArray(r))
|
|
5976
5976
|
return console.warn("Progressive: Got an array of textures for a texture slot, this should not happen..."), null;
|
|
5977
5977
|
if ((r == null ? void 0 : r.isTexture) === !0) {
|
|
5978
5978
|
if (r != e && i && s) {
|
|
5979
5979
|
const h = i[s];
|
|
5980
|
-
if (h && !
|
|
5980
|
+
if (h && !N) {
|
|
5981
5981
|
const u = this.getAssignedLODInformation(h);
|
|
5982
5982
|
if (u && (u == null ? void 0 : u.level) < t)
|
|
5983
|
-
return
|
|
5983
|
+
return N === "verbose" && console.warn("Assigned texture level is already higher: ", u.level, t, i, h, r), null;
|
|
5984
5984
|
}
|
|
5985
5985
|
if (ic && r.mipmaps) {
|
|
5986
5986
|
const u = r.mipmaps.length;
|
|
5987
|
-
r.mipmaps.length = Math.min(r.mipmaps.length, 3), u !== r.mipmaps.length &&
|
|
5987
|
+
r.mipmaps.length = Math.min(r.mipmaps.length, 3), u !== r.mipmaps.length && N && console.debug(`Reduced mipmap count from ${u} to ${r.mipmaps.length} for ${r.uuid}: ${(o = r.image) == null ? void 0 : o.width}x${(c = r.image) == null ? void 0 : c.height}.`);
|
|
5988
5988
|
}
|
|
5989
5989
|
i[s] = r;
|
|
5990
5990
|
}
|
|
5991
5991
|
return r;
|
|
5992
5992
|
} else
|
|
5993
|
-
|
|
5993
|
+
N == "verbose" && console.warn("No LOD found for", e, t);
|
|
5994
5994
|
return null;
|
|
5995
5995
|
}).catch((r) => (console.error("Error loading LOD", e, r), null));
|
|
5996
5996
|
}
|
|
@@ -6010,24 +6010,24 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
6010
6010
|
// }
|
|
6011
6011
|
afterRoot(e) {
|
|
6012
6012
|
var t, i;
|
|
6013
|
-
return
|
|
6013
|
+
return N && console.log("AFTER", this.url, e), (t = this.parser.json.textures) == null || t.forEach((s, r) => {
|
|
6014
6014
|
var o;
|
|
6015
6015
|
if (s != null && s.extensions) {
|
|
6016
6016
|
const c = s == null ? void 0 : s.extensions[He];
|
|
6017
6017
|
if (c) {
|
|
6018
6018
|
if (!c.lods) {
|
|
6019
|
-
|
|
6019
|
+
N && console.warn("Texture has no LODs", c);
|
|
6020
6020
|
return;
|
|
6021
6021
|
}
|
|
6022
6022
|
let h = !1;
|
|
6023
6023
|
for (const u of this.parser.associations.keys())
|
|
6024
6024
|
if (u.isTexture === !0) {
|
|
6025
6025
|
const d = this.parser.associations.get(u);
|
|
6026
|
-
(d == null ? void 0 : d.textures) === r && (h = !0,
|
|
6026
|
+
(d == null ? void 0 : d.textures) === r && (h = !0, H.registerTexture(this.url, u, (o = c.lods) == null ? void 0 : o.length, r, c));
|
|
6027
6027
|
}
|
|
6028
6028
|
h || this.parser.getDependency("texture", r).then((u) => {
|
|
6029
6029
|
var d;
|
|
6030
|
-
u &&
|
|
6030
|
+
u && H.registerTexture(this.url, u, (d = c.lods) == null ? void 0 : d.length, r, c);
|
|
6031
6031
|
});
|
|
6032
6032
|
}
|
|
6033
6033
|
}
|
|
@@ -6038,7 +6038,7 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
6038
6038
|
for (const c of this.parser.associations.keys())
|
|
6039
6039
|
if (c.isMesh) {
|
|
6040
6040
|
const h = this.parser.associations.get(c);
|
|
6041
|
-
(h == null ? void 0 : h.meshes) === r &&
|
|
6041
|
+
(h == null ? void 0 : h.meshes) === r && H.registerMesh(this.url, o.guid, c, o.lods.length, h.primitives, o);
|
|
6042
6042
|
}
|
|
6043
6043
|
}
|
|
6044
6044
|
}
|
|
@@ -6046,17 +6046,17 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
6046
6046
|
}
|
|
6047
6047
|
static async getOrLoadLOD(e, t) {
|
|
6048
6048
|
var h, u, d, n;
|
|
6049
|
-
const i =
|
|
6049
|
+
const i = N == "verbose", s = this.getAssignedLODInformation(e);
|
|
6050
6050
|
if (!s)
|
|
6051
|
-
return
|
|
6051
|
+
return N && console.warn(`[gltf-progressive] No LOD information found: ${e.name}, uuid: ${e.uuid}, type: ${e.type}`, e), null;
|
|
6052
6052
|
const r = s == null ? void 0 : s.key;
|
|
6053
6053
|
let o;
|
|
6054
6054
|
if (e.isTexture === !0) {
|
|
6055
6055
|
const l = e;
|
|
6056
6056
|
l.source && l.source[vs] && (o = l.source[vs]);
|
|
6057
6057
|
}
|
|
6058
|
-
if (o || (o =
|
|
6059
|
-
|
|
6058
|
+
if (o || (o = H.lodInfos.get(r)), !o)
|
|
6059
|
+
N && console.warn(`Can not load LOD ${t}: no LOD info found for "${r}" ${e.name}`, e.type, H.lodInfos);
|
|
6060
6060
|
else {
|
|
6061
6061
|
if (t > 0) {
|
|
6062
6062
|
let m = !1;
|
|
@@ -6066,7 +6066,7 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
6066
6066
|
}
|
|
6067
6067
|
const l = Array.isArray(o.lods) ? (h = o.lods[t]) == null ? void 0 : h.path : o.lods;
|
|
6068
6068
|
if (!l)
|
|
6069
|
-
return
|
|
6069
|
+
return N && !o["missing:uri"] && (o["missing:uri"] = !0, console.warn("Missing uri for progressive asset for LOD " + t, o)), null;
|
|
6070
6070
|
const f = Ql(s.url, l);
|
|
6071
6071
|
if (f.endsWith(".glb") || f.endsWith(".gltf")) {
|
|
6072
6072
|
if (!o.guid)
|
|
@@ -6074,101 +6074,101 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
6074
6074
|
const m = f + "_" + o.guid, _ = await this.queue.slot(f), p = this.previouslyLoaded.get(m);
|
|
6075
6075
|
if (p !== void 0) {
|
|
6076
6076
|
i && console.log(`LOD ${t} was already loading/loaded: ${m}`);
|
|
6077
|
-
let x = await p.catch((
|
|
6078
|
-
`,
|
|
6079
|
-
if (x == null || (x instanceof
|
|
6077
|
+
let x = await p.catch((S) => (console.error(`Error loading LOD ${t} from ${f}
|
|
6078
|
+
`, S), null)), w = !1;
|
|
6079
|
+
if (x == null || (x instanceof nt && e instanceof nt ? (u = x.image) != null && u.data || (d = x.source) != null && d.data ? x = this.copySettings(e, x) : (w = !0, this.previouslyLoaded.delete(m)) : x instanceof re && e instanceof re && ((n = x.attributes.position) != null && n.array || (w = !0, this.previouslyLoaded.delete(m)))), !w)
|
|
6080
6080
|
return x;
|
|
6081
6081
|
}
|
|
6082
6082
|
if (!_.use)
|
|
6083
|
-
return
|
|
6083
|
+
return N && console.log(`LOD ${t} was aborted: ${f}`), null;
|
|
6084
6084
|
const g = o, v = new Promise(async (x, w) => {
|
|
6085
6085
|
if (tc) {
|
|
6086
6086
|
const A = await (await $l({})).load(f);
|
|
6087
6087
|
if (A.textures.length > 0)
|
|
6088
|
-
for (const
|
|
6089
|
-
let
|
|
6090
|
-
return
|
|
6088
|
+
for (const M of A.textures) {
|
|
6089
|
+
let E = M.texture;
|
|
6090
|
+
return H.assignLODInformation(s.url, E, r, t, void 0), e instanceof nt && (E = this.copySettings(e, E)), E && (E.guid = g.guid), x(E);
|
|
6091
6091
|
}
|
|
6092
6092
|
if (A.geometries.length > 0) {
|
|
6093
|
-
const
|
|
6094
|
-
for (const
|
|
6095
|
-
const R =
|
|
6096
|
-
|
|
6093
|
+
const M = new Array();
|
|
6094
|
+
for (const E of A.geometries) {
|
|
6095
|
+
const R = E.geometry;
|
|
6096
|
+
H.assignLODInformation(s.url, R, r, t, E.primitiveIndex), M.push(R);
|
|
6097
6097
|
}
|
|
6098
|
-
return x(
|
|
6098
|
+
return x(M);
|
|
6099
6099
|
}
|
|
6100
6100
|
return x(null);
|
|
6101
6101
|
}
|
|
6102
|
-
const
|
|
6103
|
-
Vn(
|
|
6104
|
-
let
|
|
6102
|
+
const S = new ar();
|
|
6103
|
+
Vn(S), N && (await new Promise((I) => setTimeout(I, 1e3)), i && console.warn("Start loading (delayed) " + f, g.guid));
|
|
6104
|
+
let C = f;
|
|
6105
6105
|
if (g && Array.isArray(g.lods)) {
|
|
6106
6106
|
const I = g.lods[t];
|
|
6107
|
-
I.hash && (
|
|
6107
|
+
I.hash && (C += "?v=" + I.hash);
|
|
6108
6108
|
}
|
|
6109
|
-
const D = await
|
|
6109
|
+
const D = await S.loadAsync(C).catch((I) => (console.error(`Error loading LOD ${t} from ${f}
|
|
6110
6110
|
`, I), x(null)));
|
|
6111
6111
|
if (!D)
|
|
6112
6112
|
return x(null);
|
|
6113
|
-
const
|
|
6113
|
+
const T = D.parser;
|
|
6114
6114
|
i && console.log("Loading finished " + f, g.guid);
|
|
6115
|
-
let
|
|
6115
|
+
let P = 0;
|
|
6116
6116
|
if (D.parser.json.textures) {
|
|
6117
6117
|
let I = !1;
|
|
6118
6118
|
for (const A of D.parser.json.textures) {
|
|
6119
6119
|
if (A != null && A.extensions) {
|
|
6120
|
-
const
|
|
6121
|
-
if (
|
|
6120
|
+
const M = A == null ? void 0 : A.extensions[He];
|
|
6121
|
+
if (M != null && M.guid && M.guid === g.guid) {
|
|
6122
6122
|
I = !0;
|
|
6123
6123
|
break;
|
|
6124
6124
|
}
|
|
6125
6125
|
}
|
|
6126
|
-
|
|
6126
|
+
P++;
|
|
6127
6127
|
}
|
|
6128
6128
|
if (I) {
|
|
6129
|
-
let A = await
|
|
6130
|
-
return A &&
|
|
6129
|
+
let A = await T.getDependency("texture", P);
|
|
6130
|
+
return A && H.assignLODInformation(s.url, A, r, t, void 0), i && console.log('change "' + e.name + '" → "' + A.name + '"', f, P, A, m), e instanceof nt && (A = this.copySettings(e, A)), A && (A.guid = g.guid), x(A);
|
|
6131
6131
|
} else
|
|
6132
|
-
|
|
6132
|
+
N && console.warn("Could not find texture with guid", g.guid, D.parser.json);
|
|
6133
6133
|
}
|
|
6134
|
-
if (
|
|
6134
|
+
if (P = 0, D.parser.json.meshes) {
|
|
6135
6135
|
let I = !1;
|
|
6136
6136
|
for (const A of D.parser.json.meshes) {
|
|
6137
6137
|
if (A != null && A.extensions) {
|
|
6138
|
-
const
|
|
6139
|
-
if (
|
|
6138
|
+
const M = A == null ? void 0 : A.extensions[He];
|
|
6139
|
+
if (M != null && M.guid && M.guid === g.guid) {
|
|
6140
6140
|
I = !0;
|
|
6141
6141
|
break;
|
|
6142
6142
|
}
|
|
6143
6143
|
}
|
|
6144
|
-
|
|
6144
|
+
P++;
|
|
6145
6145
|
}
|
|
6146
6146
|
if (I) {
|
|
6147
|
-
const A = await
|
|
6148
|
-
if (i && console.log(`Loaded Mesh "${A.name}"`, f,
|
|
6149
|
-
const
|
|
6150
|
-
return
|
|
6147
|
+
const A = await T.getDependency("mesh", P);
|
|
6148
|
+
if (i && console.log(`Loaded Mesh "${A.name}"`, f, P, A, m), A.isMesh === !0) {
|
|
6149
|
+
const M = A.geometry;
|
|
6150
|
+
return H.assignLODInformation(s.url, M, r, t, 0), x(M);
|
|
6151
6151
|
} else {
|
|
6152
|
-
const
|
|
6153
|
-
for (let
|
|
6154
|
-
const R = A.children[
|
|
6152
|
+
const M = new Array();
|
|
6153
|
+
for (let E = 0; E < A.children.length; E++) {
|
|
6154
|
+
const R = A.children[E];
|
|
6155
6155
|
if (R.isMesh === !0) {
|
|
6156
6156
|
const k = R.geometry;
|
|
6157
|
-
|
|
6157
|
+
H.assignLODInformation(s.url, k, r, t, E), M.push(k);
|
|
6158
6158
|
}
|
|
6159
6159
|
}
|
|
6160
|
-
return x(
|
|
6160
|
+
return x(M);
|
|
6161
6161
|
}
|
|
6162
6162
|
} else
|
|
6163
|
-
|
|
6163
|
+
N && console.warn("Could not find mesh with guid", g.guid, D.parser.json);
|
|
6164
6164
|
}
|
|
6165
6165
|
return x(null);
|
|
6166
6166
|
});
|
|
6167
6167
|
return this.previouslyLoaded.set(m, v), _.use(v), await v;
|
|
6168
|
-
} else if (e instanceof
|
|
6168
|
+
} else if (e instanceof nt) {
|
|
6169
6169
|
i && console.log("Load texture from uri: " + f);
|
|
6170
6170
|
const _ = await new En().loadAsync(f);
|
|
6171
|
-
return _ ? (_.guid = o.guid, _.flipY = !1, _.needsUpdate = !0, _.colorSpace = e.colorSpace, i && console.log(o, _)) :
|
|
6171
|
+
return _ ? (_.guid = o.guid, _.flipY = !1, _.needsUpdate = !0, _.colorSpace = e.colorSpace, i && console.log(o, _)) : N && console.warn("failed loading", f), _;
|
|
6172
6172
|
}
|
|
6173
6173
|
}
|
|
6174
6174
|
return null;
|
|
@@ -6186,7 +6186,7 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
6186
6186
|
}
|
|
6187
6187
|
// private static readonly _copiedTextures: WeakMap<Texture, Texture> = new Map();
|
|
6188
6188
|
static copySettings(e, t) {
|
|
6189
|
-
return t ? (
|
|
6189
|
+
return t ? (N === "verbose" && console.debug(`Copy texture settings
|
|
6190
6190
|
`, e.uuid, `
|
|
6191
6191
|
`, t.uuid), t = t.clone(), t.offset = e.offset, t.repeat = e.repeat, t.colorSpace = e.colorSpace, t.magFilter = e.magFilter, t.minFilter = e.minFilter, t.wrapS = e.wrapS, t.wrapT = e.wrapT, t.flipY = e.flipY, t.anisotropy = e.anisotropy, t.mipmaps || (t.generateMipmaps = e.generateMipmaps), t) : e;
|
|
6192
6192
|
}
|
|
@@ -6194,39 +6194,39 @@ const tc = vt("gltf-progressive-worker"), ic = vt("gltf-progressive-reduce-mipma
|
|
|
6194
6194
|
/**
|
|
6195
6195
|
* Register a texture with LOD information
|
|
6196
6196
|
*/
|
|
6197
|
-
L(
|
|
6197
|
+
L(H, "registerTexture", (e, t, i, s, r) => {
|
|
6198
6198
|
var c, h, u, d, n, l, f, m;
|
|
6199
6199
|
if (!t) {
|
|
6200
|
-
|
|
6200
|
+
N && console.error("!! gltf-progressive: Called register texture without texture");
|
|
6201
6201
|
return;
|
|
6202
6202
|
}
|
|
6203
|
-
if (
|
|
6203
|
+
if (N) {
|
|
6204
6204
|
const _ = ((c = t.image) == null ? void 0 : c.width) || ((u = (h = t.source) == null ? void 0 : h.data) == null ? void 0 : u.width) || 0, p = ((d = t.image) == null ? void 0 : d.height) || ((l = (n = t.source) == null ? void 0 : n.data) == null ? void 0 : l.height) || 0;
|
|
6205
6205
|
console.log(`> gltf-progressive: register texture[${s}] "${t.name || t.uuid}", Current: ${_}x${p}, Max: ${(f = r.lods[0]) == null ? void 0 : f.width}x${(m = r.lods[0]) == null ? void 0 : m.height}, uuid: ${t.uuid}`, r, t);
|
|
6206
6206
|
}
|
|
6207
6207
|
t.source && (t.source[vs] = r);
|
|
6208
6208
|
const o = r.guid;
|
|
6209
|
-
|
|
6209
|
+
H.assignLODInformation(e, t, o, i, s), H.lodInfos.set(o, r), H.lowresCache.set(o, t);
|
|
6210
6210
|
}), /**
|
|
6211
6211
|
* Register a mesh with LOD information
|
|
6212
6212
|
*/
|
|
6213
|
-
L(
|
|
6213
|
+
L(H, "registerMesh", (e, t, i, s, r, o) => {
|
|
6214
6214
|
var u;
|
|
6215
6215
|
const c = i.geometry;
|
|
6216
6216
|
if (!c) {
|
|
6217
|
-
|
|
6217
|
+
N && console.warn("gltf-progressive: Register mesh without geometry");
|
|
6218
6218
|
return;
|
|
6219
6219
|
}
|
|
6220
|
-
c.userData || (c.userData = {}),
|
|
6221
|
-
let h =
|
|
6222
|
-
h ? h.push(i.geometry) : h = [i.geometry],
|
|
6223
|
-
for (const d of
|
|
6220
|
+
c.userData || (c.userData = {}), N && console.log("> Progressive: register mesh " + i.name, { index: r, uuid: i.uuid }, o, i), H.assignLODInformation(e, c, t, s, r), H.lodInfos.set(t, o);
|
|
6221
|
+
let h = H.lowresCache.get(t);
|
|
6222
|
+
h ? h.push(i.geometry) : h = [i.geometry], H.lowresCache.set(t, h), s > 0 && !_i(i) && Yl(i, c);
|
|
6223
|
+
for (const d of ot)
|
|
6224
6224
|
(u = d.onRegisteredNewMesh) == null || u.call(d, i, o);
|
|
6225
6225
|
}), /** A map of key = asset uuid and value = LOD information */
|
|
6226
|
-
L(
|
|
6227
|
-
L(
|
|
6228
|
-
L(
|
|
6229
|
-
let Oe =
|
|
6226
|
+
L(H, "lodInfos", /* @__PURE__ */ new Map()), /** cache of already loaded mesh lods */
|
|
6227
|
+
L(H, "previouslyLoaded", /* @__PURE__ */ new Map()), /** this contains the geometry/textures that were originally loaded */
|
|
6228
|
+
L(H, "lowresCache", /* @__PURE__ */ new Map()), L(H, "workers", []), L(H, "_workersIndex", 0), L(H, "maxConcurrent", 50), L(H, "queue", new jl(H.maxConcurrent, { debug: N != !1 }));
|
|
6229
|
+
let Oe = H;
|
|
6230
6230
|
class sc {
|
|
6231
6231
|
constructor(e, t, i, s) {
|
|
6232
6232
|
L(this, "url");
|
|
@@ -6284,7 +6284,7 @@ class qi {
|
|
|
6284
6284
|
}
|
|
6285
6285
|
add(e, t, i) {
|
|
6286
6286
|
if (this._resolved) {
|
|
6287
|
-
|
|
6287
|
+
N && console.warn("PromiseGroup: Trying to add a promise to a resolved group, ignoring.");
|
|
6288
6288
|
return;
|
|
6289
6289
|
}
|
|
6290
6290
|
if (!(this._frame_start !== void 0 && this._currentFrame > this._frame_start + this._frames_to_capture)) {
|
|
@@ -6292,7 +6292,7 @@ class qi {
|
|
|
6292
6292
|
if (this._seen.has(t)) {
|
|
6293
6293
|
let s = this._seen.get(t);
|
|
6294
6294
|
if (s >= this._maxPromisesPerObject) {
|
|
6295
|
-
|
|
6295
|
+
N && console.warn("PromiseGroup: Already awaiting object ignoring new promise for it.");
|
|
6296
6296
|
return;
|
|
6297
6297
|
}
|
|
6298
6298
|
this._seen.set(t, s + 1);
|
|
@@ -6317,8 +6317,8 @@ L(qi, "addPromise", (e, t, i, s) => {
|
|
|
6317
6317
|
r.add(e, t, i);
|
|
6318
6318
|
});
|
|
6319
6319
|
});
|
|
6320
|
-
const
|
|
6321
|
-
var _e, Ne, ts,
|
|
6320
|
+
const Ce = yt("debugprogressive"), rc = yt("noprogressive"), ys = Symbol("Needle:LODSManager"), xs = Symbol("Needle:LODState"), it = Symbol("Needle:CurrentLOD"), pe = { mesh_lod: -1, texture_lod: -1 };
|
|
6321
|
+
var _e, Ne, ts, lt, Ut, is, Ve;
|
|
6322
6322
|
const K = class K {
|
|
6323
6323
|
// readonly plugins: NEEDLE_progressive_plugin[] = [];
|
|
6324
6324
|
constructor(e, t) {
|
|
@@ -6346,7 +6346,7 @@ const K = class K {
|
|
|
6346
6346
|
* @default "auto"
|
|
6347
6347
|
*/
|
|
6348
6348
|
L(this, "updateInterval", "auto");
|
|
6349
|
-
|
|
6349
|
+
et(this, _e, 1);
|
|
6350
6350
|
/**
|
|
6351
6351
|
* If set to true, the LODsManager will not update the LODs.
|
|
6352
6352
|
* @default false
|
|
@@ -6361,12 +6361,12 @@ const K = class K {
|
|
|
6361
6361
|
L(this, "_newPromiseGroups", []);
|
|
6362
6362
|
L(this, "_promiseGroupIds", 0);
|
|
6363
6363
|
L(this, "_lodchangedlisteners", []);
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6364
|
+
et(this, Ne, void 0);
|
|
6365
|
+
et(this, ts, new rs());
|
|
6366
|
+
et(this, lt, 0);
|
|
6367
|
+
et(this, Ut, 0);
|
|
6368
|
+
et(this, is, 0);
|
|
6369
|
+
et(this, Ve, 0);
|
|
6370
6370
|
L(this, "_fpsBuffer", [60, 60, 60, 60, 60]);
|
|
6371
6371
|
// private testIfLODLevelsAreAvailable() {
|
|
6372
6372
|
L(this, "_sphere", new ns());
|
|
@@ -6383,11 +6383,11 @@ const K = class K {
|
|
|
6383
6383
|
return e[xs];
|
|
6384
6384
|
}
|
|
6385
6385
|
static addPlugin(e) {
|
|
6386
|
-
|
|
6386
|
+
ot.push(e);
|
|
6387
6387
|
}
|
|
6388
6388
|
static removePlugin(e) {
|
|
6389
|
-
const t =
|
|
6390
|
-
t >= 0 &&
|
|
6389
|
+
const t = ot.indexOf(e);
|
|
6390
|
+
t >= 0 && ot.splice(t, 1);
|
|
6391
6391
|
}
|
|
6392
6392
|
/**
|
|
6393
6393
|
* Gets the LODsManager for the given renderer. If the LODsManager does not exist yet, it will be created.
|
|
@@ -6405,13 +6405,13 @@ const K = class K {
|
|
|
6405
6405
|
}
|
|
6406
6406
|
/** @deprecated use static `LODsManager.addPlugin()` method. This getter will be removed in later versions */
|
|
6407
6407
|
get plugins() {
|
|
6408
|
-
return
|
|
6408
|
+
return ot;
|
|
6409
6409
|
}
|
|
6410
6410
|
/**
|
|
6411
6411
|
* Call to await LODs loading during the next render cycle.
|
|
6412
6412
|
*/
|
|
6413
6413
|
awaitLoading(e) {
|
|
6414
|
-
const t = this._promiseGroupIds++, i = new qi(
|
|
6414
|
+
const t = this._promiseGroupIds++, i = new qi(Q(this, lt), { ...e });
|
|
6415
6415
|
this._newPromiseGroups.push(i);
|
|
6416
6416
|
const s = performance.now();
|
|
6417
6417
|
return i.ready.finally(() => {
|
|
@@ -6425,7 +6425,7 @@ const K = class K {
|
|
|
6425
6425
|
_postprocessPromiseGroups() {
|
|
6426
6426
|
if (this._newPromiseGroups.length !== 0)
|
|
6427
6427
|
for (let e = this._newPromiseGroups.length - 1; e >= 0; e--)
|
|
6428
|
-
this._newPromiseGroups[e].update(
|
|
6428
|
+
this._newPromiseGroups[e].update(Q(this, lt));
|
|
6429
6429
|
}
|
|
6430
6430
|
addEventListener(e, t) {
|
|
6431
6431
|
e === "changed" && this._lodchangedlisteners.push(t);
|
|
@@ -6440,7 +6440,7 @@ const K = class K {
|
|
|
6440
6440
|
* Enable the LODsManager. This will replace the render method of the renderer with a method that updates the LODs.
|
|
6441
6441
|
*/
|
|
6442
6442
|
enable() {
|
|
6443
|
-
if (
|
|
6443
|
+
if (Q(this, Ne))
|
|
6444
6444
|
return;
|
|
6445
6445
|
console.debug("[gltf-progressive] Enabling LODsManager for renderer");
|
|
6446
6446
|
let e = 0;
|
|
@@ -6448,13 +6448,13 @@ const K = class K {
|
|
|
6448
6448
|
const t = this;
|
|
6449
6449
|
Nn(this.renderer), this.renderer.render = function(i, s) {
|
|
6450
6450
|
const r = t.renderer.getRenderTarget();
|
|
6451
|
-
(r == null || "isXRRenderTarget" in r && r.isXRRenderTarget) && (e = 0, Fe(t,
|
|
6451
|
+
(r == null || "isXRRenderTarget" in r && r.isXRRenderTarget) && (e = 0, Fe(t, lt, Q(t, lt) + 1), Fe(t, Ut, Q(t, ts).getDelta()), Fe(t, is, Q(t, is) + Q(t, Ut)), t._fpsBuffer.shift(), t._fpsBuffer.push(1 / Q(t, Ut)), Fe(t, Ve, t._fpsBuffer.reduce((c, h) => c + h) / t._fpsBuffer.length), Ce && Q(t, lt) % 200 === 0 && console.log("FPS", Math.round(Q(t, Ve)), "Interval:", Q(t, _e)));
|
|
6452
6452
|
const o = e++;
|
|
6453
|
-
|
|
6453
|
+
Q(t, Ne).call(this, i, s), t.onAfterRender(i, s, o);
|
|
6454
6454
|
};
|
|
6455
6455
|
}
|
|
6456
6456
|
disable() {
|
|
6457
|
-
|
|
6457
|
+
Q(this, Ne) && (console.debug("[gltf-progressive] Disabling LODsManager for renderer"), this.renderer.render = Q(this, Ne), Fe(this, Ne, void 0));
|
|
6458
6458
|
}
|
|
6459
6459
|
update(e, t) {
|
|
6460
6460
|
this.internalUpdate(e, t);
|
|
@@ -6469,7 +6469,7 @@ const K = class K {
|
|
|
6469
6469
|
(c.name === "EffectMaterial" || c.name === "CopyShader") && (o = !1);
|
|
6470
6470
|
}
|
|
6471
6471
|
if ((t.parent && t.parent.type === "CubeCamera" || i >= 1 && t.type === "OrthographicCamera") && (o = !1), o) {
|
|
6472
|
-
if (rc || (this.updateInterval === "auto" ?
|
|
6472
|
+
if (rc || (this.updateInterval === "auto" ? Q(this, Ve) < 40 && Q(this, _e) < 10 ? (Fe(this, _e, Q(this, _e) + 1), Ce && console.warn("↓ Reducing LOD updates", Q(this, _e), Q(this, Ve).toFixed(0))) : Q(this, Ve) >= 60 && Q(this, _e) > 1 && (Fe(this, _e, Q(this, _e) - 1), Ce && console.warn("↑ Increasing LOD updates", Q(this, _e), Q(this, Ve).toFixed(0))) : Fe(this, _e, this.updateInterval), Q(this, _e) > 0 && Q(this, lt) % Q(this, _e) != 0))
|
|
6473
6473
|
return;
|
|
6474
6474
|
this.internalUpdate(e, t), this._postprocessPromiseGroups();
|
|
6475
6475
|
}
|
|
@@ -6484,7 +6484,7 @@ const K = class K {
|
|
|
6484
6484
|
const r = this.targetTriangleDensity;
|
|
6485
6485
|
for (const d of s) {
|
|
6486
6486
|
if (d.material && (((h = d.geometry) == null ? void 0 : h.type) === "BoxGeometry" || ((u = d.geometry) == null ? void 0 : u.type) === "BufferGeometry") && (d.material.name === "SphericalGaussianBlur" || d.material.name == "BackgroundCubeMaterial" || d.material.name === "CubemapFromEquirect" || d.material.name === "EquirectangularToCubeUV")) {
|
|
6487
|
-
|
|
6487
|
+
Ce && (d.material["NEEDLE_PROGRESSIVE:IGNORE-WARNING"] || (d.material["NEEDLE_PROGRESSIVE:IGNORE-WARNING"] = !0, console.warn("Ignoring skybox or BLIT object", d, d.material.name, d.material.type)));
|
|
6488
6488
|
continue;
|
|
6489
6489
|
}
|
|
6490
6490
|
switch (d.material.type) {
|
|
@@ -6496,7 +6496,7 @@ const K = class K {
|
|
|
6496
6496
|
case "MeshDepthMaterial":
|
|
6497
6497
|
continue;
|
|
6498
6498
|
}
|
|
6499
|
-
if (
|
|
6499
|
+
if (Ce === "color" && d.material && !d.object.progressive_debug_color) {
|
|
6500
6500
|
d.object.progressive_debug_color = !0;
|
|
6501
6501
|
const l = Math.random() * 16777215, f = new ji({ color: l });
|
|
6502
6502
|
d.object.material = f;
|
|
@@ -6522,11 +6522,11 @@ const K = class K {
|
|
|
6522
6522
|
let r = i[xs];
|
|
6523
6523
|
if (r || (r = new nc(), i[xs] = r), r.frames++ < 2)
|
|
6524
6524
|
return;
|
|
6525
|
-
for (const u of
|
|
6525
|
+
for (const u of ot)
|
|
6526
6526
|
(c = u.onBeforeUpdateLOD) == null || c.call(u, this.renderer, e, t, i);
|
|
6527
|
-
const o = this.overrideLodLevel !== void 0 ? this.overrideLodLevel :
|
|
6528
|
-
o >= 0 ? (pe.mesh_lod = o, pe.texture_lod = o) : (this.calculateLodLevel(t, i, r, s, pe), pe.mesh_lod = Math.round(pe.mesh_lod), pe.texture_lod = Math.round(pe.texture_lod)), pe.mesh_lod >= 0 && this.loadProgressiveMeshes(i, pe.mesh_lod), i.material && pe.texture_lod >= 0 && this.loadProgressiveTextures(i.material, pe.texture_lod, o),
|
|
6529
|
-
for (const u of
|
|
6527
|
+
const o = this.overrideLodLevel !== void 0 ? this.overrideLodLevel : _t;
|
|
6528
|
+
o >= 0 ? (pe.mesh_lod = o, pe.texture_lod = o) : (this.calculateLodLevel(t, i, r, s, pe), pe.mesh_lod = Math.round(pe.mesh_lod), pe.texture_lod = Math.round(pe.texture_lod)), pe.mesh_lod >= 0 && this.loadProgressiveMeshes(i, pe.mesh_lod), i.material && pe.texture_lod >= 0 && this.loadProgressiveTextures(i.material, pe.texture_lod, o), N && i.material && !i.isGizmo && Yn(i.material);
|
|
6529
|
+
for (const u of ot)
|
|
6530
6530
|
(h = u.onAfterUpdatedLOD) == null || h.call(u, this.renderer, e, t, i, pe);
|
|
6531
6531
|
r.lastLodLevel_Mesh = pe.mesh_lod, r.lastLodLevel_Texture = pe.texture_lod;
|
|
6532
6532
|
}
|
|
@@ -6544,8 +6544,8 @@ const K = class K {
|
|
|
6544
6544
|
return;
|
|
6545
6545
|
}
|
|
6546
6546
|
let s = !1;
|
|
6547
|
-
if ((e[
|
|
6548
|
-
e[
|
|
6547
|
+
if ((e[it] === void 0 || t < e[it]) && (s = !0), i !== void 0 && i >= 0 && (s = e[it] != i, t = i), s) {
|
|
6548
|
+
e[it] = t;
|
|
6549
6549
|
const r = Oe.assignTextureLOD(e, t).then((o) => {
|
|
6550
6550
|
this._lodchangedlisteners.forEach((c) => c({ type: "texture", level: t, object: e }));
|
|
6551
6551
|
});
|
|
@@ -6561,11 +6561,11 @@ const K = class K {
|
|
|
6561
6561
|
loadProgressiveMeshes(e, t) {
|
|
6562
6562
|
if (!e)
|
|
6563
6563
|
return Promise.resolve(null);
|
|
6564
|
-
let i = e[
|
|
6564
|
+
let i = e[it] !== t;
|
|
6565
6565
|
const s = e["DEBUG:LOD"];
|
|
6566
|
-
if (s != null && (i = e[
|
|
6567
|
-
e[
|
|
6568
|
-
const r = e.geometry, o = Oe.assignMeshLOD(e, t).then((c) => (c && e[
|
|
6566
|
+
if (s != null && (i = e[it] != s, t = s), i) {
|
|
6567
|
+
e[it] = t;
|
|
6568
|
+
const r = e.geometry, o = Oe.assignMeshLOD(e, t).then((c) => (c && e[it] == t && r != e.geometry && this._lodchangedlisteners.forEach((h) => h({ type: "mesh", level: t, object: e })), c));
|
|
6569
6569
|
return qi.addPromise("mesh", e, o, this._newPromiseGroups), o;
|
|
6570
6570
|
}
|
|
6571
6571
|
return Promise.resolve(null);
|
|
@@ -6586,7 +6586,7 @@ const K = class K {
|
|
|
6586
6586
|
return;
|
|
6587
6587
|
}
|
|
6588
6588
|
let c = 10 + 1, h = !1;
|
|
6589
|
-
if (
|
|
6589
|
+
if (Ce && t["DEBUG:LOD"] != null)
|
|
6590
6590
|
return t["DEBUG:LOD"];
|
|
6591
6591
|
const u = (p = Oe.getMeshLODExtension(t.geometry)) == null ? void 0 : p.lods, d = Oe.getPrimitiveIndex(t.geometry), n = u && u.length > 0, l = Oe.getMaterialMinMaxLODsCount(t.material), f = l.min_count !== 1 / 0 && l.min_count >= 0 && l.max_count >= 0;
|
|
6592
6592
|
if (!n && !f) {
|
|
@@ -6602,13 +6602,13 @@ const K = class K {
|
|
|
6602
6602
|
x.computeBoundingBox();
|
|
6603
6603
|
else if (this.skinnedMeshAutoUpdateBoundsInterval > 0) {
|
|
6604
6604
|
if (!x[K.$skinnedMeshBoundsOffset]) {
|
|
6605
|
-
const
|
|
6606
|
-
x[K.$skinnedMeshBoundsOffset] =
|
|
6605
|
+
const S = K.skinnedMeshBoundsFrameOffsetCounter++;
|
|
6606
|
+
x[K.$skinnedMeshBoundsOffset] = S;
|
|
6607
6607
|
}
|
|
6608
6608
|
const w = x[K.$skinnedMeshBoundsOffset];
|
|
6609
6609
|
if ((i.frames + w) % this.skinnedMeshAutoUpdateBoundsInterval === 0) {
|
|
6610
|
-
const
|
|
6611
|
-
|
|
6610
|
+
const S = _i(x), C = x.geometry;
|
|
6611
|
+
S && (x.geometry = S), x.computeBoundingBox(), x.geometry = C;
|
|
6612
6612
|
}
|
|
6613
6613
|
}
|
|
6614
6614
|
_ = x.boundingBox;
|
|
@@ -6617,8 +6617,8 @@ const K = class K {
|
|
|
6617
6617
|
const x = e;
|
|
6618
6618
|
if (t.geometry.attributes.color && t.geometry.attributes.color.count < 100 && t.geometry.boundingSphere) {
|
|
6619
6619
|
this._sphere.copy(t.geometry.boundingSphere), this._sphere.applyMatrix4(t.matrixWorld);
|
|
6620
|
-
const
|
|
6621
|
-
if (this._sphere.containsPoint(
|
|
6620
|
+
const M = e.getWorldPosition(this._tempWorldPosition);
|
|
6621
|
+
if (this._sphere.containsPoint(M)) {
|
|
6622
6622
|
r.mesh_lod = 0, r.texture_lod = 0;
|
|
6623
6623
|
return;
|
|
6624
6624
|
}
|
|
@@ -6628,59 +6628,59 @@ const K = class K {
|
|
|
6628
6628
|
return;
|
|
6629
6629
|
}
|
|
6630
6630
|
if (this._tempBox.applyMatrix4(this.projectionScreenMatrix), this.renderer.xr.enabled && x.isPerspectiveCamera && x.fov > 70) {
|
|
6631
|
-
const
|
|
6632
|
-
let R =
|
|
6633
|
-
const B = 2,
|
|
6634
|
-
R = (R -
|
|
6635
|
-
const Y = R < 0 && F > 0 ? 0 : Math.min(Math.abs(
|
|
6636
|
-
i.lastCentrality = (
|
|
6631
|
+
const M = this._tempBox.min, E = this._tempBox.max;
|
|
6632
|
+
let R = M.x, k = M.y, F = E.x, z = E.y;
|
|
6633
|
+
const B = 2, j = 1.5, G = (M.x + E.x) * 0.5, O = (M.y + E.y) * 0.5;
|
|
6634
|
+
R = (R - G) * B + G, k = (k - O) * B + O, F = (F - G) * B + G, z = (z - O) * B + O;
|
|
6635
|
+
const Y = R < 0 && F > 0 ? 0 : Math.min(Math.abs(M.x), Math.abs(E.x)), U = k < 0 && z > 0 ? 0 : Math.min(Math.abs(M.y), Math.abs(E.y)), oe = Math.max(Y, U);
|
|
6636
|
+
i.lastCentrality = (j - oe) * (j - oe) * (j - oe);
|
|
6637
6637
|
} else
|
|
6638
6638
|
i.lastCentrality = 1;
|
|
6639
6639
|
const w = this._tempBox.getSize(this._tempBoxSize);
|
|
6640
6640
|
w.multiplyScalar(0.5), screen.availHeight > 0 && m > 0 && w.multiplyScalar(m / screen.availHeight), e.isPerspectiveCamera ? w.x *= e.aspect : e.isOrthographicCamera;
|
|
6641
|
-
const
|
|
6642
|
-
|
|
6643
|
-
const D =
|
|
6644
|
-
if (Math.max(w.x, w.y) != 0 &&
|
|
6645
|
-
const
|
|
6646
|
-
|
|
6647
|
-
const
|
|
6648
|
-
|
|
6649
|
-
const z = (
|
|
6650
|
-
|
|
6641
|
+
const S = e.matrixWorldInverse, C = this._tempBox2;
|
|
6642
|
+
C.copy(_), C.applyMatrix4(t.matrixWorld), C.applyMatrix4(S);
|
|
6643
|
+
const D = C.getSize(this._tempBox2Size), T = Math.max(D.x, D.y);
|
|
6644
|
+
if (Math.max(w.x, w.y) != 0 && T != 0 && (w.z = D.z / Math.max(D.x, D.y) * Math.max(w.x, w.y)), i.lastScreenCoverage = Math.max(w.x, w.y, w.z), i.lastScreenspaceVolume.copy(w), i.lastScreenCoverage *= i.lastCentrality, Ce && K.debugDrawLine) {
|
|
6645
|
+
const M = this.tempMatrix.copy(this.projectionScreenMatrix);
|
|
6646
|
+
M.invert();
|
|
6647
|
+
const E = K.corner0, R = K.corner1, k = K.corner2, F = K.corner3;
|
|
6648
|
+
E.copy(this._tempBox.min), R.copy(this._tempBox.max), R.x = E.x, k.copy(this._tempBox.max), k.y = E.y, F.copy(this._tempBox.max);
|
|
6649
|
+
const z = (E.z + F.z) * 0.5;
|
|
6650
|
+
E.z = R.z = k.z = F.z = z, E.applyMatrix4(M), R.applyMatrix4(M), k.applyMatrix4(M), F.applyMatrix4(M), K.debugDrawLine(E, R, 255), K.debugDrawLine(E, k, 255), K.debugDrawLine(R, F, 255), K.debugDrawLine(k, F, 255);
|
|
6651
6651
|
}
|
|
6652
6652
|
let I = 999;
|
|
6653
6653
|
if (u && i.lastScreenCoverage > 0)
|
|
6654
|
-
for (let
|
|
6655
|
-
const
|
|
6656
|
-
if (d > 0 && jr() && !
|
|
6657
|
-
I =
|
|
6654
|
+
for (let M = 0; M < u.length; M++) {
|
|
6655
|
+
const E = u[M], k = (((g = E.densities) == null ? void 0 : g[d]) || E.density || 1e-5) / i.lastScreenCoverage;
|
|
6656
|
+
if (d > 0 && jr() && !E.densities && !globalThis["NEEDLE:MISSING_LOD_PRIMITIVE_DENSITIES"] && (window["NEEDLE:MISSING_LOD_PRIMITIVE_DENSITIES"] = !0, console.warn("[Needle Progressive] Detected usage of mesh without primitive densities. This might cause incorrect LOD level selection: Consider re-optimizing your model by updating your Needle Integration, Needle glTF Pipeline or running optimization again on Needle Cloud.")), k < s) {
|
|
6657
|
+
I = M;
|
|
6658
6658
|
break;
|
|
6659
6659
|
}
|
|
6660
6660
|
}
|
|
6661
6661
|
I < c && (c = I, h = !0);
|
|
6662
6662
|
}
|
|
6663
|
-
if (h ? r.mesh_lod = c : r.mesh_lod = i.lastLodLevel_Mesh,
|
|
6663
|
+
if (h ? r.mesh_lod = c : r.mesh_lod = i.lastLodLevel_Mesh, Ce && r.mesh_lod != i.lastLodLevel_Mesh) {
|
|
6664
6664
|
const w = u == null ? void 0 : u[r.mesh_lod];
|
|
6665
6665
|
w && console.log(`Mesh LOD changed: ${i.lastLodLevel_Mesh} → ${r.mesh_lod} (density: ${(v = w.densities) == null ? void 0 : v[d].toFixed(0)}) | ${t.name}`);
|
|
6666
6666
|
}
|
|
6667
6667
|
if (f) {
|
|
6668
6668
|
const x = "saveData" in globalThis.navigator && globalThis.navigator.saveData === !0;
|
|
6669
6669
|
if (i.lastLodLevel_Texture < 0) {
|
|
6670
|
-
if (r.texture_lod = l.max_count - 1,
|
|
6670
|
+
if (r.texture_lod = l.max_count - 1, Ce) {
|
|
6671
6671
|
const w = l.lods[l.max_count - 1];
|
|
6672
|
-
|
|
6672
|
+
Ce && console.log(`First Texture LOD ${r.texture_lod} (${w.max_height}px) - ${t.name}`);
|
|
6673
6673
|
}
|
|
6674
6674
|
} else {
|
|
6675
6675
|
const w = i.lastScreenspaceVolume.x + i.lastScreenspaceVolume.y + i.lastScreenspaceVolume.z;
|
|
6676
|
-
let
|
|
6677
|
-
((y = this.context) == null ? void 0 : y.engine) === "model-viewer" && (
|
|
6678
|
-
const D = m / window.devicePixelRatio *
|
|
6679
|
-
let
|
|
6680
|
-
for (let
|
|
6681
|
-
const I = l.lods[
|
|
6682
|
-
if (!(x && I.max_height >= 2048) && !(qn() && I.max_height > 4096) && (I.max_height > D || !
|
|
6683
|
-
if (
|
|
6676
|
+
let S = i.lastScreenCoverage * 4;
|
|
6677
|
+
((y = this.context) == null ? void 0 : y.engine) === "model-viewer" && (S *= 1.5);
|
|
6678
|
+
const D = m / window.devicePixelRatio * S;
|
|
6679
|
+
let T = !1;
|
|
6680
|
+
for (let P = l.lods.length - 1; P >= 0; P--) {
|
|
6681
|
+
const I = l.lods[P];
|
|
6682
|
+
if (!(x && I.max_height >= 2048) && !(qn() && I.max_height > 4096) && (I.max_height > D || !T && P === 0)) {
|
|
6683
|
+
if (T = !0, r.texture_lod = P, Ce && r.texture_lod < i.lastLodLevel_Texture) {
|
|
6684
6684
|
const A = I.max_height;
|
|
6685
6685
|
console.log(`Texture LOD changed: ${i.lastLodLevel_Texture} → ${r.texture_lod} = ${A}px
|
|
6686
6686
|
Screensize: ${D.toFixed(0)}px, Coverage: ${(100 * i.lastScreenCoverage).toFixed(2)}%, Volume ${w.toFixed(1)}
|
|
@@ -6694,7 +6694,7 @@ ${t.name}`);
|
|
|
6694
6694
|
r.texture_lod = 0;
|
|
6695
6695
|
}
|
|
6696
6696
|
};
|
|
6697
|
-
_e = new WeakMap(), Ne = new WeakMap(), ts = new WeakMap(),
|
|
6697
|
+
_e = new WeakMap(), Ne = new WeakMap(), ts = new WeakMap(), lt = new WeakMap(), Ut = new WeakMap(), is = new WeakMap(), Ve = 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
|
L(K, "debugDrawLine"), L(K, "corner0", new b()), L(K, "corner1", new b()), L(K, "corner2", new b()), L(K, "corner3", new b()), L(K, "_tempPtInside", new b()), L(K, "skinnedMeshBoundsFrameOffsetCounter", 0), L(K, "$skinnedMeshBoundsOffset", Symbol("gltf-progressive-skinnedMeshBoundsOffset"));
|
|
@@ -7063,18 +7063,18 @@ var zt = Object.freeze({
|
|
|
7063
7063
|
return !0;
|
|
7064
7064
|
}, a;
|
|
7065
7065
|
}()
|
|
7066
|
-
),
|
|
7066
|
+
), vt = {
|
|
7067
7067
|
Linear: function(a, e) {
|
|
7068
|
-
var t = a.length - 1, i = t * e, s = Math.floor(i), r =
|
|
7068
|
+
var t = a.length - 1, i = t * e, s = Math.floor(i), r = vt.Utils.Linear;
|
|
7069
7069
|
return e < 0 ? r(a[0], a[1], i) : e > 1 ? r(a[t], a[t - 1], t - i) : r(a[s], a[s + 1 > t ? t : s + 1], i - s);
|
|
7070
7070
|
},
|
|
7071
7071
|
Bezier: function(a, e) {
|
|
7072
|
-
for (var t = 0, i = a.length - 1, s = Math.pow, r =
|
|
7072
|
+
for (var t = 0, i = a.length - 1, s = Math.pow, r = vt.Utils.Bernstein, o = 0; o <= i; o++)
|
|
7073
7073
|
t += s(1 - e, i - o) * s(e, o) * a[o] * r(i, o);
|
|
7074
7074
|
return t;
|
|
7075
7075
|
},
|
|
7076
7076
|
CatmullRom: function(a, e) {
|
|
7077
|
-
var t = a.length - 1, i = t * e, s = Math.floor(i), r =
|
|
7077
|
+
var t = a.length - 1, i = t * e, s = Math.floor(i), r = vt.Utils.CatmullRom;
|
|
7078
7078
|
return a[0] === a[t] ? (e < 0 && (s = Math.floor(i = t * (1 + e))), r(a[(s - 1 + t) % t], a[s], a[(s + 1) % t], a[(s + 2) % t], i - s)) : e < 0 ? a[0] - (r(a[0], a[0], a[1], a[1], -i) - a[0]) : e > 1 ? a[t] - (r(a[t], a[t], a[t - 1], a[t - 1], i - t) - a[t]) : r(a[s ? s - 1 : 0], a[s], a[t < s + 1 ? t : s + 1], a[t < s + 2 ? t : s + 2], i - s);
|
|
7079
7079
|
},
|
|
7080
7080
|
Utils: {
|
|
@@ -7082,7 +7082,7 @@ var zt = Object.freeze({
|
|
|
7082
7082
|
return (e - a) * t + a;
|
|
7083
7083
|
},
|
|
7084
7084
|
Bernstein: function(a, e) {
|
|
7085
|
-
var t =
|
|
7085
|
+
var t = vt.Utils.Factorial;
|
|
7086
7086
|
return t(a) / t(e) / t(a - e);
|
|
7087
7087
|
},
|
|
7088
7088
|
Factorial: /* @__PURE__ */ function() {
|
|
@@ -7114,7 +7114,7 @@ var zt = Object.freeze({
|
|
|
7114
7114
|
/** @class */
|
|
7115
7115
|
function() {
|
|
7116
7116
|
function a(e, t) {
|
|
7117
|
-
t === void 0 && (t = qs), 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 = zt.Linear.None, this._interpolationFunction =
|
|
7117
|
+
t === void 0 && (t = qs), 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 = zt.Linear.None, this._interpolationFunction = vt.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = fr.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1;
|
|
7118
7118
|
}
|
|
7119
7119
|
return a.prototype.getId = function() {
|
|
7120
7120
|
return this._id;
|
|
@@ -7213,7 +7213,7 @@ var zt = Object.freeze({
|
|
|
7213
7213
|
}, a.prototype.easing = function(e) {
|
|
7214
7214
|
return e === void 0 && (e = zt.Linear.None), this._easingFunction = e, this;
|
|
7215
7215
|
}, a.prototype.interpolation = function(e) {
|
|
7216
|
-
return e === void 0 && (e =
|
|
7216
|
+
return e === void 0 && (e = vt.Linear), this._interpolationFunction = e, this;
|
|
7217
7217
|
}, a.prototype.chain = function() {
|
|
7218
7218
|
for (var e = [], t = 0; t < arguments.length; t++)
|
|
7219
7219
|
e[t] = arguments[t];
|
|
@@ -7281,7 +7281,7 @@ var zt = Object.freeze({
|
|
|
7281
7281
|
), cc = "23.1.3", hc = fr.nextId, We = qs, uc = We.getAll.bind(We), fc = We.removeAll.bind(We), dc = We.add.bind(We), pc = We.remove.bind(We), mc = We.update.bind(We), me = {
|
|
7282
7282
|
Easing: zt,
|
|
7283
7283
|
Group: Jn,
|
|
7284
|
-
Interpolation:
|
|
7284
|
+
Interpolation: vt,
|
|
7285
7285
|
now: Bt,
|
|
7286
7286
|
Sequence: fr,
|
|
7287
7287
|
nextId: hc,
|
|
@@ -7408,7 +7408,7 @@ var $n = { exports: {} };
|
|
|
7408
7408
|
}, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = t, c.EventEmitter = c, a.exports = c;
|
|
7409
7409
|
})($n);
|
|
7410
7410
|
var _c = $n.exports;
|
|
7411
|
-
const
|
|
7411
|
+
const xt = /* @__PURE__ */ gc(_c);
|
|
7412
7412
|
var hi = function() {
|
|
7413
7413
|
var a = 0, e = document.createElement("div");
|
|
7414
7414
|
e.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", e.addEventListener("click", function(n) {
|
|
@@ -7821,55 +7821,55 @@ var eo = {};
|
|
|
7821
7821
|
if (m && !g._paused)
|
|
7822
7822
|
return l || f._loadQueue("play"), g._id;
|
|
7823
7823
|
f._webAudio && t._autoResume();
|
|
7824
|
-
var y = Math.max(0, g._seek > 0 ? g._seek : f._sprite[n][0] / 1e3), x = Math.max(0, (f._sprite[n][0] + f._sprite[n][1]) / 1e3 - y), w = x * 1e3 / Math.abs(g._rate),
|
|
7824
|
+
var y = Math.max(0, g._seek > 0 ? g._seek : f._sprite[n][0] / 1e3), x = Math.max(0, (f._sprite[n][0] + f._sprite[n][1]) / 1e3 - y), w = x * 1e3 / Math.abs(g._rate), S = f._sprite[n][0] / 1e3, C = (f._sprite[n][0] + f._sprite[n][1]) / 1e3;
|
|
7825
7825
|
g._sprite = n, g._ended = !1;
|
|
7826
7826
|
var D = function() {
|
|
7827
|
-
g._paused = !1, g._seek = y, g._start =
|
|
7827
|
+
g._paused = !1, g._seek = y, g._start = S, g._stop = C, g._loop = !!(g._loop || f._sprite[n][2]);
|
|
7828
7828
|
};
|
|
7829
|
-
if (y >=
|
|
7829
|
+
if (y >= C) {
|
|
7830
7830
|
f._ended(g);
|
|
7831
7831
|
return;
|
|
7832
7832
|
}
|
|
7833
|
-
var
|
|
7833
|
+
var T = g._node;
|
|
7834
7834
|
if (f._webAudio) {
|
|
7835
|
-
var
|
|
7835
|
+
var P = function() {
|
|
7836
7836
|
f._playLock = !1, D(), f._refreshBuffer(g);
|
|
7837
|
-
var
|
|
7838
|
-
|
|
7837
|
+
var E = g._muted || f._muted ? 0 : g._volume;
|
|
7838
|
+
T.gain.setValueAtTime(E, t.ctx.currentTime), g._playStart = t.ctx.currentTime, typeof T.bufferSource.start > "u" ? g._loop ? T.bufferSource.noteGrainOn(0, y, 86400) : T.bufferSource.noteGrainOn(0, y, x) : g._loop ? T.bufferSource.start(0, y, 86400) : T.bufferSource.start(0, y, x), w !== 1 / 0 && (f._endTimers[g._id] = setTimeout(f._ended.bind(f, g), w)), l || setTimeout(function() {
|
|
7839
7839
|
f._emit("play", g._id), f._loadQueue();
|
|
7840
7840
|
}, 0);
|
|
7841
7841
|
};
|
|
7842
|
-
t.state === "running" && t.ctx.state !== "interrupted" ?
|
|
7842
|
+
t.state === "running" && t.ctx.state !== "interrupted" ? P() : (f._playLock = !0, f.once("resume", P), f._clearTimer(g._id));
|
|
7843
7843
|
} else {
|
|
7844
7844
|
var I = function() {
|
|
7845
|
-
|
|
7845
|
+
T.currentTime = y, T.muted = g._muted || f._muted || t._muted || T.muted, T.volume = g._volume * t.volume(), T.playbackRate = g._rate;
|
|
7846
7846
|
try {
|
|
7847
|
-
var
|
|
7848
|
-
if (
|
|
7849
|
-
f._playLock = !1,
|
|
7847
|
+
var E = T.play();
|
|
7848
|
+
if (E && typeof Promise < "u" && (E instanceof Promise || typeof E.then == "function") ? (f._playLock = !0, D(), E.then(function() {
|
|
7849
|
+
f._playLock = !1, T._unlocked = !0, l ? f._loadQueue() : f._emit("play", g._id);
|
|
7850
7850
|
}).catch(function() {
|
|
7851
7851
|
f._playLock = !1, f._emit("playerror", g._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."), g._ended = !0, g._paused = !0;
|
|
7852
|
-
})) : l || (f._playLock = !1, D(), f._emit("play", g._id)),
|
|
7852
|
+
})) : l || (f._playLock = !1, D(), f._emit("play", g._id)), T.playbackRate = g._rate, T.paused) {
|
|
7853
7853
|
f._emit("playerror", g._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");
|
|
7854
7854
|
return;
|
|
7855
7855
|
}
|
|
7856
7856
|
n !== "__default" || g._loop ? f._endTimers[g._id] = setTimeout(f._ended.bind(f, g), w) : (f._endTimers[g._id] = function() {
|
|
7857
|
-
f._ended(g),
|
|
7858
|
-
},
|
|
7857
|
+
f._ended(g), T.removeEventListener("ended", f._endTimers[g._id], !1);
|
|
7858
|
+
}, T.addEventListener("ended", f._endTimers[g._id], !1));
|
|
7859
7859
|
} catch (R) {
|
|
7860
7860
|
f._emit("playerror", g._id, R);
|
|
7861
7861
|
}
|
|
7862
7862
|
};
|
|
7863
|
-
|
|
7864
|
-
var A = window && window.ejecta || !
|
|
7865
|
-
if (
|
|
7863
|
+
T.src === "data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA" && (T.src = f._src, T.load());
|
|
7864
|
+
var A = window && window.ejecta || !T.readyState && t._navigator.isCocoonJS;
|
|
7865
|
+
if (T.readyState >= 3 || A)
|
|
7866
7866
|
I();
|
|
7867
7867
|
else {
|
|
7868
7868
|
f._playLock = !0, f._state = "loading";
|
|
7869
|
-
var
|
|
7870
|
-
f._state = "loaded", I(),
|
|
7869
|
+
var M = function() {
|
|
7870
|
+
f._state = "loaded", I(), T.removeEventListener(t._canPlayEvent, M, !1);
|
|
7871
7871
|
};
|
|
7872
|
-
|
|
7872
|
+
T.addEventListener(t._canPlayEvent, M, !1), f._clearTimer(g._id);
|
|
7873
7873
|
}
|
|
7874
7874
|
}
|
|
7875
7875
|
return g._id;
|
|
@@ -8023,10 +8023,10 @@ var eo = {};
|
|
|
8023
8023
|
* @param {Boolean} isGroup If true, set the volume on the group.
|
|
8024
8024
|
*/
|
|
8025
8025
|
_startFadeInterval: function(n, l, f, m, _, p) {
|
|
8026
|
-
var g = this, v = l, y = f - l, x = Math.abs(y / 0.01), w = Math.max(4, x > 0 ? m / x : m),
|
|
8026
|
+
var g = this, v = l, y = f - l, x = Math.abs(y / 0.01), w = Math.max(4, x > 0 ? m / x : m), S = Date.now();
|
|
8027
8027
|
n._fadeTo = f, n._interval = setInterval(function() {
|
|
8028
|
-
var
|
|
8029
|
-
|
|
8028
|
+
var C = (Date.now() - S) / m;
|
|
8029
|
+
S = Date.now(), v += y * C, v = Math.round(v * 100) / 100, y < 0 ? v = Math.max(f, v) : v = Math.min(f, v), g._webAudio ? n._volume = v : g.volume(v, n._id, !0), p && (g._volume = v), (f < l && v <= f || f > l && v >= f) && (clearInterval(n._interval), n._interval = null, n._fadeTo = null, g.volume(f, n._id), g._emit("fade", n._id));
|
|
8030
8030
|
}, w);
|
|
8031
8031
|
},
|
|
8032
8032
|
/**
|
|
@@ -8141,8 +8141,8 @@ var eo = {};
|
|
|
8141
8141
|
} else
|
|
8142
8142
|
y();
|
|
8143
8143
|
} else if (n._webAudio) {
|
|
8144
|
-
var w = n.playing(m) ? t.ctx.currentTime - g._playStart : 0,
|
|
8145
|
-
return g._seek + (
|
|
8144
|
+
var w = n.playing(m) ? t.ctx.currentTime - g._playStart : 0, S = g._rateSeek ? g._rateSeek - g._seek : 0;
|
|
8145
|
+
return g._seek + (S + w * Math.abs(g._rate));
|
|
8146
8146
|
} else
|
|
8147
8147
|
return g._node.currentTime;
|
|
8148
8148
|
return n;
|
|
@@ -8754,48 +8754,48 @@ function Sc() {
|
|
|
8754
8754
|
function Mc(a) {
|
|
8755
8755
|
let e = !1, t = !1, i = !1, s = 1 / 0, r = 1 / 0, o = 1 / 0, c = -1 / 0, h = -1 / 0, u = -1 / 0, d = 0, n = 0;
|
|
8756
8756
|
return a.traverse((f) => {
|
|
8757
|
-
var D,
|
|
8757
|
+
var D, T, P;
|
|
8758
8758
|
const m = f;
|
|
8759
8759
|
if (!(m != null && m.isMesh) || !m.geometry || m.userData.ignoreSize)
|
|
8760
8760
|
return;
|
|
8761
8761
|
const _ = m.material;
|
|
8762
8762
|
if ((D = _ == null ? void 0 : _.userData) != null && D.isLOGO)
|
|
8763
8763
|
return;
|
|
8764
|
-
const p = m.geometry, g = (
|
|
8764
|
+
const p = m.geometry, g = (T = p == null ? void 0 : p.attributes) == null ? void 0 : T.position;
|
|
8765
8765
|
if (!g || g.count <= 0)
|
|
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 = (P = p == null ? void 0 : p.morphAttributes) == null ? void 0 : P.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
|
-
const
|
|
8774
|
-
if (
|
|
8773
|
+
const M = x[A] || 0;
|
|
8774
|
+
if (M === 0)
|
|
8775
8775
|
continue;
|
|
8776
|
-
const
|
|
8776
|
+
const E = y[A];
|
|
8777
8777
|
w.push({
|
|
8778
|
-
attr:
|
|
8779
|
-
weight:
|
|
8780
|
-
array:
|
|
8781
|
-
itemSize:
|
|
8778
|
+
attr: E,
|
|
8779
|
+
weight: M,
|
|
8780
|
+
array: E.array,
|
|
8781
|
+
itemSize: E.itemSize ?? 3
|
|
8782
8782
|
});
|
|
8783
8783
|
}
|
|
8784
8784
|
}
|
|
8785
|
-
const
|
|
8786
|
-
if (
|
|
8785
|
+
const S = g.array, C = g.itemSize ?? 3;
|
|
8786
|
+
if (S && C >= 3) {
|
|
8787
8787
|
const I = g.count, A = w.length > 0;
|
|
8788
|
-
for (let
|
|
8789
|
-
const
|
|
8790
|
-
let R =
|
|
8788
|
+
for (let M = 0; M < I; M++) {
|
|
8789
|
+
const E = M * C;
|
|
8790
|
+
let R = S[E], k = S[E + 1], F = S[E + 2];
|
|
8791
8791
|
if (A)
|
|
8792
8792
|
for (let B = 0; B < w.length; B++) {
|
|
8793
|
-
const
|
|
8794
|
-
if (
|
|
8795
|
-
const O =
|
|
8796
|
-
R +=
|
|
8793
|
+
const j = w[B], G = j.weight;
|
|
8794
|
+
if (j.array && j.itemSize >= 3) {
|
|
8795
|
+
const O = M * j.itemSize;
|
|
8796
|
+
R += j.array[O] * G, k += j.array[O + 1] * G, F += j.array[O + 2] * G;
|
|
8797
8797
|
} else
|
|
8798
|
-
R +=
|
|
8798
|
+
R += j.attr.getX(M) * G, k += j.attr.getY(M) * G, F += j.attr.getZ(M) * G;
|
|
8799
8799
|
}
|
|
8800
8800
|
R < s && (s = R), k < r && (r = k), F < o && (o = F), R > c && (c = R), k > h && (h = k), F > u && (u = F), k > n && (n = k);
|
|
8801
8801
|
const z = R * R + k * k;
|
|
@@ -8804,14 +8804,14 @@ function Mc(a) {
|
|
|
8804
8804
|
return;
|
|
8805
8805
|
}
|
|
8806
8806
|
for (let I = 0; I < g.count; I++) {
|
|
8807
|
-
let A = g.getX(I),
|
|
8807
|
+
let A = g.getX(I), M = g.getY(I), E = g.getZ(I);
|
|
8808
8808
|
if (w.length > 0)
|
|
8809
8809
|
for (let k = 0; k < w.length; k++) {
|
|
8810
8810
|
const F = w[k], z = F.weight;
|
|
8811
|
-
A += F.attr.getX(I) * z,
|
|
8811
|
+
A += F.attr.getX(I) * z, M += F.attr.getY(I) * z, E += F.attr.getZ(I) * z;
|
|
8812
8812
|
}
|
|
8813
|
-
A < s && (s = A),
|
|
8814
|
-
const R = A * A +
|
|
8813
|
+
A < s && (s = A), M < r && (r = M), E < o && (o = E), A > c && (c = A), M > h && (h = M), E > u && (u = E), M > n && (n = M);
|
|
8814
|
+
const R = A * A + M * M;
|
|
8815
8815
|
R > d && (d = R);
|
|
8816
8816
|
}
|
|
8817
8817
|
}), s === 1 / 0 ? { box: new J(new b(0, 0, 0), new b(0, 0, 0)), maxRadius: 0, height: 0, hasWidth: t, hasLength: e, hasHeight: i } : { box: new J(new b(s, r, o), new b(c, h, u)), maxRadius: Math.sqrt(d), height: n, hasWidth: t, hasLength: e, hasHeight: i };
|
|
@@ -8857,7 +8857,7 @@ function Dc() {
|
|
|
8857
8857
|
}
|
|
8858
8858
|
return !1;
|
|
8859
8859
|
}
|
|
8860
|
-
function
|
|
8860
|
+
function ue(a) {
|
|
8861
8861
|
return typeof a == "string" ? a.trim() : "";
|
|
8862
8862
|
}
|
|
8863
8863
|
const Pc = new Zo(), Vt = new qo(), os = new Yo();
|
|
@@ -9209,7 +9209,7 @@ const ne = {
|
|
|
9209
9209
|
class sn extends Ke {
|
|
9210
9210
|
constructor(e) {
|
|
9211
9211
|
const t = document.createElement("div");
|
|
9212
|
-
super(t), this.props = e, this._emitter = new
|
|
9212
|
+
super(t), this.props = e, this._emitter = new xt(), this._slotContainer = new Ee(), 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 Ee(), this._showSlot = !0, this._isMirror = !1, this.beforeInstall = void 0, this._preventDefaults = (i) => {
|
|
9213
9213
|
i.preventDefault(), i.stopPropagation();
|
|
9214
9214
|
}, this.getWP = this._slotContainer.getWorldPosition.bind(this._slotContainer), t.setAttribute("data-ui-type", "slot"), this._showSlot = typeof e.show == "boolean" ? e.show : !0, this.name = e.name, this._isMirror = e.isMirror, this._slotUI = new to({
|
|
9215
9215
|
name: e.name,
|
|
@@ -9414,7 +9414,7 @@ class sn extends Ke {
|
|
|
9414
9414
|
const t = this.element.style.transform, i = /translate\(-?\d*\.?\d*%?,?\s-?\d*\.?\d*%?\)\s*translate\((-?\d*\.?\d*)px,\s*(-?\d*\.?\d*)px\)/.exec(t);
|
|
9415
9415
|
if (!i)
|
|
9416
9416
|
return;
|
|
9417
|
-
const s = new
|
|
9417
|
+
const s = new V(parseFloat(i[1]), parseFloat(i[2])), r = e.mousePos.distanceTo(s);
|
|
9418
9418
|
let o = this.props.isMobile ? 12 : 18, c = 38, h = 30;
|
|
9419
9419
|
if (this._canInstall && (o = 34, c = 60, h = 60), r < h) {
|
|
9420
9420
|
let u = (h - r) * 1 + o;
|
|
@@ -9423,7 +9423,7 @@ class sn extends Ke {
|
|
|
9423
9423
|
this._slotUI.setSize(o);
|
|
9424
9424
|
}
|
|
9425
9425
|
clone(e) {
|
|
9426
|
-
return new
|
|
9426
|
+
return new Ee();
|
|
9427
9427
|
}
|
|
9428
9428
|
}
|
|
9429
9429
|
class Fc extends Ke {
|
|
@@ -9470,7 +9470,7 @@ class Fc extends Ke {
|
|
|
9470
9470
|
this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element);
|
|
9471
9471
|
}
|
|
9472
9472
|
}
|
|
9473
|
-
class Yi extends
|
|
9473
|
+
class Yi extends Ee {
|
|
9474
9474
|
constructor(e, t = !0, i = !0) {
|
|
9475
9475
|
super(), this._startWith = e, this._showText = t, this.useStartEnd = i, this._line2Length = 0.01, this._line = new zs(
|
|
9476
9476
|
new re(),
|
|
@@ -9521,7 +9521,7 @@ class Yi extends Pe {
|
|
|
9521
9521
|
this._text.dispose(), this.children.forEach((e) => Xe(e)), this.removeFromParent();
|
|
9522
9522
|
}
|
|
9523
9523
|
}
|
|
9524
|
-
class io extends
|
|
9524
|
+
class io extends Re {
|
|
9525
9525
|
// 上一次的角度
|
|
9526
9526
|
constructor(e, t) {
|
|
9527
9527
|
super(), this.radius = e, this._text = new Bc(""), this._line = new Yi(void 0, !1, !1), this._box = new q(), this._arc = new Ln(), this._previousPosition = null, this._updateTimer = null, this._updateDelay = 300, this._accumulatedAngle = 0, this._lastAngle = null, this._line.updateMaterial(new Us({
|
|
@@ -9535,7 +9535,7 @@ class io extends Ee {
|
|
|
9535
9535
|
color: "#eee",
|
|
9536
9536
|
linewidth: 2,
|
|
9537
9537
|
// 像素单位的线宽
|
|
9538
|
-
resolution: new
|
|
9538
|
+
resolution: new V(window.innerWidth, window.innerHeight)
|
|
9539
9539
|
// 屏幕分辨率
|
|
9540
9540
|
}), this._arc.visible = !1, this._arc.rotateX(-Math.PI / 2), this.position.y = t, this._arc.position.y = 1e-3, this.add(this._box), this.add(this._arc), this.add(this._line), this.add(this._text);
|
|
9541
9541
|
}
|
|
@@ -9617,7 +9617,7 @@ const Oc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAUCAYAAADY6P5TAA
|
|
|
9617
9617
|
class nn extends Ke {
|
|
9618
9618
|
constructor(e, t) {
|
|
9619
9619
|
const i = document.createElement("div");
|
|
9620
|
-
super(i), this.props = e, this.amr = t, this.isController = !0, this._direction = 1, this._controllingRotate = !1, this._controlling = !1, this._startAt = 0, this._looper = 0, this._initial = 0, this._canRotate = !1, this._emitter = new
|
|
9620
|
+
super(i), this.props = e, this.amr = t, this.isController = !0, this._direction = 1, this._controllingRotate = !1, this._controlling = !1, this._startAt = 0, this._looper = 0, this._initial = 0, this._canRotate = !1, this._emitter = new xt(), this.addListener = this._emitter.addListener.bind(this._emitter), this.removeListener = this._emitter.removeListener.bind(this._emitter), this._update = () => {
|
|
9621
9621
|
if (this._looper = requestAnimationFrame(this._update), this._controlling) {
|
|
9622
9622
|
let n = (Date.now() - this._startAt) / 200;
|
|
9623
9623
|
n > 4 && (n = 4);
|
|
@@ -9736,7 +9736,7 @@ class nn extends Ke {
|
|
|
9736
9736
|
class Uc extends Xo {
|
|
9737
9737
|
constructor(e) {
|
|
9738
9738
|
const t = document.createElement("div");
|
|
9739
|
-
super(t), this.props = e, this._scale = 0.01, this._emitter = new
|
|
9739
|
+
super(t), this.props = e, this._scale = 0.01, this._emitter = new xt(), this.addEventListener = this._emitter.on.bind(this._emitter), this.removeEventListener = this._emitter.on.bind(this._emitter), this._mouseStart = new V(), this._targetSize = new V(), this._caches = [], this._sizeFlag = "width", this._direction = 1, this._lines = [], this._pointerdown = (h) => {
|
|
9740
9740
|
const { pageX: u, pageY: d } = h;
|
|
9741
9741
|
this.endNode.setPointerCapture(h.pointerId), this._mouseStart.set(u, d), this._targetSize.setX(parseFloat(this.endNode.parentElement.style.width)), this._targetSize.setY(parseFloat(this.endNode.parentElement.style.height));
|
|
9742
9742
|
}, this._pointermove = (h) => {
|
|
@@ -9764,7 +9764,7 @@ class Uc extends Xo {
|
|
|
9764
9764
|
this._lines.forEach((e) => e.dispose()), this._emitter.removeAllListeners(), this.endNode.removeEventListener("pointerdown", this._pointerdown), this.endNode.removeEventListener("pointermove", this._pointermove), this.endNode.removeEventListener("pointerup", this._pointercancel), this.element.remove(), this._caches.forEach((e) => e.clear()), this._caches = [];
|
|
9765
9765
|
}
|
|
9766
9766
|
}
|
|
9767
|
-
class Hc extends
|
|
9767
|
+
class Hc extends Re {
|
|
9768
9768
|
constructor() {
|
|
9769
9769
|
super(), this._box3 = new J(), this._line11 = new Yi("长:"), this._line12 = new Yi("宽:"), this._line13 = new Yi("高:"), this._outline = new io(0, 0), this._radius = 0, this._hasWidthConfig = !1, this._hasLengthConfig = !1, this._hasHeightConfig = !1, this.follow = "", this.followOrigin = 0, this.followScale = 1, this.originOffset = 0, this.translateCache = 0, this.head = 0, this.tail = 0, this._change = () => {
|
|
9770
9770
|
if (!this._app)
|
|
@@ -9910,7 +9910,7 @@ class on {
|
|
|
9910
9910
|
clear() {
|
|
9911
9911
|
this.change();
|
|
9912
9912
|
}
|
|
9913
|
-
change(e, t = new
|
|
9913
|
+
change(e, t = new V(1, 1), i = new V()) {
|
|
9914
9914
|
this.imageUrl = e;
|
|
9915
9915
|
let s;
|
|
9916
9916
|
if (e) {
|
|
@@ -9920,7 +9920,7 @@ class on {
|
|
|
9920
9920
|
let o = window.devicePixelRatio * 2;
|
|
9921
9921
|
this._offscreen.width = r.width + o, this._offscreen.height = r.height + o;
|
|
9922
9922
|
const c = this._offscreen.getContext("2d");
|
|
9923
|
-
c == null || c.clearRect(0, 0, this._offscreen.width, this._offscreen.height), c == null || c.drawImage(r, o / 2, o / 2, r.width, r.height), s = new
|
|
9923
|
+
c == null || c.clearRect(0, 0, this._offscreen.width, this._offscreen.height), c == null || c.drawImage(r, o / 2, o / 2, r.width, r.height), s = new nt(this._offscreen), s.minFilter = 1003, s.colorSpace = pi, s.wrapS = s.wrapT = Ze, s.repeat.set(1 / t.x, 1 / t.y), s.offset.set(i.x, i.y), s.flipY = !1, s.needsUpdate = !0;
|
|
9924
9924
|
const h = this._props.target;
|
|
9925
9925
|
h.material && ((u = h.material.map) == null || u.dispose(), s ? (h.material.map = s, h.material.opacity = 1) : (h.material.map = this.transparentTexture, h.material.opacity = 0));
|
|
9926
9926
|
};
|
|
@@ -10229,7 +10229,7 @@ class an {
|
|
|
10229
10229
|
return m;
|
|
10230
10230
|
}
|
|
10231
10231
|
update() {
|
|
10232
|
-
var
|
|
10232
|
+
var T, P, I;
|
|
10233
10233
|
if (this.links.length < 2)
|
|
10234
10234
|
return;
|
|
10235
10235
|
const { ikTcpIndex: e, effectorJointIndex: t } = this._getEndIndices(), i = this.links[Math.max(0, Math.min(this.links.length - 1, e))].object, s = this._tmpEffectorPos, r = this._tmpTargetPos.copy(this.target), o = this._tmpLinkPos, c = this._tmpAxisWorld, h = this._tmpVToEff, u = this._tmpVToTar;
|
|
@@ -10251,73 +10251,73 @@ class an {
|
|
|
10251
10251
|
for (let A = 0; A < this._frameAppliedAbsDelta.length; A++)
|
|
10252
10252
|
this._frameAppliedAbsDelta[A] && this._frameAppliedAbsDelta[A].fill(0);
|
|
10253
10253
|
for (let A = 0; A < this._jointStates.length; A++) {
|
|
10254
|
-
const
|
|
10255
|
-
if (
|
|
10256
|
-
for (let
|
|
10257
|
-
|
|
10254
|
+
const M = this._jointStates[A];
|
|
10255
|
+
if (M.prevAngle = M.currentAngle, M.prevAngles && M.currentAngles)
|
|
10256
|
+
for (let E = 0; E < M.currentAngles.length; E++)
|
|
10257
|
+
M.prevAngles[E] = M.currentAngles[E];
|
|
10258
10258
|
}
|
|
10259
|
-
let
|
|
10259
|
+
let S = m, C = _, D = 0;
|
|
10260
10260
|
for (let A = 0; A < this.iterations; A++) {
|
|
10261
10261
|
i.getWorldPosition(s);
|
|
10262
|
-
const
|
|
10263
|
-
if (
|
|
10262
|
+
const M = s.distanceToSquared(r), E = M < l, R = d ? this._orientationErrorAngle() : 0, k = !d || R <= f;
|
|
10263
|
+
if (E && k)
|
|
10264
10264
|
break;
|
|
10265
|
-
if (
|
|
10265
|
+
if (M >= S * 0.9 && (!d || R >= C * 0.5)) {
|
|
10266
10266
|
if (D++, D >= 2)
|
|
10267
10267
|
break;
|
|
10268
10268
|
} else
|
|
10269
10269
|
D = 0;
|
|
10270
|
-
|
|
10270
|
+
S = M, C = R;
|
|
10271
10271
|
let F = 0, z = d ? t : e === t ? t - 1 : t;
|
|
10272
10272
|
z = Math.max(0, Math.min(this.links.length - 1, z));
|
|
10273
10273
|
for (let B = z; B >= 0; B--) {
|
|
10274
|
-
const
|
|
10275
|
-
if (!(!
|
|
10276
|
-
for (let O = 0; O <
|
|
10277
|
-
const Y =
|
|
10278
|
-
if (!Y || Y.lengthSq() < 1e-12 || (i.getWorldPosition(s),
|
|
10274
|
+
const j = this.links[B].object, G = this._axesLocal[B];
|
|
10275
|
+
if (!(!G || G.length === 0))
|
|
10276
|
+
for (let O = 0; O < G.length; O++) {
|
|
10277
|
+
const Y = G[O];
|
|
10278
|
+
if (!Y || Y.lengthSq() < 1e-12 || (i.getWorldPosition(s), j.getWorldPosition(o), this._getAxisWorld(B, O, c), c.lengthSq() < 1e-12))
|
|
10279
10279
|
continue;
|
|
10280
|
-
let
|
|
10280
|
+
let U = 0;
|
|
10281
10281
|
if (!(B === t && e === t)) {
|
|
10282
10282
|
h.subVectors(s, o), u.subVectors(r, o);
|
|
10283
|
-
const se = h.lengthSq(),
|
|
10284
|
-
se >= 1e-12 &&
|
|
10283
|
+
const se = h.lengthSq(), he = u.lengthSq();
|
|
10284
|
+
se >= 1e-12 && he >= 1e-12 && (h.multiplyScalar(1 / Math.sqrt(se)), u.multiplyScalar(1 / Math.sqrt(he)), U += this._signedAngleAroundAxis(h, u, c));
|
|
10285
10285
|
}
|
|
10286
10286
|
if (d && B >= n.orientationStartIndex && B <= n.effectorIndex) {
|
|
10287
10287
|
this.links[Math.max(0, Math.min(this.links.length - 1, n.orientationEvalIndex))].object.getWorldQuaternion(this._tmpEffWorldQ), this._tmpTarWorldQ.copy(this.targetQuaternion), this._tmpDirCurP.copy(n.effectorForwardAxis).applyQuaternion(this._tmpEffWorldQ).normalize(), this._tmpDirTarP.copy(n.targetForwardAxis).applyQuaternion(this._tmpTarWorldQ).normalize();
|
|
10288
|
-
const
|
|
10288
|
+
const he = this._signedAngleAroundAxis(this._tmpDirCurP, this._tmpDirTarP, c);
|
|
10289
10289
|
let _r = 0;
|
|
10290
|
-
n.upWeight > 0 && (this._tmpDirCurS.copy(n.effectorUpAxis).applyQuaternion(this._tmpEffWorldQ).normalize(), this._tmpDirTarS.copy(n.targetUpAxis).applyQuaternion(this._tmpTarWorldQ).normalize(), _r = this._signedAngleAroundAxis(this._tmpDirCurS, this._tmpDirTarS, c)),
|
|
10290
|
+
n.upWeight > 0 && (this._tmpDirCurS.copy(n.effectorUpAxis).applyQuaternion(this._tmpEffWorldQ).normalize(), this._tmpDirTarS.copy(n.targetUpAxis).applyQuaternion(this._tmpTarWorldQ).normalize(), _r = this._signedAngleAroundAxis(this._tmpDirCurS, this._tmpDirTarS, c)), U += n.forwardWeight * he + n.upWeight * _r;
|
|
10291
10291
|
}
|
|
10292
|
-
if (Math.abs(
|
|
10292
|
+
if (Math.abs(U) < 1e-6)
|
|
10293
10293
|
continue;
|
|
10294
|
-
const
|
|
10295
|
-
if (
|
|
10294
|
+
const $e = Math.max(0, this._jointWeights[B] ?? 1);
|
|
10295
|
+
if ($e <= 0)
|
|
10296
10296
|
continue;
|
|
10297
|
-
if (
|
|
10298
|
-
const se = this.maxStep *
|
|
10297
|
+
if (U *= Math.max(0, Math.min(1, this.damping)) * $e, this.maxStep > 0) {
|
|
10298
|
+
const se = this.maxStep * $e;
|
|
10299
10299
|
if (se <= 0)
|
|
10300
10300
|
continue;
|
|
10301
|
-
|
|
10301
|
+
U > se ? U = se : U < -se && (U = -se);
|
|
10302
10302
|
}
|
|
10303
10303
|
if (this.maxAngleDelta > 0) {
|
|
10304
|
-
const se = ((
|
|
10305
|
-
if (
|
|
10304
|
+
const se = ((T = this._frameAppliedAbsDelta[B]) == null ? void 0 : T[O]) ?? 0, he = Math.max(0, this.maxAngleDelta - se);
|
|
10305
|
+
if (he <= 0)
|
|
10306
10306
|
continue;
|
|
10307
|
-
|
|
10307
|
+
U > he ? U = he : U < -he && (U = -he);
|
|
10308
10308
|
}
|
|
10309
|
-
const
|
|
10310
|
-
|
|
10311
|
-
const vi = (
|
|
10312
|
-
|
|
10309
|
+
const we = this._jointStates[B];
|
|
10310
|
+
we.currentAngles || (we.currentAngles = new Array(G.length).fill(0));
|
|
10311
|
+
const vi = (we.currentAngles[O] ?? 0) + U, yi = (P = this._axisMins[B]) == null ? void 0 : P[O], ke = (I = this._axisMaxs[B]) == null ? void 0 : I[O];
|
|
10312
|
+
U = this._clamp(vi, yi, ke) - (we.currentAngles[O] ?? 0), !(Math.abs(U) < 1e-9) && (we.currentAngles[O] = (we.currentAngles[O] ?? 0) + U, we.currentAngle = we.currentAngles[0] ?? 0, Math.abs(U) > F && (F = Math.abs(U)), this._frameAppliedAbsDelta[B] && (this._frameAppliedAbsDelta[B][O] = (this._frameAppliedAbsDelta[B][O] ?? 0) + Math.abs(U)), this._applyLinkAngles(B), j.updateMatrixWorld(!0));
|
|
10313
10313
|
}
|
|
10314
10314
|
}
|
|
10315
|
-
if (F < 1e-5 &&
|
|
10315
|
+
if (F < 1e-5 && M <= l * 4 && (!d || R <= f * 2))
|
|
10316
10316
|
break;
|
|
10317
10317
|
}
|
|
10318
10318
|
}
|
|
10319
10319
|
}
|
|
10320
|
-
const
|
|
10320
|
+
const st = new Rn(), Jt = new b(), Vc = new ee(), ln = new b(), cn = new b(), bs = { type: "change" }, hn = { type: "mouseDown", mode: null }, un = { type: "mouseUp", mode: null }, Gc = { type: "objectChange" }, Di = /* @__PURE__ */ new WeakMap(), Pi = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap();
|
|
10321
10321
|
function Qc(a) {
|
|
10322
10322
|
if (!this.domElement)
|
|
10323
10323
|
return { x: 0, y: 0, button: a.button };
|
|
@@ -10340,7 +10340,7 @@ function Ei(a, e, t) {
|
|
|
10340
10340
|
function As(a) {
|
|
10341
10341
|
return a === "E" ? "rotate" : a === "XYZ" ? "translate" : null;
|
|
10342
10342
|
}
|
|
10343
|
-
class jc extends
|
|
10343
|
+
class jc extends Re {
|
|
10344
10344
|
constructor(e) {
|
|
10345
10345
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
10346
10346
|
}
|
|
@@ -10359,9 +10359,9 @@ class jc extends Ee {
|
|
|
10359
10359
|
});
|
|
10360
10360
|
}
|
|
10361
10361
|
}
|
|
10362
|
-
const
|
|
10362
|
+
const ae = class ae extends Re {
|
|
10363
10363
|
constructor(e) {
|
|
10364
|
-
super(), this.picker = new
|
|
10364
|
+
super(), this.picker = new Re(), this.gizmo = new Re(), this.helper = new Re(), this._matMove = new ze({
|
|
10365
10365
|
color: 16777215,
|
|
10366
10366
|
depthTest: !1,
|
|
10367
10367
|
depthWrite: !1,
|
|
@@ -10393,8 +10393,8 @@ const oe = class oe extends Ee {
|
|
|
10393
10393
|
toneMapped: !1,
|
|
10394
10394
|
transparent: !0,
|
|
10395
10395
|
opacity: 0.6
|
|
10396
|
-
}), this._arcSegments = 96, this._arcStartAngleOffset = 0.05, this._moveColorDefault = new X(16777215), this._moveColorActive = new X(0), this._moveOpacityDefault = 1, this._moveOpacityRingActive = 0.5, this._ringColorDefault = new X(16777215), this._ringColorActive = new X(0), this._ringOpacityDefault = 1, this._ringOpacityActive = 0.6, this._ringScale = 1, this._ringTargetScale = 1.5, this._ringScaleTweening = !1, this._isMoveActive = !1, this._isRingActive = !1, this._isMoveHover = !1, this._isDragging = !1, this._isExpanded = !1, this.controls = e, this._moveMesh = new q(new xr(
|
|
10397
|
-
new wr(
|
|
10396
|
+
}), this._arcSegments = 96, this._arcStartAngleOffset = 0.05, this._moveColorDefault = new X(16777215), this._moveColorActive = new X(0), this._moveOpacityDefault = 1, this._moveOpacityRingActive = 0.5, this._ringColorDefault = new X(16777215), this._ringColorActive = new X(0), this._ringOpacityDefault = 1, this._ringOpacityActive = 0.6, this._ringScale = 1, this._ringTargetScale = 1.5, this._ringScaleTweening = !1, this._isMoveActive = !1, this._isRingActive = !1, this._isMoveHover = !1, this._isDragging = !1, this._isExpanded = !1, this.controls = e, this._moveMesh = new q(new xr(ae.MOVE_RADIUS, 96), this._matMove), this._moveMesh.rotateX(-Math.PI / 2), this._moveMesh.name = "XYZ", this._moveMesh.renderOrder = 1 / 0, this._ringMesh = new q(
|
|
10397
|
+
new wr(ae.RING_RADIUS, ae.RING_TUBE, 48, 96),
|
|
10398
10398
|
this._matRing
|
|
10399
10399
|
), this._ringMesh.name = "E", this._ringMesh.renderOrder = 1e3, this._arcGeom = new Ns(), this._arcPositions = new Float32Array((this._arcSegments + 1) * 3), this._arcGeom.setPositions(this._arcPositions), this._arcGeom.instanceCount = 0;
|
|
10400
10400
|
const t = new kn({
|
|
@@ -10408,10 +10408,10 @@ const oe = class oe extends Ee {
|
|
|
10408
10408
|
opacity: 1
|
|
10409
10409
|
});
|
|
10410
10410
|
t.resolution.set(window.innerWidth, window.innerHeight), this._arcLine = new Ln(this._arcGeom, t), this._arcLine.renderOrder = 1001, this._arcLine.visible = !1, this.gizmo.add(this._ringMesh), this.gizmo.add(this._moveMesh), this.gizmo.add(this._arcLine);
|
|
10411
|
-
const i = new q(new xr(
|
|
10411
|
+
const i = new q(new xr(ae.PICKER_MOVE_RADIUS, 32), this._matInvisible);
|
|
10412
10412
|
i.name = "XYZ", i.renderOrder = 1 / 0;
|
|
10413
10413
|
const s = new q(
|
|
10414
|
-
new wr(
|
|
10414
|
+
new wr(ae.RING_RADIUS + 5e-3, ae.PICKER_RING_TUBE, 8, 48),
|
|
10415
10415
|
this._matInvisible
|
|
10416
10416
|
);
|
|
10417
10417
|
s.name = "E", s.renderOrder = 1 / 0, this.picker.add(s), this.picker.add(i), this.picker.visible = !1;
|
|
@@ -10479,16 +10479,16 @@ const oe = class oe extends Ee {
|
|
|
10479
10479
|
}
|
|
10480
10480
|
if (_ !== this._isRingActive) {
|
|
10481
10481
|
this._isRingActive = _;
|
|
10482
|
-
const x = _ ? this._ringColorActive : this._ringColorDefault, w = _ ? this._ringOpacityActive : this._ringOpacityDefault,
|
|
10483
|
-
this._matMove.opacity =
|
|
10484
|
-
const
|
|
10482
|
+
const x = _ ? this._ringColorActive : this._ringColorDefault, w = _ ? this._ringOpacityActive : this._ringOpacityDefault, S = _ ? this._moveOpacityRingActive : this._moveOpacityDefault;
|
|
10483
|
+
this._matMove.opacity = S, (y = this._ringColorTween) == null || y.stop();
|
|
10484
|
+
const C = {
|
|
10485
10485
|
r: this._matRing.color.r,
|
|
10486
10486
|
g: this._matRing.color.g,
|
|
10487
10487
|
b: this._matRing.color.b,
|
|
10488
10488
|
opacity: this._matRing.opacity
|
|
10489
10489
|
};
|
|
10490
|
-
this._ringColorTween = new me.Tween(
|
|
10491
|
-
this._matRing.color.setRGB(
|
|
10490
|
+
this._ringColorTween = new me.Tween(C).to({ r: x.r, g: x.g, b: x.b, opacity: w }, 200).easing(me.Easing.Quadratic.Out).onUpdate(() => {
|
|
10491
|
+
this._matRing.color.setRGB(C.r, C.g, C.b), this._matRing.opacity = C.opacity;
|
|
10492
10492
|
}).start();
|
|
10493
10493
|
}
|
|
10494
10494
|
const p = n;
|
|
@@ -10502,21 +10502,21 @@ const oe = class oe extends Ee {
|
|
|
10502
10502
|
const x = t.pointStart, w = t.pointEnd;
|
|
10503
10503
|
if (x.lengthSq() > 1e-12 && w.lengthSq() > 1e-12) {
|
|
10504
10504
|
ln.set(1, 0, 0).applyQuaternion(t.cameraQuaternion), cn.set(0, 1, 0).applyQuaternion(t.cameraQuaternion);
|
|
10505
|
-
const
|
|
10506
|
-
if (Math.abs(
|
|
10505
|
+
const S = x.dot(ln), C = x.dot(cn), D = Math.atan2(C, S), T = t.rotationAngle;
|
|
10506
|
+
if (Math.abs(T) < 1e-4)
|
|
10507
10507
|
this._arcLine.visible = !1, this._arcGeom.instanceCount = 0;
|
|
10508
10508
|
else {
|
|
10509
|
-
const
|
|
10509
|
+
const P = this._arcSegments, I = Math.max(2, Math.min(P, Math.ceil(Math.abs(T) / (Math.PI * 2) * P))), A = T / I, M = ae.RING_RADIUS, E = Math.sign(T) * this._arcStartAngleOffset;
|
|
10510
10510
|
for (let F = 0; F <= I; F++) {
|
|
10511
|
-
const z = D +
|
|
10512
|
-
this._arcPositions[
|
|
10511
|
+
const z = D + E + A * F, B = Math.cos(z) * M, j = Math.sin(z) * M, G = F * 3;
|
|
10512
|
+
this._arcPositions[G] = B, this._arcPositions[G + 1] = j, this._arcPositions[G + 2] = 0;
|
|
10513
10513
|
}
|
|
10514
|
-
for (let F = I + 1; F <=
|
|
10514
|
+
for (let F = I + 1; F <= P; F++) {
|
|
10515
10515
|
const z = F * 3;
|
|
10516
10516
|
this._arcPositions[z] = 0, this._arcPositions[z + 1] = 0, this._arcPositions[z + 2] = 0;
|
|
10517
10517
|
}
|
|
10518
10518
|
this._arcGeom.setPositions(this._arcPositions), this._arcGeom.instanceCount = I, this._arcLine.computeLineDistances(), this._arcGeom.computeBoundingSphere();
|
|
10519
|
-
const R = Math.cos(D) *
|
|
10519
|
+
const R = Math.cos(D) * ae.RING_RADIUS * this._ringScale, k = Math.sin(D) * ae.RING_RADIUS * this._ringScale;
|
|
10520
10520
|
Jt.set(R, k, 0), Jt.applyQuaternion(t.cameraQuaternion), Jt.multiplyScalar(o), Jt.add(r), this._startMarker.position.copy(Jt);
|
|
10521
10521
|
}
|
|
10522
10522
|
} else
|
|
@@ -10526,8 +10526,8 @@ const oe = class oe extends Ee {
|
|
|
10526
10526
|
super.updateMatrixWorld(e);
|
|
10527
10527
|
}
|
|
10528
10528
|
};
|
|
10529
|
-
|
|
10530
|
-
let Ys =
|
|
10529
|
+
ae.RING_RADIUS = 0.18, ae.RING_TUBE = 3e-3, ae.PICKER_RING_TUBE = 0.025, ae.MOVE_RADIUS = 0.04, ae.PICKER_MOVE_RADIUS = 0.2;
|
|
10530
|
+
let Ys = ae;
|
|
10531
10531
|
class qc extends q {
|
|
10532
10532
|
constructor() {
|
|
10533
10533
|
super(
|
|
@@ -10602,7 +10602,7 @@ class Yc extends Po {
|
|
|
10602
10602
|
this.size = e;
|
|
10603
10603
|
}
|
|
10604
10604
|
getRaycaster() {
|
|
10605
|
-
return
|
|
10605
|
+
return st;
|
|
10606
10606
|
}
|
|
10607
10607
|
_handlePointerHover(e) {
|
|
10608
10608
|
if (this.enabled)
|
|
@@ -10686,15 +10686,15 @@ class Yc extends Po {
|
|
|
10686
10686
|
pointerHover(e) {
|
|
10687
10687
|
if (this.object === void 0 || this.dragging === !0)
|
|
10688
10688
|
return;
|
|
10689
|
-
e !== null &&
|
|
10690
|
-
const t = this._gizmo.picker.children.find((h) => h.name === "XYZ"), i = this._gizmo.picker.children.find((h) => h.name === "E"), s = t ? Ei(t,
|
|
10689
|
+
e !== null && st.setFromCamera(e, this.camera);
|
|
10690
|
+
const t = this._gizmo.picker.children.find((h) => h.name === "XYZ"), i = this._gizmo.picker.children.find((h) => h.name === "E"), s = t ? Ei(t, st) : !1, r = i ? Ei(i, st) : !1;
|
|
10691
10691
|
let o = this._gizmo.isExpanded, c = null;
|
|
10692
10692
|
o ? r && !this._gizmo.isRingScaleTweening ? c = "E" : s ? c = "XYZ" : (o = !1, c = null) : s && (o = !0, c = "XYZ"), this._gizmo.isExpanded !== o && (this._gizmo.isExpanded = o), c && this._isAxisAllowed(c) ? this.axis = c : this.axis = null, this._setHoverShieldActive(!!this.axis || this.dragging), this._updateCursor();
|
|
10693
10693
|
}
|
|
10694
10694
|
pointerDown(e) {
|
|
10695
10695
|
if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null && this._isAxisAllowed(this.axis)) {
|
|
10696
|
-
e !== null &&
|
|
10697
|
-
const t = Ei(this._plane,
|
|
10696
|
+
e !== null && st.setFromCamera(e, this.camera);
|
|
10697
|
+
const t = Ei(this._plane, st, !0);
|
|
10698
10698
|
t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, this._setHoverShieldActive(!0);
|
|
10699
10699
|
const i = As(this.axis);
|
|
10700
10700
|
hn.mode = i, this.dispatchEvent(hn), this._updateCursor();
|
|
@@ -10707,8 +10707,8 @@ class Yc extends Po {
|
|
|
10707
10707
|
const s = As(t);
|
|
10708
10708
|
if (!s)
|
|
10709
10709
|
return;
|
|
10710
|
-
e !== null &&
|
|
10711
|
-
const r = Ei(this._plane,
|
|
10710
|
+
e !== null && st.setFromCamera(e, this.camera);
|
|
10711
|
+
const r = Ei(this._plane, st, !0);
|
|
10712
10712
|
r && (this.pointEnd.copy(r.point).sub(this.worldPositionStart), s === "translate" ? (this._offset.copy(this.pointEnd).sub(this.pointStart), this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), i.position.copy(this._offset).add(this._positionStart)) : s === "rotate" && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1, this.rotationAxis.applyQuaternion(this._parentQuaternionInv), i.quaternion.copy(Vc.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), i.quaternion.multiply(this._quaternionStart).normalize()), this.dispatchEvent(bs), this.dispatchEvent(Gc));
|
|
10713
10713
|
}
|
|
10714
10714
|
pointerUp(e) {
|
|
@@ -10741,7 +10741,7 @@ class Yc extends Po {
|
|
|
10741
10741
|
class Kc {
|
|
10742
10742
|
constructor(e, t) {
|
|
10743
10743
|
var n;
|
|
10744
|
-
this.isController = !0, this._enabled = !0, this._tmpQ = new ee(), this._tmpContainerQ = new ee(), this._tmpV = new b(), this._resetHierarchy = !1, this._defaultPoseQuats = /* @__PURE__ */ new Map(), this._zeroPoseQuats = /* @__PURE__ */ new Map(), this._emitter = new
|
|
10744
|
+
this.isController = !0, this._enabled = !0, this._tmpQ = new ee(), this._tmpContainerQ = new ee(), this._tmpV = new b(), this._resetHierarchy = !1, this._defaultPoseQuats = /* @__PURE__ */ new Map(), this._zeroPoseQuats = /* @__PURE__ */ new Map(), this._emitter = new xt(), this.addListener = this._emitter.addListener.bind(this._emitter), this.removeAllListeners = this._emitter.removeAllListeners.bind(this._emitter), this._initialTargetPos = new b(), this._initialTargetQuat = new ee(), this._axesHelpers = [], this._showAxes = !1;
|
|
10745
10745
|
const { joints: i, container: s, context: r, resetHierarchy: o } = e, c = (Array.isArray(i) ? i : []).map((l) => l.object);
|
|
10746
10746
|
this._container = s, this._context = r, this._resetHierarchy = !!o;
|
|
10747
10747
|
let h;
|
|
@@ -10754,7 +10754,7 @@ class Kc {
|
|
|
10754
10754
|
this._emitter.emit("dragging-changed", l), l || this.syncTargetToEffector();
|
|
10755
10755
|
}), this.transformControls.addEventListener("axis-changed", ({ value: l }) => {
|
|
10756
10756
|
this.transformControls.dragging || (this.targetObject.visible = l === "E");
|
|
10757
|
-
}), this.targetObject = new
|
|
10757
|
+
}), this.targetObject = new Re(), this.targetObject.name = "ikTarget", this.targetObject.visible = !1, this.targetObject.userData.isIKTarget = !0, this.transformControls.attach(this.targetObject);
|
|
10758
10758
|
const u = new cs(0.0675);
|
|
10759
10759
|
u.material.depthTest = !1, u.material.depthWrite = !1, u.renderOrder = 1e3, this.targetObject.add(u), this.syncTargetToEffector(), this._initialTargetPos.copy(this.targetObject.position), this._initialTargetQuat.copy(this.targetObject.quaternion);
|
|
10760
10760
|
const d = this.transformControls.getHelper();
|
|
@@ -10879,9 +10879,9 @@ const Zc = (a, e, t, i = {}) => {
|
|
|
10879
10879
|
}), s;
|
|
10880
10880
|
}, so = new En();
|
|
10881
10881
|
so.crossOrigin = "anonymous";
|
|
10882
|
-
class Xc extends
|
|
10882
|
+
class Xc extends Re {
|
|
10883
10883
|
constructor(e) {
|
|
10884
|
-
super(), this._props = e, this._emitter = new
|
|
10884
|
+
super(), this._props = e, this._emitter = new xt(), this.addEventListener = this._emitter.addListener.bind(this._emitter), this._container = new Ee(), this.lines = new Ee(), this._clips = [], this._actionsMap = /* @__PURE__ */ new Map(), this._animationClock = new rs(), this.sizeBox = new Hc(), this._goodsSize = new Ic(0, 0, 0), this._slots = [], this._logos = [], this._skins = [], this._levels = /* @__PURE__ */ new Map(), this._rollerLevel = /* @__PURE__ */ new Map(), this._liftBrackets = [], this._ikChains = [], this.ikControllers = [], this._ikDraggingControllers = /* @__PURE__ */ new Set(), this._shelfSyncCache = /* @__PURE__ */ new WeakMap(), this._rollerPools = /* @__PURE__ */ new WeakMap(), this._videoCache = /* @__PURE__ */ new Map(), this._rollerColumns = 1, this._bodyOpacity = 1, this._masts = /* @__PURE__ */ new Map(), this._liftMaxHeight = 0, this._jackMaxHeight = 0, this._forkMaxHeight = 0, this.controllers = [], this.goods = [], this._breathLights = [], this._shelves = /* @__PURE__ */ new Map(), this._shelfMaxLevel = 1, this._url = "", this._showController = !0, this._showSlots = !0, this._shapeKeys = /* @__PURE__ */ new Map(), this._shapeKeyTargets = /* @__PURE__ */ new Map(), this._shapeKeyTimer = 0, this._shapeKeyCache = "", this.shapeKeyDirty = !1, this._materialsCache = /* @__PURE__ */ new Map(), this.opacityCache = void 0, this.actions = [], this._useCenterModel = !1, this._useLift = !1, this._columnCount = 1, this._columnGap = 0.03, this._rowCount = 1, this._rowGap = 0.01, this._levelCount = 1, this._currentAction = null, this._pendingFinishedCallback = null, this._url = e.url || "", this._url && this.load(this._url).then(), this.add(this._container, this.lines), this._props.showSizeBox && this.add(this.sizeBox), this.showController = typeof e.showController == "boolean" ? e.showController : !0, this._showSlots = typeof e.showSlots == "boolean" ? e.showSlots : !0;
|
|
10885
10885
|
}
|
|
10886
10886
|
get shapeKeys() {
|
|
10887
10887
|
return this._shapeKeys;
|
|
@@ -11102,7 +11102,7 @@ class Xc extends Ee {
|
|
|
11102
11102
|
e && (e.change(t), this._app && this._app.usePathTracing && (this._app.sampleCount = 0, this._app.usePathTracing && (this._app.pathTracer.pausePathTracing = !1, this._app.pathTracer.updateMaterials())));
|
|
11103
11103
|
}
|
|
11104
11104
|
changeLogo(e, t) {
|
|
11105
|
-
e.change(t.url, new
|
|
11105
|
+
e.change(t.url, new V(t.scaleX, t.scaleY), new V(
|
|
11106
11106
|
t.ox,
|
|
11107
11107
|
t.oy
|
|
11108
11108
|
));
|
|
@@ -11272,9 +11272,9 @@ class Xc extends Ee {
|
|
|
11272
11272
|
if (this._ikChains = [], !this._ikChains.length) {
|
|
11273
11273
|
const t = [];
|
|
11274
11274
|
e.traverse((i) => {
|
|
11275
|
-
const s =
|
|
11275
|
+
const s = ue(i == null ? void 0 : i.name);
|
|
11276
11276
|
s && s.startsWith("ArmatureRoot") && t.push(i);
|
|
11277
|
-
}), t.sort((i, s) =>
|
|
11277
|
+
}), t.sort((i, s) => ue(i.name).localeCompare(ue(s.name))), t.forEach((i) => {
|
|
11278
11278
|
const { joints: s, orientation: r } = this._buildIKChainParams(i);
|
|
11279
11279
|
if (s.length < 2)
|
|
11280
11280
|
return;
|
|
@@ -11446,7 +11446,7 @@ class Xc extends Ee {
|
|
|
11446
11446
|
}
|
|
11447
11447
|
setForkMaxHeight(e) {
|
|
11448
11448
|
this._fork && (this._forkMaxHeight = e, this.limitValue(e), this.controllers.forEach((t) => {
|
|
11449
|
-
|
|
11449
|
+
ue(t.name).toLowerCase().includes("fork") && (t.props.max = e);
|
|
11450
11450
|
}), this._fork && this.forkHeight > this._forkMaxHeight && this.setForkHeight(e));
|
|
11451
11451
|
}
|
|
11452
11452
|
setLiftHeight(e) {
|
|
@@ -11464,7 +11464,7 @@ class Xc extends Ee {
|
|
|
11464
11464
|
if (!this._lift)
|
|
11465
11465
|
return;
|
|
11466
11466
|
this._liftMaxHeight = e, this.limitValue(e), this.controllers.forEach((r) => {
|
|
11467
|
-
|
|
11467
|
+
ue(r.name).toLowerCase().includes("lift") && (r.props.max = e);
|
|
11468
11468
|
}), this.liftHeight > this._liftMaxHeight && this.setLiftHeight(e);
|
|
11469
11469
|
let t = 0.46;
|
|
11470
11470
|
this.levelOffset && (t = this.levelOffset + 0.1);
|
|
@@ -11474,7 +11474,7 @@ class Xc extends Ee {
|
|
|
11474
11474
|
}
|
|
11475
11475
|
setJackMaxHeight(e) {
|
|
11476
11476
|
this._jack && (this._jackMaxHeight = e, this.limitValue(e), this.controllers.forEach((t) => {
|
|
11477
|
-
|
|
11477
|
+
ue(t.name).toLowerCase().includes("jack") && (t.props.max = e);
|
|
11478
11478
|
}), this.jackHeight > this._jackMaxHeight && this.setJackHeight(e));
|
|
11479
11479
|
}
|
|
11480
11480
|
setJackHeight(e) {
|
|
@@ -11764,10 +11764,10 @@ class Xc extends Ee {
|
|
|
11764
11764
|
generateController(e, t) {
|
|
11765
11765
|
if (this.showController) {
|
|
11766
11766
|
if (e.userData.isForkController && e.userData.target) {
|
|
11767
|
-
const i =
|
|
11767
|
+
const i = ue(e.userData.target.name), { min: s, max: r } = e.userData;
|
|
11768
11768
|
let o;
|
|
11769
11769
|
if (!i || (t.traverse((h) => {
|
|
11770
|
-
const u =
|
|
11770
|
+
const u = ue(h == null ? void 0 : h.name);
|
|
11771
11771
|
u && u === i && (o = h);
|
|
11772
11772
|
}), !o))
|
|
11773
11773
|
return;
|
|
@@ -11780,10 +11780,10 @@ class Xc extends Ee {
|
|
|
11780
11780
|
}, o);
|
|
11781
11781
|
e.add(c);
|
|
11782
11782
|
} else if (e.userData.isController && e.userData.target) {
|
|
11783
|
-
const i =
|
|
11783
|
+
const i = ue(e.userData.target.name), { min: s, max: r } = e.userData;
|
|
11784
11784
|
let o;
|
|
11785
11785
|
if (!i || (t.traverse((h) => {
|
|
11786
|
-
const u =
|
|
11786
|
+
const u = ue(h == null ? void 0 : h.name);
|
|
11787
11787
|
u && u === i && (o = h);
|
|
11788
11788
|
}), !o))
|
|
11789
11789
|
return;
|
|
@@ -11821,7 +11821,7 @@ class Xc extends Ee {
|
|
|
11821
11821
|
var f;
|
|
11822
11822
|
if (!n.startsWith("target"))
|
|
11823
11823
|
return [];
|
|
11824
|
-
const l =
|
|
11824
|
+
const l = ue((f = e.userData[n]) == null ? void 0 : f.name);
|
|
11825
11825
|
return l ? [l] : [];
|
|
11826
11826
|
}).length)
|
|
11827
11827
|
return;
|
|
@@ -11838,12 +11838,12 @@ class Xc extends Ee {
|
|
|
11838
11838
|
generateSlot(e, t) {
|
|
11839
11839
|
var i, s;
|
|
11840
11840
|
if (e.userData.isSlot) {
|
|
11841
|
-
const r =
|
|
11841
|
+
const r = ue(e.userData.name), o = e.userData.isMirror, c = ue((i = e.userData.mirrorSlot) == null ? void 0 : i.name);
|
|
11842
11842
|
if (r) {
|
|
11843
|
-
const h = e.userData.holeTarget && e.userData.holeTarget.name, u =
|
|
11843
|
+
const h = e.userData.holeTarget && e.userData.holeTarget.name, u = ue(h);
|
|
11844
11844
|
let d;
|
|
11845
11845
|
u && t.traverse((m) => {
|
|
11846
|
-
const _ =
|
|
11846
|
+
const _ = ue(m == null ? void 0 : m.name);
|
|
11847
11847
|
_ && _ === u && (d = m);
|
|
11848
11848
|
});
|
|
11849
11849
|
const n = /* @__PURE__ */ new Map();
|
|
@@ -12034,12 +12034,12 @@ function rh(a) {
|
|
|
12034
12034
|
function Ms(a, e, t, i, s) {
|
|
12035
12035
|
let r = 1 / 0, o = 1 / 0, c = 1 / 0, h = -1 / 0, u = -1 / 0, d = -1 / 0, n = 1 / 0, l = 1 / 0, f = 1 / 0, m = -1 / 0, _ = -1 / 0, p = -1 / 0;
|
|
12036
12036
|
for (let g = e * 6, v = (e + t) * 6; g < v; g += 6) {
|
|
12037
|
-
const y = a[g + 0], x = a[g + 1], w = y - x,
|
|
12038
|
-
w < r && (r = w),
|
|
12039
|
-
const
|
|
12040
|
-
|
|
12041
|
-
const I = a[g + 4], A = a[g + 5],
|
|
12042
|
-
|
|
12037
|
+
const y = a[g + 0], x = a[g + 1], w = y - x, S = y + x;
|
|
12038
|
+
w < r && (r = w), S > h && (h = S), y < n && (n = y), y > m && (m = y);
|
|
12039
|
+
const C = a[g + 2], D = a[g + 3], T = C - D, P = C + D;
|
|
12040
|
+
T < o && (o = T), P > u && (u = P), C < l && (l = C), C > _ && (_ = C);
|
|
12041
|
+
const I = a[g + 4], A = a[g + 5], M = I - A, E = I + A;
|
|
12042
|
+
M < c && (c = M), E > d && (d = E), I < f && (f = I), I > p && (p = I);
|
|
12043
12043
|
}
|
|
12044
12044
|
i[0] = r, i[1] = o, i[2] = c, i[3] = h, i[4] = u, i[5] = d, s[0] = n, s[1] = l, s[2] = f, s[3] = m, s[4] = _, s[5] = p;
|
|
12045
12045
|
}
|
|
@@ -12056,14 +12056,14 @@ function nh(a, e = null, t = null, i = null) {
|
|
|
12056
12056
|
let p = m + 0, g = m + 1, v = m + 2;
|
|
12057
12057
|
r && (p = r[p], g = r[g], v = r[v]), c || (p = p * n + d, g = g * n + d, v = v * n + d);
|
|
12058
12058
|
for (let y = 0; y < 3; y++) {
|
|
12059
|
-
let x, w,
|
|
12060
|
-
c ? (x = s[l[y]](p), w = s[l[y]](g),
|
|
12061
|
-
let
|
|
12062
|
-
w <
|
|
12059
|
+
let x, w, S;
|
|
12060
|
+
c ? (x = s[l[y]](p), w = s[l[y]](g), S = s[l[y]](v)) : (x = u[p + y], w = u[g + y], S = u[v + y]);
|
|
12061
|
+
let C = x;
|
|
12062
|
+
w < C && (C = w), S < C && (C = S);
|
|
12063
12063
|
let D = x;
|
|
12064
|
-
w > D && (D = w),
|
|
12065
|
-
const
|
|
12066
|
-
h[_ +
|
|
12064
|
+
w > D && (D = w), S > D && (D = S);
|
|
12065
|
+
const T = (D - C) / 2, P = y * 2;
|
|
12066
|
+
h[_ + P + 0] = C + T, h[_ + P + 1] = T + (Math.abs(C) + T) * eh;
|
|
12067
12067
|
}
|
|
12068
12068
|
}
|
|
12069
12069
|
return h;
|
|
@@ -12099,7 +12099,7 @@ function ei(a) {
|
|
|
12099
12099
|
const e = a[3] - a[0], t = a[4] - a[1], i = a[5] - a[2];
|
|
12100
12100
|
return 2 * (e * t + t * i + i * e);
|
|
12101
12101
|
}
|
|
12102
|
-
const Ue = 32, oh = (a, e) => a.candidate - e.candidate,
|
|
12102
|
+
const Ue = 32, oh = (a, e) => a.candidate - e.candidate, rt = new Array(Ue).fill().map(() => ({
|
|
12103
12103
|
count: 0,
|
|
12104
12104
|
bounds: new Float32Array(6),
|
|
12105
12105
|
rightCacheBounds: new Float32Array(6),
|
|
@@ -12119,20 +12119,20 @@ function ah(a, e, t, i, s, r) {
|
|
|
12119
12119
|
for (let l = 0; l < 3; l++) {
|
|
12120
12120
|
const f = e[l], p = (e[l + 3] - f) / Ue;
|
|
12121
12121
|
if (s < Ue / 4) {
|
|
12122
|
-
const g = [...
|
|
12122
|
+
const g = [...rt];
|
|
12123
12123
|
g.length = s;
|
|
12124
12124
|
let v = 0;
|
|
12125
12125
|
for (let x = d; x < n; x += 6, v++) {
|
|
12126
12126
|
const w = g[v];
|
|
12127
12127
|
w.candidate = t[x + 2 * l], w.count = 0;
|
|
12128
12128
|
const {
|
|
12129
|
-
bounds:
|
|
12130
|
-
leftCacheBounds:
|
|
12129
|
+
bounds: S,
|
|
12130
|
+
leftCacheBounds: C,
|
|
12131
12131
|
rightCacheBounds: D
|
|
12132
12132
|
} = w;
|
|
12133
|
-
for (let
|
|
12134
|
-
D[
|
|
12135
|
-
Ri(x, t,
|
|
12133
|
+
for (let T = 0; T < 3; T++)
|
|
12134
|
+
D[T] = 1 / 0, D[T + 3] = -1 / 0, C[T] = 1 / 0, C[T + 3] = -1 / 0, S[T] = 1 / 0, S[T + 3] = -1 / 0;
|
|
12135
|
+
Ri(x, t, S);
|
|
12136
12136
|
}
|
|
12137
12137
|
g.sort(oh);
|
|
12138
12138
|
let y = s;
|
|
@@ -12143,49 +12143,49 @@ function ah(a, e, t, i, s, r) {
|
|
|
12143
12143
|
}
|
|
12144
12144
|
for (let x = d; x < n; x += 6) {
|
|
12145
12145
|
const w = t[x + 2 * l];
|
|
12146
|
-
for (let
|
|
12147
|
-
const
|
|
12148
|
-
w >=
|
|
12146
|
+
for (let S = 0; S < y; S++) {
|
|
12147
|
+
const C = g[S];
|
|
12148
|
+
w >= C.candidate ? Ri(x, t, C.rightCacheBounds) : (Ri(x, t, C.leftCacheBounds), C.count++);
|
|
12149
12149
|
}
|
|
12150
12150
|
}
|
|
12151
12151
|
for (let x = 0; x < y; x++) {
|
|
12152
|
-
const w = g[x],
|
|
12153
|
-
let
|
|
12154
|
-
|
|
12152
|
+
const w = g[x], S = w.count, C = s - w.count, D = w.leftCacheBounds, T = w.rightCacheBounds;
|
|
12153
|
+
let P = 0;
|
|
12154
|
+
S !== 0 && (P = ei(D) / h);
|
|
12155
12155
|
let I = 0;
|
|
12156
|
-
|
|
12157
|
-
const A = dn + Ts * (
|
|
12156
|
+
C !== 0 && (I = ei(T) / h);
|
|
12157
|
+
const A = dn + Ts * (P * S + I * C);
|
|
12158
12158
|
A < u && (o = l, u = A, c = w.candidate);
|
|
12159
12159
|
}
|
|
12160
12160
|
} else {
|
|
12161
12161
|
for (let y = 0; y < Ue; y++) {
|
|
12162
|
-
const x =
|
|
12162
|
+
const x = rt[y];
|
|
12163
12163
|
x.count = 0, x.candidate = f + p + y * p;
|
|
12164
12164
|
const w = x.bounds;
|
|
12165
|
-
for (let
|
|
12166
|
-
w[
|
|
12165
|
+
for (let S = 0; S < 3; S++)
|
|
12166
|
+
w[S] = 1 / 0, w[S + 3] = -1 / 0;
|
|
12167
12167
|
}
|
|
12168
12168
|
for (let y = d; y < n; y += 6) {
|
|
12169
|
-
let
|
|
12170
|
-
|
|
12171
|
-
const
|
|
12172
|
-
|
|
12169
|
+
let S = ~~((t[y + 2 * l] - f) / p);
|
|
12170
|
+
S >= Ue && (S = Ue - 1);
|
|
12171
|
+
const C = rt[S];
|
|
12172
|
+
C.count++, Ri(y, t, C.bounds);
|
|
12173
12173
|
}
|
|
12174
|
-
const g =
|
|
12174
|
+
const g = rt[Ue - 1];
|
|
12175
12175
|
mn(g.bounds, g.rightCacheBounds);
|
|
12176
12176
|
for (let y = Ue - 2; y >= 0; y--) {
|
|
12177
|
-
const x =
|
|
12177
|
+
const x = rt[y], w = rt[y + 1];
|
|
12178
12178
|
gn(x.bounds, w.rightCacheBounds, x.rightCacheBounds);
|
|
12179
12179
|
}
|
|
12180
12180
|
let v = 0;
|
|
12181
12181
|
for (let y = 0; y < Ue - 1; y++) {
|
|
12182
|
-
const x =
|
|
12183
|
-
w !== 0 && (v === 0 ? mn(
|
|
12184
|
-
let
|
|
12185
|
-
v !== 0 && (
|
|
12182
|
+
const x = rt[y], w = x.count, S = x.bounds, D = rt[y + 1].rightCacheBounds;
|
|
12183
|
+
w !== 0 && (v === 0 ? mn(S, Li) : gn(S, Li, Li)), v += w;
|
|
12184
|
+
let T = 0, P = 0;
|
|
12185
|
+
v !== 0 && (T = ei(Li) / h);
|
|
12186
12186
|
const I = s - v;
|
|
12187
|
-
I !== 0 && (
|
|
12188
|
-
const A = dn + Ts * (
|
|
12187
|
+
I !== 0 && (P = ei(D) / h);
|
|
12188
|
+
const A = dn + Ts * (T * v + P * I);
|
|
12189
12189
|
A < u && (o = l, u = A, c = x.candidate);
|
|
12190
12190
|
}
|
|
12191
12191
|
}
|
|
@@ -12253,13 +12253,13 @@ function ge(a, e) {
|
|
|
12253
12253
|
function ye(a, e) {
|
|
12254
12254
|
return e[a + 6];
|
|
12255
12255
|
}
|
|
12256
|
-
function
|
|
12256
|
+
function be(a, e) {
|
|
12257
12257
|
return e[a + 14];
|
|
12258
12258
|
}
|
|
12259
|
-
function
|
|
12259
|
+
function Ae(a) {
|
|
12260
12260
|
return a + 8;
|
|
12261
12261
|
}
|
|
12262
|
-
function
|
|
12262
|
+
function Te(a, e) {
|
|
12263
12263
|
return e[a + 6];
|
|
12264
12264
|
}
|
|
12265
12265
|
function ao(a, e) {
|
|
@@ -12319,21 +12319,21 @@ function ph(a, e, t, i, s) {
|
|
|
12319
12319
|
function y(w) {
|
|
12320
12320
|
u && u(w / _);
|
|
12321
12321
|
}
|
|
12322
|
-
function x(w,
|
|
12323
|
-
if (!g &&
|
|
12324
|
-
return y(
|
|
12325
|
-
const
|
|
12326
|
-
if (
|
|
12327
|
-
return y(
|
|
12328
|
-
const I = m(n, f, e,
|
|
12329
|
-
if (I ===
|
|
12330
|
-
y(
|
|
12322
|
+
function x(w, S, C, D = null, T = 0) {
|
|
12323
|
+
if (!g && T >= r && (g = !0, o && (console.warn(`MeshBVH: Max depth of ${r} reached when generating BVH. Consider increasing maxDepth.`), console.warn(l))), C <= c || T >= r)
|
|
12324
|
+
return y(S + C), w.offset = S, w.count = C, w;
|
|
12325
|
+
const P = ah(w.boundingData, D, e, S, C, h);
|
|
12326
|
+
if (P.axis === -1)
|
|
12327
|
+
return y(S + C), w.offset = S, w.count = C, w;
|
|
12328
|
+
const I = m(n, f, e, S, C, P);
|
|
12329
|
+
if (I === S || I === S + C)
|
|
12330
|
+
y(S + C), w.offset = S, w.count = C;
|
|
12331
12331
|
else {
|
|
12332
|
-
w.splitAxis =
|
|
12333
|
-
const A = new Cs(),
|
|
12334
|
-
w.left = A, Ms(e,
|
|
12335
|
-
const R = new Cs(), k = I, F =
|
|
12336
|
-
w.right = R, Ms(e, k, F, R.boundingData, p), x(R, k, F, p,
|
|
12332
|
+
w.splitAxis = P.axis;
|
|
12333
|
+
const A = new Cs(), M = S, E = I - S;
|
|
12334
|
+
w.left = A, Ms(e, M, E, A.boundingData, p), x(A, M, E, p, T + 1);
|
|
12335
|
+
const R = new Cs(), k = I, F = C - E;
|
|
12336
|
+
w.right = R, Ms(e, k, F, R.boundingData, p), x(R, k, F, p, T + 1);
|
|
12337
12337
|
}
|
|
12338
12338
|
return w;
|
|
12339
12339
|
}
|
|
@@ -12398,7 +12398,7 @@ const gh = function() {
|
|
|
12398
12398
|
p !== 0 ? g = (n * l - m * f) / p : g = 0, v = (n + g * l) / f, o.x = g, o.y = v;
|
|
12399
12399
|
};
|
|
12400
12400
|
}(), pr = function() {
|
|
12401
|
-
const a = new
|
|
12401
|
+
const a = new V(), e = new b(), t = new b();
|
|
12402
12402
|
return function(s, r, o, c) {
|
|
12403
12403
|
gh(s, r, a);
|
|
12404
12404
|
let h = a.x, u = a.y;
|
|
@@ -12444,7 +12444,7 @@ const gh = function() {
|
|
|
12444
12444
|
function Is(a) {
|
|
12445
12445
|
return Math.abs(a) < vh;
|
|
12446
12446
|
}
|
|
12447
|
-
class
|
|
12447
|
+
class Le extends oi {
|
|
12448
12448
|
constructor(...e) {
|
|
12449
12449
|
super(...e), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new b()), this.satBounds = new Array(4).fill().map(() => new Je()), this.points = [this.a, this.b, this.c], this.sphere = new ns(), this.plane = new or(), this.needsUpdate = !0;
|
|
12450
12450
|
}
|
|
@@ -12462,7 +12462,7 @@ class Re extends oi {
|
|
|
12462
12462
|
f.subVectors(i, e), m.setFromPoints(f, s), this.sphere.setFromPoints(this.points), this.plane.setFromNormalAndCoplanarPoint(c, e), this.needsUpdate = !1;
|
|
12463
12463
|
}
|
|
12464
12464
|
}
|
|
12465
|
-
|
|
12465
|
+
Le.prototype.closestPointToSegment = function() {
|
|
12466
12466
|
const a = new b(), e = new b(), t = new Ye();
|
|
12467
12467
|
return function(s, r = null, o = null) {
|
|
12468
12468
|
const { start: c, end: h } = s, u = this.points;
|
|
@@ -12474,21 +12474,21 @@ Re.prototype.closestPointToSegment = function() {
|
|
|
12474
12474
|
return this.closestPointToPoint(c, a), d = c.distanceToSquared(a), d < n && (n = d, r && r.copy(a), o && o.copy(c)), this.closestPointToPoint(h, a), d = h.distanceToSquared(a), d < n && (n = d, r && r.copy(a), o && o.copy(h)), Math.sqrt(n);
|
|
12475
12475
|
};
|
|
12476
12476
|
}();
|
|
12477
|
-
|
|
12478
|
-
const a = new
|
|
12477
|
+
Le.prototype.intersectsTriangle = function() {
|
|
12478
|
+
const a = new Le(), e = new Array(3), t = new Array(3), i = new Je(), s = new Je(), r = new b(), o = new b(), c = new b(), h = new b(), u = new b(), d = new Ye(), n = new Ye(), l = new Ye(), f = new b();
|
|
12479
12479
|
function m(_, p, g) {
|
|
12480
12480
|
const v = _.points;
|
|
12481
12481
|
let y = 0, x = -1;
|
|
12482
12482
|
for (let w = 0; w < 3; w++) {
|
|
12483
|
-
const { start:
|
|
12484
|
-
|
|
12485
|
-
const D = Is(p.distanceToPoint(
|
|
12483
|
+
const { start: S, end: C } = d;
|
|
12484
|
+
S.copy(v[w]), C.copy(v[(w + 1) % 3]), d.delta(o);
|
|
12485
|
+
const D = Is(p.distanceToPoint(S));
|
|
12486
12486
|
if (Is(p.normal.dot(o)) && D) {
|
|
12487
12487
|
g.copy(d), y = 2;
|
|
12488
12488
|
break;
|
|
12489
12489
|
}
|
|
12490
|
-
const
|
|
12491
|
-
if (!
|
|
12490
|
+
const T = p.intersectLine(d, f);
|
|
12491
|
+
if (!T && D && f.copy(S), (T || D) && !Is(f.distanceTo(C))) {
|
|
12492
12492
|
if (y <= 1)
|
|
12493
12493
|
(y === 1 ? g.start : g.end).copy(f), D && (x = y);
|
|
12494
12494
|
else if (y >= 2) {
|
|
@@ -12505,25 +12505,25 @@ Re.prototype.intersectsTriangle = function() {
|
|
|
12505
12505
|
this.needsUpdate && this.update(), p.isExtendedTriangle ? p.needsUpdate && p.update() : (a.copy(p), a.update(), p = a);
|
|
12506
12506
|
const y = this.plane, x = p.plane;
|
|
12507
12507
|
if (Math.abs(y.normal.dot(x.normal)) > 1 - 1e-10) {
|
|
12508
|
-
const w = this.satBounds,
|
|
12508
|
+
const w = this.satBounds, S = this.satAxes;
|
|
12509
12509
|
t[0] = p.a, t[1] = p.b, t[2] = p.c;
|
|
12510
|
-
for (let
|
|
12511
|
-
const
|
|
12512
|
-
if (i.setFromPoints(I, t),
|
|
12510
|
+
for (let T = 0; T < 4; T++) {
|
|
12511
|
+
const P = w[T], I = S[T];
|
|
12512
|
+
if (i.setFromPoints(I, t), P.isSeparated(i))
|
|
12513
12513
|
return !1;
|
|
12514
12514
|
}
|
|
12515
|
-
const
|
|
12515
|
+
const C = p.satBounds, D = p.satAxes;
|
|
12516
12516
|
e[0] = this.a, e[1] = this.b, e[2] = this.c;
|
|
12517
|
-
for (let
|
|
12518
|
-
const
|
|
12519
|
-
if (i.setFromPoints(I, e),
|
|
12517
|
+
for (let T = 0; T < 4; T++) {
|
|
12518
|
+
const P = C[T], I = D[T];
|
|
12519
|
+
if (i.setFromPoints(I, e), P.isSeparated(i))
|
|
12520
12520
|
return !1;
|
|
12521
12521
|
}
|
|
12522
|
-
for (let
|
|
12523
|
-
const
|
|
12522
|
+
for (let T = 0; T < 4; T++) {
|
|
12523
|
+
const P = S[T];
|
|
12524
12524
|
for (let I = 0; I < 4; I++) {
|
|
12525
12525
|
const A = D[I];
|
|
12526
|
-
if (r.crossVectors(
|
|
12526
|
+
if (r.crossVectors(P, A), i.setFromPoints(r, e), s.setFromPoints(r, t), i.isSeparated(s))
|
|
12527
12527
|
return !1;
|
|
12528
12528
|
}
|
|
12529
12529
|
}
|
|
@@ -12534,27 +12534,27 @@ Re.prototype.intersectsTriangle = function() {
|
|
|
12534
12534
|
return g && (g.start.copy(n.end), g.end.copy(n.end)), !0;
|
|
12535
12535
|
if (w !== 2)
|
|
12536
12536
|
return !1;
|
|
12537
|
-
const
|
|
12538
|
-
if (
|
|
12537
|
+
const S = m(p, y, l);
|
|
12538
|
+
if (S === 1 && this.containsPoint(l.end))
|
|
12539
12539
|
return g && (g.start.copy(l.end), g.end.copy(l.end)), !0;
|
|
12540
|
-
if (
|
|
12540
|
+
if (S !== 2)
|
|
12541
12541
|
return !1;
|
|
12542
12542
|
if (n.delta(c), l.delta(h), c.dot(h) < 0) {
|
|
12543
|
-
let
|
|
12544
|
-
l.start = l.end, l.end =
|
|
12543
|
+
let M = l.start;
|
|
12544
|
+
l.start = l.end, l.end = M;
|
|
12545
12545
|
}
|
|
12546
|
-
const
|
|
12547
|
-
return
|
|
12546
|
+
const C = n.start.dot(c), D = n.end.dot(c), T = l.start.dot(c), P = l.end.dot(c), I = D < T, A = C < P;
|
|
12547
|
+
return C !== P && T !== D && I === A ? !1 : (g && (u.subVectors(n.start, l.start), u.dot(c) > 0 ? g.start.copy(n.start) : g.start.copy(l.start), u.subVectors(n.end, l.end), u.dot(c) < 0 ? g.end.copy(n.end) : g.end.copy(l.end)), !0);
|
|
12548
12548
|
}
|
|
12549
12549
|
};
|
|
12550
12550
|
}();
|
|
12551
|
-
|
|
12551
|
+
Le.prototype.distanceToPoint = function() {
|
|
12552
12552
|
const a = new b();
|
|
12553
12553
|
return function(t) {
|
|
12554
12554
|
return this.closestPointToPoint(t, a), t.distanceTo(a);
|
|
12555
12555
|
};
|
|
12556
12556
|
}();
|
|
12557
|
-
|
|
12557
|
+
Le.prototype.distanceToTriangle = function() {
|
|
12558
12558
|
const a = new b(), e = new b(), t = ["a", "b", "c"], i = new Ye(), s = new Ye();
|
|
12559
12559
|
return function(o, c = null, h = null) {
|
|
12560
12560
|
const u = c || h ? i : null;
|
|
@@ -12581,7 +12581,7 @@ Re.prototype.distanceToTriangle = function() {
|
|
|
12581
12581
|
return Math.sqrt(d);
|
|
12582
12582
|
};
|
|
12583
12583
|
}();
|
|
12584
|
-
class
|
|
12584
|
+
class fe {
|
|
12585
12585
|
constructor(e, t, i) {
|
|
12586
12586
|
this.isOrientedBox = !0, this.min = new b(), this.max = new b(), this.matrix = new te(), this.invMatrix = new te(), this.points = new Array(8).fill().map(() => new b()), this.satAxes = new Array(3).fill().map(() => new b()), this.satBounds = new Array(3).fill().map(() => new Je()), this.alignedSatBounds = new Array(3).fill().map(() => new Je()), this.needsUpdate = !1, e && this.min.copy(e), t && this.max.copy(t), i && this.matrix.copy(i);
|
|
12587
12587
|
}
|
|
@@ -12592,7 +12592,7 @@ class ue {
|
|
|
12592
12592
|
this.min.copy(e.min), this.max.copy(e.max), this.matrix.copy(e.matrix), this.needsUpdate = !0;
|
|
12593
12593
|
}
|
|
12594
12594
|
}
|
|
12595
|
-
|
|
12595
|
+
fe.prototype.update = /* @__PURE__ */ function() {
|
|
12596
12596
|
return function() {
|
|
12597
12597
|
const e = this.matrix, t = this.min, i = this.max, s = this.points;
|
|
12598
12598
|
for (let u = 0; u <= 1; u++)
|
|
@@ -12610,7 +12610,7 @@ ue.prototype.update = /* @__PURE__ */ function() {
|
|
|
12610
12610
|
h[0].setFromPointsField(s, "x"), h[1].setFromPointsField(s, "y"), h[2].setFromPointsField(s, "z"), this.invMatrix.copy(this.matrix).invert(), this.needsUpdate = !1;
|
|
12611
12611
|
};
|
|
12612
12612
|
}();
|
|
12613
|
-
|
|
12613
|
+
fe.prototype.intersectsBox = function() {
|
|
12614
12614
|
const a = new Je();
|
|
12615
12615
|
return function(t) {
|
|
12616
12616
|
this.needsUpdate && this.update();
|
|
@@ -12625,8 +12625,8 @@ ue.prototype.intersectsBox = function() {
|
|
|
12625
12625
|
return !0;
|
|
12626
12626
|
};
|
|
12627
12627
|
}();
|
|
12628
|
-
|
|
12629
|
-
const a = new
|
|
12628
|
+
fe.prototype.intersectsTriangle = function() {
|
|
12629
|
+
const a = new Le(), e = new Array(3), t = new Je(), i = new Je(), s = new b();
|
|
12630
12630
|
return function(o) {
|
|
12631
12631
|
this.needsUpdate && this.update(), o.isExtendedTriangle ? o.needsUpdate && o.update() : (a.copy(o), a.update(), o = a);
|
|
12632
12632
|
const c = this.satBounds, h = this.satAxes;
|
|
@@ -12653,18 +12653,18 @@ ue.prototype.intersectsTriangle = function() {
|
|
|
12653
12653
|
return !0;
|
|
12654
12654
|
};
|
|
12655
12655
|
}();
|
|
12656
|
-
|
|
12656
|
+
fe.prototype.closestPointToPoint = /* @__PURE__ */ function() {
|
|
12657
12657
|
return function(e, t) {
|
|
12658
12658
|
return this.needsUpdate && this.update(), t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min, this.max).applyMatrix4(this.matrix), t;
|
|
12659
12659
|
};
|
|
12660
12660
|
}();
|
|
12661
|
-
|
|
12661
|
+
fe.prototype.distanceToPoint = function() {
|
|
12662
12662
|
const a = new b();
|
|
12663
12663
|
return function(t) {
|
|
12664
12664
|
return this.closestPointToPoint(t, a), t.distanceTo(a);
|
|
12665
12665
|
};
|
|
12666
12666
|
}();
|
|
12667
|
-
|
|
12667
|
+
fe.prototype.distanceToBox = function() {
|
|
12668
12668
|
const a = ["x", "y", "z"], e = new Array(12).fill().map(() => new Ye()), t = new Array(12).fill().map(() => new Ye()), i = new b(), s = new b();
|
|
12669
12669
|
return function(o, c = 0, h = null, u = null) {
|
|
12670
12670
|
if (this.needsUpdate && this.update(), this.intersectsBox(o))
|
|
@@ -12682,10 +12682,10 @@ ue.prototype.distanceToBox = function() {
|
|
|
12682
12682
|
for (let p = 0; p < 3; p++)
|
|
12683
12683
|
for (let g = 0; g <= 1; g++)
|
|
12684
12684
|
for (let v = 0; v <= 1; v++) {
|
|
12685
|
-
const y = (p + 1) % 3, x = (p + 2) % 3, w = g << y | v << x,
|
|
12686
|
-
e[_].set(
|
|
12687
|
-
const
|
|
12688
|
-
P
|
|
12685
|
+
const y = (p + 1) % 3, x = (p + 2) % 3, w = g << y | v << x, S = 1 << p | g << y | v << x, C = f[w], D = f[S];
|
|
12686
|
+
e[_].set(C, D);
|
|
12687
|
+
const P = a[p], I = a[y], A = a[x], M = t[_], E = M.start, R = M.end;
|
|
12688
|
+
E[P] = n[P], E[I] = g ? n[I] : l[I], E[A] = v ? n[A] : l[I], R[P] = l[P], R[I] = g ? n[I] : l[I], R[A] = v ? n[A] : l[I], _++;
|
|
12689
12689
|
}
|
|
12690
12690
|
for (let p = 0; p <= 1; p++)
|
|
12691
12691
|
for (let g = 0; g <= 1; g++)
|
|
@@ -12722,10 +12722,10 @@ class mr {
|
|
|
12722
12722
|
}
|
|
12723
12723
|
class yh extends mr {
|
|
12724
12724
|
constructor() {
|
|
12725
|
-
super(() => new
|
|
12725
|
+
super(() => new Le());
|
|
12726
12726
|
}
|
|
12727
12727
|
}
|
|
12728
|
-
const
|
|
12728
|
+
const Se = /* @__PURE__ */ new yh();
|
|
12729
12729
|
class xh {
|
|
12730
12730
|
constructor() {
|
|
12731
12731
|
this.float32Array = null, this.uint16Array = null, this.uint32Array = null;
|
|
@@ -12739,50 +12739,50 @@ class xh {
|
|
|
12739
12739
|
}
|
|
12740
12740
|
}
|
|
12741
12741
|
const Z = new xh();
|
|
12742
|
-
let
|
|
12742
|
+
let ct, Ot;
|
|
12743
12743
|
const Tt = [], ki = /* @__PURE__ */ new mr(() => new J());
|
|
12744
12744
|
function wh(a, e, t, i, s, r) {
|
|
12745
|
-
|
|
12745
|
+
ct = ki.getPrimitive(), Ot = ki.getPrimitive(), Tt.push(ct, Ot), Z.setBuffer(a._roots[e]);
|
|
12746
12746
|
const o = Xs(0, a.geometry, t, i, s, r);
|
|
12747
|
-
Z.clearBuffer(), ki.releasePrimitive(
|
|
12747
|
+
Z.clearBuffer(), ki.releasePrimitive(ct), ki.releasePrimitive(Ot), Tt.pop(), Tt.pop();
|
|
12748
12748
|
const c = Tt.length;
|
|
12749
|
-
return c > 0 && (Ot = Tt[c - 1],
|
|
12749
|
+
return c > 0 && (Ot = Tt[c - 1], ct = Tt[c - 2]), o;
|
|
12750
12750
|
}
|
|
12751
12751
|
function Xs(a, e, t, i, s = null, r = 0, o = 0) {
|
|
12752
12752
|
const { float32Array: c, uint16Array: h, uint32Array: u } = Z;
|
|
12753
12753
|
let d = a * 2;
|
|
12754
12754
|
if (ge(d, h)) {
|
|
12755
|
-
const l = ye(a, u), f =
|
|
12756
|
-
return $(a, c,
|
|
12755
|
+
const l = ye(a, u), f = be(d, h);
|
|
12756
|
+
return $(a, c, ct), i(l, f, !1, o, r + a, ct);
|
|
12757
12757
|
} else {
|
|
12758
|
-
let
|
|
12759
|
-
const { uint16Array:
|
|
12758
|
+
let P = function(A) {
|
|
12759
|
+
const { uint16Array: M, uint32Array: E } = Z;
|
|
12760
12760
|
let R = A * 2;
|
|
12761
|
-
for (; !ge(R,
|
|
12762
|
-
A =
|
|
12763
|
-
return ye(A,
|
|
12761
|
+
for (; !ge(R, M); )
|
|
12762
|
+
A = Ae(A), R = A * 2;
|
|
12763
|
+
return ye(A, E);
|
|
12764
12764
|
}, I = function(A) {
|
|
12765
|
-
const { uint16Array:
|
|
12765
|
+
const { uint16Array: M, uint32Array: E } = Z;
|
|
12766
12766
|
let R = A * 2;
|
|
12767
|
-
for (; !ge(R,
|
|
12768
|
-
A =
|
|
12769
|
-
return ye(A,
|
|
12767
|
+
for (; !ge(R, M); )
|
|
12768
|
+
A = Te(A, E), R = A * 2;
|
|
12769
|
+
return ye(A, E) + be(R, M);
|
|
12770
12770
|
};
|
|
12771
|
-
const l =
|
|
12771
|
+
const l = Ae(a), f = Te(a, u);
|
|
12772
12772
|
let m = l, _ = f, p, g, v, y;
|
|
12773
|
-
if (s && (v =
|
|
12773
|
+
if (s && (v = ct, y = Ot, $(m, c, v), $(_, c, y), p = s(v), g = s(y), g < p)) {
|
|
12774
12774
|
m = f, _ = l;
|
|
12775
12775
|
const A = p;
|
|
12776
12776
|
p = g, g = A, v = y;
|
|
12777
12777
|
}
|
|
12778
|
-
v || (v =
|
|
12778
|
+
v || (v = ct, $(m, c, v));
|
|
12779
12779
|
const x = ge(m * 2, h), w = t(v, x, p, o + 1, r + m);
|
|
12780
|
-
let
|
|
12780
|
+
let S;
|
|
12781
12781
|
if (w === fn) {
|
|
12782
|
-
const A =
|
|
12783
|
-
|
|
12782
|
+
const A = P(m), E = I(m) - A;
|
|
12783
|
+
S = i(A, E, !0, o + 1, r + m, v);
|
|
12784
12784
|
} else
|
|
12785
|
-
|
|
12785
|
+
S = w && Xs(
|
|
12786
12786
|
m,
|
|
12787
12787
|
e,
|
|
12788
12788
|
t,
|
|
@@ -12791,16 +12791,16 @@ function Xs(a, e, t, i, s = null, r = 0, o = 0) {
|
|
|
12791
12791
|
r,
|
|
12792
12792
|
o + 1
|
|
12793
12793
|
);
|
|
12794
|
-
if (
|
|
12794
|
+
if (S)
|
|
12795
12795
|
return !0;
|
|
12796
12796
|
y = Ot, $(_, c, y);
|
|
12797
|
-
const
|
|
12798
|
-
let
|
|
12797
|
+
const C = ge(_ * 2, h), D = t(y, C, g, o + 1, r + _);
|
|
12798
|
+
let T;
|
|
12799
12799
|
if (D === fn) {
|
|
12800
|
-
const A =
|
|
12801
|
-
|
|
12800
|
+
const A = P(_), E = I(_) - A;
|
|
12801
|
+
T = i(A, E, !0, o + 1, r + _, y);
|
|
12802
12802
|
} else
|
|
12803
|
-
|
|
12803
|
+
T = D && Xs(
|
|
12804
12804
|
_,
|
|
12805
12805
|
e,
|
|
12806
12806
|
t,
|
|
@@ -12809,7 +12809,7 @@ function Xs(a, e, t, i, s = null, r = 0, o = 0) {
|
|
|
12809
12809
|
r,
|
|
12810
12810
|
o + 1
|
|
12811
12811
|
);
|
|
12812
|
-
return !!
|
|
12812
|
+
return !!T;
|
|
12813
12813
|
}
|
|
12814
12814
|
}
|
|
12815
12815
|
const ti = /* @__PURE__ */ new b(), Ds = /* @__PURE__ */ new b();
|
|
@@ -12831,7 +12831,7 @@ function bh(a, e, t = {}, i = 0, s = 1 / 0) {
|
|
|
12831
12831
|
const u = Math.sqrt(c);
|
|
12832
12832
|
return t.point ? t.point.copy(Ds) : t.point = Ds.clone(), t.distance = u, t.faceIndex = h, t;
|
|
12833
12833
|
}
|
|
12834
|
-
const St = /* @__PURE__ */ new b(), Mt = /* @__PURE__ */ new b(), Ct = /* @__PURE__ */ new b(), Fi = /* @__PURE__ */ new
|
|
12834
|
+
const St = /* @__PURE__ */ new b(), Mt = /* @__PURE__ */ new b(), Ct = /* @__PURE__ */ new b(), Fi = /* @__PURE__ */ new V(), Bi = /* @__PURE__ */ new V(), Oi = /* @__PURE__ */ new V(), _n = /* @__PURE__ */ new b(), vn = /* @__PURE__ */ new b(), yn = /* @__PURE__ */ new b(), zi = /* @__PURE__ */ new b();
|
|
12835
12835
|
function Ah(a, e, t, i, s, r, o, c) {
|
|
12836
12836
|
let h;
|
|
12837
12837
|
if (r === Dn ? h = a.intersectTriangle(i, t, e, !0, s) : h = a.intersectTriangle(e, t, i, r !== gi, s), h === null)
|
|
@@ -12846,7 +12846,7 @@ function Th(a, e, t, i, s, r, o, c, h, u, d) {
|
|
|
12846
12846
|
St.fromBufferAttribute(e, r), Mt.fromBufferAttribute(e, o), Ct.fromBufferAttribute(e, c);
|
|
12847
12847
|
const n = Ah(a, St, Mt, Ct, zi, h, u, d);
|
|
12848
12848
|
if (n) {
|
|
12849
|
-
i && (Fi.fromBufferAttribute(i, r), Bi.fromBufferAttribute(i, o), Oi.fromBufferAttribute(i, c), n.uv = oi.getInterpolation(zi, St, Mt, Ct, Fi, Bi, Oi, new
|
|
12849
|
+
i && (Fi.fromBufferAttribute(i, r), Bi.fromBufferAttribute(i, o), Oi.fromBufferAttribute(i, c), n.uv = oi.getInterpolation(zi, St, Mt, Ct, Fi, Bi, Oi, new V())), s && (Fi.fromBufferAttribute(s, r), Bi.fromBufferAttribute(s, o), Oi.fromBufferAttribute(s, c), n.uv1 = oi.getInterpolation(zi, St, Mt, Ct, Fi, Bi, Oi, new V())), t && (_n.fromBufferAttribute(t, r), vn.fromBufferAttribute(t, o), yn.fromBufferAttribute(t, c), n.normal = oi.getInterpolation(zi, St, Mt, Ct, _n, vn, yn, new b()), n.normal.dot(a.direction) > 0 && n.normal.multiplyScalar(-1));
|
|
12850
12850
|
const l = {
|
|
12851
12851
|
a: r,
|
|
12852
12852
|
b: o,
|
|
@@ -12905,37 +12905,37 @@ function Ih(a, e = null) {
|
|
|
12905
12905
|
const _ = l * 2;
|
|
12906
12906
|
if (c[_ + 15] === as) {
|
|
12907
12907
|
const g = o[l + 6], v = c[_ + 14];
|
|
12908
|
-
let y = 1 / 0, x = 1 / 0, w = 1 / 0,
|
|
12909
|
-
for (let
|
|
12910
|
-
let I = i[
|
|
12911
|
-
const A = s.getX(I),
|
|
12912
|
-
A < y && (y = A), A >
|
|
12908
|
+
let y = 1 / 0, x = 1 / 0, w = 1 / 0, S = -1 / 0, C = -1 / 0, D = -1 / 0;
|
|
12909
|
+
for (let T = 3 * g, P = 3 * (g + v); T < P; T++) {
|
|
12910
|
+
let I = i[T];
|
|
12911
|
+
const A = s.getX(I), M = s.getY(I), E = s.getZ(I);
|
|
12912
|
+
A < y && (y = A), A > S && (S = A), M < x && (x = M), M > C && (C = M), E < w && (w = E), E > D && (D = E);
|
|
12913
12913
|
}
|
|
12914
|
-
return h[l + 0] !== y || h[l + 1] !== x || h[l + 2] !== w || h[l + 3] !==
|
|
12914
|
+
return h[l + 0] !== y || h[l + 1] !== x || h[l + 2] !== w || h[l + 3] !== S || h[l + 4] !== C || h[l + 5] !== D ? (h[l + 0] = y, h[l + 1] = x, h[l + 2] = w, h[l + 3] = S, h[l + 4] = C, h[l + 5] = D, !0) : !1;
|
|
12915
12915
|
} else {
|
|
12916
12916
|
const g = l + 8, v = o[l + 6], y = g + f, x = v + f;
|
|
12917
|
-
let w = m,
|
|
12918
|
-
e ? w || (
|
|
12919
|
-
const D = w ||
|
|
12920
|
-
let
|
|
12921
|
-
D && (
|
|
12917
|
+
let w = m, S = !1, C = !1;
|
|
12918
|
+
e ? w || (S = e.has(y), C = e.has(x), w = !S && !C) : (S = !0, C = !0);
|
|
12919
|
+
const D = w || S, T = w || C;
|
|
12920
|
+
let P = !1;
|
|
12921
|
+
D && (P = n(g, f, w));
|
|
12922
12922
|
let I = !1;
|
|
12923
|
-
|
|
12924
|
-
const A =
|
|
12923
|
+
T && (I = n(v, f, w));
|
|
12924
|
+
const A = P || I;
|
|
12925
12925
|
if (A)
|
|
12926
|
-
for (let
|
|
12927
|
-
const
|
|
12928
|
-
h[l +
|
|
12926
|
+
for (let M = 0; M < 3; M++) {
|
|
12927
|
+
const E = g + M, R = v + M, k = h[E], F = h[E + 3], z = h[R], B = h[R + 3];
|
|
12928
|
+
h[l + M] = k < z ? k : z, h[l + M + 3] = F > B ? F : B;
|
|
12929
12929
|
}
|
|
12930
12930
|
return A;
|
|
12931
12931
|
}
|
|
12932
12932
|
}
|
|
12933
12933
|
}
|
|
12934
|
-
function
|
|
12934
|
+
function ft(a, e, t, i, s) {
|
|
12935
12935
|
let r, o, c, h, u, d;
|
|
12936
12936
|
const n = 1 / t.direction.x, l = 1 / t.direction.y, f = 1 / t.direction.z, m = t.origin.x, _ = t.origin.y, p = t.origin.z;
|
|
12937
|
-
let g = e[a], v = e[a + 3], y = e[a + 1], x = e[a + 3 + 1], w = e[a + 2],
|
|
12938
|
-
return n >= 0 ? (r = (g - m) * n, o = (v - m) * n) : (r = (v - m) * n, o = (g - m) * n), l >= 0 ? (c = (y - _) * l, h = (x - _) * l) : (c = (x - _) * l, h = (y - _) * l), r > h || c > o || ((c > r || isNaN(r)) && (r = c), (h < o || isNaN(o)) && (o = h), f >= 0 ? (u = (w - p) * f, d = (
|
|
12937
|
+
let g = e[a], v = e[a + 3], y = e[a + 1], x = e[a + 3 + 1], w = e[a + 2], S = e[a + 3 + 2];
|
|
12938
|
+
return n >= 0 ? (r = (g - m) * n, o = (v - m) * n) : (r = (v - m) * n, o = (g - m) * n), l >= 0 ? (c = (y - _) * l, h = (x - _) * l) : (c = (x - _) * l, h = (y - _) * l), r > h || c > o || ((c > r || isNaN(r)) && (r = c), (h < o || isNaN(o)) && (o = h), f >= 0 ? (u = (w - p) * f, d = (S - p) * f) : (u = (S - p) * f, d = (w - p) * f), r > d || u > o) ? !1 : ((u > r || r !== r) && (r = u), (d < o || o !== o) && (o = d), r <= s && o >= i);
|
|
12939
12939
|
}
|
|
12940
12940
|
function Dh(a, e, t, i, s, r, o, c) {
|
|
12941
12941
|
const { geometry: h, _indirectBuffer: u } = a;
|
|
@@ -12968,13 +12968,13 @@ function Rh(a, e, t, i, s, r, o) {
|
|
|
12968
12968
|
function Js(a, e, t, i, s, r, o) {
|
|
12969
12969
|
const { float32Array: c, uint16Array: h, uint32Array: u } = Z, d = a * 2;
|
|
12970
12970
|
if (ge(d, h)) {
|
|
12971
|
-
const l = ye(a, u), f =
|
|
12971
|
+
const l = ye(a, u), f = be(d, h);
|
|
12972
12972
|
Sh(e, t, i, l, f, s, r, o);
|
|
12973
12973
|
} else {
|
|
12974
|
-
const l =
|
|
12975
|
-
|
|
12976
|
-
const f =
|
|
12977
|
-
|
|
12974
|
+
const l = Ae(a);
|
|
12975
|
+
ft(l, c, i, r, o) && Js(l, e, t, i, s, r, o);
|
|
12976
|
+
const f = Te(a, u);
|
|
12977
|
+
ft(f, c, i, r, o) && Js(f, e, t, i, s, r, o);
|
|
12978
12978
|
}
|
|
12979
12979
|
}
|
|
12980
12980
|
const Lh = ["x", "y", "z"];
|
|
@@ -12987,13 +12987,13 @@ function $s(a, e, t, i, s, r) {
|
|
|
12987
12987
|
const { float32Array: o, uint16Array: c, uint32Array: h } = Z;
|
|
12988
12988
|
let u = a * 2;
|
|
12989
12989
|
if (ge(u, c)) {
|
|
12990
|
-
const n = ye(a, h), l =
|
|
12990
|
+
const n = ye(a, h), l = be(u, c);
|
|
12991
12991
|
return Mh(e, t, i, n, l, s, r);
|
|
12992
12992
|
} else {
|
|
12993
12993
|
const n = ao(a, h), l = Lh[n], m = i.direction[l] >= 0;
|
|
12994
12994
|
let _, p;
|
|
12995
|
-
m ? (_ =
|
|
12996
|
-
const v =
|
|
12995
|
+
m ? (_ = Ae(a), p = Te(a, h)) : (_ = Te(a, h), p = Ae(a));
|
|
12996
|
+
const v = ft(_, o, i, s, r) ? $s(_, e, t, i, s, r) : null;
|
|
12997
12997
|
if (v) {
|
|
12998
12998
|
const w = v.point[l];
|
|
12999
12999
|
if (m ? w <= o[p + n] : (
|
|
@@ -13002,11 +13002,11 @@ function $s(a, e, t, i, s, r) {
|
|
|
13002
13002
|
))
|
|
13003
13003
|
return v;
|
|
13004
13004
|
}
|
|
13005
|
-
const x =
|
|
13005
|
+
const x = ft(p, o, i, s, r) ? $s(p, e, t, i, s, r) : null;
|
|
13006
13006
|
return v && x ? v.distance <= x.distance ? v : x : v || x || null;
|
|
13007
13007
|
}
|
|
13008
13008
|
}
|
|
13009
|
-
const Wi = /* @__PURE__ */ new J(), It = /* @__PURE__ */ new
|
|
13009
|
+
const Wi = /* @__PURE__ */ new J(), It = /* @__PURE__ */ new Le(), Dt = /* @__PURE__ */ new Le(), ii = /* @__PURE__ */ new te(), xn = /* @__PURE__ */ new fe(), Ui = /* @__PURE__ */ new fe();
|
|
13010
13010
|
function Fh(a, e, t, i) {
|
|
13011
13011
|
Z.setBuffer(a._roots[e]);
|
|
13012
13012
|
const s = er(0, a, t, i);
|
|
@@ -13016,7 +13016,7 @@ function er(a, e, t, i, s = null) {
|
|
|
13016
13016
|
const { float32Array: r, uint16Array: o, uint32Array: c } = Z;
|
|
13017
13017
|
let h = a * 2;
|
|
13018
13018
|
if (s === null && (t.boundingBox || t.computeBoundingBox(), xn.set(t.boundingBox.min, t.boundingBox.max, i), s = xn), ge(h, o)) {
|
|
13019
|
-
const d = e.geometry, n = d.index, l = d.attributes.position, f = t.index, m = t.attributes.position, _ = ye(a, c), p =
|
|
13019
|
+
const d = e.geometry, n = d.index, l = d.attributes.position, f = t.index, m = t.attributes.position, _ = ye(a, c), p = be(h, o);
|
|
13020
13020
|
if (ii.copy(i).invert(), t.boundsTree)
|
|
13021
13021
|
return $(a, r, Ui), Ui.matrix.copy(ii), Ui.needsUpdate = !0, t.boundsTree.shapecast({
|
|
13022
13022
|
intersectsBounds: (v) => Ui.intersectsBox(v),
|
|
@@ -13039,49 +13039,49 @@ function er(a, e, t, i, s = null) {
|
|
|
13039
13039
|
return $(d, r, Wi), !!(s.intersectsBox(Wi) && er(d, e, t, i, s) || ($(n, r, Wi), s.intersectsBox(Wi) && er(n, e, t, i, s)));
|
|
13040
13040
|
}
|
|
13041
13041
|
}
|
|
13042
|
-
const Hi = /* @__PURE__ */ new te(), Ps = /* @__PURE__ */ new
|
|
13042
|
+
const Hi = /* @__PURE__ */ new te(), Ps = /* @__PURE__ */ new fe(), si = /* @__PURE__ */ new fe(), Bh = /* @__PURE__ */ new b(), Oh = /* @__PURE__ */ new b(), zh = /* @__PURE__ */ new b(), Wh = /* @__PURE__ */ new b();
|
|
13043
13043
|
function Uh(a, e, t, i = {}, s = {}, r = 0, o = 1 / 0) {
|
|
13044
13044
|
e.boundingBox || e.computeBoundingBox(), Ps.set(e.boundingBox.min, e.boundingBox.max, t), Ps.needsUpdate = !0;
|
|
13045
|
-
const c = a.geometry, h = c.attributes.position, u = c.index, d = e.attributes.position, n = e.index, l =
|
|
13045
|
+
const c = a.geometry, h = c.attributes.position, u = c.index, d = e.attributes.position, n = e.index, l = Se.getPrimitive(), f = Se.getPrimitive();
|
|
13046
13046
|
let m = Bh, _ = Oh, p = null, g = null;
|
|
13047
13047
|
s && (p = zh, g = Wh);
|
|
13048
13048
|
let v = 1 / 0, y = null, x = null;
|
|
13049
13049
|
return Hi.copy(t).invert(), si.matrix.copy(Hi), a.shapecast(
|
|
13050
13050
|
{
|
|
13051
13051
|
boundsTraverseOrder: (w) => Ps.distanceToBox(w),
|
|
13052
|
-
intersectsBounds: (w,
|
|
13053
|
-
intersectsRange: (w,
|
|
13052
|
+
intersectsBounds: (w, S, C) => C < v && C < o ? (S && (si.min.copy(w.min), si.max.copy(w.max), si.needsUpdate = !0), !0) : !1,
|
|
13053
|
+
intersectsRange: (w, S) => {
|
|
13054
13054
|
if (e.boundsTree)
|
|
13055
13055
|
return e.boundsTree.shapecast({
|
|
13056
13056
|
boundsTraverseOrder: (D) => si.distanceToBox(D),
|
|
13057
|
-
intersectsBounds: (D,
|
|
13058
|
-
intersectsRange: (D,
|
|
13059
|
-
for (let
|
|
13060
|
-
ie(f, 3 *
|
|
13061
|
-
for (let A = w,
|
|
13057
|
+
intersectsBounds: (D, T, P) => P < v && P < o,
|
|
13058
|
+
intersectsRange: (D, T) => {
|
|
13059
|
+
for (let P = D, I = D + T; P < I; P++) {
|
|
13060
|
+
ie(f, 3 * P, n, d), f.a.applyMatrix4(t), f.b.applyMatrix4(t), f.c.applyMatrix4(t), f.needsUpdate = !0;
|
|
13061
|
+
for (let A = w, M = w + S; A < M; A++) {
|
|
13062
13062
|
ie(l, 3 * A, u, h), l.needsUpdate = !0;
|
|
13063
|
-
const
|
|
13064
|
-
if (
|
|
13063
|
+
const E = l.distanceToTriangle(f, m, p);
|
|
13064
|
+
if (E < v && (_.copy(m), g && g.copy(p), v = E, y = A, x = P), E < r)
|
|
13065
13065
|
return !0;
|
|
13066
13066
|
}
|
|
13067
13067
|
}
|
|
13068
13068
|
}
|
|
13069
13069
|
});
|
|
13070
13070
|
{
|
|
13071
|
-
const
|
|
13072
|
-
for (let D = 0,
|
|
13071
|
+
const C = Qt(e);
|
|
13072
|
+
for (let D = 0, T = C; D < T; D++) {
|
|
13073
13073
|
ie(f, 3 * D, n, d), f.a.applyMatrix4(t), f.b.applyMatrix4(t), f.c.applyMatrix4(t), f.needsUpdate = !0;
|
|
13074
|
-
for (let
|
|
13075
|
-
ie(l, 3 *
|
|
13074
|
+
for (let P = w, I = w + S; P < I; P++) {
|
|
13075
|
+
ie(l, 3 * P, u, h), l.needsUpdate = !0;
|
|
13076
13076
|
const A = l.distanceToTriangle(f, m, p);
|
|
13077
|
-
if (A < v && (_.copy(m), g && g.copy(p), v = A, y =
|
|
13077
|
+
if (A < v && (_.copy(m), g && g.copy(p), v = A, y = P, x = D), A < r)
|
|
13078
13078
|
return !0;
|
|
13079
13079
|
}
|
|
13080
13080
|
}
|
|
13081
13081
|
}
|
|
13082
13082
|
}
|
|
13083
13083
|
}
|
|
13084
|
-
),
|
|
13084
|
+
), Se.releasePrimitive(l), Se.releasePrimitive(f), v === 1 / 0 ? null : (i.point ? i.point.copy(_) : i.point = _.clone(), i.distance = v, i.faceIndex = y, s && (s.point ? s.point.copy(g) : s.point = g.clone(), s.point.applyMatrix4(Hi), _.applyMatrix4(Hi), s.distance = _.sub(s.point).length(), s.faceIndex = x), i);
|
|
13085
13085
|
}
|
|
13086
13086
|
function Hh(a, e = null) {
|
|
13087
13087
|
e && Array.isArray(e) && (e = new Set(e));
|
|
@@ -13094,31 +13094,31 @@ function Hh(a, e = null) {
|
|
|
13094
13094
|
const _ = l * 2;
|
|
13095
13095
|
if (c[_ + 15] === as) {
|
|
13096
13096
|
const g = o[l + 6], v = c[_ + 14];
|
|
13097
|
-
let y = 1 / 0, x = 1 / 0, w = 1 / 0,
|
|
13098
|
-
for (let
|
|
13099
|
-
const I = 3 * a.resolveTriangleIndex(
|
|
13097
|
+
let y = 1 / 0, x = 1 / 0, w = 1 / 0, S = -1 / 0, C = -1 / 0, D = -1 / 0;
|
|
13098
|
+
for (let T = g, P = g + v; T < P; T++) {
|
|
13099
|
+
const I = 3 * a.resolveTriangleIndex(T);
|
|
13100
13100
|
for (let A = 0; A < 3; A++) {
|
|
13101
|
-
let
|
|
13102
|
-
|
|
13103
|
-
const
|
|
13104
|
-
|
|
13101
|
+
let M = I + A;
|
|
13102
|
+
M = i ? i[M] : M;
|
|
13103
|
+
const E = s.getX(M), R = s.getY(M), k = s.getZ(M);
|
|
13104
|
+
E < y && (y = E), E > S && (S = E), R < x && (x = R), R > C && (C = R), k < w && (w = k), k > D && (D = k);
|
|
13105
13105
|
}
|
|
13106
13106
|
}
|
|
13107
|
-
return h[l + 0] !== y || h[l + 1] !== x || h[l + 2] !== w || h[l + 3] !==
|
|
13107
|
+
return h[l + 0] !== y || h[l + 1] !== x || h[l + 2] !== w || h[l + 3] !== S || h[l + 4] !== C || h[l + 5] !== D ? (h[l + 0] = y, h[l + 1] = x, h[l + 2] = w, h[l + 3] = S, h[l + 4] = C, h[l + 5] = D, !0) : !1;
|
|
13108
13108
|
} else {
|
|
13109
13109
|
const g = l + 8, v = o[l + 6], y = g + f, x = v + f;
|
|
13110
|
-
let w = m,
|
|
13111
|
-
e ? w || (
|
|
13112
|
-
const D = w ||
|
|
13113
|
-
let
|
|
13114
|
-
D && (
|
|
13110
|
+
let w = m, S = !1, C = !1;
|
|
13111
|
+
e ? w || (S = e.has(y), C = e.has(x), w = !S && !C) : (S = !0, C = !0);
|
|
13112
|
+
const D = w || S, T = w || C;
|
|
13113
|
+
let P = !1;
|
|
13114
|
+
D && (P = n(g, f, w));
|
|
13115
13115
|
let I = !1;
|
|
13116
|
-
|
|
13117
|
-
const A =
|
|
13116
|
+
T && (I = n(v, f, w));
|
|
13117
|
+
const A = P || I;
|
|
13118
13118
|
if (A)
|
|
13119
|
-
for (let
|
|
13120
|
-
const
|
|
13121
|
-
h[l +
|
|
13119
|
+
for (let M = 0; M < 3; M++) {
|
|
13120
|
+
const E = g + M, R = v + M, k = h[E], F = h[E + 3], z = h[R], B = h[R + 3];
|
|
13121
|
+
h[l + M] = k < z ? k : z, h[l + M + 3] = F > B ? F : B;
|
|
13122
13122
|
}
|
|
13123
13123
|
return A;
|
|
13124
13124
|
}
|
|
@@ -13130,13 +13130,13 @@ function Nh(a, e, t, i, s, r, o) {
|
|
|
13130
13130
|
function tr(a, e, t, i, s, r, o) {
|
|
13131
13131
|
const { float32Array: c, uint16Array: h, uint32Array: u } = Z, d = a * 2;
|
|
13132
13132
|
if (ge(d, h)) {
|
|
13133
|
-
const l = ye(a, u), f =
|
|
13133
|
+
const l = ye(a, u), f = be(d, h);
|
|
13134
13134
|
Dh(e, t, i, l, f, s, r, o);
|
|
13135
13135
|
} else {
|
|
13136
|
-
const l =
|
|
13137
|
-
|
|
13138
|
-
const f =
|
|
13139
|
-
|
|
13136
|
+
const l = Ae(a);
|
|
13137
|
+
ft(l, c, i, r, o) && tr(l, e, t, i, s, r, o);
|
|
13138
|
+
const f = Te(a, u);
|
|
13139
|
+
ft(f, c, i, r, o) && tr(f, e, t, i, s, r, o);
|
|
13140
13140
|
}
|
|
13141
13141
|
}
|
|
13142
13142
|
const Vh = ["x", "y", "z"];
|
|
@@ -13149,13 +13149,13 @@ function ir(a, e, t, i, s, r) {
|
|
|
13149
13149
|
const { float32Array: o, uint16Array: c, uint32Array: h } = Z;
|
|
13150
13150
|
let u = a * 2;
|
|
13151
13151
|
if (ge(u, c)) {
|
|
13152
|
-
const n = ye(a, h), l =
|
|
13152
|
+
const n = ye(a, h), l = be(u, c);
|
|
13153
13153
|
return Ph(e, t, i, n, l, s, r);
|
|
13154
13154
|
} else {
|
|
13155
13155
|
const n = ao(a, h), l = Vh[n], m = i.direction[l] >= 0;
|
|
13156
13156
|
let _, p;
|
|
13157
|
-
m ? (_ =
|
|
13158
|
-
const v =
|
|
13157
|
+
m ? (_ = Ae(a), p = Te(a, h)) : (_ = Te(a, h), p = Ae(a));
|
|
13158
|
+
const v = ft(_, o, i, s, r) ? ir(_, e, t, i, s, r) : null;
|
|
13159
13159
|
if (v) {
|
|
13160
13160
|
const w = v.point[l];
|
|
13161
13161
|
if (m ? w <= o[p + n] : (
|
|
@@ -13164,11 +13164,11 @@ function ir(a, e, t, i, s, r) {
|
|
|
13164
13164
|
))
|
|
13165
13165
|
return v;
|
|
13166
13166
|
}
|
|
13167
|
-
const x =
|
|
13167
|
+
const x = ft(p, o, i, s, r) ? ir(p, e, t, i, s, r) : null;
|
|
13168
13168
|
return v && x ? v.distance <= x.distance ? v : x : v || x || null;
|
|
13169
13169
|
}
|
|
13170
13170
|
}
|
|
13171
|
-
const Ni = /* @__PURE__ */ new J(), Pt = /* @__PURE__ */ new
|
|
13171
|
+
const Ni = /* @__PURE__ */ new J(), Pt = /* @__PURE__ */ new Le(), Et = /* @__PURE__ */ new Le(), ri = /* @__PURE__ */ new te(), wn = /* @__PURE__ */ new fe(), Vi = /* @__PURE__ */ new fe();
|
|
13172
13172
|
function Qh(a, e, t, i) {
|
|
13173
13173
|
Z.setBuffer(a._roots[e]);
|
|
13174
13174
|
const s = sr(0, a, t, i);
|
|
@@ -13178,7 +13178,7 @@ function sr(a, e, t, i, s = null) {
|
|
|
13178
13178
|
const { float32Array: r, uint16Array: o, uint32Array: c } = Z;
|
|
13179
13179
|
let h = a * 2;
|
|
13180
13180
|
if (s === null && (t.boundingBox || t.computeBoundingBox(), wn.set(t.boundingBox.min, t.boundingBox.max, i), s = wn), ge(h, o)) {
|
|
13181
|
-
const d = e.geometry, n = d.index, l = d.attributes.position, f = t.index, m = t.attributes.position, _ = ye(a, c), p =
|
|
13181
|
+
const d = e.geometry, n = d.index, l = d.attributes.position, f = t.index, m = t.attributes.position, _ = ye(a, c), p = be(h, o);
|
|
13182
13182
|
if (ri.copy(i).invert(), t.boundsTree)
|
|
13183
13183
|
return $(a, r, Vi), Vi.matrix.copy(ri), Vi.needsUpdate = !0, t.boundsTree.shapecast({
|
|
13184
13184
|
intersectsBounds: (v) => Vi.intersectsBox(v),
|
|
@@ -13202,58 +13202,58 @@ function sr(a, e, t, i, s = null) {
|
|
|
13202
13202
|
return $(d, r, Ni), !!(s.intersectsBox(Ni) && sr(d, e, t, i, s) || ($(n, r, Ni), s.intersectsBox(Ni) && sr(n, e, t, i, s)));
|
|
13203
13203
|
}
|
|
13204
13204
|
}
|
|
13205
|
-
const Gi = /* @__PURE__ */ new te(), Es = /* @__PURE__ */ new
|
|
13205
|
+
const Gi = /* @__PURE__ */ new te(), Es = /* @__PURE__ */ new fe(), ni = /* @__PURE__ */ new fe(), jh = /* @__PURE__ */ new b(), qh = /* @__PURE__ */ new b(), Yh = /* @__PURE__ */ new b(), Kh = /* @__PURE__ */ new b();
|
|
13206
13206
|
function Zh(a, e, t, i = {}, s = {}, r = 0, o = 1 / 0) {
|
|
13207
13207
|
e.boundingBox || e.computeBoundingBox(), Es.set(e.boundingBox.min, e.boundingBox.max, t), Es.needsUpdate = !0;
|
|
13208
|
-
const c = a.geometry, h = c.attributes.position, u = c.index, d = e.attributes.position, n = e.index, l =
|
|
13208
|
+
const c = a.geometry, h = c.attributes.position, u = c.index, d = e.attributes.position, n = e.index, l = Se.getPrimitive(), f = Se.getPrimitive();
|
|
13209
13209
|
let m = jh, _ = qh, p = null, g = null;
|
|
13210
13210
|
s && (p = Yh, g = Kh);
|
|
13211
13211
|
let v = 1 / 0, y = null, x = null;
|
|
13212
13212
|
return Gi.copy(t).invert(), ni.matrix.copy(Gi), a.shapecast(
|
|
13213
13213
|
{
|
|
13214
13214
|
boundsTraverseOrder: (w) => Es.distanceToBox(w),
|
|
13215
|
-
intersectsBounds: (w,
|
|
13216
|
-
intersectsRange: (w,
|
|
13215
|
+
intersectsBounds: (w, S, C) => C < v && C < o ? (S && (ni.min.copy(w.min), ni.max.copy(w.max), ni.needsUpdate = !0), !0) : !1,
|
|
13216
|
+
intersectsRange: (w, S) => {
|
|
13217
13217
|
if (e.boundsTree) {
|
|
13218
|
-
const
|
|
13219
|
-
return
|
|
13218
|
+
const C = e.boundsTree;
|
|
13219
|
+
return C.shapecast({
|
|
13220
13220
|
boundsTraverseOrder: (D) => ni.distanceToBox(D),
|
|
13221
|
-
intersectsBounds: (D,
|
|
13222
|
-
intersectsRange: (D,
|
|
13223
|
-
for (let
|
|
13224
|
-
const A =
|
|
13221
|
+
intersectsBounds: (D, T, P) => P < v && P < o,
|
|
13222
|
+
intersectsRange: (D, T) => {
|
|
13223
|
+
for (let P = D, I = D + T; P < I; P++) {
|
|
13224
|
+
const A = C.resolveTriangleIndex(P);
|
|
13225
13225
|
ie(f, 3 * A, n, d), f.a.applyMatrix4(t), f.b.applyMatrix4(t), f.c.applyMatrix4(t), f.needsUpdate = !0;
|
|
13226
|
-
for (let
|
|
13227
|
-
const R = a.resolveTriangleIndex(
|
|
13226
|
+
for (let M = w, E = w + S; M < E; M++) {
|
|
13227
|
+
const R = a.resolveTriangleIndex(M);
|
|
13228
13228
|
ie(l, 3 * R, u, h), l.needsUpdate = !0;
|
|
13229
13229
|
const k = l.distanceToTriangle(f, m, p);
|
|
13230
|
-
if (k < v && (_.copy(m), g && g.copy(p), v = k, y =
|
|
13230
|
+
if (k < v && (_.copy(m), g && g.copy(p), v = k, y = M, x = P), k < r)
|
|
13231
13231
|
return !0;
|
|
13232
13232
|
}
|
|
13233
13233
|
}
|
|
13234
13234
|
}
|
|
13235
13235
|
});
|
|
13236
13236
|
} else {
|
|
13237
|
-
const
|
|
13238
|
-
for (let D = 0,
|
|
13237
|
+
const C = Qt(e);
|
|
13238
|
+
for (let D = 0, T = C; D < T; D++) {
|
|
13239
13239
|
ie(f, 3 * D, n, d), f.a.applyMatrix4(t), f.b.applyMatrix4(t), f.c.applyMatrix4(t), f.needsUpdate = !0;
|
|
13240
|
-
for (let
|
|
13241
|
-
const A = a.resolveTriangleIndex(
|
|
13240
|
+
for (let P = w, I = w + S; P < I; P++) {
|
|
13241
|
+
const A = a.resolveTriangleIndex(P);
|
|
13242
13242
|
ie(l, 3 * A, u, h), l.needsUpdate = !0;
|
|
13243
|
-
const
|
|
13244
|
-
if (
|
|
13243
|
+
const M = l.distanceToTriangle(f, m, p);
|
|
13244
|
+
if (M < v && (_.copy(m), g && g.copy(p), v = M, y = P, x = D), M < r)
|
|
13245
13245
|
return !0;
|
|
13246
13246
|
}
|
|
13247
13247
|
}
|
|
13248
13248
|
}
|
|
13249
13249
|
}
|
|
13250
13250
|
}
|
|
13251
|
-
),
|
|
13251
|
+
), Se.releasePrimitive(l), Se.releasePrimitive(f), v === 1 / 0 ? null : (i.point ? i.point.copy(_) : i.point = _.clone(), i.distance = v, i.faceIndex = y, s && (s.point ? s.point.copy(g) : s.point = g.clone(), s.point.applyMatrix4(Gi), _.applyMatrix4(Gi), s.distance = _.sub(s.point).length(), s.faceIndex = x), i);
|
|
13252
13252
|
}
|
|
13253
13253
|
function Xh() {
|
|
13254
13254
|
return typeof SharedArrayBuffer < "u";
|
|
13255
13255
|
}
|
|
13256
|
-
const fi = new Z.constructor(), es = new Z.constructor(),
|
|
13256
|
+
const fi = new Z.constructor(), es = new Z.constructor(), at = new mr(() => new J()), Rt = new J(), Lt = new J(), Rs = new J(), Ls = new J();
|
|
13257
13257
|
let ks = !1;
|
|
13258
13258
|
function Jh(a, e, t, i) {
|
|
13259
13259
|
if (ks)
|
|
@@ -13264,9 +13264,9 @@ function Jh(a, e, t, i) {
|
|
|
13264
13264
|
const u = new te().copy(t).invert();
|
|
13265
13265
|
for (let d = 0, n = s.length; d < n; d++) {
|
|
13266
13266
|
fi.setBuffer(s[d]), h = 0;
|
|
13267
|
-
const l =
|
|
13267
|
+
const l = at.getPrimitive();
|
|
13268
13268
|
$(0, fi.float32Array, l), l.applyMatrix4(u);
|
|
13269
|
-
for (let f = 0, m = r.length; f < m && (es.setBuffer(r[d]), o =
|
|
13269
|
+
for (let f = 0, m = r.length; f < m && (es.setBuffer(r[d]), o = Ie(
|
|
13270
13270
|
0,
|
|
13271
13271
|
0,
|
|
13272
13272
|
t,
|
|
@@ -13279,45 +13279,45 @@ function Jh(a, e, t, i) {
|
|
|
13279
13279
|
l
|
|
13280
13280
|
), es.clearBuffer(), h += r[f].length, !o); f++)
|
|
13281
13281
|
;
|
|
13282
|
-
if (
|
|
13282
|
+
if (at.releasePrimitive(l), fi.clearBuffer(), c += s[d].length, o)
|
|
13283
13283
|
break;
|
|
13284
13284
|
}
|
|
13285
13285
|
return ks = !1, o;
|
|
13286
13286
|
}
|
|
13287
|
-
function
|
|
13287
|
+
function Ie(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
13288
13288
|
let n, l;
|
|
13289
13289
|
d ? (n = es, l = fi) : (n = fi, l = es);
|
|
13290
|
-
const f = n.float32Array, m = n.uint32Array, _ = n.uint16Array, p = l.float32Array, g = l.uint32Array, v = l.uint16Array, y = a * 2, x = e * 2, w = ge(y, _),
|
|
13291
|
-
let
|
|
13292
|
-
if (
|
|
13293
|
-
d ?
|
|
13290
|
+
const f = n.float32Array, m = n.uint32Array, _ = n.uint16Array, p = l.float32Array, g = l.uint32Array, v = l.uint16Array, y = a * 2, x = e * 2, w = ge(y, _), S = ge(x, v);
|
|
13291
|
+
let C = !1;
|
|
13292
|
+
if (S && w)
|
|
13293
|
+
d ? C = s(
|
|
13294
13294
|
ye(e, g),
|
|
13295
|
-
|
|
13295
|
+
be(e * 2, v),
|
|
13296
13296
|
ye(a, m),
|
|
13297
|
-
|
|
13297
|
+
be(a * 2, _),
|
|
13298
13298
|
h,
|
|
13299
13299
|
o + e,
|
|
13300
13300
|
c,
|
|
13301
13301
|
r + a
|
|
13302
|
-
) :
|
|
13302
|
+
) : C = s(
|
|
13303
13303
|
ye(a, m),
|
|
13304
|
-
|
|
13304
|
+
be(a * 2, _),
|
|
13305
13305
|
ye(e, g),
|
|
13306
|
-
|
|
13306
|
+
be(e * 2, v),
|
|
13307
13307
|
c,
|
|
13308
13308
|
r + a,
|
|
13309
13309
|
h,
|
|
13310
13310
|
o + e
|
|
13311
13311
|
);
|
|
13312
|
-
else if (
|
|
13313
|
-
const D =
|
|
13312
|
+
else if (S) {
|
|
13313
|
+
const D = at.getPrimitive();
|
|
13314
13314
|
$(e, p, D), D.applyMatrix4(t);
|
|
13315
|
-
const
|
|
13316
|
-
$(
|
|
13315
|
+
const T = Ae(a), P = Te(a, m);
|
|
13316
|
+
$(T, f, Rt), $(P, f, Lt);
|
|
13317
13317
|
const I = D.intersectsBox(Rt), A = D.intersectsBox(Lt);
|
|
13318
|
-
|
|
13318
|
+
C = I && Ie(
|
|
13319
13319
|
e,
|
|
13320
|
-
|
|
13320
|
+
T,
|
|
13321
13321
|
i,
|
|
13322
13322
|
t,
|
|
13323
13323
|
s,
|
|
@@ -13327,9 +13327,9 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13327
13327
|
c + 1,
|
|
13328
13328
|
D,
|
|
13329
13329
|
!d
|
|
13330
|
-
) || A &&
|
|
13330
|
+
) || A && Ie(
|
|
13331
13331
|
e,
|
|
13332
|
-
|
|
13332
|
+
P,
|
|
13333
13333
|
i,
|
|
13334
13334
|
t,
|
|
13335
13335
|
s,
|
|
@@ -13339,13 +13339,13 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13339
13339
|
c + 1,
|
|
13340
13340
|
D,
|
|
13341
13341
|
!d
|
|
13342
|
-
),
|
|
13342
|
+
), at.releasePrimitive(D);
|
|
13343
13343
|
} else {
|
|
13344
|
-
const D =
|
|
13345
|
-
$(D, p, Rs), $(
|
|
13346
|
-
const
|
|
13347
|
-
if (
|
|
13348
|
-
|
|
13344
|
+
const D = Ae(e), T = Te(e, g);
|
|
13345
|
+
$(D, p, Rs), $(T, p, Ls);
|
|
13346
|
+
const P = u.intersectsBox(Rs), I = u.intersectsBox(Ls);
|
|
13347
|
+
if (P && I)
|
|
13348
|
+
C = Ie(
|
|
13349
13349
|
a,
|
|
13350
13350
|
D,
|
|
13351
13351
|
t,
|
|
@@ -13357,9 +13357,9 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13357
13357
|
h + 1,
|
|
13358
13358
|
u,
|
|
13359
13359
|
d
|
|
13360
|
-
) ||
|
|
13360
|
+
) || Ie(
|
|
13361
13361
|
a,
|
|
13362
|
-
|
|
13362
|
+
T,
|
|
13363
13363
|
t,
|
|
13364
13364
|
i,
|
|
13365
13365
|
s,
|
|
@@ -13370,9 +13370,9 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13370
13370
|
u,
|
|
13371
13371
|
d
|
|
13372
13372
|
);
|
|
13373
|
-
else if (
|
|
13373
|
+
else if (P)
|
|
13374
13374
|
if (w)
|
|
13375
|
-
|
|
13375
|
+
C = Ie(
|
|
13376
13376
|
a,
|
|
13377
13377
|
D,
|
|
13378
13378
|
t,
|
|
@@ -13386,14 +13386,14 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13386
13386
|
d
|
|
13387
13387
|
);
|
|
13388
13388
|
else {
|
|
13389
|
-
const A =
|
|
13389
|
+
const A = at.getPrimitive();
|
|
13390
13390
|
A.copy(Rs).applyMatrix4(t);
|
|
13391
|
-
const
|
|
13392
|
-
$(
|
|
13391
|
+
const M = Ae(a), E = Te(a, m);
|
|
13392
|
+
$(M, f, Rt), $(E, f, Lt);
|
|
13393
13393
|
const R = A.intersectsBox(Rt), k = A.intersectsBox(Lt);
|
|
13394
|
-
|
|
13394
|
+
C = R && Ie(
|
|
13395
13395
|
D,
|
|
13396
|
-
|
|
13396
|
+
M,
|
|
13397
13397
|
i,
|
|
13398
13398
|
t,
|
|
13399
13399
|
s,
|
|
@@ -13403,9 +13403,9 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13403
13403
|
c + 1,
|
|
13404
13404
|
A,
|
|
13405
13405
|
!d
|
|
13406
|
-
) || k &&
|
|
13406
|
+
) || k && Ie(
|
|
13407
13407
|
D,
|
|
13408
|
-
|
|
13408
|
+
E,
|
|
13409
13409
|
i,
|
|
13410
13410
|
t,
|
|
13411
13411
|
s,
|
|
@@ -13415,13 +13415,13 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13415
13415
|
c + 1,
|
|
13416
13416
|
A,
|
|
13417
13417
|
!d
|
|
13418
|
-
),
|
|
13418
|
+
), at.releasePrimitive(A);
|
|
13419
13419
|
}
|
|
13420
13420
|
else if (I)
|
|
13421
13421
|
if (w)
|
|
13422
|
-
|
|
13422
|
+
C = Ie(
|
|
13423
13423
|
a,
|
|
13424
|
-
|
|
13424
|
+
T,
|
|
13425
13425
|
t,
|
|
13426
13426
|
i,
|
|
13427
13427
|
s,
|
|
@@ -13433,14 +13433,14 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13433
13433
|
d
|
|
13434
13434
|
);
|
|
13435
13435
|
else {
|
|
13436
|
-
const A =
|
|
13436
|
+
const A = at.getPrimitive();
|
|
13437
13437
|
A.copy(Ls).applyMatrix4(t);
|
|
13438
|
-
const
|
|
13439
|
-
$(
|
|
13438
|
+
const M = Ae(a), E = Te(a, m);
|
|
13439
|
+
$(M, f, Rt), $(E, f, Lt);
|
|
13440
13440
|
const R = A.intersectsBox(Rt), k = A.intersectsBox(Lt);
|
|
13441
|
-
|
|
13442
|
-
|
|
13443
|
-
|
|
13441
|
+
C = R && Ie(
|
|
13442
|
+
T,
|
|
13443
|
+
M,
|
|
13444
13444
|
i,
|
|
13445
13445
|
t,
|
|
13446
13446
|
s,
|
|
@@ -13450,9 +13450,9 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13450
13450
|
c + 1,
|
|
13451
13451
|
A,
|
|
13452
13452
|
!d
|
|
13453
|
-
) || k &&
|
|
13454
|
-
|
|
13455
|
-
|
|
13453
|
+
) || k && Ie(
|
|
13454
|
+
T,
|
|
13455
|
+
E,
|
|
13456
13456
|
i,
|
|
13457
13457
|
t,
|
|
13458
13458
|
s,
|
|
@@ -13462,12 +13462,12 @@ function Ce(a, e, t, i, s, r = 0, o = 0, c = 0, h = 0, u = null, d = !1) {
|
|
|
13462
13462
|
c + 1,
|
|
13463
13463
|
A,
|
|
13464
13464
|
!d
|
|
13465
|
-
),
|
|
13465
|
+
), at.releasePrimitive(A);
|
|
13466
13466
|
}
|
|
13467
13467
|
}
|
|
13468
|
-
return
|
|
13468
|
+
return C;
|
|
13469
13469
|
}
|
|
13470
|
-
const Qi = /* @__PURE__ */ new
|
|
13470
|
+
const Qi = /* @__PURE__ */ new fe(), bn = /* @__PURE__ */ new J(), $h = {
|
|
13471
13471
|
strategy: ro,
|
|
13472
13472
|
maxDepth: 40,
|
|
13473
13473
|
maxLeafTris: 10,
|
|
@@ -13578,7 +13578,7 @@ class gr {
|
|
|
13578
13578
|
return i;
|
|
13579
13579
|
}
|
|
13580
13580
|
shapecast(e) {
|
|
13581
|
-
const t =
|
|
13581
|
+
const t = Se.getPrimitive(), i = this.indirect ? Eh : Ch;
|
|
13582
13582
|
let {
|
|
13583
13583
|
boundsTraverseOrder: s,
|
|
13584
13584
|
intersectsBounds: r,
|
|
@@ -13598,38 +13598,38 @@ class gr {
|
|
|
13598
13598
|
break;
|
|
13599
13599
|
u += f.byteLength;
|
|
13600
13600
|
}
|
|
13601
|
-
return
|
|
13601
|
+
return Se.releasePrimitive(t), h;
|
|
13602
13602
|
}
|
|
13603
13603
|
bvhcast(e, t, i) {
|
|
13604
13604
|
let {
|
|
13605
13605
|
intersectsRanges: s,
|
|
13606
13606
|
intersectsTriangles: r
|
|
13607
13607
|
} = i;
|
|
13608
|
-
const o =
|
|
13608
|
+
const o = Se.getPrimitive(), c = this.geometry.index, h = this.geometry.attributes.position, u = this.indirect ? (m) => {
|
|
13609
13609
|
const _ = this.resolveTriangleIndex(m);
|
|
13610
13610
|
ie(o, _ * 3, c, h);
|
|
13611
13611
|
} : (m) => {
|
|
13612
13612
|
ie(o, m * 3, c, h);
|
|
13613
|
-
}, d =
|
|
13613
|
+
}, d = Se.getPrimitive(), n = e.geometry.index, l = e.geometry.attributes.position, f = e.indirect ? (m) => {
|
|
13614
13614
|
const _ = e.resolveTriangleIndex(m);
|
|
13615
13615
|
ie(d, _ * 3, n, l);
|
|
13616
13616
|
} : (m) => {
|
|
13617
13617
|
ie(d, m * 3, n, l);
|
|
13618
13618
|
};
|
|
13619
13619
|
if (r) {
|
|
13620
|
-
const m = (_, p, g, v, y, x, w,
|
|
13621
|
-
for (let
|
|
13622
|
-
f(
|
|
13623
|
-
for (let
|
|
13624
|
-
if (u(
|
|
13620
|
+
const m = (_, p, g, v, y, x, w, S) => {
|
|
13621
|
+
for (let C = g, D = g + v; C < D; C++) {
|
|
13622
|
+
f(C), d.a.applyMatrix4(t), d.b.applyMatrix4(t), d.c.applyMatrix4(t), d.needsUpdate = !0;
|
|
13623
|
+
for (let T = _, P = _ + p; T < P; T++)
|
|
13624
|
+
if (u(T), o.needsUpdate = !0, r(o, d, T, C, y, x, w, S))
|
|
13625
13625
|
return !0;
|
|
13626
13626
|
}
|
|
13627
13627
|
return !1;
|
|
13628
13628
|
};
|
|
13629
13629
|
if (s) {
|
|
13630
13630
|
const _ = s;
|
|
13631
|
-
s = function(p, g, v, y, x, w,
|
|
13632
|
-
return _(p, g, v, y, x, w,
|
|
13631
|
+
s = function(p, g, v, y, x, w, S, C) {
|
|
13632
|
+
return _(p, g, v, y, x, w, S, C) ? !0 : m(p, g, v, y, x, w, S, C);
|
|
13633
13633
|
};
|
|
13634
13634
|
} else
|
|
13635
13635
|
s = m;
|
|
@@ -13748,7 +13748,7 @@ class tu extends eu {
|
|
|
13748
13748
|
}
|
|
13749
13749
|
class iu {
|
|
13750
13750
|
constructor(e, t) {
|
|
13751
|
-
this.lock = !1, this.lockX = !1, this.lockY = !1, this.invRotMat = new te(), this.mouse = new b(), this.rotateStart = new
|
|
13751
|
+
this.lock = !1, this.lockX = !1, this.lockY = !1, this.invRotMat = new te(), this.mouse = new b(), this.rotateStart = new V(), this.rotateEnd = new V(), this.rotateDelta = new V(), this.selectedAxis = null, this.isDragging = !1, this.context = null, this.orbitState = !0, this._animator = 0, this._emitter = new xt(), this.addListener = this._emitter.addListener.bind(this._emitter), this.removeAllListeners = this._emitter.removeAllListeners.bind(this._emitter), this._text = document.createElement("div"), this._textTimer = 0, this._update = () => {
|
|
13752
13752
|
this.lock || (this._textTimer && (window.clearTimeout(this._textTimer), this._textTimer = 0), this._textTimer = window.setTimeout(() => {
|
|
13753
13753
|
this._text.style.opacity = "0";
|
|
13754
13754
|
}, 800), this.camera.updateMatrix(), this.invRotMat.extractRotation(this.camera.matrix).invert(), this.axes.forEach((s) => {
|
|
@@ -13814,7 +13814,7 @@ class iu {
|
|
|
13814
13814
|
);
|
|
13815
13815
|
};
|
|
13816
13816
|
const i = {
|
|
13817
|
-
offset: new
|
|
13817
|
+
offset: new V(),
|
|
13818
13818
|
size: 90,
|
|
13819
13819
|
padding: 8,
|
|
13820
13820
|
bubbleSizePrimary: 8,
|
|
@@ -13968,20 +13968,20 @@ class su {
|
|
|
13968
13968
|
size: c,
|
|
13969
13969
|
displayDelayFrames: Math.max(0, Math.floor(l)),
|
|
13970
13970
|
paused: f
|
|
13971
|
-
}, this.scene = t, this.renderer = e, this.buffer1Active = !1, this.dirLights = [], this.dirLightsHelpers = [], this.clearColor = new X(), this.clearAlpha = 0, this.progress = 0, this.discardMaterial = new nu(), this.lights = [], this.meshes = [], this.objectsToShow = [], this.autoHiddenObjects = [], this.objectsToShowSet = /* @__PURE__ */ new Set(), this.objectsToShowAncestors = /* @__PURE__ */ new Set(), this.framesDone = 0, this.fixedCamera = null, this.isRendering = !1, this._displaySuppressed = !1, this._displayDelayRemaining = 0, this._displayRestoreOpacity = 1, this.shadowMapHistory = [], this.isZUp =
|
|
13971
|
+
}, this.scene = t, this.renderer = e, this.buffer1Active = !1, this.dirLights = [], this.dirLightsHelpers = [], this.clearColor = new X(), this.clearAlpha = 0, this.progress = 0, this.discardMaterial = new nu(), this.lights = [], this.meshes = [], this.objectsToShow = [], this.autoHiddenObjects = [], this.objectsToShowSet = /* @__PURE__ */ new Set(), this.objectsToShowAncestors = /* @__PURE__ */ new Set(), this.framesDone = 0, this.fixedCamera = null, this.isRendering = !1, this._displaySuppressed = !1, this._displayDelayRemaining = 0, this._displayRestoreOpacity = 1, this.shadowMapHistory = [], this.isZUp = Re.DEFAULT_UP.z === 1, this.progShadowGrp = new Ee(), this.progShadowGrp.name = "progressive_shadow_assets", this.scene.add(this.progShadowGrp), this.lightOrigin = new Ee(), this.lightOrigin.name = "light_origin", this.isZUp ? this.lightOrigin.position.set(c, c, c * 1.5) : this.lightOrigin.position.set(c, c, c), this.progShadowGrp.add(this.lightOrigin), this.lightGroup = new Ee(), this.lightGroup.name = "all_dir_lights", this.progShadowGrp.add(this.lightGroup);
|
|
13972
13972
|
const m = Math.PI;
|
|
13973
13973
|
for (let g = 0; g < o; g++) {
|
|
13974
13974
|
const v = new Fo(16777215, m / o);
|
|
13975
13975
|
v.name = "dir_light_" + g, v.castShadow = !0, v.shadow.bias = r, v.shadow.camera.near = 0.1, v.shadow.camera.far = 50, v.shadow.camera.right = c / 2, v.shadow.camera.left = -c / 2, v.shadow.camera.top = c / 2, v.shadow.camera.bottom = -c / 2, v.shadow.mapSize.width = s, v.shadow.mapSize.height = s, this.dirLights.push(v), this.lightGroup.add(v);
|
|
13976
13976
|
}
|
|
13977
|
-
const _ = /(Android|iPad|iPhone|iPod)/g.test(navigator == null ? void 0 : navigator.userAgent) ?
|
|
13977
|
+
const _ = /(Android|iPad|iPhone|iPod)/g.test(navigator == null ? void 0 : navigator.userAgent) ? Pe : xe;
|
|
13978
13978
|
this.progressiveLightMap1 = new je(i, i, { type: _ }), this.progressiveLightMap2 = new je(i, i, { type: _ }), this.progressiveLightMap1.texture.colorSpace = Ar, this.progressiveLightMap2.texture.colorSpace = Ar, this.shadowCatcherMaterial = new ru({
|
|
13979
13979
|
map: this.progressiveLightMap2.texture,
|
|
13980
13980
|
transparent: !0,
|
|
13981
13981
|
opacity: 1
|
|
13982
13982
|
});
|
|
13983
13983
|
const p = new mi(c, c);
|
|
13984
|
-
this.isZUp || p.rotateX(-Math.PI / 2), this.shadowCatcherMesh = new q(p, this.shadowCatcherMaterial), this.isZUp ? this.shadowCatcherMesh.position.z = 1e-3 : this.shadowCatcherMesh.position.y = 1e-3, this.shadowCatcherMesh.name = "shadowCatcherMesh", this.shadowCatcherMesh.receiveShadow = !0, this.progShadowGrp.add(this.shadowCatcherMesh), this.addObjectToShow(this.progShadowGrp), this.addObjectToShow(this.lightGroup), this.addObjectToShow(this.lightOrigin), this.addObjectToShow(this.shadowCatcherMesh), this.rebuildObjectsToShowAncestors(), this.debugHelpersGroup = new
|
|
13984
|
+
this.isZUp || p.rotateX(-Math.PI / 2), this.shadowCatcherMesh = new q(p, this.shadowCatcherMaterial), this.isZUp ? this.shadowCatcherMesh.position.z = 1e-3 : this.shadowCatcherMesh.position.y = 1e-3, this.shadowCatcherMesh.name = "shadowCatcherMesh", this.shadowCatcherMesh.receiveShadow = !0, this.progShadowGrp.add(this.shadowCatcherMesh), this.addObjectToShow(this.progShadowGrp), this.addObjectToShow(this.lightGroup), this.addObjectToShow(this.lightOrigin), this.addObjectToShow(this.shadowCatcherMesh), this.rebuildObjectsToShowAncestors(), this.debugHelpersGroup = new Ee(), this.targetMat = new Bo({ fog: !1 }), this.previousShadowMap = { value: this.progressiveLightMap1.texture }, this.averagingWindow = { value: h }, this.targetMat.onBeforeCompile = (g) => {
|
|
13985
13985
|
g.vertexShader = `varying vec2 vUv;
|
|
13986
13986
|
` + g.vertexShader.slice(0, -1) + "vUv = uv; gl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }";
|
|
13987
13987
|
const v = g.fragmentShader.indexOf("void main() {");
|
|
@@ -14613,14 +14613,14 @@ class hu {
|
|
|
14613
14613
|
const c = s.layers.mask;
|
|
14614
14614
|
if (e) {
|
|
14615
14615
|
const D = Array.isArray(e) ? e : [e];
|
|
14616
|
-
D.length > 0 && (o = !0, this._box.makeEmpty(), D.forEach((
|
|
14617
|
-
if (
|
|
14616
|
+
D.length > 0 && (o = !0, this._box.makeEmpty(), D.forEach((T) => {
|
|
14617
|
+
if (T)
|
|
14618
14618
|
try {
|
|
14619
|
-
this._box.expandByObject(
|
|
14620
|
-
|
|
14619
|
+
this._box.expandByObject(T), T.traverse((P) => {
|
|
14620
|
+
P.layers.enable(this._selectionLayer);
|
|
14621
14621
|
});
|
|
14622
|
-
} catch (
|
|
14623
|
-
console.log("eee",
|
|
14622
|
+
} catch (P) {
|
|
14623
|
+
console.log("eee", P);
|
|
14624
14624
|
}
|
|
14625
14625
|
}), this._box.getBoundingSphere(this._sphere), s.layers.set(this._selectionLayer));
|
|
14626
14626
|
} else
|
|
@@ -14648,10 +14648,10 @@ class hu {
|
|
|
14648
14648
|
t.autoClear = !1;
|
|
14649
14649
|
const w = this.effectQuad.material;
|
|
14650
14650
|
w.map = this.targets[0].texture;
|
|
14651
|
-
const
|
|
14652
|
-
this.targets[0].texture.minFilter = W.LinearFilter, this.targets[0].texture.magFilter = W.LinearFilter, this.targets[0].texture.needsUpdate = !0, w.mask = this.masks[1].texture, w.thickness = r.thickness, w.inside = r.inside, w.color.set(r.color), w.transparent = !0, w.blending = W.NormalBlending, w.depthTest = !1, w.depthWrite = !1, this.effectQuad.render(t), this.targets[0].texture.minFilter =
|
|
14653
|
-
|
|
14654
|
-
|
|
14651
|
+
const S = this.targets[0].texture.minFilter, C = this.targets[0].texture.magFilter;
|
|
14652
|
+
this.targets[0].texture.minFilter = W.LinearFilter, this.targets[0].texture.magFilter = W.LinearFilter, this.targets[0].texture.needsUpdate = !0, w.mask = this.masks[1].texture, w.thickness = r.thickness, w.inside = r.inside, w.color.set(r.color), w.transparent = !0, w.blending = W.NormalBlending, w.depthTest = !1, w.depthWrite = !1, this.effectQuad.render(t), this.targets[0].texture.minFilter = S, this.targets[0].texture.magFilter = C, this.targets[0].texture.needsUpdate = !0, t.autoClear = x, t.setScissorTest(!1), o && e && ((Array.isArray(e) ? e : [e]).forEach((T) => {
|
|
14653
|
+
T && T.traverse((P) => {
|
|
14654
|
+
P.layers.disable(this._selectionLayer);
|
|
14655
14655
|
});
|
|
14656
14656
|
}), s.layers.mask = c);
|
|
14657
14657
|
}
|
|
@@ -14748,7 +14748,7 @@ class Tn {
|
|
|
14748
14748
|
}
|
|
14749
14749
|
var mu = /* @__PURE__ */ ((a) => (a[a.DEFAULT = 0] = "DEFAULT", a[a.CAN_INSTALL = 1] = "CAN_INSTALL", a))(mu || {});
|
|
14750
14750
|
const Sn = 0.15;
|
|
14751
|
-
|
|
14751
|
+
Re.DEFAULT_UP.set(0, 0, 1);
|
|
14752
14752
|
let Ft, Zi = 0, rr = 0;
|
|
14753
14753
|
const gu = () => {
|
|
14754
14754
|
Ft = void 0, Zi = 0, rr = 0;
|
|
@@ -14761,7 +14761,7 @@ class cf {
|
|
|
14761
14761
|
logarithmicDepthBuffer: !0,
|
|
14762
14762
|
powerPreference: "high-performance",
|
|
14763
14763
|
preserveDrawingBuffer: !0
|
|
14764
|
-
}), this.css2dRenderer = new Qo(), this.mousePos = new
|
|
14764
|
+
}), this.css2dRenderer = new Qo(), this.mousePos = new V(), this.mouseCoord = new V(), this.offset = new V(), this.size = new V(), this.amr = new Xc({ showSizeBox: !0, showController: !0 }), this._selectedForOutline = [], this._clock = new rs(!0), this._uiHiddenTime = this._clock.getElapsedTime(), this.camera = new ss(
|
|
14765
14765
|
39.6,
|
|
14766
14766
|
window.innerWidth / window.innerHeight,
|
|
14767
14767
|
0.1,
|
|
@@ -14773,7 +14773,7 @@ class cf {
|
|
|
14773
14773
|
-this.d,
|
|
14774
14774
|
0.1,
|
|
14775
14775
|
1e3
|
|
14776
|
-
), this._axisMoving = !1, this._container = new
|
|
14776
|
+
), this._axisMoving = !1, this._container = new Ee(), this._raycaster = new Rn(), this._selected = [], this._pointerDownTimeout = 0, this._dragging = !1, this.maxSample = 1024 * 2, this.sampleCount = 0, this._usePathTracing = !1, this._fpsCache = [], this._fpsCacheMax = 20, this._emitter = new xt(), this.sound = new wc(), this._rafId = null, this._destroyed = !1, this._css2dUiStyleInjected = !1, this._ground = new q(
|
|
14777
14777
|
new mi(100, 100),
|
|
14778
14778
|
new Ho({
|
|
14779
14779
|
color: new X("#eee"),
|
|
@@ -14783,7 +14783,7 @@ class cf {
|
|
|
14783
14783
|
clearcoatRoughness: 0.1
|
|
14784
14784
|
})
|
|
14785
14785
|
), this._sciFiGrid = new uu(18, 40), this._amrRender = new je(1024, 1024, {
|
|
14786
|
-
format:
|
|
14786
|
+
format: ce,
|
|
14787
14787
|
type: nr,
|
|
14788
14788
|
colorSpace: pi,
|
|
14789
14789
|
samples: 8
|
|
@@ -14816,37 +14816,37 @@ class cf {
|
|
|
14816
14816
|
var c;
|
|
14817
14817
|
this._progressShadow.clear(), (c = this._progressShadow) == null || c.recalculate();
|
|
14818
14818
|
}, 300), this.focusObjects = (c, h) => {
|
|
14819
|
-
var
|
|
14819
|
+
var G;
|
|
14820
14820
|
if (!c.length) {
|
|
14821
14821
|
this.fit();
|
|
14822
14822
|
return;
|
|
14823
14823
|
}
|
|
14824
|
-
this.scene.updateMatrixWorld(!0), this._focusRestoreView = void 0, (
|
|
14824
|
+
this.scene.updateMatrixWorld(!0), this._focusRestoreView = void 0, (G = this._fitAnimation) == null || G.stop();
|
|
14825
14825
|
const u = new J(), d = new J(), n = new b(), l = new b(), f = new b(), m = new b(), _ = (O) => {
|
|
14826
14826
|
O.geometry && (O.geometry.boundingBox || O.geometry.computeBoundingBox(), d.copy(O.geometry.boundingBox).applyMatrix4(O.matrixWorld), d.isEmpty() || u.union(d));
|
|
14827
14827
|
}, p = (O) => {
|
|
14828
14828
|
var vi, yi;
|
|
14829
|
-
const Y = O.geometry,
|
|
14830
|
-
if (!
|
|
14829
|
+
const Y = O.geometry, U = (vi = Y == null ? void 0 : Y.attributes) == null ? void 0 : vi.position;
|
|
14830
|
+
if (!U) {
|
|
14831
14831
|
_(O);
|
|
14832
14832
|
return;
|
|
14833
14833
|
}
|
|
14834
|
-
const
|
|
14835
|
-
for (let ke = 0; ke <
|
|
14834
|
+
const oe = ((yi = Y.morphAttributes) == null ? void 0 : yi.position) || [], $e = O.morphTargetInfluences || [], we = oe.length > 0 && $e.length > 0;
|
|
14835
|
+
for (let ke = 0; ke < U.count; ke++) {
|
|
14836
14836
|
if (n.set(
|
|
14837
|
-
|
|
14838
|
-
|
|
14839
|
-
|
|
14840
|
-
),
|
|
14837
|
+
U.getX(ke),
|
|
14838
|
+
U.getY(ke),
|
|
14839
|
+
U.getZ(ke)
|
|
14840
|
+
), we) {
|
|
14841
14841
|
l.set(0, 0, 0);
|
|
14842
14842
|
let xi = 0;
|
|
14843
|
-
for (let se = 0; se <
|
|
14844
|
-
const
|
|
14845
|
-
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14849
|
-
), Y.morphTargetsRelative, l.addScaledVector(f,
|
|
14843
|
+
for (let se = 0; se < oe.length; se++) {
|
|
14844
|
+
const he = $e[se] || 0;
|
|
14845
|
+
he && (xi += he, f.set(
|
|
14846
|
+
oe[se].getX(ke),
|
|
14847
|
+
oe[se].getY(ke),
|
|
14848
|
+
oe[se].getZ(ke)
|
|
14849
|
+
), Y.morphTargetsRelative, l.addScaledVector(f, he));
|
|
14850
14850
|
}
|
|
14851
14851
|
Y.morphTargetsRelative ? n.add(l) : xi > 0 && (n.multiplyScalar(1 - xi), n.add(l));
|
|
14852
14852
|
}
|
|
@@ -14873,7 +14873,7 @@ class cf {
|
|
|
14873
14873
|
this._lastTarget.copy(y);
|
|
14874
14874
|
let x;
|
|
14875
14875
|
h ? x = h.clone().normalize().negate() : x = this.camera.position.clone().sub(this.controls.target).normalize();
|
|
14876
|
-
const w = v.clone().multiplyScalar(0.5),
|
|
14876
|
+
const w = v.clone().multiplyScalar(0.5), S = [
|
|
14877
14877
|
new b(w.x, w.y, w.z),
|
|
14878
14878
|
new b(w.x, w.y, -w.z),
|
|
14879
14879
|
new b(w.x, -w.y, w.z),
|
|
@@ -14882,20 +14882,20 @@ class cf {
|
|
|
14882
14882
|
new b(-w.x, w.y, -w.z),
|
|
14883
14883
|
new b(-w.x, -w.y, w.z),
|
|
14884
14884
|
new b(-w.x, -w.y, -w.z)
|
|
14885
|
-
],
|
|
14886
|
-
Math.abs(x.dot(
|
|
14887
|
-
const D = new b().crossVectors(x,
|
|
14888
|
-
let
|
|
14889
|
-
|
|
14890
|
-
const Y = O.dot(D),
|
|
14891
|
-
|
|
14892
|
-
}),
|
|
14893
|
-
const I = this.camera.fov * Math.PI / 180, A = 2 * Math.atan(Math.tan(I / 2) * this.camera.aspect),
|
|
14885
|
+
], C = new b(0, 1, 0);
|
|
14886
|
+
Math.abs(x.dot(C)) > 0.99 && C.set(0, 0, 1);
|
|
14887
|
+
const D = new b().crossVectors(x, C).normalize(), T = new b().crossVectors(D, x).normalize();
|
|
14888
|
+
let P = 0;
|
|
14889
|
+
S.forEach((O) => {
|
|
14890
|
+
const Y = O.dot(D), U = O.dot(T), oe = Math.sqrt(Y * Y + U * U);
|
|
14891
|
+
P = Math.max(P, oe);
|
|
14892
|
+
}), P = P / 2 + 0.4;
|
|
14893
|
+
const I = this.camera.fov * Math.PI / 180, A = 2 * Math.atan(Math.tan(I / 2) * this.camera.aspect), M = P / Math.tan(A / 2), E = P / Math.tan(I / 2), R = Math.max(M, E), k = g.clone().add(x.multiplyScalar(R)), F = this.camera.position.clone(), z = this.controls.target.clone();
|
|
14894
14894
|
let B = 500;
|
|
14895
|
-
const
|
|
14896
|
-
|
|
14895
|
+
const j = F.distanceTo(k) + z.distanceTo(y);
|
|
14896
|
+
j > 1e-3 && (B = Math.min(1e3, Math.max(450, j * 45))), this._animateCamera(F, k, z, y, B);
|
|
14897
14897
|
}, this.focusSlots = (c) => {
|
|
14898
|
-
var
|
|
14898
|
+
var T, P;
|
|
14899
14899
|
if (this.amr.slots.forEach((I) => {
|
|
14900
14900
|
I.focused = !1, I.hide();
|
|
14901
14901
|
}), !c.length)
|
|
@@ -14904,10 +14904,10 @@ class cf {
|
|
|
14904
14904
|
}), this.shadowMode = !1, this._focusRestoreView) {
|
|
14905
14905
|
const I = this._focusRestoreView;
|
|
14906
14906
|
this._focusRestoreView = void 0;
|
|
14907
|
-
const A = this.camera.position.clone(),
|
|
14907
|
+
const A = this.camera.position.clone(), M = this.controls.target.clone(), E = I.position.clone(), R = I.target.clone();
|
|
14908
14908
|
let k = 500;
|
|
14909
|
-
const F = A.distanceTo(
|
|
14910
|
-
F > 1e-3 && (k = Math.min(1e3, Math.max(450, F * 45))), this._animateCamera(A,
|
|
14909
|
+
const F = A.distanceTo(E) + M.distanceTo(R);
|
|
14910
|
+
F > 1e-3 && (k = Math.min(1e3, Math.max(450, F * 45))), this._animateCamera(A, E, M, R, k, () => {
|
|
14911
14911
|
this.camera.up.copy(I.up);
|
|
14912
14912
|
});
|
|
14913
14913
|
return;
|
|
@@ -14915,11 +14915,11 @@ class cf {
|
|
|
14915
14915
|
this.fit();
|
|
14916
14916
|
return;
|
|
14917
14917
|
}
|
|
14918
|
-
(
|
|
14918
|
+
(T = this._fitAnimation) != null && T.isPlaying() || this.shadowMode || (this._focusRestoreView = {
|
|
14919
14919
|
position: this.camera.position.clone(),
|
|
14920
14920
|
target: new b(0, 0, this.controls.target.z),
|
|
14921
14921
|
up: this.camera.up.clone()
|
|
14922
|
-
}), (
|
|
14922
|
+
}), (P = this._fitAnimation) == null || P.stop(), this.shadowMode = !0;
|
|
14923
14923
|
const h = c.flatMap((I) => {
|
|
14924
14924
|
if (I.show(), I.focused = !0, !I.parent)
|
|
14925
14925
|
return [];
|
|
@@ -14931,17 +14931,17 @@ class cf {
|
|
|
14931
14931
|
const u = h.reduce((I, A) => I.add(A), new b()).multiplyScalar(1 / h.length), d = this.controls.target.clone(), n = this.camera.position.clone().sub(d).normalize();
|
|
14932
14932
|
let l = 0;
|
|
14933
14933
|
for (const I of h) {
|
|
14934
|
-
const A = I.clone().sub(u),
|
|
14935
|
-
|
|
14934
|
+
const A = I.clone().sub(u), M = A.dot(n), E = Math.sqrt(Math.max(0, A.lengthSq() - M * M));
|
|
14935
|
+
E > l && (l = E);
|
|
14936
14936
|
}
|
|
14937
14937
|
l = l + 0.4;
|
|
14938
|
-
const f = this.camera.fov * Math.PI / 180, m = 2 * Math.atan(Math.tan(f / 2) * this.camera.aspect), _ = l / Math.tan(m / 2), p = l / Math.tan(f / 2), g = Math.max(_, p), v = u.clone(), y = u.clone().add(n.clone().multiplyScalar(g < 1 ? 1 : g)), x = this.camera.position.clone(), w = d.clone(),
|
|
14939
|
-
let
|
|
14938
|
+
const f = this.camera.fov * Math.PI / 180, m = 2 * Math.atan(Math.tan(f / 2) * this.camera.aspect), _ = l / Math.tan(m / 2), p = l / Math.tan(f / 2), g = Math.max(_, p), v = u.clone(), y = u.clone().add(n.clone().multiplyScalar(g < 1 ? 1 : g)), x = this.camera.position.clone(), w = d.clone(), S = { t: 0 };
|
|
14939
|
+
let C = 500;
|
|
14940
14940
|
const D = x.distanceTo(y) + w.distanceTo(v);
|
|
14941
|
-
D > 1e-3 && (
|
|
14941
|
+
D > 1e-3 && (C = Math.min(1e3, Math.max(450, D * 45))), this._lastTarget = v.clone(), this._fitAnimation = new Ji(S).to({ t: 1 }, C).easing(me.Easing.Quadratic.InOut).onStart(() => {
|
|
14942
14942
|
this.controls.enabled = !1;
|
|
14943
14943
|
}).onUpdate(() => {
|
|
14944
|
-
const I =
|
|
14944
|
+
const I = S.t;
|
|
14945
14945
|
this.camera.position.lerpVectors(x, y, I), this.controls.target.lerpVectors(w, v, I);
|
|
14946
14946
|
}).onComplete(() => {
|
|
14947
14947
|
this.controls.enabled = !0;
|
|
@@ -14964,19 +14964,19 @@ class cf {
|
|
|
14964
14964
|
];
|
|
14965
14965
|
let _ = 0;
|
|
14966
14966
|
for (const A of m) {
|
|
14967
|
-
const
|
|
14968
|
-
|
|
14967
|
+
const M = A.dot(l), E = Math.sqrt(Math.max(0, A.lengthSq() - M * M));
|
|
14968
|
+
E > _ && (_ = E);
|
|
14969
14969
|
}
|
|
14970
14970
|
_ = _ * 1.05;
|
|
14971
14971
|
const p = this.camera.fov * Math.PI / 180, g = 2 * Math.atan(Math.tan(p / 2) * this.camera.aspect), v = _ / Math.tan(g / 2), y = _ / Math.tan(p / 2), x = Math.max(v, y), w = u.clone();
|
|
14972
|
-
let
|
|
14973
|
-
h.z < h.x && h.z < h.y && (
|
|
14974
|
-
const
|
|
14972
|
+
let S = h.z / 3;
|
|
14973
|
+
h.z < h.x && h.z < h.y && (S = h.x * 0.8), h.z > h.x && h.z > h.y && (S = 0), w.z += S;
|
|
14974
|
+
const C = n.clone().normalize().multiplyScalar(x < 1 ? 1 : x).add(w);
|
|
14975
14975
|
Math.max(h.x * 2, 5);
|
|
14976
|
-
const D = this.camera.position.clone(),
|
|
14977
|
-
let
|
|
14978
|
-
const I = D.distanceTo(
|
|
14979
|
-
I > 1e-3 && (
|
|
14976
|
+
const D = this.camera.position.clone(), T = this.controls.target.clone();
|
|
14977
|
+
let P = 600;
|
|
14978
|
+
const I = D.distanceTo(C) + T.distanceTo(d);
|
|
14979
|
+
I > 1e-3 && (P = Math.min(800, Math.max(650, I * 45))), this._animateCamera(D, C, T, d, P, () => {
|
|
14980
14980
|
this.shadowMode || (this._progressShadow.visible = !0, this._progressShadow.isFinished || this._progressShadow.recalculate());
|
|
14981
14981
|
}), this.controls.minDistance = Math.max(0.2, Math.min(x * 0.25, x - 0.1)), this.controls.maxDistance = x * 4;
|
|
14982
14982
|
}, this.resize = () => {
|
|
@@ -15033,7 +15033,7 @@ class cf {
|
|
|
15033
15033
|
}), (typeof e.useAxisBall != "boolean" || e.useAxisBall) && (this._controlsGizmo = new iu(this.controls, {
|
|
15034
15034
|
size: 160,
|
|
15035
15035
|
padding: 12,
|
|
15036
|
-
offset: e.axisBallOffset || new
|
|
15036
|
+
offset: e.axisBallOffset || new V(10, 10),
|
|
15037
15037
|
fontSize: 17,
|
|
15038
15038
|
bubbleSizePrimary: 18,
|
|
15039
15039
|
bubbleSizeSecondary: 14
|
|
@@ -15175,10 +15175,7 @@ class cf {
|
|
|
15175
15175
|
});
|
|
15176
15176
|
}
|
|
15177
15177
|
async captureTriViews(e) {
|
|
15178
|
-
|
|
15179
|
-
const t = (e == null ? void 0 : e.subject) ?? this._container;
|
|
15180
|
-
(o = this._progressShadow) == null || o.visible;
|
|
15181
|
-
const i = this.scene.background, s = this.showSize;
|
|
15178
|
+
const t = (e == null ? void 0 : e.subject) ?? this._container, i = this.scene.background, s = this.showSize;
|
|
15182
15179
|
return new vu({
|
|
15183
15180
|
renderer: this.renderer,
|
|
15184
15181
|
scene: this.scene,
|
|
@@ -15238,8 +15235,8 @@ class cf {
|
|
|
15238
15235
|
const x = new b().crossVectors(g, v);
|
|
15239
15236
|
if (x.lengthSq() > 1e-3) {
|
|
15240
15237
|
x.normalize();
|
|
15241
|
-
const w = new ee().setFromAxisAngle(x, y * u),
|
|
15242
|
-
p = d.clone().add(
|
|
15238
|
+
const w = new ee().setFromAxisAngle(x, y * u), S = g.clone().applyQuaternion(w);
|
|
15239
|
+
p = d.clone().add(S.multiplyScalar(_));
|
|
15243
15240
|
} else
|
|
15244
15241
|
p = d.clone().add(g.multiplyScalar(_));
|
|
15245
15242
|
} else
|
|
@@ -15310,11 +15307,12 @@ class vu {
|
|
|
15310
15307
|
const t = this.deps.renderer, i = (e == null ? void 0 : e.subject) ?? this.deps.subject;
|
|
15311
15308
|
if (!i)
|
|
15312
15309
|
throw new Error("TriViewCapture: subject is required.");
|
|
15313
|
-
const s = new
|
|
15310
|
+
const s = new V();
|
|
15314
15311
|
t.getSize(s);
|
|
15315
15312
|
const r = ((m = e == null ? void 0 : e.size) == null ? void 0 : m.width) ?? Math.round(s.x), o = ((_ = e == null ? void 0 : e.size) == null ? void 0 : _.height) ?? Math.round(s.y), c = (e == null ? void 0 : e.margin) ?? 0.15, h = (e == null ? void 0 : e.includeOverlay) ?? !1, u = r / o || 1, d = this.resolveViews(e == null ? void 0 : e.views), n = new je(r, o, {
|
|
15316
|
-
format:
|
|
15317
|
-
type: nr
|
|
15313
|
+
format: ce,
|
|
15314
|
+
type: nr,
|
|
15315
|
+
samples: 4
|
|
15318
15316
|
});
|
|
15319
15317
|
n.texture.colorSpace = pi, n.texture.generateMipmaps = !1, n.depthBuffer = !0;
|
|
15320
15318
|
const l = this.storeRendererState(t), f = {};
|
|
@@ -15328,10 +15326,10 @@ class vu {
|
|
|
15328
15326
|
e == null ? void 0 : e.backgroundColor
|
|
15329
15327
|
);
|
|
15330
15328
|
for (const w of d) {
|
|
15331
|
-
const
|
|
15332
|
-
t.setRenderTarget(n), t.clear(!0, !0, !0), t.render(this.deps.scene,
|
|
15333
|
-
const
|
|
15334
|
-
f[w.key] =
|
|
15329
|
+
const S = this.configureCamera(x, w, u, c, r, o);
|
|
15330
|
+
t.setRenderTarget(n), t.clear(!0, !0, !0), t.render(this.deps.scene, S), h && this.deps.overlayScene && (t.clearDepth(), t.render(this.deps.overlayScene, S));
|
|
15331
|
+
const C = this.readPixels(t, n, r, o);
|
|
15332
|
+
f[w.key] = C;
|
|
15335
15333
|
}
|
|
15336
15334
|
} finally {
|
|
15337
15335
|
n.dispose(), this.restoreRendererState(t, l), (y = (v = this.deps).onAfterCapture) == null || y.call(v);
|
|
@@ -15343,7 +15341,10 @@ class vu {
|
|
|
15343
15341
|
key: t.key,
|
|
15344
15342
|
direction: t.direction.clone(),
|
|
15345
15343
|
up: t.up.clone(),
|
|
15346
|
-
plane: t.plane
|
|
15344
|
+
plane: t.plane,
|
|
15345
|
+
mode: t.mode,
|
|
15346
|
+
fov: t.fov,
|
|
15347
|
+
useFitDirection: t.useFitDirection
|
|
15347
15348
|
})) : [
|
|
15348
15349
|
{
|
|
15349
15350
|
key: "top",
|
|
@@ -15353,19 +15354,19 @@ class vu {
|
|
|
15353
15354
|
},
|
|
15354
15355
|
{
|
|
15355
15356
|
key: "front",
|
|
15356
|
-
direction: new b(
|
|
15357
|
+
direction: new b(1, 0, 0),
|
|
15357
15358
|
up: new b(0, 0, 1),
|
|
15358
|
-
plane: { width: "
|
|
15359
|
+
plane: { width: "y", height: "z", depth: "x" }
|
|
15359
15360
|
},
|
|
15360
15361
|
{
|
|
15361
15362
|
key: "side",
|
|
15362
|
-
direction: new b(
|
|
15363
|
+
direction: new b(0, -1, 0),
|
|
15363
15364
|
up: new b(0, 0, 1),
|
|
15364
|
-
plane: { width: "
|
|
15365
|
+
plane: { width: "x", height: "z", depth: "y" }
|
|
15365
15366
|
},
|
|
15366
15367
|
{
|
|
15367
15368
|
key: "perspective",
|
|
15368
|
-
direction: new b(1, 1,
|
|
15369
|
+
direction: new b(1, 1, 0),
|
|
15369
15370
|
up: new b(0, 0, 1),
|
|
15370
15371
|
plane: { width: "x", height: "z", depth: "y" },
|
|
15371
15372
|
mode: "perspective",
|
|
@@ -15374,16 +15375,64 @@ class vu {
|
|
|
15374
15375
|
];
|
|
15375
15376
|
}
|
|
15376
15377
|
computeBounds(e) {
|
|
15377
|
-
const t = new J(), i = new J(), s = new b(), r = new b(), o = new ns();
|
|
15378
|
-
|
|
15379
|
-
|
|
15378
|
+
const t = new J(), i = new J(), s = new b(), r = new b(), o = new ns(), c = new b(), h = new b(), u = new b(), d = new b();
|
|
15379
|
+
e.updateMatrixWorld(!0);
|
|
15380
|
+
const n = (l, f) => {
|
|
15381
|
+
if (l.visible) {
|
|
15382
|
+
f(l);
|
|
15383
|
+
for (const m of l.children)
|
|
15384
|
+
n(m, f);
|
|
15385
|
+
}
|
|
15386
|
+
};
|
|
15387
|
+
return n(e, (l) => {
|
|
15388
|
+
var w, S, C, D;
|
|
15389
|
+
const f = l, m = f.geometry;
|
|
15390
|
+
if (!m || (w = f.userData) != null && w.ignoreSize)
|
|
15391
|
+
return;
|
|
15392
|
+
const _ = f.material;
|
|
15393
|
+
if ((S = _ == null ? void 0 : _.userData) != null && S.isLOGO)
|
|
15394
|
+
return;
|
|
15395
|
+
const p = (C = m.attributes) == null ? void 0 : C.position;
|
|
15396
|
+
if (!p || p.count <= 0) {
|
|
15397
|
+
m.boundingBox || m.computeBoundingBox();
|
|
15398
|
+
const T = m.boundingBox;
|
|
15399
|
+
if (!T)
|
|
15400
|
+
return;
|
|
15401
|
+
i.copy(T).applyMatrix4(l.matrixWorld), t.union(i);
|
|
15380
15402
|
return;
|
|
15381
|
-
|
|
15382
|
-
|
|
15403
|
+
}
|
|
15404
|
+
const g = typeof f.getVertexPosition == "function" ? f.getVertexPosition.bind(f) : void 0;
|
|
15405
|
+
if (g) {
|
|
15406
|
+
for (let T = 0; T < p.count; T++)
|
|
15407
|
+
g(T, d), d.applyMatrix4(l.matrixWorld), t.expandByPoint(d);
|
|
15408
|
+
return;
|
|
15409
|
+
}
|
|
15410
|
+
const v = (D = m.morphAttributes) == null ? void 0 : D.position, y = f.morphTargetInfluences;
|
|
15411
|
+
if (!(v && y && v.length > 0)) {
|
|
15412
|
+
m.boundingBox || m.computeBoundingBox();
|
|
15413
|
+
const T = m.boundingBox;
|
|
15414
|
+
if (!T)
|
|
15415
|
+
return;
|
|
15416
|
+
i.copy(T).applyMatrix4(l.matrixWorld), t.union(i);
|
|
15383
15417
|
return;
|
|
15384
|
-
|
|
15385
|
-
|
|
15386
|
-
|
|
15418
|
+
}
|
|
15419
|
+
for (let T = 0; T < p.count; T++) {
|
|
15420
|
+
c.set(
|
|
15421
|
+
p.getX(T),
|
|
15422
|
+
p.getY(T),
|
|
15423
|
+
p.getZ(T)
|
|
15424
|
+
), h.set(0, 0, 0);
|
|
15425
|
+
let P = 0;
|
|
15426
|
+
for (let I = 0; I < v.length; I++) {
|
|
15427
|
+
const A = y[I] || 0;
|
|
15428
|
+
A && (P += A, u.set(
|
|
15429
|
+
v[I].getX(T),
|
|
15430
|
+
v[I].getY(T),
|
|
15431
|
+
v[I].getZ(T)
|
|
15432
|
+
), h.addScaledVector(u, A));
|
|
15433
|
+
}
|
|
15434
|
+
m.morphTargetsRelative ? c.add(h) : P > 0 && (c.multiplyScalar(1 - P), c.add(h)), d.copy(c).applyMatrix4(l.matrixWorld), t.expandByPoint(d);
|
|
15435
|
+
}
|
|
15387
15436
|
}), t.isEmpty() ? (t.setFromCenterAndSize(s, new b(1e-3, 1e-3, 1e-3)), r.set(1e-3, 1e-3, 1e-3), o.center.copy(s), o.radius = 1e-3) : (t.getCenter(s), t.getSize(r), t.getBoundingSphere(o)), (!Number.isFinite(o.radius) || o.radius <= 0) && (o.radius = Math.max(r.length() * 0.5, 1e-3)), { box: t, center: s, size: r, sphere: o };
|
|
15388
15437
|
}
|
|
15389
15438
|
configureCamera(e, t, i, s, r, o) {
|
|
@@ -15391,33 +15440,35 @@ class vu {
|
|
|
15391
15440
|
c.lengthSq() === 0 && c.set(0, 0, 1);
|
|
15392
15441
|
const h = t.up.clone().normalize();
|
|
15393
15442
|
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") {
|
|
15394
|
-
const x = this.perspectiveCamera, w = t.fov ?? 45,
|
|
15395
|
-
|
|
15396
|
-
const I = new b().crossVectors(
|
|
15397
|
-
new b(-A, -
|
|
15398
|
-
new b(-A, -
|
|
15399
|
-
new b(-A,
|
|
15400
|
-
new b(-A,
|
|
15401
|
-
new b(A, -
|
|
15402
|
-
new b(A, -
|
|
15403
|
-
new b(A,
|
|
15404
|
-
new b(A,
|
|
15443
|
+
const x = this.perspectiveCamera, w = t.fov ?? 45, S = Qe.degToRad(w), C = Math.max(Math.tan(S / 2), 1e-4), D = Math.max(C * (i || 1), 1e-4), T = this.getPerspectiveDirection(t, e.size).normalize(), P = new b().crossVectors(T, h).normalize();
|
|
15444
|
+
P.lengthSq() < 1e-6 && P.set(1, 0, 0);
|
|
15445
|
+
const I = new b().crossVectors(P, T).normalize(), A = Math.max(e.size.x * 0.5, 1e-4), M = Math.max(e.size.y * 0.5, 1e-4), E = Math.max(e.size.z * 0.5, 1e-4), R = [
|
|
15446
|
+
new b(-A, -M, -E),
|
|
15447
|
+
new b(-A, -M, E),
|
|
15448
|
+
new b(-A, M, -E),
|
|
15449
|
+
new b(-A, M, E),
|
|
15450
|
+
new b(A, -M, -E),
|
|
15451
|
+
new b(A, -M, E),
|
|
15452
|
+
new b(A, M, -E),
|
|
15453
|
+
new b(A, M, E)
|
|
15405
15454
|
];
|
|
15406
15455
|
let k = 0, F = -1 / 0;
|
|
15407
|
-
for (const
|
|
15408
|
-
const
|
|
15409
|
-
F = Math.max(F,
|
|
15410
|
-
const
|
|
15411
|
-
k = Math.max(k,
|
|
15456
|
+
for (const O of R) {
|
|
15457
|
+
const Y = P.dot(O), U = I.dot(O), oe = T.dot(O);
|
|
15458
|
+
F = Math.max(F, oe);
|
|
15459
|
+
const $e = oe + Math.abs(Y) / D, we = oe + Math.abs(U) / C;
|
|
15460
|
+
k = Math.max(k, $e, we);
|
|
15412
15461
|
}
|
|
15413
15462
|
k = Math.max(k, F + 0.1);
|
|
15414
15463
|
const z = k * (1 + s);
|
|
15415
15464
|
let B = 1 / 0;
|
|
15416
|
-
for (const
|
|
15417
|
-
const
|
|
15418
|
-
|
|
15465
|
+
for (const O of R) {
|
|
15466
|
+
const Y = T.dot(O), U = z - Y;
|
|
15467
|
+
U > 1e-3 && (B = Math.min(B, U));
|
|
15419
15468
|
}
|
|
15420
|
-
|
|
15469
|
+
x.fov = w, x.aspect = i || r / Math.max(o, 1), x.near = Math.max(0.1, Number.isFinite(B) ? B * 0.5 : z * 0.1), x.far = Math.max(x.near + 1, z + e.sphere.radius * 3);
|
|
15470
|
+
const j = this.getPerspectiveTargetZOffset(t, e.size), G = e.center.clone();
|
|
15471
|
+
return x.position.copy(e.center).add(T.clone().multiplyScalar(z)).add(new b(0, 0, j)), x.up.copy(I), x.lookAt(G), x.updateProjectionMatrix(), x.updateMatrixWorld(!0), x;
|
|
15421
15472
|
}
|
|
15422
15473
|
const d = this.orthoCamera, n = e.size, l = e.center, f = Math.max(n[t.plane.width] * 0.5, 0.01), m = Math.max(n[t.plane.height] * 0.5, 0.01), _ = Math.max(n[t.plane.depth] * 0.5, 0.01);
|
|
15423
15474
|
let p = f * (1 + s), g = m * (1 + s);
|
|
@@ -15426,21 +15477,30 @@ class vu {
|
|
|
15426
15477
|
return d.left = -p, d.right = p, d.top = g, d.bottom = -g, d.near = 0.1, d.far = v * 4, d.zoom = 1, d.position.copy(y), d.up.copy(h), d.lookAt(l), d.updateProjectionMatrix(), d.updateMatrixWorld(!0), d;
|
|
15427
15478
|
}
|
|
15428
15479
|
getPerspectiveDirection(e, t) {
|
|
15480
|
+
if (e.useFitDirection !== !1) {
|
|
15481
|
+
const r = new b(t.x, t.y, 0);
|
|
15482
|
+
return r.lengthSq() < 1e-6 && r.set(1, 0, 0), r;
|
|
15483
|
+
}
|
|
15429
15484
|
const i = e.direction.clone();
|
|
15430
|
-
i.lengthSq() === 0 && i.set(1, 1, 1)
|
|
15431
|
-
|
|
15432
|
-
|
|
15433
|
-
|
|
15434
|
-
|
|
15435
|
-
|
|
15436
|
-
|
|
15485
|
+
return i.lengthSq() === 0 && i.set(1, 1, 1), new b(
|
|
15486
|
+
i.x * Math.max(t.x, 1e-3),
|
|
15487
|
+
i.y * Math.max(t.y, 1e-3),
|
|
15488
|
+
i.z * Math.max(t.z, 1e-3)
|
|
15489
|
+
);
|
|
15490
|
+
}
|
|
15491
|
+
/** 计算 fit 风格的目标 Z 偏移(相机高于目标,形成俯视角) */
|
|
15492
|
+
getPerspectiveTargetZOffset(e, t) {
|
|
15493
|
+
if (e.useFitDirection === !1)
|
|
15494
|
+
return 0;
|
|
15495
|
+
let i = t.z / 3;
|
|
15496
|
+
return t.z < t.x && t.z < t.y && (i = t.x * 0.8), t.z > t.x && t.z > t.y && (i = 0), i;
|
|
15437
15497
|
}
|
|
15438
15498
|
storeRendererState(e) {
|
|
15439
|
-
const t = new
|
|
15499
|
+
const t = new V();
|
|
15440
15500
|
e.getSize(t);
|
|
15441
|
-
const i = new
|
|
15501
|
+
const i = new ut();
|
|
15442
15502
|
e.getViewport(i);
|
|
15443
|
-
const s = new
|
|
15503
|
+
const s = new ut();
|
|
15444
15504
|
e.getScissor(s);
|
|
15445
15505
|
const r = e.getClearColor(new X()), o = e.getClearAlpha();
|
|
15446
15506
|
return {
|
|
@@ -15489,7 +15549,7 @@ class vu {
|
|
|
15489
15549
|
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;
|
|
15490
15550
|
}
|
|
15491
15551
|
}
|
|
15492
|
-
const yu = "shop-components", xu = "0.4.
|
|
15552
|
+
const yu = "shop-components", xu = "0.4.31", wu = "Shop components", bu = "dist/shop-components.umd.js", Au = "dist/shop-components.mjs", Tu = "dist/main.d.ts", Su = {
|
|
15493
15553
|
dts: "tsc --emitDeclarationOnly & tsc & storybook build -o dist",
|
|
15494
15554
|
dev: "vite dev",
|
|
15495
15555
|
build: "vite build",
|