iflow-engine-base 4.0.14 → 4.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bim-engine-sdk.es.js +2 -2
- package/dist/bim-engine-sdk.umd.js +194 -194
- package/dist/chunks/{engine-3d-O9j7G-bi.js → engine-3d-DAEOqkkS.js} +847 -639
- package/dist/chunks/{sdk-runtime-y-YldFea.js → sdk-runtime-CB2jwkGL.js} +1 -1
- package/dist/gis-fixtures/0/0/0.png +0 -0
- package/dist/gis-fixtures/0/0/0.svg +6 -0
- package/dist/gis-fixtures/1/0/0.png +0 -0
- package/dist/gis-fixtures/1/0/0.svg +7 -0
- package/dist/gis-fixtures/1/0/1.png +0 -0
- package/dist/gis-fixtures/1/0/1.svg +7 -0
- package/dist/gis-fixtures/1/1/0.png +0 -0
- package/dist/gis-fixtures/1/1/0.svg +7 -0
- package/dist/gis-fixtures/1/1/1.png +0 -0
- package/dist/gis-fixtures/1/1/1.svg +7 -0
- package/dist/gis-fixtures/10/846/439.png +0 -0
- package/dist/gis-fixtures/10/846/440.png +0 -0
- package/dist/gis-fixtures/10/846/441.png +0 -0
- package/dist/gis-fixtures/10/847/439.png +0 -0
- package/dist/gis-fixtures/10/847/440.png +0 -0
- package/dist/gis-fixtures/10/847/441.png +0 -0
- package/dist/gis-fixtures/10/848/439.png +0 -0
- package/dist/gis-fixtures/10/848/440.png +0 -0
- package/dist/gis-fixtures/10/848/441.png +0 -0
- package/dist/gis-fixtures/11/1694/879.png +0 -0
- package/dist/gis-fixtures/11/1694/880.png +0 -0
- package/dist/gis-fixtures/11/1694/881.png +0 -0
- package/dist/gis-fixtures/11/1695/879.png +0 -0
- package/dist/gis-fixtures/11/1695/880.png +0 -0
- package/dist/gis-fixtures/11/1695/881.png +0 -0
- package/dist/gis-fixtures/11/1696/879.png +0 -0
- package/dist/gis-fixtures/11/1696/880.png +0 -0
- package/dist/gis-fixtures/11/1696/881.png +0 -0
- package/dist/gis-fixtures/12/3390/1759.png +0 -0
- package/dist/gis-fixtures/12/3390/1760.png +0 -0
- package/dist/gis-fixtures/12/3390/1761.png +0 -0
- package/dist/gis-fixtures/12/3391/1759.png +0 -0
- package/dist/gis-fixtures/12/3391/1760.png +0 -0
- package/dist/gis-fixtures/12/3391/1761.png +0 -0
- package/dist/gis-fixtures/12/3392/1759.png +0 -0
- package/dist/gis-fixtures/12/3392/1760.png +0 -0
- package/dist/gis-fixtures/12/3392/1761.png +0 -0
- package/dist/gis-fixtures/13/6782/3520.png +0 -0
- package/dist/gis-fixtures/13/6782/3521.png +0 -0
- package/dist/gis-fixtures/13/6782/3522.png +0 -0
- package/dist/gis-fixtures/13/6783/3520.png +0 -0
- package/dist/gis-fixtures/13/6783/3521.png +0 -0
- package/dist/gis-fixtures/13/6783/3522.png +0 -0
- package/dist/gis-fixtures/13/6784/3520.png +0 -0
- package/dist/gis-fixtures/13/6784/3521.png +0 -0
- package/dist/gis-fixtures/13/6784/3522.png +0 -0
- package/dist/gis-fixtures/14/13565/7041.png +0 -0
- package/dist/gis-fixtures/14/13565/7042.png +0 -0
- package/dist/gis-fixtures/14/13565/7043.png +0 -0
- package/dist/gis-fixtures/14/13566/7041.png +0 -0
- package/dist/gis-fixtures/14/13566/7042.png +0 -0
- package/dist/gis-fixtures/14/13566/7043.png +0 -0
- package/dist/gis-fixtures/14/13567/7041.png +0 -0
- package/dist/gis-fixtures/14/13567/7042.png +0 -0
- package/dist/gis-fixtures/14/13567/7043.png +0 -0
- package/dist/gis-fixtures/15/27131/14083.png +0 -0
- package/dist/gis-fixtures/15/27131/14084.png +0 -0
- package/dist/gis-fixtures/15/27131/14085.png +0 -0
- package/dist/gis-fixtures/15/27132/14083.png +0 -0
- package/dist/gis-fixtures/15/27132/14084.png +0 -0
- package/dist/gis-fixtures/15/27132/14085.png +0 -0
- package/dist/gis-fixtures/15/27133/14083.png +0 -0
- package/dist/gis-fixtures/15/27133/14084.png +0 -0
- package/dist/gis-fixtures/15/27133/14085.png +0 -0
- package/dist/gis-fixtures/16/54264/28168.png +0 -0
- package/dist/gis-fixtures/16/54264/28169.png +0 -0
- package/dist/gis-fixtures/16/54264/28170.png +0 -0
- package/dist/gis-fixtures/16/54265/28168.png +0 -0
- package/dist/gis-fixtures/16/54265/28169.png +0 -0
- package/dist/gis-fixtures/16/54265/28170.png +0 -0
- package/dist/gis-fixtures/16/54266/28168.png +0 -0
- package/dist/gis-fixtures/16/54266/28169.png +0 -0
- package/dist/gis-fixtures/16/54266/28170.png +0 -0
- package/dist/gis-fixtures/17/108530/56337.png +0 -0
- package/dist/gis-fixtures/17/108530/56338.png +0 -0
- package/dist/gis-fixtures/17/108530/56339.png +0 -0
- package/dist/gis-fixtures/17/108531/56337.png +0 -0
- package/dist/gis-fixtures/17/108531/56338.png +0 -0
- package/dist/gis-fixtures/17/108531/56339.png +0 -0
- package/dist/gis-fixtures/17/108532/56337.png +0 -0
- package/dist/gis-fixtures/17/108532/56338.png +0 -0
- package/dist/gis-fixtures/17/108532/56339.png +0 -0
- package/dist/gis-fixtures/18/217061/112676.png +0 -0
- package/dist/gis-fixtures/18/217061/112677.png +0 -0
- package/dist/gis-fixtures/18/217061/112678.png +0 -0
- package/dist/gis-fixtures/18/217062/112676.png +0 -0
- package/dist/gis-fixtures/18/217062/112677.png +0 -0
- package/dist/gis-fixtures/18/217062/112678.png +0 -0
- package/dist/gis-fixtures/18/217063/112676.png +0 -0
- package/dist/gis-fixtures/18/217063/112677.png +0 -0
- package/dist/gis-fixtures/18/217063/112678.png +0 -0
- package/dist/gis-fixtures/2/2/0.png +0 -0
- package/dist/gis-fixtures/2/2/1.png +0 -0
- package/dist/gis-fixtures/2/2/2.png +0 -0
- package/dist/gis-fixtures/2/3/0.png +0 -0
- package/dist/gis-fixtures/2/3/1.png +0 -0
- package/dist/gis-fixtures/2/3/2.png +0 -0
- package/dist/gis-fixtures/2/4/0.png +0 -0
- package/dist/gis-fixtures/2/4/1.png +0 -0
- package/dist/gis-fixtures/2/4/2.png +0 -0
- package/dist/gis-fixtures/3/5/2.png +0 -0
- package/dist/gis-fixtures/3/5/3.png +0 -0
- package/dist/gis-fixtures/3/5/4.png +0 -0
- package/dist/gis-fixtures/3/6/2.png +0 -0
- package/dist/gis-fixtures/3/6/3.png +0 -0
- package/dist/gis-fixtures/3/6/4.png +0 -0
- package/dist/gis-fixtures/3/7/2.png +0 -0
- package/dist/gis-fixtures/3/7/3.png +0 -0
- package/dist/gis-fixtures/3/7/4.png +0 -0
- package/dist/gis-fixtures/4/12/5.png +0 -0
- package/dist/gis-fixtures/4/12/6.png +0 -0
- package/dist/gis-fixtures/4/12/7.png +0 -0
- package/dist/gis-fixtures/4/13/5.png +0 -0
- package/dist/gis-fixtures/4/13/6.png +0 -0
- package/dist/gis-fixtures/4/13/7.png +0 -0
- package/dist/gis-fixtures/4/14/5.png +0 -0
- package/dist/gis-fixtures/4/14/6.png +0 -0
- package/dist/gis-fixtures/4/14/7.png +0 -0
- package/dist/gis-fixtures/5/25/12.png +0 -0
- package/dist/gis-fixtures/5/25/13.png +0 -0
- package/dist/gis-fixtures/5/25/14.png +0 -0
- package/dist/gis-fixtures/5/26/12.png +0 -0
- package/dist/gis-fixtures/5/26/13.png +0 -0
- package/dist/gis-fixtures/5/26/14.png +0 -0
- package/dist/gis-fixtures/5/27/12.png +0 -0
- package/dist/gis-fixtures/5/27/13.png +0 -0
- package/dist/gis-fixtures/5/27/14.png +0 -0
- package/dist/gis-fixtures/6/51/26.png +0 -0
- package/dist/gis-fixtures/6/51/27.png +0 -0
- package/dist/gis-fixtures/6/51/28.png +0 -0
- package/dist/gis-fixtures/6/52/26.png +0 -0
- package/dist/gis-fixtures/6/52/27.png +0 -0
- package/dist/gis-fixtures/6/52/28.png +0 -0
- package/dist/gis-fixtures/6/53/26.png +0 -0
- package/dist/gis-fixtures/6/53/27.png +0 -0
- package/dist/gis-fixtures/6/53/28.png +0 -0
- package/dist/gis-fixtures/7/104/54.png +0 -0
- package/dist/gis-fixtures/7/104/55.png +0 -0
- package/dist/gis-fixtures/7/104/56.png +0 -0
- package/dist/gis-fixtures/7/105/54.png +0 -0
- package/dist/gis-fixtures/7/105/55.png +0 -0
- package/dist/gis-fixtures/7/105/56.png +0 -0
- package/dist/gis-fixtures/7/106/54.png +0 -0
- package/dist/gis-fixtures/7/106/55.png +0 -0
- package/dist/gis-fixtures/7/106/56.png +0 -0
- package/dist/gis-fixtures/8/210/109.png +0 -0
- package/dist/gis-fixtures/8/210/110.png +0 -0
- package/dist/gis-fixtures/8/210/111.png +0 -0
- package/dist/gis-fixtures/8/211/109.png +0 -0
- package/dist/gis-fixtures/8/211/110.png +0 -0
- package/dist/gis-fixtures/8/211/111.png +0 -0
- package/dist/gis-fixtures/8/212/109.png +0 -0
- package/dist/gis-fixtures/8/212/110.png +0 -0
- package/dist/gis-fixtures/8/212/111.png +0 -0
- package/dist/gis-fixtures/9/422/219.png +0 -0
- package/dist/gis-fixtures/9/422/220.png +0 -0
- package/dist/gis-fixtures/9/422/221.png +0 -0
- package/dist/gis-fixtures/9/423/219.png +0 -0
- package/dist/gis-fixtures/9/423/220.png +0 -0
- package/dist/gis-fixtures/9/423/221.png +0 -0
- package/dist/gis-fixtures/9/424/219.png +0 -0
- package/dist/gis-fixtures/9/424/220.png +0 -0
- package/dist/gis-fixtures/9/424/221.png +0 -0
- package/package.json +8 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { S as Bi, G as me, P as
|
|
2
|
-
import { W as fe, C as
|
|
3
|
-
import { r as ee, g as
|
|
4
|
-
import { a as
|
|
5
|
-
class
|
|
1
|
+
import { S as Bi, G as me, P as Qt, O as Be, M as F, V as d, e as et, T as Xn, C as Qs, W as zi, a as $s, b as We, N as Ri, c as Zs, d as lt, f as W, Q as Ie, E as Qn, R as de, g as tt, h as $n, B as R, i as Oi, A as Zn, j as H, k as z, I as V, l as ai, m as li, n as Jn, o as es, L as $t, p as Js, q as eo, r as to, s as Qi, D as re, t as $i, u as io, F as no, v as xe, w as ts, x as is, y as Fi, z as so, H as ns, J as ae, K as oo, U as ro, X as Et, Y as ao, Z as ss, _ as lo, $ as De, a0 as At, a1 as it, a2 as Xe, a3 as Zt, a4 as Ni, a5 as Z, a6 as oe, a7 as St, a8 as co, a9 as nt, aa as Ci, ab as Ge, ac as Lt, ad as ho, ae as uo, af as Ei, ag as pt, ah as po, ai as ut, aj as mo, ak as go, al as os, am as Jt, an as Pt, ao as ei, ap as fo, aq as Zi, ar as Tt, as as It, at as yo, au as Mo, av as Ji, aw as vo, ax as xo, ay as wo, az as bo, aA as Co, aB as Eo, aC as Ao, aD as So, aE as Po, aF as To, aG as rs, aH as Io, aI as _o, aJ as Do, aK as ko, aL as Lo, aM as Bo, aN as zo, aO as Ro, aP as Oo, aQ as Fo } from "./three-vendor-rBTtPKhu.js";
|
|
2
|
+
import { W as fe, C as No, L as Mt, B as en, g as Oe, a as Ho, E as Vo, r as Uo } from "./sdk-runtime-CB2jwkGL.js";
|
|
3
|
+
import { r as ee, g as Wo } from "./sdk-assets-Eo-SBV02.js";
|
|
4
|
+
import { a as ti, J as Ai, h as Go, d as qo, B as ci, $ as Ko, F as jo, c as tn, M as nn, S as Yo } from "./sdk-vendor-DtYOqJWo.js";
|
|
5
|
+
class Xo {
|
|
6
6
|
engine;
|
|
7
7
|
scene;
|
|
8
8
|
constructor(e) {
|
|
@@ -21,7 +21,7 @@ class ie {
|
|
|
21
21
|
orthographicCamera;
|
|
22
22
|
cameraAnimationFrame = null;
|
|
23
23
|
constructor(e) {
|
|
24
|
-
this.engine = e, this.perspectiveCamera = new
|
|
24
|
+
this.engine = e, this.perspectiveCamera = new Qt(
|
|
25
25
|
45,
|
|
26
26
|
this.engine.container.clientWidth / this.engine.container.clientHeight,
|
|
27
27
|
0.1,
|
|
@@ -190,7 +190,7 @@ class ie {
|
|
|
190
190
|
const e = this.engine.camera;
|
|
191
191
|
if (!e)
|
|
192
192
|
return;
|
|
193
|
-
const t = e.position.clone(), i = this.engine.controls.target.clone(), n = e.quaternion.clone(), s = e.up.clone(), o = this.orthographicCamera, r = this.getViewDirection(t, i, n), l = e instanceof
|
|
193
|
+
const t = e.position.clone(), i = this.engine.controls.target.clone(), n = e.quaternion.clone(), s = e.up.clone(), o = this.orthographicCamera, r = this.getViewDirection(t, i, n), l = e instanceof Qt ? this.getPerspectiveVisibleHeight(e, i) : this.getOrthographicVisibleHeight(e), c = F.degToRad(e.getEffectiveFOV() * 0.5), h = Math.max(
|
|
194
194
|
l / (2 * Math.tan(c)),
|
|
195
195
|
ie.MIN_CAMERA_DISTANCE
|
|
196
196
|
);
|
|
@@ -358,7 +358,7 @@ class ie {
|
|
|
358
358
|
l(), h.start(), u();
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
class
|
|
361
|
+
class Qo {
|
|
362
362
|
engine;
|
|
363
363
|
deviceType;
|
|
364
364
|
constructor(e) {
|
|
@@ -423,7 +423,7 @@ class Yo {
|
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
const Hi = 1.1;
|
|
426
|
-
function
|
|
426
|
+
function as(a) {
|
|
427
427
|
if (a?.deviceModule?.isMobile?.() !== !0)
|
|
428
428
|
return window.devicePixelRatio || 1;
|
|
429
429
|
const e = Number(a?.options?.limit_memory);
|
|
@@ -435,16 +435,16 @@ function sn(a) {
|
|
|
435
435
|
const e = Number(a?.options?.limit_memory);
|
|
436
436
|
return !(!Number.isFinite(e) || e <= 4);
|
|
437
437
|
}
|
|
438
|
-
class
|
|
438
|
+
class $o {
|
|
439
439
|
engine;
|
|
440
440
|
renderer;
|
|
441
441
|
watermark;
|
|
442
442
|
constructor(e) {
|
|
443
|
-
this.engine = e, this.renderer = null, this.watermark = new
|
|
443
|
+
this.engine = e, this.renderer = null, this.watermark = new No(Xn);
|
|
444
444
|
}
|
|
445
445
|
createRenderer() {
|
|
446
446
|
const { width: e, height: t } = this.engine.deviceModule.getContainerSize();
|
|
447
|
-
return this.engine.deviceModule.isMobile(),
|
|
447
|
+
return this.engine.deviceModule.isMobile(), Qs.enabled = !0, this.renderer = new zi({
|
|
448
448
|
// 原生 MSAA 主要覆盖非后处理路径;后处理链路的边缘由 composer 的 samples 和 FXAA 继续处理。
|
|
449
449
|
antialias: this.engine.options.antialias ?? !0,
|
|
450
450
|
alpha: !0,
|
|
@@ -452,7 +452,7 @@ class Xo {
|
|
|
452
452
|
stencil: !0,
|
|
453
453
|
// iOS 保留 drawing buffer 会长期占用额外帧缓冲;移动端优先保证大模型稳定加载。
|
|
454
454
|
preserveDrawingBuffer: sn(this.engine)
|
|
455
|
-
}), this.renderer.setClearColor(0, 0), this.renderer.setSize(e, t, !1), this.renderer.setPixelRatio(
|
|
455
|
+
}), this.renderer.setClearColor(0, 0), this.renderer.setSize(e, t, !1), this.renderer.setPixelRatio(as(this.engine)), this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%", this.renderer.domElement.style.display = "block", this.renderer.shadowMap.enabled = sn(this.engine), this.renderer.shadowMap.type = $s, this.renderer.localClippingEnabled = !0, this.renderer.outputColorSpace = We, this.renderer.toneMapping = Ri, this.renderer.toneMappingExposure = Hi, this.engine.container.appendChild(this.renderer.domElement), this.renderer;
|
|
456
456
|
}
|
|
457
457
|
disposeRenderer() {
|
|
458
458
|
this.watermark.dispose(), this.renderer?.dispose();
|
|
@@ -464,14 +464,14 @@ class Xo {
|
|
|
464
464
|
this.renderer && this.watermark.render(this.renderer);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
const
|
|
467
|
+
const Zo = { type: "change" }, on = { type: "start" }, rn = { type: "end" }, $ = 1e-6, hi = Math.PI * 2, ue = {
|
|
468
468
|
NONE: -1,
|
|
469
469
|
ROTATE: 0,
|
|
470
470
|
PAN: 1,
|
|
471
471
|
DOLLY: 2,
|
|
472
472
|
TOUCH_ROTATE: 3,
|
|
473
473
|
TOUCH_DOLLY_PAN: 4
|
|
474
|
-
},
|
|
474
|
+
}, di = new d(1, 0, 0), Jo = new d(0, 1, 0), er = new d(0, 0, 1), ct = new d(), Ot = new d(), Ae = new d(), X = new d(), ke = new d(), ge = new d(), Le = new d(), tr = new d(), Ft = new Ie(), ui = new Ie(), an = /* @__PURE__ */ new Set([
|
|
475
475
|
"KeyW",
|
|
476
476
|
"KeyA",
|
|
477
477
|
"KeyS",
|
|
@@ -501,7 +501,7 @@ function cn(a) {
|
|
|
501
501
|
const e = a?.tagName?.toLowerCase?.();
|
|
502
502
|
return a?.isContentEditable === !0 || e === "input" || e === "textarea" || e === "select";
|
|
503
503
|
}
|
|
504
|
-
class
|
|
504
|
+
class ls extends Zs {
|
|
505
505
|
constructor(e, t, i = null) {
|
|
506
506
|
super(t, i), this.engine = e, this.target = new d(), this.origin = new d(), this.cursor = new d(), this.showOriginIcon = !0, this.auto = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.enableRotate = !0, this.enablePan = !0, this.enableZoom = !0, this.enableDamping = !1, this.rotateSpeed = 0.51, this.panSpeed = 1, this.zoomSpeed = 1, this.touchZoomSpeed = 1.35, this.dampingFactor = 0.08, this.keyRotateSpeed = 1, this.keyPanSpeed = 7, this.keyMoveSpeed = 0.5, this.keyMoveBoost = 2, this.keys = {
|
|
507
507
|
LEFT: "ArrowLeft",
|
|
@@ -536,7 +536,7 @@ class rs extends Qs {
|
|
|
536
536
|
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.up.copy(this.up0), Ye(this.origin) && this.origin.copy(this.origin0), this._rotateVelocity.set(0, 0), this._panVelocity.set(0, 0), this._zoomVelocity = 0, this.object.updateProjectionMatrix?.(), this.update(!0), this.state = ue.NONE;
|
|
537
537
|
}
|
|
538
538
|
setScreenUp(e) {
|
|
539
|
-
return !Ye(e) || (ge.copy(this.target).sub(this.object.position), ge.lengthSq() < $) || (ge.normalize(),
|
|
539
|
+
return !Ye(e) || (ge.copy(this.target).sub(this.object.position), ge.lengthSq() < $) || (ge.normalize(), ke.copy(e).normalize(), X.crossVectors(ge, ke), X.lengthSq() < $) ? !1 : (this._viewRight.copy(X.normalize()), this.update(!0), !0);
|
|
540
540
|
}
|
|
541
541
|
syncStateFromCamera(e = this.object, t = this.target, i = {}) {
|
|
542
542
|
if (!e)
|
|
@@ -549,7 +549,7 @@ class rs extends Qs {
|
|
|
549
549
|
const i = typeof e == "number" ? e : null, n = typeof e == "boolean" ? e : !!t, s = this._applyPendingMotion(i);
|
|
550
550
|
this._alignCamera();
|
|
551
551
|
const o = n || s || this._hasCameraStateChanged();
|
|
552
|
-
return o && (this.dispatchEvent(
|
|
552
|
+
return o && (this.dispatchEvent(Zo), this._rememberState()), o;
|
|
553
553
|
}
|
|
554
554
|
_applyPendingMotion(e) {
|
|
555
555
|
let t = !1;
|
|
@@ -562,7 +562,7 @@ class rs extends Qs {
|
|
|
562
562
|
return Math.abs(s) > $ && this.enableZoom && (this._applyZoom(s), t = !0), t;
|
|
563
563
|
}
|
|
564
564
|
_applyKeyboardMove(e) {
|
|
565
|
-
if (!this.enabled || !this.object?.isPerspectiveCamera || this._pressedKeys.size === 0 || (
|
|
565
|
+
if (!this.enabled || !this.object?.isPerspectiveCamera || this._pressedKeys.size === 0 || (Le.set(0, 0, 0), (this._pressedKeys.has("KeyW") || this._pressedKeys.has("ArrowUp")) && (Le.z += 1), (this._pressedKeys.has("KeyS") || this._pressedKeys.has("ArrowDown")) && (Le.z -= 1), (this._pressedKeys.has("KeyA") || this._pressedKeys.has("ArrowLeft")) && (Le.x -= 1), (this._pressedKeys.has("KeyD") || this._pressedKeys.has("ArrowRight")) && (Le.x += 1), this._pressedKeys.has("KeyQ") && (Le.y += 1), this._pressedKeys.has("KeyE") && (Le.y -= 1), Le.lengthSq() <= $) || (Le.normalize(), X.copy(di).applyQuaternion(this.object.quaternion).normalize(), ge.set(0, 0, -1).applyQuaternion(this.object.quaternion).normalize(), ke.copy(this._referenceUp).normalize(), ke.lengthSq() <= $ && ke.copy(this.object.up).normalize(), Ae.set(0, 0, 0), Ae.addScaledVector(X, Le.x), Ae.addScaledVector(ge, Le.z), Ae.addScaledVector(ke, Le.y), Ae.lengthSq() <= $))
|
|
566
566
|
return !1;
|
|
567
567
|
Ae.normalize();
|
|
568
568
|
const t = Number.isFinite(e) && e > 0 ? e : 1 / 60, i = Math.max(this.object.position.distanceTo(this.target), 1), n = this._pressedKeys.has("ShiftLeft") || this._pressedKeys.has("ShiftRight") ? this.keyMoveBoost : 1, s = Math.max(i * 0.8, 1) * this.keyMoveSpeed * t * n;
|
|
@@ -603,11 +603,11 @@ class rs extends Qs {
|
|
|
603
603
|
}
|
|
604
604
|
_applyRotation(e, t) {
|
|
605
605
|
const i = this._getRotatePivot(), n = this.object.position;
|
|
606
|
-
ct.copy(n).sub(i), ct.lengthSq() < $ && ct.set(0, 0, Math.max(this.minDistance, 1)), Ot.copy(this.target).sub(i), ge.copy(this.target).sub(n).normalize(), Math.abs(e) > $ && (Ft.setFromAxisAngle(this._referenceUp, -e), ct.applyQuaternion(Ft), Ot.applyQuaternion(Ft), ge.applyQuaternion(Ft).normalize()), X.copy(this._getStableRightAxis(ge)), Math.abs(t) > $ && X.lengthSq() > $ && (
|
|
606
|
+
ct.copy(n).sub(i), ct.lengthSq() < $ && ct.set(0, 0, Math.max(this.minDistance, 1)), Ot.copy(this.target).sub(i), ge.copy(this.target).sub(n).normalize(), Math.abs(e) > $ && (Ft.setFromAxisAngle(this._referenceUp, -e), ct.applyQuaternion(Ft), Ot.applyQuaternion(Ft), ge.applyQuaternion(Ft).normalize()), X.copy(this._getStableRightAxis(ge)), Math.abs(t) > $ && X.lengthSq() > $ && (ui.setFromAxisAngle(X, -t), ct.applyQuaternion(ui), Ot.applyQuaternion(ui)), n.copy(i).add(ct), this.target.copy(i).add(Ot);
|
|
607
607
|
}
|
|
608
608
|
_applyPan(e, t) {
|
|
609
609
|
const { width: i, height: n } = ln(this.domElement);
|
|
610
|
-
X.copy(
|
|
610
|
+
X.copy(di).applyQuaternion(this.object.quaternion).normalize(), ke.copy(Jo).applyQuaternion(this.object.quaternion).normalize();
|
|
611
611
|
let s = 0, o = 0;
|
|
612
612
|
if (this.object.isPerspectiveCamera) {
|
|
613
613
|
const l = 2 * Math.max(this.object.position.distanceTo(this.target), $) * Math.tan(F.degToRad(this.object.getEffectiveFOV() * 0.5)), c = l * this.object.aspect;
|
|
@@ -617,7 +617,7 @@ class rs extends Qs {
|
|
|
617
617
|
s = e / i * r * this.panSpeed, o = t / n * l * this.panSpeed;
|
|
618
618
|
} else
|
|
619
619
|
return;
|
|
620
|
-
Ae.set(0, 0, 0), Ae.addScaledVector(X, -s), Ae.addScaledVector(
|
|
620
|
+
Ae.set(0, 0, 0), Ae.addScaledVector(X, -s), Ae.addScaledVector(ke, o), this.object.position.add(Ae), this.target.add(Ae);
|
|
621
621
|
}
|
|
622
622
|
_applyZoom(e) {
|
|
623
623
|
const t = Math.pow(0.95, this.zoomSpeed * e);
|
|
@@ -630,13 +630,13 @@ class rs extends Qs {
|
|
|
630
630
|
this.object.isOrthographicCamera && (this.object.zoom = Nt(this.object.zoom * t, this.minZoom, this.maxZoom), this.object.updateProjectionMatrix());
|
|
631
631
|
}
|
|
632
632
|
_alignCamera() {
|
|
633
|
-
ge.copy(this.target).sub(this.object.position), !(ge.lengthSq() < $) && (ge.normalize(), X.copy(this._getStableRightAxis(ge)),
|
|
633
|
+
ge.copy(this.target).sub(this.object.position), !(ge.lengthSq() < $) && (ge.normalize(), X.copy(this._getStableRightAxis(ge)), ke.crossVectors(X, ge).normalize(), ke.lengthSq() < $ && ke.copy(this._referenceUp), this._viewRight.copy(X), this.object.up.copy(ke), this.object.lookAt(this.target), this.object.updateMatrixWorld());
|
|
634
634
|
}
|
|
635
635
|
_getStableRightAxis(e) {
|
|
636
|
-
return X.crossVectors(e, this._referenceUp), X.lengthSq() < $ && (X.copy(this._viewRight), X.addScaledVector(e, -X.dot(e))), X.lengthSq() < $ && (X.copy(
|
|
636
|
+
return X.crossVectors(e, this._referenceUp), X.lengthSq() < $ && (X.copy(this._viewRight), X.addScaledVector(e, -X.dot(e))), X.lengthSq() < $ && (X.copy(di), X.addScaledVector(e, -X.dot(e))), X.lengthSq() < $ && (X.copy(er), X.addScaledVector(e, -X.dot(e))), X.normalize(), this._viewRight.lengthSq() > $ && X.dot(this._viewRight) < 0 && X.negate(), X;
|
|
637
637
|
}
|
|
638
638
|
_getRotatePivot() {
|
|
639
|
-
return Ye(this.origin) ? this.origin.distanceToSquared(this.target) < $ ? this.target :
|
|
639
|
+
return Ye(this.origin) ? this.origin.distanceToSquared(this.target) < $ ? this.target : tr.copy(this.origin) : this.target;
|
|
640
640
|
}
|
|
641
641
|
_hasCameraStateChanged() {
|
|
642
642
|
const e = this.object.isOrthographicCamera && Math.abs(this.object.zoom - this._lastZoom) > $;
|
|
@@ -646,7 +646,7 @@ class rs extends Qs {
|
|
|
646
646
|
this._lastPosition.copy(this.object.position), this._lastTarget.copy(this.target), this._lastUp.copy(this.object.up), this._lastQuaternion.copy(this.object.quaternion), this._lastZoom = this.object.zoom;
|
|
647
647
|
}
|
|
648
648
|
_getAutoRotateAngle(e) {
|
|
649
|
-
return e != null ?
|
|
649
|
+
return e != null ? hi / 60 * this.autoRotateSpeed * e : hi / 3600 * this.autoRotateSpeed;
|
|
650
650
|
}
|
|
651
651
|
_beginInteraction(e) {
|
|
652
652
|
this._isInteracting || (this.dispatchEvent(on), this._isInteracting = !0), this.state = e;
|
|
@@ -773,7 +773,7 @@ class rs extends Qs {
|
|
|
773
773
|
_queueRotate(e, t) {
|
|
774
774
|
if (!this.enableRotate || !this.domElement)
|
|
775
775
|
return;
|
|
776
|
-
const { height: i } = ln(this.domElement), n =
|
|
776
|
+
const { height: i } = ln(this.domElement), n = hi / i;
|
|
777
777
|
this._rotateVelocity.x += e * n * this.rotateSpeed, this._rotateVelocity.y += t * n * this.rotateSpeed;
|
|
778
778
|
}
|
|
779
779
|
_queuePan(e, t) {
|
|
@@ -783,7 +783,7 @@ class rs extends Qs {
|
|
|
783
783
|
this.enableZoom && (this._zoomVelocity += e);
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
|
-
class hn extends
|
|
786
|
+
class hn extends Qn {
|
|
787
787
|
constructor(e, t, i, n) {
|
|
788
788
|
super(), this._Engine = e, this.camera = t, this.object = t, this.domElement = i, this._isEnabled = !1, this._rayOriginOffset = new d(0, -1, 0), this._camerLocalDirection = new d(), this._tmpVector = new d(), this._lookDirection = new d(), this._rayCaster = new de(), this._fallingTime = 0, this._isMouseInElement = !1, this._euler = new tt(0, 0, 0, "YZX"), this._prevMouseX = 0, this._prevMouseY = 0, this._pointerLookActive = !1, this._externalLookActive = !1, this._interactionActive = !1, this._sharedTargetDistance = 10, this.target = this.camera.position.clone().add(
|
|
789
789
|
new d(0, 0, -1).applyQuaternion(this.camera.quaternion).normalize().multiplyScalar(this._sharedTargetDistance)
|
|
@@ -1145,7 +1145,7 @@ class hn extends Yn {
|
|
|
1145
1145
|
return r;
|
|
1146
1146
|
}
|
|
1147
1147
|
}
|
|
1148
|
-
const
|
|
1148
|
+
const ir = ee("/assets/worker_walk.glb", import.meta.url), nr = Math.PI, sr = {
|
|
1149
1149
|
16: "ShiftLeft",
|
|
1150
1150
|
37: "ArrowLeft",
|
|
1151
1151
|
38: "ArrowUp",
|
|
@@ -1169,9 +1169,9 @@ const er = ee("/assets/worker_walk.glb", import.meta.url), tr = Math.PI, ir = {
|
|
|
1169
1169
|
jump: ["Space"],
|
|
1170
1170
|
boost: ["ShiftLeft", "ShiftRight"]
|
|
1171
1171
|
};
|
|
1172
|
-
class dn extends
|
|
1172
|
+
class dn extends Qn {
|
|
1173
1173
|
constructor(e, t, i, n = {}) {
|
|
1174
|
-
super(), this._Engine = e, this.camera = t, this.object = t, this.domElement = i, this._isEnabled = !1, this.target = new d(), this.auto = !1, this.applyGravity = n.applyGravity ?? !0, this.gravityMinHeight = !0, this.applyCollision = n.applyCollision ?? !0, this.positionEasing = !0, this.lookflag = 1, this.lookHorizontalFlag = 1, this.lookSpeed = n.lookSpeed ?? 3e-3, this.moveSpeed = n.moveSpeed ?? 0.02, this.playerHeight = n.playerHeight ?? 1.6, this.playerRadius = n.playerRadius ?? 0.3, this.cameraDistance = n.cameraDistance ?? 2, this.cameraHeight = n.cameraHeight ?? 0, this.targetHeight = n.targetHeight ?? this.playerHeight, this.cameraCollisionTargetHeight = n.cameraCollisionTargetHeight ?? this.playerHeight + 0.1, this.cameraCollisionInterval = Math.max(1, Math.floor(n.cameraCollisionInterval ?? 20)), this.cameraCollisionPadding = n.cameraCollisionPadding ?? 0.15, this.minCameraCollisionDistance = n.minCameraCollisionDistance ?? 0.35, this.jumpSpeed = n.jumpSpeed ?? 0.24, this.jumpGravity = n.jumpGravity ?? 0.012, this.maxRotateX = n.maxPitch ?? Math.PI * 0.45, this.minPitch = n.minPitch ?? -Math.PI * 0.38, this.g = 9.8, this._moveInput = new d(), this._moveDirection = new d(), this._rayCaster = new de(), this._cameraRayCaster = new de(), this._cameraCollisionFrame = 0, this._lastCameraSafeDistance = null, this._fallingTime = 0, this._isMouseInElement = !1, this._prevMouseX = 0, this._prevMouseY = 0, this._dragRotateThreshold = n.dragRotateThreshold ?? 2, this._pointerLookActive = !1, this._externalLookActive = !1, this._scriptedMotionActive = !1, this._interactionActive = !1, this._yaw = 0, this._pitch = n.initialPitch ?? 0, this._pressedKeys = /* @__PURE__ */ new Set(), this._verticalVelocity = 0, this._isJumping = !1, this._isJumpKeyDown = !1, this._jumpStartHeight = 0, this.avatarRoot = new me(), this.avatarRoot.name = "ThirdPersonAvatarRoot", this.avatarRoot.visible = n.visible ?? !0, this.avatarMixer = null, this.avatarWalkAction = null, this._isWalkActionPlaying = !1, this._avatarAnimationTimer = new
|
|
1174
|
+
super(), this._Engine = e, this.camera = t, this.object = t, this.domElement = i, this._isEnabled = !1, this.target = new d(), this.auto = !1, this.applyGravity = n.applyGravity ?? !0, this.gravityMinHeight = !0, this.applyCollision = n.applyCollision ?? !0, this.positionEasing = !0, this.lookflag = 1, this.lookHorizontalFlag = 1, this.lookSpeed = n.lookSpeed ?? 3e-3, this.moveSpeed = n.moveSpeed ?? 0.02, this.playerHeight = n.playerHeight ?? 1.6, this.playerRadius = n.playerRadius ?? 0.3, this.cameraDistance = n.cameraDistance ?? 2, this.cameraHeight = n.cameraHeight ?? 0, this.targetHeight = n.targetHeight ?? this.playerHeight, this.cameraCollisionTargetHeight = n.cameraCollisionTargetHeight ?? this.playerHeight + 0.1, this.cameraCollisionInterval = Math.max(1, Math.floor(n.cameraCollisionInterval ?? 20)), this.cameraCollisionPadding = n.cameraCollisionPadding ?? 0.15, this.minCameraCollisionDistance = n.minCameraCollisionDistance ?? 0.35, this.jumpSpeed = n.jumpSpeed ?? 0.24, this.jumpGravity = n.jumpGravity ?? 0.012, this.maxRotateX = n.maxPitch ?? Math.PI * 0.45, this.minPitch = n.minPitch ?? -Math.PI * 0.38, this.g = 9.8, this._moveInput = new d(), this._moveDirection = new d(), this._rayCaster = new de(), this._cameraRayCaster = new de(), this._cameraCollisionFrame = 0, this._lastCameraSafeDistance = null, this._fallingTime = 0, this._isMouseInElement = !1, this._prevMouseX = 0, this._prevMouseY = 0, this._dragRotateThreshold = n.dragRotateThreshold ?? 2, this._pointerLookActive = !1, this._externalLookActive = !1, this._scriptedMotionActive = !1, this._interactionActive = !1, this._yaw = 0, this._pitch = n.initialPitch ?? 0, this._pressedKeys = /* @__PURE__ */ new Set(), this._verticalVelocity = 0, this._isJumping = !1, this._isJumpKeyDown = !1, this._jumpStartHeight = 0, this.avatarRoot = new me(), this.avatarRoot.name = "ThirdPersonAvatarRoot", this.avatarRoot.visible = n.visible ?? !0, this.avatarMixer = null, this.avatarWalkAction = null, this._isWalkActionPlaying = !1, this._avatarAnimationTimer = new $n(), this._avatarAnimationTimer.connect(document), this._avatarLoadRequestId = 0, this.defaultAvatarUrl = n.avatarUrl ?? ir, this._ownsAvatarResources = !n.avatar, this.avatar = n.avatar || this.createDefaultAvatar(), this.avatar.name = this.avatar.name || "ThirdPersonAvatar", this.avatarRoot.add(this.avatar), !n.avatar && this.defaultAvatarUrl && this.loadAvatarModel(this.defaultAvatarUrl, n.avatarOptions);
|
|
1175
1175
|
const s = this.isPcDevice();
|
|
1176
1176
|
this.bindmousedown = s ? this.onMouseDown.bind(this) : this.onTouchStart.bind(this), this.bindmouseup = s ? this.onMouseUp.bind(this) : this.onTouchEnd.bind(this), this.bindmousemove = s ? this.onMouseMove.bind(this) : this.onTouchMove.bind(this), this.bindonKeyDown = this.onKeyDown.bind(this), this.bindonKeyUp = this.onKeyUp.bind(this), this.bindWindowBlur = this.onWindowBlur.bind(this), this.bindVisibilityChange = this.onVisibilityChange.bind(this), this.bindMouseEnter = this.onMouseEnter.bind(this), this.bindMouseLeave = this.onMouseLeave.bind(this), this.initAvatarPoseFromCamera();
|
|
1177
1177
|
}
|
|
@@ -1232,7 +1232,7 @@ class dn extends Yn {
|
|
|
1232
1232
|
alignToFeet: !0,
|
|
1233
1233
|
fitToPlayerHeight: !0,
|
|
1234
1234
|
ownsResources: !0,
|
|
1235
|
-
yawOffset:
|
|
1235
|
+
yawOffset: nr,
|
|
1236
1236
|
...t
|
|
1237
1237
|
}), this.setupAvatarAnimation(o, s.animations || []);
|
|
1238
1238
|
},
|
|
@@ -1246,7 +1246,7 @@ class dn extends Yn {
|
|
|
1246
1246
|
setupAvatarAnimation(e, t) {
|
|
1247
1247
|
if (!t.length)
|
|
1248
1248
|
return;
|
|
1249
|
-
this.avatarMixer = new
|
|
1249
|
+
this.avatarMixer = new Zn(e);
|
|
1250
1250
|
const i = t.find((n) => /walk|run|move/i.test(n.name)) || t[0];
|
|
1251
1251
|
this.avatarWalkAction = this.avatarMixer.clipAction(i), this.avatarWalkAction.enabled = !0, this.avatarWalkAction.clampWhenFinished = !1, this.avatarWalkAction.setEffectiveWeight(1), this.avatarWalkAction.paused = !0, this.avatarWalkAction.play(), this._avatarAnimationTimer.reset();
|
|
1252
1252
|
}
|
|
@@ -1351,7 +1351,7 @@ class dn extends Yn {
|
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
1353
1353
|
getEventCode(e) {
|
|
1354
|
-
return e.code ||
|
|
1354
|
+
return e.code || sr[e.keyCode] || e.key || "";
|
|
1355
1355
|
}
|
|
1356
1356
|
hasPressed(e) {
|
|
1357
1357
|
return e.some((t) => this._pressedKeys.has(t));
|
|
@@ -1608,11 +1608,11 @@ class dn extends Yn {
|
|
|
1608
1608
|
});
|
|
1609
1609
|
}
|
|
1610
1610
|
}
|
|
1611
|
-
const Si = "__isModelUrlGroup",
|
|
1612
|
-
function
|
|
1611
|
+
const Si = "__isModelUrlGroup", ii = "__modelDepthBias", cs = 4;
|
|
1612
|
+
function hs(a) {
|
|
1613
1613
|
return a.__modelGroupMap instanceof Map || (a.__modelGroupMap = /* @__PURE__ */ new Map()), a.__modelGroupMap;
|
|
1614
1614
|
}
|
|
1615
|
-
function
|
|
1615
|
+
function ds(a) {
|
|
1616
1616
|
return a.__modelObjectIndexMap instanceof Map || (a.__modelObjectIndexMap = /* @__PURE__ */ new Map()), a.__modelObjectIndexMap;
|
|
1617
1617
|
}
|
|
1618
1618
|
function Pi(a, e) {
|
|
@@ -1631,7 +1631,7 @@ function vt(a, e, t) {
|
|
|
1631
1631
|
i != null && (Array.isArray(i.urls) || (i.urls = []), i.urls.includes(t) || i.urls.push(t));
|
|
1632
1632
|
}
|
|
1633
1633
|
function $e(a, e) {
|
|
1634
|
-
const t =
|
|
1634
|
+
const t = hs(a), i = t.get(e);
|
|
1635
1635
|
if (i && i.parent != null)
|
|
1636
1636
|
return i;
|
|
1637
1637
|
const n = Ui(a, e);
|
|
@@ -1640,7 +1640,7 @@ function $e(a, e) {
|
|
|
1640
1640
|
const s = a?.scene?.children?.find?.((o) => o instanceof me ? Vi(o, e) ? !0 : o.name === e && o.url === e : !1);
|
|
1641
1641
|
return s != null ? (Pi(s, e), t.set(e, s), n != null && (n.group = s), s) : null;
|
|
1642
1642
|
}
|
|
1643
|
-
function
|
|
1643
|
+
function Se(a, e) {
|
|
1644
1644
|
const t = $e(a, e);
|
|
1645
1645
|
return t == null ? new H() : (t.updateWorldMatrix(!0, !1), t.matrixWorld.clone());
|
|
1646
1646
|
}
|
|
@@ -1649,11 +1649,11 @@ function ot(a, e) {
|
|
|
1649
1649
|
if (t != null)
|
|
1650
1650
|
return t;
|
|
1651
1651
|
const i = new me();
|
|
1652
|
-
Pi(i, e), a.scene.add(i),
|
|
1652
|
+
Pi(i, e), a.scene.add(i), hs(a).set(e, i);
|
|
1653
1653
|
const s = Ui(a, e);
|
|
1654
1654
|
return s != null && (s.group = i), i;
|
|
1655
1655
|
}
|
|
1656
|
-
function
|
|
1656
|
+
function or(a) {
|
|
1657
1657
|
const e = [], t = /* @__PURE__ */ new Set();
|
|
1658
1658
|
return (Array.isArray(a?.models) ? a.models : []).forEach((n) => {
|
|
1659
1659
|
if (n?.url == null)
|
|
@@ -1666,7 +1666,7 @@ function nr(a) {
|
|
|
1666
1666
|
}
|
|
1667
1667
|
function _t(a, e) {
|
|
1668
1668
|
const t = [], i = /* @__PURE__ */ new Set();
|
|
1669
|
-
return
|
|
1669
|
+
return or(a).forEach((s) => {
|
|
1670
1670
|
s.traverse((o) => {
|
|
1671
1671
|
o === s || i.has(o.uuid) || e(o) && (i.add(o.uuid), t.push(o));
|
|
1672
1672
|
});
|
|
@@ -1683,7 +1683,7 @@ function _t(a, e) {
|
|
|
1683
1683
|
function Wi(a) {
|
|
1684
1684
|
return _t(a, (e) => e instanceof z && !(e instanceof V));
|
|
1685
1685
|
}
|
|
1686
|
-
function
|
|
1686
|
+
function rr(a) {
|
|
1687
1687
|
if (typeof a.__modelObjectIndexSeed == "number")
|
|
1688
1688
|
return;
|
|
1689
1689
|
let e = -1;
|
|
@@ -1691,55 +1691,55 @@ function sr(a) {
|
|
|
1691
1691
|
typeof t?.index == "number" && Number.isFinite(t.index) && (e = Math.max(e, t.index));
|
|
1692
1692
|
}), a.__modelObjectIndexSeed = e + 1;
|
|
1693
1693
|
}
|
|
1694
|
-
function
|
|
1695
|
-
|
|
1694
|
+
function ar(a) {
|
|
1695
|
+
rr(a);
|
|
1696
1696
|
const e = a.__modelObjectIndexSeed;
|
|
1697
1697
|
return a.__modelObjectIndexSeed += 1, e;
|
|
1698
1698
|
}
|
|
1699
1699
|
function Gi(a, e, t) {
|
|
1700
|
-
const i = typeof t == "number" ? t :
|
|
1701
|
-
return e.index = i,
|
|
1700
|
+
const i = typeof t == "number" ? t : ar(a);
|
|
1701
|
+
return e.index = i, ds(a).set(i, e), i;
|
|
1702
1702
|
}
|
|
1703
|
-
function
|
|
1703
|
+
function us(a) {
|
|
1704
1704
|
return Array.isArray(a) ? a : a != null ? [a] : [];
|
|
1705
1705
|
}
|
|
1706
|
-
function
|
|
1706
|
+
function lr(a) {
|
|
1707
1707
|
return 1 + (Number.isFinite(a) ? Math.abs(Math.floor(a)) : 0) % 16 * 0.125;
|
|
1708
1708
|
}
|
|
1709
1709
|
function qi(a, e) {
|
|
1710
|
-
const t = typeof e == "number" ? e : a?.index, i =
|
|
1711
|
-
|
|
1710
|
+
const t = typeof e == "number" ? e : a?.index, i = lr(t);
|
|
1711
|
+
us(a?.material).forEach((n) => {
|
|
1712
1712
|
n.userData = n.userData ?? {};
|
|
1713
|
-
const s = n.userData[
|
|
1714
|
-
n.userData[
|
|
1713
|
+
const s = n.userData[ii] ?? {};
|
|
1714
|
+
n.userData[ii] = {
|
|
1715
1715
|
...s,
|
|
1716
1716
|
enabled: !0,
|
|
1717
1717
|
factor: 1,
|
|
1718
1718
|
units: i
|
|
1719
|
-
}, n.polygonOffset = !0, n.polygonOffsetFactor = 1, n.polygonOffsetUnits = i + (s.edgeActive ?
|
|
1719
|
+
}, n.polygonOffset = !0, n.polygonOffsetFactor = 1, n.polygonOffsetUnits = i + (s.edgeActive ? cs : 0), n.needsUpdate = !0;
|
|
1720
1720
|
});
|
|
1721
1721
|
}
|
|
1722
1722
|
function un(a, e) {
|
|
1723
|
-
|
|
1723
|
+
us(a?.material).forEach((t) => {
|
|
1724
1724
|
t.userData = t.userData ?? {};
|
|
1725
|
-
const i = t.userData[
|
|
1726
|
-
t.userData[
|
|
1725
|
+
const i = t.userData[ii] ?? {}, n = i.enabled ? i.units : t.polygonOffsetUnits ?? 0, s = i.enabled ? i.factor : t.polygonOffsetFactor ?? 1;
|
|
1726
|
+
t.userData[ii] = {
|
|
1727
1727
|
...i,
|
|
1728
1728
|
edgeActive: e
|
|
1729
|
-
}, i.enabled || e ? (t.polygonOffset = !1, t.polygonOffsetFactor = s, t.polygonOffsetUnits = n + (e ?
|
|
1729
|
+
}, i.enabled || e ? (t.polygonOffset = !1, t.polygonOffsetFactor = s, t.polygonOffsetUnits = n + (e ? cs : 0)) : t.polygonOffset = !1, t.needsUpdate = !0;
|
|
1730
1730
|
});
|
|
1731
1731
|
}
|
|
1732
|
-
function
|
|
1732
|
+
function _e(a, e) {
|
|
1733
1733
|
if (!Number.isFinite(e))
|
|
1734
1734
|
return;
|
|
1735
|
-
const t =
|
|
1735
|
+
const t = ds(a), i = t.get(e);
|
|
1736
1736
|
if (i && i.parent != null)
|
|
1737
1737
|
return i;
|
|
1738
1738
|
i && i.parent == null && t.delete(e);
|
|
1739
1739
|
const n = _t(a, (s) => s.index === e)[0];
|
|
1740
1740
|
return n != null ? (t.set(e, n), n) : a?.scene?.children?.find?.((s) => s?.index === e);
|
|
1741
1741
|
}
|
|
1742
|
-
class
|
|
1742
|
+
class cr {
|
|
1743
1743
|
constructor(e) {
|
|
1744
1744
|
this.engine = e;
|
|
1745
1745
|
}
|
|
@@ -1752,9 +1752,9 @@ class ar {
|
|
|
1752
1752
|
const n = this.engine, s = e.object.url, o = e.object.name;
|
|
1753
1753
|
let r = n.modelEdge.getModelEdge(s, o);
|
|
1754
1754
|
r || (r = [0, 0, []]);
|
|
1755
|
-
const l =
|
|
1755
|
+
const l = Se(n, s), c = this.getModelSnapCache(s, o, r);
|
|
1756
1756
|
n.camera.updateMatrixWorld(!0);
|
|
1757
|
-
const h = new H().multiplyMatrices(n.camera.projectionMatrix, n.camera.matrixWorldInverse), u = n.renderer.domElement.clientWidth, p = n.renderer.domElement.clientHeight, g = new W(t.offsetX, t.offsetY), f = new
|
|
1757
|
+
const h = new H().multiplyMatrices(n.camera.projectionMatrix, n.camera.matrixWorldInverse), u = n.renderer.domElement.clientWidth, p = n.renderer.domElement.clientHeight, g = new W(t.offsetX, t.offsetY), f = new ai(), M = new d(), x = new d(), m = new W(), b = new W(), C = new d();
|
|
1758
1758
|
let S = "face", I = null, P = null, L = 100;
|
|
1759
1759
|
if (i != null) {
|
|
1760
1760
|
const k = e.point.clone(), O = e.normal || (e.face ? e.face.normal : null);
|
|
@@ -1886,7 +1886,7 @@ class ar {
|
|
|
1886
1886
|
const o = F.clamp(e, 0, 1);
|
|
1887
1887
|
if (!this.engine.camera.isPerspectiveCamera)
|
|
1888
1888
|
return s.lerpVectors(t, i, o);
|
|
1889
|
-
const r = new
|
|
1889
|
+
const r = new ai(t.x, t.y, t.z, 1).applyMatrix4(n), c = new ai(i.x, i.y, i.z, 1).applyMatrix4(n).w * (1 - o) + o * r.w, h = Math.abs(c) > 1e-10 ? o * r.w / c : o;
|
|
1890
1890
|
return s.lerpVectors(t, i, F.clamp(h, 0, 1));
|
|
1891
1891
|
}
|
|
1892
1892
|
/**
|
|
@@ -1963,7 +1963,7 @@ function Ki(a) {
|
|
|
1963
1963
|
touchControlsSnapshot: null,
|
|
1964
1964
|
mouseMoveFrame: null,
|
|
1965
1965
|
latestMouseMoveEvent: null
|
|
1966
|
-
}, t = 800, i = 28, n = 132, s = 44, o = 168, r = new
|
|
1966
|
+
}, t = 800, i = 28, n = 132, s = 44, o = 168, r = new cr(a);
|
|
1967
1967
|
e.handle_catch = function(v, A, B = !0, U = !0) {
|
|
1968
1968
|
const Y = e.options;
|
|
1969
1969
|
e.options = {
|
|
@@ -2135,7 +2135,7 @@ function Ki(a) {
|
|
|
2135
2135
|
// 保留原始触摸事件
|
|
2136
2136
|
};
|
|
2137
2137
|
}
|
|
2138
|
-
function
|
|
2138
|
+
function Pe(v) {
|
|
2139
2139
|
const B = a.renderer.domElement.getBoundingClientRect();
|
|
2140
2140
|
return {
|
|
2141
2141
|
offsetX: v.clientX - B.left,
|
|
@@ -2204,14 +2204,14 @@ function Ki(a) {
|
|
|
2204
2204
|
function N(v) {
|
|
2205
2205
|
if (v.pointerType !== "touch" || !f() || v.isPrimary === !1)
|
|
2206
2206
|
return;
|
|
2207
|
-
const A =
|
|
2207
|
+
const A = Pe(v);
|
|
2208
2208
|
w(A, new W(v.clientX, v.clientY), "pointer", v.pointerId);
|
|
2209
2209
|
}
|
|
2210
2210
|
function G(v) {
|
|
2211
|
-
v.pointerType !== "touch" || !f() || (e.touchLongPressActive && b(v), e.touchInputMode === "pointer" && (e.touchPointerId != null && v.pointerId !== e.touchPointerId || y(
|
|
2211
|
+
v.pointerType !== "touch" || !f() || (e.touchLongPressActive && b(v), e.touchInputMode === "pointer" && (e.touchPointerId != null && v.pointerId !== e.touchPointerId || y(Pe(v), new W(v.clientX, v.clientY))));
|
|
2212
2212
|
}
|
|
2213
2213
|
function q(v) {
|
|
2214
|
-
v.pointerType !== "touch" || !f() || (e.touchLongPressActive && b(v), e.touchInputMode === "pointer" && (e.touchPointerId != null && v.pointerId !== e.touchPointerId || E(
|
|
2214
|
+
v.pointerType !== "touch" || !f() || (e.touchLongPressActive && b(v), e.touchInputMode === "pointer" && (e.touchPointerId != null && v.pointerId !== e.touchPointerId || E(Pe(v))));
|
|
2215
2215
|
}
|
|
2216
2216
|
function j(v, A, B = !1, U = !0) {
|
|
2217
2217
|
if (!a.engineStatus.isFree && B == !1) {
|
|
@@ -2231,7 +2231,7 @@ function Ki(a) {
|
|
|
2231
2231
|
e.lastPoint = null;
|
|
2232
2232
|
}, e;
|
|
2233
2233
|
}
|
|
2234
|
-
class
|
|
2234
|
+
class hr {
|
|
2235
2235
|
engine;
|
|
2236
2236
|
orbitControls;
|
|
2237
2237
|
firstPersonControls;
|
|
@@ -2257,7 +2257,7 @@ class lr {
|
|
|
2257
2257
|
this.engine = e, this.init(), this.handelBehaved = Ki(this.engine), this.handelBehaved.init(this, null), this.handelBehaved.active();
|
|
2258
2258
|
}
|
|
2259
2259
|
init() {
|
|
2260
|
-
this.orbitControls = new
|
|
2260
|
+
this.orbitControls = new ls(this.engine, this.engine.camera, this.engine.renderer.domElement), this.orbitControls.showOriginIcon = !0, this.firstPersonControls = new hn(this.engine, this.engine.camera, this.engine.renderer.domElement), this.thirdPersonControls = new dn(this.engine, this.engine.camera, this.engine.renderer.domElement), this.applyRoamLookDirection(this.firstPersonControls), this.applyRoamLookDirection(this.thirdPersonControls);
|
|
2261
2261
|
const e = document.createElement("div");
|
|
2262
2262
|
this.originDiv = e, e.className = "originDiv", e.style.position = "absolute", e.style.top = "0px", e.style.left = "0px", e.style.width = "30px", e.style.height = "30px", e.style.borderRadius = "50%", e.style.pointerEvents = "none", e.style.backgroundImage = `url(${ee("/assets/svg/rotate-orbit.svg", import.meta.url)})`, this.engine.container.appendChild(this.originDiv);
|
|
2263
2263
|
}
|
|
@@ -2553,7 +2553,7 @@ class lr {
|
|
|
2553
2553
|
this.isActive = !1, this.handelBehaved?.disActive?.(), this.orbitControls?.dispose?.(), this.firstPersonControls?.dispose?.(), this.thirdPersonControls?.dispose?.(), this.removeMobileRoamControls(), this.originDiv?.remove(), this.originDiv = null, this.orbitControls = null, this.firstPersonControls = null, this.thirdPersonControls = null, this.handelBehaved = null;
|
|
2554
2554
|
}
|
|
2555
2555
|
}
|
|
2556
|
-
const
|
|
2556
|
+
const dr = {
|
|
2557
2557
|
uniforms: {
|
|
2558
2558
|
tDiffuse: { value: null },
|
|
2559
2559
|
saturation: { value: 1.2 },
|
|
@@ -2589,8 +2589,8 @@ const cr = {
|
|
|
2589
2589
|
gl_FragColor = color;
|
|
2590
2590
|
}
|
|
2591
2591
|
`
|
|
2592
|
-
},
|
|
2593
|
-
class
|
|
2592
|
+
}, ps = 0.5, ms = 1.1, gs = 1;
|
|
2593
|
+
class ur {
|
|
2594
2594
|
engine;
|
|
2595
2595
|
composer;
|
|
2596
2596
|
saturationPass;
|
|
@@ -2665,7 +2665,7 @@ class hr {
|
|
|
2665
2665
|
return;
|
|
2666
2666
|
const i = this.engine.renderer?.getPixelRatio?.() ?? window.devicePixelRatio ?? 1;
|
|
2667
2667
|
this.composer.setPixelRatio(i), this.composer.setSize(e, t);
|
|
2668
|
-
const n = this.composer.passes.find((s) => s instanceof
|
|
2668
|
+
const n = this.composer.passes.find((s) => s instanceof li && s.material.uniforms.resolution);
|
|
2669
2669
|
n && (n.material.uniforms.resolution.value.x = 1 / (e * i), n.material.uniforms.resolution.value.y = 1 / (t * i)), this.syncAmbientOcclusionDepthTextures();
|
|
2670
2670
|
}
|
|
2671
2671
|
/**
|
|
@@ -2675,16 +2675,16 @@ class hr {
|
|
|
2675
2675
|
this.composer && (this.syncAmbientOcclusionDepthTextures(), this.composer.render());
|
|
2676
2676
|
}
|
|
2677
2677
|
init() {
|
|
2678
|
-
const { width: e, height: t } = this.engine.deviceModule.getContainerSize(), i = this.engine.scene, n = this.engine.camera, s = this.engine.renderer, o = this.engine.deviceModule.isMobile(), r = this.engine.renderer?.getPixelRatio?.() ?? window.devicePixelRatio ?? 1, l = o ? this.engine.mobileMemoryProfile.samples : 4, c = new
|
|
2679
|
-
minFilter:
|
|
2680
|
-
magFilter:
|
|
2681
|
-
format:
|
|
2678
|
+
const { width: e, height: t } = this.engine.deviceModule.getContainerSize(), i = this.engine.scene, n = this.engine.camera, s = this.engine.renderer, o = this.engine.deviceModule.isMobile(), r = this.engine.renderer?.getPixelRatio?.() ?? window.devicePixelRatio ?? 1, l = o ? this.engine.mobileMemoryProfile.samples : 4, c = new Jn(e, t, {
|
|
2679
|
+
minFilter: $t,
|
|
2680
|
+
magFilter: $t,
|
|
2681
|
+
format: es,
|
|
2682
2682
|
// 移动端按设备内存控制多重采样,平衡边缘质量与全分辨率缓冲占用。
|
|
2683
2683
|
samples: l
|
|
2684
2684
|
});
|
|
2685
|
-
c.texture.colorSpace =
|
|
2686
|
-
const h = new
|
|
2687
|
-
this.composer.addPass(h), this.gtaoPass = new Qi(i, n, e, t), this.gtaoPass.output = Qi.OUTPUT.Default, this.gtaoPass.blendIntensity =
|
|
2685
|
+
c.texture.colorSpace = Js, this.composer = new eo(s, c), this.composer.setPixelRatio(r), this.composer.setSize(e, t);
|
|
2686
|
+
const h = new to(i, n);
|
|
2687
|
+
this.composer.addPass(h), this.gtaoPass = new Qi(i, n, e, t), this.gtaoPass.output = Qi.OUTPUT.Default, this.gtaoPass.blendIntensity = ps, this.gtaoPass.enabled = !1, this.gtaoPass.normalMaterial.side = re, this.gtaoPass.normalMaterial.needsUpdate = !0, this.excludeClippingHelpersFromGtao(this.gtaoPass), this.gtaoPass.updateGtaoMaterial && this.gtaoPass.updateGtaoMaterial({
|
|
2688
2688
|
// AO 采样半径。推荐范围:0.1 ~ 2.0。
|
|
2689
2689
|
// 越大遮蔽范围越广,但容易发灰、丢细节;对性能有轻到中等影响。
|
|
2690
2690
|
radius: 0.45,
|
|
@@ -2710,7 +2710,7 @@ class hr {
|
|
|
2710
2710
|
samples: 32,
|
|
2711
2711
|
rings: 3,
|
|
2712
2712
|
radiusExponent: 2
|
|
2713
|
-
}), this.applyClippingToAmbientOcclusionPass(this.gtaoPass), this.composer.addPass(this.gtaoPass), this.ssaoPass = new $i(i, n, e, t), this.ssaoPass.kernelRadius = 8, this.ssaoPass.minDistance = 5e-3, this.ssaoPass.maxDistance = 0.1, this.ssaoPass.output = $i.OUTPUT.Default, this.ssaoPass.enabled = !1, this.excludeClippingHelpersFromGtao(this.ssaoPass), this.applyClippingToAmbientOcclusionPass(this.ssaoPass), this.composer.addPass(this.ssaoPass), this.saturationPass = new
|
|
2713
|
+
}), this.applyClippingToAmbientOcclusionPass(this.gtaoPass), this.composer.addPass(this.gtaoPass), this.ssaoPass = new $i(i, n, e, t), this.ssaoPass.kernelRadius = 8, this.ssaoPass.minDistance = 5e-3, this.ssaoPass.maxDistance = 0.1, this.ssaoPass.output = $i.OUTPUT.Default, this.ssaoPass.enabled = !1, this.excludeClippingHelpersFromGtao(this.ssaoPass), this.applyClippingToAmbientOcclusionPass(this.ssaoPass), this.composer.addPass(this.ssaoPass), this.saturationPass = new li(dr), this.saturationPass.uniforms.saturation.value = ms, this.saturationPass.uniforms.contrast.value = gs, this.saturationPass.enabled = !1, this.composer.addPass(this.saturationPass), this.outputPass = new io(), this.outputPass.enabled = !0, this.composer.addPass(this.outputPass), this.fxaaPass = new li(no), this.fxaaPass.material.uniforms.resolution.value.x = 1 / (e * r), this.fxaaPass.material.uniforms.resolution.value.y = 1 / (t * r), this.fxaaPass.enabled = o, this.composer.addPass(this.fxaaPass), this.syncAmbientOcclusionDepthTextures();
|
|
2714
2714
|
}
|
|
2715
2715
|
}
|
|
2716
2716
|
function Dt(a) {
|
|
@@ -2720,7 +2720,7 @@ function Dt(a) {
|
|
|
2720
2720
|
i = n[1];
|
|
2721
2721
|
a.name = t, a.guid = i;
|
|
2722
2722
|
}
|
|
2723
|
-
function
|
|
2723
|
+
function pr(a, e, t, i) {
|
|
2724
2724
|
const r = a.models.find((x) => x.url == t);
|
|
2725
2725
|
if (r == null)
|
|
2726
2726
|
return;
|
|
@@ -2731,7 +2731,7 @@ function dr(a, e, t, i) {
|
|
|
2731
2731
|
}, x.rotation = { x: 0, y: 0, z: 0 }, x), M = (x, m) => {
|
|
2732
2732
|
if (!Array.isArray(m) || m.length === 0)
|
|
2733
2733
|
return;
|
|
2734
|
-
const b = m.map((S) => f(S)), C =
|
|
2734
|
+
const b = m.map((S) => f(S)), C = gr(x, l, b, t, a);
|
|
2735
2735
|
C != null && b.forEach((S, I) => {
|
|
2736
2736
|
const P = [[C, I, 0, 0]];
|
|
2737
2737
|
S.indexes = P, S.id = Number(S.id);
|
|
@@ -2739,9 +2739,9 @@ function dr(a, e, t, i) {
|
|
|
2739
2739
|
Dt(L), r.nodesMap.set(Number(S.id), L), c.push(Number(S.id));
|
|
2740
2740
|
});
|
|
2741
2741
|
};
|
|
2742
|
-
M("Circle", h), M("Rect", u), M("Ellipse", g), M("Bridge", p),
|
|
2742
|
+
M("Circle", h), M("Rect", u), M("Ellipse", g), M("Bridge", p), mr(r, c);
|
|
2743
2743
|
}
|
|
2744
|
-
function
|
|
2744
|
+
function mr(a, e) {
|
|
2745
2745
|
if (e.length === 0 || !Array.isArray(a?.lods))
|
|
2746
2746
|
return;
|
|
2747
2747
|
const i = a.lods[0]?.octreeBox;
|
|
@@ -2753,7 +2753,7 @@ function ur(a, e) {
|
|
|
2753
2753
|
n.has(s) || (i.elements.push(s), n.add(s));
|
|
2754
2754
|
});
|
|
2755
2755
|
}
|
|
2756
|
-
function
|
|
2756
|
+
function gr(a, e, t, i, n) {
|
|
2757
2757
|
let s;
|
|
2758
2758
|
const o = {
|
|
2759
2759
|
width: 1,
|
|
@@ -2831,7 +2831,7 @@ function pr(a, e, t, i, n) {
|
|
|
2831
2831
|
return r.meshs = p, r.instanceMatrix && r.instanceMatrix.array && (r.cloneInstanceMatrix = Array.from(r.instanceMatrix.array)), r.instanceMatrix.needsUpdate = !0, l;
|
|
2832
2832
|
}
|
|
2833
2833
|
function Ht(a, e) {
|
|
2834
|
-
const t = new
|
|
2834
|
+
const t = new ts();
|
|
2835
2835
|
switch (e.width = e.width * 0.3048, e.height = e.height * 0.3048, e.diameter = e.diameter * 0.3048, a) {
|
|
2836
2836
|
case "Rect":
|
|
2837
2837
|
t.moveTo(-e.width / 2, -e.height / 2), t.lineTo(-e.width / 2, e.height / 2), t.lineTo(e.width / 2, e.height / 2), t.lineTo(e.width / 2, -e.height / 2), t.lineTo(-e.width / 2, -e.height / 2);
|
|
@@ -2852,7 +2852,7 @@ function Ht(a, e) {
|
|
|
2852
2852
|
};
|
|
2853
2853
|
return n(t, i, e.color, e.position, e.rotation);
|
|
2854
2854
|
function n(s, o, r, l, c) {
|
|
2855
|
-
const h = new
|
|
2855
|
+
const h = new is(s, o), u = new Fi({
|
|
2856
2856
|
// MEP 最终颜色由 instanceColor 乘算,基础材质保持白色才能避免二次染色。
|
|
2857
2857
|
color: 16777215,
|
|
2858
2858
|
metalness: 0,
|
|
@@ -2864,70 +2864,70 @@ function Ht(a, e) {
|
|
|
2864
2864
|
}
|
|
2865
2865
|
}
|
|
2866
2866
|
var se = /* @__PURE__ */ ((a) => (a.ModelLoadStart = "model-load-start", a.ModelLoadProgress = "model-load-progress", a.ModelLoaded = "model-loaded", a.ModelError = "model-error", a.SelectionChanged = "selection-changed", a.HoverChanged = "hover-changed", a.Click = "click", a.MouseMove = "mouse-move", a.ModelPlaceSelected = "model-place-selected", a.ModelCalibrationChanged = "model-calibration-changed", a.CameraChanged = "camera-changed", a.CameraIdle = "camera-idle", a.EngineFree = "engine-free", a.EngineBusy = "engine-busy", a.MeasureChanged = "measure-changed", a.MeasureClick = "measure-click", a.SectionMove = "section-move", a.LoadingCompleted = "loading_completed", a))(se || {});
|
|
2867
|
-
const pn = "__bvhAccelerationInstalled",
|
|
2868
|
-
function
|
|
2867
|
+
const pn = "__bvhAccelerationInstalled", fs = "__bvhBuildFailed", fr = "__bvhBuilt", yr = "__bvhTriangleCount", ys = 200, Mr = 10;
|
|
2868
|
+
function vr() {
|
|
2869
2869
|
const a = globalThis;
|
|
2870
|
-
a[pn] !== !0 && (z.prototype.raycast =
|
|
2870
|
+
a[pn] !== !0 && (z.prototype.raycast = so, ae.prototype.computeBoundsTree = ns, ae.prototype.disposeBoundsTree = oo, a[pn] = !0);
|
|
2871
2871
|
}
|
|
2872
|
-
function
|
|
2872
|
+
function xr(a) {
|
|
2873
2873
|
a.firstHitOnly = !0;
|
|
2874
2874
|
}
|
|
2875
|
-
function
|
|
2875
|
+
function wr(a) {
|
|
2876
2876
|
delete a.firstHitOnly;
|
|
2877
2877
|
}
|
|
2878
|
-
function
|
|
2878
|
+
function br(a, e = ys) {
|
|
2879
2879
|
if (a == null)
|
|
2880
2880
|
return !1;
|
|
2881
2881
|
const t = a;
|
|
2882
|
-
if (t.boundsTree != null || t.userData?.[
|
|
2882
|
+
if (t.boundsTree != null || t.userData?.[fs] === !0)
|
|
2883
2883
|
return !1;
|
|
2884
2884
|
const i = a.attributes.position?.count ?? 0;
|
|
2885
2885
|
return (a.index?.count ?? i) / 3 >= e;
|
|
2886
2886
|
}
|
|
2887
|
-
function
|
|
2887
|
+
function Cr(a) {
|
|
2888
2888
|
if (a == null)
|
|
2889
2889
|
return 0;
|
|
2890
2890
|
const e = a.attributes.position?.count ?? 0;
|
|
2891
2891
|
return (a.index?.count ?? e) / 3;
|
|
2892
2892
|
}
|
|
2893
|
-
function
|
|
2893
|
+
function Er(a, e = {}) {
|
|
2894
2894
|
if (a == null)
|
|
2895
2895
|
return;
|
|
2896
|
-
const t = e.triangleThreshold ??
|
|
2897
|
-
if (!
|
|
2896
|
+
const t = e.triangleThreshold ?? ys;
|
|
2897
|
+
if (!br(a, t)) {
|
|
2898
2898
|
e.setBoundingBox === !0 && a.boundingBox == null && a.computeBoundingBox(), e.setBoundingSphere === !0 && a.boundingSphere == null && a.computeBoundingSphere();
|
|
2899
2899
|
return;
|
|
2900
2900
|
}
|
|
2901
2901
|
const i = a;
|
|
2902
2902
|
try {
|
|
2903
|
-
i.userData = i.userData ?? {}, i.userData[
|
|
2903
|
+
i.userData = i.userData ?? {}, i.userData[yr] = Cr(a), e.setBoundingBox === !0 && a.boundingBox == null && a.computeBoundingBox(), e.setBoundingSphere === !0 && a.boundingSphere == null && a.computeBoundingSphere(), ns.call(i, {
|
|
2904
2904
|
// 对外继续兼容旧字段,内部改用 three-mesh-bvh 0.9.10 的新参数名。
|
|
2905
|
-
maxLeafSize: e.maxLeafTris ??
|
|
2906
|
-
}), i.userData[
|
|
2905
|
+
maxLeafSize: e.maxLeafTris ?? Mr
|
|
2906
|
+
}), i.userData[fr] = i.boundsTree != null;
|
|
2907
2907
|
} catch (n) {
|
|
2908
|
-
i.userData = i.userData ?? {}, i.userData[
|
|
2908
|
+
i.userData = i.userData ?? {}, i.userData[fs] = !0, console.warn("[raycastAcceleration] failed to build bounds tree", n);
|
|
2909
2909
|
}
|
|
2910
2910
|
}
|
|
2911
2911
|
let gt = null, ft = null, mn = null;
|
|
2912
|
-
const
|
|
2913
|
-
let
|
|
2914
|
-
function
|
|
2912
|
+
const Ar = 8, Ms = 24, Sr = 24, Pr = 64, Tr = 240, Ir = 2, gn = /* @__PURE__ */ new WeakSet(), _r = 10;
|
|
2913
|
+
let vs = !1;
|
|
2914
|
+
function xs() {
|
|
2915
2915
|
return ee("draco/", import.meta.url);
|
|
2916
2916
|
}
|
|
2917
|
-
function
|
|
2917
|
+
function ws() {
|
|
2918
2918
|
return ee("basis/", import.meta.url);
|
|
2919
2919
|
}
|
|
2920
|
-
function
|
|
2921
|
-
return gt == null && (gt = new
|
|
2920
|
+
function Dr() {
|
|
2921
|
+
return gt == null && (gt = new ss(), gt.setDecoderPath(xs()), gt.preload()), gt;
|
|
2922
2922
|
}
|
|
2923
|
-
function
|
|
2924
|
-
return ft == null && (ft = new
|
|
2923
|
+
function kr(a) {
|
|
2924
|
+
return ft == null && (ft = new lo(), ft.setTranscoderPath(ws())), mn !== a && (ft.detectSupport(a), mn = a), ft;
|
|
2925
2925
|
}
|
|
2926
|
-
function
|
|
2926
|
+
function Lr(a) {
|
|
2927
2927
|
const e = new Oi();
|
|
2928
|
-
return e.setDRACOLoader(
|
|
2928
|
+
return e.setDRACOLoader(Dr()), e.setMeshoptDecoder(ao), a?.renderer != null && e.setKTX2Loader(kr(a.renderer)), e;
|
|
2929
2929
|
}
|
|
2930
|
-
function
|
|
2930
|
+
function bs() {
|
|
2931
2931
|
return new Promise((a) => {
|
|
2932
2932
|
if (typeof requestAnimationFrame == "function") {
|
|
2933
2933
|
requestAnimationFrame(() => a());
|
|
@@ -2936,20 +2936,20 @@ function xs() {
|
|
|
2936
2936
|
setTimeout(a, 16);
|
|
2937
2937
|
});
|
|
2938
2938
|
}
|
|
2939
|
-
function
|
|
2939
|
+
function Br() {
|
|
2940
2940
|
const a = navigator?.scheduling;
|
|
2941
2941
|
return typeof a?.isInputPending == "function" ? a.isInputPending() : !1;
|
|
2942
2942
|
}
|
|
2943
|
-
function
|
|
2944
|
-
return a?.engineStatus?.isFree === !1 ||
|
|
2943
|
+
function zr(a) {
|
|
2944
|
+
return a?.engineStatus?.isFree === !1 || Br();
|
|
2945
2945
|
}
|
|
2946
2946
|
async function Ze(a, e, t) {
|
|
2947
2947
|
if (e)
|
|
2948
2948
|
return t;
|
|
2949
2949
|
const i = performance.now();
|
|
2950
|
-
return
|
|
2950
|
+
return zr(a) || i - t >= Ar ? (await bs(), performance.now()) : t;
|
|
2951
2951
|
}
|
|
2952
|
-
function
|
|
2952
|
+
function Rr(a, e) {
|
|
2953
2953
|
return new Promise((t, i) => {
|
|
2954
2954
|
Mt(a, (n) => {
|
|
2955
2955
|
if (n == null) {
|
|
@@ -2962,8 +2962,8 @@ function Br(a, e) {
|
|
|
2962
2962
|
}, e);
|
|
2963
2963
|
});
|
|
2964
2964
|
}
|
|
2965
|
-
async function
|
|
2966
|
-
const t = await
|
|
2965
|
+
async function Cs(a, e) {
|
|
2966
|
+
const t = await ti({
|
|
2967
2967
|
method: "get",
|
|
2968
2968
|
responseType: "arraybuffer",
|
|
2969
2969
|
url: a
|
|
@@ -2974,7 +2974,7 @@ async function ws(a, e) {
|
|
|
2974
2974
|
function fn(a) {
|
|
2975
2975
|
return a.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
2976
2976
|
}
|
|
2977
|
-
function
|
|
2977
|
+
function Es(a, e) {
|
|
2978
2978
|
const t = new Set(e.map((i) => fn(i)));
|
|
2979
2979
|
for (const i of Object.keys(a.files))
|
|
2980
2980
|
if (t.has(fn(i)))
|
|
@@ -2982,37 +2982,37 @@ function bs(a, e) {
|
|
|
2982
2982
|
return null;
|
|
2983
2983
|
}
|
|
2984
2984
|
function yn(a, e) {
|
|
2985
|
-
const t =
|
|
2985
|
+
const t = Es(a, e);
|
|
2986
2986
|
return t == null || t.dir ? Promise.resolve(null) : t.async("string");
|
|
2987
2987
|
}
|
|
2988
|
-
function
|
|
2988
|
+
function Or(a) {
|
|
2989
2989
|
const e = Object.values(a.files).find((t) => t != null && t.dir !== !0);
|
|
2990
2990
|
return e == null ? Promise.resolve(null) : e.async("string");
|
|
2991
2991
|
}
|
|
2992
|
-
function
|
|
2992
|
+
function Fr(a) {
|
|
2993
2993
|
return a.charCodeAt(0) === 65279 ? a.slice(1) : a;
|
|
2994
2994
|
}
|
|
2995
|
-
function
|
|
2996
|
-
return JSON.parse(
|
|
2995
|
+
function ni(a) {
|
|
2996
|
+
return JSON.parse(Fr(a));
|
|
2997
2997
|
}
|
|
2998
|
-
async function
|
|
2998
|
+
async function Nr(a, e) {
|
|
2999
2999
|
try {
|
|
3000
|
-
const t = await
|
|
3000
|
+
const t = await Cs(a, e), i = await Or(t);
|
|
3001
3001
|
if (i == null)
|
|
3002
3002
|
return { exists: !0, value: [] };
|
|
3003
|
-
const n =
|
|
3003
|
+
const n = ni(i);
|
|
3004
3004
|
return Array.isArray(n) ? { exists: !0, value: n } : (console.warn("[loadLightModel] quota_list is not an array", { path: a, parsed: n }), { exists: !0, value: [] });
|
|
3005
3005
|
} catch (t) {
|
|
3006
|
-
return
|
|
3006
|
+
return ti.isAxiosError(t) && t.response?.status === 404 ? { exists: !1 } : (console.warn("[loadLightModel] failed to load optional quota_list", { path: a, error: t }), { exists: !1 });
|
|
3007
3007
|
}
|
|
3008
3008
|
}
|
|
3009
|
-
function
|
|
3010
|
-
const t =
|
|
3009
|
+
function Hr(a, e) {
|
|
3010
|
+
const t = Es(a, e);
|
|
3011
3011
|
return t == null || t.dir ? Promise.resolve(null) : t.async("arraybuffer");
|
|
3012
3012
|
}
|
|
3013
|
-
function
|
|
3013
|
+
function Vr(a, e) {
|
|
3014
3014
|
return new Promise((t, i) => {
|
|
3015
|
-
|
|
3015
|
+
Lr(a).parse(e, Wo(import.meta.url), t, i);
|
|
3016
3016
|
});
|
|
3017
3017
|
}
|
|
3018
3018
|
function mt(a, e) {
|
|
@@ -3030,34 +3030,34 @@ function kt(a) {
|
|
|
3030
3030
|
t.disposeBoundsTree?.(), t.dispose();
|
|
3031
3031
|
}), a.length = 0;
|
|
3032
3032
|
}
|
|
3033
|
-
function
|
|
3033
|
+
function As(a, e) {
|
|
3034
3034
|
const t = mt(a, e);
|
|
3035
3035
|
return Array.isArray(t?.lods) ? t.lods : [];
|
|
3036
3036
|
}
|
|
3037
|
-
function
|
|
3037
|
+
function Ss(a) {
|
|
3038
3038
|
a.loadStatus == null && (a.loadStatus = {}), a.loadStatus.modelMep == null && (a.loadStatus.modelMep = !1), a.loadStatus.normal == null && (a.loadStatus.normal = !1), a.loadStatus.quotaList == null && (a.loadStatus.quotaList = !1);
|
|
3039
3039
|
}
|
|
3040
|
-
function
|
|
3041
|
-
return
|
|
3040
|
+
function Ur(a) {
|
|
3041
|
+
return Ss(a), a.status === "loaded" && a.loadStatus.normal === !0 && a.loadStatus.modelMep === !0 && a.loadStatus.quotaList === !0;
|
|
3042
3042
|
}
|
|
3043
3043
|
function xt(a) {
|
|
3044
3044
|
const e = a?.engineStatus?.models;
|
|
3045
|
-
!Array.isArray(e) || e.length === 0 || !e.every((i) =>
|
|
3045
|
+
!Array.isArray(e) || e.length === 0 || !e.every((i) => Ur(i)) || a.__loadingCompletedTriggered === !0 || (a.__loadingCompletedTriggered = !0, a.events?.trigger?.(se.LoadingCompleted, {}));
|
|
3046
3046
|
}
|
|
3047
|
-
function
|
|
3047
|
+
function Ps(a) {
|
|
3048
3048
|
return a === !0 || a === "loading";
|
|
3049
3049
|
}
|
|
3050
3050
|
function Mn(a) {
|
|
3051
3051
|
return a.index != null ? a.index.count : a.attributes.position?.count ?? 0;
|
|
3052
3052
|
}
|
|
3053
|
-
async function
|
|
3053
|
+
async function Wr(a, e, t) {
|
|
3054
3054
|
let i = performance.now();
|
|
3055
3055
|
for (let n = 0; n < e.length; n++)
|
|
3056
3056
|
e[n]?.traverse?.((s) => {
|
|
3057
|
-
|
|
3058
|
-
}), (n + 1) %
|
|
3057
|
+
_s(s?.material, a);
|
|
3058
|
+
}), (n + 1) % Sr === 0 && (i = await Ze(a, t, i));
|
|
3059
3059
|
}
|
|
3060
|
-
async function
|
|
3060
|
+
async function Gr(a, e, t) {
|
|
3061
3061
|
const i = [], n = [{ node: e.octreeBox, visited: !1 }];
|
|
3062
3062
|
let s = performance.now();
|
|
3063
3063
|
for (; n.length > 0; ) {
|
|
@@ -3078,13 +3078,13 @@ async function Ur(a, e, t) {
|
|
|
3078
3078
|
}
|
|
3079
3079
|
return i;
|
|
3080
3080
|
}
|
|
3081
|
-
async function
|
|
3081
|
+
async function qr(a, e, t, i) {
|
|
3082
3082
|
if (pe(a, e.url, e.loadVersion))
|
|
3083
3083
|
return [];
|
|
3084
3084
|
const n = mt(a, e.url);
|
|
3085
3085
|
if (n?.nodesMap == null)
|
|
3086
3086
|
return [];
|
|
3087
|
-
const s = a.filterLoaderModel?.getContinueIdSet?.(e.url) ?? /* @__PURE__ */ new Set(), o = await
|
|
3087
|
+
const s = a.filterLoaderModel?.getContinueIdSet?.(e.url) ?? /* @__PURE__ */ new Set(), o = await Gr(a, t, i);
|
|
3088
3088
|
console.log("[loadLightModel] pending mesh ids", t.path, o.length);
|
|
3089
3089
|
const r = [], l = a?.deviceModule?.isMobile?.() !== !0;
|
|
3090
3090
|
let c = performance.now(), h = 0;
|
|
@@ -3105,46 +3105,46 @@ async function Wr(a, e, t, i) {
|
|
|
3105
3105
|
m.dispose();
|
|
3106
3106
|
continue;
|
|
3107
3107
|
}
|
|
3108
|
-
m.applyMatrix4(x), m.computeBoundingBox(), l && b.count > 2e4 &&
|
|
3108
|
+
m.applyMatrix4(x), m.computeBoundingBox(), l && b.count > 2e4 && Er(m, {
|
|
3109
3109
|
setBoundingSphere: !0
|
|
3110
3110
|
});
|
|
3111
3111
|
const C = new z(m, M.material);
|
|
3112
|
-
f.box = m.boundingBox?.clone(), f.mesh = C, C.name = Number(u), C.glb = f.glb, C.url = e.url, r.push(C), h++, h %
|
|
3112
|
+
f.box = m.boundingBox?.clone(), f.mesh = C, C.name = Number(u), C.glb = f.glb, C.url = e.url, r.push(C), h++, h % Ms === 0 && (c = await Ze(a, i, c));
|
|
3113
3113
|
}
|
|
3114
3114
|
}
|
|
3115
3115
|
return r;
|
|
3116
3116
|
}
|
|
3117
|
-
function
|
|
3117
|
+
function Ts(a) {
|
|
3118
3118
|
const e = a.clone();
|
|
3119
3119
|
return e.clippingPlanes = a.clippingPlanes, e;
|
|
3120
3120
|
}
|
|
3121
|
-
function
|
|
3121
|
+
function Kr(a) {
|
|
3122
3122
|
a.setRGB(a.r, a.g, a.b, We);
|
|
3123
3123
|
}
|
|
3124
|
-
function
|
|
3124
|
+
function jr(a) {
|
|
3125
3125
|
const e = a;
|
|
3126
|
-
e.color == null || a.userData.__displayColorLinearized === !0 || (
|
|
3126
|
+
e.color == null || a.userData.__displayColorLinearized === !0 || (Kr(e.color), a.userData.__displayColorLinearized = !0);
|
|
3127
3127
|
}
|
|
3128
|
-
function
|
|
3128
|
+
function Yr(a, e, t, i, n, s) {
|
|
3129
3129
|
const o = Et(
|
|
3130
3130
|
i.map((u) => u.geometry),
|
|
3131
3131
|
!1
|
|
3132
|
-
), r =
|
|
3132
|
+
), r = Ts(n), l = new z(o, r);
|
|
3133
3133
|
s != null && (l.visible = !1, s.push(l)), l.castShadow = !0, l.receiveShadow = !0, ot(e, a).add(l);
|
|
3134
3134
|
const h = Gi(e, l);
|
|
3135
3135
|
return qi(l, h), l.url = a, l.glb = t, l.materialClone = r, l.geometrys = i.map((u) => u.geometry), l.geometry.computeVertexNormals(), l;
|
|
3136
3136
|
}
|
|
3137
|
-
function
|
|
3137
|
+
function Xr(a, e, t, i) {
|
|
3138
3138
|
return ($e(a, e)?.children ?? a.scene.children).find((o) => {
|
|
3139
3139
|
const r = o;
|
|
3140
3140
|
return o instanceof z && r.url == e && r.glb == t && r.materialClone === i;
|
|
3141
3141
|
});
|
|
3142
3142
|
}
|
|
3143
|
-
function
|
|
3143
|
+
function Qr(a, e) {
|
|
3144
3144
|
const t = Array.isArray(a.geometrys) ? a.geometrys : [], i = e.map((o) => o.geometry), n = [...t, ...i], s = Et(n, !1);
|
|
3145
3145
|
a.geometry != null && a.geometry.dispose(), a.geometry = s, a.geometrys = n, a.castShadow = !0, a.receiveShadow = !0;
|
|
3146
3146
|
}
|
|
3147
|
-
async function
|
|
3147
|
+
async function $r(a, e, t, i, n, s) {
|
|
3148
3148
|
if (pe(t, a, e)) {
|
|
3149
3149
|
kt(i);
|
|
3150
3150
|
return;
|
|
@@ -3157,7 +3157,7 @@ async function Xr(a, e, t, i, n, s) {
|
|
|
3157
3157
|
const r = mt(t, a);
|
|
3158
3158
|
let l = performance.now();
|
|
3159
3159
|
for (const [c, h] of o.entries()) {
|
|
3160
|
-
const u = n ? h.length :
|
|
3160
|
+
const u = n ? h.length : Tr;
|
|
3161
3161
|
for (let p = 0; p < h.length; p += u) {
|
|
3162
3162
|
if (pe(t, a, e)) {
|
|
3163
3163
|
kt(i);
|
|
@@ -3166,9 +3166,9 @@ async function Xr(a, e, t, i, n, s) {
|
|
|
3166
3166
|
const g = h.slice(p, p + u);
|
|
3167
3167
|
if (g.length === 0)
|
|
3168
3168
|
continue;
|
|
3169
|
-
const f =
|
|
3170
|
-
let M =
|
|
3171
|
-
M = null, M != null ? (x = Array.isArray(M.geometrys) ? M.geometrys.length : 0, m = Mn(M.geometry),
|
|
3169
|
+
const f = la(g[0].material, t);
|
|
3170
|
+
let M = Xr(t, a, c, f), x = 0, m = 0;
|
|
3171
|
+
M = null, M != null ? (x = Array.isArray(M.geometrys) ? M.geometrys.length : 0, m = Mn(M.geometry), Qr(M, g)) : M = Yr(a, t, c, g, f, s);
|
|
3172
3172
|
const b = /* @__PURE__ */ new Map();
|
|
3173
3173
|
let C = m;
|
|
3174
3174
|
g.forEach((S, I) => {
|
|
@@ -3185,25 +3185,25 @@ async function Xr(a, e, t, i, n, s) {
|
|
|
3185
3185
|
}
|
|
3186
3186
|
}
|
|
3187
3187
|
}
|
|
3188
|
-
function
|
|
3188
|
+
function Zr(a, e) {
|
|
3189
3189
|
const t = a?.geometry;
|
|
3190
3190
|
return t instanceof ae ? (t.boundingBox == null && t.computeBoundingBox(), t.boundingBox?.clone().applyMatrix4(e) ?? null) : null;
|
|
3191
3191
|
}
|
|
3192
|
-
async function
|
|
3192
|
+
async function Jr(a, e, t, i, n, s, o, r) {
|
|
3193
3193
|
if (pe(i, a, e) || n == null || s == null || s.length === 0)
|
|
3194
3194
|
return;
|
|
3195
3195
|
const l = mt(i, a);
|
|
3196
3196
|
if (l == null)
|
|
3197
3197
|
return;
|
|
3198
3198
|
n.geometry.computeVertexNormals();
|
|
3199
|
-
const c = new V(n.geometry,
|
|
3199
|
+
const c = new V(n.geometry, Ts(n.material), s.length);
|
|
3200
3200
|
r != null && (c.visible = !1, r.push(c)), ot(i, a).add(c);
|
|
3201
3201
|
const u = Gi(i, c);
|
|
3202
3202
|
qi(c, u);
|
|
3203
3203
|
const p = new Float32Array(s.length * 3);
|
|
3204
3204
|
for (let M = 0; M < s.length; M++)
|
|
3205
3205
|
p[M * 3] = 1, p[M * 3 + 1] = 1, p[M * 3 + 2] = 1;
|
|
3206
|
-
c.instanceColor = new
|
|
3206
|
+
c.instanceColor = new ro(p, 3);
|
|
3207
3207
|
let g = performance.now();
|
|
3208
3208
|
const f = [];
|
|
3209
3209
|
for (let M = 0; M < s.length; M++) {
|
|
@@ -3213,7 +3213,7 @@ async function $r(a, e, t, i, n, s, o, r) {
|
|
|
3213
3213
|
}
|
|
3214
3214
|
const x = s[M], m = new H();
|
|
3215
3215
|
m.elements = x.matrix;
|
|
3216
|
-
const b =
|
|
3216
|
+
const b = Zr(n, m);
|
|
3217
3217
|
if (b != null && (x.box = b.clone()), c.setMatrixAt(M, m), c.matrixs || (c.matrixs = []), c.matrixs.push(m.clone()), f.push(m.clone()), l.nodesMap.has(x.id)) {
|
|
3218
3218
|
const C = l.nodesMap.get(x.id);
|
|
3219
3219
|
C.indexes == null && (C.indexes = []), C.indexes.push([u, M, 0, 0]), Dt(C), b != null && C?.info != null && (C.info.box instanceof R ? C.info.box.union(b) : C.info.box = b.clone());
|
|
@@ -3226,11 +3226,11 @@ async function $r(a, e, t, i, n, s, o, r) {
|
|
|
3226
3226
|
};
|
|
3227
3227
|
Dt(C), l.nodesMap.set(x.id, C);
|
|
3228
3228
|
}
|
|
3229
|
-
(M + 1) %
|
|
3229
|
+
(M + 1) % Pr === 0 && (g = await Ze(i, o, g));
|
|
3230
3230
|
}
|
|
3231
3231
|
c.instanceMatrix.needsUpdate = !0, c.instanceColor != null && (c.instanceColor.needsUpdate = !0), c.materialClone = c.material, c.url = a, c.glb = n.glb, c.ids = s.map((M) => M.id), c.matrixsClone = f, c.meshIndex = t, r == null && i.requestComposerRender?.();
|
|
3232
3232
|
}
|
|
3233
|
-
async function
|
|
3233
|
+
async function ea(a, e, t, i, n) {
|
|
3234
3234
|
const s = e.instanceNodes;
|
|
3235
3235
|
if (s == null)
|
|
3236
3236
|
return;
|
|
@@ -3247,7 +3247,7 @@ async function Zr(a, e, t, i, n) {
|
|
|
3247
3247
|
const u = Array.isArray(c.children) ? c.children.filter((p) => o.has(Number(p?.id)) === !1) : [];
|
|
3248
3248
|
if (u.length === 0)
|
|
3249
3249
|
continue;
|
|
3250
|
-
await
|
|
3250
|
+
await Jr(
|
|
3251
3251
|
a.url,
|
|
3252
3252
|
a.loadVersion,
|
|
3253
3253
|
c.mesh,
|
|
@@ -3263,30 +3263,30 @@ async function Zr(a, e, t, i, n) {
|
|
|
3263
3263
|
}
|
|
3264
3264
|
}
|
|
3265
3265
|
}
|
|
3266
|
-
async function
|
|
3266
|
+
async function ta(a, e, t, i) {
|
|
3267
3267
|
if (t.status === !0 || t.meshPromise != null) {
|
|
3268
3268
|
await t.meshPromise;
|
|
3269
3269
|
return;
|
|
3270
3270
|
}
|
|
3271
3271
|
t.meshPromise = (async () => {
|
|
3272
3272
|
console.log(`[loadLightModel] start build lod meshes ${Date.now() - window.startTime}ms`);
|
|
3273
|
-
const n = a?.deviceModule?.isMobile?.() === !0 ? [] : void 0, s = await
|
|
3273
|
+
const n = a?.deviceModule?.isMobile?.() === !0 ? [] : void 0, s = await qr(a, e, t, i);
|
|
3274
3274
|
if (pe(a, e.url, e.loadVersion)) {
|
|
3275
3275
|
kt(s);
|
|
3276
3276
|
return;
|
|
3277
3277
|
}
|
|
3278
|
-
if (await
|
|
3278
|
+
if (await ea(e, t, a, i, n), pe(a, e.url, e.loadVersion)) {
|
|
3279
3279
|
kt(s);
|
|
3280
3280
|
return;
|
|
3281
3281
|
}
|
|
3282
|
-
t.glbs = [], await
|
|
3282
|
+
t.glbs = [], await $r(e.url, e.loadVersion, a, s, i, n), !pe(a, e.url, e.loadVersion) && (t.instanceNodes = null, t.status = !0, n?.forEach((o) => {
|
|
3283
3283
|
o.visible = !0;
|
|
3284
3284
|
}), a.requestComposerRender?.(), console.log(`[loadLightModel] *****************************************************finish build lod meshes ${Date.now() - window.startTime}ms`));
|
|
3285
3285
|
})().finally(() => {
|
|
3286
3286
|
t.meshPromise = null;
|
|
3287
3287
|
}), await t.meshPromise;
|
|
3288
3288
|
}
|
|
3289
|
-
async function
|
|
3289
|
+
async function ia(a, e, t, i) {
|
|
3290
3290
|
if (t.loadSuccess !== !0) {
|
|
3291
3291
|
if (t.preparePromise != null) {
|
|
3292
3292
|
await t.preparePromise;
|
|
@@ -3296,12 +3296,12 @@ async function ea(a, e, t, i) {
|
|
|
3296
3296
|
console.log("[loadLightModel] loading GLB bundle", t.path), t.glbs = t.glbs ?? {};
|
|
3297
3297
|
const n = e.url + t.path;
|
|
3298
3298
|
vt(a, e.url, n), console.log(`[loadLightModel] ZIP 解压开始 ${Date.now() - window.startTime}ms`);
|
|
3299
|
-
const s = await
|
|
3299
|
+
const s = await Cs(n, e.key);
|
|
3300
3300
|
console.log(`[loadLightModel] ZIP 解压完成 ${Date.now() - window.startTime}ms`);
|
|
3301
3301
|
const o = await yn(s, ["/nodes.json", "nodes.json"]);
|
|
3302
3302
|
if (o == null)
|
|
3303
3303
|
return;
|
|
3304
|
-
const r =
|
|
3304
|
+
const r = ni(o), l = mt(a, e.url);
|
|
3305
3305
|
if (l == null)
|
|
3306
3306
|
return;
|
|
3307
3307
|
l.nodesMap == null && (l.nodesMap = /* @__PURE__ */ new Map());
|
|
@@ -3320,11 +3320,11 @@ async function ea(a, e, t, i) {
|
|
|
3320
3320
|
continue;
|
|
3321
3321
|
S.infos.push(C), Dt(S);
|
|
3322
3322
|
}
|
|
3323
|
-
(b + 1) %
|
|
3323
|
+
(b + 1) % Ms === 0 && (c = await Ze(a, i, c));
|
|
3324
3324
|
}
|
|
3325
3325
|
}
|
|
3326
3326
|
const u = async (x) => {
|
|
3327
|
-
let m = await
|
|
3327
|
+
let m = await Hr(s, [`/${x}.glb`, `${x}.glb`, x + ".glb"]);
|
|
3328
3328
|
if (m == null) {
|
|
3329
3329
|
console.error("[loadLightModel] glb not found in zip", {
|
|
3330
3330
|
modelUrl: e.url,
|
|
@@ -3335,17 +3335,17 @@ async function ea(a, e, t, i) {
|
|
|
3335
3335
|
return;
|
|
3336
3336
|
}
|
|
3337
3337
|
try {
|
|
3338
|
-
const b = await
|
|
3338
|
+
const b = await Vr(a, m);
|
|
3339
3339
|
m = null, t.glbs[x] = b.scene.children, t.glbs[x].forEach((C) => {
|
|
3340
3340
|
C.matrixWorld;
|
|
3341
|
-
}), await
|
|
3341
|
+
}), await Wr(a, t.glbs[x], i);
|
|
3342
3342
|
} catch (b) {
|
|
3343
3343
|
console.error("[loadLightModel] failed to load glb", {
|
|
3344
3344
|
modelUrl: e.url,
|
|
3345
3345
|
lodPath: t.path,
|
|
3346
3346
|
glbKey: `${x}.glb`,
|
|
3347
|
-
dracoDecoderPath:
|
|
3348
|
-
basisTranscoderPath:
|
|
3347
|
+
dracoDecoderPath: xs(),
|
|
3348
|
+
basisTranscoderPath: ws(),
|
|
3349
3349
|
error: b
|
|
3350
3350
|
});
|
|
3351
3351
|
} finally {
|
|
@@ -3353,7 +3353,7 @@ async function ea(a, e, t, i) {
|
|
|
3353
3353
|
}
|
|
3354
3354
|
};
|
|
3355
3355
|
let p = 0;
|
|
3356
|
-
const g = a?.deviceModule?.isMobile?.() === !0 ? 1 :
|
|
3356
|
+
const g = a?.deviceModule?.isMobile?.() === !0 ? 1 : Ir, f = Math.min(g, h.length);
|
|
3357
3357
|
await Promise.all(Array.from({ length: f }, async () => {
|
|
3358
3358
|
for (; p < h.length; ) {
|
|
3359
3359
|
const x = h[p++];
|
|
@@ -3361,13 +3361,13 @@ async function ea(a, e, t, i) {
|
|
|
3361
3361
|
}
|
|
3362
3362
|
})), console.log(`[loadLightModel] 所有 GLB 加载完成 ${Date.now() - window.startTime}ms`);
|
|
3363
3363
|
const M = await yn(s, ["/instances.json", "instances.json"]);
|
|
3364
|
-
t.instanceNodes = M != null ?
|
|
3364
|
+
t.instanceNodes = M != null ? ni(M) : null, t.loadSuccess = !0;
|
|
3365
3365
|
})().finally(() => {
|
|
3366
3366
|
t.preparePromise = null;
|
|
3367
3367
|
}), await t.preparePromise;
|
|
3368
3368
|
}
|
|
3369
3369
|
}
|
|
3370
|
-
function
|
|
3370
|
+
function na(a, e, t) {
|
|
3371
3371
|
if (t.boundingBox || (t.boundingBox = new R(), t.boundingBox.min = new d(t.octreeBox.min.X, t.octreeBox.min.Z, -t.octreeBox.min.Y), t.boundingBox.max = new d(t.octreeBox.max.X, t.octreeBox.max.Z, -t.octreeBox.max.Y)), !t.maxSize)
|
|
3372
3372
|
return 1e3;
|
|
3373
3373
|
const i = t.boundingBox, n = i.min, s = i.max, o = n.clone().add(s.clone()).multiplyScalar(0.5), r = n.distanceTo(s), l = new d(), c = new d(), h = new d(), u = new d();
|
|
@@ -3383,31 +3383,31 @@ function ta(a, e, t) {
|
|
|
3383
3383
|
const g = u.clone().add(h.multiplyScalar(Math.max(p, r))), f = g.clone().add(l.setLength(t.maxSize)), M = new fe(e, a.renderer, a.scene).worldToScreen(g), x = new fe(e, a.renderer, a.scene).worldToScreen(f);
|
|
3384
3384
|
return M.distanceTo(x);
|
|
3385
3385
|
}
|
|
3386
|
-
async function
|
|
3387
|
-
pe(a, e.url, e.loadVersion) || t.maxSize < 1e6 && t.path != "/lod0" && !
|
|
3386
|
+
async function sa(a, e, t, i) {
|
|
3387
|
+
pe(a, e.url, e.loadVersion) || t.maxSize < 1e6 && t.path != "/lod0" && !vs && (!(na(a, a.camera, t) >= _r) || t.status === !0) || (await ia(a, e, t, i), !pe(a, e.url, e.loadVersion) && t.loadSuccess === !0 && await ta(a, e, t, i));
|
|
3388
3388
|
}
|
|
3389
|
-
function
|
|
3390
|
-
if (
|
|
3389
|
+
function oa(a, e, t) {
|
|
3390
|
+
if (Ps(e.loadStatus.modelMep))
|
|
3391
3391
|
return;
|
|
3392
3392
|
const i = mt(a, e.url);
|
|
3393
3393
|
if (i == null)
|
|
3394
3394
|
return;
|
|
3395
3395
|
e.loadStatus.modelMep = "loading", i.modelMep == null && (i.modelMep = {}), (async () => {
|
|
3396
|
-
t || await
|
|
3396
|
+
t || await bs(), !pe(a, e.url, e.loadVersion) && (pr(a, i.modelMep, e.url), e.loadStatus.modelMep = !0, xt(a));
|
|
3397
3397
|
})().catch((s) => {
|
|
3398
3398
|
e.loadStatus.modelMep = !1, console.error("[loadLightModel] failed to load mep model", s);
|
|
3399
3399
|
});
|
|
3400
3400
|
}
|
|
3401
|
-
function
|
|
3401
|
+
function ra(a, e, t, i, n) {
|
|
3402
3402
|
const s = ot(a, e);
|
|
3403
3403
|
a.models || (a.models = []);
|
|
3404
3404
|
const o = t?.loadQuotaList ?? !1, r = t?.loadEdge !== !1;
|
|
3405
3405
|
window.startTime = Date.now();
|
|
3406
3406
|
let l = "WDDsBNtzVz6aSh/bCFh3CmjjANEDRryoXF1XCJvJjeE=";
|
|
3407
|
-
|
|
3407
|
+
Rr(e + "/info", l).then((c) => {
|
|
3408
3408
|
if (pe(a, e, n))
|
|
3409
3409
|
return;
|
|
3410
|
-
const h =
|
|
3410
|
+
const h = ni(c), u = h?.baseInfo ?? {}, p = typeof u?.name == "string" ? u.name : "";
|
|
3411
3411
|
a.__loadingCompletedTriggered = !1;
|
|
3412
3412
|
const g = {
|
|
3413
3413
|
type: "light",
|
|
@@ -3450,48 +3450,48 @@ function sa(a, e, t, i, n) {
|
|
|
3450
3450
|
pe(a, e, n) || (a.filterLoaderModel?.buildContinueIds?.(e), M());
|
|
3451
3451
|
}) : M();
|
|
3452
3452
|
function M() {
|
|
3453
|
-
pe(a, e, n) || (o ?
|
|
3454
|
-
pe(a, e, n) || (x.exists && (f.quotaList = x.value ?? [], a.rxQuotaListMapper.loadNodeMap(f)), g.loadStatus.quotaList = !0,
|
|
3453
|
+
pe(a, e, n) || (o ? Nr(e + "/quota_list", l).then((x) => {
|
|
3454
|
+
pe(a, e, n) || (x.exists && (f.quotaList = x.value ?? [], a.rxQuotaListMapper.loadNodeMap(f)), g.loadStatus.quotaList = !0, vs = !0, xt(a));
|
|
3455
3455
|
}).catch((x) => {
|
|
3456
3456
|
pe(a, e, n) || (g.loadStatus.quotaList = !0, console.warn("[loadLightModel] unexpected quota_list load failure", { url: e, error: x }), xt(a));
|
|
3457
3457
|
}) : (g.loadStatus.quotaList = !0, xt(a)), a.viewCube.CameraGoHome(1), a.models.length == i && setTimeout(() => {
|
|
3458
|
-
|
|
3458
|
+
Is(a, null, !1);
|
|
3459
3459
|
}, 100));
|
|
3460
3460
|
}
|
|
3461
3461
|
}).catch((c) => {
|
|
3462
3462
|
console.error("[loadLightModel] failed to load model info", { url: e, error: c });
|
|
3463
3463
|
});
|
|
3464
3464
|
}
|
|
3465
|
-
async function
|
|
3465
|
+
async function Is(a, e, t = !1) {
|
|
3466
3466
|
const i = a.engineStatus.models.filter((n) => e == null || n.url == e);
|
|
3467
3467
|
for (const n of i)
|
|
3468
|
-
if (!pe(a, n.url, n.loadVersion) && (
|
|
3468
|
+
if (!pe(a, n.url, n.loadVersion) && (Ss(n), !(n.status !== "loading" || n.type !== "light") && (oa(a, n, t), !Ps(n.loadStatus.normal)))) {
|
|
3469
3469
|
n.loadStatus.normal = "loading";
|
|
3470
3470
|
try {
|
|
3471
|
-
await
|
|
3471
|
+
await aa(a, n, t);
|
|
3472
3472
|
} finally {
|
|
3473
|
-
const s =
|
|
3473
|
+
const s = As(a, n.url), o = s.length > 0 && s.every((r) => r.status === !0);
|
|
3474
3474
|
n.loadStatus.normal = o, o && (n.status = "loaded"), xt(a);
|
|
3475
3475
|
}
|
|
3476
3476
|
}
|
|
3477
3477
|
}
|
|
3478
|
-
async function
|
|
3478
|
+
async function aa(a, e, t = !1) {
|
|
3479
3479
|
console.log(`[loadLightModel] start loadNode ${Date.now() - window.startTime}ms`);
|
|
3480
|
-
const i =
|
|
3480
|
+
const i = As(a, e.url);
|
|
3481
3481
|
if (i.length !== 0)
|
|
3482
3482
|
for (const n of i)
|
|
3483
|
-
await
|
|
3483
|
+
await sa(a, e, n, t);
|
|
3484
3484
|
}
|
|
3485
|
-
function
|
|
3486
|
-
|
|
3485
|
+
function la(a, e) {
|
|
3486
|
+
jr(a), _s(a, e);
|
|
3487
3487
|
const t = a.map;
|
|
3488
3488
|
return t != null && t.colorSpace !== We && (t.colorSpace = We, t.needsUpdate = !0), a.side = re, a.shadowSide = re, a.clipShadows = !0, e?.sectionPlane && (a.clippingPlanes = e.sectionPlane), a;
|
|
3489
3489
|
}
|
|
3490
|
-
function
|
|
3490
|
+
function ca(a) {
|
|
3491
3491
|
const e = a.source?.data ?? a.image, t = Array.isArray(a.mipmaps) ? a.mipmaps[0] : null, i = Number(e?.videoWidth ?? e?.naturalWidth ?? e?.width ?? t?.width), n = Number(e?.videoHeight ?? e?.naturalHeight ?? e?.height ?? t?.height);
|
|
3492
3492
|
return Number.isFinite(i) && i > 0 && Number.isFinite(n) && n > 0 ? { width: i, height: n } : null;
|
|
3493
3493
|
}
|
|
3494
|
-
function
|
|
3494
|
+
function ha(a) {
|
|
3495
3495
|
const e = a.source?.data ?? a.image;
|
|
3496
3496
|
typeof e?.close == "function" && e.close(), Array.isArray(a.mipmaps) && (a.mipmaps.length = 0), a.dispose(), a.source != null && (a.source.data = null);
|
|
3497
3497
|
}
|
|
@@ -3501,7 +3501,7 @@ function vn(a, e) {
|
|
|
3501
3501
|
const t = a.color;
|
|
3502
3502
|
t != null && (t.getHex() === 0 && t.set(16777215), a.needsUpdate = !0);
|
|
3503
3503
|
}
|
|
3504
|
-
function
|
|
3504
|
+
function _s(a, e) {
|
|
3505
3505
|
if (e?.deviceModule?.isMobile?.() !== !0 || e?.mobileMemoryProfile?.restrictTextureSize === !1 || a == null)
|
|
3506
3506
|
return;
|
|
3507
3507
|
const t = Array.isArray(a) ? a : [a], i = Number(e?.renderer?.capabilities?.maxTextureSize), n = Number(e?.mobileMemoryProfile?.maxTextureSize ?? 2048), s = Number.isFinite(i) ? Math.min(n, i) : n;
|
|
@@ -3514,8 +3514,8 @@ function Ts(a, e) {
|
|
|
3514
3514
|
o[r] = null, vn(o, r);
|
|
3515
3515
|
return;
|
|
3516
3516
|
}
|
|
3517
|
-
const c =
|
|
3518
|
-
c == null || Math.max(c.width, c.height) <= s || (gn.add(l), o[r] = null, vn(o, r),
|
|
3517
|
+
const c = ca(l);
|
|
3518
|
+
c == null || Math.max(c.width, c.height) <= s || (gn.add(l), o[r] = null, vn(o, r), ha(l), console.warn("[loadLightModel] discarded oversized mobile texture", {
|
|
3519
3519
|
slot: r,
|
|
3520
3520
|
width: c.width,
|
|
3521
3521
|
height: c.height,
|
|
@@ -3524,7 +3524,7 @@ function Ts(a, e) {
|
|
|
3524
3524
|
});
|
|
3525
3525
|
});
|
|
3526
3526
|
}
|
|
3527
|
-
const
|
|
3527
|
+
const da = "/__local_model__", ua = /^(info|property|edge|quota_list|lod\d+)(?:\.zip)?$/i, pa = /^(info|property|edge|quota_list|lod\d+)(?:~)?$/i;
|
|
3528
3528
|
class ve {
|
|
3529
3529
|
static localRequestMap = /* @__PURE__ */ new Map();
|
|
3530
3530
|
static localObjectUrls = /* @__PURE__ */ new Set();
|
|
@@ -3547,7 +3547,7 @@ class ve {
|
|
|
3547
3547
|
for (const n of e) {
|
|
3548
3548
|
this.unloadedModelUrls.delete(n);
|
|
3549
3549
|
const s = (this.modelLoadVersions.get(n) ?? 0) + 1;
|
|
3550
|
-
this.modelLoadVersions.set(n, s), i(n) === "light" &&
|
|
3550
|
+
this.modelLoadVersions.set(n, s), i(n) === "light" && ra(this.engine, n, t, e.length, s);
|
|
3551
3551
|
}
|
|
3552
3552
|
function i(n) {
|
|
3553
3553
|
const s = n.split(".").pop();
|
|
@@ -3564,12 +3564,12 @@ class ve {
|
|
|
3564
3564
|
for (let n = 0; n < e.length; n++) {
|
|
3565
3565
|
const s = e[n];
|
|
3566
3566
|
try {
|
|
3567
|
-
const o = await
|
|
3567
|
+
const o = await ti.get(s, { responseType: "blob" });
|
|
3568
3568
|
if (!await wn(o.data))
|
|
3569
3569
|
throw new Error("响应内容不是有效的 ZIP 文件");
|
|
3570
3570
|
i.push(new File(
|
|
3571
3571
|
[o.data],
|
|
3572
|
-
|
|
3572
|
+
xa(s, n),
|
|
3573
3573
|
{ type: o.data.type || "application/zip" }
|
|
3574
3574
|
));
|
|
3575
3575
|
} catch (o) {
|
|
@@ -3610,8 +3610,8 @@ class ve {
|
|
|
3610
3610
|
if (typeof e != "string" || e.length === 0)
|
|
3611
3611
|
return;
|
|
3612
3612
|
this.unloadedModelUrls.add(e), this.modelLoadVersions.set(e, (this.modelLoadVersions.get(e) ?? 0) + 1);
|
|
3613
|
-
const t = Array.isArray(this.engine?.models) ? this.engine.models.filter((s) => s?.url === e) : [], i =
|
|
3614
|
-
this.engine?.modelExplode?.releaseModel?.(e), this.engine?.modelToolModule?.releaseModelRuntimeState?.(e), this.engine?.modelEdge?.releaseModel?.(e),
|
|
3613
|
+
const t = Array.isArray(this.engine?.models) ? this.engine.models.filter((s) => s?.url === e) : [], i = ma(this.engine, e, t), n = ga(this.engine, e, i);
|
|
3614
|
+
this.engine?.modelExplode?.releaseModel?.(e), this.engine?.modelToolModule?.releaseModelRuntimeState?.(e), this.engine?.modelEdge?.releaseModel?.(e), fa(i), ya(i, n), Ma(this.engine, e, i, t), t.forEach(va), Array.isArray(this.engine?.models) && (this.engine.models = this.engine.models.filter((s) => s?.url !== e)), this.clearEngineStatus(e), this.engine?.filterLoaderModel?.clear?.(e), this.removeModelGroupReference(e), ve.releaseLocalRequests(e), this.engine.requestComposerRender?.();
|
|
3615
3615
|
}
|
|
3616
3616
|
/** 返回指定 URL 是否已收到卸载请求,供异步加载链路避免卸载后回写。 */
|
|
3617
3617
|
isModelUnloadRequested(e) {
|
|
@@ -3671,7 +3671,7 @@ class ve {
|
|
|
3671
3671
|
blob: await this.packEntriesAsZip(g)
|
|
3672
3672
|
});
|
|
3673
3673
|
c.some((p) => p.packageName === "info") && (r += 1, o.push({
|
|
3674
|
-
rootUrl: `${
|
|
3674
|
+
rootUrl: `${da}/${ve.createLocalModelId(l, r)}`,
|
|
3675
3675
|
packages: c
|
|
3676
3676
|
}));
|
|
3677
3677
|
}
|
|
@@ -3690,10 +3690,10 @@ class ve {
|
|
|
3690
3690
|
continue;
|
|
3691
3691
|
}
|
|
3692
3692
|
if (await wn(i)) {
|
|
3693
|
-
const o = await Ai.loadAsync(i), r =
|
|
3693
|
+
const o = await Ai.loadAsync(i), r = pi(n), l = Object.values(o.files);
|
|
3694
3694
|
for (const c of l)
|
|
3695
3695
|
c.dir || t.push({
|
|
3696
|
-
path:
|
|
3696
|
+
path: wa(r, Re(c.name)),
|
|
3697
3697
|
blob: await c.async("blob")
|
|
3698
3698
|
});
|
|
3699
3699
|
continue;
|
|
@@ -3706,10 +3706,10 @@ class ve {
|
|
|
3706
3706
|
* 识别已经打好的模型包文件,例如 `info`、`lod0.zip`。
|
|
3707
3707
|
*/
|
|
3708
3708
|
parseDirectPackageEntry(e) {
|
|
3709
|
-
const t =
|
|
3709
|
+
const t = pi(e), i = wt(e);
|
|
3710
3710
|
return xn(i) ? {
|
|
3711
3711
|
modelKey: t,
|
|
3712
|
-
packageName:
|
|
3712
|
+
packageName: ba(i)
|
|
3713
3713
|
} : null;
|
|
3714
3714
|
}
|
|
3715
3715
|
/**
|
|
@@ -3718,7 +3718,7 @@ class ve {
|
|
|
3718
3718
|
parseExtractedPackageEntry(e) {
|
|
3719
3719
|
const t = Re(e).split("/").filter(Boolean);
|
|
3720
3720
|
for (let n = 0; n < t.length; n++) {
|
|
3721
|
-
const s =
|
|
3721
|
+
const s = Ca(t[n]);
|
|
3722
3722
|
if (s == null)
|
|
3723
3723
|
continue;
|
|
3724
3724
|
const o = t.slice(n + 1);
|
|
@@ -3731,7 +3731,7 @@ class ve {
|
|
|
3731
3731
|
}
|
|
3732
3732
|
const i = wt(e).toLowerCase();
|
|
3733
3733
|
return i === "info.json" || i === "property.json" || i === "edge.json" || i === "quota_list.json" ? {
|
|
3734
|
-
modelKey:
|
|
3734
|
+
modelKey: pi(e),
|
|
3735
3735
|
packageName: i.replace(".json", ""),
|
|
3736
3736
|
innerPath: i
|
|
3737
3737
|
} : null;
|
|
@@ -3749,7 +3749,7 @@ class ve {
|
|
|
3749
3749
|
* 注册 axios 拦截器,把虚拟模型地址改写为对应的 Blob URL。
|
|
3750
3750
|
*/
|
|
3751
3751
|
static ensureLocalRequestInterceptor() {
|
|
3752
|
-
ve.interceptorInstalled || (
|
|
3752
|
+
ve.interceptorInstalled || (ti.interceptors.request.use((e) => {
|
|
3753
3753
|
if (typeof e.url == "string") {
|
|
3754
3754
|
const t = ve.normalizeRequestKey(e.url), i = ve.localRequestMap.get(t);
|
|
3755
3755
|
i != null && (e.url = i);
|
|
@@ -3789,22 +3789,22 @@ class ve {
|
|
|
3789
3789
|
return `${e.replace(/[^a-zA-Z0-9/_-]/g, "_").replace(/\//g, "__") || "model"}_${Date.now()}_${t}_${Math.random().toString(36).slice(2, 8)}`;
|
|
3790
3790
|
}
|
|
3791
3791
|
}
|
|
3792
|
-
function
|
|
3792
|
+
function Ds() {
|
|
3793
3793
|
return {
|
|
3794
3794
|
geometries: /* @__PURE__ */ new Set(),
|
|
3795
3795
|
materials: /* @__PURE__ */ new Set(),
|
|
3796
3796
|
textures: /* @__PURE__ */ new Set()
|
|
3797
3797
|
};
|
|
3798
3798
|
}
|
|
3799
|
-
function
|
|
3799
|
+
function ks(a, e) {
|
|
3800
3800
|
Object.values(a).forEach((i) => {
|
|
3801
|
-
i instanceof
|
|
3801
|
+
i instanceof De && e.add(i);
|
|
3802
3802
|
});
|
|
3803
3803
|
const t = a.uniforms;
|
|
3804
3804
|
t == null || typeof t != "object" || Object.values(t).forEach((i) => {
|
|
3805
3805
|
const n = i?.value;
|
|
3806
|
-
n instanceof
|
|
3807
|
-
s instanceof
|
|
3806
|
+
n instanceof De ? e.add(n) : Array.isArray(n) && n.forEach((s) => {
|
|
3807
|
+
s instanceof De && e.add(s);
|
|
3808
3808
|
});
|
|
3809
3809
|
});
|
|
3810
3810
|
}
|
|
@@ -3812,13 +3812,13 @@ function Ti(a, e) {
|
|
|
3812
3812
|
[a?.geometry, ...Array.isArray(a?.geometrys) ? a.geometrys : []].forEach((n) => {
|
|
3813
3813
|
n instanceof ae && e.geometries.add(n);
|
|
3814
3814
|
}), (Array.isArray(a?.material) ? a.material : [a?.material]).forEach((n) => {
|
|
3815
|
-
n instanceof At && (e.materials.add(n),
|
|
3815
|
+
n instanceof At && (e.materials.add(n), ks(n, e.textures));
|
|
3816
3816
|
});
|
|
3817
3817
|
}
|
|
3818
3818
|
function Ve(a, e) {
|
|
3819
3819
|
a instanceof it && a.traverse((t) => e.add(t));
|
|
3820
3820
|
}
|
|
3821
|
-
function
|
|
3821
|
+
function Ls(a, e) {
|
|
3822
3822
|
Ve(a?.group, e), a?.nodesMap?.forEach?.((t) => {
|
|
3823
3823
|
Ve(t?.mesh, e), Ve(t?.pickBoxMesh, e), Ve(t?.info?.mesh, e), t?.infos?.forEach?.((i) => Ve(i?.mesh, e));
|
|
3824
3824
|
}), a?.lods?.forEach?.((t) => {
|
|
@@ -3827,26 +3827,26 @@ function Ds(a, e) {
|
|
|
3827
3827
|
});
|
|
3828
3828
|
});
|
|
3829
3829
|
}
|
|
3830
|
-
function
|
|
3830
|
+
function ma(a, e, t) {
|
|
3831
3831
|
const i = /* @__PURE__ */ new Set();
|
|
3832
|
-
return Ve(a?.__modelGroupMap instanceof Map ? a.__modelGroupMap.get(e) : null, i), Ve($e(a, e), i), t.forEach((n) =>
|
|
3832
|
+
return Ve(a?.__modelGroupMap instanceof Map ? a.__modelGroupMap.get(e) : null, i), Ve($e(a, e), i), t.forEach((n) => Ls(n, i)), a?.__modelObjectIndexMap instanceof Map && a.__modelObjectIndexMap.forEach((n) => {
|
|
3833
3833
|
(n?.url === e || n?.userData?.url === e) && Ve(n, i);
|
|
3834
3834
|
}), a?.scene?.traverse?.((n) => {
|
|
3835
3835
|
(n?.url === e || n?.userData?.url === e) && Ve(n, i);
|
|
3836
3836
|
}), i;
|
|
3837
3837
|
}
|
|
3838
|
-
function
|
|
3839
|
-
const i =
|
|
3838
|
+
function ga(a, e, t) {
|
|
3839
|
+
const i = Ds();
|
|
3840
3840
|
a?.scene?.traverse?.((s) => {
|
|
3841
3841
|
t.has(s) || Ti(s, i);
|
|
3842
3842
|
}), a?.models?.forEach?.((s) => {
|
|
3843
3843
|
if (s?.url === e)
|
|
3844
3844
|
return;
|
|
3845
3845
|
const o = /* @__PURE__ */ new Set();
|
|
3846
|
-
|
|
3846
|
+
Ls(s, o), o.forEach((r) => Ti(r, i));
|
|
3847
3847
|
});
|
|
3848
3848
|
const n = a?.scene;
|
|
3849
|
-
return n?.background instanceof
|
|
3849
|
+
return n?.background instanceof De && i.textures.add(n.background), n?.environment instanceof De && i.textures.add(n.environment), [
|
|
3850
3850
|
a?.modelToolModule?.highlightMaterial,
|
|
3851
3851
|
a?.modelToolModule?.translucentMaterial,
|
|
3852
3852
|
a?.modelToolModule?.pickBoxMaterial,
|
|
@@ -3857,16 +3857,16 @@ function pa(a, e, t) {
|
|
|
3857
3857
|
a?.modelExplode?.highlightMaterial,
|
|
3858
3858
|
a?.modelExplode?.translucentMaterial
|
|
3859
3859
|
].forEach((s) => {
|
|
3860
|
-
s instanceof At && (i.materials.add(s),
|
|
3860
|
+
s instanceof At && (i.materials.add(s), ks(s, i.textures));
|
|
3861
3861
|
}), i;
|
|
3862
3862
|
}
|
|
3863
|
-
function
|
|
3863
|
+
function fa(a) {
|
|
3864
3864
|
a.forEach((e) => {
|
|
3865
3865
|
e.parent != null && !a.has(e.parent) && e.parent.remove(e);
|
|
3866
3866
|
});
|
|
3867
3867
|
}
|
|
3868
|
-
function
|
|
3869
|
-
const t =
|
|
3868
|
+
function ya(a, e) {
|
|
3869
|
+
const t = Ds();
|
|
3870
3870
|
a.forEach((i) => Ti(i, t)), t.geometries.forEach((i) => {
|
|
3871
3871
|
e.geometries.has(i) || (i.disposeBoundsTree?.(), i.dispose());
|
|
3872
3872
|
}), t.materials.forEach((i) => {
|
|
@@ -3875,7 +3875,7 @@ function ga(a, e) {
|
|
|
3875
3875
|
e.textures.has(i) || i.dispose();
|
|
3876
3876
|
});
|
|
3877
3877
|
}
|
|
3878
|
-
function
|
|
3878
|
+
function Ma(a, e, t, i) {
|
|
3879
3879
|
const n = /* @__PURE__ */ new Set();
|
|
3880
3880
|
t.forEach((o) => {
|
|
3881
3881
|
Number.isFinite(o?.index) && n.add(o.index);
|
|
@@ -3891,7 +3891,7 @@ function fa(a, e, t, i) {
|
|
|
3891
3891
|
(n.has(r) || t.has(o) || o?.url === e) && s.delete(r);
|
|
3892
3892
|
});
|
|
3893
3893
|
}
|
|
3894
|
-
function
|
|
3894
|
+
function va(a) {
|
|
3895
3895
|
a?.nodesMap?.clear?.(), a?.lods?.forEach?.((e) => {
|
|
3896
3896
|
e.glbs = [], e.instanceNodes = null, e.preparePromise = null, e.meshPromise = null, e.octreeBox = null;
|
|
3897
3897
|
}), a.group = null, a.modelEdge = null, a.modelMep = null, a.modelMapper = null, a.modelTree = null, a.quotaList = null, a.urls = [];
|
|
@@ -3903,11 +3903,11 @@ function wt(a) {
|
|
|
3903
3903
|
const e = Re(a), t = e.lastIndexOf("/");
|
|
3904
3904
|
return t >= 0 ? e.slice(t + 1) : e;
|
|
3905
3905
|
}
|
|
3906
|
-
function
|
|
3906
|
+
function pi(a) {
|
|
3907
3907
|
const e = Re(a), t = e.lastIndexOf("/");
|
|
3908
3908
|
return t >= 0 ? e.slice(0, t) : "";
|
|
3909
3909
|
}
|
|
3910
|
-
function
|
|
3910
|
+
function xa(a, e) {
|
|
3911
3911
|
try {
|
|
3912
3912
|
const t = new URL(a, window.location.origin);
|
|
3913
3913
|
return decodeURIComponent(wt(t.pathname)) || `model-package-${e + 1}.zip`;
|
|
@@ -3915,17 +3915,17 @@ function Ma(a, e) {
|
|
|
3915
3915
|
return wt(a.split("?")[0].split("#")[0]) || `model-package-${e + 1}.zip`;
|
|
3916
3916
|
}
|
|
3917
3917
|
}
|
|
3918
|
-
function
|
|
3918
|
+
function wa(a, e) {
|
|
3919
3919
|
return Re(a ? e ? `${a}/${e}` : a : e);
|
|
3920
3920
|
}
|
|
3921
3921
|
function xn(a) {
|
|
3922
|
-
return
|
|
3922
|
+
return ua.test(a);
|
|
3923
3923
|
}
|
|
3924
|
-
function
|
|
3924
|
+
function ba(a) {
|
|
3925
3925
|
return a.replace(/\.zip$/i, "").toLowerCase();
|
|
3926
3926
|
}
|
|
3927
|
-
function
|
|
3928
|
-
const e =
|
|
3927
|
+
function Ca(a) {
|
|
3928
|
+
const e = pa.exec(a);
|
|
3929
3929
|
return e == null ? null : e[1].toLowerCase();
|
|
3930
3930
|
}
|
|
3931
3931
|
async function wn(a) {
|
|
@@ -3937,7 +3937,7 @@ function bn(a, e) {
|
|
|
3937
3937
|
return t == null && (t = /* @__PURE__ */ new Map(), a.set(e, t)), t;
|
|
3938
3938
|
}
|
|
3939
3939
|
var ne = /* @__PURE__ */ ((a) => (a.ModelLoadStart = "model-load-start", a.ModelLoadProgress = "model-load-progress", a.ModelLoaded = "model-loaded", a.ModelError = "model-error", a.SelectionChanged = "selection-changed", a.HoverChanged = "hover-changed", a.Click = "click", a.MouseMove = "mouse-move", a.ModelPlaceSelected = "model-place-selected", a.ModelCalibrationChanged = "model-calibration-changed", a.CameraChanged = "camera-changed", a.CameraIdle = "camera-idle", a.ViewportResize = "viewport-resize", a.EngineFree = "engine-free", a.EngineBusy = "engine-busy", a.MeasureChanged = "measure-changed", a.SectionMove = "section-move", a.LoadingCompleted = "loading_completed", a))(ne || {});
|
|
3940
|
-
class
|
|
3940
|
+
class Ea {
|
|
3941
3941
|
engine;
|
|
3942
3942
|
isFree;
|
|
3943
3943
|
// 是否是编辑模式
|
|
@@ -3960,7 +3960,7 @@ class ba {
|
|
|
3960
3960
|
}
|
|
3961
3961
|
init() {
|
|
3962
3962
|
this.engine.renderer?.domElement?.addEventListener("contextmenu", this.handleContextMenu, !0), this.engine.events.on(ne.EngineFree, (e) => {
|
|
3963
|
-
this.updateFree(!0),
|
|
3963
|
+
this.updateFree(!0), Is(this.engine, e, !1), this.engine?.octreeBox?.requestBvhBuild?.();
|
|
3964
3964
|
}), this.engine.events.on(ne.EngineBusy, () => {
|
|
3965
3965
|
this.updateFree(!1);
|
|
3966
3966
|
});
|
|
@@ -3979,7 +3979,7 @@ class ba {
|
|
|
3979
3979
|
closeAllFunction = () => {
|
|
3980
3980
|
};
|
|
3981
3981
|
}
|
|
3982
|
-
class
|
|
3982
|
+
class Aa {
|
|
3983
3983
|
// 使用字符串作为键,以确保不同来源的 EventType 枚举值能够正确匹配
|
|
3984
3984
|
listeners = /* @__PURE__ */ new Map();
|
|
3985
3985
|
// 是否启用调试模式(可以通过外部设置)
|
|
@@ -4035,8 +4035,8 @@ class Ca {
|
|
|
4035
4035
|
});
|
|
4036
4036
|
}
|
|
4037
4037
|
}
|
|
4038
|
-
const bt = 1,
|
|
4039
|
-
class
|
|
4038
|
+
const bt = 1, mi = 1, Sa = 1800, Cn = 1024, Pa = 1.35, Ta = 20, Ia = 1200, gi = 0.5, _a = 10, Da = 0.08, fi = 500, En = 5e4, An = 120, ka = 5e4, Sn = 0.12, La = 8, Ba = 0.75, Pn = 5e-5, za = 15e-4, Ra = 2.5, Oa = 2.4, Fa = 4.5, Na = 0.94, Ha = 0.995, Va = 80, Ua = 0.06, Wa = 8, Ga = new d(-1, 4, 2).normalize();
|
|
4039
|
+
class qa {
|
|
4040
4040
|
// 引擎实例,要求至少提供 scene、controls、octreeBox 等运行时对象。
|
|
4041
4041
|
engine;
|
|
4042
4042
|
// 上一次应用到阴影相机的半边长,用于跳过无意义的小幅更新。
|
|
@@ -4067,12 +4067,12 @@ class Wa {
|
|
|
4067
4067
|
*/
|
|
4068
4068
|
init() {
|
|
4069
4069
|
const e = new Xe(16774630, 2);
|
|
4070
|
-
e.name = "directionalShadowLight", e.castShadow = !0, e.shadow.mapSize.width = Cn, e.shadow.mapSize.height = Cn, e.shadow.camera.near =
|
|
4071
|
-
const t =
|
|
4070
|
+
e.name = "directionalShadowLight", e.castShadow = !0, e.shadow.mapSize.width = Cn, e.shadow.mapSize.height = Cn, e.shadow.camera.near = gi, e.shadow.camera.far = fi, e.shadow.bias = -Pn, e.shadow.normalBias = Sn;
|
|
4071
|
+
const t = mi;
|
|
4072
4072
|
e.shadow.camera.left = -t, e.shadow.camera.right = t, e.shadow.camera.top = t, e.shadow.camera.bottom = -t, e.shadow.radius = 2, e.shadow.intensity = bt, e.target.name = "directionalShadowLightTarget";
|
|
4073
4073
|
const i = new Xe(16777215, 2);
|
|
4074
4074
|
i.name = "directionalFillLight", this.engine.scene.add(e), this.engine.scene.add(e.target), this.engine.scene.add(i), this.engine.scene.dirLight = i, this.engine.scene.dirLightShadow = e, this.engine.scene.dirLightShodow = e;
|
|
4075
|
-
const n = new
|
|
4075
|
+
const n = new Zt(16777215, 1);
|
|
4076
4076
|
this.engine.scene.add(n);
|
|
4077
4077
|
}
|
|
4078
4078
|
/**
|
|
@@ -4099,16 +4099,16 @@ class Wa {
|
|
|
4099
4099
|
}
|
|
4100
4100
|
const l = this.resolveShadowTarget(e, r), c = this.getCameraHalfExtent(e, l), h = this.getSceneShadowHalfSize(s, c), u = F.clamp(
|
|
4101
4101
|
Math.max(
|
|
4102
|
-
c *
|
|
4102
|
+
c * Pa,
|
|
4103
4103
|
h,
|
|
4104
|
-
|
|
4104
|
+
mi
|
|
4105
4105
|
),
|
|
4106
|
-
|
|
4107
|
-
|
|
4106
|
+
mi,
|
|
4107
|
+
Sa
|
|
4108
4108
|
), p = F.clamp(
|
|
4109
4109
|
Math.max(u * 2.5, o * 0.75, An),
|
|
4110
4110
|
An,
|
|
4111
|
-
|
|
4111
|
+
ka
|
|
4112
4112
|
), g = this.getLightOffsetDirection(), f = this.snapShadowTargetToTexel(
|
|
4113
4113
|
l,
|
|
4114
4114
|
g,
|
|
@@ -4141,7 +4141,7 @@ class Wa {
|
|
|
4141
4141
|
return 0;
|
|
4142
4142
|
if (t <= 0)
|
|
4143
4143
|
return e * 0.75;
|
|
4144
|
-
const i = t *
|
|
4144
|
+
const i = t * Ta;
|
|
4145
4145
|
return Math.min(e * 0.75, i);
|
|
4146
4146
|
}
|
|
4147
4147
|
/**
|
|
@@ -4153,15 +4153,15 @@ class Wa {
|
|
|
4153
4153
|
updateShadowBias(e, t, i) {
|
|
4154
4154
|
const n = Math.max(e.shadow.mapSize.width, 1), s = t * 2 / n, o = Math.max(i.far - i.near, 1);
|
|
4155
4155
|
e.shadow.normalBias = F.clamp(
|
|
4156
|
-
s *
|
|
4156
|
+
s * Ba,
|
|
4157
4157
|
Sn,
|
|
4158
|
-
|
|
4158
|
+
La
|
|
4159
4159
|
);
|
|
4160
|
-
const r = s / o *
|
|
4160
|
+
const r = s / o * Ra;
|
|
4161
4161
|
e.shadow.bias = -F.clamp(
|
|
4162
4162
|
r,
|
|
4163
4163
|
Pn,
|
|
4164
|
-
|
|
4164
|
+
za
|
|
4165
4165
|
);
|
|
4166
4166
|
}
|
|
4167
4167
|
/**
|
|
@@ -4184,9 +4184,9 @@ class Wa {
|
|
|
4184
4184
|
}
|
|
4185
4185
|
if (Number.isFinite(c) && Number.isFinite(h)) {
|
|
4186
4186
|
const u = Math.max(
|
|
4187
|
-
(h - c) *
|
|
4188
|
-
|
|
4189
|
-
), p = Math.max(
|
|
4187
|
+
(h - c) * Da,
|
|
4188
|
+
_a
|
|
4189
|
+
), p = Math.max(gi, c - u), g = F.clamp(
|
|
4190
4190
|
Math.max(p + 1, h + u),
|
|
4191
4191
|
p + 1,
|
|
4192
4192
|
En
|
|
@@ -4195,11 +4195,11 @@ class Wa {
|
|
|
4195
4195
|
}
|
|
4196
4196
|
}
|
|
4197
4197
|
const r = F.clamp(
|
|
4198
|
-
Math.max(n * 1.5, s * 4,
|
|
4199
|
-
|
|
4198
|
+
Math.max(n * 1.5, s * 4, fi),
|
|
4199
|
+
fi,
|
|
4200
4200
|
En
|
|
4201
4201
|
);
|
|
4202
|
-
return { near:
|
|
4202
|
+
return { near: gi, far: r };
|
|
4203
4203
|
}
|
|
4204
4204
|
/**
|
|
4205
4205
|
* 获取包围盒 8 个顶点。
|
|
@@ -4299,9 +4299,9 @@ class Wa {
|
|
|
4299
4299
|
const i = Math.max(e.zoom, 1e-6), n = Math.max((e.top - e.bottom) / (2 * i), 1), s = Math.max((e.right - e.left) / (2 * i), 1);
|
|
4300
4300
|
return Math.max(s, n);
|
|
4301
4301
|
}
|
|
4302
|
-
if (e instanceof
|
|
4302
|
+
if (e instanceof Qt) {
|
|
4303
4303
|
const i = this.resolveShadowTarget(e, t), n = Math.max(e.position.distanceTo(i), 1), s = F.degToRad(e.getEffectiveFOV() * 0.5), o = Math.max(Math.tan(s) * n, 1), r = o * Math.max(e.aspect, 1e-6);
|
|
4304
|
-
return Math.min(Math.max(r, o),
|
|
4304
|
+
return Math.min(Math.max(r, o), Ia);
|
|
4305
4305
|
}
|
|
4306
4306
|
return 0;
|
|
4307
4307
|
}
|
|
@@ -4328,7 +4328,7 @@ class Wa {
|
|
|
4328
4328
|
* @returns 标准化后的世界空间光源偏移方向。
|
|
4329
4329
|
*/
|
|
4330
4330
|
getLightOffsetDirection() {
|
|
4331
|
-
return
|
|
4331
|
+
return Ga.clone();
|
|
4332
4332
|
}
|
|
4333
4333
|
/**
|
|
4334
4334
|
* 根据当前视角和阴影贴图密度计算最终显示强度。
|
|
@@ -4341,8 +4341,8 @@ class Wa {
|
|
|
4341
4341
|
getShadowDisplayIntensity(e, t, i, n) {
|
|
4342
4342
|
const s = i * 2 / Math.max(n, 1), o = 1 - F.smoothstep(
|
|
4343
4343
|
s,
|
|
4344
|
-
|
|
4345
|
-
|
|
4344
|
+
Oa,
|
|
4345
|
+
Fa
|
|
4346
4346
|
);
|
|
4347
4347
|
let r = 1;
|
|
4348
4348
|
if (e) {
|
|
@@ -4351,8 +4351,8 @@ class Wa {
|
|
|
4351
4351
|
const c = Math.abs(l.dot(t.clone().normalize()));
|
|
4352
4352
|
r = 1 - F.smoothstep(
|
|
4353
4353
|
c,
|
|
4354
|
-
|
|
4355
|
-
|
|
4354
|
+
Na,
|
|
4355
|
+
Ha
|
|
4356
4356
|
);
|
|
4357
4357
|
}
|
|
4358
4358
|
return bt * Math.min(o, r);
|
|
@@ -4397,10 +4397,10 @@ class Wa {
|
|
|
4397
4397
|
if (i.isEmpty())
|
|
4398
4398
|
return;
|
|
4399
4399
|
const n = i.getSize(new d()), s = Math.max(n.x, n.z), o = Math.max(
|
|
4400
|
-
|
|
4401
|
-
s *
|
|
4400
|
+
Wa,
|
|
4401
|
+
s * Ua
|
|
4402
4402
|
);
|
|
4403
|
-
if (s >=
|
|
4403
|
+
if (s >= Va && n.y <= o) {
|
|
4404
4404
|
e.castShadow = !1, t.__lightModuleReceiverOnlyShadow = !0;
|
|
4405
4405
|
return;
|
|
4406
4406
|
}
|
|
@@ -4416,7 +4416,7 @@ class Wa {
|
|
|
4416
4416
|
i && (i.shadowSide = Ni);
|
|
4417
4417
|
}
|
|
4418
4418
|
}
|
|
4419
|
-
class
|
|
4419
|
+
class Ka {
|
|
4420
4420
|
engine;
|
|
4421
4421
|
behavior;
|
|
4422
4422
|
isCtrlDown = !1;
|
|
@@ -4742,7 +4742,7 @@ class Ga {
|
|
|
4742
4742
|
return n;
|
|
4743
4743
|
}
|
|
4744
4744
|
if (Array.isArray(t?.infos) && t.infos.length > 0) {
|
|
4745
|
-
const n =
|
|
4745
|
+
const n = Se(this.engine, e.url), s = t.infos.map((o) => o?.box).filter((o) => o instanceof R).map((o) => o.clone().applyMatrix4(n));
|
|
4746
4746
|
return this.getMergedBox(s);
|
|
4747
4747
|
}
|
|
4748
4748
|
if (Array.isArray(t?.indexes) && t.indexes.length > 0) {
|
|
@@ -4775,7 +4775,7 @@ class Ga {
|
|
|
4775
4775
|
const n = e.infos.map((o) => o?.mesh).filter((o) => o instanceof z && o.userData?.__pickBox !== !0);
|
|
4776
4776
|
if (t == null)
|
|
4777
4777
|
return n;
|
|
4778
|
-
const s =
|
|
4778
|
+
const s = Se(this.engine, t);
|
|
4779
4779
|
return n.forEach((o) => {
|
|
4780
4780
|
o.parent == null && (o.matrixAutoUpdate = !1, o.matrix.copy(s), o.matrixWorld.copy(s), o.matrixWorldNeedsUpdate = !1);
|
|
4781
4781
|
}), n;
|
|
@@ -4841,7 +4841,7 @@ class Ga {
|
|
|
4841
4841
|
return e.forEach((i) => t.union(i)), t.isEmpty() ? null : t;
|
|
4842
4842
|
}
|
|
4843
4843
|
getSceneModel(e) {
|
|
4844
|
-
return
|
|
4844
|
+
return _e(this.engine, e);
|
|
4845
4845
|
}
|
|
4846
4846
|
/** 从射线命中的对象还原真实构件 ID,兼容炸开代理和普通模型对象。 */
|
|
4847
4847
|
getHitModelId(e) {
|
|
@@ -4851,7 +4851,7 @@ class Ga {
|
|
|
4851
4851
|
return e?.nodesMap?.get(t) ?? e?.nodesMap?.get(Number(t)) ?? e?.nodesMap?.get(String(t));
|
|
4852
4852
|
}
|
|
4853
4853
|
}
|
|
4854
|
-
class
|
|
4854
|
+
class ja {
|
|
4855
4855
|
engine;
|
|
4856
4856
|
highlightMaterial;
|
|
4857
4857
|
translucentMaterial;
|
|
@@ -4908,7 +4908,7 @@ class qa {
|
|
|
4908
4908
|
const r = ot(this.engine, o.url);
|
|
4909
4909
|
o.nodesMap.forEach((l, c) => {
|
|
4910
4910
|
const h = String(l?.name ?? l?.info?.name ?? l?.infos?.[0]?.name ?? "");
|
|
4911
|
-
if (!i.some((m) => h.includes(m)) || l?.pickBoxMesh instanceof z || l?.indexes?.some((m) =>
|
|
4911
|
+
if (!i.some((m) => h.includes(m)) || l?.pickBoxMesh instanceof z || l?.indexes?.some((m) => _e(this.engine, m?.[0]) instanceof V))
|
|
4912
4912
|
return;
|
|
4913
4913
|
const p = this.getNodeLocalBox(l);
|
|
4914
4914
|
if (p == null)
|
|
@@ -5049,7 +5049,7 @@ class qa {
|
|
|
5049
5049
|
}
|
|
5050
5050
|
// 获取场景中的所有模型
|
|
5051
5051
|
getSceneModel(e) {
|
|
5052
|
-
return
|
|
5052
|
+
return _e(this.engine, e);
|
|
5053
5053
|
}
|
|
5054
5054
|
/** 炸开模式下,原模型状态变化后需要同步到代理构件,保证交互语义一致。 */
|
|
5055
5055
|
syncExplodeVisualState() {
|
|
@@ -5067,7 +5067,7 @@ class qa {
|
|
|
5067
5067
|
const s = this.getEngineModelByUrl(n.url);
|
|
5068
5068
|
if (s?.nodesMap == null)
|
|
5069
5069
|
return;
|
|
5070
|
-
const o =
|
|
5070
|
+
const o = Se(this.engine, n.url);
|
|
5071
5071
|
n.ids.forEach((r) => {
|
|
5072
5072
|
const l = s.nodesMap.get(r);
|
|
5073
5073
|
[
|
|
@@ -5123,7 +5123,7 @@ class qa {
|
|
|
5123
5123
|
const u = this.getSceneModel(h[0]);
|
|
5124
5124
|
u instanceof V ? o.has(h[0]) ? o.get(h[0])?.push(h[1]) : o.set(h[0], [h[1]]) : this.setSplitComponentState(u, h[1], 1, !0);
|
|
5125
5125
|
});
|
|
5126
|
-
}),
|
|
5126
|
+
}), Ya(o, this.engine);
|
|
5127
5127
|
let r = this.engine.engineStatus.highlightModels.find((l) => l.url == t.url);
|
|
5128
5128
|
r != null ? (Array.isArray(r.guids) || (r.guids = this.getModelGuids(i, r.ids)), n.forEach((l, c) => {
|
|
5129
5129
|
const h = r.ids.indexOf(l);
|
|
@@ -5177,7 +5177,7 @@ class qa {
|
|
|
5177
5177
|
const c = this.getSceneModel(l[0]);
|
|
5178
5178
|
c instanceof V ? n.has(l[0]) ? n.get(l[0])?.push(l[1]) : n.set(l[0], [l[1]]) : this.setSplitComponentState(c, l[1], -1, !1);
|
|
5179
5179
|
});
|
|
5180
|
-
}), n.size > 0 &&
|
|
5180
|
+
}), n.size > 0 && Qa(n, this.engine);
|
|
5181
5181
|
let s = this.engine.engineStatus.hideModels.find((o) => o.url == t.url);
|
|
5182
5182
|
s != null ? this.appendUniqueIds(s.ids, t.ids) : this.engine.engineStatus.hideModels.push({
|
|
5183
5183
|
url: t.url,
|
|
@@ -5529,7 +5529,7 @@ class qa {
|
|
|
5529
5529
|
const u = this.getSceneModel(h[0]);
|
|
5530
5530
|
u instanceof V ? o.has(h[0]) ? o.get(h[0])?.push(h[1]) : o.set(h[0], [h[1]]) : this.setSplitComponentState(u, h[1], 2, !0);
|
|
5531
5531
|
});
|
|
5532
|
-
}),
|
|
5532
|
+
}), Xa(o, this.engine, i);
|
|
5533
5533
|
let r = this.engine.engineStatus.translucentModels.find((l) => l.url == n.url);
|
|
5534
5534
|
r != null ? r.ids.push(...n.ids) : this.engine.engineStatus.translucentModels.push({
|
|
5535
5535
|
url: n.url,
|
|
@@ -5603,7 +5603,7 @@ class qa {
|
|
|
5603
5603
|
}
|
|
5604
5604
|
// ***************************************************** 设置模型颜色 ***************************************************** //
|
|
5605
5605
|
}
|
|
5606
|
-
function
|
|
5606
|
+
function Ya(a, e) {
|
|
5607
5607
|
a.forEach((t, i) => {
|
|
5608
5608
|
const n = Rt(e, i);
|
|
5609
5609
|
if (!(n instanceof V))
|
|
@@ -5654,11 +5654,11 @@ function Tn(a, e, t) {
|
|
|
5654
5654
|
e.scene.traverse((r) => {
|
|
5655
5655
|
r.key == n && r.name == t && o.push(r);
|
|
5656
5656
|
}), o.forEach((r) => {
|
|
5657
|
-
|
|
5657
|
+
Bs(r);
|
|
5658
5658
|
});
|
|
5659
5659
|
});
|
|
5660
5660
|
}
|
|
5661
|
-
function
|
|
5661
|
+
function Xa(a, e, t = 0.05) {
|
|
5662
5662
|
a.forEach((i, n) => {
|
|
5663
5663
|
const s = Rt(e, n);
|
|
5664
5664
|
if (!(s instanceof V))
|
|
@@ -5685,12 +5685,12 @@ function ja(a, e, t = 0.05) {
|
|
|
5685
5685
|
}), s.instanceMatrix.needsUpdate = !0, l.instanceMatrix.needsUpdate = !0, (s.parent ?? e.scene).add(l);
|
|
5686
5686
|
});
|
|
5687
5687
|
}
|
|
5688
|
-
function
|
|
5688
|
+
function Qa(a, e) {
|
|
5689
5689
|
const t = [];
|
|
5690
5690
|
e.scene.traverse((i) => {
|
|
5691
5691
|
i.name == "highlightModel" && t.push(i);
|
|
5692
5692
|
}), t.forEach((i) => {
|
|
5693
|
-
|
|
5693
|
+
Bs(i);
|
|
5694
5694
|
}), a.forEach((i, n) => {
|
|
5695
5695
|
const s = Rt(e, n);
|
|
5696
5696
|
if (!(s instanceof V))
|
|
@@ -5725,17 +5725,17 @@ function Bt(a, e, t) {
|
|
|
5725
5725
|
function zt(a, e) {
|
|
5726
5726
|
a?.cloneModel != null && (a.cloneModel.visible = e);
|
|
5727
5727
|
}
|
|
5728
|
-
function
|
|
5728
|
+
function Bs(a) {
|
|
5729
5729
|
if (a == null)
|
|
5730
5730
|
return;
|
|
5731
5731
|
const e = a.parent;
|
|
5732
5732
|
e?.remove(a), a.material?.dispose != null && a.material.dispose();
|
|
5733
5733
|
}
|
|
5734
5734
|
function Rt(a, e) {
|
|
5735
|
-
return
|
|
5735
|
+
return _e(a, e);
|
|
5736
5736
|
}
|
|
5737
|
-
const
|
|
5738
|
-
class
|
|
5737
|
+
const zs = "advanced";
|
|
5738
|
+
class $a {
|
|
5739
5739
|
engine;
|
|
5740
5740
|
currentMode = "";
|
|
5741
5741
|
// 是否为手动设置(手动设置时,自动适配不再生效)
|
|
@@ -5753,7 +5753,7 @@ class Xa {
|
|
|
5753
5753
|
* 初始化模块
|
|
5754
5754
|
*/
|
|
5755
5755
|
init() {
|
|
5756
|
-
this.cachePassReferences(), this.autoSwitch(
|
|
5756
|
+
this.cachePassReferences(), this.autoSwitch(zs);
|
|
5757
5757
|
}
|
|
5758
5758
|
/**
|
|
5759
5759
|
* 手动切换渲染模式(用户调用),锁定自动适配
|
|
@@ -5920,7 +5920,7 @@ class Xa {
|
|
|
5920
5920
|
this.gtaoPass && (this.gtaoPass.blendIntensity = e);
|
|
5921
5921
|
}
|
|
5922
5922
|
}
|
|
5923
|
-
class
|
|
5923
|
+
class si {
|
|
5924
5924
|
engine;
|
|
5925
5925
|
overlayMaterial;
|
|
5926
5926
|
overlayMeshes = [];
|
|
@@ -5959,7 +5959,7 @@ class ni {
|
|
|
5959
5959
|
color: 16777215,
|
|
5960
5960
|
transparent: !0,
|
|
5961
5961
|
opacity: 0,
|
|
5962
|
-
blending:
|
|
5962
|
+
blending: co,
|
|
5963
5963
|
depthWrite: !1
|
|
5964
5964
|
}), this.overlayMaterial.clippingPlanes = this.engine.sectionPlane;
|
|
5965
5965
|
}
|
|
@@ -5998,10 +5998,10 @@ class ni {
|
|
|
5998
5998
|
if (this.animState === "idle" || this.overlayMeshes.length === 0) return;
|
|
5999
5999
|
const e = performance.now() - this.animStartTime, t = this.overlayMaterial.userData.targetOpacity ?? 0.35;
|
|
6000
6000
|
if (this.animState === "fadeIn") {
|
|
6001
|
-
const i = Math.min(e /
|
|
6001
|
+
const i = Math.min(e / si.FADE_IN_MS, 1);
|
|
6002
6002
|
this.overlayMaterial.opacity = this.easeOutQuad(i) * t, i >= 1 && (this.animState = "idle", this.setAnimationFrameRateExempt(!1));
|
|
6003
6003
|
} else if (this.animState === "fadeOut") {
|
|
6004
|
-
const i = Math.min(e /
|
|
6004
|
+
const i = Math.min(e / si.FADE_OUT_MS, 1);
|
|
6005
6005
|
this.overlayMaterial.opacity = (1 - this.easeOutQuad(i)) * t, i >= 1 && (this.removeOverlayMeshes(), this.animState = "idle", this.setAnimationFrameRateExempt(!1));
|
|
6006
6006
|
}
|
|
6007
6007
|
}
|
|
@@ -6024,10 +6024,10 @@ class ni {
|
|
|
6024
6024
|
this.setAnimationFrameRateExempt(!1), this.removeOverlayMeshes(), this.overlayMaterial.dispose(), this.tagDiv?.remove?.(), this.tagDiv = null, this.animState = "idle";
|
|
6025
6025
|
}
|
|
6026
6026
|
}
|
|
6027
|
-
function
|
|
6027
|
+
function Za() {
|
|
6028
6028
|
return new Bi();
|
|
6029
6029
|
}
|
|
6030
|
-
function
|
|
6030
|
+
function Ja(a, e) {
|
|
6031
6031
|
a.appendChild(e.domElement);
|
|
6032
6032
|
}
|
|
6033
6033
|
const Je = {
|
|
@@ -6039,7 +6039,7 @@ const Je = {
|
|
|
6039
6039
|
front: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAABp0lEQVR4nO3ZwWnDQBBA0XFwM9uA23FtbkcNqByngxCCzQb/985CzOEzaFeXmXkOWdeZmfM8d8/BBmut+do9BHsJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAogTQJwA4gQQJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAoi77h7gne73+xzH8bL33W63eTweL3vff2ADxAkgTgBxAogTQNxHnwJ+8olf9H9hA8QJIE4AcQKIE0CcAOIEECeAOAHEZW8Cj+OYtdavn//Um0MbIE4AcQKIE0CcAOKyp4CZmfM8d4+wnQ0QJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiLvMzNNv0aa1lg1QJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAogTQJwA4gQQJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxF1m5rl7CPb5Bhi1Gm3j3a/lAAAAAElFTkSuQmCC",
|
|
6040
6040
|
back: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAADuklEQVR4nO3dMUvjYADG8cfjlsxugkRBkAwuog5+gJKAk1un4iLZbAQds+nioG7FzamDH0BXN4ngKg6i0k0IuEhGbzlFvCY1veR97/I8vzURnuFPkzYBJwC8QWj9BIDb21vbO8QCz/Pww/YIsUsBkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAC5n7YHVK3T6SBJkrH/fmVlBe12GwDg+35Vs/5ZjQvgbyVJ8hFQFEUIwxDr6+uYnp62vKweugSM0Ov10Gq1cHFxYXtKLRTAN0VRhLOzM9szKqcASojjGDc3N7ZnVEoBlHR8fGx7QqXobgKH/XucLMtweXmJfr8/8htEkiQYDAaNuSnUJwAAx3Hg+z5OT08/vgIWeXx8rH+UIQrgi52dHbiua3uGMQrgC8dxsLq6anuGMQpgDDMzM7YnVEYBDPHy8pJ7zHXdxtwAAgrgD3d3dzg/P8893u12zY0xQAF8kqYp9vf3c48HQdC4B0R0vwMMk6Yprq+vEUVR7jlBEGBvb8/gKjPoAvA8r/TfhGGIra2tGtbYRxdAGWEYwvd9zM/P255SG90DFJiamsLDw4PtGbVSAAXiOEYURfA8r5GPggEF8G1xHKPT6SBNU9tTKqUASkiSBNvb28iyzPaUytDdBA57HAx8/5FwkiQ4OTlpzLcCfQL89vmR8O7ubuG5vV4Pg8HA0LJ6KYAhNjY2EARB4TlXV1eG1tRLAeRotVqFx/MuJf8bBZBjdna28Pj9/b2hJfVSADleX19tTzBCAeR4fn4uPD45OWloSb0UwBBZlqHf7xees7CwYGhNvRTAEAcHByNfD5+bmzO0pl50PwTleX8n4OjoCE9PT4Xnuq6LpaUlQ8vqRRfAOO8DfNXtduE4TgVr7NMloKSmvRamAEpo4mthdJeAcYVhiM3NzcZ89L9TACO0222sra1hcXHR9pRaKIAhDg8PAQDLy8uN+cEnzwSAt6Y82JByPM/TTSA7BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkJsA8GZ7hNjzC2Yhv7BCBMu8AAAAAElFTkSuQmCC"
|
|
6041
6041
|
};
|
|
6042
|
-
function
|
|
6042
|
+
function el(a, e, t) {
|
|
6043
6043
|
var i = new Object();
|
|
6044
6044
|
i.visible = !0;
|
|
6045
6045
|
let n = null, s = 0, o, r, l = [];
|
|
@@ -6131,7 +6131,7 @@ function Za(a, e, t) {
|
|
|
6131
6131
|
return _;
|
|
6132
6132
|
}, i.ReductionCameraPose = function(w, y = 1e3, E) {
|
|
6133
6133
|
p();
|
|
6134
|
-
var _ = new
|
|
6134
|
+
var _ = new Ie(
|
|
6135
6135
|
w.quaternion._x,
|
|
6136
6136
|
w.quaternion._y,
|
|
6137
6137
|
w.quaternion._z,
|
|
@@ -6178,8 +6178,8 @@ function Za(a, e, t) {
|
|
|
6178
6178
|
);
|
|
6179
6179
|
}, i.zoomToBox = function(w, y = 1e3) {
|
|
6180
6180
|
if (p(), e.camera.isOrthographicCamera) {
|
|
6181
|
-
let
|
|
6182
|
-
n = requestAnimationFrame(
|
|
6181
|
+
let ri = function() {
|
|
6182
|
+
n = requestAnimationFrame(ri), He.update();
|
|
6183
6183
|
};
|
|
6184
6184
|
var E = w.min.clone().add(w.max.clone()).multiplyScalar(0.5), _ = e.camera.position.clone().sub(a.controls.target.clone()).normalize(), D = e.camera.position.distanceTo(a.controls.target), T = E.clone().add(_.multiplyScalar(D)), N = e.camera.zoom, G = new d(1, 0, 0).applyQuaternion(e.camera.quaternion), q = new d(0, 1, 0).applyQuaternion(e.camera.quaternion), j = [
|
|
6185
6185
|
new d(w.min.x, w.min.y, w.min.z),
|
|
@@ -6222,11 +6222,11 @@ function Za(a, e, t) {
|
|
|
6222
6222
|
return;
|
|
6223
6223
|
}
|
|
6224
6224
|
a.controls.auto = !1, i.RenderScene(), cancelAnimationFrame(n), n = null, f();
|
|
6225
|
-
}), He.easing(et.Easing.Cubic.InOut), g(), He.start(),
|
|
6225
|
+
}), He.easing(et.Easing.Cubic.InOut), g(), He.start(), ri();
|
|
6226
6226
|
} else {
|
|
6227
6227
|
var E = w.min.clone().add(w.max.clone()).multiplyScalar(0.5);
|
|
6228
|
-
let
|
|
6229
|
-
var T = E.clone().add(
|
|
6228
|
+
let Xs = e.camera.position.clone().sub(a.controls.target.clone()).normalize();
|
|
6229
|
+
var T = E.clone().add(Xs.multiplyScalar(2 * w.max.distanceTo(w.min)));
|
|
6230
6230
|
P(e.camera.position, T, a.controls.target.clone(), E, null, null, y);
|
|
6231
6231
|
}
|
|
6232
6232
|
};
|
|
@@ -6339,7 +6339,7 @@ function Za(a, e, t) {
|
|
|
6339
6339
|
}
|
|
6340
6340
|
}
|
|
6341
6341
|
function k() {
|
|
6342
|
-
i.sceneOrtho =
|
|
6342
|
+
i.sceneOrtho = Za();
|
|
6343
6343
|
var E = t.clientWidth, _ = t.clientWidth, w = E > _ ? E / _ : _ / E, y = 300;
|
|
6344
6344
|
i.camera = new Be(
|
|
6345
6345
|
y * w / -2,
|
|
@@ -6353,8 +6353,8 @@ function Za(a, e, t) {
|
|
|
6353
6353
|
alpha: !0
|
|
6354
6354
|
});
|
|
6355
6355
|
D.setSize(E, _), D.setClearAlpha(0), i.sceneOrtho.renderer = D;
|
|
6356
|
-
let T = new
|
|
6357
|
-
i.sceneOrtho.add(T),
|
|
6356
|
+
let T = new Zt(16777215, 0.8);
|
|
6357
|
+
i.sceneOrtho.add(T), Ja(o, D), i.orbitControls = new ls(a, i.camera, o), i.orbitControls.enableZoom = !1, i.orbitControls.enablePan = !1, i.orbitControls.enableDamping = !0, i.orbitControls.dampingFactor = 0.1, i.orbitControls.rotateSpeed = 0.5, i.orbitControls.addEventListener("start", K), i.orbitControls.addEventListener("change", te), i.orbitControls.addEventListener("end", Q);
|
|
6358
6358
|
}
|
|
6359
6359
|
let O = !1;
|
|
6360
6360
|
function K() {
|
|
@@ -6625,13 +6625,13 @@ function Za(a, e, t) {
|
|
|
6625
6625
|
point: new d(y, 0, -y)
|
|
6626
6626
|
}
|
|
6627
6627
|
], T = 0; T < E.length; T++)
|
|
6628
|
-
l.push(
|
|
6628
|
+
l.push(Pe(E[T]));
|
|
6629
6629
|
for (var T = 0; T < _.length; T++)
|
|
6630
|
-
l.push(
|
|
6630
|
+
l.push(Pe(_[T]));
|
|
6631
6631
|
for (var T = 0; T < D.length; T++)
|
|
6632
|
-
l.push(
|
|
6632
|
+
l.push(Pe(D[T]));
|
|
6633
6633
|
}
|
|
6634
|
-
function
|
|
6634
|
+
function Pe(w) {
|
|
6635
6635
|
const y = new St(w.a, w.b, w.c), E = new oe({
|
|
6636
6636
|
color: "blue",
|
|
6637
6637
|
transparent: !0,
|
|
@@ -6659,7 +6659,7 @@ function Za(a, e, t) {
|
|
|
6659
6659
|
!document.fullscreenElement && !document.webkitFullscreenElement && !document.mozFullScreenElement && !document.msFullscreenElement ? (w.requestFullscreen ? w.requestFullscreen() : w.webkitRequestFullscreen ? w.webkitRequestFullscreen() : w.mozRequestFullScreen ? w.mozRequestFullScreen() : w.msRequestFullscreen && w.msRequestFullscreen(), console.log("已进入全屏模式")) : (document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.msExitFullscreen && document.msExitFullscreen(), console.log("已退出全屏模式"));
|
|
6660
6660
|
}, i;
|
|
6661
6661
|
}
|
|
6662
|
-
class
|
|
6662
|
+
class tl {
|
|
6663
6663
|
engine;
|
|
6664
6664
|
cubeTool;
|
|
6665
6665
|
mainViewPort;
|
|
@@ -6667,7 +6667,7 @@ class Ja {
|
|
|
6667
6667
|
this.engine = e;
|
|
6668
6668
|
}
|
|
6669
6669
|
init() {
|
|
6670
|
-
this.cubeTool =
|
|
6670
|
+
this.cubeTool = el(this.engine, this.engine.scene, this.engine.container), this.cubeTool.init();
|
|
6671
6671
|
}
|
|
6672
6672
|
// 隐藏视图立方体,供 showViewCube=false 的初始化配置调用。
|
|
6673
6673
|
hide() {
|
|
@@ -6717,7 +6717,7 @@ class Ja {
|
|
|
6717
6717
|
const s = this.engine.models?.find((r) => r.url === n.url);
|
|
6718
6718
|
if (s?.nodesMap == null)
|
|
6719
6719
|
return;
|
|
6720
|
-
const o =
|
|
6720
|
+
const o = Se(this.engine, n.url);
|
|
6721
6721
|
n.ids.forEach((r) => {
|
|
6722
6722
|
const l = s.nodesMap.get(r);
|
|
6723
6723
|
[
|
|
@@ -6787,7 +6787,7 @@ class Ja {
|
|
|
6787
6787
|
this.cubeTool.TakeScreenshot();
|
|
6788
6788
|
}
|
|
6789
6789
|
}
|
|
6790
|
-
function
|
|
6790
|
+
function il(a) {
|
|
6791
6791
|
let e = new Object(), t = null;
|
|
6792
6792
|
return e.getBoundingBox = function() {
|
|
6793
6793
|
let i = a.models, n = new d(1e8, 1e9, 1e10), s = new d(-1e8, -1e9, -1e10);
|
|
@@ -6833,24 +6833,24 @@ function el(a) {
|
|
|
6833
6833
|
}, e.clearSelectableScope = function() {
|
|
6834
6834
|
t = null;
|
|
6835
6835
|
}, e.rayInterationModel = function(i, n, s = !0, o = !0) {
|
|
6836
|
-
const l = [], c = /* @__PURE__ */ new Set(), h = new d(), u = a.clipping, p = Array.isArray(a.models) ? a.models : [], g = new Map(p.map((y) => [y.url, y])), f =
|
|
6836
|
+
const l = [], c = /* @__PURE__ */ new Set(), h = new d(), u = a.clipping, p = Array.isArray(a.models) ? a.models : [], g = new Map(p.map((y) => [y.url, y])), f = Pe(a.engineStatus.hideModels), M = Pe(a.engineStatus.translucentModels), x = a.modelExplode?.raycast?.(i) ?? [];
|
|
6837
6837
|
p.forEach((y) => {
|
|
6838
6838
|
const E = g.get(y.url);
|
|
6839
6839
|
if (E == null)
|
|
6840
6840
|
return;
|
|
6841
|
-
const _ =
|
|
6841
|
+
const _ = Se(a, y.url);
|
|
6842
6842
|
(y.lods ?? []).forEach((D) => {
|
|
6843
6843
|
let T = D.octreeBox;
|
|
6844
6844
|
C(i, T, y, E, _);
|
|
6845
6845
|
});
|
|
6846
6846
|
});
|
|
6847
6847
|
const m = l.map((y) => O(y)).filter((y) => y instanceof z);
|
|
6848
|
-
|
|
6848
|
+
xr(i);
|
|
6849
6849
|
const b = [
|
|
6850
6850
|
...x,
|
|
6851
6851
|
...i.intersectObjects(m, !1).map(he)
|
|
6852
6852
|
].sort((y, E) => y.distance - E.distance);
|
|
6853
|
-
return
|
|
6853
|
+
return wr(i), b;
|
|
6854
6854
|
function C(y, E, _, D, T) {
|
|
6855
6855
|
if (E == null)
|
|
6856
6856
|
return;
|
|
@@ -6914,7 +6914,7 @@ function el(a) {
|
|
|
6914
6914
|
}), k());
|
|
6915
6915
|
}
|
|
6916
6916
|
function P(y, E, _, D, T) {
|
|
6917
|
-
if (!Array.isArray(E) || E.length < 2 || !(
|
|
6917
|
+
if (!Array.isArray(E) || E.length < 2 || !(_e(a, E[0]) instanceof V))
|
|
6918
6918
|
return;
|
|
6919
6919
|
const G = `instance:${E[0]}:${E[1]}`;
|
|
6920
6920
|
c.has(G) || (c.add(G), l.push({
|
|
@@ -6928,7 +6928,7 @@ function el(a) {
|
|
|
6928
6928
|
}), k());
|
|
6929
6929
|
}
|
|
6930
6930
|
function L(y) {
|
|
6931
|
-
return Array.isArray(y) ? y.filter((E) => Array.isArray(E) &&
|
|
6931
|
+
return Array.isArray(y) ? y.filter((E) => Array.isArray(E) && _e(a, E[0]) instanceof V) : [];
|
|
6932
6932
|
}
|
|
6933
6933
|
function k() {
|
|
6934
6934
|
if (l.sort((y, E) => y.distanceSq - E.distanceSq), l.length > 20) {
|
|
@@ -6942,7 +6942,7 @@ function el(a) {
|
|
|
6942
6942
|
function K(y, E, _, D) {
|
|
6943
6943
|
if (!Array.isArray(E) || E.length < 2 || y == null)
|
|
6944
6944
|
return null;
|
|
6945
|
-
const T =
|
|
6945
|
+
const T = _e(a, E[0]);
|
|
6946
6946
|
if (!(T instanceof V) || T.geometry == null)
|
|
6947
6947
|
return null;
|
|
6948
6948
|
const N = E[1], G = Q(T, N);
|
|
@@ -6962,7 +6962,7 @@ function el(a) {
|
|
|
6962
6962
|
function te(y, E, _) {
|
|
6963
6963
|
if (y?.info?.box instanceof R)
|
|
6964
6964
|
return y.info.box.clone().applyMatrix4(E);
|
|
6965
|
-
const D =
|
|
6965
|
+
const D = _e(a, _?.[0]);
|
|
6966
6966
|
if (!(D instanceof V) || D.geometry == null)
|
|
6967
6967
|
return null;
|
|
6968
6968
|
D.geometry.boundingBox == null && D.geometry.computeBoundingBox();
|
|
@@ -7002,7 +7002,7 @@ function el(a) {
|
|
|
7002
7002
|
function ye(y, E) {
|
|
7003
7003
|
return t == null ? !0 : t.get(y)?.has(E) === !0;
|
|
7004
7004
|
}
|
|
7005
|
-
function
|
|
7005
|
+
function Pe(y) {
|
|
7006
7006
|
const E = /* @__PURE__ */ new Map();
|
|
7007
7007
|
return y?.forEach((_) => {
|
|
7008
7008
|
Array.isArray(_.ids) && E.set(_.url, new Set(_.ids));
|
|
@@ -7013,7 +7013,7 @@ function el(a) {
|
|
|
7013
7013
|
}
|
|
7014
7014
|
}, e;
|
|
7015
7015
|
}
|
|
7016
|
-
class
|
|
7016
|
+
class nl {
|
|
7017
7017
|
engine;
|
|
7018
7018
|
// 绘制状态
|
|
7019
7019
|
isDrawing = !1;
|
|
@@ -7171,7 +7171,7 @@ class tl {
|
|
|
7171
7171
|
const s = new d();
|
|
7172
7172
|
e.getSize(s);
|
|
7173
7173
|
const o = Math.max(s.x, s.y, s.z);
|
|
7174
|
-
if (t instanceof
|
|
7174
|
+
if (t instanceof Qt) {
|
|
7175
7175
|
const r = t.fov * (Math.PI / 180), c = o / (2 * Math.tan(r / 2)) * 1.2, h = new d();
|
|
7176
7176
|
t.getWorldDirection(h);
|
|
7177
7177
|
const u = n.clone().sub(t.position);
|
|
@@ -7191,8 +7191,8 @@ class tl {
|
|
|
7191
7191
|
this.disActive(), this.selectionBox?.remove(), this.selectionBox = null, this.worldToScreen = null, this.isDrawing = !1;
|
|
7192
7192
|
}
|
|
7193
7193
|
}
|
|
7194
|
-
const
|
|
7195
|
-
class
|
|
7194
|
+
const sl = F.degToRad(10), _n = 1e-3, Ii = !1, ol = [];
|
|
7195
|
+
class rl {
|
|
7196
7196
|
engine;
|
|
7197
7197
|
rootGroup = null;
|
|
7198
7198
|
isVisible = Ii;
|
|
@@ -7206,7 +7206,7 @@ class sl {
|
|
|
7206
7206
|
}
|
|
7207
7207
|
setMockData() {
|
|
7208
7208
|
const e = this.engine.models?.[0]?.grids;
|
|
7209
|
-
this.setData(Array.isArray(e) && e.length > 0 ? e :
|
|
7209
|
+
this.setData(Array.isArray(e) && e.length > 0 ? e : ol);
|
|
7210
7210
|
}
|
|
7211
7211
|
show() {
|
|
7212
7212
|
this.isVisible = !0, this.rootGroup && (this.rootGroup.visible = !0);
|
|
@@ -7295,7 +7295,7 @@ class sl {
|
|
|
7295
7295
|
throw new Error("Grid sprite canvas context is not available");
|
|
7296
7296
|
const o = 128 / 2, r = 128 / 2, l = 128 / 2 - 4;
|
|
7297
7297
|
s.beginPath(), s.arc(o, r, l, 0, Math.PI * 2), s.fillStyle = "white", s.fill(), s.strokeStyle = "#1890ff", s.lineWidth = 6, s.stroke(), s.fillStyle = "#1890ff", s.font = `bold ${Math.round(128 * 0.38)}px Arial`, s.textAlign = "center", s.textBaseline = "middle", s.fillText(e, o, r);
|
|
7298
|
-
const c = new
|
|
7298
|
+
const c = new ho(n), h = new uo({
|
|
7299
7299
|
map: c,
|
|
7300
7300
|
depthTest: !1,
|
|
7301
7301
|
transparent: !0
|
|
@@ -7345,7 +7345,7 @@ class sl {
|
|
|
7345
7345
|
const n = this.createProjection(i);
|
|
7346
7346
|
if (!n)
|
|
7347
7347
|
return;
|
|
7348
|
-
const s = t.find((o) => o.direction.angleTo(n.direction) <=
|
|
7348
|
+
const s = t.find((o) => o.direction.angleTo(n.direction) <= sl);
|
|
7349
7349
|
if (s) {
|
|
7350
7350
|
s.axes.push(n);
|
|
7351
7351
|
return;
|
|
@@ -7480,15 +7480,15 @@ class sl {
|
|
|
7480
7480
|
return e instanceof d ? e.clone() : new d(e.x, e.y, e.z);
|
|
7481
7481
|
}
|
|
7482
7482
|
}
|
|
7483
|
-
const
|
|
7483
|
+
const Rs = "0", Os = 0, Fs = !0;
|
|
7484
7484
|
class ji {
|
|
7485
7485
|
engine;
|
|
7486
|
-
currentId =
|
|
7486
|
+
currentId = Rs;
|
|
7487
7487
|
groundGroup;
|
|
7488
7488
|
groundMesh = null;
|
|
7489
7489
|
/** 当前为官方 Water 水面时为 true,用于 update/dispose 分支 */
|
|
7490
7490
|
isWaterAddon = !1;
|
|
7491
|
-
groundY =
|
|
7491
|
+
groundY = Os;
|
|
7492
7492
|
/** 默认水面法线贴图路径(项目内为 public/textture/waternormals.jpg) */
|
|
7493
7493
|
static DEFAULT_WATER_NORMALS = "/texture/waternormals.jpg";
|
|
7494
7494
|
groundList = [
|
|
@@ -7513,7 +7513,7 @@ class ji {
|
|
|
7513
7513
|
this.engine = e, this.groundGroup = new me(), this.groundGroup.name = "groundGroup";
|
|
7514
7514
|
}
|
|
7515
7515
|
init() {
|
|
7516
|
-
this.engine.scene.add(this.groundGroup), this.groundGroup.visible =
|
|
7516
|
+
this.engine.scene.add(this.groundGroup), this.groundGroup.visible = Fs;
|
|
7517
7517
|
}
|
|
7518
7518
|
/**
|
|
7519
7519
|
* 切换地面类型
|
|
@@ -7527,7 +7527,7 @@ class ji {
|
|
|
7527
7527
|
if (i.water) {
|
|
7528
7528
|
const s = new Ei(n, n), o = t?.waterNormalsUrl ?? ee(ji.DEFAULT_WATER_NORMALS, import.meta.url), r = new nt().load(o, (g) => {
|
|
7529
7529
|
g.wrapS = g.wrapT = pt;
|
|
7530
|
-
}), l = t?.sunDirection ?? new d(0.5, 0.8, 0.5).normalize(), c = t?.distortionScale ?? i.distortionScale ?? 3.7, h = t?.waterSize ?? i.size ?? 1, u = t?.opacity ?? 0.92, p = new
|
|
7530
|
+
}), l = t?.sunDirection ?? new d(0.5, 0.8, 0.5).normalize(), c = t?.distortionScale ?? i.distortionScale ?? 3.7, h = t?.waterSize ?? i.size ?? 1, u = t?.opacity ?? 0.92, p = new po(s, {
|
|
7531
7531
|
textureWidth: 512,
|
|
7532
7532
|
textureHeight: 512,
|
|
7533
7533
|
waterNormals: r,
|
|
@@ -7620,12 +7620,12 @@ class ji {
|
|
|
7620
7620
|
Array.isArray(t) ? t.forEach((i) => i.dispose()) : t.dispose(), this.groundGroup.remove(this.groundMesh), this.groundMesh = null, this.isWaterAddon = !1;
|
|
7621
7621
|
}
|
|
7622
7622
|
}
|
|
7623
|
-
const Ue = "0",
|
|
7624
|
-
class
|
|
7623
|
+
const Ue = "0", al = !0, Ns = 0.2, ll = 0.35;
|
|
7624
|
+
class cl {
|
|
7625
7625
|
engine;
|
|
7626
7626
|
currentHdrId = Ue;
|
|
7627
|
-
isVisible =
|
|
7628
|
-
currentIntensity =
|
|
7627
|
+
isVisible = al;
|
|
7628
|
+
currentIntensity = Ns;
|
|
7629
7629
|
currentTexture = null;
|
|
7630
7630
|
currentEnvironmentTexture = null;
|
|
7631
7631
|
skybox = null;
|
|
@@ -7710,10 +7710,10 @@ class al {
|
|
|
7710
7710
|
_loadHdr(e) {
|
|
7711
7711
|
const t = ee(e, import.meta.url);
|
|
7712
7712
|
return new Promise((i, n) => {
|
|
7713
|
-
new
|
|
7713
|
+
new mo().load(
|
|
7714
7714
|
t,
|
|
7715
7715
|
(s) => {
|
|
7716
|
-
s.mapping =
|
|
7716
|
+
s.mapping = go, i(s);
|
|
7717
7717
|
},
|
|
7718
7718
|
void 0,
|
|
7719
7719
|
(s) => n(s)
|
|
@@ -7723,7 +7723,7 @@ class al {
|
|
|
7723
7723
|
_applyTexture(e) {
|
|
7724
7724
|
if (this.currentTexture = e, !this.engine.scene || !this.engine.renderer) return;
|
|
7725
7725
|
this._captureSceneState(), this.currentEnvironmentTexture?.dispose();
|
|
7726
|
-
const t = new
|
|
7726
|
+
const t = new os(this.engine.renderer), i = t.fromEquirectangular(e).texture;
|
|
7727
7727
|
t.dispose(), this.currentEnvironmentTexture = i, this.engine.scene.background = null, this.engine.scene.environment = i, this.engine.scene.environmentIntensity = this.currentIntensity, this.engine.renderer.toneMapping = Ri, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure > 0 ? this.previousToneMappingExposure : Hi, this._removeSkybox(), this._createSkybox(e), this._setAmbientLightIntensity(this._getHdrAmbientLightIntensity());
|
|
7728
7728
|
}
|
|
7729
7729
|
_captureSceneState() {
|
|
@@ -7731,7 +7731,7 @@ class al {
|
|
|
7731
7731
|
}
|
|
7732
7732
|
_createSkybox(e) {
|
|
7733
7733
|
if (!this.engine.scene) return;
|
|
7734
|
-
const t = new
|
|
7734
|
+
const t = new Jt(1e3, 64, 32), i = new oe({
|
|
7735
7735
|
map: e,
|
|
7736
7736
|
side: Ni,
|
|
7737
7737
|
depthWrite: !1,
|
|
@@ -7755,30 +7755,30 @@ class al {
|
|
|
7755
7755
|
}
|
|
7756
7756
|
_getAmbientLightIntensity() {
|
|
7757
7757
|
return this.engine.scene?.children.find(
|
|
7758
|
-
(t) => t instanceof
|
|
7758
|
+
(t) => t instanceof Zt
|
|
7759
7759
|
)?.intensity ?? 1;
|
|
7760
7760
|
}
|
|
7761
7761
|
_setAmbientLightIntensity(e) {
|
|
7762
7762
|
const t = this.engine.scene?.children.find(
|
|
7763
|
-
(i) => i instanceof
|
|
7763
|
+
(i) => i instanceof Zt
|
|
7764
7764
|
);
|
|
7765
7765
|
t && (t.intensity = e);
|
|
7766
7766
|
}
|
|
7767
7767
|
_getHdrAmbientLightIntensity() {
|
|
7768
|
-
return Math.max(this.previousAmbientLightIntensity *
|
|
7768
|
+
return Math.max(this.previousAmbientLightIntensity * ll, 0);
|
|
7769
7769
|
}
|
|
7770
7770
|
_requestRender() {
|
|
7771
7771
|
this.engine?.requestComposerRender?.();
|
|
7772
7772
|
}
|
|
7773
7773
|
}
|
|
7774
|
-
const
|
|
7774
|
+
const hl = 1e-3, Hs = !1, dl = [
|
|
7775
7775
|
{ Id: "339", Name: "L1", Elevation: -0.32808398950131235 },
|
|
7776
7776
|
{ Id: "2787", Name: "L2", Elevation: 16.896325459317584 },
|
|
7777
7777
|
{ Id: "236633", Name: "L3", Elevation: 36.745406824146976 }
|
|
7778
7778
|
];
|
|
7779
|
-
class
|
|
7779
|
+
class ul {
|
|
7780
7780
|
engine;
|
|
7781
|
-
isVisible =
|
|
7781
|
+
isVisible = Hs;
|
|
7782
7782
|
levels = [];
|
|
7783
7783
|
svgContainer = null;
|
|
7784
7784
|
svgOverlay = null;
|
|
@@ -7796,7 +7796,7 @@ class hl {
|
|
|
7796
7796
|
}
|
|
7797
7797
|
setMockData() {
|
|
7798
7798
|
const e = this.engine.models?.[0]?.levels, t = this.engine.models?.[0]?.boundingBox;
|
|
7799
|
-
this.setData(Array.isArray(e) && e.length > 0 ? e :
|
|
7799
|
+
this.setData(Array.isArray(e) && e.length > 0 ? e : dl, t);
|
|
7800
7800
|
}
|
|
7801
7801
|
show() {
|
|
7802
7802
|
this.isVisible = !0, this.svgContainer && (this.svgContainer.style.display = "block"), this.levels.forEach((e) => {
|
|
@@ -7829,7 +7829,7 @@ class hl {
|
|
|
7829
7829
|
const { url: i, targetPoint: n } = this.resolvePointLookupArgs(e, t), s = this.getLevelData(i).slice().sort((g, f) => g.Elevation - f.Elevation);
|
|
7830
7830
|
if (s.length === 0)
|
|
7831
7831
|
return null;
|
|
7832
|
-
const o = (n instanceof d, n.y), r = s.find((g) => Math.abs(g.Elevation - o) <=
|
|
7832
|
+
const o = (n instanceof d, n.y), r = s.find((g) => Math.abs(g.Elevation - o) <= hl) ?? null;
|
|
7833
7833
|
if (r)
|
|
7834
7834
|
return {
|
|
7835
7835
|
pointY: o,
|
|
@@ -8003,35 +8003,35 @@ class hl {
|
|
|
8003
8003
|
};
|
|
8004
8004
|
}
|
|
8005
8005
|
}
|
|
8006
|
-
const
|
|
8007
|
-
function
|
|
8006
|
+
const Yt = !0, _i = 0.5, pl = 32, ml = 0.3, Vs = 0.05, gl = 0.04, fl = 0.18, yl = 0.01;
|
|
8007
|
+
function Ml(a) {
|
|
8008
8008
|
return !a?.min || !a?.max ? 0 : a.min.distanceTo(a.max);
|
|
8009
8009
|
}
|
|
8010
|
-
function
|
|
8010
|
+
function vl(a, e) {
|
|
8011
8011
|
return a instanceof d ? a.clone() : e?.min && e?.max ? e.min.clone().add(e.max).multiplyScalar(0.5) : new d();
|
|
8012
8012
|
}
|
|
8013
|
-
function
|
|
8013
|
+
function xl(a, e, t) {
|
|
8014
8014
|
if (a instanceof Be)
|
|
8015
8015
|
return Math.max((a.top - a.bottom) / Math.max(a.zoom, 1e-6), 1);
|
|
8016
|
-
const i = a, n =
|
|
8016
|
+
const i = a, n = vl(e, t), s = i.position.distanceTo(n), o = typeof i.getEffectiveFOV == "function" ? i.getEffectiveFOV() : i.fov, r = F.degToRad(o * 0.5);
|
|
8017
8017
|
return Math.max(2 * s * Math.tan(r), 1);
|
|
8018
8018
|
}
|
|
8019
|
-
function
|
|
8019
|
+
function wl(a, e, t, i) {
|
|
8020
8020
|
if (a == null)
|
|
8021
8021
|
return i;
|
|
8022
|
-
const n =
|
|
8022
|
+
const n = Ml(t);
|
|
8023
8023
|
if (n <= 0)
|
|
8024
8024
|
return i;
|
|
8025
|
-
const s =
|
|
8025
|
+
const s = xl(a, e, t), o = Math.max(n * gl, 1), r = Math.max(n * fl, o + 1), l = F.clamp(
|
|
8026
8026
|
(s - o) / (r - o),
|
|
8027
8027
|
0,
|
|
8028
8028
|
1
|
|
8029
|
-
), c = Math.max(i *
|
|
8029
|
+
), c = Math.max(i * ml, Vs);
|
|
8030
8030
|
return F.lerp(i, c, l);
|
|
8031
8031
|
}
|
|
8032
|
-
class
|
|
8032
|
+
class bl {
|
|
8033
8033
|
engine;
|
|
8034
|
-
isActive =
|
|
8034
|
+
isActive = Yt;
|
|
8035
8035
|
groupEdge;
|
|
8036
8036
|
highlightEdgeGroup;
|
|
8037
8037
|
material;
|
|
@@ -8043,7 +8043,7 @@ class xl {
|
|
|
8043
8043
|
highlightIndexes = /* @__PURE__ */ new Map();
|
|
8044
8044
|
highlightEdgeSyncVersion = 0;
|
|
8045
8045
|
explodeHidden = !1;
|
|
8046
|
-
groupVisibleBeforeExplode =
|
|
8046
|
+
groupVisibleBeforeExplode = Yt;
|
|
8047
8047
|
highlightVisibleBeforeExplode = !0;
|
|
8048
8048
|
getModelEntry(e) {
|
|
8049
8049
|
return this.engine?.models?.find((t) => t?.url === e) ?? null;
|
|
@@ -8113,7 +8113,7 @@ class xl {
|
|
|
8113
8113
|
// 高亮边线也要遵守深度,否则隐藏边线密集叠加时会像一块灰色半透明面。
|
|
8114
8114
|
depthTest: !1,
|
|
8115
8115
|
depthWrite: !1
|
|
8116
|
-
}), this.highlightEdgeMaterial.clippingPlanes = this.engine.sectionPlane, this.groupEdge.visible =
|
|
8116
|
+
}), this.highlightEdgeMaterial.clippingPlanes = this.engine.sectionPlane, this.groupEdge.visible = Yt;
|
|
8117
8117
|
}
|
|
8118
8118
|
// 启动
|
|
8119
8119
|
active() {
|
|
@@ -8140,13 +8140,13 @@ class xl {
|
|
|
8140
8140
|
update() {
|
|
8141
8141
|
if (!this.isActive || !this.material)
|
|
8142
8142
|
return;
|
|
8143
|
-
const e =
|
|
8143
|
+
const e = wl(
|
|
8144
8144
|
this.engine?.camera,
|
|
8145
8145
|
this.engine?.controls?.target,
|
|
8146
8146
|
this.engine?.octreeBox?.getBoundingBox?.(),
|
|
8147
8147
|
this.baseOpacity
|
|
8148
8148
|
);
|
|
8149
|
-
Math.abs(this.material.opacity - e) <=
|
|
8149
|
+
Math.abs(this.material.opacity - e) <= yl || (this.material.opacity = e, this.material.needsUpdate = !0);
|
|
8150
8150
|
}
|
|
8151
8151
|
hasPendingModelEdges() {
|
|
8152
8152
|
return (this.engine?.models ?? []).some((t) => this.shouldLoadModelEdge(t) && !Array.isArray(t?.modelEdge));
|
|
@@ -8231,8 +8231,8 @@ class xl {
|
|
|
8231
8231
|
return;
|
|
8232
8232
|
const l = new ae();
|
|
8233
8233
|
l.setAttribute("position", new Pt(s, 3));
|
|
8234
|
-
const c = new
|
|
8235
|
-
c.url = i, this.setLineTransform(c,
|
|
8234
|
+
const c = new ei(l, this.material);
|
|
8235
|
+
c.url = i, this.setLineTransform(c, Se(this.engine, i)), this.groupEdge.add(c), this.highlightIndexes.set(i, o), this.releaseIndexes(i);
|
|
8236
8236
|
});
|
|
8237
8237
|
}
|
|
8238
8238
|
/**
|
|
@@ -8279,7 +8279,7 @@ class xl {
|
|
|
8279
8279
|
if (i.ids.forEach((l) => {
|
|
8280
8280
|
const c = n?.get(Number(l)), h = typeof c == "number" ? this.getEdgePointsByIndex(i.url, c) : null;
|
|
8281
8281
|
if (Array.isArray(h)) {
|
|
8282
|
-
if (h.length >
|
|
8282
|
+
if (h.length > pl)
|
|
8283
8283
|
return;
|
|
8284
8284
|
this.appendEdgePositions(s, h);
|
|
8285
8285
|
}
|
|
@@ -8287,8 +8287,8 @@ class xl {
|
|
|
8287
8287
|
return;
|
|
8288
8288
|
const o = new ae();
|
|
8289
8289
|
o.setAttribute("position", new Pt(s, 3));
|
|
8290
|
-
const r = new
|
|
8291
|
-
r.name = "highlightModelEdge", r.url = i.url, this.setLineTransform(r,
|
|
8290
|
+
const r = new ei(o, this.highlightEdgeMaterial);
|
|
8291
|
+
r.name = "highlightModelEdge", r.url = i.url, this.setLineTransform(r, Se(this.engine, i.url)), this.highlightEdgeGroup.add(r);
|
|
8292
8292
|
}));
|
|
8293
8293
|
}
|
|
8294
8294
|
appendEdgePositions(e, t) {
|
|
@@ -8338,7 +8338,7 @@ class xl {
|
|
|
8338
8338
|
}
|
|
8339
8339
|
// 设置边线材质透明度
|
|
8340
8340
|
setOpacity(e) {
|
|
8341
|
-
this.baseOpacity = F.clamp(e,
|
|
8341
|
+
this.baseOpacity = F.clamp(e, Vs, 1), this.update();
|
|
8342
8342
|
}
|
|
8343
8343
|
// 显示边线
|
|
8344
8344
|
showModelEdge(e, t) {
|
|
@@ -8382,7 +8382,7 @@ const Dn = {
|
|
|
8382
8382
|
cloudDensity: 0.4,
|
|
8383
8383
|
cloudElevation: 0.5,
|
|
8384
8384
|
showSunDisc: !0
|
|
8385
|
-
}, Di = "sunrise_clear",
|
|
8385
|
+
}, Di = "sunrise_clear", Us = 0.2, ki = [
|
|
8386
8386
|
{
|
|
8387
8387
|
id: "sunrise_clear",
|
|
8388
8388
|
names: ["晴朗日出", "晴朗日出", "Clear Sunrise"],
|
|
@@ -8557,13 +8557,13 @@ const Dn = {
|
|
|
8557
8557
|
(a, e) => (a[e.id] = e, a),
|
|
8558
8558
|
{}
|
|
8559
8559
|
), Ln = 2e6;
|
|
8560
|
-
class
|
|
8560
|
+
class Cl {
|
|
8561
8561
|
engine;
|
|
8562
8562
|
sky = null;
|
|
8563
8563
|
sun = new d();
|
|
8564
8564
|
params = { ...Dn, ...kn[Di].params };
|
|
8565
8565
|
currentPreset = Di;
|
|
8566
|
-
currentIntensity =
|
|
8566
|
+
currentIntensity = Us;
|
|
8567
8567
|
currentEnvironmentTarget = null;
|
|
8568
8568
|
skyScale = 45e4;
|
|
8569
8569
|
skyName = "bim_engine_sky";
|
|
@@ -8584,7 +8584,7 @@ class wl {
|
|
|
8584
8584
|
this.sky.visible = !0, this._captureSceneState(), this._expandCameraFarForSky(), this._applyParamsToSky();
|
|
8585
8585
|
return;
|
|
8586
8586
|
}
|
|
8587
|
-
const e = new
|
|
8587
|
+
const e = new fo();
|
|
8588
8588
|
e.scale.setScalar(this.skyScale), e.name = this.skyName, this.sky = e, this.engine.scene.add(e), this._captureSceneState(), this._expandCameraFarForSky(), this.engine.renderer && (this.engine.renderer.toneMapping = Zi, this.engine.scene.background = null), this._applyParamsToSky();
|
|
8589
8589
|
}
|
|
8590
8590
|
close(e = !0) {
|
|
@@ -8670,7 +8670,7 @@ class wl {
|
|
|
8670
8670
|
this._disposeEnvironmentTarget();
|
|
8671
8671
|
const e = new Bi(), t = this.sky.clone();
|
|
8672
8672
|
t.material = this.sky.material.clone(), e.add(t);
|
|
8673
|
-
const i = new
|
|
8673
|
+
const i = new os(this.engine.renderer);
|
|
8674
8674
|
this.currentEnvironmentTarget = i.fromScene(e, 0, 0.1, this.skyScale * 2), i.dispose(), this.engine.scene.background = null, this.engine.scene.environment = this.currentEnvironmentTarget.texture, this.engine.scene.environmentIntensity = this.currentIntensity, t.material.dispose();
|
|
8675
8675
|
}
|
|
8676
8676
|
_disposeEnvironmentTarget() {
|
|
@@ -8681,7 +8681,7 @@ class wl {
|
|
|
8681
8681
|
n && (i instanceof d && typeof n.value?.copy == "function" ? n.value.copy(i) : n.value = i);
|
|
8682
8682
|
}
|
|
8683
8683
|
}
|
|
8684
|
-
class
|
|
8684
|
+
class El {
|
|
8685
8685
|
/** 寮曟搸瀹炰緥寮曠敤 */
|
|
8686
8686
|
engine;
|
|
8687
8687
|
defaultSettings;
|
|
@@ -8813,28 +8813,28 @@ class bl {
|
|
|
8813
8813
|
return {
|
|
8814
8814
|
render: {
|
|
8815
8815
|
mode: this._toRenderMode(this.engine.engineModelModule?.getCurrentMode?.()),
|
|
8816
|
-
contrast: this._uniformToPercent(t,
|
|
8817
|
-
saturation: this._uniformToPercent(e,
|
|
8816
|
+
contrast: this._uniformToPercent(t, gs),
|
|
8817
|
+
saturation: this._uniformToPercent(e, ms),
|
|
8818
8818
|
shadowIntensity: this._shadowToPercent(this._getDirectionalLightShadowIntensity(), bt),
|
|
8819
8819
|
lightIntensity: this._exposureToPercent(n, Hi),
|
|
8820
|
-
gtaoIntensity: this._unitToPercent(i,
|
|
8820
|
+
gtaoIntensity: this._unitToPercent(i, ps)
|
|
8821
8821
|
},
|
|
8822
8822
|
display: {
|
|
8823
|
-
showEdge: this.engine.modelEdge?.isEnabled?.() ??
|
|
8823
|
+
showEdge: this.engine.modelEdge?.isEnabled?.() ?? Yt,
|
|
8824
8824
|
edgeOpacity: this._unitToPercent(s, _i),
|
|
8825
8825
|
showGrid: this.engine.grid?.getVisible?.() ?? Ii,
|
|
8826
|
-
showLevel: this.engine.level?.getVisible?.() ??
|
|
8827
|
-
showGround: this.engine.ground?.getVisible?.() ??
|
|
8828
|
-
groundId: this.engine.ground?.getCurrentId?.() ??
|
|
8829
|
-
groundHeight: this.engine.ground?.getHeight?.() ??
|
|
8826
|
+
showLevel: this.engine.level?.getVisible?.() ?? Hs,
|
|
8827
|
+
showGround: this.engine.ground?.getVisible?.() ?? Fs,
|
|
8828
|
+
groundId: this.engine.ground?.getCurrentId?.() ?? Rs,
|
|
8829
|
+
groundHeight: this.engine.ground?.getHeight?.() ?? Os
|
|
8830
8830
|
},
|
|
8831
8831
|
environment: {
|
|
8832
8832
|
type: h ? "sky" : o !== Ue ? "hdr" : "none",
|
|
8833
8833
|
hdrId: o,
|
|
8834
|
-
hdrIntensity: this._unitToPercent(r,
|
|
8834
|
+
hdrIntensity: this._unitToPercent(r, Ns),
|
|
8835
8835
|
skyPreset: c,
|
|
8836
8836
|
skyParams: {},
|
|
8837
|
-
skyIntensity: this._unitToPercent(l,
|
|
8837
|
+
skyIntensity: this._unitToPercent(l, Us)
|
|
8838
8838
|
}
|
|
8839
8839
|
};
|
|
8840
8840
|
}
|
|
@@ -8869,7 +8869,7 @@ class bl {
|
|
|
8869
8869
|
};
|
|
8870
8870
|
}
|
|
8871
8871
|
_toRenderMode(e) {
|
|
8872
|
-
return e === "simple" || e === "balance" || e === "advanced" ? e :
|
|
8872
|
+
return e === "simple" || e === "balance" || e === "advanced" ? e : zs;
|
|
8873
8873
|
}
|
|
8874
8874
|
_uniformToPercent(e, t) {
|
|
8875
8875
|
const i = typeof e == "number" ? e : t;
|
|
@@ -9218,7 +9218,7 @@ class qe {
|
|
|
9218
9218
|
}
|
|
9219
9219
|
}
|
|
9220
9220
|
}
|
|
9221
|
-
class
|
|
9221
|
+
class Al {
|
|
9222
9222
|
engine;
|
|
9223
9223
|
isActive = !1;
|
|
9224
9224
|
tools;
|
|
@@ -9322,7 +9322,7 @@ class Cl {
|
|
|
9322
9322
|
}
|
|
9323
9323
|
}
|
|
9324
9324
|
}
|
|
9325
|
-
class
|
|
9325
|
+
class Sl {
|
|
9326
9326
|
engine;
|
|
9327
9327
|
tools;
|
|
9328
9328
|
isActive = !1;
|
|
@@ -9378,7 +9378,7 @@ class El {
|
|
|
9378
9378
|
}
|
|
9379
9379
|
// 按下esc
|
|
9380
9380
|
}
|
|
9381
|
-
class
|
|
9381
|
+
class Pl {
|
|
9382
9382
|
engine;
|
|
9383
9383
|
isActive = !1;
|
|
9384
9384
|
tools;
|
|
@@ -9433,7 +9433,7 @@ class Al {
|
|
|
9433
9433
|
t.point1 = s.point, t.point2 = n[0].point, t.text = t.point1.clone().distanceTo(t.point2.clone()), this.engine.events.trigger(se.MeasureChanged, t);
|
|
9434
9434
|
}
|
|
9435
9435
|
}
|
|
9436
|
-
class
|
|
9436
|
+
class Tl {
|
|
9437
9437
|
engine;
|
|
9438
9438
|
isActive = !1;
|
|
9439
9439
|
tools;
|
|
@@ -9478,7 +9478,7 @@ class Sl {
|
|
|
9478
9478
|
t.point = e.catch.point.clone(), t.text = e.catch.point.y, t.isSelect = !1, this.engine.events.trigger(se.MeasureChanged, t);
|
|
9479
9479
|
}
|
|
9480
9480
|
}
|
|
9481
|
-
class
|
|
9481
|
+
class Il {
|
|
9482
9482
|
engine;
|
|
9483
9483
|
isActive = !1;
|
|
9484
9484
|
tools;
|
|
@@ -9530,7 +9530,7 @@ class Pl {
|
|
|
9530
9530
|
e != null && (e.isSelect = !1, this.engine.events.trigger(se.MeasureChanged, e));
|
|
9531
9531
|
}
|
|
9532
9532
|
}
|
|
9533
|
-
class
|
|
9533
|
+
class _l {
|
|
9534
9534
|
engine;
|
|
9535
9535
|
tools;
|
|
9536
9536
|
// 存储三个点:起点、顶点(中间点)、终点
|
|
@@ -9598,7 +9598,7 @@ class Tl {
|
|
|
9598
9598
|
}
|
|
9599
9599
|
}
|
|
9600
9600
|
}
|
|
9601
|
-
class
|
|
9601
|
+
class Dl {
|
|
9602
9602
|
engine;
|
|
9603
9603
|
tools;
|
|
9604
9604
|
points = [];
|
|
@@ -9825,7 +9825,7 @@ class Ct {
|
|
|
9825
9825
|
}
|
|
9826
9826
|
}
|
|
9827
9827
|
}
|
|
9828
|
-
class
|
|
9828
|
+
class kl {
|
|
9829
9829
|
engine;
|
|
9830
9830
|
isActive = !1;
|
|
9831
9831
|
points = [];
|
|
@@ -9906,7 +9906,7 @@ class _l {
|
|
|
9906
9906
|
};
|
|
9907
9907
|
}
|
|
9908
9908
|
}
|
|
9909
|
-
class
|
|
9909
|
+
class Ll {
|
|
9910
9910
|
isActive = !1;
|
|
9911
9911
|
engine;
|
|
9912
9912
|
clearHeightMeasure;
|
|
@@ -9932,7 +9932,7 @@ class Dl {
|
|
|
9932
9932
|
volumeAnnotation: []
|
|
9933
9933
|
};
|
|
9934
9934
|
constructor(e) {
|
|
9935
|
-
this.engine = e, this.clearHeightMeasure = new
|
|
9935
|
+
this.engine = e, this.clearHeightMeasure = new Al(e), this.distanceMeasure = new Sl(e), this.clearDistanceMeasure = new Pl(e), this.elevationMeasure = new Tl(e), this.pointMeasure = new Il(e), this.angleMeasure = new _l(e), this.areaMeasure = new Dl(e), this.slopeMeasure = new Ct(e), this.faceDistanceMeasure = new kl(e), this.tools = new qe(e), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", e.container.appendChild(this.annotationContainer);
|
|
9936
9936
|
}
|
|
9937
9937
|
setContextMenuDisabled(e) {
|
|
9938
9938
|
this.engine?.engineStatus != null && (this.engine.engineStatus.isDisableContextMenu = e);
|
|
@@ -9980,7 +9980,7 @@ class Dl {
|
|
|
9980
9980
|
this.engine.setIdleFrameRateExempt?.("measure", !1), this.setContextMenuDisabled(!1), this.tools.disActive(), this.clearHeightMeasure.disActive(), this.distanceMeasure.disActive(), this.clearDistanceMeasure.disActive(), this.elevationMeasure.disActive(), this.pointMeasure.disActive(), this.angleMeasure.disActive(), this.areaMeasure.disActive(), this.slopeMeasure.disActive(), this.faceDistanceMeasure.disActive(), this.clearAll(), this.annotationContainer.remove(), this.isActive = !1;
|
|
9981
9981
|
}
|
|
9982
9982
|
}
|
|
9983
|
-
class
|
|
9983
|
+
class Bl {
|
|
9984
9984
|
engine;
|
|
9985
9985
|
isActive = !1;
|
|
9986
9986
|
isCtrlDown = !1;
|
|
@@ -10324,7 +10324,7 @@ class kl {
|
|
|
10324
10324
|
const s = this.transformAnchors.get(e), o = this.transformControls.get(e);
|
|
10325
10325
|
if (!s || !o)
|
|
10326
10326
|
return;
|
|
10327
|
-
const r = this.getFaceTransformOffset(), l = new
|
|
10327
|
+
const r = this.getFaceTransformOffset(), l = new Ie().setFromUnitVectors(
|
|
10328
10328
|
new d(1, 0, 0),
|
|
10329
10329
|
t.clone().normalize()
|
|
10330
10330
|
), c = i.clone().add(t.clone().setLength(r));
|
|
@@ -10499,7 +10499,7 @@ class kl {
|
|
|
10499
10499
|
x && x.setFromNormalAndCoplanarPoint(i.clone().setLength(-1), o);
|
|
10500
10500
|
}
|
|
10501
10501
|
}
|
|
10502
|
-
class
|
|
10502
|
+
class zl {
|
|
10503
10503
|
engine;
|
|
10504
10504
|
isActive = !1;
|
|
10505
10505
|
isDrag = !1;
|
|
@@ -10877,7 +10877,7 @@ class Ll {
|
|
|
10877
10877
|
i,
|
|
10878
10878
|
e.clone().normalize()
|
|
10879
10879
|
);
|
|
10880
|
-
return new
|
|
10880
|
+
return new Ie().setFromRotationMatrix(n);
|
|
10881
10881
|
}
|
|
10882
10882
|
keepSingleDirectionArrow(e, t = "X") {
|
|
10883
10883
|
const i = e.getHelper(), n = [];
|
|
@@ -10944,7 +10944,7 @@ class Ll {
|
|
|
10944
10944
|
updateTransformControl(e) {
|
|
10945
10945
|
if (this.ensureTransformControl(), !this.transformControl || !this.transformAnchor || !this.current_center)
|
|
10946
10946
|
return;
|
|
10947
|
-
const t = this.getTransformHandleOffset(), i = this.current_center.clone().add(e.clone().setLength(t)), n = new
|
|
10947
|
+
const t = this.getTransformHandleOffset(), i = this.current_center.clone().add(e.clone().setLength(t)), n = new Ie().setFromUnitVectors(
|
|
10948
10948
|
new d(1, 0, 0),
|
|
10949
10949
|
e.clone().normalize().multiplyScalar(-1)
|
|
10950
10950
|
);
|
|
@@ -11054,7 +11054,7 @@ class Ll {
|
|
|
11054
11054
|
}
|
|
11055
11055
|
}
|
|
11056
11056
|
}
|
|
11057
|
-
class
|
|
11057
|
+
class Rl {
|
|
11058
11058
|
engine;
|
|
11059
11059
|
callback_;
|
|
11060
11060
|
isActive;
|
|
@@ -11085,7 +11085,7 @@ class Bl {
|
|
|
11085
11085
|
});
|
|
11086
11086
|
}
|
|
11087
11087
|
}
|
|
11088
|
-
class
|
|
11088
|
+
class Ol {
|
|
11089
11089
|
/** 引擎实例(包含 scene / models / engineStatus / octreeBox 等) */
|
|
11090
11090
|
engine;
|
|
11091
11091
|
/** three-bvh-csg 计算器,负责执行布尔操作 */
|
|
@@ -11107,7 +11107,7 @@ class zl {
|
|
|
11107
11107
|
fillTextureRepeat = 60;
|
|
11108
11108
|
fillTextureRotation = 0;
|
|
11109
11109
|
constructor(e) {
|
|
11110
|
-
this.engine = e, this.evaluator = new
|
|
11110
|
+
this.engine = e, this.evaluator = new yo();
|
|
11111
11111
|
const t = ee("/texture/fill.png", import.meta.url), i = new nt().load(t);
|
|
11112
11112
|
i.wrapS = pt, i.wrapT = pt, i.center.set(0.5, 0.5), i.rotation = this.fillTextureRotation, this.fillMaterial = new Fi({
|
|
11113
11113
|
color: 14079687,
|
|
@@ -11177,7 +11177,7 @@ class zl {
|
|
|
11177
11177
|
const x = this.createWorldBrushFromMesh(M);
|
|
11178
11178
|
if (x != null)
|
|
11179
11179
|
try {
|
|
11180
|
-
const b = this.evaluator.evaluate(x, c,
|
|
11180
|
+
const b = this.evaluator.evaluate(x, c, Mo)?.geometry;
|
|
11181
11181
|
if (!b)
|
|
11182
11182
|
continue;
|
|
11183
11183
|
const C = this.extractPlaneCapGeometry(b, e, l);
|
|
@@ -11314,7 +11314,7 @@ class zl {
|
|
|
11314
11314
|
* - 平移到 plane 上
|
|
11315
11315
|
*/
|
|
11316
11316
|
createPlaneBrush(e, t, i) {
|
|
11317
|
-
const n = new St(t, t, i), s = e.coplanarPoint(new d()), o = new
|
|
11317
|
+
const n = new St(t, t, i), s = e.coplanarPoint(new d()), o = new Ie().setFromUnitVectors(
|
|
11318
11318
|
new d(0, 0, 1),
|
|
11319
11319
|
e.normal.clone().normalize()
|
|
11320
11320
|
), r = new H().compose(s, o, new d(1, 1, 1));
|
|
@@ -11405,7 +11405,7 @@ class zl {
|
|
|
11405
11405
|
return { tangent: l, bitangent: c };
|
|
11406
11406
|
}
|
|
11407
11407
|
}
|
|
11408
|
-
class
|
|
11408
|
+
class Fl {
|
|
11409
11409
|
engine;
|
|
11410
11410
|
clippingTolerance = 1e-4;
|
|
11411
11411
|
sectionBox;
|
|
@@ -11417,7 +11417,7 @@ class Rl {
|
|
|
11417
11417
|
fillCutFace = !0;
|
|
11418
11418
|
viewRangePlanes = null;
|
|
11419
11419
|
constructor(e) {
|
|
11420
|
-
this.engine = e, this.sectionCatchFace = new
|
|
11420
|
+
this.engine = e, this.sectionCatchFace = new Rl(this.engine);
|
|
11421
11421
|
let t = new Z(new d(0, 0, 1), 1e5);
|
|
11422
11422
|
t.name = "前";
|
|
11423
11423
|
let i = new Z(new d(0, 0, 1), 1e5);
|
|
@@ -11434,7 +11434,7 @@ class Rl {
|
|
|
11434
11434
|
l.name = "face", this.engine.sectionPlane = [t, i, n, s, o, r, l];
|
|
11435
11435
|
}
|
|
11436
11436
|
init() {
|
|
11437
|
-
this.sectionBox = new
|
|
11437
|
+
this.sectionBox = new Bl(this.engine), this.sectionFace = new zl(this.engine), this.clippingCSGSimple = new Ol(this.engine);
|
|
11438
11438
|
}
|
|
11439
11439
|
// 自动缩放适用的视图比例
|
|
11440
11440
|
scaleBox() {
|
|
@@ -11641,7 +11641,7 @@ class Rl {
|
|
|
11641
11641
|
});
|
|
11642
11642
|
}
|
|
11643
11643
|
}
|
|
11644
|
-
class
|
|
11644
|
+
class Nl {
|
|
11645
11645
|
engine;
|
|
11646
11646
|
constructor(e) {
|
|
11647
11647
|
this.engine = e;
|
|
@@ -11680,7 +11680,7 @@ class Ol {
|
|
|
11680
11680
|
}), e;
|
|
11681
11681
|
}
|
|
11682
11682
|
}
|
|
11683
|
-
class
|
|
11683
|
+
class Hl {
|
|
11684
11684
|
engine;
|
|
11685
11685
|
constructor(e) {
|
|
11686
11686
|
this.engine = e;
|
|
@@ -11718,7 +11718,7 @@ class Fl {
|
|
|
11718
11718
|
});
|
|
11719
11719
|
}
|
|
11720
11720
|
}
|
|
11721
|
-
class
|
|
11721
|
+
class Vl {
|
|
11722
11722
|
engine;
|
|
11723
11723
|
// 扩展属性
|
|
11724
11724
|
extended = /* @__PURE__ */ new Map();
|
|
@@ -11844,8 +11844,8 @@ class Nl {
|
|
|
11844
11844
|
}
|
|
11845
11845
|
}
|
|
11846
11846
|
}
|
|
11847
|
-
const
|
|
11848
|
-
class
|
|
11847
|
+
const Ul = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="10.8" cy="10.8" r="6.5" stroke="currentColor" stroke-width="2"/><path d="m16 16 4.3 4.3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>';
|
|
11848
|
+
class Wl {
|
|
11849
11849
|
manager;
|
|
11850
11850
|
wrapper;
|
|
11851
11851
|
input;
|
|
@@ -11861,7 +11861,7 @@ class Vl {
|
|
|
11861
11861
|
this.manager = t, this.wrapper = document.createElement("div"), this.wrapper.className = "engine-3d-search", this.wrapper.innerHTML = `
|
|
11862
11862
|
<section class="engine-3d-search__box" role="dialog" aria-label="模型检索">
|
|
11863
11863
|
<div class="engine-3d-search__input-row">
|
|
11864
|
-
<span class="engine-3d-search__icon">${
|
|
11864
|
+
<span class="engine-3d-search__icon">${Ul}</span>
|
|
11865
11865
|
<input class="engine-3d-search__input" type="search" placeholder="检索模型名称、构件 ID、房间" autocomplete="off" spellcheck="false" />
|
|
11866
11866
|
<button class="engine-3d-search__clear" type="button" aria-label="关闭检索框">×</button>
|
|
11867
11867
|
</div>
|
|
@@ -11964,13 +11964,13 @@ class Vl {
|
|
|
11964
11964
|
this.input.removeEventListener("input", this.onInput), this.input.removeEventListener("keydown", this.onKeyDown), this.wrapper.querySelector(".engine-3d-search__clear")?.removeEventListener("click", this.onCloseClick), this.pagination.removeEventListener("click", this.onPageClick), document.removeEventListener("mousedown", this.onDocumentMouseDown), document.removeEventListener("keydown", this.onDocumentKeyDown), this.debounceTimer !== null && clearTimeout(this.debounceTimer), this.wrapper.remove();
|
|
11965
11965
|
}
|
|
11966
11966
|
}
|
|
11967
|
-
class
|
|
11967
|
+
class Gl {
|
|
11968
11968
|
engine;
|
|
11969
11969
|
searchUI = null;
|
|
11970
11970
|
constructor(e) {
|
|
11971
11971
|
this.engine = e;
|
|
11972
11972
|
const t = e?.container;
|
|
11973
|
-
t && (this.searchUI = new
|
|
11973
|
+
t && (this.searchUI = new Wl(t, this), this.setTheme(e?.options?.searchTheme === "light" ? "light" : "dark"));
|
|
11974
11974
|
}
|
|
11975
11975
|
/** 按名称、ID、房间名称/编号检索已加载模型。 */
|
|
11976
11976
|
search(e, t = {}) {
|
|
@@ -12108,7 +12108,7 @@ class Ul {
|
|
|
12108
12108
|
return s < 0 ? null : (s === 0 ? 1e3 : 500) - s - Math.max(0, n.length - t.length) * 0.01;
|
|
12109
12109
|
}
|
|
12110
12110
|
}
|
|
12111
|
-
class
|
|
12111
|
+
class ql {
|
|
12112
12112
|
engine;
|
|
12113
12113
|
constructor(e) {
|
|
12114
12114
|
this.engine = e;
|
|
@@ -12201,8 +12201,8 @@ class Wl {
|
|
|
12201
12201
|
}), t && t(i), i;
|
|
12202
12202
|
}
|
|
12203
12203
|
}
|
|
12204
|
-
const Bn = !1,
|
|
12205
|
-
class
|
|
12204
|
+
const Bn = !1, Kl = 51283, jl = 2718207;
|
|
12205
|
+
class Yl {
|
|
12206
12206
|
engine;
|
|
12207
12207
|
rootGroup;
|
|
12208
12208
|
meshMaterial;
|
|
@@ -12216,7 +12216,7 @@ class Kl {
|
|
|
12216
12216
|
showInstance: !0
|
|
12217
12217
|
};
|
|
12218
12218
|
constructor(e) {
|
|
12219
|
-
this.engine = e, this.rootGroup = new me(), this.rootGroup.name = "nodeBoxGroup", this.rootGroup.visible = Bn, this.engine.scene?.add(this.rootGroup), this.meshMaterial = this.createMaterial(
|
|
12219
|
+
this.engine = e, this.rootGroup = new me(), this.rootGroup.name = "nodeBoxGroup", this.rootGroup.visible = Bn, this.engine.scene?.add(this.rootGroup), this.meshMaterial = this.createMaterial(Kl), this.instanceMaterial = this.createMaterial(jl), this.handleLoadingCompleted = () => {
|
|
12220
12220
|
this.isVisible && this.rebuild();
|
|
12221
12221
|
}, this.engine.events?.on?.(ne.LoadingCompleted, this.handleLoadingCompleted);
|
|
12222
12222
|
}
|
|
@@ -12262,7 +12262,7 @@ class Kl {
|
|
|
12262
12262
|
this.appendBoxPositions(g.min, g.max, p);
|
|
12263
12263
|
});
|
|
12264
12264
|
});
|
|
12265
|
-
const r =
|
|
12265
|
+
const r = Se(this.engine, i.url);
|
|
12266
12266
|
this.addLineGroup(i.url, n, this.meshMaterial, "mesh", r), this.addLineGroup(i.url, s, this.instanceMaterial, "instance", r);
|
|
12267
12267
|
}), this.rootGroup.visible = this.isVisible, this.engine.requestComposerRender?.();
|
|
12268
12268
|
}
|
|
@@ -12323,7 +12323,7 @@ class Kl {
|
|
|
12323
12323
|
for (const i of t) {
|
|
12324
12324
|
if (!Array.isArray(i) || i.length === 0)
|
|
12325
12325
|
continue;
|
|
12326
|
-
if (
|
|
12326
|
+
if (_e(this.engine, i[0]) instanceof V)
|
|
12327
12327
|
return !0;
|
|
12328
12328
|
}
|
|
12329
12329
|
return !1;
|
|
@@ -12333,7 +12333,7 @@ class Kl {
|
|
|
12333
12333
|
return;
|
|
12334
12334
|
const o = new ae();
|
|
12335
12335
|
o.setAttribute("position", new Pt(t, 3)), o.computeBoundingSphere();
|
|
12336
|
-
const r = new
|
|
12336
|
+
const r = new ei(o, i);
|
|
12337
12337
|
r.name = `nodeBox:${n}`, r.frustumCulled = !1, r.userData.kind = n, r.userData.url = e, this.setLineTransform(r, s), this.rootGroup.add(r);
|
|
12338
12338
|
}
|
|
12339
12339
|
appendBoxPositions(e, t, i) {
|
|
@@ -12347,8 +12347,8 @@ class Kl {
|
|
|
12347
12347
|
e.matrixAutoUpdate = !1, e.matrix.copy(t), e.matrixWorldNeedsUpdate = !0, e.updateMatrixWorld(!0);
|
|
12348
12348
|
}
|
|
12349
12349
|
}
|
|
12350
|
-
const
|
|
12351
|
-
class
|
|
12350
|
+
const Xl = "path-roaming-animation", Ql = 8e3, $l = 100, Vt = 16;
|
|
12351
|
+
class Zl {
|
|
12352
12352
|
engine;
|
|
12353
12353
|
points = [];
|
|
12354
12354
|
status = "idle";
|
|
@@ -12652,7 +12652,7 @@ class Ql {
|
|
|
12652
12652
|
}
|
|
12653
12653
|
s.normalize();
|
|
12654
12654
|
const o = s.clone().cross(n).normalize(), r = n.clone().negate(), l = new H().makeBasis(s, o, r);
|
|
12655
|
-
return new
|
|
12655
|
+
return new Ie().setFromRotationMatrix(l).normalize();
|
|
12656
12656
|
}
|
|
12657
12657
|
/** 直接更新相机;只有相机类型切换时才调用完整恢复流程。 */
|
|
12658
12658
|
applyPose(e) {
|
|
@@ -12698,7 +12698,7 @@ class Ql {
|
|
|
12698
12698
|
const t = e.loopMode ?? (e.loop ? "repeat" : "none");
|
|
12699
12699
|
return {
|
|
12700
12700
|
...e,
|
|
12701
|
-
duration: this.toPositiveNumber(e.duration,
|
|
12701
|
+
duration: this.toPositiveNumber(e.duration, Ql),
|
|
12702
12702
|
playbackRate: this.toPositiveNumber(e.playbackRate, 1),
|
|
12703
12703
|
timing: "distance",
|
|
12704
12704
|
positionInterpolation: "linear",
|
|
@@ -12708,7 +12708,7 @@ class Ql {
|
|
|
12708
12708
|
loopMode: t,
|
|
12709
12709
|
loopCount: e.loopCount === void 0 ? Number.POSITIVE_INFINITY : Math.max(Math.floor(this.toNonNegativeNumber(e.loopCount, 0)), 0),
|
|
12710
12710
|
direction: e.direction ?? "forward",
|
|
12711
|
-
maxFrameDelta: this.toPositiveNumber(e.maxFrameDelta,
|
|
12711
|
+
maxFrameDelta: this.toPositiveNumber(e.maxFrameDelta, $l)
|
|
12712
12712
|
};
|
|
12713
12713
|
}
|
|
12714
12714
|
/** 规范化外部关键帧,并以四元数作为旋转的权威数据。 */
|
|
@@ -12746,7 +12746,7 @@ class Ql {
|
|
|
12746
12746
|
if (n.lengthSq() > Number.EPSILON) return n.normalize();
|
|
12747
12747
|
}
|
|
12748
12748
|
const i = e?.rotation;
|
|
12749
|
-
return new
|
|
12749
|
+
return new Ie().setFromEuler(new tt(
|
|
12750
12750
|
this.toFiniteNumber(i?.x, 0),
|
|
12751
12751
|
this.toFiniteNumber(i?.y, 0),
|
|
12752
12752
|
this.toFiniteNumber(i?.z, 0),
|
|
@@ -12802,7 +12802,7 @@ class Ql {
|
|
|
12802
12802
|
}
|
|
12803
12803
|
/** 播放期间解除引擎空闲限帧。 */
|
|
12804
12804
|
setFrameRateExempt(e) {
|
|
12805
|
-
this.engine.setIdleFrameRateExempt?.(
|
|
12805
|
+
this.engine.setIdleFrameRateExempt?.(Xl, e);
|
|
12806
12806
|
}
|
|
12807
12807
|
isValidPointIndex(e) {
|
|
12808
12808
|
return Number.isInteger(e) && e >= 0 && e < this.points.length;
|
|
@@ -12857,13 +12857,13 @@ class Ql {
|
|
|
12857
12857
|
return { x: e.x, y: e.y, z: e.z };
|
|
12858
12858
|
}
|
|
12859
12859
|
toQuaternion(e) {
|
|
12860
|
-
return new
|
|
12860
|
+
return new Ie(e.x, e.y, e.z, e.w).normalize();
|
|
12861
12861
|
}
|
|
12862
12862
|
fromQuaternion(e) {
|
|
12863
12863
|
return { x: e.x, y: e.y, z: e.z, w: e.w };
|
|
12864
12864
|
}
|
|
12865
12865
|
}
|
|
12866
|
-
class
|
|
12866
|
+
class Jl {
|
|
12867
12867
|
engine;
|
|
12868
12868
|
miniMapCamera = null;
|
|
12869
12869
|
miniMapRenderer = null;
|
|
@@ -13255,7 +13255,7 @@ class $l {
|
|
|
13255
13255
|
c > Math.PI && (c -= 2 * Math.PI), c < -Math.PI && (c += 2 * Math.PI);
|
|
13256
13256
|
const h = n.target ? Math.max(i.position.distanceTo(n.target), 1e-3) : 10, u = this.engine.controlModule?.firstPersonControls, p = this.getThirdPersonControl();
|
|
13257
13257
|
if (u?.enabled) {
|
|
13258
|
-
const M = new d(0, 1, 0), x = new
|
|
13258
|
+
const M = new d(0, 1, 0), x = new Ie().setFromAxisAngle(M, -c);
|
|
13259
13259
|
i.quaternion.premultiply(x), i.up.copy(M), i.updateMatrixWorld(!0);
|
|
13260
13260
|
const m = i.position.clone().add(i.getWorldDirection(new d()).multiplyScalar(h));
|
|
13261
13261
|
n.target?.copy(m), u.syncRotationStateFromCamera?.(), u.syncSharedTargetFromCamera?.();
|
|
@@ -13265,7 +13265,7 @@ class $l {
|
|
|
13265
13265
|
p.rotateYaw(-c);
|
|
13266
13266
|
return;
|
|
13267
13267
|
}
|
|
13268
|
-
const g = i.getWorldDirection(new d()).multiplyScalar(h), f = new
|
|
13268
|
+
const g = i.getWorldDirection(new d()).multiplyScalar(h), f = new vo().setFromVector3(g);
|
|
13269
13269
|
f.theta -= c, g.setFromSpherical(f), n.target?.copy(i.position).add(g), n.update?.(), this.engine.controlModule?.firstPersonControls?.syncRotationStateFromCamera?.();
|
|
13270
13270
|
}
|
|
13271
13271
|
drawOverlay() {
|
|
@@ -13324,7 +13324,7 @@ class $l {
|
|
|
13324
13324
|
this.miniMapContainer && (this.miniMapContainer.removeEventListener("wheel", this.onWheel), this.miniMapContainer.removeEventListener("mousedown", this.onMouseDown), this.miniMapContainer.removeEventListener("mousemove", this.onMouseMove), this.miniMapContainer.removeEventListener("mouseup", this.onMouseUp), this.miniMapContainer.removeEventListener("pointerdown", this.onMouseDown), this.miniMapContainer.removeEventListener("pointermove", this.onMouseMove), this.miniMapContainer.removeEventListener("pointerup", this.onMouseUp), this.miniMapContainer.removeEventListener("pointercancel", this.onMouseUp), this.miniMapContainer.removeEventListener("mouseenter", this.onMouseEnter), this.miniMapContainer.removeEventListener("mouseleave", this.onMouseLeave)), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("pointermove", this.onMouseMove), window.removeEventListener("pointerup", this.onMouseUp), window.removeEventListener("pointercancel", this.onMouseUp), window.removeEventListener("resize", this.onWindowResize), this.sizeToggleButton?.removeEventListener("click", this.onSizeToggleClick), this.resizeHandle?.removeEventListener("mousedown", this.onResizeHandleMouseDown), this.resizeHandle?.removeEventListener("pointerdown", this.onResizeHandleMouseDown), this.modelSelect?.removeEventListener("change", this.onModelChange), this.levelSelect?.removeEventListener("change", this.onLevelChange), this.engine.events?.off?.(this.loadingCompletedEventName, this.onLoadingCompleted), this.miniMapRenderer && (this.miniMapRenderer.dispose(), this.miniMapRenderer = null), this.miniMapContainer && (this.miniMapContainer.remove(), this.miniMapContainer = null), this.miniMapCamera = null, this.overlayCtx = null, this.overlayCanvas = null, this.levelToolbar = null, this.sizeToggleButton = null, this.resizeHandle = null, this.modelSelect = null, this.levelSelect = null, this.levelModels = [], this.levelDataSignature = "", this.selectedModelUrl = null;
|
|
13325
13325
|
}
|
|
13326
13326
|
}
|
|
13327
|
-
class
|
|
13327
|
+
class ec {
|
|
13328
13328
|
engine;
|
|
13329
13329
|
constructor(e) {
|
|
13330
13330
|
this.engine = e;
|
|
@@ -13621,7 +13621,7 @@ class Zl {
|
|
|
13621
13621
|
return Math.abs(s.dot(e)) < 0.999 ? s : new d(1, 0, 0);
|
|
13622
13622
|
}
|
|
13623
13623
|
}
|
|
13624
|
-
class
|
|
13624
|
+
class tc {
|
|
13625
13625
|
engine;
|
|
13626
13626
|
constructor(e) {
|
|
13627
13627
|
}
|
|
@@ -13629,7 +13629,7 @@ class Jl {
|
|
|
13629
13629
|
}
|
|
13630
13630
|
}
|
|
13631
13631
|
const zn = "bim-engine:link-element-2d3d-state", Rn = "link-element-2d3d";
|
|
13632
|
-
class
|
|
13632
|
+
class ic {
|
|
13633
13633
|
engine;
|
|
13634
13634
|
constructor(e) {
|
|
13635
13635
|
this.engine = e, this.active();
|
|
@@ -13663,7 +13663,7 @@ class ec {
|
|
|
13663
13663
|
this.engine?.setIdleFrameRateExempt?.(Rn, t);
|
|
13664
13664
|
};
|
|
13665
13665
|
}
|
|
13666
|
-
class
|
|
13666
|
+
class nc {
|
|
13667
13667
|
engine;
|
|
13668
13668
|
constructor(e) {
|
|
13669
13669
|
this.engine = e, this.active();
|
|
@@ -13717,7 +13717,7 @@ const ht = {
|
|
|
13717
13717
|
EncodingComplete: "encoding-complete",
|
|
13718
13718
|
EncodingError: "encoding-error"
|
|
13719
13719
|
};
|
|
13720
|
-
class
|
|
13720
|
+
class sc {
|
|
13721
13721
|
engine;
|
|
13722
13722
|
apiKey;
|
|
13723
13723
|
baseURL = "https://api.deepseek.com";
|
|
@@ -13905,30 +13905,38 @@ class ic {
|
|
|
13905
13905
|
}
|
|
13906
13906
|
}
|
|
13907
13907
|
}
|
|
13908
|
-
const
|
|
13908
|
+
const yi = 1 / 0.3048, oc = 1, Mi = 1.8, On = 5, rc = 0.1, Fn = 5, Ut = 1e-6, Nn = /* @__PURE__ */ new Set([
|
|
13909
13909
|
"dynamic-elevation-bar-area",
|
|
13910
13910
|
"dynamic-elevation-guest-area",
|
|
13911
13911
|
"dynamic-elevation-door-head-area"
|
|
13912
|
-
]),
|
|
13912
|
+
]), ac = ["台面"], lc = ["咖啡机"], Hn = ["门店编号"], cc = ["发光logo", "发光Logo", "英中组合"];
|
|
13913
13913
|
class hc {
|
|
13914
|
+
/** v2 引擎实例,用于读取模型、八叉树和场景对象。 */
|
|
13914
13915
|
engine;
|
|
13916
|
+
/** 复用的吧台射线检测器,避免每次生成视图重复分配对象。 */
|
|
13915
13917
|
barCameraRaycaster = new de();
|
|
13918
|
+
/**
|
|
13919
|
+
* 创建动态立面视图生成器。
|
|
13920
|
+
* @param engine v2 引擎实例,必须提供模型场景查询能力;射线避障还需要 octreeBox。
|
|
13921
|
+
*/
|
|
13916
13922
|
constructor(e) {
|
|
13917
13923
|
this.engine = e;
|
|
13918
13924
|
}
|
|
13919
13925
|
/**
|
|
13920
13926
|
* 将动态生成的立面视图同步回模型视图集合。
|
|
13921
13927
|
* 这里会保留原有静态视图,并替换掉同 id 的动态视图结果。
|
|
13928
|
+
* @param model 当前模型数据;为空时直接返回 null。
|
|
13929
|
+
* @returns 同步后的模型视图集合,输入为空时返回 null。
|
|
13922
13930
|
*/
|
|
13923
13931
|
syncModelViews(e) {
|
|
13924
13932
|
if (e == null)
|
|
13925
13933
|
return null;
|
|
13926
13934
|
const t = e.views ?? {}, i = (t.Elevations ?? []).filter((o) => {
|
|
13927
13935
|
const r = o?.Id ?? o?.id;
|
|
13928
|
-
return !
|
|
13936
|
+
return !Nn.has(String(r ?? ""));
|
|
13929
13937
|
}), n = (t.DynamicViews ?? []).filter((o) => {
|
|
13930
13938
|
const r = o?.Id ?? o?.id, l = String(r ?? "");
|
|
13931
|
-
return !
|
|
13939
|
+
return !Nn.has(l) && !l.startsWith("dynamic-elevation-door-head-area");
|
|
13932
13940
|
}), s = this.generate(e);
|
|
13933
13941
|
return e.views = {
|
|
13934
13942
|
...t,
|
|
@@ -13941,11 +13949,13 @@ class hc {
|
|
|
13941
13949
|
}
|
|
13942
13950
|
/**
|
|
13943
13951
|
* 从模型节点中提取关键对象包围盒,并按预设规则生成动态立面视图。
|
|
13952
|
+
* @param model 当前模型数据,必须包含非空的 nodesMap 和模型 url。
|
|
13953
|
+
* @returns 本次生成的吧台区、客区和门头区运行时视图列表。
|
|
13944
13954
|
*/
|
|
13945
13955
|
generate(e) {
|
|
13946
13956
|
if (!(e?.nodesMap instanceof Map) || e.nodesMap.size === 0)
|
|
13947
13957
|
return [];
|
|
13948
|
-
const t = this.collectWorldBoxesByKeywords(e,
|
|
13958
|
+
const t = this.collectWorldBoxesByKeywords(e, ac), i = this.collectWorldBoxesByKeywords(e, lc), n = this.collectWorldBoxesByKeywords(e, Hn), s = this.mergeWorldBoxes(i), o = this.mergeWorldBoxes(n), r = i.length > 0 && n.length > 0 ? this.filterCountertopBoxesByReferences(
|
|
13949
13959
|
t,
|
|
13950
13960
|
i,
|
|
13951
13961
|
n
|
|
@@ -13953,14 +13963,67 @@ class hc {
|
|
|
13953
13963
|
if (l && s && o) {
|
|
13954
13964
|
const u = this.createBarAreaView(l, s, o), p = this.createGuestAreaView(l, s, o);
|
|
13955
13965
|
u && h.push(u), p && h.push(p);
|
|
13966
|
+
} else if (r.length === 0 && o) {
|
|
13967
|
+
const u = s ? s.getCenter(new d()) : o.getCenter(new d()), p = this.getKeywordNodeWorldZAxis(
|
|
13968
|
+
e,
|
|
13969
|
+
Hn,
|
|
13970
|
+
u
|
|
13971
|
+
), g = this.extractHorizontalZAxis(Se(this.engine, e.url)) ?? new d(0, 0, 1), f = p ?? {
|
|
13972
|
+
box: o,
|
|
13973
|
+
zAxis: g
|
|
13974
|
+
}, M = this.createViewsFromStoreNumberZAxis(
|
|
13975
|
+
s,
|
|
13976
|
+
f.box,
|
|
13977
|
+
f.zAxis
|
|
13978
|
+
);
|
|
13979
|
+
h.push(...M);
|
|
13980
|
+
}
|
|
13981
|
+
if (o) {
|
|
13982
|
+
const u = l ?? o;
|
|
13983
|
+
c.forEach((p, g) => {
|
|
13984
|
+
const f = this.createDoorHeadView(
|
|
13985
|
+
p,
|
|
13986
|
+
u,
|
|
13987
|
+
o,
|
|
13988
|
+
g + 1
|
|
13989
|
+
);
|
|
13990
|
+
f && h.push(f);
|
|
13991
|
+
});
|
|
13956
13992
|
}
|
|
13957
|
-
return
|
|
13958
|
-
|
|
13959
|
-
|
|
13960
|
-
|
|
13993
|
+
return h;
|
|
13994
|
+
}
|
|
13995
|
+
/**
|
|
13996
|
+
* 距离过滤后没有有效台面时,以门店编号世界矩阵的 Z 轴生成吧台区和客区视图。
|
|
13997
|
+
* 吧台使用 Z 轴正向及原有射线避障,客区使用 Z 轴反向固定偏移。
|
|
13998
|
+
* @param coffeeMachineBox 合并后的咖啡机世界包围盒;允许为空,为空时吧台使用固定偏移。
|
|
13999
|
+
* @param storeNumberBox 作为视图原点和关注范围基准的门店编号世界包围盒。
|
|
14000
|
+
* @param storeNumberZAxis 门店编号世界矩阵投影到 x/z 平面后的归一化 Z 轴。
|
|
14001
|
+
* @returns 成功创建的吧台区和客区视图;单个视图无效时不会加入列表。
|
|
14002
|
+
*/
|
|
14003
|
+
createViewsFromStoreNumberZAxis(e, t, i) {
|
|
14004
|
+
const n = t.getCenter(new d()), s = i.clone().setLength(2), o = e ? this.createBarCameraPosition(n, s, e) : this.createCameraPosition(n, s), r = o.clone().sub(s), l = i.clone().setLength(-2), c = this.createCameraPosition(n, l), h = e ? t.clone().union(e) : t.clone(), u = [], p = this.createDynamicElevationView(
|
|
14005
|
+
"dynamic-elevation-bar-area",
|
|
14006
|
+
"吧台区",
|
|
14007
|
+
n,
|
|
14008
|
+
o,
|
|
14009
|
+
r,
|
|
14010
|
+
h
|
|
14011
|
+
), g = this.createDynamicElevationView(
|
|
14012
|
+
"dynamic-elevation-guest-area",
|
|
14013
|
+
"客区",
|
|
14014
|
+
n,
|
|
14015
|
+
c,
|
|
14016
|
+
n,
|
|
14017
|
+
h
|
|
14018
|
+
);
|
|
14019
|
+
return p && u.push(p), g && u.push(g), u;
|
|
13961
14020
|
}
|
|
13962
14021
|
/**
|
|
13963
14022
|
* 吧台区立面:先用门店编号确定基准边,吧台区直接使用该基准边。
|
|
14023
|
+
* @param countertopBox 通过 5 米规则筛选后合并得到的台面世界包围盒。
|
|
14024
|
+
* @param coffeeMachineBox 合并后的咖啡机世界包围盒,用作射线起点和关注范围。
|
|
14025
|
+
* @param storeNumberBox 合并后的门店编号世界包围盒,用于确定台面基准边。
|
|
14026
|
+
* @returns 可用的吧台区视图;台面无法形成有效基准边时返回 null。
|
|
13964
14027
|
*/
|
|
13965
14028
|
createBarAreaView(e, t, i) {
|
|
13966
14029
|
const n = this.getGroundEdges(e), s = i.getCenter(new d()), o = this.getNearestEdgeFromPoint(n, s);
|
|
@@ -13982,13 +14045,17 @@ class hc {
|
|
|
13982
14045
|
);
|
|
13983
14046
|
}
|
|
13984
14047
|
/**
|
|
13985
|
-
*
|
|
14048
|
+
* 客区立面:使用门店编号确定台面基准边,再沿该边内侧生成固定偏移视图。
|
|
14049
|
+
* @param countertopBox 通过 5 米规则筛选后合并得到的台面世界包围盒。
|
|
14050
|
+
* @param coffeeMachineBox 合并后的咖啡机世界包围盒,仅用于扩展视图关注范围。
|
|
14051
|
+
* @param storeNumberBox 合并后的门店编号世界包围盒,用于确定客区基准边。
|
|
14052
|
+
* @returns 可用的客区视图;台面无法形成有效基准边时返回 null。
|
|
13986
14053
|
*/
|
|
13987
14054
|
createGuestAreaView(e, t, i) {
|
|
13988
14055
|
const n = this.getGroundEdges(e), s = i.getCenter(new d()), o = this.getNearestEdgeFromPoint(n, s);
|
|
13989
14056
|
if (!o)
|
|
13990
14057
|
return null;
|
|
13991
|
-
o.normal.setLength(-2)
|
|
14058
|
+
o.normal.setLength(-2);
|
|
13992
14059
|
const r = o.center.clone(), l = this.createCameraPosition(r, o.normal), c = e.clone().union(t);
|
|
13993
14060
|
return this.createDynamicElevationView(
|
|
13994
14061
|
"dynamic-elevation-guest-area",
|
|
@@ -14001,14 +14068,17 @@ class hc {
|
|
|
14001
14068
|
}
|
|
14002
14069
|
/**
|
|
14003
14070
|
* 门头区立面:先取门头最长的两条边,再从中选择距离门店编号最远的一侧。
|
|
14071
|
+
* @param doorHeadBox 当前门头构件的世界包围盒。
|
|
14072
|
+
* @param referenceBox 优先使用筛选后的台面包围盒;台面缺失时使用门店编号包围盒兜底。
|
|
14073
|
+
* @param storeNumberBox 合并后的门店编号世界包围盒,用于选择门头观察侧。
|
|
14074
|
+
* @param index 门头视图从 1 开始的序号,用于生成唯一 id 和名称。
|
|
14075
|
+
* @returns 可用的门头区视图;门头没有有效水平边时返回 null。
|
|
14004
14076
|
*/
|
|
14005
14077
|
createDoorHeadView(e, t, i, n) {
|
|
14006
14078
|
const s = this.getGroundEdges(e);
|
|
14007
14079
|
if (s.length === 0)
|
|
14008
14080
|
return null;
|
|
14009
|
-
const o = Math.max(...s.map((g) => g.length)), r = s.filter((g) => Math.abs(g.length - o) < 1e-6), l = i.getCenter(new d());
|
|
14010
|
-
t.getCenter(new d());
|
|
14011
|
-
const c = this.getFarthestEdgeFromPoint(r, l);
|
|
14081
|
+
const o = Math.max(...s.map((g) => g.length)), r = s.filter((g) => Math.abs(g.length - o) < 1e-6), l = i.getCenter(new d()), c = this.getFarthestEdgeFromPoint(r, l);
|
|
14012
14082
|
if (!c)
|
|
14013
14083
|
return null;
|
|
14014
14084
|
const h = c.center.clone(), u = this.createCameraPosition(h, c.normal.clone().setLength(10)), p = e.clone().union(t);
|
|
@@ -14023,6 +14093,10 @@ class hc {
|
|
|
14023
14093
|
}
|
|
14024
14094
|
/**
|
|
14025
14095
|
* 用门店编号确定基准边,再用咖啡机在基准边和对边之间判断吧台区方向。
|
|
14096
|
+
* @param countertopBox 台面世界包围盒,用于构造四条水平边。
|
|
14097
|
+
* @param coffeeMachineBox 咖啡机世界包围盒,用于判断吧台所在一侧。
|
|
14098
|
+
* @param storeNumberBox 门店编号世界包围盒,用于选择初始基准边。
|
|
14099
|
+
* @returns 吧台边和客区边;任一几何关系无法确定时返回 null。
|
|
14026
14100
|
*/
|
|
14027
14101
|
getBarAndGuestEdges(e, t, i) {
|
|
14028
14102
|
const n = this.getGroundEdges(e);
|
|
@@ -14042,43 +14116,57 @@ class hc {
|
|
|
14042
14116
|
}
|
|
14043
14117
|
/**
|
|
14044
14118
|
* 相机始终在观察面外侧偏移固定距离,且高度统一锁定为 1.8 米。
|
|
14119
|
+
* @param sectionOrigin 观察面的世界坐标基准点,单位:米。
|
|
14120
|
+
* @param normal 从观察面指向相机的水平偏移向量;向量长度会参与最终偏移。
|
|
14121
|
+
* @returns 固定高度下的 Three.js 世界坐标相机位置。
|
|
14045
14122
|
*/
|
|
14046
14123
|
createCameraPosition(e, t) {
|
|
14047
|
-
const i = e.clone().add(t.clone().multiplyScalar(
|
|
14048
|
-
return i.y =
|
|
14124
|
+
const i = e.clone().add(t.clone().multiplyScalar(oc));
|
|
14125
|
+
return i.y = Mi, i;
|
|
14049
14126
|
}
|
|
14050
14127
|
/**
|
|
14051
14128
|
* 从咖啡机位置沿吧台相机外移方向探测障碍物,命中时将相机放在碰撞面前方。
|
|
14052
14129
|
* 射线和最终相机均锁定为 1.8 米高度,且不受当前交互视图裁剪状态影响。
|
|
14130
|
+
* @param sectionOrigin 吧台观察面的世界坐标基准点,用于计算无碰撞时的固定位置。
|
|
14131
|
+
* @param cameraOffset 从吧台向相机方向的水平偏移向量,同时决定射线方向。
|
|
14132
|
+
* @param coffeeMachineBox 咖啡机世界包围盒;其中心点的 x/z 坐标作为射线起点。
|
|
14133
|
+
* @returns 射线命中时返回从碰撞点朝观察目标前移 0.1 米的位置,否则返回固定偏移位置。
|
|
14053
14134
|
*/
|
|
14054
14135
|
createBarCameraPosition(e, t, i) {
|
|
14055
14136
|
const n = this.createCameraPosition(e, t), s = this.engine.octreeBox?.rayInterationModel;
|
|
14056
14137
|
if (typeof s != "function" || i.isEmpty())
|
|
14057
14138
|
return n;
|
|
14058
14139
|
const o = t.clone();
|
|
14059
|
-
if (o.y = 0, o.lengthSq() <=
|
|
14140
|
+
if (o.y = 0, o.lengthSq() <= Ut)
|
|
14060
14141
|
return n;
|
|
14061
14142
|
o.normalize();
|
|
14062
14143
|
const r = i.getCenter(new d());
|
|
14063
|
-
r.y =
|
|
14144
|
+
r.y = Mi, this.barCameraRaycaster.near = 0, this.barCameraRaycaster.far = On, this.barCameraRaycaster.set(r, o);
|
|
14064
14145
|
const c = (s.call(
|
|
14065
14146
|
this.engine.octreeBox,
|
|
14066
14147
|
this.barCameraRaycaster,
|
|
14067
14148
|
!0,
|
|
14068
14149
|
!1,
|
|
14069
14150
|
!1
|
|
14070
|
-
) ?? []).find((u) => u.point instanceof d && u.distance >
|
|
14151
|
+
) ?? []).find((u) => u.point instanceof d && u.distance > Ut && u.distance < On && !i.containsPoint(u.point));
|
|
14071
14152
|
if (!c)
|
|
14072
14153
|
return n;
|
|
14073
14154
|
const h = Math.max(
|
|
14074
|
-
c.distance -
|
|
14075
|
-
|
|
14155
|
+
c.distance - rc,
|
|
14156
|
+
Ut
|
|
14076
14157
|
);
|
|
14077
|
-
return r.clone().add(o.multiplyScalar(h)).setY(
|
|
14158
|
+
return r.clone().add(o.multiplyScalar(h)).setY(Mi);
|
|
14078
14159
|
}
|
|
14079
14160
|
/**
|
|
14080
14161
|
* 将 three.js 空间中的观察参数转换成运行时立面视图结构。
|
|
14081
14162
|
* 这里会强制把目标点拉平到相机高度,保证视线为标准水平立面方向。
|
|
14163
|
+
* @param id 动态视图唯一标识,同时写入 Id 和 id 字段。
|
|
14164
|
+
* @param name 动态视图显示名称,同时写入 Name 和 name 字段。
|
|
14165
|
+
* @param sectionOrigin Three.js 世界坐标中的立面基准点,单位:米。
|
|
14166
|
+
* @param cameraPosition Three.js 世界坐标中的相机位置,单位:米。
|
|
14167
|
+
* @param target Three.js 世界坐标中的初始目标点;高度会被相机高度覆盖。
|
|
14168
|
+
* @param focusBox Three.js 世界坐标中的关注范围,必须为非空包围盒。
|
|
14169
|
+
* @returns 完整运行时视图;相机方向为零或关注范围为空时返回 null。
|
|
14082
14170
|
*/
|
|
14083
14171
|
createDynamicElevationView(e, t, i, n, s, o) {
|
|
14084
14172
|
const r = s.clone();
|
|
@@ -14110,33 +14198,122 @@ class hc {
|
|
|
14110
14198
|
__dynamic: !0
|
|
14111
14199
|
};
|
|
14112
14200
|
}
|
|
14113
|
-
/**
|
|
14201
|
+
/**
|
|
14202
|
+
* 选取距参考点最近的关键构件,并从其绝对世界矩阵提取水平 Z 轴。
|
|
14203
|
+
* 实例优先使用原始实例矩阵,普通构件回退到自身矩阵或模型根矩阵。
|
|
14204
|
+
* @param model 当前模型数据,提供 nodesMap 和 url。
|
|
14205
|
+
* @param keywords 构件名称匹配关键字,匹配前统一去空白并转为小写。
|
|
14206
|
+
* @param referencePoint Three.js 世界坐标中的水平距离参考点,单位:米。
|
|
14207
|
+
* @returns 最近有效构件的包围盒和水平 Z 轴;没有有效候选时返回 null。
|
|
14208
|
+
*/
|
|
14209
|
+
getKeywordNodeWorldZAxis(e, t, i) {
|
|
14210
|
+
const n = e?.nodesMap;
|
|
14211
|
+
if (!(n instanceof Map))
|
|
14212
|
+
return null;
|
|
14213
|
+
const s = Se(this.engine, e.url);
|
|
14214
|
+
let o = null, r = Number.POSITIVE_INFINITY;
|
|
14215
|
+
return n.forEach((l) => {
|
|
14216
|
+
const c = this.normalizeName(this.getNodeName(l));
|
|
14217
|
+
if (!c || !t.some((f) => c.includes(this.normalizeName(f))))
|
|
14218
|
+
return;
|
|
14219
|
+
const h = this.getNodeWorldBox(l, s), u = this.getNodeWorldZAxis(l, s);
|
|
14220
|
+
if (!h || h.isEmpty() || !u)
|
|
14221
|
+
return;
|
|
14222
|
+
const p = h.getCenter(new d()), g = this.getHorizontalDistanceSquared(p, i);
|
|
14223
|
+
g < r && (r = g, o = { box: h, zAxis: u });
|
|
14224
|
+
}), o;
|
|
14225
|
+
}
|
|
14226
|
+
/**
|
|
14227
|
+
* 从节点可用的绝对变换中提取世界 Z 轴,并投影到引擎水平面。
|
|
14228
|
+
* @param node 模型节点;可包含实例索引、节点矩阵或 infos 中的矩阵。
|
|
14229
|
+
* @param modelMatrix 模型根节点的世界矩阵,用于将节点局部矩阵转换到世界空间。
|
|
14230
|
+
* @returns 归一化后的水平 Z 轴;无法取得有效方向时返回 null。
|
|
14231
|
+
*/
|
|
14232
|
+
getNodeWorldZAxis(e, t) {
|
|
14233
|
+
const i = Array.isArray(e?.indexes) ? e.indexes[0] : null;
|
|
14234
|
+
if (Array.isArray(i) && i.length >= 2) {
|
|
14235
|
+
const s = _e(this.engine, i[0]), o = s?.matrixsClone?.[i[1]] ?? s?.matrixs?.[i[1]];
|
|
14236
|
+
if (s instanceof V && o instanceof H) {
|
|
14237
|
+
s.updateWorldMatrix(!0, !1);
|
|
14238
|
+
const r = s.matrixWorld.clone().multiply(o), l = this.extractHorizontalZAxis(r);
|
|
14239
|
+
if (l)
|
|
14240
|
+
return l;
|
|
14241
|
+
}
|
|
14242
|
+
}
|
|
14243
|
+
const n = e?.matrix ?? e?.info?.matrix ?? e?.infos?.[0]?.matrix;
|
|
14244
|
+
if (Array.isArray(n) && n.length === 16) {
|
|
14245
|
+
const s = new H().fromArray(n), o = this.extractHorizontalZAxis(t.clone().multiply(s));
|
|
14246
|
+
if (o)
|
|
14247
|
+
return o;
|
|
14248
|
+
}
|
|
14249
|
+
return this.extractHorizontalZAxis(t);
|
|
14250
|
+
}
|
|
14251
|
+
/**
|
|
14252
|
+
* 提取矩阵 Z 轴并去除高度分量,避免特殊模型倾斜导致相机俯仰。
|
|
14253
|
+
* @param matrix 需要解析的 Three.js 变换矩阵。
|
|
14254
|
+
* @returns 投影到 x/z 平面并归一化的 Z 轴;水平投影长度为零时返回 null。
|
|
14255
|
+
*/
|
|
14256
|
+
extractHorizontalZAxis(e) {
|
|
14257
|
+
const t = new d().setFromMatrixColumn(e, 2);
|
|
14258
|
+
return t.y = 0, t.lengthSq() <= Ut ? null : t.normalize();
|
|
14259
|
+
}
|
|
14260
|
+
/**
|
|
14261
|
+
* 合并有效世界包围盒,空集合保持为 null。
|
|
14262
|
+
* @param boxes 已转换到 Three.js 世界坐标的包围盒列表。
|
|
14263
|
+
* @returns 所有输入包围盒的并集;输入为空时返回 null。
|
|
14264
|
+
*/
|
|
14114
14265
|
mergeWorldBoxes(e) {
|
|
14115
14266
|
return e.length === 0 ? null : e.reduce((t, i) => t.union(i), e[0].clone());
|
|
14116
14267
|
}
|
|
14117
14268
|
/**
|
|
14118
14269
|
* 仅保留水平投影边缘同时靠近咖啡机和门店编号的台面。
|
|
14119
14270
|
* 每类参考对象只需存在一个中心点距台面最近边不超过 5 米即可。
|
|
14271
|
+
* @param countertopBoxes 待筛选的独立台面世界包围盒列表。
|
|
14272
|
+
* @param coffeeMachineBoxes 独立咖啡机世界包围盒列表,用其中心点参与距离判断。
|
|
14273
|
+
* @param storeNumberBoxes 独立门店编号世界包围盒列表,用其中心点参与距离判断。
|
|
14274
|
+
* @returns 同时满足咖啡机距离和门店编号距离限制的台面包围盒列表。
|
|
14120
14275
|
*/
|
|
14121
14276
|
filterCountertopBoxesByReferences(e, t, i) {
|
|
14122
|
-
const n =
|
|
14123
|
-
return e.filter((
|
|
14124
|
-
const
|
|
14125
|
-
|
|
14277
|
+
const n = t.map((o) => o.getCenter(new d())), s = i.map((o) => o.getCenter(new d()));
|
|
14278
|
+
return e.filter((o) => {
|
|
14279
|
+
const r = this.getGroundEdges(o), l = this.getNearestHorizontalEdgeDistance(
|
|
14280
|
+
r,
|
|
14281
|
+
n
|
|
14282
|
+
), c = this.getNearestHorizontalEdgeDistance(
|
|
14283
|
+
r,
|
|
14284
|
+
s
|
|
14285
|
+
);
|
|
14286
|
+
return l <= Fn && c <= Fn;
|
|
14126
14287
|
});
|
|
14127
14288
|
}
|
|
14128
|
-
/**
|
|
14129
|
-
|
|
14130
|
-
|
|
14289
|
+
/**
|
|
14290
|
+
* 计算一组参考点到台面水平边缘的最近距离,空输入返回正无穷。
|
|
14291
|
+
* @param edges 台面包围盒投影到 x/z 平面后的四条边。
|
|
14292
|
+
* @param points 需要与台面边缘比较的 Three.js 世界坐标参考点。
|
|
14293
|
+
* @returns 最近水平距离,单位:米;任一输入集合为空时返回正无穷。
|
|
14294
|
+
*/
|
|
14295
|
+
getNearestHorizontalEdgeDistance(e, t) {
|
|
14296
|
+
let i = Number.POSITIVE_INFINITY;
|
|
14297
|
+
return t.forEach((n) => {
|
|
14298
|
+
e.forEach((s) => {
|
|
14299
|
+
i = Math.min(
|
|
14300
|
+
i,
|
|
14301
|
+
this.getHorizontalDistanceToEdgeSquared(s, n)
|
|
14302
|
+
);
|
|
14303
|
+
});
|
|
14304
|
+
}), Number.isFinite(i) ? Math.sqrt(i) : Number.POSITIVE_INFINITY;
|
|
14131
14305
|
}
|
|
14132
14306
|
/**
|
|
14133
14307
|
* 按关键字遍历节点名称,返回每个命中节点各自的世界坐标包围盒。
|
|
14308
|
+
* @param model 当前模型数据,提供 nodesMap、url 和节点包围盒信息。
|
|
14309
|
+
* @param keywords 构件名称匹配关键字,任意关键字命中即视为候选节点。
|
|
14310
|
+
* @returns 名称命中且具有有效包围盒的独立世界包围盒列表。
|
|
14134
14311
|
*/
|
|
14135
14312
|
collectWorldBoxesByKeywords(e, t) {
|
|
14136
14313
|
const i = e?.nodesMap;
|
|
14137
14314
|
if (!(i instanceof Map))
|
|
14138
14315
|
return [];
|
|
14139
|
-
const n =
|
|
14316
|
+
const n = Se(this.engine, e.url), s = [];
|
|
14140
14317
|
return i.forEach((o) => {
|
|
14141
14318
|
const r = this.normalizeName(this.getNodeName(o));
|
|
14142
14319
|
if (!r || !t.some((c) => r.includes(this.normalizeName(c))))
|
|
@@ -14147,6 +14324,8 @@ class hc {
|
|
|
14147
14324
|
}
|
|
14148
14325
|
/**
|
|
14149
14326
|
* 优先从 infos 中读取业务名称,回退到节点自身名称。
|
|
14327
|
+
* @param node 模型节点,允许名称位于 infos[0].name 或 node.name。
|
|
14328
|
+
* @returns 可用于关键字匹配的原始名称;没有有效名称时返回空字符串。
|
|
14150
14329
|
*/
|
|
14151
14330
|
getNodeName(e) {
|
|
14152
14331
|
const t = Array.isArray(e?.infos) ? e.infos[0]?.name : void 0;
|
|
@@ -14154,12 +14333,17 @@ class hc {
|
|
|
14154
14333
|
}
|
|
14155
14334
|
/**
|
|
14156
14335
|
* 名称匹配前统一去空白并转小写,降低建模命名差异带来的影响。
|
|
14336
|
+
* @param name 待标准化的构件名称。
|
|
14337
|
+
* @returns 删除全部空白字符并转换为小写后的名称。
|
|
14157
14338
|
*/
|
|
14158
14339
|
normalizeName(e) {
|
|
14159
14340
|
return String(e ?? "").replace(/\s+/g, "").toLowerCase();
|
|
14160
14341
|
}
|
|
14161
14342
|
/**
|
|
14162
14343
|
* 收集节点上可能存在的多个包围盒来源,并统一转换到模型世界坐标后合并。
|
|
14344
|
+
* @param node 模型节点,包围盒可来自 infos、info 或节点自身。
|
|
14345
|
+
* @param modelMatrix 模型根节点的世界矩阵,用于转换节点包围盒。
|
|
14346
|
+
* @returns 节点全部有效包围盒的世界坐标并集;不存在有效包围盒时返回 null。
|
|
14163
14347
|
*/
|
|
14164
14348
|
getNodeWorldBox(e, t) {
|
|
14165
14349
|
const i = [
|
|
@@ -14178,6 +14362,8 @@ class hc {
|
|
|
14178
14362
|
/**
|
|
14179
14363
|
* 取包围盒落地平面上的四条边中心点与外法线。
|
|
14180
14364
|
* 这里使用 x/z 平面作为水平面,y 轴代表高度。
|
|
14365
|
+
* @param box Three.js 世界坐标包围盒。
|
|
14366
|
+
* @returns 西、东、南、北四条水平投影边;包围盒为空时返回空数组。
|
|
14181
14367
|
*/
|
|
14182
14368
|
getGroundEdges(e) {
|
|
14183
14369
|
if (!e || e.isEmpty())
|
|
@@ -14192,6 +14378,9 @@ class hc {
|
|
|
14192
14378
|
}
|
|
14193
14379
|
/**
|
|
14194
14380
|
* 找出在水平面上距离目标点最远的边,用于确定观察面。
|
|
14381
|
+
* @param edges 可参与选择的水平投影边列表。
|
|
14382
|
+
* @param point Three.js 世界坐标中的距离参考点。
|
|
14383
|
+
* @returns 边中心距参考点最远的边;输入边列表为空时返回 null。
|
|
14195
14384
|
*/
|
|
14196
14385
|
getFarthestEdgeFromPoint(e, t) {
|
|
14197
14386
|
return e.reduce((i, n) => {
|
|
@@ -14203,6 +14392,9 @@ class hc {
|
|
|
14203
14392
|
}
|
|
14204
14393
|
/**
|
|
14205
14394
|
* 找出在水平面上距离目标点最近的边,用于确定基准边。
|
|
14395
|
+
* @param edges 可参与选择的水平投影边列表。
|
|
14396
|
+
* @param point Three.js 世界坐标中的距离参考点。
|
|
14397
|
+
* @returns 线段距参考点最近的边;输入边列表为空时返回 null。
|
|
14206
14398
|
*/
|
|
14207
14399
|
getNearestEdgeFromPoint(e, t) {
|
|
14208
14400
|
return e.reduce((i, n) => {
|
|
@@ -14214,6 +14406,9 @@ class hc {
|
|
|
14214
14406
|
}
|
|
14215
14407
|
/**
|
|
14216
14408
|
* 计算点到边线段的水平最短距离,避免只比较边中点导致边端附近的编号误选。
|
|
14409
|
+
* @param edge 包围盒在 x/z 水平面上的边。
|
|
14410
|
+
* @param point Three.js 世界坐标中的待测点。
|
|
14411
|
+
* @returns 点到边线段的水平距离平方,单位:平方米。
|
|
14217
14412
|
*/
|
|
14218
14413
|
getHorizontalDistanceToEdgeSquared(e, t) {
|
|
14219
14414
|
const i = e.length * 0.5, n = e.center.clone(), s = e.center.clone();
|
|
@@ -14223,6 +14418,9 @@ class hc {
|
|
|
14223
14418
|
}
|
|
14224
14419
|
/**
|
|
14225
14420
|
* 根据边 key 取其几何对边。
|
|
14421
|
+
* @param edges 同一包围盒生成的水平边列表。
|
|
14422
|
+
* @param key 当前边的方位标识。
|
|
14423
|
+
* @returns 与当前边相对的边;列表中不存在对应边时返回 null。
|
|
14226
14424
|
*/
|
|
14227
14425
|
getOppositeEdge(e, t) {
|
|
14228
14426
|
const i = {
|
|
@@ -14235,6 +14433,9 @@ class hc {
|
|
|
14235
14433
|
}
|
|
14236
14434
|
/**
|
|
14237
14435
|
* 仅计算水平面距离,忽略高度差。
|
|
14436
|
+
* @param from Three.js 世界坐标中的起点。
|
|
14437
|
+
* @param to Three.js 世界坐标中的终点。
|
|
14438
|
+
* @returns 两点在 x/z 平面上的距离平方,单位:平方米。
|
|
14238
14439
|
*/
|
|
14239
14440
|
getHorizontalDistanceSquared(e, t) {
|
|
14240
14441
|
const i = e.x - t.x, n = e.z - t.z;
|
|
@@ -14242,6 +14443,9 @@ class hc {
|
|
|
14242
14443
|
}
|
|
14243
14444
|
/**
|
|
14244
14445
|
* 用边法线和“远离吧台”的方向做点积,分数越高说明越符合预期朝向。
|
|
14446
|
+
* @param edge 待评分的水平投影边。
|
|
14447
|
+
* @param awayFromBar 指向远离吧台方向的水平向量。
|
|
14448
|
+
* @returns 两个方向的点积分数;参考方向为零向量时返回 0。
|
|
14245
14449
|
*/
|
|
14246
14450
|
getEdgeDirectionScore(e, t) {
|
|
14247
14451
|
return t.lengthSq() <= 1e-6 ? 0 : e.normal.dot(t.clone().normalize());
|
|
@@ -14251,16 +14455,20 @@ class hc {
|
|
|
14251
14455
|
* 1. 长度单位从米转英尺
|
|
14252
14456
|
* 2. 水平面从 x/z 映射为 Revit 的 X/Y
|
|
14253
14457
|
* 3. z 方向取反以匹配坐标朝向
|
|
14458
|
+
* @param point Three.js 世界坐标点,长度单位:米。
|
|
14459
|
+
* @returns Revit 坐标点,长度单位:英尺。
|
|
14254
14460
|
*/
|
|
14255
14461
|
toRevitPoint(e) {
|
|
14256
14462
|
return {
|
|
14257
|
-
X: e.x *
|
|
14258
|
-
Y: -e.z *
|
|
14259
|
-
Z: e.y *
|
|
14463
|
+
X: e.x * yi,
|
|
14464
|
+
Y: -e.z * yi,
|
|
14465
|
+
Z: e.y * yi
|
|
14260
14466
|
};
|
|
14261
14467
|
}
|
|
14262
14468
|
/**
|
|
14263
14469
|
* 方向向量只做轴映射,不做单位换算。
|
|
14470
|
+
* @param direction Three.js 坐标系中的归一化方向向量。
|
|
14471
|
+
* @returns 映射到 Revit 坐标轴后的方向向量。
|
|
14264
14472
|
*/
|
|
14265
14473
|
toRevitDirection(e) {
|
|
14266
14474
|
return {
|
|
@@ -14270,8 +14478,8 @@ class hc {
|
|
|
14270
14478
|
};
|
|
14271
14479
|
}
|
|
14272
14480
|
}
|
|
14273
|
-
const
|
|
14274
|
-
function
|
|
14481
|
+
const Vn = 16, Un = 0.02, vi = 1e-6, dc = 600;
|
|
14482
|
+
function Ws() {
|
|
14275
14483
|
return {
|
|
14276
14484
|
ceilingPlans: [],
|
|
14277
14485
|
elevations: [],
|
|
@@ -14280,7 +14488,7 @@ function Vs() {
|
|
|
14280
14488
|
sections: []
|
|
14281
14489
|
};
|
|
14282
14490
|
}
|
|
14283
|
-
function
|
|
14491
|
+
function Gs(a, e) {
|
|
14284
14492
|
return {
|
|
14285
14493
|
id: a.Id ?? a.id,
|
|
14286
14494
|
name: a.Name ?? a.name,
|
|
@@ -14297,7 +14505,7 @@ class uc {
|
|
|
14297
14505
|
}
|
|
14298
14506
|
/** 获取构件可见的动态视图,并可选择直接打开第一个匹配项。 */
|
|
14299
14507
|
getElementVisibleViews(e, t, i = !1) {
|
|
14300
|
-
const n =
|
|
14508
|
+
const n = Ws(), s = this.engine.models.find((p) => p.url === e);
|
|
14301
14509
|
if (!s)
|
|
14302
14510
|
return n;
|
|
14303
14511
|
const o = this.findModelNode(s, t), r = this.getNodeWorldBox(s, o), l = this.resolveViewTree(e);
|
|
@@ -14310,7 +14518,7 @@ class uc {
|
|
|
14310
14518
|
h = p.length > 0 ? p : [this.getNearestCameraCandidate(c, r)];
|
|
14311
14519
|
}
|
|
14312
14520
|
h.forEach((p) => {
|
|
14313
|
-
n.dynamicViews.push(
|
|
14521
|
+
n.dynamicViews.push(Gs(p.view, e));
|
|
14314
14522
|
});
|
|
14315
14523
|
const u = n.dynamicViews[0];
|
|
14316
14524
|
return i && u ? this.openView(u.url, u.id, () => {
|
|
@@ -14335,7 +14543,7 @@ class uc {
|
|
|
14335
14543
|
...Array.isArray(t.infos) ? t.infos.map((o) => o?.box) : [],
|
|
14336
14544
|
t.info?.box,
|
|
14337
14545
|
t.box
|
|
14338
|
-
], n =
|
|
14546
|
+
], n = Se(this.engine, e.url);
|
|
14339
14547
|
let s = null;
|
|
14340
14548
|
return i.forEach((o) => {
|
|
14341
14549
|
if (!(o instanceof R) || o.isEmpty())
|
|
@@ -14370,7 +14578,7 @@ class uc {
|
|
|
14370
14578
|
t.projectionMatrix,
|
|
14371
14579
|
t.matrixWorldInverse
|
|
14372
14580
|
);
|
|
14373
|
-
if (new
|
|
14581
|
+
if (new xo().setFromProjectionMatrix(i).intersectsBox(e))
|
|
14374
14582
|
return;
|
|
14375
14583
|
const s = e.getCenter(new d()), o = this.engine.cameraModule?.rotateToTarget;
|
|
14376
14584
|
if (typeof o == "function") {
|
|
@@ -14400,13 +14608,13 @@ class uc {
|
|
|
14400
14608
|
*/
|
|
14401
14609
|
createElementSamplePoints(e, t, i, n) {
|
|
14402
14610
|
const s = this.collectSampleSources(e, t), o = [];
|
|
14403
|
-
for (let r = 0; r <
|
|
14611
|
+
for (let r = 0; r < Vn && s.length > 0; r++) {
|
|
14404
14612
|
const l = s[r % s.length], c = this.sampleGeometrySurface(l, n);
|
|
14405
14613
|
c && o.push(c);
|
|
14406
14614
|
}
|
|
14407
14615
|
if (o.length > 0)
|
|
14408
14616
|
return o;
|
|
14409
|
-
for (o.push(i.getCenter(new d())); o.length <
|
|
14617
|
+
for (o.push(i.getCenter(new d())); o.length < Vn; )
|
|
14410
14618
|
o.push(new d(
|
|
14411
14619
|
F.lerp(i.min.x, i.max.x, n()),
|
|
14412
14620
|
F.lerp(i.min.y, i.max.y, n()),
|
|
@@ -14416,7 +14624,7 @@ class uc {
|
|
|
14416
14624
|
}
|
|
14417
14625
|
/** 收集普通构件和实例构件用于表面采样的几何及其世界矩阵。 */
|
|
14418
14626
|
collectSampleSources(e, t) {
|
|
14419
|
-
const i = [], n =
|
|
14627
|
+
const i = [], n = Se(this.engine, e.url);
|
|
14420
14628
|
(Array.isArray(t?.infos) ? t.infos : []).forEach((o) => {
|
|
14421
14629
|
const r = o?.mesh?.geometry;
|
|
14422
14630
|
r instanceof ae && r.getAttribute("position") != null && i.push({ geometry: r, worldMatrix: n.clone() });
|
|
@@ -14425,7 +14633,7 @@ class uc {
|
|
|
14425
14633
|
return (Array.isArray(t?.indexes) ? t.indexes : []).forEach((o) => {
|
|
14426
14634
|
if (!Array.isArray(o) || o.length < 2)
|
|
14427
14635
|
return;
|
|
14428
|
-
const r =
|
|
14636
|
+
const r = _e(this.engine, o[0]);
|
|
14429
14637
|
if (!(r instanceof V) || !(r.geometry instanceof ae))
|
|
14430
14638
|
return;
|
|
14431
14639
|
const l = `${o[0]}:${o[1]}`;
|
|
@@ -14453,9 +14661,9 @@ class uc {
|
|
|
14453
14661
|
if (typeof s != "function")
|
|
14454
14662
|
return !1;
|
|
14455
14663
|
const o = t.clone().sub(e), r = o.length();
|
|
14456
|
-
if (r <=
|
|
14664
|
+
if (r <= Un)
|
|
14457
14665
|
return !0;
|
|
14458
|
-
this.raycaster.near = 0, this.raycaster.far = r +
|
|
14666
|
+
this.raycaster.near = 0, this.raycaster.far = r + Un, this.raycaster.set(e, o.normalize());
|
|
14459
14667
|
const c = (s.call(
|
|
14460
14668
|
this.engine.octreeBox,
|
|
14461
14669
|
this.raycaster,
|
|
@@ -14495,16 +14703,16 @@ class uc {
|
|
|
14495
14703
|
);
|
|
14496
14704
|
}
|
|
14497
14705
|
}
|
|
14498
|
-
const
|
|
14706
|
+
const Wt = {
|
|
14499
14707
|
ceilingPlan: "天花平面",
|
|
14500
14708
|
floorPlan: "楼层平面",
|
|
14501
14709
|
elevation: "立面视图",
|
|
14502
14710
|
section: "剖面视图"
|
|
14503
14711
|
}, pc = {
|
|
14504
|
-
ceilingPlan: [
|
|
14505
|
-
floorPlan: [
|
|
14506
|
-
elevation: [
|
|
14507
|
-
section: [
|
|
14712
|
+
ceilingPlan: [Wt.ceilingPlan, "天花"],
|
|
14713
|
+
floorPlan: [Wt.floorPlan, "楼层"],
|
|
14714
|
+
elevation: [Wt.elevation, "立面"],
|
|
14715
|
+
section: [Wt.section, "剖面"]
|
|
14508
14716
|
}, mc = [
|
|
14509
14717
|
["CeilingPlans", "ceilingPlans"],
|
|
14510
14718
|
["Elevations", "elevations"],
|
|
@@ -14538,10 +14746,10 @@ class Yi {
|
|
|
14538
14746
|
}
|
|
14539
14747
|
/** 获取单个模型的视图树数据,并补充运行时生成的动态视图分类。 */
|
|
14540
14748
|
getViewTreeData(e) {
|
|
14541
|
-
const t = this.getResolvedViewTree(e), i =
|
|
14749
|
+
const t = this.getResolvedViewTree(e), i = Ws();
|
|
14542
14750
|
return t && mc.forEach(([n, s]) => {
|
|
14543
14751
|
(t[n] ?? []).forEach((o) => {
|
|
14544
|
-
i[s].push(
|
|
14752
|
+
i[s].push(Gs(o, e));
|
|
14545
14753
|
});
|
|
14546
14754
|
}), i;
|
|
14547
14755
|
}
|
|
@@ -14746,10 +14954,10 @@ function vc(a, e, t) {
|
|
|
14746
14954
|
const i = a?.renderer, n = a?.scene, s = a?.camera;
|
|
14747
14955
|
if (!i || !n || !s)
|
|
14748
14956
|
return null;
|
|
14749
|
-
const o = new
|
|
14750
|
-
minFilter:
|
|
14751
|
-
magFilter:
|
|
14752
|
-
format:
|
|
14957
|
+
const o = new Jn(e, t, {
|
|
14958
|
+
minFilter: $t,
|
|
14959
|
+
magFilter: $t,
|
|
14960
|
+
format: es,
|
|
14753
14961
|
depthBuffer: !0,
|
|
14754
14962
|
stencilBuffer: !0
|
|
14755
14963
|
}), r = i.getRenderTarget(), l = i.autoClear, c = i.xr?.enabled ?? !1;
|
|
@@ -15045,7 +15253,7 @@ class Dc {
|
|
|
15045
15253
|
fontSize: this.drawStyle.fontSize
|
|
15046
15254
|
}), this.toolbar.mount(this.wrapper);
|
|
15047
15255
|
const i = this.engine.renderer?.domElement;
|
|
15048
|
-
i?.nextSibling ? t.insertBefore(this.wrapper, i.nextSibling) : t.appendChild(this.wrapper), this.canvas = new
|
|
15256
|
+
i?.nextSibling ? t.insertBefore(this.wrapper, i.nextSibling) : t.appendChild(this.wrapper), this.canvas = new Go(this.canvasEl, {
|
|
15049
15257
|
selection: !0,
|
|
15050
15258
|
preserveObjectStacking: !0
|
|
15051
15259
|
}), this.resize(), this.canvas.on("mouse:down", this.onMouseDown), this.canvas.on("mouse:move", this.onMouseMove), this.canvas.on("mouse:up", this.onMouseUp), this.canvas.on("mouse:dblclick", this.onMouseDblClick), this.canvas.on("selection:created", this.onSelectionChanged), this.canvas.on("selection:updated", this.onSelectionChanged), this.canvas.on("selection:cleared", this.onSelectionChanged), window.addEventListener("keydown", this.onKeyDown), this.refreshToolbarState();
|
|
@@ -15131,7 +15339,7 @@ class Dc {
|
|
|
15131
15339
|
/**
|
|
15132
15340
|
* 鐩存帴缁樺埗鏂囧瓧銆? */
|
|
15133
15341
|
drawText(e, t, i) {
|
|
15134
|
-
const n = this.mergeStyle(i), s = new
|
|
15342
|
+
const n = this.mergeStyle(i), s = new qo(t ?? n.text, {
|
|
15135
15343
|
left: e.x,
|
|
15136
15344
|
top: e.y,
|
|
15137
15345
|
...this.createTextStyle(n),
|
|
@@ -15328,7 +15536,7 @@ class Dc {
|
|
|
15328
15536
|
};
|
|
15329
15537
|
}
|
|
15330
15538
|
createLineObject(e, t, i, n) {
|
|
15331
|
-
const s = new
|
|
15539
|
+
const s = new ci([e.x, e.y, t.x, t.y], {
|
|
15332
15540
|
...this.createObjectBase(i, n),
|
|
15333
15541
|
fill: "",
|
|
15334
15542
|
strokeLineCap: "round"
|
|
@@ -15336,7 +15544,7 @@ class Dc {
|
|
|
15336
15544
|
return s.annotationType = "line", s;
|
|
15337
15545
|
}
|
|
15338
15546
|
createRectObject(e, t, i, n) {
|
|
15339
|
-
const s = this.getBoxFromPoints(e, t), o = new
|
|
15547
|
+
const s = this.getBoxFromPoints(e, t), o = new Ko({
|
|
15340
15548
|
...this.createObjectBase(i, n),
|
|
15341
15549
|
left: s.left,
|
|
15342
15550
|
top: s.top,
|
|
@@ -15348,7 +15556,7 @@ class Dc {
|
|
|
15348
15556
|
return o.annotationType = "rect", o;
|
|
15349
15557
|
}
|
|
15350
15558
|
createCircleObject(e, t, i, n) {
|
|
15351
|
-
const s = this.getCircleFromPoints(e, t), o = new
|
|
15559
|
+
const s = this.getCircleFromPoints(e, t), o = new jo({
|
|
15352
15560
|
...this.createObjectBase(i, n),
|
|
15353
15561
|
left: s.left,
|
|
15354
15562
|
top: s.top,
|
|
@@ -15361,7 +15569,7 @@ class Dc {
|
|
|
15361
15569
|
createArrowObject(e, t, i, n) {
|
|
15362
15570
|
const s = t.x - e.x, o = t.y - e.y, r = Math.sqrt(s * s + o * o);
|
|
15363
15571
|
if (r < 1e-6) {
|
|
15364
|
-
const k = new
|
|
15572
|
+
const k = new ci([e.x, e.y, t.x, t.y], {
|
|
15365
15573
|
stroke: i.stroke,
|
|
15366
15574
|
strokeWidth: i.strokeWidth,
|
|
15367
15575
|
fill: "",
|
|
@@ -15374,7 +15582,7 @@ class Dc {
|
|
|
15374
15582
|
});
|
|
15375
15583
|
return O.annotationType = "arrow", O;
|
|
15376
15584
|
}
|
|
15377
|
-
const l = s / r, c = o / r, h = -c, u = l, p = Math.max(10, i.strokeWidth * 6), g = p * 0.72, f = t.x - l * p, M = t.y - c * p, x = f + h * (g * 0.5), m = M + u * (g * 0.5), b = f - h * (g * 0.5), C = M - u * (g * 0.5), S = new
|
|
15585
|
+
const l = s / r, c = o / r, h = -c, u = l, p = Math.max(10, i.strokeWidth * 6), g = p * 0.72, f = t.x - l * p, M = t.y - c * p, x = f + h * (g * 0.5), m = M + u * (g * 0.5), b = f - h * (g * 0.5), C = M - u * (g * 0.5), S = new ci([e.x, e.y, t.x, t.y], {
|
|
15378
15586
|
stroke: i.stroke,
|
|
15379
15587
|
strokeWidth: i.strokeWidth,
|
|
15380
15588
|
fill: "",
|
|
@@ -16102,7 +16310,7 @@ class kc {
|
|
|
16102
16310
|
return e;
|
|
16103
16311
|
}
|
|
16104
16312
|
}
|
|
16105
|
-
const xi = "bim-engine:model-link-3d", Lc = "default-model-link-3d-group",
|
|
16313
|
+
const xi = "bim-engine:model-link-3d", Lc = "default-model-link-3d-group", Wn = "model-link-3d", Gn = {
|
|
16106
16314
|
enabled: !1,
|
|
16107
16315
|
highlight: !0,
|
|
16108
16316
|
visibility: !0,
|
|
@@ -16169,11 +16377,11 @@ class Bc {
|
|
|
16169
16377
|
return this.applyingLinkedEvent;
|
|
16170
16378
|
}
|
|
16171
16379
|
dispose() {
|
|
16172
|
-
this.disposed || (this.disposed = !0, typeof window < "u" && window.removeEventListener(xi, this.handleWindowEvent), this.pendingCameraTimer != null && (window.clearTimeout(this.pendingCameraTimer), this.pendingCameraTimer = null), this.firstPersonSyncFrame != null && (window.cancelAnimationFrame(this.firstPersonSyncFrame), this.firstPersonSyncFrame = null), this.engine?.setIdleFrameRateExempt?.(
|
|
16380
|
+
this.disposed || (this.disposed = !0, typeof window < "u" && window.removeEventListener(xi, this.handleWindowEvent), this.pendingCameraTimer != null && (window.clearTimeout(this.pendingCameraTimer), this.pendingCameraTimer = null), this.firstPersonSyncFrame != null && (window.cancelAnimationFrame(this.firstPersonSyncFrame), this.firstPersonSyncFrame = null), this.engine?.setIdleFrameRateExempt?.(Wn, !1), this.unbindCameraEvents(), this.restoreModelToolMethods());
|
|
16173
16381
|
}
|
|
16174
16382
|
normalizeOptions(e) {
|
|
16175
16383
|
return {
|
|
16176
|
-
...
|
|
16384
|
+
...Gn,
|
|
16177
16385
|
...e,
|
|
16178
16386
|
groupId: e.groupId ?? this.engine?.options?.linkGroupId ?? Lc,
|
|
16179
16387
|
modelId: e.modelId ?? this.engine?.options?.modelLinkId
|
|
@@ -16182,7 +16390,7 @@ class Bc {
|
|
|
16182
16390
|
/** 模型联动开启后需要持续响应外部视图变化,不能进入空闲限帧。 */
|
|
16183
16391
|
syncIdleFrameRateExempt() {
|
|
16184
16392
|
this.engine?.setIdleFrameRateExempt?.(
|
|
16185
|
-
|
|
16393
|
+
Wn,
|
|
16186
16394
|
this.options.enabled === !0
|
|
16187
16395
|
);
|
|
16188
16396
|
}
|
|
@@ -16274,7 +16482,7 @@ class Bc {
|
|
|
16274
16482
|
return this.engine?.controlModule?.firstPersonControls?.enabled === !0 && this.engine?.movefirst === !0;
|
|
16275
16483
|
}
|
|
16276
16484
|
emitCameraThrottled() {
|
|
16277
|
-
const e = Date.now(), t = Math.max(0, (this.options.cameraThrottleMs ??
|
|
16485
|
+
const e = Date.now(), t = Math.max(0, (this.options.cameraThrottleMs ?? Gn.cameraThrottleMs) - (e - this.lastCameraEmitTime));
|
|
16278
16486
|
if (t === 0) {
|
|
16279
16487
|
this.emitCamera();
|
|
16280
16488
|
return;
|
|
@@ -16421,7 +16629,7 @@ class zc {
|
|
|
16421
16629
|
worldToScreen;
|
|
16422
16630
|
raycaster = new de();
|
|
16423
16631
|
constructor(e) {
|
|
16424
|
-
this.engine = e, this.worldToScreen = new fe(e.camera, e.renderer, e.scene), this.manager = new
|
|
16632
|
+
this.engine = e, this.worldToScreen = new fe(e.camera, e.renderer, e.scene), this.manager = new Ho({
|
|
16425
16633
|
container: e.container,
|
|
16426
16634
|
className: "bim-engine-label-container bim-engine-label-container-3d",
|
|
16427
16635
|
projectCoordinate: (t) => this.projectCoordinate(t),
|
|
@@ -16626,7 +16834,7 @@ class Oc {
|
|
|
16626
16834
|
return { id: e.instance.id, annotation: e.instance, originalEvent: t };
|
|
16627
16835
|
}
|
|
16628
16836
|
}
|
|
16629
|
-
const
|
|
16837
|
+
const Te = {
|
|
16630
16838
|
color: "#7ffcff",
|
|
16631
16839
|
opacity: 0.92,
|
|
16632
16840
|
fillColor: "#7ffcff",
|
|
@@ -16823,13 +17031,13 @@ const Pe = {
|
|
|
16823
17031
|
minWidth: "120px",
|
|
16824
17032
|
pointerEvents: "auto"
|
|
16825
17033
|
}, Nc = "bim-engine-annotation3d-panels";
|
|
16826
|
-
function
|
|
17034
|
+
function Xt(a) {
|
|
16827
17035
|
return a.map((e) => ({ x: e.x, y: e.y, z: e.z }));
|
|
16828
17036
|
}
|
|
16829
17037
|
function J(a) {
|
|
16830
17038
|
return new d(a.x, a.y, a.z);
|
|
16831
17039
|
}
|
|
16832
|
-
function
|
|
17040
|
+
function Gt(a) {
|
|
16833
17041
|
const e = new d();
|
|
16834
17042
|
return a.length === 0 ? e : (a.forEach((t) => e.add(J(t))), e.multiplyScalar(1 / a.length));
|
|
16835
17043
|
}
|
|
@@ -16841,7 +17049,7 @@ function Hc(a) {
|
|
|
16841
17049
|
}
|
|
16842
17050
|
return e.normalize();
|
|
16843
17051
|
}
|
|
16844
|
-
function
|
|
17052
|
+
function qs(a) {
|
|
16845
17053
|
const e = a.map((c) => J(c)), t = e[0].clone(), i = e.length > 1 ? e[1].clone().sub(t).normalize() : new d(1, 0, 0);
|
|
16846
17054
|
let n = Hc(e);
|
|
16847
17055
|
n.lengthSq() < 1e-8 && (n = new d(0, 1, 0));
|
|
@@ -16851,8 +17059,8 @@ function Ws(a) {
|
|
|
16851
17059
|
}), l = new H().makeBasis(o, s, n).setPosition(t);
|
|
16852
17060
|
return { origin: t, normal: n, matrix: l, localPoints: r };
|
|
16853
17061
|
}
|
|
16854
|
-
function
|
|
16855
|
-
const e = new
|
|
17062
|
+
function Ks(a) {
|
|
17063
|
+
const e = new ts();
|
|
16856
17064
|
return a.forEach((t, i) => {
|
|
16857
17065
|
if (i === 0) {
|
|
16858
17066
|
e.moveTo(t.x, t.y);
|
|
@@ -16886,7 +17094,7 @@ function Gc(a) {
|
|
|
16886
17094
|
}
|
|
16887
17095
|
class qc {
|
|
16888
17096
|
render(e) {
|
|
16889
|
-
const t = e.instance.style.leaderPoint ?? {}, i = t.strokeColor || e.instance.style.color || "#7ffcff", n = t.backgroundColor || e.instance.style.fillColor || i, s = t.borderColor || i, o = t.anchorColor || n, r = t.anchorRingColor || i, l = t.iconBackgroundColor || n, c = t.side ?? "right", h = t.icon ? this.escapeXmlAttribute(t.icon) : "", u = Math.max(t.iconWidth ?? 22, 1), p = Math.max(t.iconHeight ?? 22, 1), g = (t.text ?? "").trim(), f = Math.max(t.fontSize ?? 14, 10), M = t.textColor || e.instance.style.color || "#ffffff", x = t.fontWeight ?? 500, m = Math.max(Math.round((t.height ?? 8) * 12), 48), b = Math.max(Math.round(Math.abs(t.offsetX ?? t.armLength ?? 4) * 18), 56), C = this.getBoardWidth(e, g, f), S = Math.max(Math.round((t.boardHeight ?? 1.8) * 22), f + 18, 34), I = Math.max(Math.round((t.stemWidth ?? e.instance.style.lineWidth ?? 0.12) * 20), 2), P = t.borderWidth ?? 2.5, L = t.variant ?? "elbow", k = c === "right" ? 22 + b - 8 : 22 - b - C + 8, O = 8, K = Math.min(22, k) - 16, te = Math.max(22, k + C) + 16, Q = Math.max(te - K, 140), he = Math.max(m + S + 36, 120), le = 22 - K, ce = k - K, ye = he - 18,
|
|
17097
|
+
const t = e.instance.style.leaderPoint ?? {}, i = t.strokeColor || e.instance.style.color || "#7ffcff", n = t.backgroundColor || e.instance.style.fillColor || i, s = t.borderColor || i, o = t.anchorColor || n, r = t.anchorRingColor || i, l = t.iconBackgroundColor || n, c = t.side ?? "right", h = t.icon ? this.escapeXmlAttribute(t.icon) : "", u = Math.max(t.iconWidth ?? 22, 1), p = Math.max(t.iconHeight ?? 22, 1), g = (t.text ?? "").trim(), f = Math.max(t.fontSize ?? 14, 10), M = t.textColor || e.instance.style.color || "#ffffff", x = t.fontWeight ?? 500, m = Math.max(Math.round((t.height ?? 8) * 12), 48), b = Math.max(Math.round(Math.abs(t.offsetX ?? t.armLength ?? 4) * 18), 56), C = this.getBoardWidth(e, g, f), S = Math.max(Math.round((t.boardHeight ?? 1.8) * 22), f + 18, 34), I = Math.max(Math.round((t.stemWidth ?? e.instance.style.lineWidth ?? 0.12) * 20), 2), P = t.borderWidth ?? 2.5, L = t.variant ?? "elbow", k = c === "right" ? 22 + b - 8 : 22 - b - C + 8, O = 8, K = Math.min(22, k) - 16, te = Math.max(22, k + C) + 16, Q = Math.max(te - K, 140), he = Math.max(m + S + 36, 120), le = 22 - K, ce = k - K, ye = he - 18, Pe = Math.max(ye - m, 14), w = c === "right" ? ce : ce + C, y = O + Math.round(S * 0.5), E = L === "vertical" ? [`${le},${ye}`, `${le},${Pe}`] : [`${le},${ye}`, `${le},${y}`, `${w},${y}`], _ = e.instance.selectable !== !1, D = _ ? "visiblePainted" : "none", T = _ ? "pointer" : "default", N = ce + (h || !g ? 38 : 12), G = t.showBoard === !1 ? "" : `
|
|
16890
17098
|
<rect x="${ce}" y="${O}" width="${C}" height="${S}" rx="10"
|
|
16891
17099
|
fill="${n}" fill-opacity="${t.backgroundOpacity ?? t.boardOpacity ?? 0.18}"
|
|
16892
17100
|
stroke="${s}" stroke-width="${P}" />
|
|
@@ -17119,12 +17327,12 @@ class Xc {
|
|
|
17119
17327
|
if (Yc.has(e.instance.type))
|
|
17120
17328
|
n.copy(J(e.instance.points[0])), i === "top" && (n.y += e.volumeHeight ?? 0);
|
|
17121
17329
|
else if (e.instance.type === "polyline" || e.instance.type === "curve3d")
|
|
17122
|
-
i === "start" ? n.copy(J(e.instance.points[0])) : i === "end" ? n.copy(J(e.instance.points[e.instance.points.length - 1])) : e.anchorCurve ? n.copy(e.anchorCurve.getPoint(0.5)) : n.copy(
|
|
17330
|
+
i === "start" ? n.copy(J(e.instance.points[0])) : i === "end" ? n.copy(J(e.instance.points[e.instance.points.length - 1])) : e.anchorCurve ? n.copy(e.anchorCurve.getPoint(0.5)) : n.copy(Gt(e.instance.points));
|
|
17123
17331
|
else if (e.instance.type === "polygon")
|
|
17124
|
-
n.copy(
|
|
17332
|
+
n.copy(Gt(e.instance.points));
|
|
17125
17333
|
else if (e.instance.type === "extrudePolygon")
|
|
17126
|
-
n.copy(
|
|
17127
|
-
else if (e.instance.type === "box" && (n.copy(
|
|
17334
|
+
n.copy(Gt(e.instance.points)), i === "top" && e.anchorNormal && n.add(e.anchorNormal.clone().multiplyScalar(e.volumeHeight ?? 0));
|
|
17335
|
+
else if (e.instance.type === "box" && (n.copy(Gt(e.instance.points)), i === "top" && e.instance.points.length >= 2)) {
|
|
17128
17336
|
const s = J(e.instance.points[0]), o = J(e.instance.points[1]);
|
|
17129
17337
|
n.y = Math.max(s.y, o.y);
|
|
17130
17338
|
}
|
|
@@ -17144,7 +17352,7 @@ class $c {
|
|
|
17144
17352
|
}
|
|
17145
17353
|
engine;
|
|
17146
17354
|
createSurfaceMaterial(e) {
|
|
17147
|
-
const t = e.style ?? {}, i = e.effect ?? {}, n = this.getGradientStops(e.color, i.gradient?.stops), s = i.gradient?.enabled === !0, o = i.glow?.enabled ? i.glow.intensity ?? 0.9 : 0, r = i.flow?.enabled === !0, l = i.pulse?.enabled === !0, c = i.scan?.enabled === !0, h = i.flow?.direction === "backward" ? -1 : 1, u = new
|
|
17355
|
+
const t = e.style ?? {}, i = e.effect ?? {}, n = this.getGradientStops(e.color, i.gradient?.stops), s = i.gradient?.enabled === !0, o = i.glow?.enabled ? i.glow.intensity ?? 0.9 : 0, r = i.flow?.enabled === !0, l = i.pulse?.enabled === !0, c = i.scan?.enabled === !0, h = i.flow?.direction === "backward" ? -1 : 1, u = new wo({
|
|
17148
17356
|
transparent: !0,
|
|
17149
17357
|
side: re,
|
|
17150
17358
|
depthTest: t.alwaysOnTop ? !1 : t.depthTest !== !1,
|
|
@@ -17293,13 +17501,13 @@ class Ke {
|
|
|
17293
17501
|
engine;
|
|
17294
17502
|
materialFactory;
|
|
17295
17503
|
createSegmentCurve(e) {
|
|
17296
|
-
const t = new
|
|
17504
|
+
const t = new bo();
|
|
17297
17505
|
for (let i = 0; i < e.length - 1; i += 1)
|
|
17298
|
-
t.add(new
|
|
17506
|
+
t.add(new Co(e[i], e[i + 1]));
|
|
17299
17507
|
return t;
|
|
17300
17508
|
}
|
|
17301
17509
|
createTubeMesh(e, t, i, n, s, o, r = 10, l = !1) {
|
|
17302
|
-
const c = new
|
|
17510
|
+
const c = new Eo(t, i, n, r, l);
|
|
17303
17511
|
c.computeBoundingBox();
|
|
17304
17512
|
const h = c.boundingBox ?? new R(new d(0, 0, 0), new d(1, 1, 1)), u = this.materialFactory.createSurfaceMaterial({
|
|
17305
17513
|
color: s.color ?? "#7ffcff",
|
|
@@ -17320,7 +17528,7 @@ class Ke {
|
|
|
17320
17528
|
depthTest: i.alwaysOnTop ? !1 : i.depthTest !== !1
|
|
17321
17529
|
});
|
|
17322
17530
|
s.clippingPlanes = this.engine.sectionPlane;
|
|
17323
|
-
const o = new
|
|
17531
|
+
const o = new Ao(n, s);
|
|
17324
17532
|
return o.renderOrder = 998, o;
|
|
17325
17533
|
}
|
|
17326
17534
|
}
|
|
@@ -17351,14 +17559,14 @@ class Zc extends Ke {
|
|
|
17351
17559
|
depthTest: e.instance.style.alwaysOnTop ? !1 : e.instance.style.depthTest !== !1
|
|
17352
17560
|
});
|
|
17353
17561
|
p.clippingPlanes = this.engine.sectionPlane;
|
|
17354
|
-
const g = new
|
|
17562
|
+
const g = new ei(new So(l), p);
|
|
17355
17563
|
g.position.copy(r), e.instance.root.add(g), e.volumeHeight = o.y, e.animatedMaterials.push(h);
|
|
17356
17564
|
}
|
|
17357
17565
|
}
|
|
17358
17566
|
class Jc extends Ke {
|
|
17359
17567
|
type = "curve3d";
|
|
17360
17568
|
build(e) {
|
|
17361
|
-
const t = e.instance.points.map((r) => J(r)), i = e.instance.style.curve ?? {}, n = i.interpolation ?? "catmullRom", s = new
|
|
17569
|
+
const t = e.instance.points.map((r) => J(r)), i = e.instance.style.curve ?? {}, n = i.interpolation ?? "catmullRom", s = new Po(
|
|
17362
17570
|
t,
|
|
17363
17571
|
i.closed ?? !1,
|
|
17364
17572
|
n === "catmullRom" ? "catmullrom" : n,
|
|
@@ -17379,7 +17587,7 @@ class Jc extends Ke {
|
|
|
17379
17587
|
class eh extends Ke {
|
|
17380
17588
|
type = "extrudePolygon";
|
|
17381
17589
|
build(e) {
|
|
17382
|
-
const t =
|
|
17590
|
+
const t = qs(e.instance.points), i = Ks(t.localPoints), n = e.instance.style.volume?.height ?? 10, s = new is(i, {
|
|
17383
17591
|
depth: n,
|
|
17384
17592
|
bevelEnabled: !1,
|
|
17385
17593
|
steps: 1,
|
|
@@ -17464,7 +17672,7 @@ class sh extends Ke {
|
|
|
17464
17672
|
build(e) {
|
|
17465
17673
|
const t = e.instance.style.pillarPoint ?? {}, i = J(e.instance.points[0]), n = new d(t.offsetX ?? 0, t.offsetY ?? 0, t.offsetZ ?? 0), s = Math.max(t.height ?? 16, 0.01);
|
|
17466
17674
|
e.instance.root.position.copy(i).add(n), e.panelAnchorPoint = i.clone().add(n).add(new d(0, s, 0)), e.volumeHeight = s;
|
|
17467
|
-
const o = new
|
|
17675
|
+
const o = new To(
|
|
17468
17676
|
Math.max(t.radiusTop ?? 0.3, 1e-3),
|
|
17469
17677
|
Math.max(t.radiusBottom ?? 0.75, 1e-3),
|
|
17470
17678
|
s,
|
|
@@ -17507,7 +17715,7 @@ class sh extends Ke {
|
|
|
17507
17715
|
});
|
|
17508
17716
|
h.clippingPlanes = this.engine.sectionPlane;
|
|
17509
17717
|
const u = new z(
|
|
17510
|
-
new
|
|
17718
|
+
new rs(
|
|
17511
17719
|
Math.max(t.baseRingInnerRadius ?? 1.9, 1e-3),
|
|
17512
17720
|
Math.max(t.baseRingOuterRadius ?? 2.4, (t.baseRingInnerRadius ?? 1.9) + 1e-3),
|
|
17513
17721
|
Math.max(12, Math.floor(t.baseRingSegments ?? 48))
|
|
@@ -17521,7 +17729,7 @@ class sh extends Ke {
|
|
|
17521
17729
|
class oh extends Ke {
|
|
17522
17730
|
type = "polygon";
|
|
17523
17731
|
build(e) {
|
|
17524
|
-
const t =
|
|
17732
|
+
const t = qs(e.instance.points), i = Ks(t.localPoints), n = new Io(i);
|
|
17525
17733
|
n.computeBoundingBox();
|
|
17526
17734
|
const s = n.boundingBox ?? new R(new d(0, 0, 0), new d(1, 1, 1)), o = this.materialFactory.createSurfaceMaterial({
|
|
17527
17735
|
color: e.instance.style.fillColor ?? e.instance.style.color ?? "#7ffcff",
|
|
@@ -17570,7 +17778,7 @@ class ah extends Ke {
|
|
|
17570
17778
|
});
|
|
17571
17779
|
c.clippingPlanes = this.engine.sectionPlane;
|
|
17572
17780
|
const h = new z(
|
|
17573
|
-
new
|
|
17781
|
+
new Jt(Math.max(t.centerRadius ?? 0.28, 0.01), 20, 16),
|
|
17574
17782
|
c
|
|
17575
17783
|
);
|
|
17576
17784
|
e.instance.root.add(h);
|
|
@@ -17587,7 +17795,7 @@ class ah extends Ke {
|
|
|
17587
17795
|
});
|
|
17588
17796
|
h.clippingPlanes = this.engine.sectionPlane;
|
|
17589
17797
|
const u = new z(
|
|
17590
|
-
new
|
|
17798
|
+
new rs(Math.max(o - r, 1e-3), o, l),
|
|
17591
17799
|
h
|
|
17592
17800
|
);
|
|
17593
17801
|
u.rotation.set(t.rotationX ?? -Math.PI / 2, t.rotationY ?? 0, t.rotationZ ?? 0), u.userData.ripplePhase = c / s, u.userData.rippleSpeed = Math.max(t.speed ?? 0.9, 0), u.userData.rippleStartRadius = Math.max(t.startRadius ?? 0.2, 0), u.userData.rippleMaxRadius = o, u.userData.rippleBaseOpacity = h.opacity, e.instance.root.add(u), e.rippleMeshes.push(u);
|
|
@@ -17635,7 +17843,7 @@ class dh {
|
|
|
17635
17843
|
const t = {
|
|
17636
17844
|
...e,
|
|
17637
17845
|
id: e.id ?? `annotation3d-${Date.now()}-${Math.random().toString(16).slice(2)}`,
|
|
17638
|
-
points:
|
|
17846
|
+
points: Xt(e.points ?? []),
|
|
17639
17847
|
visible: e.visible ?? !0,
|
|
17640
17848
|
selectable: e.selectable ?? !0,
|
|
17641
17849
|
style: this.mergeStyle(e.style),
|
|
@@ -17657,7 +17865,7 @@ class dh {
|
|
|
17657
17865
|
return this.normalizeData({
|
|
17658
17866
|
id: n,
|
|
17659
17867
|
type: i.type ?? e.type,
|
|
17660
|
-
points: i.points ?
|
|
17868
|
+
points: i.points ? Xt(i.points) : Xt(e.points),
|
|
17661
17869
|
visible: i.visible ?? e.visible,
|
|
17662
17870
|
selectable: i.selectable ?? e.selectable,
|
|
17663
17871
|
style: {
|
|
@@ -17693,30 +17901,30 @@ class dh {
|
|
|
17693
17901
|
}
|
|
17694
17902
|
mergeStyle(e) {
|
|
17695
17903
|
return {
|
|
17696
|
-
...
|
|
17904
|
+
...Te,
|
|
17697
17905
|
...e,
|
|
17698
17906
|
iconPoint: {
|
|
17699
|
-
...
|
|
17907
|
+
...Te.iconPoint,
|
|
17700
17908
|
...e?.iconPoint ?? {},
|
|
17701
|
-
background: { ...
|
|
17909
|
+
background: { ...Te.iconPoint?.background, ...e?.iconPoint?.background ?? {} }
|
|
17702
17910
|
},
|
|
17703
17911
|
textPoint: {
|
|
17704
|
-
...
|
|
17912
|
+
...Te.textPoint,
|
|
17705
17913
|
...e?.textPoint ?? {},
|
|
17706
|
-
background: { ...
|
|
17914
|
+
background: { ...Te.textPoint?.background, ...e?.textPoint?.background ?? {} }
|
|
17707
17915
|
},
|
|
17708
17916
|
iconTextPoint: {
|
|
17709
|
-
...
|
|
17917
|
+
...Te.iconTextPoint,
|
|
17710
17918
|
...e?.iconTextPoint ?? {},
|
|
17711
|
-
background: { ...
|
|
17919
|
+
background: { ...Te.iconTextPoint?.background, ...e?.iconTextPoint?.background ?? {} }
|
|
17712
17920
|
},
|
|
17713
|
-
ripplePoint: { ...
|
|
17714
|
-
pillarPoint: { ...
|
|
17715
|
-
leaderPoint: { ...
|
|
17716
|
-
line: { ...
|
|
17717
|
-
curve: { ...
|
|
17718
|
-
polygon: { ...
|
|
17719
|
-
volume: { ...
|
|
17921
|
+
ripplePoint: { ...Te.ripplePoint, ...e?.ripplePoint ?? {} },
|
|
17922
|
+
pillarPoint: { ...Te.pillarPoint, ...e?.pillarPoint ?? {} },
|
|
17923
|
+
leaderPoint: { ...Te.leaderPoint, ...e?.leaderPoint ?? {} },
|
|
17924
|
+
line: { ...Te.line, ...e?.line ?? {} },
|
|
17925
|
+
curve: { ...Te.curve, ...e?.curve ?? {} },
|
|
17926
|
+
polygon: { ...Te.polygon, ...e?.polygon ?? {} },
|
|
17927
|
+
volume: { ...Te.volume, ...e?.volume ?? {} }
|
|
17720
17928
|
};
|
|
17721
17929
|
}
|
|
17722
17930
|
mergeEffect(e) {
|
|
@@ -17810,16 +18018,16 @@ function ph(a) {
|
|
|
17810
18018
|
return {
|
|
17811
18019
|
id: a.instance.id,
|
|
17812
18020
|
type: a.instance.type,
|
|
17813
|
-
points:
|
|
18021
|
+
points: Xt(a.instance.points),
|
|
17814
18022
|
visible: a.instance.visible,
|
|
17815
18023
|
selectable: a.instance.selectable,
|
|
17816
|
-
style:
|
|
17817
|
-
effect:
|
|
17818
|
-
panel: a.instance.panel ?
|
|
17819
|
-
data:
|
|
18024
|
+
style: qt(a.instance.style),
|
|
18025
|
+
effect: qt(a.instance.effect),
|
|
18026
|
+
panel: a.instance.panel ? qt(a.instance.panel) : void 0,
|
|
18027
|
+
data: qt(a.instance.data)
|
|
17820
18028
|
};
|
|
17821
18029
|
}
|
|
17822
|
-
function
|
|
18030
|
+
function qt(a) {
|
|
17823
18031
|
return a === void 0 ? a : JSON.parse(JSON.stringify(a));
|
|
17824
18032
|
}
|
|
17825
18033
|
class mh {
|
|
@@ -18075,7 +18283,7 @@ class dt {
|
|
|
18075
18283
|
throw new Error("[Calibration] source and target segments must have valid length");
|
|
18076
18284
|
o.normalize(), r.normalize();
|
|
18077
18285
|
const l = new H().makeRotationFromQuaternion(
|
|
18078
|
-
new
|
|
18286
|
+
new Ie().setFromUnitVectors(o, r)
|
|
18079
18287
|
), c = new H().makeTranslation(n.x, n.y, n.z).multiply(l).multiply(new H().makeTranslation(-t.x, -t.y, -t.z)), h = this.getMatrix(e.url);
|
|
18080
18288
|
return this.applyInternal({
|
|
18081
18289
|
url: e.url,
|
|
@@ -18106,7 +18314,7 @@ class dt {
|
|
|
18106
18314
|
throw new Error("[Calibration] source and target segments must have valid length");
|
|
18107
18315
|
r.normalize(), l.normalize();
|
|
18108
18316
|
const c = new H().makeRotationFromQuaternion(
|
|
18109
|
-
new
|
|
18317
|
+
new Ie().setFromUnitVectors(r, l)
|
|
18110
18318
|
), h = new H().makeTranslation(s.x, s.y, s.z).multiply(c).multiply(new H().makeTranslation(-i.x, -i.y, -i.z)), u = this.getMatrix(this.pointCalibrationUrl);
|
|
18111
18319
|
this.applyInternal({
|
|
18112
18320
|
url: this.pointCalibrationUrl,
|
|
@@ -18252,7 +18460,7 @@ class dt {
|
|
|
18252
18460
|
this.engine.events?.trigger?.(ne.ModelCalibrationChanged, s);
|
|
18253
18461
|
}
|
|
18254
18462
|
createChangeEvent(e, t, i, n) {
|
|
18255
|
-
const s = new d(), o = new
|
|
18463
|
+
const s = new d(), o = new Ie(), r = new d();
|
|
18256
18464
|
t.decompose(s, o, r);
|
|
18257
18465
|
const l = new tt().setFromQuaternion(o, "XYZ"), c = [
|
|
18258
18466
|
F.radToDeg(l.x),
|
|
@@ -18354,7 +18562,7 @@ class wh {
|
|
|
18354
18562
|
dracoDecoderPath;
|
|
18355
18563
|
modelList = /* @__PURE__ */ new Map();
|
|
18356
18564
|
modelTransforms = [];
|
|
18357
|
-
animationTimer = new
|
|
18565
|
+
animationTimer = new $n();
|
|
18358
18566
|
transformControl = null;
|
|
18359
18567
|
transformHelper = null;
|
|
18360
18568
|
selectedModelId = null;
|
|
@@ -18512,13 +18720,13 @@ class wh {
|
|
|
18512
18720
|
const l = t ? `“${t}”` : "默认动画";
|
|
18513
18721
|
throw new Error(`播放模型动画失败:模型 “${e}” 不存在${l}。`);
|
|
18514
18722
|
}
|
|
18515
|
-
(i.stopOthers ?? !0) && this.stopAnimation(e), n.mixer || (n.mixer = new
|
|
18723
|
+
(i.stopOthers ?? !0) && this.stopAnimation(e), n.mixer || (n.mixer = new Zn(n.object), n.mixer.addEventListener("finished", (l) => {
|
|
18516
18724
|
n.actions.forEach((c, h) => {
|
|
18517
18725
|
c === l.action && n.actions.delete(h);
|
|
18518
18726
|
});
|
|
18519
18727
|
}));
|
|
18520
18728
|
const o = n.mixer.clipAction(s);
|
|
18521
|
-
o.reset(), o.enabled = !0, o.clampWhenFinished = i.clampWhenFinished ?? !1, o.setEffectiveTimeScale(i.timeScale ?? 1), i.loop ?? !0 ? o.setLoop(
|
|
18729
|
+
o.reset(), o.enabled = !0, o.clampWhenFinished = i.clampWhenFinished ?? !1, o.setEffectiveTimeScale(i.timeScale ?? 1), i.loop ?? !0 ? o.setLoop(_o, i.repetitions ?? 1 / 0) : o.setLoop(Do, i.repetitions ?? 1);
|
|
18522
18730
|
const r = i.fadeIn ?? 0;
|
|
18523
18731
|
return r > 0 && o.fadeIn(r), o.play(), n.actions.set(s.name, o), this.animationTimer.reset(), this.requestRender(), { name: s.name, duration: s.duration };
|
|
18524
18732
|
}
|
|
@@ -18611,7 +18819,7 @@ class wh {
|
|
|
18611
18819
|
}
|
|
18612
18820
|
/** 创建独立解码器实例,便于管理器销毁或切换资源目录时释放 worker。 */
|
|
18613
18821
|
createDracoLoader(e) {
|
|
18614
|
-
const t = new
|
|
18822
|
+
const t = new ss();
|
|
18615
18823
|
return t.setDecoderPath(e), t;
|
|
18616
18824
|
}
|
|
18617
18825
|
resolveDracoDecoderPath(e) {
|
|
@@ -19295,7 +19503,7 @@ class bh {
|
|
|
19295
19503
|
});
|
|
19296
19504
|
}
|
|
19297
19505
|
}
|
|
19298
|
-
const
|
|
19506
|
+
const qn = "__modelExplodeProxy", Kn = new H().makeScale(0, 0, 0);
|
|
19299
19507
|
class Ch {
|
|
19300
19508
|
engine;
|
|
19301
19509
|
/** 当前是否处于炸开模式;供外部滑块、交互模块判断是否需要走代理逻辑。 */
|
|
@@ -19437,7 +19645,7 @@ class Ch {
|
|
|
19437
19645
|
* 从命中的代理对象还原真实构件 ID,避免 Object3D.name 字符串化造成 nodesMap 查询失败。
|
|
19438
19646
|
*/
|
|
19439
19647
|
getObjectComponentId(e) {
|
|
19440
|
-
return e?.userData?.[
|
|
19648
|
+
return e?.userData?.[qn] === !0 ? e.userData.componentId : null;
|
|
19441
19649
|
}
|
|
19442
19650
|
/**
|
|
19443
19651
|
* 返回炸开后用于悬浮高亮的代理网格。
|
|
@@ -19543,7 +19751,7 @@ class Ch {
|
|
|
19543
19751
|
createRecord(e, t, i, n) {
|
|
19544
19752
|
if (!Array.isArray(i) || i.length < 2)
|
|
19545
19753
|
return;
|
|
19546
|
-
const s =
|
|
19754
|
+
const s = _e(this.engine, i[0]);
|
|
19547
19755
|
if (!(s instanceof z))
|
|
19548
19756
|
return;
|
|
19549
19757
|
const o = s instanceof V ? "instance" : "mesh", r = o === "instance" ? this.createInstanceProxy(s, i[1], e, t) : this.createMeshProxy(s, i[1], e, t);
|
|
@@ -19591,7 +19799,7 @@ class Ch {
|
|
|
19591
19799
|
}
|
|
19592
19800
|
/** 给代理对象写入稳定交互身份,避免依赖 name 的字符串化 id。 */
|
|
19593
19801
|
assignProxyIdentity(e, t, i) {
|
|
19594
|
-
e.url = t, e.name = String(i), e.userData[
|
|
19802
|
+
e.url = t, e.name = String(i), e.userData[qn] = !0, e.userData.componentId = i, e.userData.url = t;
|
|
19595
19803
|
}
|
|
19596
19804
|
/**
|
|
19597
19805
|
* 隐藏源渲染片段,避免与代理对象重复显示。
|
|
@@ -19599,7 +19807,7 @@ class Ch {
|
|
|
19599
19807
|
*/
|
|
19600
19808
|
hideSource(e) {
|
|
19601
19809
|
if (e.kind === "instance") {
|
|
19602
|
-
e.sourceMesh.setMatrixAt(e.subIndex,
|
|
19810
|
+
e.sourceMesh.setMatrixAt(e.subIndex, Kn), e.sourceMesh.instanceMatrix.needsUpdate = !0;
|
|
19603
19811
|
return;
|
|
19604
19812
|
}
|
|
19605
19813
|
this.ensureSplitState(e);
|
|
@@ -19619,7 +19827,7 @@ class Ch {
|
|
|
19619
19827
|
*/
|
|
19620
19828
|
restoreSource(e) {
|
|
19621
19829
|
if (e.kind === "instance") {
|
|
19622
|
-
const s = this.shouldKeepOriginalInstanceHidden(e) ?
|
|
19830
|
+
const s = this.shouldKeepOriginalInstanceHidden(e) ? Kn : e.originalMatrix;
|
|
19623
19831
|
s instanceof H && (e.sourceMesh.setMatrixAt(e.subIndex, s), e.sourceMesh.instanceMatrix.needsUpdate = !0);
|
|
19624
19832
|
return;
|
|
19625
19833
|
}
|
|
@@ -19734,7 +19942,7 @@ class Ch {
|
|
|
19734
19942
|
].filter((o) => o instanceof R && !o.isEmpty());
|
|
19735
19943
|
if (i.length === 0)
|
|
19736
19944
|
return null;
|
|
19737
|
-
const n =
|
|
19945
|
+
const n = Se(this.engine, e.url), s = new R().makeEmpty();
|
|
19738
19946
|
return i.forEach((o) => s.union(o.clone().applyMatrix4(n))), s.isEmpty() ? null : s;
|
|
19739
19947
|
}
|
|
19740
19948
|
/** 计算单个模型在世界坐标下的整体包围盒,作为默认爆炸原点的依据。 */
|
|
@@ -19823,7 +20031,7 @@ class Ch {
|
|
|
19823
20031
|
return Math.abs(i);
|
|
19824
20032
|
}
|
|
19825
20033
|
}
|
|
19826
|
-
const
|
|
20034
|
+
const jn = "bim-material-editor-style", st = [
|
|
19827
20035
|
"map",
|
|
19828
20036
|
"normalMap",
|
|
19829
20037
|
"roughnessMap",
|
|
@@ -19874,7 +20082,7 @@ class Eh {
|
|
|
19874
20082
|
collectFromNode(e) {
|
|
19875
20083
|
const t = /* @__PURE__ */ new Map();
|
|
19876
20084
|
return (Array.isArray(e?.indexes) ? e.indexes : []).forEach((s) => {
|
|
19877
|
-
const o =
|
|
20085
|
+
const o = _e(this.engine, s?.[0]);
|
|
19878
20086
|
o instanceof it && this.getObjectMaterials(o).forEach((r) => this.mergeMaterialOption(t, r, [o]));
|
|
19879
20087
|
}), (Array.isArray(e?.infos) ? e.infos : []).forEach((s) => {
|
|
19880
20088
|
const o = s?.mesh;
|
|
@@ -19902,8 +20110,8 @@ class Eh {
|
|
|
19902
20110
|
e.set(t.uuid, { material: t, owners: [...i] });
|
|
19903
20111
|
}
|
|
19904
20112
|
}
|
|
19905
|
-
function
|
|
19906
|
-
if (!(a instanceof
|
|
20113
|
+
function oi(a) {
|
|
20114
|
+
if (!(a instanceof De))
|
|
19907
20115
|
return "";
|
|
19908
20116
|
const e = a.userData?.sourceUrl;
|
|
19909
20117
|
if (typeof e == "string")
|
|
@@ -19929,7 +20137,7 @@ function si(a) {
|
|
|
19929
20137
|
function bi(a) {
|
|
19930
20138
|
return a.map((e) => e.name || e.url || e.type || e.uuid).filter((e, t, i) => e.length > 0 && i.indexOf(e) === t);
|
|
19931
20139
|
}
|
|
19932
|
-
function
|
|
20140
|
+
function js(a) {
|
|
19933
20141
|
const e = {
|
|
19934
20142
|
name: a.name,
|
|
19935
20143
|
opacity: a.opacity,
|
|
@@ -19947,7 +20155,7 @@ function qs(a) {
|
|
|
19947
20155
|
}), e;
|
|
19948
20156
|
}
|
|
19949
20157
|
function yt(a) {
|
|
19950
|
-
return a instanceof
|
|
20158
|
+
return a instanceof De ? oi(a) || a.uuid : a;
|
|
19951
20159
|
}
|
|
19952
20160
|
function Ah(a) {
|
|
19953
20161
|
const e = a, t = {
|
|
@@ -19966,7 +20174,7 @@ function Ah(a) {
|
|
|
19966
20174
|
}), JSON.stringify(t);
|
|
19967
20175
|
}
|
|
19968
20176
|
function Sh(a, e) {
|
|
19969
|
-
const t =
|
|
20177
|
+
const t = js(a), i = {};
|
|
19970
20178
|
return Object.entries(e.values).forEach(([n, s]) => {
|
|
19971
20179
|
const o = t[n];
|
|
19972
20180
|
yt(s) !== yt(o) && (i[n] = {
|
|
@@ -19975,19 +20183,19 @@ function Sh(a, e) {
|
|
|
19975
20183
|
});
|
|
19976
20184
|
}), i;
|
|
19977
20185
|
}
|
|
19978
|
-
function
|
|
20186
|
+
function Ys(a, e, t) {
|
|
19979
20187
|
const i = a;
|
|
19980
20188
|
if ((e === "color" || e === "emissive") && i[e] instanceof xe && typeof t == "string") {
|
|
19981
20189
|
i[e].set(t);
|
|
19982
20190
|
return;
|
|
19983
20191
|
}
|
|
19984
20192
|
if (st.includes(e)) {
|
|
19985
|
-
i[e] = t instanceof
|
|
20193
|
+
i[e] = t instanceof De ? t : null;
|
|
19986
20194
|
return;
|
|
19987
20195
|
}
|
|
19988
20196
|
(e in i || e in a) && (i[e] = t);
|
|
19989
20197
|
}
|
|
19990
|
-
function
|
|
20198
|
+
function Kt(a) {
|
|
19991
20199
|
const e = a;
|
|
19992
20200
|
return {
|
|
19993
20201
|
id: a.uuid,
|
|
@@ -20005,8 +20213,8 @@ function qt(a) {
|
|
|
20005
20213
|
textures: st.filter((t) => t in e).map((t) => ({
|
|
20006
20214
|
slot: t,
|
|
20007
20215
|
name: Li[t],
|
|
20008
|
-
url:
|
|
20009
|
-
hasTexture: e[t] instanceof
|
|
20216
|
+
url: oi(e[t]),
|
|
20217
|
+
hasTexture: e[t] instanceof De
|
|
20010
20218
|
}))
|
|
20011
20219
|
};
|
|
20012
20220
|
}
|
|
@@ -20114,7 +20322,7 @@ class Ph {
|
|
|
20114
20322
|
const i = e;
|
|
20115
20323
|
return st.filter((n) => n in i).forEach((n) => {
|
|
20116
20324
|
const s = this.createElement("div", "bim-material-editor__texture-row"), o = this.createElement("label", "", Li[n]), r = document.createElement("input");
|
|
20117
|
-
r.type = "text", r.placeholder = "输入贴图 URL", r.value =
|
|
20325
|
+
r.type = "text", r.placeholder = "输入贴图 URL", r.value = oi(i[n]), r.addEventListener("change", () => {
|
|
20118
20326
|
this.host.setTexture(e.uuid, n, r.value.trim() || null);
|
|
20119
20327
|
});
|
|
20120
20328
|
const l = document.createElement("input");
|
|
@@ -20130,7 +20338,7 @@ class Ph {
|
|
|
20130
20338
|
}
|
|
20131
20339
|
/** 材质卡片预览优先显示贴图,没有贴图时用材质颜色兜底。 */
|
|
20132
20340
|
createMaterialPreview(e) {
|
|
20133
|
-
const t = this.createElement("div", "bim-material-editor__material-preview"), i = e, n = i.map instanceof
|
|
20341
|
+
const t = this.createElement("div", "bim-material-editor__material-preview"), i = e, n = i.map instanceof De ? i.map : st.map((r) => i[r]).find((r) => r instanceof De), s = oi(n);
|
|
20134
20342
|
if (s)
|
|
20135
20343
|
return t.style.backgroundImage = `url(${JSON.stringify(s)})`, t.classList.add("has-texture"), t;
|
|
20136
20344
|
const o = i.color instanceof xe ? `#${i.color.getHexString()}` : "#c7ced8";
|
|
@@ -20166,7 +20374,7 @@ class Ph {
|
|
|
20166
20374
|
createSideSelect(e, t) {
|
|
20167
20375
|
const i = this.createElement("div", "bim-material-editor__row"), n = document.createElement("select");
|
|
20168
20376
|
return [
|
|
20169
|
-
{ label: "正面", value:
|
|
20377
|
+
{ label: "正面", value: ko },
|
|
20170
20378
|
{ label: "背面", value: Ni },
|
|
20171
20379
|
{ label: "双面", value: re }
|
|
20172
20380
|
].forEach((s) => {
|
|
@@ -20183,10 +20391,10 @@ class Ph {
|
|
|
20183
20391
|
return t && (n.className = t), i && (n.textContent = i), n;
|
|
20184
20392
|
}
|
|
20185
20393
|
ensureStyle() {
|
|
20186
|
-
if (document.getElementById(
|
|
20394
|
+
if (document.getElementById(jn) != null)
|
|
20187
20395
|
return;
|
|
20188
20396
|
const e = document.createElement("style");
|
|
20189
|
-
e.id =
|
|
20397
|
+
e.id = jn, e.textContent = `
|
|
20190
20398
|
.bim-material-editor{position:absolute;right:0;top:0;bottom:0;z-index:1005;height:100%;max-height:100%;display:grid;grid-template-rows:auto auto auto auto minmax(0,1fr) auto;gap:8px;padding:12px;background:#f7f9fc;color:#1b2430;border-left:1px solid #d7dde8;box-shadow:-8px 0 24px rgba(20,30,45,.16);font:13px/1.4 Arial,"Microsoft YaHei",sans-serif;box-sizing:border-box;overflow:hidden}
|
|
20191
20399
|
.bim-material-editor *{box-sizing:border-box}
|
|
20192
20400
|
.bim-material-editor__header{display:flex;align-items:center;justify-content:space-between;gap:8px}
|
|
@@ -20241,7 +20449,7 @@ class Th {
|
|
|
20241
20449
|
name: e.name,
|
|
20242
20450
|
type: e.type,
|
|
20243
20451
|
objectNames: bi(t),
|
|
20244
|
-
values:
|
|
20452
|
+
values: js(e)
|
|
20245
20453
|
});
|
|
20246
20454
|
}
|
|
20247
20455
|
getModifiedMaterials() {
|
|
@@ -20264,7 +20472,7 @@ class Th {
|
|
|
20264
20472
|
restore(e) {
|
|
20265
20473
|
const t = this.baselineSnapshots.get(e.uuid);
|
|
20266
20474
|
return t == null ? !1 : (Object.entries(t.values).forEach(([i, n]) => {
|
|
20267
|
-
|
|
20475
|
+
Ys(e, i, n);
|
|
20268
20476
|
}), e.needsUpdate = !0, !0);
|
|
20269
20477
|
}
|
|
20270
20478
|
}
|
|
@@ -20331,19 +20539,19 @@ class Ih {
|
|
|
20331
20539
|
}
|
|
20332
20540
|
/** 只读取目标对象材质,不改变当前 UI 选择。 */
|
|
20333
20541
|
getMaterialsByObject(e) {
|
|
20334
|
-
return this.collector.collectFromObject(e).map((t) =>
|
|
20542
|
+
return this.collector.collectFromObject(e).map((t) => Kt(t.material));
|
|
20335
20543
|
}
|
|
20336
20544
|
/** 只读取指定构件材质,不改变当前 UI 选择。 */
|
|
20337
20545
|
getMaterialsByTarget(e) {
|
|
20338
|
-
return this.collector.collectFromTarget(e).map((t) =>
|
|
20546
|
+
return this.collector.collectFromTarget(e).map((t) => Kt(t.material));
|
|
20339
20547
|
}
|
|
20340
20548
|
/** 读取当前场景中所有可编辑材质。 */
|
|
20341
20549
|
getAllSceneMaterials() {
|
|
20342
|
-
return this.collectSceneMaterials().map((e) =>
|
|
20550
|
+
return this.collectSceneMaterials().map((e) => Kt(e.material));
|
|
20343
20551
|
}
|
|
20344
20552
|
/** 返回当前选择对象上可编辑的材质信息。 */
|
|
20345
20553
|
getSelectedMaterials() {
|
|
20346
|
-
return this.selectedMaterials.map((e) =>
|
|
20554
|
+
return this.selectedMaterials.map((e) => Kt(e.material));
|
|
20347
20555
|
}
|
|
20348
20556
|
/** 返回全场景相对快照发生变化的材质信息。 */
|
|
20349
20557
|
getModifiedMaterials() {
|
|
@@ -20358,7 +20566,7 @@ class Ih {
|
|
|
20358
20566
|
const i = this.findMaterialGroupById(e);
|
|
20359
20567
|
i.length !== 0 && (i.forEach((n) => {
|
|
20360
20568
|
this.snapshots.ensure(n, this.collector.findOwners(n)), Object.entries(t).forEach(([s, o]) => {
|
|
20361
|
-
|
|
20569
|
+
Ys(n, s, o);
|
|
20362
20570
|
}), n.needsUpdate = !0;
|
|
20363
20571
|
}), this.requestRender(), this.render());
|
|
20364
20572
|
}
|
|
@@ -20443,7 +20651,7 @@ class Ih {
|
|
|
20443
20651
|
}
|
|
20444
20652
|
replaceTexture(e, t, i) {
|
|
20445
20653
|
const n = e, s = n[t];
|
|
20446
|
-
s != null && this.ownedTextures.has(s) && (s.dispose(), this.ownedTextures.delete(s)), i != null && (i.colorSpace = t === "map" || t === "emissiveMap" ? We :
|
|
20654
|
+
s != null && this.ownedTextures.has(s) && (s.dispose(), this.ownedTextures.delete(s)), i != null && (i.colorSpace = t === "map" || t === "emissiveMap" ? We : Lo, i.wrapS = pt, i.wrapT = pt, i.needsUpdate = !0, this.ownedTextures.add(i)), n[t] = i, e.needsUpdate = !0, this.requestRender();
|
|
20447
20655
|
}
|
|
20448
20656
|
loadTexture(e) {
|
|
20449
20657
|
return new Promise((t, i) => {
|
|
@@ -20547,7 +20755,7 @@ class _h {
|
|
|
20547
20755
|
n != null && (n.has(t) || n.set(t, []), n.get(t)?.push(i));
|
|
20548
20756
|
}
|
|
20549
20757
|
}
|
|
20550
|
-
const
|
|
20758
|
+
const jt = {
|
|
20551
20759
|
lineType: "bezier",
|
|
20552
20760
|
lineColor: "#22c55e",
|
|
20553
20761
|
previewColor: "#f59e0b",
|
|
@@ -20574,9 +20782,9 @@ class Lh {
|
|
|
20574
20782
|
pointsGroup = new me();
|
|
20575
20783
|
points = [];
|
|
20576
20784
|
history = [];
|
|
20577
|
-
options = { ...
|
|
20578
|
-
lineType =
|
|
20579
|
-
roundedRadius =
|
|
20785
|
+
options = { ...jt };
|
|
20786
|
+
lineType = jt.lineType;
|
|
20787
|
+
roundedRadius = jt.roundedRadius;
|
|
20580
20788
|
line = null;
|
|
20581
20789
|
previewLine = null;
|
|
20582
20790
|
previewMarker = null;
|
|
@@ -20603,7 +20811,7 @@ class Lh {
|
|
|
20603
20811
|
}
|
|
20604
20812
|
/** 打开路径编辑器;重复打开会先彻底清理上一次会话。 */
|
|
20605
20813
|
open(e = {}) {
|
|
20606
|
-
this.active && this.close(), this.options = { ...
|
|
20814
|
+
this.active && this.close(), this.options = { ...jt, ...e }, this.pathId = e.id ?? `path-${Date.now()}`, this.lineType = this.options.lineType, this.roundedRadius = Math.max(0, this.options.roundedRadius), this.active = !0, this.mode = "editing", this.engine.scene?.add(this.root), this.ensureTransformControl(), this.createPanel(), this.activateBehavior(), window.addEventListener("keydown", this.onKeyDown, !0), this.refreshAll();
|
|
20607
20815
|
}
|
|
20608
20816
|
/** 点击“添加点”后进入单次拾取,成功落点会立即回到编辑状态。 */
|
|
20609
20817
|
startAddPoint() {
|
|
@@ -20743,7 +20951,7 @@ class Lh {
|
|
|
20743
20951
|
this.transformControl?.detach(), this.transformHelper && (this.transformHelper.visible = !1, this.transformHelper.parent?.remove(this.transformHelper));
|
|
20744
20952
|
}
|
|
20745
20953
|
createPointRecord(e, t) {
|
|
20746
|
-
const i = new
|
|
20954
|
+
const i = new Jt(this.options.pointSize, 18, 12), n = new oe({
|
|
20747
20955
|
color: this.options.pointColor,
|
|
20748
20956
|
depthTest: !1,
|
|
20749
20957
|
depthWrite: !1
|
|
@@ -20774,7 +20982,7 @@ class Lh {
|
|
|
20774
20982
|
}
|
|
20775
20983
|
updatePreview(e) {
|
|
20776
20984
|
this.previewMarker || (this.previewMarker = new z(
|
|
20777
|
-
new
|
|
20985
|
+
new Jt(this.options.pointSize * 0.72, 14, 10),
|
|
20778
20986
|
new oe({ color: this.options.previewColor, depthTest: !1, depthWrite: !1 })
|
|
20779
20987
|
), this.previewMarker.renderOrder = 1003, this.root.add(this.previewMarker)), this.previewMarker.position.copy(e), this.previewMarker.visible = !0;
|
|
20780
20988
|
const t = [...this.points.map((n) => n.position), e];
|
|
@@ -20801,10 +21009,10 @@ class Lh {
|
|
|
20801
21009
|
}
|
|
20802
21010
|
/** 使用 Line2 保证 WebGL 环境下的像素线宽真实生效。 */
|
|
20803
21011
|
updateLineObject(e, t, i) {
|
|
20804
|
-
const n = new
|
|
21012
|
+
const n = new Bo();
|
|
20805
21013
|
if (n.setPositions(t.flatMap((r) => [r.x, r.y, r.z])), e)
|
|
20806
21014
|
return e.geometry.dispose(), e.geometry = n, e.computeLineDistances(), this.syncLineResolution(e), this.requestRender(), e;
|
|
20807
|
-
const s = new
|
|
21015
|
+
const s = new zo({
|
|
20808
21016
|
color: i ? this.options.previewColor : this.options.lineColor,
|
|
20809
21017
|
linewidth: this.options.lineWidth,
|
|
20810
21018
|
dashed: i,
|
|
@@ -20813,7 +21021,7 @@ class Lh {
|
|
|
20813
21021
|
depthTest: !1,
|
|
20814
21022
|
transparent: i,
|
|
20815
21023
|
opacity: i ? 0.82 : 1
|
|
20816
|
-
}), o = new
|
|
21024
|
+
}), o = new Ro(n, s);
|
|
20817
21025
|
return o.name = i ? "PathDrawPreviewLine" : "PathDrawLine", o.renderOrder = i ? 1001 : 1e3, o.computeLineDistances(), this.syncLineResolution(o), this.root.add(o), this.requestRender(), o;
|
|
20818
21026
|
}
|
|
20819
21027
|
syncLineResolution(e) {
|
|
@@ -21123,13 +21331,13 @@ const zh = Object.freeze({
|
|
|
21123
21331
|
maxTextureSize: 10240,
|
|
21124
21332
|
samples: 4,
|
|
21125
21333
|
restrictTextureSize: !0
|
|
21126
|
-
}),
|
|
21334
|
+
}), Yn = Object.freeze({
|
|
21127
21335
|
maxTextureSize: 10240,
|
|
21128
21336
|
samples: 4,
|
|
21129
21337
|
restrictTextureSize: !1
|
|
21130
21338
|
});
|
|
21131
21339
|
function Fh(a) {
|
|
21132
|
-
return a == null ?
|
|
21340
|
+
return a == null ? Yn : typeof a != "number" || !Number.isFinite(a) || a <= 4 ? zh : a <= 6 ? Rh : a < 8 ? Oh : Yn;
|
|
21133
21341
|
}
|
|
21134
21342
|
class Wh {
|
|
21135
21343
|
// 引擎参数
|
|
@@ -21248,22 +21456,22 @@ class Wh {
|
|
|
21248
21456
|
// 业务数据
|
|
21249
21457
|
models = [];
|
|
21250
21458
|
reactBoundingClientRect = { left: 0, top: 0 };
|
|
21251
|
-
version =
|
|
21459
|
+
version = Vo;
|
|
21252
21460
|
versionEl = null;
|
|
21253
21461
|
// 引擎容器
|
|
21254
21462
|
container;
|
|
21255
21463
|
constructor(e) {
|
|
21256
|
-
if (window.THREE =
|
|
21464
|
+
if (window.THREE = Xn, vr(), this.options = e, this.mobileMemoryProfile = Fh(e.limit_memory), this.container = document.getElementById(e.containerId), !this.container)
|
|
21257
21465
|
throw new Error(`Container ${e.containerId} not found`);
|
|
21258
|
-
if (this.rxQuotaListMapper = new _h(this), this.filterLoaderModel = new Bh(this), this.engineModelModule = new
|
|
21466
|
+
if (this.rxQuotaListMapper = new _h(this), this.filterLoaderModel = new Bh(this), this.engineModelModule = new $a(this), this.engineModelModule.init(), this.deviceModule = new Qo(this), this.deviceType = this.deviceModule.getDeviceType(), this.cameraModule = new ie(this), this.sceneModule = new Xo(this), this.scene = this.sceneModule.scene, this.renderModule = new $o(this), this.renderer = this.renderModule.createRenderer(), this.camera = this.cameraModule.perspectiveCamera, this.scene.camera = this.camera, this.renderer) {
|
|
21259
21467
|
const o = this.renderer;
|
|
21260
21468
|
o.interactionCullingEnabled = !0, o.interactionActive = !1, o.interactionRenderScene = this.scene, o.interactionFrameBudgetMs = this.options.interactionFrameBudgetMs ?? 6, o.interactionSkipShadows = this.options.interactionSkipShadows ?? !0;
|
|
21261
21469
|
}
|
|
21262
|
-
this.controlModule = new
|
|
21470
|
+
this.controlModule = new hr(this), this.controlModule.switchDefaultMode(), this.controls = this.controlModule.orbitControls, this.clipping = new Fl(this), this.clipping.init(), this.composerModule = new ur(this), this.composerModule.init(), this.events = new Aa();
|
|
21263
21471
|
const t = this.events.trigger.bind(this.events);
|
|
21264
21472
|
this.events.trigger = ((o, r) => {
|
|
21265
21473
|
t(o, r), String(o) !== String(ne.EngineBusy) && this.requestComposerRender();
|
|
21266
|
-
}), this.engineStatus = new
|
|
21474
|
+
}), this.engineStatus = new Ea(this), this.engineStatus.init(), this.loaderModule = new ve(this), this.lightModule = new qa(this), this.lightModule.init(), this.viewCube = new tl(this), this.viewCube.init(), this.options.showViewCube == !1 && this.viewCube.hide(), this.octreeBox = il(this), this.rangeScale = new nl(this), this.rangeScale.init(), this.setting = new El(this), this.engineModelModule.init(), this.handelBehaved = Ki(this), this.modelMapperBatch = new ql(this), this.measure = new Ll(this), this.modelToolModule = new ja(this), this.modelLink3d = new Bc(this, this.options.linkOptions ?? {}), this.modelLink3d.init(), this.modelProperties = new Vl(this), this.search = new Gl(this), this.interactionModule = new Ka(this), this.interactionModule.init(), this.interactionModule.active(), this.hoverHighLight = new si(this), this.modelEdge = new bl(this), this.nodeBox = new Yl(this), this.modelTree = new Nl(this), this.viewTree = new Yi(this), this.merge2d = new gc(this), this.engineInfo = new Hl(this), this.pathRoaming = new Zl(this), this.pathRoaming.init(), this.oneClickEncoding = new sc(this), this.minMap = new Jl(this), this.linkElement2d3d = new ic(this), this.linkView2d3d = new nc(this), this.grid = new rl(this), this.level = new ul(this), this.issueReport = new ec(this), this.fabricDraw = new Dc(this), this.drawingPin = new kc(this), this.label = new zc(this), this.annotation3d = new yh(this), this.calibration = new dt(this), this.modelPlace = new wh(this), this.modelComparison = new bh(this), this.modelExplode = new Ch(this), this.materialTool = new Ih(this, this.options.materialEditorOptions ?? {}), this.materialTool.init(), this.pathDraw = new Lh(this), this.text = new tc(this), this.hdr = new cl(this), this.ground = new ji(this), this.ground.init(), this.skyManager = new Cl(this), this.setting.init(), this.worldToScreen = new fe(this.camera, this.renderer, this.scene), this.options.showStats && (this.stats = new Yo(), this.stats.showPanel(0), this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0px", this.stats.dom.style.left = "0px", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom));
|
|
21267
21475
|
let i = document.createElement("div");
|
|
21268
21476
|
i.className = "versionText", this.versionEl = i, this.updateVersionDisplay(), this.container.appendChild(i);
|
|
21269
21477
|
let n = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
@@ -21379,7 +21587,7 @@ class Wh {
|
|
|
21379
21587
|
* 解析得到多个模型地址时,共用同一份加载选项,包括是否加载边线。
|
|
21380
21588
|
*/
|
|
21381
21589
|
async loadModelByViewToken(e, t) {
|
|
21382
|
-
const i = await
|
|
21590
|
+
const i = await Uo(
|
|
21383
21591
|
this.options,
|
|
21384
21592
|
e,
|
|
21385
21593
|
"3d"
|
|
@@ -21489,7 +21697,7 @@ class Wh {
|
|
|
21489
21697
|
const i = this.getViewportSize(e, t);
|
|
21490
21698
|
e = i.width, t = i.height;
|
|
21491
21699
|
const n = this.camera.position.clone(), s = this.camera.quaternion.clone(), o = this.camera.up.clone(), r = this.controls?.target?.clone?.(), l = this.controlModule?.orbitControls?.origin?.clone?.();
|
|
21492
|
-
this.renderer.setPixelRatio(
|
|
21700
|
+
this.renderer.setPixelRatio(as(this)), this.renderer.setSize(e, t, !1);
|
|
21493
21701
|
const c = this.renderer.domElement.clientWidth || e, h = this.renderer.domElement.clientHeight || t;
|
|
21494
21702
|
if (!c || !h)
|
|
21495
21703
|
return;
|
|
@@ -21556,7 +21764,7 @@ class Wh {
|
|
|
21556
21764
|
if (!e) return;
|
|
21557
21765
|
[...e.children].forEach((i) => {
|
|
21558
21766
|
this.clearScene(i);
|
|
21559
|
-
}), e.parent && e.parent.remove(e), e instanceof z && !(e instanceof V) && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((i) => this.disposeMaterial(i)) : this.disposeMaterial(e.material))), e instanceof Lt && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof
|
|
21767
|
+
}), e.parent && e.parent.remove(e), e instanceof z && !(e instanceof V) && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((i) => this.disposeMaterial(i)) : this.disposeMaterial(e.material))), e instanceof Lt && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof Oo && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof V && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((i) => this.disposeMaterial(i)) : this.disposeMaterial(e.material)), e.instanceMatrix && (e.instanceMatrix = null), e.instanceColor && (e.instanceColor = null)), e instanceof Ci && e.material && this.disposeMaterial(e.material), e instanceof Fo && e.shadow?.dispose?.();
|
|
21560
21768
|
}
|
|
21561
21769
|
/**
|
|
21562
21770
|
* 清理材质及其纹理
|
|
@@ -21575,7 +21783,7 @@ class Wh {
|
|
|
21575
21783
|
}), e.background = null, e.environment = null, e.overrideMaterial = null, e.dirLight = null, e.camera = null;
|
|
21576
21784
|
}
|
|
21577
21785
|
disposeSceneAttachment(e) {
|
|
21578
|
-
e && (e instanceof At || e instanceof
|
|
21786
|
+
e && (e instanceof At || e instanceof De) && e.dispose?.();
|
|
21579
21787
|
}
|
|
21580
21788
|
disposeMaterial(e) {
|
|
21581
21789
|
if (!e) return;
|
|
@@ -21606,7 +21814,7 @@ class Wh {
|
|
|
21606
21814
|
"iridescenceThicknessMap"
|
|
21607
21815
|
].forEach((i) => {
|
|
21608
21816
|
const n = e[i];
|
|
21609
|
-
n && n instanceof
|
|
21817
|
+
n && n instanceof De && n.dispose();
|
|
21610
21818
|
}), e.dispose();
|
|
21611
21819
|
}
|
|
21612
21820
|
}
|