iflow-engine-base 4.0.18 → 4.0.19
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 +246 -246
- package/dist/chunks/{EngineKernel-BucDRg23.js → EngineKernel-CZX0Omjs.js} +730 -718
- package/dist/chunks/{engine-2d-BjtuYZUi.js → engine-2d-CA5-uNuf.js} +2 -2
- package/dist/chunks/{engine-3d-DnlK2vTK.js → engine-3d-BsWcD-bl.js} +2 -2
- package/dist/chunks/{engine-720-DJsweyG9.js → engine-720-DiTJEtdN.js} +1 -1
- package/dist/chunks/{engine-gaussian-DklK6vdJ.js → engine-gaussian-BHUGuaw_.js} +1 -1
- package/dist/chunks/{index-BtsyaVm2.js → index-D7NwsYhB.js} +8 -8
- package/dist/chunks/{sdk-runtime-CFM9OAcx.js → sdk-runtime-DN15bwdD.js} +1 -1
- package/dist/index.d.ts +13 -5
- package/package.json +3 -1
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { bJ as
|
|
2
|
-
import { a as ui, J as Oi, h as
|
|
3
|
-
import { W as Me, L as Tt, B as fn, C as
|
|
4
|
-
import { E as se, S as
|
|
5
|
-
import { r as Z, g as
|
|
6
|
-
import { D as Xe, g as Te, E as oe, a as Le, b as
|
|
7
|
-
import { L as
|
|
8
|
-
function
|
|
9
|
-
const { camera: e, depthNode: t, inputNode: i, normalNode: n, parameters: s } = a, o = s.gtao, r =
|
|
1
|
+
import { bJ as ao, bK as me, bL as ai, bM as lo, bN as co, bO as ho, bP as uo, bQ as po, bR as go, bS as mo, bT as fo, aT as ln, bU as yo, bV as vo, bW as ft, bX as Mo, bY as bo, bZ as xo, b_ as hs, b$ as ds, a as d, c0 as _t, c1 as wo, c2 as vt, c3 as Co, c4 as Eo, c5 as So, c6 as tt, c7 as Ao, i as kt, c8 as Po, c9 as To, ca as Io, cb as Ve, cc as Gt, cd as cn, ao as st, C as ce, P as Lt, j as Ne, k as O, l as it, q as Do, r as ut, V as j, Q as ze, E as us, R as be, s as $e, G as Pe, t as ps, u as B, v as Yi, A as gs, b as H, w as vi, ac as Rt, ab as ot, O as Bt, ad as ve, M as G, I as W, S as Ge, $ as ms, a0 as fs, a1 as ys, e as Se, a2 as _o, a3 as vs, a4 as de, a5 as ko, c as zt, B as Ms, a6 as Ri, a7 as Lo, a9 as bs, aa as Ro, T as Oe, ae as le, af as li, m as xs, n as Bo, ce as zo, o as Oo, p as Qi, bI as No, W as ws, f as bt, ah as hn, ai as rt, aj as Cs, ak as Fo, al as Ho, am as Bi, g as ci, cf as Vo, ap as Uo, aq as qo, cg as Es, at as zi, au as hi, ch as Go, as as di, aw as Wo, aC as jo, aD as Ko, y as Yo, z as Qo, L as dn, ci as wt, cj as un, ck as Ct, cl as pn, cm as Mi, cn as Xo, co as $o, cp as bi, aF as Jo, aG as Zo, aH as er, aI as tr, aJ as ir, aK as nr, aL as sr, aM as Ss, aN as or, aO as rr, aP as ar, ax as As, d as lr, N as cr, aQ as hr, aR as dr, aS as ur } from "./three-vendor-CGmeNMm5.js";
|
|
2
|
+
import { a as ui, J as Oi, h as pr, d as gr, B as xi, $ as mr, F as fr, c as gn, M as mn, S as yr } from "./sdk-vendor-6wYtfmXR.js";
|
|
3
|
+
import { W as Me, L as Tt, B as fn, C as vr, g as Fe, a as Mr, E as br, r as xr } from "./sdk-runtime-DN15bwdD.js";
|
|
4
|
+
import { E as se, S as wr, c as Cr, d as Er, C as Sr, A as Ar } from "./engine-3d-BsWcD-bl.js";
|
|
5
|
+
import { r as Z, g as Pr } from "./sdk-assets-DtcFvuth.js";
|
|
6
|
+
import { D as Xe, g as Te, E as oe, a as Le, b as lt, c as Xi, d as $i, f as Ji, e as Mt, h as pi, s as Tr, i as Ni, j as yn, k as Wt, l as vn, m as Ot, n as Mn, o as Ps, M as Ir } from "./index-D7NwsYhB.js";
|
|
7
|
+
import { L as Dr } from "./engine-2d-CA5-uNuf.js";
|
|
8
|
+
function _r(a) {
|
|
9
|
+
const { camera: e, depthNode: t, inputNode: i, normalNode: n, parameters: s } = a, o = s.gtao, r = ao(t, n, e);
|
|
10
10
|
return r.resolutionScale = o.resolutionScale, r.radius.value = o.radius, r.thickness.value = o.thickness, r.distanceExponent.value = o.distanceExponent, r.distanceFallOff.value = o.distanceFallOff, r.scale.value = o.scale, r.samples.value = o.samples, r.useTemporalFiltering = o.useTemporalFiltering && a.temporalFiltering, {
|
|
11
11
|
outputNode: me(i.rgb.mul(r.getTextureNode().r), i.a),
|
|
12
12
|
node: r,
|
|
13
13
|
dispose: () => r.dispose()
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function kr(a, e) {
|
|
17
17
|
const t = ai(a, e);
|
|
18
|
-
t.setMRT(
|
|
19
|
-
output:
|
|
18
|
+
t.setMRT(lo({
|
|
19
|
+
output: ho,
|
|
20
20
|
// 金属度和粗糙度复用 Alpha,避免超过常见设备的四颜色附件上限。
|
|
21
|
-
diffuseColor: me(
|
|
22
|
-
normal: me(
|
|
23
|
-
velocity:
|
|
21
|
+
diffuseColor: me(mo.rgb, fo),
|
|
22
|
+
normal: me(uo(po), go),
|
|
23
|
+
velocity: co
|
|
24
24
|
})), t.getTexture("diffuseColor").type = ln, t.getTexture("normal").type = ln;
|
|
25
|
-
const i = t.getTextureNode("diffuseColor"), n = t.getTextureNode("normal"), s =
|
|
25
|
+
const i = t.getTextureNode("diffuseColor"), n = t.getTextureNode("normal"), s = yo((o) => vo(n.sample(o)));
|
|
26
26
|
return {
|
|
27
27
|
scenePass: t,
|
|
28
28
|
colorNode: t.getTextureNode("output"),
|
|
29
29
|
depthNode: t.getTextureNode("depth"),
|
|
30
30
|
diffuseNode: i,
|
|
31
|
-
metalRoughNode:
|
|
31
|
+
metalRoughNode: ft(i.a, n.a),
|
|
32
32
|
normalNode: s,
|
|
33
33
|
velocityNode: t.getTextureNode("velocity")
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const { camera: e, colorNode: t, depthNode: i, diffuseNode: n, inputNode: s, normalNode: o, parameters: r } = a, l = r.ssgi, c =
|
|
36
|
+
function Lr(a) {
|
|
37
|
+
const { camera: e, colorNode: t, depthNode: i, diffuseNode: n, inputNode: s, normalNode: o, parameters: r } = a, l = r.ssgi, c = Mo(t, i, o, e);
|
|
38
38
|
c.sliceCount.value = l.sliceCount, c.stepCount.value = l.stepCount, c.aoIntensity.value = l.aoIntensity, c.giIntensity.value = l.giIntensity, c.radius.value = l.radius, c.useScreenSpaceSampling.value = l.useScreenSpaceSampling, c.expFactor.value = l.expFactor, c.thickness.value = l.thickness, c.useLinearThickness.value = l.useLinearThickness, c.backfaceLighting.value = l.backfaceLighting, c.useTemporalFiltering = l.useTemporalFiltering && a.temporalFiltering;
|
|
39
39
|
const h = s.rgb.mul(c.getAONode().r).add(n.rgb.mul(c.getGINode().rgb));
|
|
40
40
|
return {
|
|
@@ -43,8 +43,8 @@ function kr(a) {
|
|
|
43
43
|
dispose: () => c.dispose()
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
const { camera: e, colorNode: t, depthNode: i, inputNode: n, metalRoughNode: s, normalNode: o, parameters: r } = a, l = r.ssr, c = l.environmentNode, h = c?.isTexture === !0 && c.image?.data != null, u =
|
|
46
|
+
function Rr(a) {
|
|
47
|
+
const { camera: e, colorNode: t, depthNode: i, inputNode: n, metalRoughNode: s, normalNode: o, parameters: r } = a, l = r.ssr, c = l.environmentNode, h = c?.isTexture === !0 && c.image?.data != null, u = bo(t, i, o, {
|
|
48
48
|
camera: e,
|
|
49
49
|
metalnessNode: s.r.max(0.04),
|
|
50
50
|
roughnessNode: s.g,
|
|
@@ -60,13 +60,13 @@ function Lr(a) {
|
|
|
60
60
|
dispose: () => u.dispose()
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
const { camera: e, depthNode: t, inputNode: i, parameters: n, velocityNode: s } = a, o = n.traa, r =
|
|
65
|
-
l.transparent = !0, l.blending =
|
|
63
|
+
function Br(a) {
|
|
64
|
+
const { camera: e, depthNode: t, inputNode: i, parameters: n, velocityNode: s } = a, o = n.traa, r = xo(i, t, s, e), l = r._resolveMaterial;
|
|
65
|
+
l.transparent = !0, l.blending = hs, r.depthThreshold = o.depthThreshold, r.edgeDepthDiff = o.edgeDepthDiff, r.maxVelocityLength = o.maxVelocityLength, r.useSubpixelCorrection = o.useSubpixelCorrection;
|
|
66
66
|
let c = r;
|
|
67
67
|
if (a.transparentBackground) {
|
|
68
68
|
const h = r.a, u = me(r.rgb, h);
|
|
69
|
-
c =
|
|
69
|
+
c = ds(() => (h.lessThanEqual(0).discard(), u))();
|
|
70
70
|
}
|
|
71
71
|
return {
|
|
72
72
|
outputNode: c,
|
|
@@ -74,19 +74,19 @@ function Rr(a) {
|
|
|
74
74
|
dispose: () => r.dispose()
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
const t =
|
|
77
|
+
function zr(a, e) {
|
|
78
|
+
const t = Or(e.colorTemperature), i = ii(e.saturation, 0, 2), n = ii(e.contrast, 0, 2), s = ii(e.sharpen, 0, 1);
|
|
79
79
|
if (t.equals(new d(1, 1, 1)) && i === 1 && n === 1 && s === 0)
|
|
80
80
|
return { outputNode: a, node: null, dispose: () => {
|
|
81
81
|
} };
|
|
82
|
-
const r = _t(t.x, t.y, t.z), l =
|
|
83
|
-
const h = a.rgb.mul(r), u = _t(
|
|
82
|
+
const r = _t(t.x, t.y, t.z), l = ds(() => {
|
|
83
|
+
const h = a.rgb.mul(r), u = _t(wo(h)), g = vt(u, h, i).sub(0.5).mul(n).add(0.5);
|
|
84
84
|
return me(g.max(0), a.a);
|
|
85
85
|
})();
|
|
86
86
|
if (s === 0)
|
|
87
87
|
return { outputNode: l, node: null, dispose: () => {
|
|
88
88
|
} };
|
|
89
|
-
const c =
|
|
89
|
+
const c = Co(l, 2 - s * 2, !0);
|
|
90
90
|
return {
|
|
91
91
|
outputNode: c.getTextureNode(),
|
|
92
92
|
node: c,
|
|
@@ -96,21 +96,21 @@ function Br(a, e) {
|
|
|
96
96
|
function ii(a, e, t) {
|
|
97
97
|
return Math.min(Math.max(Number.isFinite(a) ? a : e, e), t);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
const e = ii(a, 1e3, 12e3) / 100, t = e <= 66 ? 255 : 329.698727446 * (e - 60) ** -0.1332047592, i = e <= 66 ? 99.4708025861 * Math.log(e) - 161.1195681661 : 288.1221695283 * (e - 60) ** -0.0755148492, n = e >= 66 ? 255 : e <= 19 ? 0 : 138.5177312231 * Math.log(e - 10) - 305.0447927307, s = new d(1, 1, 1), o = new d(t, i, n).divideScalar(255).max(new d(0, 0, 0)), r =
|
|
99
|
+
function Or(a) {
|
|
100
|
+
const e = ii(a, 1e3, 12e3) / 100, t = e <= 66 ? 255 : 329.698727446 * (e - 60) ** -0.1332047592, i = e <= 66 ? 99.4708025861 * Math.log(e) - 161.1195681661 : 288.1221695283 * (e - 60) ** -0.0755148492, n = e >= 66 ? 255 : e <= 19 ? 0 : 138.5177312231 * Math.log(e - 10) - 305.0447927307, s = new d(1, 1, 1), o = new d(t, i, n).divideScalar(255).max(new d(0, 0, 0)), r = Nr(65);
|
|
101
101
|
s.set(o.x / r.x, o.y / r.y, o.z / r.z);
|
|
102
102
|
const l = 0.2126 * s.x + 0.7152 * s.y + 0.0722 * s.z;
|
|
103
103
|
return l > 0 ? s.divideScalar(l) : new d(1, 1, 1);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Nr(a) {
|
|
106
106
|
const t = 99.4708025861 * Math.log(a) - 161.1195681661, i = 138.5177312231 * Math.log(a - 10) - 305.0447927307;
|
|
107
107
|
return new d(255, t, i).divideScalar(255).max(new d(0, 0, 0));
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
const { camera: e, depthNode: t, normalNode: i, scene: n, parameters: s } = a, o = s.vxgi, r =
|
|
109
|
+
function Fr(a) {
|
|
110
|
+
const { camera: e, depthNode: t, normalNode: i, scene: n, parameters: s } = a, o = s.vxgi, r = Eo(t, i, n, e, o.resolution);
|
|
111
111
|
r.coneCount.value = o.coneCount, r.coneAngle.value = o.coneAngle, r.giIntensity.value = o.giIntensity, r.aoIntensity.value = o.aoIntensity, r.aoMinVisibility.value = o.aoMinVisibility, r.aoDistance.value = o.aoDistance, r.normalOffset.value = o.normalOffset, r.volume.maxDistance.value = o.maxDistance, r.volume.stepScale.value = o.stepScale, r.bounces = o.bounces, r.directionalRadiance = o.directionalRadiance, r.useTemporalFiltering = o.useTemporalFiltering && a.temporalFiltering;
|
|
112
112
|
const l = ai(n, e);
|
|
113
|
-
return l.contextNode =
|
|
113
|
+
return l.contextNode = So(
|
|
114
114
|
r.getAONode().sample(tt).r,
|
|
115
115
|
r.getGINode().sample(tt).rgb
|
|
116
116
|
), {
|
|
@@ -121,23 +121,23 @@ function Nr(a) {
|
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
const { inputNode: e, parameters: t } = a, i = t.bloom, n =
|
|
124
|
+
function Hr(a) {
|
|
125
|
+
const { inputNode: e, parameters: t } = a, i = t.bloom, n = Ao(e, i.strength, i.radius, i.threshold);
|
|
126
126
|
return n.smoothWidth.value = i.smoothWidth, n.setResolutionScale(i.resolutionScale), {
|
|
127
127
|
outputNode: me(e.rgb.add(n.rgb), e.a),
|
|
128
128
|
node: n,
|
|
129
129
|
dispose: () => n.dispose()
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
const wi = ["vxgi", "ssgi", "gtao", "ssr", "bloom", "traa"],
|
|
133
|
-
vxgi:
|
|
134
|
-
ssgi:
|
|
135
|
-
gtao:
|
|
136
|
-
ssr:
|
|
137
|
-
bloom:
|
|
138
|
-
traa:
|
|
132
|
+
const wi = ["vxgi", "ssgi", "gtao", "ssr", "bloom", "traa"], Vr = {
|
|
133
|
+
vxgi: Fr,
|
|
134
|
+
ssgi: Lr,
|
|
135
|
+
gtao: _r,
|
|
136
|
+
ssr: Rr,
|
|
137
|
+
bloom: Hr,
|
|
138
|
+
traa: Br
|
|
139
139
|
};
|
|
140
|
-
class
|
|
140
|
+
class Ur {
|
|
141
141
|
renderer;
|
|
142
142
|
scene;
|
|
143
143
|
requestRender;
|
|
@@ -183,7 +183,7 @@ class Vr {
|
|
|
183
183
|
}
|
|
184
184
|
/** 创建整个生命周期唯一的 RenderPipeline。 */
|
|
185
185
|
init() {
|
|
186
|
-
this.renderPipeline || (this.renderPipeline = new
|
|
186
|
+
this.renderPipeline || (this.renderPipeline = new Po(this.renderer), this.replacePipeline(this.effects, !0));
|
|
187
187
|
}
|
|
188
188
|
/** 渲染当前效果栈;即使关闭全部画质效果,也保留基础管线用于轮廓合成。 */
|
|
189
189
|
render() {
|
|
@@ -285,14 +285,14 @@ class Vr {
|
|
|
285
285
|
}
|
|
286
286
|
/** 在不改变当前输出的情况下创建下一组完整效果节点。 */
|
|
287
287
|
buildPipeline(e) {
|
|
288
|
-
const t =
|
|
288
|
+
const t = kr(this.scene, this.camera), i = this.resolveSolidBackgroundColor(), n = this.isTransparentBackground(), s = [], o = {
|
|
289
289
|
vxgi: null,
|
|
290
290
|
ssgi: null,
|
|
291
291
|
gtao: null,
|
|
292
292
|
ssr: null,
|
|
293
293
|
bloom: null,
|
|
294
294
|
traa: null
|
|
295
|
-
}, r = t.colorNode.a.mul(
|
|
295
|
+
}, r = t.colorNode.a.mul(To(1e-6, t.depthNode));
|
|
296
296
|
let l = me(t.colorNode.rgb, r), c = r;
|
|
297
297
|
try {
|
|
298
298
|
for (const k of wi) {
|
|
@@ -306,18 +306,18 @@ class Vr {
|
|
|
306
306
|
// 背景透明度统一在末端恢复,避免 TRAA 的 discard 留下未清理的黑色像素。
|
|
307
307
|
transparentBackground: !1,
|
|
308
308
|
parameters: this.parameters
|
|
309
|
-
}, $ =
|
|
309
|
+
}, $ = Vr[k](q);
|
|
310
310
|
s.push($), o[k] = $.node, l = $.outputNode, k === "traa" && (c = l.a);
|
|
311
311
|
}
|
|
312
312
|
if (this.isColorGradingActive()) {
|
|
313
|
-
const k =
|
|
313
|
+
const k = zr(l, this.parameters.colorGrading);
|
|
314
314
|
s.push(k), l = k.outputNode;
|
|
315
315
|
}
|
|
316
316
|
} catch (k) {
|
|
317
317
|
throw s.forEach((F) => F.dispose()), t.scenePass.dispose?.(), k;
|
|
318
318
|
}
|
|
319
319
|
c = c.saturate();
|
|
320
|
-
const h = ai(this.depthAwareOverlayScene, this.camera), u = h.getTextureNode("output"), p =
|
|
320
|
+
const h = ai(this.depthAwareOverlayScene, this.camera), u = h.getTextureNode("output"), p = ft(1).div(Io(u)).mul(1.5), g = u.sample(tt), y = u.sample(tt.sub(ft(p.x, 0))), b = u.sample(tt.add(ft(p.x, 0))), x = u.sample(tt.add(ft(0, p.y))), m = u.sample(tt.sub(ft(0, p.y))), w = Ve(
|
|
321
321
|
Ve(g.a, y.a),
|
|
322
322
|
Ve(Ve(b.a, x.a), m.a)
|
|
323
323
|
), C = Gt(
|
|
@@ -344,7 +344,7 @@ class Vr {
|
|
|
344
344
|
i.b
|
|
345
345
|
), q = cn(
|
|
346
346
|
me(F, 1),
|
|
347
|
-
|
|
347
|
+
st,
|
|
348
348
|
this.renderer.outputColorSpace
|
|
349
349
|
);
|
|
350
350
|
l = me(
|
|
@@ -418,11 +418,11 @@ class Vr {
|
|
|
418
418
|
}), t;
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
const
|
|
422
|
-
class
|
|
421
|
+
const qr = 0.5, Gr = 1.1, Wr = 1;
|
|
422
|
+
class jr {
|
|
423
423
|
pipelineManager;
|
|
424
424
|
constructor(e) {
|
|
425
|
-
this.pipelineManager = new
|
|
425
|
+
this.pipelineManager = new Ur(
|
|
426
426
|
e.renderer,
|
|
427
427
|
e.scene,
|
|
428
428
|
e.camera,
|
|
@@ -880,14 +880,14 @@ class ee {
|
|
|
880
880
|
this.cameraAnimationFrame !== null && (cancelAnimationFrame(this.cameraAnimationFrame), this.cameraAnimationFrame = null), this.engine.setIdleFrameRateExempt?.(ee.CAMERA_ANIMATION_IDLE_EXEMPT_REASON, !1);
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
-
const
|
|
883
|
+
const Kr = { type: "change" }, bn = { type: "start" }, xn = { type: "end" }, U = 1e-6, Ci = Math.PI * 2, ae = {
|
|
884
884
|
NONE: -1,
|
|
885
885
|
ROTATE: 0,
|
|
886
886
|
PAN: 1,
|
|
887
887
|
DOLLY: 2,
|
|
888
888
|
TOUCH_ROTATE: 3,
|
|
889
889
|
TOUCH_DOLLY_PAN: 4
|
|
890
|
-
}, Ei = new d(1, 0, 0),
|
|
890
|
+
}, Ei = new d(1, 0, 0), Yr = new d(0, 1, 0), Qr = new d(0, 0, 1), pt = new d(), jt = new d(), Ee = new d(), Q = new d(), _e = new d(), re = new d(), ke = new d(), Xr = new d(), Kt = new ze(), Si = new ze(), wn = /* @__PURE__ */ new Set([
|
|
891
891
|
"KeyW",
|
|
892
892
|
"KeyA",
|
|
893
893
|
"KeyS",
|
|
@@ -917,7 +917,7 @@ function En(a) {
|
|
|
917
917
|
const e = a?.tagName?.toLowerCase?.();
|
|
918
918
|
return a?.isContentEditable === !0 || e === "input" || e === "textarea" || e === "select";
|
|
919
919
|
}
|
|
920
|
-
class
|
|
920
|
+
class Ts extends Do {
|
|
921
921
|
constructor(e, t, i = null) {
|
|
922
922
|
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.selectionReferencePoint = null, this.selectionReferenceSize = null, this.touchZoomSpeed = 1.35, this.dampingFactor = 0.08, this.keyRotateSpeed = 1, this.keyPanSpeed = 7, this.keyMoveSpeed = 0.5, this.keyMoveBoost = 2, this.keys = {
|
|
923
923
|
LEFT: "ArrowLeft",
|
|
@@ -925,9 +925,9 @@ class Ps extends Io {
|
|
|
925
925
|
RIGHT: "ArrowRight",
|
|
926
926
|
BOTTOM: "ArrowDown"
|
|
927
927
|
}, this.mouseButtons = {
|
|
928
|
-
LEFT:
|
|
929
|
-
MIDDLE:
|
|
930
|
-
RIGHT:
|
|
928
|
+
LEFT: ut.ROTATE,
|
|
929
|
+
MIDDLE: ut.DOLLY,
|
|
930
|
+
RIGHT: ut.PAN
|
|
931
931
|
}, this.state = ae.NONE, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.up0 = this.object.up.clone(), this.origin0 = this.origin.clone(), this._lastZoom = this.object.zoom, this._lastPosition = this.object.position.clone(), this._lastTarget = this.target.clone(), this._lastUp = this.object.up.clone(), this._lastQuaternion = this.object.quaternion.clone(), this._referenceUp = this.object.up.clone().normalize(), this._viewRight = new d(1, 0, 0).applyQuaternion(this.object.quaternion).normalize(), this._rotateVelocity = new j(), this._panVelocity = new j(), this._zoomVelocity = 0, this._mouseStart = new j(), this._touchCenter = new j(), this._touchDistance = 0, this._pointers = /* @__PURE__ */ new Map(), this._pressedKeys = /* @__PURE__ */ new Set(), this._keyboardAnimationId = null, this._lastKeyboardMoveTime = 0, this._isInteracting = !1, this._keyDomElement = null, this._touchAction = "", this._onContextMenu = this._handleContextMenu.bind(this), this._onPointerDown = this._handlePointerDown.bind(this), this._onPointerMove = this._handlePointerMove.bind(this), this._onPointerUp = this._handlePointerUp.bind(this), this._onPointerCancel = this._handlePointerUp.bind(this), this._onWheel = this._handleWheel.bind(this), this._onKeyDown = this._handleKeyDown.bind(this), this._onKeyUp = this._handleKeyUp.bind(this), this.domElement && this.connect(this.domElement), this.update(), this.saveState();
|
|
932
932
|
}
|
|
933
933
|
connect(e) {
|
|
@@ -978,7 +978,7 @@ class Ps extends Io {
|
|
|
978
978
|
const i = typeof e == "number" ? e : null, n = typeof e == "boolean" ? e : !!t, s = this._applyPendingMotion(i);
|
|
979
979
|
this._alignCamera();
|
|
980
980
|
const o = n || s || this._hasCameraStateChanged();
|
|
981
|
-
return o && (this.dispatchEvent(
|
|
981
|
+
return o && (this.dispatchEvent(Kr), this._rememberState()), o;
|
|
982
982
|
}
|
|
983
983
|
_applyPendingMotion(e) {
|
|
984
984
|
let t = !1;
|
|
@@ -1032,11 +1032,11 @@ class Ps extends Io {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
_applyRotation(e, t) {
|
|
1034
1034
|
const i = this._getRotatePivot(), n = this.object.position;
|
|
1035
|
-
|
|
1035
|
+
pt.copy(n).sub(i), pt.lengthSq() < U && pt.set(0, 0, Math.max(this.minDistance, 1)), jt.copy(this.target).sub(i), re.copy(this.target).sub(n).normalize(), Math.abs(e) > U && (Kt.setFromAxisAngle(this._referenceUp, -e), pt.applyQuaternion(Kt), jt.applyQuaternion(Kt), re.applyQuaternion(Kt).normalize()), Q.copy(this._getStableRightAxis(re)), Math.abs(t) > U && Q.lengthSq() > U && (Si.setFromAxisAngle(Q, -t), pt.applyQuaternion(Si), jt.applyQuaternion(Si)), n.copy(i).add(pt), this.target.copy(i).add(jt);
|
|
1036
1036
|
}
|
|
1037
1037
|
_applyPan(e, t) {
|
|
1038
1038
|
const { width: i, height: n } = Cn(this.domElement);
|
|
1039
|
-
Q.copy(Ei).applyQuaternion(this.object.quaternion).normalize(), _e.copy(
|
|
1039
|
+
Q.copy(Ei).applyQuaternion(this.object.quaternion).normalize(), _e.copy(Yr).applyQuaternion(this.object.quaternion).normalize();
|
|
1040
1040
|
let s = 0, o = 0;
|
|
1041
1041
|
if (this.object.isPerspectiveCamera) {
|
|
1042
1042
|
const r = this.object.position.distanceTo(this.target), c = 2 * Math.max(this._getInteractionReferenceDistance(r), U) * Math.tan(O.degToRad(this.object.getEffectiveFOV() * 0.5)), h = c * this.object.aspect;
|
|
@@ -1073,10 +1073,10 @@ class Ps extends Io {
|
|
|
1073
1073
|
re.copy(this.target).sub(this.object.position), !(re.lengthSq() < U) && (re.normalize(), Q.copy(this._getStableRightAxis(re)), _e.crossVectors(Q, re).normalize(), _e.lengthSq() < U && _e.copy(this._referenceUp), this._viewRight.copy(Q), this.object.up.copy(_e), this.object.lookAt(this.target), this.object.updateMatrixWorld());
|
|
1074
1074
|
}
|
|
1075
1075
|
_getStableRightAxis(e) {
|
|
1076
|
-
return Q.crossVectors(e, this._referenceUp), Q.lengthSq() < U && (Q.copy(this._viewRight), Q.addScaledVector(e, -Q.dot(e))), Q.lengthSq() < U && (Q.copy(Ei), Q.addScaledVector(e, -Q.dot(e))), Q.lengthSq() < U && (Q.copy(
|
|
1076
|
+
return Q.crossVectors(e, this._referenceUp), Q.lengthSq() < U && (Q.copy(this._viewRight), Q.addScaledVector(e, -Q.dot(e))), Q.lengthSq() < U && (Q.copy(Ei), Q.addScaledVector(e, -Q.dot(e))), Q.lengthSq() < U && (Q.copy(Qr), Q.addScaledVector(e, -Q.dot(e))), Q.normalize(), this._viewRight.lengthSq() > U && Q.dot(this._viewRight) < 0 && Q.negate(), Q;
|
|
1077
1077
|
}
|
|
1078
1078
|
_getRotatePivot() {
|
|
1079
|
-
return Re(this.origin) ? this.origin.distanceToSquared(this.target) < U ? this.target :
|
|
1079
|
+
return Re(this.origin) ? this.origin.distanceToSquared(this.target) < U ? this.target : Xr.copy(this.origin) : this.target;
|
|
1080
1080
|
}
|
|
1081
1081
|
_hasCameraStateChanged() {
|
|
1082
1082
|
const e = this.object.isOrthographicCamera && Math.abs(this.object.zoom - this._lastZoom) > U;
|
|
@@ -1208,7 +1208,7 @@ class Ps extends Io {
|
|
|
1208
1208
|
}
|
|
1209
1209
|
_resolveMouseAction(e) {
|
|
1210
1210
|
let t = null;
|
|
1211
|
-
return e.button === 0 ? t = e.ctrlKey || e.metaKey || e.shiftKey ? this.mouseButtons.RIGHT : this.mouseButtons.LEFT : e.button === 1 ? t = this.mouseButtons.MIDDLE : e.button === 2 && (t = this.mouseButtons.RIGHT), t ===
|
|
1211
|
+
return e.button === 0 ? t = e.ctrlKey || e.metaKey || e.shiftKey ? this.mouseButtons.RIGHT : this.mouseButtons.LEFT : e.button === 1 ? t = this.mouseButtons.MIDDLE : e.button === 2 && (t = this.mouseButtons.RIGHT), t === ut.ROTATE && this.enableRotate ? ae.ROTATE : t === ut.PAN && this.enablePan ? ae.PAN : t === ut.DOLLY && this.enableZoom ? ae.DOLLY : null;
|
|
1212
1212
|
}
|
|
1213
1213
|
_queueRotate(e, t) {
|
|
1214
1214
|
if (!this.enableRotate || !this.domElement)
|
|
@@ -1223,7 +1223,7 @@ class Ps extends Io {
|
|
|
1223
1223
|
this.enableZoom && (this._zoomVelocity += e);
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
|
-
class Sn extends
|
|
1226
|
+
class Sn extends us {
|
|
1227
1227
|
constructor(e, t, i, n) {
|
|
1228
1228
|
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 be(), this._fallingTime = 0, this._isMouseInElement = !1, this._euler = new $e(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(
|
|
1229
1229
|
new d(0, 0, -1).applyQuaternion(this.camera.quaternion).normalize().multiplyScalar(this._sharedTargetDistance)
|
|
@@ -1591,7 +1591,7 @@ class Sn extends ds {
|
|
|
1591
1591
|
this._isEnabled = !1, this.removeEvents(), this.wheelClock != null && (clearTimeout(this.wheelClock), this.wheelClock = null), this.setPointerLookActive(!1), this.setExternalLookActive(!1), this.resetMovementState?.();
|
|
1592
1592
|
}
|
|
1593
1593
|
}
|
|
1594
|
-
const
|
|
1594
|
+
const $r = Z("/assets/worker_walk.glb", import.meta.url), Jr = Math.PI, Zr = {
|
|
1595
1595
|
16: "ShiftLeft",
|
|
1596
1596
|
37: "ArrowLeft",
|
|
1597
1597
|
38: "ArrowUp",
|
|
@@ -1615,9 +1615,9 @@ const Xr = Z("/assets/worker_walk.glb", import.meta.url), $r = Math.PI, Jr = {
|
|
|
1615
1615
|
jump: ["Space"],
|
|
1616
1616
|
boost: ["ShiftLeft", "ShiftRight"]
|
|
1617
1617
|
};
|
|
1618
|
-
class An extends
|
|
1618
|
+
class An extends us {
|
|
1619
1619
|
constructor(e, t, i, n = {}) {
|
|
1620
|
-
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 be(), this._cameraRayCaster = new be(), 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 Pe(), this.avatarRoot.name = "ThirdPersonAvatarRoot", this.avatarRoot.visible = n.visible ?? !0, this.avatarMixer = null, this.avatarWalkAction = null, this._isWalkActionPlaying = !1, this._avatarAnimationTimer = new
|
|
1620
|
+
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 be(), this._cameraRayCaster = new be(), 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 Pe(), this.avatarRoot.name = "ThirdPersonAvatarRoot", this.avatarRoot.visible = n.visible ?? !0, this.avatarMixer = null, this.avatarWalkAction = null, this._isWalkActionPlaying = !1, this._avatarAnimationTimer = new ps(), this._avatarAnimationTimer.connect(document), this._avatarLoadRequestId = 0, this.defaultAvatarUrl = n.avatarUrl ?? $r, 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);
|
|
1621
1621
|
const s = this.isPcDevice();
|
|
1622
1622
|
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();
|
|
1623
1623
|
}
|
|
@@ -1678,7 +1678,7 @@ class An extends ds {
|
|
|
1678
1678
|
alignToFeet: !0,
|
|
1679
1679
|
fitToPlayerHeight: !0,
|
|
1680
1680
|
ownsResources: !0,
|
|
1681
|
-
yawOffset:
|
|
1681
|
+
yawOffset: Jr,
|
|
1682
1682
|
...t
|
|
1683
1683
|
}), this.setupAvatarAnimation(o, s.animations || []);
|
|
1684
1684
|
},
|
|
@@ -1692,7 +1692,7 @@ class An extends ds {
|
|
|
1692
1692
|
setupAvatarAnimation(e, t) {
|
|
1693
1693
|
if (!t.length)
|
|
1694
1694
|
return;
|
|
1695
|
-
this.avatarMixer = new
|
|
1695
|
+
this.avatarMixer = new gs(e);
|
|
1696
1696
|
const i = t.find((n) => /walk|run|move/i.test(n.name)) || t[0];
|
|
1697
1697
|
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();
|
|
1698
1698
|
}
|
|
@@ -1797,7 +1797,7 @@ class An extends ds {
|
|
|
1797
1797
|
}
|
|
1798
1798
|
}
|
|
1799
1799
|
getEventCode(e) {
|
|
1800
|
-
return e.code ||
|
|
1800
|
+
return e.code || Zr[e.keyCode] || e.key || "";
|
|
1801
1801
|
}
|
|
1802
1802
|
hasPressed(e) {
|
|
1803
1803
|
return e.some((t) => this._pressedKeys.has(t));
|
|
@@ -2054,7 +2054,7 @@ class An extends ds {
|
|
|
2054
2054
|
});
|
|
2055
2055
|
}
|
|
2056
2056
|
}
|
|
2057
|
-
class
|
|
2057
|
+
class ea {
|
|
2058
2058
|
constructor(e) {
|
|
2059
2059
|
this.engine = e;
|
|
2060
2060
|
}
|
|
@@ -2278,7 +2278,7 @@ function Zi(a) {
|
|
|
2278
2278
|
touchControlsSnapshot: null,
|
|
2279
2279
|
mouseMoveFrame: null,
|
|
2280
2280
|
latestMouseMoveEvent: null
|
|
2281
|
-
}, t = 800, i = 28, n = 132, s = 44, o = 168, r = new
|
|
2281
|
+
}, t = 800, i = 28, n = 132, s = 44, o = 168, r = new ea(a);
|
|
2282
2282
|
e.handle_catch = function(M, S, T = !0, N = !0) {
|
|
2283
2283
|
const K = e.options;
|
|
2284
2284
|
e.options = {
|
|
@@ -2372,13 +2372,13 @@ function Zi(a) {
|
|
|
2372
2372
|
function q(M, S, T, N, K, we) {
|
|
2373
2373
|
const fe = a?.catchSvg;
|
|
2374
2374
|
if (!fe?.childElementCount) return;
|
|
2375
|
-
const De = a?.reactBoundingClientRect ?? S.getBoundingClientRect(),
|
|
2375
|
+
const De = a?.reactBoundingClientRect ?? S.getBoundingClientRect(), ct = (Ce) => {
|
|
2376
2376
|
const [He, Ke] = Ce.split(",").map(Number);
|
|
2377
2377
|
return Number.isFinite(He) && Number.isFinite(Ke) ? [(He - De.left - T) / K * n * we, (Ke - De.top - N) / K * n * we] : null;
|
|
2378
2378
|
};
|
|
2379
2379
|
Array.from(fe.children).forEach((Ce) => {
|
|
2380
|
-
const He = Ce.tagName.toLowerCase(), ye = (He === "line" ? [`${Ce.getAttribute("x1")},${Ce.getAttribute("y1")}`, `${Ce.getAttribute("x2")},${Ce.getAttribute("y2")}`].map(
|
|
2381
|
-
ye.length < 2 || (M.beginPath(), M.strokeStyle = Ce.getAttribute("stroke") || "rgb(8, 223, 215)", M.fillStyle = Ce.getAttribute("fill") || "transparent", M.lineWidth = Number(Ce.getAttribute("stroke-width") || 2) * we, M.moveTo(ye[0][0], ye[0][1]), ye.slice(1).forEach(([Ye,
|
|
2380
|
+
const He = Ce.tagName.toLowerCase(), ye = (He === "line" ? [`${Ce.getAttribute("x1")},${Ce.getAttribute("y1")}`, `${Ce.getAttribute("x2")},${Ce.getAttribute("y2")}`].map(ct) : (Ce.getAttribute("points") || "").trim().split(/\s+/).map(ct)).filter(Boolean);
|
|
2381
|
+
ye.length < 2 || (M.beginPath(), M.strokeStyle = Ce.getAttribute("stroke") || "rgb(8, 223, 215)", M.fillStyle = Ce.getAttribute("fill") || "transparent", M.lineWidth = Number(Ce.getAttribute("stroke-width") || 2) * we, M.moveTo(ye[0][0], ye[0][1]), ye.slice(1).forEach(([Ye, ht]) => M.lineTo(Ye, ht)), He === "polygon" && (M.closePath(), ["none", "transparent"].includes(String(M.fillStyle)) || M.fill()), M.stroke());
|
|
2382
2382
|
});
|
|
2383
2383
|
}
|
|
2384
2384
|
function $(M) {
|
|
@@ -2390,18 +2390,18 @@ function Zi(a) {
|
|
|
2390
2390
|
k();
|
|
2391
2391
|
return;
|
|
2392
2392
|
}
|
|
2393
|
-
const De = T.width / n,
|
|
2393
|
+
const De = T.width / n, ct = Math.min(
|
|
2394
2394
|
window.innerWidth - n / 2 - 8,
|
|
2395
2395
|
Math.max(n / 2 + 8, M.clientX)
|
|
2396
2396
|
), Ce = Math.min(
|
|
2397
2397
|
window.innerHeight - n - 8,
|
|
2398
2398
|
Math.max(8, M.clientY - o)
|
|
2399
2399
|
);
|
|
2400
|
-
T.style.left = `${
|
|
2401
|
-
const He = S.width / Math.max(1, S.clientWidth), Ke = S.height / Math.max(1, S.clientHeight), ye = s, Ye = Math.max(0, Math.min(S.clientWidth - ye, fe.x - ye / 2)),
|
|
2400
|
+
T.style.left = `${ct - n / 2}px`, T.style.top = `${Ce}px`, T.style.display = "block";
|
|
2401
|
+
const He = S.width / Math.max(1, S.clientWidth), Ke = S.height / Math.max(1, S.clientHeight), ye = s, Ye = Math.max(0, Math.min(S.clientWidth - ye, fe.x - ye / 2)), ht = Math.max(0, Math.min(S.clientHeight - ye, fe.y - ye / 2));
|
|
2402
2402
|
N.save(), N.clearRect(0, 0, T.width, T.height), N.beginPath(), N.arc(T.width / 2, T.height / 2, T.width / 2, 0, Math.PI * 2), N.clip(), N.fillStyle = window.getComputedStyle(S.parentElement ?? document.body).backgroundColor || "#dfe8f2", N.fillRect(0, 0, T.width, T.height);
|
|
2403
2403
|
try {
|
|
2404
|
-
N.drawImage(S, Ye * He,
|
|
2404
|
+
N.drawImage(S, Ye * He, ht * Ke, ye * He, ye * Ke, 0, 0, T.width, T.height), q(N, S, Ye, ht, ye, De);
|
|
2405
2405
|
} catch {
|
|
2406
2406
|
k(), N.restore();
|
|
2407
2407
|
return;
|
|
@@ -2550,7 +2550,7 @@ function Zi(a) {
|
|
|
2550
2550
|
e.lastPoint = null;
|
|
2551
2551
|
}, e;
|
|
2552
2552
|
}
|
|
2553
|
-
class
|
|
2553
|
+
class ta {
|
|
2554
2554
|
engine;
|
|
2555
2555
|
orbitControls;
|
|
2556
2556
|
firstPersonControls;
|
|
@@ -2579,7 +2579,7 @@ class ea {
|
|
|
2579
2579
|
this.engine = e, this.init(), this.handelBehaved = Zi(this.engine), this.handelBehaved.init(this, null), this.handelBehaved.active();
|
|
2580
2580
|
}
|
|
2581
2581
|
init() {
|
|
2582
|
-
this.orbitControls = new
|
|
2582
|
+
this.orbitControls = new Ts(this.engine, this.engine.camera, this.engine.renderer.domElement), this.orbitControls.showOriginIcon = !0, this.firstPersonControls = new Sn(this.engine, this.engine.camera, this.engine.renderer.domElement), this.thirdPersonControls = new An(this.engine, this.engine.camera, this.engine.renderer.domElement), this.applyRoamLookDirection(this.firstPersonControls), this.applyRoamLookDirection(this.thirdPersonControls);
|
|
2583
2583
|
const e = document.createElement("div");
|
|
2584
2584
|
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(${Z("/assets/svg/rotate-orbit.svg", import.meta.url)})`, this.engine.container.appendChild(this.originDiv);
|
|
2585
2585
|
}
|
|
@@ -2929,7 +2929,7 @@ class ea {
|
|
|
2929
2929
|
this.isActive = !1, this.thirdPersonPlacementResolver = null, this.orbitCenterResolver = null, 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;
|
|
2930
2930
|
}
|
|
2931
2931
|
}
|
|
2932
|
-
class
|
|
2932
|
+
class ia {
|
|
2933
2933
|
engine;
|
|
2934
2934
|
deviceType;
|
|
2935
2935
|
constructor(e) {
|
|
@@ -2993,7 +2993,7 @@ class ta {
|
|
|
2993
2993
|
};
|
|
2994
2994
|
}
|
|
2995
2995
|
}
|
|
2996
|
-
class
|
|
2996
|
+
class na {
|
|
2997
2997
|
// 使用字符串作为键,以确保不同来源的 EventType 枚举值能够正确匹配
|
|
2998
2998
|
listeners = /* @__PURE__ */ new Map();
|
|
2999
2999
|
// 是否启用调试模式(可以通过外部设置)
|
|
@@ -3053,13 +3053,13 @@ class ia {
|
|
|
3053
3053
|
this.listeners.clear();
|
|
3054
3054
|
}
|
|
3055
3055
|
}
|
|
3056
|
-
const ni = 1,
|
|
3057
|
-
class
|
|
3056
|
+
const ni = 1, sa = new d(18, 28, 16), oa = new d(0.7, 1, 0.6).normalize(), ra = 1, aa = 1800, la = 1.5, ca = 4, Pn = 0.05, ha = 1;
|
|
3057
|
+
class da {
|
|
3058
3058
|
engine;
|
|
3059
3059
|
ambientLight = null;
|
|
3060
3060
|
directionalLight = null;
|
|
3061
3061
|
lastBounds = new B();
|
|
3062
|
-
lightDirection =
|
|
3062
|
+
lightDirection = oa.clone();
|
|
3063
3063
|
boundsCenter = new d();
|
|
3064
3064
|
boundsSize = new d();
|
|
3065
3065
|
lastShadowTarget = new d(Number.NaN, Number.NaN, Number.NaN);
|
|
@@ -3069,8 +3069,8 @@ class ha {
|
|
|
3069
3069
|
}
|
|
3070
3070
|
/** 创建参考项目使用的环境光和主定向光。 */
|
|
3071
3071
|
init() {
|
|
3072
|
-
const e = new Rt(16777215, 2), t = new
|
|
3073
|
-
t.position.copy(
|
|
3072
|
+
const e = new Rt(16777215, 2), t = new ot(16777215, 2);
|
|
3073
|
+
t.position.copy(sa), t.castShadow = !0, t.shadow.mapSize.set(2048, 2048), t.shadow.bias = -2e-4, t.shadow.normalBias = 0.2, t.shadow.intensity = ni, t.shadow.autoUpdate = !1, t.shadow.needsUpdate = !0, this.engine.scene.add(e), this.engine.scene.add(t, t.target), this.ambientLight = e, this.directionalLight = t, this.engine.scene.dirLight = t, this.engine.scene.dirLightShadow = t, this.engine.scene.dirLightShodow = t;
|
|
3074
3074
|
}
|
|
3075
3075
|
/** 兼容旧调用名,按当前模型范围更新阴影视锥。 */
|
|
3076
3076
|
updateShadowCameraRange(e) {
|
|
@@ -3141,11 +3141,11 @@ class ha {
|
|
|
3141
3141
|
return;
|
|
3142
3142
|
const n = this.lastBounds.getCenter(this.boundsCenter), s = this.lastBounds.getSize(this.boundsSize), o = Math.max(s.length(), 1), r = Math.max(s.x, s.y, s.z) * 0.5, l = this.resolveShadowTarget(e, n, o), c = this.getCameraHalfSize(e, l), h = O.clamp(
|
|
3143
3143
|
c > 0 ? Math.max(
|
|
3144
|
-
c *
|
|
3145
|
-
Math.min(r * 0.75, c *
|
|
3144
|
+
c * la,
|
|
3145
|
+
Math.min(r * 0.75, c * ca)
|
|
3146
3146
|
) : r * 0.75,
|
|
3147
|
-
|
|
3148
|
-
|
|
3147
|
+
ra,
|
|
3148
|
+
aa
|
|
3149
3149
|
), u = Math.max(h / Math.max(i.shadow.mapSize.width, 1), 0.01);
|
|
3150
3150
|
if (!t && Math.abs(h - this.lastShadowHalfSize) <= u && l.distanceToSquared(this.lastShadowTarget) <= u * u)
|
|
3151
3151
|
return;
|
|
@@ -3199,7 +3199,7 @@ class ha {
|
|
|
3199
3199
|
const l = Math.max(
|
|
3200
3200
|
(r - o) * Pn,
|
|
3201
3201
|
i * Pn,
|
|
3202
|
-
|
|
3202
|
+
ha
|
|
3203
3203
|
), c = Math.max(o - l, 0.1);
|
|
3204
3204
|
return { near: c, far: Math.max(r + l, c + 1) };
|
|
3205
3205
|
}
|
|
@@ -3229,7 +3229,7 @@ class ha {
|
|
|
3229
3229
|
) : null;
|
|
3230
3230
|
}
|
|
3231
3231
|
}
|
|
3232
|
-
class
|
|
3232
|
+
class ua {
|
|
3233
3233
|
engine;
|
|
3234
3234
|
behavior;
|
|
3235
3235
|
isCtrlDown = !1;
|
|
@@ -3682,18 +3682,18 @@ function Nt(a) {
|
|
|
3682
3682
|
i = n[1];
|
|
3683
3683
|
a.name = t, a.guid = i;
|
|
3684
3684
|
}
|
|
3685
|
-
function
|
|
3685
|
+
function pa(a, e, t, i) {
|
|
3686
3686
|
const r = a.models.find((x) => x.url == t);
|
|
3687
3687
|
if (r == null)
|
|
3688
3688
|
return;
|
|
3689
|
-
const l =
|
|
3689
|
+
const l = lt(a, t), c = [], h = e.circularMeps, u = e.rectMeps?.filter((x) => x.type === "风管"), p = e.rectMeps?.filter((x) => x.type === "桥架"), g = e.ellipseMeps, y = (x) => (x.color = x.color.split(",").map((m) => parseInt(m) / 255), x.color = new ce().setRGB(x.color[0], x.color[1], x.color[2], Ge), x.position = {
|
|
3690
3690
|
x: x.startPoint.X * 0.3048 + 0,
|
|
3691
3691
|
y: x.startPoint.Z * 0.3048 + 0,
|
|
3692
3692
|
z: -x.startPoint.Y * 0.3048 + 0
|
|
3693
3693
|
}, x.rotation = { x: 0, y: 0, z: 0 }, x), b = (x, m) => {
|
|
3694
3694
|
if (!Array.isArray(m) || m.length === 0)
|
|
3695
3695
|
return;
|
|
3696
|
-
const w = m.map((A) => y(A)), C =
|
|
3696
|
+
const w = m.map((A) => y(A)), C = ma(x, l, w, t, a);
|
|
3697
3697
|
C != null && w.forEach((A, L) => {
|
|
3698
3698
|
const I = [[C, L, 0, 0]];
|
|
3699
3699
|
A.indexes = I, A.id = Number(A.id);
|
|
@@ -3701,9 +3701,9 @@ function ua(a, e, t, i) {
|
|
|
3701
3701
|
Nt(z), r.nodesMap.set(Number(A.id), z), c.push(Number(A.id));
|
|
3702
3702
|
});
|
|
3703
3703
|
};
|
|
3704
|
-
b("Circle", h), b("Rect", u), b("Ellipse", g), b("Bridge", p),
|
|
3704
|
+
b("Circle", h), b("Rect", u), b("Ellipse", g), b("Bridge", p), ga(r, c);
|
|
3705
3705
|
}
|
|
3706
|
-
function
|
|
3706
|
+
function ga(a, e) {
|
|
3707
3707
|
if (e.length === 0 || !Array.isArray(a?.lods))
|
|
3708
3708
|
return;
|
|
3709
3709
|
const i = a.lods[0]?.octreeBox;
|
|
@@ -3715,7 +3715,7 @@ function pa(a, e) {
|
|
|
3715
3715
|
n.has(s) || (i.elements.push(s), n.add(s));
|
|
3716
3716
|
});
|
|
3717
3717
|
}
|
|
3718
|
-
function
|
|
3718
|
+
function ma(a, e, t, i, n) {
|
|
3719
3719
|
let s;
|
|
3720
3720
|
const o = {
|
|
3721
3721
|
width: 1,
|
|
@@ -3793,7 +3793,7 @@ function ga(a, e, t, i, n) {
|
|
|
3793
3793
|
return r.meshs = p, r.instanceMatrix && r.instanceMatrix.array && (r.cloneInstanceMatrix = Array.from(r.instanceMatrix.array)), r.instanceMatrix.needsUpdate = !0, Ji(r), l;
|
|
3794
3794
|
}
|
|
3795
3795
|
function Yt(a, e) {
|
|
3796
|
-
const t = new
|
|
3796
|
+
const t = new ms();
|
|
3797
3797
|
switch (e.width = e.width * 0.3048, e.height = e.height * 0.3048, e.diameter = e.diameter * 0.3048, a) {
|
|
3798
3798
|
case "Rect":
|
|
3799
3799
|
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);
|
|
@@ -3814,7 +3814,7 @@ function Yt(a, e) {
|
|
|
3814
3814
|
};
|
|
3815
3815
|
return n(t, i, e.color, e.position, e.rotation);
|
|
3816
3816
|
function n(s, o, r, l, c) {
|
|
3817
|
-
const h = new
|
|
3817
|
+
const h = new fs(s, o), u = new ys({
|
|
3818
3818
|
// MEP 最终颜色由 instanceColor 乘算,基础材质保持白色才能避免二次染色。
|
|
3819
3819
|
color: 16777215,
|
|
3820
3820
|
metalness: 0,
|
|
@@ -3825,90 +3825,90 @@ function Yt(a, e) {
|
|
|
3825
3825
|
return p.position.set(l.x, l.y, l.z), p.rotation._order = "YXZ", p.rotation.set(c.x, c.y, c.z), p;
|
|
3826
3826
|
}
|
|
3827
3827
|
}
|
|
3828
|
-
const Tn = "__bvhAccelerationInstalled",
|
|
3829
|
-
function
|
|
3828
|
+
const Tn = "__bvhAccelerationInstalled", Is = "__bvhBuildFailed", fa = "__bvhBuilt", ya = "__bvhTriangleCount", Ds = 200, va = 10;
|
|
3829
|
+
function Ma() {
|
|
3830
3830
|
const a = globalThis;
|
|
3831
|
-
a[Tn] !== !0 && (G.prototype.raycast =
|
|
3831
|
+
a[Tn] !== !0 && (G.prototype.raycast = _o, de.prototype.computeBoundsTree = vs, de.prototype.disposeBoundsTree = ko, a[Tn] = !0);
|
|
3832
3832
|
}
|
|
3833
|
-
function
|
|
3833
|
+
function ba(a) {
|
|
3834
3834
|
a.firstHitOnly = !0;
|
|
3835
3835
|
}
|
|
3836
|
-
function
|
|
3836
|
+
function xa(a) {
|
|
3837
3837
|
delete a.firstHitOnly;
|
|
3838
3838
|
}
|
|
3839
|
-
function
|
|
3839
|
+
function wa(a, e = Ds) {
|
|
3840
3840
|
if (a == null)
|
|
3841
3841
|
return !1;
|
|
3842
3842
|
const t = a;
|
|
3843
|
-
if (t.boundsTree != null || t.userData?.[
|
|
3843
|
+
if (t.boundsTree != null || t.userData?.[Is] === !0)
|
|
3844
3844
|
return !1;
|
|
3845
3845
|
const i = a.attributes.position?.count ?? 0;
|
|
3846
3846
|
return (a.index?.count ?? i) / 3 >= e;
|
|
3847
3847
|
}
|
|
3848
|
-
function
|
|
3848
|
+
function Ca(a) {
|
|
3849
3849
|
if (a == null)
|
|
3850
3850
|
return 0;
|
|
3851
3851
|
const e = a.attributes.position?.count ?? 0;
|
|
3852
3852
|
return (a.index?.count ?? e) / 3;
|
|
3853
3853
|
}
|
|
3854
|
-
function
|
|
3854
|
+
function Ea(a, e = {}) {
|
|
3855
3855
|
if (a == null)
|
|
3856
3856
|
return;
|
|
3857
|
-
const t = e.triangleThreshold ??
|
|
3858
|
-
if (!
|
|
3857
|
+
const t = e.triangleThreshold ?? Ds;
|
|
3858
|
+
if (!wa(a, t)) {
|
|
3859
3859
|
e.setBoundingBox === !0 && a.boundingBox == null && a.computeBoundingBox(), e.setBoundingSphere === !0 && a.boundingSphere == null && a.computeBoundingSphere();
|
|
3860
3860
|
return;
|
|
3861
3861
|
}
|
|
3862
3862
|
const i = a;
|
|
3863
3863
|
try {
|
|
3864
|
-
i.userData = i.userData ?? {}, i.userData[
|
|
3864
|
+
i.userData = i.userData ?? {}, i.userData[ya] = Ca(a), e.setBoundingBox === !0 && a.boundingBox == null && a.computeBoundingBox(), e.setBoundingSphere === !0 && a.boundingSphere == null && a.computeBoundingSphere(), vs.call(i, {
|
|
3865
3865
|
// 对外继续兼容旧字段,内部改用 three-mesh-bvh 0.9.10 的新参数名。
|
|
3866
|
-
maxLeafSize: e.maxLeafTris ??
|
|
3867
|
-
}), i.userData[
|
|
3866
|
+
maxLeafSize: e.maxLeafTris ?? va
|
|
3867
|
+
}), i.userData[fa] = i.boundsTree != null;
|
|
3868
3868
|
} catch (n) {
|
|
3869
|
-
i.userData = i.userData ?? {}, i.userData[
|
|
3869
|
+
i.userData = i.userData ?? {}, i.userData[Is] = !0, console.warn("[raycastAcceleration] failed to build bounds tree", n);
|
|
3870
3870
|
}
|
|
3871
3871
|
}
|
|
3872
|
-
const
|
|
3872
|
+
const _s = 1e6, Sa = 8, In = 100, Aa = 100, Pa = 100, Ai = "__ordinaryMeshDistanceCullingRegistry", Pi = "__instanceMeshDistanceCullingRegistry", si = "__instanceMeshDistanceCullingScheduler", Ze = new d(), Dn = /* @__PURE__ */ new WeakMap();
|
|
3873
3873
|
function Ht(a) {
|
|
3874
3874
|
const e = a?.options?.ordinaryMeshOptimization;
|
|
3875
3875
|
return {
|
|
3876
3876
|
enabled: e !== !1 && e?.enabled !== !1,
|
|
3877
3877
|
meshDistanceCullingEnabled: e?.meshDistanceCullingEnabled !== !1,
|
|
3878
3878
|
instanceDistanceCullingEnabled: e?.instanceDistanceCullingEnabled !== !1,
|
|
3879
|
-
instanceDistanceCullingUpdateIntervalMs:
|
|
3879
|
+
instanceDistanceCullingUpdateIntervalMs: Ua(
|
|
3880
3880
|
e?.instanceDistanceCullingUpdateIntervalMs,
|
|
3881
|
-
|
|
3881
|
+
Pa
|
|
3882
3882
|
),
|
|
3883
|
-
maxTrianglesPerMesh:
|
|
3883
|
+
maxTrianglesPerMesh: Ls(
|
|
3884
3884
|
e?.maxTrianglesPerMesh,
|
|
3885
|
-
|
|
3885
|
+
_s
|
|
3886
3886
|
),
|
|
3887
|
-
minProjectedSizePx:
|
|
3887
|
+
minProjectedSizePx: Va(
|
|
3888
3888
|
e?.minProjectedSizePx,
|
|
3889
|
-
|
|
3889
|
+
Sa
|
|
3890
3890
|
)
|
|
3891
3891
|
};
|
|
3892
3892
|
}
|
|
3893
|
-
function
|
|
3893
|
+
function Ta(a) {
|
|
3894
3894
|
const t = (Array.isArray(a.material) ? a.material : [a.material]).map((s) => s?.uuid ?? "").join(","), i = Object.entries(a.geometry?.attributes ?? {}).map(([s, o]) => {
|
|
3895
3895
|
const r = o;
|
|
3896
3896
|
return `${s}:${r.itemSize}:${r.normalized}:${r.array?.constructor?.name ?? ""}`;
|
|
3897
3897
|
}).sort().join(","), n = a.geometry?.index == null ? "plain" : "indexed";
|
|
3898
3898
|
return `${a.glb ?? ""}|${t}|${n}|${i}`;
|
|
3899
3899
|
}
|
|
3900
|
-
function
|
|
3900
|
+
function Ia(a) {
|
|
3901
3901
|
return [...a].sort((e, t) => Fi(t) - Fi(e));
|
|
3902
3902
|
}
|
|
3903
3903
|
function _n(a, e) {
|
|
3904
|
-
const t =
|
|
3904
|
+
const t = Ls(e, _s), i = [];
|
|
3905
3905
|
let n = [], s = 0;
|
|
3906
3906
|
return a.forEach((o) => {
|
|
3907
|
-
const r =
|
|
3907
|
+
const r = Na(o.geometry);
|
|
3908
3908
|
n.length > 0 && s + r > t && (i.push(n), n = [], s = 0), n.push(o), s += r;
|
|
3909
3909
|
}), n.length > 0 && i.push(n), i;
|
|
3910
3910
|
}
|
|
3911
|
-
function
|
|
3911
|
+
function Da(a) {
|
|
3912
3912
|
if (a.length === 0)
|
|
3913
3913
|
return [];
|
|
3914
3914
|
const e = /* @__PURE__ */ new Map();
|
|
@@ -3917,14 +3917,14 @@ function Ia(a) {
|
|
|
3917
3917
|
o == null ? e.set(s, [t]) : o.push(t);
|
|
3918
3918
|
}), Array.from(e.values());
|
|
3919
3919
|
}
|
|
3920
|
-
function
|
|
3920
|
+
function _a(a, e, t) {
|
|
3921
3921
|
const i = Ht(a);
|
|
3922
3922
|
if (!i.enabled || !i.meshDistanceCullingEnabled || t.length === 0)
|
|
3923
3923
|
return;
|
|
3924
3924
|
const n = [];
|
|
3925
3925
|
let s = 0;
|
|
3926
3926
|
t.forEach((r) => {
|
|
3927
|
-
s +=
|
|
3927
|
+
s += ks(r.geometry), n.push({ size: Fi(r), end: s });
|
|
3928
3928
|
}), e.geometry.computeBoundingSphere(), e.geometry.computeBoundingBox();
|
|
3929
3929
|
const o = e.geometry.boundingSphere;
|
|
3930
3930
|
e.userData = e.userData ?? {}, e.userData.ordinaryMeshDistanceCulling = {
|
|
@@ -3940,7 +3940,7 @@ function Da(a, e, t) {
|
|
|
3940
3940
|
minProjectedSizePx: i.minProjectedSizePx
|
|
3941
3941
|
}, e.geometry.setDrawRange(0, s), fi(a).add(e);
|
|
3942
3942
|
}
|
|
3943
|
-
function
|
|
3943
|
+
function ka(a, e, t) {
|
|
3944
3944
|
const i = Ht(a);
|
|
3945
3945
|
!i.enabled || !i.instanceDistanceCullingEnabled || t.length === 0 || (e.computeBoundingSphere(), e.computeBoundingBox(), e.userData = e.userData ?? {}, e.userData.instanceDistanceCulling = {
|
|
3946
3946
|
center: e.boundingSphere?.center.clone() ?? new d(),
|
|
@@ -3955,7 +3955,7 @@ function _a(a, e, t) {
|
|
|
3955
3955
|
minProjectedSizePx: i.minProjectedSizePx
|
|
3956
3956
|
}, yi(a).add(e));
|
|
3957
3957
|
}
|
|
3958
|
-
function
|
|
3958
|
+
function La(a, e, t, i = typeof performance > "u" ? Date.now() : performance.now()) {
|
|
3959
3959
|
const n = Ht(a), s = fi(a), o = yi(a);
|
|
3960
3960
|
if (s.size === 0 && o.size === 0 || t <= 0)
|
|
3961
3961
|
return !1;
|
|
@@ -3964,16 +3964,16 @@ function ka(a, e, t, i = typeof performance > "u" ? Date.now() : performance.now
|
|
|
3964
3964
|
let p = !1;
|
|
3965
3965
|
return s.forEach((g) => {
|
|
3966
3966
|
const y = g.userData.ordinaryMeshDistanceCulling;
|
|
3967
|
-
y != null && (g.isSplit === !0 ? p =
|
|
3967
|
+
y != null && (g.isSplit === !0 ? p = gt(g, y, y.ranges.length, !1) || p : p = gt(g, y, y.ranges.length) || p);
|
|
3968
3968
|
}), o.forEach((g) => {
|
|
3969
3969
|
const y = g.userData.instanceDistanceCulling;
|
|
3970
3970
|
y != null && (p = Qt(g, y, !0) || p);
|
|
3971
3971
|
}), p;
|
|
3972
3972
|
}
|
|
3973
|
-
const c =
|
|
3973
|
+
const c = Fa(e, t);
|
|
3974
3974
|
if (c == null)
|
|
3975
3975
|
return !1;
|
|
3976
|
-
const h =
|
|
3976
|
+
const h = za(a, n, i);
|
|
3977
3977
|
e.getWorldPosition(Ze);
|
|
3978
3978
|
let u = !1;
|
|
3979
3979
|
return s.forEach((p) => {
|
|
@@ -3987,19 +3987,19 @@ function ka(a, e, t, i = typeof performance > "u" ? Date.now() : performance.now
|
|
|
3987
3987
|
return;
|
|
3988
3988
|
}
|
|
3989
3989
|
if (!r) {
|
|
3990
|
-
u =
|
|
3990
|
+
u = gt(p, g, g.ranges.length, p.isSplit !== !0) || u;
|
|
3991
3991
|
return;
|
|
3992
3992
|
}
|
|
3993
3993
|
if (p.isSplit === !0) {
|
|
3994
|
-
u =
|
|
3994
|
+
u = gt(p, g, g.ranges.length, !1) || u;
|
|
3995
3995
|
return;
|
|
3996
3996
|
}
|
|
3997
3997
|
if (kn(p, g), g.worldBox != null && g.worldBox.containsPoint(Ze)) {
|
|
3998
|
-
u =
|
|
3998
|
+
u = gt(p, g, g.ranges.length) || u;
|
|
3999
3999
|
return;
|
|
4000
4000
|
}
|
|
4001
|
-
const y = g.worldBox?.distanceToPoint(Ze) ?? Ze.distanceTo(g.worldCenter), b = c.isPerspective ? g.minProjectedSizePx * Math.max(y, 1e-3) / c.scale : g.minProjectedSizePx / c.scale, x =
|
|
4002
|
-
u =
|
|
4001
|
+
const y = g.worldBox?.distanceToPoint(Ze) ?? Ze.distanceTo(g.worldCenter), b = c.isPerspective ? g.minProjectedSizePx * Math.max(y, 1e-3) / c.scale : g.minProjectedSizePx / c.scale, x = Ha(g.ranges, b);
|
|
4002
|
+
u = gt(p, g, x) || u;
|
|
4003
4003
|
}), h && o.forEach((p) => {
|
|
4004
4004
|
if (p.parent == null) {
|
|
4005
4005
|
o.delete(p);
|
|
@@ -4022,10 +4022,10 @@ function ka(a, e, t, i = typeof performance > "u" ? Date.now() : performance.now
|
|
|
4022
4022
|
u = Qt(p, g, g.maxSize >= b) || u;
|
|
4023
4023
|
}), u;
|
|
4024
4024
|
}
|
|
4025
|
-
function
|
|
4025
|
+
function Ra(a) {
|
|
4026
4026
|
fi(a).clear(), yi(a).clear(), delete a[si];
|
|
4027
4027
|
}
|
|
4028
|
-
function
|
|
4028
|
+
function Ba(a, e) {
|
|
4029
4029
|
[fi(a), yi(a)].forEach((t) => {
|
|
4030
4030
|
Array.from(t).forEach((i) => {
|
|
4031
4031
|
(i?.url === e || i?.userData?.url === e) && t.delete(i);
|
|
@@ -4038,21 +4038,21 @@ function fi(a) {
|
|
|
4038
4038
|
function yi(a) {
|
|
4039
4039
|
return a?.[Pi] instanceof Set || (a[Pi] = /* @__PURE__ */ new Set()), a[Pi];
|
|
4040
4040
|
}
|
|
4041
|
-
function
|
|
4042
|
-
const i =
|
|
4041
|
+
function za(a, e, t) {
|
|
4042
|
+
const i = Oa(a), n = a?.renderer?.interactionActive === !0;
|
|
4043
4043
|
return !n || e.instanceDistanceCullingUpdateIntervalMs <= 0 ? (i.wasInteractionActive = n, i.lastInteractionUpdateTime = n ? t : Number.NEGATIVE_INFINITY, !0) : !i.wasInteractionActive || t - i.lastInteractionUpdateTime >= e.instanceDistanceCullingUpdateIntervalMs ? (i.wasInteractionActive = !0, i.lastInteractionUpdateTime = t, !0) : !1;
|
|
4044
4044
|
}
|
|
4045
|
-
function
|
|
4045
|
+
function Oa(a) {
|
|
4046
4046
|
return a?.[si] == null && (a[si] = {
|
|
4047
4047
|
lastInteractionUpdateTime: Number.NEGATIVE_INFINITY,
|
|
4048
4048
|
wasInteractionActive: !1
|
|
4049
4049
|
}), a[si];
|
|
4050
4050
|
}
|
|
4051
|
-
function
|
|
4051
|
+
function ks(a) {
|
|
4052
4052
|
return a.index?.count ?? a.getAttribute("position")?.count ?? 0;
|
|
4053
4053
|
}
|
|
4054
|
-
function
|
|
4055
|
-
return Math.floor(
|
|
4054
|
+
function Na(a) {
|
|
4055
|
+
return Math.floor(ks(a) / 3);
|
|
4056
4056
|
}
|
|
4057
4057
|
function Fi(a) {
|
|
4058
4058
|
const e = Dn.get(a.geometry);
|
|
@@ -4062,7 +4062,7 @@ function Fi(a) {
|
|
|
4062
4062
|
const t = a.geometry.boundingSphere == null ? 0 : a.geometry.boundingSphere.radius * 2;
|
|
4063
4063
|
return Dn.set(a.geometry, t), t;
|
|
4064
4064
|
}
|
|
4065
|
-
function
|
|
4065
|
+
function Fa(a, e) {
|
|
4066
4066
|
if (a instanceof Lt) {
|
|
4067
4067
|
const t = e / (2 * Math.tan(O.degToRad(a.fov) / 2));
|
|
4068
4068
|
return t > 0 ? { isPerspective: !0, scale: t } : null;
|
|
@@ -4076,7 +4076,7 @@ function Na(a, e) {
|
|
|
4076
4076
|
function kn(a, e) {
|
|
4077
4077
|
e.worldBoundsInitialized && e.worldMatrix.equals(a.matrixWorld) || (e.worldMatrix.copy(a.matrixWorld), e.worldCenter.copy(e.center).applyMatrix4(a.matrixWorld), e.box == null ? e.worldBox = null : (e.worldBox ??= new B(), e.worldBox.copy(e.box).applyMatrix4(a.matrixWorld)), e.worldBoundsInitialized = !0);
|
|
4078
4078
|
}
|
|
4079
|
-
function
|
|
4079
|
+
function Ha(a, e) {
|
|
4080
4080
|
let t = 0, i = a.length;
|
|
4081
4081
|
for (; t < i; ) {
|
|
4082
4082
|
const n = Math.floor((t + i) / 2);
|
|
@@ -4084,7 +4084,7 @@ function Fa(a, e) {
|
|
|
4084
4084
|
}
|
|
4085
4085
|
return t;
|
|
4086
4086
|
}
|
|
4087
|
-
function
|
|
4087
|
+
function gt(a, e, t, i = !0) {
|
|
4088
4088
|
const n = t > 0 ? e.ranges[t - 1].end : 0, s = n !== e.currentCount, o = e.visibleComponentCount !== t;
|
|
4089
4089
|
let r = !1;
|
|
4090
4090
|
if (s && (a.geometry.setDrawRange(0, n), i)) {
|
|
@@ -4097,35 +4097,35 @@ function Qt(a, e, t) {
|
|
|
4097
4097
|
const i = e.distanceVisible !== t || a.visible !== t;
|
|
4098
4098
|
return e.distanceVisible = t, a.visible = t, i;
|
|
4099
4099
|
}
|
|
4100
|
-
function
|
|
4100
|
+
function Ls(a, e) {
|
|
4101
4101
|
const t = Number(a);
|
|
4102
4102
|
return Number.isFinite(t) && t > 0 ? Math.max(1, Math.floor(t)) : e;
|
|
4103
4103
|
}
|
|
4104
|
-
function
|
|
4104
|
+
function Va(a, e) {
|
|
4105
4105
|
const t = Number(a);
|
|
4106
4106
|
return Number.isFinite(t) && t > 0 ? t : e;
|
|
4107
4107
|
}
|
|
4108
|
-
function
|
|
4108
|
+
function Ua(a, e) {
|
|
4109
4109
|
const t = Number(a);
|
|
4110
4110
|
return Number.isFinite(t) && t >= 0 ? t : e;
|
|
4111
4111
|
}
|
|
4112
4112
|
let St = null, At = null, Ln = null;
|
|
4113
4113
|
const Rn = 2048, Bn = /* @__PURE__ */ new WeakSet();
|
|
4114
|
-
function
|
|
4114
|
+
function Rs() {
|
|
4115
4115
|
return Z("draco/", import.meta.url);
|
|
4116
4116
|
}
|
|
4117
|
-
function
|
|
4117
|
+
function Bs() {
|
|
4118
4118
|
return Z("basis/", import.meta.url);
|
|
4119
4119
|
}
|
|
4120
|
-
function
|
|
4121
|
-
return St == null && (St = new
|
|
4122
|
-
}
|
|
4123
|
-
function qa(a) {
|
|
4124
|
-
return At == null && (At = new Lo(), At.setTranscoderPath(Rs())), Ln !== a && (At.detectSupport(a), Ln = a), At;
|
|
4120
|
+
function qa() {
|
|
4121
|
+
return St == null && (St = new bs(), St.setDecoderPath(Rs()), St.preload()), St;
|
|
4125
4122
|
}
|
|
4126
4123
|
function Ga(a) {
|
|
4124
|
+
return At == null && (At = new Ro(), At.setTranscoderPath(Bs())), Ln !== a && (At.detectSupport(a), Ln = a), At;
|
|
4125
|
+
}
|
|
4126
|
+
function Wa(a) {
|
|
4127
4127
|
const e = new Yi();
|
|
4128
|
-
return e.setDRACOLoader(
|
|
4128
|
+
return e.setDRACOLoader(qa()), e.setMeshoptDecoder(Lo), a?.renderer != null && e.setKTX2Loader(Ga(a.renderer)), e;
|
|
4129
4129
|
}
|
|
4130
4130
|
function zn(a, e) {
|
|
4131
4131
|
return new Promise((t, i) => {
|
|
@@ -4140,7 +4140,7 @@ function zn(a, e) {
|
|
|
4140
4140
|
}, e);
|
|
4141
4141
|
});
|
|
4142
4142
|
}
|
|
4143
|
-
async function
|
|
4143
|
+
async function zs(a, e) {
|
|
4144
4144
|
const t = await ui({
|
|
4145
4145
|
method: "get",
|
|
4146
4146
|
responseType: "arraybuffer",
|
|
@@ -4152,7 +4152,7 @@ async function Bs(a, e) {
|
|
|
4152
4152
|
function On(a) {
|
|
4153
4153
|
return a.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
4154
4154
|
}
|
|
4155
|
-
function
|
|
4155
|
+
function Os(a, e) {
|
|
4156
4156
|
const t = new Set(e.map((i) => On(i)));
|
|
4157
4157
|
for (const i of Object.keys(a.files))
|
|
4158
4158
|
if (t.has(On(i)))
|
|
@@ -4160,22 +4160,22 @@ function zs(a, e) {
|
|
|
4160
4160
|
return null;
|
|
4161
4161
|
}
|
|
4162
4162
|
function Nn(a, e) {
|
|
4163
|
-
const t =
|
|
4163
|
+
const t = Os(a, e);
|
|
4164
4164
|
return t == null || t.dir ? Promise.resolve(null) : t.async("string");
|
|
4165
4165
|
}
|
|
4166
|
-
function
|
|
4166
|
+
function ja(a) {
|
|
4167
4167
|
const e = Object.values(a.files).find((t) => t != null && t.dir !== !0);
|
|
4168
4168
|
return e == null ? Promise.resolve(null) : e.async("string");
|
|
4169
4169
|
}
|
|
4170
|
-
function
|
|
4170
|
+
function Ka(a) {
|
|
4171
4171
|
return a.charCodeAt(0) === 65279 ? a.slice(1) : a;
|
|
4172
4172
|
}
|
|
4173
4173
|
function Ft(a) {
|
|
4174
|
-
return JSON.parse(
|
|
4174
|
+
return JSON.parse(Ka(a));
|
|
4175
4175
|
}
|
|
4176
|
-
async function
|
|
4176
|
+
async function Ya(a, e) {
|
|
4177
4177
|
try {
|
|
4178
|
-
const t = await
|
|
4178
|
+
const t = await zs(a, e), i = await ja(t);
|
|
4179
4179
|
if (i == null)
|
|
4180
4180
|
return { exists: !0, value: [] };
|
|
4181
4181
|
const n = Ft(i);
|
|
@@ -4184,23 +4184,23 @@ async function Ka(a, e) {
|
|
|
4184
4184
|
return ui.isAxiosError(t) && t.response?.status === 404 ? { exists: !1 } : (console.warn("[loadLightModel] failed to load optional quota_list", { path: a, error: t }), { exists: !1 });
|
|
4185
4185
|
}
|
|
4186
4186
|
}
|
|
4187
|
-
function
|
|
4188
|
-
const t =
|
|
4187
|
+
function Qa(a, e) {
|
|
4188
|
+
const t = Os(a, e);
|
|
4189
4189
|
return t == null || t.dir ? Promise.resolve(null) : t.async("arraybuffer");
|
|
4190
4190
|
}
|
|
4191
|
-
function
|
|
4191
|
+
function Xa(a, e) {
|
|
4192
4192
|
return new Promise((t, i) => {
|
|
4193
|
-
|
|
4193
|
+
Wa(a).parse(e, Pr(import.meta.url), t, i);
|
|
4194
4194
|
});
|
|
4195
4195
|
}
|
|
4196
4196
|
function xt(a, e) {
|
|
4197
4197
|
const t = a.models?.find?.((i) => i.url == e);
|
|
4198
|
-
return t != null && t.group == null && (t.group = pi(a, e) ??
|
|
4198
|
+
return t != null && t.group == null && (t.group = pi(a, e) ?? lt(a, e)), t;
|
|
4199
4199
|
}
|
|
4200
4200
|
function he(a, e, t) {
|
|
4201
4201
|
return Number.isFinite(t) && typeof a?.loaderModule?.isModelLoadActive == "function" ? a.loaderModule.isModelLoadActive(e, t) !== !0 : a?.loaderModule?.isModelUnloadRequested?.(e) === !0;
|
|
4202
4202
|
}
|
|
4203
|
-
function
|
|
4203
|
+
function Ns(a) {
|
|
4204
4204
|
const e = /* @__PURE__ */ new Set();
|
|
4205
4205
|
a.forEach((t) => {
|
|
4206
4206
|
t?.geometry instanceof de && e.add(t.geometry), t != null && (t.geometry = null, t.material = null);
|
|
@@ -4208,7 +4208,7 @@ function Os(a) {
|
|
|
4208
4208
|
t.disposeBoundsTree?.(), t.dispose();
|
|
4209
4209
|
}), a.length = 0;
|
|
4210
4210
|
}
|
|
4211
|
-
function
|
|
4211
|
+
function $a(a) {
|
|
4212
4212
|
if (a == null)
|
|
4213
4213
|
return;
|
|
4214
4214
|
const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
@@ -4222,14 +4222,14 @@ function Xa(a) {
|
|
|
4222
4222
|
n.disposeBoundsTree?.(), n.dispose();
|
|
4223
4223
|
}), t.forEach((n) => n.dispose()), i.forEach((n) => n.dispose());
|
|
4224
4224
|
}
|
|
4225
|
-
function
|
|
4225
|
+
function Ja(a, e) {
|
|
4226
4226
|
const t = xt(a, e);
|
|
4227
4227
|
return Array.isArray(t?.lods) ? t.lods : [];
|
|
4228
4228
|
}
|
|
4229
|
-
function
|
|
4229
|
+
function Fs(a) {
|
|
4230
4230
|
return a.index != null ? a.index.count : a.attributes.position?.count ?? 0;
|
|
4231
4231
|
}
|
|
4232
|
-
function
|
|
4232
|
+
function Za(a) {
|
|
4233
4233
|
const e = [], t = [{ node: a.octreeBox, visited: !1 }];
|
|
4234
4234
|
for (; t.length > 0; ) {
|
|
4235
4235
|
const i = t.pop();
|
|
@@ -4248,16 +4248,16 @@ function Ja(a) {
|
|
|
4248
4248
|
}
|
|
4249
4249
|
return e;
|
|
4250
4250
|
}
|
|
4251
|
-
function
|
|
4251
|
+
function el(a, e, t) {
|
|
4252
4252
|
if (he(a, e.url, e.loadVersion))
|
|
4253
4253
|
return [];
|
|
4254
4254
|
const i = xt(a, e.url);
|
|
4255
4255
|
if (i?.nodesMap == null)
|
|
4256
4256
|
return [];
|
|
4257
|
-
const n = a.filterLoaderModel?.getContinueIdSet?.(e.url) ?? /* @__PURE__ */ new Set(), s =
|
|
4257
|
+
const n = a.filterLoaderModel?.getContinueIdSet?.(e.url) ?? /* @__PURE__ */ new Set(), s = Za(t), o = [], r = a?.deviceModule?.isMobile?.() !== !0;
|
|
4258
4258
|
for (const l of s) {
|
|
4259
4259
|
if (he(a, e.url, e.loadVersion))
|
|
4260
|
-
return
|
|
4260
|
+
return Ns(o), [];
|
|
4261
4261
|
if (n.has(Number(l)) || !i.nodesMap.has(l))
|
|
4262
4262
|
continue;
|
|
4263
4263
|
const c = i.nodesMap.get(l), h = Array.isArray(c?.infos) ? c.infos : [];
|
|
@@ -4272,7 +4272,7 @@ function Za(a, e, t) {
|
|
|
4272
4272
|
y.dispose();
|
|
4273
4273
|
continue;
|
|
4274
4274
|
}
|
|
4275
|
-
y.applyMatrix4(g), y.computeBoundingBox(), r && b.count > 2e4 &&
|
|
4275
|
+
y.applyMatrix4(g), y.computeBoundingBox(), r && b.count > 2e4 && Ea(y, {
|
|
4276
4276
|
setBoundingSphere: !0
|
|
4277
4277
|
});
|
|
4278
4278
|
const x = new G(y, p.material);
|
|
@@ -4287,42 +4287,42 @@ function en(a) {
|
|
|
4287
4287
|
const e = a.clone();
|
|
4288
4288
|
return e.clippingPlanes = a.clippingPlanes, e;
|
|
4289
4289
|
}
|
|
4290
|
-
function
|
|
4290
|
+
function tl(a) {
|
|
4291
4291
|
a.setRGB(a.r, a.g, a.b, Ge);
|
|
4292
4292
|
}
|
|
4293
|
-
function
|
|
4293
|
+
function il(a) {
|
|
4294
4294
|
const e = a;
|
|
4295
|
-
e.color == null || a.userData.__displayColorLinearized === !0 || (
|
|
4295
|
+
e.color == null || a.userData.__displayColorLinearized === !0 || (tl(e.color), a.userData.__displayColorLinearized = !0);
|
|
4296
4296
|
}
|
|
4297
|
-
function
|
|
4297
|
+
function nl(a) {
|
|
4298
4298
|
return a.boundingSphere == null && a.computeBoundingSphere(), a.boundingSphere?.radius ? a.boundingSphere.radius * 2 : 0;
|
|
4299
4299
|
}
|
|
4300
|
-
function
|
|
4300
|
+
function sl(a, e, t, i, n) {
|
|
4301
4301
|
const s = Ri(
|
|
4302
4302
|
i.map((p) => p.geometry),
|
|
4303
4303
|
!1
|
|
4304
4304
|
);
|
|
4305
4305
|
if (s == null)
|
|
4306
4306
|
throw new Error(`[loadLightModel] 普通构件合批失败: ${t}`);
|
|
4307
|
-
const o = en(n), r = new G(s, o), l = i.reduce((p, g) => Math.max(p,
|
|
4308
|
-
r.castShadow =
|
|
4307
|
+
const o = en(n), r = new G(s, o), l = i.reduce((p, g) => Math.max(p, nl(g.geometry)), 0), c = Math.floor(Fs(s) / 3);
|
|
4308
|
+
r.castShadow = Tr(l, c), r.receiveShadow = !0, lt(e, a).add(r);
|
|
4309
4309
|
const u = Xi(e, r);
|
|
4310
|
-
return e.options?.modelDepthBias !== !1 && $i(r, u, e.renderer?.reversedDepthBuffer === !0), r.url = a, r.glb = t, r.materialClone = o, r.geometrys = i.map((p) => p.geometry), r.geometry.computeVertexNormals(),
|
|
4310
|
+
return e.options?.modelDepthBias !== !1 && $i(r, u, e.renderer?.reversedDepthBuffer === !0), r.url = a, r.glb = t, r.materialClone = o, r.geometrys = i.map((p) => p.geometry), r.geometry.computeVertexNormals(), _a(e, r, i), Ji(r), r;
|
|
4311
4311
|
}
|
|
4312
|
-
function
|
|
4312
|
+
function ol(a, e, t) {
|
|
4313
4313
|
const i = /* @__PURE__ */ new Map();
|
|
4314
4314
|
for (const o of t) {
|
|
4315
|
-
const r =
|
|
4315
|
+
const r = Ta(o), l = i.get(r) ?? { glb: String(o.glb ?? ""), meshes: [] };
|
|
4316
4316
|
l.meshes.push(o), i.set(r, l);
|
|
4317
4317
|
}
|
|
4318
4318
|
const n = xt(e, a), s = Ht(e);
|
|
4319
4319
|
for (const o of i.values()) {
|
|
4320
|
-
const r = s.enabled && s.meshDistanceCullingEnabled ?
|
|
4320
|
+
const r = s.enabled && s.meshDistanceCullingEnabled ? Ia(o.meshes) : o.meshes, l = s.enabled ? _n(r, s.maxTrianglesPerMesh) : _n(r, Number.MAX_SAFE_INTEGER);
|
|
4321
4321
|
for (const c of l) {
|
|
4322
|
-
const h = tn(c[0].material, e), u =
|
|
4322
|
+
const h = tn(c[0].material, e), u = sl(a, e, o.glb, c, h), p = /* @__PURE__ */ new Map();
|
|
4323
4323
|
let g = 0;
|
|
4324
4324
|
c.forEach((y, b) => {
|
|
4325
|
-
const x = Number(y.name), m =
|
|
4325
|
+
const x = Number(y.name), m = Fs(y.geometry), w = p.get(x) ?? [];
|
|
4326
4326
|
if (w.push([g, g + m]), p.set(x, w), n?.nodesMap?.has(x)) {
|
|
4327
4327
|
const C = n.nodesMap.get(x);
|
|
4328
4328
|
C.indexes == null && (C.indexes = []), C.indexes.push([u.index, b, g, g + m]);
|
|
@@ -4335,16 +4335,16 @@ function sl(a, e, t) {
|
|
|
4335
4335
|
}
|
|
4336
4336
|
}
|
|
4337
4337
|
}
|
|
4338
|
-
function
|
|
4338
|
+
function rl(a, e) {
|
|
4339
4339
|
const t = a?.geometry;
|
|
4340
4340
|
return t instanceof de ? (t.boundingBox == null && t.computeBoundingBox(), t.boundingBox?.clone().applyMatrix4(e) ?? null) : null;
|
|
4341
4341
|
}
|
|
4342
|
-
function
|
|
4342
|
+
function al(a, e) {
|
|
4343
4343
|
return a.boundingSphere == null && a.computeBoundingSphere(), a.boundingSphere?.clone().applyMatrix4(e) ?? null;
|
|
4344
4344
|
}
|
|
4345
|
-
function
|
|
4345
|
+
function ll(a, e, t, i, n, s) {
|
|
4346
4346
|
const o = tn(en(i.material), t), r = new W(i.geometry, o, s.length);
|
|
4347
|
-
r.castShadow = !1, r.receiveShadow = !1,
|
|
4347
|
+
r.castShadow = !1, r.receiveShadow = !1, lt(t, a).add(r);
|
|
4348
4348
|
const c = Xi(t, r);
|
|
4349
4349
|
t.options?.modelDepthBias !== !1 && $i(r, c, t.renderer?.reversedDepthBuffer === !0);
|
|
4350
4350
|
const h = [];
|
|
@@ -4363,9 +4363,9 @@ function al(a, e, t, i, n, s) {
|
|
|
4363
4363
|
Nt(b), n.nodesMap.set(y.id, b);
|
|
4364
4364
|
}
|
|
4365
4365
|
}
|
|
4366
|
-
r.instanceMatrix.needsUpdate = !0, r.materialClone = r.material, r.url = a, r.glb = i.glb, r.ids = s.map((u) => u.node.id), r.matrixsClone = h, r.meshIndex = e,
|
|
4366
|
+
r.instanceMatrix.needsUpdate = !0, r.materialClone = r.material, r.url = a, r.glb = i.glb, r.ids = s.map((u) => u.node.id), r.matrixsClone = h, r.meshIndex = e, ka(t, r, s.map((u) => u.size)), Ji(r);
|
|
4367
4367
|
}
|
|
4368
|
-
function
|
|
4368
|
+
function cl(a, e, t, i, n) {
|
|
4369
4369
|
if (i == null || n == null || n.length === 0)
|
|
4370
4370
|
return;
|
|
4371
4371
|
const s = xt(t, a);
|
|
@@ -4373,7 +4373,7 @@ function ll(a, e, t, i, n) {
|
|
|
4373
4373
|
return;
|
|
4374
4374
|
i.geometry.computeVertexNormals();
|
|
4375
4375
|
const o = n.filter((c) => Array.isArray(c?.matrix) && c.matrix.length === 16 && c.matrix.every(Number.isFinite)).map((c) => {
|
|
4376
|
-
const h = new H().fromArray(c.matrix), u =
|
|
4376
|
+
const h = new H().fromArray(c.matrix), u = rl(i, h), p = al(i.geometry, h);
|
|
4377
4377
|
return {
|
|
4378
4378
|
node: c,
|
|
4379
4379
|
matrix: h,
|
|
@@ -4388,12 +4388,12 @@ function ll(a, e, t, i, n) {
|
|
|
4388
4388
|
((c) => {
|
|
4389
4389
|
if (c.length === 0)
|
|
4390
4390
|
return;
|
|
4391
|
-
(r.enabled && r.instanceDistanceCullingEnabled && c.length >=
|
|
4392
|
-
|
|
4391
|
+
(r.enabled && r.instanceDistanceCullingEnabled && c.length >= Aa ? Da(c) : [c]).forEach((u) => {
|
|
4392
|
+
ll(a, e, t, i, s, u);
|
|
4393
4393
|
});
|
|
4394
4394
|
})(o);
|
|
4395
4395
|
}
|
|
4396
|
-
function
|
|
4396
|
+
function hl(a, e, t) {
|
|
4397
4397
|
const i = e.instanceNodes;
|
|
4398
4398
|
if (i == null)
|
|
4399
4399
|
return;
|
|
@@ -4407,30 +4407,30 @@ function cl(a, e, t) {
|
|
|
4407
4407
|
const l = Array.isArray(o.children) ? o.children.filter((c) => n.has(Number(c?.id)) === !1) : [];
|
|
4408
4408
|
if (l.length === 0)
|
|
4409
4409
|
continue;
|
|
4410
|
-
|
|
4410
|
+
cl(a.url, o.mesh, t, r, l);
|
|
4411
4411
|
}
|
|
4412
4412
|
}
|
|
4413
4413
|
}
|
|
4414
4414
|
}
|
|
4415
|
-
async function
|
|
4415
|
+
async function dl(a, e, t) {
|
|
4416
4416
|
if (!he(a, e.url, e.loadVersion)) {
|
|
4417
4417
|
if (t.status === !0 || t.meshPromise != null) {
|
|
4418
4418
|
await t.meshPromise;
|
|
4419
4419
|
return;
|
|
4420
4420
|
}
|
|
4421
4421
|
t.meshPromise = (async () => {
|
|
4422
|
-
const i =
|
|
4422
|
+
const i = el(a, e, t);
|
|
4423
4423
|
if (he(a, e.url, e.loadVersion)) {
|
|
4424
|
-
|
|
4424
|
+
Ns(i);
|
|
4425
4425
|
return;
|
|
4426
4426
|
}
|
|
4427
|
-
|
|
4427
|
+
ol(e.url, a, i), hl(e, t, a), t.glbs = [], t.instanceNodes = null, t.status = !0;
|
|
4428
4428
|
})().finally(() => {
|
|
4429
4429
|
t.meshPromise = null;
|
|
4430
4430
|
}), await t.meshPromise;
|
|
4431
4431
|
}
|
|
4432
4432
|
}
|
|
4433
|
-
async function
|
|
4433
|
+
async function ul(a, e, t) {
|
|
4434
4434
|
if (!he(a, e.url, e.loadVersion) && t.loadSuccess !== !0) {
|
|
4435
4435
|
if (t.preparePromise != null) {
|
|
4436
4436
|
await t.preparePromise;
|
|
@@ -4440,7 +4440,7 @@ async function dl(a, e, t) {
|
|
|
4440
4440
|
t.glbs = t.glbs ?? {};
|
|
4441
4441
|
const i = e.url + t.path;
|
|
4442
4442
|
Mt(a, e.url, i);
|
|
4443
|
-
const n = await
|
|
4443
|
+
const n = await zs(i, e.key);
|
|
4444
4444
|
if (he(a, e.url, e.loadVersion))
|
|
4445
4445
|
return;
|
|
4446
4446
|
const s = await Nn(n, ["/nodes.json", "nodes.json"]);
|
|
@@ -4469,7 +4469,7 @@ async function dl(a, e, t) {
|
|
|
4469
4469
|
const c = async (u) => {
|
|
4470
4470
|
if (he(a, e.url, e.loadVersion))
|
|
4471
4471
|
return;
|
|
4472
|
-
let p = await
|
|
4472
|
+
let p = await Qa(n, [`/${u}.glb`, `${u}.glb`, u + ".glb"]);
|
|
4473
4473
|
if (p == null) {
|
|
4474
4474
|
console.error("[loadLightModel] glb not found in zip", {
|
|
4475
4475
|
modelUrl: e.url,
|
|
@@ -4480,14 +4480,14 @@ async function dl(a, e, t) {
|
|
|
4480
4480
|
return;
|
|
4481
4481
|
}
|
|
4482
4482
|
try {
|
|
4483
|
-
const g = await
|
|
4483
|
+
const g = await Xa(a, p);
|
|
4484
4484
|
if (he(a, e.url, e.loadVersion)) {
|
|
4485
|
-
|
|
4485
|
+
$a(g.scene);
|
|
4486
4486
|
return;
|
|
4487
4487
|
}
|
|
4488
4488
|
p = null, t.glbs[u] = g.scene.children, t.glbs[u].forEach((y) => {
|
|
4489
4489
|
y?.traverse?.((b) => {
|
|
4490
|
-
|
|
4490
|
+
Hs(b?.material, a);
|
|
4491
4491
|
});
|
|
4492
4492
|
});
|
|
4493
4493
|
} catch (g) {
|
|
@@ -4495,8 +4495,8 @@ async function dl(a, e, t) {
|
|
|
4495
4495
|
modelUrl: e.url,
|
|
4496
4496
|
lodPath: t.path,
|
|
4497
4497
|
glbKey: `${u}.glb`,
|
|
4498
|
-
dracoDecoderPath:
|
|
4499
|
-
basisTranscoderPath:
|
|
4498
|
+
dracoDecoderPath: Rs(),
|
|
4499
|
+
basisTranscoderPath: Bs(),
|
|
4500
4500
|
error: g
|
|
4501
4501
|
});
|
|
4502
4502
|
} finally {
|
|
@@ -4513,10 +4513,10 @@ async function dl(a, e, t) {
|
|
|
4513
4513
|
}), await t.preparePromise;
|
|
4514
4514
|
}
|
|
4515
4515
|
}
|
|
4516
|
-
async function
|
|
4517
|
-
he(a, e.url, e.loadVersion) || t.status === !0 || (await
|
|
4516
|
+
async function pl(a, e, t) {
|
|
4517
|
+
he(a, e.url, e.loadVersion) || t.status === !0 || (await ul(a, e, t), !he(a, e.url, e.loadVersion) && t.loadSuccess === !0 && await dl(a, e, t));
|
|
4518
4518
|
}
|
|
4519
|
-
function
|
|
4519
|
+
function gl(a, e) {
|
|
4520
4520
|
if (he(a, e.url, e.loadVersion) || e.loadStatus.modelMep === !0)
|
|
4521
4521
|
return;
|
|
4522
4522
|
const t = xt(a, e.url);
|
|
@@ -4524,14 +4524,14 @@ function pl(a, e) {
|
|
|
4524
4524
|
throw new Error(`[loadLightModel] runtime model not found: ${e.url}`);
|
|
4525
4525
|
e.loadStatus.modelMep = "loading";
|
|
4526
4526
|
try {
|
|
4527
|
-
t.modelMep = t.modelMep ?? {},
|
|
4527
|
+
t.modelMep = t.modelMep ?? {}, pa(a, t.modelMep, e.url, () => {
|
|
4528
4528
|
}), e.loadStatus.modelMep = !0;
|
|
4529
4529
|
} catch (i) {
|
|
4530
4530
|
throw e.loadStatus.modelMep = !1, i;
|
|
4531
4531
|
}
|
|
4532
4532
|
}
|
|
4533
|
-
async function
|
|
4534
|
-
const n =
|
|
4533
|
+
async function ml(a, e, t, i) {
|
|
4534
|
+
const n = lt(a, e);
|
|
4535
4535
|
a.models || (a.models = []);
|
|
4536
4536
|
const s = t?.loadQuotaList ?? !1, o = t?.loadEdge !== !1, r = "WDDsBNtzVz6aSh/bCFh3CmjjANEDRryoXF1XCJvJjeE=", l = await zn(e + "/info", r);
|
|
4537
4537
|
if (he(a, e, i))
|
|
@@ -4579,48 +4579,48 @@ async function gl(a, e, t, i) {
|
|
|
4579
4579
|
if (Mt(a, e, e + "/property"), p.properties = Ft(await zn(e + "/property", r)), he(a, e, i))
|
|
4580
4580
|
return;
|
|
4581
4581
|
a.filterLoaderModel?.buildContinueIds?.(e);
|
|
4582
|
-
const b = await
|
|
4582
|
+
const b = await Ya(e + "/quota_list", r);
|
|
4583
4583
|
if (he(a, e, i))
|
|
4584
4584
|
return;
|
|
4585
4585
|
b.exists && (g.quotaList = b.value ?? [], a.rxQuotaListMapper.loadNodeMap(g));
|
|
4586
4586
|
}
|
|
4587
|
-
if (p.loadStatus.quotaList = !0, p.loadStatus.normal = "loading", await
|
|
4587
|
+
if (p.loadStatus.quotaList = !0, p.loadStatus.normal = "loading", await fl(a, p), he(a, e, i))
|
|
4588
4588
|
return;
|
|
4589
4589
|
if (!g.lods.every((b) => b.status === !0))
|
|
4590
4590
|
throw new Error(`[loadLightModel] incomplete LOD data: ${e}`);
|
|
4591
|
-
p.loadStatus.normal = !0,
|
|
4591
|
+
p.loadStatus.normal = !0, gl(a, p), p.status = "loaded", a.lightModule?.updateDirectionalShadow?.(a.camera), a.requestShadowUpdate?.();
|
|
4592
4592
|
} catch (y) {
|
|
4593
4593
|
if (he(a, e, i))
|
|
4594
4594
|
return;
|
|
4595
4595
|
throw p.status = "error", p.loadStatus.normal === "loading" && (p.loadStatus.normal = !1), y;
|
|
4596
4596
|
}
|
|
4597
4597
|
}
|
|
4598
|
-
async function
|
|
4599
|
-
const t =
|
|
4598
|
+
async function fl(a, e) {
|
|
4599
|
+
const t = Ja(a, e.url);
|
|
4600
4600
|
for (const i of t) {
|
|
4601
4601
|
if (he(a, e.url, e.loadVersion))
|
|
4602
4602
|
return;
|
|
4603
|
-
await
|
|
4603
|
+
await pl(a, e, i);
|
|
4604
4604
|
}
|
|
4605
4605
|
}
|
|
4606
4606
|
function tn(a, e) {
|
|
4607
4607
|
if (Array.isArray(a))
|
|
4608
4608
|
return a.map((n) => tn(n, e));
|
|
4609
|
-
|
|
4609
|
+
il(a), Hs(a, e);
|
|
4610
4610
|
const t = a.map;
|
|
4611
4611
|
t != null && t.colorSpace !== Ge && (t.colorSpace = Ge, t.needsUpdate = !0);
|
|
4612
4612
|
const i = a;
|
|
4613
|
-
return i.metalness === 0 && (i.metalness = 0.1, i.roughness = 0.4), a.shadowSide =
|
|
4613
|
+
return i.metalness === 0 && (i.metalness = 0.1, i.roughness = 0.4), a.shadowSide = Ms, a.clipShadows = !0, e?.sectionPlane && (a.clippingPlanes = e.sectionPlane), e?.materialReplacement?.applyMaterial?.(a), a;
|
|
4614
4614
|
}
|
|
4615
|
-
function
|
|
4615
|
+
function yl(a) {
|
|
4616
4616
|
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);
|
|
4617
4617
|
return Number.isFinite(i) && i > 0 && Number.isFinite(n) && n > 0 ? { width: i, height: n } : null;
|
|
4618
4618
|
}
|
|
4619
|
-
function
|
|
4619
|
+
function vl(a) {
|
|
4620
4620
|
const e = a.source?.data ?? a.image;
|
|
4621
4621
|
typeof e?.close == "function" && e.close(), Array.isArray(a.mipmaps) && (a.mipmaps.length = 0), a.dispose(), a.source != null && (a.source.data = null);
|
|
4622
4622
|
}
|
|
4623
|
-
function
|
|
4623
|
+
function Hs(a, e) {
|
|
4624
4624
|
if (e?.deviceModule?.isMobile?.() !== !0 || a == null)
|
|
4625
4625
|
return;
|
|
4626
4626
|
(Array.isArray(a) ? a : [a]).forEach((i) => {
|
|
@@ -4632,8 +4632,8 @@ function Fs(a, e) {
|
|
|
4632
4632
|
i[n] = null;
|
|
4633
4633
|
return;
|
|
4634
4634
|
}
|
|
4635
|
-
const o =
|
|
4636
|
-
o == null || Math.max(o.width, o.height) <= Rn || (Bn.add(s), i[n] = null,
|
|
4635
|
+
const o = yl(s);
|
|
4636
|
+
o == null || Math.max(o.width, o.height) <= Rn || (Bn.add(s), i[n] = null, vl(s), console.warn("[loadLightModel:v3] discarded oversized mobile texture", {
|
|
4637
4637
|
slot: n,
|
|
4638
4638
|
width: o.width,
|
|
4639
4639
|
height: o.height,
|
|
@@ -4642,7 +4642,7 @@ function Fs(a, e) {
|
|
|
4642
4642
|
});
|
|
4643
4643
|
});
|
|
4644
4644
|
}
|
|
4645
|
-
const
|
|
4645
|
+
const Ml = "/__local_model__", bl = /^(info|property|edge|quota_list|lod\d+)(?:\.zip)?$/i, xl = /^(info|property|edge|quota_list|lod\d+)(?:~)?$/i;
|
|
4646
4646
|
class ge {
|
|
4647
4647
|
static localRequestMap = /* @__PURE__ */ new Map();
|
|
4648
4648
|
static localObjectUrls = /* @__PURE__ */ new Set();
|
|
@@ -4668,7 +4668,7 @@ class ge {
|
|
|
4668
4668
|
for (const s of e) {
|
|
4669
4669
|
this.unloadedModelUrls.delete(s);
|
|
4670
4670
|
const o = (this.modelLoadVersions.get(s) ?? 0) + 1;
|
|
4671
|
-
this.modelLoadVersions.set(s, o), n(s) === "light" && i.push(
|
|
4671
|
+
this.modelLoadVersions.set(s, o), n(s) === "light" && i.push(ml(this.engine, s, t, o));
|
|
4672
4672
|
}
|
|
4673
4673
|
await Promise.all(i), this.engine.events?.trigger?.(oe.LoadingCompleted, {});
|
|
4674
4674
|
function n(s) {
|
|
@@ -4691,7 +4691,7 @@ class ge {
|
|
|
4691
4691
|
throw new Error("响应内容不是有效的 ZIP 文件");
|
|
4692
4692
|
i.push(new File(
|
|
4693
4693
|
[o.data],
|
|
4694
|
-
|
|
4694
|
+
Tl(s, n),
|
|
4695
4695
|
{ type: o.data.type || "application/zip" }
|
|
4696
4696
|
));
|
|
4697
4697
|
} catch (o) {
|
|
@@ -4732,8 +4732,8 @@ class ge {
|
|
|
4732
4732
|
if (typeof e != "string" || e.length === 0)
|
|
4733
4733
|
return;
|
|
4734
4734
|
this.unloadedModelUrls.add(e), this.modelLoadVersions.set(e, (this.modelLoadVersions.get(e) ?? 0) + 1);
|
|
4735
|
-
const t = Array.isArray(this.engine?.models) ? this.engine.models.filter((s) => s?.url === e) : [], i =
|
|
4736
|
-
this.engine?.modelExplode?.releaseModel?.(e), this.engine?.modelToolModule?.releaseModelRuntimeState?.(e), this.engine?.modelEdge?.releaseModel?.(e),
|
|
4735
|
+
const t = Array.isArray(this.engine?.models) ? this.engine.models.filter((s) => s?.url === e) : [], i = wl(this.engine, e, t), n = Cl(this.engine, e, i);
|
|
4736
|
+
this.engine?.modelExplode?.releaseModel?.(e), this.engine?.modelToolModule?.releaseModelRuntimeState?.(e), this.engine?.modelEdge?.releaseModel?.(e), Ba(this.engine, e), El(i), Sl(i, n), Al(this.engine, e, i, t), t.forEach(Pl), Array.isArray(this.engine?.models) && (this.engine.models = this.engine.models.filter((s) => s?.url !== e)), this.refreshHomeBoundingBoxAfterUnload(), this.clearEngineStatus(e), this.engine?.filterLoaderModel?.clear?.(e), this.removeModelGroupReference(e), ge.releaseLocalRequests(e), this.engine?.composerModule?.markSceneDirty?.(), this.engine?.requestShadowUpdate?.(), this.engine?.requestComposerRender?.();
|
|
4737
4737
|
}
|
|
4738
4738
|
/** 返回指定 URL 是否已收到卸载请求。 */
|
|
4739
4739
|
isModelUnloadRequested(e) {
|
|
@@ -4832,7 +4832,7 @@ class ge {
|
|
|
4832
4832
|
blob: await this.packEntriesAsZip(g)
|
|
4833
4833
|
});
|
|
4834
4834
|
c.some((p) => p.packageName === "info") && (r += 1, o.push({
|
|
4835
|
-
rootUrl: `${
|
|
4835
|
+
rootUrl: `${Ml}/${ge.createLocalModelId(l, r)}`,
|
|
4836
4836
|
packages: c
|
|
4837
4837
|
}));
|
|
4838
4838
|
}
|
|
@@ -4854,7 +4854,7 @@ class ge {
|
|
|
4854
4854
|
const o = await Oi.loadAsync(i), r = Ti(n), l = Object.values(o.files);
|
|
4855
4855
|
for (const c of l)
|
|
4856
4856
|
c.dir || t.push({
|
|
4857
|
-
path:
|
|
4857
|
+
path: Il(r, Be(c.name)),
|
|
4858
4858
|
blob: await c.async("blob")
|
|
4859
4859
|
});
|
|
4860
4860
|
continue;
|
|
@@ -4870,7 +4870,7 @@ class ge {
|
|
|
4870
4870
|
const t = Ti(e), i = It(e);
|
|
4871
4871
|
return Fn(i) ? {
|
|
4872
4872
|
modelKey: t,
|
|
4873
|
-
packageName:
|
|
4873
|
+
packageName: Dl(i)
|
|
4874
4874
|
} : null;
|
|
4875
4875
|
}
|
|
4876
4876
|
/**
|
|
@@ -4879,7 +4879,7 @@ class ge {
|
|
|
4879
4879
|
parseExtractedPackageEntry(e) {
|
|
4880
4880
|
const t = Be(e).split("/").filter(Boolean);
|
|
4881
4881
|
for (let n = 0; n < t.length; n++) {
|
|
4882
|
-
const s =
|
|
4882
|
+
const s = _l(t[n]);
|
|
4883
4883
|
if (s == null)
|
|
4884
4884
|
continue;
|
|
4885
4885
|
const o = t.slice(n + 1);
|
|
@@ -4950,14 +4950,14 @@ class ge {
|
|
|
4950
4950
|
return `${e.replace(/[^a-zA-Z0-9/_-]/g, "_").replace(/\//g, "__") || "model"}_${Date.now()}_${t}_${Math.random().toString(36).slice(2, 8)}`;
|
|
4951
4951
|
}
|
|
4952
4952
|
}
|
|
4953
|
-
function
|
|
4953
|
+
function Vs() {
|
|
4954
4954
|
return {
|
|
4955
4955
|
geometries: /* @__PURE__ */ new Set(),
|
|
4956
4956
|
materials: /* @__PURE__ */ new Set(),
|
|
4957
4957
|
textures: /* @__PURE__ */ new Set()
|
|
4958
4958
|
};
|
|
4959
4959
|
}
|
|
4960
|
-
function
|
|
4960
|
+
function Us(a, e) {
|
|
4961
4961
|
Object.values(a).forEach((i) => {
|
|
4962
4962
|
i instanceof Oe && e.add(i);
|
|
4963
4963
|
});
|
|
@@ -4973,13 +4973,13 @@ function Hi(a, e) {
|
|
|
4973
4973
|
[a?.geometry, ...Array.isArray(a?.geometrys) ? a.geometrys : []].forEach((n) => {
|
|
4974
4974
|
n instanceof de && e.geometries.add(n);
|
|
4975
4975
|
}), (Array.isArray(a?.material) ? a.material : [a?.material]).forEach((n) => {
|
|
4976
|
-
n instanceof zt && (e.materials.add(n),
|
|
4976
|
+
n instanceof zt && (e.materials.add(n), Us(n, e.textures));
|
|
4977
4977
|
});
|
|
4978
4978
|
}
|
|
4979
4979
|
function Ue(a, e) {
|
|
4980
4980
|
a instanceof Bt && a.traverse((t) => e.add(t));
|
|
4981
4981
|
}
|
|
4982
|
-
function
|
|
4982
|
+
function qs(a, e) {
|
|
4983
4983
|
Ue(a?.group, e), a?.nodesMap?.forEach?.((t) => {
|
|
4984
4984
|
Ue(t?.mesh, e), Ue(t?.pickBoxMesh, e), Ue(t?.info?.mesh, e), t?.infos?.forEach?.((i) => Ue(i?.mesh, e));
|
|
4985
4985
|
}), a?.lods?.forEach?.((t) => {
|
|
@@ -4988,23 +4988,23 @@ function Us(a, e) {
|
|
|
4988
4988
|
});
|
|
4989
4989
|
});
|
|
4990
4990
|
}
|
|
4991
|
-
function
|
|
4991
|
+
function wl(a, e, t) {
|
|
4992
4992
|
const i = /* @__PURE__ */ new Set();
|
|
4993
|
-
return Ue(a?.__modelGroupMap instanceof Map ? a.__modelGroupMap.get(e) : null, i), Ue(pi(a, e), i), t.forEach((n) =>
|
|
4993
|
+
return Ue(a?.__modelGroupMap instanceof Map ? a.__modelGroupMap.get(e) : null, i), Ue(pi(a, e), i), t.forEach((n) => qs(n, i)), a?.__modelObjectIndexMap?.forEach?.((n) => {
|
|
4994
4994
|
(n?.url === e || n?.userData?.url === e) && Ue(n, i);
|
|
4995
4995
|
}), a?.scene?.traverse?.((n) => {
|
|
4996
4996
|
(n?.url === e || n?.userData?.url === e) && Ue(n, i);
|
|
4997
4997
|
}), i;
|
|
4998
4998
|
}
|
|
4999
|
-
function
|
|
5000
|
-
const i =
|
|
4999
|
+
function Cl(a, e, t) {
|
|
5000
|
+
const i = Vs();
|
|
5001
5001
|
a?.scene?.traverse?.((s) => {
|
|
5002
5002
|
t.has(s) || Hi(s, i);
|
|
5003
5003
|
}), a?.models?.forEach?.((s) => {
|
|
5004
5004
|
if (s?.url === e)
|
|
5005
5005
|
return;
|
|
5006
5006
|
const o = /* @__PURE__ */ new Set();
|
|
5007
|
-
|
|
5007
|
+
qs(s, o), o.forEach((r) => Hi(r, i));
|
|
5008
5008
|
});
|
|
5009
5009
|
const n = a?.scene;
|
|
5010
5010
|
return n?.background instanceof Oe && i.textures.add(n.background), n?.environment instanceof Oe && i.textures.add(n.environment), [
|
|
@@ -5018,16 +5018,16 @@ function wl(a, e, t) {
|
|
|
5018
5018
|
a?.modelExplode?.highlightMaterial,
|
|
5019
5019
|
a?.modelExplode?.translucentMaterial
|
|
5020
5020
|
].forEach((s) => {
|
|
5021
|
-
s instanceof zt && (i.materials.add(s),
|
|
5021
|
+
s instanceof zt && (i.materials.add(s), Us(s, i.textures));
|
|
5022
5022
|
}), i;
|
|
5023
5023
|
}
|
|
5024
|
-
function
|
|
5024
|
+
function El(a) {
|
|
5025
5025
|
a.forEach((e) => {
|
|
5026
5026
|
e.parent != null && !a.has(e.parent) && e.parent.remove(e);
|
|
5027
5027
|
});
|
|
5028
5028
|
}
|
|
5029
|
-
function
|
|
5030
|
-
const t =
|
|
5029
|
+
function Sl(a, e) {
|
|
5030
|
+
const t = Vs();
|
|
5031
5031
|
a.forEach((i) => Hi(i, t)), t.geometries.forEach((i) => {
|
|
5032
5032
|
e.geometries.has(i) || (i.disposeBoundsTree?.(), i.dispose());
|
|
5033
5033
|
}), t.materials.forEach((i) => {
|
|
@@ -5036,7 +5036,7 @@ function El(a, e) {
|
|
|
5036
5036
|
e.textures.has(i) || i.dispose();
|
|
5037
5037
|
});
|
|
5038
5038
|
}
|
|
5039
|
-
function
|
|
5039
|
+
function Al(a, e, t, i) {
|
|
5040
5040
|
const n = /* @__PURE__ */ new Set();
|
|
5041
5041
|
t.forEach((o) => {
|
|
5042
5042
|
Number.isFinite(o?.index) && n.add(o.index);
|
|
@@ -5052,7 +5052,7 @@ function Sl(a, e, t, i) {
|
|
|
5052
5052
|
(n.has(r) || t.has(o) || o?.url === e) && s.delete(r);
|
|
5053
5053
|
});
|
|
5054
5054
|
}
|
|
5055
|
-
function
|
|
5055
|
+
function Pl(a) {
|
|
5056
5056
|
a?.nodesMap?.clear?.(), a?.lods?.forEach?.((e) => {
|
|
5057
5057
|
e.glbs = [], e.instanceNodes = null, e.preparePromise = null, e.meshPromise = null, e.octreeBox = null;
|
|
5058
5058
|
}), a.group = null, a.modelEdge = null, a.modelMep = null, a.modelMapper = null, a.modelTree = null, a.quotaList = null, a.urls = [];
|
|
@@ -5068,7 +5068,7 @@ function Ti(a) {
|
|
|
5068
5068
|
const e = Be(a), t = e.lastIndexOf("/");
|
|
5069
5069
|
return t >= 0 ? e.slice(0, t) : "";
|
|
5070
5070
|
}
|
|
5071
|
-
function
|
|
5071
|
+
function Tl(a, e) {
|
|
5072
5072
|
try {
|
|
5073
5073
|
const t = new URL(a, window.location.origin);
|
|
5074
5074
|
return decodeURIComponent(It(t.pathname)) || `model-package-${e + 1}.zip`;
|
|
@@ -5076,17 +5076,17 @@ function Pl(a, e) {
|
|
|
5076
5076
|
return It(a.split("?")[0].split("#")[0]) || `model-package-${e + 1}.zip`;
|
|
5077
5077
|
}
|
|
5078
5078
|
}
|
|
5079
|
-
function
|
|
5079
|
+
function Il(a, e) {
|
|
5080
5080
|
return Be(a ? e ? `${a}/${e}` : a : e);
|
|
5081
5081
|
}
|
|
5082
5082
|
function Fn(a) {
|
|
5083
|
-
return
|
|
5083
|
+
return bl.test(a);
|
|
5084
5084
|
}
|
|
5085
|
-
function
|
|
5085
|
+
function Dl(a) {
|
|
5086
5086
|
return a.replace(/\.zip$/i, "").toLowerCase();
|
|
5087
5087
|
}
|
|
5088
|
-
function
|
|
5089
|
-
const e =
|
|
5088
|
+
function _l(a) {
|
|
5089
|
+
const e = xl.exec(a);
|
|
5090
5090
|
return e == null ? null : e[1].toLowerCase();
|
|
5091
5091
|
}
|
|
5092
5092
|
async function Hn(a) {
|
|
@@ -5097,7 +5097,7 @@ function Vn(a, e) {
|
|
|
5097
5097
|
let t = a.get(e);
|
|
5098
5098
|
return t == null && (t = /* @__PURE__ */ new Map(), a.set(e, t)), t;
|
|
5099
5099
|
}
|
|
5100
|
-
class
|
|
5100
|
+
class kl {
|
|
5101
5101
|
engine;
|
|
5102
5102
|
highlightMaterial;
|
|
5103
5103
|
translucentMaterial;
|
|
@@ -5151,7 +5151,7 @@ class _l {
|
|
|
5151
5151
|
return this.engine.models.forEach((o) => {
|
|
5152
5152
|
if (!(o?.nodesMap instanceof Map) || !o.url)
|
|
5153
5153
|
return;
|
|
5154
|
-
const r =
|
|
5154
|
+
const r = lt(this.engine, o.url);
|
|
5155
5155
|
o.nodesMap.forEach((l, c) => {
|
|
5156
5156
|
const h = String(l?.name ?? l?.info?.name ?? l?.infos?.[0]?.name ?? "");
|
|
5157
5157
|
if (!i.some((m) => h.includes(m)) || l?.pickBoxMesh instanceof G || l?.indexes?.some((m) => Le(this.engine, m?.[0]) instanceof W))
|
|
@@ -5369,7 +5369,7 @@ class _l {
|
|
|
5369
5369
|
const u = this.getSceneModel(h[0]);
|
|
5370
5370
|
u instanceof W ? o.has(h[0]) ? o.get(h[0])?.push(h[1]) : o.set(h[0], [h[1]]) : this.setSplitComponentState(u, h[1], 1, !0);
|
|
5371
5371
|
});
|
|
5372
|
-
}),
|
|
5372
|
+
}), Ll(o, this.engine);
|
|
5373
5373
|
let r = this.engine.engineStatus.highlightModels.find((l) => l.url == t.url);
|
|
5374
5374
|
r != null ? (Array.isArray(r.guids) || (r.guids = this.getModelGuids(i, r.ids)), n.forEach((l, c) => {
|
|
5375
5375
|
const h = r.ids.indexOf(l);
|
|
@@ -5423,7 +5423,7 @@ class _l {
|
|
|
5423
5423
|
const c = this.getSceneModel(l[0]);
|
|
5424
5424
|
c instanceof W ? n.has(l[0]) ? n.get(l[0])?.push(l[1]) : n.set(l[0], [l[1]]) : this.setSplitComponentState(c, l[1], -1, !1);
|
|
5425
5425
|
});
|
|
5426
|
-
}), n.size > 0 &&
|
|
5426
|
+
}), n.size > 0 && Bl(n, this.engine);
|
|
5427
5427
|
let s = this.engine.engineStatus.hideModels.find((o) => o.url == t.url);
|
|
5428
5428
|
s != null ? this.appendUniqueIds(s.ids, t.ids) : this.engine.engineStatus.hideModels.push({
|
|
5429
5429
|
url: t.url,
|
|
@@ -5772,7 +5772,7 @@ class _l {
|
|
|
5772
5772
|
const u = this.getSceneModel(h[0]);
|
|
5773
5773
|
u instanceof W ? o.has(h[0]) ? o.get(h[0])?.push(h[1]) : o.set(h[0], [h[1]]) : this.setSplitComponentState(u, h[1], 2, !0);
|
|
5774
5774
|
});
|
|
5775
|
-
}),
|
|
5775
|
+
}), Rl(o, this.engine, i);
|
|
5776
5776
|
let r = this.engine.engineStatus.translucentModels.find((l) => l.url == n.url);
|
|
5777
5777
|
r != null ? r.ids.push(...n.ids) : this.engine.engineStatus.translucentModels.push({
|
|
5778
5778
|
url: n.url,
|
|
@@ -5846,7 +5846,7 @@ class _l {
|
|
|
5846
5846
|
}
|
|
5847
5847
|
// ***************************************************** 设置模型颜色 ***************************************************** //
|
|
5848
5848
|
}
|
|
5849
|
-
function
|
|
5849
|
+
function Ll(a, e) {
|
|
5850
5850
|
a.forEach((t, i) => {
|
|
5851
5851
|
const n = qt(e, i);
|
|
5852
5852
|
if (!(n instanceof W))
|
|
@@ -5897,11 +5897,11 @@ function Un(a, e, t) {
|
|
|
5897
5897
|
e.scene.traverse((r) => {
|
|
5898
5898
|
r.key == n && r.name == t && o.push(r);
|
|
5899
5899
|
}), o.forEach((r) => {
|
|
5900
|
-
|
|
5900
|
+
Gs(r);
|
|
5901
5901
|
});
|
|
5902
5902
|
});
|
|
5903
5903
|
}
|
|
5904
|
-
function
|
|
5904
|
+
function Rl(a, e, t = 0.05) {
|
|
5905
5905
|
a.forEach((i, n) => {
|
|
5906
5906
|
const s = qt(e, n);
|
|
5907
5907
|
if (!(s instanceof W))
|
|
@@ -5928,12 +5928,12 @@ function Ll(a, e, t = 0.05) {
|
|
|
5928
5928
|
}), s.instanceMatrix.needsUpdate = !0, l.instanceMatrix.needsUpdate = !0, (s.parent ?? e.scene).add(l);
|
|
5929
5929
|
});
|
|
5930
5930
|
}
|
|
5931
|
-
function
|
|
5931
|
+
function Bl(a, e) {
|
|
5932
5932
|
const t = [];
|
|
5933
5933
|
e.scene.traverse((i) => {
|
|
5934
5934
|
i.name == "highlightModel" && t.push(i);
|
|
5935
5935
|
}), t.forEach((i) => {
|
|
5936
|
-
|
|
5936
|
+
Gs(i);
|
|
5937
5937
|
}), a.forEach((i, n) => {
|
|
5938
5938
|
const s = qt(e, n);
|
|
5939
5939
|
if (!(s instanceof W))
|
|
@@ -5968,7 +5968,7 @@ function Vt(a, e, t) {
|
|
|
5968
5968
|
function Ut(a, e) {
|
|
5969
5969
|
a?.cloneModel != null && (a.cloneModel.visible = e);
|
|
5970
5970
|
}
|
|
5971
|
-
function
|
|
5971
|
+
function Gs(a) {
|
|
5972
5972
|
if (a == null)
|
|
5973
5973
|
return;
|
|
5974
5974
|
const e = a.parent;
|
|
@@ -5978,22 +5978,22 @@ function qt(a, e) {
|
|
|
5978
5978
|
return Le(a, e);
|
|
5979
5979
|
}
|
|
5980
5980
|
const nn = 1.2;
|
|
5981
|
-
function
|
|
5981
|
+
function Ws(a) {
|
|
5982
5982
|
const e = Number(a?.options?.renderPixelRatio);
|
|
5983
5983
|
return Number.isFinite(e) ? Math.min(2, Math.max(0.5, e)) : a?.deviceModule?.isMobile?.() === !0 ? 1 : Math.min(Math.max(window.devicePixelRatio || 1, 1), 2);
|
|
5984
5984
|
}
|
|
5985
|
-
class
|
|
5985
|
+
class zl {
|
|
5986
5986
|
engine;
|
|
5987
5987
|
renderer;
|
|
5988
5988
|
watermark;
|
|
5989
5989
|
backgroundHdrTexture = null;
|
|
5990
5990
|
isDisposed = !1;
|
|
5991
5991
|
constructor(e) {
|
|
5992
|
-
this.engine = e, this.renderer = null, this.watermark = new
|
|
5992
|
+
this.engine = e, this.renderer = null, this.watermark = new vr(xs);
|
|
5993
5993
|
}
|
|
5994
5994
|
createRenderer() {
|
|
5995
5995
|
const { width: e, height: t } = this.engine.deviceModule.getContainerSize(), i = this.engine.deviceModule.isMobile(), n = this.engine.options?.forceWebGL === !0, s = this.engine.options?.backgroundColor, o = s == null || s === "transparent";
|
|
5996
|
-
return
|
|
5996
|
+
return Bo.enabled = !0, this.renderer = new zo({
|
|
5997
5997
|
// 质量等级允许运行时开关 TRAA,因此原生 MSAA 必须在 Renderer 创建时固定关闭。
|
|
5998
5998
|
antialias: !1,
|
|
5999
5999
|
// 后处理依赖场景通道的 Alpha 区分模型与背景,纯色背景也必须保留该通道。
|
|
@@ -6004,7 +6004,7 @@ class Bl {
|
|
|
6004
6004
|
reversedDepthBuffer: !0,
|
|
6005
6005
|
// 强制模式用于 WebGL2 对照测试;普通模式仍优先初始化 WebGPU。
|
|
6006
6006
|
forceWebGL: n
|
|
6007
|
-
}), this.renderer.setClearColor(0, 0), this.renderer.setPixelRatio(
|
|
6007
|
+
}), this.renderer.setClearColor(0, 0), this.renderer.setPixelRatio(Ws(this.engine)), this.renderer.setSize(e, t, !1), this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%", this.renderer.domElement.style.display = "block", this.renderer.domElement.style.backgroundColor = o ? "transparent" : new ce(s).getStyle(), this.renderer.shadowMap.enabled = !i, this.renderer.shadowMap.type = Oo, this.renderer.outputColorSpace = Ge, this.renderer.toneMapping = Qi, this.renderer.toneMappingExposure = nn, this.engine.container.appendChild(this.renderer.domElement), this.renderer;
|
|
6008
6008
|
}
|
|
6009
6009
|
/** WebGPU 设备初始化是异步的,初始化顺序之外保持与 v2 一致。 */
|
|
6010
6010
|
async initRenderer() {
|
|
@@ -6013,7 +6013,7 @@ class Bl {
|
|
|
6013
6013
|
const e = this.engine.options?.forceWebGL === !0, t = this.engine.options?.render?.allowWebGLFallback === !0;
|
|
6014
6014
|
if (!(typeof navigator < "u" && "gpu" in navigator) && !e && !t)
|
|
6015
6015
|
throw new Error("当前浏览器不支持 WebGPU,请启用 WebGPU 或设置 allowWebGLFallback。");
|
|
6016
|
-
if (await this.renderer.init(), this.renderer.coordinateSystem !==
|
|
6016
|
+
if (await this.renderer.init(), this.renderer.coordinateSystem !== No && !e && !t)
|
|
6017
6017
|
throw new Error("WebGPU 初始化失败,且当前配置不允许回退到 WebGL2。");
|
|
6018
6018
|
return this.renderer;
|
|
6019
6019
|
}
|
|
@@ -6029,7 +6029,7 @@ class Bl {
|
|
|
6029
6029
|
this.renderer && this.watermark.render(this.renderer);
|
|
6030
6030
|
}
|
|
6031
6031
|
}
|
|
6032
|
-
class
|
|
6032
|
+
class Ol {
|
|
6033
6033
|
engine;
|
|
6034
6034
|
scene;
|
|
6035
6035
|
constructor(e) {
|
|
@@ -6038,7 +6038,7 @@ class zl {
|
|
|
6038
6038
|
t.name = "groupEdge", this.scene.add(t);
|
|
6039
6039
|
}
|
|
6040
6040
|
}
|
|
6041
|
-
class
|
|
6041
|
+
class Nl {
|
|
6042
6042
|
engine;
|
|
6043
6043
|
continusIds = /* @__PURE__ */ new Map();
|
|
6044
6044
|
constructor(e) {
|
|
@@ -6097,7 +6097,7 @@ class Ol {
|
|
|
6097
6097
|
});
|
|
6098
6098
|
}
|
|
6099
6099
|
}
|
|
6100
|
-
class
|
|
6100
|
+
class Fl {
|
|
6101
6101
|
engine;
|
|
6102
6102
|
isFree;
|
|
6103
6103
|
// 是否是编辑模式
|
|
@@ -6139,10 +6139,10 @@ class Nl {
|
|
|
6139
6139
|
closeAllFunction = () => {
|
|
6140
6140
|
};
|
|
6141
6141
|
}
|
|
6142
|
-
function
|
|
6142
|
+
function Hl() {
|
|
6143
6143
|
return new kt();
|
|
6144
6144
|
}
|
|
6145
|
-
function
|
|
6145
|
+
function Vl(a, e) {
|
|
6146
6146
|
a.appendChild(e.domElement);
|
|
6147
6147
|
}
|
|
6148
6148
|
const et = {
|
|
@@ -6154,7 +6154,7 @@ const et = {
|
|
|
6154
6154
|
front: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAABp0lEQVR4nO3ZwWnDQBBA0XFwM9uA23FtbkcNqByngxCCzQb/985CzOEzaFeXmXkOWdeZmfM8d8/BBmut+do9BHsJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAogTQJwA4gQQJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAoi77h7gne73+xzH8bL33W63eTweL3vff2ADxAkgTgBxAogTQNxHnwJ+8olf9H9hA8QJIE4AcQKIE0CcAOIEECeAOAHEZW8Cj+OYtdavn//Um0MbIE4AcQKIE0CcAOKyp4CZmfM8d4+wnQ0QJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiLvMzNNv0aa1lg1QJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAogTQJwA4gQQJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxF1m5rl7CPb5Bhi1Gm3j3a/lAAAAAElFTkSuQmCC",
|
|
6155
6155
|
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"
|
|
6156
6156
|
};
|
|
6157
|
-
function
|
|
6157
|
+
function Ul(a) {
|
|
6158
6158
|
if (a?.isBox3) return a;
|
|
6159
6159
|
const e = a?.min, t = a?.max;
|
|
6160
6160
|
return [e?.x, e?.y, e?.z, t?.x, t?.y, t?.z].every(Number.isFinite) ? new B(
|
|
@@ -6170,7 +6170,7 @@ function Vl(a) {
|
|
|
6170
6170
|
)
|
|
6171
6171
|
) : null;
|
|
6172
6172
|
}
|
|
6173
|
-
function
|
|
6173
|
+
function ql(a, e, t) {
|
|
6174
6174
|
var i = new Object();
|
|
6175
6175
|
i.visible = !0;
|
|
6176
6176
|
let n = null, s = !1, o = 0, r, l, c = [];
|
|
@@ -6287,7 +6287,7 @@ function Ul(a, e, t) {
|
|
|
6287
6287
|
R || (E(!0), R = !0);
|
|
6288
6288
|
}, v + 10);
|
|
6289
6289
|
}, i.CameraGoHome = function(f = 1e3) {
|
|
6290
|
-
var v = a.viewCube?.getHomeBoundingBox?.(), E =
|
|
6290
|
+
var v = a.viewCube?.getHomeBoundingBox?.(), E = Ul(v === void 0 ? a.octreeBox.getBoundingBox() : v);
|
|
6291
6291
|
if (!E || E.isEmpty()) return;
|
|
6292
6292
|
g();
|
|
6293
6293
|
const P = new d(0, 1, 0);
|
|
@@ -6315,7 +6315,7 @@ function Ul(a, e, t) {
|
|
|
6315
6315
|
}, i.zoomToBox = function(f, v = 1e3) {
|
|
6316
6316
|
if (g(), e.camera.isOrthographicCamera) {
|
|
6317
6317
|
let an = function() {
|
|
6318
|
-
n = requestAnimationFrame(an),
|
|
6318
|
+
n = requestAnimationFrame(an), dt.update();
|
|
6319
6319
|
};
|
|
6320
6320
|
var E = f.min.clone().add(f.max.clone()).multiplyScalar(0.5), P = e.camera.position.clone().sub(a.controls.target.clone()).normalize(), D = e.camera.position.distanceTo(a.controls.target), _ = E.clone().add(P.multiplyScalar(D)), R = e.camera.zoom, V = new d(1, 0, 0).applyQuaternion(e.camera.quaternion), X = new d(0, 1, 0).applyQuaternion(e.camera.quaternion), M = [
|
|
6321
6321
|
new d(f.min.x, f.min.y, f.min.z),
|
|
@@ -6331,16 +6331,16 @@ function Ul(a, e, t) {
|
|
|
6331
6331
|
var fe = we.dot(V), De = we.dot(X);
|
|
6332
6332
|
S = Math.min(S, fe), T = Math.max(T, fe), N = Math.min(N, De), K = Math.max(K, De);
|
|
6333
6333
|
}
|
|
6334
|
-
var
|
|
6335
|
-
R = Math.min(He /
|
|
6336
|
-
var ye = e.camera.position.clone(), Ye = a.controls.target.clone(),
|
|
6334
|
+
var ct = (T - S) / 2, Ce = (K - N) / 2, He = (e.camera.right - e.camera.left) / 2, Ke = (e.camera.top - e.camera.bottom) / 2;
|
|
6335
|
+
R = Math.min(He / ct, Ke / Ce) * 0.75;
|
|
6336
|
+
var ye = e.camera.position.clone(), Ye = a.controls.target.clone(), ht = e.camera.zoom, dt = new it.Tween({
|
|
6337
6337
|
x1: ye.x,
|
|
6338
6338
|
y1: ye.y,
|
|
6339
6339
|
z1: ye.z,
|
|
6340
6340
|
x2: Ye.x,
|
|
6341
6341
|
y2: Ye.y,
|
|
6342
6342
|
z2: Ye.z,
|
|
6343
|
-
zoom:
|
|
6343
|
+
zoom: ht
|
|
6344
6344
|
}).to({
|
|
6345
6345
|
x1: _.x,
|
|
6346
6346
|
y1: _.y,
|
|
@@ -6350,19 +6350,19 @@ function Ul(a, e, t) {
|
|
|
6350
6350
|
z2: E.z,
|
|
6351
6351
|
zoom: R
|
|
6352
6352
|
}, v);
|
|
6353
|
-
|
|
6353
|
+
dt.onUpdate(function(Qe) {
|
|
6354
6354
|
a.controls && (e.camera.position.set(Qe.x1, Qe.y1, Qe.z1), a.controls.target.set(Qe.x2, Qe.y2, Qe.z2), e.camera.isOrthographicCamera && (e.camera.zoom = Qe.zoom, e.camera.updateProjectionMatrix()), a.controls.auto = !0, a.controls.update(), i.RenderScene());
|
|
6355
|
-
}),
|
|
6355
|
+
}), dt.onComplete(function() {
|
|
6356
6356
|
if (!a.controls) {
|
|
6357
6357
|
b();
|
|
6358
6358
|
return;
|
|
6359
6359
|
}
|
|
6360
6360
|
a.controls.auto = !1, i.RenderScene(), cancelAnimationFrame(n), n = null, b();
|
|
6361
|
-
}),
|
|
6361
|
+
}), dt.easing(it.Easing.Cubic.InOut), y(), dt.start(), an();
|
|
6362
6362
|
} else {
|
|
6363
6363
|
var E = f.min.clone().add(f.max.clone()).multiplyScalar(0.5);
|
|
6364
|
-
let
|
|
6365
|
-
var _ = E.clone().add(
|
|
6364
|
+
let ro = e.camera.position.clone().sub(a.controls.target.clone()).normalize();
|
|
6365
|
+
var _ = E.clone().add(ro.multiplyScalar(2 * f.max.distanceTo(f.min)));
|
|
6366
6366
|
z(e.camera.position, _, a.controls.target.clone(), E, null, null, v);
|
|
6367
6367
|
}
|
|
6368
6368
|
};
|
|
@@ -6475,7 +6475,7 @@ function Ul(a, e, t) {
|
|
|
6475
6475
|
}
|
|
6476
6476
|
}
|
|
6477
6477
|
function F() {
|
|
6478
|
-
i.sceneOrtho =
|
|
6478
|
+
i.sceneOrtho = Hl();
|
|
6479
6479
|
var E = t.clientWidth, P = t.clientWidth, f = E > P ? E / P : P / E, v = 300;
|
|
6480
6480
|
i.camera = new Ne(
|
|
6481
6481
|
v * f / -2,
|
|
@@ -6485,12 +6485,12 @@ function Ul(a, e, t) {
|
|
|
6485
6485
|
0.01,
|
|
6486
6486
|
1e4
|
|
6487
6487
|
);
|
|
6488
|
-
var E = r.clientWidth, P = r.clientHeight, D = new
|
|
6488
|
+
var E = r.clientWidth, P = r.clientHeight, D = new ws({
|
|
6489
6489
|
alpha: !0
|
|
6490
6490
|
});
|
|
6491
6491
|
D.setSize(E, P), D.setClearAlpha(0), i.sceneOrtho.renderer = D;
|
|
6492
6492
|
let _ = new Rt(16777215, 0.8);
|
|
6493
|
-
i.sceneOrtho.add(_),
|
|
6493
|
+
i.sceneOrtho.add(_), Vl(r, D), i.orbitControls = new Ts(a, i.camera, r), 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", $), i.orbitControls.addEventListener("change", Y), i.orbitControls.addEventListener("end", te);
|
|
6494
6494
|
}
|
|
6495
6495
|
let q = !1;
|
|
6496
6496
|
function $() {
|
|
@@ -6813,7 +6813,7 @@ function Ul(a, e, t) {
|
|
|
6813
6813
|
E?.dispose?.(), E?.forceContextLoss?.(), E?.domElement?.remove?.(), r?.remove?.(), c = [], i.orbitControls = null, i.camera = null, i.sceneOrtho = null, r = null, l = null;
|
|
6814
6814
|
}, i;
|
|
6815
6815
|
}
|
|
6816
|
-
class
|
|
6816
|
+
class Gl {
|
|
6817
6817
|
engine;
|
|
6818
6818
|
homeBoundingBoxProvider = null;
|
|
6819
6819
|
cubeTool;
|
|
@@ -6822,7 +6822,7 @@ class ql {
|
|
|
6822
6822
|
this.engine = e;
|
|
6823
6823
|
}
|
|
6824
6824
|
init() {
|
|
6825
|
-
this.cubeTool =
|
|
6825
|
+
this.cubeTool = ql(this.engine, this.engine.scene, this.engine.container), this.cubeTool.init();
|
|
6826
6826
|
}
|
|
6827
6827
|
// 隐藏视图立方体,供 showViewCube=false 的初始化配置调用。
|
|
6828
6828
|
hide() {
|
|
@@ -6949,7 +6949,7 @@ class ql {
|
|
|
6949
6949
|
this.cubeTool.TakeScreenshot();
|
|
6950
6950
|
}
|
|
6951
6951
|
}
|
|
6952
|
-
function
|
|
6952
|
+
function Wl(a) {
|
|
6953
6953
|
let e = new Object(), t = null;
|
|
6954
6954
|
return e.getBoundingBox = function() {
|
|
6955
6955
|
let i = a.models, n = new d(1e8, 1e9, 1e10), s = new d(-1e8, -1e9, -1e10);
|
|
@@ -7007,12 +7007,12 @@ function Gl(a) {
|
|
|
7007
7007
|
});
|
|
7008
7008
|
});
|
|
7009
7009
|
const m = l.map((f) => F(f)).filter((f) => f instanceof G);
|
|
7010
|
-
|
|
7010
|
+
ba(i);
|
|
7011
7011
|
const w = [
|
|
7012
7012
|
...x,
|
|
7013
7013
|
...i.intersectObjects(m, !1).map(te)
|
|
7014
7014
|
].sort((f, v) => f.distance - v.distance);
|
|
7015
|
-
return
|
|
7015
|
+
return xa(i), w;
|
|
7016
7016
|
function C(f, v, E, P, D) {
|
|
7017
7017
|
if (v == null)
|
|
7018
7018
|
return;
|
|
@@ -7175,7 +7175,7 @@ function Gl(a) {
|
|
|
7175
7175
|
}
|
|
7176
7176
|
}, e;
|
|
7177
7177
|
}
|
|
7178
|
-
class
|
|
7178
|
+
class jl {
|
|
7179
7179
|
engine;
|
|
7180
7180
|
// 扩展属性
|
|
7181
7181
|
extended = /* @__PURE__ */ new Map();
|
|
@@ -7301,7 +7301,7 @@ class Wl {
|
|
|
7301
7301
|
}
|
|
7302
7302
|
}
|
|
7303
7303
|
}
|
|
7304
|
-
class
|
|
7304
|
+
class Kl {
|
|
7305
7305
|
engine;
|
|
7306
7306
|
codeMap = [];
|
|
7307
7307
|
continusIds = /* @__PURE__ */ new Map();
|
|
@@ -7397,7 +7397,7 @@ const Gn = {
|
|
|
7397
7397
|
gtao: "Ground Truth Ambient Occlusion",
|
|
7398
7398
|
ssr: "Screen Space Reflections",
|
|
7399
7399
|
traa: "Temporal Reprojection Anti-Aliasing"
|
|
7400
|
-
},
|
|
7400
|
+
}, Yl = {
|
|
7401
7401
|
enabled: "Enabled",
|
|
7402
7402
|
resolution: "Resolution",
|
|
7403
7403
|
resolutionScale: "Resolution Scale",
|
|
@@ -7447,7 +7447,7 @@ const Gn = {
|
|
|
7447
7447
|
distanceFallOff: "Distance Falloff",
|
|
7448
7448
|
scale: "Scale"
|
|
7449
7449
|
};
|
|
7450
|
-
class
|
|
7450
|
+
class Ql {
|
|
7451
7451
|
constructor(e, t) {
|
|
7452
7452
|
this.engine = e, this.host = t;
|
|
7453
7453
|
}
|
|
@@ -7632,7 +7632,7 @@ class Yl {
|
|
|
7632
7632
|
this.host.resetQualityPreset(this.editingLevel), this.host.resetBloomSettings(), this.host.resetLightingPresets(), this.loadDrafts();
|
|
7633
7633
|
}
|
|
7634
7634
|
appendParameterControl(e, t, i, n) {
|
|
7635
|
-
const s =
|
|
7635
|
+
const s = Yl[t] ?? t;
|
|
7636
7636
|
typeof i == "number" ? e.appendChild(this.createNumberRow(s, i, 0, this.getParameterMax(t, i), this.getParameterStep(i), n)) : typeof i == "boolean" && e.appendChild(this.createCheckboxRow(s, i, n));
|
|
7637
7637
|
}
|
|
7638
7638
|
createSection(e) {
|
|
@@ -7679,20 +7679,27 @@ class Yl {
|
|
|
7679
7679
|
return e === "resolution" || e === "maxVelocityLength" ? 512 : e.includes("Count") || e === "samples" || e === "blurQuality" ? 64 : e.toLowerCase().includes("intensity") ? 10 : Math.max(10, Math.ceil(Math.abs(t) * 4));
|
|
7680
7680
|
}
|
|
7681
7681
|
}
|
|
7682
|
-
|
|
7682
|
+
const Wn = {
|
|
7683
|
+
simple: 1,
|
|
7684
|
+
balance: 5,
|
|
7685
|
+
advanced: 8
|
|
7686
|
+
};
|
|
7687
|
+
function nt(a) {
|
|
7688
|
+
if (typeof a == "string" && Object.prototype.hasOwnProperty.call(Wn, a))
|
|
7689
|
+
return Wn[a];
|
|
7683
7690
|
const e = typeof a == "number" ? a : Number(a), t = Number.isFinite(e) ? Math.round(e) : 6;
|
|
7684
7691
|
return Math.min(12, Math.max(1, t));
|
|
7685
7692
|
}
|
|
7686
|
-
const
|
|
7687
|
-
class
|
|
7693
|
+
const js = 8, Xl = 0.5, $l = 2;
|
|
7694
|
+
class Jl {
|
|
7688
7695
|
constructor(e) {
|
|
7689
7696
|
this.engine = e, yn.forEach((t) => {
|
|
7690
7697
|
this.presets.set(t.level, Wt(t));
|
|
7691
7698
|
}), vn.forEach((t) => {
|
|
7692
7699
|
this.lightingPresets.set(t.id, { ...t });
|
|
7693
|
-
}), this.currentLevel =
|
|
7694
|
-
e.options?.renderQualityLevel ??
|
|
7695
|
-
), this.pixelRatio = this.normalizePixelRatio(e.renderer?.getPixelRatio?.() ?? 1), this.panel = new
|
|
7700
|
+
}), this.currentLevel = nt(
|
|
7701
|
+
e.options?.renderQualityLevel ?? js
|
|
7702
|
+
), this.pixelRatio = this.normalizePixelRatio(e.renderer?.getPixelRatio?.() ?? 1), this.panel = new Ql(e, this);
|
|
7696
7703
|
}
|
|
7697
7704
|
engine;
|
|
7698
7705
|
presets = /* @__PURE__ */ new Map();
|
|
@@ -7706,29 +7713,33 @@ class $l {
|
|
|
7706
7713
|
init() {
|
|
7707
7714
|
this.applyQualityPreset(this.getQualityPreset(this.currentLevel)), this.engine.options?.renderQualityUI !== !1 && this.panel.init(), this.engine.updateVersionDisplay?.();
|
|
7708
7715
|
}
|
|
7709
|
-
/** 手动切换 1 至 12
|
|
7716
|
+
/** 手动切换 1 至 12 级渲染质量,同时接受 v2 三档模式名称。 */
|
|
7710
7717
|
setQualityLevel(e) {
|
|
7711
|
-
const t =
|
|
7718
|
+
const t = nt(e), i = this.getQualityPreset(t);
|
|
7712
7719
|
this.applyQualityPreset(i), this.currentLevel = t, this.panel.refresh(), this.engine.updateVersionDisplay?.();
|
|
7713
7720
|
}
|
|
7714
7721
|
/** 返回当前数字渲染等级。 */
|
|
7715
7722
|
getQualityLevel() {
|
|
7716
7723
|
return this.currentLevel;
|
|
7717
7724
|
}
|
|
7725
|
+
/** 兼容 v2 的三档模式 API,并映射到 v3 的 1、5、8 级。 */
|
|
7726
|
+
switchModel(e) {
|
|
7727
|
+
this.setQualityLevel(e);
|
|
7728
|
+
}
|
|
7718
7729
|
/** 返回指定等级的深拷贝,调用方可以安全地编辑草稿。 */
|
|
7719
7730
|
getQualityPreset(e) {
|
|
7720
|
-
const t =
|
|
7731
|
+
const t = nt(e), i = this.presets.get(t);
|
|
7721
7732
|
if (!i) throw new Error(`[EngineModelModule] 渲染等级 ${t} 不存在`);
|
|
7722
7733
|
return Wt(i);
|
|
7723
7734
|
}
|
|
7724
7735
|
/** 保存指定等级的完整参数,并按需立即应用。 */
|
|
7725
7736
|
updateQualityPreset(e, t, i = !1) {
|
|
7726
|
-
const n =
|
|
7737
|
+
const n = nt(e), s = Wt({ ...t, level: n });
|
|
7727
7738
|
this.presets.set(n, s), i && n === this.currentLevel && this.applyQualityPreset(s), this.panel.refresh();
|
|
7728
7739
|
}
|
|
7729
7740
|
/** 恢复指定等级的内置参数。 */
|
|
7730
7741
|
resetQualityPreset(e) {
|
|
7731
|
-
const t =
|
|
7742
|
+
const t = nt(e), i = yn.find((n) => n.level === t);
|
|
7732
7743
|
i && (this.presets.set(t, Wt(i)), t === this.currentLevel && this.applyQualityPreset(i));
|
|
7733
7744
|
}
|
|
7734
7745
|
/** 设置独立于质量等级的渲染像素比。 */
|
|
@@ -7788,7 +7799,7 @@ class $l {
|
|
|
7788
7799
|
if (!t) throw new Error(`[EngineModelModule] 光环境预设 ${e} 不存在`);
|
|
7789
7800
|
const i = ++this.lightingApplyVersion;
|
|
7790
7801
|
this.engine.skyManager?.close?.(!0), await this.engine.hdr?.setHdr?.(t.hdrId), i === this.lightingApplyVersion && (this.engine.hdr?.setIntensity?.(t.hdrIntensity), this.engine.scene?.children?.forEach((n) => {
|
|
7791
|
-
n instanceof Rt && (n.intensity = t.ambientIntensity), n instanceof
|
|
7802
|
+
n instanceof Rt && (n.intensity = t.ambientIntensity), n instanceof ot && (n.intensity = t.directionalIntensity);
|
|
7792
7803
|
}), this.lightingPresetId = t.id, this.engine.requestShadowUpdate?.(), this.engine.requestComposerRender?.(), this.panel.refresh());
|
|
7793
7804
|
}
|
|
7794
7805
|
/** 返回 UI 和外部调用方需要的当前状态副本。 */
|
|
@@ -7830,19 +7841,19 @@ class $l {
|
|
|
7830
7841
|
}
|
|
7831
7842
|
applyShadowPreset(e, t) {
|
|
7832
7843
|
this.engine.renderer?.shadowMap && (this.engine.renderer.shadowMap.enabled = e), this.engine.scene?.children?.forEach((i) => {
|
|
7833
|
-
i instanceof
|
|
7844
|
+
i instanceof ot && (i.castShadow = e, (i.shadow.mapSize.width !== t || i.shadow.mapSize.height !== t) && (i.shadow.mapSize.set(t, t), i.shadow.map?.dispose?.(), i.shadow.map = null), i.shadow.needsUpdate = e);
|
|
7834
7845
|
}), this.engine.lightModule?.updateDirectionalShadowView?.(this.engine.camera, !0);
|
|
7835
7846
|
}
|
|
7836
7847
|
normalizePixelRatio(e) {
|
|
7837
7848
|
const t = Number.isFinite(e) ? e : 1;
|
|
7838
|
-
return Math.min(
|
|
7849
|
+
return Math.min($l, Math.max(Xl, t));
|
|
7839
7850
|
}
|
|
7840
7851
|
normalizeIntensity(e, t) {
|
|
7841
7852
|
const i = Number.isFinite(e) ? e : 0;
|
|
7842
7853
|
return Math.min(t, Math.max(0, i));
|
|
7843
7854
|
}
|
|
7844
7855
|
}
|
|
7845
|
-
class
|
|
7856
|
+
class Zl {
|
|
7846
7857
|
engine;
|
|
7847
7858
|
// 绘制状态
|
|
7848
7859
|
isDrawing = !1;
|
|
@@ -8020,8 +8031,8 @@ class Jl {
|
|
|
8020
8031
|
this.disActive(), this.selectionBox?.remove(), this.selectionBox = null, this.worldToScreen = null, this.isDrawing = !1;
|
|
8021
8032
|
}
|
|
8022
8033
|
}
|
|
8023
|
-
const
|
|
8024
|
-
class
|
|
8034
|
+
const ec = O.degToRad(10), jn = 1e-3, Vi = !1, tc = [];
|
|
8035
|
+
class ic {
|
|
8025
8036
|
engine;
|
|
8026
8037
|
rootGroup = null;
|
|
8027
8038
|
isVisible = Vi;
|
|
@@ -8035,7 +8046,7 @@ class tc {
|
|
|
8035
8046
|
}
|
|
8036
8047
|
setMockData() {
|
|
8037
8048
|
const e = this.engine.models?.[0]?.grids;
|
|
8038
|
-
this.setData(Array.isArray(e) && e.length > 0 ? e :
|
|
8049
|
+
this.setData(Array.isArray(e) && e.length > 0 ? e : tc);
|
|
8039
8050
|
}
|
|
8040
8051
|
show() {
|
|
8041
8052
|
this.isVisible = !0, this.rootGroup && (this.rootGroup.visible = !0);
|
|
@@ -8110,10 +8121,10 @@ class tc {
|
|
|
8110
8121
|
return;
|
|
8111
8122
|
const t = this.coordinateMapper(e.data.Points[0]), i = this.coordinateMapper(e.data.Points[1]), n = new Pe();
|
|
8112
8123
|
n.name = `GridAxis_${e.data.Id}`;
|
|
8113
|
-
const s = new de().setFromPoints([t, i]), o = new
|
|
8124
|
+
const s = new de().setFromPoints([t, i]), o = new rt({
|
|
8114
8125
|
color: 1609983,
|
|
8115
8126
|
depthTest: !1
|
|
8116
|
-
}), r = new
|
|
8127
|
+
}), r = new Cs(s, o);
|
|
8117
8128
|
r.renderOrder = 998, n.add(r), n.add(this._makeCircleSprite(e.data.Name, t)), n.add(this._makeCircleSprite(e.data.Name, i)), this.rootGroup.add(n), e.group = n;
|
|
8118
8129
|
}
|
|
8119
8130
|
_makeCircleSprite(e, t) {
|
|
@@ -8124,7 +8135,7 @@ class tc {
|
|
|
8124
8135
|
throw new Error("Grid sprite canvas context is not available");
|
|
8125
8136
|
const o = 128 / 2, r = 128 / 2, l = 128 / 2 - 4;
|
|
8126
8137
|
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);
|
|
8127
|
-
const c = new
|
|
8138
|
+
const c = new Fo(n), h = new Ho({
|
|
8128
8139
|
map: c,
|
|
8129
8140
|
depthTest: !1,
|
|
8130
8141
|
transparent: !0
|
|
@@ -8174,7 +8185,7 @@ class tc {
|
|
|
8174
8185
|
const n = this.createProjection(i);
|
|
8175
8186
|
if (!n)
|
|
8176
8187
|
return;
|
|
8177
|
-
const s = t.find((o) => o.direction.angleTo(n.direction) <=
|
|
8188
|
+
const s = t.find((o) => o.direction.angleTo(n.direction) <= ec);
|
|
8178
8189
|
if (s) {
|
|
8179
8190
|
s.axes.push(n);
|
|
8180
8191
|
return;
|
|
@@ -8204,13 +8215,13 @@ class tc {
|
|
|
8204
8215
|
}
|
|
8205
8216
|
normalizeDirection(e) {
|
|
8206
8217
|
const t = e.clone().normalize();
|
|
8207
|
-
return (t.x < 0 || Math.abs(t.x) <=
|
|
8218
|
+
return (t.x < 0 || Math.abs(t.x) <= jn && t.y < 0) && t.multiplyScalar(-1), t;
|
|
8208
8219
|
}
|
|
8209
8220
|
/**
|
|
8210
8221
|
* 在单个轴族内优先返回点位所属的最近轴网区间,避免落在线上时出现空描述。
|
|
8211
8222
|
*/
|
|
8212
8223
|
resolveFamilyLocation(e, t) {
|
|
8213
|
-
const i = t.dot(e.normal), n = e.axes.find((c) => Math.abs(c.offset - i) <=
|
|
8224
|
+
const i = t.dot(e.normal), n = e.axes.find((c) => Math.abs(c.offset - i) <= jn) ?? null;
|
|
8214
8225
|
if (n) {
|
|
8215
8226
|
const c = e.axes.findIndex((u) => u.data.Id === n.data.Id), h = this.pickAxisPairAroundIndex(e.axes, c);
|
|
8216
8227
|
return {
|
|
@@ -8309,17 +8320,17 @@ class tc {
|
|
|
8309
8320
|
return e instanceof d ? e.clone() : new d(e.x, e.y, e.z);
|
|
8310
8321
|
}
|
|
8311
8322
|
}
|
|
8312
|
-
const
|
|
8323
|
+
const Ks = "0", Ys = 0, Qs = !0, nc = "animated-water-surface";
|
|
8313
8324
|
class sn {
|
|
8314
8325
|
engine;
|
|
8315
|
-
currentId =
|
|
8326
|
+
currentId = Ks;
|
|
8316
8327
|
groundGroup;
|
|
8317
8328
|
groundMesh = null;
|
|
8318
8329
|
/** 当前为官方 Water 水面时为 true,用于 update/dispose 分支 */
|
|
8319
8330
|
isWaterAddon = !1;
|
|
8320
8331
|
/** 未显式配置太阳方向时,使水面高光跟随场景主定向光。 */
|
|
8321
8332
|
syncWaterSunDirection = !1;
|
|
8322
|
-
groundY =
|
|
8333
|
+
groundY = Ys;
|
|
8323
8334
|
lightWorldPosition = new d();
|
|
8324
8335
|
lightTargetWorldPosition = new d();
|
|
8325
8336
|
/** 官网案例使用的水面法线贴图。 */
|
|
@@ -8348,7 +8359,7 @@ class sn {
|
|
|
8348
8359
|
this.engine = e, this.groundGroup = new Pe(), this.groundGroup.name = "groundGroup";
|
|
8349
8360
|
}
|
|
8350
8361
|
init() {
|
|
8351
|
-
this.engine.scene.add(this.groundGroup), this.groundGroup.visible =
|
|
8362
|
+
this.engine.scene.add(this.groundGroup), this.groundGroup.visible = Qs;
|
|
8352
8363
|
}
|
|
8353
8364
|
/**
|
|
8354
8365
|
* 切换地面类型
|
|
@@ -8362,7 +8373,7 @@ class sn {
|
|
|
8362
8373
|
if (i.water) {
|
|
8363
8374
|
const s = new Bi(n, n), o = t?.waterNormalsUrl ?? Z(sn.DEFAULT_WATER_NORMALS, import.meta.url), r = new bt().load(o, (g) => {
|
|
8364
8375
|
g.wrapS = g.wrapT = ci;
|
|
8365
|
-
}), l = t?.sunDirection?.clone().normalize() ?? this.getSceneSunDirection().clone(), c = t?.waterSize ?? i.size ?? 1, h = t?.distortionScale ?? i.distortionScale ?? 3.7, u = O.clamp(t?.opacity ?? 0.92, 0, 1), p = new
|
|
8376
|
+
}), l = t?.sunDirection?.clone().normalize() ?? this.getSceneSunDirection().clone(), c = t?.waterSize ?? i.size ?? 1, h = t?.distortionScale ?? i.distortionScale ?? 3.7, u = O.clamp(t?.opacity ?? 0.92, 0, 1), p = new Vo(s, {
|
|
8366
8377
|
resolutionScale: O.clamp(t?.resolutionScale ?? 0.5, 0.1, 1),
|
|
8367
8378
|
waterNormals: r,
|
|
8368
8379
|
alpha: u,
|
|
@@ -8376,7 +8387,7 @@ class sn {
|
|
|
8376
8387
|
} else {
|
|
8377
8388
|
const s = new Bi(n, n, 1, 1);
|
|
8378
8389
|
s.rotateX(-Math.PI / 2);
|
|
8379
|
-
const o = new
|
|
8390
|
+
const o = new ys({
|
|
8380
8391
|
color: i.color,
|
|
8381
8392
|
roughness: i.roughness,
|
|
8382
8393
|
metalness: i.metalness
|
|
@@ -8410,7 +8421,7 @@ class sn {
|
|
|
8410
8421
|
update() {
|
|
8411
8422
|
if (!this.groundMesh || !this.isWaterAddon || !this.syncWaterSunDirection) return;
|
|
8412
8423
|
const e = this.groundMesh;
|
|
8413
|
-
this.engine.scene?.dirLight instanceof
|
|
8424
|
+
this.engine.scene?.dirLight instanceof ot && e.sunDirection.value.copy(this.getSceneSunDirection());
|
|
8414
8425
|
}
|
|
8415
8426
|
/** 获取地面列表(id + 名称) */
|
|
8416
8427
|
getGroundList() {
|
|
@@ -8441,21 +8452,21 @@ class sn {
|
|
|
8441
8452
|
/** 计算从定向光目标指向光源的单位向量,作为水面的太阳方向。 */
|
|
8442
8453
|
getSceneSunDirection() {
|
|
8443
8454
|
const e = this.engine.scene?.dirLight;
|
|
8444
|
-
return e instanceof
|
|
8455
|
+
return e instanceof ot ? (e.getWorldPosition(this.lightWorldPosition), e.target.getWorldPosition(this.lightTargetWorldPosition), this.lightWorldPosition.sub(this.lightTargetWorldPosition).normalize()) : this.lightWorldPosition.set(0.5, 0.8, 0.5).normalize();
|
|
8445
8456
|
}
|
|
8446
8457
|
/** 水面可见时关闭空闲限帧,保证 TSL 时间节点持续产生平滑波纹。 */
|
|
8447
8458
|
updateWaterFrameRateExemption() {
|
|
8448
8459
|
this.engine.setIdleFrameRateExempt?.(
|
|
8449
|
-
|
|
8460
|
+
nc,
|
|
8450
8461
|
this.isWaterAddon && this.groundGroup.visible
|
|
8451
8462
|
);
|
|
8452
8463
|
}
|
|
8453
8464
|
}
|
|
8454
|
-
const qe = "0",
|
|
8455
|
-
class
|
|
8465
|
+
const qe = "0", sc = !0, Ui = 0.2, qi = 1, oc = 0.35;
|
|
8466
|
+
class rc {
|
|
8456
8467
|
engine;
|
|
8457
8468
|
currentHdrId = qe;
|
|
8458
|
-
isVisible =
|
|
8469
|
+
isVisible = sc;
|
|
8459
8470
|
currentIntensity = Ui;
|
|
8460
8471
|
currentBackgroundIntensity = qi;
|
|
8461
8472
|
currentTexture = null;
|
|
@@ -8466,7 +8477,7 @@ class oc {
|
|
|
8466
8477
|
previousBackgroundIntensity = 1;
|
|
8467
8478
|
previousEnvironmentIntensity = 1;
|
|
8468
8479
|
previousAmbientLightIntensity = 1;
|
|
8469
|
-
previousToneMapping =
|
|
8480
|
+
previousToneMapping = st;
|
|
8470
8481
|
previousToneMappingExposure = 1;
|
|
8471
8482
|
hdrList = [
|
|
8472
8483
|
{ id: "0", names: ["无", "無", "None"] },
|
|
@@ -8548,10 +8559,10 @@ class oc {
|
|
|
8548
8559
|
_loadHdr(e) {
|
|
8549
8560
|
const t = Z(e, import.meta.url);
|
|
8550
8561
|
return new Promise((i, n) => {
|
|
8551
|
-
new
|
|
8562
|
+
new Uo().load(
|
|
8552
8563
|
t,
|
|
8553
8564
|
(s) => {
|
|
8554
|
-
s.mapping =
|
|
8565
|
+
s.mapping = qo, i(s);
|
|
8555
8566
|
},
|
|
8556
8567
|
void 0,
|
|
8557
8568
|
(s) => n(s)
|
|
@@ -8561,14 +8572,14 @@ class oc {
|
|
|
8561
8572
|
_applyTexture(e) {
|
|
8562
8573
|
if (this.currentTexture = e, !this.engine.scene || !this.engine.renderer) return;
|
|
8563
8574
|
this._captureSceneState(), this.currentEnvironmentTexture?.dispose();
|
|
8564
|
-
const t = new
|
|
8575
|
+
const t = new Es(this.engine.renderer), i = t.fromEquirectangular(e).texture;
|
|
8565
8576
|
t.dispose(), this.currentEnvironmentTexture = i, this.engine.scene.background = this.isVisible ? e : this.previousBackground, this.engine.scene.backgroundIntensity = this.isVisible ? this.currentBackgroundIntensity : this.previousBackgroundIntensity, this.engine.scene.environment = i, this.engine.scene.environmentIntensity = this.currentIntensity, this.engine.renderer.toneMapping = Qi, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure > 0 ? this.previousToneMappingExposure : nn, this._setAmbientLightIntensity(this._getHdrAmbientLightIntensity()), this.engine.composerModule?.rebuild?.();
|
|
8566
8577
|
}
|
|
8567
8578
|
_captureSceneState() {
|
|
8568
|
-
this.currentHdrId !== qe || !this.engine.scene || (this.previousBackground = this.engine.scene.background, this.previousEnvironment = this.engine.scene.environment, this.previousBackgroundIntensity = this.engine.scene.backgroundIntensity ?? 1, this.previousEnvironmentIntensity = this.engine.scene.environmentIntensity ?? 1, this.previousAmbientLightIntensity = this._getAmbientLightIntensity(), this.previousToneMapping = this.engine.renderer?.toneMapping ??
|
|
8579
|
+
this.currentHdrId !== qe || !this.engine.scene || (this.previousBackground = this.engine.scene.background, this.previousEnvironment = this.engine.scene.environment, this.previousBackgroundIntensity = this.engine.scene.backgroundIntensity ?? 1, this.previousEnvironmentIntensity = this.engine.scene.environmentIntensity ?? 1, this.previousAmbientLightIntensity = this._getAmbientLightIntensity(), this.previousToneMapping = this.engine.renderer?.toneMapping ?? st, this.previousToneMappingExposure = this.engine.renderer?.toneMappingExposure ?? 1);
|
|
8569
8580
|
}
|
|
8570
8581
|
_clearHdr() {
|
|
8571
|
-
this.currentTexture = null, this.engine.scene && (this.currentEnvironmentTexture?.dispose(), this.currentEnvironmentTexture = null, this.engine.scene.background = this.previousBackground, this.engine.scene.environment = this.previousEnvironment, this.engine.scene.backgroundIntensity = this.previousBackgroundIntensity, this.engine.scene.environmentIntensity = this.previousEnvironmentIntensity, this._setAmbientLightIntensity(this.previousAmbientLightIntensity), this.engine.renderer && (this.engine.renderer.toneMapping = this.previousToneMapping, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure), this.previousBackground = null, this.previousEnvironment = null, this.previousBackgroundIntensity = 1, this.previousEnvironmentIntensity = 1, this.previousAmbientLightIntensity = 1, this.previousToneMapping =
|
|
8582
|
+
this.currentTexture = null, this.engine.scene && (this.currentEnvironmentTexture?.dispose(), this.currentEnvironmentTexture = null, this.engine.scene.background = this.previousBackground, this.engine.scene.environment = this.previousEnvironment, this.engine.scene.backgroundIntensity = this.previousBackgroundIntensity, this.engine.scene.environmentIntensity = this.previousEnvironmentIntensity, this._setAmbientLightIntensity(this.previousAmbientLightIntensity), this.engine.renderer && (this.engine.renderer.toneMapping = this.previousToneMapping, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure), this.previousBackground = null, this.previousEnvironment = null, this.previousBackgroundIntensity = 1, this.previousEnvironmentIntensity = 1, this.previousAmbientLightIntensity = 1, this.previousToneMapping = st, this.previousToneMappingExposure = 1);
|
|
8572
8583
|
}
|
|
8573
8584
|
_getAmbientLightIntensity() {
|
|
8574
8585
|
return this.engine.scene?.children.find(
|
|
@@ -8582,20 +8593,20 @@ class oc {
|
|
|
8582
8593
|
t && (t.intensity = e);
|
|
8583
8594
|
}
|
|
8584
8595
|
_getHdrAmbientLightIntensity() {
|
|
8585
|
-
return Math.max(this.previousAmbientLightIntensity *
|
|
8596
|
+
return Math.max(this.previousAmbientLightIntensity * oc, 0);
|
|
8586
8597
|
}
|
|
8587
8598
|
_requestRender() {
|
|
8588
8599
|
this.engine?.requestComposerRender?.();
|
|
8589
8600
|
}
|
|
8590
8601
|
}
|
|
8591
|
-
const
|
|
8602
|
+
const ac = 1e-3, Xs = !1, lc = [
|
|
8592
8603
|
{ Id: "339", Name: "L1", Elevation: -0.32808398950131235 },
|
|
8593
8604
|
{ Id: "2787", Name: "L2", Elevation: 16.896325459317584 },
|
|
8594
8605
|
{ Id: "236633", Name: "L3", Elevation: 36.745406824146976 }
|
|
8595
8606
|
];
|
|
8596
|
-
class
|
|
8607
|
+
class cc {
|
|
8597
8608
|
engine;
|
|
8598
|
-
isVisible =
|
|
8609
|
+
isVisible = Xs;
|
|
8599
8610
|
levels = [];
|
|
8600
8611
|
svgContainer = null;
|
|
8601
8612
|
svgOverlay = null;
|
|
@@ -8613,7 +8624,7 @@ class lc {
|
|
|
8613
8624
|
}
|
|
8614
8625
|
setMockData() {
|
|
8615
8626
|
const e = this.engine.models?.[0]?.levels, t = this.engine.models?.[0]?.boundingBox;
|
|
8616
|
-
this.setData(Array.isArray(e) && e.length > 0 ? e :
|
|
8627
|
+
this.setData(Array.isArray(e) && e.length > 0 ? e : lc, t);
|
|
8617
8628
|
}
|
|
8618
8629
|
show() {
|
|
8619
8630
|
this.isVisible = !0, this.svgContainer && (this.svgContainer.style.display = "block"), this.levels.forEach((e) => {
|
|
@@ -8646,7 +8657,7 @@ class lc {
|
|
|
8646
8657
|
const { url: i, targetPoint: n } = this.resolvePointLookupArgs(e, t), s = this.getLevelData(i).slice().sort((g, y) => g.Elevation - y.Elevation);
|
|
8647
8658
|
if (s.length === 0)
|
|
8648
8659
|
return null;
|
|
8649
|
-
const o = (n instanceof d, n.y), r = s.find((g) => Math.abs(g.Elevation - o) <=
|
|
8660
|
+
const o = (n instanceof d, n.y), r = s.find((g) => Math.abs(g.Elevation - o) <= ac) ?? null;
|
|
8650
8661
|
if (r)
|
|
8651
8662
|
return {
|
|
8652
8663
|
pointY: o,
|
|
@@ -8718,12 +8729,12 @@ class lc {
|
|
|
8718
8729
|
new d(this.halfSize, s, this.halfSize),
|
|
8719
8730
|
new d(-this.halfSize, s, this.halfSize),
|
|
8720
8731
|
new d(-this.halfSize, s, -this.halfSize)
|
|
8721
|
-
], u = new de().setFromPoints(h), p = new
|
|
8732
|
+
], u = new de().setFromPoints(h), p = new rt({
|
|
8722
8733
|
color: this.COLOR,
|
|
8723
8734
|
transparent: !0,
|
|
8724
8735
|
opacity: 0.7
|
|
8725
8736
|
});
|
|
8726
|
-
if (o.add(new
|
|
8737
|
+
if (o.add(new Cs(u, p)), o.visible = this.isVisible, this.engine.scene.add(o), e.group = o, this.svgOverlay) {
|
|
8727
8738
|
const g = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
8728
8739
|
g.dataset.levelId = e.data.Id;
|
|
8729
8740
|
for (let y = 0; y < 4; y += 1)
|
|
@@ -8820,33 +8831,33 @@ class lc {
|
|
|
8820
8831
|
};
|
|
8821
8832
|
}
|
|
8822
8833
|
}
|
|
8823
|
-
const oi = !0, Gi = 0.1,
|
|
8824
|
-
function
|
|
8834
|
+
const oi = !0, Gi = 0.1, hc = 32, dc = 0.05, uc = 0.5, pc = 1.5, gc = 0.01;
|
|
8835
|
+
function mc(a) {
|
|
8825
8836
|
return !a?.min || !a?.max ? 0 : a.min.distanceTo(a.max);
|
|
8826
8837
|
}
|
|
8827
|
-
function
|
|
8838
|
+
function fc(a, e) {
|
|
8828
8839
|
return a instanceof d ? a.clone() : e?.min && e?.max ? e.min.clone().add(e.max).multiplyScalar(0.5) : new d();
|
|
8829
8840
|
}
|
|
8830
|
-
function
|
|
8841
|
+
function yc(a, e, t) {
|
|
8831
8842
|
if (a instanceof Ne)
|
|
8832
8843
|
return Math.max((a.top - a.bottom) / Math.max(a.zoom, 1e-6), 1);
|
|
8833
|
-
const i = a, n =
|
|
8844
|
+
const i = a, n = fc(e, t), s = i.position.distanceTo(n), o = typeof i.getEffectiveFOV == "function" ? i.getEffectiveFOV() : i.fov, r = O.degToRad(o * 0.5);
|
|
8834
8845
|
return Math.max(2 * s * Math.tan(r), 1);
|
|
8835
8846
|
}
|
|
8836
|
-
function
|
|
8847
|
+
function vc(a, e, t, i) {
|
|
8837
8848
|
if (a == null)
|
|
8838
8849
|
return i;
|
|
8839
|
-
const n =
|
|
8850
|
+
const n = mc(t);
|
|
8840
8851
|
if (n <= 0)
|
|
8841
8852
|
return i;
|
|
8842
|
-
const s =
|
|
8853
|
+
const s = yc(a, e, t), o = Math.max(n * uc, 1), r = Math.max(n * pc, o + 1), c = 1 - O.clamp(
|
|
8843
8854
|
(s - o) / (r - o),
|
|
8844
8855
|
0,
|
|
8845
8856
|
1
|
|
8846
8857
|
);
|
|
8847
8858
|
return i * c * c;
|
|
8848
8859
|
}
|
|
8849
|
-
class
|
|
8860
|
+
class Mc {
|
|
8850
8861
|
engine;
|
|
8851
8862
|
isActive = oi;
|
|
8852
8863
|
groupEdge;
|
|
@@ -8917,13 +8928,13 @@ class vc {
|
|
|
8917
8928
|
}), this.highlightIndexes.set(e, s), s;
|
|
8918
8929
|
}
|
|
8919
8930
|
constructor(e) {
|
|
8920
|
-
this.engine = e, this.groupEdge = this.engine.scene.getObjectByName("groupEdge"), Ot(this.groupEdge, this.engine.sectionPlane), this.groupEdge.userData.excludeFromAutoExposure = !0, this.highlightEdgeGroup = new Pe(), this.highlightEdgeGroup.name = "highlightModelEdgeGroup", Ot(this.highlightEdgeGroup, this.engine.sectionPlane), this.highlightEdgeGroup.userData.excludeFromAutoExposure = !0, this.highlightEdgeGroup.renderOrder = 999, this.engine.scene.add(this.highlightEdgeGroup), this.material = new
|
|
8931
|
+
this.engine = e, this.groupEdge = this.engine.scene.getObjectByName("groupEdge"), Ot(this.groupEdge, this.engine.sectionPlane), this.groupEdge.userData.excludeFromAutoExposure = !0, this.highlightEdgeGroup = new Pe(), this.highlightEdgeGroup.name = "highlightModelEdgeGroup", Ot(this.highlightEdgeGroup, this.engine.sectionPlane), this.highlightEdgeGroup.userData.excludeFromAutoExposure = !0, this.highlightEdgeGroup.renderOrder = 999, this.engine.scene.add(this.highlightEdgeGroup), this.material = new rt({
|
|
8921
8932
|
color: 0,
|
|
8922
8933
|
transparent: !0,
|
|
8923
8934
|
opacity: Gi,
|
|
8924
8935
|
depthTest: !0,
|
|
8925
8936
|
depthWrite: !1
|
|
8926
|
-
}), this.material.clippingPlanes = this.engine.sectionPlane, this.highlightEdgeMaterial = new
|
|
8937
|
+
}), this.material.clippingPlanes = this.engine.sectionPlane, this.highlightEdgeMaterial = new rt({
|
|
8927
8938
|
color: 16777215,
|
|
8928
8939
|
transparent: !0,
|
|
8929
8940
|
opacity: 1,
|
|
@@ -8957,13 +8968,13 @@ class vc {
|
|
|
8957
8968
|
update() {
|
|
8958
8969
|
if (!this.isActive || !this.material)
|
|
8959
8970
|
return;
|
|
8960
|
-
const e =
|
|
8971
|
+
const e = vc(
|
|
8961
8972
|
this.engine?.camera,
|
|
8962
8973
|
this.engine?.controls?.target,
|
|
8963
8974
|
this.engine?.octreeBox?.getBoundingBox?.(),
|
|
8964
8975
|
this.baseOpacity
|
|
8965
8976
|
);
|
|
8966
|
-
e > 0 && Math.abs(this.material.opacity - e) <=
|
|
8977
|
+
e > 0 && Math.abs(this.material.opacity - e) <= gc || (this.material.opacity = e, this.material.needsUpdate = !0);
|
|
8967
8978
|
}
|
|
8968
8979
|
hasPendingModelEdges() {
|
|
8969
8980
|
return (this.engine?.models ?? []).some((t) => this.shouldLoadModelEdge(t) && !Array.isArray(t?.modelEdge));
|
|
@@ -9096,7 +9107,7 @@ class vc {
|
|
|
9096
9107
|
if (i.ids.forEach((l) => {
|
|
9097
9108
|
const c = n?.get(Number(l)), h = typeof c == "number" ? this.getEdgePointsByIndex(i.url, c) : null;
|
|
9098
9109
|
if (Array.isArray(h)) {
|
|
9099
|
-
if (h.length >
|
|
9110
|
+
if (h.length > hc)
|
|
9100
9111
|
return;
|
|
9101
9112
|
this.appendEdgePositions(s, h);
|
|
9102
9113
|
}
|
|
@@ -9155,7 +9166,7 @@ class vc {
|
|
|
9155
9166
|
}
|
|
9156
9167
|
// 设置边线材质透明度
|
|
9157
9168
|
setOpacity(e) {
|
|
9158
|
-
this.baseOpacity = O.clamp(e,
|
|
9169
|
+
this.baseOpacity = O.clamp(e, dc, 1), this.update();
|
|
9159
9170
|
}
|
|
9160
9171
|
// 显示边线
|
|
9161
9172
|
showModelEdge(e, t) {
|
|
@@ -9186,7 +9197,7 @@ class vc {
|
|
|
9186
9197
|
this.releaseIndexes(e);
|
|
9187
9198
|
}
|
|
9188
9199
|
}
|
|
9189
|
-
const
|
|
9200
|
+
const Kn = {
|
|
9190
9201
|
turbidity: 10,
|
|
9191
9202
|
rayleigh: 3,
|
|
9192
9203
|
mieCoefficient: 5e-3,
|
|
@@ -9201,7 +9212,7 @@ const jn = {
|
|
|
9201
9212
|
cloudDensity: 0.4,
|
|
9202
9213
|
cloudElevation: 0.5,
|
|
9203
9214
|
showSunDisc: !0
|
|
9204
|
-
}, Wi = "sunrise_clear",
|
|
9215
|
+
}, Wi = "sunrise_clear", $s = 0.2, ji = [
|
|
9205
9216
|
{
|
|
9206
9217
|
id: "sunrise_clear",
|
|
9207
9218
|
names: ["晴朗日出", "晴朗日出", "Clear Sunrise"],
|
|
@@ -9372,10 +9383,10 @@ const jn = {
|
|
|
9372
9383
|
showSunDisc: !1
|
|
9373
9384
|
}
|
|
9374
9385
|
}
|
|
9375
|
-
],
|
|
9386
|
+
], Yn = ji.reduce(
|
|
9376
9387
|
(a, e) => (a[e.id] = e, a),
|
|
9377
9388
|
{}
|
|
9378
|
-
),
|
|
9389
|
+
), Qn = 2e6, Xn = 45e4, bc = 64, xc = 32, wc = 128, Cc = 100, $n = "v3-sky-clouds", Jn = {
|
|
9379
9390
|
turbidity: [0, 20],
|
|
9380
9391
|
rayleigh: [0, 4],
|
|
9381
9392
|
mieCoefficient: [0, 0.1],
|
|
@@ -9390,13 +9401,13 @@ const jn = {
|
|
|
9390
9401
|
cloudDensity: [0, 1],
|
|
9391
9402
|
cloudElevation: [0, 1]
|
|
9392
9403
|
};
|
|
9393
|
-
class
|
|
9404
|
+
class Ec {
|
|
9394
9405
|
engine;
|
|
9395
9406
|
sky = null;
|
|
9396
9407
|
sun = new d();
|
|
9397
|
-
params = this._resolveParams(
|
|
9408
|
+
params = this._resolveParams(Yn[Wi].params);
|
|
9398
9409
|
currentPreset = Wi;
|
|
9399
|
-
currentIntensity =
|
|
9410
|
+
currentIntensity = $s;
|
|
9400
9411
|
currentEnvironmentTarget = null;
|
|
9401
9412
|
environmentRefreshTimer = null;
|
|
9402
9413
|
skyName = "bim_engine_sky";
|
|
@@ -9405,7 +9416,7 @@ class Cc {
|
|
|
9405
9416
|
previousEnvironment = null;
|
|
9406
9417
|
previousBackgroundIntensity = 1;
|
|
9407
9418
|
previousEnvironmentIntensity = 1;
|
|
9408
|
-
previousToneMapping =
|
|
9419
|
+
previousToneMapping = st;
|
|
9409
9420
|
previousToneMappingExposure = 1;
|
|
9410
9421
|
hasCapturedSceneState = !1;
|
|
9411
9422
|
constructor(e) {
|
|
@@ -9417,7 +9428,7 @@ class Cc {
|
|
|
9417
9428
|
}
|
|
9418
9429
|
/** 关闭天空;remove=false 时保留 GPU 资源,便于频繁切换环境。 */
|
|
9419
9430
|
close(e = !0) {
|
|
9420
|
-
this.sky && (this._cancelEnvironmentRefresh(), this.engine?.setIdleFrameRateExempt?.(
|
|
9431
|
+
this.sky && (this._cancelEnvironmentRefresh(), this.engine?.setIdleFrameRateExempt?.($n, !1), this._restoreCameraFar(), this._restoreSceneState(), e ? (this.engine?.scene?.remove(this.sky), this.sky.material.dispose(), this.sky.geometry.dispose(), this.sky = null, this._disposeEnvironmentTarget()) : this.sky.visible = !1, this.engine.composerModule?.rebuild?.(), this._requestRender());
|
|
9421
9432
|
}
|
|
9422
9433
|
isActive() {
|
|
9423
9434
|
return this.sky?.visible === !0 && this.sky.parent === this.engine?.scene;
|
|
@@ -9430,7 +9441,7 @@ class Cc {
|
|
|
9430
9441
|
this.params = this._resolveParams({ ...this.params, ...e }), this._applyParamsToSky(), this._requestRender();
|
|
9431
9442
|
}
|
|
9432
9443
|
setPreset(e) {
|
|
9433
|
-
const t =
|
|
9444
|
+
const t = Yn[e];
|
|
9434
9445
|
t && (this.currentPreset = e, this.params = this._resolveParams(t.params), this._applyParamsToSky(), this._requestRender());
|
|
9435
9446
|
}
|
|
9436
9447
|
getCurrentPreset() {
|
|
@@ -9462,12 +9473,12 @@ class Cc {
|
|
|
9462
9473
|
* 保留其 WebGPU/TSL 材质,只将几何数据替换为连续球面。
|
|
9463
9474
|
*/
|
|
9464
9475
|
_createSeamlessSky() {
|
|
9465
|
-
const e = new
|
|
9476
|
+
const e = new Go(), t = new di(
|
|
9466
9477
|
1,
|
|
9467
|
-
|
|
9468
|
-
|
|
9478
|
+
bc,
|
|
9479
|
+
xc
|
|
9469
9480
|
);
|
|
9470
|
-
return e.geometry.copy(t), t.dispose(), e.scale.setScalar(
|
|
9481
|
+
return e.geometry.copy(t), t.dispose(), e.scale.setScalar(Xn), e.frustumCulled = !1, e;
|
|
9471
9482
|
}
|
|
9472
9483
|
_syncSkyToCamera() {
|
|
9473
9484
|
!this.sky?.visible || !this.engine?.camera || (this.sky.position.copy(this.engine.camera.position), this.sky.updateMatrixWorld());
|
|
@@ -9480,7 +9491,7 @@ class Cc {
|
|
|
9480
9491
|
}
|
|
9481
9492
|
_expandCameraFarForSky() {
|
|
9482
9493
|
const e = this.engine?.camera;
|
|
9483
|
-
!e || typeof e.far != "number" || e.far >=
|
|
9494
|
+
!e || typeof e.far != "number" || e.far >= Qn || (this.savedCameraFar == null && (this.savedCameraFar = e.far), e.far = Qn, e.updateProjectionMatrix?.());
|
|
9484
9495
|
}
|
|
9485
9496
|
_restoreCameraFar() {
|
|
9486
9497
|
const e = this.engine?.camera;
|
|
@@ -9490,18 +9501,18 @@ class Cc {
|
|
|
9490
9501
|
if (!this.sky) return;
|
|
9491
9502
|
this.sky.turbidity.value = this.params.turbidity, this.sky.rayleigh.value = this.params.rayleigh, this.sky.mieCoefficient.value = this.params.mieCoefficient, this.sky.mieDirectionalG.value = this.params.mieDirectionalG, this.sky.cloudScale.value = this.params.cloudScale, this.sky.cloudSpeed.value = this.params.cloudSpeed, this.sky.cloudCoverage.value = this.params.cloudCoverage, this.sky.cloudDensity.value = this.params.cloudDensity, this.sky.cloudElevation.value = this.params.cloudElevation, this.sky.showSunDisc.value = this.params.showSunDisc;
|
|
9492
9503
|
const e = O.degToRad(90 - this.params.elevation), t = O.degToRad(this.params.azimuth);
|
|
9493
|
-
this.sun.setFromSphericalCoords(1, e, t), this.sky.sunPosition.value.copy(this.sun), this.engine?.renderer && (this.engine.renderer.toneMapping =
|
|
9504
|
+
this.sun.setFromSphericalCoords(1, e, t), this.sky.sunPosition.value.copy(this.sun), this.engine?.renderer && (this.engine.renderer.toneMapping = Wo, this.engine.renderer.toneMappingExposure = this._getEffectiveExposure()), this._updateAnimationState(), this.isActive() && this._scheduleEnvironmentRefresh();
|
|
9494
9505
|
}
|
|
9495
9506
|
_captureSceneState() {
|
|
9496
|
-
this.hasCapturedSceneState || !this.engine?.scene || (this.previousBackground = this.engine.scene.background, this.previousEnvironment = this.engine.scene.environment, this.previousBackgroundIntensity = this.engine.scene.backgroundIntensity ?? 1, this.previousEnvironmentIntensity = this.engine.scene.environmentIntensity ?? 1, this.previousToneMapping = this.engine.renderer?.toneMapping ??
|
|
9507
|
+
this.hasCapturedSceneState || !this.engine?.scene || (this.previousBackground = this.engine.scene.background, this.previousEnvironment = this.engine.scene.environment, this.previousBackgroundIntensity = this.engine.scene.backgroundIntensity ?? 1, this.previousEnvironmentIntensity = this.engine.scene.environmentIntensity ?? 1, this.previousToneMapping = this.engine.renderer?.toneMapping ?? st, this.previousToneMappingExposure = this.engine.renderer?.toneMappingExposure ?? 1, this.hasCapturedSceneState = !0);
|
|
9497
9508
|
}
|
|
9498
9509
|
_restoreSceneState() {
|
|
9499
|
-
!this.hasCapturedSceneState || !this.engine?.scene || (this.engine.scene.background = this.previousBackground, this.engine.scene.environment = this.previousEnvironment, this.engine.scene.backgroundIntensity = this.previousBackgroundIntensity, this.engine.scene.environmentIntensity = this.previousEnvironmentIntensity, this.engine.renderer && (this.engine.renderer.toneMapping = this.previousToneMapping, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure), this.previousBackground = null, this.previousEnvironment = null, this.previousBackgroundIntensity = 1, this.previousEnvironmentIntensity = 1, this.previousToneMapping =
|
|
9510
|
+
!this.hasCapturedSceneState || !this.engine?.scene || (this.engine.scene.background = this.previousBackground, this.engine.scene.environment = this.previousEnvironment, this.engine.scene.backgroundIntensity = this.previousBackgroundIntensity, this.engine.scene.environmentIntensity = this.previousEnvironmentIntensity, this.engine.renderer && (this.engine.renderer.toneMapping = this.previousToneMapping, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure), this.previousBackground = null, this.previousEnvironment = null, this.previousBackgroundIntensity = 1, this.previousEnvironmentIntensity = 1, this.previousToneMapping = st, this.previousToneMappingExposure = 1, this.hasCapturedSceneState = !1);
|
|
9500
9511
|
}
|
|
9501
9512
|
_scheduleEnvironmentRefresh() {
|
|
9502
9513
|
!this.isActive() || !this.engine?.renderer || (this._cancelEnvironmentRefresh(), this.environmentRefreshTimer = setTimeout(() => {
|
|
9503
9514
|
this.environmentRefreshTimer = null, this._refreshEnvironmentMap();
|
|
9504
|
-
},
|
|
9515
|
+
}, Cc));
|
|
9505
9516
|
}
|
|
9506
9517
|
_cancelEnvironmentRefresh() {
|
|
9507
9518
|
this.environmentRefreshTimer != null && (clearTimeout(this.environmentRefreshTimer), this.environmentRefreshTimer = null);
|
|
@@ -9510,14 +9521,14 @@ class Cc {
|
|
|
9510
9521
|
if (!this.isActive() || !this.engine?.renderer || !this.engine?.scene) return;
|
|
9511
9522
|
const e = new kt(), t = this._createSeamlessSky();
|
|
9512
9523
|
t.turbidity.value = this.params.turbidity, t.rayleigh.value = this.params.rayleigh, t.mieCoefficient.value = this.params.mieCoefficient, t.mieDirectionalG.value = this.params.mieDirectionalG, t.sunPosition.value.copy(this.sun), t.cloudScale.value = this.params.cloudScale, t.cloudSpeed.value = 0, t.cloudCoverage.value = this.params.cloudCoverage, t.cloudDensity.value = this.params.cloudDensity, t.cloudElevation.value = this.params.cloudElevation, t.showSunDisc.value = !1, e.add(t);
|
|
9513
|
-
const i = new
|
|
9524
|
+
const i = new Es(this.engine.renderer);
|
|
9514
9525
|
try {
|
|
9515
9526
|
const n = i.fromScene(
|
|
9516
9527
|
e,
|
|
9517
9528
|
0,
|
|
9518
9529
|
0.1,
|
|
9519
|
-
|
|
9520
|
-
{ size:
|
|
9530
|
+
Xn * 2,
|
|
9531
|
+
{ size: wc }
|
|
9521
9532
|
), s = this.currentEnvironmentTarget;
|
|
9522
9533
|
this.currentEnvironmentTarget = n, this.engine.scene.environment = n.texture, this.engine.scene.environmentIntensity = this.currentIntensity, s?.dispose(), this._requestRender();
|
|
9523
9534
|
} catch (n) {
|
|
@@ -9531,14 +9542,14 @@ class Cc {
|
|
|
9531
9542
|
}
|
|
9532
9543
|
_updateAnimationState() {
|
|
9533
9544
|
const e = this.isActive() && this.params.cloudSpeed > 0 && this.params.cloudCoverage > 0 && this.params.cloudDensity > 0;
|
|
9534
|
-
this.engine?.setIdleFrameRateExempt?.(
|
|
9545
|
+
this.engine?.setIdleFrameRateExempt?.($n, e);
|
|
9535
9546
|
}
|
|
9536
9547
|
_resolveParams(e) {
|
|
9537
|
-
const t = { ...
|
|
9538
|
-
return Object.keys(
|
|
9539
|
-
const n =
|
|
9548
|
+
const t = { ...Kn, ...e };
|
|
9549
|
+
return Object.keys(Jn).forEach((i) => {
|
|
9550
|
+
const n = Jn[i], s = t[i];
|
|
9540
9551
|
if (!n || typeof s != "number") return;
|
|
9541
|
-
const o = Number.isFinite(s) ? s :
|
|
9552
|
+
const o = Number.isFinite(s) ? s : Kn[i];
|
|
9542
9553
|
t[i] = O.clamp(
|
|
9543
9554
|
o,
|
|
9544
9555
|
n[0],
|
|
@@ -9550,7 +9561,7 @@ class Cc {
|
|
|
9550
9561
|
this.engine?.requestComposerRender?.();
|
|
9551
9562
|
}
|
|
9552
9563
|
}
|
|
9553
|
-
class
|
|
9564
|
+
class Sc {
|
|
9554
9565
|
/** 寮曟搸瀹炰緥寮曠敤 */
|
|
9555
9566
|
engine;
|
|
9556
9567
|
defaultSettings;
|
|
@@ -9580,16 +9591,17 @@ class Ec {
|
|
|
9580
9591
|
}
|
|
9581
9592
|
/** 鎵归噺鏇存柊璁剧疆锛堟敮鎸侀儴鍒嗘洿鏂帮級 */
|
|
9582
9593
|
async setSettings(e) {
|
|
9583
|
-
e.render && (Object.assign(this.settings.render, e.render), this._applyRenderSettings(this.settings.render)), e.display && (Object.assign(this.settings.display, e.display), this._applyDisplaySettings(this.settings.display)), e.environment && (this._mergeEnvironmentSettings(e.environment), await this._applyEnvironmentSettings(this._clone(this.settings.environment)));
|
|
9594
|
+
e.render && (Object.prototype.hasOwnProperty.call(e.render, "lightIntensity") && this.engine.autoExposureModule?.setEnabled?.(!1), Object.assign(this.settings.render, e.render), this._applyRenderSettings(this.settings.render)), e.display && (Object.assign(this.settings.display, e.display), this._applyDisplaySettings(this.settings.display)), e.environment && (this._mergeEnvironmentSettings(e.environment), await this._applyEnvironmentSettings(this._clone(this.settings.environment)));
|
|
9584
9595
|
}
|
|
9585
9596
|
/** 閲嶇疆鎵€鏈夎缃负榛樿鍊?*/
|
|
9586
9597
|
async resetToDefault() {
|
|
9587
9598
|
this.settings = this._clone(this.defaultSettings), this._applyRenderSettings(this.settings.render), this._applyDisplaySettings(this.settings.display), await this._applyEnvironmentSettings(this._clone(this.settings.environment));
|
|
9588
9599
|
}
|
|
9589
9600
|
// ==================== 娓叉煋璁剧疆 ====================
|
|
9590
|
-
/** 设置 1 至 12
|
|
9601
|
+
/** 设置 1 至 12 的手动等级,或使用 v2 的 simple、balance、advanced 三档模式。 */
|
|
9591
9602
|
setRenderMode(e) {
|
|
9592
|
-
|
|
9603
|
+
const t = nt(e);
|
|
9604
|
+
this.settings.render.mode = t, this.engine.engineModelModule?.setQualityLevel(t);
|
|
9593
9605
|
}
|
|
9594
9606
|
/** 璁剧疆瀵规瘮搴︼紙0~100锛?*/
|
|
9595
9607
|
setContrast(e) {
|
|
@@ -9607,7 +9619,7 @@ class Ec {
|
|
|
9607
9619
|
}
|
|
9608
9620
|
/** 璁剧疆鍏夌収寮哄害锛?~100锛夛紝璋冩暣鐜鍏変寒搴?*/
|
|
9609
9621
|
setLightIntensity(e) {
|
|
9610
|
-
this.settings.render.lightIntensity = e, this.setAmbientLightIntensity(e / 100);
|
|
9622
|
+
this.engine.autoExposureModule?.setEnabled?.(!1), this.settings.render.lightIntensity = e, this.setAmbientLightIntensity(e / 100);
|
|
9611
9623
|
}
|
|
9612
9624
|
/** 璁剧疆 GTAO锛堝睆骞曠┖闂寸幆澧冨厜閬斀锛夊己搴︼紙0~100锛?*/
|
|
9613
9625
|
setGTAOIntensity(e) {
|
|
@@ -9690,20 +9702,20 @@ class Ec {
|
|
|
9690
9702
|
return {
|
|
9691
9703
|
render: {
|
|
9692
9704
|
mode: this._toRenderMode(this.engine.engineModelModule?.getQualityLevel?.()),
|
|
9693
|
-
contrast: this._uniformToPercent(e?.contrast,
|
|
9694
|
-
saturation: this._uniformToPercent(e?.saturation,
|
|
9705
|
+
contrast: this._uniformToPercent(e?.contrast, Wr),
|
|
9706
|
+
saturation: this._uniformToPercent(e?.saturation, Gr),
|
|
9695
9707
|
shadowIntensity: this._shadowToPercent(this._getDirectionalLightShadowIntensity(), ni),
|
|
9696
9708
|
lightIntensity: this._exposureToPercent(i, nn),
|
|
9697
|
-
gtaoIntensity: this._unitToPercent(t?.scale,
|
|
9709
|
+
gtaoIntensity: this._unitToPercent(t?.scale, qr)
|
|
9698
9710
|
},
|
|
9699
9711
|
display: {
|
|
9700
9712
|
showEdge: this.engine.modelEdge?.isEnabled?.() ?? oi,
|
|
9701
9713
|
edgeOpacity: this._unitToPercent(n, Gi),
|
|
9702
9714
|
showGrid: this.engine.grid?.getVisible?.() ?? Vi,
|
|
9703
|
-
showLevel: this.engine.level?.getVisible?.() ??
|
|
9704
|
-
showGround: this.engine.ground?.getVisible?.() ??
|
|
9705
|
-
groundId: this.engine.ground?.getCurrentId?.() ??
|
|
9706
|
-
groundHeight: this.engine.ground?.getHeight?.() ??
|
|
9715
|
+
showLevel: this.engine.level?.getVisible?.() ?? Xs,
|
|
9716
|
+
showGround: this.engine.ground?.getVisible?.() ?? Qs,
|
|
9717
|
+
groundId: this.engine.ground?.getCurrentId?.() ?? Ks,
|
|
9718
|
+
groundHeight: this.engine.ground?.getHeight?.() ?? Ys
|
|
9707
9719
|
},
|
|
9708
9720
|
environment: {
|
|
9709
9721
|
type: h ? "sky" : s !== qe ? "hdr" : "none",
|
|
@@ -9713,7 +9725,7 @@ class Ec {
|
|
|
9713
9725
|
hdrEnvironmentIntensity: this._unitToPercent(o, Ui),
|
|
9714
9726
|
skyPreset: c,
|
|
9715
9727
|
skyParams: {},
|
|
9716
|
-
skyIntensity: this._unitToPercent(l,
|
|
9728
|
+
skyIntensity: this._unitToPercent(l, $s)
|
|
9717
9729
|
}
|
|
9718
9730
|
};
|
|
9719
9731
|
}
|
|
@@ -9756,7 +9768,7 @@ class Ec {
|
|
|
9756
9768
|
};
|
|
9757
9769
|
}
|
|
9758
9770
|
_toRenderMode(e) {
|
|
9759
|
-
return e == null ?
|
|
9771
|
+
return e == null ? js : nt(e);
|
|
9760
9772
|
}
|
|
9761
9773
|
_uniformToPercent(e, t) {
|
|
9762
9774
|
const i = typeof e == "number" ? e : t;
|
|
@@ -9779,12 +9791,12 @@ class Ec {
|
|
|
9779
9791
|
}
|
|
9780
9792
|
_getDirectionalLightShadowIntensity() {
|
|
9781
9793
|
const e = this.engine.scene?.children?.filter(
|
|
9782
|
-
(i) => i instanceof
|
|
9794
|
+
(i) => i instanceof ot
|
|
9783
9795
|
);
|
|
9784
9796
|
return !e || e.length === 0 ? ni : (e.find((i) => i.castShadow) ?? e[0]).shadow?.intensity ?? ni;
|
|
9785
9797
|
}
|
|
9786
9798
|
_applyRenderSettings(e) {
|
|
9787
|
-
this.setRenderMode(e.mode), this.setContrast(e.contrast), this.setSaturation(e.saturation), this.setShadowIntensity(e.shadowIntensity), this.
|
|
9799
|
+
this.setRenderMode(e.mode), this.setContrast(e.contrast), this.setSaturation(e.saturation), this.setShadowIntensity(e.shadowIntensity), this.settings.render.lightIntensity = e.lightIntensity, this.setAmbientLightIntensity(e.lightIntensity / 100), this.setGTAOIntensity(e.gtaoIntensity);
|
|
9788
9800
|
}
|
|
9789
9801
|
/** 涓€娆℃€у簲鐢ㄦ墍鏈夋樉绀鸿缃?*/
|
|
9790
9802
|
_applyDisplaySettings(e) {
|
|
@@ -9818,7 +9830,7 @@ class Ec {
|
|
|
9818
9830
|
}
|
|
9819
9831
|
_updateDirectionalLight(e) {
|
|
9820
9832
|
const t = this.engine.scene?.children.find(
|
|
9821
|
-
(i) => i instanceof
|
|
9833
|
+
(i) => i instanceof ot
|
|
9822
9834
|
);
|
|
9823
9835
|
t && e(t);
|
|
9824
9836
|
}
|
|
@@ -10109,7 +10121,7 @@ class We {
|
|
|
10109
10121
|
}
|
|
10110
10122
|
}
|
|
10111
10123
|
}
|
|
10112
|
-
class
|
|
10124
|
+
class Ac {
|
|
10113
10125
|
engine;
|
|
10114
10126
|
isActive = !1;
|
|
10115
10127
|
tools;
|
|
@@ -10213,7 +10225,7 @@ class Sc {
|
|
|
10213
10225
|
}
|
|
10214
10226
|
}
|
|
10215
10227
|
}
|
|
10216
|
-
class
|
|
10228
|
+
class Pc {
|
|
10217
10229
|
engine;
|
|
10218
10230
|
tools;
|
|
10219
10231
|
isActive = !1;
|
|
@@ -10269,7 +10281,7 @@ class Ac {
|
|
|
10269
10281
|
}
|
|
10270
10282
|
// 按下esc
|
|
10271
10283
|
}
|
|
10272
|
-
class
|
|
10284
|
+
class Tc {
|
|
10273
10285
|
engine;
|
|
10274
10286
|
isActive = !1;
|
|
10275
10287
|
tools;
|
|
@@ -10324,7 +10336,7 @@ class Pc {
|
|
|
10324
10336
|
t.point1 = s.point, t.point2 = n[0].point, t.text = t.point1.clone().distanceTo(t.point2.clone()), this.engine.events.trigger(oe.MeasureChanged, t);
|
|
10325
10337
|
}
|
|
10326
10338
|
}
|
|
10327
|
-
class
|
|
10339
|
+
class Ic {
|
|
10328
10340
|
engine;
|
|
10329
10341
|
isActive = !1;
|
|
10330
10342
|
tools;
|
|
@@ -10369,7 +10381,7 @@ class Tc {
|
|
|
10369
10381
|
t.point = e.catch.point.clone(), t.text = e.catch.point.y, t.isSelect = !1, this.engine.events.trigger(oe.MeasureChanged, t);
|
|
10370
10382
|
}
|
|
10371
10383
|
}
|
|
10372
|
-
class
|
|
10384
|
+
class Dc {
|
|
10373
10385
|
engine;
|
|
10374
10386
|
isActive = !1;
|
|
10375
10387
|
tools;
|
|
@@ -10421,7 +10433,7 @@ class Ic {
|
|
|
10421
10433
|
e != null && (e.isSelect = !1, this.engine.events.trigger(oe.MeasureChanged, e));
|
|
10422
10434
|
}
|
|
10423
10435
|
}
|
|
10424
|
-
class
|
|
10436
|
+
class _c {
|
|
10425
10437
|
engine;
|
|
10426
10438
|
tools;
|
|
10427
10439
|
// 存储三个点:起点、顶点(中间点)、终点
|
|
@@ -10489,7 +10501,7 @@ class Dc {
|
|
|
10489
10501
|
}
|
|
10490
10502
|
}
|
|
10491
10503
|
}
|
|
10492
|
-
class
|
|
10504
|
+
class kc {
|
|
10493
10505
|
engine;
|
|
10494
10506
|
tools;
|
|
10495
10507
|
points = [];
|
|
@@ -10716,7 +10728,7 @@ class Dt {
|
|
|
10716
10728
|
}
|
|
10717
10729
|
}
|
|
10718
10730
|
}
|
|
10719
|
-
class
|
|
10731
|
+
class Lc {
|
|
10720
10732
|
engine;
|
|
10721
10733
|
isActive = !1;
|
|
10722
10734
|
points = [];
|
|
@@ -10797,7 +10809,7 @@ class kc {
|
|
|
10797
10809
|
};
|
|
10798
10810
|
}
|
|
10799
10811
|
}
|
|
10800
|
-
class
|
|
10812
|
+
class Rc {
|
|
10801
10813
|
isActive = !1;
|
|
10802
10814
|
engine;
|
|
10803
10815
|
clearHeightMeasure;
|
|
@@ -10823,7 +10835,7 @@ class Lc {
|
|
|
10823
10835
|
volumeAnnotation: []
|
|
10824
10836
|
};
|
|
10825
10837
|
constructor(e) {
|
|
10826
|
-
this.engine = e, this.clearHeightMeasure = new
|
|
10838
|
+
this.engine = e, this.clearHeightMeasure = new Ac(e), this.distanceMeasure = new Pc(e), this.clearDistanceMeasure = new Tc(e), this.elevationMeasure = new Ic(e), this.pointMeasure = new Dc(e), this.angleMeasure = new _c(e), this.areaMeasure = new kc(e), this.slopeMeasure = new Dt(e), this.faceDistanceMeasure = new Lc(e), this.tools = new We(e), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", e.container.appendChild(this.annotationContainer);
|
|
10827
10839
|
}
|
|
10828
10840
|
setContextMenuDisabled(e) {
|
|
10829
10841
|
this.engine?.engineStatus != null && (this.engine.engineStatus.isDisableContextMenu = e);
|
|
@@ -10871,18 +10883,18 @@ class Lc {
|
|
|
10871
10883
|
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;
|
|
10872
10884
|
}
|
|
10873
10885
|
}
|
|
10874
|
-
function
|
|
10886
|
+
function Js(a) {
|
|
10875
10887
|
const e = Object.create(a);
|
|
10876
10888
|
return e.scene = a.composerModule?.postProcessingOverlayScene ?? a.scene, e;
|
|
10877
10889
|
}
|
|
10878
|
-
function
|
|
10890
|
+
function Zs(a) {
|
|
10879
10891
|
a.getObjectByName("ClippingBox")?.traverse((t) => {
|
|
10880
10892
|
t.castShadow = !1, t.receiveShadow = !1, t.userData.excludeFromAmbientOcclusion = !0, (Array.isArray(t.material) ? t.material : t.material ? [t.material] : []).forEach((n) => {
|
|
10881
10893
|
n.depthWrite = !1, n.depthTest = !1, n.toneMapped = !1, n.needsUpdate = !0;
|
|
10882
10894
|
});
|
|
10883
10895
|
});
|
|
10884
10896
|
}
|
|
10885
|
-
class
|
|
10897
|
+
class Bc {
|
|
10886
10898
|
planes;
|
|
10887
10899
|
mode = "";
|
|
10888
10900
|
fillCutFace = !0;
|
|
@@ -10907,16 +10919,16 @@ class Rc {
|
|
|
10907
10919
|
return this.mode === "box" || this.mode === "viewRange" ? this.planes.slice(0, 6) : this.mode === "x" || this.mode === "y" || this.mode === "z" || this.mode === "face" ? [this.planes[6]] : [];
|
|
10908
10920
|
}
|
|
10909
10921
|
}
|
|
10910
|
-
class
|
|
10922
|
+
class zc extends wr {
|
|
10911
10923
|
webgpuState;
|
|
10912
10924
|
interactionScene;
|
|
10913
10925
|
constructor(e, t) {
|
|
10914
|
-
const i =
|
|
10926
|
+
const i = Js(e);
|
|
10915
10927
|
super(i), this.webgpuState = t, this.interactionScene = i.scene;
|
|
10916
10928
|
}
|
|
10917
10929
|
/** V2 每次重建六个面后同步 WebGPU ClippingGroup,并唤醒按需渲染。 */
|
|
10918
10930
|
updata_face(e) {
|
|
10919
|
-
super.updata_face(e),
|
|
10931
|
+
super.updata_face(e), Zs(this.interactionScene), this.webgpuState.apply();
|
|
10920
10932
|
}
|
|
10921
10933
|
/** 释放 V2 覆盖层,防止引擎销毁后控制器继续响应。 */
|
|
10922
10934
|
dispose() {
|
|
@@ -10931,16 +10943,16 @@ class Bc extends xr {
|
|
|
10931
10943
|
}), s.forEach((o) => o.removeFromParent()), this.webgpuState.apply();
|
|
10932
10944
|
}
|
|
10933
10945
|
}
|
|
10934
|
-
class
|
|
10946
|
+
class Oc extends Cr {
|
|
10935
10947
|
webgpuState;
|
|
10936
10948
|
interactionScene;
|
|
10937
10949
|
constructor(e, t) {
|
|
10938
|
-
const i =
|
|
10950
|
+
const i = Js(e);
|
|
10939
10951
|
super(i), this.webgpuState = t, this.interactionScene = i.scene;
|
|
10940
10952
|
}
|
|
10941
10953
|
/** V2 每次移动或旋转剖切面后同步 WebGPU 平面。 */
|
|
10942
10954
|
updata_face(e, t) {
|
|
10943
|
-
super.updata_face(e, t),
|
|
10955
|
+
super.updata_face(e, t), Zs(this.interactionScene), this.webgpuState.apply();
|
|
10944
10956
|
}
|
|
10945
10957
|
/** 释放剖切面、平移控制器和旋转控制器。 */
|
|
10946
10958
|
dispose() {
|
|
@@ -10953,17 +10965,17 @@ class zc extends wr {
|
|
|
10953
10965
|
}), t.forEach((i) => i.removeFromParent()), this.webgpuState.apply();
|
|
10954
10966
|
}
|
|
10955
10967
|
}
|
|
10956
|
-
class
|
|
10968
|
+
class Nc extends Er {
|
|
10957
10969
|
}
|
|
10958
|
-
class
|
|
10970
|
+
class Fc {
|
|
10959
10971
|
engine;
|
|
10960
10972
|
state;
|
|
10961
|
-
fillGroup =
|
|
10973
|
+
fillGroup = Ps();
|
|
10962
10974
|
delegate;
|
|
10963
10975
|
constructor(e, t) {
|
|
10964
10976
|
this.engine = e, this.state = t, this.fillGroup.name = "WebGPUClippingFaceFills", this.fillGroup.userData.__isClippingFillGroup = !0, this.fillGroup.userData.excludeFromAmbientOcclusion = !0, this.engine.scene.add(this.fillGroup);
|
|
10965
10977
|
const i = Object.create(this.engine);
|
|
10966
|
-
i.scene = this.fillGroup, this.delegate = new
|
|
10978
|
+
i.scene = this.fillGroup, this.delegate = new Sr(i);
|
|
10967
10979
|
}
|
|
10968
10980
|
clear() {
|
|
10969
10981
|
this.delegate.clear(), this.requestRender();
|
|
@@ -10989,10 +11001,10 @@ class Nc {
|
|
|
10989
11001
|
this.engine.composerModule?.markSceneDirty?.(), this.engine.requestComposerRender?.();
|
|
10990
11002
|
}
|
|
10991
11003
|
}
|
|
10992
|
-
function
|
|
10993
|
-
return new
|
|
11004
|
+
function Hc(a, e) {
|
|
11005
|
+
return new Fc(a, e);
|
|
10994
11006
|
}
|
|
10995
|
-
class
|
|
11007
|
+
class Vc {
|
|
10996
11008
|
engine;
|
|
10997
11009
|
state;
|
|
10998
11010
|
viewRangePlanes = null;
|
|
@@ -11015,7 +11027,7 @@ class Hc {
|
|
|
11015
11027
|
new ve(new d(0, 0, 1), 1e5)
|
|
11016
11028
|
], this.sectionPlane.forEach((t, i) => {
|
|
11017
11029
|
t.name = ["前", "左", "后", "右", "顶", "底", "face"][i];
|
|
11018
|
-
}), this.engine.sectionPlane = this.sectionPlane, this.state = new
|
|
11030
|
+
}), this.engine.sectionPlane = this.sectionPlane, this.state = new Bc(e, this.sectionPlane), this.engine.__getActiveWebGPUClippingPlanes = () => this.state.getActivePlanes(), this.sectionBox = new zc(e, this.state), this.sectionFace = new Oc(e, this.state), this.sectionCatchFace = new Nc(e), this.clippingCSGSimple = Hc(e, this.state);
|
|
11019
11031
|
}
|
|
11020
11032
|
init() {
|
|
11021
11033
|
this.state.apply();
|
|
@@ -11154,7 +11166,7 @@ class Hc {
|
|
|
11154
11166
|
return Math.abs(s) < 1e-8 ? null : new d().crossVectors(t.normal, i.normal).multiplyScalar(-e.constant).add(new d().crossVectors(i.normal, e.normal).multiplyScalar(-t.constant)).add(n.multiplyScalar(-i.constant)).divideScalar(s);
|
|
11155
11167
|
}
|
|
11156
11168
|
}
|
|
11157
|
-
class
|
|
11169
|
+
class Uc {
|
|
11158
11170
|
engine;
|
|
11159
11171
|
constructor(e) {
|
|
11160
11172
|
this.engine = e;
|
|
@@ -11193,7 +11205,7 @@ class Vc {
|
|
|
11193
11205
|
}), e;
|
|
11194
11206
|
}
|
|
11195
11207
|
}
|
|
11196
|
-
class
|
|
11208
|
+
class qc {
|
|
11197
11209
|
engine;
|
|
11198
11210
|
constructor(e) {
|
|
11199
11211
|
this.engine = e;
|
|
@@ -11231,8 +11243,8 @@ class Uc {
|
|
|
11231
11243
|
});
|
|
11232
11244
|
}
|
|
11233
11245
|
}
|
|
11234
|
-
const
|
|
11235
|
-
class
|
|
11246
|
+
const Gc = '<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>';
|
|
11247
|
+
class Wc {
|
|
11236
11248
|
manager;
|
|
11237
11249
|
wrapper;
|
|
11238
11250
|
input;
|
|
@@ -11248,7 +11260,7 @@ class Gc {
|
|
|
11248
11260
|
this.manager = t, this.wrapper = document.createElement("div"), this.wrapper.className = "engine-3d-search", this.wrapper.innerHTML = `
|
|
11249
11261
|
<section class="engine-3d-search__box" role="dialog" aria-label="模型检索">
|
|
11250
11262
|
<div class="engine-3d-search__input-row">
|
|
11251
|
-
<span class="engine-3d-search__icon">${
|
|
11263
|
+
<span class="engine-3d-search__icon">${Gc}</span>
|
|
11252
11264
|
<input class="engine-3d-search__input" type="search" placeholder="检索模型名称、构件 ID、房间" autocomplete="off" spellcheck="false" />
|
|
11253
11265
|
<button class="engine-3d-search__clear" type="button" aria-label="关闭检索框">×</button>
|
|
11254
11266
|
</div>
|
|
@@ -11351,13 +11363,13 @@ class Gc {
|
|
|
11351
11363
|
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();
|
|
11352
11364
|
}
|
|
11353
11365
|
}
|
|
11354
|
-
class
|
|
11366
|
+
class jc {
|
|
11355
11367
|
engine;
|
|
11356
11368
|
searchUI = null;
|
|
11357
11369
|
constructor(e) {
|
|
11358
11370
|
this.engine = e;
|
|
11359
11371
|
const t = e?.container;
|
|
11360
|
-
t && (this.searchUI = new
|
|
11372
|
+
t && (this.searchUI = new Wc(t, this), this.setTheme(e?.options?.searchTheme === "light" ? "light" : "dark"));
|
|
11361
11373
|
}
|
|
11362
11374
|
/** 按名称、ID、房间名称/编号检索已加载模型。 */
|
|
11363
11375
|
search(e, t = {}) {
|
|
@@ -11495,7 +11507,7 @@ class Wc {
|
|
|
11495
11507
|
return s < 0 ? null : (s === 0 ? 1e3 : 500) - s - Math.max(0, n.length - t.length) * 0.01;
|
|
11496
11508
|
}
|
|
11497
11509
|
}
|
|
11498
|
-
class
|
|
11510
|
+
class Kc {
|
|
11499
11511
|
engine;
|
|
11500
11512
|
constructor(e) {
|
|
11501
11513
|
this.engine = e;
|
|
@@ -11588,14 +11600,14 @@ class jc {
|
|
|
11588
11600
|
}), t && t(i), i;
|
|
11589
11601
|
}
|
|
11590
11602
|
}
|
|
11591
|
-
const
|
|
11592
|
-
class
|
|
11603
|
+
const Zn = !1, Yc = 51283, Qc = 2718207;
|
|
11604
|
+
class Xc {
|
|
11593
11605
|
engine;
|
|
11594
11606
|
rootGroup;
|
|
11595
11607
|
meshMaterial;
|
|
11596
11608
|
instanceMaterial;
|
|
11597
11609
|
handleLoadingCompleted;
|
|
11598
|
-
isVisible =
|
|
11610
|
+
isVisible = Zn;
|
|
11599
11611
|
filterState = {
|
|
11600
11612
|
urls: null,
|
|
11601
11613
|
ids: null,
|
|
@@ -11603,7 +11615,7 @@ class Qc {
|
|
|
11603
11615
|
showInstance: !0
|
|
11604
11616
|
};
|
|
11605
11617
|
constructor(e) {
|
|
11606
|
-
this.engine = e, this.rootGroup = new Pe(), this.rootGroup.name = "nodeBoxGroup", this.rootGroup.visible =
|
|
11618
|
+
this.engine = e, this.rootGroup = new Pe(), this.rootGroup.name = "nodeBoxGroup", this.rootGroup.visible = Zn, this.engine.scene?.add(this.rootGroup), this.meshMaterial = this.createMaterial(Yc), this.instanceMaterial = this.createMaterial(Qc), this.handleLoadingCompleted = () => {
|
|
11607
11619
|
this.isVisible && this.rebuild();
|
|
11608
11620
|
}, this.engine.events?.on?.(se.LoadingCompleted, this.handleLoadingCompleted);
|
|
11609
11621
|
}
|
|
@@ -11667,7 +11679,7 @@ class Qc {
|
|
|
11667
11679
|
this.engine.events?.off?.(se.LoadingCompleted, this.handleLoadingCompleted), this.clear(), this.rootGroup.parent && this.rootGroup.parent.remove(this.rootGroup), this.meshMaterial.dispose(), this.instanceMaterial.dispose();
|
|
11668
11680
|
}
|
|
11669
11681
|
createMaterial(e) {
|
|
11670
|
-
const t = new
|
|
11682
|
+
const t = new rt({
|
|
11671
11683
|
color: e,
|
|
11672
11684
|
transparent: !0,
|
|
11673
11685
|
opacity: 0.45,
|
|
@@ -11734,8 +11746,8 @@ class Qc {
|
|
|
11734
11746
|
e.matrixAutoUpdate = !1, e.matrix.copy(t), e.matrixWorldNeedsUpdate = !0, e.updateMatrixWorld(!0);
|
|
11735
11747
|
}
|
|
11736
11748
|
}
|
|
11737
|
-
const
|
|
11738
|
-
class
|
|
11749
|
+
const $c = "path-roaming-animation", Jc = 8e3, Zc = 100, Xt = 16;
|
|
11750
|
+
class eh {
|
|
11739
11751
|
engine;
|
|
11740
11752
|
points = [];
|
|
11741
11753
|
status = "idle";
|
|
@@ -12085,7 +12097,7 @@ class Zc {
|
|
|
12085
12097
|
const t = e.loopMode ?? (e.loop ? "repeat" : "none");
|
|
12086
12098
|
return {
|
|
12087
12099
|
...e,
|
|
12088
|
-
duration: this.toPositiveNumber(e.duration,
|
|
12100
|
+
duration: this.toPositiveNumber(e.duration, Jc),
|
|
12089
12101
|
playbackRate: this.toPositiveNumber(e.playbackRate, 1),
|
|
12090
12102
|
timing: "distance",
|
|
12091
12103
|
positionInterpolation: "linear",
|
|
@@ -12095,7 +12107,7 @@ class Zc {
|
|
|
12095
12107
|
loopMode: t,
|
|
12096
12108
|
loopCount: e.loopCount === void 0 ? Number.POSITIVE_INFINITY : Math.max(Math.floor(this.toNonNegativeNumber(e.loopCount, 0)), 0),
|
|
12097
12109
|
direction: e.direction ?? "forward",
|
|
12098
|
-
maxFrameDelta: this.toPositiveNumber(e.maxFrameDelta,
|
|
12110
|
+
maxFrameDelta: this.toPositiveNumber(e.maxFrameDelta, Zc)
|
|
12099
12111
|
};
|
|
12100
12112
|
}
|
|
12101
12113
|
/** 规范化外部关键帧,并以四元数作为旋转的权威数据。 */
|
|
@@ -12189,7 +12201,7 @@ class Zc {
|
|
|
12189
12201
|
}
|
|
12190
12202
|
/** 播放期间解除引擎空闲限帧。 */
|
|
12191
12203
|
setFrameRateExempt(e) {
|
|
12192
|
-
this.engine.setIdleFrameRateExempt?.(
|
|
12204
|
+
this.engine.setIdleFrameRateExempt?.($c, e);
|
|
12193
12205
|
}
|
|
12194
12206
|
isValidPointIndex(e) {
|
|
12195
12207
|
return Number.isInteger(e) && e >= 0 && e < this.points.length;
|
|
@@ -12250,7 +12262,7 @@ class Zc {
|
|
|
12250
12262
|
return { x: e.x, y: e.y, z: e.z, w: e.w };
|
|
12251
12263
|
}
|
|
12252
12264
|
}
|
|
12253
|
-
class
|
|
12265
|
+
class th {
|
|
12254
12266
|
engine;
|
|
12255
12267
|
miniMapCamera = null;
|
|
12256
12268
|
miniMapRenderer = null;
|
|
@@ -12328,7 +12340,7 @@ class eh {
|
|
|
12328
12340
|
}
|
|
12329
12341
|
}
|
|
12330
12342
|
init() {
|
|
12331
|
-
this.miniMapContainer = document.createElement("div"), this.miniMapContainer.style.position = "absolute", this.applyContainerPosition(), this.miniMapContainer.style.width = `${this.currentMapWidth}px`, this.miniMapContainer.style.height = `${this.currentMapHeight}px`, this.miniMapContainer.style.border = "2px solid rgba(255, 255, 255, 0.4)", this.miniMapContainer.style.borderRadius = "4px", this.miniMapContainer.style.overflow = "hidden", this.miniMapContainer.style.display = "none", this.miniMapContainer.style.pointerEvents = "auto", this.miniMapContainer.style.touchAction = "none", this.miniMapContainer.style.cursor = "crosshair", this.engine.container.appendChild(this.miniMapContainer), this.miniMapRenderer = new
|
|
12343
|
+
this.miniMapContainer = document.createElement("div"), this.miniMapContainer.style.position = "absolute", this.applyContainerPosition(), this.miniMapContainer.style.width = `${this.currentMapWidth}px`, this.miniMapContainer.style.height = `${this.currentMapHeight}px`, this.miniMapContainer.style.border = "2px solid rgba(255, 255, 255, 0.4)", this.miniMapContainer.style.borderRadius = "4px", this.miniMapContainer.style.overflow = "hidden", this.miniMapContainer.style.display = "none", this.miniMapContainer.style.pointerEvents = "auto", this.miniMapContainer.style.touchAction = "none", this.miniMapContainer.style.cursor = "crosshair", this.engine.container.appendChild(this.miniMapContainer), this.miniMapRenderer = new ws({ alpha: !0, antialias: !1 }), this.miniMapRenderer.setSize(this.currentMapWidth, this.currentMapHeight), this.miniMapRenderer.setPixelRatio(window.devicePixelRatio), this.miniMapRenderer.setClearColor(1710638, 0.85), this.miniMapContainer.appendChild(this.miniMapRenderer.domElement);
|
|
12332
12344
|
const e = window.devicePixelRatio || 1;
|
|
12333
12345
|
this.overlayCanvas = document.createElement("canvas"), this.overlayCanvas.width = this.currentMapWidth * e, this.overlayCanvas.height = this.currentMapHeight * e, this.overlayCanvas.style.position = "absolute", this.overlayCanvas.style.top = "0", this.overlayCanvas.style.left = "0", this.overlayCanvas.style.width = `${this.currentMapWidth}px`, this.overlayCanvas.style.height = `${this.currentMapHeight}px`, this.overlayCanvas.style.pointerEvents = "none", this.miniMapContainer.appendChild(this.overlayCanvas), this.overlayCtx = this.overlayCanvas.getContext("2d"), this.overlayCtx && this.overlayCtx.scale(e, e), this.initLevelSelectors(), this.initResizeHandle(), this.initSizeToggleButton(), this.miniMapCamera = new Ne(
|
|
12334
12346
|
-this.currentHalfSize,
|
|
@@ -12673,7 +12685,7 @@ class eh {
|
|
|
12673
12685
|
p.rotateYaw(-c);
|
|
12674
12686
|
return;
|
|
12675
12687
|
}
|
|
12676
|
-
const g = i.getWorldDirection(new d()).multiplyScalar(h), y = new
|
|
12688
|
+
const g = i.getWorldDirection(new d()).multiplyScalar(h), y = new jo().setFromVector3(g);
|
|
12677
12689
|
y.theta -= c, g.setFromSpherical(y), n.target?.copy(i.position).add(g), n.update?.(), this.engine.controlModule?.firstPersonControls?.syncRotationStateFromCamera?.();
|
|
12678
12690
|
}
|
|
12679
12691
|
drawOverlay() {
|
|
@@ -12732,7 +12744,7 @@ class eh {
|
|
|
12732
12744
|
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, !0), window.removeEventListener("pointermove", this.onMouseMove), window.removeEventListener("pointerup", this.onMouseUp, !0), window.removeEventListener("pointercancel", this.onMouseUp, !0), window.removeEventListener("blur", this.onWindowBlur), 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;
|
|
12733
12745
|
}
|
|
12734
12746
|
}
|
|
12735
|
-
class
|
|
12747
|
+
class ih {
|
|
12736
12748
|
engine;
|
|
12737
12749
|
constructor(e) {
|
|
12738
12750
|
this.engine = e;
|
|
@@ -13029,26 +13041,26 @@ class th {
|
|
|
13029
13041
|
return Math.abs(s.dot(e)) < 0.999 ? s : new d(1, 0, 0);
|
|
13030
13042
|
}
|
|
13031
13043
|
}
|
|
13032
|
-
class
|
|
13044
|
+
class nh {
|
|
13033
13045
|
engine;
|
|
13034
13046
|
constructor(e) {
|
|
13035
13047
|
}
|
|
13036
13048
|
update() {
|
|
13037
13049
|
}
|
|
13038
13050
|
}
|
|
13039
|
-
const
|
|
13040
|
-
class
|
|
13051
|
+
const es = "bim-engine:link-element-2d3d-state", ts = "link-element-2d3d";
|
|
13052
|
+
class sh {
|
|
13041
13053
|
engine;
|
|
13042
13054
|
constructor(e) {
|
|
13043
13055
|
this.engine = e, this.active();
|
|
13044
13056
|
}
|
|
13045
13057
|
// 激活
|
|
13046
13058
|
active() {
|
|
13047
|
-
window.addEventListener("D2ElementClick", this.listenElementClick), window.addEventListener(
|
|
13059
|
+
window.addEventListener("D2ElementClick", this.listenElementClick), window.addEventListener(es, this.listenLinkStateChange);
|
|
13048
13060
|
}
|
|
13049
13061
|
// 取消
|
|
13050
13062
|
disActive() {
|
|
13051
|
-
window.removeEventListener("D2ElementClick", this.listenElementClick), window.removeEventListener(
|
|
13063
|
+
window.removeEventListener("D2ElementClick", this.listenElementClick), window.removeEventListener(es, this.listenLinkStateChange), this.engine?.setIdleFrameRateExempt?.(ts, !1);
|
|
13052
13064
|
}
|
|
13053
13065
|
dispose() {
|
|
13054
13066
|
this.disActive();
|
|
@@ -13068,10 +13080,10 @@ class nh {
|
|
|
13068
13080
|
/** 二三维模型联动开启时保持 3D 引擎全帧渲染,避免等待空闲限帧间隔。 */
|
|
13069
13081
|
listenLinkStateChange = (e) => {
|
|
13070
13082
|
const t = e.detail?.enabled === !0;
|
|
13071
|
-
this.engine?.setIdleFrameRateExempt?.(
|
|
13083
|
+
this.engine?.setIdleFrameRateExempt?.(ts, t);
|
|
13072
13084
|
};
|
|
13073
13085
|
}
|
|
13074
|
-
class
|
|
13086
|
+
class oh {
|
|
13075
13087
|
engine;
|
|
13076
13088
|
constructor(e) {
|
|
13077
13089
|
this.engine = e, this.active();
|
|
@@ -13120,12 +13132,12 @@ class sh {
|
|
|
13120
13132
|
i?.target ? (i.target.copy(l), i.update(), i.dispatchEvent?.({ type: "change" })) : t.lookAt(l);
|
|
13121
13133
|
}
|
|
13122
13134
|
}
|
|
13123
|
-
const
|
|
13135
|
+
const mt = {
|
|
13124
13136
|
EncodingStart: "encoding-start",
|
|
13125
13137
|
EncodingComplete: "encoding-complete",
|
|
13126
13138
|
EncodingError: "encoding-error"
|
|
13127
13139
|
};
|
|
13128
|
-
class
|
|
13140
|
+
class rh {
|
|
13129
13141
|
engine;
|
|
13130
13142
|
apiKey;
|
|
13131
13143
|
baseURL = "https://api.deepseek.com";
|
|
@@ -13206,14 +13218,14 @@ class oh {
|
|
|
13206
13218
|
// 开始编码
|
|
13207
13219
|
async start() {
|
|
13208
13220
|
let e = ["注释", "族名称"], t = ["梁", "墩", "桩", "墙", "面", "台", "石", "支"];
|
|
13209
|
-
this.engine.events.trigger(
|
|
13221
|
+
this.engine.events.trigger(mt.EncodingStart, { message: "编码开始" });
|
|
13210
13222
|
let i = [], n = "";
|
|
13211
13223
|
if (this.engine.models.forEach((c) => {
|
|
13212
13224
|
n = c.url, c.nodesMap.forEach((h, u) => {
|
|
13213
13225
|
t.some((p) => h.infos[0].name.includes(p)) && i.push({ id: u, url: c.url });
|
|
13214
13226
|
});
|
|
13215
13227
|
}), i.length === 0) {
|
|
13216
|
-
this.engine.events.trigger(
|
|
13228
|
+
this.engine.events.trigger(mt.EncodingComplete, { message: "无匹配构件", results: [] });
|
|
13217
13229
|
return;
|
|
13218
13230
|
}
|
|
13219
13231
|
let s = await this.queryProperties(i, e);
|
|
@@ -13221,7 +13233,7 @@ class oh {
|
|
|
13221
13233
|
let r = [], l = Math.ceil(s.length / o);
|
|
13222
13234
|
for (let c = 0; c < s.length; c += o) {
|
|
13223
13235
|
let h = s.slice(c, c + o), u = Math.floor(c / o) + 1;
|
|
13224
|
-
this.engine.events.trigger(
|
|
13236
|
+
this.engine.events.trigger(mt.EncodingStart, {
|
|
13225
13237
|
message: `正在编码第 ${u}/${l} 批`,
|
|
13226
13238
|
batch: u,
|
|
13227
13239
|
totalBatches: l
|
|
@@ -13230,13 +13242,13 @@ class oh {
|
|
|
13230
13242
|
let p = await this.startChat(n, JSON.stringify(h));
|
|
13231
13243
|
r = r.concat(p);
|
|
13232
13244
|
} catch (p) {
|
|
13233
|
-
this.engine.events.trigger(
|
|
13245
|
+
this.engine.events.trigger(mt.EncodingError, {
|
|
13234
13246
|
message: `第 ${u} 批编码失败`,
|
|
13235
13247
|
error: p
|
|
13236
13248
|
});
|
|
13237
13249
|
}
|
|
13238
13250
|
}
|
|
13239
|
-
this.engine.events.trigger(
|
|
13251
|
+
this.engine.events.trigger(mt.EncodingComplete, {
|
|
13240
13252
|
message: "编码完成",
|
|
13241
13253
|
url: n,
|
|
13242
13254
|
results: r,
|
|
@@ -13277,7 +13289,7 @@ class oh {
|
|
|
13277
13289
|
r.set(l.id, c);
|
|
13278
13290
|
}), this.engine.modelProperties.updateExtended(e, r), this.savaModelCodeToStoge(e), o;
|
|
13279
13291
|
} catch (i) {
|
|
13280
|
-
return console.error("编码失败:", i), this.engine.events.trigger(
|
|
13292
|
+
return console.error("编码失败:", i), this.engine.events.trigger(mt.EncodingError, {
|
|
13281
13293
|
message: "编码失败",
|
|
13282
13294
|
error: i
|
|
13283
13295
|
}), [];
|
|
@@ -13313,12 +13325,12 @@ class oh {
|
|
|
13313
13325
|
}
|
|
13314
13326
|
}
|
|
13315
13327
|
}
|
|
13316
|
-
const Ii = 1 / 0.3048,
|
|
13328
|
+
const Ii = 1 / 0.3048, ah = 1, lh = 1.8, is = /* @__PURE__ */ new Set([
|
|
13317
13329
|
"dynamic-elevation-bar-area",
|
|
13318
13330
|
"dynamic-elevation-guest-area",
|
|
13319
13331
|
"dynamic-elevation-door-head-area"
|
|
13320
|
-
]),
|
|
13321
|
-
class
|
|
13332
|
+
]), ch = ["台面"], hh = ["咖啡机"], dh = ["门店编号"], uh = ["发光logo", "发光Logo"];
|
|
13333
|
+
class ph {
|
|
13322
13334
|
engine;
|
|
13323
13335
|
constructor(e) {
|
|
13324
13336
|
this.engine = e;
|
|
@@ -13332,10 +13344,10 @@ class uh {
|
|
|
13332
13344
|
return null;
|
|
13333
13345
|
const t = e.views ?? {}, i = (t.Elevations ?? []).filter((o) => {
|
|
13334
13346
|
const r = o?.Id ?? o?.id;
|
|
13335
|
-
return !
|
|
13347
|
+
return !is.has(String(r ?? ""));
|
|
13336
13348
|
}), n = (t.DynamicViews ?? []).filter((o) => {
|
|
13337
13349
|
const r = o?.Id ?? o?.id, l = String(r ?? "");
|
|
13338
|
-
return !
|
|
13350
|
+
return !is.has(l) && !l.startsWith("dynamic-elevation-door-head-area");
|
|
13339
13351
|
}), s = this.generate(e);
|
|
13340
13352
|
return e.views = {
|
|
13341
13353
|
...t,
|
|
@@ -13352,7 +13364,7 @@ class uh {
|
|
|
13352
13364
|
generate(e) {
|
|
13353
13365
|
if (!(e?.nodesMap instanceof Map) || e.nodesMap.size === 0)
|
|
13354
13366
|
return [];
|
|
13355
|
-
const t = this.collectMergedWorldBoxByKeywords(e,
|
|
13367
|
+
const t = this.collectMergedWorldBoxByKeywords(e, ch), i = this.collectMergedWorldBoxByKeywords(e, hh), n = this.collectMergedWorldBoxByKeywords(e, dh), s = this.collectWorldBoxesByKeywords(e, uh), o = [];
|
|
13356
13368
|
if (t && i && n) {
|
|
13357
13369
|
const r = this.createBarAreaView(t, i, n), l = this.createGuestAreaView(t, i, n);
|
|
13358
13370
|
r && o.push(r), l && o.push(l);
|
|
@@ -13443,8 +13455,8 @@ class uh {
|
|
|
13443
13455
|
* 相机始终在观察面外侧偏移固定距离,且高度统一锁定为 1.8 米。
|
|
13444
13456
|
*/
|
|
13445
13457
|
createCameraPosition(e, t) {
|
|
13446
|
-
const i = e.clone().add(t.clone().multiplyScalar(
|
|
13447
|
-
return i.y =
|
|
13458
|
+
const i = e.clone().add(t.clone().multiplyScalar(ah));
|
|
13459
|
+
return i.y = lh, i;
|
|
13448
13460
|
}
|
|
13449
13461
|
/**
|
|
13450
13462
|
* 将 three.js 空间中的观察参数转换成运行时立面视图结构。
|
|
@@ -13619,8 +13631,8 @@ class uh {
|
|
|
13619
13631
|
};
|
|
13620
13632
|
}
|
|
13621
13633
|
}
|
|
13622
|
-
const
|
|
13623
|
-
function
|
|
13634
|
+
const ns = 16, ss = 0.02, Di = 1e-6, gh = 600;
|
|
13635
|
+
function eo() {
|
|
13624
13636
|
return {
|
|
13625
13637
|
ceilingPlans: [],
|
|
13626
13638
|
elevations: [],
|
|
@@ -13629,14 +13641,14 @@ function Zs() {
|
|
|
13629
13641
|
sections: []
|
|
13630
13642
|
};
|
|
13631
13643
|
}
|
|
13632
|
-
function
|
|
13644
|
+
function to(a, e) {
|
|
13633
13645
|
return {
|
|
13634
13646
|
id: a.Id ?? a.id,
|
|
13635
13647
|
name: a.Name ?? a.name,
|
|
13636
13648
|
url: e
|
|
13637
13649
|
};
|
|
13638
13650
|
}
|
|
13639
|
-
class
|
|
13651
|
+
class mh {
|
|
13640
13652
|
engine;
|
|
13641
13653
|
resolveViewTree;
|
|
13642
13654
|
openView;
|
|
@@ -13646,7 +13658,7 @@ class gh {
|
|
|
13646
13658
|
}
|
|
13647
13659
|
/** 获取构件可见的动态视图,并可选择直接打开第一个匹配项。 */
|
|
13648
13660
|
getElementVisibleViews(e, t, i = !1) {
|
|
13649
|
-
const n =
|
|
13661
|
+
const n = eo(), s = this.engine.models.find((p) => p.url === e);
|
|
13650
13662
|
if (!s)
|
|
13651
13663
|
return n;
|
|
13652
13664
|
const o = this.findModelNode(s, t), r = this.getNodeWorldBox(s, o), l = this.resolveViewTree(e);
|
|
@@ -13659,7 +13671,7 @@ class gh {
|
|
|
13659
13671
|
h = p.length > 0 ? p : [this.getNearestCameraCandidate(c, r)];
|
|
13660
13672
|
}
|
|
13661
13673
|
h.forEach((p) => {
|
|
13662
|
-
n.dynamicViews.push(
|
|
13674
|
+
n.dynamicViews.push(to(p.view, e));
|
|
13663
13675
|
});
|
|
13664
13676
|
const u = n.dynamicViews[0];
|
|
13665
13677
|
return i && u ? this.openView(u.url, u.id, () => {
|
|
@@ -13719,14 +13731,14 @@ class gh {
|
|
|
13719
13731
|
t.projectionMatrix,
|
|
13720
13732
|
t.matrixWorldInverse
|
|
13721
13733
|
);
|
|
13722
|
-
if (new
|
|
13734
|
+
if (new Ko().setFromProjectionMatrix(i).intersectsBox(e))
|
|
13723
13735
|
return;
|
|
13724
13736
|
const s = e.getCenter(new d()), o = this.engine.cameraModule?.rotateToTarget;
|
|
13725
13737
|
if (typeof o == "function") {
|
|
13726
13738
|
o.call(
|
|
13727
13739
|
this.engine.cameraModule,
|
|
13728
13740
|
s,
|
|
13729
|
-
|
|
13741
|
+
gh,
|
|
13730
13742
|
() => this.syncControlRotationState()
|
|
13731
13743
|
);
|
|
13732
13744
|
return;
|
|
@@ -13749,13 +13761,13 @@ class gh {
|
|
|
13749
13761
|
*/
|
|
13750
13762
|
createElementSamplePoints(e, t, i, n) {
|
|
13751
13763
|
const s = this.collectSampleSources(e, t), o = [];
|
|
13752
|
-
for (let r = 0; r <
|
|
13764
|
+
for (let r = 0; r < ns && s.length > 0; r++) {
|
|
13753
13765
|
const l = s[r % s.length], c = this.sampleGeometrySurface(l, n);
|
|
13754
13766
|
c && o.push(c);
|
|
13755
13767
|
}
|
|
13756
13768
|
if (o.length > 0)
|
|
13757
13769
|
return o;
|
|
13758
|
-
for (o.push(i.getCenter(new d())); o.length <
|
|
13770
|
+
for (o.push(i.getCenter(new d())); o.length < ns; )
|
|
13759
13771
|
o.push(new d(
|
|
13760
13772
|
O.lerp(i.min.x, i.max.x, n()),
|
|
13761
13773
|
O.lerp(i.min.y, i.max.y, n()),
|
|
@@ -13802,9 +13814,9 @@ class gh {
|
|
|
13802
13814
|
if (typeof s != "function")
|
|
13803
13815
|
return !1;
|
|
13804
13816
|
const o = t.clone().sub(e), r = o.length();
|
|
13805
|
-
if (r <=
|
|
13817
|
+
if (r <= ss)
|
|
13806
13818
|
return !0;
|
|
13807
|
-
this.raycaster.near = 0, this.raycaster.far = r +
|
|
13819
|
+
this.raycaster.near = 0, this.raycaster.far = r + ss, this.raycaster.set(e, o.normalize());
|
|
13808
13820
|
const c = (s.call(
|
|
13809
13821
|
this.engine.octreeBox,
|
|
13810
13822
|
this.raycaster,
|
|
@@ -13849,12 +13861,12 @@ const $t = {
|
|
|
13849
13861
|
floorPlan: "楼层平面",
|
|
13850
13862
|
elevation: "立面视图",
|
|
13851
13863
|
section: "剖面视图"
|
|
13852
|
-
},
|
|
13864
|
+
}, fh = {
|
|
13853
13865
|
ceilingPlan: [$t.ceilingPlan, "天花"],
|
|
13854
13866
|
floorPlan: [$t.floorPlan, "楼层"],
|
|
13855
13867
|
elevation: [$t.elevation, "立面"],
|
|
13856
13868
|
section: [$t.section, "剖面"]
|
|
13857
|
-
},
|
|
13869
|
+
}, yh = [
|
|
13858
13870
|
["CeilingPlans", "ceilingPlans"],
|
|
13859
13871
|
["Elevations", "elevations"],
|
|
13860
13872
|
["DynamicViews", "dynamicViews"],
|
|
@@ -13868,7 +13880,7 @@ class on {
|
|
|
13868
13880
|
dynamicViewVisibility;
|
|
13869
13881
|
/** 管理模型原生视图与运行时动态视图的统一入口。 */
|
|
13870
13882
|
constructor(e) {
|
|
13871
|
-
this.engine = e, this.dynamicElevationViewGenerator = new
|
|
13883
|
+
this.engine = e, this.dynamicElevationViewGenerator = new ph(e), this.dynamicViewVisibility = new mh(
|
|
13872
13884
|
e,
|
|
13873
13885
|
(t) => this.getResolvedViewTree(t),
|
|
13874
13886
|
(t, i, n) => this.openViewInternal(t, i, n)
|
|
@@ -13887,10 +13899,10 @@ class on {
|
|
|
13887
13899
|
}
|
|
13888
13900
|
/** 获取单个模型的视图树数据,并补充运行时生成的动态视图分类。 */
|
|
13889
13901
|
getViewTreeData(e) {
|
|
13890
|
-
const t = this.getResolvedViewTree(e), i =
|
|
13891
|
-
return t &&
|
|
13902
|
+
const t = this.getResolvedViewTree(e), i = eo();
|
|
13903
|
+
return t && yh.forEach(([n, s]) => {
|
|
13892
13904
|
(t[n] ?? []).forEach((o) => {
|
|
13893
|
-
i[s].push(
|
|
13905
|
+
i[s].push(to(o, e));
|
|
13894
13906
|
});
|
|
13895
13907
|
}), i;
|
|
13896
13908
|
}
|
|
@@ -14003,7 +14015,7 @@ class on {
|
|
|
14003
14015
|
const t = String(e ?? "").replace(/\s+/g, "");
|
|
14004
14016
|
if (!t)
|
|
14005
14017
|
return "unknown";
|
|
14006
|
-
const i = Object.entries(
|
|
14018
|
+
const i = Object.entries(fh);
|
|
14007
14019
|
for (const [n, s] of i)
|
|
14008
14020
|
if (s.some((o) => t.includes(o)))
|
|
14009
14021
|
return n;
|
|
@@ -14040,12 +14052,12 @@ class on {
|
|
|
14040
14052
|
!t || t.isEmpty?.() || this.engine.viewCube?.zoomToModel?.(t, e);
|
|
14041
14053
|
}
|
|
14042
14054
|
}
|
|
14043
|
-
class
|
|
14055
|
+
class vh {
|
|
14044
14056
|
engine;
|
|
14045
14057
|
sectionPlaneGroup = null;
|
|
14046
14058
|
loaderModule2d;
|
|
14047
14059
|
constructor(e) {
|
|
14048
|
-
this.engine = e, this.loaderModule2d = new
|
|
14060
|
+
this.engine = e, this.loaderModule2d = new Dr(this.engine);
|
|
14049
14061
|
}
|
|
14050
14062
|
/**
|
|
14051
14063
|
* 根据剖切面原点与视线方向,生成与场景 boundingBox 同大的平面 mesh 并添加到场景(贴到剖面上)
|
|
@@ -14110,16 +14122,16 @@ class yh {
|
|
|
14110
14122
|
), l.setPosition(e), l;
|
|
14111
14123
|
}
|
|
14112
14124
|
}
|
|
14113
|
-
function
|
|
14125
|
+
function Mh(a, e, t = "bim-snapshot.png") {
|
|
14114
14126
|
const i = a?.renderer, n = i?.domElement;
|
|
14115
14127
|
if (!i || !n || !e)
|
|
14116
14128
|
return null;
|
|
14117
14129
|
const s = n.width || n.clientWidth, o = n.height || n.clientHeight;
|
|
14118
14130
|
if (s <= 0 || o <= 0)
|
|
14119
14131
|
return null;
|
|
14120
|
-
let r =
|
|
14121
|
-
if (!
|
|
14122
|
-
const p =
|
|
14132
|
+
let r = bh(n, s, o);
|
|
14133
|
+
if (!xh(r)) {
|
|
14134
|
+
const p = wh(a, s, o);
|
|
14123
14135
|
p && (r = p);
|
|
14124
14136
|
}
|
|
14125
14137
|
const l = document.createElement("canvas");
|
|
@@ -14131,13 +14143,13 @@ function vh(a, e, t = "bim-snapshot.png") {
|
|
|
14131
14143
|
const h = l.toDataURL("image/png"), u = document.createElement("a");
|
|
14132
14144
|
return u.href = h, u.download = t.toLowerCase().endsWith(".png") ? t : `${t}.png`, u.click(), h;
|
|
14133
14145
|
}
|
|
14134
|
-
function
|
|
14146
|
+
function bh(a, e, t) {
|
|
14135
14147
|
const i = document.createElement("canvas");
|
|
14136
14148
|
i.width = e, i.height = t;
|
|
14137
14149
|
const n = i.getContext("2d");
|
|
14138
14150
|
return n && n.drawImage(a, 0, 0, e, t), i;
|
|
14139
14151
|
}
|
|
14140
|
-
function
|
|
14152
|
+
function xh(a) {
|
|
14141
14153
|
const e = a.getContext("2d");
|
|
14142
14154
|
if (!e || a.width <= 0 || a.height <= 0)
|
|
14143
14155
|
return !1;
|
|
@@ -14150,28 +14162,28 @@ function bh(a) {
|
|
|
14150
14162
|
}
|
|
14151
14163
|
return !1;
|
|
14152
14164
|
}
|
|
14153
|
-
function
|
|
14165
|
+
function wh(a, e, t) {
|
|
14154
14166
|
const i = a?.renderer, n = a?.scene, s = a?.camera;
|
|
14155
14167
|
if (!i || !n || !s)
|
|
14156
14168
|
return null;
|
|
14157
|
-
const o = new
|
|
14169
|
+
const o = new Yo(e, t, {
|
|
14158
14170
|
minFilter: dn,
|
|
14159
14171
|
magFilter: dn,
|
|
14160
|
-
format:
|
|
14172
|
+
format: Qo,
|
|
14161
14173
|
depthBuffer: !0,
|
|
14162
14174
|
stencilBuffer: !0
|
|
14163
14175
|
}), r = i.getRenderTarget(), l = i.autoClear, c = i.xr?.enabled ?? !1;
|
|
14164
14176
|
try {
|
|
14165
14177
|
i.xr && (i.xr.enabled = !1), i.autoClear = !0, i.setRenderTarget(o), i.clear(!0, !0, !0), i.render(n, s);
|
|
14166
14178
|
const h = new Uint8Array(e * t * 4);
|
|
14167
|
-
return i.readRenderTargetPixels(o, 0, 0, e, t, h),
|
|
14179
|
+
return i.readRenderTargetPixels(o, 0, 0, e, t, h), Ch(h, e, t);
|
|
14168
14180
|
} catch {
|
|
14169
14181
|
return null;
|
|
14170
14182
|
} finally {
|
|
14171
14183
|
i.setRenderTarget(r), i.autoClear = l, i.xr && (i.xr.enabled = c), o.dispose();
|
|
14172
14184
|
}
|
|
14173
14185
|
}
|
|
14174
|
-
function
|
|
14186
|
+
function Ch(a, e, t) {
|
|
14175
14187
|
const i = document.createElement("canvas");
|
|
14176
14188
|
i.width = e, i.height = t;
|
|
14177
14189
|
const n = i.getContext("2d");
|
|
@@ -14185,7 +14197,7 @@ function wh(a, e, t) {
|
|
|
14185
14197
|
}
|
|
14186
14198
|
return n.putImageData(s, 0, 0), i;
|
|
14187
14199
|
}
|
|
14188
|
-
const
|
|
14200
|
+
const Eh = [
|
|
14189
14201
|
"#ffffff",
|
|
14190
14202
|
"#000000",
|
|
14191
14203
|
"#ff4d4f",
|
|
@@ -14196,7 +14208,7 @@ const Ch = [
|
|
|
14196
14208
|
"#1677ff",
|
|
14197
14209
|
"#722ed1",
|
|
14198
14210
|
"#eb2f96"
|
|
14199
|
-
],
|
|
14211
|
+
], Sh = {
|
|
14200
14212
|
none: Z("/assets/icon/选择.svg", import.meta.url),
|
|
14201
14213
|
line: Z("/assets/icon/线.svg", import.meta.url),
|
|
14202
14214
|
arrow: Z("/assets/icon/箭头.svg", import.meta.url),
|
|
@@ -14204,7 +14216,7 @@ const Ch = [
|
|
|
14204
14216
|
circle: Z("/assets/icon/圆形.svg", import.meta.url),
|
|
14205
14217
|
text: Z("/assets/icon/文字.svg", import.meta.url),
|
|
14206
14218
|
cloudline: Z("/assets/icon/云线.svg", import.meta.url)
|
|
14207
|
-
},
|
|
14219
|
+
}, Ah = Z("/assets/icon/测距.svg", import.meta.url), Ph = Z("/assets/icon/截图.svg", import.meta.url), Th = Z("/assets/icon/线宽.svg", import.meta.url), Ih = Z("/assets/icon/字号.svg", import.meta.url), Dh = `data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2l4 8-4 12-4-12 4-8z" fill="#1677ff"/><circle cx="12" cy="10" r="2.5" fill="#fff"/></svg>')}`, _h = [
|
|
14208
14220
|
{ type: "distance", label: "距离" },
|
|
14209
14221
|
{ type: "clearDistance", label: "净距" },
|
|
14210
14222
|
{ type: "clearHeight", label: "净高" },
|
|
@@ -14213,7 +14225,7 @@ const Ch = [
|
|
|
14213
14225
|
{ type: "angle", label: "角度" },
|
|
14214
14226
|
{ type: "area", label: "面积" },
|
|
14215
14227
|
{ type: "slope", label: "坡度" }
|
|
14216
|
-
],
|
|
14228
|
+
], kh = {
|
|
14217
14229
|
distance: Z("/assets/icon/距离.svg", import.meta.url),
|
|
14218
14230
|
clearDistance: Z("/assets/icon/净距.svg", import.meta.url),
|
|
14219
14231
|
clearHeight: Z("/assets/icon/净高.svg", import.meta.url),
|
|
@@ -14223,7 +14235,7 @@ const Ch = [
|
|
|
14223
14235
|
area: Z("/assets/icon/面积.svg", import.meta.url),
|
|
14224
14236
|
slope: Z("/assets/icon/坡度.svg", import.meta.url)
|
|
14225
14237
|
};
|
|
14226
|
-
class
|
|
14238
|
+
class Lh {
|
|
14227
14239
|
constructor(e, t) {
|
|
14228
14240
|
this.handlers = e, this.root = document.createElement("div"), this.root.style.position = "absolute", this.root.style.top = "8px", this.root.style.left = "50%", this.root.style.transform = "translateX(-50%)", this.root.style.display = "none", this.root.style.padding = "6px", this.root.style.background = "#ffffff", this.root.style.border = "1px solid #d9d9d9", this.root.style.borderRadius = "8px", this.root.style.pointerEvents = "auto", this.root.style.userSelect = "none", this.root.style.boxShadow = "0 4px 14px rgba(0, 0, 0, 0.12)", this.root.style.zIndex = "1300", this.root.style.overflow = "visible", this.editPanel = document.createElement("div"), this.editPanel.style.display = "flex", this.editPanel.style.flexDirection = "column", this.editPanel.style.gap = "6px", this.viewPanel = document.createElement("div"), this.viewPanel.style.display = "none", this.viewPanel.style.alignItems = "center", this.viewPanel.style.gap = "6px";
|
|
14229
14241
|
const i = document.createElement("div");
|
|
@@ -14236,7 +14248,7 @@ class kh {
|
|
|
14236
14248
|
{ type: "text", label: "文字" },
|
|
14237
14249
|
{ type: "cloudline", label: "云线" }
|
|
14238
14250
|
].forEach((y) => {
|
|
14239
|
-
const b = this.createIconButton(y.label,
|
|
14251
|
+
const b = this.createIconButton(y.label, Sh[y.type]);
|
|
14240
14252
|
b.onclick = () => this.handlers.onDrawTypeChange(y.type), this.drawButtons[y.type] = b, i.appendChild(b);
|
|
14241
14253
|
});
|
|
14242
14254
|
const s = document.createElement("div");
|
|
@@ -14246,23 +14258,23 @@ class kh {
|
|
|
14246
14258
|
this.updateColorControl(this.colorInput.value), this.handlers.onColorChange(this.colorInput.value), this.setColorPresetVisible(!1);
|
|
14247
14259
|
}, s.appendChild(this.colorInput), this.colorPresetPanel = document.createElement("div"), this.colorPresetPanel.style.position = "absolute", this.colorPresetPanel.style.top = "30px", this.colorPresetPanel.style.left = "0", this.colorPresetPanel.style.display = "none", this.colorPresetPanel.style.padding = "8px", this.colorPresetPanel.style.background = "#ffffff", this.colorPresetPanel.style.border = "1px solid #d9d9d9", this.colorPresetPanel.style.borderRadius = "6px", this.colorPresetPanel.style.boxShadow = "0 6px 18px rgba(0, 0, 0, 0.14)", this.colorPresetPanel.style.zIndex = "20", this.colorPresetPanel.style.width = "152px";
|
|
14248
14260
|
const r = document.createElement("div");
|
|
14249
|
-
r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px",
|
|
14261
|
+
r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px", Eh.forEach((y) => {
|
|
14250
14262
|
const b = document.createElement("button");
|
|
14251
14263
|
b.type = "button", b.title = y, b.style.width = "22px", b.style.height = "22px", b.style.padding = "0", b.style.border = "1px solid #d9d9d9", b.style.borderRadius = "4px", b.style.background = y, b.style.cursor = "pointer", b.onclick = () => {
|
|
14252
14264
|
this.updateColorControl(y), this.handlers.onColorChange(y), this.setColorPresetVisible(!1);
|
|
14253
14265
|
}, r.appendChild(b);
|
|
14254
14266
|
}), this.colorPresetPanel.appendChild(r);
|
|
14255
14267
|
const l = document.createElement("button");
|
|
14256
|
-
l.type = "button", l.textContent = "自定义", l.style.marginTop = "8px", l.style.width = "100%", l.style.height = "26px", l.style.border = "1px solid #d9d9d9", l.style.borderRadius = "4px", l.style.background = "#ffffff", l.style.color = "#333333", l.style.cursor = "pointer", l.onclick = () => this.openNativeColorPicker(), this.colorPresetPanel.appendChild(l), s.appendChild(this.colorPresetPanel), this.updateColorControl(t.stroke), i.appendChild(this.createField("", s)), this.strokeWidthInput = document.createElement("input"), this.strokeWidthInput.type = "number", this.strokeWidthInput.min = "1", this.strokeWidthInput.max = "20", this.strokeWidthInput.step = "1", this.strokeWidthInput.value = String(t.strokeWidth), this.strokeWidthInput.style.width = "46px", this.strokeWidthInput.oninput = () => this.handlers.onStrokeWidthChange(this.strokeWidthInput.value), i.appendChild(this.createField("", this.strokeWidthInput,
|
|
14257
|
-
const c = this.createIconButton("截图",
|
|
14268
|
+
l.type = "button", l.textContent = "自定义", l.style.marginTop = "8px", l.style.width = "100%", l.style.height = "26px", l.style.border = "1px solid #d9d9d9", l.style.borderRadius = "4px", l.style.background = "#ffffff", l.style.color = "#333333", l.style.cursor = "pointer", l.onclick = () => this.openNativeColorPicker(), this.colorPresetPanel.appendChild(l), s.appendChild(this.colorPresetPanel), this.updateColorControl(t.stroke), i.appendChild(this.createField("", s)), this.strokeWidthInput = document.createElement("input"), this.strokeWidthInput.type = "number", this.strokeWidthInput.min = "1", this.strokeWidthInput.max = "20", this.strokeWidthInput.step = "1", this.strokeWidthInput.value = String(t.strokeWidth), this.strokeWidthInput.style.width = "46px", this.strokeWidthInput.oninput = () => this.handlers.onStrokeWidthChange(this.strokeWidthInput.value), i.appendChild(this.createField("", this.strokeWidthInput, Th, "线宽")), this.fontSizeInput = document.createElement("input"), this.fontSizeInput.type = "number", this.fontSizeInput.min = "10", this.fontSizeInput.max = "96", this.fontSizeInput.step = "1", this.fontSizeInput.value = String(t.fontSize), this.fontSizeInput.style.width = "46px", this.fontSizeInput.oninput = () => this.handlers.onFontSizeChange(this.fontSizeInput.value), i.appendChild(this.createField("", this.fontSizeInput, Ih, "字号")), this.distanceButton = this.createIconButton("测量", Ah), this.distanceButton.onclick = () => this.handlers.onMeasureToggle(), i.appendChild(this.distanceButton);
|
|
14269
|
+
const c = this.createIconButton("截图", Ph);
|
|
14258
14270
|
c.onclick = () => this.handlers.onScreenshot(), i.appendChild(c);
|
|
14259
|
-
const h = this.createIconButton("捕捉点",
|
|
14271
|
+
const h = this.createIconButton("捕捉点", Dh);
|
|
14260
14272
|
h.onclick = () => this.handlers.onPickPoint(), i.appendChild(h);
|
|
14261
14273
|
const u = this.createTextButton("×", "取消");
|
|
14262
14274
|
u.onclick = () => this.handlers.onCancel(), u.style.background = "#ff4d4f", u.style.borderColor = "#ff4d4f", u.style.color = "#ffffff", i.appendChild(u);
|
|
14263
14275
|
const p = this.createTextButton("✔", "确定");
|
|
14264
|
-
p.onclick = () => this.handlers.onConfirm(), p.style.background = "#52c41a", p.style.borderColor = "#52c41a", p.style.color = "#ffffff", i.appendChild(p), this.measureSubPanel = document.createElement("div"), this.measureSubPanel.style.display = "none", this.measureSubPanel.style.alignItems = "center", this.measureSubPanel.style.gap = "6px", this.measureSubPanel.style.flexWrap = "wrap", this.measureSubPanel.style.paddingTop = "2px",
|
|
14265
|
-
const b = this.createSmallIconButton(y.label,
|
|
14276
|
+
p.onclick = () => this.handlers.onConfirm(), p.style.background = "#52c41a", p.style.borderColor = "#52c41a", p.style.color = "#ffffff", i.appendChild(p), this.measureSubPanel = document.createElement("div"), this.measureSubPanel.style.display = "none", this.measureSubPanel.style.alignItems = "center", this.measureSubPanel.style.gap = "6px", this.measureSubPanel.style.flexWrap = "wrap", this.measureSubPanel.style.paddingTop = "2px", _h.forEach((y) => {
|
|
14277
|
+
const b = this.createSmallIconButton(y.label, kh[y.type]);
|
|
14266
14278
|
b.onclick = () => this.handlers.onMeasureTypeChange(y.type), this.measureTypeButtons[y.type] = b, this.measureSubPanel.appendChild(b);
|
|
14267
14279
|
}), this.editPanel.appendChild(i), this.editPanel.appendChild(this.measureSubPanel);
|
|
14268
14280
|
const g = this.createTextButton("关闭", "关闭");
|
|
@@ -14388,7 +14400,7 @@ class kh {
|
|
|
14388
14400
|
return i.type = "button", i.title = t, i.textContent = e, i.style.width = "28px", i.style.height = "28px", i.style.padding = "0 10px", i.style.border = "1px solid #d9d9d9", i.style.borderRadius = "4px", i.style.background = "#ffffff", i.style.color = "#333333", i.style.fontSize = "13px", i.style.lineHeight = "1", i.style.cursor = "pointer", i;
|
|
14389
14401
|
}
|
|
14390
14402
|
}
|
|
14391
|
-
class
|
|
14403
|
+
class Rh {
|
|
14392
14404
|
engine;
|
|
14393
14405
|
wrapper;
|
|
14394
14406
|
canvasEl;
|
|
@@ -14427,7 +14439,7 @@ class Lh {
|
|
|
14427
14439
|
const t = this.engine.container;
|
|
14428
14440
|
if (!t)
|
|
14429
14441
|
throw new Error("FabricDraw: engine container not found.");
|
|
14430
|
-
this.wrapper = document.createElement("div"), this.wrapper.className = "fabric-draw-layer", this.wrapper.style.position = "absolute", this.wrapper.style.left = "0", this.wrapper.style.top = "0", this.wrapper.style.right = "0", this.wrapper.style.bottom = "0", this.wrapper.style.pointerEvents = "none", this.canvasEl = document.createElement("canvas"), this.canvasEl.style.width = "100%", this.canvasEl.style.height = "100%", this.wrapper.appendChild(this.canvasEl), this.toolbar = new
|
|
14442
|
+
this.wrapper = document.createElement("div"), this.wrapper.className = "fabric-draw-layer", this.wrapper.style.position = "absolute", this.wrapper.style.left = "0", this.wrapper.style.top = "0", this.wrapper.style.right = "0", this.wrapper.style.bottom = "0", this.wrapper.style.pointerEvents = "none", this.canvasEl = document.createElement("canvas"), this.canvasEl.style.width = "100%", this.canvasEl.style.height = "100%", this.wrapper.appendChild(this.canvasEl), this.toolbar = new Lh({
|
|
14431
14443
|
onDrawTypeChange: (n) => this.setDrawType(n),
|
|
14432
14444
|
onMeasureToggle: () => this.toggleMeasurePanel(),
|
|
14433
14445
|
onMeasureTypeChange: (n) => this.activateDistanceMeasure(n),
|
|
@@ -14453,7 +14465,7 @@ class Lh {
|
|
|
14453
14465
|
fontSize: this.drawStyle.fontSize
|
|
14454
14466
|
}), this.toolbar.mount(this.wrapper);
|
|
14455
14467
|
const i = this.engine.renderer?.domElement;
|
|
14456
|
-
i?.nextSibling ? t.insertBefore(this.wrapper, i.nextSibling) : t.appendChild(this.wrapper), this.canvas = new
|
|
14468
|
+
i?.nextSibling ? t.insertBefore(this.wrapper, i.nextSibling) : t.appendChild(this.wrapper), this.canvas = new pr(this.canvasEl, {
|
|
14457
14469
|
selection: !0,
|
|
14458
14470
|
preserveObjectStacking: !0
|
|
14459
14471
|
}), 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();
|
|
@@ -14539,7 +14551,7 @@ class Lh {
|
|
|
14539
14551
|
/**
|
|
14540
14552
|
* 鐩存帴缁樺埗鏂囧瓧銆? */
|
|
14541
14553
|
drawText(e, t, i) {
|
|
14542
|
-
const n = this.mergeStyle(i), s = new
|
|
14554
|
+
const n = this.mergeStyle(i), s = new gr(t ?? n.text, {
|
|
14543
14555
|
left: e.x,
|
|
14544
14556
|
top: e.y,
|
|
14545
14557
|
...this.createTextStyle(n),
|
|
@@ -14576,7 +14588,7 @@ class Lh {
|
|
|
14576
14588
|
* 鎴浘淇濆瓨锛堟ā鍨?Fabric鎵规敞鍚堟垚锛夈€? */
|
|
14577
14589
|
saveScreenshot(e = "bim-snapshot.png") {
|
|
14578
14590
|
const t = this.canvas.lowerCanvasEl;
|
|
14579
|
-
return t ?
|
|
14591
|
+
return t ? Mh(this.engine, t, e) : null;
|
|
14580
14592
|
}
|
|
14581
14593
|
/**
|
|
14582
14594
|
* 鍚屾鐢诲竷灏哄銆? */
|
|
@@ -14744,7 +14756,7 @@ class Lh {
|
|
|
14744
14756
|
return s.annotationType = "line", s;
|
|
14745
14757
|
}
|
|
14746
14758
|
createRectObject(e, t, i, n) {
|
|
14747
|
-
const s = this.getBoxFromPoints(e, t), o = new
|
|
14759
|
+
const s = this.getBoxFromPoints(e, t), o = new mr({
|
|
14748
14760
|
...this.createObjectBase(i, n),
|
|
14749
14761
|
left: s.left,
|
|
14750
14762
|
top: s.top,
|
|
@@ -14756,7 +14768,7 @@ class Lh {
|
|
|
14756
14768
|
return o.annotationType = "rect", o;
|
|
14757
14769
|
}
|
|
14758
14770
|
createCircleObject(e, t, i, n) {
|
|
14759
|
-
const s = this.getCircleFromPoints(e, t), o = new
|
|
14771
|
+
const s = this.getCircleFromPoints(e, t), o = new fr({
|
|
14760
14772
|
...this.createObjectBase(i, n),
|
|
14761
14773
|
left: s.left,
|
|
14762
14774
|
top: s.top,
|
|
@@ -15060,7 +15072,7 @@ class Lh {
|
|
|
15060
15072
|
return JSON.parse(JSON.stringify(e));
|
|
15061
15073
|
}
|
|
15062
15074
|
}
|
|
15063
|
-
class
|
|
15075
|
+
class Bh {
|
|
15064
15076
|
engine;
|
|
15065
15077
|
capturePoint = null;
|
|
15066
15078
|
labelPrefix = "drawing-pin-label-";
|
|
@@ -15510,7 +15522,7 @@ class Rh {
|
|
|
15510
15522
|
return e;
|
|
15511
15523
|
}
|
|
15512
15524
|
}
|
|
15513
|
-
const _i = "bim-engine:model-link-3d",
|
|
15525
|
+
const _i = "bim-engine:model-link-3d", zh = "default-model-link-3d-group", os = "model-link-3d", rs = {
|
|
15514
15526
|
enabled: !1,
|
|
15515
15527
|
highlight: !0,
|
|
15516
15528
|
visibility: !0,
|
|
@@ -15519,7 +15531,7 @@ const _i = "bim-engine:model-link-3d", Bh = "default-model-link-3d-group", ss =
|
|
|
15519
15531
|
cameraMode: "onStop",
|
|
15520
15532
|
cameraThrottleMs: 50
|
|
15521
15533
|
};
|
|
15522
|
-
class
|
|
15534
|
+
class Oh {
|
|
15523
15535
|
viewerGuid;
|
|
15524
15536
|
engine;
|
|
15525
15537
|
options;
|
|
@@ -15577,20 +15589,20 @@ class zh {
|
|
|
15577
15589
|
return this.applyingLinkedEvent;
|
|
15578
15590
|
}
|
|
15579
15591
|
dispose() {
|
|
15580
|
-
this.disposed || (this.disposed = !0, typeof window < "u" && window.removeEventListener(_i, 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?.(
|
|
15592
|
+
this.disposed || (this.disposed = !0, typeof window < "u" && window.removeEventListener(_i, 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?.(os, !1), this.unbindCameraEvents(), this.restoreModelToolMethods());
|
|
15581
15593
|
}
|
|
15582
15594
|
normalizeOptions(e) {
|
|
15583
15595
|
return {
|
|
15584
|
-
...
|
|
15596
|
+
...rs,
|
|
15585
15597
|
...e,
|
|
15586
|
-
groupId: e.groupId ?? this.engine?.options?.linkGroupId ??
|
|
15598
|
+
groupId: e.groupId ?? this.engine?.options?.linkGroupId ?? zh,
|
|
15587
15599
|
modelId: e.modelId ?? this.engine?.options?.modelLinkId
|
|
15588
15600
|
};
|
|
15589
15601
|
}
|
|
15590
15602
|
/** 模型联动开启后需要持续响应外部视图变化,不能进入空闲限帧。 */
|
|
15591
15603
|
syncIdleFrameRateExempt() {
|
|
15592
15604
|
this.engine?.setIdleFrameRateExempt?.(
|
|
15593
|
-
|
|
15605
|
+
os,
|
|
15594
15606
|
this.options.enabled === !0
|
|
15595
15607
|
);
|
|
15596
15608
|
}
|
|
@@ -15682,7 +15694,7 @@ class zh {
|
|
|
15682
15694
|
return this.engine?.controlModule?.firstPersonControls?.enabled === !0 && this.engine?.movefirst === !0;
|
|
15683
15695
|
}
|
|
15684
15696
|
emitCameraThrottled() {
|
|
15685
|
-
const e = Date.now(), t = Math.max(0, (this.options.cameraThrottleMs ??
|
|
15697
|
+
const e = Date.now(), t = Math.max(0, (this.options.cameraThrottleMs ?? rs.cameraThrottleMs) - (e - this.lastCameraEmitTime));
|
|
15686
15698
|
if (t === 0) {
|
|
15687
15699
|
this.emitCamera();
|
|
15688
15700
|
return;
|
|
@@ -15823,13 +15835,13 @@ class zh {
|
|
|
15823
15835
|
}).filter((n) => n.ids.length > 0);
|
|
15824
15836
|
}
|
|
15825
15837
|
}
|
|
15826
|
-
class
|
|
15838
|
+
class Nh {
|
|
15827
15839
|
engine;
|
|
15828
15840
|
manager;
|
|
15829
15841
|
worldToScreen;
|
|
15830
15842
|
raycaster = new be();
|
|
15831
15843
|
constructor(e) {
|
|
15832
|
-
this.engine = e, this.worldToScreen = new Me(e.camera, e.renderer, e.scene), this.manager = new
|
|
15844
|
+
this.engine = e, this.worldToScreen = new Me(e.camera, e.renderer, e.scene), this.manager = new Mr({
|
|
15833
15845
|
container: e.container,
|
|
15834
15846
|
className: "bim-engine-label-container bim-engine-label-container-3d",
|
|
15835
15847
|
projectCoordinate: (t) => this.projectCoordinate(t),
|
|
@@ -15891,7 +15903,7 @@ class Oh {
|
|
|
15891
15903
|
return e = this.engine.clipping?.filterIntersectionsByClipping?.(e) ?? e, e.filter((i) => i?.point instanceof d).sort((i, n) => i.distance - n.distance)[0] ?? null;
|
|
15892
15904
|
}
|
|
15893
15905
|
}
|
|
15894
|
-
class
|
|
15906
|
+
class Fh {
|
|
15895
15907
|
/** 推进当前标记注册的材质与独立点动画。 */
|
|
15896
15908
|
updateRecord(e, t) {
|
|
15897
15909
|
const i = t + e.timeSeed;
|
|
@@ -15916,7 +15928,7 @@ class Nh {
|
|
|
15916
15928
|
});
|
|
15917
15929
|
}
|
|
15918
15930
|
}
|
|
15919
|
-
class
|
|
15931
|
+
class Hh {
|
|
15920
15932
|
engine;
|
|
15921
15933
|
rootGroup;
|
|
15922
15934
|
records;
|
|
@@ -16223,7 +16235,7 @@ const Ae = {
|
|
|
16223
16235
|
showBottom: !1,
|
|
16224
16236
|
edgeColor: "#d9ffff"
|
|
16225
16237
|
}
|
|
16226
|
-
},
|
|
16238
|
+
}, Vh = {
|
|
16227
16239
|
background: "rgba(10, 18, 28, 0.92)",
|
|
16228
16240
|
color: "#ffffff",
|
|
16229
16241
|
border: "1px solid rgba(127, 252, 255, 0.72)",
|
|
@@ -16232,7 +16244,7 @@ const Ae = {
|
|
|
16232
16244
|
boxShadow: "0 10px 30px rgba(0, 0, 0, 0.32)",
|
|
16233
16245
|
minWidth: "120px",
|
|
16234
16246
|
pointerEvents: "auto"
|
|
16235
|
-
},
|
|
16247
|
+
}, Uh = "bim-engine-annotation3d-panels";
|
|
16236
16248
|
function ri(a) {
|
|
16237
16249
|
return a.map((e) => ({ x: e.x, y: e.y, z: e.z }));
|
|
16238
16250
|
}
|
|
@@ -16243,7 +16255,7 @@ function Jt(a) {
|
|
|
16243
16255
|
const e = new d();
|
|
16244
16256
|
return a.length === 0 ? e : (a.forEach((t) => e.add(J(t))), e.multiplyScalar(1 / a.length));
|
|
16245
16257
|
}
|
|
16246
|
-
function
|
|
16258
|
+
function qh(a) {
|
|
16247
16259
|
const e = new d();
|
|
16248
16260
|
for (let t = 0; t < a.length; t += 1) {
|
|
16249
16261
|
const i = a[t], n = a[(t + 1) % a.length];
|
|
@@ -16251,9 +16263,9 @@ function Uh(a) {
|
|
|
16251
16263
|
}
|
|
16252
16264
|
return e.normalize();
|
|
16253
16265
|
}
|
|
16254
|
-
function
|
|
16266
|
+
function io(a) {
|
|
16255
16267
|
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);
|
|
16256
|
-
let n =
|
|
16268
|
+
let n = qh(e);
|
|
16257
16269
|
n.lengthSq() < 1e-8 && (n = new d(0, 1, 0));
|
|
16258
16270
|
const s = new d().crossVectors(n, i).normalize(), o = new d().crossVectors(s, n).normalize(), r = e.map((c) => {
|
|
16259
16271
|
const h = c.clone().sub(t);
|
|
@@ -16261,8 +16273,8 @@ function to(a) {
|
|
|
16261
16273
|
}), l = new H().makeBasis(o, s, n).setPosition(t);
|
|
16262
16274
|
return { origin: t, normal: n, matrix: l, localPoints: r };
|
|
16263
16275
|
}
|
|
16264
|
-
function
|
|
16265
|
-
const e = new
|
|
16276
|
+
function no(a) {
|
|
16277
|
+
const e = new ms();
|
|
16266
16278
|
return a.forEach((t, i) => {
|
|
16267
16279
|
if (i === 0) {
|
|
16268
16280
|
e.moveTo(t.x, t.y);
|
|
@@ -16271,12 +16283,12 @@ function io(a) {
|
|
|
16271
16283
|
e.lineTo(t.x, t.y);
|
|
16272
16284
|
}), e.closePath(), e;
|
|
16273
16285
|
}
|
|
16274
|
-
function
|
|
16286
|
+
function Gh(a, e) {
|
|
16275
16287
|
a.traverse((t) => {
|
|
16276
16288
|
t.userData = t.userData ?? {}, t.userData.annotationId = e;
|
|
16277
16289
|
});
|
|
16278
16290
|
}
|
|
16279
|
-
function
|
|
16291
|
+
function Wh(a) {
|
|
16280
16292
|
a.traverse((e) => {
|
|
16281
16293
|
const t = e;
|
|
16282
16294
|
t.geometry?.dispose?.();
|
|
@@ -16288,13 +16300,13 @@ function Gh(a) {
|
|
|
16288
16300
|
i?.dispose?.();
|
|
16289
16301
|
});
|
|
16290
16302
|
}
|
|
16291
|
-
function
|
|
16303
|
+
function jh(a) {
|
|
16292
16304
|
return a.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
16293
16305
|
}
|
|
16294
|
-
function
|
|
16306
|
+
function Kh(a) {
|
|
16295
16307
|
return a === "polyline" || a === "curve3d" ? "center" : a === "polygon" ? "centroid" : "top";
|
|
16296
16308
|
}
|
|
16297
|
-
class
|
|
16309
|
+
class Yh {
|
|
16298
16310
|
render(e) {
|
|
16299
16311
|
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(), y = Math.max(t.fontSize ?? 14, 10), b = t.textColor || e.instance.style.color || "#ffffff", x = t.fontWeight ?? 500, m = Math.max(Math.round((t.height ?? 8) * 12), 48), w = Math.max(Math.round(Math.abs(t.offsetX ?? t.armLength ?? 4) * 18), 56), C = this.getBoardWidth(e, g, y), A = Math.max(Math.round((t.boardHeight ?? 1.8) * 22), y + 18, 34), L = Math.max(Math.round((t.stemWidth ?? e.instance.style.lineWidth ?? 0.12) * 20), 2), I = t.borderWidth ?? 2.5, z = t.variant ?? "elbow", k = c === "right" ? 22 + w - 8 : 22 - w - C + 8, F = 8, q = Math.min(22, k) - 16, $ = Math.max(22, k + C) + 16, Y = Math.max($ - q, 140), te = Math.max(m + A + 36, 120), ie = 22 - q, ne = k - q, ue = te - 18, Ie = Math.max(ue - m, 14), xe = c === "right" ? ne : ne + C, f = F + Math.round(A * 0.5), v = z === "vertical" ? [`${ie},${ue}`, `${ie},${Ie}`] : [`${ie},${ue}`, `${ie},${f}`, `${xe},${f}`], E = e.instance.selectable !== !1, P = E ? "visiblePainted" : "none", D = E ? "pointer" : "default", _ = ne + (h || !g ? 38 : 12), R = t.showBoard === !1 ? "" : `
|
|
16300
16312
|
<rect x="${ne}" y="${F}" width="${C}" height="${A}" rx="10"
|
|
@@ -16348,7 +16360,7 @@ class Kh {
|
|
|
16348
16360
|
return Math.max(Math.round((n.boardWidth ?? 4.6) * 22), Math.ceil(r), 78);
|
|
16349
16361
|
}
|
|
16350
16362
|
}
|
|
16351
|
-
class
|
|
16363
|
+
class Qh {
|
|
16352
16364
|
/** 按标记类型重建内容,并返回相对三维锚点的布局参数。 */
|
|
16353
16365
|
render(e, t) {
|
|
16354
16366
|
const i = t.instance.type === "iconPoint" ? t.instance.style.iconPoint ?? {} : t.instance.type === "textPoint" ? t.instance.style.textPoint ?? {} : t.instance.style.iconTextPoint ?? {}, n = JSON.stringify({
|
|
@@ -16421,10 +16433,10 @@ class Yh {
|
|
|
16421
16433
|
return `rgba(${r >> 16 & 255}, ${r >> 8 & 255}, ${r & 255}, ${i})`;
|
|
16422
16434
|
}
|
|
16423
16435
|
}
|
|
16424
|
-
const
|
|
16425
|
-
class
|
|
16436
|
+
const Xh = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]), $h = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint", "ripplePoint", "pillarPoint", "leaderPoint"]);
|
|
16437
|
+
class Jh {
|
|
16426
16438
|
constructor(e, t) {
|
|
16427
|
-
this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className =
|
|
16439
|
+
this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className = Uh, this.container.style.cssText = [
|
|
16428
16440
|
"position:absolute",
|
|
16429
16441
|
"left:0",
|
|
16430
16442
|
"top:0",
|
|
@@ -16439,8 +16451,8 @@ class $h {
|
|
|
16439
16451
|
isAnchorOccluded;
|
|
16440
16452
|
container;
|
|
16441
16453
|
worldToScreen;
|
|
16442
|
-
leaderMarker = new
|
|
16443
|
-
pointContentMarker = new
|
|
16454
|
+
leaderMarker = new Yh();
|
|
16455
|
+
pointContentMarker = new Qh();
|
|
16444
16456
|
updateProjectionState() {
|
|
16445
16457
|
this.worldToScreen.updateCamera(this.engine.camera), this.worldToScreen.updateRenderer(this.engine.renderer), this.worldToScreen.updateScene(this.engine.scene);
|
|
16446
16458
|
}
|
|
@@ -16453,7 +16465,7 @@ class $h {
|
|
|
16453
16465
|
"transform:translate(-50%, -100%)",
|
|
16454
16466
|
"display:none",
|
|
16455
16467
|
t.interactive === !1 ? "pointer-events:none" : "pointer-events:auto"
|
|
16456
|
-
].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => i.style.setProperty(
|
|
16468
|
+
].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => i.style.setProperty(jh(n), s)), i;
|
|
16457
16469
|
}
|
|
16458
16470
|
createLeaderMarkerElement(e) {
|
|
16459
16471
|
const t = document.createElement("div");
|
|
@@ -16465,7 +16477,7 @@ class $h {
|
|
|
16465
16477
|
return t.className = "bim-annotation3d-marker bim-annotation3d-point-marker", t.dataset.annotationId = e.id, t.style.cssText = ["position:absolute", "left:0", "top:0", "display:none", "pointer-events:none"].join(";"), t;
|
|
16466
16478
|
}
|
|
16467
16479
|
updateRecord(e) {
|
|
16468
|
-
if (e.markerElement && e.instance.type === "leaderPoint" ? this.updateLeaderMarker(e) : e.markerElement &&
|
|
16480
|
+
if (e.markerElement && e.instance.type === "leaderPoint" ? this.updateLeaderMarker(e) : e.markerElement && Xh.has(e.instance.type) && this.updatePointMarker(e), !e.panelElement || !e.instance.panel)
|
|
16469
16481
|
return;
|
|
16470
16482
|
const t = e.instance.panel;
|
|
16471
16483
|
if (!(t.visible !== !1 && this.shouldShowPanel(e)) || !e.instance.visible) {
|
|
@@ -16524,9 +16536,9 @@ class $h {
|
|
|
16524
16536
|
const t = e.instance.panel?.offset ?? {};
|
|
16525
16537
|
if (e.panelAnchorPoint)
|
|
16526
16538
|
return e.panelAnchorPoint.clone().add(new d(t.x ?? 0, t.y ?? 0, t.z ?? 0));
|
|
16527
|
-
const i = e.instance.panel?.anchor ??
|
|
16539
|
+
const i = e.instance.panel?.anchor ?? Kh(e.instance.type);
|
|
16528
16540
|
let n = new d();
|
|
16529
|
-
if (
|
|
16541
|
+
if ($h.has(e.instance.type))
|
|
16530
16542
|
n.copy(J(e.instance.points[0])), i === "top" && (n.y += e.volumeHeight ?? 0);
|
|
16531
16543
|
else if (e.instance.type === "polyline" || e.instance.type === "curve3d")
|
|
16532
16544
|
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(Jt(e.instance.points));
|
|
@@ -16541,14 +16553,14 @@ class $h {
|
|
|
16541
16553
|
return n.add(new d(t.x ?? 0, t.y ?? 0, t.z ?? 0)), n;
|
|
16542
16554
|
}
|
|
16543
16555
|
}
|
|
16544
|
-
class
|
|
16556
|
+
class Zh {
|
|
16545
16557
|
apply(e, t) {
|
|
16546
16558
|
e.instance.root.visible = e.instance.visible, e.instance.style.alwaysOnTop && e.instance.root.traverse((i) => {
|
|
16547
16559
|
i.renderOrder = Math.max(i.renderOrder, 1200);
|
|
16548
16560
|
}), t(e);
|
|
16549
16561
|
}
|
|
16550
16562
|
}
|
|
16551
|
-
class
|
|
16563
|
+
class ed {
|
|
16552
16564
|
constructor(e) {
|
|
16553
16565
|
this.engine = e;
|
|
16554
16566
|
}
|
|
@@ -16573,14 +16585,14 @@ class Zh {
|
|
|
16573
16585
|
y = y.add(_t(0.28).mul(C)), b = b.add(C.mul(0.12));
|
|
16574
16586
|
}
|
|
16575
16587
|
if (s > 0.01 && (y = y.mul(1 + s * 0.25)), i.pulse?.enabled === !0) {
|
|
16576
|
-
const m =
|
|
16588
|
+
const m = Xo(r.mul(i.pulse.speed ?? 1.4)).mul(0.5).add(0.5);
|
|
16577
16589
|
b = b.mul(vt(
|
|
16578
16590
|
i.pulse.minOpacity ?? 0.55,
|
|
16579
16591
|
i.pulse.maxOpacity ?? 1,
|
|
16580
16592
|
m
|
|
16581
16593
|
));
|
|
16582
16594
|
}
|
|
16583
|
-
const x = new
|
|
16595
|
+
const x = new $o({
|
|
16584
16596
|
transparent: !0,
|
|
16585
16597
|
side: Se,
|
|
16586
16598
|
depthTest: t.alwaysOnTop ? !1 : t.depthTest !== !1,
|
|
@@ -16630,13 +16642,13 @@ class je {
|
|
|
16630
16642
|
engine;
|
|
16631
16643
|
materialFactory;
|
|
16632
16644
|
createSegmentCurve(e) {
|
|
16633
|
-
const t = new
|
|
16645
|
+
const t = new Jo();
|
|
16634
16646
|
for (let i = 0; i < e.length - 1; i += 1)
|
|
16635
|
-
t.add(new
|
|
16647
|
+
t.add(new Zo(e[i], e[i + 1]));
|
|
16636
16648
|
return t;
|
|
16637
16649
|
}
|
|
16638
16650
|
createTubeMesh(e, t, i, n, s, o, r = 10, l = !1) {
|
|
16639
|
-
const c = new
|
|
16651
|
+
const c = new er(t, i, n, r, l);
|
|
16640
16652
|
c.computeBoundingBox();
|
|
16641
16653
|
const h = c.boundingBox ?? new B(new d(0, 0, 0), new d(1, 1, 1)), u = this.materialFactory.createSurfaceMaterial({
|
|
16642
16654
|
color: s.color ?? "#7ffcff",
|
|
@@ -16650,18 +16662,18 @@ class je {
|
|
|
16650
16662
|
return e.animatedMaterials.push(u), p;
|
|
16651
16663
|
}
|
|
16652
16664
|
createLoopLine(e, t, i) {
|
|
16653
|
-
const n = new de().setFromPoints(e.map((r) => J(r))), s = new
|
|
16665
|
+
const n = new de().setFromPoints(e.map((r) => J(r))), s = new rt({
|
|
16654
16666
|
color: t,
|
|
16655
16667
|
transparent: !0,
|
|
16656
16668
|
opacity: 0.94,
|
|
16657
16669
|
depthTest: i.alwaysOnTop ? !1 : i.depthTest !== !1
|
|
16658
16670
|
});
|
|
16659
16671
|
s.clippingPlanes = this.engine.sectionPlane;
|
|
16660
|
-
const o = new
|
|
16672
|
+
const o = new tr(n, s);
|
|
16661
16673
|
return o.renderOrder = 998, o;
|
|
16662
16674
|
}
|
|
16663
16675
|
}
|
|
16664
|
-
class
|
|
16676
|
+
class td extends je {
|
|
16665
16677
|
type = "box";
|
|
16666
16678
|
build(e) {
|
|
16667
16679
|
if (e.instance.points.length < 2)
|
|
@@ -16681,21 +16693,21 @@ class ed extends je {
|
|
|
16681
16693
|
axisMax: c.max.y
|
|
16682
16694
|
}), u = new G(l, h);
|
|
16683
16695
|
u.position.copy(r), e.instance.root.add(u);
|
|
16684
|
-
const p = new
|
|
16696
|
+
const p = new rt({
|
|
16685
16697
|
color: e.instance.style.volume?.edgeColor ?? "#d9ffff",
|
|
16686
16698
|
transparent: !0,
|
|
16687
16699
|
opacity: 0.88,
|
|
16688
16700
|
depthTest: e.instance.style.alwaysOnTop ? !1 : e.instance.style.depthTest !== !1
|
|
16689
16701
|
});
|
|
16690
16702
|
p.clippingPlanes = this.engine.sectionPlane;
|
|
16691
|
-
const g = new hi(new
|
|
16703
|
+
const g = new hi(new ir(l), p);
|
|
16692
16704
|
g.position.copy(r), e.instance.root.add(g), e.volumeHeight = o.y, e.animatedMaterials.push(h);
|
|
16693
16705
|
}
|
|
16694
16706
|
}
|
|
16695
|
-
class
|
|
16707
|
+
class id extends je {
|
|
16696
16708
|
type = "curve3d";
|
|
16697
16709
|
build(e) {
|
|
16698
|
-
const t = e.instance.points.map((r) => J(r)), i = e.instance.style.curve ?? {}, n = i.interpolation ?? "catmullRom", s = new
|
|
16710
|
+
const t = e.instance.points.map((r) => J(r)), i = e.instance.style.curve ?? {}, n = i.interpolation ?? "catmullRom", s = new nr(
|
|
16699
16711
|
t,
|
|
16700
16712
|
i.closed ?? !1,
|
|
16701
16713
|
n === "catmullRom" ? "catmullrom" : n,
|
|
@@ -16713,10 +16725,10 @@ class td extends je {
|
|
|
16713
16725
|
e.instance.root.add(o), e.anchorCurve = s, e.panelAnchorPoint = s.getPoint(0.5);
|
|
16714
16726
|
}
|
|
16715
16727
|
}
|
|
16716
|
-
class
|
|
16728
|
+
class nd extends je {
|
|
16717
16729
|
type = "extrudePolygon";
|
|
16718
16730
|
build(e) {
|
|
16719
|
-
const t =
|
|
16731
|
+
const t = io(e.instance.points), i = no(t.localPoints), n = e.instance.style.volume?.height ?? 10, s = new fs(i, {
|
|
16720
16732
|
depth: n,
|
|
16721
16733
|
bevelEnabled: !1,
|
|
16722
16734
|
steps: 1,
|
|
@@ -16761,21 +16773,21 @@ class rn extends je {
|
|
|
16761
16773
|
e.instance.root.position.copy(t), e.panelAnchorPoint = t.clone();
|
|
16762
16774
|
}
|
|
16763
16775
|
}
|
|
16764
|
-
class
|
|
16776
|
+
class sd extends rn {
|
|
16765
16777
|
type = "iconPoint";
|
|
16766
16778
|
/** 将图标点绑定到首个世界坐标。 */
|
|
16767
16779
|
build(e) {
|
|
16768
16780
|
this.buildDomAnchor(e);
|
|
16769
16781
|
}
|
|
16770
16782
|
}
|
|
16771
|
-
class
|
|
16783
|
+
class od extends rn {
|
|
16772
16784
|
type = "iconTextPoint";
|
|
16773
16785
|
/** 将图文组合点绑定到首个世界坐标。 */
|
|
16774
16786
|
build(e) {
|
|
16775
16787
|
this.buildDomAnchor(e);
|
|
16776
16788
|
}
|
|
16777
16789
|
}
|
|
16778
|
-
class
|
|
16790
|
+
class rd extends je {
|
|
16779
16791
|
type = "leaderPoint";
|
|
16780
16792
|
build(e) {
|
|
16781
16793
|
const t = J(e.instance.points[0]), i = e.instance.style.leaderPoint ?? {}, n = Math.max(i.height ?? 8, 0.5), s = i.offsetX ?? i.armLength ?? 4, o = i.offsetZ ?? 0, r = this.createLeaderPathPoints(i.variant ?? "elbow", n, s, o), l = r[r.length - 1].clone();
|
|
@@ -16795,13 +16807,13 @@ class od extends je {
|
|
|
16795
16807
|
];
|
|
16796
16808
|
}
|
|
16797
16809
|
}
|
|
16798
|
-
class
|
|
16810
|
+
class ad extends je {
|
|
16799
16811
|
type = "pillarPoint";
|
|
16800
16812
|
/** 根据光柱专属参数创建柱体与可选底环。 */
|
|
16801
16813
|
build(e) {
|
|
16802
16814
|
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);
|
|
16803
16815
|
e.instance.root.position.copy(i).add(n), e.panelAnchorPoint = i.clone().add(n).add(new d(0, s, 0)), e.volumeHeight = s;
|
|
16804
|
-
const o = new
|
|
16816
|
+
const o = new sr(
|
|
16805
16817
|
Math.max(t.radiusTop ?? 0.3, 1e-3),
|
|
16806
16818
|
Math.max(t.radiusBottom ?? 0.75, 1e-3),
|
|
16807
16819
|
s,
|
|
@@ -16844,7 +16856,7 @@ class rd extends je {
|
|
|
16844
16856
|
});
|
|
16845
16857
|
h.clippingPlanes = this.engine.sectionPlane;
|
|
16846
16858
|
const u = new G(
|
|
16847
|
-
new
|
|
16859
|
+
new Ss(
|
|
16848
16860
|
Math.max(t.baseRingInnerRadius ?? 1.9, 1e-3),
|
|
16849
16861
|
Math.max(t.baseRingOuterRadius ?? 2.4, (t.baseRingInnerRadius ?? 1.9) + 1e-3),
|
|
16850
16862
|
Math.max(12, Math.floor(t.baseRingSegments ?? 48))
|
|
@@ -16855,10 +16867,10 @@ class rd extends je {
|
|
|
16855
16867
|
}
|
|
16856
16868
|
}
|
|
16857
16869
|
}
|
|
16858
|
-
class
|
|
16870
|
+
class ld extends je {
|
|
16859
16871
|
type = "polygon";
|
|
16860
16872
|
build(e) {
|
|
16861
|
-
const t =
|
|
16873
|
+
const t = io(e.instance.points), i = no(t.localPoints), n = new or(i);
|
|
16862
16874
|
n.computeBoundingBox();
|
|
16863
16875
|
const s = n.boundingBox ?? new B(new d(0, 0, 0), new d(1, 1, 1)), o = this.materialFactory.createSurfaceMaterial({
|
|
16864
16876
|
color: e.instance.style.fillColor ?? e.instance.style.color ?? "#7ffcff",
|
|
@@ -16878,7 +16890,7 @@ class ad extends je {
|
|
|
16878
16890
|
), e.animatedMaterials.push(o);
|
|
16879
16891
|
}
|
|
16880
16892
|
}
|
|
16881
|
-
class
|
|
16893
|
+
class cd extends je {
|
|
16882
16894
|
type = "polyline";
|
|
16883
16895
|
build(e) {
|
|
16884
16896
|
const t = e.instance.points.map((s) => J(s)), i = this.createSegmentCurve(t), n = this.createTubeMesh(
|
|
@@ -16892,7 +16904,7 @@ class ld extends je {
|
|
|
16892
16904
|
e.instance.root.add(n), e.anchorCurve = i, e.panelAnchorPoint = i.getPoint(0.5);
|
|
16893
16905
|
}
|
|
16894
16906
|
}
|
|
16895
|
-
class
|
|
16907
|
+
class hd extends je {
|
|
16896
16908
|
type = "ripplePoint";
|
|
16897
16909
|
/** 根据波纹参数创建中心点和错相扩散圆环。 */
|
|
16898
16910
|
build(e) {
|
|
@@ -16924,36 +16936,36 @@ class cd extends je {
|
|
|
16924
16936
|
});
|
|
16925
16937
|
h.clippingPlanes = this.engine.sectionPlane;
|
|
16926
16938
|
const u = new G(
|
|
16927
|
-
new
|
|
16939
|
+
new Ss(Math.max(o - r, 1e-3), o, l),
|
|
16928
16940
|
h
|
|
16929
16941
|
);
|
|
16930
16942
|
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);
|
|
16931
16943
|
}
|
|
16932
16944
|
}
|
|
16933
16945
|
}
|
|
16934
|
-
class
|
|
16946
|
+
class dd extends rn {
|
|
16935
16947
|
type = "textPoint";
|
|
16936
16948
|
/** 将文字点绑定到首个世界坐标。 */
|
|
16937
16949
|
build(e) {
|
|
16938
16950
|
this.buildDomAnchor(e);
|
|
16939
16951
|
}
|
|
16940
16952
|
}
|
|
16941
|
-
function
|
|
16953
|
+
function ud(a, e) {
|
|
16942
16954
|
return [
|
|
16943
|
-
new nd(a, e),
|
|
16944
|
-
new hd(a, e),
|
|
16945
16955
|
new sd(a, e),
|
|
16946
|
-
new
|
|
16947
|
-
new rd(a, e),
|
|
16956
|
+
new dd(a, e),
|
|
16948
16957
|
new od(a, e),
|
|
16949
|
-
new
|
|
16950
|
-
new td(a, e),
|
|
16958
|
+
new hd(a, e),
|
|
16951
16959
|
new ad(a, e),
|
|
16960
|
+
new rd(a, e),
|
|
16961
|
+
new cd(a, e),
|
|
16952
16962
|
new id(a, e),
|
|
16953
|
-
new
|
|
16963
|
+
new ld(a, e),
|
|
16964
|
+
new nd(a, e),
|
|
16965
|
+
new td(a, e)
|
|
16954
16966
|
];
|
|
16955
16967
|
}
|
|
16956
|
-
function
|
|
16968
|
+
function pd(a, e, t) {
|
|
16957
16969
|
const i = a.camera;
|
|
16958
16970
|
if (!i)
|
|
16959
16971
|
return !1;
|
|
@@ -16966,7 +16978,7 @@ function ud(a, e, t) {
|
|
|
16966
16978
|
const r = o.sort((l, c) => l.distance - c.distance)[0];
|
|
16967
16979
|
return !!(r && r.distance < s - 0.05);
|
|
16968
16980
|
}
|
|
16969
|
-
class
|
|
16981
|
+
class gd {
|
|
16970
16982
|
/** 归一化外部数据,并在创建几何前校验类型对应的必要输入。 */
|
|
16971
16983
|
normalizeData(e) {
|
|
16972
16984
|
const t = {
|
|
@@ -17100,7 +17112,7 @@ class pd {
|
|
|
17100
17112
|
offset: { ...e.offset ?? {} },
|
|
17101
17113
|
screenOffset: { ...e.screenOffset ?? {} },
|
|
17102
17114
|
className: e.className,
|
|
17103
|
-
style: { ...
|
|
17115
|
+
style: { ...Vh, ...e.style ?? {} },
|
|
17104
17116
|
interactive: e.interactive ?? !0,
|
|
17105
17117
|
occlusion: e.occlusion ?? "show",
|
|
17106
17118
|
actions: e.actions
|
|
@@ -17139,11 +17151,11 @@ class pd {
|
|
|
17139
17151
|
}
|
|
17140
17152
|
}
|
|
17141
17153
|
}
|
|
17142
|
-
function
|
|
17154
|
+
function md(a) {
|
|
17143
17155
|
const { actions: e, ...t } = a;
|
|
17144
17156
|
return t;
|
|
17145
17157
|
}
|
|
17146
|
-
function
|
|
17158
|
+
function fd(a) {
|
|
17147
17159
|
return {
|
|
17148
17160
|
id: a.instance.id,
|
|
17149
17161
|
type: a.instance.type,
|
|
@@ -17159,7 +17171,7 @@ function md(a) {
|
|
|
17159
17171
|
function Zt(a) {
|
|
17160
17172
|
return a === void 0 ? a : JSON.parse(JSON.stringify(a));
|
|
17161
17173
|
}
|
|
17162
|
-
class
|
|
17174
|
+
class yd {
|
|
17163
17175
|
builders = /* @__PURE__ */ new Map();
|
|
17164
17176
|
constructor(e) {
|
|
17165
17177
|
e.forEach((t) => this.builders.set(t.type, t));
|
|
@@ -17171,8 +17183,8 @@ class fd {
|
|
|
17171
17183
|
t.build(e);
|
|
17172
17184
|
}
|
|
17173
17185
|
}
|
|
17174
|
-
const
|
|
17175
|
-
class
|
|
17186
|
+
const vd = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]);
|
|
17187
|
+
class Md {
|
|
17176
17188
|
constructor(e, t) {
|
|
17177
17189
|
this.markerRegistry = e, this.overlayController = t;
|
|
17178
17190
|
}
|
|
@@ -17189,7 +17201,7 @@ class vd {
|
|
|
17189
17201
|
selectable: e.selectable ?? !0,
|
|
17190
17202
|
style: e.style,
|
|
17191
17203
|
effect: e.effect ?? {},
|
|
17192
|
-
panel: e.panel ?
|
|
17204
|
+
panel: e.panel ? md(e.panel) : void 0,
|
|
17193
17205
|
data: e.data,
|
|
17194
17206
|
panelVisible: e.panel?.trigger === "always",
|
|
17195
17207
|
hovered: !1,
|
|
@@ -17198,37 +17210,37 @@ class vd {
|
|
|
17198
17210
|
instance: i,
|
|
17199
17211
|
actions: e.panel?.actions,
|
|
17200
17212
|
panelElement: e.panel ? this.overlayController.createPanelElement(i, e.panel) : null,
|
|
17201
|
-
markerElement: e.type === "leaderPoint" ? this.overlayController.createLeaderMarkerElement(i) :
|
|
17213
|
+
markerElement: e.type === "leaderPoint" ? this.overlayController.createLeaderMarkerElement(i) : vd.has(e.type) ? this.overlayController.createPointMarkerElement(i) : null,
|
|
17202
17214
|
timeSeed: Math.random() * Math.PI * 2,
|
|
17203
17215
|
pulseMaterials: [],
|
|
17204
17216
|
rippleMeshes: [],
|
|
17205
17217
|
baseRingMeshes: [],
|
|
17206
17218
|
animatedMaterials: []
|
|
17207
17219
|
};
|
|
17208
|
-
return this.markerRegistry.build(n),
|
|
17220
|
+
return this.markerRegistry.build(n), Gh(t, i.id), n;
|
|
17209
17221
|
}
|
|
17210
17222
|
}
|
|
17211
|
-
class
|
|
17223
|
+
class bd {
|
|
17212
17224
|
engine;
|
|
17213
17225
|
rootGroup;
|
|
17214
17226
|
records = /* @__PURE__ */ new Map();
|
|
17215
17227
|
occlusionRaycaster = new be();
|
|
17216
|
-
normalizer = new
|
|
17228
|
+
normalizer = new gd();
|
|
17217
17229
|
materialFactory;
|
|
17218
17230
|
overlayController;
|
|
17219
17231
|
interactionController;
|
|
17220
17232
|
effectsController;
|
|
17221
|
-
visibilityController = new
|
|
17233
|
+
visibilityController = new Zh();
|
|
17222
17234
|
markerRegistry;
|
|
17223
17235
|
recordFactory;
|
|
17224
17236
|
currentTime = 0;
|
|
17225
17237
|
constructor(e) {
|
|
17226
|
-
this.engine = e, this.rootGroup = new Pe(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new
|
|
17238
|
+
this.engine = e, this.rootGroup = new Pe(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new ed(this.engine), this.overlayController = new Jh(
|
|
17227
17239
|
this.engine,
|
|
17228
|
-
(t) =>
|
|
17229
|
-
), this.markerRegistry = new
|
|
17230
|
-
|
|
17231
|
-
), this.recordFactory = new
|
|
17240
|
+
(t) => pd(this.engine, this.occlusionRaycaster, t)
|
|
17241
|
+
), this.markerRegistry = new yd(
|
|
17242
|
+
ud(this.engine, this.materialFactory)
|
|
17243
|
+
), this.recordFactory = new Md(this.markerRegistry, this.overlayController), this.effectsController = new Fh(), this.interactionController = new Hh({
|
|
17232
17244
|
engine: this.engine,
|
|
17233
17245
|
rootGroup: this.rootGroup,
|
|
17234
17246
|
records: this.records,
|
|
@@ -17329,7 +17341,7 @@ class Md {
|
|
|
17329
17341
|
return this.update(e, { panel: n });
|
|
17330
17342
|
}
|
|
17331
17343
|
getData() {
|
|
17332
|
-
return Array.from(this.records.values()).map((e) =>
|
|
17344
|
+
return Array.from(this.records.values()).map((e) => fd(e));
|
|
17333
17345
|
}
|
|
17334
17346
|
restoreData(e) {
|
|
17335
17347
|
this.clear(), e.forEach((t) => this.add(t));
|
|
@@ -17347,7 +17359,7 @@ class Md {
|
|
|
17347
17359
|
}
|
|
17348
17360
|
removeInternal(e, t) {
|
|
17349
17361
|
const i = this.records.get(e);
|
|
17350
|
-
return i ? (this.interactionController.handleRecordRemoved(e),
|
|
17362
|
+
return i ? (this.interactionController.handleRecordRemoved(e), Wh(i.instance.root), i.instance.root.removeFromParent(), i.panelElement?.remove(), i.markerElement?.remove(), this.records.delete(e), t && this.emit("annotation3d-removed", { id: e }), !0) : !1;
|
|
17351
17363
|
}
|
|
17352
17364
|
toEventPayload(e, t) {
|
|
17353
17365
|
return { id: e.instance.id, annotation: e.instance, originalEvent: t };
|
|
@@ -17391,7 +17403,7 @@ class yt {
|
|
|
17391
17403
|
applyInternal(e, t) {
|
|
17392
17404
|
if (!e?.url || e.matrix == null)
|
|
17393
17405
|
return !1;
|
|
17394
|
-
const i = this.toThreeMatrix(e.matrix), n = this.getMatrix(e.url), s =
|
|
17406
|
+
const i = this.toThreeMatrix(e.matrix), n = this.getMatrix(e.url), s = lt(this.engine, e.url);
|
|
17395
17407
|
return t.saveHistory !== !1 && this.pushHistory(e.url, n), s.matrixAutoUpdate = !1, s.matrix.copy(i), s.matrixWorldNeedsUpdate = !0, s.updateMatrixWorld(!0), this.clearRuntimeWorldBoxCache(s), this.engine.octreeBox?.invalidateModelWorldCache?.(e.url), this.matrices.set(e.url, i.clone()), this.updateCachedModelBox(e.url, s), this.engine.modelEdge?.setModelEdgeTransform?.(e.url, i), this.engine.nodeBox?.setModelBoxTransform?.(e.url, i), this.engine.requestComposerRender?.(), this.notifyChange(e.url, i, n, t), !0;
|
|
17396
17408
|
}
|
|
17397
17409
|
/**
|
|
@@ -17683,15 +17695,15 @@ class yt {
|
|
|
17683
17695
|
return "x" in e ? new d(e.x, e.y, e.z) : new d(e.X, e.Y, e.Z);
|
|
17684
17696
|
}
|
|
17685
17697
|
}
|
|
17686
|
-
const
|
|
17687
|
-
class
|
|
17698
|
+
const xd = 1e-3, wd = 0.65, Cd = 1;
|
|
17699
|
+
class Ed {
|
|
17688
17700
|
engine;
|
|
17689
17701
|
loader;
|
|
17690
17702
|
dracoLoader;
|
|
17691
17703
|
dracoDecoderPath;
|
|
17692
17704
|
modelList = /* @__PURE__ */ new Map();
|
|
17693
17705
|
modelTransforms = [];
|
|
17694
|
-
animationTimer = new
|
|
17706
|
+
animationTimer = new ps();
|
|
17695
17707
|
transformControl = null;
|
|
17696
17708
|
transformHelper = null;
|
|
17697
17709
|
selectedModelId = null;
|
|
@@ -17849,13 +17861,13 @@ class Cd {
|
|
|
17849
17861
|
const l = t ? `“${t}”` : "默认动画";
|
|
17850
17862
|
throw new Error(`播放模型动画失败:模型 “${e}” 不存在${l}。`);
|
|
17851
17863
|
}
|
|
17852
|
-
(i.stopOthers ?? !0) && this.stopAnimation(e), n.mixer || (n.mixer = new
|
|
17864
|
+
(i.stopOthers ?? !0) && this.stopAnimation(e), n.mixer || (n.mixer = new gs(n.object), n.mixer.addEventListener("finished", (l) => {
|
|
17853
17865
|
n.actions.forEach((c, h) => {
|
|
17854
17866
|
c === l.action && n.actions.delete(h);
|
|
17855
17867
|
});
|
|
17856
17868
|
}));
|
|
17857
17869
|
const o = n.mixer.clipAction(s);
|
|
17858
|
-
o.reset(), o.enabled = !0, o.clampWhenFinished = i.clampWhenFinished ?? !1, o.setEffectiveTimeScale(i.timeScale ?? 1), i.loop ?? !0 ? o.setLoop(
|
|
17870
|
+
o.reset(), o.enabled = !0, o.clampWhenFinished = i.clampWhenFinished ?? !1, o.setEffectiveTimeScale(i.timeScale ?? 1), i.loop ?? !0 ? o.setLoop(rr, i.repetitions ?? 1 / 0) : o.setLoop(ar, i.repetitions ?? 1);
|
|
17859
17871
|
const r = i.fadeIn ?? 0;
|
|
17860
17872
|
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 };
|
|
17861
17873
|
}
|
|
@@ -17948,7 +17960,7 @@ class Cd {
|
|
|
17948
17960
|
}
|
|
17949
17961
|
/** 创建独立解码器实例,便于管理器销毁或切换资源目录时释放 worker。 */
|
|
17950
17962
|
createDracoLoader(e) {
|
|
17951
|
-
const t = new
|
|
17963
|
+
const t = new bs();
|
|
17952
17964
|
return t.setDecoderPath(e), t;
|
|
17953
17965
|
}
|
|
17954
17966
|
resolveDracoDecoderPath(e) {
|
|
@@ -17990,13 +18002,13 @@ class Cd {
|
|
|
17990
18002
|
this.syncTransformControlCamera();
|
|
17991
18003
|
return;
|
|
17992
18004
|
}
|
|
17993
|
-
!this.engine.camera || !this.engine.renderer || !this.engine.scene || (this.transformControl = new
|
|
18005
|
+
!this.engine.camera || !this.engine.renderer || !this.engine.scene || (this.transformControl = new As(this.engine.camera, this.engine.renderer.domElement), this.transformControl.addEventListener("dragging-changed", (e) => {
|
|
17994
18006
|
this.engine.controls && (this.engine.controls.enabled = !e.value), e.value ? this.saveHistory() : this.syncSelectedTransform();
|
|
17995
18007
|
}), this.transformControl.addEventListener("objectChange", () => this.requestRender()), this.transformHelper = this.transformControl.getHelper(), this.transformHelper.visible = !1, this.engine.scene.add(this.transformHelper), this.syncTransformControlCamera());
|
|
17996
18008
|
}
|
|
17997
18009
|
/** 透视相机使用更小的屏幕尺寸系数,正交相机维持原有尺寸。 */
|
|
17998
18010
|
syncTransformControlCamera() {
|
|
17999
|
-
!this.transformControl || !this.engine.camera || (this.transformControl.camera = this.engine.camera, this.transformControl.size = this.engine.camera.isPerspectiveCamera ?
|
|
18011
|
+
!this.transformControl || !this.engine.camera || (this.transformControl.camera = this.engine.camera, this.transformControl.size = this.engine.camera.isPerspectiveCamera ? wd : Cd);
|
|
18000
18012
|
}
|
|
18001
18013
|
/** 使用引擎统一的捕捉器等待用户单击,并在取消或完成后恢复常规交互。 */
|
|
18002
18014
|
pickPlacementPoint(e, t) {
|
|
@@ -18035,7 +18047,7 @@ class Cd {
|
|
|
18035
18047
|
const i = t.clone(), n = e?.normal ?? e?.face?.normal;
|
|
18036
18048
|
if (n == null) return { position: i, normal: null };
|
|
18037
18049
|
const s = n.clone(), o = e?.matrix ?? e?.object?.matrixWorld;
|
|
18038
|
-
return o && s.transformDirection(o), s.lengthSq() < 1e-10 ? { position: i, normal: null } : (s.normalize(), i.addScaledVector(s,
|
|
18050
|
+
return o && s.transformDirection(o), s.lengthSq() < 1e-10 ? { position: i, normal: null } : (s.normalize(), i.addScaledVector(s, xd), { position: i, normal: s });
|
|
18039
18051
|
}
|
|
18040
18052
|
handlePointerDown(e) {
|
|
18041
18053
|
if (!(!this.editingEnabled || !this.engine.camera || !this.engine.renderer)) {
|
|
@@ -18193,7 +18205,7 @@ class ki extends Error {
|
|
|
18193
18205
|
super("模型对比已取消"), this.name = "ModelComparisonCancelledError";
|
|
18194
18206
|
}
|
|
18195
18207
|
}
|
|
18196
|
-
class
|
|
18208
|
+
class Sd {
|
|
18197
18209
|
constructor(e) {
|
|
18198
18210
|
this.engine = e;
|
|
18199
18211
|
}
|
|
@@ -18632,8 +18644,8 @@ class Ed {
|
|
|
18632
18644
|
});
|
|
18633
18645
|
}
|
|
18634
18646
|
}
|
|
18635
|
-
const
|
|
18636
|
-
class
|
|
18647
|
+
const as = "__modelExplodeProxy", ls = new H().makeScale(0, 0, 0);
|
|
18648
|
+
class Ad {
|
|
18637
18649
|
engine;
|
|
18638
18650
|
/** 当前是否处于炸开模式;供外部滑块、交互模块判断是否需要走代理逻辑。 */
|
|
18639
18651
|
active = !1;
|
|
@@ -18770,7 +18782,7 @@ class Sd {
|
|
|
18770
18782
|
* 从命中的代理对象还原真实构件 ID,避免 Object3D.name 字符串化造成 nodesMap 查询失败。
|
|
18771
18783
|
*/
|
|
18772
18784
|
getObjectComponentId(e) {
|
|
18773
|
-
return e?.userData?.[
|
|
18785
|
+
return e?.userData?.[as] === !0 ? e.userData.componentId : null;
|
|
18774
18786
|
}
|
|
18775
18787
|
/**
|
|
18776
18788
|
* 返回炸开后用于悬浮高亮的代理网格。
|
|
@@ -18924,7 +18936,7 @@ class Sd {
|
|
|
18924
18936
|
}
|
|
18925
18937
|
/** 给代理对象写入稳定交互身份,避免依赖 name 的字符串化 id。 */
|
|
18926
18938
|
assignProxyIdentity(e, t, i) {
|
|
18927
|
-
e.url = t, e.name = String(i), e.userData[
|
|
18939
|
+
e.url = t, e.name = String(i), e.userData[as] = !0, e.userData.componentId = i, e.userData.url = t;
|
|
18928
18940
|
}
|
|
18929
18941
|
/**
|
|
18930
18942
|
* 隐藏源渲染片段,避免与代理对象重复显示。
|
|
@@ -18932,7 +18944,7 @@ class Sd {
|
|
|
18932
18944
|
*/
|
|
18933
18945
|
hideSource(e) {
|
|
18934
18946
|
if (e.kind === "instance") {
|
|
18935
|
-
e.sourceMesh.setMatrixAt(e.subIndex,
|
|
18947
|
+
e.sourceMesh.setMatrixAt(e.subIndex, ls), e.sourceMesh.instanceMatrix.needsUpdate = !0;
|
|
18936
18948
|
return;
|
|
18937
18949
|
}
|
|
18938
18950
|
this.ensureSplitState(e);
|
|
@@ -18952,7 +18964,7 @@ class Sd {
|
|
|
18952
18964
|
*/
|
|
18953
18965
|
restoreSource(e) {
|
|
18954
18966
|
if (e.kind === "instance") {
|
|
18955
|
-
const s = this.shouldKeepOriginalInstanceHidden(e) ?
|
|
18967
|
+
const s = this.shouldKeepOriginalInstanceHidden(e) ? ls : e.originalMatrix;
|
|
18956
18968
|
s instanceof H && (e.sourceMesh.setMatrixAt(e.subIndex, s), e.sourceMesh.instanceMatrix.needsUpdate = !0);
|
|
18957
18969
|
return;
|
|
18958
18970
|
}
|
|
@@ -19156,7 +19168,7 @@ class Sd {
|
|
|
19156
19168
|
return Math.abs(i);
|
|
19157
19169
|
}
|
|
19158
19170
|
}
|
|
19159
|
-
const
|
|
19171
|
+
const cs = "bim-material-editor-style", at = [
|
|
19160
19172
|
"map",
|
|
19161
19173
|
"normalMap",
|
|
19162
19174
|
"roughnessMap",
|
|
@@ -19175,7 +19187,7 @@ const ls = "bim-material-editor-style", rt = [
|
|
|
19175
19187
|
bumpMap: "凹凸贴图",
|
|
19176
19188
|
emissiveMap: "自发光贴图"
|
|
19177
19189
|
};
|
|
19178
|
-
class
|
|
19190
|
+
class Pd {
|
|
19179
19191
|
constructor(e) {
|
|
19180
19192
|
this.engine = e;
|
|
19181
19193
|
}
|
|
@@ -19262,7 +19274,7 @@ function gi(a) {
|
|
|
19262
19274
|
function Li(a) {
|
|
19263
19275
|
return a.map((e) => e.name || e.url || e.type || e.uuid).filter((e, t, i) => e.length > 0 && i.indexOf(e) === t);
|
|
19264
19276
|
}
|
|
19265
|
-
function
|
|
19277
|
+
function so(a) {
|
|
19266
19278
|
const e = {
|
|
19267
19279
|
name: a.name,
|
|
19268
19280
|
opacity: a.opacity,
|
|
@@ -19275,14 +19287,14 @@ function no(a) {
|
|
|
19275
19287
|
t[i] instanceof ce && (e[i] = `#${t[i].getHexString()}`);
|
|
19276
19288
|
}), ["roughness", "metalness", "emissiveIntensity", "wireframe"].forEach((i) => {
|
|
19277
19289
|
i in t && (e[i] = t[i]);
|
|
19278
|
-
}),
|
|
19290
|
+
}), at.forEach((i) => {
|
|
19279
19291
|
i in t && (e[i] = t[i] ?? null);
|
|
19280
19292
|
}), e;
|
|
19281
19293
|
}
|
|
19282
19294
|
function Pt(a) {
|
|
19283
19295
|
return a instanceof Oe ? gi(a) || a.uuid : a;
|
|
19284
19296
|
}
|
|
19285
|
-
function
|
|
19297
|
+
function Td(a) {
|
|
19286
19298
|
const e = a, t = {
|
|
19287
19299
|
type: a.type,
|
|
19288
19300
|
name: a.name || a.type,
|
|
@@ -19294,12 +19306,12 @@ function Pd(a) {
|
|
|
19294
19306
|
};
|
|
19295
19307
|
return ["roughness", "metalness", "emissiveIntensity", "wireframe"].forEach((i) => {
|
|
19296
19308
|
i in e && (t[i] = e[i]);
|
|
19297
|
-
}),
|
|
19309
|
+
}), at.forEach((i) => {
|
|
19298
19310
|
i in e && (t[i] = Pt(e[i]) ?? null);
|
|
19299
19311
|
}), JSON.stringify(t);
|
|
19300
19312
|
}
|
|
19301
|
-
function
|
|
19302
|
-
const t =
|
|
19313
|
+
function Id(a, e) {
|
|
19314
|
+
const t = so(a), i = {};
|
|
19303
19315
|
return Object.entries(e.values).forEach(([n, s]) => {
|
|
19304
19316
|
const o = t[n];
|
|
19305
19317
|
Pt(s) !== Pt(o) && (i[n] = {
|
|
@@ -19308,13 +19320,13 @@ function Td(a, e) {
|
|
|
19308
19320
|
});
|
|
19309
19321
|
}), i;
|
|
19310
19322
|
}
|
|
19311
|
-
function
|
|
19323
|
+
function oo(a, e, t) {
|
|
19312
19324
|
const i = a;
|
|
19313
19325
|
if ((e === "color" || e === "emissive") && i[e] instanceof ce && typeof t == "string") {
|
|
19314
19326
|
i[e].set(t);
|
|
19315
19327
|
return;
|
|
19316
19328
|
}
|
|
19317
|
-
if (
|
|
19329
|
+
if (at.includes(e)) {
|
|
19318
19330
|
i[e] = t instanceof Oe ? t : null;
|
|
19319
19331
|
return;
|
|
19320
19332
|
}
|
|
@@ -19335,7 +19347,7 @@ function ei(a) {
|
|
|
19335
19347
|
emissiveIntensity: typeof e.emissiveIntensity == "number" ? e.emissiveIntensity : void 0,
|
|
19336
19348
|
side: a.side,
|
|
19337
19349
|
wireframe: typeof e.wireframe == "boolean" ? e.wireframe : void 0,
|
|
19338
|
-
textures:
|
|
19350
|
+
textures: at.filter((t) => t in e).map((t) => ({
|
|
19339
19351
|
slot: t,
|
|
19340
19352
|
name: Ki[t],
|
|
19341
19353
|
url: gi(e[t]),
|
|
@@ -19343,7 +19355,7 @@ function ei(a) {
|
|
|
19343
19355
|
}))
|
|
19344
19356
|
};
|
|
19345
19357
|
}
|
|
19346
|
-
class
|
|
19358
|
+
class Dd {
|
|
19347
19359
|
constructor(e, t) {
|
|
19348
19360
|
this.engine = e, this.host = t;
|
|
19349
19361
|
}
|
|
@@ -19445,7 +19457,7 @@ class Id {
|
|
|
19445
19457
|
const t = this.createElement("div", "bim-material-editor__section");
|
|
19446
19458
|
t.appendChild(this.createElement("div", "bim-material-editor__section-title", "贴图"));
|
|
19447
19459
|
const i = e;
|
|
19448
|
-
return
|
|
19460
|
+
return at.filter((n) => n in i).forEach((n) => {
|
|
19449
19461
|
const s = this.createElement("div", "bim-material-editor__texture-row"), o = this.createElement("label", "", Ki[n]), r = document.createElement("input");
|
|
19450
19462
|
r.type = "text", r.placeholder = "输入贴图 URL", r.value = gi(i[n]), r.addEventListener("change", () => {
|
|
19451
19463
|
this.host.setTexture(e.uuid, n, r.value.trim() || null);
|
|
@@ -19463,7 +19475,7 @@ class Id {
|
|
|
19463
19475
|
}
|
|
19464
19476
|
/** 材质卡片预览优先显示贴图,没有贴图时用材质颜色兜底。 */
|
|
19465
19477
|
createMaterialPreview(e) {
|
|
19466
|
-
const t = this.createElement("div", "bim-material-editor__material-preview"), i = e, n = i.map instanceof Oe ? i.map :
|
|
19478
|
+
const t = this.createElement("div", "bim-material-editor__material-preview"), i = e, n = i.map instanceof Oe ? i.map : at.map((r) => i[r]).find((r) => r instanceof Oe), s = gi(n);
|
|
19467
19479
|
if (s)
|
|
19468
19480
|
return t.style.backgroundImage = `url(${JSON.stringify(s)})`, t.classList.add("has-texture"), t;
|
|
19469
19481
|
const o = i.color instanceof ce ? `#${i.color.getHexString()}` : "#c7ced8";
|
|
@@ -19499,8 +19511,8 @@ class Id {
|
|
|
19499
19511
|
createSideSelect(e, t) {
|
|
19500
19512
|
const i = this.createElement("div", "bim-material-editor__row"), n = document.createElement("select");
|
|
19501
19513
|
return [
|
|
19502
|
-
{ label: "正面", value:
|
|
19503
|
-
{ label: "背面", value:
|
|
19514
|
+
{ label: "正面", value: lr },
|
|
19515
|
+
{ label: "背面", value: Ms },
|
|
19504
19516
|
{ label: "双面", value: Se }
|
|
19505
19517
|
].forEach((s) => {
|
|
19506
19518
|
const o = document.createElement("option");
|
|
@@ -19516,10 +19528,10 @@ class Id {
|
|
|
19516
19528
|
return t && (n.className = t), i && (n.textContent = i), n;
|
|
19517
19529
|
}
|
|
19518
19530
|
ensureStyle() {
|
|
19519
|
-
if (document.getElementById(
|
|
19531
|
+
if (document.getElementById(cs) != null)
|
|
19520
19532
|
return;
|
|
19521
19533
|
const e = document.createElement("style");
|
|
19522
|
-
e.id =
|
|
19534
|
+
e.id = cs, e.textContent = `
|
|
19523
19535
|
.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}
|
|
19524
19536
|
.bim-material-editor *{box-sizing:border-box}
|
|
19525
19537
|
.bim-material-editor__header{display:flex;align-items:center;justify-content:space-between;gap:8px}
|
|
@@ -19552,7 +19564,7 @@ class Id {
|
|
|
19552
19564
|
`, document.head.appendChild(e);
|
|
19553
19565
|
}
|
|
19554
19566
|
}
|
|
19555
|
-
class
|
|
19567
|
+
class _d {
|
|
19556
19568
|
constructor(e) {
|
|
19557
19569
|
this.collectSceneMaterials = e;
|
|
19558
19570
|
}
|
|
@@ -19574,7 +19586,7 @@ class Dd {
|
|
|
19574
19586
|
name: e.name,
|
|
19575
19587
|
type: e.type,
|
|
19576
19588
|
objectNames: Li(t),
|
|
19577
|
-
values:
|
|
19589
|
+
values: so(e)
|
|
19578
19590
|
});
|
|
19579
19591
|
}
|
|
19580
19592
|
getModifiedMaterials() {
|
|
@@ -19584,7 +19596,7 @@ class Dd {
|
|
|
19584
19596
|
const i = this.baselineSnapshots.get(t.material.uuid);
|
|
19585
19597
|
if (i == null)
|
|
19586
19598
|
return;
|
|
19587
|
-
const n =
|
|
19599
|
+
const n = Id(t.material, i);
|
|
19588
19600
|
Object.keys(n).length !== 0 && e.push({
|
|
19589
19601
|
id: t.material.uuid,
|
|
19590
19602
|
name: t.material.name || i.name,
|
|
@@ -19597,17 +19609,17 @@ class Dd {
|
|
|
19597
19609
|
restore(e) {
|
|
19598
19610
|
const t = this.baselineSnapshots.get(e.uuid);
|
|
19599
19611
|
return t == null ? !1 : (Object.entries(t.values).forEach(([i, n]) => {
|
|
19600
|
-
|
|
19612
|
+
oo(e, i, n);
|
|
19601
19613
|
}), e.needsUpdate = !0, !0);
|
|
19602
19614
|
}
|
|
19603
19615
|
}
|
|
19604
|
-
class
|
|
19616
|
+
class kd {
|
|
19605
19617
|
constructor(e, t = {}) {
|
|
19606
19618
|
this.engine = e, this.options = {
|
|
19607
19619
|
visible: t.visible ?? !1,
|
|
19608
19620
|
title: t.title ?? "材质编辑器",
|
|
19609
19621
|
width: t.width ?? 340
|
|
19610
|
-
}, this.visible = this.options.visible, this.collector = new
|
|
19622
|
+
}, this.visible = this.options.visible, this.collector = new Pd(e), this.snapshots = new _d(() => this.collectSceneMaterials()), this.panel = new Dd(e, this);
|
|
19611
19623
|
}
|
|
19612
19624
|
engine;
|
|
19613
19625
|
options;
|
|
@@ -19691,14 +19703,14 @@ class _d {
|
|
|
19691
19703
|
const i = this.findMaterialGroupById(e);
|
|
19692
19704
|
i.length !== 0 && (i.forEach((n) => {
|
|
19693
19705
|
this.snapshots.ensure(n, this.collector.findOwners(n)), Object.entries(t).forEach(([s, o]) => {
|
|
19694
|
-
|
|
19706
|
+
oo(n, s, o);
|
|
19695
19707
|
}), n.needsUpdate = !0;
|
|
19696
19708
|
}), this.requestRender(), this.render());
|
|
19697
19709
|
}
|
|
19698
19710
|
/** 通过 URL 或 File 修改指定贴图槽;传入 null 时清除贴图。 */
|
|
19699
19711
|
async setTexture(e, t, i) {
|
|
19700
19712
|
const n = this.findMaterialGroupById(e);
|
|
19701
|
-
if (n.length === 0 || !
|
|
19713
|
+
if (n.length === 0 || !at.includes(t))
|
|
19702
19714
|
return;
|
|
19703
19715
|
if (n.forEach((r) => this.snapshots.ensure(r, this.collector.findOwners(r))), i == null) {
|
|
19704
19716
|
n.forEach((r) => this.replaceTexture(r, t, null)), this.render();
|
|
@@ -19750,7 +19762,7 @@ class _d {
|
|
|
19750
19762
|
dedupeMaterials(e) {
|
|
19751
19763
|
const t = /* @__PURE__ */ new Map();
|
|
19752
19764
|
return e.forEach((i) => {
|
|
19753
|
-
const n =
|
|
19765
|
+
const n = Td(i.material), s = t.get(n);
|
|
19754
19766
|
if (s == null) {
|
|
19755
19767
|
t.set(n, { material: i.material, materials: [i.material], owners: [...i.owners] });
|
|
19756
19768
|
return;
|
|
@@ -19776,7 +19788,7 @@ class _d {
|
|
|
19776
19788
|
}
|
|
19777
19789
|
replaceTexture(e, t, i) {
|
|
19778
19790
|
const n = e, s = n[t];
|
|
19779
|
-
s != null && this.ownedTextures.has(s) && (s.dispose(), this.ownedTextures.delete(s)), i != null && (i.colorSpace = t === "map" || t === "emissiveMap" ? Ge :
|
|
19791
|
+
s != null && this.ownedTextures.has(s) && (s.dispose(), this.ownedTextures.delete(s)), i != null && (i.colorSpace = t === "map" || t === "emissiveMap" ? Ge : cr, i.wrapS = ci, i.wrapT = ci, i.needsUpdate = !0, this.ownedTextures.add(i)), n[t] = i, e.needsUpdate = !0, this.requestRender();
|
|
19780
19792
|
}
|
|
19781
19793
|
loadTexture(e) {
|
|
19782
19794
|
return new Promise((t, i) => {
|
|
@@ -19801,16 +19813,16 @@ const ti = {
|
|
|
19801
19813
|
sampleCount: 64,
|
|
19802
19814
|
roundedRadius: 1,
|
|
19803
19815
|
historyLimit: 100
|
|
19804
|
-
},
|
|
19816
|
+
}, Ld = {
|
|
19805
19817
|
bezier: "贝塞尔曲线",
|
|
19806
19818
|
straight: "直线",
|
|
19807
19819
|
rounded: "圆角直线"
|
|
19808
|
-
},
|
|
19820
|
+
}, Rd = {
|
|
19809
19821
|
bezier: "∿",
|
|
19810
19822
|
straight: "╱",
|
|
19811
19823
|
rounded: "⌁"
|
|
19812
19824
|
};
|
|
19813
|
-
class
|
|
19825
|
+
class Bd {
|
|
19814
19826
|
type = "path-draw";
|
|
19815
19827
|
engine;
|
|
19816
19828
|
root = new Pe();
|
|
@@ -19969,7 +19981,7 @@ class Rd {
|
|
|
19969
19981
|
this.transformHelper && !this.transformHelper.parent && this.engine.scene?.add(this.transformHelper);
|
|
19970
19982
|
return;
|
|
19971
19983
|
}
|
|
19972
|
-
!this.engine.camera || !this.engine.renderer || !this.engine.scene || (this.transformControl = new
|
|
19984
|
+
!this.engine.camera || !this.engine.renderer || !this.engine.scene || (this.transformControl = new As(this.engine.camera, this.engine.renderer.domElement), this.transformControl.setMode("translate"), this.transformControl.size = 0.72, this.transformControl.addEventListener("dragging-changed", (e) => {
|
|
19973
19985
|
if (this.transformDragging = !!e.value, this.transformDragging) {
|
|
19974
19986
|
this.saveHistory(), this.controlsEnabledBeforeDrag = this.engine.controls?.enabled !== !1, this.engine.controls && (this.engine.controls.enabled = !1);
|
|
19975
19987
|
return;
|
|
@@ -20044,10 +20056,10 @@ class Rd {
|
|
|
20044
20056
|
}
|
|
20045
20057
|
/** 使用 Line2 保证 WebGL 环境下的像素线宽真实生效。 */
|
|
20046
20058
|
updateLineObject(e, t, i) {
|
|
20047
|
-
const n = new
|
|
20059
|
+
const n = new hr();
|
|
20048
20060
|
if (n.setPositions(t.flatMap((r) => [r.x, r.y, r.z])), e)
|
|
20049
20061
|
return e.geometry.dispose(), e.geometry = n, e.computeLineDistances(), this.syncLineResolution(e), this.requestRender(), e;
|
|
20050
|
-
const s = new
|
|
20062
|
+
const s = new dr({
|
|
20051
20063
|
color: i ? this.options.previewColor : this.options.lineColor,
|
|
20052
20064
|
linewidth: this.options.lineWidth,
|
|
20053
20065
|
dashed: i,
|
|
@@ -20056,7 +20068,7 @@ class Rd {
|
|
|
20056
20068
|
depthTest: !1,
|
|
20057
20069
|
transparent: i,
|
|
20058
20070
|
opacity: i ? 0.82 : 1
|
|
20059
|
-
}), o = new
|
|
20071
|
+
}), o = new ur(n, s);
|
|
20060
20072
|
return o.name = i ? "PathDrawPreviewLine" : "PathDrawLine", o.renderOrder = i ? 1001 : 1e3, o.computeLineDistances(), this.syncLineResolution(o), this.root.add(o), this.requestRender(), o;
|
|
20061
20073
|
}
|
|
20062
20074
|
syncLineResolution(e) {
|
|
@@ -20176,7 +20188,7 @@ class Rd {
|
|
|
20176
20188
|
t.append(i, n, s), e.appendChild(t), this.statusElement = n;
|
|
20177
20189
|
const o = document.createElement("div");
|
|
20178
20190
|
Object.assign(o.style, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "4px", padding: "8px" }), ["bezier", "straight", "rounded"].forEach((x) => {
|
|
20179
|
-
const m = this.createIconButton(
|
|
20191
|
+
const m = this.createIconButton(Rd[x], Ld[x], () => this.setLineType(x));
|
|
20180
20192
|
m.dataset.lineType = x, m.style.width = "100%", m.style.fontSize = "18px", o.appendChild(m);
|
|
20181
20193
|
}), e.appendChild(o);
|
|
20182
20194
|
const r = document.createElement("label");
|
|
@@ -20294,14 +20306,14 @@ class Rd {
|
|
|
20294
20306
|
return { x: e.x, y: e.y, z: e.z };
|
|
20295
20307
|
}
|
|
20296
20308
|
}
|
|
20297
|
-
class
|
|
20309
|
+
class zd {
|
|
20298
20310
|
engine;
|
|
20299
20311
|
constructor(e) {
|
|
20300
20312
|
this.engine = e;
|
|
20301
20313
|
}
|
|
20302
20314
|
// 定义一些实用的方法
|
|
20303
20315
|
}
|
|
20304
|
-
class
|
|
20316
|
+
class Od {
|
|
20305
20317
|
// 引擎本体
|
|
20306
20318
|
engine;
|
|
20307
20319
|
// 初始化
|
|
@@ -20309,7 +20321,7 @@ class zd {
|
|
|
20309
20321
|
this.engine = e;
|
|
20310
20322
|
}
|
|
20311
20323
|
}
|
|
20312
|
-
class
|
|
20324
|
+
class Nd {
|
|
20313
20325
|
engine;
|
|
20314
20326
|
constructor(e) {
|
|
20315
20327
|
this.engine = e;
|
|
@@ -20325,7 +20337,7 @@ class Od {
|
|
|
20325
20337
|
];
|
|
20326
20338
|
}
|
|
20327
20339
|
}
|
|
20328
|
-
class
|
|
20340
|
+
class Fd {
|
|
20329
20341
|
engine;
|
|
20330
20342
|
constructor(e) {
|
|
20331
20343
|
this.engine = e;
|
|
@@ -20367,11 +20379,11 @@ class mi {
|
|
|
20367
20379
|
this.tagDiv ? (this.tagDiv.style.left = o.x + 10 + this.engine.reactBoundingClientRect.left + "px", this.tagDiv.style.top = o.y - 10 + this.engine.reactBoundingClientRect.top + "px", this.tagDiv.style.display = "block") : this.tagDiv && (this.tagDiv.style.display = "none");
|
|
20368
20380
|
}
|
|
20369
20381
|
init() {
|
|
20370
|
-
this.overlayGroup =
|
|
20382
|
+
this.overlayGroup = Ps(), this.overlayGroup.name = "hoverHighlightClippingGroup", this.syncClippingPlanes(), (this.engine.composerModule?.depthAwareOverlayScene ?? this.engine.scene).add(this.overlayGroup), this.overlayMaterial = new le({
|
|
20371
20383
|
color: 16777215,
|
|
20372
20384
|
transparent: !0,
|
|
20373
20385
|
opacity: 0,
|
|
20374
|
-
blending:
|
|
20386
|
+
blending: hs,
|
|
20375
20387
|
// 只处理高亮网格自身的前后表面,外部场景不会遮挡最终轮廓。
|
|
20376
20388
|
depthTest: !0,
|
|
20377
20389
|
depthWrite: !0
|
|
@@ -20445,7 +20457,7 @@ class mi {
|
|
|
20445
20457
|
this.setAnimationFrameRateExempt(!1), this.removeOverlayMeshes(), this.overlayGroup.removeFromParent(), this.overlayMaterial.dispose(), this.tagDiv?.remove?.(), this.tagDiv = null, this.animState = "idle";
|
|
20446
20458
|
}
|
|
20447
20459
|
}
|
|
20448
|
-
function
|
|
20460
|
+
function Hd(a) {
|
|
20449
20461
|
const e = a.postProcessing ?? {}, t = (i) => i === !0 || i != null && typeof i == "object" && i.enabled === !0 ? i : !1;
|
|
20450
20462
|
a.postProcessing = {
|
|
20451
20463
|
...e,
|
|
@@ -20464,8 +20476,8 @@ function Fd(a) {
|
|
|
20464
20476
|
}
|
|
20465
20477
|
};
|
|
20466
20478
|
}
|
|
20467
|
-
class
|
|
20468
|
-
version =
|
|
20479
|
+
class Yd {
|
|
20480
|
+
version = br;
|
|
20469
20481
|
options;
|
|
20470
20482
|
container;
|
|
20471
20483
|
scene;
|
|
@@ -20561,15 +20573,15 @@ class Kd {
|
|
|
20561
20573
|
renderDrawCallsValueEl = null;
|
|
20562
20574
|
versionEl = null;
|
|
20563
20575
|
constructor(e) {
|
|
20564
|
-
window.THREE =
|
|
20576
|
+
window.THREE = xs, Ma(), this.options = e, this.container = this.resolveContainer(e), this.rxQuotaListMapper = new Kl(this), this.filterLoaderModel = new Nl(this), this.deviceModule = new ia(this), this.deviceModule.isMobile() && Hd(this.options), this.cameraModule = new ee(this), this.sceneModule = new Ol(this), this.scene = this.sceneModule.scene, this.renderModule = new zl(this), this.renderer = this.renderModule.createRenderer(), this.autoExposureModule = new Ar(this), this.camera = this.cameraModule.perspectiveCamera, this.scene.camera = this.camera;
|
|
20565
20577
|
const t = this.renderer;
|
|
20566
|
-
t.interactionCullingEnabled = !0, t.interactionActive = !1, t.interactionRenderScene = this.scene, t.interactionFrameBudgetMs = this.options.interactionFrameBudgetMs ?? 6, t.interactionSkipShadows = this.options.interactionSkipShadows ?? !0, this.controlModule = new
|
|
20578
|
+
t.interactionCullingEnabled = !0, t.interactionActive = !1, t.interactionRenderScene = this.scene, t.interactionFrameBudgetMs = this.options.interactionFrameBudgetMs ?? 6, t.interactionSkipShadows = this.options.interactionSkipShadows ?? !0, this.controlModule = new ta(this), this.controlModule.switchDefaultMode(), this.controls = this.controlModule.orbitControls, this.composerModule = new jr(this), this.composerModule.init(), this.engineModelModule = new Jl(this), this.clipping = new Vc(this), this.clipping.init(), this.events = new na();
|
|
20567
20579
|
const i = this.events.trigger.bind(this.events);
|
|
20568
20580
|
this.events.trigger = ((n, s) => {
|
|
20569
20581
|
i(n, s), String(n) !== String(se.EngineBusy) && this.requestComposerRender(), this.updateTemporalFrameRateExemption();
|
|
20570
|
-
}), this.engineStatus = new
|
|
20582
|
+
}), this.engineStatus = new Fl(this), this.engineStatus.init(), this.updateTemporalFrameRateExemption(), this.materialReplacement = new Ir(this, this.options.materialReplacementOptions), this.materialReplacement.init(), this.loaderModule = new ge(this), this.lightModule = new da(this), this.lightModule.init(), this.engineModelModule.init(), this.initializeVersionDisplay(), this.viewCube = new Gl(this), this.viewCube.init(), this.options.showViewCube === !1 && this.viewCube.hide(), this.octreeBox = Wl(this), this.handelBehaved = Zi(this), this.modelToolModule = new kl(this), this.modelProperties = new jl(this), this.rangeScale = new Zl(this), this.rangeScale.init(), this.setting = new Sc(this), this.modelMapperBatch = new Kc(this), this.measure = new Rc(this), this.modelLink3d = new Oh(this, this.options.linkOptions ?? {}), this.modelLink3d.init(), this.search = new jc(this), this.modelEdge = new Mc(this), this.events.on(se.LoadingCompleted, () => {
|
|
20571
20583
|
this.modelEdge.active(), this.composerModule.markSceneDirty();
|
|
20572
|
-
}), this.nodeBox = new
|
|
20584
|
+
}), this.nodeBox = new Xc(this), this.modelTree = new Uc(this), this.viewTree = new on(this), this.merge2d = new vh(this), this.engineInfo = new qc(this), this.pathRoaming = new eh(this), this.pathRoaming.init(), this.oneClickEncoding = new rh(this), this.minMap = new th(this), this.linkElement2d3d = new sh(this), this.linkView2d3d = new oh(this), this.grid = new ic(this), this.level = new cc(this), this.issueReport = new ih(this), this.fabricDraw = new Rh(this), this.drawingPin = new Bh(this), this.label = new Nh(this), this.annotation3d = new bd(this), this.calibration = new yt(this), this.modelPlace = new Ed(this), this.modelComparison = new Sd(this), this.modelExplode = new Ad(this), this.materialTool = new kd(this, this.options.materialEditorOptions ?? {}), this.materialTool.init(), this.pathDraw = new Bd(this), this.collector = new zd(this), this.modelEditor = new Od(this), this.modelQuantityList = new Nd(this), this.roomSpace = new Fd(this), this.text = new nh(this), this.hdr = new rc(this), this.ground = new sn(this), this.ground.init(), this.skyManager = new Ec(this), this.setting.init(), this.interactionModule = new ua(this), this.interactionModule.init(), this.interactionModule.active(), this.hoverHighLight = new mi(this), this.worldToScreen = new Me(this.camera, this.renderer, this.scene), this.catchSvg = this.createCatchSvg(), this.initializeStats(), this.bindControlEvents(this.controls), this.resizeObserver = typeof ResizeObserver > "u" ? null : new ResizeObserver((n) => {
|
|
20573
20585
|
const s = n[0];
|
|
20574
20586
|
s && this.handleWindowResize(s.contentRect.width, s.contentRect.height);
|
|
20575
20587
|
}), this.resizeObserver?.observe(this.container), this.ready = this.initialize().catch((n) => {
|
|
@@ -20618,7 +20630,7 @@ class Kd {
|
|
|
20618
20630
|
* 解析与 SDK 鉴权沿用公共实现,保证和 v2 的 OpenAPI 行为一致。
|
|
20619
20631
|
*/
|
|
20620
20632
|
async loadModelByViewToken(e, t) {
|
|
20621
|
-
const i = await
|
|
20633
|
+
const i = await xr(
|
|
20622
20634
|
this.options,
|
|
20623
20635
|
e,
|
|
20624
20636
|
"3d"
|
|
@@ -20671,7 +20683,7 @@ class Kd {
|
|
|
20671
20683
|
if (this.isDisposed)
|
|
20672
20684
|
return;
|
|
20673
20685
|
const i = this.container.getBoundingClientRect(), n = Math.max(1, Math.round(i.width || e || this.container.clientWidth)), s = Math.max(1, Math.round(i.height || t || this.container.clientHeight)), o = this.camera.position.clone(), r = this.camera.quaternion.clone(), l = this.camera.up.clone(), c = this.controls?.target?.clone?.(), h = this.controlModule.orbitControls?.origin?.clone?.();
|
|
20674
|
-
this.renderer.setPixelRatio(
|
|
20686
|
+
this.renderer.setPixelRatio(Ws(this)), this.renderer.setSize(n, s, !1);
|
|
20675
20687
|
const u = n / s;
|
|
20676
20688
|
if (this.camera === this.cameraModule.perspectiveCamera)
|
|
20677
20689
|
this.cameraModule.perspectiveCamera.aspect = u, this.cameraModule.perspectiveCamera.updateProjectionMatrix();
|
|
@@ -20684,7 +20696,7 @@ class Kd {
|
|
|
20684
20696
|
dispose() {
|
|
20685
20697
|
if (this.isDisposed)
|
|
20686
20698
|
return;
|
|
20687
|
-
this.isDisposed = !0, this.resizeObserver?.disconnect(), this.renderer.setAnimationLoop(null), this.rangeScale?.dispose?.(), this.measure?.dispose?.(), this.clipping?.dispose?.(), this.pathRoaming?.dispose?.(), this.linkElement2d3d?.dispose?.(), this.linkView2d3d?.dispose?.(), this.skyManager?.close?.(!0), this.hdr?.dispose?.(), this.minMap?.dispose?.(), this.grid?.dispose?.(), this.level?.dispose?.(), this.ground?.dispose?.(), this.issueReport?.dispose?.(), this.fabricDraw?.dispose?.(), this.modelLink3d?.dispose?.(), this.label?.dispose?.(), this.annotation3d?.dispose?.(), this.calibration?.dispose?.(), this.search?.dispose?.(), this.modelPlace?.dispose?.(), this.modelComparison?.dispose?.(), this.modelExplode?.dispose?.(), this.materialTool?.dispose?.(), this.materialReplacement?.dispose?.(), this.pathDraw?.dispose?.(), this.nodeBox?.dispose?.(), this.interactionModule?.dispose?.(), this.hoverHighLight?.dispose?.(),
|
|
20699
|
+
this.isDisposed = !0, this.resizeObserver?.disconnect(), this.renderer.setAnimationLoop(null), this.rangeScale?.dispose?.(), this.measure?.dispose?.(), this.clipping?.dispose?.(), this.pathRoaming?.dispose?.(), this.linkElement2d3d?.dispose?.(), this.linkView2d3d?.dispose?.(), this.skyManager?.close?.(!0), this.hdr?.dispose?.(), this.minMap?.dispose?.(), this.grid?.dispose?.(), this.level?.dispose?.(), this.ground?.dispose?.(), this.issueReport?.dispose?.(), this.fabricDraw?.dispose?.(), this.modelLink3d?.dispose?.(), this.label?.dispose?.(), this.annotation3d?.dispose?.(), this.calibration?.dispose?.(), this.search?.dispose?.(), this.modelPlace?.dispose?.(), this.modelComparison?.dispose?.(), this.modelExplode?.dispose?.(), this.materialTool?.dispose?.(), this.materialReplacement?.dispose?.(), this.pathDraw?.dispose?.(), this.nodeBox?.dispose?.(), this.interactionModule?.dispose?.(), this.hoverHighLight?.dispose?.(), Ra(this), this.handelBehaved?.disActive?.(), this.viewCube?.cubeTool?.dispose?.(), this.controlModule?.dispose?.(), this.engineStatus?.dispose?.(), this.events?.dispose?.(), this.cameraModule?.dispose?.(), this.composerModule?.dispose?.(), this.engineModelModule?.dispose?.(), this.autoExposureModule?.dispose?.(), this.catchSvg?.remove(), this.stats?.dom?.remove(), this.stats = void 0, this.renderStatsEl?.remove(), this.renderStatsEl = null, this.renderTrianglesValueEl = null, this.renderDrawCallsValueEl = null, this.versionEl?.remove(), this.versionEl = null, this.frameCallbacks.clear();
|
|
20688
20700
|
const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = (o) => {
|
|
20689
20701
|
if (!(o == null || typeof o != "object" || n.has(o))) {
|
|
20690
20702
|
if (n.add(o), o.isTexture === !0 && typeof o.dispose == "function") {
|
|
@@ -20717,14 +20729,14 @@ class Kd {
|
|
|
20717
20729
|
if (!(this.frameLockEnabled && t && this.idleFrameRateExemptionReasons.size === 0 && !this.pendingComposerRender && e - this.lastIdleFrameTime < this.idleFrameInterval)) {
|
|
20718
20730
|
this.lastIdleFrameTime = e, this.stats?.begin(), this.modelEdge?.update?.(), this.controlModule.update();
|
|
20719
20731
|
for (const i of this.frameCallbacks) i(e);
|
|
20720
|
-
this.autoExposureModule?.update(e),
|
|
20732
|
+
this.autoExposureModule?.update(e), La(this, this.camera, this.container.clientHeight, e) && this.requestShadowUpdate(), this.skyManager?.update?.(e), this.composerModule.render(), this.renderModule.drawWatermark(), this.viewCube?.cubeTool?.RenderScene?.(), this.hoverHighLight.update(), this.measure?.update?.(), this.ground?.update?.(), this.modelPlace?.update?.(), this.pathDraw?.update?.(), this.minMap?.update?.(), this.grid?.update?.(), this.level?.update?.(), this.text?.update?.(), this.label?.update?.(), this.annotation3d?.updateFrame?.(1 / 60), this.modelExplode?.update?.(), this.updateRenderStats(), this.stats?.end(), this.pendingComposerRender = this.options.continuousRendering === !0;
|
|
20721
20733
|
}
|
|
20722
20734
|
};
|
|
20723
20735
|
/** 初始化 FPS 面板及其右侧的实时渲染量面板。 */
|
|
20724
20736
|
initializeStats() {
|
|
20725
20737
|
if (this.options.showStats !== !0)
|
|
20726
20738
|
return;
|
|
20727
|
-
this.stats = new
|
|
20739
|
+
this.stats = new yr(), this.stats.showPanel(0), this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0", this.stats.dom.style.left = "0", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom);
|
|
20728
20740
|
const e = document.createElement("div");
|
|
20729
20741
|
e.className = "bim-render-stats";
|
|
20730
20742
|
const t = document.createElement("span");
|
|
@@ -20757,5 +20769,5 @@ class Kd {
|
|
|
20757
20769
|
}
|
|
20758
20770
|
}
|
|
20759
20771
|
export {
|
|
20760
|
-
|
|
20772
|
+
Yd as EngineKernelV3
|
|
20761
20773
|
};
|