@reall3d/reall3dviewer 0.0.1 → 0.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/pkg.js +822 -826
- package/dist/pkg.umd.cjs +17 -17
- package/package.json +1 -1
- package/dist/assets/Sorter-Dl_LG4bh.js +0 -1
- /package/dist/{style.css → pkg.css} +0 -0
package/dist/pkg.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { Vector3 as C, InstancedBufferGeometry as cn, BufferAttribute as
|
|
1
|
+
import { Vector3 as C, InstancedBufferGeometry as cn, BufferAttribute as He, InstancedBufferAttribute as ca, DynamicDrawUsage as la, ShaderMaterial as In, DoubleSide as we, NormalBlending as da, DataTexture as Ee, RGBAIntegerFormat as _e, UnsignedIntType as Ie, Mesh as te, Vector4 as Se, Vector2 as j, WebGLRenderer as es, PerspectiveCamera as ts, Object3D as Dn, CylinderGeometry as ti, MeshBasicMaterial as xe, PlaneGeometry as ua, Quaternion as It, Controls as ha, MOUSE as Ae, TOUCH as ve, Spherical as ni, Ray as pa, Plane as fa, MathUtils as be, Float32BufferAttribute as ii, InstancedInterleavedBuffer as ln, InterleavedBufferAttribute as We, WireframeGeometry as ga, Box3 as Pn, Sphere as tt, ShaderLib as xt, UniformsUtils as ns, UniformsLib as Ct, Line3 as ma, Matrix4 as Ke, CircleGeometry as De, Group as Ht, BufferGeometry as ya, Raycaster as Aa, SphereGeometry as wa, Color as is, FrontSide as Sa, CatmullRomCurve3 as si, Scene as ss, AmbientLight as as, FogExp2 as ai, DirectionalLight as va, EventDispatcher as ba, Clock as xa } from "three";
|
|
2
2
|
import * as gt from "@gotoeasy/three-tile";
|
|
3
|
-
let
|
|
4
|
-
const at =
|
|
5
|
-
|
|
6
|
-
const oe =
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const Te =
|
|
15
|
-
|
|
16
|
-
const Je =
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class
|
|
3
|
+
let A = 1;
|
|
4
|
+
const at = A++, Ln = A++, Pe = A++, os = A++, dn = A++, un = A++, rs = A++, Nt = A++, cs = A++, $e = A++, V = A++, Y = A++, ls = A++, hn = A++, Ce = A++, Ne = A++, Be = A++, ft = A++, ds = A++, us = A++, hs = A++, Ca = A++, ps = A++, fs = A++, Rn = A++, Ma = A++, Ta = A++, oi = A++, q = A++;
|
|
5
|
+
A++;
|
|
6
|
+
const oe = A++, ot = A++, Ye = A++, ri = A++, ci = A++, li = A++, gs = A++, ka = A++, di = A++, Xt = A++, Kt = A++, ui = A++, hi = A++, pi = A++, nt = A++, fi = A++, rt = A++, ms = A++, mt = A++, $t = A++, Mt = A++, ys = A++, pn = A++, Ea = A++, Fn = A++, gi = A++, mi = A++, Dt = A++, Pt = A++, Lt = A++, Rt = A++, As = A++, Bn = A++, _ = A++, Ue = A++, ct = A++, B = A++, Wt = A++, ws = A++, _a = A++, ee = A++, fn = A++, re = A++, Ss = A++, vs = A++, bs = A++, xs = A++, gn = A++, Cs = A++, Le = A++, Ms = A++, Ts = A++, Tt = A++, Ia = A++, ks = A++, Es = A++;
|
|
7
|
+
A++;
|
|
8
|
+
const Yt = A++, Zt = A++, yi = A++, Ai = A++, mn = A++, Ft = A++, yn = A++, it = A++, ce = A++, Un = A++, _s = A++, Da = A++, Is = A++, wi = A++, Si = A++, Pa = A++, La = A++, kt = A++, Bt = A++, On = A++, Ve = A++, Oe = A++, lt = A++, yt = A++, Ds = A++, N = A++, J = A++, Ra = A++, vi = A++, Ut = A++, Ot = A++, Fa = A++, zn = A++, Qn = A++, Me = A++, st = A++, Ze = A++, Ba = A++, Ps = A++, Ua = A++;
|
|
9
|
+
A++;
|
|
10
|
+
A++;
|
|
11
|
+
A++;
|
|
12
|
+
A++;
|
|
13
|
+
A++;
|
|
14
|
+
const Te = A++, dt = A++, Et = A++, An = A++, Ls = A++, Rs = A++, wn = A++, ke = A++, qe = A++, Fs = A++, Hn = A++, bi = A++, Oa = A++, za = A++, Wn = A++, Bs = A++, Yn = A++, Vn = A++, Gn = A++, zt = A++, Us = A++, xi = A++, Qt = A++, ye = A++, Os = A++, zs = A++;
|
|
15
|
+
A++;
|
|
16
|
+
const Je = A++, Qs = A++, Hs = A++, Nn = A++, Ws = A++, Qa = A++, Ys = A++, Ci = A++, Vs = A++, Gs = A++;
|
|
17
|
+
A++;
|
|
18
|
+
const Ns = A++, Xs = A++, X = A++, Sn = A++, vn = A++, bn = A++, Ha = A++, Ks = A++, Wa = A++, Ya = A++, Va = A++, Ga = A++, Na = A++, $s = A++, Zs = A++;
|
|
19
|
+
A++;
|
|
20
|
+
A++;
|
|
21
|
+
A++;
|
|
22
|
+
A++;
|
|
23
|
+
A++;
|
|
24
|
+
class Xn {
|
|
25
25
|
constructor() {
|
|
26
26
|
this.map = /* @__PURE__ */ new Map();
|
|
27
27
|
}
|
|
@@ -60,44 +60,44 @@ class Gn {
|
|
|
60
60
|
this.map.clear();
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
class
|
|
63
|
+
class Xa {
|
|
64
64
|
}
|
|
65
|
-
class
|
|
65
|
+
class Ka {
|
|
66
66
|
constructor(e, t = {}) {
|
|
67
67
|
this.fileSize = 0, this.downloadSize = 0, this.status = 0, this.splatData = null, this.watermarkData = null, this.dataSplatCount = 0, this.watermarkCount = 0, this.sh12Data = [], this.sh3Data = [], this.sh12Count = 0, this.sh3Count = 0, this.rowLength = 0, this.modelSplatCount = -1, this.downloadSplatCount = 0, this.renderSplatCount = 0, this.header = null, this.dataShDegree = 0, this.minX = 1 / 0, this.maxX = -1 / 0, this.minY = 1 / 0, this.maxY = -1 / 0, this.minZ = 1 / 0, this.maxZ = -1 / 0, this.topY = 0, this.currentRadius = 0, this.textWatermarkVersion = 0, this.lastTextWatermarkVersion = 0, this.fetchLimit = 0, this.opts = { ...e }, this.meta = t, t.autoCut && (this.map = /* @__PURE__ */ new Map()), e.format || (e.url?.endsWith(".spx") ? this.opts.format = "spx" : e.url?.endsWith(".splat") ? this.opts.format = "splat" : e.url?.endsWith(".ply") ? this.opts.format = "ply" : e.url?.endsWith(".spz") ? this.opts.format = "spz" : console.error("unknow format!")), this.abortController = new AbortController();
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
var L = /* @__PURE__ */ ((i) => (i[i.FetchReady = 0] = "FetchReady", i[i.Fetching = 1] = "Fetching", i[i.FetchDone = 2] = "FetchDone", i[i.FetchAborted = 3] = "FetchAborted", i[i.FetchFailed = 4] = "FetchFailed", i[i.Invalid = 5] = "Invalid", i))(L || {});
|
|
71
|
-
const Vt = "v1.5.0-dev-map", le = navigator.userAgent.includes("Mobi"),
|
|
71
|
+
const Vt = "v1.5.0-dev-map", le = navigator.userAgent.includes("Mobi"), $a = "QWERTYUIOPLKJHGFDSAZXCVBNM1234567890qwertyuioplkjhgfdsazxcvbnm`~!@#$%^&*()-_=+\\|]}[{'\";::,<.>//? ", ze = 128, Za = 32, F = 32, ja = 20, qa = 16, js = 64 * 1024, Ja = 1024 * 1e4, eo = 10240 * 1e4, _t = 0.28209479177387814, to = 0, no = 20, Kn = 1, ut = 2, $n = 3, io = 3141592653, Zn = "AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEeBmABfQF9YAAAYAF9AX9gAX8Bf2ACf38AYAJ/fwF/AhoCA2VudgRleHBmAAADZW52Bm1lbW9yeQIAAAMGBQECAwQFByEEEV9fd2FzbV9jYWxsX2N0b3JzAAEBSAADAXcABAFEAAUKigsFAwABC3IBBH8gALwiBEH///8DcSEBAkAgBEEXdkH/AXEiAkUNACACQfAATQRAIAFBgICABHJB8QAgAmt2IQEMAQsgAkGNAUsEQEGA+AEhA0EAIQEMAQsgAkEKdEGAgAdrIQMLIAMgBEEQdkGAgAJxciABQQ12cgsyAQJ/QcGmFiEBA0AgACACai0AACABQSFscyEBIAJBAWoiAkH8AEcNAAsgASAAKAJ8RwszACAAQQhBBCABQQFGG2pBADYCACAAQQA2ABwgAP0MAAABAIwRFgCVAWwS7YEyE/0LAgwLqQkDKH8OfQR8IAEoAgRBi/AJRgR/IAEoAgAiBEEASgRAIAFBCWoiAiAEQRNsaiEIIAIgBEESbGohCSACIARBEWxqIQogAiAEQQR0aiELIAIgBEEPbGohDCACIARBDmxqIQ0gAiAEQQ1saiEOIAIgBEEMbGohDyACIARBC2xqIRAgAiAEQQpsaiERIAIgBEEJbGohEiACIARBBmxqIRMgAiAEQQNsaiEUIAEtAAghFUEAIQIDQCACIAlqLQAAIQcgAiAKai0AACEWIAIgC2otAAAhFyACIAxqLQAAIRggAiANai0AACEZIAIgDmotAAAhGiACIA9qLQAAIRsgAiAQai0AACEcIAIgEWotAAAhHSACIBJqLQAAIR4gEyACQQNsIgNqIgUtAAAhHyADIBRqIgYtAAAhICABIANqIgMtAAohISADLQAJISIgBS0AASEjIAYtAAEhJCADLQALIiXAISYgBS0AAiInwCEoIAYtAAIiBsAhKUEAIQUgFQRAIAggAkEBdGoiAy0AASIFQQh0QYD+AXEgAy0AAHIgBUEJdEGAgARxciEFCyAes0MAAIA9lEMAACDBkhAAIS8gHbNDAACAPZRDAAAgwZIQACExIByzQwAAgD2UQwAAIMGSEAAhMkMAAAAAQwAAgD8gB7NDAAAAw5JDAAAAPJQiKiAqlCAXs0MAAADDkkMAAAA8lCIrICuUIBazQwAAAMOSQwAAADyUIiwgLJSSkpMiLZEgLUMAAAAAXRshLSAAIAJBBXRqIgMgIUEIdCAiciAlQRB0ciIHQYCAgHhyIAcgJkEASBuyQwAAgDmUOAIAIAMgBTYCDCADICNBCHQgH3IgJ0EQdHIiBUGAgIB4ciAFIChBAEgbskMAAIA5lDgCCCADICRBCHQgIHIgBkEQdHIiBUGAgIB4ciAFIClBAEgbskMAAIA5lDgCBCADICsgKiAqlCAsICyUIC0gLZQgKyArlJKSkpEiLpUiKyAqIC6VIiqUIjQgLSAulSIwICwgLpUiLJQiNZK7IjggOKAgMrsiOKK2Ii0gLZREAAAAAAAA8D8gLCAslCIyICogKpQiNpK7IjogOqChIC+7IjqitiIuIC6UICsgLJQiMyAwICqUIjeTuyI7IDugIDG7IjuitiIvIC+UkpJDAACAQJQQAiAtICwgKpQiMSAwICuUIjCTuyI5IDmgIDiitiIqlCAuIDMgN5K7IjkgOaAgOqK2IiyUIC9EAAAAAAAA8D8gKyArlCIzIDaSuyI5IDmgoSA7orYiK5SSkkMAAIBAlBACQRB0cjYCECADIC1EAAAAAAAA8D8gMyAykrsiOSA5oKEgOKK2Ii2UIC4gNCA1k7siOCA4oCA6orYiLpQgLyAxIDCSuyI4IDigIDuitiIvlJKSQwAAgECUEAIgKiAqlCAsICyUICsgK5SSkkMAAIBAlBACQRB0cjYCFCADIBpBCHQgG3IgGUEQdHIgGEEYdHI2AhwgAyAqIC2UICwgLpQgKyAvlJKSQwAAgECUEAIgLSAtlCAuIC6UIC8gL5SSkkMAAIBAlBACQRB0cjYCGCACQQFqIgIgBEcNAAsLQQAFQQELCw==", jn = "AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEpBmACf38Bf2ABfQF9YAAAYAF9AX9gAX8Bf2ANf399fX19fX19fX19fwACGgIDZW52BGV4cGYAAQNlbnYGbWVtb3J5AgAAAwcGAgMEBQAAByEEEV9fd2FzbV9jYWxsX2N0b3JzAAEBSAADAXMABQFEAAYKnhUGAwABC3IBBH8gALwiBEH///8DcSEBAkAgBEEXdkH/AXEiAkUNACACQfAATQRAIAFBgICABHJB8QAgAmt2IQEMAQsgAkGNAUsEQEGA+AEhA0EAIQEMAQsgAkEKdEGAgAdrIQMLIAMgBEEQdkGAgAJxciABQQ12cgsyAQJ/QZWjAyEBA0AgACACai0AACABQSFscyEBIAJBAWoiAkH8AEcNAAsgASAAKAJ8RwvpAwIEfAR9IAAgAUECdGoiACACOAIAIABBADYCDCAAIAQ4AgggACADOAIEIAAgCSALIAuUIAogCpQgCCAIlCAJIAmUkpKSkSIElSICIAsgBJUiA5QiCSAIIASVIgggCiAElSIElCIKkrsiDSANoCAHuyINorYiByAHlEQAAAAAAADwPyAEIASUIgsgAyADlCISkrsiDyAPoKEgBbsiD6K2IgUgBZQgAiAElCIRIAggA5QiE5O7IhAgEKAgBrsiEKK2IgYgBpSSkkMAAIBAlBACIAcgBCADlCIUIAggApQiCJO7Ig4gDqAgDaK2IgOUIAUgESATkrsiDiAOoCAPorYiBJQgBkQAAAAAAADwPyACIAKUIhEgEpK7Ig4gDqChIBCitiIClJKSQwAAgECUEAJBEHRyNgIQIAAgB0QAAAAAAADwPyARIAuSuyIOIA6goSANorYiB5QgBSAJIAqTuyINIA2gIA+itiIFlCAGIBQgCJK7Ig0gDaAgEKK2IgaUkpJDAACAQJQQAiADIAOUIAQgBJQgAiAClJKSQwAAgECUEAJBEHRyNgIUIAAgDDYCHCAAIAMgB5QgBCAFlCACIAaUkpJDAACAQJQQAiAHIAeUIAUgBZQgBiAGlJKSQwAAgECUEAJBEHRyNgIYC70BAQJ/IAFBAEoEQANAIAAgA0EDdCAAIANBBXRqIgIqAgAgAioCBCACKgIIIAIqAgwgAioCECACKgIUIAItABy4RAAAAAAAAGDAoEQAAAAAAACAP6K2IAItAB24RAAAAAAAAGDAoEQAAAAAAACAP6K2IAItAB64RAAAAAAAAGDAoEQAAAAAAACAP6K2IAItAB+4RAAAAAAAAGDAoEQAAAAAAACAP6K2IAIoAhgQBCADQQFqIgMgAUcNAAsLQQALxw4BHH8CfwJAAkACQAJAAkAgASgCBCICQQFrDgMBAgMAC0EBIAJBFEcNBBogASgCACIDQQBKBEAgAUEIaiICIANBE2xqIQUgAiADQRJsaiEGIAIgA0ERbGohCCACIANBBHRqIQkgAiADQQ9saiEKIAIgA0EObGohCyACIANBDWxqIQwgAiADQQxsaiENIAIgA0ELbGohDiACIANBCmxqIQ8gAiADQQlsaiEQIAIgA0EGbGohESACIANBA2xqIRJBACECA0AgAiAMai0AACETIAIgDWotAAAhFCACIAtqLQAAIRUgAiAKai0AACEWIAIgBWotAAAhFyACIAZqLQAAIRggAiAIai0AACEZIAIgCWotAAAhGyACIA5qLQAAIRwgAiAPai0AACEdIAAgAkEDdCABIAJBA2wiBGoiBy8ACCAHLAAKIgdB/wFxQRB0ciIaQYCAgHhyIBogB0EASBuyQwAAgDmUIAQgEmoiBy8AACAHLAACIgdB/wFxQRB0ciIaQYCAgHhyIBogB0EASBuyQwAAgDmUIAQgEWoiBC8AACAELAACIgRB/wFxQRB0ciIHQYCAgHhyIAcgBEEASBuyQwAAgDmUIAIgEGotAACzQwAAgD2UQwAAIMGSEAAgHbNDAACAPZRDAAAgwZIQACAcs0MAAIA9lEMAACDBkhAAIBu4RAAAAAAAAGDAoEQAAAAAAACAP6K2IBm4RAAAAAAAAGDAoEQAAAAAAACAP6K2IBi4RAAAAAAAAGDAoEQAAAAAAACAP6K2IBe4RAAAAAAAAGDAoEQAAAAAAACAP6K2IBQgE0EIdHIgFUEQdHIgFkEYdHIQBCACQQFqIgIgA0cNAAsLDAMLIAEoAgAiBUEASgRAA0AgASADQQlsaiICLQANIQYgAi0ADCEIIAItAAshCSACLQAKIQogAi0ACSELIAItAAghDCACLQAQIQ0gAi0ADyEOIAItAA4hAiAAIANBBHRqIgRCgICAgBA3AgggBCANQRB0QYCA4AdxIA5BFXRBgICA+AFxIAJBGnRBgICAgH5xcnI2AgQgBCAGQQF2QfwAcSAIQQR0QYAfcSAJQQl0QYDgB3EgCkEOdEGAgPgBcSALQRN0QYCAgD5xIAxBGHRBgICAQHFycnJyciACQQZ2cjYCACADQQFqIgMgBUcNAAsLDAILIAEoAgAiCEEASgRAA0AgASADQRhsaiICLQAaIQkgAi0AGSEKIAItABghCyACLQAXIQwgAi0AFiENIAItABUhDiACLQANIQ8gAi0ADCEQIAItAAshESACLQAKIRIgAi0ACSETIAItAAghFCACLQAUIQUgAi0AEyEVIAItABIhFiACLQARIRcgAi0AECEYIAItAA8hGSACLQAOIQYgACADQQR0aiIEIAItAB9BBXRBgD5xIAItAB5BCnRBgMAPcSACLQAdQQ90QYCA8ANxIAItABxBFHRBgICA/ABxIAItABsiAkEZdEGAgICAf3FycnJyQQFyNgIMIAQgFUEBdEHwA3EgFkEGdEGA/ABxIBdBC3RBgIAfcSAYQRB0QYCA4AdxIBlBFXRBgICA+AFxIAZBGnRBgICAgH5xcnJycnIgBUEEdnI2AgQgBCAPQQF2QfwAcSAQQQR0QYAfcSARQQl0QYDgB3EgEkEOdEGAgPgBcSATQRN0QYCAgD5xIBRBGHRBgICAQHFycnJyciAGQQZ2cjYCACAEIAlBAnZBPnEgCkEDdEHAD3EgC0EIdEGA8ANxIAxBDXRBgID8AHEgDUESdEGAgIAfcSAOQRd0QYCAgOAHcSAFQRx0QYCAgIB4cXJycnJyciACQQd2cjYCCCADQQFqIgMgCEcNAAsLDAELIAEoAgAiCEEASgRAA0AgASADQRVsaiICLQAaIQkgAi0AGSEKIAItABghCyACLQAXIQwgAi0AFiENIAItABUhDiACLQANIQ8gAi0ADCEQIAItAAshESACLQAKIRIgAi0ACSETIAItAAghFCACLQAUIQUgAi0AEyEVIAItABIhFiACLQARIRcgAi0AECEYIAItAA8hGSACLQAOIQYgACADQQR0aiIEIAItABxBFHRBgICA/ABxIAItABsiAkEZdEGAgICAf3FyQQFyNgIMIAQgFUEBdEHwA3EgFkEGdEGA/ABxIBdBC3RBgIAfcSAYQRB0QYCA4AdxIBlBFXRBgICA+AFxIAZBGnRBgICAgH5xcnJycnIgBUEEdnI2AgQgBCAPQQF2QfwAcSAQQQR0QYAfcSARQQl0QYDgB3EgEkEOdEGAgPgBcSATQRN0QYCAgD5xIBRBGHRBgICAQHFycnJyciAGQQZ2cjYCACAEIAlBAnZBPnEgCkEDdEHAD3EgC0EIdEGA8ANxIAxBDXRBgID8AHEgDUESdEGAgIAfcSAOQRd0QYCAgOAHcSAFQRx0QYCAgIB4cXJycnJyciACQQd2cjYCCCADQQFqIgMgCEcNAAsLC0EACws=";
|
|
72
72
|
async function so(i) {
|
|
73
|
-
const e = new Uint32Array(i.buffer), t = new Float32Array(i.buffer), n = new
|
|
73
|
+
const e = new Uint32Array(i.buffer), t = new Float32Array(i.buffer), n = new Xa();
|
|
74
74
|
n.Fixed = String.fromCharCode(i[0]) + String.fromCharCode(i[1]) + String.fromCharCode(i[2]), n.Version = i[3], n.SplatCount = e[1], n.MinX = t[2], n.MaxX = t[3], n.MinY = t[4], n.MaxY = t[5], n.MinZ = t[6], n.MaxZ = t[7], n.MinTopY = t[8], n.MaxTopY = t[9], n.CreateDate = e[10], n.CreaterId = e[11], n.ExclusiveId = e[12], n.ShDegree = i[52], n.Flag1 = i[53], n.Flag2 = i[54], n.Flag3 = i[55], n.Reserve1 = e[14], n.Reserve2 = e[15];
|
|
75
75
|
let a = "";
|
|
76
76
|
for (let h = 64; h < 124; h++)
|
|
77
77
|
a += String.fromCharCode(i[h]);
|
|
78
78
|
if (n.Comment = a.trim(), n.HashCheck = !0, n.Fixed !== "spx" && n.Version !== 1)
|
|
79
79
|
return null;
|
|
80
|
-
const o = n.CreaterId == 1202056903 ?
|
|
80
|
+
const o = n.CreaterId == 1202056903 ? jn : Zn, s = WebAssembly.compile(Uint8Array.from(atob(o), (h) => h.charCodeAt(0)).buffer), r = new WebAssembly.Memory({ initial: 1, maximum: 1 }), u = (await WebAssembly.instantiate(await s, { env: { memory: r, expf: Gt } })).exports.H;
|
|
81
81
|
return new Uint8Array(r.buffer).set(i, 0), u(0) && (n.HashCheck = !1), n;
|
|
82
82
|
}
|
|
83
83
|
async function fe(i) {
|
|
84
|
-
const e = new Uint32Array(i.slice(0, 8).buffer), t = e[0], n = e[1], a =
|
|
85
|
-
return g.set(i, l),
|
|
84
|
+
const e = new Uint32Array(i.slice(0, 8).buffer), t = e[0], n = e[1], a = Kn == n, o = ut == n, s = $n == n, r = a || o || s, c = !r, u = n == 20 || r ? jn : Zn, l = t * (r ? qa : F), d = WebAssembly.compile(Uint8Array.from(atob(u), (x) => x.charCodeAt(0)).buffer), h = Math.floor((l + i.byteLength) / js) + 2, f = new WebAssembly.Memory({ initial: h, maximum: h }), y = (await WebAssembly.instantiate(await d, { env: { memory: f, expf: Gt } })).exports.D, g = new Uint8Array(f.buffer);
|
|
85
|
+
return g.set(i, l), y(0, l) ? { splatCount: t, blockFormat: n, success: !1 } : { splatCount: t, blockFormat: n, success: !0, datas: g.slice(0, l), isSplat: c, isSh: r, isSh1: a, isSh2: o, isSh3: s };
|
|
86
86
|
}
|
|
87
|
-
async function
|
|
88
|
-
const t = WebAssembly.compile(Uint8Array.from(atob(
|
|
89
|
-
r.set(i.slice(0, e *
|
|
87
|
+
async function xn(i, e) {
|
|
88
|
+
const t = WebAssembly.compile(Uint8Array.from(atob(jn), (u) => u.charCodeAt(0)).buffer), n = Math.floor(e * F / js) + 2, a = new WebAssembly.Memory({ initial: n, maximum: n }), s = (await WebAssembly.instantiate(await t, { env: { memory: a, expf: Gt } })).exports.s, r = new Uint8Array(a.buffer);
|
|
89
|
+
r.set(i.slice(0, e * F), 0);
|
|
90
90
|
const c = s(0, e);
|
|
91
|
-
return c ? (console.error("splat data parser failed:", c), new Uint8Array(0)) : r.slice(0, e *
|
|
91
|
+
return c ? (console.error("splat data parser failed:", c), new Uint8Array(0)) : r.slice(0, e * F);
|
|
92
92
|
}
|
|
93
93
|
async function ao(i, e, t = !0, n = !0) {
|
|
94
|
-
const a = WebAssembly.compile(Uint8Array.from(atob(
|
|
95
|
-
return u[0] = i, t ? u[1] = l * e : u[2] = l * e, r(0, t ? 1 : 0), c.slice(0,
|
|
94
|
+
const a = WebAssembly.compile(Uint8Array.from(atob(Zn), (d) => d.charCodeAt(0)).buffer), o = new WebAssembly.Memory({ initial: 1, maximum: 1 }), r = (await WebAssembly.instantiate(await a, { env: { memory: o, expf: Gt } })).exports.w, c = new Uint8Array(o.buffer), u = new Float32Array(c.buffer), l = n ? -1 : 1;
|
|
95
|
+
return u[0] = i, t ? u[1] = l * e : u[2] = l * e, r(0, t ? 1 : 0), c.slice(0, F);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Gt(i) {
|
|
98
98
|
return Math.exp(i);
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const Qe = le ? 20480 : 51200;
|
|
101
101
|
async function oo(i) {
|
|
102
102
|
let e = 0;
|
|
103
103
|
try {
|
|
@@ -132,11 +132,11 @@ async function oo(i) {
|
|
|
132
132
|
let c = (a + s.byteLength) / n.rowLength | 0, u = (a + s.byteLength) % n.rowLength, l;
|
|
133
133
|
a ? (l = new Uint8Array(c * n.rowLength), l.set(o.slice(0, a), 0), l.set(s.slice(0, s.byteLength - u), a)) : l = s.slice(0, c * n.rowLength), n.downloadSplatCount + c > n.fetchLimit && (c = n.fetchLimit - n.downloadSplatCount, u = 0);
|
|
134
134
|
const d = async () => {
|
|
135
|
-
if (c >
|
|
136
|
-
const h = await
|
|
137
|
-
Mi(n, h), n.downloadSplatCount +=
|
|
135
|
+
if (c > Qe) {
|
|
136
|
+
const h = await xn(l, Qe);
|
|
137
|
+
Mi(n, h), n.downloadSplatCount += Qe, e += Qe * n.rowLength, n.downloadSize = e, c -= Qe, l = l.slice(Qe * n.rowLength), setTimeout(d);
|
|
138
138
|
} else {
|
|
139
|
-
const h = await
|
|
139
|
+
const h = await xn(l, c);
|
|
140
140
|
Mi(n, h), n.downloadSplatCount += c, e += c * n.rowLength, n.downloadSize = e, r(u);
|
|
141
141
|
}
|
|
142
142
|
};
|
|
@@ -145,9 +145,9 @@ async function oo(i) {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
function Mi(i, e) {
|
|
148
|
-
let t = e.byteLength /
|
|
148
|
+
let t = e.byteLength / F;
|
|
149
149
|
const n = Math.min(i.fetchLimit, i.modelSplatCount);
|
|
150
|
-
i.dataSplatCount + t > n ? (t = n - i.dataSplatCount, i.splatData.set(e.slice(0, t *
|
|
150
|
+
i.dataSplatCount + t > n ? (t = n - i.dataSplatCount, i.splatData.set(e.slice(0, t * F), i.dataSplatCount * F)) : i.splatData.set(e, i.dataSplatCount * F);
|
|
151
151
|
const a = new Float32Array(e.buffer);
|
|
152
152
|
for (let s = 0, r = 0, c = 0, u = 0; s < t; s++)
|
|
153
153
|
r = a[s * 8], c = a[s * 8 + 1], u = a[s * 8 + 2], i.minX = Math.min(i.minX, r), i.maxX = Math.max(i.maxX, r), i.minY = Math.min(i.minY, c), i.maxY = Math.max(i.maxY, c), i.minZ = Math.min(i.minZ, u), i.maxZ = Math.max(i.maxZ, u);
|
|
@@ -155,21 +155,21 @@ function Mi(i, e) {
|
|
|
155
155
|
const o = i.header?.MinTopY || 0;
|
|
156
156
|
i.currentRadius = Math.sqrt(i.maxX * i.maxX + o * o + i.maxZ * i.maxZ), i.aabbCenter = new C((i.minX + i.maxX) / 2, (i.minY + i.maxY) / 2, (i.minZ + i.maxZ) / 2);
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function qn(i) {
|
|
159
159
|
let e = !1;
|
|
160
|
-
const t = (p,
|
|
161
|
-
t(re, () => n(_).debugMode), t(
|
|
160
|
+
const t = (p, y, g) => i.on(p, y, g), n = (p, ...y) => i.fire(p, ...y), a = !n(_).renderer;
|
|
161
|
+
t(re, () => n(_).debugMode), t(Bn, () => e = !0);
|
|
162
162
|
let o = 0;
|
|
163
163
|
(function p() {
|
|
164
164
|
o++, !e && requestAnimationFrame(p);
|
|
165
|
-
})(), t(at, (p,
|
|
165
|
+
})(), t(at, (p, y = null, g = 0) => {
|
|
166
166
|
const m = () => {
|
|
167
|
-
e || (g > 0 ? !(o % g) && p(o) : p(o),
|
|
167
|
+
e || (g > 0 ? !(o % g) && p(o) : p(o), y && y() && requestAnimationFrame(m));
|
|
168
168
|
};
|
|
169
169
|
m();
|
|
170
|
-
}), t(Ln, (p,
|
|
170
|
+
}), t(Ln, (p, y = null, g = 20) => {
|
|
171
171
|
const m = () => {
|
|
172
|
-
e || (p(),
|
|
172
|
+
e || (p(), y && y() && setTimeout(m, g));
|
|
173
173
|
};
|
|
174
174
|
m();
|
|
175
175
|
});
|
|
@@ -179,53 +179,53 @@ function Kn(i) {
|
|
|
179
179
|
const p = document.querySelector("#gsviewer #progressBarWrap");
|
|
180
180
|
if (p) {
|
|
181
181
|
p.style.display = "block";
|
|
182
|
-
const
|
|
183
|
-
|
|
182
|
+
const y = document.querySelector("#gsviewer #progressBar");
|
|
183
|
+
y && (y.style.width = "0%");
|
|
184
184
|
}
|
|
185
185
|
})(), (async () => document.querySelector("#gsviewer .logo")?.classList.add("loading"))()) : parent?.onProgress && parent.onProgress(1e-3, "0.001%");
|
|
186
186
|
}), t(Tt, (p) => {
|
|
187
187
|
p && (r = p), s = !1, p !== void 0 && ((async () => {
|
|
188
|
-
const
|
|
189
|
-
|
|
188
|
+
const y = document.querySelector("#gsviewer #progressBarWrap");
|
|
189
|
+
y && (y.style.display = "none");
|
|
190
190
|
})(), (async () => document.querySelector("#gsviewer .logo")?.classList.remove("loading"))(), parent?.onProgress && parent.onProgress(0, "100%", 9));
|
|
191
191
|
}), t(Ts, (p) => {
|
|
192
192
|
s = !0, n(_).debugMode ? (async () => {
|
|
193
|
-
const
|
|
194
|
-
|
|
193
|
+
const y = document.querySelector("#gsviewer #progressBar");
|
|
194
|
+
y && (y.style.width = `${p}%`);
|
|
195
195
|
})() : parent?.onProgress && parent.onProgress(p, `${p}%`);
|
|
196
196
|
}), t(Ia, () => s), t(ks, (p) => {
|
|
197
197
|
c = p;
|
|
198
198
|
}), t(Es, () => !s && r && c >= r), t(Ue, () => {
|
|
199
|
-
const
|
|
200
|
-
return { width:
|
|
199
|
+
const y = n($e).parentElement.getBoundingClientRect();
|
|
200
|
+
return { width: y.width, height: y.height, left: y.left, top: y.top };
|
|
201
201
|
}), t(Le, (p) => {
|
|
202
|
-
let
|
|
203
|
-
return (
|
|
202
|
+
let y = p.x.toFixed(3).split("."), g = p.y.toFixed(3).split("."), m = p.z.toFixed(3).split(".");
|
|
203
|
+
return (y[1] === "000" || y[1] === "00000") && (y[1] = "0"), (g[1] === "000" || g[1] === "00000") && (g[1] = "0"), (m[1] === "000" || m[1] === "00000") && (m[1] = "0"), `${y.join(".")}, ${g.join(".")}, ${m.join(".")}`;
|
|
204
204
|
}), t(Ma, (p) => btoa(p)), t(Ta, (p) => atob(p));
|
|
205
205
|
const u = 1e-3;
|
|
206
206
|
let l = new C(), d = new C(), h = 0;
|
|
207
207
|
t(_a, () => {
|
|
208
|
-
const p = n(V),
|
|
209
|
-
return Math.abs(h -
|
|
208
|
+
const p = n(V), y = p.fov, g = p.position.clone(), m = p.getWorldDirection(new C());
|
|
209
|
+
return Math.abs(h - y) < u && Math.abs(g.x - l.x) < u && Math.abs(g.y - l.y) < u && Math.abs(g.z - l.z) < u && Math.abs(m.x - d.x) < u && Math.abs(m.y - d.y) < u && Math.abs(m.z - d.z) < u ? !1 : (h = y, l = g, d = m, !0);
|
|
210
210
|
}), t(ke, (p) => {
|
|
211
211
|
if (!p)
|
|
212
212
|
return;
|
|
213
|
-
const
|
|
214
|
-
p.traverse((g) =>
|
|
213
|
+
const y = [];
|
|
214
|
+
p.traverse((g) => y.push(g)), y.forEach((g) => {
|
|
215
215
|
g.dispose ? g.dispose() : (g.geometry?.dispose?.(), g.material && g.material instanceof Array ? g.material.forEach((m) => m?.dispose?.()) : g.material?.dispose?.());
|
|
216
216
|
}), p.clear();
|
|
217
217
|
}), t(oe, async ({
|
|
218
218
|
renderSplatCount: p,
|
|
219
|
-
visibleSplatCount:
|
|
219
|
+
visibleSplatCount: y,
|
|
220
220
|
modelSplatCount: g,
|
|
221
221
|
fps: m,
|
|
222
|
-
realFps:
|
|
223
|
-
sortTime:
|
|
224
|
-
fov:
|
|
222
|
+
realFps: x,
|
|
223
|
+
sortTime: b,
|
|
224
|
+
fov: S,
|
|
225
225
|
position: T,
|
|
226
226
|
lookUp: w,
|
|
227
227
|
lookAt: I,
|
|
228
|
-
worker:
|
|
228
|
+
worker: v,
|
|
229
229
|
scene: D,
|
|
230
230
|
// updateSceneData,
|
|
231
231
|
scale: k,
|
|
@@ -234,7 +234,7 @@ function Kn(i) {
|
|
|
234
234
|
} = {}) => {
|
|
235
235
|
if (!n(re))
|
|
236
236
|
return;
|
|
237
|
-
R !== void 0 && f("shDegree", `${R}`), p !== void 0 && f("renderSplatCount", `${p}`),
|
|
237
|
+
R !== void 0 && f("shDegree", `${R}`), p !== void 0 && f("renderSplatCount", `${p}`), y !== void 0 && f("visibleSplatCount", `${y}`), g !== void 0 && f("modelSplatCount", `${g}`), m !== void 0 && f("fps", m), x !== void 0 && f("realFps", `raw ${x}`), b !== void 0 && f("sort", `${b} ms`), !a && n(ee) ? M !== void 0 && f("cuts", `(${M} cuts)`) : f("cuts", ""), v && f("worker", `${v}`), D && f("scene", D), S && f("fov", S), T && f("position", T), w && f("lookUp", w), I && f("lookAt", I), I && f("viewer-version", Vt);
|
|
238
238
|
let E = performance.memory || { usedJSHeapSize: 0, totalJSHeapSize: 0, jsHeapSizeLimit: 0 }, P = "", U = E.usedJSHeapSize / 1024 / 1024;
|
|
239
239
|
U > 1e3 ? P += (U / 1024).toFixed(2) + " G" : P += U.toFixed(0) + " M", P += " / ";
|
|
240
240
|
let O = E.totalJSHeapSize / 1024 / 1024;
|
|
@@ -242,16 +242,16 @@ function Kn(i) {
|
|
|
242
242
|
let W = E.jsHeapSizeLimit / 1024 / 1024;
|
|
243
243
|
P += " / ", W > 1e3 ? P += (W / 1024).toFixed(2) + " G" : P += W.toFixed(0) + " M", f("memory", P), k && f("scale", k);
|
|
244
244
|
});
|
|
245
|
-
async function f(p,
|
|
245
|
+
async function f(p, y) {
|
|
246
246
|
let g = document.querySelector(`#gsviewer .debug .${p}`);
|
|
247
|
-
g && (g.innerText =
|
|
247
|
+
g && (g.innerText = y);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
function ro(i = 0) {
|
|
251
251
|
const e = /* @__PURE__ */ new Date();
|
|
252
252
|
return e.setDate(e.getDate() - 7), i >= e.getFullYear() * 1e4 + (e.getMonth() + 1) * 100 + e.getDate();
|
|
253
253
|
}
|
|
254
|
-
async function
|
|
254
|
+
async function qs(i) {
|
|
255
255
|
try {
|
|
256
256
|
const e = new ReadableStream({
|
|
257
257
|
async start(n) {
|
|
@@ -266,7 +266,7 @@ async function Ks(i) {
|
|
|
266
266
|
function ne(i) {
|
|
267
267
|
return i < 0 ? 0 : i > 255 ? 255 : i | 0;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function At(i) {
|
|
270
270
|
const e = ne(Math.round(i * 128) + 128);
|
|
271
271
|
return ne(Math.floor((e + 4) / 8) * 8);
|
|
272
272
|
}
|
|
@@ -280,22 +280,22 @@ async function lo(i) {
|
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
282
|
const a = n.body.getReader(), o = parseInt(n.headers.get("content-length") || "0");
|
|
283
|
-
if (o - ze <
|
|
283
|
+
if (o - ze < ja) {
|
|
284
284
|
console.warn("data empty", i.opts.url), i.status === L.Fetching && (i.status = L.Invalid);
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
287
|
i.fileSize = o;
|
|
288
|
-
let r = [], c = new Uint8Array(ze), u = new Uint8Array(
|
|
288
|
+
let r = [], c = new Uint8Array(ze), u = new Uint8Array(F), l = 0, d = !1, h = 0, f = 0, p, y = !1;
|
|
289
289
|
for (; ; ) {
|
|
290
290
|
let { done: g, value: m } = await a.read();
|
|
291
291
|
if (g)
|
|
292
292
|
break;
|
|
293
293
|
if (i.downloadSize += m.byteLength, r) {
|
|
294
294
|
r.push(m);
|
|
295
|
-
let
|
|
295
|
+
let S = 0;
|
|
296
296
|
for (let I = 0; I < r.length; I++)
|
|
297
|
-
|
|
298
|
-
if (
|
|
297
|
+
S += r[I].byteLength;
|
|
298
|
+
if (S < ze)
|
|
299
299
|
continue;
|
|
300
300
|
let T = 0;
|
|
301
301
|
for (let I = 0; I < r.length; I++)
|
|
@@ -315,22 +315,22 @@ async function lo(i) {
|
|
|
315
315
|
u.set(m, l), l += m.byteLength;
|
|
316
316
|
continue;
|
|
317
317
|
}
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
const T = new Int32Array(
|
|
321
|
-
|
|
318
|
+
const S = new Uint8Array(l + m.byteLength);
|
|
319
|
+
S.set(u.slice(0, l), 0), S.set(m, l), m = S.slice(4), l = 0, d = !0, p = [], f = 0;
|
|
320
|
+
const T = new Int32Array(S.slice(0, 4).buffer);
|
|
321
|
+
y = T[0] < 0, h = Math.abs(T[0]);
|
|
322
322
|
}
|
|
323
|
-
let
|
|
324
|
-
if (p.push(m),
|
|
323
|
+
let x = f + m.byteLength;
|
|
324
|
+
if (p.push(m), x < h) {
|
|
325
325
|
f += m.byteLength;
|
|
326
326
|
continue;
|
|
327
327
|
}
|
|
328
|
-
for (;
|
|
329
|
-
let
|
|
328
|
+
for (; x >= h; ) {
|
|
329
|
+
let S = new Uint8Array(h), T = 0;
|
|
330
330
|
for (let I = 0; I < p.length; I++)
|
|
331
|
-
T + p[I].byteLength < h ? (
|
|
332
|
-
|
|
333
|
-
const w = await fe(
|
|
331
|
+
T + p[I].byteLength < h ? (S.set(p[I], T), T += p[I].byteLength) : (S.set(p[I].slice(0, h - T), T), m = new Uint8Array(p[I].slice(h - T)));
|
|
332
|
+
y && (S = await qs(S));
|
|
333
|
+
const w = await fe(S);
|
|
334
334
|
if (!w.success) {
|
|
335
335
|
console.error("spx block data parser failed. block format:", w.blockFormat), i.abortController.abort(), i.status = L.Invalid;
|
|
336
336
|
break;
|
|
@@ -341,13 +341,13 @@ async function lo(i) {
|
|
|
341
341
|
const I = Math.min(i.fetchLimit, i.modelSplatCount);
|
|
342
342
|
if (w.isSh3)
|
|
343
343
|
if (i.sh3Count + w.splatCount > I) {
|
|
344
|
-
const
|
|
345
|
-
i.sh3Data.push(w.datas.slice(0,
|
|
344
|
+
const v = I - i.sh3Count;
|
|
345
|
+
i.sh3Data.push(w.datas.slice(0, v * 16)), i.sh3Count += v;
|
|
346
346
|
} else
|
|
347
347
|
i.sh3Data.push(w.datas), i.sh3Count += w.splatCount;
|
|
348
348
|
else if (i.sh12Count + w.splatCount > I) {
|
|
349
|
-
const
|
|
350
|
-
i.sh12Data.push(w.datas.slice(0,
|
|
349
|
+
const v = I - i.sh12Count;
|
|
350
|
+
i.sh12Data.push(w.datas.slice(0, v * 16)), i.sh12Count += v;
|
|
351
351
|
} else
|
|
352
352
|
i.sh12Data.push(w.datas), i.sh12Count += w.splatCount;
|
|
353
353
|
}
|
|
@@ -356,11 +356,11 @@ async function lo(i) {
|
|
|
356
356
|
break;
|
|
357
357
|
} else {
|
|
358
358
|
const I = new Int32Array(m.slice(0, 4).buffer);
|
|
359
|
-
h = Math.abs(I[0]),
|
|
359
|
+
h = Math.abs(I[0]), y = I[0] < 0, m = m.slice(4), x = m.byteLength, p = [m], f = m.byteLength;
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
const
|
|
363
|
-
i.header.ShDegree === 3 ? i.downloadSplatCount >=
|
|
362
|
+
const b = i.fetchLimit;
|
|
363
|
+
i.header.ShDegree === 3 ? i.downloadSplatCount >= b && i.sh12Count >= b && i.sh3Count >= b && i.abortController.abort() : i.header.ShDegree ? i.downloadSplatCount >= b && i.sh12Count >= b && i.abortController.abort() : i.downloadSplatCount >= b && i.abortController.abort();
|
|
364
364
|
}
|
|
365
365
|
} catch (e) {
|
|
366
366
|
e.name === "AbortError" ? (console.log("Fetch Abort", i.opts.url), i.status === L.Fetching && (i.status = L.FetchAborted)) : (console.error(e), i.status === L.Fetching && (i.status = L.FetchFailed), i.abortController.abort());
|
|
@@ -373,18 +373,18 @@ function uo(i, e) {
|
|
|
373
373
|
const a = 4096;
|
|
374
374
|
if (!t) {
|
|
375
375
|
const c = Math.min(i.fetchLimit, i.modelSplatCount);
|
|
376
|
-
if (!i.splatData && (i.splatData = new Uint8Array(c *
|
|
376
|
+
if (!i.splatData && (i.splatData = new Uint8Array(c * F)), !i.watermarkData && (i.watermarkData = new Uint8Array(0)), i.dataSplatCount + n > c && (n = c - i.dataSplatCount, !n))
|
|
377
377
|
return;
|
|
378
378
|
const u = new Float32Array(e.buffer), l = new Uint32Array(e.buffer);
|
|
379
|
-
for (let h = 0, f = 0, p = 0,
|
|
380
|
-
if (f = u[h * 8], p = u[h * 8 + 1],
|
|
381
|
-
if (i.watermarkCount *
|
|
382
|
-
const g = new Uint8Array((i.watermarkCount + a) *
|
|
379
|
+
for (let h = 0, f = 0, p = 0, y = 0; h < n; h++)
|
|
380
|
+
if (f = u[h * 8], p = u[h * 8 + 1], y = u[h * 8 + 2], i.minX = Math.min(i.minX, f), i.maxX = Math.max(i.maxX, f), i.minY = Math.min(i.minY, p), i.maxY = Math.max(i.maxY, p), i.minZ = Math.min(i.minZ, y), i.maxZ = Math.max(i.maxZ, y), l[h * 8 + 3] >> 16) {
|
|
381
|
+
if (i.watermarkCount * F === i.watermarkData.byteLength) {
|
|
382
|
+
const g = new Uint8Array((i.watermarkCount + a) * F);
|
|
383
383
|
g.set(i.watermarkData, 0), i.watermarkData = g;
|
|
384
384
|
}
|
|
385
|
-
i.watermarkData.set(e.slice(h * 32, h * 32 + 32), i.watermarkCount++ *
|
|
385
|
+
i.watermarkData.set(e.slice(h * 32, h * 32 + 32), i.watermarkCount++ * F);
|
|
386
386
|
} else
|
|
387
|
-
i.splatData.set(e.slice(h * 32, h * 32 + 32), i.dataSplatCount++ *
|
|
387
|
+
i.splatData.set(e.slice(h * 32, h * 32 + 32), i.dataSplatCount++ * F);
|
|
388
388
|
const d = i.header.MinTopY || 0;
|
|
389
389
|
i.currentRadius = Math.sqrt(i.maxX * i.maxX + d * d + i.maxZ * i.maxZ);
|
|
390
390
|
return;
|
|
@@ -392,34 +392,34 @@ function uo(i, e) {
|
|
|
392
392
|
let o = Math.min(Math.max(i.meta.autoCut, 2), 50);
|
|
393
393
|
!i.watermarkData && (i.watermarkData = new Uint8Array(0));
|
|
394
394
|
const s = new Float32Array(e.buffer), r = new Uint32Array(e.buffer);
|
|
395
|
-
for (let c = 0, u = Math.floor(e.byteLength /
|
|
395
|
+
for (let c = 0, u = Math.floor(e.byteLength / F), l = 0, d = 0, h = 0, f = ""; c < u; c++) {
|
|
396
396
|
if (r[c * 8 + 3] >> 16) {
|
|
397
|
-
if (i.watermarkCount *
|
|
398
|
-
const m = new Uint8Array((i.watermarkCount + a) *
|
|
397
|
+
if (i.watermarkCount * F === i.watermarkData.byteLength) {
|
|
398
|
+
const m = new Uint8Array((i.watermarkCount + a) * F);
|
|
399
399
|
m.set(i.watermarkData, 0), i.watermarkData = m;
|
|
400
400
|
}
|
|
401
|
-
i.watermarkData.set(e.slice(c * 32, c * 32 + 32), i.watermarkCount++ *
|
|
401
|
+
i.watermarkData.set(e.slice(c * 32, c * 32 + 32), i.watermarkCount++ * F);
|
|
402
402
|
continue;
|
|
403
403
|
}
|
|
404
404
|
l = s[c * 8], d = s[c * 8 + 1], h = s[c * 8 + 2];
|
|
405
|
-
let p = Math.min(o - 1, Math.floor(Math.max(0, l - i.header.MinX) / (i.header.MaxX - i.header.MinX) * o)),
|
|
406
|
-
f = `${p}-${
|
|
405
|
+
let p = Math.min(o - 1, Math.floor(Math.max(0, l - i.header.MinX) / (i.header.MaxX - i.header.MinX) * o)), y = Math.min(o - 1, Math.floor(Math.max(0, h - i.header.MinZ) / (i.header.MaxZ - i.header.MinZ) * o));
|
|
406
|
+
f = `${p}-${y}`;
|
|
407
407
|
let g = i.map.get(f);
|
|
408
408
|
if (!g)
|
|
409
|
-
g = {}, g.minX = l, g.maxX = l, g.minY = d, g.maxY = d, g.minZ = h, g.maxZ = h, g.centerX = l, g.centerY = d, g.centerZ = h, g.radius = 0, g.splatData = new Uint8Array(a *
|
|
409
|
+
g = {}, g.minX = l, g.maxX = l, g.minY = d, g.maxY = d, g.minZ = h, g.maxZ = h, g.centerX = l, g.centerY = d, g.centerZ = h, g.radius = 0, g.splatData = new Uint8Array(a * F), g.splatData.set(e.slice(c * F, c * F + F), 0), g.splatCount = 1, i.map.set(f, g);
|
|
410
410
|
else {
|
|
411
|
-
if (g.splatData.byteLength /
|
|
412
|
-
const
|
|
413
|
-
|
|
411
|
+
if (g.splatData.byteLength / F == g.splatCount) {
|
|
412
|
+
const S = new Uint8Array(g.splatData.byteLength + a * F);
|
|
413
|
+
S.set(g.splatData, 0), g.splatData = S;
|
|
414
414
|
}
|
|
415
415
|
g.minX = Math.min(g.minX, l), g.maxX = Math.max(g.maxX, l), g.minY = Math.min(g.minY, d), g.maxY = Math.max(g.maxY, d), g.minZ = Math.min(g.minZ, h), g.maxZ = Math.max(g.maxZ, h), g.centerX = (g.maxX + g.minX) / 2, g.centerY = (g.maxY + g.minY) / 2, g.centerZ = (g.maxZ + g.minZ) / 2;
|
|
416
|
-
const m = g.maxX - g.minX,
|
|
417
|
-
g.radius = Math.sqrt(m * m +
|
|
416
|
+
const m = g.maxX - g.minX, x = g.maxY - g.minY, b = g.maxZ - g.minZ;
|
|
417
|
+
g.radius = Math.sqrt(m * m + x * x + b * b) / 2, g.splatData.set(e.slice(c * F, c * F + F), g.splatCount++ * F);
|
|
418
418
|
}
|
|
419
419
|
i.dataSplatCount++;
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
const
|
|
422
|
+
const je = le ? 20480 : 51200;
|
|
423
423
|
async function ho(i) {
|
|
424
424
|
try {
|
|
425
425
|
i.status = L.Fetching;
|
|
@@ -438,14 +438,14 @@ async function ho(i) {
|
|
|
438
438
|
if (i.downloadSize += p.byteLength, d) {
|
|
439
439
|
if (d.push(p), i.downloadSize < 200)
|
|
440
440
|
continue;
|
|
441
|
-
const
|
|
441
|
+
const y = new Uint8Array(i.downloadSize);
|
|
442
442
|
for (let g = 0, m = 0; g < d.length; g++)
|
|
443
|
-
|
|
444
|
-
if (h = n(
|
|
445
|
-
d = [
|
|
443
|
+
y.set(d[g], m), m += d[g].byteLength;
|
|
444
|
+
if (h = n(y), !h) {
|
|
445
|
+
d = [y];
|
|
446
446
|
continue;
|
|
447
447
|
}
|
|
448
|
-
d = null, p =
|
|
448
|
+
d = null, p = y.slice(h.headerLength), i.rowLength = h.rowLength, i.dataShDegree = h.shDegree, i.modelSplatCount = h.vertexCount, i.splatData = new Uint8Array(Math.min(i.modelSplatCount, i.fetchLimit) * 32);
|
|
449
449
|
}
|
|
450
450
|
l + p.byteLength < i.rowLength ? (u.set(p, l), l += p.byteLength) : (l = await e(h, i, l, u, p), l && u.set(p.slice(p.byteLength - l), 0)), i.downloadSplatCount >= i.fetchLimit && i.abortController.abort();
|
|
451
451
|
}
|
|
@@ -459,9 +459,9 @@ async function ho(i) {
|
|
|
459
459
|
let l = (s + c.byteLength) / o.rowLength | 0, d = (s + c.byteLength) % o.rowLength, h;
|
|
460
460
|
s ? (h = new Uint8Array(l * o.rowLength), h.set(r.slice(0, s), 0), h.set(c.slice(0, c.byteLength - d), s)) : h = c.slice(0, l * o.rowLength), o.downloadSplatCount + l > o.fetchLimit && (l = o.fetchLimit - o.downloadSplatCount, d = 0);
|
|
461
461
|
const f = async () => {
|
|
462
|
-
if (l >
|
|
463
|
-
const p = await t(a, h,
|
|
464
|
-
Ti(o, p), o.downloadSplatCount +=
|
|
462
|
+
if (l > je) {
|
|
463
|
+
const p = await t(a, h, je);
|
|
464
|
+
Ti(o, p), o.downloadSplatCount += je, l -= je, h = h.slice(je * o.rowLength), setTimeout(f);
|
|
465
465
|
} else {
|
|
466
466
|
const p = await t(a, h, l);
|
|
467
467
|
Ti(o, p), o.downloadSplatCount += l, u(d);
|
|
@@ -471,46 +471,46 @@ async function ho(i) {
|
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
473
|
async function t(a, o, s) {
|
|
474
|
-
const r = new Uint8Array(s *
|
|
474
|
+
const r = new Uint8Array(s * Za), c = new Float32Array(o.buffer), u = new Float32Array(r.buffer);
|
|
475
475
|
for (let l = 0; l < s; l++)
|
|
476
476
|
u[l * 8 + 0] = c[(l * i.rowLength + a.offsets.x) / 4], u[l * 8 + 1] = c[(l * i.rowLength + a.offsets.y) / 4], u[l * 8 + 2] = c[(l * i.rowLength + a.offsets.z) / 4], u[l * 8 + 3] = Math.exp(c[(l * i.rowLength + a.offsets.scale_0) / 4]), u[l * 8 + 4] = Math.exp(c[(l * i.rowLength + a.offsets.scale_1) / 4]), u[l * 8 + 5] = Math.exp(c[(l * i.rowLength + a.offsets.scale_2) / 4]), r[l * 32 + 24] = ne((0.5 + _t * c[(l * i.rowLength + a.offsets.f_dc_0) / 4]) * 255), r[l * 32 + 25] = ne((0.5 + _t * c[(l * i.rowLength + a.offsets.f_dc_1) / 4]) * 255), r[l * 32 + 26] = ne((0.5 + _t * c[(l * i.rowLength + a.offsets.f_dc_2) / 4]) * 255), r[l * 32 + 27] = ne(1 / (1 + Math.exp(-c[(l * i.rowLength + a.offsets.opacity) / 4])) * 255), r[l * 32 + 28] = ne(c[(l * i.rowLength + a.offsets.rot_0) / 4] * 128 + 128), r[l * 32 + 29] = ne(c[(l * i.rowLength + a.offsets.rot_1) / 4] * 128 + 128), r[l * 32 + 30] = ne(c[(l * i.rowLength + a.offsets.rot_2) / 4] * 128 + 128), r[l * 32 + 31] = ne(c[(l * i.rowLength + a.offsets.rot_3) / 4] * 128 + 128);
|
|
477
477
|
if (a.shDegree == 3) {
|
|
478
478
|
const d = new Uint8Array(s * 24 + 8), h = new Uint8Array(s * 21 + 8), f = new Uint32Array(2);
|
|
479
479
|
f[0] = s, f[1] = ut, d.set(new Uint8Array(f.buffer), 0);
|
|
480
480
|
const p = new Uint32Array(2);
|
|
481
|
-
p[0] = s, p[1] =
|
|
482
|
-
for (let m = 0,
|
|
483
|
-
for (let
|
|
484
|
-
for (let
|
|
485
|
-
d[8 +
|
|
486
|
-
for (let m = 0,
|
|
487
|
-
for (let
|
|
488
|
-
for (let
|
|
489
|
-
h[8 +
|
|
490
|
-
const
|
|
491
|
-
i.sh12Data.push(
|
|
481
|
+
p[0] = s, p[1] = $n, h.set(new Uint8Array(p.buffer), 0);
|
|
482
|
+
for (let m = 0, x = 0; m < s; m++)
|
|
483
|
+
for (let b = 0; b < 8; b++)
|
|
484
|
+
for (let S = 0; S < 3; S++)
|
|
485
|
+
d[8 + x++] = At(c[(m * i.rowLength + a.offsets["f_rest_" + (b + S * 15)]) / 4]);
|
|
486
|
+
for (let m = 0, x = 0; m < s; m++)
|
|
487
|
+
for (let b = 8; b < 15; b++)
|
|
488
|
+
for (let S = 0; S < 3; S++)
|
|
489
|
+
h[8 + x++] = At(c[(m * i.rowLength + a.offsets["f_rest_" + (b + S * 15)]) / 4]);
|
|
490
|
+
const y = await fe(d);
|
|
491
|
+
i.sh12Data.push(y.datas);
|
|
492
492
|
const g = await fe(h);
|
|
493
493
|
i.sh3Data.push(g.datas);
|
|
494
494
|
} else if (a.shDegree == 2) {
|
|
495
495
|
const d = new Uint8Array(s * 24 + 8), h = new Uint32Array(2);
|
|
496
496
|
h[0] = s, h[1] = ut, d.set(new Uint8Array(h.buffer), 0);
|
|
497
|
-
for (let p = 0,
|
|
497
|
+
for (let p = 0, y = 0; p < s; p++)
|
|
498
498
|
for (let g = 0; g < 8; g++)
|
|
499
499
|
for (let m = 0; m < 3; m++)
|
|
500
|
-
d[8 +
|
|
500
|
+
d[8 + y++] = At(c[(p * i.rowLength + a.offsets["f_rest_" + (g + m * 8)]) / 4]);
|
|
501
501
|
const f = await fe(d);
|
|
502
502
|
i.sh12Data.push(f.datas);
|
|
503
503
|
} else if (a.shDegree == 1) {
|
|
504
504
|
const d = new Uint8Array(s * 9 + 8), h = new Uint32Array(2);
|
|
505
|
-
h[0] = s, h[1] =
|
|
506
|
-
for (let p = 0,
|
|
505
|
+
h[0] = s, h[1] = Kn, d.set(new Uint8Array(h.buffer), 0);
|
|
506
|
+
for (let p = 0, y = 0; p < s; p++)
|
|
507
507
|
for (let g = 0; g < 3; g++)
|
|
508
508
|
for (let m = 0; m < 3; m++)
|
|
509
|
-
d[8 +
|
|
509
|
+
d[8 + y++] = At(c[(p * i.rowLength + a.offsets["f_rest_" + (g + m * 3)]) / 4]);
|
|
510
510
|
const f = await fe(d);
|
|
511
511
|
i.sh12Data.push(f.datas);
|
|
512
512
|
}
|
|
513
|
-
return await
|
|
513
|
+
return await xn(r, s);
|
|
514
514
|
}
|
|
515
515
|
function n(a) {
|
|
516
516
|
let o = new TextDecoder().decode(a.slice(0, 2048));
|
|
@@ -534,16 +534,16 @@ async function ho(i) {
|
|
|
534
534
|
ushort: "getUint16",
|
|
535
535
|
uchar: "getUint8"
|
|
536
536
|
};
|
|
537
|
-
for (let
|
|
537
|
+
for (let y of o.slice(0, r).split(`
|
|
538
538
|
`).filter((g) => g.startsWith("property "))) {
|
|
539
|
-
const [g, m,
|
|
540
|
-
d[
|
|
539
|
+
const [g, m, x] = y.split(" "), b = h[m] || "getInt8";
|
|
540
|
+
d[x] = b, l[x] = u, u += parseInt(b.replace(/[^\d]/g, "")) / 8;
|
|
541
541
|
}
|
|
542
542
|
let f = 0;
|
|
543
543
|
d.f_rest_44 ? f = 3 : d.f_rest_23 ? f = 2 : d.f_rest_8 && (f = 1);
|
|
544
544
|
const p = ["x", "y", "z", "scale_0", "scale_1", "scale_2", "f_dc_0", "f_dc_1", "f_dc_2", "opacity", "rot_0", "rot_1", "rot_2", "rot_3"];
|
|
545
|
-
for (let
|
|
546
|
-
const g = p[
|
|
545
|
+
for (let y = 0; y < p.length; y++) {
|
|
546
|
+
const g = p[y];
|
|
547
547
|
if (!d[g])
|
|
548
548
|
throw new Error(`Property not found: ${g}`);
|
|
549
549
|
}
|
|
@@ -551,9 +551,9 @@ async function ho(i) {
|
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
function Ti(i, e) {
|
|
554
|
-
let t = e.byteLength /
|
|
554
|
+
let t = e.byteLength / F;
|
|
555
555
|
const n = Math.min(i.fetchLimit, i.modelSplatCount);
|
|
556
|
-
i.dataSplatCount + t > n ? (t = n - i.dataSplatCount, i.splatData.set(e.slice(0, t *
|
|
556
|
+
i.dataSplatCount + t > n ? (t = n - i.dataSplatCount, i.splatData.set(e.slice(0, t * F), i.dataSplatCount * F)) : i.splatData.set(e, i.dataSplatCount * F);
|
|
557
557
|
const a = new Float32Array(e.buffer);
|
|
558
558
|
for (let s = 0, r = 0, c = 0, u = 0; s < t; s++)
|
|
559
559
|
r = a[s * 8], c = a[s * 8 + 1], u = a[s * 8 + 2], i.minX = Math.min(i.minX, r), i.maxX = Math.max(i.maxX, r), i.minY = Math.min(i.minY, c), i.maxY = Math.max(i.maxY, c), i.minZ = Math.min(i.minZ, u), i.maxZ = Math.max(i.maxZ, u);
|
|
@@ -561,7 +561,7 @@ function Ti(i, e) {
|
|
|
561
561
|
const o = 0;
|
|
562
562
|
i.currentRadius = Math.sqrt(i.maxX * i.maxX + o * o + i.maxZ * i.maxZ), i.aabbCenter = new C((i.minX + i.maxX) / 2, (i.minY + i.maxY) / 2, (i.minZ + i.maxZ) / 2);
|
|
563
563
|
}
|
|
564
|
-
const z = le ? 20480 : 51200,
|
|
564
|
+
const z = le ? 20480 : 51200, jt = 16;
|
|
565
565
|
async function po(i) {
|
|
566
566
|
try {
|
|
567
567
|
i.status = L.Fetching;
|
|
@@ -579,7 +579,7 @@ async function po(i) {
|
|
|
579
579
|
break;
|
|
580
580
|
u.set(f, i.downloadSize), i.downloadSize += f.length;
|
|
581
581
|
}
|
|
582
|
-
const l = await
|
|
582
|
+
const l = await qs(u);
|
|
583
583
|
if (!l || l.length < 16) {
|
|
584
584
|
console.error("Invalid spz format"), i.status = L.Invalid;
|
|
585
585
|
return;
|
|
@@ -592,68 +592,68 @@ async function po(i) {
|
|
|
592
592
|
i.status === L.Fetching && (i.status = L.FetchDone);
|
|
593
593
|
}
|
|
594
594
|
async function e(a, o, s) {
|
|
595
|
-
const r = a.numPoints * 9, c = a.numPoints, u = a.numPoints * 3, l = a.numPoints * 3, d = a.numPoints * 3, h =
|
|
596
|
-
for (let
|
|
597
|
-
let T =
|
|
595
|
+
const r = a.numPoints * 9, c = a.numPoints, u = a.numPoints * 3, l = a.numPoints * 3, d = a.numPoints * 3, h = jt, f = h + r, p = f + c, y = p + u, g = y + l, m = g + d, x = Math.min(a.numPoints, o.fetchLimit), b = Math.ceil(x / z);
|
|
596
|
+
for (let S = 0; S < b; S++) {
|
|
597
|
+
let T = S < b - 1 ? z : x - S * z;
|
|
598
598
|
o.dataSplatCount + T > o.fetchLimit && (T = o.fetchLimit - o.dataSplatCount);
|
|
599
599
|
const w = new Uint8Array(T * 20 + 8), I = new Uint32Array(2);
|
|
600
600
|
I[0] = T, I[1] = no, w.set(new Uint8Array(I.buffer), 0);
|
|
601
|
-
let
|
|
601
|
+
let v = 8;
|
|
602
602
|
for (let M = 0; M < T; M++)
|
|
603
|
-
w[
|
|
603
|
+
w[v++] = s[h + (S * z + M) * 9 + 0], w[v++] = s[h + (S * z + M) * 9 + 1], w[v++] = s[h + (S * z + M) * 9 + 2];
|
|
604
604
|
for (let M = 0; M < T; M++)
|
|
605
|
-
w[
|
|
605
|
+
w[v++] = s[h + (S * z + M) * 9 + 3], w[v++] = s[h + (S * z + M) * 9 + 4], w[v++] = s[h + (S * z + M) * 9 + 5];
|
|
606
606
|
for (let M = 0; M < T; M++)
|
|
607
|
-
w[
|
|
607
|
+
w[v++] = s[h + (S * z + M) * 9 + 6], w[v++] = s[h + (S * z + M) * 9 + 7], w[v++] = s[h + (S * z + M) * 9 + 8];
|
|
608
608
|
for (let M = 0; M < T; M++)
|
|
609
|
-
w[
|
|
609
|
+
w[v++] = s[y + (S * z + M) * 3];
|
|
610
610
|
for (let M = 0; M < T; M++)
|
|
611
|
-
w[
|
|
611
|
+
w[v++] = s[y + (S * z + M) * 3 + 1];
|
|
612
612
|
for (let M = 0; M < T; M++)
|
|
613
|
-
w[
|
|
613
|
+
w[v++] = s[y + (S * z + M) * 3 + 2];
|
|
614
614
|
for (let M = 0; M < T; M++)
|
|
615
|
-
w[
|
|
615
|
+
w[v++] = qt(s[p + (S * z + M) * 3]);
|
|
616
616
|
for (let M = 0; M < T; M++)
|
|
617
|
-
w[
|
|
617
|
+
w[v++] = qt(s[p + (S * z + M) * 3 + 1]);
|
|
618
618
|
for (let M = 0; M < T; M++)
|
|
619
|
-
w[
|
|
619
|
+
w[v++] = qt(s[p + (S * z + M) * 3 + 2]);
|
|
620
620
|
const D = [];
|
|
621
621
|
for (let M = 0, R = 0, E = 0, P = 0; M < T; M++)
|
|
622
|
-
w[
|
|
622
|
+
w[v++] = s[f + (S * z + M)], R = s[g + (S * z + M) * 3 + 0], E = s[g + (S * z + M) * 3 + 1], P = s[g + (S * z + M) * 3 + 2], D.push(fo(R, E, P));
|
|
623
623
|
for (let M = 0; M < T; M++)
|
|
624
|
-
w[
|
|
624
|
+
w[v++] = D[M][0];
|
|
625
625
|
for (let M = 0; M < T; M++)
|
|
626
|
-
w[
|
|
626
|
+
w[v++] = D[M][1];
|
|
627
627
|
for (let M = 0; M < T; M++)
|
|
628
|
-
w[
|
|
628
|
+
w[v++] = D[M][2];
|
|
629
629
|
for (let M = 0; M < T; M++)
|
|
630
|
-
w[
|
|
630
|
+
w[v++] = D[M][3];
|
|
631
631
|
const k = await fe(w);
|
|
632
632
|
if (t(a, o, k.datas), a.shDegree === 1) {
|
|
633
633
|
const M = new Uint8Array(T * 9 + 8), R = new Uint32Array(2);
|
|
634
|
-
R[0] = T, R[1] =
|
|
634
|
+
R[0] = T, R[1] = Kn, M.set(new Uint8Array(R.buffer), 0);
|
|
635
635
|
for (let P = 0, U = 8; P < T; P++)
|
|
636
|
-
M.set(s.slice(m + (
|
|
636
|
+
M.set(s.slice(m + (S * z + P) * 9, m + (S * z + P) * 9 + 9), U), U += 9;
|
|
637
637
|
const E = await fe(M);
|
|
638
638
|
o.sh12Data.push(E.datas);
|
|
639
639
|
} else if (a.shDegree === 2) {
|
|
640
640
|
const M = new Uint8Array(T * 24 + 8), R = new Uint32Array(2);
|
|
641
641
|
R[0] = T, R[1] = ut, M.set(new Uint8Array(R.buffer), 0);
|
|
642
642
|
for (let P = 0, U = 8; P < T; P++)
|
|
643
|
-
M.set(s.slice(m + (
|
|
643
|
+
M.set(s.slice(m + (S * z + P) * 24, m + (S * z + P) * 24 + 24), U), U += 24;
|
|
644
644
|
const E = await fe(M);
|
|
645
645
|
o.sh12Data.push(E.datas);
|
|
646
646
|
} else if (a.shDegree === 3) {
|
|
647
647
|
const M = new Uint8Array(T * 24 + 8), R = new Uint32Array(2);
|
|
648
648
|
R[0] = T, R[1] = ut, M.set(new Uint8Array(R.buffer), 0);
|
|
649
649
|
for (let W = 0, se = 8; W < T; W++)
|
|
650
|
-
M.set(s.slice(m + (
|
|
650
|
+
M.set(s.slice(m + (S * z + W) * 45, m + (S * z + W) * 45 + 24), se), se += 24;
|
|
651
651
|
const E = await fe(M);
|
|
652
652
|
o.sh12Data.push(E.datas);
|
|
653
653
|
const P = new Uint8Array(T * 21 + 8), U = new Uint32Array(2);
|
|
654
|
-
U[0] = T, U[1] =
|
|
654
|
+
U[0] = T, U[1] = $n, P.set(new Uint8Array(U.buffer), 0);
|
|
655
655
|
for (let W = 0, se = 8; W < T; W++)
|
|
656
|
-
P.set(s.slice(m + (
|
|
656
|
+
P.set(s.slice(m + (S * z + W) * 45 + 24, m + (S * z + W) * 45 + 45), se), se += 21;
|
|
657
657
|
const O = await fe(P);
|
|
658
658
|
o.sh3Data.push(O.datas);
|
|
659
659
|
}
|
|
@@ -662,9 +662,9 @@ async function po(i) {
|
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
664
|
function t(a, o, s) {
|
|
665
|
-
let r = s.byteLength /
|
|
665
|
+
let r = s.byteLength / F;
|
|
666
666
|
const c = Math.min(o.fetchLimit, a.numPoints);
|
|
667
|
-
o.dataSplatCount + r > c ? (r = c - o.dataSplatCount, o.splatData.set(s.slice(0, r *
|
|
667
|
+
o.dataSplatCount + r > c ? (r = c - o.dataSplatCount, o.splatData.set(s.slice(0, r * F), o.dataSplatCount * F)) : o.splatData.set(s, o.dataSplatCount * F);
|
|
668
668
|
const u = new Float32Array(s.buffer);
|
|
669
669
|
for (let d = 0, h = 0, f = 0, p = 0; d < r; d++)
|
|
670
670
|
h = u[d * 8], f = u[d * 8 + 1], p = u[d * 8 + 2], o.minX = Math.min(o.minX, h), o.maxX = Math.max(o.maxX, h), o.minY = Math.min(o.minY, f), o.maxY = Math.max(o.maxY, f), o.minZ = Math.min(o.minZ, p), o.maxZ = Math.max(o.maxZ, p);
|
|
@@ -673,7 +673,7 @@ async function po(i) {
|
|
|
673
673
|
o.currentRadius = Math.sqrt(o.maxX * o.maxX + l * l + o.maxZ * o.maxZ), o.aabbCenter = new C((o.minX + o.maxX) / 2, (o.minY + o.maxY) / 2, (o.minZ + o.maxZ) / 2);
|
|
674
674
|
}
|
|
675
675
|
function n(a) {
|
|
676
|
-
const o = a.slice(0,
|
|
676
|
+
const o = a.slice(0, jt), s = new Uint32Array(o.buffer), r = {};
|
|
677
677
|
if (r.magic = s[0], r.version = s[1], r.numPoints = s[2], r.shDegree = o[12], r.fractionalBits = o[13], r.flags = o[14], r.reserved = o[15], r.magic !== 1347635022)
|
|
678
678
|
throw new Error("[SPZ ERROR] header not found");
|
|
679
679
|
if (r.version !== 2)
|
|
@@ -683,12 +683,12 @@ async function po(i) {
|
|
|
683
683
|
if (r.fractionalBits !== 12)
|
|
684
684
|
throw new Error("[SPZ ERROR] unsupported FractionalBits:" + r.fractionalBits);
|
|
685
685
|
let c = 0;
|
|
686
|
-
if (r.shDegree === 1 ? c = 9 : r.shDegree === 2 ? c = 24 : r.shDegree === 3 && (c = 45), a.length !==
|
|
686
|
+
if (r.shDegree === 1 ? c = 9 : r.shDegree === 2 ? c = 24 : r.shDegree === 3 && (c = 45), a.length !== jt + r.numPoints * (19 + c))
|
|
687
687
|
throw new Error("[SPZ ERROR] invalid spz data");
|
|
688
688
|
return r;
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function qt(i) {
|
|
692
692
|
const e = (i - 127.5) / 38.25;
|
|
693
693
|
return ne((0.5 + _t * e) * 255);
|
|
694
694
|
}
|
|
@@ -697,38 +697,38 @@ function fo(i, e, t) {
|
|
|
697
697
|
return [ne(s * 128 + 128), ne(n * 128 + 128), ne(a * 128 + 128), ne(o * 128 + 128)];
|
|
698
698
|
}
|
|
699
699
|
function go(i) {
|
|
700
|
-
const e = (
|
|
700
|
+
const e = (x, b, S) => i.on(x, b, S), t = (x, ...b) => i.fire(x, ...b);
|
|
701
701
|
let n, a = Date.now() + 36e5, o = null, s, r = { index: 0, version: 0 }, c = { version: 0 }, u = !1;
|
|
702
702
|
const l = t(ee);
|
|
703
|
-
e(
|
|
703
|
+
e(Ys, () => s?.aabbCenter || new C());
|
|
704
704
|
let d;
|
|
705
|
-
const h = new Promise((
|
|
705
|
+
const h = new Promise((x) => d = x);
|
|
706
706
|
e(ot, async () => {
|
|
707
|
-
const b = t(_);
|
|
708
|
-
let x = le ? b.maxRenderCountOfMobile : b.maxRenderCountOfPc;
|
|
709
|
-
if (!b.bigSceneMode) {
|
|
710
|
-
let v = await h;
|
|
711
|
-
x = Math.min(v, x) + 10240;
|
|
712
|
-
}
|
|
713
|
-
return x;
|
|
714
|
-
}), e(Je, async (b) => {
|
|
715
707
|
const x = t(_);
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
708
|
+
let b = le ? x.maxRenderCountOfMobile : x.maxRenderCountOfPc;
|
|
709
|
+
if (!x.bigSceneMode) {
|
|
710
|
+
let S = await h;
|
|
711
|
+
b = Math.min(S, b) + 10240;
|
|
712
|
+
}
|
|
713
|
+
return b;
|
|
714
|
+
}), e(Je, async (x) => {
|
|
715
|
+
const b = t(_);
|
|
716
|
+
if (b.bigSceneMode) return 1;
|
|
717
|
+
let S = le ? b.maxRenderCountOfMobile : b.maxRenderCountOfPc, T = await h;
|
|
718
|
+
if (S = Math.min(T, S), !s.dataShDegree) return 1;
|
|
719
|
+
if (x >= 3) {
|
|
720
720
|
if (s.dataShDegree < 3) return 1;
|
|
721
|
-
} else if (
|
|
721
|
+
} else if (x >= 1) {
|
|
722
722
|
if (s.dataShDegree < 1) return 1;
|
|
723
723
|
} else
|
|
724
724
|
return 1;
|
|
725
725
|
const w = 1024 * 2;
|
|
726
|
-
return Math.ceil(
|
|
727
|
-
}), e(
|
|
726
|
+
return Math.ceil(S / w);
|
|
727
|
+
}), e(Nn, async () => t(_).bigSceneMode ? 0 : (await h, s.dataShDegree)), e(Hn, async (x, b = !0) => {
|
|
728
728
|
try {
|
|
729
729
|
await h;
|
|
730
|
-
const
|
|
731
|
-
o = await t(
|
|
730
|
+
const S = !!s.header?.Flag2;
|
|
731
|
+
o = await t(Fs, x, b, S), s && (s.textWatermarkVersion = Date.now());
|
|
732
732
|
} catch {
|
|
733
733
|
console.info("failed to generate watermark");
|
|
734
734
|
}
|
|
@@ -736,77 +736,77 @@ function go(i) {
|
|
|
736
736
|
if (l) return r.version <= c.version ? r.xyz : c.xyz;
|
|
737
737
|
if (s?.status === L.FetchDone || s?.status === L.FetchAborted) {
|
|
738
738
|
if (s.activePoints && s.activePoints.length === void 0) return s.activePoints;
|
|
739
|
-
const
|
|
740
|
-
for (let
|
|
741
|
-
w =
|
|
742
|
-
return s.activePoints =
|
|
739
|
+
const x = {}, b = r.xyz;
|
|
740
|
+
for (let S = 0, T = b.length / 3, w = 0, I = 0, v = 0, D = ""; S < T; S++)
|
|
741
|
+
w = b[S * 3], I = b[S * 3 + 1], v = b[S * 3 + 2], D = `${Math.floor(w / 2) * 2 + 1},${Math.floor(I / 2) * 2 + 1},${Math.floor(v / 2) * 2 + 1}`, (x[D] = x[D] || []).push(w, I, v);
|
|
742
|
+
return s.activePoints = x;
|
|
743
743
|
}
|
|
744
744
|
return r.xyz;
|
|
745
745
|
});
|
|
746
|
-
async function f(
|
|
746
|
+
async function f(x) {
|
|
747
747
|
if (n) return;
|
|
748
748
|
if (s && (s.status === L.Invalid || s.status === L.FetchFailed))
|
|
749
|
-
return t(_).viewerEvents?.fire(
|
|
749
|
+
return t(_).viewerEvents?.fire(q), t(Tt, 0) || t(oe, { renderSplatCount: 0, visibleSplatCount: 0, modelSplatCount: 0 });
|
|
750
750
|
if (!s || !s.downloadSize) return;
|
|
751
|
-
const
|
|
752
|
-
if (
|
|
753
|
-
const
|
|
754
|
-
!s.notifyFetchStopDone && (s.notifyFetchStopDone = !0) && t(Tt,
|
|
751
|
+
const b = s.status !== L.FetchReady && s.status !== L.Fetching;
|
|
752
|
+
if (b) {
|
|
753
|
+
const S = Math.min(s.fetchLimit, s.downloadSplatCount);
|
|
754
|
+
!s.notifyFetchStopDone && (s.notifyFetchStopDone = !0) && t(Tt, S);
|
|
755
755
|
} else
|
|
756
756
|
t(Ts, 100 * s.downloadSize / s.fileSize);
|
|
757
757
|
s.downloadSplatCount && (u || (u = !0, setTimeout(async () => {
|
|
758
|
-
await p(
|
|
758
|
+
await p(b), u = !1;
|
|
759
759
|
})));
|
|
760
760
|
}
|
|
761
|
-
async function p(
|
|
761
|
+
async function p(x) {
|
|
762
762
|
if (n) return;
|
|
763
|
-
const
|
|
764
|
-
let w = s.dataSplatCount, I =
|
|
765
|
-
if (s.renderSplatCount = w + I +
|
|
766
|
-
if (!
|
|
763
|
+
const b = r, S = await t(ot), T = o;
|
|
764
|
+
let w = s.dataSplatCount, I = x ? s.watermarkCount : 0, v = s.meta.showWatermark && x ? (T?.byteLength || 0) / 32 : 0;
|
|
765
|
+
if (s.renderSplatCount = w + I + v, s.renderSplatCount >= S && (s.renderSplatCount = S, I = 0, v = 0, w > S && (w = S)), t(oe, { visibleSplatCount: s.renderSplatCount, modelSplatCount: s.modelSplatCount + v }), Date.now() - b.textureReadyTime < (le ? 600 : 300) || s.smallSceneUploadDone && s.lastTextWatermarkVersion == s.textWatermarkVersion) return;
|
|
766
|
+
if (!b.version) {
|
|
767
767
|
t(ms, (s.header?.Flag2 ? s.header.MaxTopY : s.header?.MinTopY) || 0);
|
|
768
768
|
let O = s.opts.format;
|
|
769
769
|
s.opts.format == "spx" && (O = "spx" + (s.header.ExclusiveId ? (" " + s.header.ExclusiveId).substring(0, 6) : "")), t(oe, { scene: `small (${O})` });
|
|
770
770
|
}
|
|
771
|
-
s.lastTextWatermarkVersion = s.textWatermarkVersion,
|
|
772
|
-
const D = 1024 * 2, k = Math.ceil(2 *
|
|
773
|
-
E.set(s.splatData.slice(0, w * 32), 0), I && E.set(s.watermarkData.slice(0, I * 32), w * 32),
|
|
771
|
+
s.lastTextWatermarkVersion = s.textWatermarkVersion, b.textureReady = !1;
|
|
772
|
+
const D = 1024 * 2, k = Math.ceil(2 * S / D), M = new Uint32Array(D * k * 4), R = new Float32Array(M.buffer), E = new Uint8Array(M.buffer);
|
|
773
|
+
E.set(s.splatData.slice(0, w * 32), 0), I && E.set(s.watermarkData.slice(0, I * 32), w * 32), v && E.set(T.slice(0, v * 32), (w + I) * 32);
|
|
774
774
|
const P = new Float32Array(s.renderSplatCount * 3);
|
|
775
775
|
for (let O = 0, W = 0; O < s.renderSplatCount; O++)
|
|
776
776
|
P[O * 3] = R[O * 8], P[O * 3 + 1] = R[O * 8 + 1], P[O * 3 + 2] = R[O * 8 + 2];
|
|
777
777
|
const U = Date.now();
|
|
778
|
-
if (
|
|
779
|
-
s.smallSceneUploadDone = !0, t(
|
|
778
|
+
if (b.version = U, b.txdata = M, b.xyz = P, b.renderSplatCount = s.renderSplatCount, b.visibleSplatCount = s.downloadSplatCount + v, b.modelSplatCount = s.downloadSplatCount + v, b.watermarkCount = I + v, b.minX = s.minX, b.maxX = s.maxX, b.minY = s.minY, b.maxY = s.maxY, b.minZ = s.minZ, b.maxZ = s.maxZ, t(zs, b, s.currentRadius, s.currentRadius), a = U, x && !s.smallSceneUploadDone) {
|
|
779
|
+
s.smallSceneUploadDone = !0, t(Qs, s.sh12Data), t(Hs, s.sh3Data), s.sh12Data = null, s.sh3Data = null;
|
|
780
780
|
const O = t(_);
|
|
781
|
-
t(
|
|
781
|
+
t(Fn, O.shDegree === void 0 ? 3 : O.shDegree), t(mn);
|
|
782
782
|
}
|
|
783
783
|
t(oe, { renderSplatCount: s.renderSplatCount });
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function y() {
|
|
786
786
|
n || (n = !0, s?.abortController?.abort(), s?.map?.clear(), s = null, o = null, r = null, c = null);
|
|
787
787
|
}
|
|
788
|
-
function g(
|
|
789
|
-
if (
|
|
790
|
-
lo(
|
|
791
|
-
else if (
|
|
792
|
-
oo(
|
|
793
|
-
else if (
|
|
794
|
-
ho(
|
|
795
|
-
else if (
|
|
796
|
-
po(
|
|
788
|
+
function g(x) {
|
|
789
|
+
if (x.opts.format === "spx")
|
|
790
|
+
lo(x);
|
|
791
|
+
else if (x.opts.format === "splat")
|
|
792
|
+
oo(x);
|
|
793
|
+
else if (x.opts.format === "ply")
|
|
794
|
+
ho(x);
|
|
795
|
+
else if (x.opts.format === "spz")
|
|
796
|
+
po(x);
|
|
797
797
|
else
|
|
798
798
|
return !1;
|
|
799
799
|
return !0;
|
|
800
800
|
}
|
|
801
|
-
async function m(
|
|
801
|
+
async function m(x, b) {
|
|
802
802
|
if (n) return;
|
|
803
|
-
const
|
|
804
|
-
if (
|
|
805
|
-
const D =
|
|
806
|
-
s.fetchLimit = Math.min(
|
|
803
|
+
const S = t(_), T = le ? S.maxRenderCountOfMobile : S.maxRenderCountOfPc, w = t(ee);
|
|
804
|
+
if (x.fetchReload = ro(b.updateDate || 0), s = new Ka(x, b), w && b.autoCut) {
|
|
805
|
+
const D = b.pcDownloadLimitSplatCount || eo, k = b.mobileDownloadLimitSplatCount || Ja, M = le ? k : D;
|
|
806
|
+
s.fetchLimit = Math.min(b.autoCut * b.autoCut * T + T, M);
|
|
807
807
|
} else
|
|
808
808
|
s.fetchLimit = T;
|
|
809
|
-
const I = Date.now(),
|
|
809
|
+
const I = Date.now(), v = () => {
|
|
810
810
|
if (!s || s.status == L.Invalid || s.status == L.FetchFailed)
|
|
811
811
|
return d(0);
|
|
812
812
|
if (s.modelSplatCount >= 0)
|
|
@@ -814,16 +814,16 @@ function go(i) {
|
|
|
814
814
|
else {
|
|
815
815
|
if (Date.now() - I >= 3e3)
|
|
816
816
|
return d(0);
|
|
817
|
-
setTimeout(
|
|
817
|
+
setTimeout(v, 10);
|
|
818
818
|
}
|
|
819
819
|
};
|
|
820
|
-
if (
|
|
821
|
-
console.error("Unsupported format:",
|
|
820
|
+
if (v(), !g(s)) {
|
|
821
|
+
console.error("Unsupported format:", x.format), t(Tt, 0);
|
|
822
822
|
return;
|
|
823
823
|
}
|
|
824
824
|
t(Ms);
|
|
825
825
|
}
|
|
826
|
-
e(
|
|
826
|
+
e(Ss, async (x, b) => await m(x, b)), e(vs, (x = 1e4) => Date.now() - a < x), e(bs, () => y()), t(
|
|
827
827
|
at,
|
|
828
828
|
async () => await f(),
|
|
829
829
|
() => !n
|
|
@@ -1083,7 +1083,7 @@ function mo() {
|
|
|
1083
1083
|
}
|
|
1084
1084
|
`;
|
|
1085
1085
|
}
|
|
1086
|
-
function
|
|
1086
|
+
function yo() {
|
|
1087
1087
|
return `
|
|
1088
1088
|
precision highp float;
|
|
1089
1089
|
|
|
@@ -1102,7 +1102,7 @@ function Ao() {
|
|
|
1102
1102
|
|
|
1103
1103
|
`;
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function Ao() {
|
|
1106
1106
|
return `
|
|
1107
1107
|
uniform vec2 viewport;
|
|
1108
1108
|
uniform vec3 realFocusPosition;
|
|
@@ -1176,24 +1176,24 @@ function wo() {
|
|
|
1176
1176
|
}
|
|
1177
1177
|
`;
|
|
1178
1178
|
}
|
|
1179
|
-
const ki = "currentVisibleRadius", Ei = "currentLightRadius", Js = "realFocusPosition", Jt = "splatShTexture12", en = "splatShTexture3", _i = "performanceNow",
|
|
1180
|
-
let
|
|
1181
|
-
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1188
|
-
const _o = `$${
|
|
1189
|
-
|
|
1190
|
-
const Do = `$${
|
|
1191
|
-
|
|
1192
|
-
const Po = `$${
|
|
1193
|
-
|
|
1194
|
-
const Lo = `$${
|
|
1195
|
-
|
|
1196
|
-
function
|
|
1179
|
+
const ki = "currentVisibleRadius", Ei = "currentLightRadius", Js = "realFocusPosition", Jt = "splatShTexture12", en = "splatShTexture3", _i = "performanceNow", So = "waterMarkColor", Ii = "showWaterMark", tn = "splatTexture0", nn = "splatTexture1", Di = "bigSceneMode", Pi = "lightFactor", Li = "debugEffect", Ri = "usingIndex", vo = "cycleColor", bo = "splatIndex", Fi = "pointMode", Bi = "markPoint", Ui = "shDegree", ht = "viewport", Cn = "opacity", Oi = "focal", zi = "topY";
|
|
1180
|
+
let Q = 0;
|
|
1181
|
+
Q++;
|
|
1182
|
+
const Qi = `$${Q++}`;
|
|
1183
|
+
Q++;
|
|
1184
|
+
Q++;
|
|
1185
|
+
Q++;
|
|
1186
|
+
const Hi = `$${Q++}`, xo = `$${Q++}`, Wi = `$${Q++}`, Co = `$${Q++}`, Mo = `$${Q++}`, To = `$${Q++}`, ko = `$${Q++}`, Eo = `$${Q++}`;
|
|
1187
|
+
Q++;
|
|
1188
|
+
const _o = `$${Q++}`, Io = `$${Q++}`;
|
|
1189
|
+
Q++;
|
|
1190
|
+
const Do = `$${Q++}`;
|
|
1191
|
+
Q++;
|
|
1192
|
+
const Po = `$${Q++}`;
|
|
1193
|
+
Q++;
|
|
1194
|
+
const Lo = `$${Q++}`, Ro = `$${Q++}`, Fo = `$${Q++}`, Bo = `$${Q++}`, Uo = `$${Q++}`, Oo = `$${Q++}`, zo = `$${Q++}`, Qo = `$${Q++}`;
|
|
1195
|
+
Q++;
|
|
1196
|
+
function Ho(i) {
|
|
1197
1197
|
let e = !1;
|
|
1198
1198
|
const t = (d, h, f) => i.on(d, h, f), n = (d, ...h) => i.fire(d, ...h);
|
|
1199
1199
|
let a = 0, o = 0;
|
|
@@ -1202,15 +1202,15 @@ function Qo(i) {
|
|
|
1202
1202
|
t(Ws, () => r), t(ci, async () => {
|
|
1203
1203
|
const d = new cn();
|
|
1204
1204
|
d.setIndex([0, 1, 2, 0, 2, 3]);
|
|
1205
|
-
const h = new Float32Array(4 * 3), f = new
|
|
1205
|
+
const h = new Float32Array(4 * 3), f = new He(h, 3);
|
|
1206
1206
|
d.setAttribute("position", f), f.setXYZ(0, -2, -2, 0), f.setXYZ(1, -2, 2, 0), f.setXYZ(2, 2, 2, 0), f.setXYZ(3, 2, -2, 0), f.needsUpdate = !0;
|
|
1207
1207
|
let p = new cn().copy(d);
|
|
1208
|
-
const
|
|
1208
|
+
const y = await n(ot);
|
|
1209
1209
|
if (e)
|
|
1210
1210
|
return;
|
|
1211
|
-
const g = new Uint32Array(
|
|
1212
|
-
return m.setUsage(la), m.needsUpdate = !0, p.setAttribute(
|
|
1213
|
-
n(pi,
|
|
1211
|
+
const g = new Uint32Array(y), m = new ca(g, 1, !1);
|
|
1212
|
+
return m.setUsage(la), m.needsUpdate = !0, p.setAttribute(bo, m), p.instanceCount = 0, t(ui, (x, b, S, T) => {
|
|
1213
|
+
n(pi, b), g.set(x, 0), m.clearUpdateRanges(), m.addUpdateRange(0, x.length), m.needsUpdate = !0, p.instanceCount = x.length, n(N), n(oe, { sortTime: `${S} / ${Date.now() - T}` });
|
|
1214
1214
|
}), t(ka, () => p), t(gi, () => {
|
|
1215
1215
|
m.array = null, p.dispose();
|
|
1216
1216
|
}), p;
|
|
@@ -1218,10 +1218,10 @@ function Qo(i) {
|
|
|
1218
1218
|
const d = await n(ot);
|
|
1219
1219
|
if (e)
|
|
1220
1220
|
return;
|
|
1221
|
-
const h = 1024 * 2, f = Math.ceil(2 * d / h), p = n(_),
|
|
1221
|
+
const h = 1024 * 2, f = Math.ceil(2 * d / h), p = n(_), y = new In({
|
|
1222
1222
|
uniforms: n(ri),
|
|
1223
1223
|
vertexShader: mo(),
|
|
1224
|
-
fragmentShader:
|
|
1224
|
+
fragmentShader: yo(),
|
|
1225
1225
|
transparent: !0,
|
|
1226
1226
|
alphaTest: 1,
|
|
1227
1227
|
blending: da,
|
|
@@ -1232,16 +1232,16 @@ function Qo(i) {
|
|
|
1232
1232
|
side: we
|
|
1233
1233
|
}), g = new Uint32Array(h * f * 4);
|
|
1234
1234
|
let m = new Ee(g, h, f, _e, Ie);
|
|
1235
|
-
m.internalFormat = "RGBA32UI", m.needsUpdate = !0,
|
|
1236
|
-
const
|
|
1237
|
-
let
|
|
1238
|
-
|
|
1235
|
+
m.internalFormat = "RGBA32UI", m.needsUpdate = !0, y.uniforms[tn].value = m;
|
|
1236
|
+
const x = n(ee) ? f : 1, b = new Uint32Array(h * x * 4);
|
|
1237
|
+
let S = new Ee(b, h, x, _e, Ie);
|
|
1238
|
+
S.internalFormat = "RGBA32UI", S.needsUpdate = !0, y.uniforms[nn].value = S;
|
|
1239
1239
|
const T = await n(Je, 1), w = new Uint32Array(h * T * 4);
|
|
1240
1240
|
let I = new Ee(w, h, T, _e, Ie);
|
|
1241
|
-
I.internalFormat = "RGBA32UI", I.needsUpdate = !0,
|
|
1242
|
-
const
|
|
1243
|
-
let k = new Ee(D, h,
|
|
1244
|
-
k.internalFormat = "RGBA32UI", k.needsUpdate = !0,
|
|
1241
|
+
I.internalFormat = "RGBA32UI", I.needsUpdate = !0, y.uniforms[Jt].value = I;
|
|
1242
|
+
const v = await n(Je, 3), D = new Uint32Array(h * v * 4);
|
|
1243
|
+
let k = new Ee(D, h, v, _e, Ie);
|
|
1244
|
+
k.internalFormat = "RGBA32UI", k.needsUpdate = !0, y.uniforms[en].value = k, y.needsUpdate = !0;
|
|
1245
1245
|
let M = !1;
|
|
1246
1246
|
t(hi, (E) => {
|
|
1247
1247
|
if (!n(ee)) {
|
|
@@ -1254,74 +1254,74 @@ function Qo(i) {
|
|
|
1254
1254
|
const U = new Ee(P, h, f, _e, Ie);
|
|
1255
1255
|
U.onUpdate = () => {
|
|
1256
1256
|
E.textureReady = !0, E.textureReadyTime = Date.now(), l(E), n(ks, E.renderSplatCount);
|
|
1257
|
-
}, U.internalFormat = "RGBA32UI", U.needsUpdate = !0, E.index ? (
|
|
1258
|
-
}), t(
|
|
1257
|
+
}, U.internalFormat = "RGBA32UI", U.needsUpdate = !0, E.index ? (y.uniforms[nn].value = U, S = U) : (y.uniforms[tn].value = U, m = U), y.needsUpdate = !0, n(N);
|
|
1258
|
+
}), t(Qs, async (E) => {
|
|
1259
1259
|
if (n(ee) || !E || !E.length)
|
|
1260
1260
|
return;
|
|
1261
1261
|
const P = new Uint32Array(h * await n(Je, 1) * 4), U = new Uint8Array(P.buffer);
|
|
1262
1262
|
for (let W = 0, se = 0; W < E.length; W++)
|
|
1263
1263
|
U.set(E[W], se), se += E[W].byteLength;
|
|
1264
1264
|
const O = new Ee(P, h, T, _e, Ie);
|
|
1265
|
-
O.internalFormat = "RGBA32UI", O.needsUpdate = !0,
|
|
1266
|
-
}), t(
|
|
1265
|
+
O.internalFormat = "RGBA32UI", O.needsUpdate = !0, y.uniforms[Jt].value = O, y.needsUpdate = !0, n(N);
|
|
1266
|
+
}), t(Hs, async (E) => {
|
|
1267
1267
|
if (n(ee) || !E || !E.length)
|
|
1268
1268
|
return;
|
|
1269
1269
|
const P = new Uint32Array(h * await n(Je, 3) * 4), U = new Uint8Array(P.buffer);
|
|
1270
1270
|
for (let W = 0, se = 0; W < E.length; W++)
|
|
1271
1271
|
U.set(E[W], se), se += E[W].byteLength;
|
|
1272
1272
|
const O = new Ee(P, h, T, _e, Ie);
|
|
1273
|
-
O.internalFormat = "RGBA32UI", O.needsUpdate = !0,
|
|
1274
|
-
}), t(di, () =>
|
|
1273
|
+
O.internalFormat = "RGBA32UI", O.needsUpdate = !0, y.uniforms[en].value = O, y.needsUpdate = !0, n(N);
|
|
1274
|
+
}), t(di, () => y), t(Xt, () => {
|
|
1275
1275
|
const E = n(V), { width: P, height: U } = n(Ue), O = Math.abs(E.projectionMatrix.elements[0]) * 0.5 * P, W = Math.abs(E.projectionMatrix.elements[5]) * 0.5 * U, se = n(di);
|
|
1276
|
-
se.uniforms[Oi].value.set(O, W), se.uniformsNeedUpdate = !0, n(
|
|
1277
|
-
}), t(
|
|
1276
|
+
se.uniforms[Oi].value.set(O, W), se.uniformsNeedUpdate = !0, n(N);
|
|
1277
|
+
}), t(Kt, () => {
|
|
1278
1278
|
const { width: E, height: P } = n(Ue);
|
|
1279
|
-
|
|
1279
|
+
y.uniforms[ht].value.set(E, P), y.uniformsNeedUpdate = !0, n(N);
|
|
1280
1280
|
}), t(pi, (E) => {
|
|
1281
|
-
|
|
1281
|
+
y.uniforms[Ri].value = E, y.uniformsNeedUpdate = !0, n(N);
|
|
1282
1282
|
}), t(nt, (E) => {
|
|
1283
1283
|
const P = n(_);
|
|
1284
|
-
E === void 0 && (E = !P.pointcloudMode),
|
|
1284
|
+
E === void 0 && (E = !P.pointcloudMode), y.uniforms[Fi].value = E ? 1 : 0, y.uniformsNeedUpdate = !0, P.pointcloudMode = E, n(N), P.viewerEvents && (P.viewerEvents.fire(_).pointcloudMode = E);
|
|
1285
1285
|
}), t(fi, (E) => {
|
|
1286
|
-
|
|
1286
|
+
y.uniforms[Di].value = E ? 1 : 0, y.uniformsNeedUpdate = !0;
|
|
1287
1287
|
const P = n(_);
|
|
1288
|
-
P.bigSceneMode = E, n(
|
|
1288
|
+
P.bigSceneMode = E, n(N);
|
|
1289
1289
|
}), t(rt, (E) => {
|
|
1290
|
-
|
|
1290
|
+
y.uniforms[Pi].value = E, y.uniformsNeedUpdate = !0;
|
|
1291
1291
|
const P = n(_);
|
|
1292
|
-
P.lightFactor = E, n(
|
|
1292
|
+
P.lightFactor = E, n(N);
|
|
1293
1293
|
});
|
|
1294
1294
|
let R = !1;
|
|
1295
1295
|
return t(ms, (E) => {
|
|
1296
|
-
n(ee) || R || (R = !0,
|
|
1296
|
+
n(ee) || R || (R = !0, y.uniforms[zi].value = E, y.uniformsNeedUpdate = !0, n(N));
|
|
1297
1297
|
}), t(mt, (E) => {
|
|
1298
|
-
|
|
1299
|
-
}), t(
|
|
1300
|
-
|
|
1298
|
+
y.uniforms[ki].value = E, y.uniformsNeedUpdate = !0, n(N);
|
|
1299
|
+
}), t($t, (E) => {
|
|
1300
|
+
y.uniforms[Ei].value = E, y.uniformsNeedUpdate = !0, n(N);
|
|
1301
1301
|
}), t(Mt, (E, P, U, O) => {
|
|
1302
|
-
|
|
1302
|
+
y.uniforms[Bi].value = [E, P, U, O ? 1 : -1], y.uniformsNeedUpdate = !0, n(N);
|
|
1303
1303
|
}), t(pn, (E = !0) => {
|
|
1304
|
-
|
|
1305
|
-
}), t(
|
|
1306
|
-
|
|
1304
|
+
y.uniforms[Ii].value = E ? 1 : 0, y.uniformsNeedUpdate = !0, n(N);
|
|
1305
|
+
}), t(ys, (E) => {
|
|
1306
|
+
y.uniforms[_i].value = E, y.uniformsNeedUpdate = !0;
|
|
1307
1307
|
}), t(Ea, (E) => {
|
|
1308
|
-
|
|
1309
|
-
}), t(
|
|
1308
|
+
y.uniforms[Li].value = E, y.uniformsNeedUpdate = !0;
|
|
1309
|
+
}), t(Fn, async (E) => {
|
|
1310
1310
|
if (n(ee))
|
|
1311
1311
|
return;
|
|
1312
|
-
const P = await n(
|
|
1313
|
-
E < 0 && (E = 0), E > P && (E = P), r = E,
|
|
1312
|
+
const P = await n(Nn);
|
|
1313
|
+
E < 0 && (E = 0), E > P && (E = P), r = E, y.uniforms[Ui].value = E, y.uniformsNeedUpdate = !0, n(oe, { shDegree: `${E} / max ${P}` }), n(N);
|
|
1314
1314
|
}), t(mi, () => {
|
|
1315
|
-
|
|
1316
|
-
}),
|
|
1315
|
+
y.dispose(), m && m.dispose(), S && S.dispose(), I && I.dispose(), k && k.dispose();
|
|
1316
|
+
}), y;
|
|
1317
1317
|
}), t(gs, async () => {
|
|
1318
1318
|
const d = new te(await n(ci), await n(li));
|
|
1319
|
-
return n(
|
|
1319
|
+
return n(Xt), n(Kt), n(fi, n(ee)), n(nt, n(fn)), d;
|
|
1320
1320
|
});
|
|
1321
1321
|
function c() {
|
|
1322
|
-
n(
|
|
1322
|
+
n(Xt), n(Kt);
|
|
1323
1323
|
}
|
|
1324
|
-
window.addEventListener("resize", c), t(
|
|
1324
|
+
window.addEventListener("resize", c), t(xs, () => {
|
|
1325
1325
|
e = !0, window.removeEventListener("resize", c), n(gi), n(mi);
|
|
1326
1326
|
}), t(Cs, async () => {
|
|
1327
1327
|
if (n(ee))
|
|
@@ -1331,10 +1331,10 @@ function Qo(i) {
|
|
|
1331
1331
|
if (e || o <= h)
|
|
1332
1332
|
return;
|
|
1333
1333
|
h += (o - h) * d, n(mt, h);
|
|
1334
|
-
let
|
|
1335
|
-
|
|
1334
|
+
let y = n(Es);
|
|
1335
|
+
y && !p && (p = Date.now());
|
|
1336
1336
|
let g = h / a;
|
|
1337
|
-
|
|
1337
|
+
y && (g > 0.9 || Date.now() - p > 2500) ? (n(fn) && n(gn, !0), n(mt, 0), f = !0) : y && g > 0.7 ? d = Math.min(d * 1.2, 0.3) : y && g > 0.5 ? d = Math.min(d * 1.2, 0.2) : g > 0.4 && (d = Math.min(d * 1.05, 0.1));
|
|
1338
1338
|
}, () => !e && !f, 3);
|
|
1339
1339
|
}), t(gn, (d = !1) => {
|
|
1340
1340
|
if (n(ee))
|
|
@@ -1344,17 +1344,17 @@ function Qo(i) {
|
|
|
1344
1344
|
const h = n(_), f = a * 1e-3;
|
|
1345
1345
|
let p = { currentPointMode: h.pointcloudMode, stepRate: 15e-4, currentLightRadius: f, stop: !1 };
|
|
1346
1346
|
s.push(p), n(at, () => {
|
|
1347
|
-
e || (p.currentLightRadius += a * p.stepRate, n(
|
|
1347
|
+
e || (p.currentLightRadius += a * p.stepRate, n($t, p.currentLightRadius), p.currentLightRadius > a ? (n(nt, !p.currentPointMode), n($t, 0), p.stop = !0, s.length === 1 && s[0] === p && s.pop(), d && n(_)?.viewerEvents?.fire(dt), n(_)?.viewerEvents?.fire(Us)) : p.currentLightRadius / a < 0.4 ? p.stepRate = Math.min(p.stepRate * 1.02, 0.03) : p.stepRate *= 1.04);
|
|
1348
1348
|
}, () => !e && !p.stop);
|
|
1349
1349
|
}), t(ri, () => ({
|
|
1350
1350
|
[tn]: { type: "t", value: null },
|
|
1351
1351
|
[nn]: { type: "t", value: null },
|
|
1352
1352
|
[Jt]: { type: "t", value: null },
|
|
1353
1353
|
[en]: { type: "t", value: null },
|
|
1354
|
-
[Oi]: { type: "v2", value: new
|
|
1355
|
-
[ht]: { type: "v2", value: new
|
|
1354
|
+
[Oi]: { type: "v2", value: new j() },
|
|
1355
|
+
[ht]: { type: "v2", value: new j() },
|
|
1356
1356
|
[Ri]: { type: "int", value: 0 },
|
|
1357
|
-
[
|
|
1357
|
+
[Fi]: { type: "int", value: 0 },
|
|
1358
1358
|
[Li]: { type: "int", value: 1 },
|
|
1359
1359
|
[Di]: { type: "int", value: 0 },
|
|
1360
1360
|
[Ui]: { type: "int", value: 0 },
|
|
@@ -1362,15 +1362,15 @@ function Qo(i) {
|
|
|
1362
1362
|
[zi]: { type: "float", value: 0 },
|
|
1363
1363
|
[ki]: { type: "float", value: 0 },
|
|
1364
1364
|
[Ei]: { type: "float", value: 0 },
|
|
1365
|
-
[
|
|
1365
|
+
[Bi]: { type: "v4", value: new Se(0, 0, 0, -1) },
|
|
1366
1366
|
[_i]: { type: "float", value: performance.now() },
|
|
1367
|
-
[
|
|
1367
|
+
[So]: { type: "v4", value: new Se(1, 1, 0, 0.5) },
|
|
1368
1368
|
[Ii]: { type: "int", value: 1 }
|
|
1369
1369
|
}));
|
|
1370
1370
|
const u = n(cs);
|
|
1371
1371
|
u.onmessage = (d) => {
|
|
1372
1372
|
const h = d.data;
|
|
1373
|
-
h[
|
|
1373
|
+
h[Qi] && n(ui, h[Qi], h[Hi], h[ko], h[To], h[Wi]);
|
|
1374
1374
|
}, t(zs, (d, h, f) => {
|
|
1375
1375
|
n(ee) || (o = h, a = f), n(hi, d);
|
|
1376
1376
|
});
|
|
@@ -1379,57 +1379,57 @@ function Qo(i) {
|
|
|
1379
1379
|
u.postMessage({
|
|
1380
1380
|
[Eo]: !0,
|
|
1381
1381
|
[Po]: h,
|
|
1382
|
-
[
|
|
1383
|
-
[
|
|
1384
|
-
[
|
|
1382
|
+
[Qo]: d.watermarkCount,
|
|
1383
|
+
[Hi]: d.index,
|
|
1384
|
+
[xo]: d.version,
|
|
1385
1385
|
[Wi]: d.renderSplatCount,
|
|
1386
1386
|
[Co]: d.visibleSplatCount,
|
|
1387
1387
|
[Mo]: d.modelSplatCount,
|
|
1388
1388
|
[Lo]: d.minX,
|
|
1389
1389
|
[Ro]: d.maxX,
|
|
1390
|
-
[
|
|
1391
|
-
[
|
|
1390
|
+
[Fo]: d.minY,
|
|
1391
|
+
[Bo]: d.maxY,
|
|
1392
1392
|
[Uo]: d.minZ,
|
|
1393
1393
|
[Oo]: d.maxZ
|
|
1394
1394
|
}, [h.buffer]);
|
|
1395
1395
|
}
|
|
1396
1396
|
}
|
|
1397
1397
|
function Wo(i) {
|
|
1398
|
-
const e = (a, ...o) => i.fire(a, ...o), t = (a, o, s) => i.on(a, o, s), n = new Set(
|
|
1399
|
-
t(
|
|
1398
|
+
const e = (a, ...o) => i.fire(a, ...o), t = (a, o, s) => i.on(a, o, s), n = new Set($a.split(""));
|
|
1399
|
+
t(Fs, async (a = "", o = !0, s = !0) => {
|
|
1400
1400
|
const r = a.trim().substring(0, 100);
|
|
1401
1401
|
let c = await e(os, r), u = [];
|
|
1402
|
-
for (let
|
|
1403
|
-
let
|
|
1402
|
+
for (let b = 0; b < c.length; b++) {
|
|
1403
|
+
let S = [], T = c[b];
|
|
1404
1404
|
for (let w = 0; w < T.length; w++)
|
|
1405
|
-
|
|
1406
|
-
u.push(
|
|
1405
|
+
S.push([(T[w] % 20 - 10) * 0.02, ((T[w] / 20 | 0) - 10) * 0.02]);
|
|
1406
|
+
u.push(S);
|
|
1407
1407
|
}
|
|
1408
1408
|
let l = [], d = r.split("");
|
|
1409
|
-
for (let
|
|
1410
|
-
l[
|
|
1411
|
-
let h = d.length / 2 | 0, f = l[h] / 2, p = !(d.length % 2),
|
|
1412
|
-
for (let
|
|
1413
|
-
|
|
1414
|
-
for (let
|
|
1415
|
-
|
|
1416
|
-
|
|
1409
|
+
for (let b = 0; b < d.length; b++)
|
|
1410
|
+
l[b] = n.has(d[b]) ? 0.22 : 0.4;
|
|
1411
|
+
let h = d.length / 2 | 0, f = l[h] / 2, p = !(d.length % 2), y = p ? 0 : -f;
|
|
1412
|
+
for (let b = h - 1; b >= 0; b--) {
|
|
1413
|
+
y -= l[b] / 2;
|
|
1414
|
+
for (let S of u[b])
|
|
1415
|
+
S[0] += y;
|
|
1416
|
+
y -= l[b] / 2;
|
|
1417
1417
|
}
|
|
1418
|
-
f = l[h] / 2,
|
|
1419
|
-
for (let
|
|
1420
|
-
|
|
1421
|
-
for (let
|
|
1422
|
-
|
|
1423
|
-
|
|
1418
|
+
f = l[h] / 2, y = p ? 0 : f;
|
|
1419
|
+
for (let b = u.length - h; b < u.length; b++) {
|
|
1420
|
+
y += l[b] / 2;
|
|
1421
|
+
for (let S of u[b])
|
|
1422
|
+
S[0] += y;
|
|
1423
|
+
y += l[b] / 2;
|
|
1424
1424
|
}
|
|
1425
1425
|
let g = 0;
|
|
1426
|
-
for (let
|
|
1427
|
-
g +=
|
|
1428
|
-
const m = new Uint8Array(g *
|
|
1429
|
-
let
|
|
1430
|
-
for (let
|
|
1431
|
-
for (let
|
|
1432
|
-
m.set(await ao(
|
|
1426
|
+
for (let b of u)
|
|
1427
|
+
g += b.length;
|
|
1428
|
+
const m = new Uint8Array(g * F);
|
|
1429
|
+
let x = 0;
|
|
1430
|
+
for (let b of u)
|
|
1431
|
+
for (let S of b)
|
|
1432
|
+
m.set(await ao(S[0], S[1], o, s), F * x++);
|
|
1433
1433
|
return m;
|
|
1434
1434
|
});
|
|
1435
1435
|
}
|
|
@@ -1448,23 +1448,23 @@ function Jn(i) {
|
|
|
1448
1448
|
});
|
|
1449
1449
|
});
|
|
1450
1450
|
}
|
|
1451
|
-
function
|
|
1451
|
+
function Yo(i) {
|
|
1452
1452
|
let e = !1;
|
|
1453
1453
|
const t = (r, c, u) => i.on(r, c, u), n = (r, ...c) => i.fire(r, ...c);
|
|
1454
|
-
t(
|
|
1454
|
+
t(As, () => e = !0);
|
|
1455
1455
|
const a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
1456
|
-
t(Dt, () => n(re) && a.set(Date.now(), 1)), t(Pt, () => n(re) && n(
|
|
1456
|
+
t(Dt, () => n(re) && a.set(Date.now(), 1)), t(Pt, () => n(re) && n(Ye, a)), t(Lt, () => n(re) && o.set(Date.now(), 1)), t(Rt, () => n(re) && n(Ye, o)), t(Oe, () => {
|
|
1457
1457
|
e || (n(Lt), n(re) && n(oe, {
|
|
1458
1458
|
fov: n(ft),
|
|
1459
|
-
position: n(Le, n(
|
|
1459
|
+
position: n(Le, n(Be)),
|
|
1460
1460
|
lookAt: n(Le, n(Ce)),
|
|
1461
|
-
lookUp: n(Le, n(
|
|
1461
|
+
lookUp: n(Le, n(Ne))
|
|
1462
1462
|
}));
|
|
1463
1463
|
}, !0);
|
|
1464
1464
|
let s = 0;
|
|
1465
1465
|
t(Ve, () => {
|
|
1466
1466
|
e || (n(ds), n(re) && (n(Dt), !(s++ % 5) && n(oe, { fps: n(Pt), realFps: n(Rt) })));
|
|
1467
|
-
}, !0), t(
|
|
1467
|
+
}, !0), t(Ye, (r) => {
|
|
1468
1468
|
let c = [], u = Date.now(), l = 0;
|
|
1469
1469
|
for (const d of r.keys())
|
|
1470
1470
|
u - d <= 1e3 ? l++ : c.push(d);
|
|
@@ -1475,17 +1475,17 @@ function Vo(i) {
|
|
|
1475
1475
|
const e = { ...i };
|
|
1476
1476
|
return e.bigSceneMode ?? (e.bigSceneMode = !1), e.pointcloudMode ?? (e.pointcloudMode = !e.bigSceneMode), e.lightFactor ?? (e.lightFactor = 1), e.name ?? (e.name = ""), e.showWatermark ?? (e.showWatermark = !0), e;
|
|
1477
1477
|
}
|
|
1478
|
-
function
|
|
1478
|
+
function Yi(i) {
|
|
1479
1479
|
const e = { ...i };
|
|
1480
1480
|
return e.position = e.position ? [...e.position] : [0, -5, 15], e.lookAt = e.lookAt ? [...e.lookAt] : [0, 0, 0], e.lookUp = e.lookUp ? [...e.lookUp] : [0, -1, 0], e.fov ?? (e.fov = 45), e.near ?? (e.near = 1e-3), e.far ?? (e.far = 1e3), e.enableDamping ?? (e.enableDamping = !0), e.autoRotate ?? (e.autoRotate = !0), e.enableZoom ?? (e.enableZoom = !0), e.enableRotate ?? (e.enableRotate = !0), e.enablePan ?? (e.enablePan = !0), e.enableKeyboard ?? (e.enableKeyboard = !0), e.bigSceneMode ?? (e.bigSceneMode = !1), e.pointcloudMode ?? (e.pointcloudMode = !e.bigSceneMode), e.lightFactor ?? (e.lightFactor = 1.1), e.maxRenderCountOfMobile ?? (e.maxRenderCountOfMobile = e.bigSceneMode ? 256 * 1e4 : 384 * 10240), e.maxRenderCountOfPc ?? (e.maxRenderCountOfPc = e.bigSceneMode ? 320 * 1e4 : 384 * 1e4), e.debugMode ?? (e.debugMode = location.protocol === "http:" || /^test\./.test(location.host)), e.markMode ?? (e.markMode = !1), e.markVisible ?? (e.markVisible = !0), e.meterScale ?? (e.meterScale = 1), e;
|
|
1481
1481
|
}
|
|
1482
|
-
function
|
|
1482
|
+
function Go(i) {
|
|
1483
1483
|
let e;
|
|
1484
1484
|
i.root ? e = typeof i.root == "string" ? document.querySelector(i.root) || document.querySelector("#gsviewer") : i.root : e = document.querySelector("#gsviewer"), e || (e = document.createElement("div"), e.id = "gsviewer", document.body.appendChild(e));
|
|
1485
1485
|
let t = document.querySelector("#gsviewer-canvas") || void 0, n = null;
|
|
1486
1486
|
return i.renderer ? n = i.renderer : (n = new es({ canvas: t, antialias: !1, stencil: !0, logarithmicDepthBuffer: !0, precision: "highp" }), n.setSize(e.clientWidth, e.clientHeight), n.setPixelRatio(Math.min(devicePixelRatio, 2)), i.renderer = n), t = n.domElement, t.id = "gsviewer-canvas", e.appendChild(n.domElement), n;
|
|
1487
1487
|
}
|
|
1488
|
-
function
|
|
1488
|
+
function No(i) {
|
|
1489
1489
|
let e = i.camera;
|
|
1490
1490
|
if (!e) {
|
|
1491
1491
|
const t = i.renderer.domElement, n = t.width / t.height;
|
|
@@ -1494,17 +1494,13 @@ function Yo(i) {
|
|
|
1494
1494
|
}
|
|
1495
1495
|
return i.camera;
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1497
|
+
function Xo(i) {
|
|
1498
1498
|
const { renderer: e, scene: t } = i, n = { renderer: e, scene: t };
|
|
1499
1499
|
return n.viewerEvents = i.viewerEvents, n.debugMode = i.debugMode, n.renderer = i.renderer, n.scene = i.scene, n.controls = i.controls, n.bigSceneMode = i.bigSceneMode, n.pointcloudMode = i.pointcloudMode, n.maxRenderCountOfMobile = i.maxRenderCountOfMobile, n.maxRenderCountOfPc = i.maxRenderCountOfPc, n.lightFactor = i.lightFactor, n.shDegree = i.shDegree, n;
|
|
1500
1500
|
}
|
|
1501
|
-
function
|
|
1502
|
-
const e = (
|
|
1503
|
-
|
|
1504
|
-
"" + new URL("assets/Sorter-Dl_LG4bh.js", import.meta.url).href,
|
|
1505
|
-
import.meta.url
|
|
1506
|
-
), { type: "module" });
|
|
1507
|
-
e(cs, () => n), e(ps, () => n.postMessage({ [Do]: t(hs) })), e(fs, () => n.terminate()), (async () => n.postMessage({ [zo]: !0, [Io]: await t(ot), [_o]: t(ee) }))();
|
|
1501
|
+
function Ko(i) {
|
|
1502
|
+
const e = (s, r, c) => i.on(s, r, c), t = (s, ...r) => i.fire(s, ...r), n = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2xldCBpPTA7aSsrO2NvbnN0IEQ9YCQke2krK31gO2krKyxpKyssaSsrO2NvbnN0IFc9YCQke2krK31gLHA9YCQke2krK31gLFM9YCQke2krK31gLHk9YCQke2krK31gLEM9YCQke2krK31gLEE9YCQke2krK31gLFI9YCQke2krK31gLEc9YCQke2krK31gO2krKztjb25zdCBIPWAkJHtpKyt9YCxKPWAkJHtpKyt9YDtpKys7Y29uc3QgVD1gJCR7aSsrfWA7aSsrO2NvbnN0IEs9YCQke2krK31gO2krKztjb25zdCBMPWAkJHtpKyt9YCxOPWAkJHtpKyt9YCxPPWAkJHtpKyt9YCxRPWAkJHtpKyt9YCxfPWAkJHtpKyt9YCxWPWAkJHtpKyt9YCxqPWAkJHtpKyt9YCxQPWAkJHtpKyt9YDtpKys7Y29uc3Qgbm49bmF2aWdhdG9yLnVzZXJBZ2VudC5pbmNsdWRlcygiTW9iaSIpLGI9c2VsZjtsZXQgWD17aW5kZXg6MCx2ZXJzaW9uOjB9LFk9e2luZGV4OjEsdmVyc2lvbjowfSx3PSExLFo7Y29uc3QgdG49LjI7bGV0IGssZj1bXSxNLHo9MCxCO2Z1bmN0aW9uIGFuKG4pe2lmKCF3KXJldHVybjtsZXQgYT1YLnZlcnNpb24+WS52ZXJzaW9uP1g6WTtpZighYS52ZXJzaW9uKXJldHVybjtjb25zdHt4eXo6dCxyZW5kZXJTcGxhdENvdW50Om8sdmlzaWJsZVNwbGF0Q291bnQ6bSxtb2RlbFNwbGF0Q291bnQ6RSx3YXRlcm1hcmtDb3VudDp4LGluZGV4OkYsdmVyc2lvbjp1fT1hO2lmKHo9PT11JiZNYXRoLmFicyhmWzJdLW5bMl0pK01hdGguYWJzKGZbNl0tbls2XSkrTWF0aC5hYnMoZlsxMF0tblsxMF0pK01hdGguYWJzKGZbMTRdLW5bMTRdKTx0bilyZXR1cm47Zj1uLHo9dTtsZXQgST1EYXRlLm5vdygpLGw7aWYoIW8pe2w9bmV3IFVpbnQzMkFycmF5KDApLGIucG9zdE1lc3NhZ2Uoe1tEXTpsLFtTXTpvLFt5XTptLFtDXTpFLFtXXTpGLFtwXTp1LFtSXTowLFtBXTpJfSxbbC5idWZmZXJdKTtyZXR1cm59bGV0IHE9MDtjb25zdCByPW8teDtsPW5ldyBVaW50MzJBcnJheShvKTtjb25zdHttYXhEZXB0aDp2LG1pbkRlcHRoOmR9PWVuKGEsayk7aWYodi1kPD0xZS01KWZvcihsZXQgcz0wO3M8bztzKyspbFtzXT1zO2Vsc2V7bGV0IHM9TWF0aC5taW4ociw2NTUzNSksZz0ocy0xKS8odi1kKSxjPW5ldyBJbnQzMkFycmF5KHMpO2ZvcihsZXQgZT0wLGg9MDtlPHI7ZSsrKWg9KCQobix0WzMqZV0sdFszKmUrMV0sdFszKmUrMl0pLWQpKmd8MCxjW01bZV09aF0rKztmb3IobGV0IGU9MTtlPHM7ZSsrKWNbZV0rPWNbZS0xXTtmb3IobGV0IGU9MDtlPHI7ZSsrKWxbLS1jW01bZV1dXT1lO2lmKHgpe3M9TWF0aC5taW4oTWF0aC5tYXgoeC84fDAsNTEyKSw2NTUzNSksZz0ocy0xKS8odi1kKSxjPW5ldyBJbnQzMkFycmF5KHMpO2ZvcihsZXQgZT1yLGg9MDtlPG87ZSsrKWg9KCQobix0WzMqZV0sdFszKmUrMV0sdFszKmUrMl0pLWQpKmd8MCxjW01bZS1yXT1oXSsrO2ZvcihsZXQgZT0xO2U8cztlKyspY1tlXSs9Y1tlLTFdO2ZvcihsZXQgZT0wO2U8eDtlKyspbFtyKy0tY1tNW2VdXV09citlfX1xPURhdGUubm93KCktSSxiLnBvc3RNZXNzYWdlKHtbRF06bCxbU106byxbeV06bSxbQ106RSxbV106RixbcF06dSxbQV06SSxbUl06cX0sW2wuYnVmZmVyXSl9ZnVuY3Rpb24gJChuLGEsdCxvKXtyZXR1cm4tKG5bMl0qYStuWzZdKnQrblsxMF0qbyl9ZnVuY3Rpb24gZW4obixhKXtsZXQgdD0tMS8wLG89MS8wLG09MDtyZXR1cm4gbT0kKGEsbi5taW5YLG4ubWluWSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5taW5YLG4ubWluWSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5taW5YLG4ubWF4WSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5taW5YLG4ubWF4WSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWluWSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWluWSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWF4WSxuLm1pblopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSksbT0kKGEsbi5tYXhYLG4ubWF4WSxuLm1heFopLHQ9TWF0aC5tYXgodCxtKSxvPU1hdGgubWluKG8sbSkse21heERlcHRoOnQsbWluRGVwdGg6b319Y29uc3QgVT0oKT0+e2lmKCFaKXtaPSEwO2NvbnN0IG49azthbihuKSxzZXRUaW1lb3V0KCgpPT4hKFo9ITEpJiZuIT09ayYmVSgpKX19O2Iub25tZXNzYWdlPW49Pntjb25zdCBhPW4uZGF0YTtpZihhW0ddKXtsZXQgdD0hQnx8YVtXXT09PTA/WDpZO3QubWluWD1hW0xdLHQubWF4WD1hW05dLHQubWluWT1hW09dLHQubWF4WT1hW1FdLHQubWluWj1hW19dLHQubWF4Wj1hW1ZdLHQueHl6PW5ldyBGbG9hdDMyQXJyYXkoYVtLXS5idWZmZXIpLHQud2F0ZXJtYXJrQ291bnQ9YVtQXSx0LnZlcnNpb249YVtwXSx0LnJlbmRlclNwbGF0Q291bnQ9YVtTXSx0LnZpc2libGVTcGxhdENvdW50PWFbeV0sdC5tb2RlbFNwbGF0Q291bnQ9YVtDXSx0LnRleHR1cmVSZWFkeT0hMCx0LnRleHR1cmVSZWFkeVRpbWU9RGF0ZS5ub3coKX1lbHNlIGFbVF0/KGs9YVtUXSxVKCkpOmFbal0mJihCPWFbSF0sTT1uZXcgSW50MzJBcnJheShhW0pdKSx3PSEwKX19KSgpOwo=", a = URL.createObjectURL(new Blob([atob(n)], { type: "text/javascript" })), o = new Worker(new URL(a, import.meta.url), { type: "module" });
|
|
1503
|
+
e(cs, () => o), e(ps, () => o.postMessage({ [Do]: t(hs) })), e(fs, () => o.terminate()), (async () => o.postMessage({ [zo]: !0, [Io]: await t(ot), [_o]: t(ee) }))();
|
|
1508
1504
|
}
|
|
1509
1505
|
class pe extends te {
|
|
1510
1506
|
/**
|
|
@@ -1513,11 +1509,11 @@ class pe extends te {
|
|
|
1513
1509
|
*/
|
|
1514
1510
|
constructor(e) {
|
|
1515
1511
|
super(), this.isSplatMesh = !0, this.disposed = !1;
|
|
1516
|
-
const t = new
|
|
1517
|
-
n(_, () => o), n(
|
|
1518
|
-
a(ps), a(
|
|
1512
|
+
const t = new Xn(), n = (r, c, u) => t.on(r, c, u), a = (r, ...c) => t.fire(r, ...c), o = Vo(e), s = o.controls.object;
|
|
1513
|
+
n(_, () => o), n($e, () => o.renderer.domElement), n(V, () => s), n(ft, () => s.fov), n(Be, (r = !1) => r ? s.position.clone() : s.position), n(Ce, (r = !1) => r ? o.controls.target.clone() : o.controls.target), n(hs, () => s.projectionMatrix.clone().multiply(s.matrixWorldInverse).multiply(this.matrix).toArray()), n(Ca, () => s.projectionMatrix.clone().multiply(s.matrixWorldInverse)), n(Qa, () => s.getWorldDirection(new C()).toArray()), n(ct, () => o.renderer), n(B, () => o.scene), n(ee, () => o.bigSceneMode), n(fn, () => o.pointcloudMode), n(ye, () => this), n(N, () => o.viewerEvents?.fire(J)), qn(t), Jn(t), go(t), Ko(t), Ho(t), Wo(t), this.name = `${o.name || this.id}`, this.events = t, this.opts = o, (async () => (this.copy(await t.fire(gs)), o.matrix && this.applyMatrix4(o.matrix), this.frustumCulled = !1, this.onBeforeRender = () => {
|
|
1514
|
+
a(ps), a(ys, performance.now());
|
|
1519
1515
|
}, this.onAfterRender = () => {
|
|
1520
|
-
a(
|
|
1516
|
+
a(vs, 1e4) && a(N);
|
|
1521
1517
|
}))();
|
|
1522
1518
|
}
|
|
1523
1519
|
/**
|
|
@@ -1529,7 +1525,7 @@ class pe extends te {
|
|
|
1529
1525
|
if (this.disposed)
|
|
1530
1526
|
return;
|
|
1531
1527
|
const t = (a, ...o) => this.events.fire(a, ...o), n = this.opts;
|
|
1532
|
-
return e && (e.pointcloudMode !== void 0 && t(nt, e.pointcloudMode), e.lightFactor !== void 0 && t(rt, e.lightFactor), e.maxRenderCountOfMobile !== void 0 && (n.maxRenderCountOfMobile = e.maxRenderCountOfMobile), e.maxRenderCountOfPc !== void 0 && (n.maxRenderCountOfPc = e.maxRenderCountOfPc), t(
|
|
1528
|
+
return e && (e.pointcloudMode !== void 0 && t(nt, e.pointcloudMode), e.lightFactor !== void 0 && t(rt, e.lightFactor), e.maxRenderCountOfMobile !== void 0 && (n.maxRenderCountOfMobile = e.maxRenderCountOfMobile), e.maxRenderCountOfPc !== void 0 && (n.maxRenderCountOfPc = e.maxRenderCountOfPc), t(N)), { ...n };
|
|
1533
1529
|
}
|
|
1534
1530
|
/**
|
|
1535
1531
|
* 添加渲染指定高斯模型
|
|
@@ -1537,7 +1533,7 @@ class pe extends te {
|
|
|
1537
1533
|
* @param meta 元数据
|
|
1538
1534
|
*/
|
|
1539
1535
|
async addModel(e, t) {
|
|
1540
|
-
this.disposed || (this.meta = t, await this.events.fire(
|
|
1536
|
+
this.disposed || (this.meta = t, await this.events.fire(Ss, e, t));
|
|
1541
1537
|
}
|
|
1542
1538
|
fire(e, ...t) {
|
|
1543
1539
|
if (!this.disposed)
|
|
@@ -1551,19 +1547,19 @@ class pe extends te {
|
|
|
1551
1547
|
return;
|
|
1552
1548
|
this.disposed = !0;
|
|
1553
1549
|
const e = (t, ...n) => this.events.fire(t, ...n);
|
|
1554
|
-
e(ke, this), e(
|
|
1550
|
+
e(ke, this), e(B).remove(this), e(Bn), e(bs), e(fs), e(xs), this.events.clear(), this.events = null, this.opts = null, this.onAfterRender = null;
|
|
1555
1551
|
}
|
|
1556
1552
|
}
|
|
1557
|
-
class
|
|
1553
|
+
class $o extends Dn {
|
|
1558
1554
|
constructor(e = new C(0, 0, 1), t = new C(0, 0, 0), n = 1, a = 0.1, o = 16776960, s = n * 0.2, r = s * 0.2) {
|
|
1559
1555
|
super(), this._axis = new C(), this.type = "ArrowHelper";
|
|
1560
1556
|
const c = new ti(a, a, n, 32);
|
|
1561
1557
|
c.translate(0, n / 2, 0);
|
|
1562
1558
|
const u = new ti(0, r, s, 32);
|
|
1563
1559
|
u.translate(0, n, 0), this.position.copy(t);
|
|
1564
|
-
const l = new
|
|
1560
|
+
const l = new xe({ color: o, toneMapped: !1 });
|
|
1565
1561
|
l.side = we, this.line = new te(c, l), this.line.matrixAutoUpdate = !1, this.line.ignoreIntersect = !0, this.add(this.line);
|
|
1566
|
-
const d = new
|
|
1562
|
+
const d = new xe({ color: o, toneMapped: !1 });
|
|
1567
1563
|
d.side = we, this.cone = new te(u, d), this.cone.matrixAutoUpdate = !1, this.cone.ignoreIntersect = !0, this.add(this.cone), this.setDirection(e), this.renderOrder = 99999;
|
|
1568
1564
|
}
|
|
1569
1565
|
setDirection(e) {
|
|
@@ -1587,26 +1583,26 @@ class qo extends Dn {
|
|
|
1587
1583
|
this.line.geometry.dispose(), this.line.material.dispose(), this.cone.geometry.dispose(), this.cone.material.dispose();
|
|
1588
1584
|
}
|
|
1589
1585
|
}
|
|
1590
|
-
function
|
|
1591
|
-
const e = (
|
|
1586
|
+
function Zo(i) {
|
|
1587
|
+
const e = (y, g, m) => i.on(y, g, m), t = (y, ...g) => i.fire(y, ...g), n = new ua(1, 1);
|
|
1592
1588
|
n.rotateX(-Math.PI / 2);
|
|
1593
|
-
const a = new
|
|
1589
|
+
const a = new xe({ color: 16777215 });
|
|
1594
1590
|
a.transparent = !0, a.opacity = 0.6, a.depthTest = !1, a.depthWrite = !1, a.side = we;
|
|
1595
1591
|
const o = new te(n, a);
|
|
1596
1592
|
o.ignoreIntersect = !0;
|
|
1597
1593
|
const s = new C(0, -1, 0);
|
|
1598
1594
|
s.normalize();
|
|
1599
|
-
const r = new C(0, 0, 0), c = 0.5, u = 0.01, l = 16777062, d = 0.1, h = 0.03, f = new
|
|
1600
|
-
p.add(o), p.add(f), p.renderOrder = 99999, o.renderOrder = 99999, p.visible = !1, t(
|
|
1601
|
-
t(
|
|
1602
|
-
}), e(On, () => p.visible), e(
|
|
1603
|
-
if (
|
|
1595
|
+
const r = new C(0, 0, 0), c = 0.5, u = 0.01, l = 16777062, d = 0.1, h = 0.03, f = new $o(s, r, c, u, l, d, h), p = new Dn();
|
|
1596
|
+
p.add(o), p.add(f), p.renderOrder = 99999, o.renderOrder = 99999, p.visible = !1, t(B).add(p), e(La, () => p), e(kt, (y) => {
|
|
1597
|
+
t(Bt, !0), p.visible = y === void 0 ? !p.visible : y, t(J);
|
|
1598
|
+
}), e(On, () => p.visible), e(Bt, (y = !1) => {
|
|
1599
|
+
if (y || p.visible) {
|
|
1604
1600
|
const g = new It(), m = new C(0, -1, 0);
|
|
1605
|
-
g.setFromUnitVectors(m, t(
|
|
1601
|
+
g.setFromUnitVectors(m, t(Ne)), p.position.copy(t(Ce)), p.quaternion.copy(g);
|
|
1606
1602
|
}
|
|
1607
1603
|
});
|
|
1608
1604
|
}
|
|
1609
|
-
const Vi = { type: "change" }, ei = { type: "start" }, ea = { type: "end" }, wt = new pa(),
|
|
1605
|
+
const Vi = { type: "change" }, ei = { type: "start" }, ea = { type: "end" }, wt = new pa(), Gi = new fa(), jo = Math.cos(70 * be.DEG2RAD), G = new C(), ae = 2 * Math.PI, H = {
|
|
1610
1606
|
NONE: -1,
|
|
1611
1607
|
ROTATE: 0,
|
|
1612
1608
|
DOLLY: 1,
|
|
@@ -1618,7 +1614,7 @@ const Vi = { type: "change" }, ei = { type: "start" }, ea = { type: "end" }, wt
|
|
|
1618
1614
|
}, sn = 1e-6;
|
|
1619
1615
|
class ta extends ha {
|
|
1620
1616
|
constructor(e, t = null) {
|
|
1621
|
-
super(e, t), this.state =
|
|
1617
|
+
super(e, t), this.state = H.NONE, this.enabled = !0, this.target = new C(), this.cursor = new C(), 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: Ae.ROTATE, MIDDLE: Ae.DOLLY, RIGHT: Ae.PAN }, this.touches = { ONE: ve.ROTATE, TWO: ve.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new C(), this._lastQuaternion = new It(), this._lastTargetPosition = new C(), this._quat = new It().setFromUnitVectors(e.up, new C(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new ni(), this._sphericalDelta = new ni(), this._scale = 1, this._panOffset = new C(), this._rotateStart = new j(), this._rotateEnd = new j(), this._rotateDelta = new j(), this._panStart = new j(), this._panEnd = new j(), this._panDelta = new j(), this._dollyStart = new j(), this._dollyEnd = new j(), this._dollyDelta = new j(), this._dollyDirection = new C(), this._mouse = new j(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Jo.bind(this), this._onPointerDown = qo.bind(this), this._onPointerUp = er.bind(this), this._onContextMenu = rr.bind(this), this._onMouseWheel = ir.bind(this), this._onKeyDown = sr.bind(this), this._onTouchStart = ar.bind(this), this._onTouchMove = or.bind(this), this._onMouseDown = tr.bind(this), this._onMouseMove = nr.bind(this), this._interceptControlDown = cr.bind(this), this._interceptControlUp = lr.bind(this), this.domElement !== null && this.connect(), this.update();
|
|
1622
1618
|
}
|
|
1623
1619
|
connect() {
|
|
1624
1620
|
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";
|
|
@@ -1648,11 +1644,11 @@ class ta extends ha {
|
|
|
1648
1644
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
|
1649
1645
|
}
|
|
1650
1646
|
reset() {
|
|
1651
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Vi), this.update(), this.state =
|
|
1647
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Vi), this.update(), this.state = H.NONE;
|
|
1652
1648
|
}
|
|
1653
1649
|
update(e = null) {
|
|
1654
1650
|
const t = this.object.position;
|
|
1655
|
-
|
|
1651
|
+
G.copy(t).sub(this.target), G.applyQuaternion(this._quat), this._spherical.setFromVector3(G), this.autoRotate && this.state === H.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
|
|
1656
1652
|
let n = this.minAzimuthAngle, a = this.maxAzimuthAngle;
|
|
1657
1653
|
isFinite(n) && isFinite(a) && (n < -Math.PI ? n += ae : n > Math.PI && (n -= ae), a < -Math.PI ? a += ae : a > Math.PI && (a -= ae), n <= a ? this._spherical.theta = Math.max(n, Math.min(a, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (n + a) / 2 ? Math.max(n, this._spherical.theta) : Math.min(a, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
|
|
1658
1654
|
let o = !1;
|
|
@@ -1662,10 +1658,10 @@ class ta extends ha {
|
|
|
1662
1658
|
const s = this._spherical.radius;
|
|
1663
1659
|
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), o = s != this._spherical.radius;
|
|
1664
1660
|
}
|
|
1665
|
-
if (
|
|
1661
|
+
if (G.setFromSpherical(this._spherical), G.applyQuaternion(this._quatInverse), t.copy(this.target).add(G), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
|
|
1666
1662
|
let s = null;
|
|
1667
1663
|
if (this.object.isPerspectiveCamera) {
|
|
1668
|
-
const r =
|
|
1664
|
+
const r = G.length();
|
|
1669
1665
|
s = this._clampDistance(r * this._scale);
|
|
1670
1666
|
const c = r - s;
|
|
1671
1667
|
this.object.position.addScaledVector(this._dollyDirection, c), this.object.updateMatrixWorld(), o = !!c;
|
|
@@ -1675,10 +1671,10 @@ class ta extends ha {
|
|
|
1675
1671
|
const c = this.object.zoom;
|
|
1676
1672
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), o = c !== this.object.zoom;
|
|
1677
1673
|
const u = new C(this._mouse.x, this._mouse.y, 0);
|
|
1678
|
-
u.unproject(this.object), this.object.position.sub(u).add(r), this.object.updateMatrixWorld(), s =
|
|
1674
|
+
u.unproject(this.object), this.object.position.sub(u).add(r), this.object.updateMatrixWorld(), s = G.length();
|
|
1679
1675
|
} else
|
|
1680
1676
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
1681
|
-
s !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position) : (wt.origin.copy(this.object.position), wt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(wt.direction)) <
|
|
1677
|
+
s !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position) : (wt.origin.copy(this.object.position), wt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(wt.direction)) < jo ? this.object.lookAt(this.target) : (Gi.setFromNormalAndCoplanarPoint(this.object.up, this.target), wt.intersectPlane(Gi, this.target))));
|
|
1682
1678
|
} else if (this.object.isOrthographicCamera) {
|
|
1683
1679
|
const s = this.object.zoom;
|
|
1684
1680
|
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);
|
|
@@ -1699,18 +1695,18 @@ class ta extends ha {
|
|
|
1699
1695
|
this._sphericalDelta.phi -= e;
|
|
1700
1696
|
}
|
|
1701
1697
|
_panLeft(e, t) {
|
|
1702
|
-
|
|
1698
|
+
G.setFromMatrixColumn(t, 0), G.multiplyScalar(-e), this._panOffset.add(G);
|
|
1703
1699
|
}
|
|
1704
1700
|
_panUp(e, t) {
|
|
1705
|
-
this.screenSpacePanning === !0 ?
|
|
1701
|
+
this.screenSpacePanning === !0 ? G.setFromMatrixColumn(t, 1) : (G.setFromMatrixColumn(t, 0), G.crossVectors(this.object.up, G)), G.multiplyScalar(e), this._panOffset.add(G);
|
|
1706
1702
|
}
|
|
1707
1703
|
// deltaX and deltaY are in pixels; right and down are positive
|
|
1708
1704
|
_pan(e, t) {
|
|
1709
1705
|
const n = this.domElement;
|
|
1710
1706
|
if (this.object.isPerspectiveCamera) {
|
|
1711
1707
|
const a = this.object.position;
|
|
1712
|
-
|
|
1713
|
-
let o =
|
|
1708
|
+
G.copy(a).sub(this.target);
|
|
1709
|
+
let o = G.length();
|
|
1714
1710
|
o *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * o / n.clientHeight, this.object.matrix), this._panUp(2 * t * o / n.clientHeight, this.object.matrix);
|
|
1715
1711
|
} else this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / n.clientWidth, this.object.matrix), this._panUp(t * (this.object.top - this.object.bottom) / this.object.zoom / n.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
|
|
1716
1712
|
}
|
|
@@ -1851,7 +1847,7 @@ class ta extends ha {
|
|
|
1851
1847
|
}
|
|
1852
1848
|
_trackPointer(e) {
|
|
1853
1849
|
let t = this._pointerPositions[e.pointerId];
|
|
1854
|
-
t === void 0 && (t = new
|
|
1850
|
+
t === void 0 && (t = new j(), this._pointerPositions[e.pointerId] = t), t.set(e.pageX, e.pageY);
|
|
1855
1851
|
}
|
|
1856
1852
|
_getSecondPointerPosition(e) {
|
|
1857
1853
|
const t = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
@@ -1875,7 +1871,7 @@ class ta extends ha {
|
|
|
1875
1871
|
return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;
|
|
1876
1872
|
}
|
|
1877
1873
|
}
|
|
1878
|
-
function
|
|
1874
|
+
function qo(i) {
|
|
1879
1875
|
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
|
|
1880
1876
|
}
|
|
1881
1877
|
function Jo(i) {
|
|
@@ -1884,7 +1880,7 @@ function Jo(i) {
|
|
|
1884
1880
|
function er(i) {
|
|
1885
1881
|
switch (this._removePointer(i), this._pointers.length) {
|
|
1886
1882
|
case 0:
|
|
1887
|
-
this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(ea), this.state =
|
|
1883
|
+
this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(ea), this.state = H.NONE;
|
|
1888
1884
|
break;
|
|
1889
1885
|
case 1:
|
|
1890
1886
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
|
@@ -1908,51 +1904,51 @@ function tr(i) {
|
|
|
1908
1904
|
e = -1;
|
|
1909
1905
|
}
|
|
1910
1906
|
switch (e) {
|
|
1911
|
-
case
|
|
1907
|
+
case Ae.DOLLY:
|
|
1912
1908
|
if (this.enableZoom === !1) return;
|
|
1913
|
-
this._handleMouseDownDolly(i), this.state =
|
|
1909
|
+
this._handleMouseDownDolly(i), this.state = H.DOLLY;
|
|
1914
1910
|
break;
|
|
1915
|
-
case
|
|
1911
|
+
case Ae.ROTATE:
|
|
1916
1912
|
if (i.ctrlKey || i.metaKey || i.shiftKey) {
|
|
1917
1913
|
if (this.enablePan === !1) return;
|
|
1918
|
-
this._handleMouseDownPan(i), this.state =
|
|
1914
|
+
this._handleMouseDownPan(i), this.state = H.PAN;
|
|
1919
1915
|
} else {
|
|
1920
1916
|
if (this.enableRotate === !1) return;
|
|
1921
|
-
this._handleMouseDownRotate(i), this.state =
|
|
1917
|
+
this._handleMouseDownRotate(i), this.state = H.ROTATE;
|
|
1922
1918
|
}
|
|
1923
1919
|
break;
|
|
1924
|
-
case
|
|
1920
|
+
case Ae.PAN:
|
|
1925
1921
|
if (i.ctrlKey || i.metaKey || i.shiftKey) {
|
|
1926
1922
|
if (this.enableRotate === !1) return;
|
|
1927
|
-
this._handleMouseDownRotate(i), this.state =
|
|
1923
|
+
this._handleMouseDownRotate(i), this.state = H.ROTATE;
|
|
1928
1924
|
} else {
|
|
1929
1925
|
if (this.enablePan === !1) return;
|
|
1930
|
-
this._handleMouseDownPan(i), this.state =
|
|
1926
|
+
this._handleMouseDownPan(i), this.state = H.PAN;
|
|
1931
1927
|
}
|
|
1932
1928
|
break;
|
|
1933
1929
|
default:
|
|
1934
|
-
this.state =
|
|
1930
|
+
this.state = H.NONE;
|
|
1935
1931
|
}
|
|
1936
|
-
this.state !==
|
|
1932
|
+
this.state !== H.NONE && this.dispatchEvent(ei);
|
|
1937
1933
|
}
|
|
1938
1934
|
function nr(i) {
|
|
1939
1935
|
switch (this.state) {
|
|
1940
|
-
case
|
|
1936
|
+
case H.ROTATE:
|
|
1941
1937
|
if (this.enableRotate === !1) return;
|
|
1942
1938
|
this._handleMouseMoveRotate(i);
|
|
1943
1939
|
break;
|
|
1944
|
-
case
|
|
1940
|
+
case H.DOLLY:
|
|
1945
1941
|
if (this.enableZoom === !1) return;
|
|
1946
1942
|
this._handleMouseMoveDolly(i);
|
|
1947
1943
|
break;
|
|
1948
|
-
case
|
|
1944
|
+
case H.PAN:
|
|
1949
1945
|
if (this.enablePan === !1) return;
|
|
1950
1946
|
this._handleMouseMovePan(i);
|
|
1951
1947
|
break;
|
|
1952
1948
|
}
|
|
1953
1949
|
}
|
|
1954
1950
|
function ir(i) {
|
|
1955
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !==
|
|
1951
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== H.NONE || (i.preventDefault(), this.dispatchEvent(ei), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(ea));
|
|
1956
1952
|
}
|
|
1957
1953
|
function sr(i) {
|
|
1958
1954
|
this.enabled !== !1 && this._handleKeyDown(i);
|
|
@@ -1961,57 +1957,57 @@ function ar(i) {
|
|
|
1961
1957
|
switch (this._trackPointer(i), this._pointers.length) {
|
|
1962
1958
|
case 1:
|
|
1963
1959
|
switch (this.touches.ONE) {
|
|
1964
|
-
case
|
|
1960
|
+
case ve.ROTATE:
|
|
1965
1961
|
if (this.enableRotate === !1) return;
|
|
1966
|
-
this._handleTouchStartRotate(i), this.state =
|
|
1962
|
+
this._handleTouchStartRotate(i), this.state = H.TOUCH_ROTATE;
|
|
1967
1963
|
break;
|
|
1968
|
-
case
|
|
1964
|
+
case ve.PAN:
|
|
1969
1965
|
if (this.enablePan === !1) return;
|
|
1970
|
-
this._handleTouchStartPan(i), this.state =
|
|
1966
|
+
this._handleTouchStartPan(i), this.state = H.TOUCH_PAN;
|
|
1971
1967
|
break;
|
|
1972
1968
|
default:
|
|
1973
|
-
this.state =
|
|
1969
|
+
this.state = H.NONE;
|
|
1974
1970
|
}
|
|
1975
1971
|
break;
|
|
1976
1972
|
case 2:
|
|
1977
1973
|
switch (this.touches.TWO) {
|
|
1978
|
-
case
|
|
1974
|
+
case ve.DOLLY_PAN:
|
|
1979
1975
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
1980
|
-
this._handleTouchStartDollyPan(i), this.state =
|
|
1976
|
+
this._handleTouchStartDollyPan(i), this.state = H.TOUCH_DOLLY_PAN;
|
|
1981
1977
|
break;
|
|
1982
|
-
case
|
|
1978
|
+
case ve.DOLLY_ROTATE:
|
|
1983
1979
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
1984
|
-
this._handleTouchStartDollyRotate(i), this.state =
|
|
1980
|
+
this._handleTouchStartDollyRotate(i), this.state = H.TOUCH_DOLLY_ROTATE;
|
|
1985
1981
|
break;
|
|
1986
1982
|
default:
|
|
1987
|
-
this.state =
|
|
1983
|
+
this.state = H.NONE;
|
|
1988
1984
|
}
|
|
1989
1985
|
break;
|
|
1990
1986
|
default:
|
|
1991
|
-
this.state =
|
|
1987
|
+
this.state = H.NONE;
|
|
1992
1988
|
}
|
|
1993
|
-
this.state !==
|
|
1989
|
+
this.state !== H.NONE && this.dispatchEvent(ei);
|
|
1994
1990
|
}
|
|
1995
1991
|
function or(i) {
|
|
1996
1992
|
switch (this._trackPointer(i), this.state) {
|
|
1997
|
-
case
|
|
1993
|
+
case H.TOUCH_ROTATE:
|
|
1998
1994
|
if (this.enableRotate === !1) return;
|
|
1999
1995
|
this._handleTouchMoveRotate(i), this.update();
|
|
2000
1996
|
break;
|
|
2001
|
-
case
|
|
1997
|
+
case H.TOUCH_PAN:
|
|
2002
1998
|
if (this.enablePan === !1) return;
|
|
2003
1999
|
this._handleTouchMovePan(i), this.update();
|
|
2004
2000
|
break;
|
|
2005
|
-
case
|
|
2001
|
+
case H.TOUCH_DOLLY_PAN:
|
|
2006
2002
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
2007
2003
|
this._handleTouchMoveDollyPan(i), this.update();
|
|
2008
2004
|
break;
|
|
2009
|
-
case
|
|
2005
|
+
case H.TOUCH_DOLLY_ROTATE:
|
|
2010
2006
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
2011
2007
|
this._handleTouchMoveDollyRotate(i), this.update();
|
|
2012
2008
|
break;
|
|
2013
2009
|
default:
|
|
2014
|
-
this.state =
|
|
2010
|
+
this.state = H.NONE;
|
|
2015
2011
|
}
|
|
2016
2012
|
}
|
|
2017
2013
|
function rr(i) {
|
|
@@ -2043,10 +2039,10 @@ class dr extends ta {
|
|
|
2043
2039
|
}
|
|
2044
2040
|
class ur extends ta {
|
|
2045
2041
|
constructor(e, t) {
|
|
2046
|
-
super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT:
|
|
2042
|
+
super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Ae.PAN, MIDDLE: Ae.DOLLY, RIGHT: Ae.ROTATE }, this.touches = { ONE: ve.PAN, TWO: ve.DOLLY_ROTATE };
|
|
2047
2043
|
}
|
|
2048
2044
|
}
|
|
2049
|
-
const
|
|
2045
|
+
const Ni = new Pn(), St = new C();
|
|
2050
2046
|
class na extends cn {
|
|
2051
2047
|
constructor() {
|
|
2052
2048
|
super(), this.isLineSegmentsGeometry = !0, this.type = "LineSegmentsGeometry";
|
|
@@ -2085,7 +2081,7 @@ class na extends cn {
|
|
|
2085
2081
|
computeBoundingBox() {
|
|
2086
2082
|
this.boundingBox === null && (this.boundingBox = new Pn());
|
|
2087
2083
|
const e = this.attributes.instanceStart, t = this.attributes.instanceEnd;
|
|
2088
|
-
e !== void 0 && t !== void 0 && (this.boundingBox.setFromBufferAttribute(e),
|
|
2084
|
+
e !== void 0 && t !== void 0 && (this.boundingBox.setFromBufferAttribute(e), Ni.setFromBufferAttribute(t), this.boundingBox.union(Ni));
|
|
2089
2085
|
}
|
|
2090
2086
|
computeBoundingSphere() {
|
|
2091
2087
|
this.boundingSphere === null && (this.boundingSphere = new tt()), this.boundingBox === null && this.computeBoundingBox();
|
|
@@ -2095,7 +2091,7 @@ class na extends cn {
|
|
|
2095
2091
|
this.boundingBox.getCenter(n);
|
|
2096
2092
|
let a = 0;
|
|
2097
2093
|
for (let o = 0, s = e.count; o < s; o++)
|
|
2098
|
-
|
|
2094
|
+
St.fromBufferAttribute(e, o), a = Math.max(a, n.distanceToSquared(St)), St.fromBufferAttribute(t, o), a = Math.max(a, n.distanceToSquared(St));
|
|
2099
2095
|
this.boundingSphere.radius = Math.sqrt(a), isNaN(this.boundingSphere.radius) && console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.", this);
|
|
2100
2096
|
}
|
|
2101
2097
|
}
|
|
@@ -2108,14 +2104,14 @@ class na extends cn {
|
|
|
2108
2104
|
Ct.line = {
|
|
2109
2105
|
worldUnits: { value: 1 },
|
|
2110
2106
|
linewidth: { value: 1 },
|
|
2111
|
-
resolution: { value: new
|
|
2107
|
+
resolution: { value: new j(1, 1) },
|
|
2112
2108
|
dashOffset: { value: 0 },
|
|
2113
2109
|
dashScale: { value: 1 },
|
|
2114
2110
|
dashSize: { value: 1 },
|
|
2115
2111
|
gapSize: { value: 1 }
|
|
2116
2112
|
// todo FIX - maybe change to totalSize
|
|
2117
2113
|
};
|
|
2118
|
-
|
|
2114
|
+
xt.line = {
|
|
2119
2115
|
uniforms: ns.merge([
|
|
2120
2116
|
Ct.common,
|
|
2121
2117
|
Ct.fog,
|
|
@@ -2500,13 +2496,13 @@ bt.line = {
|
|
|
2500
2496
|
`
|
|
2501
2497
|
)
|
|
2502
2498
|
};
|
|
2503
|
-
class
|
|
2499
|
+
class Xe extends In {
|
|
2504
2500
|
constructor(e) {
|
|
2505
2501
|
super({
|
|
2506
2502
|
type: "LineMaterial",
|
|
2507
|
-
uniforms: ns.clone(
|
|
2508
|
-
vertexShader:
|
|
2509
|
-
fragmentShader:
|
|
2503
|
+
uniforms: ns.clone(xt.line.uniforms),
|
|
2504
|
+
vertexShader: xt.line.vertexShader,
|
|
2505
|
+
fragmentShader: xt.line.fragmentShader,
|
|
2510
2506
|
clipping: !0
|
|
2511
2507
|
// required for clipping support
|
|
2512
2508
|
}), this.isLineMaterial = !0, this.setValues(e);
|
|
@@ -2578,17 +2574,17 @@ class Ge extends In {
|
|
|
2578
2574
|
this.defines && (e === !0 !== this.alphaToCoverage && (this.needsUpdate = !0), e === !0 ? this.defines.USE_ALPHA_TO_COVERAGE = "" : delete this.defines.USE_ALPHA_TO_COVERAGE);
|
|
2579
2575
|
}
|
|
2580
2576
|
}
|
|
2581
|
-
const an = new
|
|
2577
|
+
const an = new Se(), Xi = new C(), Ki = new C(), K = new Se(), $ = new Se(), de = new Se(), on = new C(), rn = new Ke(), Z = new ma(), $i = new C(), vt = new Pn(), bt = new tt(), ue = new Se();
|
|
2582
2578
|
let ge, Re;
|
|
2583
|
-
function
|
|
2579
|
+
function Zi(i, e, t) {
|
|
2584
2580
|
return ue.set(0, 0, -e, 1).applyMatrix4(i.projectionMatrix), ue.multiplyScalar(1 / ue.w), ue.x = Re / t.width, ue.y = Re / t.height, ue.applyMatrix4(i.projectionMatrixInverse), ue.multiplyScalar(1 / ue.w), Math.abs(Math.max(ue.x, ue.y));
|
|
2585
2581
|
}
|
|
2586
2582
|
function hr(i, e) {
|
|
2587
2583
|
const t = i.matrixWorld, n = i.geometry, a = n.attributes.instanceStart, o = n.attributes.instanceEnd, s = Math.min(n.instanceCount, a.count);
|
|
2588
2584
|
for (let r = 0, c = s; r < c; r++) {
|
|
2589
|
-
|
|
2585
|
+
Z.start.fromBufferAttribute(a, r), Z.end.fromBufferAttribute(o, r), Z.applyMatrix4(t);
|
|
2590
2586
|
const u = new C(), l = new C();
|
|
2591
|
-
ge.distanceSqToSegment(
|
|
2587
|
+
ge.distanceSqToSegment(Z.start, Z.end, l, u), l.distanceTo(u) < Re * 0.5 && e.push({
|
|
2592
2588
|
point: l,
|
|
2593
2589
|
pointOnLine: u,
|
|
2594
2590
|
distance: ge.origin.distanceTo(l),
|
|
@@ -2604,26 +2600,26 @@ function pr(i, e, t) {
|
|
|
2604
2600
|
const n = e.projectionMatrix, o = i.material.resolution, s = i.matrixWorld, r = i.geometry, c = r.attributes.instanceStart, u = r.attributes.instanceEnd, l = Math.min(r.instanceCount, c.count), d = -e.near;
|
|
2605
2601
|
ge.at(1, de), de.w = 1, de.applyMatrix4(e.matrixWorldInverse), de.applyMatrix4(n), de.multiplyScalar(1 / de.w), de.x *= o.x / 2, de.y *= o.y / 2, de.z = 0, on.copy(de), rn.multiplyMatrices(e.matrixWorldInverse, s);
|
|
2606
2602
|
for (let h = 0, f = l; h < f; h++) {
|
|
2607
|
-
if (
|
|
2603
|
+
if (K.fromBufferAttribute(c, h), $.fromBufferAttribute(u, h), K.w = 1, $.w = 1, K.applyMatrix4(rn), $.applyMatrix4(rn), K.z > d && $.z > d)
|
|
2608
2604
|
continue;
|
|
2609
|
-
if (
|
|
2610
|
-
const
|
|
2611
|
-
|
|
2612
|
-
} else if (
|
|
2613
|
-
const
|
|
2614
|
-
|
|
2605
|
+
if (K.z > d) {
|
|
2606
|
+
const b = K.z - $.z, S = (K.z - d) / b;
|
|
2607
|
+
K.lerp($, S);
|
|
2608
|
+
} else if ($.z > d) {
|
|
2609
|
+
const b = $.z - K.z, S = ($.z - d) / b;
|
|
2610
|
+
$.lerp(K, S);
|
|
2615
2611
|
}
|
|
2616
|
-
|
|
2617
|
-
const
|
|
2618
|
-
|
|
2619
|
-
const g =
|
|
2620
|
-
if (m &&
|
|
2621
|
-
|
|
2622
|
-
const
|
|
2623
|
-
ge.distanceSqToSegment(
|
|
2624
|
-
point:
|
|
2625
|
-
pointOnLine:
|
|
2626
|
-
distance: ge.origin.distanceTo(
|
|
2612
|
+
K.applyMatrix4(n), $.applyMatrix4(n), K.multiplyScalar(1 / K.w), $.multiplyScalar(1 / $.w), K.x *= o.x / 2, K.y *= o.y / 2, $.x *= o.x / 2, $.y *= o.y / 2, Z.start.copy(K), Z.start.z = 0, Z.end.copy($), Z.end.z = 0;
|
|
2613
|
+
const y = Z.closestPointToPointParameter(on, !0);
|
|
2614
|
+
Z.at(y, $i);
|
|
2615
|
+
const g = be.lerp(K.z, $.z, y), m = g >= -1 && g <= 1, x = on.distanceTo($i) < Re * 0.5;
|
|
2616
|
+
if (m && x) {
|
|
2617
|
+
Z.start.fromBufferAttribute(c, h), Z.end.fromBufferAttribute(u, h), Z.start.applyMatrix4(s), Z.end.applyMatrix4(s);
|
|
2618
|
+
const b = new C(), S = new C();
|
|
2619
|
+
ge.distanceSqToSegment(Z.start, Z.end, S, b), t.push({
|
|
2620
|
+
point: S,
|
|
2621
|
+
pointOnLine: b,
|
|
2622
|
+
distance: ge.origin.distanceTo(S),
|
|
2627
2623
|
object: i,
|
|
2628
2624
|
face: null,
|
|
2629
2625
|
faceIndex: h,
|
|
@@ -2634,14 +2630,14 @@ function pr(i, e, t) {
|
|
|
2634
2630
|
}
|
|
2635
2631
|
}
|
|
2636
2632
|
class fr extends te {
|
|
2637
|
-
constructor(e = new na(), t = new
|
|
2633
|
+
constructor(e = new na(), t = new Xe({ color: Math.random() * 16777215 })) {
|
|
2638
2634
|
super(e, t), this.isLineSegments2 = !0, this.type = "LineSegments2";
|
|
2639
2635
|
}
|
|
2640
2636
|
// for backwards-compatibility, but could be a method of LineSegmentsGeometry...
|
|
2641
2637
|
computeLineDistances() {
|
|
2642
2638
|
const e = this.geometry, t = e.attributes.instanceStart, n = e.attributes.instanceEnd, a = new Float32Array(2 * t.count);
|
|
2643
2639
|
for (let s = 0, r = 0, c = t.count; s < c; s++, r += 2)
|
|
2644
|
-
|
|
2640
|
+
Xi.fromBufferAttribute(t, s), Ki.fromBufferAttribute(n, s), a[r] = r === 0 ? 0 : a[r - 1], a[r + 1] = a[r] + Xi.distanceTo(Ki);
|
|
2645
2641
|
const o = new ln(a, 2, 1);
|
|
2646
2642
|
return e.setAttribute("instanceDistanceStart", new We(o, 1, 0)), e.setAttribute("instanceDistanceEnd", new We(o, 1, 1)), this;
|
|
2647
2643
|
}
|
|
@@ -2651,25 +2647,25 @@ class fr extends te {
|
|
|
2651
2647
|
const o = e.params.Line2 !== void 0 && e.params.Line2.threshold || 0;
|
|
2652
2648
|
ge = e.ray;
|
|
2653
2649
|
const s = this.matrixWorld, r = this.geometry, c = this.material;
|
|
2654
|
-
Re = c.linewidth + o, r.boundingSphere === null && r.computeBoundingSphere(),
|
|
2650
|
+
Re = c.linewidth + o, r.boundingSphere === null && r.computeBoundingSphere(), bt.copy(r.boundingSphere).applyMatrix4(s);
|
|
2655
2651
|
let u;
|
|
2656
2652
|
if (n)
|
|
2657
2653
|
u = Re * 0.5;
|
|
2658
2654
|
else {
|
|
2659
|
-
const d = Math.max(a.near,
|
|
2660
|
-
u =
|
|
2655
|
+
const d = Math.max(a.near, bt.distanceToPoint(ge.origin));
|
|
2656
|
+
u = Zi(a, d, c.resolution);
|
|
2661
2657
|
}
|
|
2662
|
-
if (
|
|
2658
|
+
if (bt.radius += u, ge.intersectsSphere(bt) === !1)
|
|
2663
2659
|
return;
|
|
2664
|
-
r.boundingBox === null && r.computeBoundingBox(),
|
|
2660
|
+
r.boundingBox === null && r.computeBoundingBox(), vt.copy(r.boundingBox).applyMatrix4(s);
|
|
2665
2661
|
let l;
|
|
2666
2662
|
if (n)
|
|
2667
2663
|
l = Re * 0.5;
|
|
2668
2664
|
else {
|
|
2669
|
-
const d = Math.max(a.near,
|
|
2670
|
-
l =
|
|
2665
|
+
const d = Math.max(a.near, vt.distanceToPoint(ge.origin));
|
|
2666
|
+
l = Zi(a, d, c.resolution);
|
|
2671
2667
|
}
|
|
2672
|
-
|
|
2668
|
+
vt.expandByScalar(l), ge.intersectsBox(vt) !== !1 && (n ? hr(this, t) : pr(this, a, t));
|
|
2673
2669
|
}
|
|
2674
2670
|
onBeforeRender(e) {
|
|
2675
2671
|
const t = this.material.uniforms;
|
|
@@ -2703,12 +2699,12 @@ class pt extends na {
|
|
|
2703
2699
|
return this.setPositions(t.attributes.position.array), this;
|
|
2704
2700
|
}
|
|
2705
2701
|
}
|
|
2706
|
-
class
|
|
2707
|
-
constructor(e = new pt(), t = new
|
|
2702
|
+
class Fe extends fr {
|
|
2703
|
+
constructor(e = new pt(), t = new Xe({ color: Math.random() * 16777215 })) {
|
|
2708
2704
|
super(e, t), this.isLine2 = !0, this.type = "Line2";
|
|
2709
2705
|
}
|
|
2710
2706
|
}
|
|
2711
|
-
const
|
|
2707
|
+
const ji = new C(), gr = new It(), qi = new C();
|
|
2712
2708
|
class mr extends Dn {
|
|
2713
2709
|
constructor(e = document.createElement("div")) {
|
|
2714
2710
|
super(), this.isCSS3DObject = !0, this.element = e, this.element.style.position = "absolute", this.element.style.pointerEvents = "auto", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.addEventListener("removed", function() {
|
|
@@ -2729,8 +2725,8 @@ class ie extends mr {
|
|
|
2729
2725
|
return super.copy(e, t), this.rotation2D = e.rotation2D, this;
|
|
2730
2726
|
}
|
|
2731
2727
|
}
|
|
2732
|
-
const he = new
|
|
2733
|
-
class
|
|
2728
|
+
const he = new Ke(), yr = new Ke();
|
|
2729
|
+
class Ar {
|
|
2734
2730
|
constructor(e = {}) {
|
|
2735
2731
|
const t = this;
|
|
2736
2732
|
let n, a, o, s;
|
|
@@ -2748,12 +2744,12 @@ class yr {
|
|
|
2748
2744
|
height: a
|
|
2749
2745
|
};
|
|
2750
2746
|
}, this.render = function(g, m) {
|
|
2751
|
-
const
|
|
2747
|
+
const x = m.projectionMatrix.elements[5] * s;
|
|
2752
2748
|
m.view && m.view.enabled ? (u.style.transform = `translate( ${-m.view.offsetX * (n / m.view.width)}px, ${-m.view.offsetY * (a / m.view.height)}px )`, u.style.transform += `scale( ${m.view.fullWidth / m.view.width}, ${m.view.fullHeight / m.view.height} )`) : u.style.transform = "", g.matrixWorldAutoUpdate === !0 && g.updateMatrixWorld(), m.parent === null && m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld();
|
|
2753
|
-
let
|
|
2754
|
-
m.isOrthographicCamera && (
|
|
2755
|
-
const T = m.view && m.view.enabled ? m.view.height / m.view.fullHeight : 1, w = m.isOrthographicCamera ? `scale( ${T} )scale(` +
|
|
2756
|
-
r.camera.style !==
|
|
2749
|
+
let b, S;
|
|
2750
|
+
m.isOrthographicCamera && (b = -(m.right + m.left) / 2, S = (m.top + m.bottom) / 2);
|
|
2751
|
+
const T = m.view && m.view.enabled ? m.view.height / m.view.fullHeight : 1, w = m.isOrthographicCamera ? `scale( ${T} )scale(` + x + ")translate(" + d(b) + "px," + d(S) + "px)" + h(m.matrixWorldInverse) : `scale( ${T} )translateZ(` + x + "px)" + h(m.matrixWorldInverse), v = (m.isPerspectiveCamera ? "perspective(" + x + "px) " : "") + w + "translate(" + o + "px," + s + "px)";
|
|
2752
|
+
r.camera.style !== v && (l.style.transform = v, r.camera.style = v), y(g, g, m);
|
|
2757
2753
|
}, this.setSize = function(g, m) {
|
|
2758
2754
|
n = g, a = m, o = n / 2, s = a / 2, c.style.width = g + "px", c.style.height = m + "px", u.style.width = g + "px", u.style.height = m + "px", l.style.width = g + "px", l.style.height = m + "px";
|
|
2759
2755
|
};
|
|
@@ -2770,35 +2766,35 @@ class yr {
|
|
|
2770
2766
|
}
|
|
2771
2767
|
function p(g) {
|
|
2772
2768
|
g.isCSS3DObject && (g.element.style.display = "none");
|
|
2773
|
-
for (let m = 0,
|
|
2769
|
+
for (let m = 0, x = g.children.length; m < x; m++)
|
|
2774
2770
|
p(g.children[m]);
|
|
2775
2771
|
}
|
|
2776
|
-
function
|
|
2772
|
+
function y(g, m, x, b) {
|
|
2777
2773
|
if (g.visible === !1) {
|
|
2778
2774
|
p(g);
|
|
2779
2775
|
return;
|
|
2780
2776
|
}
|
|
2781
2777
|
if (g.isCSS3DObject) {
|
|
2782
|
-
const
|
|
2783
|
-
if (T.style.display =
|
|
2784
|
-
g.onBeforeRender(t, m,
|
|
2778
|
+
const S = g.layers.test(x.layers) === !0, T = g.element;
|
|
2779
|
+
if (T.style.display = S === !0 ? "" : "none", S === !0) {
|
|
2780
|
+
g.onBeforeRender(t, m, x);
|
|
2785
2781
|
let w;
|
|
2786
|
-
g.isCSS3DSprite ? (he.copy(
|
|
2782
|
+
g.isCSS3DSprite ? (he.copy(x.matrixWorldInverse), he.transpose(), g.rotation2D !== 0 && he.multiply(yr.makeRotationZ(g.rotation2D)), g.matrixWorld.decompose(ji, gr, qi), he.setPosition(ji), he.scale(qi), he.elements[3] = 0, he.elements[7] = 0, he.elements[11] = 0, he.elements[15] = 1, w = f(he)) : w = f(g.matrixWorld);
|
|
2787
2783
|
const I = r.objects.get(g);
|
|
2788
2784
|
if (I === void 0 || I.style !== w) {
|
|
2789
2785
|
T.style.transform = w;
|
|
2790
|
-
const
|
|
2791
|
-
r.objects.set(g,
|
|
2786
|
+
const v = { style: w };
|
|
2787
|
+
r.objects.set(g, v);
|
|
2792
2788
|
}
|
|
2793
|
-
T.parentNode !== l && l.appendChild(T), g.onAfterRender(t, m,
|
|
2789
|
+
T.parentNode !== l && l.appendChild(T), g.onAfterRender(t, m, x);
|
|
2794
2790
|
}
|
|
2795
2791
|
}
|
|
2796
|
-
for (let
|
|
2797
|
-
|
|
2792
|
+
for (let S = 0, T = g.children.length; S < T; S++)
|
|
2793
|
+
y(g.children[S], m, x);
|
|
2798
2794
|
}
|
|
2799
2795
|
}
|
|
2800
2796
|
}
|
|
2801
|
-
class Mn extends
|
|
2797
|
+
class Mn extends Fe {
|
|
2802
2798
|
constructor(e) {
|
|
2803
2799
|
super(), this.isMark = !0, this.disposed = !1, this.events = e;
|
|
2804
2800
|
}
|
|
@@ -2826,9 +2822,9 @@ class Mn extends Be {
|
|
|
2826
2822
|
title: "标记距离" + a
|
|
2827
2823
|
}, s = new pt();
|
|
2828
2824
|
s.setPositions([...o.startPoint, ...o.endPoint]);
|
|
2829
|
-
const r = new
|
|
2830
|
-
r.resolution.set(innerWidth, innerHeight), n.copy(new
|
|
2831
|
-
const c = new De(0.05, 32), u = new
|
|
2825
|
+
const r = new Xe({ color: o.lineColor, linewidth: o.lineWidth });
|
|
2826
|
+
r.resolution.set(innerWidth, innerHeight), n.copy(new Fe(s, r));
|
|
2827
|
+
const c = new De(0.05, 32), u = new xe({ color: 16777215, side: we });
|
|
2832
2828
|
u.transparent = !0, u.opacity = 0.6;
|
|
2833
2829
|
const l = new te(c, u);
|
|
2834
2830
|
l.position.copy(e), l.isMark = !0;
|
|
@@ -2841,14 +2837,14 @@ class Mn extends Be {
|
|
|
2841
2837
|
if (n.events.fire(_).markMode)
|
|
2842
2838
|
return;
|
|
2843
2839
|
const g = parent?.onActiveMark;
|
|
2844
|
-
g?.(n.getMarkData(!0)), n.events.fire(
|
|
2840
|
+
g?.(n.getMarkData(!0)), n.events.fire(q);
|
|
2845
2841
|
}, h.oncontextmenu = (g) => g.preventDefault();
|
|
2846
2842
|
const f = new ie(h);
|
|
2847
2843
|
f.position.copy(e), f.element.style.pointerEvents = "none", f.scale.set(0.01, 0.01, 0.01), f.visible = o.mainTagVisible;
|
|
2848
2844
|
const p = document.createElement("div");
|
|
2849
2845
|
p.innerHTML = `<span class="${t}-distance-tag ${t}-distance-tag0" style="color:${o.distanceTagColor};background:${o.distanceTagBackground};opacity:${o.distanceTagOpacity};padding: 1px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: none;"></span>`, p.classList.add("mark-wrap-line", `${t}`, "distance-warp"), p.style.position = "absolute", p.style.borderRadius = "4px", p.style.pointerEvents = "none";
|
|
2850
|
-
const
|
|
2851
|
-
|
|
2846
|
+
const y = new ie(p);
|
|
2847
|
+
y.position.set(e.x, e.y, e.z), y.element.style.pointerEvents = "none", y.scale.set(8e-3, 8e-3, 8e-3), y.visible = !1, n.add(l, d, f, y), n.data = o, n.circleStart = l, n.circleEnd = d, n.css3dTag = y, n.css3dMainTag = f, n.events.fire(Me, n);
|
|
2852
2848
|
}
|
|
2853
2849
|
/**
|
|
2854
2850
|
* 绘制更新
|
|
@@ -2922,9 +2918,9 @@ class Mn extends Be {
|
|
|
2922
2918
|
title: e.title || "标记距离"
|
|
2923
2919
|
}, a = new C().fromArray(n.startPoint), o = new C().fromArray(n.endPoint), s = new C((a.x + o.x) / 2, (a.y + o.y) / 2, (a.z + o.z) / 2), r = new pt();
|
|
2924
2920
|
r.setPositions([...n.startPoint, ...n.endPoint]);
|
|
2925
|
-
const c = new
|
|
2926
|
-
c.resolution.set(innerWidth, innerHeight), t.copy(new
|
|
2927
|
-
const u = new De(0.05, 32), l = new
|
|
2921
|
+
const c = new Xe({ color: n.lineColor, linewidth: n.lineWidth });
|
|
2922
|
+
c.resolution.set(innerWidth, innerHeight), t.copy(new Fe(r, c));
|
|
2923
|
+
const u = new De(0.05, 32), l = new xe({ color: 16777215, side: we });
|
|
2928
2924
|
l.transparent = !0, l.opacity = 0.6;
|
|
2929
2925
|
const d = new te(u, l);
|
|
2930
2926
|
d.position.copy(a), d.isMark = !0;
|
|
@@ -2932,21 +2928,21 @@ class Mn extends Be {
|
|
|
2932
2928
|
h.position.copy(o), h.isMark = !0;
|
|
2933
2929
|
const f = o.clone().sub(a).normalize();
|
|
2934
2930
|
d.lookAt(d.position.clone().add(f)), h.lookAt(h.position.clone().add(f));
|
|
2935
|
-
const p = n.name,
|
|
2936
|
-
|
|
2931
|
+
const p = n.name, y = document.createElement("div");
|
|
2932
|
+
y.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
|
|
2937
2933
|
<span class="${p}-main-tag" style="color:${n.mainTagColor};background:${n.mainTagBackground};opacity:${n.mainTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: auto;">${n.title}</span>
|
|
2938
|
-
</div>`,
|
|
2934
|
+
</div>`, y.classList.add("mark-wrap-line", `${n.name}`, "main-warp"), y.style.position = "absolute", y.style.borderRadius = "4px", y.style.cursor = "pointer", y.onclick = () => {
|
|
2939
2935
|
if (t.events.fire(_).markMode)
|
|
2940
2936
|
return;
|
|
2941
2937
|
const T = parent?.onActiveMark;
|
|
2942
|
-
T?.(t.getMarkData(!0)), t.events.fire(
|
|
2943
|
-
},
|
|
2944
|
-
const g = new ie(
|
|
2938
|
+
T?.(t.getMarkData(!0)), t.events.fire(q);
|
|
2939
|
+
}, y.oncontextmenu = (T) => T.preventDefault();
|
|
2940
|
+
const g = new ie(y);
|
|
2945
2941
|
g.position.copy(a), g.element.style.pointerEvents = "none", g.scale.set(0.01, 0.01, 0.01), g.visible = n.mainTagVisible;
|
|
2946
|
-
const
|
|
2947
|
-
|
|
2948
|
-
const
|
|
2949
|
-
|
|
2942
|
+
const x = (a.distanceTo(o) * t.events.fire(_).meterScale).toFixed(2) + " m", b = document.createElement("div");
|
|
2943
|
+
b.innerHTML = `<span class="${p}-distance-tag ${p}-distance-tag0" style="color:${n.distanceTagColor};background:${n.distanceTagBackground};opacity:${n.distanceTagOpacity};padding: 1px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: none;">${x}</span>`, b.classList.add("mark-wrap-line", `${p}`, "distance-warp"), b.style.position = "absolute", b.style.borderRadius = "4px", b.style.pointerEvents = "none";
|
|
2944
|
+
const S = new ie(b);
|
|
2945
|
+
S.position.copy(s), S.element.style.pointerEvents = "none", S.scale.set(8e-3, 8e-3, 8e-3), S.visible = n.distanceTagVisible, t.add(d, h, g, S), t.data = n, t.circleStart = d, t.circleEnd = h, t.css3dTag = S, t.css3dMainTag = g, t.events.fire(Me, t);
|
|
2950
2946
|
}
|
|
2951
2947
|
getMarkData(e = !1) {
|
|
2952
2948
|
const t = { ...this.data };
|
|
@@ -2956,12 +2952,12 @@ class Mn extends Be {
|
|
|
2956
2952
|
if (this.disposed)
|
|
2957
2953
|
return;
|
|
2958
2954
|
const e = this;
|
|
2959
|
-
e.disposed = !0, e.events.fire(ke, e), e.events.fire(
|
|
2955
|
+
e.disposed = !0, e.events.fire(ke, e), e.events.fire(B).remove(e), e.events.fire(Ze, e), document.querySelectorAll(`.${e.data.name}`).forEach((n) => n.parentElement?.removeChild(n)), e.events = null, e.data = null, e.circleStart = null, e.circleEnd = null, e.css3dTag = null, e.css3dMainTag = null;
|
|
2960
2956
|
}
|
|
2961
2957
|
}
|
|
2962
|
-
class Tn extends
|
|
2958
|
+
class Tn extends Fe {
|
|
2963
2959
|
constructor(e) {
|
|
2964
|
-
super(), this.isMark = !0, this.disposed = !1, this.css3dTags = [], this.group = new
|
|
2960
|
+
super(), this.isMark = !0, this.disposed = !1, this.css3dTags = [], this.group = new Ht(), this.add(this.group), this.events = e;
|
|
2965
2961
|
}
|
|
2966
2962
|
/**
|
|
2967
2963
|
* 绘制开始
|
|
@@ -3064,8 +3060,8 @@ class Tn extends Be {
|
|
|
3064
3060
|
note: e.note || ""
|
|
3065
3061
|
}, o = n.geometry, s = n.material, r = new pt();
|
|
3066
3062
|
r.setPositions([...a.points]);
|
|
3067
|
-
const c = new
|
|
3068
|
-
c.resolution.set(innerWidth, innerHeight), n.copy(new
|
|
3063
|
+
const c = new Xe({ color: a.lineColor, linewidth: a.lineWidth });
|
|
3064
|
+
c.resolution.set(innerWidth, innerHeight), n.copy(new Fe(r, c)), o?.dispose(), s?.dispose();
|
|
3069
3065
|
const u = a.name, l = a.points.length / 3 - 1;
|
|
3070
3066
|
if (!n.css3dMainTag) {
|
|
3071
3067
|
const d = document.createElement("div");
|
|
@@ -3075,7 +3071,7 @@ class Tn extends Be {
|
|
|
3075
3071
|
if (n.events.fire(_).markMode)
|
|
3076
3072
|
return;
|
|
3077
3073
|
const f = parent?.onActiveMark, p = n.getMarkData(!0);
|
|
3078
|
-
p.meterScale = n.events.fire(_).meterScale, f?.(p), n.events.fire(
|
|
3074
|
+
p.meterScale = n.events.fire(_).meterScale, f?.(p), n.events.fire(q);
|
|
3079
3075
|
}, d.oncontextmenu = (f) => f.preventDefault();
|
|
3080
3076
|
const h = new ie(d);
|
|
3081
3077
|
h.position.set(a.points[0], a.points[1], a.points[2]), h.element.style.pointerEvents = "none", h.scale.set(0.01, 0.01, 0.01), h.visible = a.mainTagVisible, n.group.add(h), n.css3dMainTag = h;
|
|
@@ -3083,8 +3079,8 @@ class Tn extends Be {
|
|
|
3083
3079
|
for (let d = n.css3dTags.length; d < l; d++) {
|
|
3084
3080
|
const h = new C().fromArray(a.points.slice(d * 3, d * 3 + 3)), f = new C().fromArray(a.points.slice(d * 3 + 3, d * 3 + 6)), p = new C((h.x + f.x) / 2, (h.y + f.y) / 2, (h.z + f.z) / 2), g = (h.distanceTo(f) * n.events.fire(_).meterScale).toFixed(2) + " m", m = document.createElement("div");
|
|
3085
3081
|
m.innerHTML = `<span class="${u}-distance-tag ${u}-distance-tag${d}" style="color:${a.distanceTagColor};background:${a.distanceTagBackground};opacity:${a.distanceTagOpacity};padding: 1px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: none;">${g}</span>`, m.classList.add("mark-wrap-lines", `${u}`, "distance-warp"), m.style.position = "absolute", m.style.borderRadius = "4px", m.style.display = "none";
|
|
3086
|
-
const
|
|
3087
|
-
|
|
3082
|
+
const x = new ie(m);
|
|
3083
|
+
x.position.copy(p), x.element.style.pointerEvents = "none", x.scale.set(8e-3, 8e-3, 8e-3), x.visible = a.distanceTagVisible, n.css3dTags.push(x), n.group.add(x);
|
|
3088
3084
|
}
|
|
3089
3085
|
t || (n.css3dTags[n.css3dTags.length - 1].visible = !1), n.data = a, n.events.fire(Me, n);
|
|
3090
3086
|
}
|
|
@@ -3096,10 +3092,10 @@ class Tn extends Be {
|
|
|
3096
3092
|
if (this.disposed)
|
|
3097
3093
|
return;
|
|
3098
3094
|
const e = this;
|
|
3099
|
-
e.disposed = !0, e.events.fire(ke, e), e.events.fire(
|
|
3095
|
+
e.disposed = !0, e.events.fire(ke, e), e.events.fire(B).remove(e), e.events.fire(Ze, e), e.geometry.dispose(), e.material.dispose(), document.querySelectorAll(`.${e.data.name}`).forEach((n) => n.parentElement?.removeChild(n)), e.events = null, e.data = null, e.css3dTags = null, e.group = null;
|
|
3100
3096
|
}
|
|
3101
3097
|
}
|
|
3102
|
-
class ia extends
|
|
3098
|
+
class ia extends Ht {
|
|
3103
3099
|
constructor(e, t, n) {
|
|
3104
3100
|
super(), this.isMark = !0, this.disposed = !1, this.events = e;
|
|
3105
3101
|
const a = this;
|
|
@@ -3141,7 +3137,7 @@ class ia extends Qt {
|
|
|
3141
3137
|
if (a.events.fire(_).markMode)
|
|
3142
3138
|
return;
|
|
3143
3139
|
const c = parent?.onActiveMark;
|
|
3144
|
-
c?.(a.getMarkData(!0)), a.events.fire(
|
|
3140
|
+
c?.(a.getMarkData(!0)), a.events.fire(q);
|
|
3145
3141
|
}, s.oncontextmenu = (c) => c.preventDefault();
|
|
3146
3142
|
const r = new ie(s);
|
|
3147
3143
|
r.position.set(o.point[0], o.point[1], o.point[2]), r.element.style.pointerEvents = "none", r.scale.set(0.01, 0.01, 0.01), a.data = o, a.css3dTag = r, a.add(r), e.fire(Me, a);
|
|
@@ -3192,14 +3188,14 @@ class ia extends Qt {
|
|
|
3192
3188
|
if (this.disposed)
|
|
3193
3189
|
return;
|
|
3194
3190
|
const e = this;
|
|
3195
|
-
e.disposed = !0, e.events.fire(ke, e), e.events.fire(
|
|
3191
|
+
e.disposed = !0, e.events.fire(ke, e), e.events.fire(B).remove(e), e.events.fire(Ze, e);
|
|
3196
3192
|
const t = document.querySelector(`.mark-wrap-${e.data.name}`);
|
|
3197
3193
|
t?.parentElement?.removeChild?.(t), e.events = null, e.data = null, e.css3dTag = null;
|
|
3198
3194
|
}
|
|
3199
3195
|
}
|
|
3200
|
-
class kn extends
|
|
3196
|
+
class kn extends Fe {
|
|
3201
3197
|
constructor(e) {
|
|
3202
|
-
super(), this.isMark = !0, this.disposed = !1, this.css3dTags = [], this.group = new
|
|
3198
|
+
super(), this.isMark = !0, this.disposed = !1, this.css3dTags = [], this.group = new Ht(), this.add(this.group), this.events = e;
|
|
3203
3199
|
}
|
|
3204
3200
|
/**
|
|
3205
3201
|
* 绘制开始
|
|
@@ -3243,7 +3239,7 @@ class kn extends Be {
|
|
|
3243
3239
|
const s = o.data.points.length;
|
|
3244
3240
|
o.data.points[s - 3] = n.x, o.data.points[s - 2] = n.y, o.data.points[s - 1] = n.z;
|
|
3245
3241
|
const r = o.css3dTags.length - 1, c = new C().fromArray(o.data.points.slice(s - 6, s - 3)), u = new C().fromArray(o.data.points.slice(s - 3)), l = new C((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), d = c.distanceTo(u), h = (d * o.events.fire(_).meterScale).toFixed(2) + " m";
|
|
3246
|
-
o.css3dTags[r].element.innerText = h, o.geometry.setPositions([...o.data.points]), o.css3dTags[r].position.set(l.x, l.y, l.z), o.css3dTags[r].visible = a ? !0 : d > 0.5, o.meshPlans.geometry.setAttribute("position", new
|
|
3242
|
+
o.css3dTags[r].element.innerText = h, o.geometry.setPositions([...o.data.points]), o.css3dTags[r].position.set(l.x, l.y, l.z), o.css3dTags[r].visible = a ? !0 : d > 0.5, o.meshPlans.geometry.setAttribute("position", new He(new Float32Array(o.data.points), 3)), o.meshPlans.geometry.attributes.position.needsUpdate = !0;
|
|
3247
3243
|
const f = o.events.fire(dn, o.data.points);
|
|
3248
3244
|
o.css3dAreaTag.position.copy(f);
|
|
3249
3245
|
const p = o.events.fire(un, o.data.points);
|
|
@@ -3326,8 +3322,8 @@ class kn extends Be {
|
|
|
3326
3322
|
note: e.note || ""
|
|
3327
3323
|
}, o = n.geometry, s = n.material, r = new pt();
|
|
3328
3324
|
r.setPositions([...a.points]);
|
|
3329
|
-
const c = new
|
|
3330
|
-
c.resolution.set(innerWidth, innerHeight), n.copy(new
|
|
3325
|
+
const c = new Xe({ color: a.lineColor, linewidth: a.lineWidth });
|
|
3326
|
+
c.resolution.set(innerWidth, innerHeight), n.copy(new Fe(r, c)), o?.dispose(), s?.dispose();
|
|
3331
3327
|
const u = a.name, l = a.points.length / 3 - 1;
|
|
3332
3328
|
if (!n.css3dMainTag) {
|
|
3333
3329
|
const f = document.createElement("div");
|
|
@@ -3336,9 +3332,9 @@ class kn extends Be {
|
|
|
3336
3332
|
</div>`, f.classList.add("mark-wrap-plans", `${a.name}`, "main-warp"), f.style.position = "absolute", f.style.borderRadius = "4px", f.style.cursor = "pointer", f.onclick = () => {
|
|
3337
3333
|
if (n.events.fire(_).markMode)
|
|
3338
3334
|
return;
|
|
3339
|
-
const
|
|
3340
|
-
g.meterScale = n.events.fire(_).meterScale,
|
|
3341
|
-
}, f.oncontextmenu = (
|
|
3335
|
+
const y = parent?.onActiveMark, g = n.getMarkData(!0);
|
|
3336
|
+
g.meterScale = n.events.fire(_).meterScale, y?.(g), n.events.fire(q);
|
|
3337
|
+
}, f.oncontextmenu = (y) => y.preventDefault();
|
|
3342
3338
|
const p = new ie(f);
|
|
3343
3339
|
p.position.set(a.points[0], a.points[1], a.points[2]), p.element.style.pointerEvents = "none", p.scale.set(0.01, 0.01, 0.01), p.visible = a.mainTagVisible, n.group.add(p), n.css3dMainTag = p;
|
|
3344
3340
|
}
|
|
@@ -3353,21 +3349,21 @@ class kn extends Be {
|
|
|
3353
3349
|
}
|
|
3354
3350
|
n.css3dAreaTag.visible = a.points.length > 6 && a.areaTagVisible;
|
|
3355
3351
|
for (let f = n.css3dTags.length; f < l; f++) {
|
|
3356
|
-
const p = new C().fromArray(a.points.slice(f * 3, f * 3 + 3)),
|
|
3357
|
-
|
|
3358
|
-
const
|
|
3359
|
-
|
|
3352
|
+
const p = new C().fromArray(a.points.slice(f * 3, f * 3 + 3)), y = new C().fromArray(a.points.slice(f * 3 + 3, f * 3 + 6)), g = new C((p.x + y.x) / 2, (p.y + y.y) / 2, (p.z + y.z) / 2), x = (p.distanceTo(y) * n.events.fire(_).meterScale).toFixed(2) + " m", b = document.createElement("div");
|
|
3353
|
+
b.innerText = x, b.style.color = "white", b.classList.add("mark-wrap-plans", `${u}`, "distance-warp"), b.style.position = "absolute", b.style.borderRadius = "4px", b.style.display = "none";
|
|
3354
|
+
const S = new ie(b);
|
|
3355
|
+
S.position.copy(g), S.element.style.pointerEvents = "none", S.scale.set(8e-3, 8e-3, 8e-3), S.visible = a.distanceTagVisible, n.css3dTags.push(S), n.group.add(S);
|
|
3360
3356
|
}
|
|
3361
3357
|
n.drawPlans(a), t || (n.css3dTags[n.css3dTags.length - 1].visible = !1), n.data = a, n.events.fire(Me, n);
|
|
3362
3358
|
}
|
|
3363
3359
|
drawPlans(e) {
|
|
3364
3360
|
const t = this;
|
|
3365
3361
|
if (!t.meshPlans) {
|
|
3366
|
-
const n = new
|
|
3367
|
-
n.setAttribute("position", new
|
|
3368
|
-
const a = new
|
|
3362
|
+
const n = new ya();
|
|
3363
|
+
n.setAttribute("position", new He(new Float32Array(), 3)), n.attributes.position.needsUpdate = !0;
|
|
3364
|
+
const a = new He(new Uint16Array([]), 1);
|
|
3369
3365
|
n.setIndex(a);
|
|
3370
|
-
const o = new
|
|
3366
|
+
const o = new xe({
|
|
3371
3367
|
color: e.lineColor,
|
|
3372
3368
|
transparent: !0,
|
|
3373
3369
|
opacity: e.planOpacity,
|
|
@@ -3376,14 +3372,14 @@ class kn extends Be {
|
|
|
3376
3372
|
t.meshPlans = new te(n, o), t.meshPlans.renderOrder = 1, t.meshPlans.isMark = !0, t.group.add(t.meshPlans);
|
|
3377
3373
|
}
|
|
3378
3374
|
if (e.points.length > 6) {
|
|
3379
|
-
t.meshPlans.geometry.setAttribute("position", new
|
|
3375
|
+
t.meshPlans.geometry.setAttribute("position", new He(new Float32Array(e.points), 3)), t.meshPlans.geometry.attributes.position.needsUpdate = !0;
|
|
3380
3376
|
let n = e.points.length / 3 - 2;
|
|
3381
3377
|
const a = new C().fromArray(e.points.slice(0, 3)), o = new C().fromArray(e.points.slice(-3));
|
|
3382
3378
|
a.distanceTo(o) < 1e-4 && n--;
|
|
3383
3379
|
const s = new Uint16Array(n * 3);
|
|
3384
3380
|
for (let r = 0; r < n; r++)
|
|
3385
3381
|
s[r * 3] = 0, s[r * 3 + 1] = r + 1, s[r * 3 + 2] = r + 2;
|
|
3386
|
-
t.meshPlans.geometry.setIndex(new
|
|
3382
|
+
t.meshPlans.geometry.setIndex(new He(s, 1));
|
|
3387
3383
|
}
|
|
3388
3384
|
}
|
|
3389
3385
|
getMarkData(e = !1) {
|
|
@@ -3394,10 +3390,10 @@ class kn extends Be {
|
|
|
3394
3390
|
if (this.disposed)
|
|
3395
3391
|
return;
|
|
3396
3392
|
const e = this;
|
|
3397
|
-
e.disposed = !0, e.events.fire(ke, e), e.events.fire(
|
|
3393
|
+
e.disposed = !0, e.events.fire(ke, e), e.events.fire(B).remove(e), e.events.fire(Ze, e), e.geometry.dispose(), e.material.dispose(), document.querySelectorAll(`.${e.data.name}`).forEach((n) => n.parentElement?.removeChild(n)), e.events = null, e.data = null, e.css3dTags = null, e.group = null, e.meshPlans = null, e.css3dMainTag = null, e.css3dAreaTag = null;
|
|
3398
3394
|
}
|
|
3399
3395
|
}
|
|
3400
|
-
class sa extends
|
|
3396
|
+
class sa extends Ht {
|
|
3401
3397
|
constructor(e) {
|
|
3402
3398
|
super(), this.isMark = !0, this.disposed = !1, this.events = e;
|
|
3403
3399
|
}
|
|
@@ -3423,7 +3419,7 @@ class sa extends Qt {
|
|
|
3423
3419
|
circleTagOpacity: 0.9,
|
|
3424
3420
|
circleTagVisible: !0,
|
|
3425
3421
|
title: "标记圆面" + a
|
|
3426
|
-
}, s = new De(o.radius, 32), r = new
|
|
3422
|
+
}, s = new De(o.radius, 32), r = new xe({ color: o.circleColor, side: we, transparent: !0 });
|
|
3427
3423
|
r.opacity = o.circleOpacity;
|
|
3428
3424
|
const c = new te(s, r);
|
|
3429
3425
|
c.position.copy(e), c.isMark = !0, c.renderOrder = 1;
|
|
@@ -3436,7 +3432,7 @@ class sa extends Qt {
|
|
|
3436
3432
|
if (n.events.fire(_).markMode)
|
|
3437
3433
|
return;
|
|
3438
3434
|
const p = parent?.onActiveMark;
|
|
3439
|
-
p?.(n.getMarkData(!0)), n.events.fire(
|
|
3435
|
+
p?.(n.getMarkData(!0)), n.events.fire(q);
|
|
3440
3436
|
}, l.oncontextmenu = (p) => p.preventDefault();
|
|
3441
3437
|
const d = new ie(l);
|
|
3442
3438
|
d.position.copy(e), d.element.style.pointerEvents = "none", d.scale.set(0.01, 0.01, 0.01), d.visible = o.mainTagVisible;
|
|
@@ -3508,7 +3504,7 @@ class sa extends Qt {
|
|
|
3508
3504
|
circleTagOpacity: e.circleTagOpacity || 0.9,
|
|
3509
3505
|
circleTagVisible: e.circleTagVisible === void 0 ? !0 : e.circleTagVisible,
|
|
3510
3506
|
title: e.title || "标记圆面"
|
|
3511
|
-
}, a = new De(n.radius, 128), o = new
|
|
3507
|
+
}, a = new De(n.radius, 128), o = new xe({ color: n.circleColor, side: we, transparent: !0 });
|
|
3512
3508
|
o.opacity = n.circleOpacity;
|
|
3513
3509
|
const s = new te(a, o);
|
|
3514
3510
|
s.position.fromArray(n.startPoint), s.isMark = !0, s.renderOrder = 1;
|
|
@@ -3521,14 +3517,14 @@ class sa extends Qt {
|
|
|
3521
3517
|
if (t.events.fire(_).markMode)
|
|
3522
3518
|
return;
|
|
3523
3519
|
const g = parent?.onActiveMark;
|
|
3524
|
-
g?.(t.getMarkData(!0)), t.events.fire(
|
|
3520
|
+
g?.(t.getMarkData(!0)), t.events.fire(q);
|
|
3525
3521
|
}, u.oncontextmenu = (g) => g.preventDefault();
|
|
3526
3522
|
const l = new C().fromArray(n.startPoint), d = n.radius * t.events.fire(_).meterScale, h = (Math.PI * d * d).toFixed(2) + " m²", f = new ie(u);
|
|
3527
3523
|
f.position.copy(l), f.element.style.pointerEvents = "none", f.scale.set(0.01, 0.01, 0.01), f.visible = n.mainTagVisible;
|
|
3528
3524
|
const p = document.createElement("div");
|
|
3529
3525
|
p.innerHTML = `<span class="${c}-distance-tag ${c}-circle-tag" style="color:${n.circleTagColor};background:${n.circleTagBackground};opacity:${n.circleTagOpacity};padding: 1px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: none;">${h}</span>`, p.classList.add("mark-wrap-circle", `${c}`, "circle-warp"), p.style.position = "absolute", p.style.borderRadius = "4px", p.style.pointerEvents = "none";
|
|
3530
|
-
const
|
|
3531
|
-
|
|
3526
|
+
const y = new ie(p);
|
|
3527
|
+
y.position.set(l.x + Math.min(n.radius / 2, 0.5), l.y, l.z), y.element.style.pointerEvents = "none", y.scale.set(8e-3, 8e-3, 8e-3), y.visible = n.circleTagVisible, t.add(s, f, y), t.data = n, t.circleMesh = s, t.css3dTag = y, t.css3dMainTag = f, t.events.fire(Me, t);
|
|
3532
3528
|
}
|
|
3533
3529
|
getMarkData(e = !1) {
|
|
3534
3530
|
const t = { ...this.data };
|
|
@@ -3538,7 +3534,7 @@ class sa extends Qt {
|
|
|
3538
3534
|
if (this.disposed)
|
|
3539
3535
|
return;
|
|
3540
3536
|
const e = this;
|
|
3541
|
-
e.disposed = !0, e.events.fire(ke, e), e.events.fire(
|
|
3537
|
+
e.disposed = !0, e.events.fire(ke, e), e.events.fire(B).remove(e), e.events.fire(Ze, e), document.querySelectorAll(`.${e.data.name}`).forEach((n) => n.parentElement?.removeChild(n)), e.events = null, e.data = null, e.circleMesh = null, e.css3dTag = null, e.css3dMainTag = null;
|
|
3542
3538
|
}
|
|
3543
3539
|
}
|
|
3544
3540
|
let wr = class {
|
|
@@ -3546,247 +3542,247 @@ let wr = class {
|
|
|
3546
3542
|
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;
|
|
3547
3543
|
}
|
|
3548
3544
|
};
|
|
3549
|
-
function
|
|
3550
|
-
const e = (
|
|
3545
|
+
function Sr(i) {
|
|
3546
|
+
const e = (v, D, k) => i.on(v, D, k), t = (v, ...D) => i.fire(v, ...D), n = t($e);
|
|
3551
3547
|
let a = /* @__PURE__ */ new Set(), o, s = new wr(), r;
|
|
3552
3548
|
e(oi, () => {
|
|
3553
|
-
t(
|
|
3554
|
-
}), e(
|
|
3555
|
-
t(
|
|
3556
|
-
}), e(
|
|
3549
|
+
t(Y).autoRotate = t(_).autoRotate = !0;
|
|
3550
|
+
}), e(q, (v = !0) => {
|
|
3551
|
+
t(Y).autoRotate = t(_).autoRotate = !1, v && t(Qt);
|
|
3552
|
+
}), e(Zt, (v = !0) => {
|
|
3557
3553
|
if (o)
|
|
3558
3554
|
return;
|
|
3559
|
-
const D = t(
|
|
3555
|
+
const D = t(Y), k = v ? Math.PI / 128 : -(Math.PI / 128), M = new Ke().makeRotationAxis(new C(0, 0, -1).transformDirection(D.object.matrixWorld), k);
|
|
3560
3556
|
D.object.up.transformDirection(M), t(J);
|
|
3561
|
-
}), e(Ai, () => {
|
|
3562
|
-
o || i.fire(Xt, !0);
|
|
3563
3557
|
}), e(yi, () => {
|
|
3564
|
-
o || i.fire(
|
|
3565
|
-
}), e(
|
|
3558
|
+
o || i.fire(Zt, !0);
|
|
3559
|
+
}), e(Ai, () => {
|
|
3560
|
+
o || i.fire(Zt, !1);
|
|
3561
|
+
}), e(Ut, (v) => {
|
|
3566
3562
|
const D = t(_);
|
|
3567
|
-
|
|
3563
|
+
v ?? (v = !D.pointcloudMode), D.pointcloudMode = v, t(B).traverse((M) => M instanceof pe && M.fire(nt, v));
|
|
3568
3564
|
}), e(Ot, () => {
|
|
3569
|
-
t(
|
|
3570
|
-
}), e(rt, (
|
|
3571
|
-
t(
|
|
3565
|
+
t(B).traverse((D) => D instanceof pe && D.fire(gn));
|
|
3566
|
+
}), e(rt, (v) => {
|
|
3567
|
+
t(B).traverse((k) => k instanceof pe && k.fire(rt, v));
|
|
3572
3568
|
}), e(Ci, () => {
|
|
3573
|
-
const
|
|
3569
|
+
const v = t(B);
|
|
3574
3570
|
let D;
|
|
3575
|
-
|
|
3576
|
-
}), e(
|
|
3571
|
+
v.traverse((k) => k instanceof pe && (D = k)), D && t(hn, D.fire(Ys));
|
|
3572
|
+
}), e(Yt, () => {
|
|
3577
3573
|
if (!a.size)
|
|
3578
3574
|
return;
|
|
3579
|
-
const
|
|
3580
|
-
if (!
|
|
3575
|
+
const v = t(_);
|
|
3576
|
+
if (!v.enableKeyboard)
|
|
3581
3577
|
return a.clear();
|
|
3582
|
-
if (
|
|
3583
|
-
t(
|
|
3578
|
+
if (v.markMode && a.has("Escape")) {
|
|
3579
|
+
t(qe), a.clear();
|
|
3584
3580
|
return;
|
|
3585
3581
|
}
|
|
3586
|
-
a.has("Space") ? (
|
|
3587
|
-
}), e(it, async (
|
|
3582
|
+
a.has("Space") ? (v.bigSceneMode ? t(Ut) : t(Ot), a.clear()) : a.has("KeyR") ? (v.autoRotate ? t(q) : t(oi), a.clear()) : a.has("KeyM") ? (t(dt, !v.markVisible), a.clear()) : a.has("ArrowLeft") ? (t(yi), t(kt, !0), a.clear()) : a.has("ArrowRight") ? (t(Ai), t(kt, !0), a.clear()) : a.has("KeyP") ? (t(zt, !0), a.clear()) : a.has("Equal") ? (t(Wn), a.clear()) : a.has("Minus") ? (t(Yn), a.clear()) : a.has("KeyY") ? (t(An), a.clear()) : a.has("KeyI") ? (t(Os), a.clear()) : a.has("KeyF") ? (t(Ci), a.clear()) : a.has("F2") && (!v.bigSceneMode && window.open("/editor/index.html?url=" + encodeURIComponent(t(ye).meta.url)), a.clear());
|
|
3583
|
+
}), e(it, async (v, D) => {
|
|
3588
3584
|
if (s.move)
|
|
3589
3585
|
return;
|
|
3590
|
-
const k = await t(
|
|
3586
|
+
const k = await t(Ft, v, D);
|
|
3591
3587
|
k.length && t(hn, k[0], !0);
|
|
3592
|
-
}), e(ce, async (
|
|
3593
|
-
const k = t(
|
|
3588
|
+
}), e(ce, async (v, D) => {
|
|
3589
|
+
const k = t(B), M = [];
|
|
3594
3590
|
k.traverse((E) => E instanceof pe && M.push(E));
|
|
3595
|
-
const R = await t(
|
|
3591
|
+
const R = await t(Ft, v, D);
|
|
3596
3592
|
return R.length ? (M.length && M[0].fire(Mt, R[0].x, R[0].y, R[0].z, !0), new C(R[0].x, R[0].y, R[0].z)) : (M.length && M[0].fire(Mt, 0, 0, 0, !1), null);
|
|
3597
3593
|
}), e(Un, async () => {
|
|
3598
|
-
const
|
|
3599
|
-
|
|
3594
|
+
const v = t(B), D = [];
|
|
3595
|
+
v.traverse((k) => k instanceof pe && D.push(k));
|
|
3600
3596
|
for (let k = 0; k < D.length; k++)
|
|
3601
3597
|
D[k].fire(Mt, 0, 0, 0, !1);
|
|
3602
3598
|
});
|
|
3603
|
-
const c = (
|
|
3604
|
-
|
|
3605
|
-
}, u = (
|
|
3606
|
-
|
|
3599
|
+
const c = (v) => {
|
|
3600
|
+
v.target.type !== "text" && (o || v.code === "F5" || (v.preventDefault(), v.code !== "KeyR" && (a.add(v.code), t(q)), r = Date.now()));
|
|
3601
|
+
}, u = (v) => {
|
|
3602
|
+
v.target.type !== "text" && (o || (v.code === "KeyR" && a.add(v.code), (v.code === "ArrowLeft" || v.code === "ArrowRight") && t(us), r = Date.now()));
|
|
3607
3603
|
};
|
|
3608
3604
|
e(Oe, () => {
|
|
3609
|
-
t(On) && Date.now() - r > 2e3 && (t(kt, !1), t(
|
|
3605
|
+
t(On) && Date.now() - r > 2e3 && (t(kt, !1), t(An));
|
|
3610
3606
|
}, !0);
|
|
3611
3607
|
const l = () => {
|
|
3612
3608
|
a.clear();
|
|
3613
|
-
}, d = (
|
|
3614
|
-
parent && setTimeout(() => window.focus()),
|
|
3615
|
-
}, h = (
|
|
3616
|
-
|
|
3609
|
+
}, d = (v) => {
|
|
3610
|
+
parent && setTimeout(() => window.focus()), v.preventDefault(), !o && (t(q), r = Date.now());
|
|
3611
|
+
}, h = (v) => {
|
|
3612
|
+
v.preventDefault(), !o && (t(q), r = Date.now());
|
|
3617
3613
|
};
|
|
3618
|
-
let f, p,
|
|
3619
|
-
e(
|
|
3620
|
-
f?.dispose(), p?.dispose(),
|
|
3614
|
+
let f, p, y, g;
|
|
3615
|
+
e(qe, () => {
|
|
3616
|
+
f?.dispose(), p?.dispose(), y?.dispose(), g?.dispose(), f = null, p = null, y = null, g = null, s.lastMovePoint = null, t(Te);
|
|
3621
3617
|
});
|
|
3622
|
-
const m = async (
|
|
3623
|
-
parent && setTimeout(() => window.focus()),
|
|
3624
|
-
},
|
|
3625
|
-
if (
|
|
3618
|
+
const m = async (v) => {
|
|
3619
|
+
parent && setTimeout(() => window.focus()), v.preventDefault(), !o && (t(q), s.down = v.button === 2 ? 2 : 1, s.move = !1, s.isDbClick = Date.now() - s.downTime < 300, r = Date.now(), s.downTime = Date.now());
|
|
3620
|
+
}, x = async (v) => {
|
|
3621
|
+
if (v.preventDefault(), o)
|
|
3626
3622
|
return;
|
|
3627
3623
|
s.down && (s.move = !0, r = Date.now());
|
|
3628
3624
|
const D = t(_);
|
|
3629
3625
|
if (D.markMode) {
|
|
3630
|
-
const k = await t(ce,
|
|
3631
|
-
k && !s.down && D.markType === "distance" && f ? f.drawUpdate({ endPoint: k.toArray() }) : !s.down && D.markType === "circle" && g ? k ? (g.drawUpdate(null, !0, k), s.lastMovePoint = k, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0) : !s.down && D.markType === "lines" && p ? k ? (p.drawUpdate(null, !0, k), s.lastMovePoint = k, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0) : !s.down && D.markType === "plans" &&
|
|
3626
|
+
const k = await t(ce, v.clientX, v.clientY);
|
|
3627
|
+
k && !s.down && D.markType === "distance" && f ? f.drawUpdate({ endPoint: k.toArray() }) : !s.down && D.markType === "circle" && g ? k ? (g.drawUpdate(null, !0, k), s.lastMovePoint = k, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0) : !s.down && D.markType === "lines" && p ? k ? (p.drawUpdate(null, !0, k), s.lastMovePoint = k, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0) : !s.down && D.markType === "plans" && y && (k ? (y.drawUpdate(null, !0, k), s.lastMovePoint = k, s.lastMovePointTime = Date.now()) : (s.lastMovePoint = null, s.lastMovePointTime = 0));
|
|
3632
3628
|
}
|
|
3633
|
-
},
|
|
3634
|
-
if (
|
|
3629
|
+
}, b = async (v) => {
|
|
3630
|
+
if (v.preventDefault(), o)
|
|
3635
3631
|
return;
|
|
3636
3632
|
const D = t(_);
|
|
3637
|
-
if (s.isDbClick && (p ? Math.abs(
|
|
3633
|
+
if (s.isDbClick && (p ? Math.abs(v.clientX - s.lastClickX) < 2 && Math.abs(v.clientY - s.lastClickY) < 2 && (p.drawFinish(s.lastClickPointTime > 0), p = null, s.lastMovePoint = null) : y && Math.abs(v.clientX - s.lastClickX) < 2 && Math.abs(v.clientY - s.lastClickY) < 2 && (y.drawFinish(s.lastClickPointTime > 0), y = null, s.lastMovePoint = null)), D.markMode && s.down === 1 && !s.move && Date.now() - s.downTime < 500) {
|
|
3638
3634
|
if (D.markType === "point") {
|
|
3639
|
-
if (await t(ce,
|
|
3640
|
-
const M = new ia(i, await t(ce,
|
|
3641
|
-
t(
|
|
3635
|
+
if (await t(ce, v.clientX, v.clientY)) {
|
|
3636
|
+
const M = new ia(i, await t(ce, v.clientX, v.clientY));
|
|
3637
|
+
t(B).add(M), M.drawFinish();
|
|
3642
3638
|
}
|
|
3643
3639
|
} else if (D.markType === "distance")
|
|
3644
3640
|
if (f) {
|
|
3645
|
-
const k = await t(ce,
|
|
3646
|
-
k ? (f.drawFinish(k), f = null) : s.isDbClick && t(
|
|
3641
|
+
const k = await t(ce, v.clientX, v.clientY);
|
|
3642
|
+
k ? (f.drawFinish(k), f = null) : s.isDbClick && t(qe);
|
|
3647
3643
|
} else {
|
|
3648
|
-
const k = await t(ce,
|
|
3649
|
-
k && (f = new Mn(i), f.drawStart(k), t(
|
|
3644
|
+
const k = await t(ce, v.clientX, v.clientY);
|
|
3645
|
+
k && (f = new Mn(i), f.drawStart(k), t(B).add(f));
|
|
3650
3646
|
}
|
|
3651
3647
|
else if (D.markType === "lines")
|
|
3652
3648
|
if (p)
|
|
3653
|
-
if (s.lastMovePoint && t(
|
|
3649
|
+
if (s.lastMovePoint && t(yn, v.clientX, v.clientY, s.lastMovePoint) < 0.03)
|
|
3654
3650
|
p.drawUpdate(null, !0, s.lastMovePoint, !0), s.lastClickPointTime = Date.now();
|
|
3655
3651
|
else {
|
|
3656
|
-
const k = await t(ce,
|
|
3652
|
+
const k = await t(ce, v.clientX, v.clientY);
|
|
3657
3653
|
k ? (p.drawUpdate(null, !0, k, !0), s.lastClickPointTime = Date.now()) : s.lastClickPointTime = 0;
|
|
3658
3654
|
}
|
|
3659
3655
|
else {
|
|
3660
|
-
const k = await t(ce,
|
|
3661
|
-
k && (p = new Tn(i), p.drawStart(k), t(
|
|
3656
|
+
const k = await t(ce, v.clientX, v.clientY);
|
|
3657
|
+
k && (p = new Tn(i), p.drawStart(k), t(B).add(p));
|
|
3662
3658
|
}
|
|
3663
3659
|
else if (D.markType === "plans")
|
|
3664
|
-
if (
|
|
3665
|
-
if (s.lastMovePoint && t(
|
|
3666
|
-
|
|
3660
|
+
if (y)
|
|
3661
|
+
if (s.lastMovePoint && t(yn, v.clientX, v.clientY, s.lastMovePoint) < 0.03)
|
|
3662
|
+
y.drawUpdate(null, !0, s.lastMovePoint, !0), s.lastClickPointTime = Date.now();
|
|
3667
3663
|
else {
|
|
3668
|
-
const k = await t(ce,
|
|
3669
|
-
k ? (
|
|
3664
|
+
const k = await t(ce, v.clientX, v.clientY);
|
|
3665
|
+
k ? (y.drawUpdate(null, !0, k, !0), s.lastClickPointTime = Date.now()) : s.lastClickPointTime = 0;
|
|
3670
3666
|
}
|
|
3671
3667
|
else {
|
|
3672
|
-
const k = await t(ce,
|
|
3673
|
-
k && (
|
|
3668
|
+
const k = await t(ce, v.clientX, v.clientY);
|
|
3669
|
+
k && (y = new kn(i), y.drawStart(k), t(B).add(y));
|
|
3674
3670
|
}
|
|
3675
3671
|
else if (D.markType === "circle")
|
|
3676
3672
|
if (g) {
|
|
3677
|
-
const k = await t(ce,
|
|
3678
|
-
k ? (g.drawFinish(k), g = null) : s.isDbClick && t(
|
|
3673
|
+
const k = await t(ce, v.clientX, v.clientY);
|
|
3674
|
+
k ? (g.drawFinish(k), g = null) : s.isDbClick && t(qe);
|
|
3679
3675
|
} else {
|
|
3680
|
-
const k = await t(ce,
|
|
3681
|
-
k && (g = new sa(i), g.drawStart(k), t(
|
|
3676
|
+
const k = await t(ce, v.clientX, v.clientY);
|
|
3677
|
+
k && (g = new sa(i), g.drawStart(k), t(B).add(g));
|
|
3682
3678
|
}
|
|
3683
|
-
s.lastClickX =
|
|
3679
|
+
s.lastClickX = v.clientX, s.lastClickY = v.clientY;
|
|
3684
3680
|
}
|
|
3685
|
-
s.down === 2 && !s.move && t(it,
|
|
3681
|
+
s.down === 2 && !s.move && t(it, v.clientX, v.clientY), s.down = 0, s.move = !1, r = Date.now();
|
|
3686
3682
|
};
|
|
3687
|
-
function v
|
|
3688
|
-
|
|
3683
|
+
function S(v) {
|
|
3684
|
+
v.preventDefault(), !o && (t(q), s.down = v.touches.length, s.down === 1 && (s.move = !1, s.x = v.touches[0].clientX, s.y = v.touches[0].clientY));
|
|
3689
3685
|
}
|
|
3690
|
-
function T(
|
|
3691
|
-
|
|
3686
|
+
function T(v) {
|
|
3687
|
+
v.touches.length === 1 && (s.move = !0);
|
|
3692
3688
|
}
|
|
3693
|
-
function w(
|
|
3689
|
+
function w(v) {
|
|
3694
3690
|
s.down === 1 && !s.move && t(it, s.x, s.y);
|
|
3695
3691
|
}
|
|
3696
|
-
window.addEventListener("keydown", c), window.addEventListener("keyup", u), window.addEventListener("blur", l), window.addEventListener("wheel", d, { passive: !1 }), n.addEventListener("contextmenu", h), n.addEventListener("mousedown", m), n.addEventListener("mousemove",
|
|
3692
|
+
window.addEventListener("keydown", c), window.addEventListener("keyup", u), window.addEventListener("blur", l), window.addEventListener("wheel", d, { passive: !1 }), n.addEventListener("contextmenu", h), n.addEventListener("mousedown", m), n.addEventListener("mousemove", x), n.addEventListener("mouseup", b), n.addEventListener("touchstart", S, { passive: !1 }), n.addEventListener("touchmove", T, { passive: !1 }), n.addEventListener("touchend", w, { passive: !1 }), window.addEventListener("resize", I);
|
|
3697
3693
|
function I() {
|
|
3698
|
-
const { width:
|
|
3699
|
-
k.aspect =
|
|
3694
|
+
const { width: v, height: D } = t(Ue), k = t(V);
|
|
3695
|
+
k.aspect = v / D, k.updateProjectionMatrix(), t(zn).setSize(v, D);
|
|
3700
3696
|
const R = t(ct);
|
|
3701
|
-
R.setPixelRatio(Math.min(devicePixelRatio, 2)), R.setSize(
|
|
3697
|
+
R.setPixelRatio(Math.min(devicePixelRatio, 2)), R.setSize(v, D);
|
|
3702
3698
|
}
|
|
3703
3699
|
e(Rn, () => {
|
|
3704
|
-
o = !0, window.removeEventListener("keydown", c), window.removeEventListener("keyup", u), window.removeEventListener("blur", l), window.removeEventListener("wheel", d), n.removeEventListener("contextmenu", h), n.removeEventListener("mousedown", m), n.removeEventListener("mousemove",
|
|
3700
|
+
o = !0, window.removeEventListener("keydown", c), window.removeEventListener("keyup", u), window.removeEventListener("blur", l), window.removeEventListener("wheel", d), n.removeEventListener("contextmenu", h), n.removeEventListener("mousedown", m), n.removeEventListener("mousemove", x), n.removeEventListener("mouseup", b), n.removeEventListener("touchstart", S), n.removeEventListener("touchmove", T), n.removeEventListener("touchend", w), window.removeEventListener("resize", I);
|
|
3705
3701
|
});
|
|
3706
3702
|
}
|
|
3707
3703
|
function aa(i) {
|
|
3708
|
-
const e = new
|
|
3709
|
-
n(
|
|
3710
|
-
const { width: r, height: c, left: u, top: l } = a(Ue), d = new
|
|
3704
|
+
const e = new Aa(), t = 0.02, n = (o, s, r) => i.on(o, s, r), a = (o, ...s) => i.fire(o, ...s);
|
|
3705
|
+
n(Ft, async (o, s) => {
|
|
3706
|
+
const { width: r, height: c, left: u, top: l } = a(Ue), d = new j();
|
|
3711
3707
|
d.x = (o - u) / r * 2 - 1, d.y = (l - s) / c * 2 + 1;
|
|
3712
3708
|
const h = a(V);
|
|
3713
3709
|
e.setFromCamera(d, h);
|
|
3714
|
-
const f = [], p = a(
|
|
3715
|
-
p.traverse(function(
|
|
3716
|
-
|
|
3710
|
+
const f = [], p = a(B), y = [], g = [];
|
|
3711
|
+
p.traverse(function(S) {
|
|
3712
|
+
S instanceof pe ? g.push(S) : S.isMesh && !S.ignoreIntersect && !S.isMark && y.push(S);
|
|
3717
3713
|
});
|
|
3718
|
-
const m = e.intersectObjects(
|
|
3719
|
-
for (let
|
|
3720
|
-
f.push(new tt(m[
|
|
3721
|
-
const
|
|
3722
|
-
for (let
|
|
3723
|
-
const T = g[
|
|
3714
|
+
const m = e.intersectObjects(y, !0);
|
|
3715
|
+
for (let S = 0; S < m.length; S++)
|
|
3716
|
+
f.push(new tt(m[S].point, e.ray.distanceToPoint(m[S].point)));
|
|
3717
|
+
const x = h.projectionMatrix.clone().multiply(h.matrixWorldInverse);
|
|
3718
|
+
for (let S = 0; S < g.length; S++) {
|
|
3719
|
+
const T = g[S].fire(mn);
|
|
3724
3720
|
if (T)
|
|
3725
3721
|
if (T.length !== void 0) {
|
|
3726
3722
|
const w = T, I = w.length / 3;
|
|
3727
|
-
for (let
|
|
3728
|
-
const D = new C(w[3 *
|
|
3723
|
+
for (let v = 0; v < I; v++) {
|
|
3724
|
+
const D = new C(w[3 * v + 0], w[3 * v + 1], w[3 * v + 2]), k = new Se(D.x, D.y, D.z, 1).applyMatrix4(x), M = k.x / k.w, R = k.y / k.w;
|
|
3729
3725
|
Math.sqrt((M - d.x) ** 2 + (R - d.y) ** 2) <= t && f.push(new tt(D, e.ray.distanceToPoint(D)));
|
|
3730
3726
|
}
|
|
3731
3727
|
} else
|
|
3732
3728
|
for (let w of Object.keys(T)) {
|
|
3733
|
-
const I = w.split(","),
|
|
3734
|
-
if (e.ray.distanceToPoint(
|
|
3729
|
+
const I = w.split(","), v = new C(Number(I[0]), Number(I[1]), Number(I[2]));
|
|
3730
|
+
if (e.ray.distanceToPoint(v) <= 1.4143) {
|
|
3735
3731
|
const D = T[w];
|
|
3736
3732
|
for (let k = 0, M = D.length / 3; k < M; k++) {
|
|
3737
|
-
const R = new C(D[3 * k + 0], D[3 * k + 1], D[3 * k + 2]), E = new
|
|
3733
|
+
const R = new C(D[3 * k + 0], D[3 * k + 1], D[3 * k + 2]), E = new Se(R.x, R.y, R.z, 1).applyMatrix4(x), P = E.x / E.w, U = E.y / E.w;
|
|
3738
3734
|
Math.sqrt((P - d.x) ** 2 + (U - d.y) ** 2) <= t && f.push(new tt(R, e.ray.distanceToPoint(R)));
|
|
3739
3735
|
}
|
|
3740
3736
|
}
|
|
3741
3737
|
}
|
|
3742
3738
|
}
|
|
3743
|
-
f.sort((
|
|
3744
|
-
const
|
|
3745
|
-
for (let
|
|
3746
|
-
|
|
3747
|
-
return
|
|
3748
|
-
}), n(
|
|
3749
|
-
const { width: c, height: u, left: l, top: d } = a(Ue), h = new
|
|
3739
|
+
f.sort((S, T) => S.radius - T.radius);
|
|
3740
|
+
const b = [];
|
|
3741
|
+
for (let S = 0; S < f.length; S++)
|
|
3742
|
+
b.push(f[S].center);
|
|
3743
|
+
return b;
|
|
3744
|
+
}), n(yn, (o, s, r) => {
|
|
3745
|
+
const { width: c, height: u, left: l, top: d } = a(Ue), h = new j();
|
|
3750
3746
|
h.x = (o - l) / c * 2 - 1, h.y = (d - s) / u * 2 + 1;
|
|
3751
3747
|
const f = a(V);
|
|
3752
3748
|
return e.setFromCamera(h, f), e.ray.distanceToPoint(r);
|
|
3753
3749
|
});
|
|
3754
3750
|
}
|
|
3755
|
-
function
|
|
3751
|
+
function vr(i) {
|
|
3756
3752
|
const e = (r, c, u) => i.on(r, c, u), t = (r, ...c) => i.fire(r, ...c);
|
|
3757
|
-
e(ft, () => t(V).fov), e(
|
|
3753
|
+
e(ft, () => t(V).fov), e(Be, (r = !1) => r ? t(V).position.clone() : t(V).position), e(Ce, (r = !1) => r ? t(Y).target.clone() : t(Y).target), e(Ne, (r = !1) => r ? t(V).up.clone() : t(V).up), e(hn, (r, c = !1) => {
|
|
3758
3754
|
if (t(Is, r), !c) {
|
|
3759
|
-
t(
|
|
3755
|
+
t(Y).target.copy(r), t(Bt);
|
|
3760
3756
|
return;
|
|
3761
3757
|
}
|
|
3762
|
-
const u = t(
|
|
3758
|
+
const u = t(Y).target.clone();
|
|
3763
3759
|
let l = 0;
|
|
3764
3760
|
t(at, () => {
|
|
3765
|
-
l += 0.03, t(
|
|
3761
|
+
l += 0.03, t(Y).target.copy(u.clone().lerp(r, l)), t(Bt);
|
|
3766
3762
|
}, () => l < 1);
|
|
3767
3763
|
}), e(ls, () => {
|
|
3768
|
-
let r = t(
|
|
3764
|
+
let r = t(Be).toArray(), c = t(Ne).toArray(), u = t(Ce).toArray();
|
|
3769
3765
|
return { position: r, lookUp: c, lookAt: u };
|
|
3770
|
-
}), e(ds, () => t(
|
|
3766
|
+
}), e(ds, () => t(Y).update()), e(us, () => t(Y).updateRotateAxis());
|
|
3771
3767
|
const n = 0.01;
|
|
3772
3768
|
let a = new C(), o = new C(), s = 0;
|
|
3773
3769
|
e(ws, () => {
|
|
3774
|
-
const r = t(
|
|
3770
|
+
const r = t(Y).object, c = r.fov, u = r.position.clone(), l = r.getWorldDirection(new C());
|
|
3775
3771
|
return Math.abs(s - c) < n && Math.abs(u.x - a.x) < n && Math.abs(u.y - a.y) < n && Math.abs(u.z - a.z) < n && Math.abs(l.x - o.x) < n && Math.abs(l.y - o.y) < n && Math.abs(l.z - o.z) < n ? !1 : (s = c, a = u, o = l, !0);
|
|
3776
3772
|
});
|
|
3777
3773
|
}
|
|
3778
|
-
class
|
|
3774
|
+
class br extends te {
|
|
3779
3775
|
constructor() {
|
|
3780
3776
|
super(...arguments), this.ignoreIntersect = !0;
|
|
3781
3777
|
}
|
|
3782
3778
|
}
|
|
3783
|
-
function
|
|
3779
|
+
function xr(i) {
|
|
3784
3780
|
let e = !1;
|
|
3785
|
-
const t = (r, c, u) => i.on(r, c, u), n = (r, ...c) => i.fire(r, ...c), a = [], o = new C(), s = new
|
|
3781
|
+
const t = (r, c, u) => i.on(r, c, u), n = (r, ...c) => i.fire(r, ...c), a = [], o = new C(), s = new Ke();
|
|
3786
3782
|
t(_s, () => {
|
|
3787
3783
|
const r = new wa(0.5, 32, 32), c = Cr();
|
|
3788
3784
|
c.depthTest = !1, c.depthWrite = !1, c.transparent = !0;
|
|
3789
|
-
const u = new
|
|
3785
|
+
const u = new br();
|
|
3790
3786
|
return u.copy(new te(r, c)), t(Da, () => c), t(wi, (l) => {
|
|
3791
3787
|
e || (c.uniforms[Cn].value = l, l <= 0.01 ? u.visible = !1 : u.visible = !0, c.uniformsNeedUpdate = !0, n(J));
|
|
3792
3788
|
}), t(Is, (l) => {
|
|
@@ -3795,11 +3791,11 @@ function br(i) {
|
|
|
3795
3791
|
const d = n(V);
|
|
3796
3792
|
s.copy(d.matrixWorld).invert(), o.copy(l).applyMatrix4(s), o.normalize().multiplyScalar(10), o.applyMatrix4(d.matrixWorld);
|
|
3797
3793
|
const { width: h, height: f } = n(Ue);
|
|
3798
|
-
c.uniforms[ht].value.set(h, f), u.position.copy(o), c.uniforms[Js].value.copy(l), c.uniforms[ht].value.set(h, f), c.uniforms[Cn].value = 1, c.uniformsNeedUpdate = !0, n(
|
|
3794
|
+
c.uniforms[ht].value.set(h, f), u.position.copy(o), c.uniforms[Js].value.copy(l), c.uniforms[ht].value.set(h, f), c.uniforms[Cn].value = 1, c.uniformsNeedUpdate = !0, n(Si), n(J);
|
|
3799
3795
|
}), t(Pa, () => {
|
|
3800
3796
|
e || (e = !0, c.dispose(), r.dispose());
|
|
3801
3797
|
}), u.renderOrder = 99999, u;
|
|
3802
|
-
}), t(
|
|
3798
|
+
}), t(Si, () => {
|
|
3803
3799
|
for (; a.length; )
|
|
3804
3800
|
a.pop().opacity = 0;
|
|
3805
3801
|
let r = { opacity: 1 };
|
|
@@ -3810,89 +3806,89 @@ function br(i) {
|
|
|
3810
3806
|
}
|
|
3811
3807
|
function Cr() {
|
|
3812
3808
|
const i = {
|
|
3813
|
-
[
|
|
3809
|
+
[vo]: { type: "v3", value: new is() },
|
|
3814
3810
|
[Js]: { type: "v3", value: new C() },
|
|
3815
|
-
[ht]: { type: "v2", value: new
|
|
3811
|
+
[ht]: { type: "v2", value: new j() },
|
|
3816
3812
|
[Cn]: { value: 0 }
|
|
3817
3813
|
};
|
|
3818
3814
|
return new In({
|
|
3819
3815
|
uniforms: i,
|
|
3820
|
-
vertexShader:
|
|
3816
|
+
vertexShader: Ao(),
|
|
3821
3817
|
fragmentShader: wo(),
|
|
3822
3818
|
transparent: !0,
|
|
3823
3819
|
depthTest: !1,
|
|
3824
3820
|
depthWrite: !1,
|
|
3825
|
-
side:
|
|
3821
|
+
side: Sa
|
|
3826
3822
|
});
|
|
3827
3823
|
}
|
|
3828
3824
|
function oa(i) {
|
|
3829
3825
|
const e = (s, r, c) => i.on(s, r, c), t = (s, ...r) => i.fire(s, ...r), n = /* @__PURE__ */ new Map(), a = document.createElement("div");
|
|
3830
3826
|
a.classList.add("mark-warp"), document.body.appendChild(a);
|
|
3831
|
-
const o = new
|
|
3832
|
-
o.setSize(innerWidth, innerHeight), o.domElement.style.position = "absolute", o.domElement.style.top = "0px", o.domElement.style.pointerEvents = "none", a.appendChild(o.domElement), e(
|
|
3827
|
+
const o = new Ar();
|
|
3828
|
+
o.setSize(innerWidth, innerHeight), o.domElement.style.position = "absolute", o.domElement.style.top = "0px", o.domElement.style.pointerEvents = "none", a.appendChild(o.domElement), e(Fa, () => a), e(zn, () => o), e(Qn, () => document.body.removeChild(a)), e(Oe, () => o.render(t(B), t(V)), !0), e(Me, (s) => {
|
|
3833
3829
|
const r = s?.getMarkData?.()?.name || s?.name;
|
|
3834
3830
|
r && n.set(r, new WeakRef(s));
|
|
3835
|
-
}), e(
|
|
3831
|
+
}), e(Ze, (s) => {
|
|
3836
3832
|
const r = s?.getMarkData?.()?.name || s?.name;
|
|
3837
3833
|
n.delete(r);
|
|
3838
|
-
}), e(st, (s) => n.get(s)?.deref()), e(
|
|
3834
|
+
}), e(st, (s) => n.get(s)?.deref()), e(Ba, (s, r) => {
|
|
3839
3835
|
const c = t(st, s);
|
|
3840
3836
|
!c || !r || c.drawUpdate?.(r);
|
|
3841
3837
|
}), e(Ua, (s) => {
|
|
3842
3838
|
const r = t(st, s);
|
|
3843
3839
|
return r ? r.getMarkData?.() : {};
|
|
3844
3840
|
}), e(dt, (s) => {
|
|
3845
|
-
s !== void 0 && (t(_).markVisible = s), t(
|
|
3846
|
-
}), e(
|
|
3841
|
+
s !== void 0 && (t(_).markVisible = s), t(B).traverse((r) => r.isMark && (r.visible = t(_).markVisible)), t(J);
|
|
3842
|
+
}), e(An, async () => {
|
|
3847
3843
|
const s = [];
|
|
3848
|
-
t(
|
|
3844
|
+
t(B).traverse((c) => {
|
|
3849
3845
|
if (c.isMark) {
|
|
3850
3846
|
const u = c.getMarkData?.();
|
|
3851
3847
|
u && s.push(u);
|
|
3852
3848
|
}
|
|
3853
3849
|
});
|
|
3854
|
-
const r = t(
|
|
3850
|
+
const r = t(ye).meta || {};
|
|
3855
3851
|
return s.length ? r.marks = s : delete r.marks, r.cameraInfo = t(ls), await t(Pe, r);
|
|
3856
3852
|
}), e(Et, async () => {
|
|
3857
3853
|
const s = [];
|
|
3858
|
-
t(
|
|
3854
|
+
t(B).traverse((c) => {
|
|
3859
3855
|
if (c.isMark) {
|
|
3860
3856
|
const u = c.getMarkData?.();
|
|
3861
3857
|
u && s.push(u);
|
|
3862
3858
|
}
|
|
3863
3859
|
});
|
|
3864
|
-
const r = t(
|
|
3860
|
+
const r = t(ye).meta || {};
|
|
3865
3861
|
return s.length ? r.marks = s : delete r.marks, await t(Pe, r);
|
|
3866
3862
|
}), e(Ls, async () => {
|
|
3867
|
-
const s = t(
|
|
3863
|
+
const s = t(ye).meta || {};
|
|
3868
3864
|
delete s.marks;
|
|
3869
3865
|
const r = await t(Pe, s), c = [];
|
|
3870
3866
|
return n.forEach((u) => c.push(u)), c.forEach((u) => u.deref()?.dispose?.()), t(J), r;
|
|
3871
3867
|
}), e(Rs, async () => {
|
|
3872
|
-
t(
|
|
3868
|
+
t(B).traverse((r) => {
|
|
3873
3869
|
r.isMark && r.getMarkData?.();
|
|
3874
3870
|
});
|
|
3875
|
-
const s = t(
|
|
3871
|
+
const s = t(ye).meta || {};
|
|
3876
3872
|
return s.watermark = t(Ds) || "", await t(Pe, s);
|
|
3877
3873
|
}), e(wn, (s) => {
|
|
3878
|
-
s.meterScale && (t(_).meterScale = s.meterScale, t(oe, { scale: `1 : ${t(_).meterScale} m` })), t(
|
|
3874
|
+
s.meterScale && (t(_).meterScale = s.meterScale, t(oe, { scale: `1 : ${t(_).meterScale} m` })), t(Y).updateByOptions({ ...s, ...s.cameraInfo || {} }), (s.marks || []).forEach((c) => {
|
|
3879
3875
|
if (c.type === "MarkSinglePoint") {
|
|
3880
3876
|
const u = new ia(i, c);
|
|
3881
|
-
u.visible = !1, t(
|
|
3877
|
+
u.visible = !1, t(B).add(u);
|
|
3882
3878
|
} else if (c.type === "MarkDistanceLine") {
|
|
3883
3879
|
const u = new Mn(i);
|
|
3884
|
-
u.draw(c), u.visible = !1, t(
|
|
3880
|
+
u.draw(c), u.visible = !1, t(B).add(u);
|
|
3885
3881
|
} else if (c.type === "MarkMultiLines") {
|
|
3886
3882
|
const u = new Tn(i);
|
|
3887
|
-
u.draw(c, !0), u.visible = !1, t(
|
|
3883
|
+
u.draw(c, !0), u.visible = !1, t(B).add(u);
|
|
3888
3884
|
} else if (c.type === "MarkMultiPlans") {
|
|
3889
3885
|
const u = new kn(i);
|
|
3890
|
-
u.draw(c, !0), u.visible = !1, t(
|
|
3886
|
+
u.draw(c, !0), u.visible = !1, t(B).add(u);
|
|
3891
3887
|
} else if (c.type === "MarkCirclePlan") {
|
|
3892
3888
|
const u = new sa(i);
|
|
3893
|
-
u.draw(c), u.visible = !1, t(
|
|
3889
|
+
u.draw(c), u.visible = !1, t(B).add(u);
|
|
3894
3890
|
}
|
|
3895
|
-
}), t(Vn, s.flyPositions || []), t(
|
|
3891
|
+
}), t(Vn, s.flyPositions || []), t(Gn, s.flyTargets || []);
|
|
3896
3892
|
}), e(Te, () => {
|
|
3897
3893
|
const s = t(_);
|
|
3898
3894
|
s.markMode = !1, t(Un), t(J);
|
|
@@ -3923,14 +3919,14 @@ function oa(i) {
|
|
|
3923
3919
|
return 0;
|
|
3924
3920
|
let l = 0;
|
|
3925
3921
|
for (let d = 0, h = r.length - 2; d < h; d++)
|
|
3926
|
-
l += t(
|
|
3922
|
+
l += t(Nt, r[0], r[d + 1], r[d + 2], t(_).meterScale);
|
|
3927
3923
|
return l;
|
|
3928
3924
|
}), e(rs, (s, r) => {
|
|
3929
3925
|
let c = 0;
|
|
3930
3926
|
for (let u = 0, l = s.length - 2; u < l; u++)
|
|
3931
|
-
c += t(
|
|
3927
|
+
c += t(Nt, s[0], s[u + 1], s[u + 2], r);
|
|
3932
3928
|
return c;
|
|
3933
|
-
}), e(
|
|
3929
|
+
}), e(Nt, (s, r, c, u) => {
|
|
3934
3930
|
const l = s.distanceTo(r) * u, d = r.distanceTo(c) * u, h = c.distanceTo(s) * u, f = (l + d + h) / 2;
|
|
3935
3931
|
return Math.sqrt(f * (f - l) * (f - d) * (f - h));
|
|
3936
3932
|
});
|
|
@@ -3938,7 +3934,7 @@ function oa(i) {
|
|
|
3938
3934
|
function Mr(i) {
|
|
3939
3935
|
const e = (h, ...f) => i.fire(h, ...f), t = (h, f, p) => i.on(h, f, p), n = [], a = [];
|
|
3940
3936
|
let o = !1, s = !1;
|
|
3941
|
-
t(
|
|
3937
|
+
t(Qt, () => o = !1), t(xi, () => o = !0), t(bi, () => n), t(Oa, () => {
|
|
3942
3938
|
const h = [];
|
|
3943
3939
|
for (let f = 0, p = n.length; f < p; f++)
|
|
3944
3940
|
h.push(...n[f].toArray());
|
|
@@ -3951,20 +3947,20 @@ function Mr(i) {
|
|
|
3951
3947
|
}), t(Vn, (h) => {
|
|
3952
3948
|
for (let f = 0, p = h.length / 3 | 0; f < p; f++)
|
|
3953
3949
|
n[f] = new C(h[f * 3 + 0], h[f * 3 + 1], h[f * 3 + 2]);
|
|
3954
|
-
}), t(
|
|
3950
|
+
}), t(Gn, (h) => {
|
|
3955
3951
|
for (let f = 0, p = h.length / 3 | 0; f < p; f++)
|
|
3956
3952
|
a[f] = new C(h[f * 3 + 0], h[f * 3 + 1], h[f * 3 + 2]);
|
|
3957
3953
|
}), t(Wn, () => {
|
|
3958
|
-
const h = e(
|
|
3954
|
+
const h = e(Y);
|
|
3959
3955
|
n.push(h.object.position.clone()), a.push(h.target.clone());
|
|
3960
|
-
}), t(
|
|
3956
|
+
}), t(Yn, () => {
|
|
3961
3957
|
n.length = 0, a.length = 0;
|
|
3962
|
-
}), t(
|
|
3963
|
-
const h = e(
|
|
3958
|
+
}), t(Bs, async () => {
|
|
3959
|
+
const h = e(ye).meta || {};
|
|
3964
3960
|
if (n.length) {
|
|
3965
3961
|
const f = [], p = [];
|
|
3966
|
-
for (let
|
|
3967
|
-
f.push(...n[
|
|
3962
|
+
for (let y = 0, g = n.length; y < g; y++)
|
|
3963
|
+
f.push(...n[y].toArray()), p.push(...a[y].toArray());
|
|
3968
3964
|
h.flyPositions = f, h.flyTargets = p;
|
|
3969
3965
|
} else
|
|
3970
3966
|
delete h.flyPositions, delete h.flyTargets;
|
|
@@ -3976,36 +3972,36 @@ function Mr(i) {
|
|
|
3976
3972
|
const c = 120 * 1e3;
|
|
3977
3973
|
let u = 0, l, d;
|
|
3978
3974
|
t(zt, (h) => {
|
|
3979
|
-
if (r = 0, u = Date.now(), l = null, d = null, !n.length || !h && !e(
|
|
3975
|
+
if (r = 0, u = Date.now(), l = null, d = null, !n.length || !h && !e(Y).autoRotate)
|
|
3980
3976
|
return;
|
|
3981
|
-
const f = e(
|
|
3982
|
-
for (let m = 0,
|
|
3983
|
-
g[m] && p.push(g[m]), a[m] &&
|
|
3984
|
-
l = new si(p), l.closed = !0, d = new si(
|
|
3977
|
+
const f = e(Y), p = [f.object.position.clone()], y = [f.target.clone()], g = e(bi) || [];
|
|
3978
|
+
for (let m = 0, x = Math.min(g.length, 100); m < x; m++)
|
|
3979
|
+
g[m] && p.push(g[m]), a[m] && y.push(a[m]);
|
|
3980
|
+
l = new si(p), l.closed = !0, d = new si(y), d.closed = !0, e(xi), e(q, !1);
|
|
3985
3981
|
}), t(lt, () => {
|
|
3986
|
-
if (Date.now() - u > c && e(
|
|
3982
|
+
if (Date.now() - u > c && e(Qt), !o || !l || !d)
|
|
3987
3983
|
return;
|
|
3988
|
-
const h = e(
|
|
3984
|
+
const h = e(Y);
|
|
3989
3985
|
r = (Date.now() - u) / c;
|
|
3990
3986
|
const f = l.getPoint(r), p = d.getPoint(r);
|
|
3991
3987
|
h.object.position.set(f.x, f.y, f.z), h.target.set(p.x, p.y, p.z);
|
|
3992
3988
|
}, !0);
|
|
3993
3989
|
}
|
|
3994
|
-
class
|
|
3990
|
+
class Br {
|
|
3995
3991
|
constructor(e = {}) {
|
|
3996
|
-
this.disposed = !1, this.updateTime = 0, this.needUpdate = !0, console.info("Reall3dViewer", Vt), this.init(
|
|
3992
|
+
this.disposed = !1, this.updateTime = 0, this.needUpdate = !0, console.info("Reall3dViewer", Vt), this.init(Yi(e)), !e.disableDropLocalFile && this.enableDropLocalFile();
|
|
3997
3993
|
}
|
|
3998
3994
|
init(e) {
|
|
3999
3995
|
const t = this;
|
|
4000
3996
|
e.position = e.position ? [...e.position] : [0, -5, 15], e.lookAt = e.lookAt ? [...e.lookAt] : [0, 0, 0], e.lookUp = e.lookUp ? [...e.lookUp] : [0, -1, 0];
|
|
4001
|
-
const n =
|
|
4002
|
-
|
|
3997
|
+
const n = Go(e), a = e.scene = e.scene || new ss();
|
|
3998
|
+
No(e);
|
|
4003
3999
|
const o = e.controls = new dr(e);
|
|
4004
4000
|
o.updateByOptions(e);
|
|
4005
|
-
const s = new
|
|
4001
|
+
const s = new Xn();
|
|
4006
4002
|
e.viewerEvents = s, t.events = s;
|
|
4007
4003
|
const r = (d, h, f) => s.on(d, h, f), c = (d, ...h) => s.fire(d, ...h);
|
|
4008
|
-
r(_, () => e), r(
|
|
4004
|
+
r(_, () => e), r($e, () => n.domElement), r(ct, () => n), r(B, () => a), r(Y, () => o), r(V, () => o.object), r(ee, () => e.bigSceneMode), r(Ra, (d) => e.pointcloudMode = d);
|
|
4009
4005
|
const u = [];
|
|
4010
4006
|
r(J, () => {
|
|
4011
4007
|
for (t.needUpdate = !0; u.length; ) u.pop().stop = !0;
|
|
@@ -4018,9 +4014,9 @@ class Fr {
|
|
|
4018
4014
|
() => !t.disposed && (c(On) || !d.stop),
|
|
4019
4015
|
10
|
|
4020
4016
|
);
|
|
4021
|
-
}),
|
|
4017
|
+
}), qn(s), Yo(s), Jn(s), vr(s), oa(s), Sr(s), aa(s), xr(s), Mr(s), t.splatMesh = new pe(Xo(e)), r(ye, () => t.splatMesh), a.add(t.splatMesh), Zo(s), a.add(new as("#ffffff", 2)), a.add(c(_s)), n.setAnimationLoop(t.update.bind(t)), r(vi, () => {
|
|
4022
4018
|
o.update(), !t.needUpdate && c(ws) && c(J);
|
|
4023
|
-
}), r(Ve, () => c(
|
|
4019
|
+
}), r(Ve, () => c(Yt), !0), r(Ve, () => c(vi), !0), r(
|
|
4024
4020
|
Oe,
|
|
4025
4021
|
() => {
|
|
4026
4022
|
try {
|
|
@@ -4031,10 +4027,10 @@ class Fr {
|
|
|
4031
4027
|
},
|
|
4032
4028
|
!0
|
|
4033
4029
|
), r(lt, () => {
|
|
4034
|
-
}, !0), r(Wt, () => t.dispose()), r(Os, () => console.info(JSON.stringify(c(
|
|
4030
|
+
}, !0), r(Wt, () => t.dispose()), r(Os, () => console.info(JSON.stringify(c(ye).meta || {}, null, 2)));
|
|
4035
4031
|
let l = "";
|
|
4036
|
-
r(
|
|
4037
|
-
l = d, t.splatMesh.fire(
|
|
4032
|
+
r(yt, (d = "") => {
|
|
4033
|
+
l = d, t.splatMesh.fire(Hn, l, !0);
|
|
4038
4034
|
}), r(Ds, () => l), c(oe, { scale: `1 : ${c(_).meterScale} m` }), t.initGsApi();
|
|
4039
4035
|
}
|
|
4040
4036
|
/**
|
|
@@ -4077,9 +4073,9 @@ class Fr {
|
|
|
4077
4073
|
// 开发调试用临时接口
|
|
4078
4074
|
fire(e, t, n) {
|
|
4079
4075
|
const a = this;
|
|
4080
|
-
e === 1 && a.splatMesh.fire(pn, t), e === 2 && a.events.fire(Wn), e === 3 && a.events.fire(zt, !0), e === 4 && a.events.fire(
|
|
4081
|
-
let o = await a.splatMesh.fire(
|
|
4082
|
-
t && (o = a.splatMesh.fire(Ws) + t), a.splatMesh.fire(
|
|
4076
|
+
e === 1 && a.splatMesh.fire(pn, t), e === 2 && a.events.fire(Wn), e === 3 && a.events.fire(zt, !0), e === 4 && a.events.fire(Yn), e === 5 && a.events.fire(Bs), e === 6 && a.events.fire(Et), e === 7 && a.events.fire(Ls), e === 8 && (async () => {
|
|
4077
|
+
let o = await a.splatMesh.fire(Nn);
|
|
4078
|
+
t && (o = a.splatMesh.fire(Ws) + t), a.splatMesh.fire(Fn, o);
|
|
4083
4079
|
})();
|
|
4084
4080
|
}
|
|
4085
4081
|
/**
|
|
@@ -4092,14 +4088,14 @@ class Fr {
|
|
|
4092
4088
|
if (t.disposed) return {};
|
|
4093
4089
|
const n = (r, ...c) => t.events.fire(r, ...c);
|
|
4094
4090
|
let a;
|
|
4095
|
-
return n(
|
|
4091
|
+
return n(B).traverse((r) => !a && r instanceof pe && (a = r.options())), e && (e.autoRotate !== void 0 && (n(Y).autoRotate = e.autoRotate, n(_).autoRotate = e.autoRotate), e.pointcloudMode !== void 0 && n(Ut, e.pointcloudMode), e.lightFactor !== void 0 && n(rt, e.lightFactor), e.maxRenderCountOfMobile && (n(_).maxRenderCountOfMobile = e.maxRenderCountOfMobile), e.maxRenderCountOfPc && (n(_).maxRenderCountOfPc = e.maxRenderCountOfPc), e.debugMode !== void 0 && (n(_).debugMode = e.debugMode), e.markType !== void 0 && (n(_).markType = e.markType), e.markVisible !== void 0 && n(dt, e.markVisible), e.meterScale !== void 0 && (n(_).meterScale = e.meterScale), e.markMode !== void 0 && (n(_).markMode = e.markMode, !e.markMode && n(Un), n(Y).autoRotate = n(_).autoRotate = !1)), n(Y).updateByOptions(e), n(oe, { scale: `1 : ${n(_).meterScale} m` }), Object.assign({ ...n(_) }, a);
|
|
4096
4092
|
}
|
|
4097
4093
|
/**
|
|
4098
4094
|
* 重置
|
|
4099
4095
|
*/
|
|
4100
4096
|
reset(e = {}) {
|
|
4101
4097
|
const t = this;
|
|
4102
|
-
t.dispose(), t.disposed = !1, t.init(
|
|
4098
|
+
t.dispose(), t.disposed = !1, t.init(Yi(e));
|
|
4103
4099
|
}
|
|
4104
4100
|
/**
|
|
4105
4101
|
* 光圈过渡切换显示
|
|
@@ -4131,7 +4127,7 @@ class Fr {
|
|
|
4131
4127
|
if (!a.url.endsWith(".bin") && !a.url.endsWith(".spx"))
|
|
4132
4128
|
return console.error("The format is unsupported in the large scene mode", a.url);
|
|
4133
4129
|
const o = { ...a, ...a.cameraInfo || {} };
|
|
4134
|
-
a.autoCut = Math.min(Math.max(a.autoCut || 0, 0), 50), o.bigSceneMode = a.autoCut > 1, t.reset({ ...o }), !o.bigSceneMode && delete a.autoCut, t.splatMesh.meta = a, le && (a.cameraInfo?.position || a.cameraInfo?.lookAt) && t.events.fire(
|
|
4130
|
+
a.autoCut = Math.min(Math.max(a.autoCut || 0, 0), 50), o.bigSceneMode = a.autoCut > 1, t.reset({ ...o }), !o.bigSceneMode && delete a.autoCut, t.splatMesh.meta = a, le && (a.cameraInfo?.position || a.cameraInfo?.lookAt) && t.events.fire(Y)._dollyOut(0.75), o.bigSceneMode ? (n(Vn, a.flyPositions || []), n(Gn, a.flyTargets || [])) : n(wn, a), await t.splatMesh.addModel({ url: a.url }, a), await n(yt, a.watermark), n(Y).updateRotateAxis();
|
|
4135
4131
|
}
|
|
4136
4132
|
/**
|
|
4137
4133
|
* 添加要渲染的高斯模型(小场景模式)
|
|
@@ -4167,14 +4163,14 @@ class Fr {
|
|
|
4167
4163
|
console.error("unknow format!", o.url);
|
|
4168
4164
|
return;
|
|
4169
4165
|
}
|
|
4170
|
-
n(wn, r), await t.splatMesh.addModel(o, r), await n(
|
|
4166
|
+
n(wn, r), await t.splatMesh.addModel(o, r), await n(yt, r.watermark);
|
|
4171
4167
|
}
|
|
4172
4168
|
/**
|
|
4173
4169
|
* 根据需要暴露的接口
|
|
4174
4170
|
*/
|
|
4175
4171
|
initGsApi() {
|
|
4176
4172
|
const e = (l, ...d) => this.events.fire(l, ...d), t = () => {
|
|
4177
|
-
setTimeout(() => window.focus()), e(
|
|
4173
|
+
setTimeout(() => window.focus()), e(Qt), e(Y).autoRotate = e(_).autoRotate = !e(_).autoRotate;
|
|
4178
4174
|
}, n = (l = !0) => {
|
|
4179
4175
|
setTimeout(() => window.focus()), l = !!l;
|
|
4180
4176
|
const d = e(_);
|
|
@@ -4195,11 +4191,11 @@ class Fr {
|
|
|
4195
4191
|
d.markType = "distance";
|
|
4196
4192
|
else
|
|
4197
4193
|
return !1;
|
|
4198
|
-
return d.markMode = !0, e(
|
|
4194
|
+
return d.markMode = !0, e(q), !0;
|
|
4199
4195
|
}, s = async (l) => (setTimeout(() => window.focus()), l ? (e(st, l)?.dispose(), e(J), await e(Et)) : !1), r = async (l, d = !0) => (e(Ps, l, d), e(st, l?.name)?.drawUpdate?.(l, d), e(J), d ? (setTimeout(() => window.focus()), await e(Et)) : !0), c = (l = !0) => {
|
|
4200
4196
|
setTimeout(() => window.focus()), e(pn, !!l);
|
|
4201
4197
|
}, u = (l, d = !0) => {
|
|
4202
|
-
e(
|
|
4198
|
+
e(yt, l), d && e(Rs, l);
|
|
4203
4199
|
};
|
|
4204
4200
|
window.$api = { switchAutoRotate: t, changePointCloudMode: n, showMark: a, startMark: o, deleteMark: s, updateMark: r, showWaterMark: c, setWaterMark: u };
|
|
4205
4201
|
}
|
|
@@ -4211,81 +4207,81 @@ class Fr {
|
|
|
4211
4207
|
if (e.disposed) return;
|
|
4212
4208
|
e.disposed = !0;
|
|
4213
4209
|
const t = (a, ...o) => e.events.fire(a, ...o);
|
|
4214
|
-
t(
|
|
4210
|
+
t(Bn), t(As), t(Qn), t(Rn), t(Y).dispose(), t(ke, t(B));
|
|
4215
4211
|
const n = t(ct);
|
|
4216
4212
|
n.clear(), n.dispose(), e.splatMesh = null, e.events.clear(), e.events = null;
|
|
4217
4213
|
}
|
|
4218
4214
|
}
|
|
4219
4215
|
function Tr(i) {
|
|
4220
4216
|
const e = (s, r, c) => i.on(s, r, c), t = (s, ...r) => i.fire(s, ...r), n = le ? 1 : 20, a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
4221
|
-
e(Dt, () => t(re) && a.set(Date.now(), 1)), e(Pt, () => t(re) && t(
|
|
4217
|
+
e(Dt, () => t(re) && a.set(Date.now(), 1)), e(Pt, () => t(re) && t(Ye, a)), e(Lt, () => t(re) && o.set(Date.now(), 1)), e(Rt, () => t(re) && t(Ye, o)), e(Ye, (s) => {
|
|
4222
4218
|
let r = [], c = Date.now(), u = 0;
|
|
4223
4219
|
for (const l of s.keys())
|
|
4224
4220
|
c - l <= 1e3 ? u++ : r.push(l);
|
|
4225
4221
|
return r.forEach((l) => s.delete(l)), Math.min(u, 30);
|
|
4226
|
-
}), e(
|
|
4227
|
-
const s = t(
|
|
4222
|
+
}), e(X, () => {
|
|
4223
|
+
const s = t(B), r = t(V), c = [];
|
|
4228
4224
|
return s?.traverse(function(u) {
|
|
4229
4225
|
u.isWarpSplatMesh && u.splatMesh?.visible && c.push(u);
|
|
4230
4226
|
}), c.sort((u, l) => r.position.distanceTo(u.position) - r.position.distanceTo(l.position)), window.splat = c[0]?.splatMesh, c[0]?.splatMesh;
|
|
4231
|
-
}), e(
|
|
4232
|
-
const s = t(
|
|
4227
|
+
}), e($s, () => {
|
|
4228
|
+
const s = t(B), r = t(V), c = [];
|
|
4233
4229
|
s?.traverse(function(u) {
|
|
4234
4230
|
u.isWarpSplatMesh && c.push(u);
|
|
4235
4231
|
}), c.sort((u, l) => r.position.distanceTo(u.position) - r.position.distanceTo(l.position));
|
|
4236
4232
|
for (let u = 0; u < c.length; u++)
|
|
4237
4233
|
c[u].active = u < n, c[u].splatMesh && (c[u].splatMesh.renderOrder = 1e3 - u);
|
|
4238
|
-
}), e(
|
|
4239
|
-
const s = t(
|
|
4234
|
+
}), e(Zs, () => {
|
|
4235
|
+
const s = t(B), r = [];
|
|
4240
4236
|
s?.traverse((c) => r.push(c)), r.forEach((c) => {
|
|
4241
4237
|
c.dispose ? c.dispose() : (c.geometry?.dispose?.(), c.material && c.material instanceof Array ? c.material.forEach((u) => u?.dispose?.()) : c.material?.dispose?.());
|
|
4242
4238
|
}), s?.clear();
|
|
4243
|
-
}), e(vn, (s = 0.1) => {
|
|
4244
|
-
const r = t(G);
|
|
4245
|
-
r && r.visible && r.rotateOnAxis(new C(1, 0, 0), xe.degToRad(s));
|
|
4246
4239
|
}), e(Sn, (s = 0.1) => {
|
|
4247
|
-
const r = t(
|
|
4248
|
-
r && r.visible && r.rotateOnAxis(new C(
|
|
4249
|
-
}), e(
|
|
4250
|
-
const r = t(
|
|
4251
|
-
r && r.visible && r.rotateOnAxis(new C(0,
|
|
4252
|
-
}), e(
|
|
4253
|
-
const r = t(
|
|
4240
|
+
const r = t(X);
|
|
4241
|
+
r && r.visible && r.rotateOnAxis(new C(1, 0, 0), be.degToRad(s));
|
|
4242
|
+
}), e(vn, (s = 0.1) => {
|
|
4243
|
+
const r = t(X);
|
|
4244
|
+
r && r.visible && r.rotateOnAxis(new C(0, 1, 0), be.degToRad(s));
|
|
4245
|
+
}), e(bn, (s = 0.1) => {
|
|
4246
|
+
const r = t(X);
|
|
4247
|
+
r && r.visible && r.rotateOnAxis(new C(0, 0, 1), be.degToRad(s));
|
|
4248
|
+
}), e(Ha, (s = 0.01) => {
|
|
4249
|
+
const r = t(X);
|
|
4254
4250
|
r && r.visible && (r.position.x += s);
|
|
4255
|
-
}), e(
|
|
4256
|
-
const r = t(
|
|
4251
|
+
}), e(Ks, (s = 0.01) => {
|
|
4252
|
+
const r = t(X);
|
|
4257
4253
|
r && r.visible && (r.position.y += s);
|
|
4258
4254
|
}), e(Wa, (s = 0.01) => {
|
|
4259
|
-
const r = t(
|
|
4255
|
+
const r = t(X);
|
|
4260
4256
|
r && r.visible && (r.position.z += s);
|
|
4261
|
-
}), e(
|
|
4262
|
-
const r = t(
|
|
4257
|
+
}), e(Ya, (s) => {
|
|
4258
|
+
const r = t(X);
|
|
4263
4259
|
r && r.visible && s && r.position.copy(s), console.info(r, s);
|
|
4264
4260
|
}), e(Va, (s = 0.01) => {
|
|
4265
|
-
const r = t(
|
|
4261
|
+
const r = t(X);
|
|
4266
4262
|
r && r.visible && r.scale.set(r.scale.x + s, r.scale.y + s, r.scale.z + s);
|
|
4267
|
-
}), e(
|
|
4268
|
-
const s = t(
|
|
4263
|
+
}), e(Ga, () => {
|
|
4264
|
+
const s = t(X);
|
|
4269
4265
|
s && (s.visible = !s.visible);
|
|
4270
|
-
}), e(
|
|
4271
|
-
if (!s && (s = t(
|
|
4266
|
+
}), e(Na, async (s) => {
|
|
4267
|
+
if (!s && (s = t(X)), !s)
|
|
4272
4268
|
return;
|
|
4273
4269
|
const r = s.meta || {};
|
|
4274
4270
|
return r.transform = s.matrix.toArray(), await t(Pe, JSON.stringify(r), s.meta.url);
|
|
4275
4271
|
}), e(Vs, () => {
|
|
4276
4272
|
const s = t(_).root, r = new es({ antialias: !1, logarithmicDepthBuffer: !0, stencil: !0, alpha: !0, precision: "highp" });
|
|
4277
|
-
return r.setSize(s.clientWidth, s.clientHeight), r.setPixelRatio(Math.min(devicePixelRatio, 2)), e(ct, () => r), e(
|
|
4278
|
-
}), e(
|
|
4273
|
+
return r.setSize(s.clientWidth, s.clientHeight), r.setPixelRatio(Math.min(devicePixelRatio, 2)), e(ct, () => r), e($e, () => r.domElement), r;
|
|
4274
|
+
}), e(Gs, () => {
|
|
4279
4275
|
const s = new ss(), r = 14414079;
|
|
4280
|
-
return s.background = new is(r), s.fog = new ai(r, 0), e(
|
|
4281
|
-
}), e(
|
|
4282
|
-
const r = t(V), c = t(
|
|
4276
|
+
return s.background = new is(r), s.fog = new ai(r, 0), e(B, () => s), s;
|
|
4277
|
+
}), e(Ns, () => {
|
|
4278
|
+
const r = t(V), c = t(B), u = t(_), l = new ur(t(V), u.root);
|
|
4283
4279
|
return l.screenSpacePanning = !1, l.minDistance = 0.1, l.maxDistance = 1e5, l.maxPolarAngle = 1.2, l.enableDamping = !0, l.dampingFactor = 0.07, l.zoomToCursor = !0, l.minAzimuthAngle = 0, l.maxAzimuthAngle = 0, l.addEventListener("change", () => {
|
|
4284
4280
|
const d = Math.max(l.getPolarAngle(), 0.1), h = Math.max(l.getDistance(), 0.1);
|
|
4285
|
-
l.zoomSpeed = Math.max(Math.log(h), 0) + 0.5, r.far =
|
|
4286
|
-
}), e(
|
|
4287
|
-
}), e(
|
|
4288
|
-
const s = new
|
|
4281
|
+
l.zoomSpeed = Math.max(Math.log(h), 0) + 0.5, r.far = be.clamp(h / d * 8, 100, 2e5), r.near = r.far / 1e3, r.updateProjectionMatrix(), c.fog instanceof ai && (c.fog.density = d / (h + 5) * 1 * 0.25), l.maxPolarAngle = Math.min(Math.pow(1e4 / h, 4), 1.2);
|
|
4282
|
+
}), e(Y, () => l), e(ft, () => r.fov), e(Be, (d = !1) => d ? r.position.clone() : r.position), e(Ce, (d = !1) => d ? l.target.clone() : l.target), e(Ne, (d = !1) => d ? r.up.clone() : r.up), l;
|
|
4283
|
+
}), e(Xs, () => {
|
|
4284
|
+
const s = new va(16777215, 1);
|
|
4289
4285
|
return s.position.set(0, 2e3, 1e3), s;
|
|
4290
4286
|
}), window.addEventListener("beforeunload", () => t(Wt));
|
|
4291
4287
|
}
|
|
@@ -4303,50 +4299,50 @@ class _r {
|
|
|
4303
4299
|
}
|
|
4304
4300
|
}
|
|
4305
4301
|
function Ir(i) {
|
|
4306
|
-
const e = (w, I,
|
|
4302
|
+
const e = (w, I, v) => i.on(w, I, v), t = (w, ...I) => i.fire(w, ...I), n = t($e);
|
|
4307
4303
|
let a = /* @__PURE__ */ new Set(), o, s = new _r();
|
|
4308
|
-
e(
|
|
4304
|
+
e(Yt, () => {
|
|
4309
4305
|
if (a.size)
|
|
4310
4306
|
if (a.has("KeyH")) {
|
|
4311
|
-
const w = t(
|
|
4307
|
+
const w = t(X);
|
|
4312
4308
|
w && (w.visible = !w.visible), a.clear();
|
|
4313
4309
|
} else if (a.has("Equal")) {
|
|
4314
|
-
const w = t(
|
|
4310
|
+
const w = t(X);
|
|
4315
4311
|
if (!w || !w.visible)
|
|
4316
4312
|
return a.clear();
|
|
4317
4313
|
if (a.has("KeyX")) {
|
|
4318
|
-
const I =
|
|
4314
|
+
const I = be.degToRad(0.1);
|
|
4319
4315
|
w.rotateOnAxis(new C(1, 0, 0), I);
|
|
4320
4316
|
} else
|
|
4321
4317
|
w.scale.set(w.scale.x + 0.01, w.scale.y + 0.01, w.scale.z + 0.01);
|
|
4322
4318
|
} else if (a.has("Minus")) {
|
|
4323
|
-
const w = t(
|
|
4319
|
+
const w = t(X);
|
|
4324
4320
|
if (!w || !w.visible)
|
|
4325
4321
|
return a.clear();
|
|
4326
4322
|
if (a.has("KeyX")) {
|
|
4327
|
-
const I =
|
|
4323
|
+
const I = be.degToRad(-0.1);
|
|
4328
4324
|
w.rotateOnAxis(new C(1, 0, 0), I);
|
|
4329
4325
|
} else
|
|
4330
4326
|
w.scale.set(w.scale.x - 0.01, w.scale.y - 0.01, w.scale.z - 0.01);
|
|
4331
4327
|
} else if (a.has("ArrowUp")) {
|
|
4332
|
-
const w = t(
|
|
4328
|
+
const w = t(X);
|
|
4333
4329
|
w && w.visible && (w.position.z += 0.1);
|
|
4334
4330
|
} else if (a.has("ArrowDown")) {
|
|
4335
|
-
const w = t(
|
|
4331
|
+
const w = t(X);
|
|
4336
4332
|
w && w.visible && (w.position.z -= 0.1);
|
|
4337
4333
|
} else if (a.has("ArrowRight")) {
|
|
4338
|
-
const w = t(
|
|
4334
|
+
const w = t(X);
|
|
4339
4335
|
w && w.visible && (w.position.x += 0.1);
|
|
4340
4336
|
} else if (a.has("ArrowLeft")) {
|
|
4341
|
-
const w = t(
|
|
4337
|
+
const w = t(X);
|
|
4342
4338
|
w && w.visible && (w.position.x -= 0.1);
|
|
4343
4339
|
} else if (a.has("KeyU")) {
|
|
4344
|
-
const w = t(
|
|
4340
|
+
const w = t(X);
|
|
4345
4341
|
if (w) {
|
|
4346
4342
|
const I = w.meta || {};
|
|
4347
4343
|
I.transform = w.matrix.toArray();
|
|
4348
4344
|
}
|
|
4349
|
-
} else a.has("KeyQ") ? t(
|
|
4345
|
+
} else a.has("KeyQ") ? t(Sn, 0.1) : a.has("KeyW") ? t(vn, 0.1) : a.has("KeyE") ? t(bn, 0.1) : a.has("KeyA") ? t(Sn, -0.1) : a.has("KeyS") ? t(vn, -0.1) : a.has("KeyD") ? t(bn, -0.1) : a.has("KeyY") ? t(Ks, a.has("ShiftLeft") || a.has("ShiftRight") ? -0.1 : 0.1) : a.has("KeyC") && console.info("position=", t(Be).toArray(), "lookat=", t(Ce).toArray());
|
|
4350
4346
|
});
|
|
4351
4347
|
const r = (w) => {
|
|
4352
4348
|
console.info(w.code), w.target.type !== "text" && (o || w.code === "F5" || (w.preventDefault(), a.add(w.code)));
|
|
@@ -4359,31 +4355,31 @@ function Ir(i) {
|
|
|
4359
4355
|
}, d = async (w) => {
|
|
4360
4356
|
w.preventDefault();
|
|
4361
4357
|
};
|
|
4362
|
-
let h, f, p,
|
|
4363
|
-
e(
|
|
4364
|
-
h?.dispose(), f?.dispose(), p?.dispose(),
|
|
4358
|
+
let h, f, p, y;
|
|
4359
|
+
e(qe, () => {
|
|
4360
|
+
h?.dispose(), f?.dispose(), p?.dispose(), y?.dispose(), h = null, f = null, p = null, y = null, s.lastMovePoint = null, t(Te);
|
|
4365
4361
|
});
|
|
4366
4362
|
const g = async (w) => {
|
|
4367
4363
|
parent && setTimeout(() => window.focus()), w.preventDefault(), !o && (s.down = w.button === 2 ? 2 : 1, s.move = !1, s.isDbClick = Date.now() - s.downTime < 300, s.downTime = Date.now());
|
|
4368
4364
|
}, m = async (w) => {
|
|
4369
4365
|
w.preventDefault(), !o && s.down && (s.move = !0);
|
|
4370
|
-
},
|
|
4366
|
+
}, x = async (w) => {
|
|
4371
4367
|
w.preventDefault(), !o && (s.down = 0, s.move = !1);
|
|
4372
4368
|
};
|
|
4373
|
-
function
|
|
4369
|
+
function b(w) {
|
|
4374
4370
|
w.preventDefault(), !o && (s.down = w.touches.length, s.down === 1 && (s.move = !1, s.x = w.touches[0].clientX, s.y = w.touches[0].clientY));
|
|
4375
4371
|
}
|
|
4376
|
-
function
|
|
4372
|
+
function S(w) {
|
|
4377
4373
|
w.touches.length === 1 && (s.move = !0);
|
|
4378
4374
|
}
|
|
4379
4375
|
function T(w) {
|
|
4380
4376
|
s.down === 1 && !s.move && t(it, s.x, s.y);
|
|
4381
4377
|
}
|
|
4382
|
-
window.addEventListener("keydown", r), window.addEventListener("keyup", c), window.addEventListener("blur", u), window.addEventListener("wheel", l, { passive: !1 }), n.addEventListener("contextmenu", d), n.addEventListener("mousedown", g), n.addEventListener("mousemove", m), n.addEventListener("mouseup",
|
|
4383
|
-
o = !0, window.removeEventListener("keydown", r), window.removeEventListener("keyup", c), window.removeEventListener("blur", u), window.removeEventListener("wheel", l), n.removeEventListener("contextmenu", d), n.removeEventListener("mousedown", g), n.removeEventListener("mousemove", m), n.removeEventListener("mouseup",
|
|
4384
|
-
}), e(it, async (w, I) => await t(
|
|
4378
|
+
window.addEventListener("keydown", r), window.addEventListener("keyup", c), window.addEventListener("blur", u), window.addEventListener("wheel", l, { passive: !1 }), n.addEventListener("contextmenu", d), n.addEventListener("mousedown", g), n.addEventListener("mousemove", m), n.addEventListener("mouseup", x), n.addEventListener("touchstart", b, { passive: !1 }), n.addEventListener("touchmove", S, { passive: !1 }), n.addEventListener("touchend", T, { passive: !1 }), e(Rn, () => {
|
|
4379
|
+
o = !0, window.removeEventListener("keydown", r), window.removeEventListener("keyup", c), window.removeEventListener("blur", u), window.removeEventListener("wheel", l), n.removeEventListener("contextmenu", d), n.removeEventListener("mousedown", g), n.removeEventListener("mousemove", m), n.removeEventListener("mouseup", x), n.removeEventListener("touchstart", b), n.removeEventListener("touchmove", S), n.removeEventListener("touchend", T);
|
|
4380
|
+
}), e(it, async (w, I) => await t(Ft, w, I));
|
|
4385
4381
|
}
|
|
4386
|
-
var
|
|
4382
|
+
var Ge = Object.freeze({
|
|
4387
4383
|
Linear: Object.freeze({
|
|
4388
4384
|
None: function(i) {
|
|
4389
4385
|
return i;
|
|
@@ -4502,13 +4498,13 @@ var Ne = Object.freeze({
|
|
|
4502
4498
|
}),
|
|
4503
4499
|
Bounce: Object.freeze({
|
|
4504
4500
|
In: function(i) {
|
|
4505
|
-
return 1 -
|
|
4501
|
+
return 1 - Ge.Bounce.Out(1 - i);
|
|
4506
4502
|
},
|
|
4507
4503
|
Out: function(i) {
|
|
4508
4504
|
return i < 1 / 2.75 ? 7.5625 * i * i : i < 2 / 2.75 ? 7.5625 * (i -= 1.5 / 2.75) * i + 0.75 : i < 2.5 / 2.75 ? 7.5625 * (i -= 2.25 / 2.75) * i + 0.9375 : 7.5625 * (i -= 2.625 / 2.75) * i + 0.984375;
|
|
4509
4505
|
},
|
|
4510
4506
|
InOut: function(i) {
|
|
4511
|
-
return i < 0.5 ?
|
|
4507
|
+
return i < 0.5 ? Ge.Bounce.In(i * 2) * 0.5 : Ge.Bounce.Out(i * 2 - 1) * 0.5 + 0.5;
|
|
4512
4508
|
}
|
|
4513
4509
|
}),
|
|
4514
4510
|
generatePow: function(i) {
|
|
@@ -4596,7 +4592,7 @@ var Ne = Object.freeze({
|
|
|
4596
4592
|
/** @class */
|
|
4597
4593
|
function() {
|
|
4598
4594
|
function i(e, t) {
|
|
4599
|
-
this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction =
|
|
4595
|
+
this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = Ge.Linear.None, this._interpolationFunction = En.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = ra.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1, this._object = e, typeof t == "object" ? (this._group = t, t.add(this)) : t === !0 && (this._group = _n, _n.add(this));
|
|
4600
4596
|
}
|
|
4601
4597
|
return i.prototype.getId = function() {
|
|
4602
4598
|
return this._id;
|
|
@@ -4643,12 +4639,12 @@ var Ne = Object.freeze({
|
|
|
4643
4639
|
if (d.length === 0)
|
|
4644
4640
|
continue;
|
|
4645
4641
|
for (var h = [r], f = 0, p = d.length; f < p; f += 1) {
|
|
4646
|
-
var
|
|
4647
|
-
if (isNaN(
|
|
4642
|
+
var y = this._handleRelativeValue(r, d[f]);
|
|
4643
|
+
if (isNaN(y)) {
|
|
4648
4644
|
l = !1, console.warn("Found invalid interpolation list. Skipping.");
|
|
4649
4645
|
break;
|
|
4650
4646
|
}
|
|
4651
|
-
h.push(
|
|
4647
|
+
h.push(y);
|
|
4652
4648
|
}
|
|
4653
4649
|
l && (n[s] = h);
|
|
4654
4650
|
}
|
|
@@ -4660,10 +4656,10 @@ var Ne = Object.freeze({
|
|
|
4660
4656
|
a[s] = c ? [] : {};
|
|
4661
4657
|
var d = n[s];
|
|
4662
4658
|
if (!this._isDynamic) {
|
|
4663
|
-
var
|
|
4659
|
+
var x = {};
|
|
4664
4660
|
for (var m in d)
|
|
4665
|
-
|
|
4666
|
-
n[s] = d =
|
|
4661
|
+
x[m] = d[m];
|
|
4662
|
+
n[s] = d = x;
|
|
4667
4663
|
}
|
|
4668
4664
|
this._setupProperties(g, t[s], d, a[s], o);
|
|
4669
4665
|
} else
|
|
@@ -4696,7 +4692,7 @@ var Ne = Object.freeze({
|
|
|
4696
4692
|
}, i.prototype.yoyo = function(e) {
|
|
4697
4693
|
return e === void 0 && (e = !1), this._yoyo = e, this;
|
|
4698
4694
|
}, i.prototype.easing = function(e) {
|
|
4699
|
-
return e === void 0 && (e =
|
|
4695
|
+
return e === void 0 && (e = Ge.Linear.None), this._easingFunction = e, this;
|
|
4700
4696
|
}, i.prototype.interpolation = function(e) {
|
|
4701
4697
|
return e === void 0 && (e = En.Linear), this._interpolationFunction = e, this;
|
|
4702
4698
|
}, i.prototype.chain = function() {
|
|
@@ -4731,7 +4727,7 @@ var Ne = Object.freeze({
|
|
|
4731
4727
|
var s = e - this._startTime, r = this._duration + ((a = this._repeatDelayTime) !== null && a !== void 0 ? a : this._delayTime), c = this._duration + this._repeat * r, u = function() {
|
|
4732
4728
|
if (n._duration === 0 || s > c)
|
|
4733
4729
|
return 1;
|
|
4734
|
-
var
|
|
4730
|
+
var y = Math.trunc(s / r), g = s - y * r, m = Math.min(g / n._duration, 1);
|
|
4735
4731
|
return m === 0 && s === n._duration ? 1 : m;
|
|
4736
4732
|
}, l = u(), d = this._easingFunction(l);
|
|
4737
4733
|
if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, d), this._onUpdateCallback && this._onUpdateCallback(this._object, l), this._duration === 0 || s >= this._duration)
|
|
@@ -4779,7 +4775,7 @@ class Lr extends te {
|
|
|
4779
4775
|
async addScene(e) {
|
|
4780
4776
|
const t = this, { renderer: n, scene: a, controls: o, tileMap: s } = t.mapViewer;
|
|
4781
4777
|
fetch(e, { mode: "cors", credentials: "omit", cache: "reload" }).then((r) => r.ok ? r.json() : {}).then((r) => {
|
|
4782
|
-
const c = new
|
|
4778
|
+
const c = new Ke();
|
|
4783
4779
|
if (r.transform)
|
|
4784
4780
|
c.fromArray(r.transform);
|
|
4785
4781
|
else if (r.WGS84) {
|
|
@@ -4803,7 +4799,7 @@ class Lr extends te {
|
|
|
4803
4799
|
if (a)
|
|
4804
4800
|
return;
|
|
4805
4801
|
const s = t.position, r = e.controls, c = r.object.position.clone(), u = Ji ? 6 : 2, l = s.clone().sub(c).normalize(), d = s.clone().sub(l.multiplyScalar(u)), h = { x: c.x, y: c.y, z: c.z, tx: r.target.x, ty: r.target.y, tz: r.target.z }, f = { x: d.x, y: d.y, z: d.z, tx: s.x, ty: s.y, tz: s.z };
|
|
4806
|
-
a = new Pr(h).to(f, 3e3), a.easing(
|
|
4802
|
+
a = new Pr(h).to(f, 3e3), a.easing(Ge.Sinusoidal.InOut).start().onUpdate(() => {
|
|
4807
4803
|
const p = h.y < 0.1 ? 0.1 : h.y;
|
|
4808
4804
|
r.object.position.set(h.x, p, h.z), r.target.set(h.tx, h.ty, h.tz);
|
|
4809
4805
|
}).onComplete(() => {
|
|
@@ -4833,7 +4829,7 @@ class Lr extends te {
|
|
|
4833
4829
|
const l = new pe(u);
|
|
4834
4830
|
t.splatMesh = l, t.opts.scene.add(l), l.applyMatrix4(t.opts.matrix), l.meta = c;
|
|
4835
4831
|
const d = c.watermark || c.name || "";
|
|
4836
|
-
c.showWatermark = c.showWatermark !== !1, l.fire(
|
|
4832
|
+
c.showWatermark = c.showWatermark !== !1, l.fire(Hn, d, !0, !1), l.addModel({ url: t.meta.url }, t.meta);
|
|
4837
4833
|
}
|
|
4838
4834
|
}
|
|
4839
4835
|
}, t.onAfterRender = () => {
|
|
@@ -4850,24 +4846,24 @@ class Lr extends te {
|
|
|
4850
4846
|
e.disposed || (e.disposed = !0, e.opts.scene.remove(e.css3dTag), e.splatMesh?.dispose(), e.meta = null, e.splatMesh = null, e.opts = null, e.css3dTag = null, e.mapViewer = null);
|
|
4851
4847
|
}
|
|
4852
4848
|
}
|
|
4853
|
-
class Ur extends
|
|
4849
|
+
class Ur extends ba {
|
|
4854
4850
|
constructor(e = {}) {
|
|
4855
|
-
console.info("Reall3dMapViewer", Vt), super(), this.clock = new
|
|
4856
|
-
const t = this, n = new
|
|
4851
|
+
console.info("Reall3dMapViewer", Vt), super(), this.clock = new xa(), this.updateTime = 0, this.disposed = !1;
|
|
4852
|
+
const t = this, n = new Xn();
|
|
4857
4853
|
t.events = n;
|
|
4858
4854
|
const a = (r, c, u) => n.on(r, c, u), o = (r, ...c) => n.fire(r, ...c);
|
|
4859
4855
|
t.tileMap = Er();
|
|
4860
4856
|
const s = kr(e);
|
|
4861
|
-
a(_, () => s),
|
|
4862
|
-
o(Lt), t.controls.update(), o(
|
|
4857
|
+
a(_, () => s), qn(n), Jn(n), Tr(n), aa(n), oa(n), t.camera = new ts(60, 1, 0.01, 1e4), a(V, () => t.camera), t.container = s.root, t.renderer = o(Vs), t.scene = o(Gs), t.controls = o(Ns), t.ambLight = new as(16777215, 1), t.scene.add(t.ambLight), t.dirLight = o(Xs), t.scene.add(t.dirLight), t.scene.add(t.tileMap), t.container.appendChild(t.renderer.domElement), window.addEventListener("resize", t.resize.bind(t)), t.resize(), t.renderer.setAnimationLoop(t.animate.bind(t)), Ir(n), a(Wt, () => t.dispose()), a(Ve, () => {
|
|
4858
|
+
o(Lt), t.controls.update(), o($s), o(Yt);
|
|
4863
4859
|
}, !0), a(lt, () => {
|
|
4864
4860
|
t.dispatchEvent({ type: "update", delta: t.clock.getDelta() }), t.updateTime = Date.now(), o(re) && o(oe, {
|
|
4865
4861
|
fps: o(Pt),
|
|
4866
4862
|
realFps: o(Rt),
|
|
4867
4863
|
fov: o(ft),
|
|
4868
|
-
position: o(Le, o(
|
|
4864
|
+
position: o(Le, o(Be)),
|
|
4869
4865
|
lookAt: o(Le, o(Ce)),
|
|
4870
|
-
lookUp: o(Le, o(
|
|
4866
|
+
lookUp: o(Le, o(Ne))
|
|
4871
4867
|
});
|
|
4872
4868
|
}, !0), a(Oe, () => {
|
|
4873
4869
|
t.tileMap.update(t.camera);
|
|
@@ -4914,10 +4910,10 @@ class Ur extends xa {
|
|
|
4914
4910
|
return;
|
|
4915
4911
|
e.disposed = !0;
|
|
4916
4912
|
const t = e.renderer.domElement;
|
|
4917
|
-
e.events.fire(
|
|
4913
|
+
e.events.fire(Qn), e.events.fire(Zs), e.renderer.clear(), e.renderer.dispose(), e.events.clear(), e.scene = null, e.renderer = null, e.camera = null, e.controls = null, e.ambLight = null, e.dirLight = null, e.container.removeChild(t), e.container.classList.add("hidden"), e.container = null, e.clock = null, e.events = null, e.tileMap = null;
|
|
4918
4914
|
}
|
|
4919
4915
|
}
|
|
4920
4916
|
export {
|
|
4921
4917
|
Ur as Reall3dMapViewer,
|
|
4922
|
-
|
|
4918
|
+
Br as Reall3dViewer
|
|
4923
4919
|
};
|