@reall3d/reall3dviewer 0.1.0 → 0.1.1
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/README.md +1 -0
- package/dist/pkg.d.ts +12 -0
- package/dist/pkg.js +632 -632
- package/dist/pkg.umd.cjs +13 -13
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/pkg.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { Vector3 as C, InstancedBufferGeometry as rn, BufferAttribute as He, InstancedBufferAttribute as ca, DynamicDrawUsage as la, ShaderMaterial as
|
|
2
|
-
import * as
|
|
1
|
+
import { Vector3 as C, InstancedBufferGeometry as rn, BufferAttribute as He, InstancedBufferAttribute as ca, DynamicDrawUsage as la, ShaderMaterial as In, DoubleSide as ve, NormalBlending as da, DataTexture as _e, RGBAIntegerFormat as Ie, UnsignedIntType as De, Mesh as te, Vector4 as Se, Vector2 as j, WebGLRenderer as ns, PerspectiveCamera as is, Object3D as Dn, CylinderGeometry as ni, MeshBasicMaterial as Me, PlaneGeometry as ua, Quaternion as _t, Controls as ha, MOUSE as Ae, TOUCH as be, Spherical as ii, Ray as pa, Plane as fa, MathUtils as xe, Float32BufferAttribute as si, InstancedInterleavedBuffer as cn, InterleavedBufferAttribute as We, WireframeGeometry as ga, Box3 as Pn, Sphere as tt, ShaderLib as bt, UniformsUtils as ss, UniformsLib as xt, Line3 as ma, Matrix4 as $e, CircleGeometry as Pe, Group as Qt, BufferGeometry as ya, Raycaster as Aa, SphereGeometry as wa, Color as Ln, FrontSide as va, CatmullRomCurve3 as ai, Scene as as, AmbientLight as os, FogExp2 as oi, DirectionalLight as Sa, EventDispatcher as ba, Clock as xa } from "three";
|
|
2
|
+
import * as ri from "@gotoeasy/three-tile";
|
|
3
3
|
let A = 1;
|
|
4
|
-
const at = A++,
|
|
4
|
+
const at = A++, Fn = A++, Le = A++, rs = A++, ln = A++, dn = A++, cs = A++, Gt = A++, ls = A++, Ke = A++, V = A++, Y = A++, ds = A++, un = A++, we = A++, Ne = A++, Ce = A++, ft = A++, us = A++, hs = A++, ps = A++, Ca = A++, fs = A++, gs = A++, Rn = A++, Ma = A++, Ta = A++, ci = A++, q = A++;
|
|
5
5
|
A++;
|
|
6
|
-
const oe = A++, ot = A++, Ye = A++,
|
|
6
|
+
const oe = A++, ot = A++, Ye = A++, li = A++, di = A++, ui = A++, ms = A++, ka = A++, hi = A++, Nt = A++, Xt = A++, pi = A++, fi = A++, gi = A++, nt = A++, mi = A++, rt = A++, ys = A++, gt = A++, $t = A++, Ct = A++, As = A++, hn = A++, Ea = A++, Bn = A++, yi = A++, Ai = A++, It = A++, Dt = A++, Pt = A++, Lt = A++, ws = A++, Un = A++, I = A++, Ue = A++, ct = A++, B = A++, Ht = A++, vs = A++, _a = A++, ee = A++, pn = A++, re = A++, Ss = A++, bs = A++, xs = A++, Cs = A++, fn = A++, Ms = A++, Fe = A++, Ts = A++, ks = A++, Mt = A++, Ia = A++, Es = A++, _s = A++;
|
|
7
7
|
A++;
|
|
8
|
-
const Wt = A++, Kt = A++,
|
|
8
|
+
const Wt = A++, Kt = A++, wi = A++, vi = A++, gn = A++, Ft = A++, mn = A++, it = A++, ce = A++, On = A++, Is = A++, Da = A++, yn = A++, Si = A++, bi = A++, Pa = A++, La = A++, Tt = A++, Rt = A++, zn = A++, Ve = A++, Oe = A++, lt = A++, mt = A++, Ds = A++, N = A++, J = A++, Fa = A++, xi = A++, Bt = A++, Ut = A++, Ra = A++, Qn = A++, Hn = A++, Te = A++, st = A++, Ze = A++, Ba = A++, Ps = A++, Ua = A++;
|
|
9
9
|
A++;
|
|
10
10
|
A++;
|
|
11
11
|
A++;
|
|
12
12
|
A++;
|
|
13
13
|
A++;
|
|
14
|
-
const
|
|
14
|
+
const ke = A++, dt = A++, kt = A++, An = A++, Ls = A++, Fs = A++, wn = A++, Ee = A++, qe = A++, Rs = A++, Wn = A++, Ci = A++, Oa = A++, za = A++, Yn = A++, Bs = A++, Vn = A++, Gn = A++, Nn = A++, Ot = A++, Us = A++, Mi = A++, zt = A++, ye = A++, Os = A++, zs = A++;
|
|
15
15
|
A++;
|
|
16
|
-
const Je = A++, Qs = A++, Hs = A++,
|
|
16
|
+
const Je = A++, Qs = A++, Hs = A++, Xn = A++, Ws = A++, Qa = A++, Ys = A++, Ti = A++, Vs = A++, Gs = A++;
|
|
17
17
|
A++;
|
|
18
|
-
const Ns = A++, Xs = A++, X = A++,
|
|
18
|
+
const Ns = A++, Xs = A++, X = A++, vn = A++, Sn = A++, bn = A++, Ha = A++, $s = A++, Wa = A++, Ya = A++, Va = A++, Ga = A++, Na = A++, Ks = A++, Zs = A++;
|
|
19
19
|
A++;
|
|
20
20
|
A++;
|
|
21
21
|
A++;
|
|
22
22
|
A++;
|
|
23
23
|
A++;
|
|
24
|
-
class
|
|
24
|
+
class $n {
|
|
25
25
|
constructor() {
|
|
26
26
|
this.map = /* @__PURE__ */ new Map();
|
|
27
27
|
}
|
|
@@ -67,7 +67,7 @@ class $a {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
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 || {});
|
|
70
|
-
const Yt = "v1.5.0-dev-pkg", le = navigator.userAgent.includes("Mobi"), Ka = "QWERTYUIOPLKJHGFDSAZXCVBNM1234567890qwertyuioplkjhgfdsazxcvbnm`~!@#$%^&*()-_=+\\|]}[{'\";::,<.>//? ", ze = 128, Za = 32, R = 32, ja = 20, qa = 16, js = 64 * 1024, Ja = 1024 * 1e4, eo = 10240 * 1e4, Et = 0.28209479177387814, to = 0, no = 20,
|
|
70
|
+
const Yt = "v1.5.0-dev-pkg", le = navigator.userAgent.includes("Mobi"), Ka = "QWERTYUIOPLKJHGFDSAZXCVBNM1234567890qwertyuioplkjhgfdsazxcvbnm`~!@#$%^&*()-_=+\\|]}[{'\";::,<.>//? ", ze = 128, Za = 32, R = 32, ja = 20, qa = 16, js = 64 * 1024, Ja = 1024 * 1e4, eo = 10240 * 1e4, Et = 0.28209479177387814, to = 0, no = 20, Kn = 1, ut = 2, Zn = 3, io = 3141592653, jn = "AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEeBmABfQF9YAAAYAF9AX9gAX8Bf2ACf38AYAJ/fwF/AhoCA2VudgRleHBmAAADZW52Bm1lbW9yeQIAAAMGBQECAwQFByEEEV9fd2FzbV9jYWxsX2N0b3JzAAEBSAADAXcABAFEAAUKigsFAwABC3IBBH8gALwiBEH///8DcSEBAkAgBEEXdkH/AXEiAkUNACACQfAATQRAIAFBgICABHJB8QAgAmt2IQEMAQsgAkGNAUsEQEGA+AEhA0EAIQEMAQsgAkEKdEGAgAdrIQMLIAMgBEEQdkGAgAJxciABQQ12cgsyAQJ/QcGmFiEBA0AgACACai0AACABQSFscyEBIAJBAWoiAkH8AEcNAAsgASAAKAJ8RwszACAAQQhBBCABQQFGG2pBADYCACAAQQA2ABwgAP0MAAABAIwRFgCVAWwS7YEyE/0LAgwLqQkDKH8OfQR8IAEoAgRBi/AJRgR/IAEoAgAiBEEASgRAIAFBCWoiAiAEQRNsaiEIIAIgBEESbGohCSACIARBEWxqIQogAiAEQQR0aiELIAIgBEEPbGohDCACIARBDmxqIQ0gAiAEQQ1saiEOIAIgBEEMbGohDyACIARBC2xqIRAgAiAEQQpsaiERIAIgBEEJbGohEiACIARBBmxqIRMgAiAEQQNsaiEUIAEtAAghFUEAIQIDQCACIAlqLQAAIQcgAiAKai0AACEWIAIgC2otAAAhFyACIAxqLQAAIRggAiANai0AACEZIAIgDmotAAAhGiACIA9qLQAAIRsgAiAQai0AACEcIAIgEWotAAAhHSACIBJqLQAAIR4gEyACQQNsIgNqIgUtAAAhHyADIBRqIgYtAAAhICABIANqIgMtAAohISADLQAJISIgBS0AASEjIAYtAAEhJCADLQALIiXAISYgBS0AAiInwCEoIAYtAAIiBsAhKUEAIQUgFQRAIAggAkEBdGoiAy0AASIFQQh0QYD+AXEgAy0AAHIgBUEJdEGAgARxciEFCyAes0MAAIA9lEMAACDBkhAAIS8gHbNDAACAPZRDAAAgwZIQACExIByzQwAAgD2UQwAAIMGSEAAhMkMAAAAAQwAAgD8gB7NDAAAAw5JDAAAAPJQiKiAqlCAXs0MAAADDkkMAAAA8lCIrICuUIBazQwAAAMOSQwAAADyUIiwgLJSSkpMiLZEgLUMAAAAAXRshLSAAIAJBBXRqIgMgIUEIdCAiciAlQRB0ciIHQYCAgHhyIAcgJkEASBuyQwAAgDmUOAIAIAMgBTYCDCADICNBCHQgH3IgJ0EQdHIiBUGAgIB4ciAFIChBAEgbskMAAIA5lDgCCCADICRBCHQgIHIgBkEQdHIiBUGAgIB4ciAFIClBAEgbskMAAIA5lDgCBCADICsgKiAqlCAsICyUIC0gLZQgKyArlJKSkpEiLpUiKyAqIC6VIiqUIjQgLSAulSIwICwgLpUiLJQiNZK7IjggOKAgMrsiOKK2Ii0gLZREAAAAAAAA8D8gLCAslCIyICogKpQiNpK7IjogOqChIC+7IjqitiIuIC6UICsgLJQiMyAwICqUIjeTuyI7IDugIDG7IjuitiIvIC+UkpJDAACAQJQQAiAtICwgKpQiMSAwICuUIjCTuyI5IDmgIDiitiIqlCAuIDMgN5K7IjkgOaAgOqK2IiyUIC9EAAAAAAAA8D8gKyArlCIzIDaSuyI5IDmgoSA7orYiK5SSkkMAAIBAlBACQRB0cjYCECADIC1EAAAAAAAA8D8gMyAykrsiOSA5oKEgOKK2Ii2UIC4gNCA1k7siOCA4oCA6orYiLpQgLyAxIDCSuyI4IDigIDuitiIvlJKSQwAAgECUEAIgKiAqlCAsICyUICsgK5SSkkMAAIBAlBACQRB0cjYCFCADIBpBCHQgG3IgGUEQdHIgGEEYdHI2AhwgAyAqIC2UICwgLpQgKyAvlJKSQwAAgECUEAIgLSAtlCAuIC6UIC8gL5SSkkMAAIBAlBACQRB0cjYCGCACQQFqIgIgBEcNAAsLQQAFQQELCw==", qn = "AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAEpBmACf38Bf2ABfQF9YAAAYAF9AX9gAX8Bf2ANf399fX19fX19fX19fwACGgIDZW52BGV4cGYAAQNlbnYGbWVtb3J5AgAAAwcGAgMEBQAAByEEEV9fd2FzbV9jYWxsX2N0b3JzAAEBSAADAXMABQFEAAYKnhUGAwABC3IBBH8gALwiBEH///8DcSEBAkAgBEEXdkH/AXEiAkUNACACQfAATQRAIAFBgICABHJB8QAgAmt2IQEMAQsgAkGNAUsEQEGA+AEhA0EAIQEMAQsgAkEKdEGAgAdrIQMLIAMgBEEQdkGAgAJxciABQQ12cgsyAQJ/QZWjAyEBA0AgACACai0AACABQSFscyEBIAJBAWoiAkH8AEcNAAsgASAAKAJ8RwvpAwIEfAR9IAAgAUECdGoiACACOAIAIABBADYCDCAAIAQ4AgggACADOAIEIAAgCSALIAuUIAogCpQgCCAIlCAJIAmUkpKSkSIElSICIAsgBJUiA5QiCSAIIASVIgggCiAElSIElCIKkrsiDSANoCAHuyINorYiByAHlEQAAAAAAADwPyAEIASUIgsgAyADlCISkrsiDyAPoKEgBbsiD6K2IgUgBZQgAiAElCIRIAggA5QiE5O7IhAgEKAgBrsiEKK2IgYgBpSSkkMAAIBAlBACIAcgBCADlCIUIAggApQiCJO7Ig4gDqAgDaK2IgOUIAUgESATkrsiDiAOoCAPorYiBJQgBkQAAAAAAADwPyACIAKUIhEgEpK7Ig4gDqChIBCitiIClJKSQwAAgECUEAJBEHRyNgIQIAAgB0QAAAAAAADwPyARIAuSuyIOIA6goSANorYiB5QgBSAJIAqTuyINIA2gIA+itiIFlCAGIBQgCJK7Ig0gDaAgEKK2IgaUkpJDAACAQJQQAiADIAOUIAQgBJQgAiAClJKSQwAAgECUEAJBEHRyNgIUIAAgDDYCHCAAIAMgB5QgBCAFlCACIAaUkpJDAACAQJQQAiAHIAeUIAUgBZQgBiAGlJKSQwAAgECUEAJBEHRyNgIYC70BAQJ/IAFBAEoEQANAIAAgA0EDdCAAIANBBXRqIgIqAgAgAioCBCACKgIIIAIqAgwgAioCECACKgIUIAItABy4RAAAAAAAAGDAoEQAAAAAAACAP6K2IAItAB24RAAAAAAAAGDAoEQAAAAAAACAP6K2IAItAB64RAAAAAAAAGDAoEQAAAAAAACAP6K2IAItAB+4RAAAAAAAAGDAoEQAAAAAAACAP6K2IAIoAhgQBCADQQFqIgMgAUcNAAsLQQALxw4BHH8CfwJAAkACQAJAAkAgASgCBCICQQFrDgMBAgMAC0EBIAJBFEcNBBogASgCACIDQQBKBEAgAUEIaiICIANBE2xqIQUgAiADQRJsaiEGIAIgA0ERbGohCCACIANBBHRqIQkgAiADQQ9saiEKIAIgA0EObGohCyACIANBDWxqIQwgAiADQQxsaiENIAIgA0ELbGohDiACIANBCmxqIQ8gAiADQQlsaiEQIAIgA0EGbGohESACIANBA2xqIRJBACECA0AgAiAMai0AACETIAIgDWotAAAhFCACIAtqLQAAIRUgAiAKai0AACEWIAIgBWotAAAhFyACIAZqLQAAIRggAiAIai0AACEZIAIgCWotAAAhGyACIA5qLQAAIRwgAiAPai0AACEdIAAgAkEDdCABIAJBA2wiBGoiBy8ACCAHLAAKIgdB/wFxQRB0ciIaQYCAgHhyIBogB0EASBuyQwAAgDmUIAQgEmoiBy8AACAHLAACIgdB/wFxQRB0ciIaQYCAgHhyIBogB0EASBuyQwAAgDmUIAQgEWoiBC8AACAELAACIgRB/wFxQRB0ciIHQYCAgHhyIAcgBEEASBuyQwAAgDmUIAIgEGotAACzQwAAgD2UQwAAIMGSEAAgHbNDAACAPZRDAAAgwZIQACAcs0MAAIA9lEMAACDBkhAAIBu4RAAAAAAAAGDAoEQAAAAAAACAP6K2IBm4RAAAAAAAAGDAoEQAAAAAAACAP6K2IBi4RAAAAAAAAGDAoEQAAAAAAACAP6K2IBe4RAAAAAAAAGDAoEQAAAAAAACAP6K2IBQgE0EIdHIgFUEQdHIgFkEYdHIQBCACQQFqIgIgA0cNAAsLDAMLIAEoAgAiBUEASgRAA0AgASADQQlsaiICLQANIQYgAi0ADCEIIAItAAshCSACLQAKIQogAi0ACSELIAItAAghDCACLQAQIQ0gAi0ADyEOIAItAA4hAiAAIANBBHRqIgRCgICAgBA3AgggBCANQRB0QYCA4AdxIA5BFXRBgICA+AFxIAJBGnRBgICAgH5xcnI2AgQgBCAGQQF2QfwAcSAIQQR0QYAfcSAJQQl0QYDgB3EgCkEOdEGAgPgBcSALQRN0QYCAgD5xIAxBGHRBgICAQHFycnJyciACQQZ2cjYCACADQQFqIgMgBUcNAAsLDAILIAEoAgAiCEEASgRAA0AgASADQRhsaiICLQAaIQkgAi0AGSEKIAItABghCyACLQAXIQwgAi0AFiENIAItABUhDiACLQANIQ8gAi0ADCEQIAItAAshESACLQAKIRIgAi0ACSETIAItAAghFCACLQAUIQUgAi0AEyEVIAItABIhFiACLQARIRcgAi0AECEYIAItAA8hGSACLQAOIQYgACADQQR0aiIEIAItAB9BBXRBgD5xIAItAB5BCnRBgMAPcSACLQAdQQ90QYCA8ANxIAItABxBFHRBgICA/ABxIAItABsiAkEZdEGAgICAf3FycnJyQQFyNgIMIAQgFUEBdEHwA3EgFkEGdEGA/ABxIBdBC3RBgIAfcSAYQRB0QYCA4AdxIBlBFXRBgICA+AFxIAZBGnRBgICAgH5xcnJycnIgBUEEdnI2AgQgBCAPQQF2QfwAcSAQQQR0QYAfcSARQQl0QYDgB3EgEkEOdEGAgPgBcSATQRN0QYCAgD5xIBRBGHRBgICAQHFycnJyciAGQQZ2cjYCACAEIAlBAnZBPnEgCkEDdEHAD3EgC0EIdEGA8ANxIAxBDXRBgID8AHEgDUESdEGAgIAfcSAOQRd0QYCAgOAHcSAFQRx0QYCAgIB4cXJycnJyciACQQd2cjYCCCADQQFqIgMgCEcNAAsLDAELIAEoAgAiCEEASgRAA0AgASADQRVsaiICLQAaIQkgAi0AGSEKIAItABghCyACLQAXIQwgAi0AFiENIAItABUhDiACLQANIQ8gAi0ADCEQIAItAAshESACLQAKIRIgAi0ACSETIAItAAghFCACLQAUIQUgAi0AEyEVIAItABIhFiACLQARIRcgAi0AECEYIAItAA8hGSACLQAOIQYgACADQQR0aiIEIAItABxBFHRBgICA/ABxIAItABsiAkEZdEGAgICAf3FyQQFyNgIMIAQgFUEBdEHwA3EgFkEGdEGA/ABxIBdBC3RBgIAfcSAYQRB0QYCA4AdxIBlBFXRBgICA+AFxIAZBGnRBgICAgH5xcnJycnIgBUEEdnI2AgQgBCAPQQF2QfwAcSAQQQR0QYAfcSARQQl0QYDgB3EgEkEOdEGAgPgBcSATQRN0QYCAgD5xIBRBGHRBgICAQHFycnJyciAGQQZ2cjYCACAEIAlBAnZBPnEgCkEDdEHAD3EgC0EIdEGA8ANxIAxBDXRBgID8AHEgDUESdEGAgIAfcSAOQRd0QYCAgOAHcSAFQRx0QYCAgIB4cXJycnJyciACQQd2cjYCCCADQQFqIgMgCEcNAAsLC0EACws=";
|
|
71
71
|
async function so(i) {
|
|
72
72
|
const e = new Uint32Array(i.buffer), t = new Float32Array(i.buffer), n = new Xa();
|
|
73
73
|
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];
|
|
@@ -76,22 +76,22 @@ async function so(i) {
|
|
|
76
76
|
a += String.fromCharCode(i[h]);
|
|
77
77
|
if (n.Comment = a.trim(), n.HashCheck = !0, n.Fixed !== "spx" && n.Version !== 1)
|
|
78
78
|
return null;
|
|
79
|
-
const o = n.CreaterId == 1202056903 ?
|
|
79
|
+
const o = n.CreaterId == 1202056903 ? qn : jn, 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: Vt } })).exports.H;
|
|
80
80
|
return new Uint8Array(r.buffer).set(i, 0), u(0) && (n.HashCheck = !1), n;
|
|
81
81
|
}
|
|
82
82
|
async function fe(i) {
|
|
83
|
-
const e = new Uint32Array(i.slice(0, 8).buffer), t = e[0], n = e[1], a =
|
|
84
|
-
return g.set(i,
|
|
83
|
+
const e = new Uint32Array(i.slice(0, 8).buffer), t = e[0], n = e[1], a = Kn == n, o = ut == n, s = Zn == n, r = a || o || s, c = !r, u = n == 20 || r ? qn : jn, d = t * (r ? qa : R), l = WebAssembly.compile(Uint8Array.from(atob(u), (M) => M.charCodeAt(0)).buffer), h = Math.floor((d + i.byteLength) / js) + 2, f = new WebAssembly.Memory({ initial: h, maximum: h }), m = (await WebAssembly.instantiate(await l, { env: { memory: f, expf: Vt } })).exports.D, g = new Uint8Array(f.buffer);
|
|
84
|
+
return g.set(i, d), m(0, d) ? { splatCount: t, blockFormat: n, success: !1 } : { splatCount: t, blockFormat: n, success: !0, datas: g.slice(0, d), isSplat: c, isSh: r, isSh1: a, isSh2: o, isSh3: s };
|
|
85
85
|
}
|
|
86
|
-
async function
|
|
87
|
-
const t = WebAssembly.compile(Uint8Array.from(atob(
|
|
86
|
+
async function xn(i, e) {
|
|
87
|
+
const t = WebAssembly.compile(Uint8Array.from(atob(qn), (u) => u.charCodeAt(0)).buffer), n = Math.floor(e * R / js) + 2, a = new WebAssembly.Memory({ initial: n, maximum: n }), s = (await WebAssembly.instantiate(await t, { env: { memory: a, expf: Vt } })).exports.s, r = new Uint8Array(a.buffer);
|
|
88
88
|
r.set(i.slice(0, e * R), 0);
|
|
89
89
|
const c = s(0, e);
|
|
90
90
|
return c ? (console.error("splat data parser failed:", c), new Uint8Array(0)) : r.slice(0, e * R);
|
|
91
91
|
}
|
|
92
92
|
async function ao(i, e, t = !0, n = !0) {
|
|
93
|
-
const a = WebAssembly.compile(Uint8Array.from(atob(
|
|
94
|
-
return u[0] = i, t ? u[1] =
|
|
93
|
+
const a = WebAssembly.compile(Uint8Array.from(atob(jn), (l) => l.charCodeAt(0)).buffer), o = new WebAssembly.Memory({ initial: 1, maximum: 1 }), r = (await WebAssembly.instantiate(await a, { env: { memory: o, expf: Vt } })).exports.w, c = new Uint8Array(o.buffer), u = new Float32Array(c.buffer), d = n ? -1 : 1;
|
|
94
|
+
return u[0] = i, t ? u[1] = d * e : u[2] = d * e, r(0, t ? 1 : 0), c.slice(0, R);
|
|
95
95
|
}
|
|
96
96
|
function Vt(i) {
|
|
97
97
|
return Math.exp(i);
|
|
@@ -114,11 +114,11 @@ async function oo(i) {
|
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
i.modelSplatCount = c, i.downloadSplatCount = 0, i.splatData = new Uint8Array(Math.min(i.modelSplatCount, i.fetchLimit) * 32), i.watermarkData = new Uint8Array(0);
|
|
117
|
-
let u = new Uint8Array(32),
|
|
117
|
+
let u = new Uint8Array(32), d = 0;
|
|
118
118
|
for (; ; ) {
|
|
119
|
-
let { done:
|
|
120
|
-
if (
|
|
121
|
-
|
|
119
|
+
let { done: l, value: h } = await s.read();
|
|
120
|
+
if (l) break;
|
|
121
|
+
d + h.byteLength < i.rowLength ? (u.set(h, d), d += h.byteLength, e += h.length, i.downloadSize = e) : (d = await t(i, d, u, h), d && u.set(h.slice(h.byteLength - d), 0)), i.downloadSplatCount >= i.fetchLimit && i.abortController.abort();
|
|
122
122
|
}
|
|
123
123
|
} catch (n) {
|
|
124
124
|
n.name === "AbortError" ? (console.log("Fetch Abort", i.opts.url), i.status === L.Fetching && (i.status = L.FetchAborted)) : (console.error(n), i.status === L.Fetching && (i.status = L.FetchFailed));
|
|
@@ -127,22 +127,22 @@ async function oo(i) {
|
|
|
127
127
|
}
|
|
128
128
|
async function t(n, a, o, s) {
|
|
129
129
|
return new Promise(async (r) => {
|
|
130
|
-
let c = (a + s.byteLength) / n.rowLength | 0, u = (a + s.byteLength) % n.rowLength,
|
|
131
|
-
a ? (
|
|
132
|
-
const
|
|
130
|
+
let c = (a + s.byteLength) / n.rowLength | 0, u = (a + s.byteLength) % n.rowLength, d;
|
|
131
|
+
a ? (d = new Uint8Array(c * n.rowLength), d.set(o.slice(0, a), 0), d.set(s.slice(0, s.byteLength - u), a)) : d = s.slice(0, c * n.rowLength), n.downloadSplatCount + c > n.fetchLimit && (c = n.fetchLimit - n.downloadSplatCount, u = 0);
|
|
132
|
+
const l = async () => {
|
|
133
133
|
if (c > Qe) {
|
|
134
|
-
const h = await
|
|
135
|
-
|
|
134
|
+
const h = await xn(d, Qe);
|
|
135
|
+
ki(n, h), n.downloadSplatCount += Qe, e += Qe * n.rowLength, n.downloadSize = e, c -= Qe, d = d.slice(Qe * n.rowLength), setTimeout(l);
|
|
136
136
|
} else {
|
|
137
|
-
const h = await
|
|
138
|
-
|
|
137
|
+
const h = await xn(d, c);
|
|
138
|
+
ki(n, h), n.downloadSplatCount += c, e += c * n.rowLength, n.downloadSize = e, r(u);
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
|
-
await
|
|
141
|
+
await l();
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function ki(i, e) {
|
|
146
146
|
let t = e.byteLength / R;
|
|
147
147
|
const n = Math.min(i.fetchLimit, i.modelSplatCount);
|
|
148
148
|
i.dataSplatCount + t > n ? (t = n - i.dataSplatCount, i.splatData.set(e.slice(0, t * R), i.dataSplatCount * R)) : i.splatData.set(e, i.dataSplatCount * R);
|
|
@@ -153,10 +153,10 @@ function Ti(i, e) {
|
|
|
153
153
|
const o = i.header?.MinTopY || 0;
|
|
154
154
|
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);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Jn(i) {
|
|
157
157
|
let e = !1;
|
|
158
158
|
const t = (p, m, g) => i.on(p, m, g), n = (p, ...m) => i.fire(p, ...m), a = !n(I).renderer;
|
|
159
|
-
t(re, () => n(I).debugMode), t(
|
|
159
|
+
t(re, () => n(I).debugMode), t(Un, () => e = !0);
|
|
160
160
|
let o = 0;
|
|
161
161
|
(function p() {
|
|
162
162
|
o++, !e && requestAnimationFrame(p);
|
|
@@ -165,14 +165,14 @@ function qn(i) {
|
|
|
165
165
|
e || (g > 0 ? !(o % g) && p(o) : p(o), m && m() && requestAnimationFrame(y));
|
|
166
166
|
};
|
|
167
167
|
y();
|
|
168
|
-
}), t(
|
|
168
|
+
}), t(Fn, (p, m = null, g = 20) => {
|
|
169
169
|
const y = () => {
|
|
170
170
|
e || (p(), m && m() && setTimeout(y, g));
|
|
171
171
|
};
|
|
172
172
|
y();
|
|
173
173
|
});
|
|
174
174
|
let s = !1, r = 0, c = 0;
|
|
175
|
-
t(
|
|
175
|
+
t(Ts, () => {
|
|
176
176
|
s = !0, n(I).debugMode ? ((async () => {
|
|
177
177
|
const p = document.querySelector("#gsviewer #progressBarWrap");
|
|
178
178
|
if (p) {
|
|
@@ -186,26 +186,26 @@ function qn(i) {
|
|
|
186
186
|
const m = document.querySelector("#gsviewer #progressBarWrap");
|
|
187
187
|
m && (m.style.display = "none");
|
|
188
188
|
})(), (async () => document.querySelector("#gsviewer .logo")?.classList.remove("loading"))(), parent?.onProgress && parent.onProgress(0, "100%", 9));
|
|
189
|
-
}), t(
|
|
189
|
+
}), t(ks, (p) => {
|
|
190
190
|
s = !0, n(I).debugMode ? (async () => {
|
|
191
191
|
const m = document.querySelector("#gsviewer #progressBar");
|
|
192
192
|
m && (m.style.width = `${p}%`);
|
|
193
193
|
})() : parent?.onProgress && parent.onProgress(p, `${p}%`);
|
|
194
|
-
}), t(Ia, () => s), t(
|
|
194
|
+
}), t(Ia, () => s), t(Es, (p) => {
|
|
195
195
|
c = p;
|
|
196
|
-
}), t(
|
|
196
|
+
}), t(_s, () => !s && r && c >= r), t(Ue, () => {
|
|
197
197
|
const m = n(Ke).parentElement.getBoundingClientRect();
|
|
198
198
|
return { width: m.width, height: m.height, left: m.left, top: m.top };
|
|
199
|
-
}), t(
|
|
199
|
+
}), t(Fe, (p) => {
|
|
200
200
|
let m = p.x.toFixed(3).split("."), g = p.y.toFixed(3).split("."), y = p.z.toFixed(3).split(".");
|
|
201
201
|
return (m[1] === "000" || m[1] === "00000") && (m[1] = "0"), (g[1] === "000" || g[1] === "00000") && (g[1] = "0"), (y[1] === "000" || y[1] === "00000") && (y[1] = "0"), `${m.join(".")}, ${g.join(".")}, ${y.join(".")}`;
|
|
202
202
|
}), t(Ma, (p) => btoa(p)), t(Ta, (p) => atob(p));
|
|
203
203
|
const u = 1e-3;
|
|
204
|
-
let
|
|
204
|
+
let d = new C(), l = new C(), h = 0;
|
|
205
205
|
t(_a, () => {
|
|
206
206
|
const p = n(V), m = p.fov, g = p.position.clone(), y = p.getWorldDirection(new C());
|
|
207
|
-
return Math.abs(h - m) < u && Math.abs(g.x -
|
|
208
|
-
}), t(
|
|
207
|
+
return Math.abs(h - m) < u && Math.abs(g.x - d.x) < u && Math.abs(g.y - d.y) < u && Math.abs(g.z - d.z) < u && Math.abs(y.x - l.x) < u && Math.abs(y.y - l.y) < u && Math.abs(y.z - l.z) < u ? !1 : (h = m, d = g, l = y, !0);
|
|
208
|
+
}), t(Ee, (p) => {
|
|
209
209
|
if (!p) return;
|
|
210
210
|
const m = [];
|
|
211
211
|
p.traverse((g) => m.push(g)), m.forEach((g) => {
|
|
@@ -284,7 +284,7 @@ async function lo(i) {
|
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
286
|
i.fileSize = o;
|
|
287
|
-
let r = [], c = new Uint8Array(ze), u = new Uint8Array(R),
|
|
287
|
+
let r = [], c = new Uint8Array(ze), u = new Uint8Array(R), d = 0, l = !1, h = 0, f = 0, p, m = !1;
|
|
288
288
|
for (; ; ) {
|
|
289
289
|
let { done: g, value: y } = await a.read();
|
|
290
290
|
if (g) break;
|
|
@@ -308,13 +308,13 @@ async function lo(i) {
|
|
|
308
308
|
continue;
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
if (!
|
|
312
|
-
if (
|
|
313
|
-
u.set(y,
|
|
311
|
+
if (!l) {
|
|
312
|
+
if (d + y.byteLength < 4) {
|
|
313
|
+
u.set(y, d), d += y.byteLength;
|
|
314
314
|
continue;
|
|
315
315
|
}
|
|
316
|
-
const v = new Uint8Array(
|
|
317
|
-
v.set(u.slice(0,
|
|
316
|
+
const v = new Uint8Array(d + y.byteLength);
|
|
317
|
+
v.set(u.slice(0, d), 0), v.set(y, d), y = v.slice(4), d = 0, l = !0, p = [], f = 0;
|
|
318
318
|
const k = new Int32Array(v.slice(0, 4).buffer);
|
|
319
319
|
m = k[0] < 0, h = Math.abs(k[0]);
|
|
320
320
|
}
|
|
@@ -350,7 +350,7 @@ async function lo(i) {
|
|
|
350
350
|
i.sh12Data.push(b.datas), i.sh12Count += b.splatCount;
|
|
351
351
|
}
|
|
352
352
|
if (y.byteLength < 4) {
|
|
353
|
-
u.set(y, 0),
|
|
353
|
+
u.set(y, 0), d = y.byteLength, l = !1;
|
|
354
354
|
break;
|
|
355
355
|
} else {
|
|
356
356
|
const x = new Int32Array(y.slice(0, 4).buffer);
|
|
@@ -373,9 +373,9 @@ function uo(i, e) {
|
|
|
373
373
|
const c = Math.min(i.fetchLimit, i.modelSplatCount);
|
|
374
374
|
if (!i.splatData && (i.splatData = new Uint8Array(c * R)), !i.watermarkData && (i.watermarkData = new Uint8Array(0)), i.dataSplatCount + n > c && (n = c - i.dataSplatCount, !n))
|
|
375
375
|
return;
|
|
376
|
-
const u = new Float32Array(e.buffer),
|
|
376
|
+
const u = new Float32Array(e.buffer), d = new Uint32Array(e.buffer);
|
|
377
377
|
for (let h = 0, f = 0, p = 0, m = 0; h < n; h++)
|
|
378
|
-
if (f = u[h * 8], p = u[h * 8 + 1], m = 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, m), i.maxZ = Math.max(i.maxZ, m),
|
|
378
|
+
if (f = u[h * 8], p = u[h * 8 + 1], m = 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, m), i.maxZ = Math.max(i.maxZ, m), d[h * 8 + 3] >> 16) {
|
|
379
379
|
if (i.watermarkCount * R === i.watermarkData.byteLength) {
|
|
380
380
|
const g = new Uint8Array((i.watermarkCount + a) * R);
|
|
381
381
|
g.set(i.watermarkData, 0), i.watermarkData = g;
|
|
@@ -383,14 +383,14 @@ function uo(i, e) {
|
|
|
383
383
|
i.watermarkData.set(e.slice(h * 32, h * 32 + 32), i.watermarkCount++ * R);
|
|
384
384
|
} else
|
|
385
385
|
i.splatData.set(e.slice(h * 32, h * 32 + 32), i.dataSplatCount++ * R);
|
|
386
|
-
const
|
|
387
|
-
i.currentRadius = Math.sqrt(i.maxX * i.maxX +
|
|
386
|
+
const l = i.header.MinTopY || 0;
|
|
387
|
+
i.currentRadius = Math.sqrt(i.maxX * i.maxX + l * l + i.maxZ * i.maxZ);
|
|
388
388
|
return;
|
|
389
389
|
}
|
|
390
390
|
let o = Math.min(Math.max(i.meta.autoCut, 2), 50);
|
|
391
391
|
!i.watermarkData && (i.watermarkData = new Uint8Array(0));
|
|
392
392
|
const s = new Float32Array(e.buffer), r = new Uint32Array(e.buffer);
|
|
393
|
-
for (let c = 0, u = Math.floor(e.byteLength / R),
|
|
393
|
+
for (let c = 0, u = Math.floor(e.byteLength / R), d = 0, l = 0, h = 0, f = ""; c < u; c++) {
|
|
394
394
|
if (r[c * 8 + 3] >> 16) {
|
|
395
395
|
if (i.watermarkCount * R === i.watermarkData.byteLength) {
|
|
396
396
|
const y = new Uint8Array((i.watermarkCount + a) * R);
|
|
@@ -399,18 +399,18 @@ function uo(i, e) {
|
|
|
399
399
|
i.watermarkData.set(e.slice(c * 32, c * 32 + 32), i.watermarkCount++ * R);
|
|
400
400
|
continue;
|
|
401
401
|
}
|
|
402
|
-
|
|
403
|
-
let p = Math.min(o - 1, Math.floor(Math.max(0,
|
|
402
|
+
d = s[c * 8], l = s[c * 8 + 1], h = s[c * 8 + 2];
|
|
403
|
+
let p = Math.min(o - 1, Math.floor(Math.max(0, d - i.header.MinX) / (i.header.MaxX - i.header.MinX) * o)), m = Math.min(o - 1, Math.floor(Math.max(0, h - i.header.MinZ) / (i.header.MaxZ - i.header.MinZ) * o));
|
|
404
404
|
f = `${p}-${m}`;
|
|
405
405
|
let g = i.map.get(f);
|
|
406
406
|
if (!g)
|
|
407
|
-
g = {}, g.minX =
|
|
407
|
+
g = {}, g.minX = d, g.maxX = d, g.minY = l, g.maxY = l, g.minZ = h, g.maxZ = h, g.centerX = d, g.centerY = l, g.centerZ = h, g.radius = 0, g.splatData = new Uint8Array(a * R), g.splatData.set(e.slice(c * R, c * R + R), 0), g.splatCount = 1, i.map.set(f, g);
|
|
408
408
|
else {
|
|
409
409
|
if (g.splatData.byteLength / R == g.splatCount) {
|
|
410
410
|
const v = new Uint8Array(g.splatData.byteLength + a * R);
|
|
411
411
|
v.set(g.splatData, 0), g.splatData = v;
|
|
412
412
|
}
|
|
413
|
-
g.minX = Math.min(g.minX,
|
|
413
|
+
g.minX = Math.min(g.minX, d), g.maxX = Math.max(g.maxX, d), g.minY = Math.min(g.minY, l), g.maxY = Math.max(g.maxY, l), 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;
|
|
414
414
|
const y = g.maxX - g.minX, M = g.maxY - g.minY, S = g.maxZ - g.minZ;
|
|
415
415
|
g.radius = Math.sqrt(y * y + M * M + S * S) / 2, g.splatData.set(e.slice(c * R, c * R + R), g.splatCount++ * R);
|
|
416
416
|
}
|
|
@@ -428,23 +428,23 @@ async function ho(i) {
|
|
|
428
428
|
}
|
|
429
429
|
const r = s.body.getReader(), c = parseInt(s.headers.get("content-length") || "0");
|
|
430
430
|
i.fileSize = c, i.downloadSize = 0, i.downloadSplatCount = 0, i.watermarkData = new Uint8Array(0);
|
|
431
|
-
let u = new Uint8Array(256),
|
|
431
|
+
let u = new Uint8Array(256), d = 0, l = [], h;
|
|
432
432
|
for (; ; ) {
|
|
433
433
|
let { done: f, value: p } = await r.read();
|
|
434
434
|
if (f) break;
|
|
435
|
-
if (i.downloadSize += p.byteLength,
|
|
436
|
-
if (
|
|
435
|
+
if (i.downloadSize += p.byteLength, l) {
|
|
436
|
+
if (l.push(p), i.downloadSize < 200)
|
|
437
437
|
continue;
|
|
438
438
|
const m = new Uint8Array(i.downloadSize);
|
|
439
|
-
for (let g = 0, y = 0; g <
|
|
440
|
-
m.set(
|
|
439
|
+
for (let g = 0, y = 0; g < l.length; g++)
|
|
440
|
+
m.set(l[g], y), y += l[g].byteLength;
|
|
441
441
|
if (h = n(m), !h) {
|
|
442
|
-
|
|
442
|
+
l = [m];
|
|
443
443
|
continue;
|
|
444
444
|
}
|
|
445
|
-
|
|
445
|
+
l = null, p = m.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);
|
|
446
446
|
}
|
|
447
|
-
|
|
447
|
+
d + p.byteLength < i.rowLength ? (u.set(p, d), d += p.byteLength) : (d = await e(h, i, d, u, p), d && u.set(p.slice(p.byteLength - d), 0)), i.downloadSplatCount >= i.fetchLimit && i.abortController.abort();
|
|
448
448
|
}
|
|
449
449
|
} catch (a) {
|
|
450
450
|
a.name === "AbortError" ? (console.log("Fetch Abort", i.opts.url), i.status === L.Fetching && (i.status = L.FetchAborted)) : (console.error(a), i.status === L.Fetching && (i.status = L.FetchFailed));
|
|
@@ -453,15 +453,15 @@ async function ho(i) {
|
|
|
453
453
|
}
|
|
454
454
|
async function e(a, o, s, r, c) {
|
|
455
455
|
return new Promise(async (u) => {
|
|
456
|
-
let
|
|
457
|
-
s ? (h = new Uint8Array(
|
|
456
|
+
let d = (s + c.byteLength) / o.rowLength | 0, l = (s + c.byteLength) % o.rowLength, h;
|
|
457
|
+
s ? (h = new Uint8Array(d * o.rowLength), h.set(r.slice(0, s), 0), h.set(c.slice(0, c.byteLength - l), s)) : h = c.slice(0, d * o.rowLength), o.downloadSplatCount + d > o.fetchLimit && (d = o.fetchLimit - o.downloadSplatCount, l = 0);
|
|
458
458
|
const f = async () => {
|
|
459
|
-
if (
|
|
459
|
+
if (d > je) {
|
|
460
460
|
const p = await t(a, h, je);
|
|
461
|
-
|
|
461
|
+
Ei(o, p), o.downloadSplatCount += je, d -= je, h = h.slice(je * o.rowLength), setTimeout(f);
|
|
462
462
|
} else {
|
|
463
|
-
const p = await t(a, h,
|
|
464
|
-
|
|
463
|
+
const p = await t(a, h, d);
|
|
464
|
+
Ei(o, p), o.downloadSplatCount += d, u(l);
|
|
465
465
|
}
|
|
466
466
|
};
|
|
467
467
|
await f();
|
|
@@ -469,45 +469,45 @@ async function ho(i) {
|
|
|
469
469
|
}
|
|
470
470
|
async function t(a, o, s) {
|
|
471
471
|
const r = new Uint8Array(s * Za), c = new Float32Array(o.buffer), u = new Float32Array(r.buffer);
|
|
472
|
-
for (let
|
|
473
|
-
u[
|
|
472
|
+
for (let d = 0; d < s; d++)
|
|
473
|
+
u[d * 8 + 0] = c[(d * i.rowLength + a.offsets.x) / 4], u[d * 8 + 1] = c[(d * i.rowLength + a.offsets.y) / 4], u[d * 8 + 2] = c[(d * i.rowLength + a.offsets.z) / 4], u[d * 8 + 3] = Math.exp(c[(d * i.rowLength + a.offsets.scale_0) / 4]), u[d * 8 + 4] = Math.exp(c[(d * i.rowLength + a.offsets.scale_1) / 4]), u[d * 8 + 5] = Math.exp(c[(d * i.rowLength + a.offsets.scale_2) / 4]), r[d * 32 + 24] = ne((0.5 + Et * c[(d * i.rowLength + a.offsets.f_dc_0) / 4]) * 255), r[d * 32 + 25] = ne((0.5 + Et * c[(d * i.rowLength + a.offsets.f_dc_1) / 4]) * 255), r[d * 32 + 26] = ne((0.5 + Et * c[(d * i.rowLength + a.offsets.f_dc_2) / 4]) * 255), r[d * 32 + 27] = ne(1 / (1 + Math.exp(-c[(d * i.rowLength + a.offsets.opacity) / 4])) * 255), r[d * 32 + 28] = ne(c[(d * i.rowLength + a.offsets.rot_0) / 4] * 128 + 128), r[d * 32 + 29] = ne(c[(d * i.rowLength + a.offsets.rot_1) / 4] * 128 + 128), r[d * 32 + 30] = ne(c[(d * i.rowLength + a.offsets.rot_2) / 4] * 128 + 128), r[d * 32 + 31] = ne(c[(d * i.rowLength + a.offsets.rot_3) / 4] * 128 + 128);
|
|
474
474
|
if (a.shDegree == 3) {
|
|
475
|
-
const
|
|
476
|
-
f[0] = s, f[1] = ut,
|
|
475
|
+
const l = new Uint8Array(s * 24 + 8), h = new Uint8Array(s * 21 + 8), f = new Uint32Array(2);
|
|
476
|
+
f[0] = s, f[1] = ut, l.set(new Uint8Array(f.buffer), 0);
|
|
477
477
|
const p = new Uint32Array(2);
|
|
478
|
-
p[0] = s, p[1] =
|
|
478
|
+
p[0] = s, p[1] = Zn, h.set(new Uint8Array(p.buffer), 0);
|
|
479
479
|
for (let y = 0, M = 0; y < s; y++)
|
|
480
480
|
for (let S = 0; S < 8; S++)
|
|
481
481
|
for (let v = 0; v < 3; v++)
|
|
482
|
-
|
|
482
|
+
l[8 + M++] = yt(c[(y * i.rowLength + a.offsets["f_rest_" + (S + v * 15)]) / 4]);
|
|
483
483
|
for (let y = 0, M = 0; y < s; y++)
|
|
484
484
|
for (let S = 8; S < 15; S++)
|
|
485
485
|
for (let v = 0; v < 3; v++)
|
|
486
486
|
h[8 + M++] = yt(c[(y * i.rowLength + a.offsets["f_rest_" + (S + v * 15)]) / 4]);
|
|
487
|
-
const m = await fe(
|
|
487
|
+
const m = await fe(l);
|
|
488
488
|
i.sh12Data.push(m.datas);
|
|
489
489
|
const g = await fe(h);
|
|
490
490
|
i.sh3Data.push(g.datas);
|
|
491
491
|
} else if (a.shDegree == 2) {
|
|
492
|
-
const
|
|
493
|
-
h[0] = s, h[1] = ut,
|
|
492
|
+
const l = new Uint8Array(s * 24 + 8), h = new Uint32Array(2);
|
|
493
|
+
h[0] = s, h[1] = ut, l.set(new Uint8Array(h.buffer), 0);
|
|
494
494
|
for (let p = 0, m = 0; p < s; p++)
|
|
495
495
|
for (let g = 0; g < 8; g++)
|
|
496
496
|
for (let y = 0; y < 3; y++)
|
|
497
|
-
|
|
498
|
-
const f = await fe(
|
|
497
|
+
l[8 + m++] = yt(c[(p * i.rowLength + a.offsets["f_rest_" + (g + y * 8)]) / 4]);
|
|
498
|
+
const f = await fe(l);
|
|
499
499
|
i.sh12Data.push(f.datas);
|
|
500
500
|
} else if (a.shDegree == 1) {
|
|
501
|
-
const
|
|
502
|
-
h[0] = s, h[1] =
|
|
501
|
+
const l = new Uint8Array(s * 9 + 8), h = new Uint32Array(2);
|
|
502
|
+
h[0] = s, h[1] = Kn, l.set(new Uint8Array(h.buffer), 0);
|
|
503
503
|
for (let p = 0, m = 0; p < s; p++)
|
|
504
504
|
for (let g = 0; g < 3; g++)
|
|
505
505
|
for (let y = 0; y < 3; y++)
|
|
506
|
-
|
|
507
|
-
const f = await fe(
|
|
506
|
+
l[8 + m++] = yt(c[(p * i.rowLength + a.offsets["f_rest_" + (g + y * 3)]) / 4]);
|
|
507
|
+
const f = await fe(l);
|
|
508
508
|
i.sh12Data.push(f.datas);
|
|
509
509
|
}
|
|
510
|
-
return await
|
|
510
|
+
return await xn(r, s);
|
|
511
511
|
}
|
|
512
512
|
function n(a) {
|
|
513
513
|
let o = new TextDecoder().decode(a.slice(0, 2048));
|
|
@@ -520,7 +520,7 @@ async function ho(i) {
|
|
|
520
520
|
if (!o.startsWith("ply") || o.indexOf("format binary_little_endian 1.0") < 0)
|
|
521
521
|
throw new Error("Unknow .ply file header");
|
|
522
522
|
const c = parseInt(/element vertex (\d+)\n/.exec(o)[1]);
|
|
523
|
-
let u = 0,
|
|
523
|
+
let u = 0, d = {}, l = {};
|
|
524
524
|
const h = {
|
|
525
525
|
double: "getFloat64",
|
|
526
526
|
int: "getInt32",
|
|
@@ -533,20 +533,20 @@ async function ho(i) {
|
|
|
533
533
|
for (let m of o.slice(0, r).split(`
|
|
534
534
|
`).filter((g) => g.startsWith("property "))) {
|
|
535
535
|
const [g, y, M] = m.split(" "), S = h[y] || "getInt8";
|
|
536
|
-
|
|
536
|
+
l[M] = S, d[M] = u, u += parseInt(S.replace(/[^\d]/g, "")) / 8;
|
|
537
537
|
}
|
|
538
538
|
let f = 0;
|
|
539
|
-
|
|
539
|
+
l.f_rest_44 ? f = 3 : l.f_rest_23 ? f = 2 : l.f_rest_8 && (f = 1);
|
|
540
540
|
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"];
|
|
541
541
|
for (let m = 0; m < p.length; m++) {
|
|
542
542
|
const g = p[m];
|
|
543
|
-
if (!
|
|
543
|
+
if (!l[g])
|
|
544
544
|
throw new Error(`Property not found: ${g}`);
|
|
545
545
|
}
|
|
546
|
-
return { headerLength: r + s.length, offsets:
|
|
546
|
+
return { headerLength: r + s.length, offsets: d, rowLength: u, vertexCount: c, shDegree: f };
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
|
-
function
|
|
549
|
+
function Ei(i, e) {
|
|
550
550
|
let t = e.byteLength / R;
|
|
551
551
|
const n = Math.min(i.fetchLimit, i.modelSplatCount);
|
|
552
552
|
i.dataSplatCount + t > n ? (t = n - i.dataSplatCount, i.splatData.set(e.slice(0, t * R), i.dataSplatCount * R)) : i.splatData.set(e, i.dataSplatCount * R);
|
|
@@ -574,20 +574,20 @@ async function po(i) {
|
|
|
574
574
|
if (h) break;
|
|
575
575
|
u.set(f, i.downloadSize), i.downloadSize += f.length;
|
|
576
576
|
}
|
|
577
|
-
const
|
|
578
|
-
if (!
|
|
577
|
+
const d = await qs(u);
|
|
578
|
+
if (!d || d.length < 16) {
|
|
579
579
|
console.error("Invalid spz format"), i.status = L.Invalid;
|
|
580
580
|
return;
|
|
581
581
|
}
|
|
582
|
-
const
|
|
583
|
-
i.modelSplatCount =
|
|
582
|
+
const l = n(d);
|
|
583
|
+
i.modelSplatCount = l.numPoints, i.dataShDegree = l.shDegree, i.splatData = new Uint8Array(Math.min(i.modelSplatCount, i.fetchLimit) * 32), await e(l, i, d);
|
|
584
584
|
} catch (a) {
|
|
585
585
|
a.name === "AbortError" ? (console.log("Fetch Abort", i.opts.url), i.status === L.Fetching && (i.status = L.FetchAborted)) : (console.error(a), i.status === L.Fetching && (i.status = L.FetchFailed));
|
|
586
586
|
} finally {
|
|
587
587
|
i.status === L.Fetching && (i.status = L.FetchDone);
|
|
588
588
|
}
|
|
589
589
|
async function e(a, o, s) {
|
|
590
|
-
const r = a.numPoints * 9, c = a.numPoints, u = a.numPoints * 3,
|
|
590
|
+
const r = a.numPoints * 9, c = a.numPoints, u = a.numPoints * 3, d = a.numPoints * 3, l = a.numPoints * 3, h = Zt, f = h + r, p = f + c, m = p + u, g = m + d, y = g + l, M = Math.min(a.numPoints, o.fetchLimit), S = Math.ceil(M / z);
|
|
591
591
|
for (let v = 0; v < S; v++) {
|
|
592
592
|
let k = v < S - 1 ? z : M - v * z;
|
|
593
593
|
o.dataSplatCount + k > o.fetchLimit && (k = o.fetchLimit - o.dataSplatCount);
|
|
@@ -626,7 +626,7 @@ async function po(i) {
|
|
|
626
626
|
const _ = await fe(b);
|
|
627
627
|
if (t(a, o, _.datas), a.shDegree === 1) {
|
|
628
628
|
const T = new Uint8Array(k * 9 + 8), F = new Uint32Array(2);
|
|
629
|
-
F[0] = k, F[1] =
|
|
629
|
+
F[0] = k, F[1] = Kn, T.set(new Uint8Array(F.buffer), 0);
|
|
630
630
|
for (let P = 0, U = 8; P < k; P++)
|
|
631
631
|
T.set(s.slice(y + (v * z + P) * 9, y + (v * z + P) * 9 + 9), U), U += 9;
|
|
632
632
|
const E = await fe(T);
|
|
@@ -646,7 +646,7 @@ async function po(i) {
|
|
|
646
646
|
const E = await fe(T);
|
|
647
647
|
o.sh12Data.push(E.datas);
|
|
648
648
|
const P = new Uint8Array(k * 21 + 8), U = new Uint32Array(2);
|
|
649
|
-
U[0] = k, U[1] =
|
|
649
|
+
U[0] = k, U[1] = Zn, P.set(new Uint8Array(U.buffer), 0);
|
|
650
650
|
for (let W = 0, se = 8; W < k; W++)
|
|
651
651
|
P.set(s.slice(y + (v * z + W) * 45 + 24, y + (v * z + W) * 45 + 45), se), se += 21;
|
|
652
652
|
const O = await fe(P);
|
|
@@ -661,11 +661,11 @@ async function po(i) {
|
|
|
661
661
|
const c = Math.min(o.fetchLimit, a.numPoints);
|
|
662
662
|
o.dataSplatCount + r > c ? (r = c - o.dataSplatCount, o.splatData.set(s.slice(0, r * R), o.dataSplatCount * R)) : o.splatData.set(s, o.dataSplatCount * R);
|
|
663
663
|
const u = new Float32Array(s.buffer);
|
|
664
|
-
for (let
|
|
665
|
-
h = u[
|
|
664
|
+
for (let l = 0, h = 0, f = 0, p = 0; l < r; l++)
|
|
665
|
+
h = u[l * 8], f = u[l * 8 + 1], p = u[l * 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);
|
|
666
666
|
o.dataSplatCount += r, o.downloadSplatCount += r;
|
|
667
|
-
const
|
|
668
|
-
o.currentRadius = Math.sqrt(o.maxX * o.maxX +
|
|
667
|
+
const d = 0;
|
|
668
|
+
o.currentRadius = Math.sqrt(o.maxX * o.maxX + d * d + o.maxZ * o.maxZ), o.aabbCenter = new C((o.minX + o.maxX) / 2, (o.minY + o.maxY) / 2, (o.minZ + o.maxZ) / 2);
|
|
669
669
|
}
|
|
670
670
|
function n(a) {
|
|
671
671
|
const o = a.slice(0, Zt), s = new Uint32Array(o.buffer), r = {};
|
|
@@ -689,10 +689,10 @@ function fo(i, e, t) {
|
|
|
689
689
|
function go(i) {
|
|
690
690
|
const e = (M, S, v) => i.on(M, S, v), t = (M, ...S) => i.fire(M, ...S);
|
|
691
691
|
let n, a = Date.now() + 36e5, o = null, s, r = { index: 0, version: 0 }, c = { version: 0 }, u = !1;
|
|
692
|
-
const
|
|
692
|
+
const d = t(ee);
|
|
693
693
|
e(Ys, () => s?.aabbCenter || new C());
|
|
694
|
-
let
|
|
695
|
-
const h = new Promise((M) =>
|
|
694
|
+
let l;
|
|
695
|
+
const h = new Promise((M) => l = M);
|
|
696
696
|
e(ot, async () => {
|
|
697
697
|
const M = t(I);
|
|
698
698
|
let S = le ? M.maxRenderCountOfMobile : M.maxRenderCountOfPc;
|
|
@@ -714,7 +714,7 @@ function go(i) {
|
|
|
714
714
|
return 1;
|
|
715
715
|
const b = 1024 * 2;
|
|
716
716
|
return Math.ceil(v / b);
|
|
717
|
-
}), e(
|
|
717
|
+
}), e(Xn, async () => t(I).bigSceneMode ? 0 : (await h, s.dataShDegree)), e(Wn, async (M, S = !0) => {
|
|
718
718
|
try {
|
|
719
719
|
await h;
|
|
720
720
|
const v = !!s.header?.Flag2;
|
|
@@ -723,7 +723,7 @@ function go(i) {
|
|
|
723
723
|
console.info("failed to generate watermark");
|
|
724
724
|
}
|
|
725
725
|
}), e(gn, () => {
|
|
726
|
-
if (
|
|
726
|
+
if (d) return r.version <= c.version ? r.xyz : c.xyz;
|
|
727
727
|
if (s?.status === L.FetchDone || s?.status === L.FetchAborted) {
|
|
728
728
|
if (s.activePoints && s.activePoints.length === void 0) return s.activePoints;
|
|
729
729
|
const M = {}, S = r.xyz;
|
|
@@ -743,7 +743,7 @@ function go(i) {
|
|
|
743
743
|
const v = Math.min(s.fetchLimit, s.downloadSplatCount);
|
|
744
744
|
!s.notifyFetchStopDone && (s.notifyFetchStopDone = !0) && t(Mt, v);
|
|
745
745
|
} else
|
|
746
|
-
t(
|
|
746
|
+
t(ks, 100 * s.downloadSize / s.fileSize);
|
|
747
747
|
s.downloadSplatCount && (u || (u = !0, setTimeout(async () => {
|
|
748
748
|
await p(S), u = !1;
|
|
749
749
|
})));
|
|
@@ -754,7 +754,7 @@ function go(i) {
|
|
|
754
754
|
let b = s.dataSplatCount, x = M ? s.watermarkCount : 0, w = s.meta.showWatermark && M ? (k?.byteLength || 0) / 32 : 0;
|
|
755
755
|
if (s.renderSplatCount = b + x + w, s.renderSplatCount >= v && (s.renderSplatCount = v, x = 0, w = 0, b > v && (b = v)), t(oe, { visibleSplatCount: s.renderSplatCount, modelSplatCount: s.modelSplatCount + w }), Date.now() - S.textureReadyTime < (le ? 600 : 300) || s.smallSceneUploadDone && s.lastTextWatermarkVersion == s.textWatermarkVersion) return;
|
|
756
756
|
if (!S.version) {
|
|
757
|
-
t(
|
|
757
|
+
t(ys, (s.header?.Flag2 ? s.header.MaxTopY : s.header?.MinTopY) || 0);
|
|
758
758
|
let O = s.opts.format;
|
|
759
759
|
s.opts.format == "spx" && (O = "spx" + (s.header.ExclusiveId ? (" " + s.header.ExclusiveId).substring(0, 6) : "")), t(oe, { scene: `small (${O})` });
|
|
760
760
|
}
|
|
@@ -768,7 +768,7 @@ function go(i) {
|
|
|
768
768
|
if (S.version = U, S.txdata = T, S.xyz = P, S.renderSplatCount = s.renderSplatCount, S.visibleSplatCount = s.downloadSplatCount + w, S.modelSplatCount = s.downloadSplatCount + w, S.watermarkCount = x + w, S.minX = s.minX, S.maxX = s.maxX, S.minY = s.minY, S.maxY = s.maxY, S.minZ = s.minZ, S.maxZ = s.maxZ, t(zs, S, s.currentRadius, s.currentRadius), a = U, M && !s.smallSceneUploadDone) {
|
|
769
769
|
s.smallSceneUploadDone = !0, t(Qs, s.sh12Data), t(Hs, s.sh3Data), s.sh12Data = null, s.sh3Data = null;
|
|
770
770
|
const O = t(I);
|
|
771
|
-
t(
|
|
771
|
+
t(Bn, O.shDegree === void 0 ? 3 : O.shDegree), t(gn);
|
|
772
772
|
}
|
|
773
773
|
t(oe, { renderSplatCount: s.renderSplatCount });
|
|
774
774
|
}
|
|
@@ -798,12 +798,12 @@ function go(i) {
|
|
|
798
798
|
s.fetchLimit = k;
|
|
799
799
|
const x = Date.now(), w = () => {
|
|
800
800
|
if (!s || s.status == L.Invalid || s.status == L.FetchFailed)
|
|
801
|
-
return
|
|
801
|
+
return l(0);
|
|
802
802
|
if (s.modelSplatCount >= 0)
|
|
803
|
-
|
|
803
|
+
l(s.modelSplatCount), setTimeout(() => t(Ms), 5);
|
|
804
804
|
else {
|
|
805
805
|
if (Date.now() - x >= 3e3)
|
|
806
|
-
return
|
|
806
|
+
return l(0);
|
|
807
807
|
setTimeout(w, 10);
|
|
808
808
|
}
|
|
809
809
|
};
|
|
@@ -811,9 +811,9 @@ function go(i) {
|
|
|
811
811
|
console.error("Unsupported format:", M.format), t(Mt, 0);
|
|
812
812
|
return;
|
|
813
813
|
}
|
|
814
|
-
t(
|
|
814
|
+
t(Ts);
|
|
815
815
|
}
|
|
816
|
-
e(
|
|
816
|
+
e(Ss, async (M, S) => await y(M, S)), e(bs, (M = 1e4) => Date.now() - a < M), e(xs, () => m()), t(
|
|
817
817
|
at,
|
|
818
818
|
async () => await f(),
|
|
819
819
|
() => !n
|
|
@@ -1166,14 +1166,14 @@ function wo() {
|
|
|
1166
1166
|
}
|
|
1167
1167
|
`;
|
|
1168
1168
|
}
|
|
1169
|
-
const
|
|
1169
|
+
const _i = "currentVisibleRadius", Ii = "currentLightRadius", Js = "realFocusPosition", qt = "splatShTexture12", Jt = "splatShTexture3", Di = "performanceNow", vo = "waterMarkColor", Pi = "showWaterMark", en = "splatTexture0", tn = "splatTexture1", Li = "bigSceneMode", Fi = "lightFactor", Ri = "debugEffect", Bi = "usingIndex", So = "cycleColor", bo = "splatIndex", Ui = "pointMode", Oi = "markPoint", zi = "shDegree", ht = "viewport", Cn = "opacity", Qi = "focal", Hi = "topY";
|
|
1170
1170
|
let Q = 0;
|
|
1171
1171
|
Q++;
|
|
1172
|
-
const
|
|
1172
|
+
const Wi = `$${Q++}`;
|
|
1173
1173
|
Q++;
|
|
1174
1174
|
Q++;
|
|
1175
1175
|
Q++;
|
|
1176
|
-
const
|
|
1176
|
+
const Yi = `$${Q++}`, xo = `$${Q++}`, Vi = `$${Q++}`, Co = `$${Q++}`, Mo = `$${Q++}`, To = `$${Q++}`, ko = `$${Q++}`, Eo = `$${Q++}`;
|
|
1177
1177
|
Q++;
|
|
1178
1178
|
const _o = `$${Q++}`, Io = `$${Q++}`;
|
|
1179
1179
|
Q++;
|
|
@@ -1185,29 +1185,29 @@ const Lo = `$${Q++}`, Fo = `$${Q++}`, Ro = `$${Q++}`, Bo = `$${Q++}`, Uo = `$${Q
|
|
|
1185
1185
|
Q++;
|
|
1186
1186
|
function Ho(i) {
|
|
1187
1187
|
let e = !1;
|
|
1188
|
-
const t = (
|
|
1188
|
+
const t = (l, h, f) => i.on(l, h, f), n = (l, ...h) => i.fire(l, ...h);
|
|
1189
1189
|
let a = 0, o = 0;
|
|
1190
1190
|
const s = [];
|
|
1191
1191
|
let r = 0;
|
|
1192
|
-
t(Ws, () => r), t(
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1192
|
+
t(Ws, () => r), t(di, async () => {
|
|
1193
|
+
const l = new rn();
|
|
1194
|
+
l.setIndex([0, 1, 2, 0, 2, 3]);
|
|
1195
1195
|
const h = new Float32Array(4 * 3), f = new He(h, 3);
|
|
1196
|
-
|
|
1197
|
-
let p = new rn().copy(
|
|
1196
|
+
l.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;
|
|
1197
|
+
let p = new rn().copy(l);
|
|
1198
1198
|
const m = await n(ot);
|
|
1199
1199
|
if (e) return;
|
|
1200
1200
|
const g = new Uint32Array(m), y = new ca(g, 1, !1);
|
|
1201
|
-
return y.setUsage(la), y.needsUpdate = !0, p.setAttribute(bo, y), p.instanceCount = 0, t(
|
|
1202
|
-
n(
|
|
1203
|
-
}), t(ka, () => p), t(
|
|
1201
|
+
return y.setUsage(la), y.needsUpdate = !0, p.setAttribute(bo, y), p.instanceCount = 0, t(pi, (M, S, v, k) => {
|
|
1202
|
+
n(gi, S), g.set(M, 0), y.clearUpdateRanges(), y.addUpdateRange(0, M.length), y.needsUpdate = !0, p.instanceCount = M.length, n(N), n(oe, { sortTime: `${v} / ${Date.now() - k}` });
|
|
1203
|
+
}), t(ka, () => p), t(yi, () => {
|
|
1204
1204
|
y.array = null, p.dispose();
|
|
1205
1205
|
}), p;
|
|
1206
|
-
}), t(
|
|
1207
|
-
const
|
|
1206
|
+
}), t(ui, async () => {
|
|
1207
|
+
const l = await n(ot);
|
|
1208
1208
|
if (e) return;
|
|
1209
|
-
const h = 1024 * 2, f = Math.ceil(2 *
|
|
1210
|
-
uniforms: n(
|
|
1209
|
+
const h = 1024 * 2, f = Math.ceil(2 * l / h), p = n(I), m = new In({
|
|
1210
|
+
uniforms: n(li),
|
|
1211
1211
|
vertexShader: mo(),
|
|
1212
1212
|
fragmentShader: yo(),
|
|
1213
1213
|
transparent: !0,
|
|
@@ -1217,113 +1217,113 @@ function Ho(i) {
|
|
|
1217
1217
|
// 是否启用深度测试。深度测试用于确保只有离相机更近的物体才会被渲染
|
|
1218
1218
|
depthWrite: !1,
|
|
1219
1219
|
// 是否将深度值写入深度缓冲区
|
|
1220
|
-
side:
|
|
1220
|
+
side: ve
|
|
1221
1221
|
}), g = new Uint32Array(h * f * 4);
|
|
1222
|
-
let y = new
|
|
1222
|
+
let y = new _e(g, h, f, Ie, De);
|
|
1223
1223
|
y.internalFormat = "RGBA32UI", y.needsUpdate = !0, m.uniforms[en].value = y;
|
|
1224
1224
|
const M = n(ee) ? f : 1, S = new Uint32Array(h * M * 4);
|
|
1225
|
-
let v = new
|
|
1225
|
+
let v = new _e(S, h, M, Ie, De);
|
|
1226
1226
|
v.internalFormat = "RGBA32UI", v.needsUpdate = !0, m.uniforms[tn].value = v;
|
|
1227
1227
|
const k = await n(Je, 1), b = new Uint32Array(h * k * 4);
|
|
1228
|
-
let x = new
|
|
1228
|
+
let x = new _e(b, h, k, Ie, De);
|
|
1229
1229
|
x.internalFormat = "RGBA32UI", x.needsUpdate = !0, m.uniforms[qt].value = x;
|
|
1230
1230
|
const w = await n(Je, 3), D = new Uint32Array(h * w * 4);
|
|
1231
|
-
let _ = new
|
|
1231
|
+
let _ = new _e(D, h, w, Ie, De);
|
|
1232
1232
|
_.internalFormat = "RGBA32UI", _.needsUpdate = !0, m.uniforms[Jt].value = _, m.needsUpdate = !0;
|
|
1233
1233
|
let T = !1;
|
|
1234
|
-
t(
|
|
1234
|
+
t(fi, (E) => {
|
|
1235
1235
|
if (!n(ee)) {
|
|
1236
1236
|
if (T && !E.renderSplatCount) return;
|
|
1237
1237
|
T = !E.renderSplatCount;
|
|
1238
1238
|
}
|
|
1239
1239
|
const P = E.txdata;
|
|
1240
1240
|
E.txdata = null;
|
|
1241
|
-
const U = new
|
|
1241
|
+
const U = new _e(P, h, f, Ie, De);
|
|
1242
1242
|
U.onUpdate = () => {
|
|
1243
|
-
E.textureReady = !0, E.textureReadyTime = Date.now(),
|
|
1243
|
+
E.textureReady = !0, E.textureReadyTime = Date.now(), d(E), n(Es, E.renderSplatCount);
|
|
1244
1244
|
}, U.internalFormat = "RGBA32UI", U.needsUpdate = !0, E.index ? (m.uniforms[tn].value = U, v = U) : (m.uniforms[en].value = U, y = U), m.needsUpdate = !0, n(N);
|
|
1245
1245
|
}), t(Qs, async (E) => {
|
|
1246
1246
|
if (n(ee) || !E || !E.length) return;
|
|
1247
1247
|
const P = new Uint32Array(h * await n(Je, 1) * 4), U = new Uint8Array(P.buffer);
|
|
1248
1248
|
for (let W = 0, se = 0; W < E.length; W++)
|
|
1249
1249
|
U.set(E[W], se), se += E[W].byteLength;
|
|
1250
|
-
const O = new
|
|
1250
|
+
const O = new _e(P, h, k, Ie, De);
|
|
1251
1251
|
O.internalFormat = "RGBA32UI", O.needsUpdate = !0, m.uniforms[qt].value = O, m.needsUpdate = !0, n(N);
|
|
1252
1252
|
}), t(Hs, async (E) => {
|
|
1253
1253
|
if (n(ee) || !E || !E.length) return;
|
|
1254
1254
|
const P = new Uint32Array(h * await n(Je, 3) * 4), U = new Uint8Array(P.buffer);
|
|
1255
1255
|
for (let W = 0, se = 0; W < E.length; W++)
|
|
1256
1256
|
U.set(E[W], se), se += E[W].byteLength;
|
|
1257
|
-
const O = new
|
|
1257
|
+
const O = new _e(P, h, k, Ie, De);
|
|
1258
1258
|
O.internalFormat = "RGBA32UI", O.needsUpdate = !0, m.uniforms[Jt].value = O, m.needsUpdate = !0, n(N);
|
|
1259
|
-
}), t(
|
|
1260
|
-
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(
|
|
1261
|
-
se.uniforms[
|
|
1259
|
+
}), t(hi, () => m), t(Nt, () => {
|
|
1260
|
+
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(hi);
|
|
1261
|
+
se.uniforms[Qi].value.set(O, W), se.uniformsNeedUpdate = !0, n(N);
|
|
1262
1262
|
}), t(Xt, () => {
|
|
1263
1263
|
const { width: E, height: P } = n(Ue);
|
|
1264
1264
|
m.uniforms[ht].value.set(E, P), m.uniformsNeedUpdate = !0, n(N);
|
|
1265
|
-
}), t(
|
|
1266
|
-
m.uniforms[
|
|
1265
|
+
}), t(gi, (E) => {
|
|
1266
|
+
m.uniforms[Bi].value = E, m.uniformsNeedUpdate = !0, n(N);
|
|
1267
1267
|
}), t(nt, (E) => {
|
|
1268
1268
|
const P = n(I);
|
|
1269
|
-
E === void 0 && (E = !P.pointcloudMode), m.uniforms[
|
|
1270
|
-
}), t(
|
|
1271
|
-
m.uniforms[
|
|
1269
|
+
E === void 0 && (E = !P.pointcloudMode), m.uniforms[Ui].value = E ? 1 : 0, m.uniformsNeedUpdate = !0, P.pointcloudMode = E, n(N), P.viewerEvents && (P.viewerEvents.fire(I).pointcloudMode = E);
|
|
1270
|
+
}), t(mi, (E) => {
|
|
1271
|
+
m.uniforms[Li].value = E ? 1 : 0, m.uniformsNeedUpdate = !0;
|
|
1272
1272
|
const P = n(I);
|
|
1273
1273
|
P.bigSceneMode = E, n(N);
|
|
1274
1274
|
}), t(rt, (E) => {
|
|
1275
|
-
m.uniforms[
|
|
1275
|
+
m.uniforms[Fi].value = E, m.uniformsNeedUpdate = !0;
|
|
1276
1276
|
const P = n(I);
|
|
1277
1277
|
P.lightFactor = E, n(N);
|
|
1278
1278
|
});
|
|
1279
1279
|
let F = !1;
|
|
1280
|
-
return t(
|
|
1281
|
-
n(ee) || F || (F = !0, m.uniforms[
|
|
1280
|
+
return t(ys, (E) => {
|
|
1281
|
+
n(ee) || F || (F = !0, m.uniforms[Hi].value = E, m.uniformsNeedUpdate = !0, n(N));
|
|
1282
1282
|
}), t(gt, (E) => {
|
|
1283
|
-
m.uniforms[Ei].value = E, m.uniformsNeedUpdate = !0, n(N);
|
|
1284
|
-
}), t($t, (E) => {
|
|
1285
1283
|
m.uniforms[_i].value = E, m.uniformsNeedUpdate = !0, n(N);
|
|
1284
|
+
}), t($t, (E) => {
|
|
1285
|
+
m.uniforms[Ii].value = E, m.uniformsNeedUpdate = !0, n(N);
|
|
1286
1286
|
}), t(Ct, (E, P, U, O) => {
|
|
1287
|
-
m.uniforms[
|
|
1287
|
+
m.uniforms[Oi].value = [E, P, U, O ? 1 : -1], m.uniformsNeedUpdate = !0, n(N);
|
|
1288
1288
|
}), t(hn, (E = !0) => {
|
|
1289
|
-
m.uniforms[
|
|
1290
|
-
}), t(
|
|
1291
|
-
m.uniforms[
|
|
1289
|
+
m.uniforms[Pi].value = E ? 1 : 0, m.uniformsNeedUpdate = !0, n(N);
|
|
1290
|
+
}), t(As, (E) => {
|
|
1291
|
+
m.uniforms[Di].value = E, m.uniformsNeedUpdate = !0;
|
|
1292
1292
|
}), t(Ea, (E) => {
|
|
1293
|
-
m.uniforms[
|
|
1294
|
-
}), t(
|
|
1293
|
+
m.uniforms[Ri].value = E, m.uniformsNeedUpdate = !0;
|
|
1294
|
+
}), t(Bn, async (E) => {
|
|
1295
1295
|
if (n(ee)) return;
|
|
1296
|
-
const P = await n(
|
|
1297
|
-
E < 0 && (E = 0), E > P && (E = P), r = E, m.uniforms[
|
|
1298
|
-
}), t(
|
|
1296
|
+
const P = await n(Xn);
|
|
1297
|
+
E < 0 && (E = 0), E > P && (E = P), r = E, m.uniforms[zi].value = E, m.uniformsNeedUpdate = !0, n(oe, { shDegree: `${E} / max ${P}` }), n(N);
|
|
1298
|
+
}), t(Ai, () => {
|
|
1299
1299
|
m.dispose(), y && y.dispose(), v && v.dispose(), x && x.dispose(), _ && _.dispose();
|
|
1300
1300
|
}), m;
|
|
1301
|
-
}), t(
|
|
1302
|
-
const
|
|
1303
|
-
return n(Nt), n(Xt), n(
|
|
1301
|
+
}), t(ms, async () => {
|
|
1302
|
+
const l = new te(await n(di), await n(ui));
|
|
1303
|
+
return n(Nt), n(Xt), n(mi, n(ee)), n(nt, n(pn)), l;
|
|
1304
1304
|
});
|
|
1305
1305
|
function c() {
|
|
1306
1306
|
n(Nt), n(Xt);
|
|
1307
1307
|
}
|
|
1308
|
-
window.addEventListener("resize", c), t(
|
|
1309
|
-
e = !0, window.removeEventListener("resize", c), n(
|
|
1310
|
-
}), t(
|
|
1308
|
+
window.addEventListener("resize", c), t(Cs, () => {
|
|
1309
|
+
e = !0, window.removeEventListener("resize", c), n(yi), n(Ai);
|
|
1310
|
+
}), t(Ms, async () => {
|
|
1311
1311
|
if (n(ee)) return;
|
|
1312
|
-
let
|
|
1312
|
+
let l = 0.01, h = 0.01, f = !1, p = 0;
|
|
1313
1313
|
n(gt, h), n(
|
|
1314
1314
|
at,
|
|
1315
1315
|
() => {
|
|
1316
1316
|
if (e || o <= h) return;
|
|
1317
|
-
h += (o - h) *
|
|
1318
|
-
let m = n(
|
|
1317
|
+
h += (o - h) * l, n(gt, h);
|
|
1318
|
+
let m = n(_s);
|
|
1319
1319
|
m && !p && (p = Date.now());
|
|
1320
1320
|
let g = h / a;
|
|
1321
|
-
m && (g > 0.9 || Date.now() - p > 2500) ? (n(pn) && n(fn, !0), n(gt, 0), f = !0) : m && g > 0.7 ?
|
|
1321
|
+
m && (g > 0.9 || Date.now() - p > 2500) ? (n(pn) && n(fn, !0), n(gt, 0), f = !0) : m && g > 0.7 ? l = Math.min(l * 1.2, 0.3) : m && g > 0.5 ? l = Math.min(l * 1.2, 0.2) : g > 0.4 && (l = Math.min(l * 1.05, 0.1));
|
|
1322
1322
|
},
|
|
1323
1323
|
() => !e && !f,
|
|
1324
1324
|
3
|
|
1325
1325
|
);
|
|
1326
|
-
}), t(fn, (
|
|
1326
|
+
}), t(fn, (l = !1) => {
|
|
1327
1327
|
if (n(ee)) return;
|
|
1328
1328
|
for (; s.length; ) s.pop().stop = !0;
|
|
1329
1329
|
const h = n(I), f = a * 1e-3;
|
|
@@ -1331,56 +1331,56 @@ function Ho(i) {
|
|
|
1331
1331
|
s.push(p), n(
|
|
1332
1332
|
at,
|
|
1333
1333
|
() => {
|
|
1334
|
-
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(),
|
|
1334
|
+
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(), l && n(I)?.viewerEvents?.fire(dt), n(I)?.viewerEvents?.fire(Us)) : p.currentLightRadius / a < 0.4 ? p.stepRate = Math.min(p.stepRate * 1.02, 0.03) : p.stepRate *= 1.04);
|
|
1335
1335
|
},
|
|
1336
1336
|
() => !e && !p.stop
|
|
1337
1337
|
);
|
|
1338
|
-
}), t(
|
|
1338
|
+
}), t(li, () => ({
|
|
1339
1339
|
[en]: { type: "t", value: null },
|
|
1340
1340
|
[tn]: { type: "t", value: null },
|
|
1341
1341
|
[qt]: { type: "t", value: null },
|
|
1342
1342
|
[Jt]: { type: "t", value: null },
|
|
1343
|
-
[
|
|
1343
|
+
[Qi]: { type: "v2", value: new j() },
|
|
1344
1344
|
[ht]: { type: "v2", value: new j() },
|
|
1345
|
-
[Ri]: { type: "int", value: 0 },
|
|
1346
1345
|
[Bi]: { type: "int", value: 0 },
|
|
1347
|
-
[
|
|
1348
|
-
[
|
|
1349
|
-
[
|
|
1350
|
-
[
|
|
1351
|
-
[
|
|
1352
|
-
[
|
|
1346
|
+
[Ui]: { type: "int", value: 0 },
|
|
1347
|
+
[Ri]: { type: "int", value: 1 },
|
|
1348
|
+
[Li]: { type: "int", value: 0 },
|
|
1349
|
+
[zi]: { type: "int", value: 0 },
|
|
1350
|
+
[Fi]: { type: "float", value: 1 },
|
|
1351
|
+
[Hi]: { type: "float", value: 0 },
|
|
1353
1352
|
[_i]: { type: "float", value: 0 },
|
|
1354
|
-
[
|
|
1355
|
-
[
|
|
1356
|
-
[
|
|
1357
|
-
[
|
|
1353
|
+
[Ii]: { type: "float", value: 0 },
|
|
1354
|
+
[Oi]: { type: "v4", value: new Se(0, 0, 0, -1) },
|
|
1355
|
+
[Di]: { type: "float", value: performance.now() },
|
|
1356
|
+
[vo]: { type: "v4", value: new Se(1, 1, 0, 0.5) },
|
|
1357
|
+
[Pi]: { type: "int", value: 1 }
|
|
1358
1358
|
}));
|
|
1359
|
-
const u = n(
|
|
1360
|
-
u.onmessage = (
|
|
1361
|
-
const h =
|
|
1362
|
-
h[
|
|
1363
|
-
}, t(zs, (
|
|
1364
|
-
n(ee) || (o = h, a = f), n(
|
|
1359
|
+
const u = n(ls);
|
|
1360
|
+
u.onmessage = (l) => {
|
|
1361
|
+
const h = l.data;
|
|
1362
|
+
h[Wi] && n(pi, h[Wi], h[Yi], h[ko], h[To], h[Vi]);
|
|
1363
|
+
}, t(zs, (l, h, f) => {
|
|
1364
|
+
n(ee) || (o = h, a = f), n(fi, l);
|
|
1365
1365
|
});
|
|
1366
|
-
function l
|
|
1367
|
-
const h =
|
|
1366
|
+
function d(l) {
|
|
1367
|
+
const h = l.xyz.slice(0);
|
|
1368
1368
|
u.postMessage(
|
|
1369
1369
|
{
|
|
1370
1370
|
[Eo]: !0,
|
|
1371
1371
|
[Po]: h,
|
|
1372
|
-
[Qo]:
|
|
1373
|
-
[
|
|
1374
|
-
[xo]:
|
|
1375
|
-
[
|
|
1376
|
-
[Co]:
|
|
1377
|
-
[Mo]:
|
|
1378
|
-
[Lo]:
|
|
1379
|
-
[Fo]:
|
|
1380
|
-
[Ro]:
|
|
1381
|
-
[Bo]:
|
|
1382
|
-
[Uo]:
|
|
1383
|
-
[Oo]:
|
|
1372
|
+
[Qo]: l.watermarkCount,
|
|
1373
|
+
[Yi]: l.index,
|
|
1374
|
+
[xo]: l.version,
|
|
1375
|
+
[Vi]: l.renderSplatCount,
|
|
1376
|
+
[Co]: l.visibleSplatCount,
|
|
1377
|
+
[Mo]: l.modelSplatCount,
|
|
1378
|
+
[Lo]: l.minX,
|
|
1379
|
+
[Fo]: l.maxX,
|
|
1380
|
+
[Ro]: l.minY,
|
|
1381
|
+
[Bo]: l.maxY,
|
|
1382
|
+
[Uo]: l.minZ,
|
|
1383
|
+
[Oo]: l.maxZ
|
|
1384
1384
|
},
|
|
1385
1385
|
[h.buffer]
|
|
1386
1386
|
);
|
|
@@ -1390,27 +1390,27 @@ function Wo(i) {
|
|
|
1390
1390
|
const e = (a, ...o) => i.fire(a, ...o), t = (a, o, s) => i.on(a, o, s), n = new Set(Ka.split(""));
|
|
1391
1391
|
t(Rs, async (a = "", o = !0, s = !0) => {
|
|
1392
1392
|
const r = a.trim().substring(0, 100);
|
|
1393
|
-
let c = await e(
|
|
1393
|
+
let c = await e(rs, r), u = [];
|
|
1394
1394
|
for (let S = 0; S < c.length; S++) {
|
|
1395
1395
|
let v = [], k = c[S];
|
|
1396
1396
|
for (let b = 0; b < k.length; b++)
|
|
1397
1397
|
v.push([(k[b] % 20 - 10) * 0.02, ((k[b] / 20 | 0) - 10) * 0.02]);
|
|
1398
1398
|
u.push(v);
|
|
1399
1399
|
}
|
|
1400
|
-
let
|
|
1401
|
-
for (let S = 0; S <
|
|
1402
|
-
|
|
1403
|
-
let h =
|
|
1400
|
+
let d = [], l = r.split("");
|
|
1401
|
+
for (let S = 0; S < l.length; S++)
|
|
1402
|
+
d[S] = n.has(l[S]) ? 0.22 : 0.4;
|
|
1403
|
+
let h = l.length / 2 | 0, f = d[h] / 2, p = !(l.length % 2), m = p ? 0 : -f;
|
|
1404
1404
|
for (let S = h - 1; S >= 0; S--) {
|
|
1405
|
-
m -=
|
|
1405
|
+
m -= d[S] / 2;
|
|
1406
1406
|
for (let v of u[S]) v[0] += m;
|
|
1407
|
-
m -=
|
|
1407
|
+
m -= d[S] / 2;
|
|
1408
1408
|
}
|
|
1409
|
-
f =
|
|
1409
|
+
f = d[h] / 2, m = p ? 0 : f;
|
|
1410
1410
|
for (let S = u.length - h; S < u.length; S++) {
|
|
1411
|
-
m +=
|
|
1411
|
+
m += d[S] / 2;
|
|
1412
1412
|
for (let v of u[S]) v[0] += m;
|
|
1413
|
-
m +=
|
|
1413
|
+
m += d[S] / 2;
|
|
1414
1414
|
}
|
|
1415
1415
|
let g = 0;
|
|
1416
1416
|
for (let S of u)
|
|
@@ -1423,15 +1423,15 @@ function Wo(i) {
|
|
|
1423
1423
|
return y;
|
|
1424
1424
|
});
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function ei(i) {
|
|
1427
1427
|
const e = (t, n, a) => i.on(t, n, a);
|
|
1428
|
-
e(
|
|
1428
|
+
e(Le, (t) => {
|
|
1429
1429
|
t.url;
|
|
1430
1430
|
const n = { ...t };
|
|
1431
1431
|
delete n.url;
|
|
1432
1432
|
const a = JSON.stringify(n, null, 2);
|
|
1433
1433
|
console.info(a);
|
|
1434
|
-
}), e(
|
|
1434
|
+
}), e(rs, (t = "") => {
|
|
1435
1435
|
const n = "https://reall3d.com/gsfont/api/getGaussianText", a = new FormData();
|
|
1436
1436
|
return a.append("text", t.substring(0, 100)), a.append("ver", Yt), new Promise((o) => {
|
|
1437
1437
|
fetch(n, { method: "POST", body: a }).then((s) => s.ok ? s.json() : {}).then((s) => s.success ? o(JSON.parse(s.data)) : o([])).catch((s) => o([]));
|
|
@@ -1441,16 +1441,16 @@ function Jn(i) {
|
|
|
1441
1441
|
function Yo(i) {
|
|
1442
1442
|
let e = !1;
|
|
1443
1443
|
const t = (r, c, u) => i.on(r, c, u), n = (r, ...c) => i.fire(r, ...c);
|
|
1444
|
-
t(
|
|
1444
|
+
t(ws, () => e = !0);
|
|
1445
1445
|
const a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
1446
1446
|
t(It, () => n(re) && a.set(Date.now(), 1)), t(Dt, () => n(re) && n(Ye, a)), t(Pt, () => n(re) && o.set(Date.now(), 1)), t(Lt, () => n(re) && n(Ye, o)), t(
|
|
1447
1447
|
Oe,
|
|
1448
1448
|
() => {
|
|
1449
1449
|
e || (n(Pt), n(re) && n(oe, {
|
|
1450
1450
|
fov: n(ft),
|
|
1451
|
-
position: n(
|
|
1452
|
-
lookAt: n(
|
|
1453
|
-
lookUp: n(
|
|
1451
|
+
position: n(Fe, n(Ce)),
|
|
1452
|
+
lookAt: n(Fe, n(we)),
|
|
1453
|
+
lookUp: n(Fe, n(Ne))
|
|
1454
1454
|
}));
|
|
1455
1455
|
},
|
|
1456
1456
|
!0
|
|
@@ -1459,21 +1459,21 @@ function Yo(i) {
|
|
|
1459
1459
|
t(
|
|
1460
1460
|
Ve,
|
|
1461
1461
|
() => {
|
|
1462
|
-
e || (n(
|
|
1462
|
+
e || (n(us), n(re) && (n(It), !(s++ % 5) && n(oe, { fps: n(Dt), realFps: n(Lt) })));
|
|
1463
1463
|
},
|
|
1464
1464
|
!0
|
|
1465
1465
|
), t(Ye, (r) => {
|
|
1466
|
-
let c = [], u = Date.now(),
|
|
1467
|
-
for (const
|
|
1468
|
-
u -
|
|
1469
|
-
return c.forEach((
|
|
1466
|
+
let c = [], u = Date.now(), d = 0;
|
|
1467
|
+
for (const l of r.keys())
|
|
1468
|
+
u - l <= 1e3 ? d++ : c.push(l);
|
|
1469
|
+
return c.forEach((l) => r.delete(l)), Math.min(d, 30);
|
|
1470
1470
|
}), window.addEventListener("beforeunload", () => n(Ht));
|
|
1471
1471
|
}
|
|
1472
1472
|
function Vo(i) {
|
|
1473
1473
|
const e = { ...i };
|
|
1474
1474
|
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.shDegree ?? (e.shDegree = 0), e.depthTest ?? (e.depthTest = !0), e.debugMode ?? (e.debugMode = !1), e.maxRenderCountOfMobile ?? (e.maxRenderCountOfMobile = e.bigSceneMode ? 256 * 1e4 : 384 * 10240), e.maxRenderCountOfPc ?? (e.maxRenderCountOfPc = e.bigSceneMode ? 320 * 1e4 : 384 * 1e4), e;
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1476
|
+
function Gi(i) {
|
|
1477
1477
|
const e = { ...i };
|
|
1478
1478
|
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.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.background ?? (e.background = "#000000"), e;
|
|
1479
1479
|
}
|
|
@@ -1481,14 +1481,14 @@ function Go(i) {
|
|
|
1481
1481
|
let e;
|
|
1482
1482
|
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));
|
|
1483
1483
|
let t = null;
|
|
1484
|
-
return i.renderer ? t = i.renderer : (t = new
|
|
1484
|
+
return i.renderer ? t = i.renderer : (t = new ns({ antialias: !1, stencil: !0, logarithmicDepthBuffer: !0, precision: "highp" }), t.setSize(e.clientWidth, e.clientHeight), t.setPixelRatio(Math.min(devicePixelRatio, 2)), i.renderer = t), t.domElement.classList.add("gsviewer-canvas"), e.appendChild(t.domElement), t;
|
|
1485
1485
|
}
|
|
1486
1486
|
function No(i) {
|
|
1487
1487
|
let e = i.camera;
|
|
1488
1488
|
if (!e) {
|
|
1489
1489
|
const t = i.renderer.domElement, n = t.width / t.height;
|
|
1490
1490
|
let a = new C().fromArray(i.lookUp), o = new C().fromArray(i.lookAt), s = new C().fromArray(i.position);
|
|
1491
|
-
e = new
|
|
1491
|
+
e = new is(i.fov, n, i.near, i.far), e.position.copy(s), e.up.copy(a).normalize(), e.lookAt(o), i.camera = e;
|
|
1492
1492
|
}
|
|
1493
1493
|
return i.camera;
|
|
1494
1494
|
}
|
|
@@ -1498,7 +1498,7 @@ function Xo(i) {
|
|
|
1498
1498
|
}
|
|
1499
1499
|
function $o(i) {
|
|
1500
1500
|
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" });
|
|
1501
|
-
e(
|
|
1501
|
+
e(ls, () => o), e(fs, () => o.postMessage({ [Do]: t(ps) })), e(gs, () => o.terminate()), (async () => o.postMessage({ [zo]: !0, [Io]: await t(ot), [_o]: t(ee) }))();
|
|
1502
1502
|
}
|
|
1503
1503
|
class pe extends te {
|
|
1504
1504
|
/**
|
|
@@ -1507,11 +1507,11 @@ class pe extends te {
|
|
|
1507
1507
|
*/
|
|
1508
1508
|
constructor(e) {
|
|
1509
1509
|
super(), this.isSplatMesh = !0, this.disposed = !1;
|
|
1510
|
-
const t = new
|
|
1511
|
-
n(I, () => o), n(Ke, () => o.renderer.domElement), n(V, () => s), n(ft, () => s.fov), n(
|
|
1512
|
-
a(
|
|
1510
|
+
const t = new $n(), n = (r, c, u) => t.on(r, c, u), a = (r, ...c) => t.fire(r, ...c), o = Vo(e), s = o.controls.object;
|
|
1511
|
+
n(I, () => o), n(Ke, () => o.renderer.domElement), n(V, () => s), n(ft, () => s.fov), n(Ce, (r = !1) => r ? s.position.clone() : s.position), n(we, (r = !1) => r ? o.controls.target.clone() : o.controls.target), n(ps, () => 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(pn, () => o.pointcloudMode), n(ye, () => this), n(N, () => o.viewerEvents?.fire(J)), Jn(t), ei(t), go(t), $o(t), Ho(t), Wo(t), this.name = `${o.name || this.id}`, this.events = t, this.opts = o, (async () => (this.copy(await t.fire(ms)), o.matrix && this.applyMatrix4(o.matrix), this.frustumCulled = !1, this.onBeforeRender = () => {
|
|
1512
|
+
a(fs), a(As, performance.now());
|
|
1513
1513
|
}, this.onAfterRender = () => {
|
|
1514
|
-
a(
|
|
1514
|
+
a(bs, 1e4) && a(N);
|
|
1515
1515
|
}))();
|
|
1516
1516
|
}
|
|
1517
1517
|
/**
|
|
@@ -1530,7 +1530,7 @@ class pe extends te {
|
|
|
1530
1530
|
* @param meta 元数据
|
|
1531
1531
|
*/
|
|
1532
1532
|
async addModel(e, t = {}) {
|
|
1533
|
-
this.disposed || (this.meta = t, await this.events.fire(
|
|
1533
|
+
this.disposed || (this.meta = t, await this.events.fire(Ss, e, t));
|
|
1534
1534
|
}
|
|
1535
1535
|
fire(e, ...t) {
|
|
1536
1536
|
if (!this.disposed)
|
|
@@ -1543,20 +1543,20 @@ class pe extends te {
|
|
|
1543
1543
|
if (this.disposed) return;
|
|
1544
1544
|
this.disposed = !0;
|
|
1545
1545
|
const e = (t, ...n) => this.events.fire(t, ...n);
|
|
1546
|
-
e(
|
|
1546
|
+
e(Ee, this), e(B).remove(this), e(Un), e(xs), e(gs), e(Cs), this.events.clear(), this.events = null, this.opts = null, this.onAfterRender = null;
|
|
1547
1547
|
}
|
|
1548
1548
|
}
|
|
1549
|
-
class Ko extends
|
|
1549
|
+
class Ko extends Dn {
|
|
1550
1550
|
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) {
|
|
1551
1551
|
super(), this._axis = new C(), this.type = "ArrowHelper";
|
|
1552
|
-
const c = new
|
|
1552
|
+
const c = new ni(a, a, n, 32);
|
|
1553
1553
|
c.translate(0, n / 2, 0);
|
|
1554
|
-
const u = new
|
|
1554
|
+
const u = new ni(0, r, s, 32);
|
|
1555
1555
|
u.translate(0, n, 0), this.position.copy(t);
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1558
|
-
const
|
|
1559
|
-
|
|
1556
|
+
const d = new Me({ color: o, toneMapped: !1 });
|
|
1557
|
+
d.side = ve, this.line = new te(c, d), this.line.matrixAutoUpdate = !1, this.line.ignoreIntersect = !0, this.add(this.line);
|
|
1558
|
+
const l = new Me({ color: o, toneMapped: !1 });
|
|
1559
|
+
l.side = ve, this.cone = new te(u, l), this.cone.matrixAutoUpdate = !1, this.cone.ignoreIntersect = !0, this.add(this.cone), this.setDirection(e), this.renderOrder = 99999;
|
|
1560
1560
|
}
|
|
1561
1561
|
setDirection(e) {
|
|
1562
1562
|
if (e.y > 0.99999)
|
|
@@ -1582,23 +1582,23 @@ class Ko extends In {
|
|
|
1582
1582
|
function Zo(i) {
|
|
1583
1583
|
const e = (m, g, y) => i.on(m, g, y), t = (m, ...g) => i.fire(m, ...g), n = new ua(1, 1);
|
|
1584
1584
|
n.rotateX(-Math.PI / 2);
|
|
1585
|
-
const a = new
|
|
1586
|
-
a.transparent = !0, a.opacity = 0.6, a.depthTest = !1, a.depthWrite = !1, a.side =
|
|
1585
|
+
const a = new Me({ color: 16777215 });
|
|
1586
|
+
a.transparent = !0, a.opacity = 0.6, a.depthTest = !1, a.depthWrite = !1, a.side = ve;
|
|
1587
1587
|
const o = new te(n, a);
|
|
1588
1588
|
o.ignoreIntersect = !0;
|
|
1589
1589
|
const s = new C(0, -1, 0);
|
|
1590
1590
|
s.normalize();
|
|
1591
|
-
const r = new C(0, 0, 0), c = 0.5, u = 0.01,
|
|
1591
|
+
const r = new C(0, 0, 0), c = 0.5, u = 0.01, d = 16777062, l = 0.1, h = 0.03, f = new Ko(s, r, c, u, d, l, h), p = new Dn();
|
|
1592
1592
|
p.add(o), p.add(f), p.renderOrder = 99999, o.renderOrder = 99999, p.visible = !1, t(B).add(p), e(La, () => p), e(Tt, (m) => {
|
|
1593
1593
|
t(Rt, !0), p.visible = m === void 0 ? !p.visible : m, t(J);
|
|
1594
|
-
}), e(
|
|
1594
|
+
}), e(zn, () => p.visible), e(Rt, (m = !1) => {
|
|
1595
1595
|
if (m || p.visible) {
|
|
1596
1596
|
const g = new _t(), y = new C(0, -1, 0);
|
|
1597
|
-
g.setFromUnitVectors(y, t(Ne)), p.position.copy(t(
|
|
1597
|
+
g.setFromUnitVectors(y, t(Ne)), p.position.copy(t(we)), p.quaternion.copy(g);
|
|
1598
1598
|
}
|
|
1599
1599
|
});
|
|
1600
1600
|
}
|
|
1601
|
-
const
|
|
1601
|
+
const Ni = { type: "change" }, ti = { type: "start" }, ea = { type: "end" }, At = new pa(), Xi = new fa(), jo = Math.cos(70 * xe.DEG2RAD), G = new C(), ae = 2 * Math.PI, H = {
|
|
1602
1602
|
NONE: -1,
|
|
1603
1603
|
ROTATE: 0,
|
|
1604
1604
|
DOLLY: 1,
|
|
@@ -1610,7 +1610,7 @@ const Gi = { type: "change" }, ei = { type: "start" }, ea = { type: "end" }, At
|
|
|
1610
1610
|
}, nn = 1e-6;
|
|
1611
1611
|
class ta extends ha {
|
|
1612
1612
|
constructor(e, t = null) {
|
|
1613
|
-
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:
|
|
1613
|
+
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: be.ROTATE, TWO: be.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 _t(), this._lastTargetPosition = new C(), this._quat = new _t().setFromUnitVectors(e.up, new C(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new ii(), this._sphericalDelta = new ii(), 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();
|
|
1614
1614
|
}
|
|
1615
1615
|
connect() {
|
|
1616
1616
|
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";
|
|
@@ -1640,7 +1640,7 @@ class ta extends ha {
|
|
|
1640
1640
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
|
1641
1641
|
}
|
|
1642
1642
|
reset() {
|
|
1643
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
1643
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Ni), this.update(), this.state = H.NONE;
|
|
1644
1644
|
}
|
|
1645
1645
|
update(e = null) {
|
|
1646
1646
|
const t = this.object.position;
|
|
@@ -1670,12 +1670,12 @@ class ta extends ha {
|
|
|
1670
1670
|
u.unproject(this.object), this.object.position.sub(u).add(r), this.object.updateMatrixWorld(), s = G.length();
|
|
1671
1671
|
} else
|
|
1672
1672
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
1673
|
-
s !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position) : (At.origin.copy(this.object.position), At.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(At.direction)) < jo ? this.object.lookAt(this.target) : (
|
|
1673
|
+
s !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position) : (At.origin.copy(this.object.position), At.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(At.direction)) < jo ? this.object.lookAt(this.target) : (Xi.setFromNormalAndCoplanarPoint(this.object.up, this.target), At.intersectPlane(Xi, this.target))));
|
|
1674
1674
|
} else if (this.object.isOrthographicCamera) {
|
|
1675
1675
|
const s = this.object.zoom;
|
|
1676
1676
|
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);
|
|
1677
1677
|
}
|
|
1678
|
-
return this._scale = 1, this._performCursorZoom = !1, o || this._lastPosition.distanceToSquared(this.object.position) > nn || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > nn || this._lastTargetPosition.distanceToSquared(this.target) > nn ? (this.dispatchEvent(
|
|
1678
|
+
return this._scale = 1, this._performCursorZoom = !1, o || this._lastPosition.distanceToSquared(this.object.position) > nn || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > nn || this._lastTargetPosition.distanceToSquared(this.target) > nn ? (this.dispatchEvent(Ni), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
1679
1679
|
}
|
|
1680
1680
|
_getAutoRotationAngle(e) {
|
|
1681
1681
|
return e !== null ? ae / 60 * this.autoRotateSpeed * e : ae / 60 / 60 * this.autoRotateSpeed;
|
|
@@ -1925,7 +1925,7 @@ function tr(i) {
|
|
|
1925
1925
|
default:
|
|
1926
1926
|
this.state = H.NONE;
|
|
1927
1927
|
}
|
|
1928
|
-
this.state !== H.NONE && this.dispatchEvent(
|
|
1928
|
+
this.state !== H.NONE && this.dispatchEvent(ti);
|
|
1929
1929
|
}
|
|
1930
1930
|
function nr(i) {
|
|
1931
1931
|
switch (this.state) {
|
|
@@ -1944,7 +1944,7 @@ function nr(i) {
|
|
|
1944
1944
|
}
|
|
1945
1945
|
}
|
|
1946
1946
|
function ir(i) {
|
|
1947
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== H.NONE || (i.preventDefault(), this.dispatchEvent(
|
|
1947
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== H.NONE || (i.preventDefault(), this.dispatchEvent(ti), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(ea));
|
|
1948
1948
|
}
|
|
1949
1949
|
function sr(i) {
|
|
1950
1950
|
this.enabled !== !1 && this._handleKeyDown(i);
|
|
@@ -1953,11 +1953,11 @@ function ar(i) {
|
|
|
1953
1953
|
switch (this._trackPointer(i), this._pointers.length) {
|
|
1954
1954
|
case 1:
|
|
1955
1955
|
switch (this.touches.ONE) {
|
|
1956
|
-
case
|
|
1956
|
+
case be.ROTATE:
|
|
1957
1957
|
if (this.enableRotate === !1) return;
|
|
1958
1958
|
this._handleTouchStartRotate(i), this.state = H.TOUCH_ROTATE;
|
|
1959
1959
|
break;
|
|
1960
|
-
case
|
|
1960
|
+
case be.PAN:
|
|
1961
1961
|
if (this.enablePan === !1) return;
|
|
1962
1962
|
this._handleTouchStartPan(i), this.state = H.TOUCH_PAN;
|
|
1963
1963
|
break;
|
|
@@ -1967,11 +1967,11 @@ function ar(i) {
|
|
|
1967
1967
|
break;
|
|
1968
1968
|
case 2:
|
|
1969
1969
|
switch (this.touches.TWO) {
|
|
1970
|
-
case
|
|
1970
|
+
case be.DOLLY_PAN:
|
|
1971
1971
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
1972
1972
|
this._handleTouchStartDollyPan(i), this.state = H.TOUCH_DOLLY_PAN;
|
|
1973
1973
|
break;
|
|
1974
|
-
case
|
|
1974
|
+
case be.DOLLY_ROTATE:
|
|
1975
1975
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
1976
1976
|
this._handleTouchStartDollyRotate(i), this.state = H.TOUCH_DOLLY_ROTATE;
|
|
1977
1977
|
break;
|
|
@@ -1982,7 +1982,7 @@ function ar(i) {
|
|
|
1982
1982
|
default:
|
|
1983
1983
|
this.state = H.NONE;
|
|
1984
1984
|
}
|
|
1985
|
-
this.state !== H.NONE && this.dispatchEvent(
|
|
1985
|
+
this.state !== H.NONE && this.dispatchEvent(ti);
|
|
1986
1986
|
}
|
|
1987
1987
|
function or(i) {
|
|
1988
1988
|
switch (this._trackPointer(i), this.state) {
|
|
@@ -2035,15 +2035,15 @@ class dr extends ta {
|
|
|
2035
2035
|
}
|
|
2036
2036
|
class ur extends ta {
|
|
2037
2037
|
constructor(e, t) {
|
|
2038
|
-
super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Ae.PAN, MIDDLE: Ae.DOLLY, RIGHT: Ae.ROTATE }, this.touches = { ONE:
|
|
2038
|
+
super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Ae.PAN, MIDDLE: Ae.DOLLY, RIGHT: Ae.ROTATE }, this.touches = { ONE: be.PAN, TWO: be.DOLLY_ROTATE };
|
|
2039
2039
|
}
|
|
2040
2040
|
}
|
|
2041
|
-
const
|
|
2041
|
+
const $i = new Pn(), wt = new C();
|
|
2042
2042
|
class na extends rn {
|
|
2043
2043
|
constructor() {
|
|
2044
2044
|
super(), this.isLineSegmentsGeometry = !0, this.type = "LineSegmentsGeometry";
|
|
2045
2045
|
const e = [-1, 2, 0, 1, 2, 0, -1, 1, 0, 1, 1, 0, -1, 0, 0, 1, 0, 0, -1, -1, 0, 1, -1, 0], t = [-1, 2, 1, 2, -1, 1, 1, 1, -1, -1, 1, -1, -1, -2, 1, -2], n = [0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5];
|
|
2046
|
-
this.setIndex(n), this.setAttribute("position", new
|
|
2046
|
+
this.setIndex(n), this.setAttribute("position", new si(e, 3)), this.setAttribute("uv", new si(t, 2));
|
|
2047
2047
|
}
|
|
2048
2048
|
applyMatrix4(e) {
|
|
2049
2049
|
const t = this.attributes.instanceStart, n = this.attributes.instanceEnd;
|
|
@@ -2075,9 +2075,9 @@ class na extends rn {
|
|
|
2075
2075
|
return this.setPositions(t.attributes.position.array), this;
|
|
2076
2076
|
}
|
|
2077
2077
|
computeBoundingBox() {
|
|
2078
|
-
this.boundingBox === null && (this.boundingBox = new
|
|
2078
|
+
this.boundingBox === null && (this.boundingBox = new Pn());
|
|
2079
2079
|
const e = this.attributes.instanceStart, t = this.attributes.instanceEnd;
|
|
2080
|
-
e !== void 0 && t !== void 0 && (this.boundingBox.setFromBufferAttribute(e),
|
|
2080
|
+
e !== void 0 && t !== void 0 && (this.boundingBox.setFromBufferAttribute(e), $i.setFromBufferAttribute(t), this.boundingBox.union($i));
|
|
2081
2081
|
}
|
|
2082
2082
|
computeBoundingSphere() {
|
|
2083
2083
|
this.boundingSphere === null && (this.boundingSphere = new tt()), this.boundingBox === null && this.computeBoundingBox();
|
|
@@ -2108,7 +2108,7 @@ xt.line = {
|
|
|
2108
2108
|
// todo FIX - maybe change to totalSize
|
|
2109
2109
|
};
|
|
2110
2110
|
bt.line = {
|
|
2111
|
-
uniforms:
|
|
2111
|
+
uniforms: ss.merge([
|
|
2112
2112
|
xt.common,
|
|
2113
2113
|
xt.fog,
|
|
2114
2114
|
xt.line
|
|
@@ -2492,11 +2492,11 @@ bt.line = {
|
|
|
2492
2492
|
`
|
|
2493
2493
|
)
|
|
2494
2494
|
};
|
|
2495
|
-
class Xe extends
|
|
2495
|
+
class Xe extends In {
|
|
2496
2496
|
constructor(e) {
|
|
2497
2497
|
super({
|
|
2498
2498
|
type: "LineMaterial",
|
|
2499
|
-
uniforms:
|
|
2499
|
+
uniforms: ss.clone(bt.line.uniforms),
|
|
2500
2500
|
vertexShader: bt.line.vertexShader,
|
|
2501
2501
|
fragmentShader: bt.line.fragmentShader,
|
|
2502
2502
|
clipping: !0
|
|
@@ -2570,20 +2570,20 @@ class Xe extends _n {
|
|
|
2570
2570
|
this.defines && (e === !0 !== this.alphaToCoverage && (this.needsUpdate = !0), e === !0 ? this.defines.USE_ALPHA_TO_COVERAGE = "" : delete this.defines.USE_ALPHA_TO_COVERAGE);
|
|
2571
2571
|
}
|
|
2572
2572
|
}
|
|
2573
|
-
const sn = new
|
|
2574
|
-
let ge,
|
|
2575
|
-
function
|
|
2576
|
-
return ue.set(0, 0, -e, 1).applyMatrix4(i.projectionMatrix), ue.multiplyScalar(1 / ue.w), ue.x =
|
|
2573
|
+
const sn = new Se(), Ki = new C(), Zi = new C(), $ = new Se(), K = new Se(), de = new Se(), an = new C(), on = new $e(), Z = new ma(), ji = new C(), vt = new Pn(), St = new tt(), ue = new Se();
|
|
2574
|
+
let ge, Re;
|
|
2575
|
+
function qi(i, e, t) {
|
|
2576
|
+
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));
|
|
2577
2577
|
}
|
|
2578
2578
|
function hr(i, e) {
|
|
2579
2579
|
const t = i.matrixWorld, n = i.geometry, a = n.attributes.instanceStart, o = n.attributes.instanceEnd, s = Math.min(n.instanceCount, a.count);
|
|
2580
2580
|
for (let r = 0, c = s; r < c; r++) {
|
|
2581
2581
|
Z.start.fromBufferAttribute(a, r), Z.end.fromBufferAttribute(o, r), Z.applyMatrix4(t);
|
|
2582
|
-
const u = new C(),
|
|
2583
|
-
ge.distanceSqToSegment(Z.start, Z.end,
|
|
2584
|
-
point:
|
|
2582
|
+
const u = new C(), d = new C();
|
|
2583
|
+
ge.distanceSqToSegment(Z.start, Z.end, d, u), d.distanceTo(u) < Re * 0.5 && e.push({
|
|
2584
|
+
point: d,
|
|
2585
2585
|
pointOnLine: u,
|
|
2586
|
-
distance: ge.origin.distanceTo(
|
|
2586
|
+
distance: ge.origin.distanceTo(d),
|
|
2587
2587
|
object: i,
|
|
2588
2588
|
face: null,
|
|
2589
2589
|
faceIndex: r,
|
|
@@ -2593,22 +2593,22 @@ function hr(i, e) {
|
|
|
2593
2593
|
}
|
|
2594
2594
|
}
|
|
2595
2595
|
function pr(i, e, t) {
|
|
2596
|
-
const n = e.projectionMatrix, o = i.material.resolution, s = i.matrixWorld, r = i.geometry, c = r.attributes.instanceStart, u = r.attributes.instanceEnd,
|
|
2596
|
+
const n = e.projectionMatrix, o = i.material.resolution, s = i.matrixWorld, r = i.geometry, c = r.attributes.instanceStart, u = r.attributes.instanceEnd, d = Math.min(r.instanceCount, c.count), l = -e.near;
|
|
2597
2597
|
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, an.copy(de), on.multiplyMatrices(e.matrixWorldInverse, s);
|
|
2598
|
-
for (let h = 0, f =
|
|
2599
|
-
if ($.fromBufferAttribute(c, h), K.fromBufferAttribute(u, h), $.w = 1, K.w = 1, $.applyMatrix4(on), K.applyMatrix4(on), $.z >
|
|
2598
|
+
for (let h = 0, f = d; h < f; h++) {
|
|
2599
|
+
if ($.fromBufferAttribute(c, h), K.fromBufferAttribute(u, h), $.w = 1, K.w = 1, $.applyMatrix4(on), K.applyMatrix4(on), $.z > l && K.z > l)
|
|
2600
2600
|
continue;
|
|
2601
|
-
if ($.z >
|
|
2602
|
-
const S = $.z - K.z, v = ($.z -
|
|
2601
|
+
if ($.z > l) {
|
|
2602
|
+
const S = $.z - K.z, v = ($.z - l) / S;
|
|
2603
2603
|
$.lerp(K, v);
|
|
2604
|
-
} else if (K.z >
|
|
2605
|
-
const S = K.z - $.z, v = (K.z -
|
|
2604
|
+
} else if (K.z > l) {
|
|
2605
|
+
const S = K.z - $.z, v = (K.z - l) / S;
|
|
2606
2606
|
K.lerp($, v);
|
|
2607
2607
|
}
|
|
2608
2608
|
$.applyMatrix4(n), K.applyMatrix4(n), $.multiplyScalar(1 / $.w), K.multiplyScalar(1 / K.w), $.x *= o.x / 2, $.y *= o.y / 2, K.x *= o.x / 2, K.y *= o.y / 2, Z.start.copy($), Z.start.z = 0, Z.end.copy(K), Z.end.z = 0;
|
|
2609
2609
|
const m = Z.closestPointToPointParameter(an, !0);
|
|
2610
|
-
Z.at(m,
|
|
2611
|
-
const g =
|
|
2610
|
+
Z.at(m, ji);
|
|
2611
|
+
const g = xe.lerp($.z, K.z, m), y = g >= -1 && g <= 1, M = an.distanceTo(ji) < Re * 0.5;
|
|
2612
2612
|
if (y && M) {
|
|
2613
2613
|
Z.start.fromBufferAttribute(c, h), Z.end.fromBufferAttribute(u, h), Z.start.applyMatrix4(s), Z.end.applyMatrix4(s);
|
|
2614
2614
|
const S = new C(), v = new C();
|
|
@@ -2633,7 +2633,7 @@ class fr extends te {
|
|
|
2633
2633
|
computeLineDistances() {
|
|
2634
2634
|
const e = this.geometry, t = e.attributes.instanceStart, n = e.attributes.instanceEnd, a = new Float32Array(2 * t.count);
|
|
2635
2635
|
for (let s = 0, r = 0, c = t.count; s < c; s++, r += 2)
|
|
2636
|
-
|
|
2636
|
+
Ki.fromBufferAttribute(t, s), Zi.fromBufferAttribute(n, s), a[r] = r === 0 ? 0 : a[r - 1], a[r + 1] = a[r] + Ki.distanceTo(Zi);
|
|
2637
2637
|
const o = new cn(a, 2, 1);
|
|
2638
2638
|
return e.setAttribute("instanceDistanceStart", new We(o, 1, 0)), e.setAttribute("instanceDistanceEnd", new We(o, 1, 1)), this;
|
|
2639
2639
|
}
|
|
@@ -2643,25 +2643,25 @@ class fr extends te {
|
|
|
2643
2643
|
const o = e.params.Line2 !== void 0 && e.params.Line2.threshold || 0;
|
|
2644
2644
|
ge = e.ray;
|
|
2645
2645
|
const s = this.matrixWorld, r = this.geometry, c = this.material;
|
|
2646
|
-
|
|
2646
|
+
Re = c.linewidth + o, r.boundingSphere === null && r.computeBoundingSphere(), St.copy(r.boundingSphere).applyMatrix4(s);
|
|
2647
2647
|
let u;
|
|
2648
2648
|
if (n)
|
|
2649
|
-
u =
|
|
2649
|
+
u = Re * 0.5;
|
|
2650
2650
|
else {
|
|
2651
|
-
const
|
|
2652
|
-
u =
|
|
2651
|
+
const l = Math.max(a.near, St.distanceToPoint(ge.origin));
|
|
2652
|
+
u = qi(a, l, c.resolution);
|
|
2653
2653
|
}
|
|
2654
2654
|
if (St.radius += u, ge.intersectsSphere(St) === !1)
|
|
2655
2655
|
return;
|
|
2656
2656
|
r.boundingBox === null && r.computeBoundingBox(), vt.copy(r.boundingBox).applyMatrix4(s);
|
|
2657
|
-
let
|
|
2657
|
+
let d;
|
|
2658
2658
|
if (n)
|
|
2659
|
-
|
|
2659
|
+
d = Re * 0.5;
|
|
2660
2660
|
else {
|
|
2661
|
-
const
|
|
2662
|
-
|
|
2661
|
+
const l = Math.max(a.near, vt.distanceToPoint(ge.origin));
|
|
2662
|
+
d = qi(a, l, c.resolution);
|
|
2663
2663
|
}
|
|
2664
|
-
vt.expandByScalar(
|
|
2664
|
+
vt.expandByScalar(d), ge.intersectsBox(vt) !== !1 && (n ? hr(this, t) : pr(this, a, t));
|
|
2665
2665
|
}
|
|
2666
2666
|
onBeforeRender(e) {
|
|
2667
2667
|
const t = this.material.uniforms;
|
|
@@ -2695,13 +2695,13 @@ class pt extends na {
|
|
|
2695
2695
|
return this.setPositions(t.attributes.position.array), this;
|
|
2696
2696
|
}
|
|
2697
2697
|
}
|
|
2698
|
-
class
|
|
2698
|
+
class Be extends fr {
|
|
2699
2699
|
constructor(e = new pt(), t = new Xe({ color: Math.random() * 16777215 })) {
|
|
2700
2700
|
super(e, t), this.isLine2 = !0, this.type = "Line2";
|
|
2701
2701
|
}
|
|
2702
2702
|
}
|
|
2703
|
-
const
|
|
2704
|
-
class mr extends
|
|
2703
|
+
const Ji = new C(), gr = new _t(), es = new C();
|
|
2704
|
+
class mr extends Dn {
|
|
2705
2705
|
constructor(e = document.createElement("div")) {
|
|
2706
2706
|
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() {
|
|
2707
2707
|
this.traverse(function(t) {
|
|
@@ -2733,8 +2733,8 @@ class Ar {
|
|
|
2733
2733
|
c.style.overflow = "hidden", this.domElement = c;
|
|
2734
2734
|
const u = document.createElement("div");
|
|
2735
2735
|
u.style.transformOrigin = "0 0", u.style.pointerEvents = "none", c.appendChild(u);
|
|
2736
|
-
const
|
|
2737
|
-
|
|
2736
|
+
const d = document.createElement("div");
|
|
2737
|
+
d.style.transformStyle = "preserve-3d", u.appendChild(d), this.getSize = function() {
|
|
2738
2738
|
return {
|
|
2739
2739
|
width: n,
|
|
2740
2740
|
height: a
|
|
@@ -2744,21 +2744,21 @@ class Ar {
|
|
|
2744
2744
|
y.view && y.view.enabled ? (u.style.transform = `translate( ${-y.view.offsetX * (n / y.view.width)}px, ${-y.view.offsetY * (a / y.view.height)}px )`, u.style.transform += `scale( ${y.view.fullWidth / y.view.width}, ${y.view.fullHeight / y.view.height} )`) : u.style.transform = "", g.matrixWorldAutoUpdate === !0 && g.updateMatrixWorld(), y.parent === null && y.matrixWorldAutoUpdate === !0 && y.updateMatrixWorld();
|
|
2745
2745
|
let S, v;
|
|
2746
2746
|
y.isOrthographicCamera && (S = -(y.right + y.left) / 2, v = (y.top + y.bottom) / 2);
|
|
2747
|
-
const k = y.view && y.view.enabled ? y.view.height / y.view.fullHeight : 1, b = y.isOrthographicCamera ? `scale( ${k} )scale(` + M + ")translate(" +
|
|
2748
|
-
r.camera.style !== w && (
|
|
2747
|
+
const k = y.view && y.view.enabled ? y.view.height / y.view.fullHeight : 1, b = y.isOrthographicCamera ? `scale( ${k} )scale(` + M + ")translate(" + l(S) + "px," + l(v) + "px)" + h(y.matrixWorldInverse) : `scale( ${k} )translateZ(` + M + "px)" + h(y.matrixWorldInverse), w = (y.isPerspectiveCamera ? "perspective(" + M + "px) " : "") + b + "translate(" + o + "px," + s + "px)";
|
|
2748
|
+
r.camera.style !== w && (d.style.transform = w, r.camera.style = w), m(g, g, y);
|
|
2749
2749
|
}, this.setSize = function(g, y) {
|
|
2750
|
-
n = g, a = y, o = n / 2, s = a / 2, c.style.width = g + "px", c.style.height = y + "px", u.style.width = g + "px", u.style.height = y + "px",
|
|
2750
|
+
n = g, a = y, o = n / 2, s = a / 2, c.style.width = g + "px", c.style.height = y + "px", u.style.width = g + "px", u.style.height = y + "px", d.style.width = g + "px", d.style.height = y + "px";
|
|
2751
2751
|
};
|
|
2752
|
-
function
|
|
2752
|
+
function l(g) {
|
|
2753
2753
|
return Math.abs(g) < 1e-10 ? 0 : g;
|
|
2754
2754
|
}
|
|
2755
2755
|
function h(g) {
|
|
2756
2756
|
const y = g.elements;
|
|
2757
|
-
return "matrix3d(" +
|
|
2757
|
+
return "matrix3d(" + l(y[0]) + "," + l(-y[1]) + "," + l(y[2]) + "," + l(y[3]) + "," + l(y[4]) + "," + l(-y[5]) + "," + l(y[6]) + "," + l(y[7]) + "," + l(y[8]) + "," + l(-y[9]) + "," + l(y[10]) + "," + l(y[11]) + "," + l(y[12]) + "," + l(-y[13]) + "," + l(y[14]) + "," + l(y[15]) + ")";
|
|
2758
2758
|
}
|
|
2759
2759
|
function f(g) {
|
|
2760
2760
|
const y = g.elements;
|
|
2761
|
-
return "translate(-50%,-50%)" + ("matrix3d(" +
|
|
2761
|
+
return "translate(-50%,-50%)" + ("matrix3d(" + l(y[0]) + "," + l(y[1]) + "," + l(y[2]) + "," + l(y[3]) + "," + l(-y[4]) + "," + l(-y[5]) + "," + l(-y[6]) + "," + l(-y[7]) + "," + l(y[8]) + "," + l(y[9]) + "," + l(y[10]) + "," + l(y[11]) + "," + l(y[12]) + "," + l(y[13]) + "," + l(y[14]) + "," + l(y[15]) + ")");
|
|
2762
2762
|
}
|
|
2763
2763
|
function p(g) {
|
|
2764
2764
|
g.isCSS3DObject && (g.element.style.display = "none");
|
|
@@ -2775,14 +2775,14 @@ class Ar {
|
|
|
2775
2775
|
if (k.style.display = v === !0 ? "" : "none", v === !0) {
|
|
2776
2776
|
g.onBeforeRender(t, y, M);
|
|
2777
2777
|
let b;
|
|
2778
|
-
g.isCSS3DSprite ? (he.copy(M.matrixWorldInverse), he.transpose(), g.rotation2D !== 0 && he.multiply(yr.makeRotationZ(g.rotation2D)), g.matrixWorld.decompose(
|
|
2778
|
+
g.isCSS3DSprite ? (he.copy(M.matrixWorldInverse), he.transpose(), g.rotation2D !== 0 && he.multiply(yr.makeRotationZ(g.rotation2D)), g.matrixWorld.decompose(Ji, gr, es), he.setPosition(Ji), he.scale(es), he.elements[3] = 0, he.elements[7] = 0, he.elements[11] = 0, he.elements[15] = 1, b = f(he)) : b = f(g.matrixWorld);
|
|
2779
2779
|
const x = r.objects.get(g);
|
|
2780
2780
|
if (x === void 0 || x.style !== b) {
|
|
2781
2781
|
k.style.transform = b;
|
|
2782
2782
|
const w = { style: b };
|
|
2783
2783
|
r.objects.set(g, w);
|
|
2784
2784
|
}
|
|
2785
|
-
k.parentNode !==
|
|
2785
|
+
k.parentNode !== d && d.appendChild(k), g.onAfterRender(t, y, M);
|
|
2786
2786
|
}
|
|
2787
2787
|
}
|
|
2788
2788
|
for (let v = 0, k = g.children.length; v < k; v++)
|
|
@@ -2790,7 +2790,7 @@ class Ar {
|
|
|
2790
2790
|
}
|
|
2791
2791
|
}
|
|
2792
2792
|
}
|
|
2793
|
-
class
|
|
2793
|
+
class Mn extends Be {
|
|
2794
2794
|
constructor(e) {
|
|
2795
2795
|
super(), this.isMark = !0, this.disposed = !1, this.events = e;
|
|
2796
2796
|
}
|
|
@@ -2818,13 +2818,13 @@ class Cn extends Re {
|
|
|
2818
2818
|
}, s = new pt();
|
|
2819
2819
|
s.setPositions([...o.startPoint, ...o.endPoint]);
|
|
2820
2820
|
const r = new Xe({ color: o.lineColor, linewidth: o.lineWidth });
|
|
2821
|
-
r.resolution.set(innerWidth, innerHeight), n.copy(new
|
|
2822
|
-
const c = new
|
|
2821
|
+
r.resolution.set(innerWidth, innerHeight), n.copy(new Be(s, r));
|
|
2822
|
+
const c = new Pe(0.05, 32), u = new Me({ color: 16777215, side: ve });
|
|
2823
2823
|
u.transparent = !0, u.opacity = 0.6;
|
|
2824
|
-
const l = new te(c, u);
|
|
2825
|
-
l.position.copy(e), l.isMark = !0;
|
|
2826
2824
|
const d = new te(c, u);
|
|
2827
2825
|
d.position.copy(e), d.isMark = !0;
|
|
2826
|
+
const l = new te(c, u);
|
|
2827
|
+
l.position.copy(e), l.isMark = !0;
|
|
2828
2828
|
const h = document.createElement("div");
|
|
2829
2829
|
h.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
|
|
2830
2830
|
<span class="${o.name}-main-tag" style="color:${o.mainTagColor};background:${o.mainTagBackground};opacity:${o.mainTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;user-select: none;font-size: 12px;pointer-events: auto;">${o.title}</span>
|
|
@@ -2838,7 +2838,7 @@ class Cn extends Re {
|
|
|
2838
2838
|
const p = document.createElement("div");
|
|
2839
2839
|
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";
|
|
2840
2840
|
const m = new ie(p);
|
|
2841
|
-
m.position.set(e.x, e.y, e.z), m.element.style.pointerEvents = "none", m.scale.set(8e-3, 8e-3, 8e-3), m.visible = !1, n.add(
|
|
2841
|
+
m.position.set(e.x, e.y, e.z), m.element.style.pointerEvents = "none", m.scale.set(8e-3, 8e-3, 8e-3), m.visible = !1, n.add(d, l, f, m), n.data = o, n.circleStart = d, n.circleEnd = l, n.css3dTag = m, n.css3dMainTag = f, n.events.fire(Te, n);
|
|
2842
2842
|
}
|
|
2843
2843
|
/**
|
|
2844
2844
|
* 绘制更新
|
|
@@ -2882,9 +2882,9 @@ class Cn extends Re {
|
|
|
2882
2882
|
const r = n.distanceTo(a);
|
|
2883
2883
|
t.css3dTag.visible = !0;
|
|
2884
2884
|
const c = (r * t.events.fire(I).meterScale).toFixed(2) + " m";
|
|
2885
|
-
t.css3dTag.element.childNodes[0].innerText = c, t.events.fire(
|
|
2886
|
-
const u = parent?.onActiveMark,
|
|
2887
|
-
|
|
2885
|
+
t.css3dTag.element.childNodes[0].innerText = c, t.events.fire(ke);
|
|
2886
|
+
const u = parent?.onActiveMark, d = t.getMarkData(!0);
|
|
2887
|
+
d.isNew = !0, d.meterScale = t.events.fire(I).meterScale, u?.(d);
|
|
2888
2888
|
}
|
|
2889
2889
|
/**
|
|
2890
2890
|
* 根据数据直接绘制
|
|
@@ -2910,15 +2910,15 @@ class Cn extends Re {
|
|
|
2910
2910
|
}, 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();
|
|
2911
2911
|
r.setPositions([...n.startPoint, ...n.endPoint]);
|
|
2912
2912
|
const c = new Xe({ color: n.lineColor, linewidth: n.lineWidth });
|
|
2913
|
-
c.resolution.set(innerWidth, innerHeight), t.copy(new
|
|
2914
|
-
const u = new
|
|
2915
|
-
|
|
2916
|
-
const
|
|
2917
|
-
|
|
2918
|
-
const h = new te(u,
|
|
2913
|
+
c.resolution.set(innerWidth, innerHeight), t.copy(new Be(r, c));
|
|
2914
|
+
const u = new Pe(0.05, 32), d = new Me({ color: 16777215, side: ve });
|
|
2915
|
+
d.transparent = !0, d.opacity = 0.6;
|
|
2916
|
+
const l = new te(u, d);
|
|
2917
|
+
l.position.copy(a), l.isMark = !0;
|
|
2918
|
+
const h = new te(u, d);
|
|
2919
2919
|
h.position.copy(o), h.isMark = !0;
|
|
2920
2920
|
const f = o.clone().sub(a).normalize();
|
|
2921
|
-
|
|
2921
|
+
l.lookAt(l.position.clone().add(f)), h.lookAt(h.position.clone().add(f));
|
|
2922
2922
|
const p = n.name, m = document.createElement("div");
|
|
2923
2923
|
m.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
|
|
2924
2924
|
<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>
|
|
@@ -2932,7 +2932,7 @@ class Cn extends Re {
|
|
|
2932
2932
|
const M = (a.distanceTo(o) * t.events.fire(I).meterScale).toFixed(2) + " m", S = document.createElement("div");
|
|
2933
2933
|
S.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;">${M}</span>`, S.classList.add("mark-wrap-line", `${p}`, "distance-warp"), S.style.position = "absolute", S.style.borderRadius = "4px", S.style.pointerEvents = "none";
|
|
2934
2934
|
const v = new ie(S);
|
|
2935
|
-
v.position.copy(s), v.element.style.pointerEvents = "none", v.scale.set(8e-3, 8e-3, 8e-3), v.visible = n.distanceTagVisible, t.add(
|
|
2935
|
+
v.position.copy(s), v.element.style.pointerEvents = "none", v.scale.set(8e-3, 8e-3, 8e-3), v.visible = n.distanceTagVisible, t.add(l, h, g, v), t.data = n, t.circleStart = l, t.circleEnd = h, t.css3dTag = v, t.css3dMainTag = g, t.events.fire(Te, t);
|
|
2936
2936
|
}
|
|
2937
2937
|
getMarkData(e = !1) {
|
|
2938
2938
|
const t = { ...this.data };
|
|
@@ -2941,10 +2941,10 @@ class Cn extends Re {
|
|
|
2941
2941
|
dispose() {
|
|
2942
2942
|
if (this.disposed) return;
|
|
2943
2943
|
const e = this;
|
|
2944
|
-
e.disposed = !0, e.events.fire(
|
|
2944
|
+
e.disposed = !0, e.events.fire(Ee, 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;
|
|
2945
2945
|
}
|
|
2946
2946
|
}
|
|
2947
|
-
class
|
|
2947
|
+
class Tn extends Be {
|
|
2948
2948
|
constructor(e) {
|
|
2949
2949
|
super(), this.isMark = !0, this.disposed = !1, this.css3dTags = [], this.group = new Qt(), this.add(this.group), this.events = e;
|
|
2950
2950
|
}
|
|
@@ -2980,13 +2980,13 @@ class Mn extends Re {
|
|
|
2980
2980
|
const o = this;
|
|
2981
2981
|
if (n)
|
|
2982
2982
|
if (a) {
|
|
2983
|
-
const s = o.data.points.length, r = o.css3dTags.length - 1, c = new C().fromArray(o.data.points.slice(s - 6, s - 3)), u = n,
|
|
2984
|
-
o.css3dTags[r].element.childNodes[0].innerText = h, o.css3dTags[r].position.set(
|
|
2983
|
+
const s = o.data.points.length, r = o.css3dTags.length - 1, c = new C().fromArray(o.data.points.slice(s - 6, s - 3)), u = n, d = new C((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), h = (c.distanceTo(u) * o.events.fire(I).meterScale).toFixed(2) + " m";
|
|
2984
|
+
o.css3dTags[r].element.childNodes[0].innerText = h, o.css3dTags[r].position.set(d.x, d.y, d.z), o.css3dTags[r].visible = !0, o.data.points.pop(), o.data.points.pop(), o.data.points.pop(), o.data.points = [...o.data.points, ...n.toArray(), ...n.toArray()], o.css3dTags[o.css3dTags.length - 1].visible = !0, this.draw(this.data);
|
|
2985
2985
|
} else {
|
|
2986
2986
|
const s = o.data.points.length;
|
|
2987
2987
|
o.data.points[s - 3] = n.x, o.data.points[s - 2] = n.y, o.data.points[s - 1] = n.z;
|
|
2988
|
-
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)),
|
|
2989
|
-
o.css3dTags[r].element.childNodes[0].innerText = h, o.geometry.setPositions([...o.data.points]), o.css3dTags[r].position.set(
|
|
2988
|
+
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)), d = new C((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), l = c.distanceTo(u), h = (l * o.events.fire(I).meterScale).toFixed(2) + " m";
|
|
2989
|
+
o.css3dTags[r].element.childNodes[0].innerText = h, o.geometry.setPositions([...o.data.points]), o.css3dTags[r].position.set(d.x, d.y, d.z), o.css3dTags[r].visible = a ? !0 : l > 0.5;
|
|
2990
2990
|
}
|
|
2991
2991
|
e?.lineColor && (t && (o.data.lineColor = e.lineColor), o.material.color.set(e.lineColor)), e?.lineWidth && (t && (o.data.lineWidth = e.lineWidth), o.material.linewidth = e.lineWidth), e?.mainTagColor && (t && (o.data.mainTagColor = e.mainTagColor), document.querySelector(`.${o.data.name}-main-tag`).style.color = e.mainTagColor), e?.mainTagBackground && (t && (o.data.mainTagBackground = e.mainTagBackground), document.querySelector(`.${o.data.name}-main-tag`).style.background = e.mainTagBackground), e?.mainTagOpacity && (t && (o.data.mainTagOpacity = e.mainTagOpacity), document.querySelector(`.${o.data.name}-main-tag`).style.opacity = e.mainTagOpacity.toString()), e?.mainTagVisible !== void 0 && (t && (o.data.mainTagVisible = e.mainTagVisible), o.css3dMainTag.visible = e.mainTagVisible), e?.distanceTagColor && (t && (o.data.distanceTagColor = e.distanceTagColor), document.querySelectorAll(`.${o.data.name}-distance-tag`)?.forEach((r) => r.style.color = e.distanceTagColor)), e?.distanceTagBackground && (t && (o.data.distanceTagBackground = e.distanceTagBackground), document.querySelectorAll(`.${o.data.name}-distance-tag`)?.forEach((r) => r.style.background = e.distanceTagBackground)), e?.distanceTagOpacity && (t && (o.data.distanceTagOpacity = e.distanceTagOpacity), document.querySelectorAll(`.${o.data.name}-distance-tag`)?.forEach((r) => r.style.opacity = e.distanceTagOpacity.toString())), e?.distanceTagVisible !== void 0 && (t && (o.data.distanceTagVisible = e.distanceTagVisible), o.css3dTags.forEach((s) => s.visible = e.distanceTagVisible)), e?.title !== void 0 && (t && (o.data.title = e.title), this.css3dMainTag.element.querySelector(`.${o.data.name}-main-tag`).innerText = e.title), e?.note !== void 0 && t && (o.data.note = e.note), o.events.fire(J);
|
|
2992
2992
|
}
|
|
@@ -3007,7 +3007,7 @@ class Mn extends Re {
|
|
|
3007
3007
|
drawFinish(e) {
|
|
3008
3008
|
if (this.disposed) return;
|
|
3009
3009
|
const t = this, n = t.data.points.length, a = new C().fromArray(t.data.points.slice(n - 6, n - 3)), o = new C().fromArray(t.data.points.slice(n - 3));
|
|
3010
|
-
if ((!e || a.distanceTo(o) < 1e-3) && (t.data.points.pop(), t.data.points.pop(), t.data.points.pop(), t.draw(t.data)), t.events.fire(
|
|
3010
|
+
if ((!e || a.distanceTo(o) < 1e-3) && (t.data.points.pop(), t.data.points.pop(), t.data.points.pop(), t.draw(t.data)), t.events.fire(ke), t.data.points.length < 6) {
|
|
3011
3011
|
t.dispose();
|
|
3012
3012
|
return;
|
|
3013
3013
|
} else {
|
|
@@ -3046,27 +3046,27 @@ class Mn extends Re {
|
|
|
3046
3046
|
}, o = n.geometry, s = n.material, r = new pt();
|
|
3047
3047
|
r.setPositions([...a.points]);
|
|
3048
3048
|
const c = new Xe({ color: a.lineColor, linewidth: a.lineWidth });
|
|
3049
|
-
c.resolution.set(innerWidth, innerHeight), n.copy(new
|
|
3050
|
-
const u = a.name,
|
|
3049
|
+
c.resolution.set(innerWidth, innerHeight), n.copy(new Be(r, c)), o?.dispose(), s?.dispose();
|
|
3050
|
+
const u = a.name, d = a.points.length / 3 - 1;
|
|
3051
3051
|
if (!n.css3dMainTag) {
|
|
3052
|
-
const
|
|
3053
|
-
|
|
3052
|
+
const l = document.createElement("div");
|
|
3053
|
+
l.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
|
|
3054
3054
|
<span class="${u}-main-tag" style="color:${a.mainTagColor};background:${a.mainTagBackground};opacity:${a.mainTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;user-select: none;font-size: 12px;pointer-events: auto;">${a.title}</span>
|
|
3055
|
-
</div>`,
|
|
3055
|
+
</div>`, l.classList.add("mark-wrap-lines", `${a.name}`, "main-warp"), l.style.position = "absolute", l.style.borderRadius = "4px", l.style.cursor = "pointer", l.onclick = () => {
|
|
3056
3056
|
if (n.events.fire(I).markMode) return;
|
|
3057
3057
|
const f = parent?.onActiveMark, p = n.getMarkData(!0);
|
|
3058
3058
|
p.meterScale = n.events.fire(I).meterScale, f?.(p), n.events.fire(q);
|
|
3059
|
-
},
|
|
3060
|
-
const h = new ie(
|
|
3059
|
+
}, l.oncontextmenu = (f) => f.preventDefault();
|
|
3060
|
+
const h = new ie(l);
|
|
3061
3061
|
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;
|
|
3062
3062
|
}
|
|
3063
|
-
for (let
|
|
3064
|
-
const h = new C().fromArray(a.points.slice(
|
|
3065
|
-
y.innerHTML = `<span class="${u}-distance-tag ${u}-distance-tag${
|
|
3063
|
+
for (let l = n.css3dTags.length; l < d; l++) {
|
|
3064
|
+
const h = new C().fromArray(a.points.slice(l * 3, l * 3 + 3)), f = new C().fromArray(a.points.slice(l * 3 + 3, l * 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(I).meterScale).toFixed(2) + " m", y = document.createElement("div");
|
|
3065
|
+
y.innerHTML = `<span class="${u}-distance-tag ${u}-distance-tag${l}" 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>`, y.classList.add("mark-wrap-lines", `${u}`, "distance-warp"), y.style.position = "absolute", y.style.borderRadius = "4px", y.style.display = "none";
|
|
3066
3066
|
const M = new ie(y);
|
|
3067
3067
|
M.position.copy(p), M.element.style.pointerEvents = "none", M.scale.set(8e-3, 8e-3, 8e-3), M.visible = a.distanceTagVisible, n.css3dTags.push(M), n.group.add(M);
|
|
3068
3068
|
}
|
|
3069
|
-
t || (n.css3dTags[n.css3dTags.length - 1].visible = !1), n.data = a, n.events.fire(
|
|
3069
|
+
t || (n.css3dTags[n.css3dTags.length - 1].visible = !1), n.data = a, n.events.fire(Te, n);
|
|
3070
3070
|
}
|
|
3071
3071
|
getMarkData(e = !1) {
|
|
3072
3072
|
const t = { ...this.data };
|
|
@@ -3075,7 +3075,7 @@ class Mn extends Re {
|
|
|
3075
3075
|
dispose() {
|
|
3076
3076
|
if (this.disposed) return;
|
|
3077
3077
|
const e = this;
|
|
3078
|
-
e.disposed = !0, e.events.fire(
|
|
3078
|
+
e.disposed = !0, e.events.fire(Ee, 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;
|
|
3079
3079
|
}
|
|
3080
3080
|
}
|
|
3081
3081
|
class ia extends Qt {
|
|
@@ -3122,7 +3122,7 @@ class ia extends Qt {
|
|
|
3122
3122
|
c?.(a.getMarkData(!0)), a.events.fire(q);
|
|
3123
3123
|
}, s.oncontextmenu = (c) => c.preventDefault();
|
|
3124
3124
|
const r = new ie(s);
|
|
3125
|
-
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(
|
|
3125
|
+
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(Te, a);
|
|
3126
3126
|
}
|
|
3127
3127
|
/**
|
|
3128
3128
|
* 绘制更新
|
|
@@ -3156,7 +3156,7 @@ class ia extends Qt {
|
|
|
3156
3156
|
drawFinish() {
|
|
3157
3157
|
if (this.disposed) return;
|
|
3158
3158
|
const e = this;
|
|
3159
|
-
e.events.fire(
|
|
3159
|
+
e.events.fire(ke);
|
|
3160
3160
|
const t = parent?.onActiveMark, n = e.getMarkData(!0);
|
|
3161
3161
|
n.isNew = !0, n.meterScale = e.events.fire(I).meterScale, t?.(n);
|
|
3162
3162
|
}
|
|
@@ -3167,12 +3167,12 @@ class ia extends Qt {
|
|
|
3167
3167
|
dispose() {
|
|
3168
3168
|
if (this.disposed) return;
|
|
3169
3169
|
const e = this;
|
|
3170
|
-
e.disposed = !0, e.events.fire(
|
|
3170
|
+
e.disposed = !0, e.events.fire(Ee, e), e.events.fire(B).remove(e), e.events.fire(Ze, e);
|
|
3171
3171
|
const t = document.querySelector(`.mark-wrap-${e.data.name}`);
|
|
3172
3172
|
t?.parentElement?.removeChild?.(t), e.events = null, e.data = null, e.css3dTag = null;
|
|
3173
3173
|
}
|
|
3174
3174
|
}
|
|
3175
|
-
class
|
|
3175
|
+
class kn extends Be {
|
|
3176
3176
|
constructor(e) {
|
|
3177
3177
|
super(), this.isMark = !0, this.disposed = !1, this.css3dTags = [], this.group = new Qt(), this.add(this.group), this.events = e;
|
|
3178
3178
|
}
|
|
@@ -3210,13 +3210,13 @@ class Tn extends Re {
|
|
|
3210
3210
|
const o = this;
|
|
3211
3211
|
if (n)
|
|
3212
3212
|
if (a) {
|
|
3213
|
-
const s = o.data.points.length, r = o.css3dTags.length - 1, c = new C().fromArray(o.data.points.slice(s - 6, s - 3)), u = n,
|
|
3214
|
-
o.css3dTags[r].element.innerText = h, o.css3dTags[r].position.set(
|
|
3213
|
+
const s = o.data.points.length, r = o.css3dTags.length - 1, c = new C().fromArray(o.data.points.slice(s - 6, s - 3)), u = n, d = new C((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), h = (c.distanceTo(u) * o.events.fire(I).meterScale).toFixed(2) + " m";
|
|
3214
|
+
o.css3dTags[r].element.innerText = h, o.css3dTags[r].position.set(d.x, d.y, d.z), o.css3dTags[r].visible = !0, o.data.points.pop(), o.data.points.pop(), o.data.points.pop(), o.data.points = [...o.data.points, ...n.toArray(), ...n.toArray()], this.draw(this.data);
|
|
3215
3215
|
} else {
|
|
3216
3216
|
const s = o.data.points.length;
|
|
3217
3217
|
o.data.points[s - 3] = n.x, o.data.points[s - 2] = n.y, o.data.points[s - 1] = n.z;
|
|
3218
|
-
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)),
|
|
3219
|
-
o.css3dTags[r].element.innerText = h, o.geometry.setPositions([...o.data.points]), o.css3dTags[r].position.set(
|
|
3218
|
+
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)), d = new C((c.x + u.x) / 2, (c.y + u.y) / 2, (c.z + u.z) / 2), l = c.distanceTo(u), h = (l * o.events.fire(I).meterScale).toFixed(2) + " m";
|
|
3219
|
+
o.css3dTags[r].element.innerText = h, o.geometry.setPositions([...o.data.points]), o.css3dTags[r].position.set(d.x, d.y, d.z), o.css3dTags[r].visible = a ? !0 : l > 0.5, o.meshPlans.geometry.setAttribute("position", new He(new Float32Array(o.data.points), 3)), o.meshPlans.geometry.attributes.position.needsUpdate = !0;
|
|
3220
3220
|
const f = o.events.fire(ln, o.data.points);
|
|
3221
3221
|
o.css3dAreaTag.position.copy(f);
|
|
3222
3222
|
const p = o.events.fire(dn, o.data.points);
|
|
@@ -3249,7 +3249,7 @@ class Tn extends Re {
|
|
|
3249
3249
|
let a, o;
|
|
3250
3250
|
for (let r = 1; r < n.length; r++)
|
|
3251
3251
|
a = n[r - 1], o = n[r], t.css3dTags[r - 1].element.innerText = (a.distanceTo(o) * e).toFixed(2) + " m";
|
|
3252
|
-
const s = t.events.fire(
|
|
3252
|
+
const s = t.events.fire(cs, n, e);
|
|
3253
3253
|
t.css3dAreaTag.element.childNodes[0].innerText = s.toFixed(2) + " m²";
|
|
3254
3254
|
}
|
|
3255
3255
|
/**
|
|
@@ -3258,7 +3258,7 @@ class Tn extends Re {
|
|
|
3258
3258
|
drawFinish(e) {
|
|
3259
3259
|
if (this.disposed) return;
|
|
3260
3260
|
const t = this, n = t.data.points.length, a = new C().fromArray(t.data.points.slice(n - 6, n - 3)), o = new C().fromArray(t.data.points.slice(n - 3));
|
|
3261
|
-
if ((!e || a.distanceTo(o) < 1e-4) && (t.data.points.pop(), t.data.points.pop(), t.data.points.pop()), t.events.fire(
|
|
3261
|
+
if ((!e || a.distanceTo(o) < 1e-4) && (t.data.points.pop(), t.data.points.pop(), t.data.points.pop()), t.events.fire(ke), t.data.points.length < 9) {
|
|
3262
3262
|
t.dispose();
|
|
3263
3263
|
return;
|
|
3264
3264
|
}
|
|
@@ -3298,8 +3298,8 @@ class Tn extends Re {
|
|
|
3298
3298
|
}, o = n.geometry, s = n.material, r = new pt();
|
|
3299
3299
|
r.setPositions([...a.points]);
|
|
3300
3300
|
const c = new Xe({ color: a.lineColor, linewidth: a.lineWidth });
|
|
3301
|
-
c.resolution.set(innerWidth, innerHeight), n.copy(new
|
|
3302
|
-
const u = a.name,
|
|
3301
|
+
c.resolution.set(innerWidth, innerHeight), n.copy(new Be(r, c)), o?.dispose(), s?.dispose();
|
|
3302
|
+
const u = a.name, d = a.points.length / 3 - 1;
|
|
3303
3303
|
if (!n.css3dMainTag) {
|
|
3304
3304
|
const f = document.createElement("div");
|
|
3305
3305
|
f.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
|
|
@@ -3312,23 +3312,23 @@ class Tn extends Re {
|
|
|
3312
3312
|
const p = new ie(f);
|
|
3313
3313
|
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;
|
|
3314
3314
|
}
|
|
3315
|
-
const
|
|
3315
|
+
const l = n.events.fire(dn, a.points).toFixed(2) + " m²", h = n.events.fire(ln, a.points);
|
|
3316
3316
|
if (n.css3dAreaTag)
|
|
3317
|
-
n.css3dAreaTag.position.copy(h), n.css3dAreaTag.element.childNodes[0].innerText =
|
|
3317
|
+
n.css3dAreaTag.position.copy(h), n.css3dAreaTag.element.childNodes[0].innerText = l;
|
|
3318
3318
|
else {
|
|
3319
3319
|
const f = document.createElement("div");
|
|
3320
|
-
f.innerHTML = `<span class="${u}-area-tag" style="color:${a.areaTagColor};background:${a.areaTagBackground};opacity:${a.areaTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;user-select: none;font-size: 12px;pointer-events: none;">${
|
|
3320
|
+
f.innerHTML = `<span class="${u}-area-tag" style="color:${a.areaTagColor};background:${a.areaTagBackground};opacity:${a.areaTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;user-select: none;font-size: 12px;pointer-events: none;">${l}</span>`, f.classList.add("mark-wrap-plans", `${a.name}`, "area-warp"), f.style.position = "absolute", f.style.borderRadius = "4px";
|
|
3321
3321
|
const p = new ie(f);
|
|
3322
3322
|
p.position.copy(h), p.element.style.pointerEvents = "none", p.scale.set(0.01, 0.01, 0.01), n.group.add(p), n.css3dAreaTag = p;
|
|
3323
3323
|
}
|
|
3324
3324
|
n.css3dAreaTag.visible = a.points.length > 6 && a.areaTagVisible;
|
|
3325
|
-
for (let f = n.css3dTags.length; f <
|
|
3325
|
+
for (let f = n.css3dTags.length; f < d; f++) {
|
|
3326
3326
|
const p = new C().fromArray(a.points.slice(f * 3, f * 3 + 3)), m = new C().fromArray(a.points.slice(f * 3 + 3, f * 3 + 6)), g = new C((p.x + m.x) / 2, (p.y + m.y) / 2, (p.z + m.z) / 2), M = (p.distanceTo(m) * n.events.fire(I).meterScale).toFixed(2) + " m", S = document.createElement("div");
|
|
3327
3327
|
S.innerText = M, S.style.color = "white", S.classList.add("mark-wrap-plans", `${u}`, "distance-warp"), S.style.position = "absolute", S.style.borderRadius = "4px", S.style.display = "none";
|
|
3328
3328
|
const v = new ie(S);
|
|
3329
3329
|
v.position.copy(g), v.element.style.pointerEvents = "none", v.scale.set(8e-3, 8e-3, 8e-3), v.visible = a.distanceTagVisible, n.css3dTags.push(v), n.group.add(v);
|
|
3330
3330
|
}
|
|
3331
|
-
n.drawPlans(a), t || (n.css3dTags[n.css3dTags.length - 1].visible = !1), n.data = a, n.events.fire(
|
|
3331
|
+
n.drawPlans(a), t || (n.css3dTags[n.css3dTags.length - 1].visible = !1), n.data = a, n.events.fire(Te, n);
|
|
3332
3332
|
}
|
|
3333
3333
|
drawPlans(e) {
|
|
3334
3334
|
const t = this;
|
|
@@ -3337,11 +3337,11 @@ class Tn extends Re {
|
|
|
3337
3337
|
n.setAttribute("position", new He(new Float32Array(), 3)), n.attributes.position.needsUpdate = !0;
|
|
3338
3338
|
const a = new He(new Uint16Array([]), 1);
|
|
3339
3339
|
n.setIndex(a);
|
|
3340
|
-
const o = new
|
|
3340
|
+
const o = new Me({
|
|
3341
3341
|
color: e.lineColor,
|
|
3342
3342
|
transparent: !0,
|
|
3343
3343
|
opacity: e.planOpacity,
|
|
3344
|
-
side:
|
|
3344
|
+
side: ve
|
|
3345
3345
|
});
|
|
3346
3346
|
t.meshPlans = new te(n, o), t.meshPlans.renderOrder = 1, t.meshPlans.isMark = !0, t.group.add(t.meshPlans);
|
|
3347
3347
|
}
|
|
@@ -3363,7 +3363,7 @@ class Tn extends Re {
|
|
|
3363
3363
|
dispose() {
|
|
3364
3364
|
if (this.disposed) return;
|
|
3365
3365
|
const e = this;
|
|
3366
|
-
e.disposed = !0, e.events.fire(
|
|
3366
|
+
e.disposed = !0, e.events.fire(Ee, 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;
|
|
3367
3367
|
}
|
|
3368
3368
|
}
|
|
3369
3369
|
class sa extends Qt {
|
|
@@ -3391,26 +3391,26 @@ class sa extends Qt {
|
|
|
3391
3391
|
circleTagOpacity: 0.9,
|
|
3392
3392
|
circleTagVisible: !0,
|
|
3393
3393
|
title: "标记圆面" + a
|
|
3394
|
-
}, s = new
|
|
3394
|
+
}, s = new Pe(o.radius, 32), r = new Me({ color: o.circleColor, side: ve, transparent: !0 });
|
|
3395
3395
|
r.opacity = o.circleOpacity;
|
|
3396
3396
|
const c = new te(s, r);
|
|
3397
3397
|
c.position.copy(e), c.isMark = !0, c.renderOrder = 1;
|
|
3398
3398
|
const u = new C(0, 1, 0).normalize();
|
|
3399
3399
|
c.lookAt(c.position.clone().add(u));
|
|
3400
|
-
const
|
|
3401
|
-
|
|
3400
|
+
const d = document.createElement("div");
|
|
3401
|
+
d.innerHTML = `<div style='flex-direction: column;align-items: center;display: flex;pointer-events: none;margin-bottom: 40px;'>
|
|
3402
3402
|
<span class="${o.name}-main-tag" style="color:${o.mainTagColor};background:${o.mainTagBackground};opacity:${o.mainTagOpacity};padding:1px 5px 2px 5px;border-radius: 4px;user-select: none;font-size: 12px;pointer-events: auto;">${o.title}</span>
|
|
3403
|
-
</div>`,
|
|
3403
|
+
</div>`, d.classList.add("mark-wrap-circle", `${o.name}`, "main-warp"), d.style.position = "absolute", d.style.borderRadius = "4px", d.style.cursor = "pointer", d.onclick = () => {
|
|
3404
3404
|
if (n.events.fire(I).markMode) return;
|
|
3405
3405
|
const p = parent?.onActiveMark;
|
|
3406
3406
|
p?.(n.getMarkData(!0)), n.events.fire(q);
|
|
3407
|
-
},
|
|
3408
|
-
const
|
|
3409
|
-
|
|
3407
|
+
}, d.oncontextmenu = (p) => p.preventDefault();
|
|
3408
|
+
const l = new ie(d);
|
|
3409
|
+
l.position.copy(e), l.element.style.pointerEvents = "none", l.scale.set(0.01, 0.01, 0.01), l.visible = o.mainTagVisible;
|
|
3410
3410
|
const h = document.createElement("div");
|
|
3411
3411
|
h.innerHTML = `<span class="${t}-circle-tag" style="color:${o.circleTagColor};background:${o.circleTagBackground};opacity:${o.circleTagOpacity};padding: 1px 5px;border-radius: 4px;margin-bottom: 5px;user-select: none;font-size: 12px;pointer-events: none;"></span>`, h.classList.add("mark-wrap-circle", `${t}`, "circle-warp"), h.style.position = "absolute", h.style.borderRadius = "4px", h.style.pointerEvents = "none";
|
|
3412
3412
|
const f = new ie(h);
|
|
3413
|
-
f.position.set(e.x + Math.min(o.radius / 2, 0.5), e.y, e.z), f.element.style.pointerEvents = "none", f.scale.set(8e-3, 8e-3, 8e-3), f.visible = !1, n.add(c,
|
|
3413
|
+
f.position.set(e.x + Math.min(o.radius / 2, 0.5), e.y, e.z), f.element.style.pointerEvents = "none", f.scale.set(8e-3, 8e-3, 8e-3), f.visible = !1, n.add(c, l, f), n.data = o, n.circleMesh = c, n.css3dTag = f, n.css3dMainTag = l, n.events.fire(Te, n);
|
|
3414
3414
|
}
|
|
3415
3415
|
/**
|
|
3416
3416
|
* 绘制更新
|
|
@@ -3420,13 +3420,13 @@ class sa extends Qt {
|
|
|
3420
3420
|
const a = this;
|
|
3421
3421
|
if (n) {
|
|
3422
3422
|
const o = new C().fromArray(a.data.startPoint), s = o.distanceTo(new C(n.x, o.y, n.z));
|
|
3423
|
-
t && (a.data.radius = s), a.circleMesh.geometry.copy(new
|
|
3423
|
+
t && (a.data.radius = s), a.circleMesh.geometry.copy(new Pe(s, 128)), a.css3dTag.visible = s > 0.3;
|
|
3424
3424
|
const r = s * a.events.fire(I).meterScale, c = (Math.PI * r * r).toFixed(2) + " m²";
|
|
3425
3425
|
a.css3dTag.element.childNodes[0].innerText = c, a.css3dTag.position.set(o.x + Math.min(a.data.radius / 2, 0.5), o.y, o.z);
|
|
3426
3426
|
}
|
|
3427
3427
|
if (e?.radius) {
|
|
3428
3428
|
const o = new C().fromArray(a.data.startPoint), s = e?.radius;
|
|
3429
|
-
t && (a.data.radius = s), a.circleMesh.geometry.copy(new
|
|
3429
|
+
t && (a.data.radius = s), a.circleMesh.geometry.copy(new Pe(s, 128)), a.css3dTag.visible = s > 0.3;
|
|
3430
3430
|
const r = s * a.events.fire(I).meterScale, c = (Math.PI * r * r).toFixed(2) + " m²";
|
|
3431
3431
|
a.css3dTag.element.childNodes[0].innerText = c, a.css3dTag.position.set(o.x + Math.min(s / 2, 0.5), o.y, o.z);
|
|
3432
3432
|
}
|
|
@@ -3445,9 +3445,9 @@ class sa extends Qt {
|
|
|
3445
3445
|
drawFinish(e) {
|
|
3446
3446
|
if (this.disposed) return;
|
|
3447
3447
|
const t = this, n = new C().fromArray(t.data.startPoint), a = n.distanceTo(new C(e.x, n.y, e.z));
|
|
3448
|
-
t.data.radius = a, t.circleMesh.geometry.copy(new
|
|
3448
|
+
t.data.radius = a, t.circleMesh.geometry.copy(new Pe(a, 128));
|
|
3449
3449
|
const o = t.data.radius * t.events.fire(I).meterScale, s = (Math.PI * o * o).toFixed(2) + " m²";
|
|
3450
|
-
t.css3dTag.element.childNodes[0].innerText = s, t.events.fire(
|
|
3450
|
+
t.css3dTag.element.childNodes[0].innerText = s, t.events.fire(ke);
|
|
3451
3451
|
const r = parent?.onActiveMark, c = t.getMarkData(!0);
|
|
3452
3452
|
c.isNew = !0, c.meterScale = t.events.fire(I).meterScale, r?.(c);
|
|
3453
3453
|
}
|
|
@@ -3472,7 +3472,7 @@ class sa extends Qt {
|
|
|
3472
3472
|
circleTagOpacity: e.circleTagOpacity || 0.9,
|
|
3473
3473
|
circleTagVisible: e.circleTagVisible === void 0 ? !0 : e.circleTagVisible,
|
|
3474
3474
|
title: e.title || "标记圆面"
|
|
3475
|
-
}, a = new
|
|
3475
|
+
}, a = new Pe(n.radius, 128), o = new Me({ color: n.circleColor, side: ve, transparent: !0 });
|
|
3476
3476
|
o.opacity = n.circleOpacity;
|
|
3477
3477
|
const s = new te(a, o);
|
|
3478
3478
|
s.position.fromArray(n.startPoint), s.isMark = !0, s.renderOrder = 1;
|
|
@@ -3486,12 +3486,12 @@ class sa extends Qt {
|
|
|
3486
3486
|
const g = parent?.onActiveMark;
|
|
3487
3487
|
g?.(t.getMarkData(!0)), t.events.fire(q);
|
|
3488
3488
|
}, u.oncontextmenu = (g) => g.preventDefault();
|
|
3489
|
-
const
|
|
3490
|
-
f.position.copy(
|
|
3489
|
+
const d = new C().fromArray(n.startPoint), l = n.radius * t.events.fire(I).meterScale, h = (Math.PI * l * l).toFixed(2) + " m²", f = new ie(u);
|
|
3490
|
+
f.position.copy(d), f.element.style.pointerEvents = "none", f.scale.set(0.01, 0.01, 0.01), f.visible = n.mainTagVisible;
|
|
3491
3491
|
const p = document.createElement("div");
|
|
3492
3492
|
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";
|
|
3493
3493
|
const m = new ie(p);
|
|
3494
|
-
m.position.set(
|
|
3494
|
+
m.position.set(d.x + Math.min(n.radius / 2, 0.5), d.y, d.z), m.element.style.pointerEvents = "none", m.scale.set(8e-3, 8e-3, 8e-3), m.visible = n.circleTagVisible, t.add(s, f, m), t.data = n, t.circleMesh = s, t.css3dTag = m, t.css3dMainTag = f, t.events.fire(Te, t);
|
|
3495
3495
|
}
|
|
3496
3496
|
getMarkData(e = !1) {
|
|
3497
3497
|
const t = { ...this.data };
|
|
@@ -3500,7 +3500,7 @@ class sa extends Qt {
|
|
|
3500
3500
|
dispose() {
|
|
3501
3501
|
if (this.disposed) return;
|
|
3502
3502
|
const e = this;
|
|
3503
|
-
e.disposed = !0, e.events.fire(
|
|
3503
|
+
e.disposed = !0, e.events.fire(Ee, 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;
|
|
3504
3504
|
}
|
|
3505
3505
|
}
|
|
3506
3506
|
let wr = class {
|
|
@@ -3511,7 +3511,7 @@ let wr = class {
|
|
|
3511
3511
|
function vr(i) {
|
|
3512
3512
|
const e = (w, D, _) => i.on(w, D, _), t = (w, ...D) => i.fire(w, ...D), n = t(Ke);
|
|
3513
3513
|
let a = /* @__PURE__ */ new Set(), o, s = new wr(), r;
|
|
3514
|
-
e(
|
|
3514
|
+
e(ci, () => {
|
|
3515
3515
|
t(Y).autoRotate = t(I).autoRotate = !0;
|
|
3516
3516
|
}), e(q, (w = !0) => {
|
|
3517
3517
|
t(Y).autoRotate = t(I).autoRotate = !1, w && t(zt);
|
|
@@ -3519,9 +3519,9 @@ function vr(i) {
|
|
|
3519
3519
|
if (o) return;
|
|
3520
3520
|
const D = t(Y), _ = w ? Math.PI / 128 : -(Math.PI / 128), T = new $e().makeRotationAxis(new C(0, 0, -1).transformDirection(D.object.matrixWorld), _);
|
|
3521
3521
|
D.object.up.transformDirection(T), t(J);
|
|
3522
|
-
}), e(Ai, () => {
|
|
3523
|
-
o || i.fire(Kt, !0);
|
|
3524
3522
|
}), e(wi, () => {
|
|
3523
|
+
o || i.fire(Kt, !0);
|
|
3524
|
+
}), e(vi, () => {
|
|
3525
3525
|
o || i.fire(Kt, !1);
|
|
3526
3526
|
}), e(Bt, (w) => {
|
|
3527
3527
|
const D = t(I);
|
|
@@ -3530,7 +3530,7 @@ function vr(i) {
|
|
|
3530
3530
|
t(B).traverse((D) => D instanceof pe && D.fire(fn));
|
|
3531
3531
|
}), e(rt, (w) => {
|
|
3532
3532
|
t(B).traverse((_) => _ instanceof pe && _.fire(rt, w));
|
|
3533
|
-
}), e(
|
|
3533
|
+
}), e(Ti, () => {
|
|
3534
3534
|
const w = t(B);
|
|
3535
3535
|
let D;
|
|
3536
3536
|
w.traverse((_) => _ instanceof pe && (D = _)), D && t(un, D.fire(Ys));
|
|
@@ -3542,17 +3542,17 @@ function vr(i) {
|
|
|
3542
3542
|
t(qe), a.clear();
|
|
3543
3543
|
return;
|
|
3544
3544
|
}
|
|
3545
|
-
a.has("Space") ? (w.bigSceneMode ? t(Bt) : t(Ut), a.clear()) : a.has("KeyR") ? (w.autoRotate ? t(q) : t(
|
|
3545
|
+
a.has("Space") ? (w.bigSceneMode ? t(Bt) : t(Ut), a.clear()) : a.has("KeyR") ? (w.autoRotate ? t(q) : t(ci), a.clear()) : a.has("KeyM") ? (t(dt, !w.markVisible), a.clear()) : a.has("ArrowLeft") ? (t(wi), t(Tt, !0), a.clear()) : a.has("ArrowRight") ? (t(vi), t(Tt, !0), a.clear()) : a.has("KeyP") ? (t(Ot, !0), a.clear()) : a.has("Equal") ? (t(Yn), a.clear()) : a.has("Minus") ? (t(Vn), a.clear()) : a.has("KeyY") ? (t(An), a.clear()) : a.has("KeyI") ? (t(Os), a.clear()) : a.has("KeyF") ? (t(Ti), a.clear()) : a.has("F2") && (!w.bigSceneMode && window.open("/editor/index.html?url=" + encodeURIComponent(t(ye).meta.url)), a.clear());
|
|
3546
3546
|
}), e(it, async (w, D) => {
|
|
3547
3547
|
if (s.move) return;
|
|
3548
3548
|
const _ = await t(Ft, w, D);
|
|
3549
|
-
_.length && t(un, _[0], !0);
|
|
3549
|
+
_.length && t(un, _[0], !0, !1);
|
|
3550
3550
|
}), e(ce, async (w, D) => {
|
|
3551
3551
|
const _ = t(B), T = [];
|
|
3552
3552
|
_.traverse((E) => E instanceof pe && T.push(E));
|
|
3553
3553
|
const F = await t(Ft, w, D);
|
|
3554
3554
|
return F.length ? (T.length && T[0].fire(Ct, F[0].x, F[0].y, F[0].z, !0), new C(F[0].x, F[0].y, F[0].z)) : (T.length && T[0].fire(Ct, 0, 0, 0, !1), null);
|
|
3555
|
-
}), e(
|
|
3555
|
+
}), e(On, async () => {
|
|
3556
3556
|
const w = t(B), D = [];
|
|
3557
3557
|
w.traverse((_) => _ instanceof pe && D.push(_));
|
|
3558
3558
|
for (let _ = 0; _ < D.length; _++)
|
|
@@ -3561,25 +3561,25 @@ function vr(i) {
|
|
|
3561
3561
|
const c = (w) => {
|
|
3562
3562
|
w.target.type !== "text" && (o || w.code === "F5" || (w.preventDefault(), w.code !== "KeyR" && (a.add(w.code), t(q)), r = Date.now()));
|
|
3563
3563
|
}, u = (w) => {
|
|
3564
|
-
w.target.type !== "text" && (o || (w.code === "KeyR" && a.add(w.code), (w.code === "ArrowLeft" || w.code === "ArrowRight") && t(
|
|
3564
|
+
w.target.type !== "text" && (o || (w.code === "KeyR" && a.add(w.code), (w.code === "ArrowLeft" || w.code === "ArrowRight") && t(hs), r = Date.now()));
|
|
3565
3565
|
};
|
|
3566
3566
|
e(
|
|
3567
3567
|
Oe,
|
|
3568
3568
|
() => {
|
|
3569
|
-
t(
|
|
3569
|
+
t(zn) && Date.now() - r > 2e3 && (t(Tt, !1), t(An));
|
|
3570
3570
|
},
|
|
3571
3571
|
!0
|
|
3572
3572
|
);
|
|
3573
|
-
const
|
|
3573
|
+
const d = () => {
|
|
3574
3574
|
a.clear();
|
|
3575
|
-
},
|
|
3575
|
+
}, l = (w) => {
|
|
3576
3576
|
parent && setTimeout(() => window.focus()), w.preventDefault(), !o && (t(q), r = Date.now());
|
|
3577
3577
|
}, h = (w) => {
|
|
3578
3578
|
w.preventDefault(), !o && (t(q), r = Date.now());
|
|
3579
3579
|
};
|
|
3580
3580
|
let f, p, m, g;
|
|
3581
3581
|
e(qe, () => {
|
|
3582
|
-
f?.dispose(), p?.dispose(), m?.dispose(), g?.dispose(), f = null, p = null, m = null, g = null, s.lastMovePoint = null, t(
|
|
3582
|
+
f?.dispose(), p?.dispose(), m?.dispose(), g?.dispose(), f = null, p = null, m = null, g = null, s.lastMovePoint = null, t(ke);
|
|
3583
3583
|
});
|
|
3584
3584
|
const y = async (w) => {
|
|
3585
3585
|
parent && setTimeout(() => window.focus()), w.preventDefault(), !o && (t(q), s.down = w.button === 2 ? 2 : 1, s.move = !1, s.isDbClick = Date.now() - s.downTime < 300, r = Date.now(), s.downTime = Date.now());
|
|
@@ -3606,7 +3606,7 @@ function vr(i) {
|
|
|
3606
3606
|
_ ? (f.drawFinish(_), f = null) : s.isDbClick && t(qe);
|
|
3607
3607
|
} else {
|
|
3608
3608
|
const _ = await t(ce, w.clientX, w.clientY);
|
|
3609
|
-
_ && (f = new
|
|
3609
|
+
_ && (f = new Mn(i), f.drawStart(_), t(B).add(f));
|
|
3610
3610
|
}
|
|
3611
3611
|
else if (D.markType === "lines")
|
|
3612
3612
|
if (p)
|
|
@@ -3618,7 +3618,7 @@ function vr(i) {
|
|
|
3618
3618
|
}
|
|
3619
3619
|
else {
|
|
3620
3620
|
const _ = await t(ce, w.clientX, w.clientY);
|
|
3621
|
-
_ && (p = new
|
|
3621
|
+
_ && (p = new Tn(i), p.drawStart(_), t(B).add(p));
|
|
3622
3622
|
}
|
|
3623
3623
|
else if (D.markType === "plans")
|
|
3624
3624
|
if (m)
|
|
@@ -3630,7 +3630,7 @@ function vr(i) {
|
|
|
3630
3630
|
}
|
|
3631
3631
|
else {
|
|
3632
3632
|
const _ = await t(ce, w.clientX, w.clientY);
|
|
3633
|
-
_ && (m = new
|
|
3633
|
+
_ && (m = new kn(i), m.drawStart(_), t(B).add(m));
|
|
3634
3634
|
}
|
|
3635
3635
|
else if (D.markType === "circle")
|
|
3636
3636
|
if (g) {
|
|
@@ -3653,26 +3653,26 @@ function vr(i) {
|
|
|
3653
3653
|
function b(w) {
|
|
3654
3654
|
s.down === 1 && !s.move && t(it, s.x, s.y);
|
|
3655
3655
|
}
|
|
3656
|
-
window.addEventListener("keydown", c), window.addEventListener("keyup", u), window.addEventListener("blur",
|
|
3656
|
+
window.addEventListener("keydown", c), window.addEventListener("keyup", u), window.addEventListener("blur", d), window.addEventListener("wheel", l, { passive: !1 }), n.addEventListener("contextmenu", h), n.addEventListener("mousedown", y), n.addEventListener("mousemove", M), n.addEventListener("mouseup", S), n.addEventListener("touchstart", v, { passive: !1 }), n.addEventListener("touchmove", k, { passive: !1 }), n.addEventListener("touchend", b, { passive: !1 }), window.addEventListener("resize", x), x();
|
|
3657
3657
|
function x() {
|
|
3658
3658
|
const { width: w, height: D, top: _, left: T } = t(Ue), F = t(V);
|
|
3659
3659
|
F.aspect = w / D, F.updateProjectionMatrix();
|
|
3660
|
-
const E = t(
|
|
3660
|
+
const E = t(Qn);
|
|
3661
3661
|
E.setSize(w, D), E.domElement.style.position = "absolute", E.domElement.style.left = `${T}px`, E.domElement.style.top = `${_}px`;
|
|
3662
3662
|
const P = t(ct);
|
|
3663
3663
|
P.setPixelRatio(Math.min(devicePixelRatio, 2)), P.setSize(w, D);
|
|
3664
3664
|
}
|
|
3665
|
-
e(
|
|
3666
|
-
o = !0, window.removeEventListener("keydown", c), window.removeEventListener("keyup", u), window.removeEventListener("blur",
|
|
3665
|
+
e(Rn, () => {
|
|
3666
|
+
o = !0, window.removeEventListener("keydown", c), window.removeEventListener("keyup", u), window.removeEventListener("blur", d), window.removeEventListener("wheel", l), n.removeEventListener("contextmenu", h), n.removeEventListener("mousedown", y), n.removeEventListener("mousemove", M), n.removeEventListener("mouseup", S), n.removeEventListener("touchstart", v), n.removeEventListener("touchmove", k), n.removeEventListener("touchend", b), window.removeEventListener("resize", x);
|
|
3667
3667
|
});
|
|
3668
3668
|
}
|
|
3669
3669
|
function aa(i) {
|
|
3670
3670
|
const e = new Aa(), t = 0.02, n = (o, s, r) => i.on(o, s, r), a = (o, ...s) => i.fire(o, ...s);
|
|
3671
3671
|
n(Ft, async (o, s) => {
|
|
3672
|
-
const { width: r, height: c, left: u, top:
|
|
3673
|
-
|
|
3672
|
+
const { width: r, height: c, left: u, top: d } = a(Ue), l = new j();
|
|
3673
|
+
l.x = (o - u) / r * 2 - 1, l.y = (d - s) / c * 2 + 1;
|
|
3674
3674
|
const h = a(V);
|
|
3675
|
-
e.setFromCamera(
|
|
3675
|
+
e.setFromCamera(l, h);
|
|
3676
3676
|
const f = [], p = a(B), m = [], g = [];
|
|
3677
3677
|
p.traverse(function(v) {
|
|
3678
3678
|
v instanceof pe ? g.push(v) : v.isMesh && !v.ignoreIntersect && !v.isMark && m.push(v);
|
|
@@ -3687,8 +3687,8 @@ function aa(i) {
|
|
|
3687
3687
|
if (k.length !== void 0) {
|
|
3688
3688
|
const b = k, x = b.length / 3;
|
|
3689
3689
|
for (let w = 0; w < x; w++) {
|
|
3690
|
-
const D = new C(b[3 * w + 0], b[3 * w + 1], b[3 * w + 2]), _ = new
|
|
3691
|
-
Math.sqrt((T -
|
|
3690
|
+
const D = new C(b[3 * w + 0], b[3 * w + 1], b[3 * w + 2]), _ = new Se(D.x, D.y, D.z, 1).applyMatrix4(M), T = _.x / _.w, F = _.y / _.w;
|
|
3691
|
+
Math.sqrt((T - l.x) ** 2 + (F - l.y) ** 2) <= t && f.push(new tt(D, e.ray.distanceToPoint(D)));
|
|
3692
3692
|
}
|
|
3693
3693
|
} else
|
|
3694
3694
|
for (let b of Object.keys(k)) {
|
|
@@ -3696,8 +3696,8 @@ function aa(i) {
|
|
|
3696
3696
|
if (e.ray.distanceToPoint(w) <= 1.4143) {
|
|
3697
3697
|
const D = k[b];
|
|
3698
3698
|
for (let _ = 0, T = D.length / 3; _ < T; _++) {
|
|
3699
|
-
const F = new C(D[3 * _ + 0], D[3 * _ + 1], D[3 * _ + 2]), E = new
|
|
3700
|
-
Math.sqrt((P -
|
|
3699
|
+
const F = new C(D[3 * _ + 0], D[3 * _ + 1], D[3 * _ + 2]), E = new Se(F.x, F.y, F.z, 1).applyMatrix4(M), P = E.x / E.w, U = E.y / E.w;
|
|
3700
|
+
Math.sqrt((P - l.x) ** 2 + (U - l.y) ** 2) <= t && f.push(new tt(F, e.ray.distanceToPoint(F)));
|
|
3701
3701
|
}
|
|
3702
3702
|
}
|
|
3703
3703
|
}
|
|
@@ -3708,37 +3708,37 @@ function aa(i) {
|
|
|
3708
3708
|
S.push(f[v].center);
|
|
3709
3709
|
return S;
|
|
3710
3710
|
}), n(mn, (o, s, r) => {
|
|
3711
|
-
const { width: c, height: u, left:
|
|
3712
|
-
h.x = (o -
|
|
3711
|
+
const { width: c, height: u, left: d, top: l } = a(Ue), h = new j();
|
|
3712
|
+
h.x = (o - d) / c * 2 - 1, h.y = (l - s) / u * 2 + 1;
|
|
3713
3713
|
const f = a(V);
|
|
3714
3714
|
return e.setFromCamera(h, f), e.ray.distanceToPoint(r);
|
|
3715
3715
|
});
|
|
3716
3716
|
}
|
|
3717
3717
|
function Sr(i) {
|
|
3718
3718
|
const e = (r, c, u) => i.on(r, c, u), t = (r, ...c) => i.fire(r, ...c);
|
|
3719
|
-
e(ft, () => t(V).fov), e(
|
|
3720
|
-
if (t(
|
|
3719
|
+
e(ft, () => t(V).fov), e(Ce, (r = !1) => r ? t(V).position.clone() : t(V).position), e(we, (r = !1) => r ? t(Y).target.clone() : t(Y).target), e(Ne, (r = !1) => r ? t(V).up.clone() : t(V).up), e(un, (r, c = !1, u) => {
|
|
3720
|
+
if (t(yn, r), !c) {
|
|
3721
3721
|
t(Y).target.copy(r), t(Rt);
|
|
3722
3722
|
return;
|
|
3723
3723
|
}
|
|
3724
|
-
const
|
|
3725
|
-
let
|
|
3724
|
+
const d = t(we, !0), l = t(Ce, !0), f = d.clone().sub(l).normalize().clone(), p = r.clone().sub(f.multiplyScalar(l.distanceTo(r)));
|
|
3725
|
+
let m = 0;
|
|
3726
3726
|
t(
|
|
3727
3727
|
at,
|
|
3728
3728
|
() => {
|
|
3729
|
-
|
|
3729
|
+
m += 0.03, t(Y).target.copy(d.clone().lerp(r, m)), u || (t(Y).object.position.copy(l.clone().lerp(p, m)), t(yn, r)), t(Rt);
|
|
3730
3730
|
},
|
|
3731
|
-
() =>
|
|
3731
|
+
() => m < 1
|
|
3732
3732
|
);
|
|
3733
|
-
}), e(
|
|
3734
|
-
let r = t(
|
|
3733
|
+
}), e(ds, () => {
|
|
3734
|
+
let r = t(Ce).toArray(), c = t(Ne).toArray(), u = t(we).toArray();
|
|
3735
3735
|
return { position: r, lookUp: c, lookAt: u };
|
|
3736
|
-
}), e(
|
|
3736
|
+
}), e(us, () => t(Y).update()), e(hs, () => t(Y).updateRotateAxis());
|
|
3737
3737
|
const n = 0.01;
|
|
3738
3738
|
let a = new C(), o = new C(), s = 0;
|
|
3739
|
-
e(
|
|
3740
|
-
const r = t(Y).object, c = r.fov, u = r.position.clone(),
|
|
3741
|
-
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(
|
|
3739
|
+
e(vs, () => {
|
|
3740
|
+
const r = t(Y).object, c = r.fov, u = r.position.clone(), d = r.getWorldDirection(new C());
|
|
3741
|
+
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(d.x - o.x) < n && Math.abs(d.y - o.y) < n && Math.abs(d.z - o.z) < n ? !1 : (s = c, a = u, o = d, !0);
|
|
3742
3742
|
});
|
|
3743
3743
|
}
|
|
3744
3744
|
class br extends te {
|
|
@@ -3749,28 +3749,28 @@ class br extends te {
|
|
|
3749
3749
|
function xr(i) {
|
|
3750
3750
|
let e = !1;
|
|
3751
3751
|
const t = (r, c, u) => i.on(r, c, u), n = (r, ...c) => i.fire(r, ...c), a = [], o = new C(), s = new $e();
|
|
3752
|
-
t(
|
|
3752
|
+
t(Is, () => {
|
|
3753
3753
|
const r = new wa(0.5, 32, 32), c = Cr();
|
|
3754
3754
|
c.depthTest = !1, c.depthWrite = !1, c.transparent = !0;
|
|
3755
3755
|
const u = new br();
|
|
3756
|
-
return u.copy(new te(r, c)), t(Da, () => c), t(
|
|
3757
|
-
e || (c.uniforms[
|
|
3758
|
-
}), t(
|
|
3756
|
+
return u.copy(new te(r, c)), t(Da, () => c), t(Si, (d) => {
|
|
3757
|
+
e || (c.uniforms[Cn].value = d, d <= 0.01 ? u.visible = !1 : u.visible = !0, c.uniformsNeedUpdate = !0, n(J));
|
|
3758
|
+
}), t(yn, (d) => {
|
|
3759
3759
|
if (e) return;
|
|
3760
|
-
const
|
|
3761
|
-
s.copy(
|
|
3760
|
+
const l = n(V);
|
|
3761
|
+
s.copy(l.matrixWorld).invert(), o.copy(d).applyMatrix4(s), o.normalize().multiplyScalar(10), o.applyMatrix4(l.matrixWorld);
|
|
3762
3762
|
const { width: h, height: f } = n(Ue);
|
|
3763
|
-
c.uniforms[ht].value.set(h, f), u.position.copy(o), c.uniforms[Js].value.copy(
|
|
3763
|
+
c.uniforms[ht].value.set(h, f), u.position.copy(o), c.uniforms[Js].value.copy(d), c.uniforms[ht].value.set(h, f), c.uniforms[Cn].value = 1, c.uniformsNeedUpdate = !0, n(bi), n(J);
|
|
3764
3764
|
}), t(Pa, () => {
|
|
3765
3765
|
e || (e = !0, c.dispose(), r.dispose());
|
|
3766
3766
|
}), u.renderOrder = 99999, u;
|
|
3767
|
-
}), t(
|
|
3767
|
+
}), t(bi, () => {
|
|
3768
3768
|
for (; a.length; ) a.pop().opacity = 0;
|
|
3769
3769
|
let r = { opacity: 1 };
|
|
3770
3770
|
a.push(r), n(
|
|
3771
|
-
|
|
3771
|
+
Fn,
|
|
3772
3772
|
() => {
|
|
3773
|
-
!e && r.opacity > 0 && (r.opacity < 0.2 ? r.opacity = 0 : r.opacity > 0.6 ? r.opacity = Math.max(r.opacity -= 0.01, 0) : r.opacity = Math.max(r.opacity -= 0.03, 0), n(
|
|
3773
|
+
!e && r.opacity > 0 && (r.opacity < 0.2 ? r.opacity = 0 : r.opacity > 0.6 ? r.opacity = Math.max(r.opacity -= 0.01, 0) : r.opacity = Math.max(r.opacity -= 0.03, 0), n(Si, r.opacity));
|
|
3774
3774
|
},
|
|
3775
3775
|
() => !e && r.opacity > 0
|
|
3776
3776
|
);
|
|
@@ -3778,12 +3778,12 @@ function xr(i) {
|
|
|
3778
3778
|
}
|
|
3779
3779
|
function Cr() {
|
|
3780
3780
|
const i = {
|
|
3781
|
-
[So]: { type: "v3", value: new
|
|
3781
|
+
[So]: { type: "v3", value: new Ln() },
|
|
3782
3782
|
[Js]: { type: "v3", value: new C() },
|
|
3783
3783
|
[ht]: { type: "v2", value: new j() },
|
|
3784
|
-
[
|
|
3784
|
+
[Cn]: { value: 0 }
|
|
3785
3785
|
};
|
|
3786
|
-
return new
|
|
3786
|
+
return new In({
|
|
3787
3787
|
uniforms: i,
|
|
3788
3788
|
vertexShader: Ao(),
|
|
3789
3789
|
fragmentShader: wo(),
|
|
@@ -3797,7 +3797,7 @@ function oa(i) {
|
|
|
3797
3797
|
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");
|
|
3798
3798
|
a.classList.add("mark-warp"), document.body.appendChild(a);
|
|
3799
3799
|
const o = new Ar();
|
|
3800
|
-
o.setSize(innerWidth, innerHeight), o.domElement.style.position = "absolute", o.domElement.style.top = "0px", o.domElement.style.pointerEvents = "none", a.appendChild(o.domElement), e(Ra, () => a), e(
|
|
3800
|
+
o.setSize(innerWidth, innerHeight), o.domElement.style.position = "absolute", o.domElement.style.top = "0px", o.domElement.style.pointerEvents = "none", a.appendChild(o.domElement), e(Ra, () => a), e(Qn, () => o), e(Hn, () => document.body.removeChild(a)), e(Oe, () => o.render(t(B), t(V)), !0), e(Te, (s) => {
|
|
3801
3801
|
const r = s?.getMarkData?.()?.name || s?.name;
|
|
3802
3802
|
r && n.set(r, new WeakRef(s));
|
|
3803
3803
|
}), e(Ze, (s) => {
|
|
@@ -3811,7 +3811,7 @@ function oa(i) {
|
|
|
3811
3811
|
return r ? r.getMarkData?.() : {};
|
|
3812
3812
|
}), e(dt, (s) => {
|
|
3813
3813
|
s !== void 0 && (t(I).markVisible = s), t(B).traverse((r) => r.isMark && (r.visible = t(I).markVisible)), t(J);
|
|
3814
|
-
}), e(
|
|
3814
|
+
}), e(An, async () => {
|
|
3815
3815
|
const s = [];
|
|
3816
3816
|
t(B).traverse((c) => {
|
|
3817
3817
|
if (c.isMark) {
|
|
@@ -3820,7 +3820,7 @@ function oa(i) {
|
|
|
3820
3820
|
}
|
|
3821
3821
|
});
|
|
3822
3822
|
const r = t(ye).meta || {};
|
|
3823
|
-
return s.length ? r.marks = s : delete r.marks, r.cameraInfo = t(
|
|
3823
|
+
return s.length ? r.marks = s : delete r.marks, r.cameraInfo = t(ds), await t(Le, r);
|
|
3824
3824
|
}), e(kt, async () => {
|
|
3825
3825
|
const s = [];
|
|
3826
3826
|
t(B).traverse((c) => {
|
|
@@ -3830,40 +3830,40 @@ function oa(i) {
|
|
|
3830
3830
|
}
|
|
3831
3831
|
});
|
|
3832
3832
|
const r = t(ye).meta || {};
|
|
3833
|
-
return s.length ? r.marks = s : delete r.marks, await t(
|
|
3833
|
+
return s.length ? r.marks = s : delete r.marks, await t(Le, r);
|
|
3834
3834
|
}), e(Ls, async () => {
|
|
3835
3835
|
const s = t(ye).meta || {};
|
|
3836
3836
|
delete s.marks;
|
|
3837
|
-
const r = await t(
|
|
3837
|
+
const r = await t(Le, s), c = [];
|
|
3838
3838
|
return n.forEach((u) => c.push(u)), c.forEach((u) => u.deref()?.dispose?.()), t(J), r;
|
|
3839
3839
|
}), e(Fs, async () => {
|
|
3840
3840
|
t(B).traverse((r) => {
|
|
3841
3841
|
r.isMark && r.getMarkData?.();
|
|
3842
3842
|
});
|
|
3843
3843
|
const s = t(ye).meta || {};
|
|
3844
|
-
return s.watermark = t(Ds) || "", await t(
|
|
3845
|
-
}), e(
|
|
3844
|
+
return s.watermark = t(Ds) || "", await t(Le, s);
|
|
3845
|
+
}), e(wn, (s) => {
|
|
3846
3846
|
s.meterScale && (t(I).meterScale = s.meterScale, t(oe, { scale: `1 : ${t(I).meterScale} m` })), t(Y).updateByOptions({ ...s, ...s.cameraInfo || {} }), (s.marks || []).forEach((c) => {
|
|
3847
3847
|
if (c.type === "MarkSinglePoint") {
|
|
3848
3848
|
const u = new ia(i, c);
|
|
3849
3849
|
u.visible = !1, t(B).add(u);
|
|
3850
3850
|
} else if (c.type === "MarkDistanceLine") {
|
|
3851
|
-
const u = new
|
|
3851
|
+
const u = new Mn(i);
|
|
3852
3852
|
u.draw(c), u.visible = !1, t(B).add(u);
|
|
3853
3853
|
} else if (c.type === "MarkMultiLines") {
|
|
3854
|
-
const u = new
|
|
3854
|
+
const u = new Tn(i);
|
|
3855
3855
|
u.draw(c, !0), u.visible = !1, t(B).add(u);
|
|
3856
3856
|
} else if (c.type === "MarkMultiPlans") {
|
|
3857
|
-
const u = new
|
|
3857
|
+
const u = new kn(i);
|
|
3858
3858
|
u.draw(c, !0), u.visible = !1, t(B).add(u);
|
|
3859
3859
|
} else if (c.type === "MarkCirclePlan") {
|
|
3860
3860
|
const u = new sa(i);
|
|
3861
3861
|
u.draw(c), u.visible = !1, t(B).add(u);
|
|
3862
3862
|
}
|
|
3863
|
-
}), t(
|
|
3864
|
-
}), e(
|
|
3863
|
+
}), t(Gn, s.flyPositions || []), t(Nn, s.flyTargets || []);
|
|
3864
|
+
}), e(ke, () => {
|
|
3865
3865
|
const s = t(I);
|
|
3866
|
-
s.markMode = !1, t(
|
|
3866
|
+
s.markMode = !1, t(On), t(J);
|
|
3867
3867
|
}), e(Ps, (s, r = !0) => {
|
|
3868
3868
|
const c = s?.meterScale;
|
|
3869
3869
|
if (c) {
|
|
@@ -3873,39 +3873,39 @@ function oa(i) {
|
|
|
3873
3873
|
}
|
|
3874
3874
|
r && (t(I).meterScale = s.meterScale), t(oe, { scale: `1 : ${c} m` });
|
|
3875
3875
|
for (const u of n.values()) {
|
|
3876
|
-
const
|
|
3877
|
-
|
|
3876
|
+
const d = u.deref();
|
|
3877
|
+
d && (d instanceof Mn || d instanceof Tn || d instanceof kn) && d.updateByMeterScale(c);
|
|
3878
3878
|
}
|
|
3879
3879
|
}
|
|
3880
3880
|
}), e(ln, (s) => {
|
|
3881
|
-
const r = new C().fromArray(s.slice(0, 3)), c = new C().fromArray(s.slice(-6, -3)), u = new C().fromArray(s.slice(-3)),
|
|
3881
|
+
const r = new C().fromArray(s.slice(0, 3)), c = new C().fromArray(s.slice(-6, -3)), u = new C().fromArray(s.slice(-3)), d = r.distanceTo(u) < 1e-4, l = c.distanceTo(u) < 1e-4, h = new C(), f = d || l ? s.length / 3 - 1 : s.length / 3;
|
|
3882
3882
|
for (let p = 0; p < f; p++)
|
|
3883
3883
|
h.add(new C(s[p * 3], s[p * 3 + 1], s[p * 3 + 2]));
|
|
3884
3884
|
return h.divideScalar(f), h;
|
|
3885
3885
|
}), e(dn, (s) => {
|
|
3886
3886
|
const r = [];
|
|
3887
|
-
for (let
|
|
3888
|
-
r.push(new C(s[
|
|
3887
|
+
for (let l = 0, h = s.length / 3; l < h; l++)
|
|
3888
|
+
r.push(new C(s[l * 3], s[l * 3 + 1], s[l * 3 + 2]));
|
|
3889
3889
|
const c = r[0].distanceTo(r[r.length - 1]) < 1e-4, u = r[r.length - 2].distanceTo(r[r.length - 1]) < 1e-4;
|
|
3890
3890
|
if ((c || u) && r.pop(), r.length < 3) return 0;
|
|
3891
|
-
let
|
|
3892
|
-
for (let
|
|
3893
|
-
|
|
3894
|
-
return
|
|
3895
|
-
}), e(
|
|
3891
|
+
let d = 0;
|
|
3892
|
+
for (let l = 0, h = r.length - 2; l < h; l++)
|
|
3893
|
+
d += t(Gt, r[0], r[l + 1], r[l + 2], t(I).meterScale);
|
|
3894
|
+
return d;
|
|
3895
|
+
}), e(cs, (s, r) => {
|
|
3896
3896
|
let c = 0;
|
|
3897
|
-
for (let u = 0,
|
|
3897
|
+
for (let u = 0, d = s.length - 2; u < d; u++)
|
|
3898
3898
|
c += t(Gt, s[0], s[u + 1], s[u + 2], r);
|
|
3899
3899
|
return c;
|
|
3900
3900
|
}), e(Gt, (s, r, c, u) => {
|
|
3901
|
-
const
|
|
3902
|
-
return Math.sqrt(f * (f -
|
|
3901
|
+
const d = s.distanceTo(r) * u, l = r.distanceTo(c) * u, h = c.distanceTo(s) * u, f = (d + l + h) / 2;
|
|
3902
|
+
return Math.sqrt(f * (f - d) * (f - l) * (f - h));
|
|
3903
3903
|
});
|
|
3904
3904
|
}
|
|
3905
3905
|
function Mr(i) {
|
|
3906
3906
|
const e = (h, ...f) => i.fire(h, ...f), t = (h, f, p) => i.on(h, f, p), n = [], a = [];
|
|
3907
3907
|
let o = !1, s = !1;
|
|
3908
|
-
t(zt, () => o = !1), t(
|
|
3908
|
+
t(zt, () => o = !1), t(Mi, () => o = !0), t(Ci, () => n), t(Oa, () => {
|
|
3909
3909
|
const h = [];
|
|
3910
3910
|
for (let f = 0, p = n.length; f < p; f++)
|
|
3911
3911
|
h.push(...n[f].toArray());
|
|
@@ -3915,16 +3915,16 @@ function Mr(i) {
|
|
|
3915
3915
|
for (let f = 0, p = a.length; f < p; f++)
|
|
3916
3916
|
h.push(...a[f].toArray());
|
|
3917
3917
|
return h;
|
|
3918
|
-
}), t(
|
|
3918
|
+
}), t(Gn, (h) => {
|
|
3919
3919
|
for (let f = 0, p = h.length / 3 | 0; f < p; f++)
|
|
3920
3920
|
n[f] = new C(h[f * 3 + 0], h[f * 3 + 1], h[f * 3 + 2]);
|
|
3921
|
-
}), t(
|
|
3921
|
+
}), t(Nn, (h) => {
|
|
3922
3922
|
for (let f = 0, p = h.length / 3 | 0; f < p; f++)
|
|
3923
3923
|
a[f] = new C(h[f * 3 + 0], h[f * 3 + 1], h[f * 3 + 2]);
|
|
3924
|
-
}), t(
|
|
3924
|
+
}), t(Yn, () => {
|
|
3925
3925
|
const h = e(Y);
|
|
3926
3926
|
n.push(h.object.position.clone()), a.push(h.target.clone());
|
|
3927
|
-
}), t(
|
|
3927
|
+
}), t(Vn, () => {
|
|
3928
3928
|
n.length = 0, a.length = 0;
|
|
3929
3929
|
}), t(Bs, async () => {
|
|
3930
3930
|
const h = e(ye).meta || {};
|
|
@@ -3935,26 +3935,26 @@ function Mr(i) {
|
|
|
3935
3935
|
h.flyPositions = f, h.flyTargets = p;
|
|
3936
3936
|
} else
|
|
3937
3937
|
delete h.flyPositions, delete h.flyTargets;
|
|
3938
|
-
return await e(
|
|
3938
|
+
return await e(Le, h);
|
|
3939
3939
|
}), t(Us, () => {
|
|
3940
3940
|
s || (s = !0) && e(Ot);
|
|
3941
3941
|
});
|
|
3942
3942
|
let r = 0;
|
|
3943
3943
|
const c = 120 * 1e3;
|
|
3944
|
-
let u = 0,
|
|
3944
|
+
let u = 0, d, l;
|
|
3945
3945
|
t(Ot, (h) => {
|
|
3946
|
-
if (r = 0, u = Date.now(),
|
|
3947
|
-
const f = e(Y), p = [f.object.position.clone()], m = [f.target.clone()], g = e(
|
|
3946
|
+
if (r = 0, u = Date.now(), d = null, l = null, !n.length || !h && !e(Y).autoRotate) return;
|
|
3947
|
+
const f = e(Y), p = [f.object.position.clone()], m = [f.target.clone()], g = e(Ci) || [];
|
|
3948
3948
|
for (let y = 0, M = Math.min(g.length, 100); y < M; y++)
|
|
3949
3949
|
g[y] && p.push(g[y]), a[y] && m.push(a[y]);
|
|
3950
|
-
|
|
3950
|
+
d = new ai(p), d.closed = !0, l = new ai(m), l.closed = !0, e(Mi), e(q, !1);
|
|
3951
3951
|
}), t(
|
|
3952
3952
|
lt,
|
|
3953
3953
|
() => {
|
|
3954
|
-
if (Date.now() - u > c && e(zt), !o || !
|
|
3954
|
+
if (Date.now() - u > c && e(zt), !o || !d || !l) return;
|
|
3955
3955
|
const h = e(Y);
|
|
3956
3956
|
r = (Date.now() - u) / c;
|
|
3957
|
-
const f =
|
|
3957
|
+
const f = d.getPoint(r), p = l.getPoint(r);
|
|
3958
3958
|
h.object.position.set(f.x, f.y, f.z), h.target.set(p.x, p.y, p.z);
|
|
3959
3959
|
},
|
|
3960
3960
|
!0
|
|
@@ -3962,49 +3962,49 @@ function Mr(i) {
|
|
|
3962
3962
|
}
|
|
3963
3963
|
class Br {
|
|
3964
3964
|
constructor(e = {}) {
|
|
3965
|
-
this.disposed = !1, this.updateTime = 0, this.needUpdate = !0, console.info("Reall3dViewer", Yt), this.init(
|
|
3965
|
+
this.disposed = !1, this.updateTime = 0, this.needUpdate = !0, console.info("Reall3dViewer", Yt), this.init(Gi(e)), !e.disableDropLocalFile && this.enableDropLocalFile();
|
|
3966
3966
|
}
|
|
3967
3967
|
init(e) {
|
|
3968
3968
|
const t = this;
|
|
3969
3969
|
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];
|
|
3970
|
-
const n = Go(e), a = e.scene = e.scene || new
|
|
3971
|
-
a.background = new
|
|
3970
|
+
const n = Go(e), a = e.scene = e.scene || new as();
|
|
3971
|
+
a.background = new Ln(e.background), No(e);
|
|
3972
3972
|
const o = e.controls = new dr(e);
|
|
3973
3973
|
o.updateByOptions(e);
|
|
3974
|
-
const s = new
|
|
3974
|
+
const s = new $n();
|
|
3975
3975
|
e.viewerEvents = s, t.events = s;
|
|
3976
|
-
const r = (
|
|
3977
|
-
r(I, () => e), r(Ke, () => n.domElement), r(ct, () => n), r(B, () => a), r(Y, () => o), r(V, () => o.object), r(ee, () => e.bigSceneMode), r(Fa, (
|
|
3976
|
+
const r = (l, h, f) => s.on(l, h, f), c = (l, ...h) => s.fire(l, ...h);
|
|
3977
|
+
r(I, () => e), r(Ke, () => n.domElement), r(ct, () => n), r(B, () => a), r(Y, () => o), r(V, () => o.object), r(ee, () => e.bigSceneMode), r(Fa, (l) => e.pointcloudMode = l);
|
|
3978
3978
|
const u = [];
|
|
3979
3979
|
r(J, () => {
|
|
3980
3980
|
for (t.needUpdate = !0; u.length; ) u.pop().stop = !0;
|
|
3981
|
-
let
|
|
3982
|
-
u.push(
|
|
3983
|
-
|
|
3981
|
+
let l = { count: 0, stop: !1 };
|
|
3982
|
+
u.push(l), c(
|
|
3983
|
+
Fn,
|
|
3984
3984
|
() => {
|
|
3985
|
-
!t.disposed && (t.needUpdate = !0),
|
|
3985
|
+
!t.disposed && (t.needUpdate = !0), l.count++ >= 600 && (l.stop = !0);
|
|
3986
3986
|
},
|
|
3987
|
-
() => !t.disposed && (c(
|
|
3987
|
+
() => !t.disposed && (c(zn) || !l.stop),
|
|
3988
3988
|
10
|
|
3989
3989
|
);
|
|
3990
|
-
}),
|
|
3991
|
-
o.update(), !t.needUpdate && c(
|
|
3992
|
-
}), r(Ve, () => c(Wt), !0), r(Ve, () => c(
|
|
3990
|
+
}), Jn(s), Yo(s), ei(s), Sr(s), oa(s), vr(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 os("#ffffff", 2)), a.add(c(Is)), n.setAnimationLoop(t.update.bind(t)), r(xi, () => {
|
|
3991
|
+
o.update(), !t.needUpdate && c(vs) && c(J);
|
|
3992
|
+
}), r(Ve, () => c(Wt), !0), r(Ve, () => c(xi), !0), r(
|
|
3993
3993
|
Oe,
|
|
3994
3994
|
() => {
|
|
3995
3995
|
try {
|
|
3996
3996
|
!(t.needUpdate = !1) && n.render(a, c(V));
|
|
3997
|
-
} catch (
|
|
3998
|
-
console.warn(
|
|
3997
|
+
} catch (l) {
|
|
3998
|
+
console.warn(l.message);
|
|
3999
3999
|
}
|
|
4000
4000
|
},
|
|
4001
4001
|
!0
|
|
4002
4002
|
), r(lt, () => {
|
|
4003
4003
|
}, !0), r(Ht, () => t.dispose()), r(Os, () => console.info(JSON.stringify(c(ye).meta || {}, null, 2)));
|
|
4004
|
-
let
|
|
4005
|
-
r(mt, (
|
|
4006
|
-
|
|
4007
|
-
}), r(Ds, () =>
|
|
4004
|
+
let d = "";
|
|
4005
|
+
r(mt, (l = "") => {
|
|
4006
|
+
d = l, t.splatMesh.fire(Wn, d, !0);
|
|
4007
|
+
}), r(Ds, () => d), c(oe, { scale: `1 : ${c(I).meterScale} m` }), t.initGsApi();
|
|
4008
4008
|
}
|
|
4009
4009
|
/**
|
|
4010
4010
|
* 允许拖拽本地文件进行渲染
|
|
@@ -4046,9 +4046,9 @@ class Br {
|
|
|
4046
4046
|
// 开发调试用临时接口
|
|
4047
4047
|
fire(e, t, n) {
|
|
4048
4048
|
const a = this;
|
|
4049
|
-
e === 1 && a.splatMesh.fire(hn, t), e === 2 && a.events.fire(
|
|
4050
|
-
let o = await a.splatMesh.fire(
|
|
4051
|
-
t && (o = a.splatMesh.fire(Ws) + t), a.splatMesh.fire(
|
|
4049
|
+
e === 1 && a.splatMesh.fire(hn, t), e === 2 && a.events.fire(Yn), e === 3 && a.events.fire(Ot, !0), e === 4 && a.events.fire(Vn), e === 5 && a.events.fire(Bs), e === 6 && a.events.fire(kt), e === 7 && a.events.fire(Ls), e === 8 && (async () => {
|
|
4050
|
+
let o = await a.splatMesh.fire(Xn);
|
|
4051
|
+
t && (o = a.splatMesh.fire(Ws) + t), a.splatMesh.fire(Bn, o);
|
|
4052
4052
|
})();
|
|
4053
4053
|
}
|
|
4054
4054
|
/**
|
|
@@ -4061,14 +4061,14 @@ class Br {
|
|
|
4061
4061
|
if (t.disposed) return {};
|
|
4062
4062
|
const n = (r, ...c) => t.events.fire(r, ...c);
|
|
4063
4063
|
let a;
|
|
4064
|
-
return n(B).traverse((r) => !a && r instanceof pe && (a = r.options())), e && (e.autoRotate !== void 0 && (n(Y).autoRotate = e.autoRotate, n(I).autoRotate = e.autoRotate), e.pointcloudMode !== void 0 && n(Bt, e.pointcloudMode), e.lightFactor !== void 0 && n(rt, e.lightFactor), e.maxRenderCountOfMobile && (n(I).maxRenderCountOfMobile = e.maxRenderCountOfMobile), e.maxRenderCountOfPc && (n(I).maxRenderCountOfPc = e.maxRenderCountOfPc), e.debugMode !== void 0 && (n(I).debugMode = e.debugMode), e.markType !== void 0 && (n(I).markType = e.markType), e.markVisible !== void 0 && n(dt, e.markVisible), e.meterScale !== void 0 && (n(I).meterScale = e.meterScale), e.markMode !== void 0 && (n(I).markMode = e.markMode, !e.markMode && n(
|
|
4064
|
+
return n(B).traverse((r) => !a && r instanceof pe && (a = r.options())), e && (e.autoRotate !== void 0 && (n(Y).autoRotate = e.autoRotate, n(I).autoRotate = e.autoRotate), e.pointcloudMode !== void 0 && n(Bt, e.pointcloudMode), e.lightFactor !== void 0 && n(rt, e.lightFactor), e.maxRenderCountOfMobile && (n(I).maxRenderCountOfMobile = e.maxRenderCountOfMobile), e.maxRenderCountOfPc && (n(I).maxRenderCountOfPc = e.maxRenderCountOfPc), e.debugMode !== void 0 && (n(I).debugMode = e.debugMode), e.markType !== void 0 && (n(I).markType = e.markType), e.markVisible !== void 0 && n(dt, e.markVisible), e.meterScale !== void 0 && (n(I).meterScale = e.meterScale), e.markMode !== void 0 && (n(I).markMode = e.markMode, !e.markMode && n(On), n(Y).autoRotate = n(I).autoRotate = !1)), n(Y).updateByOptions(e), n(oe, { scale: `1 : ${n(I).meterScale} m` }), Object.assign({ ...n(I) }, a);
|
|
4065
4065
|
}
|
|
4066
4066
|
/**
|
|
4067
4067
|
* 重置
|
|
4068
4068
|
*/
|
|
4069
4069
|
reset(e = {}) {
|
|
4070
4070
|
const t = this;
|
|
4071
|
-
t.dispose(), t.disposed = !1, t.init(
|
|
4071
|
+
t.dispose(), t.disposed = !1, t.init(Gi(e));
|
|
4072
4072
|
}
|
|
4073
4073
|
/**
|
|
4074
4074
|
* 光圈过渡切换显示
|
|
@@ -4100,7 +4100,7 @@ class Br {
|
|
|
4100
4100
|
if (!a.url.endsWith(".bin") && !a.url.endsWith(".spx"))
|
|
4101
4101
|
return console.error("The format is unsupported in the large scene mode", a.url);
|
|
4102
4102
|
const o = { ...a, ...a.cameraInfo || {} };
|
|
4103
|
-
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(
|
|
4103
|
+
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(Gn, a.flyPositions || []), n(Nn, a.flyTargets || [])) : n(wn, a), await t.splatMesh.addModel({ url: a.url }, a), await n(mt, a.watermark), n(Y).updateRotateAxis();
|
|
4104
4104
|
}
|
|
4105
4105
|
/**
|
|
4106
4106
|
* 添加要渲染的高斯模型(小场景模式)
|
|
@@ -4136,39 +4136,39 @@ class Br {
|
|
|
4136
4136
|
console.error("unknow format!", o.url);
|
|
4137
4137
|
return;
|
|
4138
4138
|
}
|
|
4139
|
-
n(
|
|
4139
|
+
n(wn, r), await t.splatMesh.addModel(o, r), await n(mt, r.watermark);
|
|
4140
4140
|
}
|
|
4141
4141
|
/**
|
|
4142
4142
|
* 根据需要暴露的接口
|
|
4143
4143
|
*/
|
|
4144
4144
|
initGsApi() {
|
|
4145
|
-
const e = (
|
|
4145
|
+
const e = (d, ...l) => this.events.fire(d, ...l), t = () => {
|
|
4146
4146
|
setTimeout(() => window.focus()), e(zt), e(Y).autoRotate = e(I).autoRotate = !e(I).autoRotate;
|
|
4147
|
-
}, n = (
|
|
4148
|
-
setTimeout(() => window.focus()),
|
|
4149
|
-
const
|
|
4150
|
-
|
|
4151
|
-
}, a = (
|
|
4152
|
-
setTimeout(() => window.focus()), e(dt, !!
|
|
4153
|
-
}, o = (
|
|
4147
|
+
}, n = (d = !0) => {
|
|
4148
|
+
setTimeout(() => window.focus()), d = !!d;
|
|
4149
|
+
const l = e(I);
|
|
4150
|
+
l.pointcloudMode !== d && (l.bigSceneMode ? e(Bt, d) : e(Ut));
|
|
4151
|
+
}, a = (d = !0) => {
|
|
4152
|
+
setTimeout(() => window.focus()), e(dt, !!d);
|
|
4153
|
+
}, o = (d) => {
|
|
4154
4154
|
setTimeout(() => window.focus());
|
|
4155
|
-
const
|
|
4156
|
-
if (
|
|
4157
|
-
if (
|
|
4158
|
-
|
|
4159
|
-
else if (
|
|
4160
|
-
|
|
4161
|
-
else if (
|
|
4162
|
-
|
|
4163
|
-
else if (
|
|
4164
|
-
|
|
4155
|
+
const l = e(I);
|
|
4156
|
+
if (l.markMode) return !1;
|
|
4157
|
+
if (d === 1)
|
|
4158
|
+
l.markType = "point";
|
|
4159
|
+
else if (d === 2)
|
|
4160
|
+
l.markType = "lines";
|
|
4161
|
+
else if (d === 3)
|
|
4162
|
+
l.markType = "plans";
|
|
4163
|
+
else if (d === 4)
|
|
4164
|
+
l.markType = "distance";
|
|
4165
4165
|
else
|
|
4166
4166
|
return !1;
|
|
4167
|
-
return
|
|
4168
|
-
}, s = async (
|
|
4169
|
-
setTimeout(() => window.focus()), e(hn, !!
|
|
4170
|
-
}, u = (
|
|
4171
|
-
e(mt,
|
|
4167
|
+
return l.markMode = !0, e(q), !0;
|
|
4168
|
+
}, s = async (d) => (setTimeout(() => window.focus()), d ? (e(st, d)?.dispose(), e(J), await e(kt)) : !1), r = async (d, l = !0) => (e(Ps, d, l), e(st, d?.name)?.drawUpdate?.(d, l), e(J), l ? (setTimeout(() => window.focus()), await e(kt)) : !0), c = (d = !0) => {
|
|
4169
|
+
setTimeout(() => window.focus()), e(hn, !!d);
|
|
4170
|
+
}, u = (d, l = !0) => {
|
|
4171
|
+
e(mt, d), l && e(Fs, d);
|
|
4172
4172
|
};
|
|
4173
4173
|
window.$api = { switchAutoRotate: t, changePointCloudMode: n, showMark: a, startMark: o, deleteMark: s, updateMark: r, showWaterMark: c, setWaterMark: u };
|
|
4174
4174
|
}
|
|
@@ -4180,26 +4180,26 @@ class Br {
|
|
|
4180
4180
|
if (e.disposed) return;
|
|
4181
4181
|
e.disposed = !0;
|
|
4182
4182
|
const t = (o, ...s) => e.events.fire(o, ...s), n = t(ct), a = n.domElement;
|
|
4183
|
-
t(
|
|
4183
|
+
t(Un), t(ws), t(Hn), t(Rn), t(Y).dispose(), t(Ee, t(B)), n.clear(), n.dispose(), a.parentElement.removeChild(a), e.splatMesh = null, e.events.clear(), e.events = null;
|
|
4184
4184
|
}
|
|
4185
4185
|
}
|
|
4186
4186
|
function Tr(i) {
|
|
4187
4187
|
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();
|
|
4188
4188
|
e(It, () => t(re) && a.set(Date.now(), 1)), e(Dt, () => t(re) && t(Ye, a)), e(Pt, () => t(re) && o.set(Date.now(), 1)), e(Lt, () => t(re) && t(Ye, o)), e(Ye, (s) => {
|
|
4189
4189
|
let r = [], c = Date.now(), u = 0;
|
|
4190
|
-
for (const
|
|
4191
|
-
c -
|
|
4192
|
-
return r.forEach((
|
|
4190
|
+
for (const d of s.keys())
|
|
4191
|
+
c - d <= 1e3 ? u++ : r.push(d);
|
|
4192
|
+
return r.forEach((d) => s.delete(d)), Math.min(u, 30);
|
|
4193
4193
|
}), e(X, () => {
|
|
4194
4194
|
const s = t(B), r = t(V), c = [];
|
|
4195
4195
|
return s?.traverse(function(u) {
|
|
4196
4196
|
u.isWarpSplatMesh && u.splatMesh?.visible && c.push(u);
|
|
4197
|
-
}), c.sort((u,
|
|
4197
|
+
}), c.sort((u, d) => r.position.distanceTo(u.position) - r.position.distanceTo(d.position)), window.splat = c[0]?.splatMesh, c[0]?.splatMesh;
|
|
4198
4198
|
}), e(Ks, () => {
|
|
4199
4199
|
const s = t(B), r = t(V), c = [];
|
|
4200
4200
|
s?.traverse(function(u) {
|
|
4201
4201
|
u.isWarpSplatMesh && c.push(u);
|
|
4202
|
-
}), c.sort((u,
|
|
4202
|
+
}), c.sort((u, d) => r.position.distanceTo(u.position) - r.position.distanceTo(d.position));
|
|
4203
4203
|
for (let u = 0; u < c.length; u++)
|
|
4204
4204
|
c[u].active = u < n, c[u].splatMesh && (c[u].splatMesh.renderOrder = 1e3 - u);
|
|
4205
4205
|
}), e(Zs, () => {
|
|
@@ -4207,15 +4207,15 @@ function Tr(i) {
|
|
|
4207
4207
|
s?.traverse((c) => r.push(c)), r.forEach((c) => {
|
|
4208
4208
|
c.dispose ? c.dispose() : (c.geometry?.dispose?.(), c.material && c.material instanceof Array ? c.material.forEach((u) => u?.dispose?.()) : c.material?.dispose?.());
|
|
4209
4209
|
}), s?.clear();
|
|
4210
|
-
}), e(wn, (s = 0.1) => {
|
|
4211
|
-
const r = t(X);
|
|
4212
|
-
r && r.visible && r.rotateOnAxis(new C(1, 0, 0), be.degToRad(s));
|
|
4213
4210
|
}), e(vn, (s = 0.1) => {
|
|
4214
4211
|
const r = t(X);
|
|
4215
|
-
r && r.visible && r.rotateOnAxis(new C(
|
|
4212
|
+
r && r.visible && r.rotateOnAxis(new C(1, 0, 0), xe.degToRad(s));
|
|
4216
4213
|
}), e(Sn, (s = 0.1) => {
|
|
4217
4214
|
const r = t(X);
|
|
4218
|
-
r && r.visible && r.rotateOnAxis(new C(0,
|
|
4215
|
+
r && r.visible && r.rotateOnAxis(new C(0, 1, 0), xe.degToRad(s));
|
|
4216
|
+
}), e(bn, (s = 0.1) => {
|
|
4217
|
+
const r = t(X);
|
|
4218
|
+
r && r.visible && r.rotateOnAxis(new C(0, 0, 1), xe.degToRad(s));
|
|
4219
4219
|
}), e(Ha, (s = 0.01) => {
|
|
4220
4220
|
const r = t(X);
|
|
4221
4221
|
r && r.visible && (r.position.x += s);
|
|
@@ -4237,21 +4237,21 @@ function Tr(i) {
|
|
|
4237
4237
|
}), e(Na, async (s) => {
|
|
4238
4238
|
if (!s && (s = t(X)), !s) return;
|
|
4239
4239
|
const r = s.meta || {};
|
|
4240
|
-
return r.transform = s.matrix.toArray(), await t(
|
|
4240
|
+
return r.transform = s.matrix.toArray(), await t(Le, JSON.stringify(r), s.meta.url);
|
|
4241
4241
|
}), e(Vs, () => {
|
|
4242
|
-
const s = t(I).root, r = new
|
|
4242
|
+
const s = t(I).root, r = new ns({ antialias: !1, logarithmicDepthBuffer: !0, stencil: !0, alpha: !0, precision: "highp" });
|
|
4243
4243
|
return r.setSize(s.clientWidth, s.clientHeight), r.setPixelRatio(Math.min(devicePixelRatio, 2)), e(ct, () => r), e(Ke, () => r.domElement), r;
|
|
4244
4244
|
}), e(Gs, () => {
|
|
4245
|
-
const s = new
|
|
4246
|
-
return
|
|
4245
|
+
const s = t(I), r = new as(), c = s.background || "#dbf0ff";
|
|
4246
|
+
return r.background = new Ln(c), r.fog = new oi(c, 0), e(B, () => r), r;
|
|
4247
4247
|
}), e(Ns, () => {
|
|
4248
|
-
const r = t(V), c = t(B), u = t(I),
|
|
4249
|
-
|
|
4250
|
-
const
|
|
4251
|
-
return
|
|
4252
|
-
const p = Math.max(
|
|
4253
|
-
|
|
4254
|
-
}), e(Y, () =>
|
|
4248
|
+
const r = t(V), c = t(B), u = t(I), d = new ur(t(V), u.root);
|
|
4249
|
+
d.screenSpacePanning = !1, d.minDistance = 0.1, d.maxDistance = 6e4, d.maxPolarAngle = 1.2, d.enableDamping = !0, d.dampingFactor = 0.07, d.zoomToCursor = !0;
|
|
4250
|
+
const l = new C().fromArray(u.minPan || [-2e4, 0.1, -6e4]), h = new C().fromArray(u.maxPan || [5e4, 1e4, 0]), f = new C();
|
|
4251
|
+
return d.addEventListener("change", () => {
|
|
4252
|
+
const p = Math.max(d.getPolarAngle(), 0.1), m = Math.max(d.getDistance(), 0.1);
|
|
4253
|
+
d.zoomSpeed = Math.max(Math.log(m), 0) + 0.5, r.far = xe.clamp(m / p * 8, 100, 1e5), r.near = r.far / 1e3, r.updateProjectionMatrix(), c.fog instanceof oi && (c.fog.density = p / (m + 5) * 1 * 0.25), d.maxPolarAngle = Math.min(Math.pow(1e4 / m, 4), 1.2), f.copy(d.target), d.target.clamp(l, h), f.sub(d.target), r.position.sub(f);
|
|
4254
|
+
}), e(Y, () => d), e(ft, () => r.fov), e(Ce, (p = !1) => p ? r.position.clone() : r.position), e(we, (p = !1) => p ? d.target.clone() : d.target), e(Ne, (p = !1) => p ? r.up.clone() : r.up), d;
|
|
4255
4255
|
}), e(Xs, () => {
|
|
4256
4256
|
const s = new Sa(16777215, 1);
|
|
4257
4257
|
return s.position.set(0, 2e3, 1e3), s;
|
|
@@ -4264,11 +4264,11 @@ function kr(i) {
|
|
|
4264
4264
|
return n.root = e, n;
|
|
4265
4265
|
}
|
|
4266
4266
|
function Er() {
|
|
4267
|
-
const i =
|
|
4267
|
+
const i = ri.TileSource.create({
|
|
4268
4268
|
dataType: "image",
|
|
4269
4269
|
attribution: "ArcGIS",
|
|
4270
4270
|
url: "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"
|
|
4271
|
-
}), e = new
|
|
4271
|
+
}), e = new ri.TileMap({ imgSource: i, lon0: 90, minLevel: 2, maxLevel: 16 });
|
|
4272
4272
|
return e.scale.set(10, 10, 10), e.rotateX(-Math.PI / 2), e.autoUpdate = !1, e;
|
|
4273
4273
|
}
|
|
4274
4274
|
class _r {
|
|
@@ -4289,7 +4289,7 @@ function Ir(i) {
|
|
|
4289
4289
|
const x = t(X);
|
|
4290
4290
|
if (!x || !x.visible) return a.clear();
|
|
4291
4291
|
if (a.has("KeyX")) {
|
|
4292
|
-
const w =
|
|
4292
|
+
const w = xe.degToRad(0.1);
|
|
4293
4293
|
x.rotateOnAxis(new C(1, 0, 0), w);
|
|
4294
4294
|
} else
|
|
4295
4295
|
x.scale.set(x.scale.x + 0.01, x.scale.y + 0.01, x.scale.z + 0.01);
|
|
@@ -4297,7 +4297,7 @@ function Ir(i) {
|
|
|
4297
4297
|
const x = t(X);
|
|
4298
4298
|
if (!x || !x.visible) return a.clear();
|
|
4299
4299
|
if (a.has("KeyX")) {
|
|
4300
|
-
const w =
|
|
4300
|
+
const w = xe.degToRad(-0.1);
|
|
4301
4301
|
x.rotateOnAxis(new C(1, 0, 0), w);
|
|
4302
4302
|
} else
|
|
4303
4303
|
x.scale.set(x.scale.x - 0.01, x.scale.y - 0.01, x.scale.z - 0.01);
|
|
@@ -4319,7 +4319,7 @@ function Ir(i) {
|
|
|
4319
4319
|
const w = x.meta || {};
|
|
4320
4320
|
w.transform = x.matrix.toArray();
|
|
4321
4321
|
}
|
|
4322
|
-
} else a.has("KeyQ") ? t(
|
|
4322
|
+
} else a.has("KeyQ") ? t(vn, 0.1) : a.has("KeyW") ? t(Sn, 0.1) : a.has("KeyE") ? t(bn, 0.1) : a.has("KeyA") ? t(vn, -0.1) : a.has("KeyS") ? t(Sn, -0.1) : a.has("KeyD") ? t(bn, -0.1) : a.has("KeyY") ? t($s, a.has("ShiftLeft") || a.has("ShiftRight") ? -0.1 : 0.1) : a.has("KeyC") && console.info("position=", t(Ce).toArray(), "lookat=", t(we).toArray());
|
|
4323
4323
|
});
|
|
4324
4324
|
const r = (b) => {
|
|
4325
4325
|
console.info(b.code), b.target.type !== "text" && (o || b.code === "F5" || (b.preventDefault(), a.add(b.code)));
|
|
@@ -4327,14 +4327,14 @@ function Ir(i) {
|
|
|
4327
4327
|
b.target.type !== "text" && (o || a.clear());
|
|
4328
4328
|
}, u = () => {
|
|
4329
4329
|
a.clear();
|
|
4330
|
-
},
|
|
4330
|
+
}, d = (b) => {
|
|
4331
4331
|
parent && setTimeout(() => window.focus()), b.preventDefault();
|
|
4332
|
-
},
|
|
4332
|
+
}, l = async (b) => {
|
|
4333
4333
|
b.preventDefault();
|
|
4334
4334
|
};
|
|
4335
4335
|
let h, f, p, m;
|
|
4336
4336
|
e(qe, () => {
|
|
4337
|
-
h?.dispose(), f?.dispose(), p?.dispose(), m?.dispose(), h = null, f = null, p = null, m = null, s.lastMovePoint = null, t(
|
|
4337
|
+
h?.dispose(), f?.dispose(), p?.dispose(), m?.dispose(), h = null, f = null, p = null, m = null, s.lastMovePoint = null, t(ke);
|
|
4338
4338
|
});
|
|
4339
4339
|
const g = async (b) => {
|
|
4340
4340
|
parent && setTimeout(() => window.focus()), b.preventDefault(), !o && (s.down = b.button === 2 ? 2 : 1, s.move = !1, s.isDbClick = Date.now() - s.downTime < 300, s.downTime = Date.now());
|
|
@@ -4352,8 +4352,8 @@ function Ir(i) {
|
|
|
4352
4352
|
function k(b) {
|
|
4353
4353
|
s.down === 1 && !s.move && t(it, s.x, s.y);
|
|
4354
4354
|
}
|
|
4355
|
-
window.addEventListener("keydown", r), window.addEventListener("keyup", c), window.addEventListener("blur", u), window.addEventListener("wheel",
|
|
4356
|
-
o = !0, window.removeEventListener("keydown", r), window.removeEventListener("keyup", c), window.removeEventListener("blur", u), window.removeEventListener("wheel",
|
|
4355
|
+
window.addEventListener("keydown", r), window.addEventListener("keyup", c), window.addEventListener("blur", u), window.addEventListener("wheel", d, { passive: !1 }), n.addEventListener("contextmenu", l), n.addEventListener("mousedown", g), n.addEventListener("mousemove", y), n.addEventListener("mouseup", M), n.addEventListener("touchstart", S, { passive: !1 }), n.addEventListener("touchmove", v, { passive: !1 }), n.addEventListener("touchend", k, { passive: !1 }), e(Rn, () => {
|
|
4356
|
+
o = !0, window.removeEventListener("keydown", r), window.removeEventListener("keyup", c), window.removeEventListener("blur", u), window.removeEventListener("wheel", d), n.removeEventListener("contextmenu", l), n.removeEventListener("mousedown", g), n.removeEventListener("mousemove", y), n.removeEventListener("mouseup", M), n.removeEventListener("touchstart", S), n.removeEventListener("touchmove", v), n.removeEventListener("touchend", k);
|
|
4357
4357
|
}), e(it, async (b, x) => await t(Ft, b, x));
|
|
4358
4358
|
}
|
|
4359
4359
|
var Ge = Object.freeze({
|
|
@@ -4546,9 +4546,9 @@ var Ge = Object.freeze({
|
|
|
4546
4546
|
}
|
|
4547
4547
|
}, i;
|
|
4548
4548
|
}()
|
|
4549
|
-
),
|
|
4549
|
+
), En = {
|
|
4550
4550
|
Linear: function(i, e) {
|
|
4551
|
-
var t = i.length - 1, n = t * e, a = Math.floor(n), o =
|
|
4551
|
+
var t = i.length - 1, n = t * e, a = Math.floor(n), o = En.Utils.Linear;
|
|
4552
4552
|
return e < 0 ? o(i[0], i[1], n) : e > 1 ? o(i[t], i[t - 1], t - n) : o(i[a], i[a + 1 > t ? t : a + 1], n - a);
|
|
4553
4553
|
},
|
|
4554
4554
|
Utils: {
|
|
@@ -4565,11 +4565,11 @@ var Ge = Object.freeze({
|
|
|
4565
4565
|
return i._nextId++;
|
|
4566
4566
|
}, i._nextId = 0, i;
|
|
4567
4567
|
}()
|
|
4568
|
-
),
|
|
4568
|
+
), _n = new Dr(), Pr = (
|
|
4569
4569
|
/** @class */
|
|
4570
4570
|
function() {
|
|
4571
4571
|
function i(e, t) {
|
|
4572
|
-
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 =
|
|
4572
|
+
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));
|
|
4573
4573
|
}
|
|
4574
4574
|
return i.prototype.getId = function() {
|
|
4575
4575
|
return this._id;
|
|
@@ -4609,38 +4609,38 @@ var Ge = Object.freeze({
|
|
|
4609
4609
|
return this.start(e, !0);
|
|
4610
4610
|
}, i.prototype._setupProperties = function(e, t, n, a, o) {
|
|
4611
4611
|
for (var s in n) {
|
|
4612
|
-
var r = e[s], c = Array.isArray(r), u = c ? "array" : typeof r,
|
|
4612
|
+
var r = e[s], c = Array.isArray(r), u = c ? "array" : typeof r, d = !c && Array.isArray(n[s]);
|
|
4613
4613
|
if (!(u === "undefined" || u === "function")) {
|
|
4614
|
-
if (
|
|
4615
|
-
var
|
|
4616
|
-
if (
|
|
4614
|
+
if (d) {
|
|
4615
|
+
var l = n[s];
|
|
4616
|
+
if (l.length === 0)
|
|
4617
4617
|
continue;
|
|
4618
|
-
for (var h = [r], f = 0, p =
|
|
4619
|
-
var m = this._handleRelativeValue(r,
|
|
4618
|
+
for (var h = [r], f = 0, p = l.length; f < p; f += 1) {
|
|
4619
|
+
var m = this._handleRelativeValue(r, l[f]);
|
|
4620
4620
|
if (isNaN(m)) {
|
|
4621
|
-
|
|
4621
|
+
d = !1, console.warn("Found invalid interpolation list. Skipping.");
|
|
4622
4622
|
break;
|
|
4623
4623
|
}
|
|
4624
4624
|
h.push(m);
|
|
4625
4625
|
}
|
|
4626
|
-
|
|
4626
|
+
d && (n[s] = h);
|
|
4627
4627
|
}
|
|
4628
|
-
if ((u === "object" || c) && r && !
|
|
4628
|
+
if ((u === "object" || c) && r && !d) {
|
|
4629
4629
|
t[s] = c ? [] : {};
|
|
4630
4630
|
var g = r;
|
|
4631
4631
|
for (var y in g)
|
|
4632
4632
|
t[s][y] = g[y];
|
|
4633
4633
|
a[s] = c ? [] : {};
|
|
4634
|
-
var
|
|
4634
|
+
var l = n[s];
|
|
4635
4635
|
if (!this._isDynamic) {
|
|
4636
4636
|
var M = {};
|
|
4637
|
-
for (var y in
|
|
4638
|
-
M[y] =
|
|
4639
|
-
n[s] =
|
|
4637
|
+
for (var y in l)
|
|
4638
|
+
M[y] = l[y];
|
|
4639
|
+
n[s] = l = M;
|
|
4640
4640
|
}
|
|
4641
|
-
this._setupProperties(g, t[s],
|
|
4641
|
+
this._setupProperties(g, t[s], l, a[s], o);
|
|
4642
4642
|
} else
|
|
4643
|
-
(typeof t[s] > "u" || o) && (t[s] = r), c || (t[s] *= 1),
|
|
4643
|
+
(typeof t[s] > "u" || o) && (t[s] = r), c || (t[s] *= 1), d ? a[s] = n[s].slice().reverse() : a[s] = t[s] || 0;
|
|
4644
4644
|
}
|
|
4645
4645
|
}
|
|
4646
4646
|
}, i.prototype.stop = function() {
|
|
@@ -4671,7 +4671,7 @@ var Ge = Object.freeze({
|
|
|
4671
4671
|
}, i.prototype.easing = function(e) {
|
|
4672
4672
|
return e === void 0 && (e = Ge.Linear.None), this._easingFunction = e, this;
|
|
4673
4673
|
}, i.prototype.interpolation = function(e) {
|
|
4674
|
-
return e === void 0 && (e =
|
|
4674
|
+
return e === void 0 && (e = En.Linear), this._interpolationFunction = e, this;
|
|
4675
4675
|
}, i.prototype.chain = function() {
|
|
4676
4676
|
for (var e = [], t = 0; t < arguments.length; t++)
|
|
4677
4677
|
e[t] = arguments[t];
|
|
@@ -4706,8 +4706,8 @@ var Ge = Object.freeze({
|
|
|
4706
4706
|
return 1;
|
|
4707
4707
|
var m = Math.trunc(s / r), g = s - m * r, y = Math.min(g / n._duration, 1);
|
|
4708
4708
|
return y === 0 && s === n._duration ? 1 : y;
|
|
4709
|
-
},
|
|
4710
|
-
if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd,
|
|
4709
|
+
}, d = u(), l = this._easingFunction(d);
|
|
4710
|
+
if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, l), this._onUpdateCallback && this._onUpdateCallback(this._object, d), this._duration === 0 || s >= this._duration)
|
|
4711
4711
|
if (this._repeat > 0) {
|
|
4712
4712
|
var h = Math.min(Math.trunc((s - this._duration) / r) + 1, this._repeat);
|
|
4713
4713
|
isFinite(this._repeat) && (this._repeat -= h);
|
|
@@ -4726,8 +4726,8 @@ var Ge = Object.freeze({
|
|
|
4726
4726
|
}, i.prototype._updateProperties = function(e, t, n, a) {
|
|
4727
4727
|
for (var o in n)
|
|
4728
4728
|
if (t[o] !== void 0) {
|
|
4729
|
-
var s = t[o] || 0, r = n[o], c = Array.isArray(e[o]), u = Array.isArray(r),
|
|
4730
|
-
|
|
4729
|
+
var s = t[o] || 0, r = n[o], c = Array.isArray(e[o]), u = Array.isArray(r), d = !c && u;
|
|
4730
|
+
d ? e[o] = this._interpolationFunction(r, a) : typeof r == "object" && r ? this._updateProperties(e[o], s, r, a) : (r = this._handleRelativeValue(s, r), typeof r == "number" && (e[o] = s + (r - s) * a));
|
|
4731
4731
|
}
|
|
4732
4732
|
}, i.prototype._handleRelativeValue = function(e, t) {
|
|
4733
4733
|
return typeof t != "string" ? t : t.charAt(0) === "+" || t.charAt(0) === "-" ? e + parseFloat(t) : parseFloat(t);
|
|
@@ -4738,13 +4738,13 @@ var Ge = Object.freeze({
|
|
|
4738
4738
|
}()
|
|
4739
4739
|
);
|
|
4740
4740
|
ra.nextId;
|
|
4741
|
-
var me =
|
|
4741
|
+
var me = _n;
|
|
4742
4742
|
me.getAll.bind(me);
|
|
4743
4743
|
me.removeAll.bind(me);
|
|
4744
4744
|
me.add.bind(me);
|
|
4745
4745
|
me.remove.bind(me);
|
|
4746
4746
|
me.update.bind(me);
|
|
4747
|
-
const
|
|
4747
|
+
const ts = navigator.userAgent.includes("Mobi");
|
|
4748
4748
|
class Lr extends te {
|
|
4749
4749
|
constructor(e, t) {
|
|
4750
4750
|
super(), this.isWarpSplatMesh = !0, this.lastActiveTime = Date.now(), this.active = !1, this.disposed = !1, this.mapViewer = t, this.addScene(e), this.frustumCulled = !1;
|
|
@@ -4760,53 +4760,53 @@ class Lr extends te {
|
|
|
4760
4760
|
c.makeTranslation(p.x, p.y, p.z);
|
|
4761
4761
|
}
|
|
4762
4762
|
r.autoCut && (r.autoCut = Math.min(Math.max(r.autoCut, 1), 50));
|
|
4763
|
-
const u = r.autoCut && r.autoCut > 1,
|
|
4763
|
+
const u = r.autoCut && r.autoCut > 1, d = !1, l = !1, h = r.showWatermark !== !1, f = { renderer: n, scene: a, controls: o, pointcloudMode: d, bigSceneMode: u, matrix: c, showWatermark: h, depthTest: l };
|
|
4764
4764
|
f.maxRenderCountOfMobile ?? (f.maxRenderCountOfMobile = f.bigSceneMode ? 128 * 10240 : 400 * 1e4), f.maxRenderCountOfPc ?? (f.maxRenderCountOfPc = f.bigSceneMode ? 320 * 1e4 : 400 * 1e4), f.debugMode = this.mapViewer.events.fire(I).debugMode, t.opts = f, t.meta = r, a.add(t), t.initCSS3DSprite(f), t.applyMatrix4(c);
|
|
4765
4765
|
}).catch((r) => {
|
|
4766
4766
|
console.error(r.message);
|
|
4767
4767
|
});
|
|
4768
4768
|
}
|
|
4769
4769
|
async initCSS3DSprite(e) {
|
|
4770
|
-
const t = this, n = document.createElement("div");
|
|
4771
|
-
|
|
4770
|
+
const t = this, n = e.controls, a = document.createElement("div");
|
|
4771
|
+
a.innerHTML = `<div title="${t.meta.name}" style='flex-direction: column;align-items: center;display: flex;pointer-events: auto;margin-bottom: 20px;'>
|
|
4772
4772
|
<svg height="20" width="20" style="color:#eeee00;opacity:0.9;"><use href="#svgicon-point3" fill="currentColor" /></svg>
|
|
4773
|
-
</div>`,
|
|
4774
|
-
let
|
|
4775
|
-
|
|
4776
|
-
if (
|
|
4777
|
-
const
|
|
4778
|
-
|
|
4779
|
-
|
|
4773
|
+
</div>`, a.classList.add("splatmesh-point"), a.style.position = "absolute", a.style.borderRadius = "4px", a.style.cursor = "pointer";
|
|
4774
|
+
let o = null;
|
|
4775
|
+
a.onclick = () => {
|
|
4776
|
+
if (o) return;
|
|
4777
|
+
const c = n.target.clone(), u = n.object.position.clone(), d = t.position.clone(), l = ts ? 6 : 2, f = c.clone().sub(u).normalize().clone(), p = d.clone().sub(f.multiplyScalar(l)), m = { x: u.x, y: u.y, z: u.z, tx: c.x, ty: c.y, tz: c.z }, g = { x: p.x, y: p.y, z: p.z, tx: d.x, ty: d.y, tz: d.z };
|
|
4778
|
+
o = new Pr(m).to(g, 3e3), o.easing(Ge.Sinusoidal.InOut).start().onUpdate(() => {
|
|
4779
|
+
n.object.position.set(m.x, m.y, m.z), n.target.set(m.tx, m.ty, m.tz);
|
|
4780
4780
|
}).onComplete(() => {
|
|
4781
|
-
|
|
4781
|
+
o = null;
|
|
4782
4782
|
});
|
|
4783
|
-
},
|
|
4784
|
-
const
|
|
4785
|
-
|
|
4786
|
-
const
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
const
|
|
4790
|
-
if (
|
|
4783
|
+
}, a.oncontextmenu = (c) => c.preventDefault();
|
|
4784
|
+
const s = new ie(a);
|
|
4785
|
+
s.element.style.pointerEvents = "none", s.visible = !1, s.applyMatrix4(e.matrix), t.css3dTag = s, e.scene.add(s);
|
|
4786
|
+
const r = (c) => this.mapViewer.controls._onMouseWheel(c);
|
|
4787
|
+
a.addEventListener("wheel", r, { passive: !1 }), s.dispose = () => a.removeEventListener("wheel", r), t.onBeforeRender = () => {
|
|
4788
|
+
o?.update();
|
|
4789
|
+
const c = ts ? 50 : 30, u = 100, d = t.position.distanceTo(t.mapViewer.controls.object.position);
|
|
4790
|
+
if (d > c) {
|
|
4791
4791
|
t.css3dTag.visible = t.opts.controls.object.position.y > 2;
|
|
4792
|
-
let
|
|
4793
|
-
|
|
4792
|
+
let l = 2e-3 * d;
|
|
4793
|
+
s.scale.set(l, l, l), t.css3dTag.visible = n.object.position.y < 10 ? d < u : !0, t.splatMesh && (t.splatMesh.visible = !1);
|
|
4794
4794
|
} else {
|
|
4795
4795
|
if (!t.active) {
|
|
4796
4796
|
t.splatMesh && (t.splatMesh.visible = !1);
|
|
4797
|
-
let
|
|
4798
|
-
|
|
4797
|
+
let l = 2e-3 * d;
|
|
4798
|
+
s.scale.set(l, l, l), t.css3dTag.visible = !0;
|
|
4799
4799
|
return;
|
|
4800
4800
|
}
|
|
4801
4801
|
if (t.lastActiveTime = Date.now(), t.css3dTag.visible = !1, t.splatMesh)
|
|
4802
4802
|
t.splatMesh.visible = !0;
|
|
4803
4803
|
else {
|
|
4804
|
-
const
|
|
4805
|
-
|
|
4806
|
-
const
|
|
4807
|
-
t.splatMesh =
|
|
4808
|
-
const
|
|
4809
|
-
|
|
4804
|
+
const l = t.meta, h = { ...t.opts };
|
|
4805
|
+
l.autoCut && (h.bigSceneMode = !0);
|
|
4806
|
+
const f = new pe(h);
|
|
4807
|
+
t.splatMesh = f, t.opts.scene.add(f), f.applyMatrix4(t.opts.matrix), f.meta = l;
|
|
4808
|
+
const p = l.watermark || l.name || "";
|
|
4809
|
+
l.showWatermark = l.showWatermark !== !1, f.fire(Wn, p, !0, !1), f.addModel({ url: t.meta.url }, t.meta);
|
|
4810
4810
|
}
|
|
4811
4811
|
}
|
|
4812
4812
|
}, t.onAfterRender = () => {
|
|
@@ -4826,30 +4826,17 @@ class Lr extends te {
|
|
|
4826
4826
|
class Ur extends ba {
|
|
4827
4827
|
constructor(e = {}) {
|
|
4828
4828
|
console.info("Reall3dMapViewer", Yt), super(), this.clock = new xa(), this.updateTime = 0, this.disposed = !1;
|
|
4829
|
-
const t = this, n = new
|
|
4829
|
+
const t = this, n = new $n();
|
|
4830
4830
|
t.events = n;
|
|
4831
4831
|
const a = (r, c, u) => n.on(r, c, u), o = (r, ...c) => n.fire(r, ...c);
|
|
4832
4832
|
t.tileMap = Er();
|
|
4833
4833
|
const s = kr(e);
|
|
4834
|
-
a(I, () => s),
|
|
4834
|
+
a(I, () => s), Jn(n), ei(n), Tr(n), aa(n), t.camera = new is(60, 1, 0.01, 100), a(V, () => t.camera), t.container = s.root, t.renderer = o(Vs), t.scene = o(Gs), t.controls = o(Ns), t.ambLight = new os(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), oa(n), Ir(n), window.addEventListener("resize", t.resize.bind(t)), t.resize(), t.renderer.setAnimationLoop(t.animate.bind(t)), a(Ht, () => t.dispose()), a(
|
|
4835
4835
|
Ve,
|
|
4836
4836
|
() => {
|
|
4837
4837
|
o(Pt), t.controls.update(), o(Ks), o(Wt);
|
|
4838
4838
|
},
|
|
4839
4839
|
!0
|
|
4840
|
-
), a(
|
|
4841
|
-
lt,
|
|
4842
|
-
() => {
|
|
4843
|
-
t.dispatchEvent({ type: "update", delta: t.clock.getDelta() }), t.updateTime = Date.now(), o(re) && o(oe, {
|
|
4844
|
-
fps: o(Dt),
|
|
4845
|
-
realFps: o(Lt),
|
|
4846
|
-
fov: o(ft),
|
|
4847
|
-
position: o(Le, o(Be)),
|
|
4848
|
-
lookAt: o(Le, o(Ce)),
|
|
4849
|
-
lookUp: o(Le, o(Ne))
|
|
4850
|
-
});
|
|
4851
|
-
},
|
|
4852
|
-
!0
|
|
4853
4840
|
), a(
|
|
4854
4841
|
Oe,
|
|
4855
4842
|
() => {
|
|
@@ -4861,6 +4848,19 @@ class Ur extends ba {
|
|
|
4861
4848
|
}
|
|
4862
4849
|
},
|
|
4863
4850
|
!0
|
|
4851
|
+
), a(
|
|
4852
|
+
lt,
|
|
4853
|
+
() => {
|
|
4854
|
+
t.dispatchEvent({ type: "update", delta: t.clock.getDelta() }), t.updateTime = Date.now(), o(re) && o(oe, {
|
|
4855
|
+
fps: o(Dt),
|
|
4856
|
+
realFps: o(Lt),
|
|
4857
|
+
fov: o(ft),
|
|
4858
|
+
position: o(Fe, o(Ce)),
|
|
4859
|
+
lookAt: o(Fe, o(we)),
|
|
4860
|
+
lookUp: o(Fe, o(Ne))
|
|
4861
|
+
});
|
|
4862
|
+
},
|
|
4863
|
+
!0
|
|
4864
4864
|
);
|
|
4865
4865
|
}
|
|
4866
4866
|
/**
|
|
@@ -4884,7 +4884,7 @@ class Ur extends ba {
|
|
|
4884
4884
|
if (e.disposed) return;
|
|
4885
4885
|
const { width: t, height: n, top: a, left: o } = e.container.getBoundingClientRect();
|
|
4886
4886
|
e.renderer.setPixelRatio(Math.min(devicePixelRatio, 2)), e.renderer.setSize(t, n), e.camera.aspect = t / n, e.camera.updateProjectionMatrix();
|
|
4887
|
-
const s = e.events.fire(
|
|
4887
|
+
const s = e.events.fire(Qn);
|
|
4888
4888
|
s.setSize(t, n), s.domElement.style.position = "absolute", s.domElement.style.left = `${o}px`, s.domElement.style.top = `${a}px`;
|
|
4889
4889
|
}
|
|
4890
4890
|
animate() {
|
|
@@ -4899,7 +4899,7 @@ class Ur extends ba {
|
|
|
4899
4899
|
if (e.disposed) return;
|
|
4900
4900
|
e.disposed = !0;
|
|
4901
4901
|
const t = e.renderer.domElement;
|
|
4902
|
-
e.events.fire(
|
|
4902
|
+
e.events.fire(Hn), 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, document.querySelector("#gsviewer .debug.dev-panel")?.classList?.remove("map");
|
|
4903
4903
|
}
|
|
4904
4904
|
}
|
|
4905
4905
|
export {
|