qg3dviewer 1.0.0 → 1.0.2
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/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var or = Object.defineProperty;
|
|
2
2
|
var rr = (n, t, e) => t in n ? or(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
3
|
var sn = (n, t, e) => rr(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { Matrix4 as $t, Vector3 as Q, Vector4 as Gt, InstancedBufferGeometry as mi, BufferAttribute as Ce, InstancedBufferAttribute as cr, DynamicDrawUsage as lr, ShaderMaterial as Na, DoubleSide as Jt, NormalBlending as Ar, DataTexture as se, RGBAIntegerFormat as ae, UnsignedIntType as oe, Mesh as pt, Vector2 as ft, Loader as ur, FileLoader as hr, Color as Wi, SRGBColorSpace as dr, Group as tn, BufferGeometry as Sn, Float32BufferAttribute as Vt, LineBasicMaterial as pn, Material as Is, PointsMaterial as an, MeshPhongMaterial as gr, LineSegments as Ci, Points as qn, WebGLRenderer as
|
|
4
|
+
import { Matrix4 as $t, Vector3 as Q, Vector4 as Gt, InstancedBufferGeometry as mi, BufferAttribute as Ce, InstancedBufferAttribute as cr, DynamicDrawUsage as lr, ShaderMaterial as Na, DoubleSide as Jt, NormalBlending as Ar, DataTexture as se, RGBAIntegerFormat as ae, UnsignedIntType as oe, Mesh as pt, Vector2 as ft, Loader as ur, FileLoader as hr, Color as Wi, SRGBColorSpace as dr, Group as tn, BufferGeometry as Sn, Float32BufferAttribute as Vt, LineBasicMaterial as pn, Material as Is, PointsMaterial as an, MeshPhongMaterial as gr, LineSegments as Ci, Points as qn, WebGLRenderer as za, PerspectiveCamera as Ha, Object3D as Nn, CylinderGeometry as ws, MeshBasicMaterial as ee, PlaneGeometry as fr, Quaternion as be, Controls as pr, MOUSE as Wt, TOUCH as Zt, Spherical as Es, Ray as mr, Plane as Cr, MathUtils as te, InstancedInterleavedBuffer as yi, InterleavedBufferAttribute as ye, WireframeGeometry as yr, Box3 as $i, Sphere as Oa, ShaderLib as mn, UniformsUtils as Ya, UniformsLib as Cn, Line3 as Ir, CircleGeometry as re, Raycaster as wr, CatmullRomCurve3 as vs, Scene as Ga, AmbientLight as qa, FogExp2 as xs, DirectionalLight as Er, EventDispatcher as vr, Clock as xr } from "three";
|
|
5
5
|
import * as Ss from "@gotoeasy/three-tile";
|
|
6
6
|
let I = 1;
|
|
7
|
-
const Me = I++, Va = I++, Ie = I++, Sr = I++, Ii = I++, wi = I++, Wa = I++, Vn = I++, $a = I++, ke = I++, dt = I++, Z = I++, Ja = I++, Ei = I++, Ot = I++, Be = I++, Lt = I++, en = I++, ja = I++, Ka = I++, Xa = I++, Za = I++, to = I++, eo = I++, Ji = I++, br = I++, Mr = I++, bs = I++, ht = I++,
|
|
7
|
+
const Me = I++, Va = I++, Ie = I++, Sr = I++, Ii = I++, wi = I++, Wa = I++, Vn = I++, $a = I++, ke = I++, dt = I++, Z = I++, Ja = I++, Ei = I++, Ot = I++, Be = I++, Lt = I++, en = I++, ja = I++, Ka = I++, Xa = I++, Za = I++, to = I++, eo = I++, Ji = I++, br = I++, Mr = I++, bs = I++, ht = I++, FA = I++, it = I++, Ee = I++, ve = I++, Ms = I++, Bs = I++, Qs = I++, no = I++, Br = I++, Ds = I++, on = I++, rn = I++, ks = I++, Ts = I++, Ls = I++, ce = I++, Rs = I++, qe = I++, io = I++, Le = I++, Re = I++, yn = I++, so = I++, vi = I++, Qr = I++, bn = I++, Wn = I++, $n = I++, Mn = I++, Bn = I++, Qn = I++, Dn = I++, ao = I++, ji = I++, _ = I++, he = I++, Ve = I++, Y = I++, zn = I++, Ki = I++, Dr = I++, Ct = I++, xi = I++, St = I++, oo = I++, ro = I++, co = I++, lo = I++, Si = I++, Ao = I++, le = I++, Xi = I++, Zi = I++, He = I++, kr = I++, uo = I++, ho = I++, PA = I++, Hn = I++, Jn = I++, _s = I++, Fs = I++, bi = I++, kn = I++, Mi = I++, Oe = I++, Mt = I++, ts = I++, UA = I++, go = I++, fo = I++, cn = I++, jn = I++, Bi = I++, Tr = I++, In = I++, Tn = I++, es = I++, xe = I++, de = I++, We = I++, ln = I++, po = I++, et = I++, ct = I++, Lr = I++, Ps = I++, Ln = I++, Rn = I++, Rr = I++, ns = I++, is = I++, ne = I++, Ye = I++, Te = I++, _r = I++, mo = I++, Fr = I++, NA = I++, zA = I++, HA = I++, OA = I++, YA = I++, ie = I++, $e = I++, wn = I++, Qi = I++, Co = I++, yo = I++, Di = I++, jt = I++, Pe = I++, Io = I++, ss = I++, Us = I++, Pr = I++, Ur = I++, as = I++, os = I++, rs = I++, cs = I++, ls = I++, Je = I++, wo = I++, Ns = I++, _n = I++, xt = I++, Eo = I++, ki = I++, vo = I++, Ue = I++, xo = I++, So = I++, As = I++, bo = I++, Mo = I++, zs = I++, Bo = I++, Qo = I++, Do = I++, Ne = I++, ko = I++, Ti = I++, Nr = I++, To = I++, Fn = I++, En = I++, Pn = I++, Kn = I++, Xn = I++, Zn = I++, Li = I++, Lo = I++, Ro = I++, GA = I++, _o = I++, Fo = I++, ot = I++, Ri = I++, _i = I++, Fi = I++, zr = I++, Po = I++, Hr = I++, Or = I++, Yr = I++, Gr = I++, qr = I++, Uo = I++, No = I++, qA = I++, VA = I++, WA = I++, $A = I++, JA = I++, jA = I++, KA = I++, XA = I++, Pi = I++, Ui = I++, ti = I++, ei = I++, us = I++, Hs = I++, zo = I++, ZA = I++, tu = I++, eu = I++, nu = I++, iu = I++;
|
|
8
8
|
class hs {
|
|
9
9
|
constructor() {
|
|
10
10
|
this.functions = /* @__PURE__ */ new Map(), this.map = /* @__PURE__ */ new Map();
|
|
@@ -66,7 +66,7 @@ class Wr {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
var P = /* @__PURE__ */ ((n) => (n[n.FetchReady = 0] = "FetchReady", n[n.Fetching = 1] = "Fetching", n[n.FetchDone = 2] = "FetchDone", n[n.FetchAborted = 3] = "FetchAborted", n[n.FetchFailed = 4] = "FetchFailed", n[n.Invalid = 5] = "Invalid", n))(P || {});
|
|
69
|
-
const ds = "v2.0.0-dev", yt = navigator.userAgent.includes("Mobi"), $r = "QWERTYUIOPLKJHGFDSAZXCVBNM1234567890qwertyuioplkjhgfdsazxcvbnm`~!@#$%^&*()-_=+\\|]}[{'\";::,<.>//? ", Jr = yt ? 600 : 300, jr = yt ? 2e3 : 300, fe = 128, vn = 32, O = 32, Kr = 20, Xr = 16,
|
|
69
|
+
const ds = "v2.0.0-dev", yt = navigator.userAgent.includes("Mobi"), $r = "QWERTYUIOPLKJHGFDSAZXCVBNM1234567890qwertyuioplkjhgfdsazxcvbnm`~!@#$%^&*()-_=+\\|]}[{'\";::,<.>//? ", Jr = yt ? 600 : 300, jr = yt ? 2e3 : 300, fe = 128, vn = 32, O = 32, Kr = 20, Xr = 16, Ho = 64 * 1024, Zr = 1024 * 1e4, tc = 10240 * 1e4, Ut = 0.28209479177387814, ec = 1, Qe = 5, nc = 9, ic = 0, sc = 20, ac = 190, je = 1, Yt = 2, ge = 3, oc = 4, rc = 3141592653;
|
|
70
70
|
var Ke = /* @__PURE__ */ ((n) => (n[n.Default = 1] = "Default", n[n.ZdepthFrontNearest2010 = 2010] = "ZdepthFrontNearest2010", n[n.ZdepthFront2011 = 2011] = "ZdepthFront2011", n[n.ZdepthFrontNearFar2012 = 2012] = "ZdepthFrontNearFar2012", n[n.ZdepthFullNearFar2112 = 2112] = "ZdepthFullNearFar2112", n))(Ke || {});
|
|
71
71
|
function cc(n) {
|
|
72
72
|
if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
|
|
@@ -442,8 +442,8 @@ var Ic = /* @__PURE__ */ Ge(nn, 9, 1), wc = /* @__PURE__ */ Ge(Wo, 5, 1), ni = f
|
|
|
442
442
|
w[S++] = k;
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
var
|
|
446
|
-
C = ni(
|
|
445
|
+
var z = w.subarray(0, v), F = w.subarray(v);
|
|
446
|
+
C = ni(z), f = ni(F), h = Ge(z, C, 1), d = Ge(F, f, 1);
|
|
447
447
|
} else
|
|
448
448
|
Qt(1);
|
|
449
449
|
else {
|
|
@@ -461,8 +461,8 @@ var Ic = /* @__PURE__ */ Ge(nn, 9, 1), wc = /* @__PURE__ */ Ge(Wo, 5, 1), ni = f
|
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
r && A(g + 131072);
|
|
464
|
-
for (var
|
|
465
|
-
var k = h[ii(n, u) &
|
|
464
|
+
for (var H = (1 << C) - 1, G = (1 << f) - 1, q = u; ; q = u) {
|
|
465
|
+
var k = h[ii(n, u) & H], V = k >> 4;
|
|
466
466
|
if (u += k & 15, u > p) {
|
|
467
467
|
c && Qt(0);
|
|
468
468
|
break;
|
|
@@ -503,7 +503,7 @@ var Ic = /* @__PURE__ */ Ge(nn, 9, 1), wc = /* @__PURE__ */ Ge(Wo, 5, 1), ni = f
|
|
|
503
503
|
t.l = h, t.p = q, t.b = g, t.f = l, h && (l = 1, t.m = C, t.d = d, t.n = f);
|
|
504
504
|
} while (!l);
|
|
505
505
|
return g != e.length && s ? gs(e, 0, g) : e.subarray(0, g);
|
|
506
|
-
}, Sc = /* @__PURE__ */ new bt(0),
|
|
506
|
+
}, Sc = /* @__PURE__ */ new bt(0), zt = function(n, t) {
|
|
507
507
|
return n[t] | n[t + 1] << 8;
|
|
508
508
|
}, Tt = function(n, t) {
|
|
509
509
|
return (n[t] | n[t + 1] << 8 | n[t + 2] << 16 | n[t + 3] << 24) >>> 0;
|
|
@@ -513,9 +513,9 @@ var Ic = /* @__PURE__ */ Ge(nn, 9, 1), wc = /* @__PURE__ */ Ge(Wo, 5, 1), ni = f
|
|
|
513
513
|
function bc(n, t) {
|
|
514
514
|
return xc(n, { i: 2 }, t && t.out, t && t.dictionary);
|
|
515
515
|
}
|
|
516
|
-
var
|
|
516
|
+
var zi = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), Mc = 0;
|
|
517
517
|
try {
|
|
518
|
-
|
|
518
|
+
zi.decode(Sc, { stream: !0 }), Mc = 1;
|
|
519
519
|
} catch {
|
|
520
520
|
}
|
|
521
521
|
var Bc = function(n) {
|
|
@@ -532,26 +532,26 @@ function Qc(n, t) {
|
|
|
532
532
|
e += String.fromCharCode.apply(null, n.subarray(i, i + 16384));
|
|
533
533
|
return e;
|
|
534
534
|
} else {
|
|
535
|
-
if (
|
|
536
|
-
return
|
|
535
|
+
if (zi)
|
|
536
|
+
return zi.decode(n);
|
|
537
537
|
var a = Bc(n), o = a.s, e = a.r;
|
|
538
538
|
return e.length && Qt(8), o;
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
541
|
var Dc = function(n, t) {
|
|
542
|
-
return t + 30 +
|
|
542
|
+
return t + 30 + zt(n, t + 26) + zt(n, t + 28);
|
|
543
543
|
}, kc = function(n, t, e) {
|
|
544
|
-
var i =
|
|
545
|
-
return [
|
|
544
|
+
var i = zt(n, t + 28), a = Qc(n.subarray(t + 46, t + 46 + i), !(zt(n, t + 8) & 2048)), o = t + 46 + i, s = Tt(n, t + 20), r = e && s == 4294967295 ? Tc(n, o) : [s, Tt(n, t + 24), Tt(n, t + 42)], c = r[0], A = r[1], l = r[2];
|
|
545
|
+
return [zt(n, t + 10), c, A, a, o + zt(n, t + 30) + zt(n, t + 32), l];
|
|
546
546
|
}, Tc = function(n, t) {
|
|
547
|
-
for (;
|
|
547
|
+
for (; zt(n, t) != 1; t += 4 + zt(n, t + 2))
|
|
548
548
|
;
|
|
549
549
|
return [si(n, t + 12), si(n, t + 4), si(n, t + 20)];
|
|
550
550
|
};
|
|
551
551
|
function Lc(n, t) {
|
|
552
552
|
for (var e = {}, i = n.length - 22; Tt(n, i) != 101010256; --i)
|
|
553
553
|
(!i || n.length - i > 65558) && Qt(13);
|
|
554
|
-
var a =
|
|
554
|
+
var a = zt(n, i + 8);
|
|
555
555
|
if (!a)
|
|
556
556
|
return {};
|
|
557
557
|
var o = Tt(n, i + 16), s = o == 4294967295 || a == 65535;
|
|
@@ -593,7 +593,7 @@ function fs(n) {
|
|
|
593
593
|
d && (d.style.width = "0%");
|
|
594
594
|
}
|
|
595
595
|
})(), (async () => document.querySelector("#gsviewer .logo")?.classList.add("loading"))(), parent?.onProgress && parent.onProgress(1e-3, "0.001%"), window.onProgress && window.onProgress(1e-3, "0.001%");
|
|
596
|
-
}), e(
|
|
596
|
+
}), e(He, (h) => {
|
|
597
597
|
h && (s = h), o = !1, h !== void 0 && ((async () => {
|
|
598
598
|
const d = document.querySelector("#gsviewer #progressBarWrap");
|
|
599
599
|
d && (d.style.display = "none");
|
|
@@ -650,8 +650,8 @@ function fs(n) {
|
|
|
650
650
|
R !== void 0 && g("shDegree", `${R}`), h !== void 0 && g("renderSplatCount", `${h}`), d !== void 0 && g("visibleSplatCount", `${d}`), C !== void 0 && g("modelSplatCount", `${C}`), f !== void 0 && g("fps", f), p !== void 0 && g("realFps", `raw ${p}`), y !== void 0 && g("sort", `${y} ms (L ${i(_).qualityLevel || Qe}, ${E} B, T ${b})`), T !== void 0 && g("cuts", T === "" ? "" : `(${T} cuts)`), M && g("worker", `${M}`), S && g("scene", S), v && g("fov", v), x && g("position", x), m && g("lookUp", m), w && g("lookAt", w), w && g("viewer-version", ds);
|
|
651
651
|
let B = performance.memory || { usedJSHeapSize: 0, totalJSHeapSize: 0, jsHeapSizeLimit: 0 }, k = "", U = B.usedJSHeapSize / 1024 / 1024;
|
|
652
652
|
U > 1e3 ? k += (U / 1024).toFixed(2) + " G" : k += U.toFixed(0) + " M", k += " / ";
|
|
653
|
-
let
|
|
654
|
-
|
|
653
|
+
let z = B.totalJSHeapSize / 1024 / 1024;
|
|
654
|
+
z > 1e3 ? k += (z / 1024).toFixed(2) + " G" : k += z.toFixed(0) + " M";
|
|
655
655
|
let F = B.jsHeapSizeLimit / 1024 / 1024;
|
|
656
656
|
k += " / ", F > 1e3 ? k += (F / 1024).toFixed(2) + " G" : k += F.toFixed(0) + " M", g("memory", k), L && g("scale", L);
|
|
657
657
|
}
|
|
@@ -794,11 +794,11 @@ function Nc(n) {
|
|
|
794
794
|
}
|
|
795
795
|
return t;
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function zc(n) {
|
|
798
798
|
return new TextDecoder("utf-8").decode(n);
|
|
799
799
|
}
|
|
800
800
|
const ps = "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", ms = "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bGohESADIAJBAnRqIRIgAyACQQNsaiETIAMgAkEBdGohFCABIAJqQQhqIRUgASACQQR0akEIaiEWQQAhAQNAIAEgBWotAAAhFyABIBZqLQAAIRggASAEai0AACEZIAEgCGotAAAhGiABIAlqLQAAIRsgASAHai0AACEcIAEgBmotAAAhDiABIApqLQAAIR0gASALai0AACEgIAAgAUEDdCABIANqLQAAIAEgE2otAABBCHRyIAEgEGosAAAiHkH/AXFBEHRyIh9BgICAeHIgHyAeQQBIG7JDAACAOZQgASAVai0AACABIBJqLQAAQQh0ciABIA9qLAAAIh5B/wFxQRB0ciIfQYCAgHhyIB8gHkEASBuyQwAAgDmUIAEgFGotAAAgASARai0AAEEIdHIgASANaiwAACIeQf8BcUEQdHIiH0GAgIB4ciAfIB5BAEgbskMAAIA5lCABIAxqLQAAs0MAAIA9lEMAACDBkhAAICCzQwAAgD2UQwAAIMGSEAAgHbNDAACAPZRDAAAgwZIQAEMAAAAAQwAAgD8gGbNDAAAAw5JDAAAAPJQiISAhlCAYs0MAAADDkkMAAAA8lCIiICKUIBezQwAAAMOSQwAAADyUIiMgI5SSkpMiJJEgJEMAAAAAXRsgIiAjICEgGyAaQQh0ciAcQRB0ciAOQRh0chAEIAFBAWoiASACRw0ACwsMBAsgASgCACICQQBKBEAgASoCHCABKgIYIiSTQwD/f0eVISUgASoCFCABKgIQIiaTQwD/f0eVIScgASoCDCABQQhqIgMqAgAiKJNDAP9/R5UhKSADIAJBD2xqIQQgAyACQQ5saiEFIAMgAkENbGohBiADIAJBDGxqIQcgAyACQQtsaiEIIAMgAkEKbGohCSADIAJBCWxqIQogAyACQQN0aiELIAMgAkEHbGohDCADIAJBBmxqIQ0gAyACQQVsaiEPIAMgAkECdGohECADIAJBA2xqIREgAyACQQF0aiESIAEgAmpBCGohE0EAIQEDQCABIAVqLQAAIRQgASAGai0AACEVIAEgBGotAAAhFiABIAlqLQAAIRcgASAKai0AACEYIAEgCGotAAAhGSABIAdqLQAAIRogASALai0AACEbIAEgDGotAAAhHCAAIAFBA3QgASADai0AACABIBFqLQAAQQh0crMgKZQgKJIgASATai0AACABIBBqLQAAQQh0crMgJ5QgJpIgASASai0AACABIA9qLQAAQQh0crMgJZQgJJIgASANai0AALNDAACAPZRDAAAgwZIQACAcs0MAAIA9lEMAACDBkhAAIBuzQwAAgD2UQwAAIMGSEABDAAAAAEMAAIA/IBazQwAAAMOSQwAAADyUIiEgIZQgFbNDAAAAw5JDAAAAPJQiIiAilCAUs0MAAADDkkMAAAA8lCIjICOUkpKTIiqRICpDAAAAAF0bICIgIyAhIBggF0EIdHIgGUEQdHIgGkEYdHIQBCABQQFqIgEgAkcNAAsLDAMLQQAhAyABKAIAIgVBAEoEQANAIAEgA0EJbGoiAi0ADSEGIAItAAwhByACLQALIQggAi0ACiEJIAItAAkhCiACLQAIIQsgAi0AECEMIAItAA8hDSACLQAOIQIgACADQQR0aiIEQoCAgIAQNwIIIAQgDEEQdEGAgOAHcSANQRV0QYCAgPgBcSACQRp0QYCAgIB+cXJyNgIEIAQgBkEBdkH8AHEgB0EEdEGAH3EgCEEJdEGA4AdxIAlBDnRBgID4AXEgCkETdEGAgIA+cSALQRh0QYCAgEBxcnJycnIgAkEGdnI2AgAgA0EBaiIDIAVHDQALCwwCC0EAIQMgASgCACIHQQBKBEADQCABIANBGGxqIgItABohCCACLQAZIQkgAi0AGCEKIAItABchCyACLQAWIQwgAi0AFSENIAItAA0hDyACLQAMIRAgAi0ACyERIAItAAohEiACLQAJIRMgAi0ACCEUIAItABQhBSACLQATIRUgAi0AEiEWIAItABEhFyACLQAQIRggAi0ADyEZIAItAA4hBiAAIANBBHRqIgQgAi0AH0EFdEGAPnEgAi0AHkEKdEGAwA9xIAItAB1BD3RBgIDwA3EgAi0AHEEUdEGAgID8AHEgAi0AGyICQRl0QYCAgIB/cXJycnJBAXI2AgwgBCAVQQF0QfADcSAWQQZ0QYD8AHEgF0ELdEGAgB9xIBhBEHRBgIDgB3EgGUEVdEGAgID4AXEgBkEadEGAgICAfnFycnJyciAFQQR2cjYCBCAEIA9BAXZB/ABxIBBBBHRBgB9xIBFBCXRBgOAHcSASQQ50QYCA+AFxIBNBE3RBgICAPnEgFEEYdEGAgIBAcXJycnJyIAZBBnZyNgIAIAQgCEECdkE+cSAJQQN0QcAPcSAKQQh0QYDwA3EgC0ENdEGAgPwAcSAMQRJ0QYCAgB9xIA1BF3RBgICA4AdxIAVBHHRBgICAgHhxcnJycnJyIAJBB3ZyNgIIIANBAWoiAyAHRw0ACwsMAQtBACEDIAEoAgAiB0EASgRAA0AgASADQRVsaiICLQAaIQggAi0AGSEJIAItABghCiACLQAXIQsgAi0AFiEMIAItABUhDSACLQANIQ8gAi0ADCEQIAItAAshESACLQAKIRIgAi0ACSETIAItAAghFCACLQAUIQUgAi0AEyEVIAItABIhFiACLQARIRcgAi0AECEYIAItAA8hGSACLQAOIQYgACADQQR0aiIEIAItABxBFHRBgICA/ABxIAItABsiAkEZdEGAgICAf3FyQQFyNgIMIAQgFUEBdEHwA3EgFkEGdEGA/ABxIBdBC3RBgIAfcSAYQRB0QYCA4AdxIBlBFXRBgICA+AFxIAZBGnRBgICAgH5xcnJycnIgBUEEdnI2AgQgBCAPQQF2QfwAcSAQQQR0QYAfcSARQQl0QYDgB3EgEkEOdEGAgPgBcSATQRN0QYCAgD5xIBRBGHRBgICAQHFycnJyciAGQQZ2cjYCACAEIAhBAnZBPnEgCUEDdEHAD3EgCkEIdEGA8ANxIAtBDXRBgID8AHEgDEESdEGAgIAfcSANQRd0QYCAgOAHcSAFQRx0QYCAgIB4cXJycnJyciACQQd2cjYCCCADQQFqIgMgB0cNAAsLC0EAIQILIAIL";
|
|
801
|
-
async function
|
|
801
|
+
async function Hc(n) {
|
|
802
802
|
const t = new Uint32Array(n.buffer), e = new Float32Array(n.buffer), i = new Vr();
|
|
803
803
|
i.Fixed = String.fromCharCode(n[0]) + String.fromCharCode(n[1]) + String.fromCharCode(n[2]), i.Version = n[3], i.SplatCount = t[1], i.MinX = e[2], i.MaxX = e[3], i.MinY = e[4], i.MaxY = e[5], i.MinZ = e[6], i.MaxZ = e[7], i.MinTopY = e[8], i.MaxTopY = e[9], i.CreateDate = t[10], i.CreaterId = t[11], i.ExclusiveId = t[12], i.ShDegree = n[52], i.Flag1 = n[53], i.Flag2 = n[54], i.Flag3 = n[55], i.Reserve1 = t[14], i.Reserve2 = t[15];
|
|
804
804
|
let a = "";
|
|
@@ -827,11 +827,11 @@ async function vt(n, t = null) {
|
|
|
827
827
|
return a == ac && (n = await Fc(n)), _e(i, a, n);
|
|
828
828
|
}
|
|
829
829
|
async function _e(n, t, e) {
|
|
830
|
-
const i = je == t, a = Yt == t, o = ge == t, s = i || a || o, r = !s, A = t <= 255 || s ? ms : ps, l = n * (s ? Xr : O), u = WebAssembly.compile(Uint8Array.from(atob(A), (y) => y.charCodeAt(0)).buffer), g = Math.floor((l + e.byteLength) /
|
|
830
|
+
const i = je == t, a = Yt == t, o = ge == t, s = i || a || o, r = !s, A = t <= 255 || s ? ms : ps, l = n * (s ? Xr : O), u = WebAssembly.compile(Uint8Array.from(atob(A), (y) => y.charCodeAt(0)).buffer), g = Math.floor((l + e.byteLength) / Ho) + 2, h = new WebAssembly.Memory({ initial: g, maximum: g }), C = (await WebAssembly.instantiate(await u, { env: { memory: h, expf: On } })).exports.D, f = new Uint8Array(h.buffer);
|
|
831
831
|
return f.set(e, l), C(0, l) ? { splatCount: n, blockFormat: t, success: !1 } : { splatCount: n, blockFormat: t, success: !0, datas: f.slice(0, l), isSplat: r, isSh: s, isSh1: i, isSh2: a, isSh3: o };
|
|
832
832
|
}
|
|
833
833
|
async function Xe(n, t) {
|
|
834
|
-
const e = WebAssembly.compile(Uint8Array.from(atob(ms), (A) => A.charCodeAt(0)).buffer), i = Math.floor(t * O /
|
|
834
|
+
const e = WebAssembly.compile(Uint8Array.from(atob(ms), (A) => A.charCodeAt(0)).buffer), i = Math.floor(t * O / Ho) + 2, a = new WebAssembly.Memory({ initial: i, maximum: i }), s = (await WebAssembly.instantiate(await e, { env: { memory: a, expf: On } })).exports.s, r = new Uint8Array(a.buffer);
|
|
835
835
|
r.set(n.slice(0, t * O), 0);
|
|
836
836
|
const c = s(0, t);
|
|
837
837
|
return c ? (console.error("splat data parser failed:", c), new Uint8Array(0)) : r.slice(0, t * O);
|
|
@@ -993,24 +993,29 @@ async function Gc(n) {
|
|
|
993
993
|
console.warn(`fetch error: ${o.status}`), n.status === P.Fetching && (n.status = P.FetchFailed);
|
|
994
994
|
return;
|
|
995
995
|
}
|
|
996
|
-
const s = o.body.getReader(), r =
|
|
997
|
-
n.rowLength = 32, n.fileSize =
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
996
|
+
const s = o.body.getReader(), r = o.headers.get("content-length"), c = r ? parseInt(r) : 0;
|
|
997
|
+
if (n.rowLength = 32, n.fileSize = c, c > 0) {
|
|
998
|
+
n.modelSplatCount = c / n.rowLength | 0;
|
|
999
|
+
const u = Math.min(n.modelSplatCount, n.fetchLimit);
|
|
1000
|
+
n.splatData = new Uint8Array(u * 32);
|
|
1001
|
+
} else {
|
|
1002
|
+
const u = n.fetchLimit > 0 ? n.fetchLimit : 1e5;
|
|
1003
|
+
n.modelSplatCount = u, n.splatData = new Uint8Array(u * 32);
|
|
1002
1004
|
}
|
|
1003
|
-
n.CompressionRatio = "7.75x", n.
|
|
1005
|
+
n.CompressionRatio = "7.75x", n.downloadSplatCount = 0, n.watermarkData = new Uint8Array(0);
|
|
1004
1006
|
let A = new Uint8Array(32), l = 0;
|
|
1005
1007
|
for (; ; ) {
|
|
1006
1008
|
let { done: u, value: g } = await s.read();
|
|
1007
1009
|
if (u) break;
|
|
1008
|
-
l + g.byteLength < n.rowLength ? (A.set(g, l), l += g.byteLength, t += g.length, n.downloadSize = t) : (l = await e(n, l, A, g), l && A.set(g.slice(g.byteLength - l), 0)), n.downloadSplatCount >= n.fetchLimit
|
|
1010
|
+
if (l + g.byteLength < n.rowLength ? (A.set(g, l), l += g.byteLength, t += g.length, n.downloadSize = t) : (l = await e(n, l, A, g), l && A.set(g.slice(g.byteLength - l), 0)), n.downloadSplatCount >= n.fetchLimit) {
|
|
1011
|
+
n.abortController.abort();
|
|
1012
|
+
break;
|
|
1013
|
+
}
|
|
1009
1014
|
}
|
|
1010
1015
|
} catch (i) {
|
|
1011
1016
|
i.name === "AbortError" ? (n.opts.url, n.status === P.Fetching && (n.status = P.FetchAborted)) : (console.error(i), n.status === P.Fetching && (n.status = P.FetchFailed));
|
|
1012
1017
|
} finally {
|
|
1013
|
-
n.status === P.Fetching && (n.status = P.FetchDone);
|
|
1018
|
+
n.splatData && n.dataSplatCount * 32 < n.splatData.length && (n.splatData = n.splatData.slice(0, n.dataSplatCount * 32)), n.status === P.Fetching && (n.status = P.FetchDone);
|
|
1014
1019
|
}
|
|
1015
1020
|
async function e(i, a, o, s) {
|
|
1016
1021
|
return new Promise(async (r) => {
|
|
@@ -1031,14 +1036,25 @@ async function Gc(n) {
|
|
|
1031
1036
|
}
|
|
1032
1037
|
function qs(n, t) {
|
|
1033
1038
|
let e = t.byteLength / O;
|
|
1034
|
-
const i =
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
+
const i = (n.dataSplatCount + e) * O;
|
|
1040
|
+
if (i > n.splatData.length) {
|
|
1041
|
+
let r = Math.max(n.splatData.length * 2, i);
|
|
1042
|
+
n.fetchLimit > 0 && (r = Math.min(r, n.fetchLimit * O));
|
|
1043
|
+
const c = new Uint8Array(r);
|
|
1044
|
+
c.set(n.splatData), n.splatData = c;
|
|
1045
|
+
}
|
|
1046
|
+
const a = n.splatData.length / O;
|
|
1047
|
+
if (n.dataSplatCount + e > a) {
|
|
1048
|
+
if (e = a - n.dataSplatCount, e <= 0) return;
|
|
1049
|
+
n.splatData.set(t.slice(0, e * O), n.dataSplatCount * O);
|
|
1050
|
+
} else
|
|
1051
|
+
n.splatData.set(t, n.dataSplatCount * O);
|
|
1052
|
+
const o = new Float32Array(t.buffer);
|
|
1053
|
+
for (let r = 0, c = 0, A = 0, l = 0; r < e; r++)
|
|
1054
|
+
c = o[r * 8], A = o[r * 8 + 1], l = o[r * 8 + 2], n.minX = Math.min(n.minX, c), n.maxX = Math.max(n.maxX, c), n.minY = Math.min(n.minY, A), n.maxY = Math.max(n.maxY, A), n.minZ = Math.min(n.minZ, l), n.maxZ = Math.max(n.maxZ, l);
|
|
1039
1055
|
n.dataSplatCount += e;
|
|
1040
|
-
const
|
|
1041
|
-
n.currentRadius = Math.sqrt(n.maxX * n.maxX +
|
|
1056
|
+
const s = n.header?.MinTopY || 0;
|
|
1057
|
+
n.currentRadius = Math.sqrt(n.maxX * n.maxX + s * s + n.maxZ * n.maxZ), n.aabbCenter = new Q((n.minX + n.maxX) / 2, (n.minY + n.maxY) / 2, (n.minZ + n.maxZ) / 2), n.maxRadius = 0.5 * Math.sqrt(Math.pow(n.maxX - n.minX, 2) + Math.pow(n.maxY - n.minY, 2) + Math.pow(n.maxZ - n.minZ, 2)), n.metaMatrix && n.aabbCenter.applyMatrix4(n.metaMatrix);
|
|
1042
1058
|
}
|
|
1043
1059
|
const qc = [ic, rc];
|
|
1044
1060
|
async function Vc(n) {
|
|
@@ -1051,7 +1067,7 @@ async function Vc(n) {
|
|
|
1051
1067
|
}
|
|
1052
1068
|
const a = i.body.getReader(), o = parseInt(i.headers.get("content-length") || "0");
|
|
1053
1069
|
if (o - fe < Kr) {
|
|
1054
|
-
console.warn("data empty", n.opts.url), n.status === P.Fetching && (n.status = P.Invalid);
|
|
1070
|
+
console.warn("spx data empty", n.opts.url), n.status === P.Fetching && (n.status = P.Invalid);
|
|
1055
1071
|
return;
|
|
1056
1072
|
}
|
|
1057
1073
|
n.fileSize = o;
|
|
@@ -1069,7 +1085,7 @@ async function Vc(n) {
|
|
|
1069
1085
|
let v = 0;
|
|
1070
1086
|
for (let m = 0; m < r.length; m++)
|
|
1071
1087
|
v + r[m].byteLength < fe ? (c.set(r[m], v), v += r[m].byteLength) : (c.set(r[m].slice(0, fe - v), v), y = new Uint8Array(r[m].slice(fe - v)));
|
|
1072
|
-
const x = await
|
|
1088
|
+
const x = await Hc(c);
|
|
1073
1089
|
if (!x) {
|
|
1074
1090
|
n.abortController.abort(), n.status === P.Fetching && (n.status = P.Invalid), console.error("invalid spx format");
|
|
1075
1091
|
continue;
|
|
@@ -1269,16 +1285,16 @@ async function Jc(n) {
|
|
|
1269
1285
|
for (let S = 0, L = 0, T = 0, R = 0, B = 0; S < D; S++) {
|
|
1270
1286
|
v[m++] = s[h + (b * X + S)], L = s[f + (b * X + S) * 4 + 0], T = s[f + (b * X + S) * 4 + 1], R = s[f + (b * X + S) * 4 + 2], B = s[f + (b * X + S) * 4 + 3];
|
|
1271
1287
|
const k = L | T << 8 | R << 16 | B << 24, U = k >>> 30;
|
|
1272
|
-
let
|
|
1288
|
+
let z = k, F = 0, H = [];
|
|
1273
1289
|
for (let G = 3; G >= 0; G--)
|
|
1274
1290
|
if (G !== U) {
|
|
1275
|
-
const q =
|
|
1276
|
-
|
|
1291
|
+
const q = z & Vs, V = (z >> 9 & 1) > 0;
|
|
1292
|
+
H[G] = Math.SQRT1_2 * (q / Vs), V && (H[G] = -H[G]), F += H[G] * H[G], z = z >> 10;
|
|
1277
1293
|
}
|
|
1278
|
-
|
|
1294
|
+
H[U] = Math.sqrt(Math.max(1 - F, 0));
|
|
1279
1295
|
for (let G = 0; G < 4; G++)
|
|
1280
|
-
|
|
1281
|
-
w.push(
|
|
1296
|
+
H[G] = j(H[G] * 128 + 128);
|
|
1297
|
+
w.push(H);
|
|
1282
1298
|
}
|
|
1283
1299
|
for (let S = 0; S < D; S++)
|
|
1284
1300
|
v[m++] = w[S][0];
|
|
@@ -1306,14 +1322,14 @@ async function Jc(n) {
|
|
|
1306
1322
|
} else if (a.shDegree === 3) {
|
|
1307
1323
|
const S = new Uint8Array(D * 24 + 8), L = new Uint32Array(2);
|
|
1308
1324
|
L[0] = D, L[1] = Yt, S.set(new Uint8Array(L.buffer), 0);
|
|
1309
|
-
for (let U = 0,
|
|
1310
|
-
S.set(s.slice(p + (b * X + U) * 45, p + (b * X + U) * 45 + 24),
|
|
1325
|
+
for (let U = 0, z = 8; U < D; U++)
|
|
1326
|
+
S.set(s.slice(p + (b * X + U) * 45, p + (b * X + U) * 45 + 24), z), z += 24;
|
|
1311
1327
|
const T = await vt(S);
|
|
1312
1328
|
o.sh12Data.push(T.datas);
|
|
1313
1329
|
const R = new Uint8Array(D * 21 + 8), B = new Uint32Array(2);
|
|
1314
1330
|
B[0] = D, B[1] = ge, R.set(new Uint8Array(B.buffer), 0);
|
|
1315
|
-
for (let U = 0,
|
|
1316
|
-
R.set(s.slice(p + (b * X + U) * 45 + 24, p + (b * X + U) * 45 + 45),
|
|
1331
|
+
for (let U = 0, z = 8; U < D; U++)
|
|
1332
|
+
R.set(s.slice(p + (b * X + U) * 45 + 24, p + (b * X + U) * 45 + 45), z), z += 21;
|
|
1317
1333
|
const k = await vt(R);
|
|
1318
1334
|
o.sh3Data.push(k.datas);
|
|
1319
1335
|
}
|
|
@@ -1391,7 +1407,7 @@ async function Kc(n) {
|
|
|
1391
1407
|
if (l) break;
|
|
1392
1408
|
s.set(u, n.downloadSize), n.downloadSize += u.length;
|
|
1393
1409
|
}
|
|
1394
|
-
const r = Nc(s), c = JSON.parse(
|
|
1410
|
+
const r = Nc(s), c = JSON.parse(zc(r.get("meta.json"))), A = c.count || c.means.shape[0];
|
|
1395
1411
|
n.modelSplatCount = A, n.CompressionRatio = Un(A, o), n.sogVersion = c.version ? c.version : 1, await $s(n, r, c);
|
|
1396
1412
|
} else {
|
|
1397
1413
|
const t = await fetch(n.opts.url, { mode: "cors", credentials: "omit", cache: "reload" });
|
|
@@ -1444,12 +1460,12 @@ async function $s(n, t, e) {
|
|
|
1444
1460
|
for (let m = E, w = 0; m < b; m++) {
|
|
1445
1461
|
let M = (A[m * 4 + 0] << 8 | c[m * 4 + 0]) / 65535, S = (A[m * 4 + 1] << 8 | c[m * 4 + 1]) / 65535, L = (A[m * 4 + 2] << 8 | c[m * 4 + 2]) / 65535, T = e.means.mins[0] + (e.means.maxs[0] - e.means.mins[0]) * M, R = e.means.mins[1] + (e.means.maxs[1] - e.means.mins[1]) * S, B = e.means.mins[2] + (e.means.maxs[2] - e.means.mins[2]) * L;
|
|
1446
1462
|
T = Math.sign(T) * (Math.exp(Math.abs(T)) - 1), R = Math.sign(R) * (Math.exp(Math.abs(R)) - 1), B = Math.sign(B) * (Math.exp(Math.abs(B)) - 1);
|
|
1447
|
-
let k = l[m * 4 + 0] / 255, U = l[m * 4 + 1] / 255,
|
|
1448
|
-
k = Math.exp(e.scales.mins[0] + (e.scales.maxs[0] - e.scales.mins[0]) * k), U = Math.exp(e.scales.mins[1] + (e.scales.maxs[1] - e.scales.mins[1]) * U),
|
|
1449
|
-
let F = (u[m * 4 + 0] / 255 - 0.5) * me,
|
|
1450
|
-
V == 0 ? ($ = q, N = F, rt =
|
|
1463
|
+
let k = l[m * 4 + 0] / 255, U = l[m * 4 + 1] / 255, z = l[m * 4 + 2] / 255;
|
|
1464
|
+
k = Math.exp(e.scales.mins[0] + (e.scales.maxs[0] - e.scales.mins[0]) * k), U = Math.exp(e.scales.mins[1] + (e.scales.maxs[1] - e.scales.mins[1]) * U), z = Math.exp(e.scales.mins[2] + (e.scales.maxs[2] - e.scales.mins[2]) * z);
|
|
1465
|
+
let F = (u[m * 4 + 0] / 255 - 0.5) * me, H = (u[m * 4 + 1] / 255 - 0.5) * me, G = (u[m * 4 + 2] / 255 - 0.5) * me, q = Math.sqrt(Math.max(0, 1 - F * F - H * H - G * G)), V = u[m * 4 + 3] - 252, $, N, rt, st;
|
|
1466
|
+
V == 0 ? ($ = q, N = F, rt = H, st = G) : V == 1 ? ($ = F, N = q, rt = H, st = G) : V == 2 ? ($ = F, N = H, rt = q, st = G) : ($ = F, N = H, rt = G, st = q);
|
|
1451
1467
|
let Rt = e.sh0.mins[0] + (e.sh0.maxs[0] - e.sh0.mins[0]) * (g[m * 4 + 0] / 255), Dt = e.sh0.mins[1] + (e.sh0.maxs[1] - e.sh0.mins[1]) * (g[m * 4 + 1] / 255), W = e.sh0.mins[2] + (e.sh0.maxs[2] - e.sh0.mins[2]) * (g[m * 4 + 2] / 255), K = e.sh0.mins[3] + (e.sh0.maxs[3] - e.sh0.mins[3]) * (g[m * 4 + 3] / 255);
|
|
1452
|
-
x[w * 8 + 0] = T, x[w * 8 + 1] = R, x[w * 8 + 2] = B, x[w * 8 + 3] = k, x[w * 8 + 4] = U, x[w * 8 + 5] =
|
|
1468
|
+
x[w * 8 + 0] = T, x[w * 8 + 1] = R, x[w * 8 + 2] = B, x[w * 8 + 3] = k, x[w * 8 + 4] = U, x[w * 8 + 5] = z, v[w * 32 + 24] = j((0.5 + Ut * Rt) * 255), v[w * 32 + 25] = j((0.5 + Ut * Dt) * 255), v[w * 32 + 26] = j((0.5 + Ut * W) * 255), v[w * 32 + 27] = j(1 / (1 + Math.exp(-K)) * 255), v[w * 32 + 28] = j($ * 128 + 128), v[w * 32 + 29] = j(N * 128 + 128), v[w * 32 + 30] = j(rt * 128 + 128), v[w * 32 + 31] = j(st * 128 + 128), w++;
|
|
1453
1469
|
}
|
|
1454
1470
|
if (s > 0) {
|
|
1455
1471
|
const m = new Uint32Array(2);
|
|
@@ -1461,17 +1477,17 @@ async function $s(n, t, e) {
|
|
|
1461
1477
|
const S = new Uint8Array(8 + D * 21);
|
|
1462
1478
|
S.set(new Uint8Array(M.buffer), 0);
|
|
1463
1479
|
for (let R = E, B = 0; R < b; R++) {
|
|
1464
|
-
const k = C[R * 4 + 0] + (C[R * 4 + 1] << 8), U = (k & 63) * 15, F = (k >> 6) * d + U,
|
|
1480
|
+
const k = C[R * 4 + 0] + (C[R * 4 + 1] << 8), U = (k & 63) * 15, F = (k >> 6) * d + U, H = new Uint8Array(9), G = new Uint8Array(15), q = new Uint8Array(21);
|
|
1465
1481
|
let V;
|
|
1466
1482
|
for (let $ = 0; $ < 3; $++) {
|
|
1467
1483
|
for (let N = 0; N < 3; N++)
|
|
1468
|
-
V = (e.shN.maxs - e.shN.mins) * h[(F + N) * 4 + $] / 255 + e.shN.mins,
|
|
1484
|
+
V = (e.shN.maxs - e.shN.mins) * h[(F + N) * 4 + $] / 255 + e.shN.mins, H[N * 3 + $] = j(Math.round(V * 128) + 128);
|
|
1469
1485
|
for (let N = 0; N < 5; N++)
|
|
1470
1486
|
V = (e.shN.maxs - e.shN.mins) * h[(F + 3 + N) * 4 + $] / 255 + e.shN.mins, G[N * 3 + $] = j(Math.round(V * 128) + 128);
|
|
1471
1487
|
for (let N = 0; N < 7; N++)
|
|
1472
1488
|
V = (e.shN.maxs - e.shN.mins) * h[(F + 8 + N) * 4 + $] / 255 + e.shN.mins, q[N * 3 + $] = j(Math.round(V * 128) + 128);
|
|
1473
1489
|
}
|
|
1474
|
-
w.set(
|
|
1490
|
+
w.set(H, 8 + B * 24), w.set(G, 8 + B * 24 + 9), S.set(q, 8 + B * 21), B++;
|
|
1475
1491
|
}
|
|
1476
1492
|
const L = await vt(w);
|
|
1477
1493
|
n.sh12Data.push(L.datas);
|
|
@@ -1485,10 +1501,10 @@ async function $s(n, t, e) {
|
|
|
1485
1501
|
for (let m = E, w = 0; m < b; m++) {
|
|
1486
1502
|
let M = (A[m * 4 + 0] << 8 | c[m * 4 + 0]) / 65535, S = (A[m * 4 + 1] << 8 | c[m * 4 + 1]) / 65535, L = (A[m * 4 + 2] << 8 | c[m * 4 + 2]) / 65535, T = e.means.mins[0] + (e.means.maxs[0] - e.means.mins[0]) * M, R = e.means.mins[1] + (e.means.maxs[1] - e.means.mins[1]) * S, B = e.means.mins[2] + (e.means.maxs[2] - e.means.mins[2]) * L;
|
|
1487
1503
|
T = Math.sign(T) * (Math.exp(Math.abs(T)) - 1), R = Math.sign(R) * (Math.exp(Math.abs(R)) - 1), B = Math.sign(B) * (Math.exp(Math.abs(B)) - 1);
|
|
1488
|
-
let k = Math.exp(e.scales.codebook[l[m * 4 + 0]]), U = Math.exp(e.scales.codebook[l[m * 4 + 1]]),
|
|
1489
|
-
V == 0 ? ($ = q, N = F, rt =
|
|
1504
|
+
let k = Math.exp(e.scales.codebook[l[m * 4 + 0]]), U = Math.exp(e.scales.codebook[l[m * 4 + 1]]), z = Math.exp(e.scales.codebook[l[m * 4 + 2]]), F = (u[m * 4 + 0] / 255 - 0.5) * me, H = (u[m * 4 + 1] / 255 - 0.5) * me, G = (u[m * 4 + 2] / 255 - 0.5) * me, q = Math.sqrt(Math.max(0, 1 - F * F - H * H - G * G)), V = u[m * 4 + 3] - 252, $, N, rt, st;
|
|
1505
|
+
V == 0 ? ($ = q, N = F, rt = H, st = G) : V == 1 ? ($ = F, N = q, rt = H, st = G) : V == 2 ? ($ = F, N = H, rt = q, st = G) : ($ = F, N = H, rt = G, st = q);
|
|
1490
1506
|
let Rt = e.sh0.codebook[g[m * 4 + 0]], Dt = e.sh0.codebook[g[m * 4 + 1]], W = e.sh0.codebook[g[m * 4 + 2]], K = g[m * 4 + 3];
|
|
1491
|
-
x[w * 8 + 0] = T, x[w * 8 + 1] = R, x[w * 8 + 2] = B, x[w * 8 + 3] = k, x[w * 8 + 4] = U, x[w * 8 + 5] =
|
|
1507
|
+
x[w * 8 + 0] = T, x[w * 8 + 1] = R, x[w * 8 + 2] = B, x[w * 8 + 3] = k, x[w * 8 + 4] = U, x[w * 8 + 5] = z, v[w * 32 + 24] = j((0.5 + Ut * Rt) * 255), v[w * 32 + 25] = j((0.5 + Ut * Dt) * 255), v[w * 32 + 26] = j((0.5 + Ut * W) * 255), v[w * 32 + 27] = K, v[w * 32 + 28] = j($ * 128 + 128), v[w * 32 + 29] = j(N * 128 + 128), v[w * 32 + 30] = j(rt * 128 + 128), v[w * 32 + 31] = j(st * 128 + 128), w++;
|
|
1492
1508
|
}
|
|
1493
1509
|
if (s > 0) {
|
|
1494
1510
|
const m = new Uint32Array(2);
|
|
@@ -1500,17 +1516,17 @@ async function $s(n, t, e) {
|
|
|
1500
1516
|
const S = new Uint8Array(8 + D * 21);
|
|
1501
1517
|
S.set(new Uint8Array(M.buffer), 0);
|
|
1502
1518
|
for (let R = E, B = 0; R < b; R++) {
|
|
1503
|
-
const k = C[R * 4 + 0] + (C[R * 4 + 1] << 8), U = (k & 63) * 15, F = (k >> 6) * d + U,
|
|
1519
|
+
const k = C[R * 4 + 0] + (C[R * 4 + 1] << 8), U = (k & 63) * 15, F = (k >> 6) * d + U, H = new Uint8Array(9), G = new Uint8Array(15), q = new Uint8Array(21);
|
|
1504
1520
|
let V;
|
|
1505
1521
|
for (let $ = 0; $ < 3; $++) {
|
|
1506
1522
|
for (let N = 0; N < 3; N++)
|
|
1507
|
-
V = e.shN.codebook[h[(F + N) * 4 + $]],
|
|
1523
|
+
V = e.shN.codebook[h[(F + N) * 4 + $]], H[N * 3 + $] = j(Math.round(V * 128) + 128);
|
|
1508
1524
|
for (let N = 0; N < 5; N++)
|
|
1509
1525
|
V = e.shN.codebook[h[(F + 3 + N) * 4 + $]], G[N * 3 + $] = j(Math.round(V * 128) + 128);
|
|
1510
1526
|
for (let N = 0; N < 7; N++)
|
|
1511
1527
|
V = e.shN.codebook[h[(F + 8 + N) * 4 + $]], q[N * 3 + $] = j(Math.round(V * 128) + 128);
|
|
1512
1528
|
}
|
|
1513
|
-
w.set(
|
|
1529
|
+
w.set(H, 8 + B * 24), w.set(G, 8 + B * 24 + 9), S.set(q, 8 + B * 21), B++;
|
|
1514
1530
|
}
|
|
1515
1531
|
const L = await vt(w);
|
|
1516
1532
|
n.sh12Data.push(L.datas);
|
|
@@ -1580,12 +1596,12 @@ function Xc(n) {
|
|
|
1580
1596
|
async function C(m) {
|
|
1581
1597
|
if (i) return;
|
|
1582
1598
|
if (s && (s.status === P.Invalid || s.status === P.FetchFailed))
|
|
1583
|
-
return e(_).viewerEvents?.fire(ht), e(
|
|
1599
|
+
return e(_).viewerEvents?.fire(ht), e(He, 0) || e(it, { renderSplatCount: 0, visibleSplatCount: 0, modelSplatCount: 0 });
|
|
1584
1600
|
if (!s || !s.downloadSize) return;
|
|
1585
1601
|
const w = s.status !== P.FetchReady && s.status !== P.Fetching;
|
|
1586
1602
|
if (b(w), w) {
|
|
1587
1603
|
const M = Math.min(s.fetchLimit, s.downloadSplatCount);
|
|
1588
|
-
M && !s.notifyFetchStopDone && (s.notifyFetchStopDone = !0) && e(
|
|
1604
|
+
M && !s.notifyFetchStopDone && (s.notifyFetchStopDone = !0) && e(He, M);
|
|
1589
1605
|
} else
|
|
1590
1606
|
e(Zi, 100 * s.downloadSize / s.fileSize);
|
|
1591
1607
|
s.dataSplatCount && (A || (A = !0, setTimeout(async () => {
|
|
@@ -1605,13 +1621,13 @@ function Xc(n) {
|
|
|
1605
1621
|
e(it, { scene: `small (${q}) ${V}${$}` });
|
|
1606
1622
|
}
|
|
1607
1623
|
s.lastTextWatermarkVersion = s.textWatermarkVersion, w.textureReady = !1;
|
|
1608
|
-
const B = 1024 * 2, k = Math.ceil(2 * M / B), U = new Uint32Array(B * k * 4),
|
|
1624
|
+
const B = 1024 * 2, k = Math.ceil(2 * M / B), U = new Uint32Array(B * k * 4), z = new Float32Array(U.buffer), F = new Uint8Array(U.buffer);
|
|
1609
1625
|
F.set(s.splatData.slice(0, L * 32), 0), T && F.set(s.watermarkData.slice(0, T * 32), L * 32), R && F.set(S.slice(0, R * 32), (L + T) * 32);
|
|
1610
|
-
const
|
|
1626
|
+
const H = new Float32Array(s.renderSplatCount * 3);
|
|
1611
1627
|
for (let q = 0, V = 0; q < s.renderSplatCount; q++)
|
|
1612
|
-
|
|
1628
|
+
H[q * 3] = z[q * 8], H[q * 3 + 1] = z[q * 8 + 1], H[q * 3 + 2] = z[q * 8 + 2];
|
|
1613
1629
|
const G = Date.now();
|
|
1614
|
-
if (w.version = G, w.txdata = U, w.xyz =
|
|
1630
|
+
if (w.version = G, w.txdata = U, w.xyz = H, w.renderSplatCount = s.renderSplatCount, w.visibleSplatCount = s.downloadSplatCount + R, w.modelSplatCount = s.downloadSplatCount + R, w.watermarkCount = T + R, w.minX = s.minX, w.maxX = s.maxX, w.minY = s.minY, w.maxY = s.maxY, w.minZ = s.minZ, w.maxZ = s.maxZ, s.meta.particleMode && !g && (g = performance.now(), e(Fn, g), e(ce, !1), e(Pn, 1)), s.maxRadius && e(To, s.maxRadius), e(ki, w, s.currentRadius, s.currentRadius), a = G, m && !s.smallSceneUploadDone) {
|
|
1615
1631
|
s.smallSceneUploadDone = !0, e(xo, s.sh12Data), e(So, s.sh3Data), s.sh12Data = null, s.sh3Data = null;
|
|
1616
1632
|
const q = e(_);
|
|
1617
1633
|
e(bn, q.shDegree === void 0 ? 3 : q.shDegree), e(bi), s.meta.particleMode && setTimeout(() => {
|
|
@@ -1638,12 +1654,12 @@ function Xc(n) {
|
|
|
1638
1654
|
}
|
|
1639
1655
|
const U = Date.now();
|
|
1640
1656
|
k.version = U, k.active = !1;
|
|
1641
|
-
let
|
|
1642
|
-
const F = [],
|
|
1657
|
+
let z = 0;
|
|
1658
|
+
const F = [], H = e(Za), G = e(Lt), q = e(Ot);
|
|
1643
1659
|
for (const W of s.map.values())
|
|
1644
|
-
E(
|
|
1660
|
+
E(H, G, q, W) && (F.push(W), W.currentRenderCnt = W.splatCount, z += W.splatCount);
|
|
1645
1661
|
e(it, { cuts: `${F.length} / ${s.map.size}` });
|
|
1646
|
-
const V = Math.min(B /
|
|
1662
|
+
const V = Math.min(B / z, 1);
|
|
1647
1663
|
if (V > 0.95)
|
|
1648
1664
|
for (const W of F) W.currentRenderCnt = W.splatCount * V | 0;
|
|
1649
1665
|
else {
|
|
@@ -1681,7 +1697,7 @@ function Xc(n) {
|
|
|
1681
1697
|
const Rt = st + T + R, Dt = new Float32Array(Rt * 3);
|
|
1682
1698
|
for (let W = 0, K = 0; W < Rt; W++)
|
|
1683
1699
|
Dt[W * 3] = N[W * 8], Dt[W * 3 + 1] = N[W * 8 + 1], Dt[W * 3 + 2] = N[W * 8 + 2];
|
|
1684
|
-
k.txdata = $, k.xyz = Dt, k.renderSplatCount = Rt, k.visibleSplatCount =
|
|
1700
|
+
k.txdata = $, k.xyz = Dt, k.renderSplatCount = Rt, k.visibleSplatCount = z + s.watermarkCount + R, k.modelSplatCount = s.downloadSplatCount + R, k.watermarkCount = T + R, k.minX = s.header.MinX, k.maxX = s.header.MaxX, k.minY = s.header.MinY, k.maxY = s.header.MaxY, k.minZ = s.header.MinZ, k.maxZ = s.header.MaxZ, e(ki, k), a = U, e(it, { visibleSplatCount: k.visibleSplatCount, modelSplatCount: k.modelSplatCount });
|
|
1685
1701
|
}
|
|
1686
1702
|
function y(m, w) {
|
|
1687
1703
|
const M = m.map((T) => 1 / (T.distance + 1e-6)), S = M.reduce((T, R) => T + R, 0);
|
|
@@ -1692,11 +1708,11 @@ function Xc(n) {
|
|
|
1692
1708
|
const T = w - L, R = m.map((k, U) => k.currentRenderCnt < k.splatCount ? M[U] : 0), B = R.reduce((k, U) => k + U, 0);
|
|
1693
1709
|
m.forEach((k, U) => {
|
|
1694
1710
|
if (B > 0 && k.currentRenderCnt < k.splatCount) {
|
|
1695
|
-
const
|
|
1711
|
+
const z = Math.min(
|
|
1696
1712
|
Math.floor(R[U] / B * T),
|
|
1697
1713
|
k.splatCount - k.currentRenderCnt
|
|
1698
1714
|
);
|
|
1699
|
-
k.currentRenderCnt +=
|
|
1715
|
+
k.currentRenderCnt += z;
|
|
1700
1716
|
}
|
|
1701
1717
|
});
|
|
1702
1718
|
}
|
|
@@ -1711,11 +1727,11 @@ function Xc(n) {
|
|
|
1711
1727
|
if (s.header) {
|
|
1712
1728
|
u = !0;
|
|
1713
1729
|
const w = new Q(s.header.MinX, s.header.MinY, s.header.MinZ), M = new Q(s.header.MaxX, s.header.MaxY, s.header.MaxZ);
|
|
1714
|
-
e(Ti, w.x, w.y, w.z, M.x, M.y, M.z, s.meta.showBoundBox);
|
|
1730
|
+
e(Ti, w.x, w.y, w.z, M.x, M.y, M.z, s.meta.showBoundBox, s);
|
|
1715
1731
|
} else if (m) {
|
|
1716
1732
|
u = !0;
|
|
1717
1733
|
const w = new Q(s.minX, s.minY, s.minZ), M = new Q(s.maxX, s.maxY, s.maxZ);
|
|
1718
|
-
e(Ti, w.x, w.y, w.z, M.x, M.y, M.z, s.meta.showBoundBox);
|
|
1734
|
+
e(Ti, w.x, w.y, w.z, M.x, M.y, M.z, s.meta.showBoundBox, s);
|
|
1719
1735
|
}
|
|
1720
1736
|
}
|
|
1721
1737
|
}
|
|
@@ -1751,7 +1767,7 @@ function Xc(n) {
|
|
|
1751
1767
|
s.modelSplatCount > 0 ? (h(s.modelSplatCount), !s.meta.particleMode && s.dataSplatCount ? setTimeout(() => e(Ao), 5) : setTimeout(T, 10)) : setTimeout(T, 10);
|
|
1752
1768
|
};
|
|
1753
1769
|
if (T(), !v(s)) {
|
|
1754
|
-
console.error("Unsupported format:", m.format), e(
|
|
1770
|
+
console.error("Unsupported format:", m.format), e(He, 0);
|
|
1755
1771
|
return;
|
|
1756
1772
|
}
|
|
1757
1773
|
e(Xi), e(it, { cuts: "" });
|
|
@@ -1778,7 +1794,7 @@ const Al = `$${J++}`;
|
|
|
1778
1794
|
J++;
|
|
1779
1795
|
const ul = `$${J++}`;
|
|
1780
1796
|
J++;
|
|
1781
|
-
const hl = `$${J++}`, dl = `$${J++}`, gl = `$${J++}`, fl = `$${J++}`, pl = `$${J++}`, ml = `$${J++}`, Cl = `$${J++}`, yl = `$${J++}`, Il = `$${J++}`, wl = `$${J++}`, Ia = `$${J++}`, El = `$${J++}`, vl = `$${J++}`,
|
|
1797
|
+
const hl = `$${J++}`, dl = `$${J++}`, gl = `$${J++}`, fl = `$${J++}`, pl = `$${J++}`, ml = `$${J++}`, Cl = `$${J++}`, yl = `$${J++}`, Il = `$${J++}`, wl = `$${J++}`, Ia = `$${J++}`, El = `$${J++}`, vl = `$${J++}`, Hi = `$${J++}`, wa = `$${J++}`, Ea = `$${J++}`;
|
|
1782
1798
|
var xl = `precision highp float;\r
|
|
1783
1799
|
precision highp int;
|
|
1784
1800
|
|
|
@@ -2201,22 +2217,22 @@ function bl(n) {
|
|
|
2201
2217
|
}), e(xo, async (B) => {
|
|
2202
2218
|
if (i(Ct) || !B || !B.length) return;
|
|
2203
2219
|
const k = new Uint32Array(d * await i(Ue, 1) * 4), U = new Uint8Array(k.buffer);
|
|
2204
|
-
for (let F = 0,
|
|
2205
|
-
U.set(B[F],
|
|
2206
|
-
const
|
|
2207
|
-
|
|
2220
|
+
for (let F = 0, H = 0; F < B.length; F++)
|
|
2221
|
+
U.set(B[F], H), H += B[F].byteLength;
|
|
2222
|
+
const z = new se(k, d, x, ae, oe);
|
|
2223
|
+
z.internalFormat = "RGBA32UI", z.needsUpdate = !0, p.uniforms[ri].value = z, p.needsUpdate = !0, i(et);
|
|
2208
2224
|
}), e(So, async (B) => {
|
|
2209
2225
|
if (i(Ct) || !B || !B.length) return;
|
|
2210
2226
|
const k = new Uint32Array(d * await i(Ue, 3) * 4), U = new Uint8Array(k.buffer);
|
|
2211
|
-
for (let F = 0,
|
|
2212
|
-
U.set(B[F],
|
|
2213
|
-
const
|
|
2214
|
-
|
|
2227
|
+
for (let F = 0, H = 0; F < B.length; F++)
|
|
2228
|
+
U.set(B[F], H), H += B[F].byteLength;
|
|
2229
|
+
const z = new se(k, d, x, ae, oe);
|
|
2230
|
+
z.internalFormat = "RGBA32UI", z.needsUpdate = !0, p.uniforms[ci].value = z, p.needsUpdate = !0, i(et);
|
|
2215
2231
|
}), e(Ds, () => p), e(
|
|
2216
2232
|
on,
|
|
2217
2233
|
() => {
|
|
2218
|
-
const B = i(dt), { width: k, height: U } = i(he),
|
|
2219
|
-
|
|
2234
|
+
const B = i(dt), { width: k, height: U } = i(he), z = Math.abs(B.projectionMatrix.elements[0]) * 0.5 * k, F = Math.abs(B.projectionMatrix.elements[5]) * 0.5 * U, H = i(Ds);
|
|
2235
|
+
H.uniforms[fa].value.set(z, F), H.uniformsNeedUpdate = !0, i(et);
|
|
2220
2236
|
},
|
|
2221
2237
|
!0
|
|
2222
2238
|
), e(
|
|
@@ -2228,7 +2244,7 @@ function bl(n) {
|
|
|
2228
2244
|
!0
|
|
2229
2245
|
), e(Ls, (B) => {
|
|
2230
2246
|
p.uniforms[ra].value = B, p.uniformsNeedUpdate = !0, i(et);
|
|
2231
|
-
}), e(
|
|
2247
|
+
}), e(Hs, (B) => {
|
|
2232
2248
|
p.uniforms[Ks].value = B, p.uniformsNeedUpdate = !0, i(et);
|
|
2233
2249
|
}), e(ce, (B) => {
|
|
2234
2250
|
const k = i(_);
|
|
@@ -2251,8 +2267,8 @@ function bl(n) {
|
|
|
2251
2267
|
p.uniforms[js].value = B, p.uniformsNeedUpdate = !0, i(et);
|
|
2252
2268
|
}), e(To, (B) => {
|
|
2253
2269
|
p.uniforms[ca].value = B, p.uniformsNeedUpdate = !0, i(et);
|
|
2254
|
-
}), e(yn, (B, k, U,
|
|
2255
|
-
p.uniforms[ua].value = [B, k, U,
|
|
2270
|
+
}), e(yn, (B, k, U, z) => {
|
|
2271
|
+
p.uniforms[ua].value = [B, k, U, z ? 1 : -1], p.uniformsNeedUpdate = !0, i(et);
|
|
2256
2272
|
}), e(vi, (B = !0) => {
|
|
2257
2273
|
p.uniforms[ea].value = B, p.uniformsNeedUpdate = !0, i(et);
|
|
2258
2274
|
}), e(so, (B) => {
|
|
@@ -2292,7 +2308,7 @@ function bl(n) {
|
|
|
2292
2308
|
window.addEventListener("resize", l), e(lo, () => {
|
|
2293
2309
|
t = !0, window.removeEventListener("resize", l), i(Wn), i($n);
|
|
2294
2310
|
}), e(Li, () => {
|
|
2295
|
-
if (!i(
|
|
2311
|
+
if (!i(zo)) return;
|
|
2296
2312
|
const h = i(_), d = i(xt)?.meta || {}, C = h.qualityLevel || Qe;
|
|
2297
2313
|
if (i(bn, [0, 1, 2, 3, 3, 3, 3, 3, 3][C - 1]), yt) {
|
|
2298
2314
|
const p = [4, 3, 3, 2, 2, 2, 1, 1, 1], y = [7, 6, 5, 4, 4, 3, 2, 2, 2], E = d.minPixelDiameter || p[C - 1], b = d.maxPixelDiameter || (C < 4 ? 128 : C > 6 ? 512 : 256);
|
|
@@ -2322,7 +2338,7 @@ function bl(n) {
|
|
|
2322
2338
|
}), e(Si, (h = !1) => {
|
|
2323
2339
|
if (i(Ct)) return;
|
|
2324
2340
|
const d = i(_);
|
|
2325
|
-
if (i(
|
|
2341
|
+
if (i(Hs, d.transitionEffect), d.transitionEffect === Yn.ModelCenterCirccle) {
|
|
2326
2342
|
for (; s.length; ) s.pop().stop = !0;
|
|
2327
2343
|
const C = a * 1e-3;
|
|
2328
2344
|
let f = { currentPointMode: d.pointcloudMode, stepRate: 15e-4, currentLightRadius: C, stop: !1 };
|
|
@@ -2373,7 +2389,7 @@ function bl(n) {
|
|
|
2373
2389
|
u.onmessage = (h) => {
|
|
2374
2390
|
const d = h.data;
|
|
2375
2391
|
if (d[ma]) {
|
|
2376
|
-
r = d[vl], c = d[
|
|
2392
|
+
r = d[vl], c = d[Hi];
|
|
2377
2393
|
const C = d[ma];
|
|
2378
2394
|
i(ks, C, d[Ca], d[ol], d[al], d[ya]), C.length && u.postMessage({ [el]: C }, [C.buffer]);
|
|
2379
2395
|
}
|
|
@@ -2795,14 +2811,14 @@ function Rl(n) {
|
|
|
2795
2811
|
for (const u of r.keys())
|
|
2796
2812
|
A - u <= 1e3 ? l++ : c.push(u);
|
|
2797
2813
|
return c.forEach((u) => r.delete(u)), Math.min(l, 30);
|
|
2798
|
-
}), window.addEventListener("beforeunload", () => i(
|
|
2814
|
+
}), window.addEventListener("beforeunload", () => i(zn)), e(Bo, async (r) => {
|
|
2799
2815
|
i(it, { scene: "small (obj)" });
|
|
2800
2816
|
const c = await Xt(r, n);
|
|
2801
2817
|
if (c) {
|
|
2802
2818
|
const A = URL.createObjectURL(new Blob([c], { type: "application/octet-stream" }));
|
|
2803
2819
|
new Ll().load(A, (l) => i(Y).add(l)), i(ct, !0), i(Je, !0);
|
|
2804
2820
|
}
|
|
2805
|
-
i(
|
|
2821
|
+
i(He, 0);
|
|
2806
2822
|
});
|
|
2807
2823
|
}
|
|
2808
2824
|
function _l(n) {
|
|
@@ -2817,14 +2833,14 @@ function Fl(n) {
|
|
|
2817
2833
|
let t;
|
|
2818
2834
|
n.root ? t = typeof n.root == "string" ? document.querySelector(n.root) || document.querySelector("#gsviewer") : n.root : t = document.querySelector("#gsviewer"), t || (t = document.createElement("div"), t.id = "gsviewer", document.body.appendChild(t));
|
|
2819
2835
|
let e = null;
|
|
2820
|
-
return n.renderer ? e = n.renderer : (e = new
|
|
2836
|
+
return n.renderer ? e = n.renderer : (e = new za({ antialias: !1, stencil: !0, logarithmicDepthBuffer: !0, precision: "highp" }), e.setSize(t.clientWidth, t.clientHeight), e.setPixelRatio(Math.min(devicePixelRatio, 2)), n.renderer = e), e.domElement.classList.add("gsviewer-canvas"), t.appendChild(e.domElement), e;
|
|
2821
2837
|
}
|
|
2822
2838
|
function Pl(n) {
|
|
2823
2839
|
let t = n.camera;
|
|
2824
2840
|
if (!t) {
|
|
2825
2841
|
const e = n.renderer.domElement, i = e.width / e.height;
|
|
2826
2842
|
let a = new Q().fromArray(n.lookUp), o = new Q().fromArray(n.lookAt), s = new Q().fromArray(n.position);
|
|
2827
|
-
t = new
|
|
2843
|
+
t = new Ha(n.fov, i, n.near, n.far), t.position.copy(s), t.up.copy(a).normalize(), t.lookAt(o), n.camera = t;
|
|
2828
2844
|
}
|
|
2829
2845
|
return n.camera;
|
|
2830
2846
|
}
|
|
@@ -2854,7 +2870,7 @@ function Nl(n) {
|
|
|
2854
2870
|
t && (self.URL || self.webkitURL).revokeObjectURL(t);
|
|
2855
2871
|
}
|
|
2856
2872
|
}
|
|
2857
|
-
function
|
|
2873
|
+
function zl(n) {
|
|
2858
2874
|
const t = (a, o, s) => n.on(a, o, s), e = (a, ...o) => n.fire(a, ...o), i = new Nl();
|
|
2859
2875
|
t($a, () => i), t(
|
|
2860
2876
|
to,
|
|
@@ -2868,7 +2884,7 @@ function Hl(n) {
|
|
|
2868
2884
|
() => i.postMessage({
|
|
2869
2885
|
[El]: !0,
|
|
2870
2886
|
[Ia]: e(Pi),
|
|
2871
|
-
[
|
|
2887
|
+
[Hi]: e(Ui),
|
|
2872
2888
|
[wa]: e(xt)?.meta?.depthNearRate,
|
|
2873
2889
|
[Ea]: e(xt)?.meta?.depthNearValue
|
|
2874
2890
|
})
|
|
@@ -2877,12 +2893,12 @@ function Hl(n) {
|
|
|
2877
2893
|
[ll]: await e(Ee),
|
|
2878
2894
|
[cl]: e(Ct),
|
|
2879
2895
|
[Ia]: e(Pi),
|
|
2880
|
-
[
|
|
2896
|
+
[Hi]: e(Ui),
|
|
2881
2897
|
[wa]: e(xt)?.meta?.depthNearRate,
|
|
2882
2898
|
[Ea]: e(xt)?.meta?.depthNearValue
|
|
2883
2899
|
}))();
|
|
2884
2900
|
}
|
|
2885
|
-
class
|
|
2901
|
+
class Hl extends Nn {
|
|
2886
2902
|
constructor(t = 0, e = 0, i = 0, a = 0, o = 0, s = 0) {
|
|
2887
2903
|
super();
|
|
2888
2904
|
const r = this, c = new Sn(), A = new pn({ color: "#ffffff" });
|
|
@@ -2915,6 +2931,27 @@ class zl extends Nn {
|
|
|
2915
2931
|
this.boxLines = null;
|
|
2916
2932
|
}
|
|
2917
2933
|
}
|
|
2934
|
+
function Ol(n, t) {
|
|
2935
|
+
const e = new DataView(n.buffer, n.byteOffset), i = 32, a = 500;
|
|
2936
|
+
let o = [], s = { x: 0, y: 0, z: 0 };
|
|
2937
|
+
for (let h = 0; h < t; h += a) {
|
|
2938
|
+
const d = h * i, C = e.getFloat32(d + 0, !0), f = e.getFloat32(d + 4, !0), p = e.getFloat32(d + 8, !0);
|
|
2939
|
+
o.push({ x: C, y: f, z: p }), s.x += C, s.y += f, s.z += p;
|
|
2940
|
+
}
|
|
2941
|
+
s.x /= o.length, s.y /= o.length, s.z /= o.length;
|
|
2942
|
+
let r = 0, c = 0, A = 0;
|
|
2943
|
+
for (let h of o) {
|
|
2944
|
+
const d = h.x - s.x, C = h.y - s.y, f = h.z - s.z;
|
|
2945
|
+
r += d * f, c += C * f, A += f * f;
|
|
2946
|
+
}
|
|
2947
|
+
let l = {
|
|
2948
|
+
x: r / o.length,
|
|
2949
|
+
y: c / o.length,
|
|
2950
|
+
z: A / o.length
|
|
2951
|
+
};
|
|
2952
|
+
const u = Math.sqrt(l.x ** 2 + l.y ** 2 + l.z ** 2), g = { x: l.x / u, y: l.y / u, z: l.z / u };
|
|
2953
|
+
return g.z < 0 && (g.x *= -1, g.y *= -1, g.z *= -1), g;
|
|
2954
|
+
}
|
|
2918
2955
|
class Nt extends pt {
|
|
2919
2956
|
/**
|
|
2920
2957
|
* 构造函数
|
|
@@ -2925,14 +2962,16 @@ class Nt extends pt {
|
|
|
2925
2962
|
const e = this, i = new hs(), a = (l, u, g) => i.on(l, u, g), o = (l, ...u) => i.fire(l, ...u);
|
|
2926
2963
|
let s = !1;
|
|
2927
2964
|
const r = _l(t), c = r.controls.object;
|
|
2928
|
-
a(_, () => r), a(ke, () => r.renderer.domElement), a(dt, () => c), a(en, () => c.fov), a(Lt, (l = !1) => l ? c.position.clone() : c.position), a(Ot, (l = !1) => l ? r.controls.target.clone() : r.controls.target), a(Xa, () => c.projectionMatrix.clone().multiply(c.matrixWorldInverse).multiply(e.matrix).toArray()), a(Za, () => c.projectionMatrix.clone().multiply(c.matrixWorldInverse)), a(fo, () => c.getWorldDirection(new Q()).toArray()), a(Ve, () => r.renderer), a(Y, () => r.scene), a(Ct, () => r.bigSceneMode), a(xi, () => r.pointcloudMode), a(xt, () => e), a(Pi, () => r.qualityLevel || Qe), a(Ui, () => r.sortType || Ke.Default), a(
|
|
2965
|
+
a(_, () => r), a(ke, () => r.renderer.domElement), a(dt, () => c), a(en, () => c.fov), a(Lt, (l = !1) => l ? c.position.clone() : c.position), a(Ot, (l = !1) => l ? r.controls.target.clone() : r.controls.target), a(Xa, () => c.projectionMatrix.clone().multiply(c.matrixWorldInverse).multiply(e.matrix).toArray()), a(Za, () => c.projectionMatrix.clone().multiply(c.matrixWorldInverse)), a(fo, () => c.getWorldDirection(new Q()).toArray()), a(Ve, () => r.renderer), a(Y, () => r.scene), a(Ct, () => r.bigSceneMode), a(xi, () => r.pointcloudMode), a(xt, () => e), a(Pi, () => r.qualityLevel || Qe), a(Ui, () => r.sortType || Ke.Default), a(zo, () => s), a(et, () => r.viewerEvents?.fire(ct)), fs(i), Xc(i), zl(i), bl(i), Ml(i), e.name = `${r.name || e.id}`, e.events = i, e.opts = r, (async () => (e.copy(await i.fire(no)), e.meta.transform && e.applyMatrix4(new $t().fromArray(e.meta.transform)), e.frustumCulled = !1, e.onBeforeRender = () => {
|
|
2929
2966
|
o(to), o(so, performance.now());
|
|
2930
2967
|
}, e.onAfterRender = () => {
|
|
2931
2968
|
o(ro, 1e4) && o(et);
|
|
2932
2969
|
}, s = !0, o(Li)))();
|
|
2933
|
-
const A = new
|
|
2934
|
-
A.visible = !1, A.renderOrder = 99999, e.boundBox = A, e.add(A), a(Ti, (l, u, g, h, d, C, f) => {
|
|
2970
|
+
const A = new Hl();
|
|
2971
|
+
A.visible = !1, A.renderOrder = 99999, e.boundBox = A, e.add(A), a(Ti, (l, u, g, h, d, C, f, p) => {
|
|
2935
2972
|
A.update(l, u, g, h, d, C, f);
|
|
2973
|
+
const y = Ol(p.splatData, p.dataSplatCount);
|
|
2974
|
+
e.dir = new Q(y.x, y.y, y.z), e.len = C - g;
|
|
2936
2975
|
}), a(Nr, (l = !0) => A.visible = l);
|
|
2937
2976
|
}
|
|
2938
2977
|
/**
|
|
@@ -2971,7 +3010,7 @@ class Nt extends pt {
|
|
|
2971
3010
|
e(jt, t), e(jt, t.boundBox), e(Y).remove(t), e(Y).remove(t.boundBox), e(ji), e(co), e(eo), e(lo), t.events.clear(), t.events = null, t.opts = null, t.onAfterRender = null, t.boundBox = null;
|
|
2972
3011
|
}
|
|
2973
3012
|
}
|
|
2974
|
-
class
|
|
3013
|
+
class Yl extends Nn {
|
|
2975
3014
|
constructor(t = new Q(0, 0, 1), e = new Q(0, 0, 0), i = 1, a = 0.1, o = 16776960, s = i * 0.2, r = s * 0.2) {
|
|
2976
3015
|
super(), this._axis = new Q(), this.type = "ArrowHelper";
|
|
2977
3016
|
const c = new ws(a, a, i, 32);
|
|
@@ -3004,7 +3043,7 @@ class Ol extends Nn {
|
|
|
3004
3043
|
this.line.geometry.dispose(), this.line.material.dispose(), this.cone.geometry.dispose(), this.cone.material.dispose();
|
|
3005
3044
|
}
|
|
3006
3045
|
}
|
|
3007
|
-
function
|
|
3046
|
+
function Gl(n) {
|
|
3008
3047
|
const t = (C, f, p) => n.on(C, f, p), e = (C, ...f) => n.fire(C, ...f), i = new fr(1, 1);
|
|
3009
3048
|
i.rotateX(-Math.PI / 2);
|
|
3010
3049
|
const a = new ee({ color: 16777215 });
|
|
@@ -3013,7 +3052,7 @@ function Yl(n) {
|
|
|
3013
3052
|
o.ignoreIntersect = !0;
|
|
3014
3053
|
const s = new Q(0, -1, 0);
|
|
3015
3054
|
s.normalize();
|
|
3016
|
-
const r = new Q(0, 0, 0), c = 0.5, A = 0.01, l = 16777062, u = 0.1, g = 0.03, h = new
|
|
3055
|
+
const r = new Q(0, 0, 0), c = 0.5, A = 0.01, l = 16777062, u = 0.1, g = 0.03, h = new Yl(s, r, c, A, l, u, g), d = new Nn();
|
|
3017
3056
|
d.add(o), d.add(h), d.renderOrder = 99999, o.renderOrder = 99999, d.visible = !1, e(Y).add(d), t(Tr, () => d), t(In, (C) => {
|
|
3018
3057
|
e(Tn, !0), d.visible = C === void 0 ? !d.visible : C, e(ct);
|
|
3019
3058
|
}), t(es, () => d.visible), t(Tn, (C = !1) => {
|
|
@@ -3023,7 +3062,7 @@ function Yl(n) {
|
|
|
3023
3062
|
}
|
|
3024
3063
|
});
|
|
3025
3064
|
}
|
|
3026
|
-
const Qa = { type: "change" }, Cs = { type: "start" }, jo = { type: "end" }, hn = new mr(), Da = new Cr(),
|
|
3065
|
+
const Qa = { type: "change" }, Cs = { type: "start" }, jo = { type: "end" }, hn = new mr(), Da = new Cr(), ql = Math.cos(70 * te.DEG2RAD), at = new Q(), wt = 2 * Math.PI, tt = {
|
|
3027
3066
|
NONE: -1,
|
|
3028
3067
|
ROTATE: 0,
|
|
3029
3068
|
DOLLY: 1,
|
|
@@ -3035,7 +3074,7 @@ const Qa = { type: "change" }, Cs = { type: "start" }, jo = { type: "end" }, hn
|
|
|
3035
3074
|
}, di = 1e-6;
|
|
3036
3075
|
class Ko extends pr {
|
|
3037
3076
|
constructor(t, e = null) {
|
|
3038
|
-
super(t, e), this.state = tt.NONE, this.enabled = !0, this.target = new Q(), this.cursor = new Q(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 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: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Wt.ROTATE, MIDDLE: Wt.DOLLY, RIGHT: Wt.PAN }, this.touches = { ONE: Zt.ROTATE, TWO: Zt.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new Q(), this._lastQuaternion = new be(), this._lastTargetPosition = new Q(), this._quat = new be().setFromUnitVectors(t.up, new Q(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Es(), this._sphericalDelta = new Es(), this._scale = 1, this._panOffset = new Q(), this._rotateStart = new ft(), this._rotateEnd = new ft(), this._rotateDelta = new ft(), this._panStart = new ft(), this._panEnd = new ft(), this._panDelta = new ft(), this._dollyStart = new ft(), this._dollyEnd = new ft(), this._dollyDelta = new ft(), this._dollyDirection = new Q(), this._mouse = new ft(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove =
|
|
3077
|
+
super(t, e), this.state = tt.NONE, this.enabled = !0, this.target = new Q(), this.cursor = new Q(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 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: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Wt.ROTATE, MIDDLE: Wt.DOLLY, RIGHT: Wt.PAN }, this.touches = { ONE: Zt.ROTATE, TWO: Zt.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new Q(), this._lastQuaternion = new be(), this._lastTargetPosition = new Q(), this._quat = new be().setFromUnitVectors(t.up, new Q(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Es(), this._sphericalDelta = new Es(), this._scale = 1, this._panOffset = new Q(), this._rotateStart = new ft(), this._rotateEnd = new ft(), this._rotateDelta = new ft(), this._panStart = new ft(), this._panEnd = new ft(), this._panDelta = new ft(), this._dollyStart = new ft(), this._dollyEnd = new ft(), this._dollyDelta = new ft(), this._dollyDirection = new Q(), this._mouse = new ft(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Wl.bind(this), this._onPointerDown = Vl.bind(this), this._onPointerUp = $l.bind(this), this._onContextMenu = eA.bind(this), this._onMouseWheel = Kl.bind(this), this._onKeyDown = Xl.bind(this), this._onTouchStart = Zl.bind(this), this._onTouchMove = tA.bind(this), this._onMouseDown = Jl.bind(this), this._onMouseMove = jl.bind(this), this._interceptControlDown = nA.bind(this), this._interceptControlUp = iA.bind(this), this.domElement !== null && this.connect(), this.update();
|
|
3039
3078
|
}
|
|
3040
3079
|
connect() {
|
|
3041
3080
|
this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
|
|
@@ -3095,7 +3134,7 @@ class Ko extends pr {
|
|
|
3095
3134
|
A.unproject(this.object), this.object.position.sub(A).add(r), this.object.updateMatrixWorld(), s = at.length();
|
|
3096
3135
|
} else
|
|
3097
3136
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
3098
|
-
s !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position) : (hn.origin.copy(this.object.position), hn.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(hn.direction)) <
|
|
3137
|
+
s !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position) : (hn.origin.copy(this.object.position), hn.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(hn.direction)) < ql ? this.object.lookAt(this.target) : (Da.setFromNormalAndCoplanarPoint(this.object.up, this.target), hn.intersectPlane(Da, this.target))));
|
|
3099
3138
|
} else if (this.object.isOrthographicCamera) {
|
|
3100
3139
|
const s = this.object.zoom;
|
|
3101
3140
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), s !== this.object.zoom && (this.object.updateProjectionMatrix(), o = !0);
|
|
@@ -3292,13 +3331,13 @@ class Ko extends pr {
|
|
|
3292
3331
|
return t.ctrlKey && !this._controlActive && (i.deltaY *= 10), i;
|
|
3293
3332
|
}
|
|
3294
3333
|
}
|
|
3295
|
-
function
|
|
3334
|
+
function Vl(n) {
|
|
3296
3335
|
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(n.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(n) && (this._addPointer(n), n.pointerType === "touch" ? this._onTouchStart(n) : this._onMouseDown(n)));
|
|
3297
3336
|
}
|
|
3298
|
-
function
|
|
3337
|
+
function Wl(n) {
|
|
3299
3338
|
this.enabled !== !1 && (n.pointerType === "touch" ? this._onTouchMove(n) : this._onMouseMove(n));
|
|
3300
3339
|
}
|
|
3301
|
-
function
|
|
3340
|
+
function $l(n) {
|
|
3302
3341
|
switch (this._removePointer(n), this._pointers.length) {
|
|
3303
3342
|
case 0:
|
|
3304
3343
|
this.domElement.releasePointerCapture(n.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(jo), this.state = tt.NONE;
|
|
@@ -3309,7 +3348,7 @@ function Wl(n) {
|
|
|
3309
3348
|
break;
|
|
3310
3349
|
}
|
|
3311
3350
|
}
|
|
3312
|
-
function
|
|
3351
|
+
function Jl(n) {
|
|
3313
3352
|
let t;
|
|
3314
3353
|
switch (n.button) {
|
|
3315
3354
|
case 0:
|
|
@@ -3352,7 +3391,7 @@ function $l(n) {
|
|
|
3352
3391
|
}
|
|
3353
3392
|
this.state !== tt.NONE && this.dispatchEvent(Cs);
|
|
3354
3393
|
}
|
|
3355
|
-
function
|
|
3394
|
+
function jl(n) {
|
|
3356
3395
|
switch (this.state) {
|
|
3357
3396
|
case tt.ROTATE:
|
|
3358
3397
|
if (this.enableRotate === !1) return;
|
|
@@ -3368,13 +3407,13 @@ function Jl(n) {
|
|
|
3368
3407
|
break;
|
|
3369
3408
|
}
|
|
3370
3409
|
}
|
|
3371
|
-
function
|
|
3410
|
+
function Kl(n) {
|
|
3372
3411
|
this.enabled === !1 || this.enableZoom === !1 || this.state !== tt.NONE || (n.preventDefault(), this.dispatchEvent(Cs), this._handleMouseWheel(this._customWheelEvent(n)), this.dispatchEvent(jo));
|
|
3373
3412
|
}
|
|
3374
|
-
function
|
|
3413
|
+
function Xl(n) {
|
|
3375
3414
|
this.enabled !== !1 && this._handleKeyDown(n);
|
|
3376
3415
|
}
|
|
3377
|
-
function
|
|
3416
|
+
function Zl(n) {
|
|
3378
3417
|
switch (this._trackPointer(n), this._pointers.length) {
|
|
3379
3418
|
case 1:
|
|
3380
3419
|
switch (this.touches.ONE) {
|
|
@@ -3409,7 +3448,7 @@ function Xl(n) {
|
|
|
3409
3448
|
}
|
|
3410
3449
|
this.state !== tt.NONE && this.dispatchEvent(Cs);
|
|
3411
3450
|
}
|
|
3412
|
-
function
|
|
3451
|
+
function tA(n) {
|
|
3413
3452
|
switch (this._trackPointer(n), this.state) {
|
|
3414
3453
|
case tt.TOUCH_ROTATE:
|
|
3415
3454
|
if (this.enableRotate === !1) return;
|
|
@@ -3431,16 +3470,16 @@ function Zl(n) {
|
|
|
3431
3470
|
this.state = tt.NONE;
|
|
3432
3471
|
}
|
|
3433
3472
|
}
|
|
3434
|
-
function
|
|
3473
|
+
function eA(n) {
|
|
3435
3474
|
this.enabled !== !1 && n.preventDefault();
|
|
3436
3475
|
}
|
|
3437
|
-
function
|
|
3476
|
+
function nA(n) {
|
|
3438
3477
|
n.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
3439
3478
|
}
|
|
3440
|
-
function
|
|
3479
|
+
function iA(n) {
|
|
3441
3480
|
n.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
3442
3481
|
}
|
|
3443
|
-
class
|
|
3482
|
+
class sA extends Ko {
|
|
3444
3483
|
constructor(t) {
|
|
3445
3484
|
const e = t.camera;
|
|
3446
3485
|
super(e, t.renderer.domElement);
|
|
@@ -3461,7 +3500,7 @@ class iA extends Ko {
|
|
|
3461
3500
|
this._quat?.setFromUnitVectors?.(this.object.up, new Q(0, 1, 0)), this._quatInverse = this._quat?.clone?.()?.invert?.();
|
|
3462
3501
|
}
|
|
3463
3502
|
}
|
|
3464
|
-
class
|
|
3503
|
+
class aA extends Ko {
|
|
3465
3504
|
constructor(t, e) {
|
|
3466
3505
|
super(t, e), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Wt.PAN, MIDDLE: Wt.DOLLY, RIGHT: Wt.ROTATE }, this.touches = { ONE: Zt.PAN, TWO: Zt.DOLLY_ROTATE };
|
|
3467
3506
|
}
|
|
@@ -3999,19 +4038,19 @@ class De extends Na {
|
|
|
3999
4038
|
}
|
|
4000
4039
|
}
|
|
4001
4040
|
const gi = new Gt(), Ta = new Q(), La = new Q(), lt = new Gt(), At = new Gt(), _t = new Gt(), fi = new Q(), pi = new $t(), ut = new Ir(), Ra = new Q(), gn = new $i(), fn = new Oa(), Ft = new Gt();
|
|
4002
|
-
let
|
|
4041
|
+
let Ht, Ae;
|
|
4003
4042
|
function _a(n, t, e) {
|
|
4004
4043
|
return Ft.set(0, 0, -t, 1).applyMatrix4(n.projectionMatrix), Ft.multiplyScalar(1 / Ft.w), Ft.x = Ae / e.width, Ft.y = Ae / e.height, Ft.applyMatrix4(n.projectionMatrixInverse), Ft.multiplyScalar(1 / Ft.w), Math.abs(Math.max(Ft.x, Ft.y));
|
|
4005
4044
|
}
|
|
4006
|
-
function
|
|
4045
|
+
function oA(n, t) {
|
|
4007
4046
|
const e = n.matrixWorld, i = n.geometry, a = i.attributes.instanceStart, o = i.attributes.instanceEnd, s = Math.min(i.instanceCount, a.count);
|
|
4008
4047
|
for (let r = 0, c = s; r < c; r++) {
|
|
4009
4048
|
ut.start.fromBufferAttribute(a, r), ut.end.fromBufferAttribute(o, r), ut.applyMatrix4(e);
|
|
4010
4049
|
const A = new Q(), l = new Q();
|
|
4011
|
-
|
|
4050
|
+
Ht.distanceSqToSegment(ut.start, ut.end, l, A), l.distanceTo(A) < Ae * 0.5 && t.push({
|
|
4012
4051
|
point: l,
|
|
4013
4052
|
pointOnLine: A,
|
|
4014
|
-
distance:
|
|
4053
|
+
distance: Ht.origin.distanceTo(l),
|
|
4015
4054
|
object: n,
|
|
4016
4055
|
face: null,
|
|
4017
4056
|
faceIndex: r,
|
|
@@ -4020,9 +4059,9 @@ function aA(n, t) {
|
|
|
4020
4059
|
});
|
|
4021
4060
|
}
|
|
4022
4061
|
}
|
|
4023
|
-
function
|
|
4062
|
+
function rA(n, t, e) {
|
|
4024
4063
|
const i = t.projectionMatrix, o = n.material.resolution, s = n.matrixWorld, r = n.geometry, c = r.attributes.instanceStart, A = r.attributes.instanceEnd, l = Math.min(r.instanceCount, c.count), u = -t.near;
|
|
4025
|
-
|
|
4064
|
+
Ht.at(1, _t), _t.w = 1, _t.applyMatrix4(t.matrixWorldInverse), _t.applyMatrix4(i), _t.multiplyScalar(1 / _t.w), _t.x *= o.x / 2, _t.y *= o.y / 2, _t.z = 0, fi.copy(_t), pi.multiplyMatrices(t.matrixWorldInverse, s);
|
|
4026
4065
|
for (let g = 0, h = l; g < h; g++) {
|
|
4027
4066
|
if (lt.fromBufferAttribute(c, g), At.fromBufferAttribute(A, g), lt.w = 1, At.w = 1, lt.applyMatrix4(pi), At.applyMatrix4(pi), lt.z > u && At.z > u)
|
|
4028
4067
|
continue;
|
|
@@ -4040,10 +4079,10 @@ function oA(n, t, e) {
|
|
|
4040
4079
|
if (p && y) {
|
|
4041
4080
|
ut.start.fromBufferAttribute(c, g), ut.end.fromBufferAttribute(A, g), ut.start.applyMatrix4(s), ut.end.applyMatrix4(s);
|
|
4042
4081
|
const E = new Q(), b = new Q();
|
|
4043
|
-
|
|
4082
|
+
Ht.distanceSqToSegment(ut.start, ut.end, b, E), e.push({
|
|
4044
4083
|
point: b,
|
|
4045
4084
|
pointOnLine: E,
|
|
4046
|
-
distance:
|
|
4085
|
+
distance: Ht.origin.distanceTo(b),
|
|
4047
4086
|
object: n,
|
|
4048
4087
|
face: null,
|
|
4049
4088
|
faceIndex: g,
|
|
@@ -4053,7 +4092,7 @@ function oA(n, t, e) {
|
|
|
4053
4092
|
}
|
|
4054
4093
|
}
|
|
4055
4094
|
}
|
|
4056
|
-
class
|
|
4095
|
+
class cA extends pt {
|
|
4057
4096
|
constructor(t = new Xo(), e = new De({ color: Math.random() * 16777215 })) {
|
|
4058
4097
|
super(t, e), this.isLineSegments2 = !0, this.type = "LineSegments2";
|
|
4059
4098
|
}
|
|
@@ -4069,27 +4108,27 @@ class rA extends pt {
|
|
|
4069
4108
|
const i = this.material.worldUnits, a = t.camera;
|
|
4070
4109
|
a === null && !i && console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');
|
|
4071
4110
|
const o = t.params.Line2 !== void 0 && t.params.Line2.threshold || 0;
|
|
4072
|
-
|
|
4111
|
+
Ht = t.ray;
|
|
4073
4112
|
const s = this.matrixWorld, r = this.geometry, c = this.material;
|
|
4074
4113
|
Ae = c.linewidth + o, r.boundingSphere === null && r.computeBoundingSphere(), fn.copy(r.boundingSphere).applyMatrix4(s);
|
|
4075
4114
|
let A;
|
|
4076
4115
|
if (i)
|
|
4077
4116
|
A = Ae * 0.5;
|
|
4078
4117
|
else {
|
|
4079
|
-
const u = Math.max(a.near, fn.distanceToPoint(
|
|
4118
|
+
const u = Math.max(a.near, fn.distanceToPoint(Ht.origin));
|
|
4080
4119
|
A = _a(a, u, c.resolution);
|
|
4081
4120
|
}
|
|
4082
|
-
if (fn.radius += A,
|
|
4121
|
+
if (fn.radius += A, Ht.intersectsSphere(fn) === !1)
|
|
4083
4122
|
return;
|
|
4084
4123
|
r.boundingBox === null && r.computeBoundingBox(), gn.copy(r.boundingBox).applyMatrix4(s);
|
|
4085
4124
|
let l;
|
|
4086
4125
|
if (i)
|
|
4087
4126
|
l = Ae * 0.5;
|
|
4088
4127
|
else {
|
|
4089
|
-
const u = Math.max(a.near, gn.distanceToPoint(
|
|
4128
|
+
const u = Math.max(a.near, gn.distanceToPoint(Ht.origin));
|
|
4090
4129
|
l = _a(a, u, c.resolution);
|
|
4091
4130
|
}
|
|
4092
|
-
gn.expandByScalar(l),
|
|
4131
|
+
gn.expandByScalar(l), Ht.intersectsBox(gn) !== !1 && (i ? oA(this, e) : rA(this, a, e));
|
|
4093
4132
|
}
|
|
4094
4133
|
onBeforeRender(t) {
|
|
4095
4134
|
const e = this.material.uniforms;
|
|
@@ -4123,13 +4162,13 @@ class Ze extends Xo {
|
|
|
4123
4162
|
return this.setPositions(e.attributes.position.array), this;
|
|
4124
4163
|
}
|
|
4125
4164
|
}
|
|
4126
|
-
class ue extends
|
|
4165
|
+
class ue extends cA {
|
|
4127
4166
|
constructor(t = new Ze(), e = new De({ color: Math.random() * 16777215 })) {
|
|
4128
4167
|
super(t, e), this.isLine2 = !0, this.type = "Line2";
|
|
4129
4168
|
}
|
|
4130
4169
|
}
|
|
4131
|
-
const Fa = new Q(),
|
|
4132
|
-
class
|
|
4170
|
+
const Fa = new Q(), lA = new be(), Pa = new Q();
|
|
4171
|
+
class AA extends Nn {
|
|
4133
4172
|
constructor(t = document.createElement("div")) {
|
|
4134
4173
|
super(), this.isCSS3DObject = !0, this.element = t, this.element.style.position = "absolute", this.element.style.pointerEvents = "auto", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.addEventListener("removed", function() {
|
|
4135
4174
|
this.traverse(function(e) {
|
|
@@ -4141,7 +4180,7 @@ class lA extends Nn {
|
|
|
4141
4180
|
return super.copy(t, e), this.element = t.element.cloneNode(!0), this;
|
|
4142
4181
|
}
|
|
4143
4182
|
}
|
|
4144
|
-
class mt extends
|
|
4183
|
+
class mt extends AA {
|
|
4145
4184
|
constructor(t) {
|
|
4146
4185
|
super(t), this.isCSS3DSprite = !0, this.rotation2D = 0;
|
|
4147
4186
|
}
|
|
@@ -4149,8 +4188,8 @@ class mt extends lA {
|
|
|
4149
4188
|
return super.copy(t, e), this.rotation2D = t.rotation2D, this;
|
|
4150
4189
|
}
|
|
4151
4190
|
}
|
|
4152
|
-
const Pt = new $t(),
|
|
4153
|
-
class
|
|
4191
|
+
const Pt = new $t(), uA = new $t();
|
|
4192
|
+
class hA {
|
|
4154
4193
|
constructor(t = {}) {
|
|
4155
4194
|
const e = this;
|
|
4156
4195
|
let i, a, o, s;
|
|
@@ -4203,7 +4242,7 @@ class uA {
|
|
|
4203
4242
|
if (D.style.display = b === !0 ? "" : "none", b === !0) {
|
|
4204
4243
|
f.onBeforeRender(e, p, y);
|
|
4205
4244
|
let v;
|
|
4206
|
-
f.isCSS3DSprite ? (Pt.copy(y.matrixWorldInverse), Pt.transpose(), f.rotation2D !== 0 && Pt.multiply(
|
|
4245
|
+
f.isCSS3DSprite ? (Pt.copy(y.matrixWorldInverse), Pt.transpose(), f.rotation2D !== 0 && Pt.multiply(uA.makeRotationZ(f.rotation2D)), f.matrixWorld.decompose(Fa, lA, Pa), Pt.setPosition(Fa), Pt.scale(Pa), Pt.elements[3] = 0, Pt.elements[7] = 0, Pt.elements[11] = 0, Pt.elements[15] = 1, v = h(Pt)) : v = h(f.matrixWorld);
|
|
4207
4246
|
const x = r.objects.get(f);
|
|
4208
4247
|
if (x === void 0 || x.style !== v) {
|
|
4209
4248
|
D.style.transform = v;
|
|
@@ -4931,14 +4970,14 @@ class tr extends tn {
|
|
|
4931
4970
|
t.disposed = !0, t.events.fire(jt, t), t.events.fire(Y).remove(t), t.events.fire(Te, t), document.querySelectorAll(`.${t.data.name}`).forEach((i) => i.parentElement?.removeChild(i)), t.events = null, t.data = null, t.circleMesh = null, t.css3dTag = null, t.css3dMainTag = null;
|
|
4932
4971
|
}
|
|
4933
4972
|
}
|
|
4934
|
-
let
|
|
4973
|
+
let dA = class {
|
|
4935
4974
|
constructor() {
|
|
4936
4975
|
this.down = 0, this.move = !1, this.downTime = 0, this.isDbClick = !1, this.x = 0, this.y = 0, this.lastClickX = 0, this.lastClickY = 0, this.lastClickPointTime = 0, this.lastMovePoint = null, this.lastMovePointTime = 0;
|
|
4937
4976
|
}
|
|
4938
4977
|
};
|
|
4939
|
-
function
|
|
4978
|
+
function gA(n) {
|
|
4940
4979
|
const t = (m, w, M) => n.on(m, w, M), e = (m, ...w) => n.fire(m, ...w), i = e(ke);
|
|
4941
|
-
let a = /* @__PURE__ */ new Set(), o, s = new
|
|
4980
|
+
let a = /* @__PURE__ */ new Set(), o, s = new dA(), r;
|
|
4942
4981
|
t(bs, () => {
|
|
4943
4982
|
e(Z).autoRotate = e(_).autoRotate = !0;
|
|
4944
4983
|
}), t(ht, (m = !0) => {
|
|
@@ -4958,11 +4997,11 @@ function dA(n) {
|
|
|
4958
4997
|
e(Y).traverse((w) => w instanceof Nt && w.fire(Si));
|
|
4959
4998
|
}), t(qe, (m) => {
|
|
4960
4999
|
e(Y).traverse((M) => M instanceof Nt && M.fire(qe, m));
|
|
4961
|
-
}), t(
|
|
5000
|
+
}), t(zs, () => {
|
|
4962
5001
|
const m = e(Y);
|
|
4963
5002
|
let w;
|
|
4964
5003
|
m.traverse((M) => M instanceof Nt && (w = M)), w && e(Ei, w.fire(Mo));
|
|
4965
|
-
}), t(
|
|
5004
|
+
}), t(Hn, () => {
|
|
4966
5005
|
if (!a.size) return;
|
|
4967
5006
|
const m = e(_);
|
|
4968
5007
|
if (!m.enableKeyboard) return a.clear();
|
|
@@ -4970,7 +5009,7 @@ function dA(n) {
|
|
|
4970
5009
|
e(Pe), a.clear();
|
|
4971
5010
|
return;
|
|
4972
5011
|
}
|
|
4973
|
-
a.has("Space") ? (m.bigSceneMode ? e(Ln) : e(Rn), a.clear()) : a.has("KeyR") ? (m.autoRotate ? e(ht) : e(bs), a.clear()) : a.has("KeyM") ? (e($e, !m.markVisible), a.clear()) : a.has("ArrowLeft") ? (e(_s), e(In, !0), a.clear()) : a.has("ArrowRight") ? (e(Fs), e(In, !0), a.clear()) : a.has("KeyP") ? (e(Je, !0), a.clear()) : a.has("Equal") ? (e(as), a.clear()) : a.has("Minus") ? (e(rs), a.clear()) : a.has("KeyY") ? (e(os, !1), e(Qi), a.clear()) : a.has("KeyI") ? (e(Eo), a.clear()) : a.has("KeyF") ? (e(
|
|
5012
|
+
a.has("Space") ? (m.bigSceneMode ? e(Ln) : e(Rn), a.clear()) : a.has("KeyR") ? (m.autoRotate ? e(ht) : e(bs), a.clear()) : a.has("KeyM") ? (e($e, !m.markVisible), a.clear()) : a.has("ArrowLeft") ? (e(_s), e(In, !0), a.clear()) : a.has("ArrowRight") ? (e(Fs), e(In, !0), a.clear()) : a.has("KeyP") ? (e(Je, !0), a.clear()) : a.has("Equal") ? (e(as), a.clear()) : a.has("Minus") ? (e(rs), a.clear()) : a.has("KeyY") ? (e(os, !1), e(Qi), a.clear()) : a.has("KeyI") ? (e(Eo), a.clear()) : a.has("KeyF") ? (e(zs), a.clear()) : a.has("F2") ? (!m.bigSceneMode && window.open("/editor/index.html?url=" + encodeURIComponent(e(xt).meta.url)), a.clear()) : a.has("KeyW") ? (mA(e(Z), 0.15), a.clear()) : a.has("KeyS") ? (CA(e(Z), 0.15), a.clear()) : a.has("KeyA") ? (fA(e(Z), 0.15), a.clear()) : a.has("KeyD") ? (pA(e(Z), 0.15), a.clear()) : a.has("KeyQ") ? (yA(e(Z)), a.clear()) : a.has("KeyE") ? (IA(e(Z)), a.clear()) : a.has("KeyC") ? (wA(e(Z)), a.clear()) : a.has("KeyZ") && (EA(e(Z)), a.clear());
|
|
4974
5013
|
}), t(Oe, async (m, w) => {
|
|
4975
5014
|
if (s.move) return;
|
|
4976
5015
|
const M = await e(kn, m, w);
|
|
@@ -5098,23 +5137,23 @@ function Gn(n, t, e = 0.012) {
|
|
|
5098
5137
|
const i = n.object.up.clone().normalize(), o = new Q().copy(t).projectOnPlane(i).normalize().multiplyScalar(e);
|
|
5099
5138
|
n.object.position.add(o), n.target.add(o), n.update();
|
|
5100
5139
|
}
|
|
5101
|
-
function
|
|
5140
|
+
function fA(n, t = 0.2) {
|
|
5102
5141
|
const e = new Q();
|
|
5103
5142
|
n.object.getWorldDirection(e);
|
|
5104
5143
|
const i = new Q().crossVectors(n.object.up, e).normalize();
|
|
5105
5144
|
Gn(n, i, t);
|
|
5106
5145
|
}
|
|
5107
|
-
function
|
|
5146
|
+
function pA(n, t = 0.2) {
|
|
5108
5147
|
const e = new Q();
|
|
5109
5148
|
n.object.getWorldDirection(e);
|
|
5110
5149
|
const i = new Q().crossVectors(n.object.up, e).normalize().negate();
|
|
5111
5150
|
Gn(n, i, t);
|
|
5112
5151
|
}
|
|
5113
|
-
function
|
|
5152
|
+
function mA(n, t = 0.2) {
|
|
5114
5153
|
const e = new Q();
|
|
5115
5154
|
n.object.getWorldDirection(e), Gn(n, e, t);
|
|
5116
5155
|
}
|
|
5117
|
-
function
|
|
5156
|
+
function CA(n, t = 0.2) {
|
|
5118
5157
|
const e = new Q();
|
|
5119
5158
|
n.object.getWorldDirection(e).negate(), Gn(n, e, t);
|
|
5120
5159
|
}
|
|
@@ -5124,10 +5163,10 @@ function er(n, t = 6e-3) {
|
|
|
5124
5163
|
const r = new Q().addVectors(e, a);
|
|
5125
5164
|
n.target.copy(r), n.update();
|
|
5126
5165
|
}
|
|
5127
|
-
function
|
|
5166
|
+
function yA(n) {
|
|
5128
5167
|
er(n, -0.01);
|
|
5129
5168
|
}
|
|
5130
|
-
function
|
|
5169
|
+
function IA(n) {
|
|
5131
5170
|
er(n, 0.01);
|
|
5132
5171
|
}
|
|
5133
5172
|
function nr(n, t = 6e-3) {
|
|
@@ -5138,10 +5177,10 @@ function nr(n, t = 6e-3) {
|
|
|
5138
5177
|
const c = new Q().addVectors(e, a);
|
|
5139
5178
|
n.target.copy(c), n.update();
|
|
5140
5179
|
}
|
|
5141
|
-
function
|
|
5180
|
+
function wA(n, t = 0.01) {
|
|
5142
5181
|
nr(n, -t);
|
|
5143
5182
|
}
|
|
5144
|
-
function
|
|
5183
|
+
function EA(n, t = 0.01) {
|
|
5145
5184
|
nr(n, t);
|
|
5146
5185
|
}
|
|
5147
5186
|
function ir(n) {
|
|
@@ -5178,7 +5217,7 @@ function ir(n) {
|
|
|
5178
5217
|
for (let T = 0, R = L.length / 3; T < R; T++) {
|
|
5179
5218
|
const B = new Q(L[3 * T + 0], L[3 * T + 1], L[3 * T + 2]);
|
|
5180
5219
|
b && B.applyMatrix4(b);
|
|
5181
|
-
const k = new Gt(B.x, B.y, B.z, 1).applyMatrix4(D), U = (k.x / k.w + 1) / 2 * r,
|
|
5220
|
+
const k = new Gt(B.x, B.y, B.z, 1).applyMatrix4(D), U = (k.x / k.w + 1) / 2 * r, z = (1 - k.y / k.w) / 2 * c, F = Math.sqrt((U - g) ** 2 + (z - h) ** 2);
|
|
5182
5221
|
F <= e && C.push({ point: B, d: d.position.distanceTo(B), p: F });
|
|
5183
5222
|
}
|
|
5184
5223
|
}
|
|
@@ -5197,7 +5236,7 @@ function ir(n) {
|
|
|
5197
5236
|
return t.setFromCamera(g, h), t.ray.distanceToPoint(r);
|
|
5198
5237
|
});
|
|
5199
5238
|
}
|
|
5200
|
-
function
|
|
5239
|
+
function vA(n) {
|
|
5201
5240
|
const t = (l, u, g) => n.on(l, u, g), e = (l, ...u) => n.fire(l, ...u), i = e(Z);
|
|
5202
5241
|
t(en, () => e(dt).fov), t(Lt, (l = !1) => l ? i.object.position.clone() : i.object.position), t(Ot, (l = !1) => l ? i.target.clone() : i.target), t(Be, (l = !1) => l ? e(dt).up.clone() : e(dt).up);
|
|
5203
5242
|
let a;
|
|
@@ -5231,7 +5270,7 @@ function EA(n) {
|
|
|
5231
5270
|
return Math.abs(A - u) < s && Math.abs(g.x - r.x) < s && Math.abs(g.y - r.y) < s && Math.abs(g.z - r.z) < s && Math.abs(h.x - c.x) < s && Math.abs(h.y - c.y) < s && Math.abs(h.z - c.z) < s ? !1 : (A = u, r = g, c = h, !0);
|
|
5232
5271
|
});
|
|
5233
5272
|
}
|
|
5234
|
-
function
|
|
5273
|
+
function xA(n) {
|
|
5235
5274
|
const t = (s, r, c) => n.on(s, r, c), e = (s, ...r) => n.fire(s, ...r);
|
|
5236
5275
|
let i = o();
|
|
5237
5276
|
const a = [];
|
|
@@ -5264,7 +5303,7 @@ function vA(n) {
|
|
|
5264
5303
|
function sr(n) {
|
|
5265
5304
|
const t = (s, r, c) => n.on(s, r, c), e = (s, ...r) => n.fire(s, ...r), i = /* @__PURE__ */ new Map(), a = document.createElement("div");
|
|
5266
5305
|
a.classList.add("mark-warp"), document.body.appendChild(a);
|
|
5267
|
-
const o = new
|
|
5306
|
+
const o = new hA();
|
|
5268
5307
|
o.setSize(innerWidth, innerHeight), o.domElement.style.position = "absolute", o.domElement.style.top = "0px", o.domElement.style.pointerEvents = "none", a.appendChild(o.domElement), t(Rr, () => a), t(ns, () => o), t(is, () => document.body.removeChild(a)), t(de, () => o.render(e(Y), e(dt)), !0), t(ne, (s) => {
|
|
5269
5308
|
const r = s?.getMarkData?.()?.name || s?.name;
|
|
5270
5309
|
r && i.set(r, new WeakRef(s));
|
|
@@ -5370,7 +5409,7 @@ function sr(n) {
|
|
|
5370
5409
|
return Math.sqrt(h * (h - l) * (h - u) * (h - g));
|
|
5371
5410
|
});
|
|
5372
5411
|
}
|
|
5373
|
-
function
|
|
5412
|
+
function SA(n) {
|
|
5374
5413
|
const t = (g, ...h) => n.fire(g, ...h), e = (g, h, d) => n.on(g, h, d), i = [], a = [];
|
|
5375
5414
|
let o = !1, s = !1;
|
|
5376
5415
|
e(_n, () => o = !1), e(Ns, () => o = !0), e(Us, () => i), e(Pr, () => {
|
|
@@ -5428,16 +5467,16 @@ function xA(n) {
|
|
|
5428
5467
|
!0
|
|
5429
5468
|
);
|
|
5430
5469
|
}
|
|
5431
|
-
class
|
|
5470
|
+
class au {
|
|
5432
5471
|
constructor(t = {}) {
|
|
5433
|
-
this.disposed = !1, this.updateTime = 0, this.needUpdate = !0, console.info("Reall3dViewer", ds), this.
|
|
5472
|
+
this.disposed = !1, this.updateTime = 0, this.needUpdate = !0, console.info("Reall3dViewer", ds, this), this.opts = Ma(t), this.init(this.opts), !t.disableDropLocalFile && this.enableDropLocalFile();
|
|
5434
5473
|
}
|
|
5435
5474
|
init(t) {
|
|
5436
5475
|
const e = this;
|
|
5437
5476
|
t.position = t.position ? [...t.position] : [0, -5, 15], t.lookAt = t.lookAt ? [...t.lookAt] : [0, 0, 0], t.lookUp = t.lookUp ? [...t.lookUp] : [0, -1, 0];
|
|
5438
5477
|
const i = Fl(t), a = t.scene = t.scene || new Ga();
|
|
5439
5478
|
a.background = new Wi(t.background), Pl(t);
|
|
5440
|
-
const o = t.controls = new
|
|
5479
|
+
const o = t.controls = new sA(t), s = new hs();
|
|
5441
5480
|
t.viewerEvents = s, e.events = s;
|
|
5442
5481
|
const r = (g, h, d) => s.on(g, h, d), c = (g, ...h) => s.fire(g, ...h);
|
|
5443
5482
|
r(ko, () => e.metaMatrix), r(_, () => t), r(ke, () => i.domElement), r(Ve, () => i), r(Y, () => a), r(Z, () => o), r(dt, () => o.object), r(Ct, () => t.bigSceneMode), r(Lr, (g) => t.pointcloudMode = g);
|
|
@@ -5453,13 +5492,13 @@ class su {
|
|
|
5453
5492
|
() => !e.disposed && (c(es) || !g.stop),
|
|
5454
5493
|
10
|
|
5455
5494
|
);
|
|
5456
|
-
}), fs(s), Rl(s),
|
|
5495
|
+
}), fs(s), Rl(s), vA(s), sr(s), gA(s), ir(s), xA(s), SA(s), e.splatMesh = new Nt(Ul(t)), r(xt, () => e.splatMesh), a.add(e.splatMesh), Gl(s), r(ei, (g) => {
|
|
5457
5496
|
t.qualityLevel = g, e.splatMesh.options({ qualityLevel: g, renderer: void 0, scene: void 0 });
|
|
5458
5497
|
}), r(ti, (g) => {
|
|
5459
5498
|
t.sortType = g, e.splatMesh.options({ sortType: g, renderer: void 0, scene: void 0 });
|
|
5460
5499
|
}), a.add(new qa("#ffffff", 2)), i.setAnimationLoop(e.update.bind(e)), r(Ps, () => {
|
|
5461
5500
|
o.update(), !e.needUpdate && c(Ki) && c(ct);
|
|
5462
|
-
}), r(xe, () => c(
|
|
5501
|
+
}), r(xe, () => c(Hn), !0), r(xe, () => c(Ps), !0), r(
|
|
5463
5502
|
de,
|
|
5464
5503
|
() => {
|
|
5465
5504
|
try {
|
|
@@ -5470,7 +5509,7 @@ class su {
|
|
|
5470
5509
|
},
|
|
5471
5510
|
!0
|
|
5472
5511
|
), r(We, () => {
|
|
5473
|
-
}, !0), r(
|
|
5512
|
+
}, !0), r(zn, () => e.dispose()), r(Eo, () => console.info(JSON.stringify(c(xt).meta || {}, null, 2)));
|
|
5474
5513
|
let l = "";
|
|
5475
5514
|
r(ln, (g = "") => {
|
|
5476
5515
|
l = g, e.splatMesh.fire(ss, l, !0);
|
|
@@ -5484,6 +5523,17 @@ class su {
|
|
|
5484
5523
|
e.splatMesh.fire(Do, h, d), u = setTimeout(() => c(Ne, g, d, g ? d * 2 : d / 2), 6 * 1e3);
|
|
5485
5524
|
});
|
|
5486
5525
|
}
|
|
5526
|
+
//
|
|
5527
|
+
forward(t, e = "dir") {
|
|
5528
|
+
if (this.splatMesh.dir)
|
|
5529
|
+
if (e === "dir") {
|
|
5530
|
+
const i = this.splatMesh.dir.clone().multiplyScalar(t || 0.5);
|
|
5531
|
+
this.opts.controls.target.add(i), this.opts.camera.position.add(i), this.opts.controls.update();
|
|
5532
|
+
} else {
|
|
5533
|
+
const i = this.splatMesh.len, a = this.splatMesh.dir.clone().multiplyScalar((t || 0) * i), o = this.opts.position || [0, 0, 0], s = this.opts.lookAt || [0, 0, 1];
|
|
5534
|
+
this.opts.controls.object.position.set(o[0] + a.x, o[1] + a.y, o[2] + a.z), this.opts.controls.target.set(s[0] + a.x, s[1] + a.y, s[2] + a.z), this.opts.controls.update();
|
|
5535
|
+
}
|
|
5536
|
+
}
|
|
5487
5537
|
/**
|
|
5488
5538
|
* 允许拖拽本地文件进行渲染
|
|
5489
5539
|
*/
|
|
@@ -5686,7 +5736,7 @@ class su {
|
|
|
5686
5736
|
e(ji), e(ao), e(is), e(Ji), e(Z).dispose(), e(jt, e(Y)), i.clear(), i.dispose(), a.parentElement.removeChild(a), t.splatMesh = null, t.events.clear(), t.events = null;
|
|
5687
5737
|
}
|
|
5688
5738
|
}
|
|
5689
|
-
function
|
|
5739
|
+
function bA(n) {
|
|
5690
5740
|
const t = (s, r, c) => n.on(s, r, c), e = (s, ...r) => n.fire(s, ...r), i = yt ? 2 : 20, a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
5691
5741
|
t(Mn, () => e(St) && a.set(Date.now(), 1)), t(Bn, () => e(St) && e(ve, a)), t(Qn, () => e(St) && o.set(Date.now(), 1)), t(Dn, () => e(St) && e(ve, o)), t(ve, (s) => {
|
|
5692
5742
|
let r = [], c = Date.now(), A = 0;
|
|
@@ -5722,13 +5772,13 @@ function SA(n) {
|
|
|
5722
5772
|
}), t(Fi, (s = 0.1) => {
|
|
5723
5773
|
const r = e(ot);
|
|
5724
5774
|
r && r.visible && r.rotateOnAxis(new Q(0, 0, 1), te.degToRad(s));
|
|
5725
|
-
}), t(
|
|
5775
|
+
}), t(zr, (s = 0.01) => {
|
|
5726
5776
|
const r = e(ot);
|
|
5727
5777
|
r && r.visible && (r.position.x += s);
|
|
5728
5778
|
}), t(Po, (s = 0.01) => {
|
|
5729
5779
|
const r = e(ot);
|
|
5730
5780
|
r && r.visible && (r.position.y += s);
|
|
5731
|
-
}), t(
|
|
5781
|
+
}), t(Hr, (s = 0.01) => {
|
|
5732
5782
|
const r = e(ot);
|
|
5733
5783
|
r && r.visible && (r.position.z += s);
|
|
5734
5784
|
}), t(Or, (s) => {
|
|
@@ -5745,13 +5795,13 @@ function SA(n) {
|
|
|
5745
5795
|
const r = s.meta || {};
|
|
5746
5796
|
return r.transform = s.matrix.toArray(), await e(Ie, JSON.stringify(r), s.meta.url);
|
|
5747
5797
|
}), t(Lo, () => {
|
|
5748
|
-
const s = e(_).root, r = new
|
|
5798
|
+
const s = e(_).root, r = new za({ antialias: !1, logarithmicDepthBuffer: !0, stencil: !0, alpha: !0, precision: "highp" });
|
|
5749
5799
|
return r.setSize(s.clientWidth, s.clientHeight), r.setPixelRatio(Math.min(devicePixelRatio, 2)), t(Ve, () => r), t(ke, () => r.domElement), r;
|
|
5750
5800
|
}), t(Ro, () => {
|
|
5751
5801
|
const s = e(_), r = new Ga(), c = s.background || "#dbf0ff";
|
|
5752
5802
|
return r.background = new Wi(c), r.fog = new xs(c, 0), t(Y, () => r), r;
|
|
5753
5803
|
}), t(_o, () => {
|
|
5754
|
-
const r = e(dt), c = e(Y), A = e(_), l = new
|
|
5804
|
+
const r = e(dt), c = e(Y), A = e(_), l = new aA(e(dt), A.root);
|
|
5755
5805
|
l.screenSpacePanning = !1, l.minDistance = 0.1, l.maxDistance = 6e4, l.maxPolarAngle = 1.2, l.enableDamping = !0, l.dampingFactor = 0.07, l.zoomToCursor = !0;
|
|
5756
5806
|
const u = new Q().fromArray(A.minPan || [-2e4, 0.1, -6e4]), g = new Q().fromArray(A.maxPan || [5e4, 1e4, 0]), h = new Q();
|
|
5757
5807
|
return l.addEventListener("change", () => {
|
|
@@ -5761,15 +5811,15 @@ function SA(n) {
|
|
|
5761
5811
|
}), t(Fo, () => {
|
|
5762
5812
|
const s = new Er(16777215, 1);
|
|
5763
5813
|
return s.position.set(0, 2e3, 1e3), s;
|
|
5764
|
-
}), window.addEventListener("beforeunload", () => e(
|
|
5814
|
+
}), window.addEventListener("beforeunload", () => e(zn));
|
|
5765
5815
|
}
|
|
5766
|
-
function
|
|
5816
|
+
function MA(n) {
|
|
5767
5817
|
let { root: t = "#map", debugMode: e } = n;
|
|
5768
5818
|
t ? t = typeof t == "string" ? document.querySelector(t) || document.querySelector("#map") : t : t = document.querySelector("#map"), t || (t = document.createElement("div"), t.id = "map", (document.querySelector("#gsviewer") || document.querySelector("body")).appendChild(t));
|
|
5769
5819
|
const i = { ...n };
|
|
5770
5820
|
return i.root = t, i;
|
|
5771
5821
|
}
|
|
5772
|
-
function
|
|
5822
|
+
function BA() {
|
|
5773
5823
|
const n = Ss.TileSource.create({
|
|
5774
5824
|
dataType: "image",
|
|
5775
5825
|
attribution: "ArcGIS",
|
|
@@ -5777,15 +5827,15 @@ function MA() {
|
|
|
5777
5827
|
}), t = new Ss.TileMap({ imgSource: n, lon0: 90, minLevel: 2, maxLevel: 16 });
|
|
5778
5828
|
return t.scale.set(10, 10, 10), t.rotateX(-Math.PI / 2), t.autoUpdate = !1, t;
|
|
5779
5829
|
}
|
|
5780
|
-
class
|
|
5830
|
+
class QA {
|
|
5781
5831
|
constructor() {
|
|
5782
5832
|
this.down = 0, this.move = !1, this.downTime = 0, this.isDbClick = !1, this.x = 0, this.y = 0, this.lastClickX = 0, this.lastClickY = 0, this.lastClickPointTime = 0, this.lastMovePoint = null, this.lastMovePointTime = 0;
|
|
5783
5833
|
}
|
|
5784
5834
|
}
|
|
5785
|
-
function
|
|
5835
|
+
function DA(n) {
|
|
5786
5836
|
const t = (v, x, m) => n.on(v, x, m), e = (v, ...x) => n.fire(v, ...x), i = e(ke);
|
|
5787
|
-
let a = /* @__PURE__ */ new Set(), o, s = new
|
|
5788
|
-
t(
|
|
5837
|
+
let a = /* @__PURE__ */ new Set(), o, s = new QA();
|
|
5838
|
+
t(Hn, () => {
|
|
5789
5839
|
if (!a.size) return;
|
|
5790
5840
|
if (!e(_).enableKeyboard) return a.clear();
|
|
5791
5841
|
if (a.has("KeyH")) {
|
|
@@ -6003,9 +6053,9 @@ var Se = Object.freeze({
|
|
|
6003
6053
|
}
|
|
6004
6054
|
};
|
|
6005
6055
|
}
|
|
6006
|
-
}),
|
|
6056
|
+
}), ze = function() {
|
|
6007
6057
|
return performance.now();
|
|
6008
|
-
},
|
|
6058
|
+
}, kA = (
|
|
6009
6059
|
/** @class */
|
|
6010
6060
|
function() {
|
|
6011
6061
|
function n() {
|
|
@@ -6039,7 +6089,7 @@ var Se = Object.freeze({
|
|
|
6039
6089
|
return !t.isPlaying();
|
|
6040
6090
|
});
|
|
6041
6091
|
}, n.prototype.update = function(t, e) {
|
|
6042
|
-
t === void 0 && (t =
|
|
6092
|
+
t === void 0 && (t = ze()), e === void 0 && (e = !0);
|
|
6043
6093
|
var i = Object.keys(this._tweens);
|
|
6044
6094
|
if (i.length !== 0)
|
|
6045
6095
|
for (; i.length > 0; ) {
|
|
@@ -6071,7 +6121,7 @@ var Se = Object.freeze({
|
|
|
6071
6121
|
return n._nextId++;
|
|
6072
6122
|
}, n._nextId = 0, n;
|
|
6073
6123
|
}()
|
|
6074
|
-
), Vi = new
|
|
6124
|
+
), Vi = new kA(), TA = (
|
|
6075
6125
|
/** @class */
|
|
6076
6126
|
function() {
|
|
6077
6127
|
function n(t, e) {
|
|
@@ -6094,7 +6144,7 @@ var Se = Object.freeze({
|
|
|
6094
6144
|
}, n.prototype.dynamic = function(t) {
|
|
6095
6145
|
return t === void 0 && (t = !1), this._isDynamic = t, this;
|
|
6096
6146
|
}, n.prototype.start = function(t, e) {
|
|
6097
|
-
if (t === void 0 && (t =
|
|
6147
|
+
if (t === void 0 && (t = ze()), e === void 0 && (e = !1), this._isPlaying)
|
|
6098
6148
|
return this;
|
|
6099
6149
|
if (this._repeat = this._initialRepeat, this._reversed) {
|
|
6100
6150
|
this._reversed = !1;
|
|
@@ -6154,9 +6204,9 @@ var Se = Object.freeze({
|
|
|
6154
6204
|
}, n.prototype.end = function() {
|
|
6155
6205
|
return this._goToEnd = !0, this.update(this._startTime + this._duration), this;
|
|
6156
6206
|
}, n.prototype.pause = function(t) {
|
|
6157
|
-
return t === void 0 && (t =
|
|
6207
|
+
return t === void 0 && (t = ze()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = t, this);
|
|
6158
6208
|
}, n.prototype.resume = function(t) {
|
|
6159
|
-
return t === void 0 && (t =
|
|
6209
|
+
return t === void 0 && (t = ze()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += t - this._pauseStart, this._pauseStart = 0, this);
|
|
6160
6210
|
}, n.prototype.stopChainedTweens = function() {
|
|
6161
6211
|
for (var t = 0, e = this._chainedTweens.length; t < e; t++)
|
|
6162
6212
|
this._chainedTweens[t].stop();
|
|
@@ -6196,7 +6246,7 @@ var Se = Object.freeze({
|
|
|
6196
6246
|
return this._onStopCallback = t, this;
|
|
6197
6247
|
}, n.prototype.update = function(t, e) {
|
|
6198
6248
|
var i = this, a;
|
|
6199
|
-
if (t === void 0 && (t =
|
|
6249
|
+
if (t === void 0 && (t = ze()), e === void 0 && (e = n.autoStartOnUpdate), this._isPaused)
|
|
6200
6250
|
return !0;
|
|
6201
6251
|
var o;
|
|
6202
6252
|
if (!this._goToEnd && !this._isPlaying)
|
|
@@ -6251,7 +6301,7 @@ qt.add.bind(qt);
|
|
|
6251
6301
|
qt.remove.bind(qt);
|
|
6252
6302
|
qt.update.bind(qt);
|
|
6253
6303
|
const Ua = navigator.userAgent.includes("Mobi");
|
|
6254
|
-
class
|
|
6304
|
+
class LA extends pt {
|
|
6255
6305
|
constructor(t, e) {
|
|
6256
6306
|
super(), this.isWarpSplatMesh = !0, this.lastActiveTime = Date.now(), this.active = !1, this.disposed = !1;
|
|
6257
6307
|
const i = this;
|
|
@@ -6283,7 +6333,7 @@ class TA extends pt {
|
|
|
6283
6333
|
a.onclick = () => {
|
|
6284
6334
|
if (o) return;
|
|
6285
6335
|
const c = i.target.clone(), A = i.object.position.clone(), l = e.position.clone(), u = Ua ? 6 : 2, h = c.clone().sub(A).normalize().clone(), d = l.clone().sub(h.multiplyScalar(u)), C = { x: A.x, y: A.y, z: A.z, tx: c.x, ty: c.y, tz: c.z }, f = { x: d.x, y: d.y, z: d.z, tx: l.x, ty: l.y, tz: l.z };
|
|
6286
|
-
o = new
|
|
6336
|
+
o = new TA(C).to(f, 3500), o.easing(Se.Sinusoidal.InOut).start().onUpdate(() => {
|
|
6287
6337
|
i.object.position.set(C.x, C.y, C.z), i.target.set(C.tx, C.ty, C.tz);
|
|
6288
6338
|
}).onComplete(() => {
|
|
6289
6339
|
o = null;
|
|
@@ -6332,18 +6382,18 @@ class TA extends pt {
|
|
|
6332
6382
|
t.disposed || (t.disposed = !0, t.opts.scene.remove(t.css3dTag), t.splatMesh?.dispose(), t.meta = null, t.splatMesh = null, t.opts = null, t.css3dTag = null, t.mapViewer = null, t.metaMatrix = null);
|
|
6333
6383
|
}
|
|
6334
6384
|
}
|
|
6335
|
-
class
|
|
6385
|
+
class ou extends vr {
|
|
6336
6386
|
constructor(t = {}) {
|
|
6337
6387
|
console.info("Reall3dMapViewer", ds), super(), this.clock = new xr(), this.updateTime = 0, this.disposed = !1;
|
|
6338
6388
|
const e = this, i = new hs();
|
|
6339
6389
|
e.events = i;
|
|
6340
6390
|
const a = (r, c, A) => i.on(r, c, A), o = (r, ...c) => i.fire(r, ...c);
|
|
6341
|
-
e.tileMap =
|
|
6342
|
-
const s =
|
|
6343
|
-
a(_, () => s), fs(i),
|
|
6391
|
+
e.tileMap = BA();
|
|
6392
|
+
const s = MA(t);
|
|
6393
|
+
a(_, () => s), fs(i), bA(i), ir(i), e.camera = new Ha(60, 1, 0.01, 100), a(dt, () => e.camera), e.container = s.root, e.renderer = o(Lo), e.scene = o(Ro), e.controls = o(_o), e.ambLight = new qa(16777215, 1), e.scene.add(e.ambLight), e.dirLight = o(Fo), e.scene.add(e.dirLight), e.scene.add(e.tileMap), e.container.appendChild(e.renderer.domElement), sr(i), DA(i), window.addEventListener("resize", e.resize.bind(e)), e.resize(), e.renderer.setAnimationLoop(e.animate.bind(e)), yt && e.controls._dollyOut?.(0.75), a(zn, () => e.dispose()), a(
|
|
6344
6394
|
xe,
|
|
6345
6395
|
() => {
|
|
6346
|
-
o(Qn), e.controls.update(), o(Uo), o(
|
|
6396
|
+
o(Qn), e.controls.update(), o(Uo), o(Hn);
|
|
6347
6397
|
},
|
|
6348
6398
|
!0
|
|
6349
6399
|
), a(
|
|
@@ -6383,7 +6433,7 @@ class au extends vr {
|
|
|
6383
6433
|
e.controls.object.position.copy(a), e.controls.target.copy(o), e.dirLight.target.position.copy(o);
|
|
6384
6434
|
const s = /* @__PURE__ */ new Set();
|
|
6385
6435
|
for (let r of i.scenes)
|
|
6386
|
-
s.has(r) || (new
|
|
6436
|
+
s.has(r) || (new LA(r, e), s.add(r));
|
|
6387
6437
|
}).catch((i) => {
|
|
6388
6438
|
console.error(i.message);
|
|
6389
6439
|
});
|
|
@@ -6411,7 +6461,7 @@ class au extends vr {
|
|
|
6411
6461
|
t.events.fire(is), t.events.fire(No), t.renderer.clear(), t.renderer.dispose(), t.events.clear(), t.scene = null, t.renderer = null, t.camera = null, t.controls = null, t.ambLight = null, t.dirLight = null, t.container.removeChild(e), t.container.classList.add("hidden"), t.container = null, t.clock = null, t.events = null, t.tileMap = null, document.querySelector("#gsviewer .debug.dev-panel")?.classList?.remove("map");
|
|
6412
6462
|
}
|
|
6413
6463
|
}
|
|
6414
|
-
class
|
|
6464
|
+
class ru {
|
|
6415
6465
|
constructor(t) {
|
|
6416
6466
|
this.tools = /* @__PURE__ */ new Map(), this.active = null, this.events = t, this.events.on("tool.deactivate", () => {
|
|
6417
6467
|
this.activate(null);
|
|
@@ -6438,7 +6488,7 @@ class ou {
|
|
|
6438
6488
|
t === this.active ? t && this.activate(null) : (this.active && (this.tools.get(this.active).deactivate(), this.events.fire(`tool.${this.active}.deactivated`), this.events.fire("tool.deactivated", this.active)), this.active = t, this.active && this.tools.get(this.active).activate(), this.events.fire(`tool.${t}.activated`), this.events.fire("tool.activated", t));
|
|
6439
6489
|
}
|
|
6440
6490
|
}
|
|
6441
|
-
class
|
|
6491
|
+
class cu {
|
|
6442
6492
|
constructor(t, e, i) {
|
|
6443
6493
|
let a = 40;
|
|
6444
6494
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
@@ -6475,7 +6525,7 @@ class ru {
|
|
|
6475
6525
|
}), o.appendChild(s), e.appendChild(o);
|
|
6476
6526
|
}
|
|
6477
6527
|
}
|
|
6478
|
-
class
|
|
6528
|
+
class lu {
|
|
6479
6529
|
constructor(t, e, i) {
|
|
6480
6530
|
let a = [], o = null, s = 0;
|
|
6481
6531
|
const r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
@@ -6513,7 +6563,7 @@ class cu {
|
|
|
6513
6563
|
}, r.appendChild(c), e.appendChild(r);
|
|
6514
6564
|
}
|
|
6515
6565
|
}
|
|
6516
|
-
class
|
|
6566
|
+
class Au {
|
|
6517
6567
|
constructor(t, e, i) {
|
|
6518
6568
|
let a = [], o = null;
|
|
6519
6569
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
@@ -6545,7 +6595,7 @@ class lu {
|
|
|
6545
6595
|
}, s.appendChild(r), e.appendChild(s);
|
|
6546
6596
|
}
|
|
6547
6597
|
}
|
|
6548
|
-
class
|
|
6598
|
+
class uu {
|
|
6549
6599
|
constructor(t, e) {
|
|
6550
6600
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
6551
6601
|
i.id = "rect-select-svg", i.classList.add("select-svg");
|
|
@@ -6587,10 +6637,10 @@ class Au {
|
|
|
6587
6637
|
export {
|
|
6588
6638
|
as as AddFlyPosition,
|
|
6589
6639
|
ne as AddMarkToWeakRef,
|
|
6590
|
-
|
|
6640
|
+
cu as BrushSelection,
|
|
6591
6641
|
is as CSS3DRendererDispose,
|
|
6592
6642
|
Ei as CameraSetLookAt,
|
|
6593
|
-
|
|
6643
|
+
PA as CanUpdateTexture,
|
|
6594
6644
|
Pe as CancelCurrentMark,
|
|
6595
6645
|
rs as ClearFlyPosition,
|
|
6596
6646
|
ts as ClearMarkPoint,
|
|
@@ -6619,16 +6669,16 @@ export {
|
|
|
6619
6669
|
wo as FlyOnce,
|
|
6620
6670
|
os as FlySavePositions,
|
|
6621
6671
|
Je as Flying,
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6672
|
+
KA as FlyingContinue,
|
|
6673
|
+
jA as FlyingPause,
|
|
6674
|
+
XA as FlyingPlay,
|
|
6675
|
+
zs as FocusAabbCenter,
|
|
6626
6676
|
Bi as FocusMarkerAutoDisappear,
|
|
6627
6677
|
cn as FocusMarkerSetOpacity,
|
|
6628
6678
|
go as FocusMarkerUpdate,
|
|
6629
6679
|
jn as FocusMarkerUpdateScale,
|
|
6630
6680
|
Mo as GetAabbCenter,
|
|
6631
|
-
|
|
6681
|
+
ZA as GetBgAudio,
|
|
6632
6682
|
ns as GetCSS3DRenderer,
|
|
6633
6683
|
po as GetCachedWaterMark,
|
|
6634
6684
|
dt as GetCamera,
|
|
@@ -6646,7 +6696,7 @@ export {
|
|
|
6646
6696
|
Pr as GetFlyPositionArray,
|
|
6647
6697
|
Us as GetFlyPositions,
|
|
6648
6698
|
Ur as GetFlyTargetArray,
|
|
6649
|
-
|
|
6699
|
+
UA as GetFocusMarkerMaterial,
|
|
6650
6700
|
Bn as GetFpsDefault,
|
|
6651
6701
|
Dn as GetFpsReal,
|
|
6652
6702
|
Io as GetGaussianText,
|
|
@@ -6681,23 +6731,23 @@ export {
|
|
|
6681
6731
|
kr as IsFetching,
|
|
6682
6732
|
xi as IsPointcloudMode,
|
|
6683
6733
|
ho as IsSmallSceneRenderDataReady,
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6734
|
+
zo as IsSplatMeshCreated,
|
|
6735
|
+
Hn as KeyActionCheckAndExecute,
|
|
6736
|
+
lu as LassoSelection,
|
|
6687
6737
|
Di as LoadSmallSceneMetaData,
|
|
6688
|
-
|
|
6689
|
-
|
|
6738
|
+
FA as LoaderModelStart,
|
|
6739
|
+
GA as MapCreateCamera,
|
|
6690
6740
|
_o as MapCreateControls,
|
|
6691
6741
|
Fo as MapCreateDirLight,
|
|
6692
6742
|
Lo as MapCreateRenderer,
|
|
6693
6743
|
Ro as MapCreateScene,
|
|
6694
|
-
|
|
6744
|
+
qA as MapFlyToTarget,
|
|
6695
6745
|
ot as MapGetSplatMesh,
|
|
6696
6746
|
No as MapSceneTraverseDispose,
|
|
6697
6747
|
Uo as MapSortSplatMeshRenderOrder,
|
|
6698
|
-
|
|
6748
|
+
zr as MapSplatMeshMoveX,
|
|
6699
6749
|
Po as MapSplatMeshMoveY,
|
|
6700
|
-
|
|
6750
|
+
Hr as MapSplatMeshMoveZ,
|
|
6701
6751
|
Ri as MapSplatMeshRotateX,
|
|
6702
6752
|
_i as MapSplatMeshRotateY,
|
|
6703
6753
|
Fi as MapSplatMeshRotateZ,
|
|
@@ -6705,12 +6755,12 @@ export {
|
|
|
6705
6755
|
Yr as MapSplatMeshScale,
|
|
6706
6756
|
Or as MapSplatMeshSetPosition,
|
|
6707
6757
|
Gr as MapSplatMeshShowHide,
|
|
6708
|
-
|
|
6709
|
-
|
|
6758
|
+
YA as MarkArea,
|
|
6759
|
+
OA as MarkDistance,
|
|
6710
6760
|
ie as MarkFinish,
|
|
6711
|
-
|
|
6761
|
+
zA as MarkLine,
|
|
6712
6762
|
HA as MarkPlan,
|
|
6713
|
-
|
|
6763
|
+
NA as MarkPoint,
|
|
6714
6764
|
$e as MarkUpdateVisible,
|
|
6715
6765
|
Co as MetaMarkRemoveData,
|
|
6716
6766
|
wn as MetaMarkSaveData,
|
|
@@ -6718,7 +6768,7 @@ export {
|
|
|
6718
6768
|
yo as MetaSaveWatermark,
|
|
6719
6769
|
et as NotifyViewerNeedUpdate,
|
|
6720
6770
|
Xi as OnFetchStart,
|
|
6721
|
-
|
|
6771
|
+
He as OnFetchStop,
|
|
6722
6772
|
Zi as OnFetching,
|
|
6723
6773
|
Bo as OnLoadAndRenderObj,
|
|
6724
6774
|
Li as OnQualityLevelChanged,
|
|
@@ -6731,15 +6781,15 @@ export {
|
|
|
6731
6781
|
We as OnViewerAfterUpdate,
|
|
6732
6782
|
xe as OnViewerBeforeUpdate,
|
|
6733
6783
|
de as OnViewerUpdate,
|
|
6734
|
-
|
|
6735
|
-
|
|
6784
|
+
tu as PlaytBgAudio,
|
|
6785
|
+
Au as PolygonSelection,
|
|
6736
6786
|
Eo as PrintInfo,
|
|
6737
6787
|
Mi as RaycasterRayDistanceToPoint,
|
|
6738
6788
|
kn as RaycasterRayIntersectPoints,
|
|
6739
6789
|
Wa as ReComputePlansArea,
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6790
|
+
ou as Reall3dMapViewer,
|
|
6791
|
+
au as Reall3dViewer,
|
|
6792
|
+
uu as RectSelection,
|
|
6743
6793
|
Jn as RotateAt,
|
|
6744
6794
|
_s as RotateLeft,
|
|
6745
6795
|
Fs as RotateRight,
|
|
@@ -6747,8 +6797,8 @@ export {
|
|
|
6747
6797
|
Va as RunLoopByTime,
|
|
6748
6798
|
Mt as SelectMarkPoint,
|
|
6749
6799
|
Oe as SelectPointAndLookAt,
|
|
6750
|
-
|
|
6751
|
-
|
|
6800
|
+
eu as SetBgAudioVolumeDown,
|
|
6801
|
+
nu as SetBgAudioVolumeUp,
|
|
6752
6802
|
ss as SetGaussianText,
|
|
6753
6803
|
Wn as SplatGeometryDispose,
|
|
6754
6804
|
$n as SplatMaterialDispose,
|
|
@@ -6785,19 +6835,19 @@ export {
|
|
|
6785
6835
|
ks as SplatUpdateSplatIndex,
|
|
6786
6836
|
Ts as SplatUpdateTexture,
|
|
6787
6837
|
io as SplatUpdateTopY,
|
|
6788
|
-
|
|
6838
|
+
Hs as SplatUpdateTransitionEffect,
|
|
6789
6839
|
Zn as SplatUpdateUseSimilarExp,
|
|
6790
6840
|
Ls as SplatUpdateUsingIndex,
|
|
6791
6841
|
rn as SplatUpdateViewport,
|
|
6792
6842
|
bs as StartAutoRotate,
|
|
6793
6843
|
ht as StopAutoRotate,
|
|
6794
|
-
|
|
6795
|
-
|
|
6844
|
+
iu as StopBgAudio,
|
|
6845
|
+
ru as ToolManager,
|
|
6796
6846
|
jt as TraverseDisposeAndClear,
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6847
|
+
VA as TweenFly,
|
|
6848
|
+
JA as TweenFlyDisable,
|
|
6849
|
+
$A as TweenFlyEnable,
|
|
6850
|
+
WA as TweenFlyOnce,
|
|
6801
6851
|
mo as UpdateAllMarkByMeterScale,
|
|
6802
6852
|
_r as UpdateMarkByName,
|
|
6803
6853
|
ei as UpdateQualityLevel,
|
|
@@ -6806,12 +6856,12 @@ export {
|
|
|
6806
6856
|
vo as UploadSplatTextureDone,
|
|
6807
6857
|
le as Vector3ToString,
|
|
6808
6858
|
Ps as ViewerCheckNeedUpdate,
|
|
6809
|
-
|
|
6859
|
+
zn as ViewerDispose,
|
|
6810
6860
|
ct as ViewerNeedUpdate,
|
|
6811
6861
|
Lr as ViewerSetPointcloudMode,
|
|
6812
6862
|
ao as ViewerUtilsDispose,
|
|
6813
6863
|
eo as WorkerDispose,
|
|
6814
6864
|
to as WorkerSort,
|
|
6815
6865
|
us as WorkerUpdateParams,
|
|
6816
|
-
|
|
6866
|
+
gA as setupEventListener
|
|
6817
6867
|
};
|