iflow-engine-base 3.11.1 → 3.11.8
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/assets//350/267/263/350/267/263/345/215/241.glb +0 -0
- package/dist/assets//351/227/250/350/264/264.glb +0 -0
- package/dist/bim-engine-sdk.es.js +20 -18
- package/dist/bim-engine-sdk.umd.js +724 -4656
- package/dist/chunks/{engine-2d-olNpwT1j.js → engine-2d-D4gXIdIW.js} +4 -4
- package/dist/chunks/engine-3d-sERn9ZUW.js +16820 -0
- package/dist/chunks/{engine-720-B2c8mBQe.js → engine-720-D2hMdaHQ.js} +13 -13
- package/dist/chunks/{engine-gaussian-BAKXl2qt.js → engine-gaussian-CaHW8cdj.js} +214 -213
- package/dist/chunks/{engine-gis-BXi9CNer.js → engine-gis-Ueesj4oW.js} +3 -3
- package/dist/chunks/{sdk-assets-y5vuEihm.js → sdk-assets-BeBYmpNK.js} +2 -2
- package/dist/chunks/{sdk-runtime-CjCXLGbs.js → sdk-runtime-5ZDRIuju.js} +3 -3
- package/dist/chunks/{sdk-vendor-VNZqYnFS.js → sdk-vendor-CiQO5bhM.js} +1 -1
- package/dist/chunks/{three-vendor-fDCVai2b.js → three-vendor-M4ZIGmaO.js} +91 -89
- package/dist/iflow-engine-base.css +1 -1
- package/dist/index.d.ts +354 -9
- package/dist2d/dwg-preview.es.js +1 -1
- package/dist2d/dwg-preview.umd.js +1 -1
- package/distGaussian/gaussian.es.js +8 -7
- package/distGaussian/gaussian.umd.js +2 -2
- package/package.json +5 -2
- package/dist/chunks/engine-3d-BzQ_DvYN.js +0 -50229
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as Js, C as st, t as Zs, V as
|
|
2
|
-
import { C as Un, c as zn, E as _n, r as Qn } from "./sdk-runtime-
|
|
1
|
+
import { n as Js, C as st, t as Zs, V as v, b as N, O as $s, W as en, M as J, Q as ge, a as tn, f as qt, j as be, B as sn, h as ft, r as it, aP as ze, aQ as Pt, aR as at, X as Bt, aS as ms, aT as yn, aU as xn, aV as In, aW as Tn, U as wn, aX as En, aY as Bn, l as lt, aZ as As, a_ as gs, a$ as vn, k as Cs, b0 as Fn, ax as Je, au as Ss, D as Kt, ak as bn, aO as ys, q as Dn, y as We, b1 as qe, aC as xs, s as Mn, b2 as Rn, a9 as Pn, b3 as On, b4 as nn, aE as Is, b5 as kn, ag as Ln, b6 as Ne, b7 as mt, p as Hn } from "./three-vendor-M4ZIGmaO.js";
|
|
2
|
+
import { C as Un, c as zn, E as _n, r as Qn } from "./sdk-runtime-5ZDRIuju.js";
|
|
3
3
|
var De = /* @__PURE__ */ ((m) => (m.LoadStart = "gaussian-load-start", m.LoadProgress = "gaussian-load-progress", m.Loaded = "gaussian-loaded", m.LoadError = "gaussian-load-error", m.SceneRemoved = "gaussian-scene-removed", m.FpsUpdated = "gaussian-fps-updated", m.ViewChanged = "gaussian-view-changed", m))(De || {});
|
|
4
4
|
class Nn {
|
|
5
5
|
listeners = /* @__PURE__ */ new Map();
|
|
@@ -56,7 +56,7 @@ class Gn {
|
|
|
56
56
|
}
|
|
57
57
|
createCamera(e) {
|
|
58
58
|
const s = Math.max(this.container.clientWidth, 1), t = Math.max(this.container.clientHeight, 1), n = new Zs(65, s / t, 0.1, 5e3);
|
|
59
|
-
return n.position.fromArray(e), n.up.fromArray(this.cameraUp).normalize(), n.lookAt(new
|
|
59
|
+
return n.position.fromArray(e), n.up.fromArray(this.cameraUp).normalize(), n.lookAt(new v().fromArray(this.initialLookAt)), n.updateProjectionMatrix(), n;
|
|
60
60
|
}
|
|
61
61
|
getCamera() {
|
|
62
62
|
return this.camera;
|
|
@@ -65,7 +65,7 @@ class Gn {
|
|
|
65
65
|
this.camera.aspect = Math.max(e, 1) / Math.max(s, 1), this.camera.updateProjectionMatrix();
|
|
66
66
|
}
|
|
67
67
|
reset(e, s) {
|
|
68
|
-
e && this.camera.position.fromArray(e), this.camera.lookAt(new
|
|
68
|
+
e && this.camera.position.fromArray(e), this.camera.lookAt(new v().fromArray(s ?? this.initialLookAt)), this.camera.updateMatrixWorld(!0);
|
|
69
69
|
}
|
|
70
70
|
dispose() {
|
|
71
71
|
this.camera = null;
|
|
@@ -181,7 +181,7 @@ const Ot = (function() {
|
|
|
181
181
|
if (m.geometry && (m.geometry.dispose(), m.geometry = null), m.material && (m.material.dispose(), m.material = null), m.children)
|
|
182
182
|
for (let e of m.children)
|
|
183
183
|
Xe(e);
|
|
184
|
-
},
|
|
184
|
+
}, ve = (m, e) => new Promise((s) => {
|
|
185
185
|
window.setTimeout(() => {
|
|
186
186
|
s(m ? m() : void 0);
|
|
187
187
|
}, e ? 1 : 50);
|
|
@@ -467,7 +467,7 @@ class I {
|
|
|
467
467
|
t && s.applyMatrix4(t);
|
|
468
468
|
}
|
|
469
469
|
getSplatScaleAndRotation = (function() {
|
|
470
|
-
const e = new J(), s = new J(), t = new J(), n = new
|
|
470
|
+
const e = new J(), s = new J(), t = new J(), n = new v(), r = new v(), i = new ge();
|
|
471
471
|
return function(o, a, l, c, d) {
|
|
472
472
|
const u = this.globalSplatIndexToSectionMap[o], h = this.sections[u], f = o - h.splatCountOffset, p = h.bytesPerSplat * f + I.CompressionLevels[this.compressionLevel].ScaleOffsetBytes, A = new DataView(this.bufferData, h.dataBase + p);
|
|
473
473
|
r.set(
|
|
@@ -494,7 +494,7 @@ class I {
|
|
|
494
494
|
fillSplatCenterArray(e, s, t, n, r) {
|
|
495
495
|
const i = this.splatCount;
|
|
496
496
|
t = t || 0, n = n || i - 1, r === void 0 && (r = t);
|
|
497
|
-
const o = new
|
|
497
|
+
const o = new v();
|
|
498
498
|
for (let a = t; a <= n; a++) {
|
|
499
499
|
const l = this.globalSplatIndexToSectionMap[a], c = this.sections[l], d = a - c.splatCountOffset, u = (a - t + r) * I.CenterComponentCount, h = c.bytesPerSplat * d, f = new DataView(this.bufferData, c.dataBase + h), p = K(f, 0, this.compressionLevel), A = K(f, 1, this.compressionLevel), C = K(f, 2, this.compressionLevel);
|
|
500
500
|
if (this.compressionLevel >= 1) {
|
|
@@ -506,7 +506,7 @@ class I {
|
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
fillSplatScaleRotationArray = (function() {
|
|
509
|
-
const e = new J(), s = new J(), t = new J(), n = new
|
|
509
|
+
const e = new J(), s = new J(), t = new J(), n = new v(), r = new ge(), i = new v(), o = (a) => {
|
|
510
510
|
const l = a.w < 0 ? -1 : 1;
|
|
511
511
|
a.x *= l, a.y *= l, a.z *= l, a.w *= l;
|
|
512
512
|
};
|
|
@@ -515,7 +515,7 @@ class I {
|
|
|
515
515
|
d = d || 0, u = u || A - 1, h === void 0 && (h = d);
|
|
516
516
|
const C = (g, x) => Xn(g, x, f);
|
|
517
517
|
for (let g = d; g <= u; g++) {
|
|
518
|
-
const x = this.globalSplatIndexToSectionMap[g], w = this.sections[x], y = g - w.splatCountOffset, E = w.bytesPerSplat * y + I.CompressionLevels[this.compressionLevel].ScaleOffsetBytes, S = (g - d + h) * I.ScaleComponentCount,
|
|
518
|
+
const x = this.globalSplatIndexToSectionMap[g], w = this.sections[x], y = g - w.splatCountOffset, E = w.bytesPerSplat * y + I.CompressionLevels[this.compressionLevel].ScaleOffsetBytes, S = (g - d + h) * I.ScaleComponentCount, B = (g - d + h) * I.RotationComponentCount, F = new DataView(this.bufferData, w.dataBase + E), D = p && p.x !== void 0 ? p.x : K(F, 0, this.compressionLevel), b = p && p.y !== void 0 ? p.y : K(F, 1, this.compressionLevel), R = p && p.z !== void 0 ? p.z : K(F, 2, this.compressionLevel), k = K(F, 3, this.compressionLevel), M = K(F, 4, this.compressionLevel), O = K(F, 5, this.compressionLevel), L = K(F, 6, this.compressionLevel);
|
|
519
519
|
n.set(
|
|
520
520
|
re(D, this.compressionLevel),
|
|
521
521
|
re(b, this.compressionLevel),
|
|
@@ -525,7 +525,7 @@ class I {
|
|
|
525
525
|
re(O, this.compressionLevel),
|
|
526
526
|
re(L, this.compressionLevel),
|
|
527
527
|
re(k, this.compressionLevel)
|
|
528
|
-
).normalize(), c && (i.set(0, 0, 0), e.makeScale(n.x, n.y, n.z), s.makeRotationFromQuaternion(r), t.identity().premultiply(e).premultiply(s), t.premultiply(c), t.decompose(i, r, n), r.normalize()), o(r), a && (a[S] = C(n.x, 0), a[S + 1] = C(n.y, 0), a[S + 2] = C(n.z, 0)), l && (l[
|
|
528
|
+
).normalize(), c && (i.set(0, 0, 0), e.makeScale(n.x, n.y, n.z), s.makeRotationFromQuaternion(r), t.identity().premultiply(e).premultiply(s), t.premultiply(c), t.decompose(i, r, n), r.normalize()), o(r), a && (a[S] = C(n.x, 0), a[S + 1] = C(n.y, 0), a[S + 2] = C(n.z, 0)), l && (l[B] = C(r.x, 0), l[B + 1] = C(r.y, 0), l[B + 2] = C(r.z, 0), l[B + 3] = C(r.w, 0));
|
|
529
529
|
}
|
|
530
530
|
};
|
|
531
531
|
})();
|
|
@@ -536,7 +536,7 @@ class I {
|
|
|
536
536
|
};
|
|
537
537
|
})();
|
|
538
538
|
fillSplatCovarianceArray(e, s, t, n, r, i) {
|
|
539
|
-
const o = this.splatCount, a = new
|
|
539
|
+
const o = this.splatCount, a = new v(), l = new ge();
|
|
540
540
|
t = t || 0, n = n || o - 1, r === void 0 && (r = t);
|
|
541
541
|
for (let c = t; c <= n; c++) {
|
|
542
542
|
const d = this.globalSplatIndexToSectionMap[c], u = this.sections[d], h = c - u.splatCountOffset, f = (c - t + r) * I.CovarianceComponentCount, p = u.bytesPerSplat * h + I.CompressionLevels[this.compressionLevel].ScaleOffsetBytes, A = new DataView(this.bufferData, u.dataBase + p);
|
|
@@ -563,8 +563,8 @@ class I {
|
|
|
563
563
|
}
|
|
564
564
|
fillSphericalHarmonicsArray = (function() {
|
|
565
565
|
for (let M = 0; M < 15; M++)
|
|
566
|
-
new
|
|
567
|
-
const e = new Ne(), s = new J(), t = new
|
|
566
|
+
new v();
|
|
567
|
+
const e = new Ne(), s = new J(), t = new v(), n = new v(), r = new ge(), i = [], o = [], a = [], l = [], c = [], d = [], u = [], h = [], f = [], p = [], A = [], C = [], g = [], x = [], w = [], y = [], E = [], S = [], B = (M) => M, F = (M, O, L, U) => {
|
|
568
568
|
M[0] = O, M[1] = L, M[2] = U;
|
|
569
569
|
}, D = (M, O, L, U, _) => {
|
|
570
570
|
M[0] = K(O, U, _, !0), M[1] = K(O, U + L, _, !0), M[2] = K(O, U + L + L, _, !0);
|
|
@@ -581,7 +581,7 @@ class I {
|
|
|
581
581
|
const Z = this.globalSplatIndexToSectionMap[se], G = this.sections[Z];
|
|
582
582
|
O = Math.min(O, G.sphericalHarmonicsDegree);
|
|
583
583
|
const X = $e(O), ce = se - G.splatCountOffset, de = G.bytesPerSplat * ce + I.CompressionLevels[this.compressionLevel].SphericalHarmonicsOffsetBytes, ie = new DataView(this.bufferData, G.dataBase + de), Se = (se - U + H) * X;
|
|
584
|
-
let pe = L ? 0 : this.compressionLevel, ne =
|
|
584
|
+
let pe = L ? 0 : this.compressionLevel, ne = B;
|
|
585
585
|
pe !== Q && (pe === 1 ? Q === 0 ? ne = Xt : Q == 2 && (ne = le) : pe === 0 && (Q === 1 ? ne = Ae : Q == 2 && (ne = V)));
|
|
586
586
|
const fe = this.minSphericalHarmonicsCoeff, $ = this.maxSphericalHarmonicsCoeff;
|
|
587
587
|
O >= 1 && (D(f, ie, 3, 0, this.compressionLevel), D(p, ie, 3, 1, this.compressionLevel), D(A, ie, 3, 2, this.compressionLevel), L ? (k(f, f, this.compressionLevel, fe, $), k(p, p, this.compressionLevel, fe, $), k(A, A, this.compressionLevel, fe, $), I.rotateSphericalHarmonics3(f, p, A, i, o, a, x, w, y)) : (b(f, x), b(p, w), b(A, y)), R(x, M, Se, ne), R(w, M, Se + 3, ne), R(y, M, Se + 6, ne), O >= 2 && (D(f, ie, 5, 9, this.compressionLevel), D(p, ie, 5, 10, this.compressionLevel), D(A, ie, 5, 11, this.compressionLevel), D(C, ie, 5, 12, this.compressionLevel), D(g, ie, 5, 13, this.compressionLevel), L ? (k(f, f, this.compressionLevel, fe, $), k(p, p, this.compressionLevel, fe, $), k(A, A, this.compressionLevel, fe, $), k(C, C, this.compressionLevel, fe, $), k(g, g, this.compressionLevel, fe, $), I.rotateSphericalHarmonics5(
|
|
@@ -628,7 +628,7 @@ class I {
|
|
|
628
628
|
l[0] = x * (a[2] * i[0] + a[0] * i[2] + (i[2] * a[0] + i[0] * a[2])), l[1] = a[1] * i[0] + i[1] * a[0], l[2] = w * (a[1] * i[1] + i[1] * a[1]), l[3] = a[1] * i[2] + i[1] * a[2], l[4] = x * (a[2] * i[2] - a[0] * i[0] + (i[2] * a[2] - i[0] * a[0])), I.dot5(e, s, t, n, r, l, f), c[0] = x * (o[2] * i[0] + o[0] * i[2] + (i[2] * o[0] + i[0] * o[2])), c[1] = o[1] * i[0] + i[1] * o[0], c[2] = w * (o[1] * i[1] + i[1] * o[1]), c[3] = o[1] * i[2] + i[1] * o[2], c[4] = x * (o[2] * i[2] - o[0] * i[0] + (i[2] * o[2] - i[0] * o[0])), I.dot5(e, s, t, n, r, c, p), d[0] = y * (o[2] * o[0] + o[0] * o[2]) + -S * (a[2] * a[0] + a[0] * a[2] + (i[2] * i[0] + i[0] * i[2])), d[1] = E * o[1] * o[0] + -y * (a[1] * a[0] + i[1] * i[0]), d[2] = o[1] * o[1] + -x * (a[1] * a[1] + i[1] * i[1]), d[3] = E * o[1] * o[2] + -y * (a[1] * a[2] + i[1] * i[2]), d[4] = y * (o[2] * o[2] - o[0] * o[0]) + -S * (a[2] * a[2] - a[0] * a[0] + (i[2] * i[2] - i[0] * i[0])), I.dot5(e, s, t, n, r, d, A), u[0] = x * (o[2] * a[0] + o[0] * a[2] + (a[2] * o[0] + a[0] * o[2])), u[1] = o[1] * a[0] + a[1] * o[0], u[2] = w * (o[1] * a[1] + a[1] * o[1]), u[3] = o[1] * a[2] + a[1] * o[2], u[4] = x * (o[2] * a[2] - o[0] * a[0] + (a[2] * o[2] - a[0] * o[0])), I.dot5(e, s, t, n, r, u, C), h[0] = x * (a[2] * a[0] + a[0] * a[2] - (i[2] * i[0] + i[0] * i[2])), h[1] = a[1] * a[0] - i[1] * i[0], h[2] = w * (a[1] * a[1] - i[1] * i[1]), h[3] = a[1] * a[2] - i[1] * i[2], h[4] = x * (a[2] * a[2] - a[0] * a[0] - (i[2] * i[2] - i[0] * i[0])), I.dot5(e, s, t, n, r, h, g);
|
|
629
629
|
};
|
|
630
630
|
static parseHeader(e) {
|
|
631
|
-
const s = new Uint8Array(e, 0, I.HeaderSizeBytes), t = new Uint16Array(e, 0, I.HeaderSizeBytes / 2), n = new Uint32Array(e, 0, I.HeaderSizeBytes / 4), r = new Float32Array(e, 0, I.HeaderSizeBytes / 4), i = s[0], o = s[1], a = n[1], l = n[2], c = n[3], d = n[4], u = t[10], h = new
|
|
631
|
+
const s = new Uint8Array(e, 0, I.HeaderSizeBytes), t = new Uint16Array(e, 0, I.HeaderSizeBytes / 2), n = new Uint32Array(e, 0, I.HeaderSizeBytes / 4), r = new Float32Array(e, 0, I.HeaderSizeBytes / 4), i = s[0], o = s[1], a = n[1], l = n[2], c = n[3], d = n[4], u = t[10], h = new v(r[6], r[7], r[8]), f = r[9] || -_e, p = r[10] || _e;
|
|
632
632
|
return {
|
|
633
633
|
versionMajor: i,
|
|
634
634
|
versionMinor: o,
|
|
@@ -654,7 +654,7 @@ class I {
|
|
|
654
654
|
const r = e.compressionLevel, i = e.maxSectionCount, o = new Uint16Array(s, t, i * I.SectionHeaderSizeBytes / 2), a = new Uint32Array(s, t, i * I.SectionHeaderSizeBytes / 4), l = new Float32Array(s, t, i * I.SectionHeaderSizeBytes / 4), c = [];
|
|
655
655
|
let d = 0, u = d / 2, h = d / 4, f = I.HeaderSizeBytes + e.maxSectionCount * I.SectionHeaderSizeBytes, p = 0;
|
|
656
656
|
for (let A = 0; A < i; A++) {
|
|
657
|
-
const C = a[h + 1], g = a[h + 2], x = a[h + 3], w = l[h + 4], y = w / 2, E = o[u + 10], S = a[h + 6] || I.CompressionLevels[r].ScaleRange,
|
|
657
|
+
const C = a[h + 1], g = a[h + 2], x = a[h + 3], w = l[h + 4], y = w / 2, E = o[u + 10], S = a[h + 6] || I.CompressionLevels[r].ScaleRange, B = a[h + 8], F = a[h + 9], D = F * 4, b = E * x + D, R = o[u + 20], { bytesPerSplat: k } = I.calculateComponentStorage(r, R), M = k * C, O = M + b, L = {
|
|
658
658
|
bytesPerSplat: k,
|
|
659
659
|
splatCountOffset: p,
|
|
660
660
|
splatCount: n ? C : 0,
|
|
@@ -672,7 +672,7 @@ class I {
|
|
|
672
672
|
base: f,
|
|
673
673
|
bucketsBase: f + D,
|
|
674
674
|
dataBase: f + b,
|
|
675
|
-
fullBucketCount:
|
|
675
|
+
fullBucketCount: B,
|
|
676
676
|
partiallyFilledBucketCount: F,
|
|
677
677
|
sphericalHarmonicsDegree: R
|
|
678
678
|
};
|
|
@@ -691,7 +691,7 @@ class I {
|
|
|
691
691
|
constructFromBuffer(e, s) {
|
|
692
692
|
this.bufferData = e, this.globalSplatIndexToLocalSplatIndexMap = [], this.globalSplatIndexToSectionMap = [];
|
|
693
693
|
const t = I.parseHeader(this.bufferData);
|
|
694
|
-
this.versionMajor = t.versionMajor, this.versionMinor = t.versionMinor, this.maxSectionCount = t.maxSectionCount, this.sectionCount = s ? t.maxSectionCount : 0, this.maxSplatCount = t.maxSplatCount, this.splatCount = s ? t.maxSplatCount : 0, this.compressionLevel = t.compressionLevel, this.sceneCenter = new
|
|
694
|
+
this.versionMajor = t.versionMajor, this.versionMinor = t.versionMinor, this.maxSectionCount = t.maxSectionCount, this.sectionCount = s ? t.maxSectionCount : 0, this.maxSplatCount = t.maxSplatCount, this.splatCount = s ? t.maxSplatCount : 0, this.compressionLevel = t.compressionLevel, this.sceneCenter = new v().copy(t.sceneCenter), this.minSphericalHarmonicsCoeff = t.minSphericalHarmonicsCoeff, this.maxSphericalHarmonicsCoeff = t.maxSphericalHarmonicsCoeff, this.sections = I.parseSectionHeaders(t, this.bufferData, I.HeaderSizeBytes, s), this.linkBufferArrays(), this.buildMaps();
|
|
695
695
|
}
|
|
696
696
|
static calculateComponentStorage(e, s) {
|
|
697
697
|
const t = I.CompressionLevels[e].BytesPerCenter, n = I.CompressionLevels[e].BytesPerScale, r = I.CompressionLevels[e].BytesPerRotation, i = I.CompressionLevels[e].BytesPerColor, o = $e(s), a = I.CompressionLevels[e].BytesPerSphericalHarmonicsComponent * o, l = t + n + r + i + a;
|
|
@@ -738,7 +738,7 @@ class I {
|
|
|
738
738
|
I.writeSectionHeaderSplatCountToBuffer(s, this.bufferData, t), this.sections[e].splatCount = s;
|
|
739
739
|
}
|
|
740
740
|
static writeSplatDataToSectionBuffer = (function() {
|
|
741
|
-
const e = new ArrayBuffer(12), s = new ArrayBuffer(12), t = new ArrayBuffer(16), n = new ArrayBuffer(4), r = new ArrayBuffer(256), i = new ge(), o = new
|
|
741
|
+
const e = new ArrayBuffer(12), s = new ArrayBuffer(12), t = new ArrayBuffer(16), n = new ArrayBuffer(4), r = new ArrayBuffer(256), i = new ge(), o = new v(), a = new v(), {
|
|
742
742
|
X: l,
|
|
743
743
|
Y: c,
|
|
744
744
|
Z: d,
|
|
@@ -754,7 +754,7 @@ class I {
|
|
|
754
754
|
FDC2: y,
|
|
755
755
|
OPACITY: E,
|
|
756
756
|
FRC0: S,
|
|
757
|
-
FRC9:
|
|
757
|
+
FRC9: B
|
|
758
758
|
} = P.OFFSET, F = (D, b, R) => {
|
|
759
759
|
const k = R * 2 + 1;
|
|
760
760
|
return D = Math.round(D * b) + R, oe(D, 0, k);
|
|
@@ -772,7 +772,7 @@ class I {
|
|
|
772
772
|
if (M >= 1) {
|
|
773
773
|
for (let $ = 0; $ < 9; $++) fe[$] = D[S + $] || 0;
|
|
774
774
|
if (M >= 2)
|
|
775
|
-
for (let $ = 0; $ < 15; $++) fe[$ + 9] = D[
|
|
775
|
+
for (let $ = 0; $ < 15; $++) fe[$ + 9] = D[B + $] || 0;
|
|
776
776
|
}
|
|
777
777
|
}
|
|
778
778
|
} else {
|
|
@@ -787,7 +787,7 @@ class I {
|
|
|
787
787
|
const Me = 9 * $;
|
|
788
788
|
if (je(Fe.buffer, 0, b, de, Me), M >= 2) {
|
|
789
789
|
for (let Ce = 0; Ce < 15; Ce++) {
|
|
790
|
-
const we = D[
|
|
790
|
+
const we = D[B + Ce] || 0;
|
|
791
791
|
Fe[Ce + 9] = k === 1 ? Ae(we) : ct(we, _, H);
|
|
792
792
|
}
|
|
793
793
|
je(
|
|
@@ -816,9 +816,9 @@ class I {
|
|
|
816
816
|
for (let y = 0; y < e.length; y++) {
|
|
817
817
|
const E = e[y];
|
|
818
818
|
for (let S = 0; S < E.splats.length; S++) {
|
|
819
|
-
const
|
|
820
|
-
for (let F = P.OFFSET.FRC0; F < P.OFFSET.FRC23 && F <
|
|
821
|
-
(!l ||
|
|
819
|
+
const B = E.splats[S];
|
|
820
|
+
for (let F = P.OFFSET.FRC0; F < P.OFFSET.FRC23 && F < B.length; F++)
|
|
821
|
+
(!l || B[F] < l) && (l = B[F]), (!c || B[F] > c) && (c = B[F]);
|
|
822
822
|
}
|
|
823
823
|
}
|
|
824
824
|
l = l || -_e, c = c || _e;
|
|
@@ -830,7 +830,7 @@ class I {
|
|
|
830
830
|
const G = E.splats[Z];
|
|
831
831
|
(G[P.OFFSET.OPACITY] || 0) >= s && S.addSplat(G);
|
|
832
832
|
}
|
|
833
|
-
const
|
|
833
|
+
const B = o[y] || {}, F = (B.blockSizeFactor || 1) * (r || I.BucketBlockSize), D = Math.ceil((B.bucketSizeFactor || 1) * (i || I.BucketSize)), b = I.computeBucketsForUncompressedSplatArray(S, F, D), R = b.fullBuckets.length, k = b.partiallyFullBuckets.map((Z) => Z.splats.length), M = k.length, O = [...b.fullBuckets, ...b.partiallyFullBuckets], L = S.splats.length * d, U = M * 4, _ = t >= 1 ? O.length * I.BucketStorageSizeBytes + U : 0, H = L + _, Q = new ArrayBuffer(H), ee = u / (F * 0.5), le = new v();
|
|
834
834
|
let V = 0;
|
|
835
835
|
for (let Z = 0; Z < O.length; Z++) {
|
|
836
836
|
const G = O[Z];
|
|
@@ -905,7 +905,7 @@ class I {
|
|
|
905
905
|
}
|
|
906
906
|
static computeBucketsForUncompressedSplatArray(e, s, t) {
|
|
907
907
|
let n = e.splatCount;
|
|
908
|
-
const r = s / 2, i = new
|
|
908
|
+
const r = s / 2, i = new v(), o = new v();
|
|
909
909
|
for (let p = 0; p < n; p++) {
|
|
910
910
|
const A = e.splats[p], C = [
|
|
911
911
|
A[P.OFFSET.X],
|
|
@@ -914,7 +914,7 @@ class I {
|
|
|
914
914
|
];
|
|
915
915
|
(p === 0 || C[0] < i.x) && (i.x = C[0]), (p === 0 || C[0] > o.x) && (o.x = C[0]), (p === 0 || C[1] < i.y) && (i.y = C[1]), (p === 0 || C[1] > o.y) && (o.y = C[1]), (p === 0 || C[2] < i.z) && (i.z = C[2]), (p === 0 || C[2] > o.z) && (o.z = C[2]);
|
|
916
916
|
}
|
|
917
|
-
const a = new
|
|
917
|
+
const a = new v().copy(o).sub(i), l = Math.ceil(a.y / s), c = Math.ceil(a.z / s), d = new v(), u = [], h = {};
|
|
918
918
|
for (let p = 0; p < n; p++) {
|
|
919
919
|
const A = e.splats[p], C = [
|
|
920
920
|
A[P.OFFSET.X],
|
|
@@ -950,7 +950,7 @@ class I {
|
|
|
950
950
|
maxSplatCount: e,
|
|
951
951
|
splatCount: e,
|
|
952
952
|
compressionLevel: 0,
|
|
953
|
-
sceneCenter: new
|
|
953
|
+
sceneCenter: new v()
|
|
954
954
|
}, i), I.writeSectionHeaderToBuffer({
|
|
955
955
|
maxSplatCount: e,
|
|
956
956
|
splatCount: e,
|
|
@@ -1160,7 +1160,7 @@ class W {
|
|
|
1160
1160
|
static getElementStorageArrays(e, s, t) {
|
|
1161
1161
|
const n = {};
|
|
1162
1162
|
if (s) {
|
|
1163
|
-
const r = ae(e, "min_r"), i = ae(e, "min_g"), o = ae(e, "min_b"), a = ae(e, "max_r"), l = ae(e, "max_g"), c = ae(e, "max_b"), d = ae(e, "min_x"), u = ae(e, "min_y"), h = ae(e, "min_z"), f = ae(e, "max_x"), p = ae(e, "max_y"), A = ae(e, "max_z"), C = ae(e, "min_scale_x"), g = ae(e, "min_scale_y"), x = ae(e, "min_scale_z"), w = ae(e, "max_scale_x"), y = ae(e, "max_scale_y"), E = ae(e, "max_scale_z"), S = ae(s, "packed_position"),
|
|
1163
|
+
const r = ae(e, "min_r"), i = ae(e, "min_g"), o = ae(e, "min_b"), a = ae(e, "max_r"), l = ae(e, "max_g"), c = ae(e, "max_b"), d = ae(e, "min_x"), u = ae(e, "min_y"), h = ae(e, "min_z"), f = ae(e, "max_x"), p = ae(e, "max_y"), A = ae(e, "max_z"), C = ae(e, "min_scale_x"), g = ae(e, "min_scale_y"), x = ae(e, "min_scale_z"), w = ae(e, "max_scale_x"), y = ae(e, "max_scale_y"), E = ae(e, "max_scale_z"), S = ae(s, "packed_position"), B = ae(s, "packed_rotation"), F = ae(s, "packed_scale"), D = ae(s, "packed_color");
|
|
1164
1164
|
n.colorExtremes = {
|
|
1165
1165
|
minR: r,
|
|
1166
1166
|
maxR: a,
|
|
@@ -1182,7 +1182,7 @@ class W {
|
|
|
1182
1182
|
maxScaleY: y,
|
|
1183
1183
|
minScaleZ: x,
|
|
1184
1184
|
maxScaleZ: E
|
|
1185
|
-
}, n.position = S, n.rotation =
|
|
1185
|
+
}, n.position = S, n.rotation = B, n.scale = F, n.color = D;
|
|
1186
1186
|
}
|
|
1187
1187
|
if (t) {
|
|
1188
1188
|
const r = {};
|
|
@@ -1198,7 +1198,7 @@ class W {
|
|
|
1198
1198
|
return n;
|
|
1199
1199
|
}
|
|
1200
1200
|
static decompressBaseSplat = (function() {
|
|
1201
|
-
const e = new
|
|
1201
|
+
const e = new v(), s = new ge(), t = new v(), n = new qt(), r = P.OFFSET;
|
|
1202
1202
|
return function(i, o, a, l, c, d, u, h, f, p) {
|
|
1203
1203
|
p = p || P.createSplat();
|
|
1204
1204
|
const A = Math.floor((o + i) / 256);
|
|
@@ -1398,7 +1398,7 @@ const Ie = {
|
|
|
1398
1398
|
ts,
|
|
1399
1399
|
ss,
|
|
1400
1400
|
ns
|
|
1401
|
-
] = [0, 1, 2, 3, 4, 5, 6],
|
|
1401
|
+
] = [0, 1, 2, 3, 4, 5, 6], Bs = {
|
|
1402
1402
|
double: ln,
|
|
1403
1403
|
int: Zt,
|
|
1404
1404
|
uint: $t,
|
|
@@ -1443,7 +1443,7 @@ class q {
|
|
|
1443
1443
|
u.push(y);
|
|
1444
1444
|
const E = s[y];
|
|
1445
1445
|
h[y] = w;
|
|
1446
|
-
const S =
|
|
1446
|
+
const S = Bs[w];
|
|
1447
1447
|
E !== void 0 && (c.push(E), d[E] = S);
|
|
1448
1448
|
}
|
|
1449
1449
|
}
|
|
@@ -1461,7 +1461,7 @@ class q {
|
|
|
1461
1461
|
const x = s[C];
|
|
1462
1462
|
x !== void 0 && (f[x] = p);
|
|
1463
1463
|
}
|
|
1464
|
-
p += $n[
|
|
1464
|
+
p += $n[Bs[g]];
|
|
1465
1465
|
}
|
|
1466
1466
|
const A = q.decodeSphericalHarmonicsFromSectionHeader(u, s);
|
|
1467
1467
|
return {
|
|
@@ -1607,7 +1607,7 @@ const cn = [
|
|
|
1607
1607
|
"blue",
|
|
1608
1608
|
"f_rest_0"
|
|
1609
1609
|
], er = cn.map((m, e) => e), [
|
|
1610
|
-
|
|
1610
|
+
vs,
|
|
1611
1611
|
tr,
|
|
1612
1612
|
sr,
|
|
1613
1613
|
nr,
|
|
@@ -1715,16 +1715,16 @@ class xe {
|
|
|
1715
1715
|
return function(g, x, w, y = 0, E = 0) {
|
|
1716
1716
|
E = Math.min(E, w.sphericalHarmonicsDegree), xe.readSplat(g, w, x, y, e);
|
|
1717
1717
|
const S = P.createSplat(E);
|
|
1718
|
-
if (e[
|
|
1719
|
-
const
|
|
1720
|
-
S[h] = (0.5 +
|
|
1718
|
+
if (e[vs] !== void 0 ? (S[i] = Math.exp(e[vs]), S[o] = Math.exp(e[tr]), S[a] = Math.exp(e[sr])) : (S[i] = 0.01, S[o] = 0.01, S[a] = 0.01), e[Fs] !== void 0) {
|
|
1719
|
+
const B = 0.28209479177387814;
|
|
1720
|
+
S[h] = (0.5 + B * e[Fs]) * 255, S[f] = (0.5 + B * e[dr]) * 255, S[p] = (0.5 + B * e[hr]) * 255;
|
|
1721
1721
|
} else e[Ds] !== void 0 ? (S[h] = e[Ds] * 255, S[f] = e[ur] * 255, S[p] = e[pr] * 255) : (S[h] = 0, S[f] = 0, S[p] = 0);
|
|
1722
1722
|
if (e[bs] !== void 0 && (S[A] = 1 / (1 + Math.exp(-e[bs])) * 255), S[h] = oe(Math.floor(S[h]), 0, 255), S[f] = oe(Math.floor(S[f]), 0, 255), S[p] = oe(Math.floor(S[p]), 0, 255), S[A] = oe(Math.floor(S[A]), 0, 255), E >= 1 && e[fr] !== void 0) {
|
|
1723
|
-
for (let
|
|
1724
|
-
S[C[
|
|
1723
|
+
for (let B = 0; B < 9; B++)
|
|
1724
|
+
S[C[B]] = e[w.sphericalHarmonicsDegree1Fields[B]];
|
|
1725
1725
|
if (E >= 2)
|
|
1726
|
-
for (let
|
|
1727
|
-
S[C[9 +
|
|
1726
|
+
for (let B = 0; B < 15; B++)
|
|
1727
|
+
S[C[9 + B]] = e[w.sphericalHarmonicsDegree2Fields[B]];
|
|
1728
1728
|
}
|
|
1729
1729
|
return s.set(e[nr], e[rr], e[or], e[ir]), s.normalize(), S[l] = s.x, S[c] = s.y, S[d] = s.z, S[u] = s.w, S[t] = e[ar], S[n] = e[lr], S[r] = e[cr], S;
|
|
1730
1730
|
};
|
|
@@ -1852,16 +1852,16 @@ const dn = [
|
|
|
1852
1852
|
Tr,
|
|
1853
1853
|
wr,
|
|
1854
1854
|
Er,
|
|
1855
|
-
|
|
1855
|
+
Br,
|
|
1856
1856
|
Wt,
|
|
1857
1857
|
un,
|
|
1858
1858
|
pn,
|
|
1859
1859
|
Os
|
|
1860
|
-
] = Gt, ks = Wt,
|
|
1860
|
+
] = Gt, ks = Wt, vr = un, Fr = pn, It = (m) => {
|
|
1861
1861
|
const e = (31744 & m) >> 10, s = 1023 & m;
|
|
1862
1862
|
return (m >> 15 ? -1 : 1) * (e ? e === 31 ? s ? NaN : 1 / 0 : Math.pow(2, e - 15) * (1 + s / 1024) : s / 1024 * 6103515625e-14);
|
|
1863
1863
|
};
|
|
1864
|
-
class
|
|
1864
|
+
class Be {
|
|
1865
1865
|
static decodeSectionHeadersFromHeaderLines(e) {
|
|
1866
1866
|
const s = Gt.reduce((c, d) => (c[hn[d]] = d, c), {}), t = St.reduce((c, d) => (c[dn[d]] = d, c), {}), n = q.getHeaderSectionNames(e);
|
|
1867
1867
|
let r;
|
|
@@ -1878,7 +1878,7 @@ class ve {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
static decodeSectionHeadersFromHeaderText(e) {
|
|
1880
1880
|
const s = q.convertHeaderTextToLines(e);
|
|
1881
|
-
return
|
|
1881
|
+
return Be.decodeSectionHeadersFromHeaderLines(s);
|
|
1882
1882
|
}
|
|
1883
1883
|
static getSplatCountFromSectionHeaders(e) {
|
|
1884
1884
|
let s = 0;
|
|
@@ -1887,7 +1887,7 @@ class ve {
|
|
|
1887
1887
|
return s;
|
|
1888
1888
|
}
|
|
1889
1889
|
static decodeHeaderFromHeaderText(e) {
|
|
1890
|
-
const s = e.indexOf(q.HeaderEndToken) + q.HeaderEndToken.length + 1, t =
|
|
1890
|
+
const s = e.indexOf(q.HeaderEndToken) + q.HeaderEndToken.length + 1, t = Be.decodeSectionHeadersFromHeaderText(e), n = Be.getSplatCountFromSectionHeaders(t);
|
|
1891
1891
|
return {
|
|
1892
1892
|
headerSizeBytes: s,
|
|
1893
1893
|
sectionHeaders: t,
|
|
@@ -1896,7 +1896,7 @@ class ve {
|
|
|
1896
1896
|
}
|
|
1897
1897
|
static decodeHeaderFromBuffer(e) {
|
|
1898
1898
|
const s = q.readHeaderFromBuffer(e);
|
|
1899
|
-
return
|
|
1899
|
+
return Be.decodeHeaderFromHeaderText(s);
|
|
1900
1900
|
}
|
|
1901
1901
|
static findVertexData(e, s, t) {
|
|
1902
1902
|
let n = s.headerSizeBytes;
|
|
@@ -1929,7 +1929,7 @@ class ve {
|
|
|
1929
1929
|
r = Math.min(r, t.sphericalHarmonicsDegree);
|
|
1930
1930
|
const i = new P(r);
|
|
1931
1931
|
for (let o = 0; o < s; o++) {
|
|
1932
|
-
const a =
|
|
1932
|
+
const a = Be.parseToUncompressedSplat(
|
|
1933
1933
|
e,
|
|
1934
1934
|
o,
|
|
1935
1935
|
t,
|
|
@@ -1947,40 +1947,40 @@ class ve {
|
|
|
1947
1947
|
for (let g = 0; g < 45; g++)
|
|
1948
1948
|
C[g] = P.OFFSET.FRC0 + g;
|
|
1949
1949
|
return function(g, x, w, y, E = 0, S = 0) {
|
|
1950
|
-
S = Math.min(S, w.sphericalHarmonicsDegree),
|
|
1951
|
-
const
|
|
1952
|
-
if (e[Ps] !== void 0 ? (
|
|
1950
|
+
S = Math.min(S, w.sphericalHarmonicsDegree), Be.readSplat(g, w, x, E, e);
|
|
1951
|
+
const B = P.createSplat(S);
|
|
1952
|
+
if (e[Ps] !== void 0 ? (B[i] = y[xt][e[Ps]], B[o] = y[xt][e[Cr]], B[a] = y[xt][e[Sr]]) : (B[i] = 0.01, B[o] = 0.01, B[a] = 0.01), e[Wt] !== void 0 ? (B[h] = y[yt][e[Wt]], B[f] = y[yt][e[un]], B[p] = y[yt][e[pn]]) : e[ks] !== void 0 ? (B[h] = e[ks] * 255, B[f] = e[vr] * 255, B[p] = e[Fr] * 255) : (B[h] = 0, B[f] = 0, B[p] = 0), e[Os] !== void 0 && (B[A] = y[Rs][e[Os]]), B[h] = oe(Math.floor(B[h]), 0, 255), B[f] = oe(Math.floor(B[f]), 0, 255), B[p] = oe(Math.floor(B[p]), 0, 255), B[A] = oe(Math.floor(B[A]), 0, 255), S >= 1 && w.sphericalHarmonicsDegree >= 1) {
|
|
1953
1953
|
for (let k = 0; k < 9; k++) {
|
|
1954
1954
|
const M = y[mr + k % 3];
|
|
1955
|
-
|
|
1955
|
+
B[C[k]] = M[e[w.sphericalHarmonicsDegree1Fields[k]]];
|
|
1956
1956
|
}
|
|
1957
1957
|
if (S >= 2 && w.sphericalHarmonicsDegree >= 2)
|
|
1958
1958
|
for (let k = 0; k < 15; k++) {
|
|
1959
1959
|
const M = y[Ar + k % 5];
|
|
1960
|
-
|
|
1960
|
+
B[C[9 + k]] = M[e[w.sphericalHarmonicsDegree2Fields[k]]];
|
|
1961
1961
|
}
|
|
1962
1962
|
}
|
|
1963
1963
|
const F = y[gr][e[yr]], D = y[Ut][e[xr]], b = y[Ut][e[Ir]], R = y[Ut][e[Tr]];
|
|
1964
|
-
return s.set(F, D, b, R), s.normalize(),
|
|
1964
|
+
return s.set(F, D, b, R), s.normalize(), B[l] = s.x, B[c] = s.y, B[d] = s.z, B[u] = s.w, B[t] = It(e[wr]), B[n] = It(e[Er]), B[r] = It(e[Br]), B;
|
|
1965
1965
|
};
|
|
1966
1966
|
})();
|
|
1967
1967
|
static readSplat(e, s, t, n, r) {
|
|
1968
1968
|
return q.readVertex(e, s, t, n, Gt, r, !1);
|
|
1969
1969
|
}
|
|
1970
1970
|
static parseToUncompressedSplatArray(e, s = 0) {
|
|
1971
|
-
const t = [], n =
|
|
1971
|
+
const t = [], n = Be.decodeHeaderFromBuffer(e, s);
|
|
1972
1972
|
let r;
|
|
1973
1973
|
for (let o = 0; o < n.sectionHeaders.length; o++) {
|
|
1974
1974
|
const a = n.sectionHeaders[o];
|
|
1975
1975
|
if (a.sectionName === "codebook_centers") {
|
|
1976
|
-
const l =
|
|
1977
|
-
r =
|
|
1976
|
+
const l = Be.findVertexData(e, n, o);
|
|
1977
|
+
r = Be.decodeCodeBook(l, a);
|
|
1978
1978
|
}
|
|
1979
1979
|
}
|
|
1980
1980
|
for (let o = 0; o < n.sectionHeaders.length; o++) {
|
|
1981
1981
|
const a = n.sectionHeaders[o];
|
|
1982
1982
|
if (a.sectionName !== "codebook_centers") {
|
|
1983
|
-
const l = a.vertexCount, c =
|
|
1983
|
+
const l = a.vertexCount, c = Be.findVertexData(e, n, o), d = Be.decodeSectionSplatData(
|
|
1984
1984
|
c,
|
|
1985
1985
|
l,
|
|
1986
1986
|
a,
|
|
@@ -2005,7 +2005,7 @@ class Ls {
|
|
|
2005
2005
|
if (t === Ie.INRIAV1)
|
|
2006
2006
|
return xe.parseToUncompressedSplatArray(e, s);
|
|
2007
2007
|
if (t === Ie.INRIAV2)
|
|
2008
|
-
return
|
|
2008
|
+
return Be.parseToUncompressedSplatArray(e, s);
|
|
2009
2009
|
}
|
|
2010
2010
|
static parseToUncompressedSplatBuffer(e, s = 0) {
|
|
2011
2011
|
const t = q.determineHeaderFormatFromPlyBuffer(e);
|
|
@@ -2040,11 +2040,11 @@ class rs {
|
|
|
2040
2040
|
parameters: s
|
|
2041
2041
|
};
|
|
2042
2042
|
}
|
|
2043
|
-
static getStandardPartitioner(e = 0, s = new
|
|
2043
|
+
static getStandardPartitioner(e = 0, s = new v(), t = I.BucketBlockSize, n = I.BucketSize) {
|
|
2044
2044
|
const r = (i) => {
|
|
2045
2045
|
const o = P.OFFSET.X, a = P.OFFSET.Y, l = P.OFFSET.Z;
|
|
2046
2046
|
e <= 0 && (e = i.splatCount);
|
|
2047
|
-
const c = new
|
|
2047
|
+
const c = new v(), d = 0.5, u = (C) => {
|
|
2048
2048
|
C.x = Math.floor(C.x / d) * d, C.y = Math.floor(C.y / d) * d, C.z = Math.floor(C.z / d) * d;
|
|
2049
2049
|
};
|
|
2050
2050
|
i.splats.forEach((C) => {
|
|
@@ -2075,7 +2075,7 @@ class rs {
|
|
|
2075
2075
|
}
|
|
2076
2076
|
class At {
|
|
2077
2077
|
constructor(e, s, t, n, r, i, o) {
|
|
2078
|
-
this.splatPartitioner = e, this.alphaRemovalThreshold = s, this.compressionLevel = t, this.sectionSize = n, this.sceneCenter = r ? new
|
|
2078
|
+
this.splatPartitioner = e, this.alphaRemovalThreshold = s, this.compressionLevel = t, this.sectionSize = n, this.sceneCenter = r ? new v().copy(r) : void 0, this.blockSize = i, this.bucketSize = o;
|
|
2079
2079
|
}
|
|
2080
2080
|
generateFromUncompressedSplatArray(e) {
|
|
2081
2081
|
const s = this.splatPartitioner.partitionUncompressedSplatArray(e);
|
|
@@ -2089,7 +2089,7 @@ class At {
|
|
|
2089
2089
|
s.parameters
|
|
2090
2090
|
);
|
|
2091
2091
|
}
|
|
2092
|
-
static getStandardGenerator(e = 1, s = 1, t = 0, n = new
|
|
2092
|
+
static getStandardGenerator(e = 1, s = 1, t = 0, n = new v(), r = I.BucketBlockSize, i = I.BucketSize) {
|
|
2093
2093
|
const o = rs.getStandardPartitioner(t, n, r, i);
|
|
2094
2094
|
return new At(
|
|
2095
2095
|
o,
|
|
@@ -2107,7 +2107,7 @@ const ue = {
|
|
|
2107
2107
|
Processing: 1,
|
|
2108
2108
|
Done: 2
|
|
2109
2109
|
};
|
|
2110
|
-
class
|
|
2110
|
+
class vt extends Error {
|
|
2111
2111
|
constructor(e) {
|
|
2112
2112
|
super(e);
|
|
2113
2113
|
}
|
|
@@ -2134,14 +2134,14 @@ function Us(m, e, s, t, n, r, i, o) {
|
|
|
2134
2134
|
r,
|
|
2135
2135
|
i,
|
|
2136
2136
|
o
|
|
2137
|
-
).generateFromUncompressedSplatArray(m) : I.generateFromUncompressedSplatArrays([m], s, 0, new
|
|
2137
|
+
).generateFromUncompressedSplatArray(m) : I.generateFromUncompressedSplatArrays([m], s, 0, new v());
|
|
2138
2138
|
}
|
|
2139
2139
|
class os {
|
|
2140
2140
|
static loadFromURL(e, s, t, n, r, i, o = !0, a = 0, l, c, d, u, h) {
|
|
2141
2141
|
let f;
|
|
2142
2142
|
!t && !o ? f = te.DownloadBeforeProcessing : o ? f = te.ProgressiveToSplatArray : f = te.ProgressiveToSplatBuffer;
|
|
2143
2143
|
const p = Y.ProgressiveLoadSectionSize, A = I.HeaderSizeBytes + I.SectionHeaderSizeBytes, C = 1;
|
|
2144
|
-
let g, x, w, y, E, S = 0,
|
|
2144
|
+
let g, x, w, y, E, S = 0, B = 0, F = 0, D = !1, b = !1, R = !1;
|
|
2145
2145
|
const k = jt();
|
|
2146
2146
|
let M = 0, O = 0, L = 0, U = 0, _ = "", H = null, Q = [], ee;
|
|
2147
2147
|
const le = new TextDecoder(), V = (se, Z, G) => {
|
|
@@ -2168,13 +2168,13 @@ class os {
|
|
|
2168
2168
|
H = xe.decodeHeaderText(_), a = Math.min(a, H.sphericalHarmonicsDegree), S = H.splatCount, b = !0, U = H.headerSizeBytes + H.bytesPerSplat * S;
|
|
2169
2169
|
else if (g === Ie.PlayCanvasCompressed) {
|
|
2170
2170
|
if (H = W.decodeHeaderText(_), a = Math.min(a, H.sphericalHarmonicsDegree), f === te.ProgressiveToSplatBuffer && a > 0)
|
|
2171
|
-
throw new
|
|
2171
|
+
throw new vt(
|
|
2172
2172
|
"PlyLoader.loadFromURL() -> Selected PLY format has spherical harmonics data that cannot be progressively loaded."
|
|
2173
2173
|
);
|
|
2174
2174
|
S = H.vertexElement.count, U = H.headerSizeBytes + H.bytesPerSplat * S + H.chunkElement.storageSizeBytes;
|
|
2175
2175
|
} else {
|
|
2176
2176
|
if (f === te.ProgressiveToSplatBuffer)
|
|
2177
|
-
throw new
|
|
2177
|
+
throw new vt(
|
|
2178
2178
|
"PlyLoader.loadFromURL() -> Selected PLY format cannot be progressively loaded."
|
|
2179
2179
|
);
|
|
2180
2180
|
f = te.DownloadBeforeProcessing;
|
|
@@ -2190,7 +2190,7 @@ class os {
|
|
|
2190
2190
|
maxSplatCount: S,
|
|
2191
2191
|
splatCount: 0,
|
|
2192
2192
|
compressionLevel: 0,
|
|
2193
|
-
sceneCenter: new
|
|
2193
|
+
sceneCenter: new v()
|
|
2194
2194
|
}, w);
|
|
2195
2195
|
} else
|
|
2196
2196
|
ee = new P(a);
|
|
@@ -2212,13 +2212,13 @@ class os {
|
|
|
2212
2212
|
), F += pe);
|
|
2213
2213
|
else {
|
|
2214
2214
|
if (f === te.ProgressiveToSplatBuffer) {
|
|
2215
|
-
const Me = I.CompressionLevels[0].SphericalHarmonicsDegrees[a], Ce =
|
|
2215
|
+
const Me = I.CompressionLevels[0].SphericalHarmonicsDegrees[a], Ce = B * Me.BytesPerSplat + A;
|
|
2216
2216
|
g === Ie.PlayCanvasCompressed ? W.parseToUncompressedSplatBufferSection(
|
|
2217
2217
|
H.chunkElement,
|
|
2218
2218
|
H.vertexElement,
|
|
2219
2219
|
0,
|
|
2220
2220
|
pe - 1,
|
|
2221
|
-
|
|
2221
|
+
B,
|
|
2222
2222
|
Fe,
|
|
2223
2223
|
w,
|
|
2224
2224
|
Ce
|
|
@@ -2238,7 +2238,7 @@ class os {
|
|
|
2238
2238
|
H.vertexElement,
|
|
2239
2239
|
0,
|
|
2240
2240
|
pe - 1,
|
|
2241
|
-
|
|
2241
|
+
B,
|
|
2242
2242
|
Fe,
|
|
2243
2243
|
ee
|
|
2244
2244
|
) : xe.parseToUncompressedSplatArraySection(
|
|
@@ -2250,9 +2250,9 @@ class os {
|
|
|
2250
2250
|
ee,
|
|
2251
2251
|
a
|
|
2252
2252
|
);
|
|
2253
|
-
|
|
2253
|
+
B += pe, f === te.ProgressiveToSplatBuffer && (y || (I.writeSectionHeaderToBuffer({
|
|
2254
2254
|
maxSplatCount: S,
|
|
2255
|
-
splatCount:
|
|
2255
|
+
splatCount: B,
|
|
2256
2256
|
bucketSize: 0,
|
|
2257
2257
|
bucketCount: 0,
|
|
2258
2258
|
bucketBlockSize: 0,
|
|
@@ -2261,7 +2261,7 @@ class os {
|
|
|
2261
2261
|
fullBucketCount: 0,
|
|
2262
2262
|
partiallyFilledBucketCount: 0,
|
|
2263
2263
|
sphericalHarmonicsDegree: a
|
|
2264
|
-
}, 0, w, I.HeaderSizeBytes), y = new I(w, !1)), y.updateLoadedCounts(1,
|
|
2264
|
+
}, 0, w, I.HeaderSizeBytes), y = new I(w, !1)), y.updateLoadedCounts(1, B)), L >= U && (R = !0);
|
|
2265
2265
|
}
|
|
2266
2266
|
if (fe === 0)
|
|
2267
2267
|
Q = [];
|
|
@@ -2293,7 +2293,7 @@ class os {
|
|
|
2293
2293
|
u,
|
|
2294
2294
|
h
|
|
2295
2295
|
));
|
|
2296
|
-
} else return f === te.ProgressiveToSplatBuffer ? se :
|
|
2296
|
+
} else return f === te.ProgressiveToSplatBuffer ? se : ve(() => Us(
|
|
2297
2297
|
se,
|
|
2298
2298
|
o,
|
|
2299
2299
|
r,
|
|
@@ -2306,7 +2306,7 @@ class os {
|
|
|
2306
2306
|
})));
|
|
2307
2307
|
}
|
|
2308
2308
|
static loadFromFileData(e, s, t, n, r = 0, i, o, a, l) {
|
|
2309
|
-
return n ?
|
|
2309
|
+
return n ? ve(() => Ls.parseToUncompressedSplatArray(e, r)).then((c) => Us(
|
|
2310
2310
|
c,
|
|
2311
2311
|
n,
|
|
2312
2312
|
s,
|
|
@@ -2315,7 +2315,7 @@ class os {
|
|
|
2315
2315
|
o,
|
|
2316
2316
|
a,
|
|
2317
2317
|
l
|
|
2318
|
-
)) :
|
|
2318
|
+
)) : ve(() => Ls.parseToUncompressedSplatBuffer(e, r));
|
|
2319
2319
|
}
|
|
2320
2320
|
}
|
|
2321
2321
|
const br = (m) => new ReadableStream({
|
|
@@ -2412,10 +2412,10 @@ const Hr = (function() {
|
|
|
2412
2412
|
const y = P.createSplat(w);
|
|
2413
2413
|
g.scale[0] !== void 0 ? (y[r] = g.scale[0], y[i] = g.scale[1], y[o] = g.scale[2]) : (y[r] = 0.01, y[i] = 0.01, y[o] = 0.01), g.color[0] !== void 0 ? (y[u] = g.color[0], y[h] = g.color[1], y[f] = g.color[2]) : m[RED] !== void 0 ? (y[u] = m[RED] * 255, y[h] = m[GREEN] * 255, y[f] = m[BLUE] * 255) : (y[u] = 0, y[h] = 0, y[f] = 0), g.alpha !== void 0 && (y[p] = g.alpha), y[u] = oe(Math.floor(y[u]), 0, 255), y[h] = oe(Math.floor(y[h]), 0, 255), y[f] = oe(Math.floor(y[f]), 0, 255), y[p] = oe(Math.floor(y[p]), 0, 255);
|
|
2414
2414
|
let E = A[w], S = A[x];
|
|
2415
|
-
for (let
|
|
2415
|
+
for (let B = 0; B < 3; ++B)
|
|
2416
2416
|
for (let F = 0; F < 15; ++F) {
|
|
2417
|
-
const D = C[
|
|
2418
|
-
F < E && F < S && (y[P.OFFSET.FRC0 + D] = g.sh[
|
|
2417
|
+
const D = C[B * 15 + F];
|
|
2418
|
+
F < E && F < S && (y[P.OFFSET.FRC0 + D] = g.sh[B * S + F]);
|
|
2419
2419
|
}
|
|
2420
2420
|
return e.set(g.rotation[3], g.rotation[0], g.rotation[1], g.rotation[2]), e.normalize(), y[a] = e.x, y[l] = e.y, y[c] = e.z, y[d] = e.w, y[s] = g.position[0], y[t] = g.position[1], y[n] = g.position[2], y;
|
|
2421
2421
|
};
|
|
@@ -2538,7 +2538,7 @@ class is {
|
|
|
2538
2538
|
)));
|
|
2539
2539
|
}
|
|
2540
2540
|
static async loadFromFileData(e, s, t, n, r = 0, i, o, a, l) {
|
|
2541
|
-
await
|
|
2541
|
+
await ve();
|
|
2542
2542
|
const c = await Nr(e);
|
|
2543
2543
|
r = Math.min(c.shDegree, r);
|
|
2544
2544
|
const d = new P(r);
|
|
@@ -2643,7 +2643,7 @@ function _s(m, e, s, t, n, r, i, o) {
|
|
|
2643
2643
|
r,
|
|
2644
2644
|
i,
|
|
2645
2645
|
o
|
|
2646
|
-
).generateFromUncompressedSplatArray(m) : I.generateFromUncompressedSplatArrays([m], s, 0, new
|
|
2646
|
+
).generateFromUncompressedSplatArray(m) : I.generateFromUncompressedSplatArrays([m], s, 0, new v());
|
|
2647
2647
|
}
|
|
2648
2648
|
class as {
|
|
2649
2649
|
static loadFromURL(e, s, t, n, r, i, o = !0, a, l, c, d, u) {
|
|
@@ -2652,7 +2652,7 @@ class as {
|
|
|
2652
2652
|
const f = I.HeaderSizeBytes + I.SectionHeaderSizeBytes, p = Y.ProgressiveLoadSectionSize, A = 1;
|
|
2653
2653
|
let C, g, x, w = 0, y = 0, E;
|
|
2654
2654
|
const S = jt();
|
|
2655
|
-
let
|
|
2655
|
+
let B = 0, F = 0, D = [];
|
|
2656
2656
|
const b = (R, k, M, O) => {
|
|
2657
2657
|
const L = R >= 100;
|
|
2658
2658
|
if (M && D.push(M), h === te.DownloadBeforeProcessing) {
|
|
@@ -2661,7 +2661,7 @@ class as {
|
|
|
2661
2661
|
}
|
|
2662
2662
|
if (!O) {
|
|
2663
2663
|
if (t)
|
|
2664
|
-
throw new
|
|
2664
|
+
throw new vt("Cannon directly load .splat because no file size info is available.");
|
|
2665
2665
|
h = te.DownloadBeforeProcessing;
|
|
2666
2666
|
return;
|
|
2667
2667
|
}
|
|
@@ -2676,12 +2676,12 @@ class as {
|
|
|
2676
2676
|
maxSplatCount: w,
|
|
2677
2677
|
splatCount: y,
|
|
2678
2678
|
compressionLevel: 0,
|
|
2679
|
-
sceneCenter: new
|
|
2679
|
+
sceneCenter: new v()
|
|
2680
2680
|
}, g)) : E = new P(0);
|
|
2681
2681
|
}
|
|
2682
2682
|
if (M) {
|
|
2683
2683
|
new Uint8Array(C, F, M.byteLength).set(new Uint8Array(M)), F += M.byteLength;
|
|
2684
|
-
const U = F -
|
|
2684
|
+
const U = F - B;
|
|
2685
2685
|
if (U > p || L) {
|
|
2686
2686
|
const H = (L ? U : p) / j.RowSizeBytes, Q = y + H;
|
|
2687
2687
|
h === te.ProgressiveToSplatBuffer ? j.parseToUncompressedSplatBufferSection(
|
|
@@ -2707,7 +2707,7 @@ class as {
|
|
|
2707
2707
|
storageSizeBytes: 0,
|
|
2708
2708
|
fullBucketCount: 0,
|
|
2709
2709
|
partiallyFilledBucketCount: 0
|
|
2710
|
-
}, 0, g, I.HeaderSizeBytes), x = new I(g, !1)), x.updateLoadedCounts(1, y), n && n(x, L)),
|
|
2710
|
+
}, 0, g, I.HeaderSizeBytes), x = new I(g, !1)), x.updateLoadedCounts(1, y), n && n(x, L)), B += p;
|
|
2711
2711
|
}
|
|
2712
2712
|
}
|
|
2713
2713
|
L && (h === te.ProgressiveToSplatBuffer ? S.resolve(x) : S.resolve(E)), s && s(R, k, ue.Downloading);
|
|
@@ -2721,7 +2721,7 @@ class as {
|
|
|
2721
2721
|
c,
|
|
2722
2722
|
d,
|
|
2723
2723
|
u
|
|
2724
|
-
)) : h === te.ProgressiveToSplatBuffer ? R :
|
|
2724
|
+
)) : h === te.ProgressiveToSplatBuffer ? R : ve(() => _s(
|
|
2725
2725
|
R,
|
|
2726
2726
|
o,
|
|
2727
2727
|
r,
|
|
@@ -2733,7 +2733,7 @@ class as {
|
|
|
2733
2733
|
))))));
|
|
2734
2734
|
}
|
|
2735
2735
|
static loadFromFileData(e, s, t, n, r, i, o, a) {
|
|
2736
|
-
return
|
|
2736
|
+
return ve(() => {
|
|
2737
2737
|
const l = j.parseStandardSplatToUncompressedSplatArray(e);
|
|
2738
2738
|
return _s(
|
|
2739
2739
|
l,
|
|
@@ -2757,7 +2757,7 @@ class dt {
|
|
|
2757
2757
|
}
|
|
2758
2758
|
static loadFromURL(e, s, t, n, r) {
|
|
2759
2759
|
let i, o, a, l, c = !1, d = !1, u, h = [], f = !1, p = !1, A = 0, C = 0, g = 0, x = !1, w = !1, y = !1, E = [];
|
|
2760
|
-
const S = jt(),
|
|
2760
|
+
const S = jt(), B = () => {
|
|
2761
2761
|
!c && !d && A >= I.HeaderSizeBytes && (d = !0, new Blob(E).arrayBuffer().then((O) => {
|
|
2762
2762
|
a = new ArrayBuffer(I.HeaderSizeBytes), new Uint8Array(a).set(new Uint8Array(O, 0, I.HeaderSizeBytes)), dt.checkVersion(a), d = !1, c = !0, l = I.parseHeader(a), window.setTimeout(() => {
|
|
2763
2763
|
b();
|
|
@@ -2826,11 +2826,11 @@ class dt {
|
|
|
2826
2826
|
window.setTimeout(M, Y.ProgressiveLoadSectionDelayDuration);
|
|
2827
2827
|
};
|
|
2828
2828
|
return Dt(e, (M, O, L) => {
|
|
2829
|
-
L && (E.push(L), i && new Uint8Array(i, A, L.byteLength).set(new Uint8Array(L)), A += L.byteLength), t ? (
|
|
2829
|
+
L && (E.push(L), i && new Uint8Array(i, A, L.byteLength).set(new Uint8Array(L)), A += L.byteLength), t ? (B(), b(), R()) : s && s(M, O, ue.Downloading);
|
|
2830
2830
|
}, !t, r).then((M) => (s && s(0, "0%", ue.Processing), (t ? S.promise : dt.loadFromFileData(M)).then((L) => (s && s(100, "100%", ue.Done), L))));
|
|
2831
2831
|
}
|
|
2832
2832
|
static loadFromFileData(e) {
|
|
2833
|
-
return
|
|
2833
|
+
return ve(() => (dt.checkVersion(e), new I(e)));
|
|
2834
2834
|
}
|
|
2835
2835
|
static downloadFile = /* @__PURE__ */ (function() {
|
|
2836
2836
|
let e;
|
|
@@ -2850,7 +2850,7 @@ const Te = {
|
|
|
2850
2850
|
}, Qs = (m) => m.endsWith(".ply") ? Te.Ply : m.endsWith(".splat") ? Te.Splat : m.endsWith(".ksplat") ? Te.KSplat : m.endsWith(".spz") ? Te.Spz : null, Ns = { type: "change" }, zt = { type: "start" }, Vs = { type: "end" }, Tt = new kn(), Gs = new Ln(), Vr = Math.cos(70 * tn.DEG2RAD);
|
|
2851
2851
|
class wt extends Dn {
|
|
2852
2852
|
constructor(e, s) {
|
|
2853
|
-
super(), this.object = e, this.domElement = s, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new
|
|
2853
|
+
super(), this.object = e, this.domElement = s, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new v(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "KeyA", UP: "KeyW", RIGHT: "KeyD", BOTTOM: "KeyS" }, this.mouseButtons = { LEFT: We.ROTATE, MIDDLE: We.DOLLY, RIGHT: We.PAN }, this.touches = { ONE: qe.ROTATE, TWO: qe.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
|
2854
2854
|
return o.phi;
|
|
2855
2855
|
}, this.getAzimuthalAngle = function() {
|
|
2856
2856
|
return o.theta;
|
|
@@ -2869,9 +2869,9 @@ class wt extends Dn {
|
|
|
2869
2869
|
}, this.clearDampedPan = function() {
|
|
2870
2870
|
c.set(0, 0, 0);
|
|
2871
2871
|
}, this.update = (function() {
|
|
2872
|
-
const T = new
|
|
2872
|
+
const T = new v(), z = new ge().setFromUnitVectors(e.up, new v(0, 1, 0)), he = z.clone().invert(), me = new v(), Ee = new ge(), Ge = new v(), Ue = 2 * Math.PI;
|
|
2873
2873
|
return function() {
|
|
2874
|
-
z.setFromUnitVectors(e.up, new
|
|
2874
|
+
z.setFromUnitVectors(e.up, new v(0, 1, 0)), he.copy(z).invert();
|
|
2875
2875
|
const fs = t.object.position;
|
|
2876
2876
|
T.copy(fs).sub(t.target), T.applyQuaternion(z), o.setFromVector3(T), t.autoRotate && r === n.NONE && b(F()), t.enableDamping ? (o.theta += a.theta * t.dampingFactor, o.phi += a.phi * t.dampingFactor) : (o.theta += a.theta, o.phi += a.phi);
|
|
2877
2877
|
let Pe = t.minAzimuthAngle, Oe = t.maxAzimuthAngle;
|
|
@@ -2885,9 +2885,9 @@ class wt extends Dn {
|
|
|
2885
2885
|
const Ct = ot - rt;
|
|
2886
2886
|
t.object.position.addScaledVector(w, Ct), t.object.updateMatrixWorld();
|
|
2887
2887
|
} else if (t.object.isOrthographicCamera) {
|
|
2888
|
-
const ot = new
|
|
2888
|
+
const ot = new v(y.x, y.y, 0);
|
|
2889
2889
|
ot.unproject(t.object), t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / l)), t.object.updateProjectionMatrix(), gt = !0;
|
|
2890
|
-
const Ct = new
|
|
2890
|
+
const Ct = new v(y.x, y.y, 0);
|
|
2891
2891
|
Ct.unproject(t.object), t.object.position.sub(Ct).add(ot), t.object.updateMatrixWorld(), rt = T.length();
|
|
2892
2892
|
} else
|
|
2893
2893
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), t.zoomToCursor = !1;
|
|
@@ -2911,9 +2911,9 @@ class wt extends Dn {
|
|
|
2911
2911
|
let r = n.NONE;
|
|
2912
2912
|
const i = 1e-6, o = new xs(), a = new xs();
|
|
2913
2913
|
let l = 1;
|
|
2914
|
-
const c = new
|
|
2914
|
+
const c = new v(), d = new N(), u = new N(), h = new N(), f = new N(), p = new N(), A = new N(), C = new N(), g = new N(), x = new N(), w = new v(), y = new N();
|
|
2915
2915
|
let E = !1;
|
|
2916
|
-
const S = [],
|
|
2916
|
+
const S = [], B = {};
|
|
2917
2917
|
function F() {
|
|
2918
2918
|
return 2 * Math.PI / 60 / 60 * t.autoRotateSpeed;
|
|
2919
2919
|
}
|
|
@@ -2927,17 +2927,17 @@ class wt extends Dn {
|
|
|
2927
2927
|
a.phi -= T;
|
|
2928
2928
|
}
|
|
2929
2929
|
const k = (function() {
|
|
2930
|
-
const T = new
|
|
2930
|
+
const T = new v();
|
|
2931
2931
|
return function(he, me) {
|
|
2932
2932
|
T.setFromMatrixColumn(me, 0), T.multiplyScalar(-he), c.add(T);
|
|
2933
2933
|
};
|
|
2934
2934
|
})(), M = (function() {
|
|
2935
|
-
const T = new
|
|
2935
|
+
const T = new v();
|
|
2936
2936
|
return function(he, me) {
|
|
2937
2937
|
t.screenSpacePanning === !0 ? T.setFromMatrixColumn(me, 1) : (T.setFromMatrixColumn(me, 0), T.crossVectors(t.object.up, T)), T.multiplyScalar(he), c.add(T);
|
|
2938
2938
|
};
|
|
2939
2939
|
})(), O = (function() {
|
|
2940
|
-
const T = new
|
|
2940
|
+
const T = new v();
|
|
2941
2941
|
return function(he, me) {
|
|
2942
2942
|
const Ee = t.domElement;
|
|
2943
2943
|
if (t.object.isPerspectiveCamera) {
|
|
@@ -3199,7 +3199,7 @@ class wt extends Dn {
|
|
|
3199
3199
|
S.push(T);
|
|
3200
3200
|
}
|
|
3201
3201
|
function Sn(T) {
|
|
3202
|
-
delete
|
|
3202
|
+
delete B[T.pointerId];
|
|
3203
3203
|
for (let z = 0; z < S.length; z++)
|
|
3204
3204
|
if (S[z].pointerId == T.pointerId) {
|
|
3205
3205
|
S.splice(z, 1);
|
|
@@ -3207,12 +3207,12 @@ class wt extends Dn {
|
|
|
3207
3207
|
}
|
|
3208
3208
|
}
|
|
3209
3209
|
function ps(T) {
|
|
3210
|
-
let z =
|
|
3211
|
-
z === void 0 && (z = new N(),
|
|
3210
|
+
let z = B[T.pointerId];
|
|
3211
|
+
z === void 0 && (z = new N(), B[T.pointerId] = z), z.set(T.pageX, T.pageY);
|
|
3212
3212
|
}
|
|
3213
3213
|
function Rt(T) {
|
|
3214
3214
|
const z = T.pointerId === S[0].pointerId ? S[1] : S[0];
|
|
3215
|
-
return
|
|
3215
|
+
return B[z.pointerId];
|
|
3216
3216
|
}
|
|
3217
3217
|
t.domElement.addEventListener("contextmenu", us), t.domElement.addEventListener("pointerdown", Ce), t.domElement.addEventListener("pointercancel", He), t.domElement.addEventListener("wheel", hs, { passive: !1 }), this.update();
|
|
3218
3218
|
}
|
|
@@ -3544,9 +3544,9 @@ class Kr {
|
|
|
3544
3544
|
this.infoPanelContainer.style.display = "none", this.visible = !1;
|
|
3545
3545
|
}
|
|
3546
3546
|
}
|
|
3547
|
-
const Ws = new
|
|
3547
|
+
const Ws = new v();
|
|
3548
3548
|
class jr extends Je {
|
|
3549
|
-
constructor(e = new
|
|
3549
|
+
constructor(e = new v(0, 0, 1), s = new v(0, 0, 0), t = 1, n = 0.1, r = 16776960, i = t * 0.2, o = i * 0.2) {
|
|
3550
3550
|
super(), this.type = "ArrowHelper";
|
|
3551
3551
|
const a = new Is(n, n, t, 32);
|
|
3552
3552
|
a.translate(0, t / 2, 0);
|
|
@@ -3580,10 +3580,10 @@ class ht {
|
|
|
3580
3580
|
}
|
|
3581
3581
|
updateSplatRenderTargetForRenderDimensions(e, s) {
|
|
3582
3582
|
this.destroySplatRendertarget(), this.splatRenderTarget = new wn(e, s, {
|
|
3583
|
-
format:
|
|
3583
|
+
format: Bt,
|
|
3584
3584
|
stencilBuffer: !1,
|
|
3585
3585
|
depthBuffer: !0
|
|
3586
|
-
}), this.splatRenderTarget.depthTexture = new En(e, s), this.splatRenderTarget.depthTexture.format =
|
|
3586
|
+
}), this.splatRenderTarget.depthTexture = new En(e, s), this.splatRenderTarget.depthTexture.format = Bn, this.splatRenderTarget.depthTexture.type = at;
|
|
3587
3587
|
}
|
|
3588
3588
|
destroySplatRendertarget() {
|
|
3589
3589
|
this.splatRenderTarget && (this.splatRenderTarget = null);
|
|
@@ -3623,7 +3623,7 @@ class ht {
|
|
|
3623
3623
|
depthWrite: !1,
|
|
3624
3624
|
depthTest: !1,
|
|
3625
3625
|
transparent: !0,
|
|
3626
|
-
blending:
|
|
3626
|
+
blending: vn,
|
|
3627
3627
|
blendSrc: gs,
|
|
3628
3628
|
blendSrcAlpha: gs,
|
|
3629
3629
|
blendDst: As,
|
|
@@ -3671,7 +3671,7 @@ class ht {
|
|
|
3671
3671
|
this.focusMarker && (Xe(this.focusMarker), this.focusMarker = null);
|
|
3672
3672
|
}
|
|
3673
3673
|
updateFocusMarker = (function() {
|
|
3674
|
-
const e = new
|
|
3674
|
+
const e = new v(), s = new J(), t = new v();
|
|
3675
3675
|
return function(n, r, i) {
|
|
3676
3676
|
s.copy(r.matrixWorld).invert(), e.copy(n).applyMatrix4(s), e.normalize().multiplyScalar(10), e.applyMatrix4(r.matrixWorld), t.copy(r.position).sub(n);
|
|
3677
3677
|
const o = t.length();
|
|
@@ -3693,9 +3693,9 @@ class ht {
|
|
|
3693
3693
|
e.rotateX(-Math.PI / 2);
|
|
3694
3694
|
const s = new ft({ color: 16777215 });
|
|
3695
3695
|
s.transparent = !0, s.opacity = 0.6, s.depthTest = !1, s.depthWrite = !1, s.side = Kt;
|
|
3696
|
-
const t = new be(e, s), n = new
|
|
3696
|
+
const t = new be(e, s), n = new v(0, 1, 0);
|
|
3697
3697
|
n.normalize();
|
|
3698
|
-
const r = new
|
|
3698
|
+
const r = new v(0, 0, 0), i = 0.5, o = 0.01, a = 56576, l = new jr(n, r, i, o, a, 0.1, 0.03);
|
|
3699
3699
|
this.controlPlane = new Je(), this.controlPlane.add(t), this.controlPlane.add(l);
|
|
3700
3700
|
}
|
|
3701
3701
|
}
|
|
@@ -3706,7 +3706,7 @@ class ht {
|
|
|
3706
3706
|
this.controlPlane.visible = e;
|
|
3707
3707
|
}
|
|
3708
3708
|
positionAndOrientControlPlane = (function() {
|
|
3709
|
-
const e = new ge(), s = new
|
|
3709
|
+
const e = new ge(), s = new v(0, 1, 0);
|
|
3710
3710
|
return function(t, n) {
|
|
3711
3711
|
e.setFromUnitVectors(s, n), this.controlPlane.position.copy(t), this.controlPlane.quaternion.copy(e);
|
|
3712
3712
|
};
|
|
@@ -3837,7 +3837,7 @@ class ht {
|
|
|
3837
3837
|
},
|
|
3838
3838
|
realFocusPosition: {
|
|
3839
3839
|
type: "v3",
|
|
3840
|
-
value: new
|
|
3840
|
+
value: new v()
|
|
3841
3841
|
},
|
|
3842
3842
|
viewport: {
|
|
3843
3843
|
type: "v2",
|
|
@@ -3861,10 +3861,10 @@ class ht {
|
|
|
3861
3861
|
this.destroyMeshCursor(), this.destroyFocusMarker(), this.destroyDebugMeshes(), this.destroyControlPlane(), this.destroyRenderTargetCopyObjects(), this.destroySplatRendertarget();
|
|
3862
3862
|
}
|
|
3863
3863
|
}
|
|
3864
|
-
const Yr = new
|
|
3864
|
+
const Yr = new v(1, 0, 0), Xr = new v(0, 1, 0), Jr = new v(0, 0, 1);
|
|
3865
3865
|
class _t {
|
|
3866
|
-
constructor(e = new
|
|
3867
|
-
this.origin = new
|
|
3866
|
+
constructor(e = new v(), s = new v()) {
|
|
3867
|
+
this.origin = new v(), this.direction = new v(), this.setParameters(e, s);
|
|
3868
3868
|
}
|
|
3869
3869
|
setParameters(e, s) {
|
|
3870
3870
|
this.origin.copy(e), this.direction.copy(s).normalize();
|
|
@@ -3873,7 +3873,7 @@ class _t {
|
|
|
3873
3873
|
return !(s.x < e.min.x - t || s.x > e.max.x + t || s.y < e.min.y - t || s.y > e.max.y + t || s.z < e.min.z - t || s.z > e.max.z + t);
|
|
3874
3874
|
}
|
|
3875
3875
|
intersectBox = (function() {
|
|
3876
|
-
const e = new
|
|
3876
|
+
const e = new v(), s = [], t = [], n = [];
|
|
3877
3877
|
return function(r, i) {
|
|
3878
3878
|
if (t[0] = this.origin.x, t[1] = this.origin.y, t[2] = this.origin.z, n[0] = this.direction.x, n[1] = this.direction.y, n[2] = this.direction.z, this.boxContainsPoint(r, this.origin, 1e-4))
|
|
3879
3879
|
return i && (i.origin.copy(this.origin), i.normal.set(0, 0, 0), i.distance = -1), !0;
|
|
@@ -3897,7 +3897,7 @@ class _t {
|
|
|
3897
3897
|
};
|
|
3898
3898
|
})();
|
|
3899
3899
|
intersectSphere = (function() {
|
|
3900
|
-
const e = new
|
|
3900
|
+
const e = new v();
|
|
3901
3901
|
return function(s, t, n) {
|
|
3902
3902
|
e.copy(s).sub(this.origin);
|
|
3903
3903
|
const r = e.dot(this.direction), i = r * r, a = e.dot(e) - i, l = t * t;
|
|
@@ -3911,7 +3911,7 @@ class _t {
|
|
|
3911
3911
|
}
|
|
3912
3912
|
class cs {
|
|
3913
3913
|
constructor() {
|
|
3914
|
-
this.origin = new
|
|
3914
|
+
this.origin = new v(), this.normal = new v(), this.distance = 0, this.splatIndex = 0;
|
|
3915
3915
|
}
|
|
3916
3916
|
set(e, s, t, n) {
|
|
3917
3917
|
this.origin.copy(e), this.normal.copy(s), this.distance = t, this.splatIndex = n;
|
|
@@ -3945,7 +3945,7 @@ class Zr {
|
|
|
3945
3945
|
};
|
|
3946
3946
|
})();
|
|
3947
3947
|
intersectSplatMesh = (function() {
|
|
3948
|
-
const e = new J(), s = new J(), t = new J(), n = new _t(), r = new
|
|
3948
|
+
const e = new J(), s = new J(), t = new J(), n = new _t(), r = new v();
|
|
3949
3949
|
return function(i, o = []) {
|
|
3950
3950
|
const a = i.getSplatTree();
|
|
3951
3951
|
if (a) {
|
|
@@ -3962,7 +3962,7 @@ class Zr {
|
|
|
3962
3962
|
};
|
|
3963
3963
|
})();
|
|
3964
3964
|
castRayAtSplatTreeNode = (function() {
|
|
3965
|
-
const e = new qt(), s = new
|
|
3965
|
+
const e = new qt(), s = new v(), t = new v(), n = new ge(), r = new cs(), i = 1e-7, o = new v(0, 0, 0), a = new J(), l = new J(), c = new J(), d = new J(), u = new J(), h = new _t();
|
|
3966
3966
|
return function(f, p, A, C = []) {
|
|
3967
3967
|
if (f.intersectBox(A.boundingBox)) {
|
|
3968
3968
|
if (A.data && A.data.indexes && A.data.indexes.length > 0)
|
|
@@ -3979,8 +3979,8 @@ class Zr {
|
|
|
3979
3979
|
} else {
|
|
3980
3980
|
let E = t.x + t.y, S = 2;
|
|
3981
3981
|
if (p.splatMesh.splatRenderMode === Le.ThreeD && (E += t.z, S = 3), E = E / S, f.intersectSphere(s, E, r)) {
|
|
3982
|
-
const
|
|
3983
|
-
|
|
3982
|
+
const B = r.clone();
|
|
3983
|
+
B.splatIndex = x, C.push(B);
|
|
3984
3984
|
}
|
|
3985
3985
|
}
|
|
3986
3986
|
}
|
|
@@ -4281,7 +4281,7 @@ class et {
|
|
|
4281
4281
|
const i = {
|
|
4282
4282
|
sceneCenter: {
|
|
4283
4283
|
type: "v3",
|
|
4284
|
-
value: new
|
|
4284
|
+
value: new v()
|
|
4285
4285
|
},
|
|
4286
4286
|
fadeInComplete: {
|
|
4287
4287
|
type: "i",
|
|
@@ -4888,7 +4888,7 @@ class $r {
|
|
|
4888
4888
|
}
|
|
4889
4889
|
}
|
|
4890
4890
|
class eo extends Je {
|
|
4891
|
-
constructor(e, s = new
|
|
4891
|
+
constructor(e, s = new v(), t = new ge(), n = new v(1, 1, 1), r = 1, i = 1, o = !0) {
|
|
4892
4892
|
super(), this.splatBuffer = e, this.position.copy(s), this.quaternion.copy(t), this.scale.copy(n), this.transform = new J(), this.minimumAlpha = r, this.opacity = i, this.visible = o;
|
|
4893
4893
|
}
|
|
4894
4894
|
copyTransformData(e) {
|
|
@@ -4901,15 +4901,15 @@ class eo extends Je {
|
|
|
4901
4901
|
class ds {
|
|
4902
4902
|
static idGen = 0;
|
|
4903
4903
|
constructor(e, s, t, n) {
|
|
4904
|
-
this.min = new
|
|
4904
|
+
this.min = new v().copy(e), this.max = new v().copy(s), this.boundingBox = new it(this.min, this.max), this.center = new v().copy(this.max).sub(this.min).multiplyScalar(0.5).add(this.min), this.depth = t, this.children = [], this.data = null, this.id = n || ds.idGen++;
|
|
4905
4905
|
}
|
|
4906
4906
|
}
|
|
4907
4907
|
class ut {
|
|
4908
4908
|
constructor(e, s) {
|
|
4909
|
-
this.maxDepth = e, this.maxCentersPerNode = s, this.sceneDimensions = new
|
|
4909
|
+
this.maxDepth = e, this.maxCentersPerNode = s, this.sceneDimensions = new v(), this.sceneMin = new v(), this.sceneMax = new v(), this.rootNode = null, this.nodesWithIndexes = [], this.splatMesh = null;
|
|
4910
4910
|
}
|
|
4911
4911
|
static convertWorkerSubTreeNode(e) {
|
|
4912
|
-
const s = new
|
|
4912
|
+
const s = new v().fromArray(e.min), t = new v().fromArray(e.max), n = new ds(s, t, e.depth, e.id);
|
|
4913
4913
|
if (e.data.indexes) {
|
|
4914
4914
|
n.data = {
|
|
4915
4915
|
indexes: []
|
|
@@ -4924,7 +4924,7 @@ class ut {
|
|
|
4924
4924
|
}
|
|
4925
4925
|
static convertWorkerSubTree(e, s) {
|
|
4926
4926
|
const t = new ut(e.maxDepth, e.maxCentersPerNode);
|
|
4927
|
-
t.sceneMin = new
|
|
4927
|
+
t.sceneMin = new v().fromArray(e.sceneMin), t.sceneMax = new v().fromArray(e.sceneMax), t.splatMesh = s, t.rootNode = ut.convertWorkerSubTreeNode(e.rootNode);
|
|
4928
4928
|
const n = (r, i) => {
|
|
4929
4929
|
r.children.length === 0 && i(r);
|
|
4930
4930
|
for (let o of r.children)
|
|
@@ -5109,7 +5109,7 @@ class ro {
|
|
|
5109
5109
|
*/
|
|
5110
5110
|
processSplatMesh = function(e, s = () => !0, t, n) {
|
|
5111
5111
|
this.splatTreeWorker || (this.splatTreeWorker = no()), this.splatMesh = e, this.subTrees = [];
|
|
5112
|
-
const r = new
|
|
5112
|
+
const r = new v(), i = (o, a) => {
|
|
5113
5113
|
const l = new Float32Array(a * 4);
|
|
5114
5114
|
let c = 0;
|
|
5115
5115
|
for (let d = 0; d < a; d++) {
|
|
@@ -5124,7 +5124,7 @@ class ro {
|
|
|
5124
5124
|
};
|
|
5125
5125
|
return new Promise((o) => {
|
|
5126
5126
|
const a = () => this.disposed ? (this.diposeSplatTreeWorker(), o(), !0) : !1;
|
|
5127
|
-
t && t(!1),
|
|
5127
|
+
t && t(!1), ve(() => {
|
|
5128
5128
|
if (a()) return;
|
|
5129
5129
|
const l = [];
|
|
5130
5130
|
if (e.dynamicMode) {
|
|
@@ -5138,18 +5138,18 @@ class ro {
|
|
|
5138
5138
|
l.push(c);
|
|
5139
5139
|
}
|
|
5140
5140
|
this.splatTreeWorker.onmessage = (c) => {
|
|
5141
|
-
a() || c.data.subTrees && (n && n(!1),
|
|
5141
|
+
a() || c.data.subTrees && (n && n(!1), ve(() => {
|
|
5142
5142
|
if (!a()) {
|
|
5143
5143
|
for (let d of c.data.subTrees) {
|
|
5144
5144
|
const u = ut.convertWorkerSubTree(d, e);
|
|
5145
5145
|
this.subTrees.push(u);
|
|
5146
5146
|
}
|
|
5147
|
-
this.diposeSplatTreeWorker(), n && n(!0),
|
|
5147
|
+
this.diposeSplatTreeWorker(), n && n(!0), ve(() => {
|
|
5148
5148
|
o();
|
|
5149
5149
|
});
|
|
5150
5150
|
}
|
|
5151
5151
|
}));
|
|
5152
|
-
},
|
|
5152
|
+
}, ve(() => {
|
|
5153
5153
|
if (a()) return;
|
|
5154
5154
|
t && t(!0);
|
|
5155
5155
|
const c = l.map((d) => d.buffer);
|
|
@@ -5277,7 +5277,7 @@ class ye extends be {
|
|
|
5277
5277
|
modelViewProjLoc: -1,
|
|
5278
5278
|
sceneIndexesLoc: -1,
|
|
5279
5279
|
transformsLocs: []
|
|
5280
|
-
}, this.globalSplatIndexToLocalSplatIndexMap = [], this.globalSplatIndexToSceneIndexMap = [], this.lastBuildSplatCount = 0, this.lastBuildScenes = [], this.lastBuildMaxSplatCount = 0, this.lastBuildSceneCount = 0, this.firstRenderTime = -1, this.finalBuild = !1, this.webGLUtils = null, this.boundingBox = new it(), this.calculatedSceneCenter = new
|
|
5280
|
+
}, this.globalSplatIndexToLocalSplatIndexMap = [], this.globalSplatIndexToSceneIndexMap = [], this.lastBuildSplatCount = 0, this.lastBuildScenes = [], this.lastBuildMaxSplatCount = 0, this.lastBuildSceneCount = 0, this.firstRenderTime = -1, this.finalBuild = !1, this.webGLUtils = null, this.boundingBox = new it(), this.calculatedSceneCenter = new v(), this.maxSplatDistanceFromSceneCenter = 0, this.visibleRegionBufferRadius = 0, this.visibleRegionRadius = 0, this.visibleRegionFadeStartRadius = 0, this.visibleRegionChanging = !1, this.splatScale = 1, this.pointCloudModeEnabled = !1, this.disposed = !1, this.lastRenderer = null, this.visible = !1;
|
|
5281
5281
|
}
|
|
5282
5282
|
/**
|
|
5283
5283
|
* Build a container for each scene managed by this splat mesh based on an instance of SplatBuffer, along with optional
|
|
@@ -5299,7 +5299,7 @@ class ye extends be {
|
|
|
5299
5299
|
for (let r = 0; r < s.length; r++) {
|
|
5300
5300
|
const i = s[r], o = t[r] || {};
|
|
5301
5301
|
let a = o.position || [0, 0, 0], l = o.rotation || [0, 0, 0, 1], c = o.scale || [1, 1, 1];
|
|
5302
|
-
const d = new
|
|
5302
|
+
const d = new v().fromArray(a), u = new ge().fromArray(l), h = new v().fromArray(c), f = ye.createScene(
|
|
5303
5303
|
i,
|
|
5304
5304
|
d,
|
|
5305
5305
|
u,
|
|
@@ -5482,7 +5482,7 @@ class ye extends be {
|
|
|
5482
5482
|
modelViewProjLoc: -1,
|
|
5483
5483
|
sceneIndexesLoc: -1,
|
|
5484
5484
|
transformsLocs: []
|
|
5485
|
-
}, this.renderer = null, this.globalSplatIndexToLocalSplatIndexMap = [], this.globalSplatIndexToSceneIndexMap = [], this.lastBuildSplatCount = 0, this.lastBuildScenes = [], this.lastBuildMaxSplatCount = 0, this.lastBuildSceneCount = 0, this.firstRenderTime = -1, this.finalBuild = !1, this.webGLUtils = null, this.boundingBox = new it(), this.calculatedSceneCenter = new
|
|
5485
|
+
}, this.renderer = null, this.globalSplatIndexToLocalSplatIndexMap = [], this.globalSplatIndexToSceneIndexMap = [], this.lastBuildSplatCount = 0, this.lastBuildScenes = [], this.lastBuildMaxSplatCount = 0, this.lastBuildSceneCount = 0, this.firstRenderTime = -1, this.finalBuild = !1, this.webGLUtils = null, this.boundingBox = new it(), this.calculatedSceneCenter = new v(), this.maxSplatDistanceFromSceneCenter = 0, this.visibleRegionBufferRadius = 0, this.visibleRegionRadius = 0, this.visibleRegionFadeStartRadius = 0, this.visibleRegionChanging = !1, this.splatScale = 1, this.pointCloudModeEnabled = !1, this.disposed = !0, this.lastRenderer = null, this.visible = !1;
|
|
5486
5486
|
}
|
|
5487
5487
|
/**
|
|
5488
5488
|
* Dispose of only the Three.js mesh resources (geometry, material, and texture)
|
|
@@ -5559,13 +5559,13 @@ class ye extends be {
|
|
|
5559
5559
|
setupDataTextures() {
|
|
5560
5560
|
const e = this.getMaxSplatCount(), s = this.getSplatCount(!0);
|
|
5561
5561
|
this.disposeTextures();
|
|
5562
|
-
const t = (S,
|
|
5562
|
+
const t = (S, B) => {
|
|
5563
5563
|
const F = new N(4096, 1024);
|
|
5564
|
-
for (; F.x * F.y * S < e *
|
|
5564
|
+
for (; F.x * F.y * S < e * B; ) F.y *= 2;
|
|
5565
5565
|
return F;
|
|
5566
5566
|
}, n = (S) => S >= 1 ? uo : co, r = (S) => {
|
|
5567
|
-
const
|
|
5568
|
-
return { elementsPerTexelStored:
|
|
5567
|
+
const B = n(S), F = t(B, 6);
|
|
5568
|
+
return { elementsPerTexelStored: B, texSize: F };
|
|
5569
5569
|
};
|
|
5570
5570
|
let i = this.getTargetCovarianceCompressionLevel();
|
|
5571
5571
|
const o = 0, a = this.getTargetSphericalHarmonicsCompressionLevel();
|
|
@@ -5602,7 +5602,7 @@ class ye extends be {
|
|
|
5602
5602
|
size: C
|
|
5603
5603
|
}
|
|
5604
5604
|
}, this.splatRenderMode === Le.ThreeD) {
|
|
5605
|
-
const S = r(i),
|
|
5605
|
+
const S = r(i), B = S.elementsPerTexelStored, F = S.texSize;
|
|
5606
5606
|
let D = i >= 1 ? Uint32Array : Float32Array;
|
|
5607
5607
|
const b = i >= 1 ? po : ho, R = new D(F.x * F.y * b);
|
|
5608
5608
|
i === 0 ? R.set(l) : ye.updatePaddedCompressedCovariancesTextureData(l, R, 0, 0, l.length);
|
|
@@ -5616,7 +5616,7 @@ class ye extends be {
|
|
|
5616
5616
|
at
|
|
5617
5617
|
), k.internalFormat = "RGBA32UI", this.material.uniforms.covariancesTextureHalfFloat.value = k;
|
|
5618
5618
|
else {
|
|
5619
|
-
k = new ze(R, F.x, F.y,
|
|
5619
|
+
k = new ze(R, F.x, F.y, Bt, ms), this.material.uniforms.covariancesTexture.value = k;
|
|
5620
5620
|
const M = new ze(new Uint32Array(32), 2, 2, Pt, at);
|
|
5621
5621
|
M.internalFormat = "RGBA32UI", this.material.uniforms.covariancesTextureHalfFloat.value = M, M.needsUpdate = !0;
|
|
5622
5622
|
}
|
|
@@ -5625,45 +5625,45 @@ class ye extends be {
|
|
|
5625
5625
|
texture: k,
|
|
5626
5626
|
size: F,
|
|
5627
5627
|
compressionLevel: i,
|
|
5628
|
-
elementsPerTexelStored:
|
|
5628
|
+
elementsPerTexelStored: B,
|
|
5629
5629
|
elementsPerTexelAllocated: b
|
|
5630
5630
|
};
|
|
5631
5631
|
} else {
|
|
5632
|
-
const
|
|
5632
|
+
const B = t(Qt, 6);
|
|
5633
5633
|
let F = Float32Array, D = ms;
|
|
5634
|
-
const b = new F(
|
|
5634
|
+
const b = new F(B.x * B.y * Qt);
|
|
5635
5635
|
ye.updateScaleRotationsPaddedData(0, s - 1, c, d, b);
|
|
5636
5636
|
const R = new ze(
|
|
5637
5637
|
b,
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5638
|
+
B.x,
|
|
5639
|
+
B.y,
|
|
5640
|
+
Bt,
|
|
5641
5641
|
D
|
|
5642
5642
|
);
|
|
5643
|
-
R.needsUpdate = !0, this.material.uniforms.scaleRotationsTexture.value = R, this.material.uniforms.scaleRotationsTextureSize.value.copy(
|
|
5643
|
+
R.needsUpdate = !0, this.material.uniforms.scaleRotationsTexture.value = R, this.material.uniforms.scaleRotationsTextureSize.value.copy(B), this.splatDataTextures.scaleRotations = {
|
|
5644
5644
|
data: b,
|
|
5645
5645
|
texture: R,
|
|
5646
|
-
size:
|
|
5646
|
+
size: B,
|
|
5647
5647
|
compressionLevel: o
|
|
5648
5648
|
};
|
|
5649
5649
|
}
|
|
5650
5650
|
if (A) {
|
|
5651
5651
|
const S = a === 2 ? yn : xn;
|
|
5652
|
-
let
|
|
5653
|
-
|
|
5654
|
-
const F = 4, D =
|
|
5655
|
-
let b = t(F,
|
|
5652
|
+
let B = p;
|
|
5653
|
+
B % 2 !== 0 && B++;
|
|
5654
|
+
const F = 4, D = Bt;
|
|
5655
|
+
let b = t(F, B);
|
|
5656
5656
|
if (b.x * b.y <= Ys) {
|
|
5657
5657
|
const R = b.x * b.y * F, k = new f(R);
|
|
5658
5658
|
for (let O = 0; O < s; O++) {
|
|
5659
|
-
const L = p * O, U =
|
|
5659
|
+
const L = p * O, U = B * O;
|
|
5660
5660
|
for (let _ = 0; _ < p; _++)
|
|
5661
5661
|
k[U + _] = A[L + _];
|
|
5662
5662
|
}
|
|
5663
5663
|
const M = new ze(k, b.x, b.y, D, S);
|
|
5664
5664
|
M.needsUpdate = !0, this.material.uniforms.sphericalHarmonicsTexture.value = M, this.splatDataTextures.sphericalHarmonics = {
|
|
5665
5665
|
componentCount: p,
|
|
5666
|
-
paddedComponentCount:
|
|
5666
|
+
paddedComponentCount: B,
|
|
5667
5667
|
data: k,
|
|
5668
5668
|
textureCount: 1,
|
|
5669
5669
|
texture: M,
|
|
@@ -5673,7 +5673,7 @@ class ye extends be {
|
|
|
5673
5673
|
};
|
|
5674
5674
|
} else {
|
|
5675
5675
|
const R = p / 3;
|
|
5676
|
-
|
|
5676
|
+
B = R, B % 2 !== 0 && B++, b = t(F, B);
|
|
5677
5677
|
const k = b.x * b.y * F, M = [
|
|
5678
5678
|
this.material.uniforms.sphericalHarmonicsTextureR,
|
|
5679
5679
|
this.material.uniforms.sphericalHarmonicsTextureG,
|
|
@@ -5683,7 +5683,7 @@ class ye extends be {
|
|
|
5683
5683
|
const _ = new f(k);
|
|
5684
5684
|
O.push(_);
|
|
5685
5685
|
for (let Q = 0; Q < s; Q++) {
|
|
5686
|
-
const ee = p * Q, le =
|
|
5686
|
+
const ee = p * Q, le = B * Q;
|
|
5687
5687
|
if (R >= 3) {
|
|
5688
5688
|
for (let V = 0; V < 3; V++) _[le + V] = A[ee + U * 3 + V];
|
|
5689
5689
|
if (R >= 8)
|
|
@@ -5696,7 +5696,7 @@ class ye extends be {
|
|
|
5696
5696
|
this.material.uniforms.sphericalHarmonicsMultiTextureMode.value = 1, this.splatDataTextures.sphericalHarmonics = {
|
|
5697
5697
|
componentCount: p,
|
|
5698
5698
|
componentCountPerChannel: R,
|
|
5699
|
-
paddedComponentCount:
|
|
5699
|
+
paddedComponentCount: B,
|
|
5700
5700
|
data: O,
|
|
5701
5701
|
textureCount: 3,
|
|
5702
5702
|
textures: L,
|
|
@@ -5829,14 +5829,14 @@ class ye extends be {
|
|
|
5829
5829
|
if (h) {
|
|
5830
5830
|
let g = 4;
|
|
5831
5831
|
a === 1 ? g = 2 : a === 2 && (g = 1);
|
|
5832
|
-
const x = (E, S,
|
|
5832
|
+
const x = (E, S, B, F, D) => {
|
|
5833
5833
|
const b = this.renderer ? this.renderer.properties.get(E) : null;
|
|
5834
5834
|
!b || !b.__webglTexture ? E.needsUpdate = !0 : this.updateDataTexture(
|
|
5835
5835
|
F,
|
|
5836
5836
|
E,
|
|
5837
5837
|
S,
|
|
5838
5838
|
b,
|
|
5839
|
-
|
|
5839
|
+
B,
|
|
5840
5840
|
D,
|
|
5841
5841
|
g,
|
|
5842
5842
|
e,
|
|
@@ -5846,9 +5846,9 @@ class ye extends be {
|
|
|
5846
5846
|
if (o.textureCount === 1) {
|
|
5847
5847
|
const E = o.data;
|
|
5848
5848
|
for (let S = e; S <= s; S++) {
|
|
5849
|
-
const
|
|
5849
|
+
const B = w * S, F = y * S;
|
|
5850
5850
|
for (let D = 0; D < w; D++)
|
|
5851
|
-
E[F + D] = h[
|
|
5851
|
+
E[F + D] = h[B + D];
|
|
5852
5852
|
}
|
|
5853
5853
|
x(
|
|
5854
5854
|
o.texture,
|
|
@@ -5860,20 +5860,20 @@ class ye extends be {
|
|
|
5860
5860
|
} else {
|
|
5861
5861
|
const E = o.componentCountPerChannel;
|
|
5862
5862
|
for (let S = 0; S < 3; S++) {
|
|
5863
|
-
const
|
|
5863
|
+
const B = o.data[S];
|
|
5864
5864
|
for (let F = e; F <= s; F++) {
|
|
5865
5865
|
const D = w * F, b = y * F;
|
|
5866
5866
|
if (E >= 3) {
|
|
5867
|
-
for (let R = 0; R < 3; R++)
|
|
5867
|
+
for (let R = 0; R < 3; R++) B[b + R] = h[D + S * 3 + R];
|
|
5868
5868
|
if (E >= 8)
|
|
5869
|
-
for (let R = 0; R < 5; R++)
|
|
5869
|
+
for (let R = 0; R < 5; R++) B[b + 3 + R] = h[D + 9 + S * 5 + R];
|
|
5870
5870
|
}
|
|
5871
5871
|
}
|
|
5872
5872
|
x(
|
|
5873
5873
|
o.textures[S],
|
|
5874
5874
|
o.size,
|
|
5875
5875
|
o.elementsPerTexel,
|
|
5876
|
-
|
|
5876
|
+
B,
|
|
5877
5877
|
y
|
|
5878
5878
|
);
|
|
5879
5879
|
}
|
|
@@ -5962,9 +5962,9 @@ class ye extends be {
|
|
|
5962
5962
|
}
|
|
5963
5963
|
}
|
|
5964
5964
|
updateVisibleRegion(e) {
|
|
5965
|
-
const s = this.getSplatCount(!0), t = new
|
|
5965
|
+
const s = this.getSplatCount(!0), t = new v();
|
|
5966
5966
|
if (!e) {
|
|
5967
|
-
const r = new
|
|
5967
|
+
const r = new v();
|
|
5968
5968
|
this.scenes.forEach((i) => {
|
|
5969
5969
|
r.add(i.splatBuffer.sceneCenter);
|
|
5970
5970
|
}), r.multiplyScalar(1 / this.scenes.length), this.calculatedSceneCenter.copy(r), this.material.uniforms.sceneCenter.value.copy(this.calculatedSceneCenter), this.material.uniformsNeedUpdate = !0;
|
|
@@ -6309,7 +6309,7 @@ class ye extends be {
|
|
|
6309
6309
|
* @param {number} destStart The start location from which to write data
|
|
6310
6310
|
*/
|
|
6311
6311
|
fillSplatDataArrays(e, s, t, n, r, i, o, a = 0, l = 0, c = 1, d, u, h = 0, f) {
|
|
6312
|
-
const p = new
|
|
6312
|
+
const p = new v();
|
|
6313
6313
|
p.x = void 0, p.y = void 0, this.splatRenderMode === Le.ThreeD ? p.z = void 0 : p.z = 1;
|
|
6314
6314
|
const A = new J();
|
|
6315
6315
|
let C = 0, g = this.scenes.length - 1;
|
|
@@ -6408,7 +6408,7 @@ class ye extends be {
|
|
|
6408
6408
|
* the default behavior will apply.
|
|
6409
6409
|
*/
|
|
6410
6410
|
getSplatScaleAndRotation = (function() {
|
|
6411
|
-
const e = {}, s = new
|
|
6411
|
+
const e = {}, s = new v();
|
|
6412
6412
|
return function(t, n, r, i) {
|
|
6413
6413
|
this.getLocalSplatParameters(t, e, i), s.x = void 0, s.y = void 0, s.z = void 0, this.splatRenderMode === Le.TwoD && (s.z = 0), e.splatBuffer.getSplatScaleAndRotation(
|
|
6414
6414
|
e.localIndex,
|
|
@@ -6492,7 +6492,7 @@ class ye extends be {
|
|
|
6492
6492
|
void 0,
|
|
6493
6493
|
s
|
|
6494
6494
|
);
|
|
6495
|
-
const r = new
|
|
6495
|
+
const r = new v(), i = new v();
|
|
6496
6496
|
for (let o = 0; o < t; o++) {
|
|
6497
6497
|
const a = o * 3, l = n[a], c = n[a + 1], d = n[a + 2];
|
|
6498
6498
|
(o === 0 || l < r.x) && (r.x = l), (o === 0 || c < r.y) && (r.y = c), (o === 0 || d < r.z) && (r.z = d), (o === 0 || l > i.x) && (i.x = l), (o === 0 || c > i.y) && (i.y = c), (o === 0 || d > i.z) && (i.z = d);
|
|
@@ -6503,7 +6503,7 @@ class ye extends be {
|
|
|
6503
6503
|
var Ao = "AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEbA2AAAGAQf39/f39/f39/f39/f39/fwBgAAF/AhIBA2VudgZtZW1vcnkCAwCAgAQDBAMAAQIHVAQRX193YXNtX2NhbGxfY3RvcnMAABhfX3dhc21fYXBwbHlfZGF0YV9yZWxvY3MAAAtzb3J0SW5kZXhlcwABE2Vtc2NyaXB0ZW5fdGxzX2luaXQAAgqWEAMDAAELihAEAXwDewN/A30gCyAKayEMAkACQCAOBEAgDQRAQfj///8HIQpBiICAgHghDSALIAxNDQMgDCEBA0AgAyABQQJ0IgVqIAIgACAFaigCAEECdGooAgAiBTYCACAFIAogBSAKSBshCiAFIA0gBSANShshDSABQQFqIgEgC0cNAAsMAwsgDwRAIAsgDE0NAkF/IQ9B+P///wchCkGIgICAeCENIAwhAgNAIA8gByAAIAJBAnQiFWooAgAiFkECdGooAgAiFEcEQAJ/IAX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qKAIANgIAIAIgBUEBazYCACAKIAxKDQALCws=";
|
|
6504
6504
|
function So(m) {
|
|
6505
6505
|
let e, s, t, n, r, i, o, a, l, c, d, u, h, f, p, A, C, g, x, w;
|
|
6506
|
-
function y(E, S,
|
|
6506
|
+
function y(E, S, B, F, D, b, R) {
|
|
6507
6507
|
const k = performance.now();
|
|
6508
6508
|
if (!t && (new Uint32Array(s, o, D.byteLength / w.BytesPerInt).set(D), new Float32Array(s, c, R.byteLength / w.BytesPerFloat).set(R), F)) {
|
|
6509
6509
|
let _;
|
|
@@ -6517,7 +6517,7 @@ function So(m) {
|
|
|
6517
6517
|
b.byteLength / w.BytesPerFloat
|
|
6518
6518
|
), _.set(b);
|
|
6519
6519
|
}
|
|
6520
|
-
A || (A = new Uint32Array(g)), new Float32Array(s, p, 16).set(
|
|
6520
|
+
A || (A = new Uint32Array(g)), new Float32Array(s, p, 16).set(B), new Uint32Array(s, h, g).set(A), e.exports.sortIndexes(
|
|
6521
6521
|
o,
|
|
6522
6522
|
f,
|
|
6523
6523
|
d,
|
|
@@ -6564,10 +6564,10 @@ function So(m) {
|
|
|
6564
6564
|
E.data.range.count
|
|
6565
6565
|
).set(new Uint32Array(sceneIndexes)), x = E.data.range.from + E.data.range.count;
|
|
6566
6566
|
else if (E.data.sort) {
|
|
6567
|
-
const S = Math.min(E.data.sort.splatRenderCount || 0, x),
|
|
6567
|
+
const S = Math.min(E.data.sort.splatRenderCount || 0, x), B = Math.min(E.data.sort.splatSortCount || 0, x), F = E.data.sort.usePrecomputedDistances;
|
|
6568
6568
|
let D, b, R;
|
|
6569
6569
|
t || (D = E.data.sort.indexesToSort, R = E.data.sort.transforms, F && (b = E.data.sort.precomputedDistances)), y(
|
|
6570
|
-
|
|
6570
|
+
B,
|
|
6571
6571
|
S,
|
|
6572
6572
|
E.data.sort.modelViewProj,
|
|
6573
6573
|
F,
|
|
@@ -6577,7 +6577,7 @@ function So(m) {
|
|
|
6577
6577
|
);
|
|
6578
6578
|
} else if (E.data.init) {
|
|
6579
6579
|
w = E.data.init.Constants, i = E.data.init.splatCount, t = E.data.init.useSharedMemory, n = E.data.init.integerBasedSort, r = E.data.init.dynamicMode, g = E.data.init.distanceMapRange, x = 0;
|
|
6580
|
-
const S = n ? w.BytesPerInt * 4 : w.BytesPerFloat * 4,
|
|
6580
|
+
const S = n ? w.BytesPerInt * 4 : w.BytesPerFloat * 4, B = new Uint8Array(E.data.init.sorterWasmBytes), F = 16 * w.BytesPerFloat, D = i * w.BytesPerInt, b = i * S, R = F, k = n ? i * w.BytesPerInt : i * w.BytesPerFloat, M = i * w.BytesPerInt, O = i * w.BytesPerInt, L = n ? g * w.BytesPerInt * 2 : g * w.BytesPerFloat * 2, U = r ? i * w.BytesPerInt : 0, _ = r ? w.MaxScenes * F : 0, H = w.MemoryPageSize * 32, Q = D + b + R + k + M + L + O + U + _ + H, ee = Math.floor(Q / w.MemoryPageSize) + 1, le = {
|
|
6581
6581
|
module: {},
|
|
6582
6582
|
env: {
|
|
6583
6583
|
memory: new WebAssembly.Memory({
|
|
@@ -6587,7 +6587,7 @@ function So(m) {
|
|
|
6587
6587
|
})
|
|
6588
6588
|
}
|
|
6589
6589
|
};
|
|
6590
|
-
WebAssembly.compile(
|
|
6590
|
+
WebAssembly.compile(B).then((V) => WebAssembly.instantiate(V, le)).then((V) => {
|
|
6591
6591
|
e = V, o = 0, f = o + D, p = f + b, d = p + R, u = d + k, h = u + M, a = h + L, l = a + O, c = l + U, s = le.env.memory.buffer, t ? m.postMessage({
|
|
6592
6592
|
sortSetupPhase1Complete: !0,
|
|
6593
6593
|
indexesToSortBuffer: s,
|
|
@@ -6765,16 +6765,16 @@ class xo {
|
|
|
6765
6765
|
const Vt = {
|
|
6766
6766
|
Always: 0,
|
|
6767
6767
|
Never: 2
|
|
6768
|
-
}, Io = 50, To = 0.75, wo = 15e5, Eo = 10,
|
|
6768
|
+
}, Io = 50, To = 0.75, wo = 15e5, Eo = 10, Bo = 2.5, vo = 60;
|
|
6769
6769
|
class Ze {
|
|
6770
6770
|
constructor(e = {}) {
|
|
6771
|
-
if (e.cameraUp || (e.cameraUp = [0, 1, 0]), this.cameraUp = new
|
|
6771
|
+
if (e.cameraUp || (e.cameraUp = [0, 1, 0]), this.cameraUp = new v().fromArray(e.cameraUp), e.initialCameraPosition || (e.initialCameraPosition = [0, 10, 15]), this.initialCameraPosition = new v().fromArray(e.initialCameraPosition), e.initialCameraLookAt || (e.initialCameraLookAt = [0, 0, 0]), this.initialCameraLookAt = new v().fromArray(e.initialCameraLookAt), this.dropInMode = e.dropInMode || !1, (e.selfDrivenMode === void 0 || e.selfDrivenMode === null) && (e.selfDrivenMode = !0), this.selfDrivenMode = e.selfDrivenMode && !this.dropInMode, this.selfDrivenUpdateFunc = this.selfDrivenUpdate.bind(this), e.useBuiltInControls === void 0 && (e.useBuiltInControls = !0), this.useBuiltInControls = e.useBuiltInControls, this.rootElement = e.rootElement, this.ignoreDevicePixelRatio = e.ignoreDevicePixelRatio || !1, this.devicePixelRatio = this.ignoreDevicePixelRatio ? 1 : window.devicePixelRatio || 1, this.halfPrecisionCovariancesOnGPU = e.halfPrecisionCovariancesOnGPU || !1, this.threeScene = e.threeScene, this.renderer = e.renderer, this.camera = e.camera, this.gpuAcceleratedSort = e.gpuAcceleratedSort || !1, (e.integerBasedSort === void 0 || e.integerBasedSort === null) && (e.integerBasedSort = !0), this.integerBasedSort = e.integerBasedSort, (e.sharedMemoryForWorkers === void 0 || e.sharedMemoryForWorkers === null) && (e.sharedMemoryForWorkers = !0), this.sharedMemoryForWorkers = e.sharedMemoryForWorkers, this.dynamicScene = !!e.dynamicScene, this.antialiased = e.antialiased || !1, this.kernel2DSize = e.kernel2DSize === void 0 ? 0.3 : e.kernel2DSize, this.webXRMode = e.webXRMode || Ye.None, this.webXRMode !== Ye.None && (this.gpuAcceleratedSort = !1), this.webXRActive = !1, this.webXRSessionInit = e.webXRSessionInit || {}, this.renderMode = e.renderMode || Vt.Always, this.sceneRevealMode = e.sceneRevealMode || pt.Default, this.focalAdjustment = e.focalAdjustment || 1, this.maxScreenSpaceSplatSize = e.maxScreenSpaceSplatSize || 1024, this.logLevel = e.logLevel || tt.None, this.sphericalHarmonicsDegree = e.sphericalHarmonicsDegree || 0, this.enableOptionalEffects = e.enableOptionalEffects || !1, (e.enableSIMDInSort === void 0 || e.enableSIMDInSort === null) && (e.enableSIMDInSort = !0), this.enableSIMDInSort = e.enableSIMDInSort, (e.inMemoryCompressionLevel === void 0 || e.inMemoryCompressionLevel === null) && (e.inMemoryCompressionLevel = 0), this.inMemoryCompressionLevel = e.inMemoryCompressionLevel, (e.optimizeSplatData === void 0 || e.optimizeSplatData === null) && (e.optimizeSplatData = !0), this.optimizeSplatData = e.optimizeSplatData, (e.freeIntermediateSplatData === void 0 || e.freeIntermediateSplatData === null) && (e.freeIntermediateSplatData = !1), this.freeIntermediateSplatData = e.freeIntermediateSplatData, Yt()) {
|
|
6772
6772
|
const t = on();
|
|
6773
6773
|
t.major < 17 && (this.enableSIMDInSort = !1), t.major < 16 && (this.sharedMemoryForWorkers = !1);
|
|
6774
6774
|
}
|
|
6775
6775
|
(e.splatRenderMode === void 0 || e.splatRenderMode === null) && (e.splatRenderMode = Le.ThreeD), this.splatRenderMode = e.splatRenderMode, this.sceneFadeInRateMultiplier = e.sceneFadeInRateMultiplier || 1, this.splatSortDistanceMapPrecision = e.splatSortDistanceMapPrecision || Y.DefaultSplatSortDistanceMapPrecision;
|
|
6776
6776
|
const s = this.integerBasedSort ? 20 : 24;
|
|
6777
|
-
this.splatSortDistanceMapPrecision = oe(this.splatSortDistanceMapPrecision, 10, s), this.onSplatMeshChangedCallback = null, this.createSplatMesh(), this.controls = null, this.perspectiveControls = null, this.orthographicControls = null, this.orthographicCamera = null, this.perspectiveCamera = null, this.showMeshCursor = !1, this.showControlPlane = !1, this.showInfo = !1, this.sceneHelper = null, this.sortWorker = null, this.sortRunning = !1, this.splatRenderCount = 0, this.splatSortCount = 0, this.lastSplatSortCount = 0, this.sortWorkerIndexesToSort = null, this.sortWorkerSortedIndexes = null, this.sortWorkerPrecomputedDistances = null, this.sortWorkerTransforms = null, this.preSortMessages = [], this.runAfterNextSort = [], this.selfDrivenModeRunning = !1, this.splatRenderReady = !1, this.raycaster = new Zr(), this.infoPanel = null, this.startInOrthographicMode = !1, this.currentFPS = 0, this.lastSortTime = 0, this.consecutiveRenderFrames = 0, this.previousCameraTarget = new
|
|
6777
|
+
this.splatSortDistanceMapPrecision = oe(this.splatSortDistanceMapPrecision, 10, s), this.onSplatMeshChangedCallback = null, this.createSplatMesh(), this.controls = null, this.perspectiveControls = null, this.orthographicControls = null, this.orthographicCamera = null, this.perspectiveCamera = null, this.showMeshCursor = !1, this.showControlPlane = !1, this.showInfo = !1, this.sceneHelper = null, this.sortWorker = null, this.sortRunning = !1, this.splatRenderCount = 0, this.splatSortCount = 0, this.lastSplatSortCount = 0, this.sortWorkerIndexesToSort = null, this.sortWorkerSortedIndexes = null, this.sortWorkerPrecomputedDistances = null, this.sortWorkerTransforms = null, this.preSortMessages = [], this.runAfterNextSort = [], this.selfDrivenModeRunning = !1, this.splatRenderReady = !1, this.raycaster = new Zr(), this.infoPanel = null, this.startInOrthographicMode = !1, this.currentFPS = 0, this.lastSortTime = 0, this.consecutiveRenderFrames = 0, this.previousCameraTarget = new v(), this.nextCameraTarget = new v(), this.mousePosition = new N(), this.mouseDownPosition = new N(), this.mouseDownTime = null, this.resizeObserver = null, this.mouseMoveListener = null, this.mouseDownListener = null, this.mouseUpListener = null, this.keyDownListener = null, this.sortPromise = null, this.sortPromiseResolver = null, this.splatSceneDownloadPromises = {}, this.splatSceneDownloadAndBuildPromise = null, this.splatSceneRemovalPromise = null, this.loadingSpinner = new ls(null, this.rootElement || document.body), this.loadingSpinner.hide(), this.loadingProgressBar = new qr(this.rootElement || document.body), this.loadingProgressBar.hide(), this.infoPanel = new Kr(this.rootElement || document.body), this.infoPanel.hide(), this.usingExternalCamera = !!(this.dropInMode || this.camera), this.usingExternalRenderer = !!(this.dropInMode || this.renderer), this.initialized = !1, this.disposing = !1, this.disposed = !1, this.disposePromise = null, this.dropInMode || this.init();
|
|
6778
6778
|
}
|
|
6779
6779
|
createSplatMesh() {
|
|
6780
6780
|
this.splatMesh = new ye(
|
|
@@ -6851,7 +6851,7 @@ class Ze {
|
|
|
6851
6851
|
this.onSplatMeshChangedCallback = e;
|
|
6852
6852
|
}
|
|
6853
6853
|
onKeyDown = (function() {
|
|
6854
|
-
const e = new
|
|
6854
|
+
const e = new v(), s = new J(), t = new J();
|
|
6855
6855
|
return function(n) {
|
|
6856
6856
|
switch (e.set(0, 0, -1), e.transformDirection(this.camera.matrixWorld), s.makeRotationAxis(e, Math.PI / 128), t.makeRotationAxis(e, -Math.PI / 128), n.code) {
|
|
6857
6857
|
case "KeyG":
|
|
@@ -6906,7 +6906,7 @@ class Ze {
|
|
|
6906
6906
|
this.mousePosition.set(e.offsetX, e.offsetY), this.checkForFocalPointChange();
|
|
6907
6907
|
}
|
|
6908
6908
|
checkForFocalPointChange = (function() {
|
|
6909
|
-
const e = new N(), s = new
|
|
6909
|
+
const e = new N(), s = new v(), t = [];
|
|
6910
6910
|
return function() {
|
|
6911
6911
|
if (!this.transitioningCameraTarget && (this.getRenderDimensions(e), t.length = 0, this.raycaster.setFromCameraAndScreenPosition(this.camera, this.mousePosition, e), this.raycaster.intersectSplatMesh(this.splatMesh, t), t.length > 0)) {
|
|
6912
6912
|
const r = t[0].origin;
|
|
@@ -6928,14 +6928,14 @@ class Ze {
|
|
|
6928
6928
|
}
|
|
6929
6929
|
}
|
|
6930
6930
|
static setCameraPositionFromZoom = (function() {
|
|
6931
|
-
const e = new
|
|
6931
|
+
const e = new v();
|
|
6932
6932
|
return function(s, t, n) {
|
|
6933
6933
|
const r = 1 / (t.zoom * 1e-3);
|
|
6934
6934
|
e.copy(n.target).sub(s.position).normalize().multiplyScalar(r).negate(), s.position.copy(n.target).add(e);
|
|
6935
6935
|
};
|
|
6936
6936
|
})();
|
|
6937
6937
|
static setCameraZoomFromPosition = (function() {
|
|
6938
|
-
const e = new
|
|
6938
|
+
const e = new v();
|
|
6939
6939
|
return function(s, t, n) {
|
|
6940
6940
|
const r = e.copy(n.target).sub(t.position).length();
|
|
6941
6941
|
s.zoom = 1 / (r * 1e-3);
|
|
@@ -7113,7 +7113,7 @@ class Ze {
|
|
|
7113
7113
|
l = !0;
|
|
7114
7114
|
const A = c.shift();
|
|
7115
7115
|
n(A.splatBuffer, A.firstBuild, A.finalBuild).then(() => {
|
|
7116
|
-
l = !1, A.firstBuild ? f.resolve() : A.finalBuild && (p.resolve(), this.clearSplatSceneDownloadAndBuildPromise()), c.length > 0 &&
|
|
7116
|
+
l = !1, A.firstBuild ? f.resolve() : A.finalBuild && (p.resolve(), this.clearSplatSceneDownloadAndBuildPromise()), c.length > 0 && ve(() => d());
|
|
7117
7117
|
});
|
|
7118
7118
|
}
|
|
7119
7119
|
}, u = (A, C) => {
|
|
@@ -7277,7 +7277,7 @@ class Ze {
|
|
|
7277
7277
|
l !== null && (this.loadingSpinner.removeTask(l), l = null);
|
|
7278
7278
|
};
|
|
7279
7279
|
return this.splatRenderReady = !1, new Promise((d) => {
|
|
7280
|
-
n && (l = this.loadingSpinner.addTask("Processing splats...")),
|
|
7280
|
+
n && (l = this.loadingSpinner.addTask("Processing splats...")), ve(() => {
|
|
7281
7281
|
if (this.isDisposingOrDisposed())
|
|
7282
7282
|
d();
|
|
7283
7283
|
else {
|
|
@@ -7414,7 +7414,7 @@ class Ze {
|
|
|
7414
7414
|
});
|
|
7415
7415
|
}
|
|
7416
7416
|
updateError(e, s) {
|
|
7417
|
-
return e instanceof rn ? e : e instanceof
|
|
7417
|
+
return e instanceof rn ? e : e instanceof vt ? new Error("File type or server does not support progressive loading.") : s ? new Error(s) : e;
|
|
7418
7418
|
}
|
|
7419
7419
|
disposeSortWorker() {
|
|
7420
7420
|
this.sortWorker && this.sortWorker.terminate(), this.sortWorker = null, this.sortPromise = null, this.sortPromiseResolver && (this.sortPromiseResolver(), this.sortPromiseResolver = null), this.preSortMessages = [], this.sortRunning = !1;
|
|
@@ -7513,7 +7513,7 @@ class Ze {
|
|
|
7513
7513
|
}
|
|
7514
7514
|
shouldRender = (function() {
|
|
7515
7515
|
let e = 0;
|
|
7516
|
-
const s = new
|
|
7516
|
+
const s = new v(), t = new ge(), n = 1e-4;
|
|
7517
7517
|
return function() {
|
|
7518
7518
|
if (!this.initialized || !this.splatRenderReady || this.isDisposingOrDisposed()) return !1;
|
|
7519
7519
|
let r = !1, i = !1;
|
|
@@ -7544,7 +7544,7 @@ class Ze {
|
|
|
7544
7544
|
updateFPS = (function() {
|
|
7545
7545
|
let e = Ke(), s = 0;
|
|
7546
7546
|
return function() {
|
|
7547
|
-
if (this.consecutiveRenderFrames >
|
|
7547
|
+
if (this.consecutiveRenderFrames > vo) {
|
|
7548
7548
|
const t = Ke();
|
|
7549
7549
|
t - e >= 1 ? (this.currentFPS = s, s = 0, e = t) : s++;
|
|
7550
7550
|
} else
|
|
@@ -7568,7 +7568,7 @@ class Ze {
|
|
|
7568
7568
|
};
|
|
7569
7569
|
})();
|
|
7570
7570
|
updateCameraTransition = (function() {
|
|
7571
|
-
let e = new
|
|
7571
|
+
let e = new v(), s = new v(), t = new v();
|
|
7572
7572
|
return function(n) {
|
|
7573
7573
|
if (this.transitioningCameraTarget) {
|
|
7574
7574
|
s.copy(this.previousCameraTarget).sub(this.camera.position).normalize(), t.copy(this.nextCameraTarget).sub(this.camera.position).normalize();
|
|
@@ -7590,7 +7590,7 @@ class Ze {
|
|
|
7590
7590
|
let n;
|
|
7591
7591
|
if (s ? n = 1 : n = Math.min(this.sceneHelper.getFocusMarkerOpacity(), 1), n > 0) {
|
|
7592
7592
|
this.sceneHelper.updateFocusMarker(this.nextCameraTarget, this.camera, e);
|
|
7593
|
-
let r = Math.max(n -
|
|
7593
|
+
let r = Math.max(n - Bo * t, 0);
|
|
7594
7594
|
this.sceneHelper.setFocusMarkerOpacity(r), r === 0 && this.sceneHelper.setFocusMarkerVisibility(!1);
|
|
7595
7595
|
}
|
|
7596
7596
|
n > 0 && this.forceRenderNextFrame(), s = !1;
|
|
@@ -7632,7 +7632,7 @@ class Ze {
|
|
|
7632
7632
|
this.showControlPlane ? (this.sceneHelper.setControlPlaneVisibility(!0), this.sceneHelper.positionAndOrientControlPlane(this.controls.target, this.camera.up)) : this.sceneHelper.setControlPlaneVisibility(!1);
|
|
7633
7633
|
}
|
|
7634
7634
|
runSplatSort = (function() {
|
|
7635
|
-
const e = new J(), s = [], t = new
|
|
7635
|
+
const e = new J(), s = [], t = new v(0, 0, -1), n = new v(0, 0, -1), r = new v(), i = new v(), o = [], a = [
|
|
7636
7636
|
{
|
|
7637
7637
|
angleThreshold: 0.55,
|
|
7638
7638
|
sortFractions: [0.125, 0.33333, 0.75]
|
|
@@ -7698,7 +7698,7 @@ class Ze {
|
|
|
7698
7698
|
gatherSceneNodesForSort = (function() {
|
|
7699
7699
|
const e = [];
|
|
7700
7700
|
let s = null;
|
|
7701
|
-
const t = new
|
|
7701
|
+
const t = new v(), n = new v(), r = new v(), i = new J(), o = new J(), a = new J(), l = new v(), c = new v(0, 0, -1), d = new v(), u = (h) => d.copy(h.max).sub(h.min).length();
|
|
7702
7702
|
return function(h = !1) {
|
|
7703
7703
|
this.getRenderDimensions(l);
|
|
7704
7704
|
const f = l.y / 2 / Math.tan(this.camera.fov / 2 * tn.DEG2RAD), p = Math.atan(l.x / 2 / f), A = Math.atan(l.y / 2 / f), C = Math.cos(p), g = Math.cos(A), x = this.splatMesh.getSplatTree();
|
|
@@ -7706,11 +7706,11 @@ class Ze {
|
|
|
7706
7706
|
o.copy(this.camera.matrixWorld).invert(), this.splatMesh.dynamicMode || o.multiply(this.splatMesh.matrixWorld);
|
|
7707
7707
|
let w = 0, y = 0;
|
|
7708
7708
|
for (let S = 0; S < x.subTrees.length; S++) {
|
|
7709
|
-
const
|
|
7709
|
+
const B = x.subTrees[S];
|
|
7710
7710
|
i.copy(o), this.splatMesh.dynamicMode && (this.splatMesh.getSceneTransform(S, a), i.multiply(a));
|
|
7711
|
-
const F =
|
|
7711
|
+
const F = B.nodesWithIndexes.length;
|
|
7712
7712
|
for (let D = 0; D < F; D++) {
|
|
7713
|
-
const b =
|
|
7713
|
+
const b = B.nodesWithIndexes[D];
|
|
7714
7714
|
if (!b.data || !b.data.indexes || b.data.indexes.length === 0) continue;
|
|
7715
7715
|
r.copy(b.center).applyMatrix4(i);
|
|
7716
7716
|
const R = r.length();
|
|
@@ -7719,15 +7719,15 @@ class Ze {
|
|
|
7719
7719
|
!h && (U || L) && R > O || (y += b.data.indexes.length, e[w] = b, b.data.distanceToNode = R, w++);
|
|
7720
7720
|
}
|
|
7721
7721
|
}
|
|
7722
|
-
e.length = w, e.sort((S,
|
|
7722
|
+
e.length = w, e.sort((S, B) => S.data.distanceToNode < B.data.distanceToNode ? -1 : 1);
|
|
7723
7723
|
let E = y * Y.BytesPerInt;
|
|
7724
7724
|
for (let S = 0; S < w; S++) {
|
|
7725
|
-
const
|
|
7725
|
+
const B = e[S], F = B.data.indexes.length, D = F * Y.BytesPerInt;
|
|
7726
7726
|
new Uint32Array(
|
|
7727
7727
|
this.sortWorkerIndexesToSort.buffer,
|
|
7728
7728
|
E - D,
|
|
7729
7729
|
F
|
|
7730
|
-
).set(
|
|
7730
|
+
).set(B.data.indexes), E -= D;
|
|
7731
7731
|
}
|
|
7732
7732
|
return {
|
|
7733
7733
|
splatRenderCount: y,
|
|
@@ -7915,12 +7915,13 @@ class Ro {
|
|
|
7915
7915
|
}
|
|
7916
7916
|
async loadModel(e, s = {}) {
|
|
7917
7917
|
const t = this.viewer.getSceneCount(), n = {
|
|
7918
|
-
showLoadingUI: !0,
|
|
7919
7918
|
progressiveLoad: !1,
|
|
7920
7919
|
position: [0, 0, 0],
|
|
7921
7920
|
rotation: this.getDefaultRotation(),
|
|
7922
7921
|
scale: [1, 1, 1],
|
|
7923
|
-
...s
|
|
7922
|
+
...s,
|
|
7923
|
+
// 统一关闭三方库内置加载浮层,加载进度仍通过 SDK 的事件与回调向外提供。
|
|
7924
|
+
showLoadingUI: !1
|
|
7924
7925
|
};
|
|
7925
7926
|
await this.viewer.addSplatScene(e, n);
|
|
7926
7927
|
const r = {
|
|
@@ -7954,7 +7955,7 @@ class Ro {
|
|
|
7954
7955
|
s.push(await this.loadModel(t.url, t.options));
|
|
7955
7956
|
return s;
|
|
7956
7957
|
}
|
|
7957
|
-
async unloadModel(e, s = !
|
|
7958
|
+
async unloadModel(e, s = !1) {
|
|
7958
7959
|
const t = this.scenes.get(e);
|
|
7959
7960
|
t && (await this.viewer.removeSplatScene(t.index, s), this.scenes.delete(e), this.localSceneResources.get(e)?.revoke(), this.localSceneResources.delete(e), this.reindexScenesAfterRemove(t.index));
|
|
7960
7961
|
}
|
|
@@ -7999,7 +8000,7 @@ class Lo {
|
|
|
7999
8000
|
initialCameraLookAt: e.initialCameraLookAt ?? [0, 0, 0],
|
|
8000
8001
|
backgroundColor: e.backgroundColor,
|
|
8001
8002
|
antialias: e.antialias ?? !1,
|
|
8002
|
-
showLoadingUI:
|
|
8003
|
+
showLoadingUI: !1,
|
|
8003
8004
|
sharedMemoryForWorkers: e.sharedMemoryForWorkers ?? !1,
|
|
8004
8005
|
gpuAcceleratedSort: e.gpuAcceleratedSort ?? !1,
|
|
8005
8006
|
sphericalHarmonicsDegree: e.sphericalHarmonicsDegree ?? 0,
|
|
@@ -8031,8 +8032,8 @@ class Lo {
|
|
|
8031
8032
|
this.checkInitialized(), this.eventModule.trigger(De.LoadStart, { url: e, name: s.name });
|
|
8032
8033
|
try {
|
|
8033
8034
|
const t = await this.loaderModule.loadModel(e, {
|
|
8034
|
-
showLoadingUI: !0,
|
|
8035
8035
|
...s,
|
|
8036
|
+
showLoadingUI: !1,
|
|
8036
8037
|
onProgress: (n, r, i) => {
|
|
8037
8038
|
this.eventModule.trigger(De.LoadProgress, { url: e, name: s.name, progress: n }), s.onProgress?.(n, r, i);
|
|
8038
8039
|
}
|
|
@@ -8055,8 +8056,8 @@ class Lo {
|
|
|
8055
8056
|
this.eventModule.trigger(De.LoadStart, { url: t, name: s.name ?? t });
|
|
8056
8057
|
try {
|
|
8057
8058
|
const n = await this.loaderModule.loadModelFile(e, {
|
|
8058
|
-
showLoadingUI: !0,
|
|
8059
8059
|
...s,
|
|
8060
|
+
showLoadingUI: !1,
|
|
8060
8061
|
onProgress: (r, i, o) => {
|
|
8061
8062
|
this.eventModule.trigger(De.LoadProgress, { url: t, name: s.name ?? t, progress: r }), s.onProgress?.(r, i, o);
|
|
8062
8063
|
}
|