iflow-engine-base-3d 4.0.4 → 4.0.6
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { S as ki, G as pe, P as Xt, O as Be, M as F, V as d, e as et, T as
|
|
2
|
-
import { W as fe, C as
|
|
3
|
-
import { r as ee, g as
|
|
4
|
-
import { a as ei, J as Ci, c as
|
|
5
|
-
class
|
|
1
|
+
import { S as ki, G as pe, P as Xt, O as Be, M as F, V as d, e as et, T as Un, C as Us, W as Li, a as Ws, b as We, N as Bi, c as Gs, d as lt, f as W, Q as Te, E as Wn, R as me, g as tt, h as Gn, B as R, i as zi, A as qn, j as H, k as z, I as V, l as ri, m as ai, n as Kn, o as jn, L as Qt, p as qs, q as Ks, r as js, s as Yi, D as re, t as Xi, u as Ys, F as Xs, v as xe, w as Yn, x as Xn, y as Ri, z as Qs, H as Qn, J as ae, K as $s, U as Zs, X as Et, Y as Js, Z as $n, _ as eo, $ as Ie, a0 as At, a1 as it, a2 as Xe, a3 as $t, a4 as Oi, a5 as Z, a6 as oe, a7 as St, a8 as to, a9 as nt, aa as wi, ab as Ge, ac as Lt, ad as io, ae as no, af as bi, ag as pt, ah as so, ai as ut, aj as oo, ak as ro, al as Zn, am as Zt, an as Pt, ao as Jt, ap as ao, aq as Qi, ar as Tt, as as It, at as lo, au as co, av as $i, aw as ho, ax as uo, ay as po, az as mo, aA as go, aB as fo, aC as yo, aD as Mo, aE as vo, aF as xo, aG as Jn, aH as wo, aI as bo, aJ as Co, aK as Eo, aL as Ao, aM as So, aN as Po, aO as To, aP as Io, aQ as _o } from "./three-vendor-UroN9p1L.js";
|
|
2
|
+
import { W as fe, C as Do, L as Mt, B as Zi, g as Oe, a as ko, E as Lo, r as Bo } from "./sdk-runtime-C5wcK1bC.js";
|
|
3
|
+
import { r as ee, g as zo } from "./sdk-assets-DHhjv3WO.js";
|
|
4
|
+
import { a as ei, J as Ci, c as Ro, b as Oo, P as li, q as Fo, k as No, n as Ji, E as en, S as Ho } from "./sdk-vendor-DYgn7sFs.js";
|
|
5
|
+
class Vo {
|
|
6
6
|
engine;
|
|
7
7
|
scene;
|
|
8
8
|
constructor(e) {
|
|
@@ -358,7 +358,7 @@ class ie {
|
|
|
358
358
|
l(), h.start(), u();
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
class
|
|
361
|
+
class Uo {
|
|
362
362
|
engine;
|
|
363
363
|
deviceType;
|
|
364
364
|
constructor(e) {
|
|
@@ -423,22 +423,22 @@ class Vo {
|
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
const Fi = 1.1;
|
|
426
|
-
function
|
|
426
|
+
function es(a) {
|
|
427
427
|
if (a?.deviceModule?.isMobile?.() !== !0)
|
|
428
428
|
return window.devicePixelRatio || 1;
|
|
429
429
|
const e = Number(a?.options?.limit_memory);
|
|
430
|
-
return !Number.isFinite(e) || e <= 4 ? 1
|
|
430
|
+
return !Number.isFinite(e) || e <= 4 ? 1 : e >= 8 || e >= 6 ? 2 : 1;
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class Wo {
|
|
433
433
|
engine;
|
|
434
434
|
renderer;
|
|
435
435
|
watermark;
|
|
436
436
|
constructor(e) {
|
|
437
|
-
this.engine = e, this.renderer = null, this.watermark = new
|
|
437
|
+
this.engine = e, this.renderer = null, this.watermark = new Do(Un);
|
|
438
438
|
}
|
|
439
439
|
createRenderer() {
|
|
440
440
|
const { width: e, height: t } = this.engine.deviceModule.getContainerSize();
|
|
441
|
-
return this.engine.deviceModule.isMobile(),
|
|
441
|
+
return this.engine.deviceModule.isMobile(), Us.enabled = !0, this.renderer = new Li({
|
|
442
442
|
// 原生 MSAA 主要覆盖非后处理路径;后处理链路的边缘由 composer 的 samples 和 FXAA 继续处理。
|
|
443
443
|
antialias: this.engine.options.antialias ?? !0,
|
|
444
444
|
alpha: !0,
|
|
@@ -446,7 +446,7 @@ class Uo {
|
|
|
446
446
|
stencil: !0,
|
|
447
447
|
// iOS 保留 drawing buffer 会长期占用额外帧缓冲;移动端优先保证大模型稳定加载。
|
|
448
448
|
preserveDrawingBuffer: !0
|
|
449
|
-
}), this.renderer.setClearColor(0, 0), this.renderer.setSize(e, t, !1), this.renderer.setPixelRatio(
|
|
449
|
+
}), this.renderer.setClearColor(0, 0), this.renderer.setSize(e, t, !1), this.renderer.setPixelRatio(es(this.engine)), this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%", this.renderer.domElement.style.display = "block", this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = Ws, this.renderer.localClippingEnabled = !0, this.renderer.outputColorSpace = We, this.renderer.toneMapping = Bi, this.renderer.toneMappingExposure = Fi, this.engine.container.appendChild(this.renderer.domElement), this.renderer;
|
|
450
450
|
}
|
|
451
451
|
disposeRenderer() {
|
|
452
452
|
this.watermark.dispose(), this.renderer?.dispose();
|
|
@@ -458,14 +458,14 @@ class Uo {
|
|
|
458
458
|
this.renderer && this.watermark.render(this.renderer);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
const
|
|
461
|
+
const Go = { type: "change" }, tn = { type: "start" }, nn = { type: "end" }, $ = 1e-6, ci = Math.PI * 2, de = {
|
|
462
462
|
NONE: -1,
|
|
463
463
|
ROTATE: 0,
|
|
464
464
|
PAN: 1,
|
|
465
465
|
DOLLY: 2,
|
|
466
466
|
TOUCH_ROTATE: 3,
|
|
467
467
|
TOUCH_DOLLY_PAN: 4
|
|
468
|
-
}, hi = new d(1, 0, 0),
|
|
468
|
+
}, hi = new d(1, 0, 0), qo = new d(0, 1, 0), Ko = new d(0, 0, 1), ct = new d(), Ot = new d(), Ae = new d(), X = new d(), De = new d(), ge = new d(), ke = new d(), jo = new d(), Ft = new Te(), di = new Te(), sn = /* @__PURE__ */ new Set([
|
|
469
469
|
"KeyW",
|
|
470
470
|
"KeyA",
|
|
471
471
|
"KeyS",
|
|
@@ -495,7 +495,7 @@ function rn(a) {
|
|
|
495
495
|
const e = a?.tagName?.toLowerCase?.();
|
|
496
496
|
return a?.isContentEditable === !0 || e === "input" || e === "textarea" || e === "select";
|
|
497
497
|
}
|
|
498
|
-
class
|
|
498
|
+
class ts extends Gs {
|
|
499
499
|
constructor(e, t, i = null) {
|
|
500
500
|
super(t, i), this.engine = e, this.target = new d(), this.origin = new d(), this.cursor = new d(), this.showOriginIcon = !0, this.auto = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.enableRotate = !0, this.enablePan = !0, this.enableZoom = !0, this.enableDamping = !1, this.rotateSpeed = 0.51, this.panSpeed = 1, this.zoomSpeed = 1, this.touchZoomSpeed = 1.35, this.dampingFactor = 0.08, this.keyRotateSpeed = 1, this.keyPanSpeed = 7, this.keyMoveSpeed = 0.5, this.keyMoveBoost = 2, this.keys = {
|
|
501
501
|
LEFT: "ArrowLeft",
|
|
@@ -543,7 +543,7 @@ class es extends Ws {
|
|
|
543
543
|
const i = typeof e == "number" ? e : null, n = typeof e == "boolean" ? e : !!t, s = this._applyPendingMotion(i);
|
|
544
544
|
this._alignCamera();
|
|
545
545
|
const o = n || s || this._hasCameraStateChanged();
|
|
546
|
-
return o && (this.dispatchEvent(
|
|
546
|
+
return o && (this.dispatchEvent(Go), this._rememberState()), o;
|
|
547
547
|
}
|
|
548
548
|
_applyPendingMotion(e) {
|
|
549
549
|
let t = !1;
|
|
@@ -601,7 +601,7 @@ class es extends Ws {
|
|
|
601
601
|
}
|
|
602
602
|
_applyPan(e, t) {
|
|
603
603
|
const { width: i, height: n } = on(this.domElement);
|
|
604
|
-
X.copy(hi).applyQuaternion(this.object.quaternion).normalize(), De.copy(
|
|
604
|
+
X.copy(hi).applyQuaternion(this.object.quaternion).normalize(), De.copy(qo).applyQuaternion(this.object.quaternion).normalize();
|
|
605
605
|
let s = 0, o = 0;
|
|
606
606
|
if (this.object.isPerspectiveCamera) {
|
|
607
607
|
const l = 2 * Math.max(this.object.position.distanceTo(this.target), $) * Math.tan(F.degToRad(this.object.getEffectiveFOV() * 0.5)), c = l * this.object.aspect;
|
|
@@ -627,10 +627,10 @@ class es extends Ws {
|
|
|
627
627
|
ge.copy(this.target).sub(this.object.position), !(ge.lengthSq() < $) && (ge.normalize(), X.copy(this._getStableRightAxis(ge)), De.crossVectors(X, ge).normalize(), De.lengthSq() < $ && De.copy(this._referenceUp), this._viewRight.copy(X), this.object.up.copy(De), this.object.lookAt(this.target), this.object.updateMatrixWorld());
|
|
628
628
|
}
|
|
629
629
|
_getStableRightAxis(e) {
|
|
630
|
-
return X.crossVectors(e, this._referenceUp), X.lengthSq() < $ && (X.copy(this._viewRight), X.addScaledVector(e, -X.dot(e))), X.lengthSq() < $ && (X.copy(hi), X.addScaledVector(e, -X.dot(e))), X.lengthSq() < $ && (X.copy(
|
|
630
|
+
return X.crossVectors(e, this._referenceUp), X.lengthSq() < $ && (X.copy(this._viewRight), X.addScaledVector(e, -X.dot(e))), X.lengthSq() < $ && (X.copy(hi), X.addScaledVector(e, -X.dot(e))), X.lengthSq() < $ && (X.copy(Ko), X.addScaledVector(e, -X.dot(e))), X.normalize(), this._viewRight.lengthSq() > $ && X.dot(this._viewRight) < 0 && X.negate(), X;
|
|
631
631
|
}
|
|
632
632
|
_getRotatePivot() {
|
|
633
|
-
return Ye(this.origin) ? this.origin.distanceToSquared(this.target) < $ ? this.target :
|
|
633
|
+
return Ye(this.origin) ? this.origin.distanceToSquared(this.target) < $ ? this.target : jo.copy(this.origin) : this.target;
|
|
634
634
|
}
|
|
635
635
|
_hasCameraStateChanged() {
|
|
636
636
|
const e = this.object.isOrthographicCamera && Math.abs(this.object.zoom - this._lastZoom) > $;
|
|
@@ -777,7 +777,7 @@ class es extends Ws {
|
|
|
777
777
|
this.enableZoom && (this._zoomVelocity += e);
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
|
-
class an extends
|
|
780
|
+
class an extends Wn {
|
|
781
781
|
constructor(e, t, i, n) {
|
|
782
782
|
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 me(), this._fallingTime = 0, this._isMouseInElement = !1, this._euler = new tt(0, 0, 0, "YZX"), this._prevMouseX = 0, this._prevMouseY = 0, this._pointerLookActive = !1, this._externalLookActive = !1, this._interactionActive = !1, this._sharedTargetDistance = 10, this.target = this.camera.position.clone().add(
|
|
783
783
|
new d(0, 0, -1).applyQuaternion(this.camera.quaternion).normalize().multiplyScalar(this._sharedTargetDistance)
|
|
@@ -1139,7 +1139,7 @@ class an extends Un {
|
|
|
1139
1139
|
return r;
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
|
-
const
|
|
1142
|
+
const Yo = ee("/assets/worker_walk.glb", import.meta.url), Xo = Math.PI, Qo = {
|
|
1143
1143
|
16: "ShiftLeft",
|
|
1144
1144
|
37: "ArrowLeft",
|
|
1145
1145
|
38: "ArrowUp",
|
|
@@ -1163,9 +1163,9 @@ const jo = ee("/assets/worker_walk.glb", import.meta.url), Yo = Math.PI, Xo = {
|
|
|
1163
1163
|
jump: ["Space"],
|
|
1164
1164
|
boost: ["ShiftLeft", "ShiftRight"]
|
|
1165
1165
|
};
|
|
1166
|
-
class ln extends
|
|
1166
|
+
class ln extends Wn {
|
|
1167
1167
|
constructor(e, t, i, n = {}) {
|
|
1168
|
-
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 me(), this._cameraRayCaster = new me(), 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
|
|
1168
|
+
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 me(), this._cameraRayCaster = new me(), 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 Gn(), this._avatarAnimationTimer.connect(document), this._avatarLoadRequestId = 0, this.defaultAvatarUrl = n.avatarUrl ?? Yo, 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);
|
|
1169
1169
|
const s = this.isPcDevice();
|
|
1170
1170
|
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();
|
|
1171
1171
|
}
|
|
@@ -1226,7 +1226,7 @@ class ln extends Un {
|
|
|
1226
1226
|
alignToFeet: !0,
|
|
1227
1227
|
fitToPlayerHeight: !0,
|
|
1228
1228
|
ownsResources: !0,
|
|
1229
|
-
yawOffset:
|
|
1229
|
+
yawOffset: Xo,
|
|
1230
1230
|
...t
|
|
1231
1231
|
}), this.setupAvatarAnimation(o, s.animations || []);
|
|
1232
1232
|
},
|
|
@@ -1240,7 +1240,7 @@ class ln extends Un {
|
|
|
1240
1240
|
setupAvatarAnimation(e, t) {
|
|
1241
1241
|
if (!t.length)
|
|
1242
1242
|
return;
|
|
1243
|
-
this.avatarMixer = new
|
|
1243
|
+
this.avatarMixer = new qn(e);
|
|
1244
1244
|
const i = t.find((n) => /walk|run|move/i.test(n.name)) || t[0];
|
|
1245
1245
|
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();
|
|
1246
1246
|
}
|
|
@@ -1345,7 +1345,7 @@ class ln extends Un {
|
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
1347
|
getEventCode(e) {
|
|
1348
|
-
return e.code ||
|
|
1348
|
+
return e.code || Qo[e.keyCode] || e.key || "";
|
|
1349
1349
|
}
|
|
1350
1350
|
hasPressed(e) {
|
|
1351
1351
|
return e.some((t) => this._pressedKeys.has(t));
|
|
@@ -1602,11 +1602,11 @@ class ln extends Un {
|
|
|
1602
1602
|
});
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
|
-
const Ei = "__isModelUrlGroup", ti = "__modelDepthBias",
|
|
1606
|
-
function
|
|
1605
|
+
const Ei = "__isModelUrlGroup", ti = "__modelDepthBias", is = 4;
|
|
1606
|
+
function ns(a) {
|
|
1607
1607
|
return a.__modelGroupMap instanceof Map || (a.__modelGroupMap = /* @__PURE__ */ new Map()), a.__modelGroupMap;
|
|
1608
1608
|
}
|
|
1609
|
-
function
|
|
1609
|
+
function ss(a) {
|
|
1610
1610
|
return a.__modelObjectIndexMap instanceof Map || (a.__modelObjectIndexMap = /* @__PURE__ */ new Map()), a.__modelObjectIndexMap;
|
|
1611
1611
|
}
|
|
1612
1612
|
function Ai(a, e) {
|
|
@@ -1625,7 +1625,7 @@ function vt(a, e, t) {
|
|
|
1625
1625
|
i != null && (Array.isArray(i.urls) || (i.urls = []), i.urls.includes(t) || i.urls.push(t));
|
|
1626
1626
|
}
|
|
1627
1627
|
function $e(a, e) {
|
|
1628
|
-
const t =
|
|
1628
|
+
const t = ns(a), i = t.get(e);
|
|
1629
1629
|
if (i && i.parent != null)
|
|
1630
1630
|
return i;
|
|
1631
1631
|
const n = Hi(a, e);
|
|
@@ -1643,11 +1643,11 @@ function ot(a, e) {
|
|
|
1643
1643
|
if (t != null)
|
|
1644
1644
|
return t;
|
|
1645
1645
|
const i = new pe();
|
|
1646
|
-
Ai(i, e), a.scene.add(i),
|
|
1646
|
+
Ai(i, e), a.scene.add(i), ns(a).set(e, i);
|
|
1647
1647
|
const s = Hi(a, e);
|
|
1648
1648
|
return s != null && (s.group = i), i;
|
|
1649
1649
|
}
|
|
1650
|
-
function
|
|
1650
|
+
function $o(a) {
|
|
1651
1651
|
const e = [], t = /* @__PURE__ */ new Set();
|
|
1652
1652
|
return (Array.isArray(a?.models) ? a.models : []).forEach((n) => {
|
|
1653
1653
|
if (n?.url == null)
|
|
@@ -1660,7 +1660,7 @@ function Qo(a) {
|
|
|
1660
1660
|
}
|
|
1661
1661
|
function _t(a, e) {
|
|
1662
1662
|
const t = [], i = /* @__PURE__ */ new Set();
|
|
1663
|
-
return
|
|
1663
|
+
return $o(a).forEach((s) => {
|
|
1664
1664
|
s.traverse((o) => {
|
|
1665
1665
|
o === s || i.has(o.uuid) || e(o) && (i.add(o.uuid), t.push(o));
|
|
1666
1666
|
});
|
|
@@ -1677,7 +1677,7 @@ function _t(a, e) {
|
|
|
1677
1677
|
function Vi(a) {
|
|
1678
1678
|
return _t(a, (e) => e instanceof z && !(e instanceof V));
|
|
1679
1679
|
}
|
|
1680
|
-
function
|
|
1680
|
+
function Zo(a) {
|
|
1681
1681
|
if (typeof a.__modelObjectIndexSeed == "number")
|
|
1682
1682
|
return;
|
|
1683
1683
|
let e = -1;
|
|
@@ -1685,24 +1685,24 @@ function $o(a) {
|
|
|
1685
1685
|
typeof t?.index == "number" && Number.isFinite(t.index) && (e = Math.max(e, t.index));
|
|
1686
1686
|
}), a.__modelObjectIndexSeed = e + 1;
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1689
|
-
|
|
1688
|
+
function Jo(a) {
|
|
1689
|
+
Zo(a);
|
|
1690
1690
|
const e = a.__modelObjectIndexSeed;
|
|
1691
1691
|
return a.__modelObjectIndexSeed += 1, e;
|
|
1692
1692
|
}
|
|
1693
1693
|
function Ui(a, e, t) {
|
|
1694
|
-
const i = typeof t == "number" ? t :
|
|
1695
|
-
return e.index = i,
|
|
1694
|
+
const i = typeof t == "number" ? t : Jo(a);
|
|
1695
|
+
return e.index = i, ss(a).set(i, e), i;
|
|
1696
1696
|
}
|
|
1697
|
-
function
|
|
1697
|
+
function os(a) {
|
|
1698
1698
|
return Array.isArray(a) ? a : a != null ? [a] : [];
|
|
1699
1699
|
}
|
|
1700
|
-
function
|
|
1700
|
+
function er(a) {
|
|
1701
1701
|
return 1 + (Number.isFinite(a) ? Math.abs(Math.floor(a)) : 0) % 16 * 0.125;
|
|
1702
1702
|
}
|
|
1703
1703
|
function Wi(a, e) {
|
|
1704
|
-
const t = typeof e == "number" ? e : a?.index, i =
|
|
1705
|
-
|
|
1704
|
+
const t = typeof e == "number" ? e : a?.index, i = er(t);
|
|
1705
|
+
os(a?.material).forEach((n) => {
|
|
1706
1706
|
n.userData = n.userData ?? {};
|
|
1707
1707
|
const s = n.userData[ti] ?? {};
|
|
1708
1708
|
n.userData[ti] = {
|
|
@@ -1710,30 +1710,30 @@ function Wi(a, e) {
|
|
|
1710
1710
|
enabled: !0,
|
|
1711
1711
|
factor: 1,
|
|
1712
1712
|
units: i
|
|
1713
|
-
}, n.polygonOffset = !0, n.polygonOffsetFactor = 1, n.polygonOffsetUnits = i + (s.edgeActive ?
|
|
1713
|
+
}, n.polygonOffset = !0, n.polygonOffsetFactor = 1, n.polygonOffsetUnits = i + (s.edgeActive ? is : 0), n.needsUpdate = !0;
|
|
1714
1714
|
});
|
|
1715
1715
|
}
|
|
1716
1716
|
function cn(a, e) {
|
|
1717
|
-
|
|
1717
|
+
os(a?.material).forEach((t) => {
|
|
1718
1718
|
t.userData = t.userData ?? {};
|
|
1719
1719
|
const i = t.userData[ti] ?? {}, n = i.enabled ? i.units : t.polygonOffsetUnits ?? 0, s = i.enabled ? i.factor : t.polygonOffsetFactor ?? 1;
|
|
1720
1720
|
t.userData[ti] = {
|
|
1721
1721
|
...i,
|
|
1722
1722
|
edgeActive: e
|
|
1723
|
-
}, i.enabled || e ? (t.polygonOffset = !1, t.polygonOffsetFactor = s, t.polygonOffsetUnits = n + (e ?
|
|
1723
|
+
}, i.enabled || e ? (t.polygonOffset = !1, t.polygonOffsetFactor = s, t.polygonOffsetUnits = n + (e ? is : 0)) : t.polygonOffset = !1, t.needsUpdate = !0;
|
|
1724
1724
|
});
|
|
1725
1725
|
}
|
|
1726
1726
|
function Le(a, e) {
|
|
1727
1727
|
if (!Number.isFinite(e))
|
|
1728
1728
|
return;
|
|
1729
|
-
const t =
|
|
1729
|
+
const t = ss(a), i = t.get(e);
|
|
1730
1730
|
if (i && i.parent != null)
|
|
1731
1731
|
return i;
|
|
1732
1732
|
i && i.parent == null && t.delete(e);
|
|
1733
1733
|
const n = _t(a, (s) => s.index === e)[0];
|
|
1734
1734
|
return n != null ? (t.set(e, n), n) : a?.scene?.children?.find?.((s) => s?.index === e);
|
|
1735
1735
|
}
|
|
1736
|
-
class
|
|
1736
|
+
class tr {
|
|
1737
1737
|
constructor(e) {
|
|
1738
1738
|
this.engine = e;
|
|
1739
1739
|
}
|
|
@@ -1956,7 +1956,7 @@ function Gi(a) {
|
|
|
1956
1956
|
touchControlsSnapshot: null,
|
|
1957
1957
|
mouseMoveFrame: null,
|
|
1958
1958
|
latestMouseMoveEvent: null
|
|
1959
|
-
}, t = 800, i = 28, n = 132, s = 44, o = 168, r = new
|
|
1959
|
+
}, t = 800, i = 28, n = 132, s = 44, o = 168, r = new tr(a);
|
|
1960
1960
|
e.handle_catch = function(v, A, B = !0, U = !0) {
|
|
1961
1961
|
const Y = e.options;
|
|
1962
1962
|
e.options = {
|
|
@@ -2224,7 +2224,7 @@ function Gi(a) {
|
|
|
2224
2224
|
e.lastPoint = null;
|
|
2225
2225
|
}, e;
|
|
2226
2226
|
}
|
|
2227
|
-
class
|
|
2227
|
+
class ir {
|
|
2228
2228
|
engine;
|
|
2229
2229
|
orbitControls;
|
|
2230
2230
|
firstPersonControls;
|
|
@@ -2250,7 +2250,7 @@ class tr {
|
|
|
2250
2250
|
this.engine = e, this.init(), this.handelBehaved = Gi(this.engine), this.handelBehaved.init(this, null), this.handelBehaved.active();
|
|
2251
2251
|
}
|
|
2252
2252
|
init() {
|
|
2253
|
-
this.orbitControls = new
|
|
2253
|
+
this.orbitControls = new ts(this.engine, this.engine.camera, this.engine.renderer.domElement), this.orbitControls.showOriginIcon = !0, this.firstPersonControls = new an(this.engine, this.engine.camera, this.engine.renderer.domElement), this.thirdPersonControls = new ln(this.engine, this.engine.camera, this.engine.renderer.domElement), this.applyRoamLookDirection(this.firstPersonControls), this.applyRoamLookDirection(this.thirdPersonControls);
|
|
2254
2254
|
const e = document.createElement("div");
|
|
2255
2255
|
this.originDiv = e, e.className = "originDiv", e.style.position = "absolute", e.style.top = "0px", e.style.left = "0px", e.style.width = "30px", e.style.height = "30px", e.style.borderRadius = "50%", e.style.pointerEvents = "none", e.style.backgroundImage = `url(${ee("/assets/svg/rotate-orbit.svg", import.meta.url)})`, this.engine.container.appendChild(this.originDiv);
|
|
2256
2256
|
}
|
|
@@ -2546,7 +2546,7 @@ class tr {
|
|
|
2546
2546
|
this.isActive = !1, this.handelBehaved?.disActive?.(), this.orbitControls?.dispose?.(), this.firstPersonControls?.dispose?.(), this.thirdPersonControls?.dispose?.(), this.removeMobileRoamControls(), this.originDiv?.remove(), this.originDiv = null, this.orbitControls = null, this.firstPersonControls = null, this.thirdPersonControls = null, this.handelBehaved = null;
|
|
2547
2547
|
}
|
|
2548
2548
|
}
|
|
2549
|
-
const
|
|
2549
|
+
const nr = {
|
|
2550
2550
|
uniforms: {
|
|
2551
2551
|
tDiffuse: { value: null },
|
|
2552
2552
|
saturation: { value: 1.2 },
|
|
@@ -2582,8 +2582,8 @@ const ir = {
|
|
|
2582
2582
|
gl_FragColor = color;
|
|
2583
2583
|
}
|
|
2584
2584
|
`
|
|
2585
|
-
},
|
|
2586
|
-
class
|
|
2585
|
+
}, rs = 0.5, as = 1.1, ls = 1;
|
|
2586
|
+
class sr {
|
|
2587
2587
|
engine;
|
|
2588
2588
|
composer;
|
|
2589
2589
|
saturationPass;
|
|
@@ -2668,16 +2668,16 @@ class nr {
|
|
|
2668
2668
|
this.composer && (this.syncAmbientOcclusionDepthTextures(), this.composer.render());
|
|
2669
2669
|
}
|
|
2670
2670
|
init() {
|
|
2671
|
-
const { width: e, height: t } = this.engine.deviceModule.getContainerSize(), i = this.engine.scene, n = this.engine.camera, s = this.engine.renderer, o = this.engine.deviceModule.isMobile(), r = this.engine.renderer?.getPixelRatio?.() ?? window.devicePixelRatio ?? 1, l = o ? this.engine.mobileMemoryProfile.samples : 4, c = new
|
|
2671
|
+
const { width: e, height: t } = this.engine.deviceModule.getContainerSize(), i = this.engine.scene, n = this.engine.camera, s = this.engine.renderer, o = this.engine.deviceModule.isMobile(), r = this.engine.renderer?.getPixelRatio?.() ?? window.devicePixelRatio ?? 1, l = o ? this.engine.mobileMemoryProfile.samples : 4, c = new Kn(e, t, {
|
|
2672
2672
|
minFilter: Qt,
|
|
2673
2673
|
magFilter: Qt,
|
|
2674
|
-
format:
|
|
2674
|
+
format: jn,
|
|
2675
2675
|
// 移动端按设备内存控制多重采样,平衡边缘质量与全分辨率缓冲占用。
|
|
2676
2676
|
samples: l
|
|
2677
2677
|
});
|
|
2678
|
-
c.texture.colorSpace =
|
|
2679
|
-
const h = new
|
|
2680
|
-
this.composer.addPass(h), this.gtaoPass = new Yi(i, n, e, t), this.gtaoPass.output = Yi.OUTPUT.Default, this.gtaoPass.blendIntensity =
|
|
2678
|
+
c.texture.colorSpace = qs, this.composer = new Ks(s, c), this.composer.setPixelRatio(r), this.composer.setSize(e, t);
|
|
2679
|
+
const h = new js(i, n);
|
|
2680
|
+
this.composer.addPass(h), this.gtaoPass = new Yi(i, n, e, t), this.gtaoPass.output = Yi.OUTPUT.Default, this.gtaoPass.blendIntensity = rs, this.gtaoPass.enabled = !1, this.gtaoPass.normalMaterial.side = re, this.gtaoPass.normalMaterial.needsUpdate = !0, this.excludeClippingHelpersFromGtao(this.gtaoPass), this.gtaoPass.updateGtaoMaterial && this.gtaoPass.updateGtaoMaterial({
|
|
2681
2681
|
// AO 采样半径。推荐范围:0.1 ~ 2.0。
|
|
2682
2682
|
// 越大遮蔽范围越广,但容易发灰、丢细节;对性能有轻到中等影响。
|
|
2683
2683
|
radius: 0.45,
|
|
@@ -2703,7 +2703,7 @@ class nr {
|
|
|
2703
2703
|
samples: 32,
|
|
2704
2704
|
rings: 3,
|
|
2705
2705
|
radiusExponent: 2
|
|
2706
|
-
}), this.applyClippingToAmbientOcclusionPass(this.gtaoPass), this.composer.addPass(this.gtaoPass), this.ssaoPass = new Xi(i, n, e, t), this.ssaoPass.kernelRadius = 8, this.ssaoPass.minDistance = 5e-3, this.ssaoPass.maxDistance = 0.1, this.ssaoPass.output = Xi.OUTPUT.Default, this.ssaoPass.enabled = !1, this.excludeClippingHelpersFromGtao(this.ssaoPass), this.applyClippingToAmbientOcclusionPass(this.ssaoPass), this.composer.addPass(this.ssaoPass), this.saturationPass = new ai(
|
|
2706
|
+
}), this.applyClippingToAmbientOcclusionPass(this.gtaoPass), this.composer.addPass(this.gtaoPass), this.ssaoPass = new Xi(i, n, e, t), this.ssaoPass.kernelRadius = 8, this.ssaoPass.minDistance = 5e-3, this.ssaoPass.maxDistance = 0.1, this.ssaoPass.output = Xi.OUTPUT.Default, this.ssaoPass.enabled = !1, this.excludeClippingHelpersFromGtao(this.ssaoPass), this.applyClippingToAmbientOcclusionPass(this.ssaoPass), this.composer.addPass(this.ssaoPass), this.saturationPass = new ai(nr), this.saturationPass.uniforms.saturation.value = as, this.saturationPass.uniforms.contrast.value = ls, this.saturationPass.enabled = !1, this.composer.addPass(this.saturationPass), this.outputPass = new Ys(), this.outputPass.enabled = !0, this.composer.addPass(this.outputPass), this.fxaaPass = new ai(Xs), this.fxaaPass.material.uniforms.resolution.value.x = 1 / (e * r), this.fxaaPass.material.uniforms.resolution.value.y = 1 / (t * r), this.fxaaPass.enabled = o, this.composer.addPass(this.fxaaPass), this.syncAmbientOcclusionDepthTextures();
|
|
2707
2707
|
}
|
|
2708
2708
|
}
|
|
2709
2709
|
function Dt(a) {
|
|
@@ -2713,7 +2713,7 @@ function Dt(a) {
|
|
|
2713
2713
|
i = n[1];
|
|
2714
2714
|
a.name = t, a.guid = i;
|
|
2715
2715
|
}
|
|
2716
|
-
function
|
|
2716
|
+
function or(a, e, t, i) {
|
|
2717
2717
|
const r = a.models.find((x) => x.url == t);
|
|
2718
2718
|
if (r == null)
|
|
2719
2719
|
return;
|
|
@@ -2724,7 +2724,7 @@ function sr(a, e, t, i) {
|
|
|
2724
2724
|
}, x.rotation = { x: 0, y: 0, z: 0 }, x), M = (x, m) => {
|
|
2725
2725
|
if (!Array.isArray(m) || m.length === 0)
|
|
2726
2726
|
return;
|
|
2727
|
-
const b = m.map((S) => y(S)), C =
|
|
2727
|
+
const b = m.map((S) => y(S)), C = ar(x, l, b, t, a);
|
|
2728
2728
|
C != null && b.forEach((S, I) => {
|
|
2729
2729
|
const P = [[C, I, 0, 0]];
|
|
2730
2730
|
S.indexes = P, S.id = Number(S.id);
|
|
@@ -2732,9 +2732,9 @@ function sr(a, e, t, i) {
|
|
|
2732
2732
|
Dt(L), r.nodesMap.set(Number(S.id), L), c.push(Number(S.id));
|
|
2733
2733
|
});
|
|
2734
2734
|
};
|
|
2735
|
-
M("Circle", h), M("Rect", u), M("Ellipse", g), M("Bridge", p),
|
|
2735
|
+
M("Circle", h), M("Rect", u), M("Ellipse", g), M("Bridge", p), rr(r, c);
|
|
2736
2736
|
}
|
|
2737
|
-
function
|
|
2737
|
+
function rr(a, e) {
|
|
2738
2738
|
if (e.length === 0 || !Array.isArray(a?.lods))
|
|
2739
2739
|
return;
|
|
2740
2740
|
const i = a.lods[0]?.octreeBox;
|
|
@@ -2746,7 +2746,7 @@ function or(a, e) {
|
|
|
2746
2746
|
n.has(s) || (i.elements.push(s), n.add(s));
|
|
2747
2747
|
});
|
|
2748
2748
|
}
|
|
2749
|
-
function
|
|
2749
|
+
function ar(a, e, t, i, n) {
|
|
2750
2750
|
let s;
|
|
2751
2751
|
const o = {
|
|
2752
2752
|
width: 1,
|
|
@@ -2824,7 +2824,7 @@ function rr(a, e, t, i, n) {
|
|
|
2824
2824
|
return r.meshs = p, r.instanceMatrix && r.instanceMatrix.array && (r.cloneInstanceMatrix = Array.from(r.instanceMatrix.array)), r.instanceMatrix.needsUpdate = !0, l;
|
|
2825
2825
|
}
|
|
2826
2826
|
function Ht(a, e) {
|
|
2827
|
-
const t = new
|
|
2827
|
+
const t = new Yn();
|
|
2828
2828
|
switch (e.width = e.width * 0.3048, e.height = e.height * 0.3048, e.diameter = e.diameter * 0.3048, a) {
|
|
2829
2829
|
case "Rect":
|
|
2830
2830
|
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);
|
|
@@ -2845,7 +2845,7 @@ function Ht(a, e) {
|
|
|
2845
2845
|
};
|
|
2846
2846
|
return n(t, i, e.color, e.position, e.rotation);
|
|
2847
2847
|
function n(s, o, r, l, c) {
|
|
2848
|
-
const h = new
|
|
2848
|
+
const h = new Xn(s, o), u = new Ri({
|
|
2849
2849
|
// MEP 最终颜色由 instanceColor 乘算,基础材质保持白色才能避免二次染色。
|
|
2850
2850
|
color: 16777215,
|
|
2851
2851
|
metalness: 0,
|
|
@@ -2857,69 +2857,69 @@ function Ht(a, e) {
|
|
|
2857
2857
|
}
|
|
2858
2858
|
}
|
|
2859
2859
|
var se = /* @__PURE__ */ ((a) => (a.ModelLoadStart = "model-load-start", a.ModelLoadProgress = "model-load-progress", a.ModelLoaded = "model-loaded", a.ModelError = "model-error", a.SelectionChanged = "selection-changed", a.HoverChanged = "hover-changed", a.Click = "click", a.MouseMove = "mouse-move", a.ModelPlaceSelected = "model-place-selected", a.ModelCalibrationChanged = "model-calibration-changed", a.CameraChanged = "camera-changed", a.CameraIdle = "camera-idle", a.EngineFree = "engine-free", a.EngineBusy = "engine-busy", a.MeasureChanged = "measure-changed", a.MeasureClick = "measure-click", a.SectionMove = "section-move", a.LoadingCompleted = "loading_completed", a))(se || {});
|
|
2860
|
-
const hn = "__bvhAccelerationInstalled",
|
|
2861
|
-
function
|
|
2860
|
+
const hn = "__bvhAccelerationInstalled", cs = "__bvhBuildFailed", lr = "__bvhBuilt", cr = "__bvhTriangleCount", hs = 200, hr = 10;
|
|
2861
|
+
function dr() {
|
|
2862
2862
|
const a = globalThis;
|
|
2863
|
-
a[hn] !== !0 && (z.prototype.raycast =
|
|
2863
|
+
a[hn] !== !0 && (z.prototype.raycast = Qs, ae.prototype.computeBoundsTree = Qn, ae.prototype.disposeBoundsTree = $s, a[hn] = !0);
|
|
2864
2864
|
}
|
|
2865
|
-
function
|
|
2865
|
+
function ur(a) {
|
|
2866
2866
|
a.firstHitOnly = !0;
|
|
2867
2867
|
}
|
|
2868
|
-
function
|
|
2868
|
+
function pr(a) {
|
|
2869
2869
|
delete a.firstHitOnly;
|
|
2870
2870
|
}
|
|
2871
|
-
function
|
|
2871
|
+
function mr(a, e = hs) {
|
|
2872
2872
|
if (a == null)
|
|
2873
2873
|
return !1;
|
|
2874
2874
|
const t = a;
|
|
2875
|
-
if (t.boundsTree != null || t.userData?.[
|
|
2875
|
+
if (t.boundsTree != null || t.userData?.[cs] === !0)
|
|
2876
2876
|
return !1;
|
|
2877
2877
|
const i = a.attributes.position?.count ?? 0;
|
|
2878
2878
|
return (a.index?.count ?? i) / 3 >= e;
|
|
2879
2879
|
}
|
|
2880
|
-
function
|
|
2880
|
+
function gr(a) {
|
|
2881
2881
|
if (a == null)
|
|
2882
2882
|
return 0;
|
|
2883
2883
|
const e = a.attributes.position?.count ?? 0;
|
|
2884
2884
|
return (a.index?.count ?? e) / 3;
|
|
2885
2885
|
}
|
|
2886
|
-
function
|
|
2886
|
+
function fr(a, e = {}) {
|
|
2887
2887
|
if (a == null)
|
|
2888
2888
|
return;
|
|
2889
|
-
const t = e.triangleThreshold ??
|
|
2890
|
-
if (!
|
|
2889
|
+
const t = e.triangleThreshold ?? hs;
|
|
2890
|
+
if (!mr(a, t)) {
|
|
2891
2891
|
e.setBoundingBox === !0 && a.boundingBox == null && a.computeBoundingBox(), e.setBoundingSphere === !0 && a.boundingSphere == null && a.computeBoundingSphere();
|
|
2892
2892
|
return;
|
|
2893
2893
|
}
|
|
2894
2894
|
const i = a;
|
|
2895
2895
|
try {
|
|
2896
|
-
i.userData = i.userData ?? {}, i.userData[
|
|
2896
|
+
i.userData = i.userData ?? {}, i.userData[cr] = gr(a), e.setBoundingBox === !0 && a.boundingBox == null && a.computeBoundingBox(), e.setBoundingSphere === !0 && a.boundingSphere == null && a.computeBoundingSphere(), Qn.call(i, {
|
|
2897
2897
|
// 对外继续兼容旧字段,内部改用 three-mesh-bvh 0.9.10 的新参数名。
|
|
2898
|
-
maxLeafSize: e.maxLeafTris ??
|
|
2899
|
-
}), i.userData[
|
|
2898
|
+
maxLeafSize: e.maxLeafTris ?? hr
|
|
2899
|
+
}), i.userData[lr] = i.boundsTree != null;
|
|
2900
2900
|
} catch (n) {
|
|
2901
|
-
i.userData = i.userData ?? {}, i.userData[
|
|
2901
|
+
i.userData = i.userData ?? {}, i.userData[cs] = !0, console.warn("[raycastAcceleration] failed to build bounds tree", n);
|
|
2902
2902
|
}
|
|
2903
2903
|
}
|
|
2904
2904
|
let gt = null, ft = null, dn = null;
|
|
2905
|
-
const
|
|
2906
|
-
function
|
|
2905
|
+
const yr = 8, ds = 24, Mr = 24, vr = 64, xr = 240, wr = 2, un = /* @__PURE__ */ new WeakSet(), br = 10;
|
|
2906
|
+
function us() {
|
|
2907
2907
|
return ee("draco/", import.meta.url);
|
|
2908
2908
|
}
|
|
2909
|
-
function
|
|
2909
|
+
function ps() {
|
|
2910
2910
|
return ee("basis/", import.meta.url);
|
|
2911
2911
|
}
|
|
2912
|
-
function
|
|
2913
|
-
return gt == null && (gt = new
|
|
2914
|
-
}
|
|
2915
|
-
function Cr(a) {
|
|
2916
|
-
return ft == null && (ft = new Js(), ft.setTranscoderPath(us())), dn !== a && (ft.detectSupport(a), dn = a), ft;
|
|
2912
|
+
function Cr() {
|
|
2913
|
+
return gt == null && (gt = new $n(), gt.setDecoderPath(us()), gt.preload()), gt;
|
|
2917
2914
|
}
|
|
2918
2915
|
function Er(a) {
|
|
2916
|
+
return ft == null && (ft = new eo(), ft.setTranscoderPath(ps())), dn !== a && (ft.detectSupport(a), dn = a), ft;
|
|
2917
|
+
}
|
|
2918
|
+
function Ar(a) {
|
|
2919
2919
|
const e = new zi();
|
|
2920
|
-
return e.setDRACOLoader(
|
|
2920
|
+
return e.setDRACOLoader(Cr()), e.setMeshoptDecoder(Js), a?.renderer != null && e.setKTX2Loader(Er(a.renderer)), e;
|
|
2921
2921
|
}
|
|
2922
|
-
function
|
|
2922
|
+
function ms() {
|
|
2923
2923
|
return new Promise((a) => {
|
|
2924
2924
|
if (typeof requestAnimationFrame == "function") {
|
|
2925
2925
|
requestAnimationFrame(() => a());
|
|
@@ -2928,20 +2928,20 @@ function ps() {
|
|
|
2928
2928
|
setTimeout(a, 16);
|
|
2929
2929
|
});
|
|
2930
2930
|
}
|
|
2931
|
-
function
|
|
2931
|
+
function Sr() {
|
|
2932
2932
|
const a = navigator?.scheduling;
|
|
2933
2933
|
return typeof a?.isInputPending == "function" ? a.isInputPending() : !1;
|
|
2934
2934
|
}
|
|
2935
|
-
function
|
|
2936
|
-
return a?.engineStatus?.isFree === !1 ||
|
|
2935
|
+
function Pr(a) {
|
|
2936
|
+
return a?.engineStatus?.isFree === !1 || Sr();
|
|
2937
2937
|
}
|
|
2938
2938
|
async function Ze(a, e, t) {
|
|
2939
2939
|
if (e)
|
|
2940
2940
|
return t;
|
|
2941
2941
|
const i = performance.now();
|
|
2942
|
-
return
|
|
2942
|
+
return Pr(a) || i - t >= yr ? (await ms(), performance.now()) : t;
|
|
2943
2943
|
}
|
|
2944
|
-
function
|
|
2944
|
+
function Tr(a, e) {
|
|
2945
2945
|
return new Promise((t, i) => {
|
|
2946
2946
|
Mt(a, (n) => {
|
|
2947
2947
|
if (n == null) {
|
|
@@ -2954,7 +2954,7 @@ function Pr(a, e) {
|
|
|
2954
2954
|
}, e);
|
|
2955
2955
|
});
|
|
2956
2956
|
}
|
|
2957
|
-
async function
|
|
2957
|
+
async function gs(a, e) {
|
|
2958
2958
|
const t = await ei({
|
|
2959
2959
|
method: "get",
|
|
2960
2960
|
responseType: "arraybuffer",
|
|
@@ -2966,7 +2966,7 @@ async function ms(a, e) {
|
|
|
2966
2966
|
function pn(a) {
|
|
2967
2967
|
return a.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
2968
2968
|
}
|
|
2969
|
-
function
|
|
2969
|
+
function fs(a, e) {
|
|
2970
2970
|
const t = new Set(e.map((i) => pn(i)));
|
|
2971
2971
|
for (const i of Object.keys(a.files))
|
|
2972
2972
|
if (t.has(pn(i)))
|
|
@@ -2974,22 +2974,22 @@ function gs(a, e) {
|
|
|
2974
2974
|
return null;
|
|
2975
2975
|
}
|
|
2976
2976
|
function mn(a, e) {
|
|
2977
|
-
const t =
|
|
2977
|
+
const t = fs(a, e);
|
|
2978
2978
|
return t == null || t.dir ? Promise.resolve(null) : t.async("string");
|
|
2979
2979
|
}
|
|
2980
|
-
function
|
|
2980
|
+
function Ir(a) {
|
|
2981
2981
|
const e = Object.values(a.files).find((t) => t != null && t.dir !== !0);
|
|
2982
2982
|
return e == null ? Promise.resolve(null) : e.async("string");
|
|
2983
2983
|
}
|
|
2984
|
-
function
|
|
2984
|
+
function _r(a) {
|
|
2985
2985
|
return a.charCodeAt(0) === 65279 ? a.slice(1) : a;
|
|
2986
2986
|
}
|
|
2987
2987
|
function ii(a) {
|
|
2988
|
-
return JSON.parse(
|
|
2988
|
+
return JSON.parse(_r(a));
|
|
2989
2989
|
}
|
|
2990
|
-
async function
|
|
2990
|
+
async function Dr(a, e) {
|
|
2991
2991
|
try {
|
|
2992
|
-
const t = await
|
|
2992
|
+
const t = await gs(a, e), i = await Ir(t);
|
|
2993
2993
|
if (i == null)
|
|
2994
2994
|
return { exists: !0, value: [] };
|
|
2995
2995
|
const n = ii(i);
|
|
@@ -2998,13 +2998,13 @@ async function _r(a, e) {
|
|
|
2998
2998
|
return ei.isAxiosError(t) && t.response?.status === 404 ? { exists: !1 } : (console.warn("[loadLightModel] failed to load optional quota_list", { path: a, error: t }), { exists: !1 });
|
|
2999
2999
|
}
|
|
3000
3000
|
}
|
|
3001
|
-
function
|
|
3002
|
-
const t =
|
|
3001
|
+
function kr(a, e) {
|
|
3002
|
+
const t = fs(a, e);
|
|
3003
3003
|
return t == null || t.dir ? Promise.resolve(null) : t.async("arraybuffer");
|
|
3004
3004
|
}
|
|
3005
|
-
function
|
|
3005
|
+
function Lr(a, e) {
|
|
3006
3006
|
return new Promise((t, i) => {
|
|
3007
|
-
|
|
3007
|
+
Ar(a).parse(e, zo(import.meta.url), t, i);
|
|
3008
3008
|
});
|
|
3009
3009
|
}
|
|
3010
3010
|
function mt(a, e) {
|
|
@@ -3022,34 +3022,34 @@ function kt(a) {
|
|
|
3022
3022
|
t.disposeBoundsTree?.(), t.dispose();
|
|
3023
3023
|
}), a.length = 0;
|
|
3024
3024
|
}
|
|
3025
|
-
function
|
|
3025
|
+
function ys(a, e) {
|
|
3026
3026
|
const t = mt(a, e);
|
|
3027
3027
|
return Array.isArray(t?.lods) ? t.lods : [];
|
|
3028
3028
|
}
|
|
3029
|
-
function
|
|
3029
|
+
function Ms(a) {
|
|
3030
3030
|
a.loadStatus == null && (a.loadStatus = {}), a.loadStatus.modelMep == null && (a.loadStatus.modelMep = !1), a.loadStatus.normal == null && (a.loadStatus.normal = !1), a.loadStatus.quotaList == null && (a.loadStatus.quotaList = !1);
|
|
3031
3031
|
}
|
|
3032
|
-
function
|
|
3033
|
-
return
|
|
3032
|
+
function Br(a) {
|
|
3033
|
+
return Ms(a), a.status === "loaded" && a.loadStatus.normal === !0 && a.loadStatus.modelMep === !0 && a.loadStatus.quotaList === !0;
|
|
3034
3034
|
}
|
|
3035
3035
|
function xt(a) {
|
|
3036
3036
|
const e = a?.engineStatus?.models;
|
|
3037
|
-
!Array.isArray(e) || e.length === 0 || !e.every((i) =>
|
|
3037
|
+
!Array.isArray(e) || e.length === 0 || !e.every((i) => Br(i)) || a.__loadingCompletedTriggered === !0 || (a.__loadingCompletedTriggered = !0, a.events?.trigger?.(se.LoadingCompleted, {}));
|
|
3038
3038
|
}
|
|
3039
|
-
function
|
|
3039
|
+
function vs(a) {
|
|
3040
3040
|
return a === !0 || a === "loading";
|
|
3041
3041
|
}
|
|
3042
3042
|
function gn(a) {
|
|
3043
3043
|
return a.index != null ? a.index.count : a.attributes.position?.count ?? 0;
|
|
3044
3044
|
}
|
|
3045
|
-
async function
|
|
3045
|
+
async function zr(a, e, t) {
|
|
3046
3046
|
let i = performance.now();
|
|
3047
3047
|
for (let n = 0; n < e.length; n++)
|
|
3048
3048
|
e[n]?.traverse?.((s) => {
|
|
3049
|
-
|
|
3050
|
-
}), (n + 1) %
|
|
3049
|
+
bs(s?.material, a);
|
|
3050
|
+
}), (n + 1) % Mr === 0 && (i = await Ze(a, t, i));
|
|
3051
3051
|
}
|
|
3052
|
-
async function
|
|
3052
|
+
async function Rr(a, e, t) {
|
|
3053
3053
|
const i = [], n = [{ node: e.octreeBox, visited: !1 }];
|
|
3054
3054
|
let s = performance.now();
|
|
3055
3055
|
for (; n.length > 0; ) {
|
|
@@ -3070,13 +3070,13 @@ async function zr(a, e, t) {
|
|
|
3070
3070
|
}
|
|
3071
3071
|
return i;
|
|
3072
3072
|
}
|
|
3073
|
-
async function
|
|
3073
|
+
async function Or(a, e, t, i) {
|
|
3074
3074
|
if (ue(a, e.url, e.loadVersion))
|
|
3075
3075
|
return [];
|
|
3076
3076
|
const n = mt(a, e.url);
|
|
3077
3077
|
if (n?.nodesMap == null)
|
|
3078
3078
|
return [];
|
|
3079
|
-
const s = a.filterLoaderModel?.getContinueIdSet?.(e.url) ?? /* @__PURE__ */ new Set(), o = await
|
|
3079
|
+
const s = a.filterLoaderModel?.getContinueIdSet?.(e.url) ?? /* @__PURE__ */ new Set(), o = await Rr(a, t, i);
|
|
3080
3080
|
console.log("[loadLightModel] pending mesh ids", t.path, o.length);
|
|
3081
3081
|
const r = [], l = a?.deviceModule?.isMobile?.() !== !0;
|
|
3082
3082
|
let c = performance.now(), h = 0;
|
|
@@ -3097,46 +3097,46 @@ async function Rr(a, e, t, i) {
|
|
|
3097
3097
|
m.dispose();
|
|
3098
3098
|
continue;
|
|
3099
3099
|
}
|
|
3100
|
-
m.applyMatrix4(x), m.computeBoundingBox(), l && b.count > 2e4 &&
|
|
3100
|
+
m.applyMatrix4(x), m.computeBoundingBox(), l && b.count > 2e4 && fr(m, {
|
|
3101
3101
|
setBoundingSphere: !0
|
|
3102
3102
|
});
|
|
3103
3103
|
const C = new z(m, M.material);
|
|
3104
|
-
y.box = m.boundingBox?.clone(), y.mesh = C, C.name = Number(u), C.glb = y.glb, C.url = e.url, r.push(C), h++, h %
|
|
3104
|
+
y.box = m.boundingBox?.clone(), y.mesh = C, C.name = Number(u), C.glb = y.glb, C.url = e.url, r.push(C), h++, h % ds === 0 && (c = await Ze(a, i, c));
|
|
3105
3105
|
}
|
|
3106
3106
|
}
|
|
3107
3107
|
return r;
|
|
3108
3108
|
}
|
|
3109
|
-
function
|
|
3109
|
+
function xs(a) {
|
|
3110
3110
|
const e = a.clone();
|
|
3111
3111
|
return e.clippingPlanes = a.clippingPlanes, e;
|
|
3112
3112
|
}
|
|
3113
|
-
function
|
|
3113
|
+
function Fr(a) {
|
|
3114
3114
|
a.setRGB(a.r, a.g, a.b, We);
|
|
3115
3115
|
}
|
|
3116
|
-
function
|
|
3116
|
+
function Nr(a) {
|
|
3117
3117
|
const e = a;
|
|
3118
|
-
e.color == null || a.userData.__displayColorLinearized === !0 || (
|
|
3118
|
+
e.color == null || a.userData.__displayColorLinearized === !0 || (Fr(e.color), a.userData.__displayColorLinearized = !0);
|
|
3119
3119
|
}
|
|
3120
|
-
function
|
|
3120
|
+
function Hr(a, e, t, i, n, s) {
|
|
3121
3121
|
const o = Et(
|
|
3122
3122
|
i.map((u) => u.geometry),
|
|
3123
3123
|
!1
|
|
3124
|
-
), r =
|
|
3124
|
+
), r = xs(n), l = new z(o, r);
|
|
3125
3125
|
s != null && (l.visible = !1, s.push(l)), l.castShadow = !0, l.receiveShadow = !0, ot(e, a).add(l);
|
|
3126
3126
|
const h = Ui(e, l);
|
|
3127
3127
|
return Wi(l, h), l.url = a, l.glb = t, l.materialClone = r, l.geometrys = i.map((u) => u.geometry), l.geometry.computeVertexNormals(), l;
|
|
3128
3128
|
}
|
|
3129
|
-
function
|
|
3129
|
+
function Vr(a, e, t, i) {
|
|
3130
3130
|
return ($e(a, e)?.children ?? a.scene.children).find((o) => {
|
|
3131
3131
|
const r = o;
|
|
3132
3132
|
return o instanceof z && r.url == e && r.glb == t && r.materialClone === i;
|
|
3133
3133
|
});
|
|
3134
3134
|
}
|
|
3135
|
-
function
|
|
3135
|
+
function Ur(a, e) {
|
|
3136
3136
|
const t = Array.isArray(a.geometrys) ? a.geometrys : [], i = e.map((o) => o.geometry), n = [...t, ...i], s = Et(n, !1);
|
|
3137
3137
|
a.geometry != null && a.geometry.dispose(), a.geometry = s, a.geometrys = n, a.castShadow = !0, a.receiveShadow = !0;
|
|
3138
3138
|
}
|
|
3139
|
-
async function
|
|
3139
|
+
async function Wr(a, e, t, i, n, s) {
|
|
3140
3140
|
if (ue(t, a, e)) {
|
|
3141
3141
|
kt(i);
|
|
3142
3142
|
return;
|
|
@@ -3149,7 +3149,7 @@ async function Ur(a, e, t, i, n, s) {
|
|
|
3149
3149
|
const r = mt(t, a);
|
|
3150
3150
|
let l = performance.now();
|
|
3151
3151
|
for (const [c, h] of o.entries()) {
|
|
3152
|
-
const u = n ? h.length :
|
|
3152
|
+
const u = n ? h.length : xr;
|
|
3153
3153
|
for (let p = 0; p < h.length; p += u) {
|
|
3154
3154
|
if (ue(t, a, e)) {
|
|
3155
3155
|
kt(i);
|
|
@@ -3158,9 +3158,9 @@ async function Ur(a, e, t, i, n, s) {
|
|
|
3158
3158
|
const g = h.slice(p, p + u);
|
|
3159
3159
|
if (g.length === 0)
|
|
3160
3160
|
continue;
|
|
3161
|
-
const y =
|
|
3162
|
-
let M =
|
|
3163
|
-
M = null, M != null ? (x = Array.isArray(M.geometrys) ? M.geometrys.length : 0, m = gn(M.geometry),
|
|
3161
|
+
const y = ea(g[0].material, t);
|
|
3162
|
+
let M = Vr(t, a, c, y), x = 0, m = 0;
|
|
3163
|
+
M = null, M != null ? (x = Array.isArray(M.geometrys) ? M.geometrys.length : 0, m = gn(M.geometry), Ur(M, g)) : M = Hr(a, t, c, g, y, s);
|
|
3164
3164
|
const b = /* @__PURE__ */ new Map();
|
|
3165
3165
|
let C = m;
|
|
3166
3166
|
g.forEach((S, I) => {
|
|
@@ -3177,25 +3177,25 @@ async function Ur(a, e, t, i, n, s) {
|
|
|
3177
3177
|
}
|
|
3178
3178
|
}
|
|
3179
3179
|
}
|
|
3180
|
-
function
|
|
3180
|
+
function Gr(a, e) {
|
|
3181
3181
|
const t = a?.geometry;
|
|
3182
3182
|
return t instanceof ae ? (t.boundingBox == null && t.computeBoundingBox(), t.boundingBox?.clone().applyMatrix4(e) ?? null) : null;
|
|
3183
3183
|
}
|
|
3184
|
-
async function
|
|
3184
|
+
async function qr(a, e, t, i, n, s, o, r) {
|
|
3185
3185
|
if (ue(i, a, e) || n == null || s == null || s.length === 0)
|
|
3186
3186
|
return;
|
|
3187
3187
|
const l = mt(i, a);
|
|
3188
3188
|
if (l == null)
|
|
3189
3189
|
return;
|
|
3190
3190
|
n.geometry.computeVertexNormals();
|
|
3191
|
-
const c = new V(n.geometry,
|
|
3191
|
+
const c = new V(n.geometry, xs(n.material), s.length);
|
|
3192
3192
|
r != null && (c.visible = !1, r.push(c)), ot(i, a).add(c);
|
|
3193
3193
|
const u = Ui(i, c);
|
|
3194
3194
|
Wi(c, u);
|
|
3195
3195
|
const p = new Float32Array(s.length * 3);
|
|
3196
3196
|
for (let M = 0; M < s.length; M++)
|
|
3197
3197
|
p[M * 3] = 1, p[M * 3 + 1] = 1, p[M * 3 + 2] = 1;
|
|
3198
|
-
c.instanceColor = new
|
|
3198
|
+
c.instanceColor = new Zs(p, 3);
|
|
3199
3199
|
let g = performance.now();
|
|
3200
3200
|
const y = [];
|
|
3201
3201
|
for (let M = 0; M < s.length; M++) {
|
|
@@ -3205,7 +3205,7 @@ async function Gr(a, e, t, i, n, s, o, r) {
|
|
|
3205
3205
|
}
|
|
3206
3206
|
const x = s[M], m = new H();
|
|
3207
3207
|
m.elements = x.matrix;
|
|
3208
|
-
const b =
|
|
3208
|
+
const b = Gr(n, m);
|
|
3209
3209
|
if (b != null && (x.box = b.clone()), c.setMatrixAt(M, m), c.matrixs || (c.matrixs = []), c.matrixs.push(m.clone()), y.push(m.clone()), l.nodesMap.has(x.id)) {
|
|
3210
3210
|
const C = l.nodesMap.get(x.id);
|
|
3211
3211
|
C.indexes == null && (C.indexes = []), C.indexes.push([u, M, 0, 0]), Dt(C), b != null && C?.info != null && (C.info.box instanceof R ? C.info.box.union(b) : C.info.box = b.clone());
|
|
@@ -3218,11 +3218,11 @@ async function Gr(a, e, t, i, n, s, o, r) {
|
|
|
3218
3218
|
};
|
|
3219
3219
|
Dt(C), l.nodesMap.set(x.id, C);
|
|
3220
3220
|
}
|
|
3221
|
-
(M + 1) %
|
|
3221
|
+
(M + 1) % vr === 0 && (g = await Ze(i, o, g));
|
|
3222
3222
|
}
|
|
3223
3223
|
c.instanceMatrix.needsUpdate = !0, c.instanceColor != null && (c.instanceColor.needsUpdate = !0), c.materialClone = c.material, c.url = a, c.glb = n.glb, c.ids = s.map((M) => M.id), c.matrixsClone = y, c.meshIndex = t, r == null && i.requestComposerRender?.();
|
|
3224
3224
|
}
|
|
3225
|
-
async function
|
|
3225
|
+
async function Kr(a, e, t, i, n) {
|
|
3226
3226
|
const s = e.instanceNodes;
|
|
3227
3227
|
if (s == null)
|
|
3228
3228
|
return;
|
|
@@ -3239,7 +3239,7 @@ async function qr(a, e, t, i, n) {
|
|
|
3239
3239
|
const u = Array.isArray(c.children) ? c.children.filter((p) => o.has(Number(p?.id)) === !1) : [];
|
|
3240
3240
|
if (u.length === 0)
|
|
3241
3241
|
continue;
|
|
3242
|
-
await
|
|
3242
|
+
await qr(
|
|
3243
3243
|
a.url,
|
|
3244
3244
|
a.loadVersion,
|
|
3245
3245
|
c.mesh,
|
|
@@ -3255,30 +3255,30 @@ async function qr(a, e, t, i, n) {
|
|
|
3255
3255
|
}
|
|
3256
3256
|
}
|
|
3257
3257
|
}
|
|
3258
|
-
async function
|
|
3258
|
+
async function jr(a, e, t, i) {
|
|
3259
3259
|
if (t.status === !0 || t.meshPromise != null) {
|
|
3260
3260
|
await t.meshPromise;
|
|
3261
3261
|
return;
|
|
3262
3262
|
}
|
|
3263
3263
|
t.meshPromise = (async () => {
|
|
3264
3264
|
console.log(`[loadLightModel] start build lod meshes ${Date.now() - window.startTime}ms`);
|
|
3265
|
-
const n = a?.deviceModule?.isMobile?.() === !0 ? [] : void 0, s = await
|
|
3265
|
+
const n = a?.deviceModule?.isMobile?.() === !0 ? [] : void 0, s = await Or(a, e, t, i);
|
|
3266
3266
|
if (ue(a, e.url, e.loadVersion)) {
|
|
3267
3267
|
kt(s);
|
|
3268
3268
|
return;
|
|
3269
3269
|
}
|
|
3270
|
-
if (await
|
|
3270
|
+
if (await Kr(e, t, a, i, n), ue(a, e.url, e.loadVersion)) {
|
|
3271
3271
|
kt(s);
|
|
3272
3272
|
return;
|
|
3273
3273
|
}
|
|
3274
|
-
t.glbs = [], await
|
|
3274
|
+
t.glbs = [], await Wr(e.url, e.loadVersion, a, s, i, n), !ue(a, e.url, e.loadVersion) && (t.instanceNodes = null, t.status = !0, n?.forEach((o) => {
|
|
3275
3275
|
o.visible = !0;
|
|
3276
3276
|
}), a.requestComposerRender?.(), console.log(`[loadLightModel] *****************************************************finish build lod meshes ${Date.now() - window.startTime}ms`));
|
|
3277
3277
|
})().finally(() => {
|
|
3278
3278
|
t.meshPromise = null;
|
|
3279
3279
|
}), await t.meshPromise;
|
|
3280
3280
|
}
|
|
3281
|
-
async function
|
|
3281
|
+
async function Yr(a, e, t, i) {
|
|
3282
3282
|
if (t.loadSuccess !== !0) {
|
|
3283
3283
|
if (t.preparePromise != null) {
|
|
3284
3284
|
await t.preparePromise;
|
|
@@ -3288,7 +3288,7 @@ async function jr(a, e, t, i) {
|
|
|
3288
3288
|
console.log("[loadLightModel] loading GLB bundle", t.path), t.glbs = t.glbs ?? {};
|
|
3289
3289
|
const n = e.url + t.path;
|
|
3290
3290
|
vt(a, e.url, n), console.log(`[loadLightModel] ZIP 解压开始 ${Date.now() - window.startTime}ms`);
|
|
3291
|
-
const s = await
|
|
3291
|
+
const s = await gs(n, e.key);
|
|
3292
3292
|
console.log(`[loadLightModel] ZIP 解压完成 ${Date.now() - window.startTime}ms`);
|
|
3293
3293
|
const o = await mn(s, ["/nodes.json", "nodes.json"]);
|
|
3294
3294
|
if (o == null)
|
|
@@ -3312,11 +3312,11 @@ async function jr(a, e, t, i) {
|
|
|
3312
3312
|
continue;
|
|
3313
3313
|
S.infos.push(C), Dt(S);
|
|
3314
3314
|
}
|
|
3315
|
-
(b + 1) %
|
|
3315
|
+
(b + 1) % ds === 0 && (c = await Ze(a, i, c));
|
|
3316
3316
|
}
|
|
3317
3317
|
}
|
|
3318
3318
|
const u = async (x) => {
|
|
3319
|
-
let m = await
|
|
3319
|
+
let m = await kr(s, [`/${x}.glb`, `${x}.glb`, x + ".glb"]);
|
|
3320
3320
|
if (m == null) {
|
|
3321
3321
|
console.error("[loadLightModel] glb not found in zip", {
|
|
3322
3322
|
modelUrl: e.url,
|
|
@@ -3327,17 +3327,17 @@ async function jr(a, e, t, i) {
|
|
|
3327
3327
|
return;
|
|
3328
3328
|
}
|
|
3329
3329
|
try {
|
|
3330
|
-
const b = await
|
|
3330
|
+
const b = await Lr(a, m);
|
|
3331
3331
|
m = null, t.glbs[x] = b.scene.children, t.glbs[x].forEach((C) => {
|
|
3332
3332
|
C.matrixWorld;
|
|
3333
|
-
}), await
|
|
3333
|
+
}), await zr(a, t.glbs[x], i);
|
|
3334
3334
|
} catch (b) {
|
|
3335
3335
|
console.error("[loadLightModel] failed to load glb", {
|
|
3336
3336
|
modelUrl: e.url,
|
|
3337
3337
|
lodPath: t.path,
|
|
3338
3338
|
glbKey: `${x}.glb`,
|
|
3339
|
-
dracoDecoderPath:
|
|
3340
|
-
basisTranscoderPath:
|
|
3339
|
+
dracoDecoderPath: us(),
|
|
3340
|
+
basisTranscoderPath: ps(),
|
|
3341
3341
|
error: b
|
|
3342
3342
|
});
|
|
3343
3343
|
} finally {
|
|
@@ -3345,7 +3345,7 @@ async function jr(a, e, t, i) {
|
|
|
3345
3345
|
}
|
|
3346
3346
|
};
|
|
3347
3347
|
let p = 0;
|
|
3348
|
-
const g = a?.deviceModule?.isMobile?.() === !0 ? 1 :
|
|
3348
|
+
const g = a?.deviceModule?.isMobile?.() === !0 ? 1 : wr, y = Math.min(g, h.length);
|
|
3349
3349
|
await Promise.all(Array.from({ length: y }, async () => {
|
|
3350
3350
|
for (; p < h.length; ) {
|
|
3351
3351
|
const x = h[p++];
|
|
@@ -3359,7 +3359,7 @@ async function jr(a, e, t, i) {
|
|
|
3359
3359
|
}), await t.preparePromise;
|
|
3360
3360
|
}
|
|
3361
3361
|
}
|
|
3362
|
-
function
|
|
3362
|
+
function Xr(a, e, t) {
|
|
3363
3363
|
if (t.boundingBox || (t.boundingBox = new R(), t.boundingBox.min = new d(t.octreeBox.min.X, t.octreeBox.min.Z, -t.octreeBox.min.Y), t.boundingBox.max = new d(t.octreeBox.max.X, t.octreeBox.max.Z, -t.octreeBox.max.Y)), !t.maxSize)
|
|
3364
3364
|
return 1e3;
|
|
3365
3365
|
const i = t.boundingBox, n = i.min, s = i.max, o = n.clone().add(s.clone()).multiplyScalar(0.5), r = n.distanceTo(s), l = new d(), c = new d(), h = new d(), u = new d();
|
|
@@ -3375,28 +3375,28 @@ function Yr(a, e, t) {
|
|
|
3375
3375
|
const g = u.clone().add(h.multiplyScalar(Math.max(p, r))), y = g.clone().add(l.setLength(t.maxSize)), M = new fe(e, a.renderer, a.scene).worldToScreen(g), x = new fe(e, a.renderer, a.scene).worldToScreen(y);
|
|
3376
3376
|
return M.distanceTo(x);
|
|
3377
3377
|
}
|
|
3378
|
-
async function
|
|
3379
|
-
ue(a, e.url, e.loadVersion) || t.maxSize < 1e6 && t.path != "/lod0" && (!(
|
|
3378
|
+
async function Qr(a, e, t, i) {
|
|
3379
|
+
ue(a, e.url, e.loadVersion) || t.maxSize < 1e6 && t.path != "/lod0" && (!(Xr(a, a.camera, t) >= br) || t.status === !0) || (await Yr(a, e, t, i), !ue(a, e.url, e.loadVersion) && t.loadSuccess === !0 && await jr(a, e, t, i));
|
|
3380
3380
|
}
|
|
3381
|
-
function
|
|
3382
|
-
if (
|
|
3381
|
+
function $r(a, e, t) {
|
|
3382
|
+
if (vs(e.loadStatus.modelMep))
|
|
3383
3383
|
return;
|
|
3384
3384
|
const i = mt(a, e.url);
|
|
3385
3385
|
if (i == null)
|
|
3386
3386
|
return;
|
|
3387
3387
|
e.loadStatus.modelMep = "loading", i.modelMep == null && (i.modelMep = {}), (async () => {
|
|
3388
|
-
t || await
|
|
3388
|
+
t || await ms(), !ue(a, e.url, e.loadVersion) && (or(a, i.modelMep, e.url), e.loadStatus.modelMep = !0, xt(a));
|
|
3389
3389
|
})().catch((s) => {
|
|
3390
3390
|
e.loadStatus.modelMep = !1, console.error("[loadLightModel] failed to load mep model", s);
|
|
3391
3391
|
});
|
|
3392
3392
|
}
|
|
3393
|
-
function
|
|
3393
|
+
function Zr(a, e, t, i, n) {
|
|
3394
3394
|
const s = ot(a, e);
|
|
3395
3395
|
a.models || (a.models = []);
|
|
3396
3396
|
const o = t?.loadQuotaList ?? !1, r = t?.loadEdge !== !1;
|
|
3397
3397
|
window.startTime = Date.now();
|
|
3398
3398
|
let l = "WDDsBNtzVz6aSh/bCFh3CmjjANEDRryoXF1XCJvJjeE=";
|
|
3399
|
-
|
|
3399
|
+
Tr(e + "/info", l).then((c) => {
|
|
3400
3400
|
if (ue(a, e, n))
|
|
3401
3401
|
return;
|
|
3402
3402
|
const h = ii(c), u = h?.baseInfo ?? {}, p = typeof u?.name == "string" ? u.name : "";
|
|
@@ -3442,52 +3442,58 @@ function $r(a, e, t, i, n) {
|
|
|
3442
3442
|
ue(a, e, n) || (a.filterLoaderModel?.buildContinueIds?.(e), M());
|
|
3443
3443
|
}) : M();
|
|
3444
3444
|
function M() {
|
|
3445
|
-
ue(a, e, n) || (o ?
|
|
3445
|
+
ue(a, e, n) || (o ? Dr(e + "/quota_list", l).then((x) => {
|
|
3446
3446
|
ue(a, e, n) || (x.exists && (y.quotaList = x.value ?? [], a.rxQuotaListMapper.loadNodeMap(y)), g.loadStatus.quotaList = !0, xt(a));
|
|
3447
3447
|
}).catch((x) => {
|
|
3448
3448
|
ue(a, e, n) || (g.loadStatus.quotaList = !0, console.warn("[loadLightModel] unexpected quota_list load failure", { url: e, error: x }), xt(a));
|
|
3449
3449
|
}) : (g.loadStatus.quotaList = !0, xt(a)), a.viewCube.CameraGoHome(1), a.models.length == i && setTimeout(() => {
|
|
3450
|
-
|
|
3450
|
+
ws(a, null, !1);
|
|
3451
3451
|
}, 100));
|
|
3452
3452
|
}
|
|
3453
3453
|
}).catch((c) => {
|
|
3454
3454
|
console.error("[loadLightModel] failed to load model info", { url: e, error: c });
|
|
3455
3455
|
});
|
|
3456
3456
|
}
|
|
3457
|
-
async function
|
|
3457
|
+
async function ws(a, e, t = !1) {
|
|
3458
3458
|
const i = a.engineStatus.models.filter((n) => e == null || n.url == e);
|
|
3459
3459
|
for (const n of i)
|
|
3460
|
-
if (!ue(a, n.url, n.loadVersion) && (
|
|
3460
|
+
if (!ue(a, n.url, n.loadVersion) && (Ms(n), !(n.status !== "loading" || n.type !== "light") && ($r(a, n, t), !vs(n.loadStatus.normal)))) {
|
|
3461
3461
|
n.loadStatus.normal = "loading";
|
|
3462
3462
|
try {
|
|
3463
|
-
await
|
|
3463
|
+
await Jr(a, n, t);
|
|
3464
3464
|
} finally {
|
|
3465
|
-
const s =
|
|
3465
|
+
const s = ys(a, n.url), o = s.length > 0 && s.every((r) => r.status === !0);
|
|
3466
3466
|
n.loadStatus.normal = o, o && (n.status = "loaded"), xt(a);
|
|
3467
3467
|
}
|
|
3468
3468
|
}
|
|
3469
3469
|
}
|
|
3470
|
-
async function
|
|
3470
|
+
async function Jr(a, e, t = !1) {
|
|
3471
3471
|
console.log(`[loadLightModel] start loadNode ${Date.now() - window.startTime}ms`);
|
|
3472
|
-
const i =
|
|
3472
|
+
const i = ys(a, e.url);
|
|
3473
3473
|
if (i.length !== 0)
|
|
3474
3474
|
for (const n of i)
|
|
3475
|
-
await
|
|
3475
|
+
await Qr(a, e, n, t);
|
|
3476
3476
|
}
|
|
3477
|
-
function
|
|
3478
|
-
|
|
3477
|
+
function ea(a, e) {
|
|
3478
|
+
Nr(a), bs(a, e);
|
|
3479
3479
|
const t = a.map;
|
|
3480
3480
|
return t != null && t.colorSpace !== We && (t.colorSpace = We, t.needsUpdate = !0), a.side = re, a.shadowSide = re, a.clipShadows = !0, e?.sectionPlane && (a.clippingPlanes = e.sectionPlane), a;
|
|
3481
3481
|
}
|
|
3482
|
-
function
|
|
3482
|
+
function ta(a) {
|
|
3483
3483
|
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);
|
|
3484
3484
|
return Number.isFinite(i) && i > 0 && Number.isFinite(n) && n > 0 ? { width: i, height: n } : null;
|
|
3485
3485
|
}
|
|
3486
|
-
function
|
|
3486
|
+
function ia(a) {
|
|
3487
3487
|
const e = a.source?.data ?? a.image;
|
|
3488
3488
|
typeof e?.close == "function" && e.close(), Array.isArray(a.mipmaps) && (a.mipmaps.length = 0), a.dispose(), a.source != null && (a.source.data = null);
|
|
3489
3489
|
}
|
|
3490
|
-
function
|
|
3490
|
+
function fn(a, e) {
|
|
3491
|
+
if (e !== "map" || a == null)
|
|
3492
|
+
return;
|
|
3493
|
+
const t = a.color;
|
|
3494
|
+
t != null && (t.getHex() === 0 && t.set(16777215), a.needsUpdate = !0);
|
|
3495
|
+
}
|
|
3496
|
+
function bs(a, e) {
|
|
3491
3497
|
if (e?.deviceModule?.isMobile?.() !== !0 || e?.mobileMemoryProfile?.restrictTextureSize === !1 || a == null)
|
|
3492
3498
|
return;
|
|
3493
3499
|
const t = Array.isArray(a) ? a : [a], i = Number(e?.renderer?.capabilities?.maxTextureSize), n = Number(e?.mobileMemoryProfile?.maxTextureSize ?? 2048), s = Number.isFinite(i) ? Math.min(n, i) : n;
|
|
@@ -3497,11 +3503,11 @@ function ws(a, e) {
|
|
|
3497
3503
|
if (l?.isTexture !== !0)
|
|
3498
3504
|
return;
|
|
3499
3505
|
if (un.has(l)) {
|
|
3500
|
-
o[r] = null;
|
|
3506
|
+
o[r] = null, fn(o, r);
|
|
3501
3507
|
return;
|
|
3502
3508
|
}
|
|
3503
|
-
const c =
|
|
3504
|
-
c == null || Math.max(c.width, c.height) <= s || (un.add(l), o[r] = null,
|
|
3509
|
+
const c = ta(l);
|
|
3510
|
+
c == null || Math.max(c.width, c.height) <= s || (un.add(l), o[r] = null, fn(o, r), ia(l), console.warn("[loadLightModel] discarded oversized mobile texture", {
|
|
3505
3511
|
slot: r,
|
|
3506
3512
|
width: c.width,
|
|
3507
3513
|
height: c.height,
|
|
@@ -3510,7 +3516,7 @@ function ws(a, e) {
|
|
|
3510
3516
|
});
|
|
3511
3517
|
});
|
|
3512
3518
|
}
|
|
3513
|
-
const
|
|
3519
|
+
const na = "/__local_model__", sa = /^(info|property|edge|quota_list|lod\d+)(?:\.zip)?$/i, oa = /^(info|property|edge|quota_list|lod\d+)(?:~)?$/i;
|
|
3514
3520
|
class ve {
|
|
3515
3521
|
static localRequestMap = /* @__PURE__ */ new Map();
|
|
3516
3522
|
static localObjectUrls = /* @__PURE__ */ new Set();
|
|
@@ -3533,7 +3539,7 @@ class ve {
|
|
|
3533
3539
|
for (const n of e) {
|
|
3534
3540
|
this.unloadedModelUrls.delete(n);
|
|
3535
3541
|
const s = (this.modelLoadVersions.get(n) ?? 0) + 1;
|
|
3536
|
-
this.modelLoadVersions.set(n, s), i(n) === "light" &&
|
|
3542
|
+
this.modelLoadVersions.set(n, s), i(n) === "light" && Zr(this.engine, n, t, e.length, s);
|
|
3537
3543
|
}
|
|
3538
3544
|
function i(n) {
|
|
3539
3545
|
const s = n.split(".").pop();
|
|
@@ -3551,11 +3557,11 @@ class ve {
|
|
|
3551
3557
|
const s = e[n];
|
|
3552
3558
|
try {
|
|
3553
3559
|
const o = await ei.get(s, { responseType: "blob" });
|
|
3554
|
-
if (!await
|
|
3560
|
+
if (!await Mn(o.data))
|
|
3555
3561
|
throw new Error("响应内容不是有效的 ZIP 文件");
|
|
3556
3562
|
i.push(new File(
|
|
3557
3563
|
[o.data],
|
|
3558
|
-
|
|
3564
|
+
ua(s, n),
|
|
3559
3565
|
{ type: o.data.type || "application/zip" }
|
|
3560
3566
|
));
|
|
3561
3567
|
} catch (o) {
|
|
@@ -3596,8 +3602,8 @@ class ve {
|
|
|
3596
3602
|
if (typeof e != "string" || e.length === 0)
|
|
3597
3603
|
return;
|
|
3598
3604
|
this.unloadedModelUrls.add(e), this.modelLoadVersions.set(e, (this.modelLoadVersions.get(e) ?? 0) + 1);
|
|
3599
|
-
const t = Array.isArray(this.engine?.models) ? this.engine.models.filter((s) => s?.url === e) : [], i =
|
|
3600
|
-
this.engine?.modelExplode?.releaseModel?.(e), this.engine?.modelToolModule?.releaseModelRuntimeState?.(e), this.engine?.modelEdge?.releaseModel?.(e),
|
|
3605
|
+
const t = Array.isArray(this.engine?.models) ? this.engine.models.filter((s) => s?.url === e) : [], i = ra(this.engine, e, t), n = aa(this.engine, e, i);
|
|
3606
|
+
this.engine?.modelExplode?.releaseModel?.(e), this.engine?.modelToolModule?.releaseModelRuntimeState?.(e), this.engine?.modelEdge?.releaseModel?.(e), la(i), ca(i, n), ha(this.engine, e, i, t), t.forEach(da), Array.isArray(this.engine?.models) && (this.engine.models = this.engine.models.filter((s) => s?.url !== e)), this.clearEngineStatus(e), this.engine?.filterLoaderModel?.clear?.(e), this.removeModelGroupReference(e), ve.releaseLocalRequests(e), this.engine.requestComposerRender?.();
|
|
3601
3607
|
}
|
|
3602
3608
|
/** 返回指定 URL 是否已收到卸载请求,供异步加载链路避免卸载后回写。 */
|
|
3603
3609
|
isModelUnloadRequested(e) {
|
|
@@ -3627,13 +3633,13 @@ class ve {
|
|
|
3627
3633
|
for (const l of t) {
|
|
3628
3634
|
const c = this.parseDirectPackageEntry(l.path);
|
|
3629
3635
|
if (c != null) {
|
|
3630
|
-
|
|
3636
|
+
vn(i, c.modelKey).set(c.packageName, l.blob);
|
|
3631
3637
|
continue;
|
|
3632
3638
|
}
|
|
3633
3639
|
const h = this.parseExtractedPackageEntry(l.path);
|
|
3634
3640
|
if (h == null)
|
|
3635
3641
|
continue;
|
|
3636
|
-
const u =
|
|
3642
|
+
const u = vn(n, h.modelKey), p = u.get(h.packageName) ?? [];
|
|
3637
3643
|
p.push({
|
|
3638
3644
|
path: h.innerPath,
|
|
3639
3645
|
blob: l.blob
|
|
@@ -3657,7 +3663,7 @@ class ve {
|
|
|
3657
3663
|
blob: await this.packEntriesAsZip(g)
|
|
3658
3664
|
});
|
|
3659
3665
|
c.some((p) => p.packageName === "info") && (r += 1, o.push({
|
|
3660
|
-
rootUrl: `${
|
|
3666
|
+
rootUrl: `${na}/${ve.createLocalModelId(l, r)}`,
|
|
3661
3667
|
packages: c
|
|
3662
3668
|
}));
|
|
3663
3669
|
}
|
|
@@ -3671,15 +3677,15 @@ class ve {
|
|
|
3671
3677
|
const t = [];
|
|
3672
3678
|
for (const i of e) {
|
|
3673
3679
|
const n = Re(i.webkitRelativePath || i.name), s = wt(n);
|
|
3674
|
-
if (
|
|
3680
|
+
if (yn(s)) {
|
|
3675
3681
|
t.push({ path: n, blob: i });
|
|
3676
3682
|
continue;
|
|
3677
3683
|
}
|
|
3678
|
-
if (await
|
|
3684
|
+
if (await Mn(i)) {
|
|
3679
3685
|
const o = await Ci.loadAsync(i), r = ui(n), l = Object.values(o.files);
|
|
3680
3686
|
for (const c of l)
|
|
3681
3687
|
c.dir || t.push({
|
|
3682
|
-
path:
|
|
3688
|
+
path: pa(r, Re(c.name)),
|
|
3683
3689
|
blob: await c.async("blob")
|
|
3684
3690
|
});
|
|
3685
3691
|
continue;
|
|
@@ -3693,9 +3699,9 @@ class ve {
|
|
|
3693
3699
|
*/
|
|
3694
3700
|
parseDirectPackageEntry(e) {
|
|
3695
3701
|
const t = ui(e), i = wt(e);
|
|
3696
|
-
return
|
|
3702
|
+
return yn(i) ? {
|
|
3697
3703
|
modelKey: t,
|
|
3698
|
-
packageName:
|
|
3704
|
+
packageName: ma(i)
|
|
3699
3705
|
} : null;
|
|
3700
3706
|
}
|
|
3701
3707
|
/**
|
|
@@ -3704,7 +3710,7 @@ class ve {
|
|
|
3704
3710
|
parseExtractedPackageEntry(e) {
|
|
3705
3711
|
const t = Re(e).split("/").filter(Boolean);
|
|
3706
3712
|
for (let n = 0; n < t.length; n++) {
|
|
3707
|
-
const s =
|
|
3713
|
+
const s = ga(t[n]);
|
|
3708
3714
|
if (s == null)
|
|
3709
3715
|
continue;
|
|
3710
3716
|
const o = t.slice(n + 1);
|
|
@@ -3775,14 +3781,14 @@ class ve {
|
|
|
3775
3781
|
return `${e.replace(/[^a-zA-Z0-9/_-]/g, "_").replace(/\//g, "__") || "model"}_${Date.now()}_${t}_${Math.random().toString(36).slice(2, 8)}`;
|
|
3776
3782
|
}
|
|
3777
3783
|
}
|
|
3778
|
-
function
|
|
3784
|
+
function Cs() {
|
|
3779
3785
|
return {
|
|
3780
3786
|
geometries: /* @__PURE__ */ new Set(),
|
|
3781
3787
|
materials: /* @__PURE__ */ new Set(),
|
|
3782
3788
|
textures: /* @__PURE__ */ new Set()
|
|
3783
3789
|
};
|
|
3784
3790
|
}
|
|
3785
|
-
function
|
|
3791
|
+
function Es(a, e) {
|
|
3786
3792
|
Object.values(a).forEach((i) => {
|
|
3787
3793
|
i instanceof Ie && e.add(i);
|
|
3788
3794
|
});
|
|
@@ -3798,13 +3804,13 @@ function Si(a, e) {
|
|
|
3798
3804
|
[a?.geometry, ...Array.isArray(a?.geometrys) ? a.geometrys : []].forEach((n) => {
|
|
3799
3805
|
n instanceof ae && e.geometries.add(n);
|
|
3800
3806
|
}), (Array.isArray(a?.material) ? a.material : [a?.material]).forEach((n) => {
|
|
3801
|
-
n instanceof At && (e.materials.add(n),
|
|
3807
|
+
n instanceof At && (e.materials.add(n), Es(n, e.textures));
|
|
3802
3808
|
});
|
|
3803
3809
|
}
|
|
3804
3810
|
function Ve(a, e) {
|
|
3805
3811
|
a instanceof it && a.traverse((t) => e.add(t));
|
|
3806
3812
|
}
|
|
3807
|
-
function
|
|
3813
|
+
function As(a, e) {
|
|
3808
3814
|
Ve(a?.group, e), a?.nodesMap?.forEach?.((t) => {
|
|
3809
3815
|
Ve(t?.mesh, e), Ve(t?.pickBoxMesh, e), Ve(t?.info?.mesh, e), t?.infos?.forEach?.((i) => Ve(i?.mesh, e));
|
|
3810
3816
|
}), a?.lods?.forEach?.((t) => {
|
|
@@ -3813,23 +3819,23 @@ function Es(a, e) {
|
|
|
3813
3819
|
});
|
|
3814
3820
|
});
|
|
3815
3821
|
}
|
|
3816
|
-
function
|
|
3822
|
+
function ra(a, e, t) {
|
|
3817
3823
|
const i = /* @__PURE__ */ new Set();
|
|
3818
|
-
return Ve(a?.__modelGroupMap instanceof Map ? a.__modelGroupMap.get(e) : null, i), Ve($e(a, e), i), t.forEach((n) =>
|
|
3824
|
+
return Ve(a?.__modelGroupMap instanceof Map ? a.__modelGroupMap.get(e) : null, i), Ve($e(a, e), i), t.forEach((n) => As(n, i)), a?.__modelObjectIndexMap instanceof Map && a.__modelObjectIndexMap.forEach((n) => {
|
|
3819
3825
|
(n?.url === e || n?.userData?.url === e) && Ve(n, i);
|
|
3820
3826
|
}), a?.scene?.traverse?.((n) => {
|
|
3821
3827
|
(n?.url === e || n?.userData?.url === e) && Ve(n, i);
|
|
3822
3828
|
}), i;
|
|
3823
3829
|
}
|
|
3824
|
-
function
|
|
3825
|
-
const i =
|
|
3830
|
+
function aa(a, e, t) {
|
|
3831
|
+
const i = Cs();
|
|
3826
3832
|
a?.scene?.traverse?.((s) => {
|
|
3827
3833
|
t.has(s) || Si(s, i);
|
|
3828
3834
|
}), a?.models?.forEach?.((s) => {
|
|
3829
3835
|
if (s?.url === e)
|
|
3830
3836
|
return;
|
|
3831
3837
|
const o = /* @__PURE__ */ new Set();
|
|
3832
|
-
|
|
3838
|
+
As(s, o), o.forEach((r) => Si(r, i));
|
|
3833
3839
|
});
|
|
3834
3840
|
const n = a?.scene;
|
|
3835
3841
|
return n?.background instanceof Ie && i.textures.add(n.background), n?.environment instanceof Ie && i.textures.add(n.environment), [
|
|
@@ -3843,16 +3849,16 @@ function ra(a, e, t) {
|
|
|
3843
3849
|
a?.modelExplode?.highlightMaterial,
|
|
3844
3850
|
a?.modelExplode?.translucentMaterial
|
|
3845
3851
|
].forEach((s) => {
|
|
3846
|
-
s instanceof At && (i.materials.add(s),
|
|
3852
|
+
s instanceof At && (i.materials.add(s), Es(s, i.textures));
|
|
3847
3853
|
}), i;
|
|
3848
3854
|
}
|
|
3849
|
-
function
|
|
3855
|
+
function la(a) {
|
|
3850
3856
|
a.forEach((e) => {
|
|
3851
3857
|
e.parent != null && !a.has(e.parent) && e.parent.remove(e);
|
|
3852
3858
|
});
|
|
3853
3859
|
}
|
|
3854
|
-
function
|
|
3855
|
-
const t =
|
|
3860
|
+
function ca(a, e) {
|
|
3861
|
+
const t = Cs();
|
|
3856
3862
|
a.forEach((i) => Si(i, t)), t.geometries.forEach((i) => {
|
|
3857
3863
|
e.geometries.has(i) || (i.disposeBoundsTree?.(), i.dispose());
|
|
3858
3864
|
}), t.materials.forEach((i) => {
|
|
@@ -3861,7 +3867,7 @@ function la(a, e) {
|
|
|
3861
3867
|
e.textures.has(i) || i.dispose();
|
|
3862
3868
|
});
|
|
3863
3869
|
}
|
|
3864
|
-
function
|
|
3870
|
+
function ha(a, e, t, i) {
|
|
3865
3871
|
const n = /* @__PURE__ */ new Set();
|
|
3866
3872
|
t.forEach((o) => {
|
|
3867
3873
|
Number.isFinite(o?.index) && n.add(o.index);
|
|
@@ -3877,7 +3883,7 @@ function ca(a, e, t, i) {
|
|
|
3877
3883
|
(n.has(r) || t.has(o) || o?.url === e) && s.delete(r);
|
|
3878
3884
|
});
|
|
3879
3885
|
}
|
|
3880
|
-
function
|
|
3886
|
+
function da(a) {
|
|
3881
3887
|
a?.nodesMap?.clear?.(), a?.lods?.forEach?.((e) => {
|
|
3882
3888
|
e.glbs = [], e.instanceNodes = null, e.preparePromise = null, e.meshPromise = null, e.octreeBox = null;
|
|
3883
3889
|
}), a.group = null, a.modelEdge = null, a.modelMep = null, a.modelMapper = null, a.modelTree = null, a.quotaList = null, a.urls = [];
|
|
@@ -3893,7 +3899,7 @@ function ui(a) {
|
|
|
3893
3899
|
const e = Re(a), t = e.lastIndexOf("/");
|
|
3894
3900
|
return t >= 0 ? e.slice(0, t) : "";
|
|
3895
3901
|
}
|
|
3896
|
-
function
|
|
3902
|
+
function ua(a, e) {
|
|
3897
3903
|
try {
|
|
3898
3904
|
const t = new URL(a, window.location.origin);
|
|
3899
3905
|
return decodeURIComponent(wt(t.pathname)) || `model-package-${e + 1}.zip`;
|
|
@@ -3901,29 +3907,29 @@ function da(a, e) {
|
|
|
3901
3907
|
return wt(a.split("?")[0].split("#")[0]) || `model-package-${e + 1}.zip`;
|
|
3902
3908
|
}
|
|
3903
3909
|
}
|
|
3904
|
-
function
|
|
3910
|
+
function pa(a, e) {
|
|
3905
3911
|
return Re(a ? e ? `${a}/${e}` : a : e);
|
|
3906
3912
|
}
|
|
3907
|
-
function
|
|
3908
|
-
return
|
|
3913
|
+
function yn(a) {
|
|
3914
|
+
return sa.test(a);
|
|
3909
3915
|
}
|
|
3910
|
-
function
|
|
3916
|
+
function ma(a) {
|
|
3911
3917
|
return a.replace(/\.zip$/i, "").toLowerCase();
|
|
3912
3918
|
}
|
|
3913
|
-
function
|
|
3914
|
-
const e =
|
|
3919
|
+
function ga(a) {
|
|
3920
|
+
const e = oa.exec(a);
|
|
3915
3921
|
return e == null ? null : e[1].toLowerCase();
|
|
3916
3922
|
}
|
|
3917
|
-
async function
|
|
3923
|
+
async function Mn(a) {
|
|
3918
3924
|
const e = await a.slice(0, 4).arrayBuffer(), t = new Uint8Array(e);
|
|
3919
3925
|
return t.length >= 4 && t[0] === 80 && t[1] === 75 && t[2] === 3 && t[3] === 4;
|
|
3920
3926
|
}
|
|
3921
|
-
function
|
|
3927
|
+
function vn(a, e) {
|
|
3922
3928
|
let t = a.get(e);
|
|
3923
3929
|
return t == null && (t = /* @__PURE__ */ new Map(), a.set(e, t)), t;
|
|
3924
3930
|
}
|
|
3925
3931
|
var ne = /* @__PURE__ */ ((a) => (a.ModelLoadStart = "model-load-start", a.ModelLoadProgress = "model-load-progress", a.ModelLoaded = "model-loaded", a.ModelError = "model-error", a.SelectionChanged = "selection-changed", a.HoverChanged = "hover-changed", a.Click = "click", a.MouseMove = "mouse-move", a.ModelPlaceSelected = "model-place-selected", a.ModelCalibrationChanged = "model-calibration-changed", a.CameraChanged = "camera-changed", a.CameraIdle = "camera-idle", a.ViewportResize = "viewport-resize", a.EngineFree = "engine-free", a.EngineBusy = "engine-busy", a.MeasureChanged = "measure-changed", a.SectionMove = "section-move", a.LoadingCompleted = "loading_completed", a))(ne || {});
|
|
3926
|
-
class
|
|
3932
|
+
class fa {
|
|
3927
3933
|
engine;
|
|
3928
3934
|
isFree;
|
|
3929
3935
|
// 是否是编辑模式
|
|
@@ -3946,7 +3952,7 @@ class ga {
|
|
|
3946
3952
|
}
|
|
3947
3953
|
init() {
|
|
3948
3954
|
this.engine.renderer?.domElement?.addEventListener("contextmenu", this.handleContextMenu, !0), this.engine.events.on(ne.EngineFree, (e) => {
|
|
3949
|
-
this.updateFree(!0),
|
|
3955
|
+
this.updateFree(!0), ws(this.engine, e, !1), this.engine?.octreeBox?.requestBvhBuild?.();
|
|
3950
3956
|
}), this.engine.events.on(ne.EngineBusy, () => {
|
|
3951
3957
|
this.updateFree(!1);
|
|
3952
3958
|
});
|
|
@@ -3965,7 +3971,7 @@ class ga {
|
|
|
3965
3971
|
closeAllFunction = () => {
|
|
3966
3972
|
};
|
|
3967
3973
|
}
|
|
3968
|
-
class
|
|
3974
|
+
class ya {
|
|
3969
3975
|
// 使用字符串作为键,以确保不同来源的 EventType 枚举值能够正确匹配
|
|
3970
3976
|
listeners = /* @__PURE__ */ new Map();
|
|
3971
3977
|
// 是否启用调试模式(可以通过外部设置)
|
|
@@ -4021,8 +4027,8 @@ class fa {
|
|
|
4021
4027
|
});
|
|
4022
4028
|
}
|
|
4023
4029
|
}
|
|
4024
|
-
const bt = 1, pi = 1,
|
|
4025
|
-
class
|
|
4030
|
+
const bt = 1, pi = 1, Ma = 1800, xn = 1024, va = 1.35, xa = 20, wa = 1200, mi = 0.5, ba = 10, Ca = 0.08, gi = 500, wn = 5e4, bn = 120, Ea = 5e4, Cn = 0.12, Aa = 8, Sa = 0.75, En = 5e-5, Pa = 15e-4, Ta = 2.5, Ia = 2.4, _a = 4.5, Da = 0.94, ka = 0.995, La = 80, Ba = 0.06, za = 8, Ra = new d(-1, 4, 2).normalize();
|
|
4031
|
+
class Oa {
|
|
4026
4032
|
// 引擎实例,要求至少提供 scene、controls、octreeBox 等运行时对象。
|
|
4027
4033
|
engine;
|
|
4028
4034
|
// 上一次应用到阴影相机的半边长,用于跳过无意义的小幅更新。
|
|
@@ -4053,7 +4059,7 @@ class Ra {
|
|
|
4053
4059
|
*/
|
|
4054
4060
|
init() {
|
|
4055
4061
|
const e = new Xe(16774630, 2);
|
|
4056
|
-
e.name = "directionalShadowLight", e.castShadow = !0, e.shadow.mapSize.width =
|
|
4062
|
+
e.name = "directionalShadowLight", e.castShadow = !0, e.shadow.mapSize.width = xn, e.shadow.mapSize.height = xn, e.shadow.camera.near = mi, e.shadow.camera.far = gi, e.shadow.bias = -En, e.shadow.normalBias = Cn;
|
|
4057
4063
|
const t = pi;
|
|
4058
4064
|
e.shadow.camera.left = -t, e.shadow.camera.right = t, e.shadow.camera.top = t, e.shadow.camera.bottom = -t, e.shadow.radius = 2, e.shadow.intensity = bt, e.target.name = "directionalShadowLightTarget";
|
|
4059
4065
|
const i = new Xe(16777215, 2);
|
|
@@ -4085,16 +4091,16 @@ class Ra {
|
|
|
4085
4091
|
}
|
|
4086
4092
|
const l = this.resolveShadowTarget(e, r), c = this.getCameraHalfExtent(e, l), h = this.getSceneShadowHalfSize(s, c), u = F.clamp(
|
|
4087
4093
|
Math.max(
|
|
4088
|
-
c *
|
|
4094
|
+
c * va,
|
|
4089
4095
|
h,
|
|
4090
4096
|
pi
|
|
4091
4097
|
),
|
|
4092
4098
|
pi,
|
|
4093
|
-
|
|
4099
|
+
Ma
|
|
4094
4100
|
), p = F.clamp(
|
|
4095
|
-
Math.max(u * 2.5, o * 0.75,
|
|
4096
|
-
|
|
4097
|
-
|
|
4101
|
+
Math.max(u * 2.5, o * 0.75, bn),
|
|
4102
|
+
bn,
|
|
4103
|
+
Ea
|
|
4098
4104
|
), g = this.getLightOffsetDirection(), y = this.snapShadowTargetToTexel(
|
|
4099
4105
|
l,
|
|
4100
4106
|
g,
|
|
@@ -4127,7 +4133,7 @@ class Ra {
|
|
|
4127
4133
|
return 0;
|
|
4128
4134
|
if (t <= 0)
|
|
4129
4135
|
return e * 0.75;
|
|
4130
|
-
const i = t *
|
|
4136
|
+
const i = t * xa;
|
|
4131
4137
|
return Math.min(e * 0.75, i);
|
|
4132
4138
|
}
|
|
4133
4139
|
/**
|
|
@@ -4139,15 +4145,15 @@ class Ra {
|
|
|
4139
4145
|
updateShadowBias(e, t, i) {
|
|
4140
4146
|
const n = Math.max(e.shadow.mapSize.width, 1), s = t * 2 / n, o = Math.max(i.far - i.near, 1);
|
|
4141
4147
|
e.shadow.normalBias = F.clamp(
|
|
4142
|
-
s *
|
|
4143
|
-
|
|
4144
|
-
|
|
4148
|
+
s * Sa,
|
|
4149
|
+
Cn,
|
|
4150
|
+
Aa
|
|
4145
4151
|
);
|
|
4146
|
-
const r = s / o *
|
|
4152
|
+
const r = s / o * Ta;
|
|
4147
4153
|
e.shadow.bias = -F.clamp(
|
|
4148
4154
|
r,
|
|
4149
|
-
|
|
4150
|
-
|
|
4155
|
+
En,
|
|
4156
|
+
Pa
|
|
4151
4157
|
);
|
|
4152
4158
|
}
|
|
4153
4159
|
/**
|
|
@@ -4170,12 +4176,12 @@ class Ra {
|
|
|
4170
4176
|
}
|
|
4171
4177
|
if (Number.isFinite(c) && Number.isFinite(h)) {
|
|
4172
4178
|
const u = Math.max(
|
|
4173
|
-
(h - c) *
|
|
4174
|
-
|
|
4179
|
+
(h - c) * Ca,
|
|
4180
|
+
ba
|
|
4175
4181
|
), p = Math.max(mi, c - u), g = F.clamp(
|
|
4176
4182
|
Math.max(p + 1, h + u),
|
|
4177
4183
|
p + 1,
|
|
4178
|
-
|
|
4184
|
+
wn
|
|
4179
4185
|
);
|
|
4180
4186
|
return { near: p, far: g };
|
|
4181
4187
|
}
|
|
@@ -4183,7 +4189,7 @@ class Ra {
|
|
|
4183
4189
|
const r = F.clamp(
|
|
4184
4190
|
Math.max(n * 1.5, s * 4, gi),
|
|
4185
4191
|
gi,
|
|
4186
|
-
|
|
4192
|
+
wn
|
|
4187
4193
|
);
|
|
4188
4194
|
return { near: mi, far: r };
|
|
4189
4195
|
}
|
|
@@ -4287,7 +4293,7 @@ class Ra {
|
|
|
4287
4293
|
}
|
|
4288
4294
|
if (e instanceof Xt) {
|
|
4289
4295
|
const i = this.resolveShadowTarget(e, t), n = Math.max(e.position.distanceTo(i), 1), s = F.degToRad(e.getEffectiveFOV() * 0.5), o = Math.max(Math.tan(s) * n, 1), r = o * Math.max(e.aspect, 1e-6);
|
|
4290
|
-
return Math.min(Math.max(r, o),
|
|
4296
|
+
return Math.min(Math.max(r, o), wa);
|
|
4291
4297
|
}
|
|
4292
4298
|
return 0;
|
|
4293
4299
|
}
|
|
@@ -4314,7 +4320,7 @@ class Ra {
|
|
|
4314
4320
|
* @returns 标准化后的世界空间光源偏移方向。
|
|
4315
4321
|
*/
|
|
4316
4322
|
getLightOffsetDirection() {
|
|
4317
|
-
return
|
|
4323
|
+
return Ra.clone();
|
|
4318
4324
|
}
|
|
4319
4325
|
/**
|
|
4320
4326
|
* 根据当前视角和阴影贴图密度计算最终显示强度。
|
|
@@ -4327,8 +4333,8 @@ class Ra {
|
|
|
4327
4333
|
getShadowDisplayIntensity(e, t, i, n) {
|
|
4328
4334
|
const s = i * 2 / Math.max(n, 1), o = 1 - F.smoothstep(
|
|
4329
4335
|
s,
|
|
4330
|
-
|
|
4331
|
-
|
|
4336
|
+
Ia,
|
|
4337
|
+
_a
|
|
4332
4338
|
);
|
|
4333
4339
|
let r = 1;
|
|
4334
4340
|
if (e) {
|
|
@@ -4337,8 +4343,8 @@ class Ra {
|
|
|
4337
4343
|
const c = Math.abs(l.dot(t.clone().normalize()));
|
|
4338
4344
|
r = 1 - F.smoothstep(
|
|
4339
4345
|
c,
|
|
4340
|
-
|
|
4341
|
-
|
|
4346
|
+
Da,
|
|
4347
|
+
ka
|
|
4342
4348
|
);
|
|
4343
4349
|
}
|
|
4344
4350
|
return bt * Math.min(o, r);
|
|
@@ -4383,10 +4389,10 @@ class Ra {
|
|
|
4383
4389
|
if (i.isEmpty())
|
|
4384
4390
|
return;
|
|
4385
4391
|
const n = i.getSize(new d()), s = Math.max(n.x, n.z), o = Math.max(
|
|
4386
|
-
|
|
4387
|
-
s *
|
|
4392
|
+
za,
|
|
4393
|
+
s * Ba
|
|
4388
4394
|
);
|
|
4389
|
-
if (s >=
|
|
4395
|
+
if (s >= La && n.y <= o) {
|
|
4390
4396
|
e.castShadow = !1, t.__lightModuleReceiverOnlyShadow = !0;
|
|
4391
4397
|
return;
|
|
4392
4398
|
}
|
|
@@ -4402,7 +4408,7 @@ class Ra {
|
|
|
4402
4408
|
i && (i.shadowSide = Oi);
|
|
4403
4409
|
}
|
|
4404
4410
|
}
|
|
4405
|
-
class
|
|
4411
|
+
class Fa {
|
|
4406
4412
|
engine;
|
|
4407
4413
|
behavior;
|
|
4408
4414
|
isCtrlDown = !1;
|
|
@@ -4837,7 +4843,7 @@ class Oa {
|
|
|
4837
4843
|
return e?.nodesMap?.get(t) ?? e?.nodesMap?.get(Number(t)) ?? e?.nodesMap?.get(String(t));
|
|
4838
4844
|
}
|
|
4839
4845
|
}
|
|
4840
|
-
class
|
|
4846
|
+
class Na {
|
|
4841
4847
|
engine;
|
|
4842
4848
|
highlightMaterial;
|
|
4843
4849
|
translucentMaterial;
|
|
@@ -5109,7 +5115,7 @@ class Fa {
|
|
|
5109
5115
|
const u = this.getSceneModel(h[0]);
|
|
5110
5116
|
u instanceof V ? o.has(h[0]) ? o.get(h[0])?.push(h[1]) : o.set(h[0], [h[1]]) : this.setSplitComponentState(u, h[1], 1, !0);
|
|
5111
5117
|
});
|
|
5112
|
-
}),
|
|
5118
|
+
}), Ha(o, this.engine);
|
|
5113
5119
|
let r = this.engine.engineStatus.highlightModels.find((l) => l.url == t.url);
|
|
5114
5120
|
r != null ? (Array.isArray(r.guids) || (r.guids = this.getModelGuids(i, r.ids)), n.forEach((l, c) => {
|
|
5115
5121
|
const h = r.ids.indexOf(l);
|
|
@@ -5139,7 +5145,7 @@ class Fa {
|
|
|
5139
5145
|
!0
|
|
5140
5146
|
);
|
|
5141
5147
|
});
|
|
5142
|
-
}),
|
|
5148
|
+
}), An(n, this.engine, "highlightModel");
|
|
5143
5149
|
}), this.rebatchSplitModels(), this.updateMaterial(), this.syncHighlightModelEdges(this.getHighlightModelsAfterRemove(e)), this.syncExplodeVisualState();
|
|
5144
5150
|
}
|
|
5145
5151
|
// 取消所有模型高亮
|
|
@@ -5163,7 +5169,7 @@ class Fa {
|
|
|
5163
5169
|
const c = this.getSceneModel(l[0]);
|
|
5164
5170
|
c instanceof V ? n.has(l[0]) ? n.get(l[0])?.push(l[1]) : n.set(l[0], [l[1]]) : this.setSplitComponentState(c, l[1], -1, !1);
|
|
5165
5171
|
});
|
|
5166
|
-
}), n.size > 0 &&
|
|
5172
|
+
}), n.size > 0 && Ua(n, this.engine);
|
|
5167
5173
|
let s = this.engine.engineStatus.hideModels.find((o) => o.url == t.url);
|
|
5168
5174
|
s != null ? this.appendUniqueIds(s.ids, t.ids) : this.engine.engineStatus.hideModels.push({
|
|
5169
5175
|
url: t.url,
|
|
@@ -5189,7 +5195,7 @@ class Fa {
|
|
|
5189
5195
|
!0
|
|
5190
5196
|
);
|
|
5191
5197
|
});
|
|
5192
|
-
}), s.size > 0 &&
|
|
5198
|
+
}), s.size > 0 && Sn(s, this.engine), t)
|
|
5193
5199
|
return;
|
|
5194
5200
|
let o = this.engine.engineStatus.hideModels.find((r) => r.url == i.url);
|
|
5195
5201
|
o && (i.ids.forEach((r) => {
|
|
@@ -5515,7 +5521,7 @@ class Fa {
|
|
|
5515
5521
|
const u = this.getSceneModel(h[0]);
|
|
5516
5522
|
u instanceof V ? o.has(h[0]) ? o.get(h[0])?.push(h[1]) : o.set(h[0], [h[1]]) : this.setSplitComponentState(u, h[1], 2, !0);
|
|
5517
5523
|
});
|
|
5518
|
-
}),
|
|
5524
|
+
}), Va(o, this.engine, i);
|
|
5519
5525
|
let r = this.engine.engineStatus.translucentModels.find((l) => l.url == n.url);
|
|
5520
5526
|
r != null ? r.ids.push(...n.ids) : this.engine.engineStatus.translucentModels.push({
|
|
5521
5527
|
url: n.url,
|
|
@@ -5541,7 +5547,7 @@ class Fa {
|
|
|
5541
5547
|
!0
|
|
5542
5548
|
);
|
|
5543
5549
|
});
|
|
5544
|
-
}), n.size > 0 &&
|
|
5550
|
+
}), n.size > 0 && Sn(n, this.engine), An(n, this.engine, "translucentModel");
|
|
5545
5551
|
}), this.engine.engineStatus.translucentModels = [], this.rebatchSplitModels(), this.syncExplodeVisualState();
|
|
5546
5552
|
}
|
|
5547
5553
|
// ***************************************************** 设置模型半透明 ***************************************************** //
|
|
@@ -5589,7 +5595,7 @@ class Fa {
|
|
|
5589
5595
|
}
|
|
5590
5596
|
// ***************************************************** 设置模型颜色 ***************************************************** //
|
|
5591
5597
|
}
|
|
5592
|
-
function
|
|
5598
|
+
function Ha(a, e) {
|
|
5593
5599
|
a.forEach((t, i) => {
|
|
5594
5600
|
const n = Rt(e, i);
|
|
5595
5601
|
if (!(n instanceof V))
|
|
@@ -5622,7 +5628,7 @@ function Na(a, e) {
|
|
|
5622
5628
|
}), n.instanceMatrix.needsUpdate = !0, r.instanceMatrix.needsUpdate = !0, (n.parent ?? e.scene).add(r);
|
|
5623
5629
|
});
|
|
5624
5630
|
}
|
|
5625
|
-
function
|
|
5631
|
+
function An(a, e, t) {
|
|
5626
5632
|
a.forEach((i, n) => {
|
|
5627
5633
|
const s = Rt(e, n);
|
|
5628
5634
|
if (!(s instanceof V))
|
|
@@ -5640,11 +5646,11 @@ function En(a, e, t) {
|
|
|
5640
5646
|
e.scene.traverse((r) => {
|
|
5641
5647
|
r.key == n && r.name == t && o.push(r);
|
|
5642
5648
|
}), o.forEach((r) => {
|
|
5643
|
-
|
|
5649
|
+
Ss(r);
|
|
5644
5650
|
});
|
|
5645
5651
|
});
|
|
5646
5652
|
}
|
|
5647
|
-
function
|
|
5653
|
+
function Va(a, e, t = 0.05) {
|
|
5648
5654
|
a.forEach((i, n) => {
|
|
5649
5655
|
const s = Rt(e, n);
|
|
5650
5656
|
if (!(s instanceof V))
|
|
@@ -5671,12 +5677,12 @@ function Ha(a, e, t = 0.05) {
|
|
|
5671
5677
|
}), s.instanceMatrix.needsUpdate = !0, l.instanceMatrix.needsUpdate = !0, (s.parent ?? e.scene).add(l);
|
|
5672
5678
|
});
|
|
5673
5679
|
}
|
|
5674
|
-
function
|
|
5680
|
+
function Ua(a, e) {
|
|
5675
5681
|
const t = [];
|
|
5676
5682
|
e.scene.traverse((i) => {
|
|
5677
5683
|
i.name == "highlightModel" && t.push(i);
|
|
5678
5684
|
}), t.forEach((i) => {
|
|
5679
|
-
|
|
5685
|
+
Ss(i);
|
|
5680
5686
|
}), a.forEach((i, n) => {
|
|
5681
5687
|
const s = Rt(e, n);
|
|
5682
5688
|
if (!(s instanceof V))
|
|
@@ -5690,7 +5696,7 @@ function Va(a, e) {
|
|
|
5690
5696
|
}), s.instanceMatrix.needsUpdate = !0;
|
|
5691
5697
|
});
|
|
5692
5698
|
}
|
|
5693
|
-
function
|
|
5699
|
+
function Sn(a, e) {
|
|
5694
5700
|
a.forEach((t, i) => {
|
|
5695
5701
|
const n = Rt(e, i);
|
|
5696
5702
|
n instanceof V && (t.forEach((s) => {
|
|
@@ -5711,7 +5717,7 @@ function Bt(a, e, t) {
|
|
|
5711
5717
|
function zt(a, e) {
|
|
5712
5718
|
a?.cloneModel != null && (a.cloneModel.visible = e);
|
|
5713
5719
|
}
|
|
5714
|
-
function
|
|
5720
|
+
function Ss(a) {
|
|
5715
5721
|
if (a == null)
|
|
5716
5722
|
return;
|
|
5717
5723
|
const e = a.parent;
|
|
@@ -5720,8 +5726,8 @@ function As(a) {
|
|
|
5720
5726
|
function Rt(a, e) {
|
|
5721
5727
|
return Le(a, e);
|
|
5722
5728
|
}
|
|
5723
|
-
const
|
|
5724
|
-
class
|
|
5729
|
+
const Ps = "advanced";
|
|
5730
|
+
class Wa {
|
|
5725
5731
|
engine;
|
|
5726
5732
|
currentMode = "";
|
|
5727
5733
|
// 是否为手动设置(手动设置时,自动适配不再生效)
|
|
@@ -5739,7 +5745,7 @@ class Ua {
|
|
|
5739
5745
|
* 初始化模块
|
|
5740
5746
|
*/
|
|
5741
5747
|
init() {
|
|
5742
|
-
this.cachePassReferences(), this.autoSwitch(
|
|
5748
|
+
this.cachePassReferences(), this.autoSwitch(Ps);
|
|
5743
5749
|
}
|
|
5744
5750
|
/**
|
|
5745
5751
|
* 手动切换渲染模式(用户调用),锁定自动适配
|
|
@@ -5945,7 +5951,7 @@ class ni {
|
|
|
5945
5951
|
color: 16777215,
|
|
5946
5952
|
transparent: !0,
|
|
5947
5953
|
opacity: 0,
|
|
5948
|
-
blending:
|
|
5954
|
+
blending: to,
|
|
5949
5955
|
depthWrite: !1
|
|
5950
5956
|
}), this.overlayMaterial.clippingPlanes = this.engine.sectionPlane;
|
|
5951
5957
|
}
|
|
@@ -6010,10 +6016,10 @@ class ni {
|
|
|
6010
6016
|
this.setAnimationFrameRateExempt(!1), this.removeOverlayMeshes(), this.overlayMaterial.dispose(), this.tagDiv?.remove?.(), this.tagDiv = null, this.animState = "idle";
|
|
6011
6017
|
}
|
|
6012
6018
|
}
|
|
6013
|
-
function
|
|
6019
|
+
function Ga() {
|
|
6014
6020
|
return new ki();
|
|
6015
6021
|
}
|
|
6016
|
-
function
|
|
6022
|
+
function qa(a, e) {
|
|
6017
6023
|
a.appendChild(e.domElement);
|
|
6018
6024
|
}
|
|
6019
6025
|
const Je = {
|
|
@@ -6025,7 +6031,7 @@ const Je = {
|
|
|
6025
6031
|
front: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAABp0lEQVR4nO3ZwWnDQBBA0XFwM9uA23FtbkcNqByngxCCzQb/985CzOEzaFeXmXkOWdeZmfM8d8/BBmut+do9BHsJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAogTQJwA4gQQJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAoi77h7gne73+xzH8bL33W63eTweL3vff2ADxAkgTgBxAogTQNxHnwJ+8olf9H9hA8QJIE4AcQKIE0CcAOIEECeAOAHEZW8Cj+OYtdavn//Um0MbIE4AcQKIE0CcAOKyp4CZmfM8d4+wnQ0QJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiLvMzNNv0aa1lg1QJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxAkgTgBxAogTQJwA4gQQJ4A4AcQJIE4AcQKIE0CcAOIEECeAOAHECSBOAHECiBNAnADiBBAngDgBxF1m5rl7CPb5Bhi1Gm3j3a/lAAAAAElFTkSuQmCC",
|
|
6026
6032
|
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"
|
|
6027
6033
|
};
|
|
6028
|
-
function
|
|
6034
|
+
function Ka(a, e, t) {
|
|
6029
6035
|
var i = new Object();
|
|
6030
6036
|
i.visible = !0;
|
|
6031
6037
|
let n = null, s = 0, o, r, l = [];
|
|
@@ -6211,8 +6217,8 @@ function qa(a, e, t) {
|
|
|
6211
6217
|
}), He.easing(et.Easing.Cubic.InOut), g(), He.start(), oi();
|
|
6212
6218
|
} else {
|
|
6213
6219
|
var E = w.min.clone().add(w.max.clone()).multiplyScalar(0.5);
|
|
6214
|
-
let
|
|
6215
|
-
var T = E.clone().add(
|
|
6220
|
+
let Vs = e.camera.position.clone().sub(a.controls.target.clone()).normalize();
|
|
6221
|
+
var T = E.clone().add(Vs.multiplyScalar(2 * w.max.distanceTo(w.min)));
|
|
6216
6222
|
P(e.camera.position, T, a.controls.target.clone(), E, null, null, f);
|
|
6217
6223
|
}
|
|
6218
6224
|
};
|
|
@@ -6325,7 +6331,7 @@ function qa(a, e, t) {
|
|
|
6325
6331
|
}
|
|
6326
6332
|
}
|
|
6327
6333
|
function k() {
|
|
6328
|
-
i.sceneOrtho =
|
|
6334
|
+
i.sceneOrtho = Ga();
|
|
6329
6335
|
var E = t.clientWidth, _ = t.clientWidth, w = E > _ ? E / _ : _ / E, f = 300;
|
|
6330
6336
|
i.camera = new Be(
|
|
6331
6337
|
f * w / -2,
|
|
@@ -6340,7 +6346,7 @@ function qa(a, e, t) {
|
|
|
6340
6346
|
});
|
|
6341
6347
|
D.setSize(E, _), D.setClearAlpha(0), i.sceneOrtho.renderer = D;
|
|
6342
6348
|
let T = new $t(16777215, 0.8);
|
|
6343
|
-
i.sceneOrtho.add(T),
|
|
6349
|
+
i.sceneOrtho.add(T), qa(o, D), i.orbitControls = new ts(a, i.camera, o), i.orbitControls.enableZoom = !1, i.orbitControls.enablePan = !1, i.orbitControls.enableDamping = !0, i.orbitControls.dampingFactor = 0.1, i.orbitControls.rotateSpeed = 0.5, i.orbitControls.addEventListener("start", K), i.orbitControls.addEventListener("change", te), i.orbitControls.addEventListener("end", Q);
|
|
6344
6350
|
}
|
|
6345
6351
|
let O = !1;
|
|
6346
6352
|
function K() {
|
|
@@ -6645,7 +6651,7 @@ function qa(a, e, t) {
|
|
|
6645
6651
|
!document.fullscreenElement && !document.webkitFullscreenElement && !document.mozFullScreenElement && !document.msFullscreenElement ? (w.requestFullscreen ? w.requestFullscreen() : w.webkitRequestFullscreen ? w.webkitRequestFullscreen() : w.mozRequestFullScreen ? w.mozRequestFullScreen() : w.msRequestFullscreen && w.msRequestFullscreen(), console.log("已进入全屏模式")) : (document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.msExitFullscreen && document.msExitFullscreen(), console.log("已退出全屏模式"));
|
|
6646
6652
|
}, i;
|
|
6647
6653
|
}
|
|
6648
|
-
class
|
|
6654
|
+
class ja {
|
|
6649
6655
|
engine;
|
|
6650
6656
|
cubeTool;
|
|
6651
6657
|
mainViewPort;
|
|
@@ -6653,7 +6659,7 @@ class Ka {
|
|
|
6653
6659
|
this.engine = e;
|
|
6654
6660
|
}
|
|
6655
6661
|
init() {
|
|
6656
|
-
this.cubeTool =
|
|
6662
|
+
this.cubeTool = Ka(this.engine, this.engine.scene, this.engine.container), this.cubeTool.init();
|
|
6657
6663
|
}
|
|
6658
6664
|
// 隐藏视图立方体,供 showViewCube=false 的初始化配置调用。
|
|
6659
6665
|
hide() {
|
|
@@ -6773,7 +6779,7 @@ class Ka {
|
|
|
6773
6779
|
this.cubeTool.TakeScreenshot();
|
|
6774
6780
|
}
|
|
6775
6781
|
}
|
|
6776
|
-
function
|
|
6782
|
+
function Ya(a) {
|
|
6777
6783
|
let e = new Object(), t = null;
|
|
6778
6784
|
return e.getBoundingBox = function() {
|
|
6779
6785
|
let i = a.models, n = new d(1e8, 1e9, 1e10), s = new d(-1e8, -1e9, -1e10);
|
|
@@ -6831,12 +6837,12 @@ function ja(a) {
|
|
|
6831
6837
|
});
|
|
6832
6838
|
});
|
|
6833
6839
|
const m = l.map((f) => O(f)).filter((f) => f instanceof z);
|
|
6834
|
-
|
|
6840
|
+
ur(i);
|
|
6835
6841
|
const b = [
|
|
6836
6842
|
...x,
|
|
6837
6843
|
...i.intersectObjects(m, !1).map(he)
|
|
6838
6844
|
].sort((f, E) => f.distance - E.distance);
|
|
6839
|
-
return
|
|
6845
|
+
return pr(i), b;
|
|
6840
6846
|
function C(f, E, _, D, T) {
|
|
6841
6847
|
if (E == null)
|
|
6842
6848
|
return;
|
|
@@ -6999,7 +7005,7 @@ function ja(a) {
|
|
|
6999
7005
|
}
|
|
7000
7006
|
}, e;
|
|
7001
7007
|
}
|
|
7002
|
-
class
|
|
7008
|
+
class Xa {
|
|
7003
7009
|
engine;
|
|
7004
7010
|
// 绘制状态
|
|
7005
7011
|
isDrawing = !1;
|
|
@@ -7177,8 +7183,8 @@ class Ya {
|
|
|
7177
7183
|
this.disActive(), this.selectionBox?.remove(), this.selectionBox = null, this.worldToScreen = null, this.isDrawing = !1;
|
|
7178
7184
|
}
|
|
7179
7185
|
}
|
|
7180
|
-
const
|
|
7181
|
-
class
|
|
7186
|
+
const Qa = F.degToRad(10), Pn = 1e-3, Pi = !1, $a = [];
|
|
7187
|
+
class Za {
|
|
7182
7188
|
engine;
|
|
7183
7189
|
rootGroup = null;
|
|
7184
7190
|
isVisible = Pi;
|
|
@@ -7192,7 +7198,7 @@ class $a {
|
|
|
7192
7198
|
}
|
|
7193
7199
|
setMockData() {
|
|
7194
7200
|
const e = this.engine.models?.[0]?.grids;
|
|
7195
|
-
this.setData(Array.isArray(e) && e.length > 0 ? e :
|
|
7201
|
+
this.setData(Array.isArray(e) && e.length > 0 ? e : $a);
|
|
7196
7202
|
}
|
|
7197
7203
|
show() {
|
|
7198
7204
|
this.isVisible = !0, this.rootGroup && (this.rootGroup.visible = !0);
|
|
@@ -7281,7 +7287,7 @@ class $a {
|
|
|
7281
7287
|
throw new Error("Grid sprite canvas context is not available");
|
|
7282
7288
|
const o = 128 / 2, r = 128 / 2, l = 128 / 2 - 4;
|
|
7283
7289
|
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);
|
|
7284
|
-
const c = new
|
|
7290
|
+
const c = new io(n), h = new no({
|
|
7285
7291
|
map: c,
|
|
7286
7292
|
depthTest: !1,
|
|
7287
7293
|
transparent: !0
|
|
@@ -7331,7 +7337,7 @@ class $a {
|
|
|
7331
7337
|
const n = this.createProjection(i);
|
|
7332
7338
|
if (!n)
|
|
7333
7339
|
return;
|
|
7334
|
-
const s = t.find((o) => o.direction.angleTo(n.direction) <=
|
|
7340
|
+
const s = t.find((o) => o.direction.angleTo(n.direction) <= Qa);
|
|
7335
7341
|
if (s) {
|
|
7336
7342
|
s.axes.push(n);
|
|
7337
7343
|
return;
|
|
@@ -7361,13 +7367,13 @@ class $a {
|
|
|
7361
7367
|
}
|
|
7362
7368
|
normalizeDirection(e) {
|
|
7363
7369
|
const t = e.clone().normalize();
|
|
7364
|
-
return (t.x < 0 || Math.abs(t.x) <=
|
|
7370
|
+
return (t.x < 0 || Math.abs(t.x) <= Pn && t.y < 0) && t.multiplyScalar(-1), t;
|
|
7365
7371
|
}
|
|
7366
7372
|
/**
|
|
7367
7373
|
* 在单个轴族内优先返回点位所属的最近轴网区间,避免落在线上时出现空描述。
|
|
7368
7374
|
*/
|
|
7369
7375
|
resolveFamilyLocation(e, t) {
|
|
7370
|
-
const i = t.dot(e.normal), n = e.axes.find((c) => Math.abs(c.offset - i) <=
|
|
7376
|
+
const i = t.dot(e.normal), n = e.axes.find((c) => Math.abs(c.offset - i) <= Pn) ?? null;
|
|
7371
7377
|
if (n) {
|
|
7372
7378
|
const c = e.axes.findIndex((u) => u.data.Id === n.data.Id), h = this.pickAxisPairAroundIndex(e.axes, c);
|
|
7373
7379
|
return {
|
|
@@ -7466,15 +7472,15 @@ class $a {
|
|
|
7466
7472
|
return e instanceof d ? e.clone() : new d(e.x, e.y, e.z);
|
|
7467
7473
|
}
|
|
7468
7474
|
}
|
|
7469
|
-
const
|
|
7475
|
+
const Ts = "0", Is = 0, _s = !1;
|
|
7470
7476
|
class qi {
|
|
7471
7477
|
engine;
|
|
7472
|
-
currentId =
|
|
7478
|
+
currentId = Ts;
|
|
7473
7479
|
groundGroup;
|
|
7474
7480
|
groundMesh = null;
|
|
7475
7481
|
/** 当前为官方 Water 水面时为 true,用于 update/dispose 分支 */
|
|
7476
7482
|
isWaterAddon = !1;
|
|
7477
|
-
groundY =
|
|
7483
|
+
groundY = Is;
|
|
7478
7484
|
/** 默认水面法线贴图路径(项目内为 public/textture/waternormals.jpg) */
|
|
7479
7485
|
static DEFAULT_WATER_NORMALS = "/texture/waternormals.jpg";
|
|
7480
7486
|
groundList = [
|
|
@@ -7499,7 +7505,7 @@ class qi {
|
|
|
7499
7505
|
this.engine = e, this.groundGroup = new pe(), this.groundGroup.name = "groundGroup";
|
|
7500
7506
|
}
|
|
7501
7507
|
init() {
|
|
7502
|
-
this.engine.scene.add(this.groundGroup), this.groundGroup.visible =
|
|
7508
|
+
this.engine.scene.add(this.groundGroup), this.groundGroup.visible = _s;
|
|
7503
7509
|
}
|
|
7504
7510
|
/**
|
|
7505
7511
|
* 切换地面类型
|
|
@@ -7514,7 +7520,7 @@ class qi {
|
|
|
7514
7520
|
if (i.water) {
|
|
7515
7521
|
const s = new bi(n, n), o = t?.waterNormalsUrl ?? ee(qi.DEFAULT_WATER_NORMALS, import.meta.url), r = new nt().load(o, (g) => {
|
|
7516
7522
|
g.wrapS = g.wrapT = pt;
|
|
7517
|
-
}), l = t?.sunDirection ?? new d(0.5, 0.8, 0.5).normalize(), c = t?.distortionScale ?? i.distortionScale ?? 3.7, h = t?.waterSize ?? i.size ?? 1, u = t?.opacity ?? 0.92, p = new
|
|
7523
|
+
}), l = t?.sunDirection ?? new d(0.5, 0.8, 0.5).normalize(), c = t?.distortionScale ?? i.distortionScale ?? 3.7, h = t?.waterSize ?? i.size ?? 1, u = t?.opacity ?? 0.92, p = new so(s, {
|
|
7518
7524
|
textureWidth: 512,
|
|
7519
7525
|
textureHeight: 512,
|
|
7520
7526
|
waterNormals: r,
|
|
@@ -7606,12 +7612,12 @@ class qi {
|
|
|
7606
7612
|
Array.isArray(e) ? e.forEach((t) => t.dispose()) : e.dispose(), this.groundGroup.remove(this.groundMesh), this.groundMesh = null, this.isWaterAddon = !1;
|
|
7607
7613
|
}
|
|
7608
7614
|
}
|
|
7609
|
-
const Ue = "0",
|
|
7610
|
-
class
|
|
7615
|
+
const Ue = "0", Ja = !0, Ds = 0.2, el = 0.35;
|
|
7616
|
+
class tl {
|
|
7611
7617
|
engine;
|
|
7612
7618
|
currentHdrId = Ue;
|
|
7613
|
-
isVisible =
|
|
7614
|
-
currentIntensity =
|
|
7619
|
+
isVisible = Ja;
|
|
7620
|
+
currentIntensity = Ds;
|
|
7615
7621
|
currentTexture = null;
|
|
7616
7622
|
currentEnvironmentTexture = null;
|
|
7617
7623
|
skybox = null;
|
|
@@ -7696,10 +7702,10 @@ class el {
|
|
|
7696
7702
|
_loadHdr(e) {
|
|
7697
7703
|
const t = ee(e, import.meta.url);
|
|
7698
7704
|
return new Promise((i, n) => {
|
|
7699
|
-
new
|
|
7705
|
+
new oo().load(
|
|
7700
7706
|
t,
|
|
7701
7707
|
(s) => {
|
|
7702
|
-
s.mapping =
|
|
7708
|
+
s.mapping = ro, i(s);
|
|
7703
7709
|
},
|
|
7704
7710
|
void 0,
|
|
7705
7711
|
(s) => n(s)
|
|
@@ -7709,7 +7715,7 @@ class el {
|
|
|
7709
7715
|
_applyTexture(e) {
|
|
7710
7716
|
if (this.currentTexture = e, !this.engine.scene || !this.engine.renderer) return;
|
|
7711
7717
|
this._captureSceneState(), this.currentEnvironmentTexture?.dispose();
|
|
7712
|
-
const t = new
|
|
7718
|
+
const t = new Zn(this.engine.renderer), i = t.fromEquirectangular(e).texture;
|
|
7713
7719
|
t.dispose(), this.currentEnvironmentTexture = i, this.engine.scene.background = null, this.engine.scene.environment = i, this.engine.scene.environmentIntensity = this.currentIntensity, this.engine.renderer.toneMapping = Bi, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure > 0 ? this.previousToneMappingExposure : Fi, this._removeSkybox(), this._createSkybox(e), this._setAmbientLightIntensity(this._getHdrAmbientLightIntensity());
|
|
7714
7720
|
}
|
|
7715
7721
|
_captureSceneState() {
|
|
@@ -7751,20 +7757,20 @@ class el {
|
|
|
7751
7757
|
t && (t.intensity = e);
|
|
7752
7758
|
}
|
|
7753
7759
|
_getHdrAmbientLightIntensity() {
|
|
7754
|
-
return Math.max(this.previousAmbientLightIntensity *
|
|
7760
|
+
return Math.max(this.previousAmbientLightIntensity * el, 0);
|
|
7755
7761
|
}
|
|
7756
7762
|
_requestRender() {
|
|
7757
7763
|
this.engine?.requestComposerRender?.();
|
|
7758
7764
|
}
|
|
7759
7765
|
}
|
|
7760
|
-
const
|
|
7766
|
+
const il = 1e-3, ks = !1, nl = [
|
|
7761
7767
|
{ Id: "339", Name: "L1", Elevation: -0.32808398950131235 },
|
|
7762
7768
|
{ Id: "2787", Name: "L2", Elevation: 16.896325459317584 },
|
|
7763
7769
|
{ Id: "236633", Name: "L3", Elevation: 36.745406824146976 }
|
|
7764
7770
|
];
|
|
7765
|
-
class
|
|
7771
|
+
class sl {
|
|
7766
7772
|
engine;
|
|
7767
|
-
isVisible =
|
|
7773
|
+
isVisible = ks;
|
|
7768
7774
|
levels = [];
|
|
7769
7775
|
svgContainer = null;
|
|
7770
7776
|
svgOverlay = null;
|
|
@@ -7782,7 +7788,7 @@ class nl {
|
|
|
7782
7788
|
}
|
|
7783
7789
|
setMockData() {
|
|
7784
7790
|
const e = this.engine.models?.[0]?.levels, t = this.engine.models?.[0]?.boundingBox;
|
|
7785
|
-
this.setData(Array.isArray(e) && e.length > 0 ? e :
|
|
7791
|
+
this.setData(Array.isArray(e) && e.length > 0 ? e : nl, t);
|
|
7786
7792
|
}
|
|
7787
7793
|
show() {
|
|
7788
7794
|
this.isVisible = !0, this.svgContainer && (this.svgContainer.style.display = "block"), this.levels.forEach((e) => {
|
|
@@ -7815,7 +7821,7 @@ class nl {
|
|
|
7815
7821
|
const { url: i, targetPoint: n } = this.resolvePointLookupArgs(e, t), s = this.getLevelData(i).slice().sort((g, y) => g.Elevation - y.Elevation);
|
|
7816
7822
|
if (s.length === 0)
|
|
7817
7823
|
return null;
|
|
7818
|
-
const o = (n instanceof d, n.y), r = s.find((g) => Math.abs(g.Elevation - o) <=
|
|
7824
|
+
const o = (n instanceof d, n.y), r = s.find((g) => Math.abs(g.Elevation - o) <= il) ?? null;
|
|
7819
7825
|
if (r)
|
|
7820
7826
|
return {
|
|
7821
7827
|
pointY: o,
|
|
@@ -7989,33 +7995,33 @@ class nl {
|
|
|
7989
7995
|
};
|
|
7990
7996
|
}
|
|
7991
7997
|
}
|
|
7992
|
-
const jt = !0, Ti = 0.5,
|
|
7993
|
-
function
|
|
7998
|
+
const jt = !0, Ti = 0.5, ol = 32, rl = 0.3, Ls = 0.05, al = 0.04, ll = 0.18, cl = 0.01;
|
|
7999
|
+
function hl(a) {
|
|
7994
8000
|
return !a?.min || !a?.max ? 0 : a.min.distanceTo(a.max);
|
|
7995
8001
|
}
|
|
7996
|
-
function
|
|
8002
|
+
function dl(a, e) {
|
|
7997
8003
|
return a instanceof d ? a.clone() : e?.min && e?.max ? e.min.clone().add(e.max).multiplyScalar(0.5) : new d();
|
|
7998
8004
|
}
|
|
7999
|
-
function
|
|
8005
|
+
function ul(a, e, t) {
|
|
8000
8006
|
if (a instanceof Be)
|
|
8001
8007
|
return Math.max((a.top - a.bottom) / Math.max(a.zoom, 1e-6), 1);
|
|
8002
|
-
const i = a, n =
|
|
8008
|
+
const i = a, n = dl(e, t), s = i.position.distanceTo(n), o = typeof i.getEffectiveFOV == "function" ? i.getEffectiveFOV() : i.fov, r = F.degToRad(o * 0.5);
|
|
8003
8009
|
return Math.max(2 * s * Math.tan(r), 1);
|
|
8004
8010
|
}
|
|
8005
|
-
function
|
|
8011
|
+
function pl(a, e, t, i) {
|
|
8006
8012
|
if (a == null)
|
|
8007
8013
|
return i;
|
|
8008
|
-
const n =
|
|
8014
|
+
const n = hl(t);
|
|
8009
8015
|
if (n <= 0)
|
|
8010
8016
|
return i;
|
|
8011
|
-
const s =
|
|
8017
|
+
const s = ul(a, e, t), o = Math.max(n * al, 1), r = Math.max(n * ll, o + 1), l = F.clamp(
|
|
8012
8018
|
(s - o) / (r - o),
|
|
8013
8019
|
0,
|
|
8014
8020
|
1
|
|
8015
|
-
), c = Math.max(i *
|
|
8021
|
+
), c = Math.max(i * rl, Ls);
|
|
8016
8022
|
return F.lerp(i, c, l);
|
|
8017
8023
|
}
|
|
8018
|
-
class
|
|
8024
|
+
class ml {
|
|
8019
8025
|
engine;
|
|
8020
8026
|
isActive = jt;
|
|
8021
8027
|
groupEdge;
|
|
@@ -8126,13 +8132,13 @@ class pl {
|
|
|
8126
8132
|
update() {
|
|
8127
8133
|
if (!this.isActive || !this.material)
|
|
8128
8134
|
return;
|
|
8129
|
-
const e =
|
|
8135
|
+
const e = pl(
|
|
8130
8136
|
this.engine?.camera,
|
|
8131
8137
|
this.engine?.controls?.target,
|
|
8132
8138
|
this.engine?.octreeBox?.getBoundingBox?.(),
|
|
8133
8139
|
this.baseOpacity
|
|
8134
8140
|
);
|
|
8135
|
-
Math.abs(this.material.opacity - e) <=
|
|
8141
|
+
Math.abs(this.material.opacity - e) <= cl || (this.material.opacity = e, this.material.needsUpdate = !0);
|
|
8136
8142
|
}
|
|
8137
8143
|
hasPendingModelEdges() {
|
|
8138
8144
|
return (this.engine?.models ?? []).some((t) => this.shouldLoadModelEdge(t) && !Array.isArray(t?.modelEdge));
|
|
@@ -8265,7 +8271,7 @@ class pl {
|
|
|
8265
8271
|
if (i.ids.forEach((l) => {
|
|
8266
8272
|
const c = n?.get(Number(l)), h = typeof c == "number" ? this.getEdgePointsByIndex(i.url, c) : null;
|
|
8267
8273
|
if (Array.isArray(h)) {
|
|
8268
|
-
if (h.length >
|
|
8274
|
+
if (h.length > ol)
|
|
8269
8275
|
return;
|
|
8270
8276
|
this.appendEdgePositions(s, h);
|
|
8271
8277
|
}
|
|
@@ -8324,7 +8330,7 @@ class pl {
|
|
|
8324
8330
|
}
|
|
8325
8331
|
// 设置边线材质透明度
|
|
8326
8332
|
setOpacity(e) {
|
|
8327
|
-
this.baseOpacity = F.clamp(e,
|
|
8333
|
+
this.baseOpacity = F.clamp(e, Ls, 1), this.update();
|
|
8328
8334
|
}
|
|
8329
8335
|
// 显示边线
|
|
8330
8336
|
showModelEdge(e, t) {
|
|
@@ -8355,7 +8361,7 @@ class pl {
|
|
|
8355
8361
|
this.releaseIndexes(e);
|
|
8356
8362
|
}
|
|
8357
8363
|
}
|
|
8358
|
-
const
|
|
8364
|
+
const Tn = {
|
|
8359
8365
|
turbidity: 10,
|
|
8360
8366
|
rayleigh: 3,
|
|
8361
8367
|
mieCoefficient: 5e-3,
|
|
@@ -8368,7 +8374,7 @@ const Pn = {
|
|
|
8368
8374
|
cloudDensity: 0.4,
|
|
8369
8375
|
cloudElevation: 0.5,
|
|
8370
8376
|
showSunDisc: !0
|
|
8371
|
-
}, Ii = "sunrise_clear",
|
|
8377
|
+
}, Ii = "sunrise_clear", Bs = 0.2, _i = [
|
|
8372
8378
|
{
|
|
8373
8379
|
id: "sunrise_clear",
|
|
8374
8380
|
names: ["晴朗日出", "晴朗日出", "Clear Sunrise"],
|
|
@@ -8539,17 +8545,17 @@ const Pn = {
|
|
|
8539
8545
|
showSunDisc: !1
|
|
8540
8546
|
}
|
|
8541
8547
|
}
|
|
8542
|
-
],
|
|
8548
|
+
], In = _i.reduce(
|
|
8543
8549
|
(a, e) => (a[e.id] = e, a),
|
|
8544
8550
|
{}
|
|
8545
|
-
),
|
|
8546
|
-
class
|
|
8551
|
+
), _n = 2e6;
|
|
8552
|
+
class gl {
|
|
8547
8553
|
engine;
|
|
8548
8554
|
sky = null;
|
|
8549
8555
|
sun = new d();
|
|
8550
|
-
params = { ...
|
|
8556
|
+
params = { ...Tn, ...In[Ii].params };
|
|
8551
8557
|
currentPreset = Ii;
|
|
8552
|
-
currentIntensity =
|
|
8558
|
+
currentIntensity = Bs;
|
|
8553
8559
|
currentEnvironmentTarget = null;
|
|
8554
8560
|
skyScale = 45e4;
|
|
8555
8561
|
skyName = "bim_engine_sky";
|
|
@@ -8570,7 +8576,7 @@ class ml {
|
|
|
8570
8576
|
this.sky.visible = !0, this._captureSceneState(), this._expandCameraFarForSky(), this._applyParamsToSky();
|
|
8571
8577
|
return;
|
|
8572
8578
|
}
|
|
8573
|
-
const e = new
|
|
8579
|
+
const e = new ao();
|
|
8574
8580
|
e.scale.setScalar(this.skyScale), e.name = this.skyName, this.sky = e, this.engine.scene.add(e), this._captureSceneState(), this._expandCameraFarForSky(), this.engine.renderer && (this.engine.renderer.toneMapping = Qi, this.engine.scene.background = null), this._applyParamsToSky();
|
|
8575
8581
|
}
|
|
8576
8582
|
close(e = !0) {
|
|
@@ -8586,8 +8592,8 @@ class ml {
|
|
|
8586
8592
|
Object.assign(this.params, e), this._applyParamsToSky(), this.engine?.renderer && (e.exposure !== void 0 || e.orthoExposureScale !== void 0) && (this.engine.renderer.toneMappingExposure = this._getEffectiveExposure());
|
|
8587
8593
|
}
|
|
8588
8594
|
setPreset(e) {
|
|
8589
|
-
const t =
|
|
8590
|
-
t && (this.currentPreset = e, this.params = { ...
|
|
8595
|
+
const t = In[e];
|
|
8596
|
+
t && (this.currentPreset = e, this.params = { ...Tn, ...t.params }, this._applyParamsToSky(), this.engine?.renderer && (this.engine.renderer.toneMappingExposure = this._getEffectiveExposure()));
|
|
8591
8597
|
}
|
|
8592
8598
|
getCurrentPreset() {
|
|
8593
8599
|
return this.currentPreset;
|
|
@@ -8631,7 +8637,7 @@ class ml {
|
|
|
8631
8637
|
const e = this.engine?.camera;
|
|
8632
8638
|
if (!e || typeof e.far != "number") return;
|
|
8633
8639
|
const t = e.far;
|
|
8634
|
-
t >=
|
|
8640
|
+
t >= _n || (this.savedCameraFar == null && (this.savedCameraFar = t), e.far = _n, typeof e.updateProjectionMatrix == "function" && e.updateProjectionMatrix());
|
|
8635
8641
|
}
|
|
8636
8642
|
_restoreCameraFar() {
|
|
8637
8643
|
if (this.savedCameraFar == null || !this.engine?.camera) return;
|
|
@@ -8656,7 +8662,7 @@ class ml {
|
|
|
8656
8662
|
this._disposeEnvironmentTarget();
|
|
8657
8663
|
const e = new ki(), t = this.sky.clone();
|
|
8658
8664
|
t.material = this.sky.material.clone(), e.add(t);
|
|
8659
|
-
const i = new
|
|
8665
|
+
const i = new Zn(this.engine.renderer);
|
|
8660
8666
|
this.currentEnvironmentTarget = i.fromScene(e, 0, 0.1, this.skyScale * 2), i.dispose(), this.engine.scene.background = null, this.engine.scene.environment = this.currentEnvironmentTarget.texture, this.engine.scene.environmentIntensity = this.currentIntensity, t.material.dispose();
|
|
8661
8667
|
}
|
|
8662
8668
|
_disposeEnvironmentTarget() {
|
|
@@ -8667,7 +8673,7 @@ class ml {
|
|
|
8667
8673
|
n && (i instanceof d && typeof n.value?.copy == "function" ? n.value.copy(i) : n.value = i);
|
|
8668
8674
|
}
|
|
8669
8675
|
}
|
|
8670
|
-
class
|
|
8676
|
+
class fl {
|
|
8671
8677
|
/** 寮曟搸瀹炰緥寮曠敤 */
|
|
8672
8678
|
engine;
|
|
8673
8679
|
defaultSettings;
|
|
@@ -8799,28 +8805,28 @@ class gl {
|
|
|
8799
8805
|
return {
|
|
8800
8806
|
render: {
|
|
8801
8807
|
mode: this._toRenderMode(this.engine.engineModelModule?.getCurrentMode?.()),
|
|
8802
|
-
contrast: this._uniformToPercent(t,
|
|
8803
|
-
saturation: this._uniformToPercent(e,
|
|
8808
|
+
contrast: this._uniformToPercent(t, ls),
|
|
8809
|
+
saturation: this._uniformToPercent(e, as),
|
|
8804
8810
|
shadowIntensity: this._shadowToPercent(this._getDirectionalLightShadowIntensity(), bt),
|
|
8805
8811
|
lightIntensity: this._exposureToPercent(n, Fi),
|
|
8806
|
-
gtaoIntensity: this._unitToPercent(i,
|
|
8812
|
+
gtaoIntensity: this._unitToPercent(i, rs)
|
|
8807
8813
|
},
|
|
8808
8814
|
display: {
|
|
8809
8815
|
showEdge: this.engine.modelEdge?.isEnabled?.() ?? jt,
|
|
8810
8816
|
edgeOpacity: this._unitToPercent(s, Ti),
|
|
8811
8817
|
showGrid: this.engine.grid?.getVisible?.() ?? Pi,
|
|
8812
|
-
showLevel: this.engine.level?.getVisible?.() ??
|
|
8813
|
-
showGround: this.engine.ground?.getVisible?.() ??
|
|
8814
|
-
groundId: this.engine.ground?.getCurrentId?.() ??
|
|
8815
|
-
groundHeight: this.engine.ground?.getHeight?.() ??
|
|
8818
|
+
showLevel: this.engine.level?.getVisible?.() ?? ks,
|
|
8819
|
+
showGround: this.engine.ground?.getVisible?.() ?? _s,
|
|
8820
|
+
groundId: this.engine.ground?.getCurrentId?.() ?? Ts,
|
|
8821
|
+
groundHeight: this.engine.ground?.getHeight?.() ?? Is
|
|
8816
8822
|
},
|
|
8817
8823
|
environment: {
|
|
8818
8824
|
type: h ? "sky" : o !== Ue ? "hdr" : "none",
|
|
8819
8825
|
hdrId: o,
|
|
8820
|
-
hdrIntensity: this._unitToPercent(r,
|
|
8826
|
+
hdrIntensity: this._unitToPercent(r, Ds),
|
|
8821
8827
|
skyPreset: c,
|
|
8822
8828
|
skyParams: {},
|
|
8823
|
-
skyIntensity: this._unitToPercent(l,
|
|
8829
|
+
skyIntensity: this._unitToPercent(l, Bs)
|
|
8824
8830
|
}
|
|
8825
8831
|
};
|
|
8826
8832
|
}
|
|
@@ -8855,7 +8861,7 @@ class gl {
|
|
|
8855
8861
|
};
|
|
8856
8862
|
}
|
|
8857
8863
|
_toRenderMode(e) {
|
|
8858
|
-
return e === "simple" || e === "balance" || e === "advanced" ? e :
|
|
8864
|
+
return e === "simple" || e === "balance" || e === "advanced" ? e : Ps;
|
|
8859
8865
|
}
|
|
8860
8866
|
_uniformToPercent(e, t) {
|
|
8861
8867
|
const i = typeof e == "number" ? e : t;
|
|
@@ -9204,7 +9210,7 @@ class qe {
|
|
|
9204
9210
|
}
|
|
9205
9211
|
}
|
|
9206
9212
|
}
|
|
9207
|
-
class
|
|
9213
|
+
class yl {
|
|
9208
9214
|
engine;
|
|
9209
9215
|
isActive = !1;
|
|
9210
9216
|
tools;
|
|
@@ -9308,7 +9314,7 @@ class fl {
|
|
|
9308
9314
|
}
|
|
9309
9315
|
}
|
|
9310
9316
|
}
|
|
9311
|
-
class
|
|
9317
|
+
class Ml {
|
|
9312
9318
|
engine;
|
|
9313
9319
|
tools;
|
|
9314
9320
|
isActive = !1;
|
|
@@ -9364,7 +9370,7 @@ class yl {
|
|
|
9364
9370
|
}
|
|
9365
9371
|
// 按下esc
|
|
9366
9372
|
}
|
|
9367
|
-
class
|
|
9373
|
+
class vl {
|
|
9368
9374
|
engine;
|
|
9369
9375
|
isActive = !1;
|
|
9370
9376
|
tools;
|
|
@@ -9419,7 +9425,7 @@ class Ml {
|
|
|
9419
9425
|
t.point1 = s.point, t.point2 = n[0].point, t.text = t.point1.clone().distanceTo(t.point2.clone()), this.engine.events.trigger(se.MeasureChanged, t);
|
|
9420
9426
|
}
|
|
9421
9427
|
}
|
|
9422
|
-
class
|
|
9428
|
+
class xl {
|
|
9423
9429
|
engine;
|
|
9424
9430
|
isActive = !1;
|
|
9425
9431
|
tools;
|
|
@@ -9464,7 +9470,7 @@ class vl {
|
|
|
9464
9470
|
t.point = e.catch.point.clone(), t.text = e.catch.point.y, t.isSelect = !1, this.engine.events.trigger(se.MeasureChanged, t);
|
|
9465
9471
|
}
|
|
9466
9472
|
}
|
|
9467
|
-
class
|
|
9473
|
+
class wl {
|
|
9468
9474
|
engine;
|
|
9469
9475
|
isActive = !1;
|
|
9470
9476
|
tools;
|
|
@@ -9516,7 +9522,7 @@ class xl {
|
|
|
9516
9522
|
e != null && (e.isSelect = !1, this.engine.events.trigger(se.MeasureChanged, e));
|
|
9517
9523
|
}
|
|
9518
9524
|
}
|
|
9519
|
-
class
|
|
9525
|
+
class bl {
|
|
9520
9526
|
engine;
|
|
9521
9527
|
tools;
|
|
9522
9528
|
// 存储三个点:起点、顶点(中间点)、终点
|
|
@@ -9584,7 +9590,7 @@ class wl {
|
|
|
9584
9590
|
}
|
|
9585
9591
|
}
|
|
9586
9592
|
}
|
|
9587
|
-
class
|
|
9593
|
+
class Cl {
|
|
9588
9594
|
engine;
|
|
9589
9595
|
tools;
|
|
9590
9596
|
points = [];
|
|
@@ -9811,7 +9817,7 @@ class Ct {
|
|
|
9811
9817
|
}
|
|
9812
9818
|
}
|
|
9813
9819
|
}
|
|
9814
|
-
class
|
|
9820
|
+
class El {
|
|
9815
9821
|
engine;
|
|
9816
9822
|
isActive = !1;
|
|
9817
9823
|
points = [];
|
|
@@ -9892,7 +9898,7 @@ class Cl {
|
|
|
9892
9898
|
};
|
|
9893
9899
|
}
|
|
9894
9900
|
}
|
|
9895
|
-
class
|
|
9901
|
+
class Al {
|
|
9896
9902
|
isActive = !1;
|
|
9897
9903
|
engine;
|
|
9898
9904
|
clearHeightMeasure;
|
|
@@ -9918,7 +9924,7 @@ class El {
|
|
|
9918
9924
|
volumeAnnotation: []
|
|
9919
9925
|
};
|
|
9920
9926
|
constructor(e) {
|
|
9921
|
-
this.engine = e, this.clearHeightMeasure = new
|
|
9927
|
+
this.engine = e, this.clearHeightMeasure = new yl(e), this.distanceMeasure = new Ml(e), this.clearDistanceMeasure = new vl(e), this.elevationMeasure = new xl(e), this.pointMeasure = new wl(e), this.angleMeasure = new bl(e), this.areaMeasure = new Cl(e), this.slopeMeasure = new Ct(e), this.faceDistanceMeasure = new El(e), this.tools = new qe(e), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", e.container.appendChild(this.annotationContainer);
|
|
9922
9928
|
}
|
|
9923
9929
|
setContextMenuDisabled(e) {
|
|
9924
9930
|
this.engine?.engineStatus != null && (this.engine.engineStatus.isDisableContextMenu = e);
|
|
@@ -9966,7 +9972,7 @@ class El {
|
|
|
9966
9972
|
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;
|
|
9967
9973
|
}
|
|
9968
9974
|
}
|
|
9969
|
-
class
|
|
9975
|
+
class Sl {
|
|
9970
9976
|
engine;
|
|
9971
9977
|
isActive = !1;
|
|
9972
9978
|
isCtrlDown = !1;
|
|
@@ -10485,7 +10491,7 @@ class Al {
|
|
|
10485
10491
|
x && x.setFromNormalAndCoplanarPoint(i.clone().setLength(-1), o);
|
|
10486
10492
|
}
|
|
10487
10493
|
}
|
|
10488
|
-
class
|
|
10494
|
+
class Pl {
|
|
10489
10495
|
engine;
|
|
10490
10496
|
isActive = !1;
|
|
10491
10497
|
isDrag = !1;
|
|
@@ -11040,7 +11046,7 @@ class Sl {
|
|
|
11040
11046
|
}
|
|
11041
11047
|
}
|
|
11042
11048
|
}
|
|
11043
|
-
class
|
|
11049
|
+
class Tl {
|
|
11044
11050
|
engine;
|
|
11045
11051
|
callback_;
|
|
11046
11052
|
isActive;
|
|
@@ -11071,7 +11077,7 @@ class Pl {
|
|
|
11071
11077
|
});
|
|
11072
11078
|
}
|
|
11073
11079
|
}
|
|
11074
|
-
class
|
|
11080
|
+
class Il {
|
|
11075
11081
|
/** 引擎实例(包含 scene / models / engineStatus / octreeBox 等) */
|
|
11076
11082
|
engine;
|
|
11077
11083
|
/** three-bvh-csg 计算器,负责执行布尔操作 */
|
|
@@ -11093,7 +11099,7 @@ class Tl {
|
|
|
11093
11099
|
fillTextureRepeat = 60;
|
|
11094
11100
|
fillTextureRotation = 0;
|
|
11095
11101
|
constructor(e) {
|
|
11096
|
-
this.engine = e, this.evaluator = new
|
|
11102
|
+
this.engine = e, this.evaluator = new lo();
|
|
11097
11103
|
const t = ee("/texture/fill.png", import.meta.url), i = new nt().load(t);
|
|
11098
11104
|
i.wrapS = pt, i.wrapT = pt, i.center.set(0.5, 0.5), i.rotation = this.fillTextureRotation, this.fillMaterial = new Ri({
|
|
11099
11105
|
color: 14079687,
|
|
@@ -11159,7 +11165,7 @@ class Tl {
|
|
|
11159
11165
|
const x = this.createWorldBrushFromMesh(M);
|
|
11160
11166
|
if (x != null)
|
|
11161
11167
|
try {
|
|
11162
|
-
const b = this.evaluator.evaluate(x, c,
|
|
11168
|
+
const b = this.evaluator.evaluate(x, c, co)?.geometry;
|
|
11163
11169
|
if (!b)
|
|
11164
11170
|
continue;
|
|
11165
11171
|
const C = this.extractPlaneCapGeometry(b, e, l);
|
|
@@ -11387,7 +11393,7 @@ class Tl {
|
|
|
11387
11393
|
return { tangent: l, bitangent: c };
|
|
11388
11394
|
}
|
|
11389
11395
|
}
|
|
11390
|
-
class
|
|
11396
|
+
class _l {
|
|
11391
11397
|
engine;
|
|
11392
11398
|
clippingTolerance = 1e-4;
|
|
11393
11399
|
sectionBox;
|
|
@@ -11399,7 +11405,7 @@ class Il {
|
|
|
11399
11405
|
fillCutFace = !0;
|
|
11400
11406
|
viewRangePlanes = null;
|
|
11401
11407
|
constructor(e) {
|
|
11402
|
-
this.engine = e, this.sectionCatchFace = new
|
|
11408
|
+
this.engine = e, this.sectionCatchFace = new Tl(this.engine);
|
|
11403
11409
|
let t = new Z(new d(0, 0, 1), 1e5);
|
|
11404
11410
|
t.name = "前";
|
|
11405
11411
|
let i = new Z(new d(0, 0, 1), 1e5);
|
|
@@ -11416,7 +11422,7 @@ class Il {
|
|
|
11416
11422
|
l.name = "face", this.engine.sectionPlane = [t, i, n, s, o, r, l];
|
|
11417
11423
|
}
|
|
11418
11424
|
init() {
|
|
11419
|
-
this.sectionBox = new
|
|
11425
|
+
this.sectionBox = new Sl(this.engine), this.sectionFace = new Pl(this.engine), this.clippingCSGSimple = new Il(this.engine);
|
|
11420
11426
|
}
|
|
11421
11427
|
// 自动缩放适用的视图比例
|
|
11422
11428
|
scaleBox() {
|
|
@@ -11623,7 +11629,7 @@ class Il {
|
|
|
11623
11629
|
});
|
|
11624
11630
|
}
|
|
11625
11631
|
}
|
|
11626
|
-
class
|
|
11632
|
+
class Dl {
|
|
11627
11633
|
engine;
|
|
11628
11634
|
constructor(e) {
|
|
11629
11635
|
this.engine = e;
|
|
@@ -11662,7 +11668,7 @@ class _l {
|
|
|
11662
11668
|
}), e;
|
|
11663
11669
|
}
|
|
11664
11670
|
}
|
|
11665
|
-
class
|
|
11671
|
+
class kl {
|
|
11666
11672
|
engine;
|
|
11667
11673
|
constructor(e) {
|
|
11668
11674
|
this.engine = e;
|
|
@@ -11700,7 +11706,7 @@ class Dl {
|
|
|
11700
11706
|
});
|
|
11701
11707
|
}
|
|
11702
11708
|
}
|
|
11703
|
-
class
|
|
11709
|
+
class Ll {
|
|
11704
11710
|
engine;
|
|
11705
11711
|
// 扩展属性
|
|
11706
11712
|
extended = /* @__PURE__ */ new Map();
|
|
@@ -11826,8 +11832,8 @@ class kl {
|
|
|
11826
11832
|
}
|
|
11827
11833
|
}
|
|
11828
11834
|
}
|
|
11829
|
-
const
|
|
11830
|
-
class
|
|
11835
|
+
const Bl = '<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>';
|
|
11836
|
+
class zl {
|
|
11831
11837
|
manager;
|
|
11832
11838
|
wrapper;
|
|
11833
11839
|
input;
|
|
@@ -11843,7 +11849,7 @@ class Bl {
|
|
|
11843
11849
|
this.manager = t, this.wrapper = document.createElement("div"), this.wrapper.className = "engine-3d-search", this.wrapper.innerHTML = `
|
|
11844
11850
|
<section class="engine-3d-search__box" role="dialog" aria-label="模型检索">
|
|
11845
11851
|
<div class="engine-3d-search__input-row">
|
|
11846
|
-
<span class="engine-3d-search__icon">${
|
|
11852
|
+
<span class="engine-3d-search__icon">${Bl}</span>
|
|
11847
11853
|
<input class="engine-3d-search__input" type="search" placeholder="检索模型名称、构件 ID、房间" autocomplete="off" spellcheck="false" />
|
|
11848
11854
|
<button class="engine-3d-search__clear" type="button" aria-label="关闭检索框">×</button>
|
|
11849
11855
|
</div>
|
|
@@ -11946,13 +11952,13 @@ class Bl {
|
|
|
11946
11952
|
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();
|
|
11947
11953
|
}
|
|
11948
11954
|
}
|
|
11949
|
-
class
|
|
11955
|
+
class Rl {
|
|
11950
11956
|
engine;
|
|
11951
11957
|
searchUI = null;
|
|
11952
11958
|
constructor(e) {
|
|
11953
11959
|
this.engine = e;
|
|
11954
11960
|
const t = e?.container;
|
|
11955
|
-
t && (this.searchUI = new
|
|
11961
|
+
t && (this.searchUI = new zl(t, this), this.setTheme(e?.options?.searchTheme === "light" ? "light" : "dark"));
|
|
11956
11962
|
}
|
|
11957
11963
|
/** 按名称、ID、房间名称/编号检索已加载模型。 */
|
|
11958
11964
|
search(e, t = {}) {
|
|
@@ -12090,7 +12096,7 @@ class zl {
|
|
|
12090
12096
|
return s < 0 ? null : (s === 0 ? 1e3 : 500) - s - Math.max(0, n.length - t.length) * 0.01;
|
|
12091
12097
|
}
|
|
12092
12098
|
}
|
|
12093
|
-
class
|
|
12099
|
+
class Ol {
|
|
12094
12100
|
engine;
|
|
12095
12101
|
constructor(e) {
|
|
12096
12102
|
this.engine = e;
|
|
@@ -12183,14 +12189,14 @@ class Rl {
|
|
|
12183
12189
|
}), t && t(i), i;
|
|
12184
12190
|
}
|
|
12185
12191
|
}
|
|
12186
|
-
const
|
|
12187
|
-
class
|
|
12192
|
+
const Dn = !1, Fl = 51283, Nl = 2718207;
|
|
12193
|
+
class Hl {
|
|
12188
12194
|
engine;
|
|
12189
12195
|
rootGroup;
|
|
12190
12196
|
meshMaterial;
|
|
12191
12197
|
instanceMaterial;
|
|
12192
12198
|
handleLoadingCompleted;
|
|
12193
|
-
isVisible =
|
|
12199
|
+
isVisible = Dn;
|
|
12194
12200
|
filterState = {
|
|
12195
12201
|
urls: null,
|
|
12196
12202
|
ids: null,
|
|
@@ -12198,7 +12204,7 @@ class Nl {
|
|
|
12198
12204
|
showInstance: !0
|
|
12199
12205
|
};
|
|
12200
12206
|
constructor(e) {
|
|
12201
|
-
this.engine = e, this.rootGroup = new pe(), this.rootGroup.name = "nodeBoxGroup", this.rootGroup.visible =
|
|
12207
|
+
this.engine = e, this.rootGroup = new pe(), this.rootGroup.name = "nodeBoxGroup", this.rootGroup.visible = Dn, this.engine.scene?.add(this.rootGroup), this.meshMaterial = this.createMaterial(Fl), this.instanceMaterial = this.createMaterial(Nl), this.handleLoadingCompleted = () => {
|
|
12202
12208
|
this.isVisible && this.rebuild();
|
|
12203
12209
|
}, this.engine.events?.on?.(ne.LoadingCompleted, this.handleLoadingCompleted);
|
|
12204
12210
|
}
|
|
@@ -12329,8 +12335,8 @@ class Nl {
|
|
|
12329
12335
|
e.matrixAutoUpdate = !1, e.matrix.copy(t), e.matrixWorldNeedsUpdate = !0, e.updateMatrixWorld(!0);
|
|
12330
12336
|
}
|
|
12331
12337
|
}
|
|
12332
|
-
const
|
|
12333
|
-
class
|
|
12338
|
+
const Vl = "path-roaming-animation", Ul = 8e3, Wl = 100, Vt = 16;
|
|
12339
|
+
class Gl {
|
|
12334
12340
|
engine;
|
|
12335
12341
|
points = [];
|
|
12336
12342
|
status = "idle";
|
|
@@ -12680,7 +12686,7 @@ class Wl {
|
|
|
12680
12686
|
const t = e.loopMode ?? (e.loop ? "repeat" : "none");
|
|
12681
12687
|
return {
|
|
12682
12688
|
...e,
|
|
12683
|
-
duration: this.toPositiveNumber(e.duration,
|
|
12689
|
+
duration: this.toPositiveNumber(e.duration, Ul),
|
|
12684
12690
|
playbackRate: this.toPositiveNumber(e.playbackRate, 1),
|
|
12685
12691
|
timing: "distance",
|
|
12686
12692
|
positionInterpolation: "linear",
|
|
@@ -12690,7 +12696,7 @@ class Wl {
|
|
|
12690
12696
|
loopMode: t,
|
|
12691
12697
|
loopCount: e.loopCount === void 0 ? Number.POSITIVE_INFINITY : Math.max(Math.floor(this.toNonNegativeNumber(e.loopCount, 0)), 0),
|
|
12692
12698
|
direction: e.direction ?? "forward",
|
|
12693
|
-
maxFrameDelta: this.toPositiveNumber(e.maxFrameDelta,
|
|
12699
|
+
maxFrameDelta: this.toPositiveNumber(e.maxFrameDelta, Wl)
|
|
12694
12700
|
};
|
|
12695
12701
|
}
|
|
12696
12702
|
/** 规范化外部关键帧,并以四元数作为旋转的权威数据。 */
|
|
@@ -12784,7 +12790,7 @@ class Wl {
|
|
|
12784
12790
|
}
|
|
12785
12791
|
/** 播放期间解除引擎空闲限帧。 */
|
|
12786
12792
|
setFrameRateExempt(e) {
|
|
12787
|
-
this.engine.setIdleFrameRateExempt?.(
|
|
12793
|
+
this.engine.setIdleFrameRateExempt?.(Vl, e);
|
|
12788
12794
|
}
|
|
12789
12795
|
isValidPointIndex(e) {
|
|
12790
12796
|
return Number.isInteger(e) && e >= 0 && e < this.points.length;
|
|
@@ -12845,7 +12851,7 @@ class Wl {
|
|
|
12845
12851
|
return { x: e.x, y: e.y, z: e.z, w: e.w };
|
|
12846
12852
|
}
|
|
12847
12853
|
}
|
|
12848
|
-
class
|
|
12854
|
+
class ql {
|
|
12849
12855
|
engine;
|
|
12850
12856
|
miniMapCamera = null;
|
|
12851
12857
|
miniMapRenderer = null;
|
|
@@ -13247,7 +13253,7 @@ class Gl {
|
|
|
13247
13253
|
p.rotateYaw(-c);
|
|
13248
13254
|
return;
|
|
13249
13255
|
}
|
|
13250
|
-
const g = i.getWorldDirection(new d()).multiplyScalar(h), y = new
|
|
13256
|
+
const g = i.getWorldDirection(new d()).multiplyScalar(h), y = new ho().setFromVector3(g);
|
|
13251
13257
|
y.theta -= c, g.setFromSpherical(y), n.target?.copy(i.position).add(g), n.update?.(), this.engine.controlModule?.firstPersonControls?.syncRotationStateFromCamera?.();
|
|
13252
13258
|
}
|
|
13253
13259
|
drawOverlay() {
|
|
@@ -13306,7 +13312,7 @@ class Gl {
|
|
|
13306
13312
|
this.miniMapContainer && (this.miniMapContainer.removeEventListener("wheel", this.onWheel), this.miniMapContainer.removeEventListener("mousedown", this.onMouseDown), this.miniMapContainer.removeEventListener("mousemove", this.onMouseMove), this.miniMapContainer.removeEventListener("mouseup", this.onMouseUp), this.miniMapContainer.removeEventListener("pointerdown", this.onMouseDown), this.miniMapContainer.removeEventListener("pointermove", this.onMouseMove), this.miniMapContainer.removeEventListener("pointerup", this.onMouseUp), this.miniMapContainer.removeEventListener("pointercancel", this.onMouseUp), this.miniMapContainer.removeEventListener("mouseenter", this.onMouseEnter), this.miniMapContainer.removeEventListener("mouseleave", this.onMouseLeave)), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("pointermove", this.onMouseMove), window.removeEventListener("pointerup", this.onMouseUp), window.removeEventListener("pointercancel", this.onMouseUp), window.removeEventListener("resize", this.onWindowResize), this.sizeToggleButton?.removeEventListener("click", this.onSizeToggleClick), this.resizeHandle?.removeEventListener("mousedown", this.onResizeHandleMouseDown), this.resizeHandle?.removeEventListener("pointerdown", this.onResizeHandleMouseDown), this.modelSelect?.removeEventListener("change", this.onModelChange), this.levelSelect?.removeEventListener("change", this.onLevelChange), this.engine.events?.off?.(this.loadingCompletedEventName, this.onLoadingCompleted), this.miniMapRenderer && (this.miniMapRenderer.dispose(), this.miniMapRenderer = null), this.miniMapContainer && (this.miniMapContainer.remove(), this.miniMapContainer = null), this.miniMapCamera = null, this.overlayCtx = null, this.overlayCanvas = null, this.levelToolbar = null, this.sizeToggleButton = null, this.resizeHandle = null, this.modelSelect = null, this.levelSelect = null, this.levelModels = [], this.levelDataSignature = "", this.selectedModelUrl = null;
|
|
13307
13313
|
}
|
|
13308
13314
|
}
|
|
13309
|
-
class
|
|
13315
|
+
class Kl {
|
|
13310
13316
|
engine;
|
|
13311
13317
|
constructor(e) {
|
|
13312
13318
|
this.engine = e;
|
|
@@ -13603,26 +13609,26 @@ class ql {
|
|
|
13603
13609
|
return Math.abs(s.dot(e)) < 0.999 ? s : new d(1, 0, 0);
|
|
13604
13610
|
}
|
|
13605
13611
|
}
|
|
13606
|
-
class
|
|
13612
|
+
class jl {
|
|
13607
13613
|
engine;
|
|
13608
13614
|
constructor(e) {
|
|
13609
13615
|
}
|
|
13610
13616
|
update() {
|
|
13611
13617
|
}
|
|
13612
13618
|
}
|
|
13613
|
-
const
|
|
13614
|
-
class
|
|
13619
|
+
const kn = "bim-engine:link-element-2d3d-state", Ln = "link-element-2d3d";
|
|
13620
|
+
class Yl {
|
|
13615
13621
|
engine;
|
|
13616
13622
|
constructor(e) {
|
|
13617
13623
|
this.engine = e, this.active();
|
|
13618
13624
|
}
|
|
13619
13625
|
// 激活
|
|
13620
13626
|
active() {
|
|
13621
|
-
window.addEventListener("D2ElementClick", this.listenElementClick), window.addEventListener(
|
|
13627
|
+
window.addEventListener("D2ElementClick", this.listenElementClick), window.addEventListener(kn, this.listenLinkStateChange);
|
|
13622
13628
|
}
|
|
13623
13629
|
// 取消
|
|
13624
13630
|
disActive() {
|
|
13625
|
-
window.removeEventListener("D2ElementClick", this.listenElementClick), window.removeEventListener(
|
|
13631
|
+
window.removeEventListener("D2ElementClick", this.listenElementClick), window.removeEventListener(kn, this.listenLinkStateChange), this.engine?.setIdleFrameRateExempt?.(Ln, !1);
|
|
13626
13632
|
}
|
|
13627
13633
|
dispose() {
|
|
13628
13634
|
this.disActive();
|
|
@@ -13642,10 +13648,10 @@ class jl {
|
|
|
13642
13648
|
/** 二三维模型联动开启时保持 3D 引擎全帧渲染,避免等待空闲限帧间隔。 */
|
|
13643
13649
|
listenLinkStateChange = (e) => {
|
|
13644
13650
|
const t = e.detail?.enabled === !0;
|
|
13645
|
-
this.engine?.setIdleFrameRateExempt?.(
|
|
13651
|
+
this.engine?.setIdleFrameRateExempt?.(Ln, t);
|
|
13646
13652
|
};
|
|
13647
13653
|
}
|
|
13648
|
-
class
|
|
13654
|
+
class Xl {
|
|
13649
13655
|
engine;
|
|
13650
13656
|
constructor(e) {
|
|
13651
13657
|
this.engine = e, this.active();
|
|
@@ -13699,7 +13705,7 @@ const ht = {
|
|
|
13699
13705
|
EncodingComplete: "encoding-complete",
|
|
13700
13706
|
EncodingError: "encoding-error"
|
|
13701
13707
|
};
|
|
13702
|
-
class
|
|
13708
|
+
class Ql {
|
|
13703
13709
|
engine;
|
|
13704
13710
|
apiKey;
|
|
13705
13711
|
baseURL = "https://api.deepseek.com";
|
|
@@ -13887,12 +13893,12 @@ class Xl {
|
|
|
13887
13893
|
}
|
|
13888
13894
|
}
|
|
13889
13895
|
}
|
|
13890
|
-
const fi = 1 / 0.3048,
|
|
13896
|
+
const fi = 1 / 0.3048, $l = 1, Zl = 1.8, Bn = /* @__PURE__ */ new Set([
|
|
13891
13897
|
"dynamic-elevation-bar-area",
|
|
13892
13898
|
"dynamic-elevation-guest-area",
|
|
13893
13899
|
"dynamic-elevation-door-head-area"
|
|
13894
|
-
]),
|
|
13895
|
-
class
|
|
13900
|
+
]), Jl = ["台面"], ec = ["咖啡机"], tc = ["门店编号"], ic = ["发光logo", "发光Logo"];
|
|
13901
|
+
class nc {
|
|
13896
13902
|
engine;
|
|
13897
13903
|
constructor(e) {
|
|
13898
13904
|
this.engine = e;
|
|
@@ -13906,10 +13912,10 @@ class ic {
|
|
|
13906
13912
|
return null;
|
|
13907
13913
|
const t = e.views ?? {}, i = (t.Elevations ?? []).filter((o) => {
|
|
13908
13914
|
const r = o?.Id ?? o?.id;
|
|
13909
|
-
return !
|
|
13915
|
+
return !Bn.has(String(r ?? ""));
|
|
13910
13916
|
}), n = (t.DynamicViews ?? []).filter((o) => {
|
|
13911
13917
|
const r = o?.Id ?? o?.id, l = String(r ?? "");
|
|
13912
|
-
return !
|
|
13918
|
+
return !Bn.has(l) && !l.startsWith("dynamic-elevation-door-head-area");
|
|
13913
13919
|
}), s = this.generate(e);
|
|
13914
13920
|
return e.views = {
|
|
13915
13921
|
...t,
|
|
@@ -13926,7 +13932,7 @@ class ic {
|
|
|
13926
13932
|
generate(e) {
|
|
13927
13933
|
if (!(e?.nodesMap instanceof Map) || e.nodesMap.size === 0)
|
|
13928
13934
|
return [];
|
|
13929
|
-
const t = this.collectMergedWorldBoxByKeywords(e,
|
|
13935
|
+
const t = this.collectMergedWorldBoxByKeywords(e, Jl), i = this.collectMergedWorldBoxByKeywords(e, ec), n = this.collectMergedWorldBoxByKeywords(e, tc), s = this.collectWorldBoxesByKeywords(e, ic), o = [];
|
|
13930
13936
|
if (t && i && n) {
|
|
13931
13937
|
const r = this.createBarAreaView(t, i, n), l = this.createGuestAreaView(t, i, n);
|
|
13932
13938
|
r && o.push(r), l && o.push(l);
|
|
@@ -14017,8 +14023,8 @@ class ic {
|
|
|
14017
14023
|
* 相机始终在观察面外侧偏移固定距离,且高度统一锁定为 1.8 米。
|
|
14018
14024
|
*/
|
|
14019
14025
|
createCameraPosition(e, t) {
|
|
14020
|
-
const i = e.clone().add(t.clone().multiplyScalar(
|
|
14021
|
-
return i.y =
|
|
14026
|
+
const i = e.clone().add(t.clone().multiplyScalar($l));
|
|
14027
|
+
return i.y = Zl, i;
|
|
14022
14028
|
}
|
|
14023
14029
|
/**
|
|
14024
14030
|
* 将 three.js 空间中的观察参数转换成运行时立面视图结构。
|
|
@@ -14193,8 +14199,8 @@ class ic {
|
|
|
14193
14199
|
};
|
|
14194
14200
|
}
|
|
14195
14201
|
}
|
|
14196
|
-
const
|
|
14197
|
-
function
|
|
14202
|
+
const zn = 16, Rn = 0.02, yi = 1e-6, sc = 600;
|
|
14203
|
+
function zs() {
|
|
14198
14204
|
return {
|
|
14199
14205
|
ceilingPlans: [],
|
|
14200
14206
|
elevations: [],
|
|
@@ -14203,14 +14209,14 @@ function Bs() {
|
|
|
14203
14209
|
sections: []
|
|
14204
14210
|
};
|
|
14205
14211
|
}
|
|
14206
|
-
function
|
|
14212
|
+
function Rs(a, e) {
|
|
14207
14213
|
return {
|
|
14208
14214
|
id: a.Id ?? a.id,
|
|
14209
14215
|
name: a.Name ?? a.name,
|
|
14210
14216
|
url: e
|
|
14211
14217
|
};
|
|
14212
14218
|
}
|
|
14213
|
-
class
|
|
14219
|
+
class oc {
|
|
14214
14220
|
engine;
|
|
14215
14221
|
resolveViewTree;
|
|
14216
14222
|
openView;
|
|
@@ -14220,7 +14226,7 @@ class sc {
|
|
|
14220
14226
|
}
|
|
14221
14227
|
/** 获取构件可见的动态视图,并可选择直接打开第一个匹配项。 */
|
|
14222
14228
|
getElementVisibleViews(e, t, i = !1) {
|
|
14223
|
-
const n =
|
|
14229
|
+
const n = zs(), s = this.engine.models.find((p) => p.url === e);
|
|
14224
14230
|
if (!s)
|
|
14225
14231
|
return n;
|
|
14226
14232
|
const o = this.findModelNode(s, t), r = this.getNodeWorldBox(s, o), l = this.resolveViewTree(e);
|
|
@@ -14233,7 +14239,7 @@ class sc {
|
|
|
14233
14239
|
h = p.length > 0 ? p : [this.getNearestCameraCandidate(c, r)];
|
|
14234
14240
|
}
|
|
14235
14241
|
h.forEach((p) => {
|
|
14236
|
-
n.dynamicViews.push(
|
|
14242
|
+
n.dynamicViews.push(Rs(p.view, e));
|
|
14237
14243
|
});
|
|
14238
14244
|
const u = n.dynamicViews[0];
|
|
14239
14245
|
return i && u ? this.openView(u.url, u.id, () => {
|
|
@@ -14293,14 +14299,14 @@ class sc {
|
|
|
14293
14299
|
t.projectionMatrix,
|
|
14294
14300
|
t.matrixWorldInverse
|
|
14295
14301
|
);
|
|
14296
|
-
if (new
|
|
14302
|
+
if (new uo().setFromProjectionMatrix(i).intersectsBox(e))
|
|
14297
14303
|
return;
|
|
14298
14304
|
const s = e.getCenter(new d()), o = this.engine.cameraModule?.rotateToTarget;
|
|
14299
14305
|
if (typeof o == "function") {
|
|
14300
14306
|
o.call(
|
|
14301
14307
|
this.engine.cameraModule,
|
|
14302
14308
|
s,
|
|
14303
|
-
|
|
14309
|
+
sc,
|
|
14304
14310
|
() => this.syncControlRotationState()
|
|
14305
14311
|
);
|
|
14306
14312
|
return;
|
|
@@ -14323,13 +14329,13 @@ class sc {
|
|
|
14323
14329
|
*/
|
|
14324
14330
|
createElementSamplePoints(e, t, i, n) {
|
|
14325
14331
|
const s = this.collectSampleSources(e, t), o = [];
|
|
14326
|
-
for (let r = 0; r <
|
|
14332
|
+
for (let r = 0; r < zn && s.length > 0; r++) {
|
|
14327
14333
|
const l = s[r % s.length], c = this.sampleGeometrySurface(l, n);
|
|
14328
14334
|
c && o.push(c);
|
|
14329
14335
|
}
|
|
14330
14336
|
if (o.length > 0)
|
|
14331
14337
|
return o;
|
|
14332
|
-
for (o.push(i.getCenter(new d())); o.length <
|
|
14338
|
+
for (o.push(i.getCenter(new d())); o.length < zn; )
|
|
14333
14339
|
o.push(new d(
|
|
14334
14340
|
F.lerp(i.min.x, i.max.x, n()),
|
|
14335
14341
|
F.lerp(i.min.y, i.max.y, n()),
|
|
@@ -14376,9 +14382,9 @@ class sc {
|
|
|
14376
14382
|
if (typeof s != "function")
|
|
14377
14383
|
return !1;
|
|
14378
14384
|
const o = t.clone().sub(e), r = o.length();
|
|
14379
|
-
if (r <=
|
|
14385
|
+
if (r <= Rn)
|
|
14380
14386
|
return !0;
|
|
14381
|
-
this.raycaster.near = 0, this.raycaster.far = r +
|
|
14387
|
+
this.raycaster.near = 0, this.raycaster.far = r + Rn, this.raycaster.set(e, o.normalize());
|
|
14382
14388
|
const c = (s.call(
|
|
14383
14389
|
this.engine.octreeBox,
|
|
14384
14390
|
this.raycaster,
|
|
@@ -14423,12 +14429,12 @@ const Ut = {
|
|
|
14423
14429
|
floorPlan: "楼层平面",
|
|
14424
14430
|
elevation: "立面视图",
|
|
14425
14431
|
section: "剖面视图"
|
|
14426
|
-
},
|
|
14432
|
+
}, rc = {
|
|
14427
14433
|
ceilingPlan: [Ut.ceilingPlan, "天花"],
|
|
14428
14434
|
floorPlan: [Ut.floorPlan, "楼层"],
|
|
14429
14435
|
elevation: [Ut.elevation, "立面"],
|
|
14430
14436
|
section: [Ut.section, "剖面"]
|
|
14431
|
-
},
|
|
14437
|
+
}, ac = [
|
|
14432
14438
|
["CeilingPlans", "ceilingPlans"],
|
|
14433
14439
|
["Elevations", "elevations"],
|
|
14434
14440
|
["DynamicViews", "dynamicViews"],
|
|
@@ -14442,7 +14448,7 @@ class Ki {
|
|
|
14442
14448
|
dynamicViewVisibility;
|
|
14443
14449
|
/** 管理模型原生视图与运行时动态视图的统一入口。 */
|
|
14444
14450
|
constructor(e) {
|
|
14445
|
-
this.engine = e, this.dynamicElevationViewGenerator = new
|
|
14451
|
+
this.engine = e, this.dynamicElevationViewGenerator = new nc(e), this.dynamicViewVisibility = new oc(
|
|
14446
14452
|
e,
|
|
14447
14453
|
(t) => this.getResolvedViewTree(t),
|
|
14448
14454
|
(t, i, n) => this.openViewInternal(t, i, n)
|
|
@@ -14461,10 +14467,10 @@ class Ki {
|
|
|
14461
14467
|
}
|
|
14462
14468
|
/** 获取单个模型的视图树数据,并补充运行时生成的动态视图分类。 */
|
|
14463
14469
|
getViewTreeData(e) {
|
|
14464
|
-
const t = this.getResolvedViewTree(e), i =
|
|
14465
|
-
return t &&
|
|
14470
|
+
const t = this.getResolvedViewTree(e), i = zs();
|
|
14471
|
+
return t && ac.forEach(([n, s]) => {
|
|
14466
14472
|
(t[n] ?? []).forEach((o) => {
|
|
14467
|
-
i[s].push(
|
|
14473
|
+
i[s].push(Rs(o, e));
|
|
14468
14474
|
});
|
|
14469
14475
|
}), i;
|
|
14470
14476
|
}
|
|
@@ -14577,7 +14583,7 @@ class Ki {
|
|
|
14577
14583
|
const t = String(e ?? "").replace(/\s+/g, "");
|
|
14578
14584
|
if (!t)
|
|
14579
14585
|
return "unknown";
|
|
14580
|
-
const i = Object.entries(
|
|
14586
|
+
const i = Object.entries(rc);
|
|
14581
14587
|
for (const [n, s] of i)
|
|
14582
14588
|
if (s.some((o) => t.includes(o)))
|
|
14583
14589
|
return n;
|
|
@@ -14614,7 +14620,7 @@ class Ki {
|
|
|
14614
14620
|
!t || t.isEmpty?.() || this.engine.viewCube?.zoomToModel?.(t, e);
|
|
14615
14621
|
}
|
|
14616
14622
|
}
|
|
14617
|
-
class
|
|
14623
|
+
class lc {
|
|
14618
14624
|
constructor(e) {
|
|
14619
14625
|
}
|
|
14620
14626
|
/** 3D 独立包不支持加载 2D 视图。 */
|
|
@@ -14625,16 +14631,16 @@ class ac {
|
|
|
14625
14631
|
removeSectionPlane() {
|
|
14626
14632
|
}
|
|
14627
14633
|
}
|
|
14628
|
-
function
|
|
14634
|
+
function cc(a, e, t = "bim-snapshot.png") {
|
|
14629
14635
|
const i = a?.renderer, n = i?.domElement;
|
|
14630
14636
|
if (!i || !n || !e)
|
|
14631
14637
|
return null;
|
|
14632
14638
|
const s = n.width || n.clientWidth, o = n.height || n.clientHeight;
|
|
14633
14639
|
if (s <= 0 || o <= 0)
|
|
14634
14640
|
return null;
|
|
14635
|
-
let r =
|
|
14636
|
-
if (!
|
|
14637
|
-
const p =
|
|
14641
|
+
let r = hc(n, s, o);
|
|
14642
|
+
if (!dc(r)) {
|
|
14643
|
+
const p = uc(a, s, o);
|
|
14638
14644
|
p && (r = p);
|
|
14639
14645
|
}
|
|
14640
14646
|
const l = document.createElement("canvas");
|
|
@@ -14646,13 +14652,13 @@ function lc(a, e, t = "bim-snapshot.png") {
|
|
|
14646
14652
|
const h = l.toDataURL("image/png"), u = document.createElement("a");
|
|
14647
14653
|
return u.href = h, u.download = t.toLowerCase().endsWith(".png") ? t : `${t}.png`, u.click(), h;
|
|
14648
14654
|
}
|
|
14649
|
-
function
|
|
14655
|
+
function hc(a, e, t) {
|
|
14650
14656
|
const i = document.createElement("canvas");
|
|
14651
14657
|
i.width = e, i.height = t;
|
|
14652
14658
|
const n = i.getContext("2d");
|
|
14653
14659
|
return n && n.drawImage(a, 0, 0, e, t), i;
|
|
14654
14660
|
}
|
|
14655
|
-
function
|
|
14661
|
+
function dc(a) {
|
|
14656
14662
|
const e = a.getContext("2d");
|
|
14657
14663
|
if (!e || a.width <= 0 || a.height <= 0)
|
|
14658
14664
|
return !1;
|
|
@@ -14665,28 +14671,28 @@ function hc(a) {
|
|
|
14665
14671
|
}
|
|
14666
14672
|
return !1;
|
|
14667
14673
|
}
|
|
14668
|
-
function
|
|
14674
|
+
function uc(a, e, t) {
|
|
14669
14675
|
const i = a?.renderer, n = a?.scene, s = a?.camera;
|
|
14670
14676
|
if (!i || !n || !s)
|
|
14671
14677
|
return null;
|
|
14672
|
-
const o = new
|
|
14678
|
+
const o = new Kn(e, t, {
|
|
14673
14679
|
minFilter: Qt,
|
|
14674
14680
|
magFilter: Qt,
|
|
14675
|
-
format:
|
|
14681
|
+
format: jn,
|
|
14676
14682
|
depthBuffer: !0,
|
|
14677
14683
|
stencilBuffer: !0
|
|
14678
14684
|
}), r = i.getRenderTarget(), l = i.autoClear, c = i.xr?.enabled ?? !1;
|
|
14679
14685
|
try {
|
|
14680
14686
|
i.xr && (i.xr.enabled = !1), i.autoClear = !0, i.setRenderTarget(o), i.clear(!0, !0, !0), i.render(n, s);
|
|
14681
14687
|
const h = new Uint8Array(e * t * 4);
|
|
14682
|
-
return i.readRenderTargetPixels(o, 0, 0, e, t, h),
|
|
14688
|
+
return i.readRenderTargetPixels(o, 0, 0, e, t, h), pc(h, e, t);
|
|
14683
14689
|
} catch {
|
|
14684
14690
|
return null;
|
|
14685
14691
|
} finally {
|
|
14686
14692
|
i.setRenderTarget(r), i.autoClear = l, i.xr && (i.xr.enabled = c), o.dispose();
|
|
14687
14693
|
}
|
|
14688
14694
|
}
|
|
14689
|
-
function
|
|
14695
|
+
function pc(a, e, t) {
|
|
14690
14696
|
const i = document.createElement("canvas");
|
|
14691
14697
|
i.width = e, i.height = t;
|
|
14692
14698
|
const n = i.getContext("2d");
|
|
@@ -14700,7 +14706,7 @@ function uc(a, e, t) {
|
|
|
14700
14706
|
}
|
|
14701
14707
|
return n.putImageData(s, 0, 0), i;
|
|
14702
14708
|
}
|
|
14703
|
-
const
|
|
14709
|
+
const mc = [
|
|
14704
14710
|
"#ffffff",
|
|
14705
14711
|
"#000000",
|
|
14706
14712
|
"#ff4d4f",
|
|
@@ -14711,7 +14717,7 @@ const pc = [
|
|
|
14711
14717
|
"#1677ff",
|
|
14712
14718
|
"#722ed1",
|
|
14713
14719
|
"#eb2f96"
|
|
14714
|
-
],
|
|
14720
|
+
], gc = {
|
|
14715
14721
|
none: ee("/assets/icon/选择.svg", import.meta.url),
|
|
14716
14722
|
line: ee("/assets/icon/线.svg", import.meta.url),
|
|
14717
14723
|
arrow: ee("/assets/icon/箭头.svg", import.meta.url),
|
|
@@ -14719,7 +14725,7 @@ const pc = [
|
|
|
14719
14725
|
circle: ee("/assets/icon/圆形.svg", import.meta.url),
|
|
14720
14726
|
text: ee("/assets/icon/文字.svg", import.meta.url),
|
|
14721
14727
|
cloudline: ee("/assets/icon/云线.svg", import.meta.url)
|
|
14722
|
-
},
|
|
14728
|
+
}, fc = ee("/assets/icon/测距.svg", import.meta.url), yc = ee("/assets/icon/截图.svg", import.meta.url), Mc = ee("/assets/icon/线宽.svg", import.meta.url), vc = ee("/assets/icon/字号.svg", import.meta.url), xc = `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>')}`, wc = [
|
|
14723
14729
|
{ type: "distance", label: "距离" },
|
|
14724
14730
|
{ type: "clearDistance", label: "净距" },
|
|
14725
14731
|
{ type: "clearHeight", label: "净高" },
|
|
@@ -14728,7 +14734,7 @@ const pc = [
|
|
|
14728
14734
|
{ type: "angle", label: "角度" },
|
|
14729
14735
|
{ type: "area", label: "面积" },
|
|
14730
14736
|
{ type: "slope", label: "坡度" }
|
|
14731
|
-
],
|
|
14737
|
+
], bc = {
|
|
14732
14738
|
distance: ee("/assets/icon/距离.svg", import.meta.url),
|
|
14733
14739
|
clearDistance: ee("/assets/icon/净距.svg", import.meta.url),
|
|
14734
14740
|
clearHeight: ee("/assets/icon/净高.svg", import.meta.url),
|
|
@@ -14738,7 +14744,7 @@ const pc = [
|
|
|
14738
14744
|
area: ee("/assets/icon/面积.svg", import.meta.url),
|
|
14739
14745
|
slope: ee("/assets/icon/坡度.svg", import.meta.url)
|
|
14740
14746
|
};
|
|
14741
|
-
class
|
|
14747
|
+
class Cc {
|
|
14742
14748
|
constructor(e, t) {
|
|
14743
14749
|
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";
|
|
14744
14750
|
const i = document.createElement("div");
|
|
@@ -14751,7 +14757,7 @@ class bc {
|
|
|
14751
14757
|
{ type: "text", label: "文字" },
|
|
14752
14758
|
{ type: "cloudline", label: "云线" }
|
|
14753
14759
|
].forEach((y) => {
|
|
14754
|
-
const M = this.createIconButton(y.label,
|
|
14760
|
+
const M = this.createIconButton(y.label, gc[y.type]);
|
|
14755
14761
|
M.onclick = () => this.handlers.onDrawTypeChange(y.type), this.drawButtons[y.type] = M, i.appendChild(M);
|
|
14756
14762
|
});
|
|
14757
14763
|
const s = document.createElement("div");
|
|
@@ -14761,23 +14767,23 @@ class bc {
|
|
|
14761
14767
|
this.updateColorControl(this.colorInput.value), this.handlers.onColorChange(this.colorInput.value), this.setColorPresetVisible(!1);
|
|
14762
14768
|
}, 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";
|
|
14763
14769
|
const r = document.createElement("div");
|
|
14764
|
-
r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px",
|
|
14770
|
+
r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px", mc.forEach((y) => {
|
|
14765
14771
|
const M = document.createElement("button");
|
|
14766
14772
|
M.type = "button", M.title = y, M.style.width = "22px", M.style.height = "22px", M.style.padding = "0", M.style.border = "1px solid #d9d9d9", M.style.borderRadius = "4px", M.style.background = y, M.style.cursor = "pointer", M.onclick = () => {
|
|
14767
14773
|
this.updateColorControl(y), this.handlers.onColorChange(y), this.setColorPresetVisible(!1);
|
|
14768
14774
|
}, r.appendChild(M);
|
|
14769
14775
|
}), this.colorPresetPanel.appendChild(r);
|
|
14770
14776
|
const l = document.createElement("button");
|
|
14771
|
-
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,
|
|
14772
|
-
const c = this.createIconButton("截图",
|
|
14777
|
+
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, Mc, "线宽")), 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, vc, "字号")), this.distanceButton = this.createIconButton("测量", fc), this.distanceButton.onclick = () => this.handlers.onMeasureToggle(), i.appendChild(this.distanceButton);
|
|
14778
|
+
const c = this.createIconButton("截图", yc);
|
|
14773
14779
|
c.onclick = () => this.handlers.onScreenshot(), i.appendChild(c);
|
|
14774
|
-
const h = this.createIconButton("捕捉点",
|
|
14780
|
+
const h = this.createIconButton("捕捉点", xc);
|
|
14775
14781
|
h.onclick = () => this.handlers.onPickPoint(), i.appendChild(h);
|
|
14776
14782
|
const u = this.createTextButton("×", "取消");
|
|
14777
14783
|
u.onclick = () => this.handlers.onCancel(), u.style.background = "#ff4d4f", u.style.borderColor = "#ff4d4f", u.style.color = "#ffffff", i.appendChild(u);
|
|
14778
14784
|
const p = this.createTextButton("✔", "确定");
|
|
14779
|
-
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",
|
|
14780
|
-
const M = this.createSmallIconButton(y.label,
|
|
14785
|
+
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", wc.forEach((y) => {
|
|
14786
|
+
const M = this.createSmallIconButton(y.label, bc[y.type]);
|
|
14781
14787
|
M.onclick = () => this.handlers.onMeasureTypeChange(y.type), this.measureTypeButtons[y.type] = M, this.measureSubPanel.appendChild(M);
|
|
14782
14788
|
}), this.editPanel.appendChild(i), this.editPanel.appendChild(this.measureSubPanel);
|
|
14783
14789
|
const g = this.createTextButton("关闭", "关闭");
|
|
@@ -14902,7 +14908,7 @@ class bc {
|
|
|
14902
14908
|
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;
|
|
14903
14909
|
}
|
|
14904
14910
|
}
|
|
14905
|
-
class
|
|
14911
|
+
class Ec {
|
|
14906
14912
|
engine;
|
|
14907
14913
|
wrapper;
|
|
14908
14914
|
canvasEl;
|
|
@@ -14941,7 +14947,7 @@ class Cc {
|
|
|
14941
14947
|
const t = this.engine.container;
|
|
14942
14948
|
if (!t)
|
|
14943
14949
|
throw new Error("FabricDraw: engine container not found.");
|
|
14944
|
-
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
|
|
14950
|
+
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 Cc({
|
|
14945
14951
|
onDrawTypeChange: (n) => this.setDrawType(n),
|
|
14946
14952
|
onMeasureToggle: () => this.toggleMeasurePanel(),
|
|
14947
14953
|
onMeasureTypeChange: (n) => this.activateDistanceMeasure(n),
|
|
@@ -14967,7 +14973,7 @@ class Cc {
|
|
|
14967
14973
|
fontSize: this.drawStyle.fontSize
|
|
14968
14974
|
}), this.toolbar.mount(this.wrapper);
|
|
14969
14975
|
const i = this.engine.renderer?.domElement;
|
|
14970
|
-
i?.nextSibling ? t.insertBefore(this.wrapper, i.nextSibling) : t.appendChild(this.wrapper), this.canvas = new
|
|
14976
|
+
i?.nextSibling ? t.insertBefore(this.wrapper, i.nextSibling) : t.appendChild(this.wrapper), this.canvas = new Ro(this.canvasEl, {
|
|
14971
14977
|
selection: !0,
|
|
14972
14978
|
preserveObjectStacking: !0
|
|
14973
14979
|
}), 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();
|
|
@@ -15053,7 +15059,7 @@ class Cc {
|
|
|
15053
15059
|
/**
|
|
15054
15060
|
* 鐩存帴缁樺埗鏂囧瓧銆? */
|
|
15055
15061
|
drawText(e, t, i) {
|
|
15056
|
-
const n = this.mergeStyle(i), s = new
|
|
15062
|
+
const n = this.mergeStyle(i), s = new Oo(t ?? n.text, {
|
|
15057
15063
|
left: e.x,
|
|
15058
15064
|
top: e.y,
|
|
15059
15065
|
...this.createTextStyle(n),
|
|
@@ -15090,7 +15096,7 @@ class Cc {
|
|
|
15090
15096
|
* 鎴浘淇濆瓨锛堟ā鍨?Fabric鎵规敞鍚堟垚锛夈€? */
|
|
15091
15097
|
saveScreenshot(e = "bim-snapshot.png") {
|
|
15092
15098
|
const t = this.canvas.lowerCanvasEl;
|
|
15093
|
-
return t ?
|
|
15099
|
+
return t ? cc(this.engine, t, e) : null;
|
|
15094
15100
|
}
|
|
15095
15101
|
/**
|
|
15096
15102
|
* 鍚屾鐢诲竷灏哄銆? */
|
|
@@ -15258,7 +15264,7 @@ class Cc {
|
|
|
15258
15264
|
return s.annotationType = "line", s;
|
|
15259
15265
|
}
|
|
15260
15266
|
createRectObject(e, t, i, n) {
|
|
15261
|
-
const s = this.getBoxFromPoints(e, t), o = new
|
|
15267
|
+
const s = this.getBoxFromPoints(e, t), o = new Fo({
|
|
15262
15268
|
...this.createObjectBase(i, n),
|
|
15263
15269
|
left: s.left,
|
|
15264
15270
|
top: s.top,
|
|
@@ -15270,7 +15276,7 @@ class Cc {
|
|
|
15270
15276
|
return o.annotationType = "rect", o;
|
|
15271
15277
|
}
|
|
15272
15278
|
createCircleObject(e, t, i, n) {
|
|
15273
|
-
const s = this.getCircleFromPoints(e, t), o = new
|
|
15279
|
+
const s = this.getCircleFromPoints(e, t), o = new No({
|
|
15274
15280
|
...this.createObjectBase(i, n),
|
|
15275
15281
|
left: s.left,
|
|
15276
15282
|
top: s.top,
|
|
@@ -15574,7 +15580,7 @@ class Cc {
|
|
|
15574
15580
|
return JSON.parse(JSON.stringify(e));
|
|
15575
15581
|
}
|
|
15576
15582
|
}
|
|
15577
|
-
class
|
|
15583
|
+
class Ac {
|
|
15578
15584
|
engine;
|
|
15579
15585
|
capturePoint = null;
|
|
15580
15586
|
labelPrefix = "drawing-pin-label-";
|
|
@@ -16024,7 +16030,7 @@ class Ec {
|
|
|
16024
16030
|
return e;
|
|
16025
16031
|
}
|
|
16026
16032
|
}
|
|
16027
|
-
const Mi = "bim-engine:model-link-3d",
|
|
16033
|
+
const Mi = "bim-engine:model-link-3d", Sc = "default-model-link-3d-group", On = "model-link-3d", Fn = {
|
|
16028
16034
|
enabled: !1,
|
|
16029
16035
|
highlight: !0,
|
|
16030
16036
|
visibility: !0,
|
|
@@ -16033,7 +16039,7 @@ const Mi = "bim-engine:model-link-3d", Ac = "default-model-link-3d-group", Rn =
|
|
|
16033
16039
|
cameraMode: "onStop",
|
|
16034
16040
|
cameraThrottleMs: 50
|
|
16035
16041
|
};
|
|
16036
|
-
class
|
|
16042
|
+
class Pc {
|
|
16037
16043
|
viewerGuid;
|
|
16038
16044
|
engine;
|
|
16039
16045
|
options;
|
|
@@ -16091,20 +16097,20 @@ class Sc {
|
|
|
16091
16097
|
return this.applyingLinkedEvent;
|
|
16092
16098
|
}
|
|
16093
16099
|
dispose() {
|
|
16094
|
-
this.disposed || (this.disposed = !0, typeof window < "u" && window.removeEventListener(Mi, 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?.(
|
|
16100
|
+
this.disposed || (this.disposed = !0, typeof window < "u" && window.removeEventListener(Mi, 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?.(On, !1), this.unbindCameraEvents(), this.restoreModelToolMethods());
|
|
16095
16101
|
}
|
|
16096
16102
|
normalizeOptions(e) {
|
|
16097
16103
|
return {
|
|
16098
|
-
...
|
|
16104
|
+
...Fn,
|
|
16099
16105
|
...e,
|
|
16100
|
-
groupId: e.groupId ?? this.engine?.options?.linkGroupId ??
|
|
16106
|
+
groupId: e.groupId ?? this.engine?.options?.linkGroupId ?? Sc,
|
|
16101
16107
|
modelId: e.modelId ?? this.engine?.options?.modelLinkId
|
|
16102
16108
|
};
|
|
16103
16109
|
}
|
|
16104
16110
|
/** 模型联动开启后需要持续响应外部视图变化,不能进入空闲限帧。 */
|
|
16105
16111
|
syncIdleFrameRateExempt() {
|
|
16106
16112
|
this.engine?.setIdleFrameRateExempt?.(
|
|
16107
|
-
|
|
16113
|
+
On,
|
|
16108
16114
|
this.options.enabled === !0
|
|
16109
16115
|
);
|
|
16110
16116
|
}
|
|
@@ -16196,7 +16202,7 @@ class Sc {
|
|
|
16196
16202
|
return this.engine?.controlModule?.firstPersonControls?.enabled === !0 && this.engine?.movefirst === !0;
|
|
16197
16203
|
}
|
|
16198
16204
|
emitCameraThrottled() {
|
|
16199
|
-
const e = Date.now(), t = Math.max(0, (this.options.cameraThrottleMs ??
|
|
16205
|
+
const e = Date.now(), t = Math.max(0, (this.options.cameraThrottleMs ?? Fn.cameraThrottleMs) - (e - this.lastCameraEmitTime));
|
|
16200
16206
|
if (t === 0) {
|
|
16201
16207
|
this.emitCamera();
|
|
16202
16208
|
return;
|
|
@@ -16337,13 +16343,13 @@ class Sc {
|
|
|
16337
16343
|
}).filter((n) => n.ids.length > 0);
|
|
16338
16344
|
}
|
|
16339
16345
|
}
|
|
16340
|
-
class
|
|
16346
|
+
class Tc {
|
|
16341
16347
|
engine;
|
|
16342
16348
|
manager;
|
|
16343
16349
|
worldToScreen;
|
|
16344
16350
|
raycaster = new me();
|
|
16345
16351
|
constructor(e) {
|
|
16346
|
-
this.engine = e, this.worldToScreen = new fe(e.camera, e.renderer, e.scene), this.manager = new
|
|
16352
|
+
this.engine = e, this.worldToScreen = new fe(e.camera, e.renderer, e.scene), this.manager = new ko({
|
|
16347
16353
|
container: e.container,
|
|
16348
16354
|
className: "bim-engine-label-container bim-engine-label-container-3d",
|
|
16349
16355
|
projectCoordinate: (t) => this.projectCoordinate(t),
|
|
@@ -16405,7 +16411,7 @@ class Pc {
|
|
|
16405
16411
|
return e = this.engine.clipping?.filterIntersectionsByClipping?.(e) ?? e, e.filter((i) => i?.point instanceof d).sort((i, n) => i.distance - n.distance)[0] ?? null;
|
|
16406
16412
|
}
|
|
16407
16413
|
}
|
|
16408
|
-
class
|
|
16414
|
+
class Ic {
|
|
16409
16415
|
/** 推进当前标记注册的材质与独立点动画。 */
|
|
16410
16416
|
updateRecord(e, t) {
|
|
16411
16417
|
const i = t + e.timeSeed;
|
|
@@ -16428,7 +16434,7 @@ class Tc {
|
|
|
16428
16434
|
});
|
|
16429
16435
|
}
|
|
16430
16436
|
}
|
|
16431
|
-
class
|
|
16437
|
+
class _c {
|
|
16432
16438
|
engine;
|
|
16433
16439
|
rootGroup;
|
|
16434
16440
|
records;
|
|
@@ -16735,7 +16741,7 @@ const Pe = {
|
|
|
16735
16741
|
showBottom: !1,
|
|
16736
16742
|
edgeColor: "#d9ffff"
|
|
16737
16743
|
}
|
|
16738
|
-
},
|
|
16744
|
+
}, Dc = {
|
|
16739
16745
|
background: "rgba(10, 18, 28, 0.92)",
|
|
16740
16746
|
color: "#ffffff",
|
|
16741
16747
|
border: "1px solid rgba(127, 252, 255, 0.72)",
|
|
@@ -16744,7 +16750,7 @@ const Pe = {
|
|
|
16744
16750
|
boxShadow: "0 10px 30px rgba(0, 0, 0, 0.32)",
|
|
16745
16751
|
minWidth: "120px",
|
|
16746
16752
|
pointerEvents: "auto"
|
|
16747
|
-
},
|
|
16753
|
+
}, kc = "bim-engine-annotation3d-panels";
|
|
16748
16754
|
function Yt(a) {
|
|
16749
16755
|
return a.map((e) => ({ x: e.x, y: e.y, z: e.z }));
|
|
16750
16756
|
}
|
|
@@ -16755,7 +16761,7 @@ function Wt(a) {
|
|
|
16755
16761
|
const e = new d();
|
|
16756
16762
|
return a.length === 0 ? e : (a.forEach((t) => e.add(J(t))), e.multiplyScalar(1 / a.length));
|
|
16757
16763
|
}
|
|
16758
|
-
function
|
|
16764
|
+
function Lc(a) {
|
|
16759
16765
|
const e = new d();
|
|
16760
16766
|
for (let t = 0; t < a.length; t += 1) {
|
|
16761
16767
|
const i = a[t], n = a[(t + 1) % a.length];
|
|
@@ -16763,9 +16769,9 @@ function kc(a) {
|
|
|
16763
16769
|
}
|
|
16764
16770
|
return e.normalize();
|
|
16765
16771
|
}
|
|
16766
|
-
function
|
|
16772
|
+
function Os(a) {
|
|
16767
16773
|
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);
|
|
16768
|
-
let n =
|
|
16774
|
+
let n = Lc(e);
|
|
16769
16775
|
n.lengthSq() < 1e-8 && (n = new d(0, 1, 0));
|
|
16770
16776
|
const s = new d().crossVectors(n, i).normalize(), o = new d().crossVectors(s, n).normalize(), r = e.map((c) => {
|
|
16771
16777
|
const h = c.clone().sub(t);
|
|
@@ -16773,8 +16779,8 @@ function Rs(a) {
|
|
|
16773
16779
|
}), l = new H().makeBasis(o, s, n).setPosition(t);
|
|
16774
16780
|
return { origin: t, normal: n, matrix: l, localPoints: r };
|
|
16775
16781
|
}
|
|
16776
|
-
function
|
|
16777
|
-
const e = new
|
|
16782
|
+
function Fs(a) {
|
|
16783
|
+
const e = new Yn();
|
|
16778
16784
|
return a.forEach((t, i) => {
|
|
16779
16785
|
if (i === 0) {
|
|
16780
16786
|
e.moveTo(t.x, t.y);
|
|
@@ -16783,12 +16789,12 @@ function Os(a) {
|
|
|
16783
16789
|
e.lineTo(t.x, t.y);
|
|
16784
16790
|
}), e.closePath(), e;
|
|
16785
16791
|
}
|
|
16786
|
-
function
|
|
16792
|
+
function Bc(a, e) {
|
|
16787
16793
|
a.traverse((t) => {
|
|
16788
16794
|
t.userData = t.userData ?? {}, t.userData.annotationId = e;
|
|
16789
16795
|
});
|
|
16790
16796
|
}
|
|
16791
|
-
function
|
|
16797
|
+
function zc(a) {
|
|
16792
16798
|
a.traverse((e) => {
|
|
16793
16799
|
const t = e;
|
|
16794
16800
|
t.geometry?.dispose?.();
|
|
@@ -16800,13 +16806,13 @@ function Bc(a) {
|
|
|
16800
16806
|
i?.dispose?.();
|
|
16801
16807
|
});
|
|
16802
16808
|
}
|
|
16803
|
-
function
|
|
16809
|
+
function Rc(a) {
|
|
16804
16810
|
return a.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
16805
16811
|
}
|
|
16806
|
-
function
|
|
16812
|
+
function Oc(a) {
|
|
16807
16813
|
return a === "polyline" || a === "curve3d" ? "center" : a === "polygon" ? "centroid" : "top";
|
|
16808
16814
|
}
|
|
16809
|
-
class
|
|
16815
|
+
class Fc {
|
|
16810
16816
|
render(e) {
|
|
16811
16817
|
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), M = t.textColor || e.instance.style.color || "#ffffff", x = t.fontWeight ?? 500, m = Math.max(Math.round((t.height ?? 8) * 12), 48), b = Math.max(Math.round(Math.abs(t.offsetX ?? t.armLength ?? 4) * 18), 56), C = this.getBoardWidth(e, g, y), S = Math.max(Math.round((t.boardHeight ?? 1.8) * 22), y + 18, 34), I = Math.max(Math.round((t.stemWidth ?? e.instance.style.lineWidth ?? 0.12) * 20), 2), P = t.borderWidth ?? 2.5, L = t.variant ?? "elbow", k = c === "right" ? 22 + b - 8 : 22 - b - C + 8, O = 8, K = Math.min(22, k) - 16, te = Math.max(22, k + C) + 16, Q = Math.max(te - K, 140), he = Math.max(m + S + 36, 120), le = 22 - K, ce = k - K, ye = he - 18, Se = Math.max(ye - m, 14), w = c === "right" ? ce : ce + C, f = O + Math.round(S * 0.5), E = L === "vertical" ? [`${le},${ye}`, `${le},${Se}`] : [`${le},${ye}`, `${le},${f}`, `${w},${f}`], _ = e.instance.selectable !== !1, D = _ ? "visiblePainted" : "none", T = _ ? "pointer" : "default", N = ce + (h || !g ? 38 : 12), G = t.showBoard === !1 ? "" : `
|
|
16812
16818
|
<rect x="${ce}" y="${O}" width="${C}" height="${S}" rx="10"
|
|
@@ -16860,7 +16866,7 @@ class Oc {
|
|
|
16860
16866
|
return Math.max(Math.round((n.boardWidth ?? 4.6) * 22), Math.ceil(r), 78);
|
|
16861
16867
|
}
|
|
16862
16868
|
}
|
|
16863
|
-
class
|
|
16869
|
+
class Nc {
|
|
16864
16870
|
/** 按标记类型重建内容,并返回相对三维锚点的布局参数。 */
|
|
16865
16871
|
render(e, t) {
|
|
16866
16872
|
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({
|
|
@@ -16933,10 +16939,10 @@ class Fc {
|
|
|
16933
16939
|
return `rgba(${r >> 16 & 255}, ${r >> 8 & 255}, ${r & 255}, ${i})`;
|
|
16934
16940
|
}
|
|
16935
16941
|
}
|
|
16936
|
-
const
|
|
16937
|
-
class
|
|
16942
|
+
const Hc = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]), Vc = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint", "ripplePoint", "pillarPoint", "leaderPoint"]);
|
|
16943
|
+
class Uc {
|
|
16938
16944
|
constructor(e, t) {
|
|
16939
|
-
this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className =
|
|
16945
|
+
this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className = kc, this.container.style.cssText = [
|
|
16940
16946
|
"position:absolute",
|
|
16941
16947
|
"left:0",
|
|
16942
16948
|
"top:0",
|
|
@@ -16949,8 +16955,8 @@ class Vc {
|
|
|
16949
16955
|
}
|
|
16950
16956
|
container;
|
|
16951
16957
|
worldToScreen;
|
|
16952
|
-
leaderMarker = new
|
|
16953
|
-
pointContentMarker = new
|
|
16958
|
+
leaderMarker = new Fc();
|
|
16959
|
+
pointContentMarker = new Nc();
|
|
16954
16960
|
updateProjectionState() {
|
|
16955
16961
|
this.worldToScreen.updateCamera(this.engine.camera), this.worldToScreen.updateRenderer(this.engine.renderer), this.worldToScreen.updateScene(this.engine.scene);
|
|
16956
16962
|
}
|
|
@@ -16963,7 +16969,7 @@ class Vc {
|
|
|
16963
16969
|
"transform:translate(-50%, -100%)",
|
|
16964
16970
|
"display:none",
|
|
16965
16971
|
t.interactive === !1 ? "pointer-events:none" : "pointer-events:auto"
|
|
16966
|
-
].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => i.style.setProperty(
|
|
16972
|
+
].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => i.style.setProperty(Rc(n), s)), i;
|
|
16967
16973
|
}
|
|
16968
16974
|
createLeaderMarkerElement(e) {
|
|
16969
16975
|
const t = document.createElement("div");
|
|
@@ -16975,7 +16981,7 @@ class Vc {
|
|
|
16975
16981
|
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;
|
|
16976
16982
|
}
|
|
16977
16983
|
updateRecord(e) {
|
|
16978
|
-
if (e.markerElement && e.instance.type === "leaderPoint" ? this.updateLeaderMarker(e) : e.markerElement &&
|
|
16984
|
+
if (e.markerElement && e.instance.type === "leaderPoint" ? this.updateLeaderMarker(e) : e.markerElement && Hc.has(e.instance.type) && this.updatePointMarker(e), !e.panelElement || !e.instance.panel)
|
|
16979
16985
|
return;
|
|
16980
16986
|
const t = e.instance.panel;
|
|
16981
16987
|
if (!(t.visible !== !1 && this.shouldShowPanel(e)) || !e.instance.visible) {
|
|
@@ -17034,9 +17040,9 @@ class Vc {
|
|
|
17034
17040
|
const t = e.instance.panel?.offset ?? {};
|
|
17035
17041
|
if (e.panelAnchorPoint)
|
|
17036
17042
|
return e.panelAnchorPoint.clone().add(new d(t.x ?? 0, t.y ?? 0, t.z ?? 0));
|
|
17037
|
-
const i = e.instance.panel?.anchor ??
|
|
17043
|
+
const i = e.instance.panel?.anchor ?? Oc(e.instance.type);
|
|
17038
17044
|
let n = new d();
|
|
17039
|
-
if (
|
|
17045
|
+
if (Vc.has(e.instance.type))
|
|
17040
17046
|
n.copy(J(e.instance.points[0])), i === "top" && (n.y += e.volumeHeight ?? 0);
|
|
17041
17047
|
else if (e.instance.type === "polyline" || e.instance.type === "curve3d")
|
|
17042
17048
|
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(Wt(e.instance.points));
|
|
@@ -17051,19 +17057,19 @@ class Vc {
|
|
|
17051
17057
|
return n.add(new d(t.x ?? 0, t.y ?? 0, t.z ?? 0)), n;
|
|
17052
17058
|
}
|
|
17053
17059
|
}
|
|
17054
|
-
class
|
|
17060
|
+
class Wc {
|
|
17055
17061
|
apply(e, t) {
|
|
17056
17062
|
e.instance.root.visible = e.instance.visible, e.instance.style.alwaysOnTop && e.instance.root.traverse((i) => {
|
|
17057
17063
|
i.renderOrder = Math.max(i.renderOrder, 1200);
|
|
17058
17064
|
}), t(e);
|
|
17059
17065
|
}
|
|
17060
17066
|
}
|
|
17061
|
-
class
|
|
17067
|
+
class Gc {
|
|
17062
17068
|
constructor(e) {
|
|
17063
17069
|
this.engine = e;
|
|
17064
17070
|
}
|
|
17065
17071
|
createSurfaceMaterial(e) {
|
|
17066
|
-
const t = e.style ?? {}, i = e.effect ?? {}, n = this.getGradientStops(e.color, i.gradient?.stops), s = i.gradient?.enabled === !0, o = i.glow?.enabled ? i.glow.intensity ?? 0.9 : 0, r = i.flow?.enabled === !0, l = i.pulse?.enabled === !0, c = i.scan?.enabled === !0, h = i.flow?.direction === "backward" ? -1 : 1, u = new
|
|
17072
|
+
const t = e.style ?? {}, i = e.effect ?? {}, n = this.getGradientStops(e.color, i.gradient?.stops), s = i.gradient?.enabled === !0, o = i.glow?.enabled ? i.glow.intensity ?? 0.9 : 0, r = i.flow?.enabled === !0, l = i.pulse?.enabled === !0, c = i.scan?.enabled === !0, h = i.flow?.direction === "backward" ? -1 : 1, u = new po({
|
|
17067
17073
|
transparent: !0,
|
|
17068
17074
|
side: re,
|
|
17069
17075
|
depthTest: t.alwaysOnTop ? !1 : t.depthTest !== !1,
|
|
@@ -17210,13 +17216,13 @@ class Ke {
|
|
|
17210
17216
|
this.engine = e, this.materialFactory = t;
|
|
17211
17217
|
}
|
|
17212
17218
|
createSegmentCurve(e) {
|
|
17213
|
-
const t = new
|
|
17219
|
+
const t = new mo();
|
|
17214
17220
|
for (let i = 0; i < e.length - 1; i += 1)
|
|
17215
|
-
t.add(new
|
|
17221
|
+
t.add(new go(e[i], e[i + 1]));
|
|
17216
17222
|
return t;
|
|
17217
17223
|
}
|
|
17218
17224
|
createTubeMesh(e, t, i, n, s, o, r = 10, l = !1) {
|
|
17219
|
-
const c = new
|
|
17225
|
+
const c = new fo(t, i, n, r, l);
|
|
17220
17226
|
c.computeBoundingBox();
|
|
17221
17227
|
const h = c.boundingBox ?? new R(new d(0, 0, 0), new d(1, 1, 1)), u = this.materialFactory.createSurfaceMaterial({
|
|
17222
17228
|
color: s.color ?? "#7ffcff",
|
|
@@ -17237,11 +17243,11 @@ class Ke {
|
|
|
17237
17243
|
depthTest: i.alwaysOnTop ? !1 : i.depthTest !== !1
|
|
17238
17244
|
});
|
|
17239
17245
|
s.clippingPlanes = this.engine.sectionPlane;
|
|
17240
|
-
const o = new
|
|
17246
|
+
const o = new yo(n, s);
|
|
17241
17247
|
return o.renderOrder = 998, o;
|
|
17242
17248
|
}
|
|
17243
17249
|
}
|
|
17244
|
-
class
|
|
17250
|
+
class qc extends Ke {
|
|
17245
17251
|
type = "box";
|
|
17246
17252
|
build(e) {
|
|
17247
17253
|
if (e.instance.points.length < 2)
|
|
@@ -17268,14 +17274,14 @@ class Gc extends Ke {
|
|
|
17268
17274
|
depthTest: e.instance.style.alwaysOnTop ? !1 : e.instance.style.depthTest !== !1
|
|
17269
17275
|
});
|
|
17270
17276
|
p.clippingPlanes = this.engine.sectionPlane;
|
|
17271
|
-
const g = new Jt(new
|
|
17277
|
+
const g = new Jt(new Mo(l), p);
|
|
17272
17278
|
g.position.copy(r), e.instance.root.add(g), e.volumeHeight = o.y, e.animatedMaterials.push(h);
|
|
17273
17279
|
}
|
|
17274
17280
|
}
|
|
17275
|
-
class
|
|
17281
|
+
class Kc extends Ke {
|
|
17276
17282
|
type = "curve3d";
|
|
17277
17283
|
build(e) {
|
|
17278
|
-
const t = e.instance.points.map((r) => J(r)), i = e.instance.style.curve ?? {}, n = i.interpolation ?? "catmullRom", s = new
|
|
17284
|
+
const t = e.instance.points.map((r) => J(r)), i = e.instance.style.curve ?? {}, n = i.interpolation ?? "catmullRom", s = new vo(
|
|
17279
17285
|
t,
|
|
17280
17286
|
i.closed ?? !1,
|
|
17281
17287
|
n === "catmullRom" ? "catmullrom" : n,
|
|
@@ -17293,10 +17299,10 @@ class qc extends Ke {
|
|
|
17293
17299
|
e.instance.root.add(o), e.anchorCurve = s, e.panelAnchorPoint = s.getPoint(0.5);
|
|
17294
17300
|
}
|
|
17295
17301
|
}
|
|
17296
|
-
class
|
|
17302
|
+
class jc extends Ke {
|
|
17297
17303
|
type = "extrudePolygon";
|
|
17298
17304
|
build(e) {
|
|
17299
|
-
const t =
|
|
17305
|
+
const t = Os(e.instance.points), i = Fs(t.localPoints), n = e.instance.style.volume?.height ?? 10, s = new Xn(i, {
|
|
17300
17306
|
depth: n,
|
|
17301
17307
|
bevelEnabled: !1,
|
|
17302
17308
|
steps: 1,
|
|
@@ -17341,21 +17347,21 @@ class ji extends Ke {
|
|
|
17341
17347
|
e.instance.root.position.copy(t), e.panelAnchorPoint = t.clone();
|
|
17342
17348
|
}
|
|
17343
17349
|
}
|
|
17344
|
-
class
|
|
17350
|
+
class Yc extends ji {
|
|
17345
17351
|
type = "iconPoint";
|
|
17346
17352
|
/** 将图标点绑定到首个世界坐标。 */
|
|
17347
17353
|
build(e) {
|
|
17348
17354
|
this.buildDomAnchor(e);
|
|
17349
17355
|
}
|
|
17350
17356
|
}
|
|
17351
|
-
class
|
|
17357
|
+
class Xc extends ji {
|
|
17352
17358
|
type = "iconTextPoint";
|
|
17353
17359
|
/** 将图文组合点绑定到首个世界坐标。 */
|
|
17354
17360
|
build(e) {
|
|
17355
17361
|
this.buildDomAnchor(e);
|
|
17356
17362
|
}
|
|
17357
17363
|
}
|
|
17358
|
-
class
|
|
17364
|
+
class Qc extends Ke {
|
|
17359
17365
|
type = "leaderPoint";
|
|
17360
17366
|
build(e) {
|
|
17361
17367
|
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();
|
|
@@ -17375,13 +17381,13 @@ class Xc extends Ke {
|
|
|
17375
17381
|
];
|
|
17376
17382
|
}
|
|
17377
17383
|
}
|
|
17378
|
-
class
|
|
17384
|
+
class $c extends Ke {
|
|
17379
17385
|
type = "pillarPoint";
|
|
17380
17386
|
/** 根据光柱专属参数创建柱体与可选底环。 */
|
|
17381
17387
|
build(e) {
|
|
17382
17388
|
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);
|
|
17383
17389
|
e.instance.root.position.copy(i).add(n), e.panelAnchorPoint = i.clone().add(n).add(new d(0, s, 0)), e.volumeHeight = s;
|
|
17384
|
-
const o = new
|
|
17390
|
+
const o = new xo(
|
|
17385
17391
|
Math.max(t.radiusTop ?? 0.3, 1e-3),
|
|
17386
17392
|
Math.max(t.radiusBottom ?? 0.75, 1e-3),
|
|
17387
17393
|
s,
|
|
@@ -17424,7 +17430,7 @@ class Qc extends Ke {
|
|
|
17424
17430
|
});
|
|
17425
17431
|
h.clippingPlanes = this.engine.sectionPlane;
|
|
17426
17432
|
const u = new z(
|
|
17427
|
-
new
|
|
17433
|
+
new Jn(
|
|
17428
17434
|
Math.max(t.baseRingInnerRadius ?? 1.9, 1e-3),
|
|
17429
17435
|
Math.max(t.baseRingOuterRadius ?? 2.4, (t.baseRingInnerRadius ?? 1.9) + 1e-3),
|
|
17430
17436
|
Math.max(12, Math.floor(t.baseRingSegments ?? 48))
|
|
@@ -17435,10 +17441,10 @@ class Qc extends Ke {
|
|
|
17435
17441
|
}
|
|
17436
17442
|
}
|
|
17437
17443
|
}
|
|
17438
|
-
class
|
|
17444
|
+
class Zc extends Ke {
|
|
17439
17445
|
type = "polygon";
|
|
17440
17446
|
build(e) {
|
|
17441
|
-
const t =
|
|
17447
|
+
const t = Os(e.instance.points), i = Fs(t.localPoints), n = new wo(i);
|
|
17442
17448
|
n.computeBoundingBox();
|
|
17443
17449
|
const s = n.boundingBox ?? new R(new d(0, 0, 0), new d(1, 1, 1)), o = this.materialFactory.createSurfaceMaterial({
|
|
17444
17450
|
color: e.instance.style.fillColor ?? e.instance.style.color ?? "#7ffcff",
|
|
@@ -17458,7 +17464,7 @@ class $c extends Ke {
|
|
|
17458
17464
|
), e.animatedMaterials.push(o);
|
|
17459
17465
|
}
|
|
17460
17466
|
}
|
|
17461
|
-
class
|
|
17467
|
+
class Jc extends Ke {
|
|
17462
17468
|
type = "polyline";
|
|
17463
17469
|
build(e) {
|
|
17464
17470
|
const t = e.instance.points.map((s) => J(s)), i = this.createSegmentCurve(t), n = this.createTubeMesh(
|
|
@@ -17472,7 +17478,7 @@ class Zc extends Ke {
|
|
|
17472
17478
|
e.instance.root.add(n), e.anchorCurve = i, e.panelAnchorPoint = i.getPoint(0.5);
|
|
17473
17479
|
}
|
|
17474
17480
|
}
|
|
17475
|
-
class
|
|
17481
|
+
class eh extends Ke {
|
|
17476
17482
|
type = "ripplePoint";
|
|
17477
17483
|
/** 根据波纹参数创建中心点和错相扩散圆环。 */
|
|
17478
17484
|
build(e) {
|
|
@@ -17504,36 +17510,36 @@ class Jc extends Ke {
|
|
|
17504
17510
|
});
|
|
17505
17511
|
h.clippingPlanes = this.engine.sectionPlane;
|
|
17506
17512
|
const u = new z(
|
|
17507
|
-
new
|
|
17513
|
+
new Jn(Math.max(o - r, 1e-3), o, l),
|
|
17508
17514
|
h
|
|
17509
17515
|
);
|
|
17510
17516
|
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);
|
|
17511
17517
|
}
|
|
17512
17518
|
}
|
|
17513
17519
|
}
|
|
17514
|
-
class
|
|
17520
|
+
class th extends ji {
|
|
17515
17521
|
type = "textPoint";
|
|
17516
17522
|
/** 将文字点绑定到首个世界坐标。 */
|
|
17517
17523
|
build(e) {
|
|
17518
17524
|
this.buildDomAnchor(e);
|
|
17519
17525
|
}
|
|
17520
17526
|
}
|
|
17521
|
-
function
|
|
17527
|
+
function ih(a, e) {
|
|
17522
17528
|
return [
|
|
17523
|
-
new jc(a, e),
|
|
17524
|
-
new eh(a, e),
|
|
17525
17529
|
new Yc(a, e),
|
|
17526
|
-
new
|
|
17527
|
-
new Qc(a, e),
|
|
17530
|
+
new th(a, e),
|
|
17528
17531
|
new Xc(a, e),
|
|
17529
|
-
new
|
|
17530
|
-
new qc(a, e),
|
|
17532
|
+
new eh(a, e),
|
|
17531
17533
|
new $c(a, e),
|
|
17534
|
+
new Qc(a, e),
|
|
17535
|
+
new Jc(a, e),
|
|
17532
17536
|
new Kc(a, e),
|
|
17533
|
-
new
|
|
17537
|
+
new Zc(a, e),
|
|
17538
|
+
new jc(a, e),
|
|
17539
|
+
new qc(a, e)
|
|
17534
17540
|
];
|
|
17535
17541
|
}
|
|
17536
|
-
function
|
|
17542
|
+
function nh(a, e, t) {
|
|
17537
17543
|
const i = a.camera;
|
|
17538
17544
|
if (!i)
|
|
17539
17545
|
return !1;
|
|
@@ -17546,7 +17552,7 @@ function ih(a, e, t) {
|
|
|
17546
17552
|
const r = o.sort((l, c) => l.distance - c.distance)[0];
|
|
17547
17553
|
return !!(r && r.distance < s - 0.05);
|
|
17548
17554
|
}
|
|
17549
|
-
class
|
|
17555
|
+
class sh {
|
|
17550
17556
|
/** 归一化外部数据,并在创建几何前校验类型对应的必要输入。 */
|
|
17551
17557
|
normalizeData(e) {
|
|
17552
17558
|
const t = {
|
|
@@ -17680,7 +17686,7 @@ class nh {
|
|
|
17680
17686
|
offset: { ...e.offset ?? {} },
|
|
17681
17687
|
screenOffset: { ...e.screenOffset ?? {} },
|
|
17682
17688
|
className: e.className,
|
|
17683
|
-
style: { ...
|
|
17689
|
+
style: { ...Dc, ...e.style ?? {} },
|
|
17684
17690
|
interactive: e.interactive ?? !0,
|
|
17685
17691
|
occlusion: e.occlusion ?? "show",
|
|
17686
17692
|
actions: e.actions
|
|
@@ -17719,11 +17725,11 @@ class nh {
|
|
|
17719
17725
|
}
|
|
17720
17726
|
}
|
|
17721
17727
|
}
|
|
17722
|
-
function
|
|
17728
|
+
function oh(a) {
|
|
17723
17729
|
const { actions: e, ...t } = a;
|
|
17724
17730
|
return t;
|
|
17725
17731
|
}
|
|
17726
|
-
function
|
|
17732
|
+
function rh(a) {
|
|
17727
17733
|
return {
|
|
17728
17734
|
id: a.instance.id,
|
|
17729
17735
|
type: a.instance.type,
|
|
@@ -17739,7 +17745,7 @@ function oh(a) {
|
|
|
17739
17745
|
function Gt(a) {
|
|
17740
17746
|
return a === void 0 ? a : JSON.parse(JSON.stringify(a));
|
|
17741
17747
|
}
|
|
17742
|
-
class
|
|
17748
|
+
class ah {
|
|
17743
17749
|
builders = /* @__PURE__ */ new Map();
|
|
17744
17750
|
constructor(e) {
|
|
17745
17751
|
e.forEach((t) => this.builders.set(t.type, t));
|
|
@@ -17751,8 +17757,8 @@ class rh {
|
|
|
17751
17757
|
t.build(e);
|
|
17752
17758
|
}
|
|
17753
17759
|
}
|
|
17754
|
-
const
|
|
17755
|
-
class
|
|
17760
|
+
const lh = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]);
|
|
17761
|
+
class ch {
|
|
17756
17762
|
constructor(e, t) {
|
|
17757
17763
|
this.markerRegistry = e, this.overlayController = t;
|
|
17758
17764
|
}
|
|
@@ -17767,7 +17773,7 @@ class lh {
|
|
|
17767
17773
|
selectable: e.selectable ?? !0,
|
|
17768
17774
|
style: e.style,
|
|
17769
17775
|
effect: e.effect ?? {},
|
|
17770
|
-
panel: e.panel ?
|
|
17776
|
+
panel: e.panel ? oh(e.panel) : void 0,
|
|
17771
17777
|
data: e.data,
|
|
17772
17778
|
panelVisible: e.panel?.trigger === "always",
|
|
17773
17779
|
hovered: !1,
|
|
@@ -17776,37 +17782,37 @@ class lh {
|
|
|
17776
17782
|
instance: i,
|
|
17777
17783
|
actions: e.panel?.actions,
|
|
17778
17784
|
panelElement: e.panel ? this.overlayController.createPanelElement(i, e.panel) : null,
|
|
17779
|
-
markerElement: e.type === "leaderPoint" ? this.overlayController.createLeaderMarkerElement(i) :
|
|
17785
|
+
markerElement: e.type === "leaderPoint" ? this.overlayController.createLeaderMarkerElement(i) : lh.has(e.type) ? this.overlayController.createPointMarkerElement(i) : null,
|
|
17780
17786
|
timeSeed: Math.random() * Math.PI * 2,
|
|
17781
17787
|
pulseMaterials: [],
|
|
17782
17788
|
rippleMeshes: [],
|
|
17783
17789
|
baseRingMeshes: [],
|
|
17784
17790
|
animatedMaterials: []
|
|
17785
17791
|
};
|
|
17786
|
-
return this.markerRegistry.build(n),
|
|
17792
|
+
return this.markerRegistry.build(n), Bc(t, i.id), n;
|
|
17787
17793
|
}
|
|
17788
17794
|
}
|
|
17789
|
-
class
|
|
17795
|
+
class hh {
|
|
17790
17796
|
engine;
|
|
17791
17797
|
rootGroup;
|
|
17792
17798
|
records = /* @__PURE__ */ new Map();
|
|
17793
17799
|
occlusionRaycaster = new me();
|
|
17794
|
-
normalizer = new
|
|
17800
|
+
normalizer = new sh();
|
|
17795
17801
|
materialFactory;
|
|
17796
17802
|
overlayController;
|
|
17797
17803
|
interactionController;
|
|
17798
17804
|
effectsController;
|
|
17799
|
-
visibilityController = new
|
|
17805
|
+
visibilityController = new Wc();
|
|
17800
17806
|
markerRegistry;
|
|
17801
17807
|
recordFactory;
|
|
17802
17808
|
currentTime = 0;
|
|
17803
17809
|
constructor(e) {
|
|
17804
|
-
this.engine = e, this.rootGroup = new pe(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new
|
|
17810
|
+
this.engine = e, this.rootGroup = new pe(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new Gc(this.engine), this.overlayController = new Uc(
|
|
17805
17811
|
this.engine,
|
|
17806
|
-
(t) =>
|
|
17807
|
-
), this.markerRegistry = new
|
|
17808
|
-
|
|
17809
|
-
), this.recordFactory = new
|
|
17812
|
+
(t) => nh(this.engine, this.occlusionRaycaster, t)
|
|
17813
|
+
), this.markerRegistry = new ah(
|
|
17814
|
+
ih(this.engine, this.materialFactory)
|
|
17815
|
+
), this.recordFactory = new ch(this.markerRegistry, this.overlayController), this.effectsController = new Ic(), this.interactionController = new _c({
|
|
17810
17816
|
engine: this.engine,
|
|
17811
17817
|
rootGroup: this.rootGroup,
|
|
17812
17818
|
records: this.records,
|
|
@@ -17907,7 +17913,7 @@ class ch {
|
|
|
17907
17913
|
return this.update(e, { panel: n });
|
|
17908
17914
|
}
|
|
17909
17915
|
getData() {
|
|
17910
|
-
return Array.from(this.records.values()).map((e) =>
|
|
17916
|
+
return Array.from(this.records.values()).map((e) => rh(e));
|
|
17911
17917
|
}
|
|
17912
17918
|
restoreData(e) {
|
|
17913
17919
|
this.clear(), e.forEach((t) => this.add(t));
|
|
@@ -17925,7 +17931,7 @@ class ch {
|
|
|
17925
17931
|
}
|
|
17926
17932
|
removeInternal(e, t) {
|
|
17927
17933
|
const i = this.records.get(e);
|
|
17928
|
-
return i ? (this.interactionController.handleRecordRemoved(e),
|
|
17934
|
+
return i ? (this.interactionController.handleRecordRemoved(e), zc(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;
|
|
17929
17935
|
}
|
|
17930
17936
|
toEventPayload(e, t) {
|
|
17931
17937
|
return { id: e.instance.id, annotation: e.instance, originalEvent: t };
|
|
@@ -18260,15 +18266,15 @@ class dt {
|
|
|
18260
18266
|
return "x" in e ? new d(e.x, e.y, e.z) : new d(e.X, e.Y, e.Z);
|
|
18261
18267
|
}
|
|
18262
18268
|
}
|
|
18263
|
-
const
|
|
18264
|
-
class
|
|
18269
|
+
const dh = 1e-3, uh = 0.65, ph = 1;
|
|
18270
|
+
class mh {
|
|
18265
18271
|
engine;
|
|
18266
18272
|
loader;
|
|
18267
18273
|
dracoLoader;
|
|
18268
18274
|
dracoDecoderPath;
|
|
18269
18275
|
modelList = /* @__PURE__ */ new Map();
|
|
18270
18276
|
modelTransforms = [];
|
|
18271
|
-
animationTimer = new
|
|
18277
|
+
animationTimer = new Gn();
|
|
18272
18278
|
transformControl = null;
|
|
18273
18279
|
transformHelper = null;
|
|
18274
18280
|
selectedModelId = null;
|
|
@@ -18426,13 +18432,13 @@ class ph {
|
|
|
18426
18432
|
const l = t ? `“${t}”` : "默认动画";
|
|
18427
18433
|
throw new Error(`播放模型动画失败:模型 “${e}” 不存在${l}。`);
|
|
18428
18434
|
}
|
|
18429
|
-
(i.stopOthers ?? !0) && this.stopAnimation(e), n.mixer || (n.mixer = new
|
|
18435
|
+
(i.stopOthers ?? !0) && this.stopAnimation(e), n.mixer || (n.mixer = new qn(n.object), n.mixer.addEventListener("finished", (l) => {
|
|
18430
18436
|
n.actions.forEach((c, h) => {
|
|
18431
18437
|
c === l.action && n.actions.delete(h);
|
|
18432
18438
|
});
|
|
18433
18439
|
}));
|
|
18434
18440
|
const o = n.mixer.clipAction(s);
|
|
18435
|
-
o.reset(), o.enabled = !0, o.clampWhenFinished = i.clampWhenFinished ?? !1, o.setEffectiveTimeScale(i.timeScale ?? 1), i.loop ?? !0 ? o.setLoop(
|
|
18441
|
+
o.reset(), o.enabled = !0, o.clampWhenFinished = i.clampWhenFinished ?? !1, o.setEffectiveTimeScale(i.timeScale ?? 1), i.loop ?? !0 ? o.setLoop(bo, i.repetitions ?? 1 / 0) : o.setLoop(Co, i.repetitions ?? 1);
|
|
18436
18442
|
const r = i.fadeIn ?? 0;
|
|
18437
18443
|
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 };
|
|
18438
18444
|
}
|
|
@@ -18525,7 +18531,7 @@ class ph {
|
|
|
18525
18531
|
}
|
|
18526
18532
|
/** 创建独立解码器实例,便于管理器销毁或切换资源目录时释放 worker。 */
|
|
18527
18533
|
createDracoLoader(e) {
|
|
18528
|
-
const t = new
|
|
18534
|
+
const t = new $n();
|
|
18529
18535
|
return t.setDecoderPath(e), t;
|
|
18530
18536
|
}
|
|
18531
18537
|
resolveDracoDecoderPath(e) {
|
|
@@ -18573,7 +18579,7 @@ class ph {
|
|
|
18573
18579
|
}
|
|
18574
18580
|
/** 透视相机使用更小的屏幕尺寸系数,正交相机维持原有尺寸。 */
|
|
18575
18581
|
syncTransformControlCamera() {
|
|
18576
|
-
!this.transformControl || !this.engine.camera || (this.transformControl.camera = this.engine.camera, this.transformControl.size = this.engine.camera.isPerspectiveCamera ?
|
|
18582
|
+
!this.transformControl || !this.engine.camera || (this.transformControl.camera = this.engine.camera, this.transformControl.size = this.engine.camera.isPerspectiveCamera ? uh : ph);
|
|
18577
18583
|
}
|
|
18578
18584
|
/** 使用引擎统一的捕捉器等待用户单击,并在取消或完成后恢复常规交互。 */
|
|
18579
18585
|
pickPlacementPoint(e, t) {
|
|
@@ -18612,7 +18618,7 @@ class ph {
|
|
|
18612
18618
|
const i = t.clone(), n = e?.normal ?? e?.face?.normal;
|
|
18613
18619
|
if (n == null) return { position: i, normal: null };
|
|
18614
18620
|
const s = n.clone(), o = e?.matrix ?? e?.object?.matrixWorld;
|
|
18615
|
-
return o && s.transformDirection(o), s.lengthSq() < 1e-10 ? { position: i, normal: null } : (s.normalize(), i.addScaledVector(s,
|
|
18621
|
+
return o && s.transformDirection(o), s.lengthSq() < 1e-10 ? { position: i, normal: null } : (s.normalize(), i.addScaledVector(s, dh), { position: i, normal: s });
|
|
18616
18622
|
}
|
|
18617
18623
|
handlePointerDown(e) {
|
|
18618
18624
|
if (!(!this.editingEnabled || !this.engine.camera || !this.engine.renderer)) {
|
|
@@ -18770,7 +18776,7 @@ class vi extends Error {
|
|
|
18770
18776
|
super("模型对比已取消"), this.name = "ModelComparisonCancelledError";
|
|
18771
18777
|
}
|
|
18772
18778
|
}
|
|
18773
|
-
class
|
|
18779
|
+
class gh {
|
|
18774
18780
|
constructor(e) {
|
|
18775
18781
|
this.engine = e;
|
|
18776
18782
|
}
|
|
@@ -19208,8 +19214,8 @@ class mh {
|
|
|
19208
19214
|
});
|
|
19209
19215
|
}
|
|
19210
19216
|
}
|
|
19211
|
-
const
|
|
19212
|
-
class
|
|
19217
|
+
const Nn = "__modelExplodeProxy", Hn = new H().makeScale(0, 0, 0);
|
|
19218
|
+
class fh {
|
|
19213
19219
|
engine;
|
|
19214
19220
|
/** 当前是否处于炸开模式;供外部滑块、交互模块判断是否需要走代理逻辑。 */
|
|
19215
19221
|
active = !1;
|
|
@@ -19350,7 +19356,7 @@ class gh {
|
|
|
19350
19356
|
* 从命中的代理对象还原真实构件 ID,避免 Object3D.name 字符串化造成 nodesMap 查询失败。
|
|
19351
19357
|
*/
|
|
19352
19358
|
getObjectComponentId(e) {
|
|
19353
|
-
return e?.userData?.[
|
|
19359
|
+
return e?.userData?.[Nn] === !0 ? e.userData.componentId : null;
|
|
19354
19360
|
}
|
|
19355
19361
|
/**
|
|
19356
19362
|
* 返回炸开后用于悬浮高亮的代理网格。
|
|
@@ -19504,7 +19510,7 @@ class gh {
|
|
|
19504
19510
|
}
|
|
19505
19511
|
/** 给代理对象写入稳定交互身份,避免依赖 name 的字符串化 id。 */
|
|
19506
19512
|
assignProxyIdentity(e, t, i) {
|
|
19507
|
-
e.url = t, e.name = String(i), e.userData[
|
|
19513
|
+
e.url = t, e.name = String(i), e.userData[Nn] = !0, e.userData.componentId = i, e.userData.url = t;
|
|
19508
19514
|
}
|
|
19509
19515
|
/**
|
|
19510
19516
|
* 隐藏源渲染片段,避免与代理对象重复显示。
|
|
@@ -19512,7 +19518,7 @@ class gh {
|
|
|
19512
19518
|
*/
|
|
19513
19519
|
hideSource(e) {
|
|
19514
19520
|
if (e.kind === "instance") {
|
|
19515
|
-
e.sourceMesh.setMatrixAt(e.subIndex,
|
|
19521
|
+
e.sourceMesh.setMatrixAt(e.subIndex, Hn), e.sourceMesh.instanceMatrix.needsUpdate = !0;
|
|
19516
19522
|
return;
|
|
19517
19523
|
}
|
|
19518
19524
|
this.ensureSplitState(e);
|
|
@@ -19532,7 +19538,7 @@ class gh {
|
|
|
19532
19538
|
*/
|
|
19533
19539
|
restoreSource(e) {
|
|
19534
19540
|
if (e.kind === "instance") {
|
|
19535
|
-
const s = this.shouldKeepOriginalInstanceHidden(e) ?
|
|
19541
|
+
const s = this.shouldKeepOriginalInstanceHidden(e) ? Hn : e.originalMatrix;
|
|
19536
19542
|
s instanceof H && (e.sourceMesh.setMatrixAt(e.subIndex, s), e.sourceMesh.instanceMatrix.needsUpdate = !0);
|
|
19537
19543
|
return;
|
|
19538
19544
|
}
|
|
@@ -19736,7 +19742,7 @@ class gh {
|
|
|
19736
19742
|
return Math.abs(i);
|
|
19737
19743
|
}
|
|
19738
19744
|
}
|
|
19739
|
-
const
|
|
19745
|
+
const Vn = "bim-material-editor-style", st = [
|
|
19740
19746
|
"map",
|
|
19741
19747
|
"normalMap",
|
|
19742
19748
|
"roughnessMap",
|
|
@@ -19755,7 +19761,7 @@ const Hn = "bim-material-editor-style", st = [
|
|
|
19755
19761
|
bumpMap: "凹凸贴图",
|
|
19756
19762
|
emissiveMap: "自发光贴图"
|
|
19757
19763
|
};
|
|
19758
|
-
class
|
|
19764
|
+
class yh {
|
|
19759
19765
|
constructor(e) {
|
|
19760
19766
|
this.engine = e;
|
|
19761
19767
|
}
|
|
@@ -19841,7 +19847,7 @@ function si(a) {
|
|
|
19841
19847
|
function xi(a) {
|
|
19842
19848
|
return a.map((e) => e.name || e.url || e.type || e.uuid).filter((e, t, i) => e.length > 0 && i.indexOf(e) === t);
|
|
19843
19849
|
}
|
|
19844
|
-
function
|
|
19850
|
+
function Ns(a) {
|
|
19845
19851
|
const e = {
|
|
19846
19852
|
name: a.name,
|
|
19847
19853
|
opacity: a.opacity,
|
|
@@ -19861,7 +19867,7 @@ function Fs(a) {
|
|
|
19861
19867
|
function yt(a) {
|
|
19862
19868
|
return a instanceof Ie ? si(a) || a.uuid : a;
|
|
19863
19869
|
}
|
|
19864
|
-
function
|
|
19870
|
+
function Mh(a) {
|
|
19865
19871
|
const e = a, t = {
|
|
19866
19872
|
type: a.type,
|
|
19867
19873
|
name: a.name || a.type,
|
|
@@ -19877,8 +19883,8 @@ function yh(a) {
|
|
|
19877
19883
|
i in e && (t[i] = yt(e[i]) ?? null);
|
|
19878
19884
|
}), JSON.stringify(t);
|
|
19879
19885
|
}
|
|
19880
|
-
function
|
|
19881
|
-
const t =
|
|
19886
|
+
function vh(a, e) {
|
|
19887
|
+
const t = Ns(a), i = {};
|
|
19882
19888
|
return Object.entries(e.values).forEach(([n, s]) => {
|
|
19883
19889
|
const o = t[n];
|
|
19884
19890
|
yt(s) !== yt(o) && (i[n] = {
|
|
@@ -19887,7 +19893,7 @@ function Mh(a, e) {
|
|
|
19887
19893
|
});
|
|
19888
19894
|
}), i;
|
|
19889
19895
|
}
|
|
19890
|
-
function
|
|
19896
|
+
function Hs(a, e, t) {
|
|
19891
19897
|
const i = a;
|
|
19892
19898
|
if ((e === "color" || e === "emissive") && i[e] instanceof xe && typeof t == "string") {
|
|
19893
19899
|
i[e].set(t);
|
|
@@ -19922,7 +19928,7 @@ function qt(a) {
|
|
|
19922
19928
|
}))
|
|
19923
19929
|
};
|
|
19924
19930
|
}
|
|
19925
|
-
class
|
|
19931
|
+
class xh {
|
|
19926
19932
|
constructor(e, t) {
|
|
19927
19933
|
this.engine = e, this.host = t;
|
|
19928
19934
|
}
|
|
@@ -20076,7 +20082,7 @@ class vh {
|
|
|
20076
20082
|
createSideSelect(e, t) {
|
|
20077
20083
|
const i = this.createElement("div", "bim-material-editor__row"), n = document.createElement("select");
|
|
20078
20084
|
return [
|
|
20079
|
-
{ label: "正面", value:
|
|
20085
|
+
{ label: "正面", value: Eo },
|
|
20080
20086
|
{ label: "背面", value: Oi },
|
|
20081
20087
|
{ label: "双面", value: re }
|
|
20082
20088
|
].forEach((s) => {
|
|
@@ -20093,10 +20099,10 @@ class vh {
|
|
|
20093
20099
|
return t && (n.className = t), i && (n.textContent = i), n;
|
|
20094
20100
|
}
|
|
20095
20101
|
ensureStyle() {
|
|
20096
|
-
if (document.getElementById(
|
|
20102
|
+
if (document.getElementById(Vn) != null)
|
|
20097
20103
|
return;
|
|
20098
20104
|
const e = document.createElement("style");
|
|
20099
|
-
e.id =
|
|
20105
|
+
e.id = Vn, e.textContent = `
|
|
20100
20106
|
.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}
|
|
20101
20107
|
.bim-material-editor *{box-sizing:border-box}
|
|
20102
20108
|
.bim-material-editor__header{display:flex;align-items:center;justify-content:space-between;gap:8px}
|
|
@@ -20129,7 +20135,7 @@ class vh {
|
|
|
20129
20135
|
`, document.head.appendChild(e);
|
|
20130
20136
|
}
|
|
20131
20137
|
}
|
|
20132
|
-
class
|
|
20138
|
+
class wh {
|
|
20133
20139
|
constructor(e) {
|
|
20134
20140
|
this.collectSceneMaterials = e;
|
|
20135
20141
|
}
|
|
@@ -20150,7 +20156,7 @@ class xh {
|
|
|
20150
20156
|
name: e.name,
|
|
20151
20157
|
type: e.type,
|
|
20152
20158
|
objectNames: xi(t),
|
|
20153
|
-
values:
|
|
20159
|
+
values: Ns(e)
|
|
20154
20160
|
});
|
|
20155
20161
|
}
|
|
20156
20162
|
getModifiedMaterials() {
|
|
@@ -20160,7 +20166,7 @@ class xh {
|
|
|
20160
20166
|
const i = this.baselineSnapshots.get(t.material.uuid);
|
|
20161
20167
|
if (i == null)
|
|
20162
20168
|
return;
|
|
20163
|
-
const n =
|
|
20169
|
+
const n = vh(t.material, i);
|
|
20164
20170
|
Object.keys(n).length !== 0 && e.push({
|
|
20165
20171
|
id: t.material.uuid,
|
|
20166
20172
|
name: t.material.name || i.name,
|
|
@@ -20173,17 +20179,17 @@ class xh {
|
|
|
20173
20179
|
restore(e) {
|
|
20174
20180
|
const t = this.baselineSnapshots.get(e.uuid);
|
|
20175
20181
|
return t == null ? !1 : (Object.entries(t.values).forEach(([i, n]) => {
|
|
20176
|
-
|
|
20182
|
+
Hs(e, i, n);
|
|
20177
20183
|
}), e.needsUpdate = !0, !0);
|
|
20178
20184
|
}
|
|
20179
20185
|
}
|
|
20180
|
-
class
|
|
20186
|
+
class bh {
|
|
20181
20187
|
constructor(e, t = {}) {
|
|
20182
20188
|
this.engine = e, this.options = {
|
|
20183
20189
|
visible: t.visible ?? !1,
|
|
20184
20190
|
title: t.title ?? "材质编辑器",
|
|
20185
20191
|
width: t.width ?? 340
|
|
20186
|
-
}, this.visible = this.options.visible, this.collector = new
|
|
20192
|
+
}, this.visible = this.options.visible, this.collector = new yh(e), this.snapshots = new wh(() => this.collectSceneMaterials()), this.panel = new xh(e, this);
|
|
20187
20193
|
}
|
|
20188
20194
|
options;
|
|
20189
20195
|
selectedMaterials = [];
|
|
@@ -20266,7 +20272,7 @@ class wh {
|
|
|
20266
20272
|
const i = this.findMaterialGroupById(e);
|
|
20267
20273
|
i.length !== 0 && (i.forEach((n) => {
|
|
20268
20274
|
this.snapshots.ensure(n, this.collector.findOwners(n)), Object.entries(t).forEach(([s, o]) => {
|
|
20269
|
-
|
|
20275
|
+
Hs(n, s, o);
|
|
20270
20276
|
}), n.needsUpdate = !0;
|
|
20271
20277
|
}), this.requestRender(), this.render());
|
|
20272
20278
|
}
|
|
@@ -20325,7 +20331,7 @@ class wh {
|
|
|
20325
20331
|
dedupeMaterials(e) {
|
|
20326
20332
|
const t = /* @__PURE__ */ new Map();
|
|
20327
20333
|
return e.forEach((i) => {
|
|
20328
|
-
const n =
|
|
20334
|
+
const n = Mh(i.material), s = t.get(n);
|
|
20329
20335
|
if (s == null) {
|
|
20330
20336
|
t.set(n, { material: i.material, materials: [i.material], owners: [...i.owners] });
|
|
20331
20337
|
return;
|
|
@@ -20351,7 +20357,7 @@ class wh {
|
|
|
20351
20357
|
}
|
|
20352
20358
|
replaceTexture(e, t, i) {
|
|
20353
20359
|
const n = e, s = n[t];
|
|
20354
|
-
s != null && this.ownedTextures.has(s) && (s.dispose(), this.ownedTextures.delete(s)), i != null && (i.colorSpace = t === "map" || t === "emissiveMap" ? We :
|
|
20360
|
+
s != null && this.ownedTextures.has(s) && (s.dispose(), this.ownedTextures.delete(s)), i != null && (i.colorSpace = t === "map" || t === "emissiveMap" ? We : Ao, i.wrapS = pt, i.wrapT = pt, i.needsUpdate = !0, this.ownedTextures.add(i)), n[t] = i, e.needsUpdate = !0, this.requestRender();
|
|
20355
20361
|
}
|
|
20356
20362
|
loadTexture(e) {
|
|
20357
20363
|
return new Promise((t, i) => {
|
|
@@ -20365,7 +20371,7 @@ class wh {
|
|
|
20365
20371
|
this.ownedTextures.forEach((e) => e.dispose()), this.ownedTextures.clear();
|
|
20366
20372
|
}
|
|
20367
20373
|
}
|
|
20368
|
-
class
|
|
20374
|
+
class Ch {
|
|
20369
20375
|
engine;
|
|
20370
20376
|
codeMap = [];
|
|
20371
20377
|
continusIds = /* @__PURE__ */ new Map();
|
|
@@ -20466,16 +20472,16 @@ const Kt = {
|
|
|
20466
20472
|
sampleCount: 64,
|
|
20467
20473
|
roundedRadius: 1,
|
|
20468
20474
|
historyLimit: 100
|
|
20469
|
-
},
|
|
20475
|
+
}, Eh = {
|
|
20470
20476
|
bezier: "贝塞尔曲线",
|
|
20471
20477
|
straight: "直线",
|
|
20472
20478
|
rounded: "圆角直线"
|
|
20473
|
-
},
|
|
20479
|
+
}, Ah = {
|
|
20474
20480
|
bezier: "∿",
|
|
20475
20481
|
straight: "╱",
|
|
20476
20482
|
rounded: "⌁"
|
|
20477
20483
|
};
|
|
20478
|
-
class
|
|
20484
|
+
class Sh {
|
|
20479
20485
|
type = "path-draw";
|
|
20480
20486
|
engine;
|
|
20481
20487
|
root = new pe();
|
|
@@ -20709,10 +20715,10 @@ class Ah {
|
|
|
20709
20715
|
}
|
|
20710
20716
|
/** 使用 Line2 保证 WebGL 环境下的像素线宽真实生效。 */
|
|
20711
20717
|
updateLineObject(e, t, i) {
|
|
20712
|
-
const n = new
|
|
20718
|
+
const n = new So();
|
|
20713
20719
|
if (n.setPositions(t.flatMap((r) => [r.x, r.y, r.z])), e)
|
|
20714
20720
|
return e.geometry.dispose(), e.geometry = n, e.computeLineDistances(), this.syncLineResolution(e), this.requestRender(), e;
|
|
20715
|
-
const s = new
|
|
20721
|
+
const s = new Po({
|
|
20716
20722
|
color: i ? this.options.previewColor : this.options.lineColor,
|
|
20717
20723
|
linewidth: this.options.lineWidth,
|
|
20718
20724
|
dashed: i,
|
|
@@ -20721,7 +20727,7 @@ class Ah {
|
|
|
20721
20727
|
depthTest: !1,
|
|
20722
20728
|
transparent: i,
|
|
20723
20729
|
opacity: i ? 0.82 : 1
|
|
20724
|
-
}), o = new
|
|
20730
|
+
}), o = new To(n, s);
|
|
20725
20731
|
return o.name = i ? "PathDrawPreviewLine" : "PathDrawLine", o.renderOrder = i ? 1001 : 1e3, o.computeLineDistances(), this.syncLineResolution(o), this.root.add(o), this.requestRender(), o;
|
|
20726
20732
|
}
|
|
20727
20733
|
syncLineResolution(e) {
|
|
@@ -20841,7 +20847,7 @@ class Ah {
|
|
|
20841
20847
|
t.append(i, n, s), e.appendChild(t), this.statusElement = n;
|
|
20842
20848
|
const o = document.createElement("div");
|
|
20843
20849
|
Object.assign(o.style, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "4px", padding: "8px" }), ["bezier", "straight", "rounded"].forEach((x) => {
|
|
20844
|
-
const m = this.createIconButton(
|
|
20850
|
+
const m = this.createIconButton(Ah[x], Eh[x], () => this.setLineType(x));
|
|
20845
20851
|
m.dataset.lineType = x, m.style.width = "100%", m.style.fontSize = "18px", o.appendChild(m);
|
|
20846
20852
|
}), e.appendChild(o);
|
|
20847
20853
|
const r = document.createElement("label");
|
|
@@ -20959,7 +20965,7 @@ class Ah {
|
|
|
20959
20965
|
return { x: e.x, y: e.y, z: e.z };
|
|
20960
20966
|
}
|
|
20961
20967
|
}
|
|
20962
|
-
class
|
|
20968
|
+
class Ph {
|
|
20963
20969
|
engine;
|
|
20964
20970
|
continusIds = /* @__PURE__ */ new Map();
|
|
20965
20971
|
constructor(e) {
|
|
@@ -21018,27 +21024,27 @@ class Sh {
|
|
|
21018
21024
|
});
|
|
21019
21025
|
}
|
|
21020
21026
|
}
|
|
21021
|
-
const
|
|
21027
|
+
const Th = Object.freeze({
|
|
21022
21028
|
maxTextureSize: 1024,
|
|
21023
|
-
samples:
|
|
21024
|
-
restrictTextureSize: !0
|
|
21025
|
-
}), Th = Object.freeze({
|
|
21026
|
-
maxTextureSize: 2048,
|
|
21027
|
-
samples: 4,
|
|
21029
|
+
samples: 0,
|
|
21028
21030
|
restrictTextureSize: !0
|
|
21029
21031
|
}), Ih = Object.freeze({
|
|
21030
21032
|
maxTextureSize: 4096,
|
|
21031
21033
|
samples: 4,
|
|
21032
21034
|
restrictTextureSize: !0
|
|
21033
21035
|
}), _h = Object.freeze({
|
|
21034
|
-
maxTextureSize:
|
|
21036
|
+
maxTextureSize: 10240,
|
|
21037
|
+
samples: 4,
|
|
21038
|
+
restrictTextureSize: !0
|
|
21039
|
+
}), Dh = Object.freeze({
|
|
21040
|
+
maxTextureSize: 10240,
|
|
21035
21041
|
samples: 4,
|
|
21036
21042
|
restrictTextureSize: !1
|
|
21037
21043
|
});
|
|
21038
|
-
function
|
|
21039
|
-
return typeof a != "number" || !Number.isFinite(a) || a <= 4 ?
|
|
21044
|
+
function kh(a) {
|
|
21045
|
+
return typeof a != "number" || !Number.isFinite(a) || a <= 4 ? Th : a <= 6 ? Ih : a < 8 ? _h : Dh;
|
|
21040
21046
|
}
|
|
21041
|
-
class
|
|
21047
|
+
class Oh {
|
|
21042
21048
|
// 引擎参数
|
|
21043
21049
|
options;
|
|
21044
21050
|
mobileMemoryProfile;
|
|
@@ -21155,22 +21161,22 @@ class Rh {
|
|
|
21155
21161
|
// 业务数据
|
|
21156
21162
|
models = [];
|
|
21157
21163
|
reactBoundingClientRect = { left: 0, top: 0 };
|
|
21158
|
-
version =
|
|
21164
|
+
version = Lo;
|
|
21159
21165
|
versionEl = null;
|
|
21160
21166
|
// 引擎容器
|
|
21161
21167
|
container;
|
|
21162
21168
|
constructor(e) {
|
|
21163
|
-
if (window.THREE =
|
|
21169
|
+
if (window.THREE = Un, dr(), this.options = e, this.mobileMemoryProfile = kh(e.limit_memory), this.container = document.getElementById(e.containerId), !this.container)
|
|
21164
21170
|
throw new Error(`Container ${e.containerId} not found`);
|
|
21165
|
-
if (this.rxQuotaListMapper = new
|
|
21171
|
+
if (this.rxQuotaListMapper = new Ch(this), this.filterLoaderModel = new Ph(this), this.engineModelModule = new Wa(this), this.engineModelModule.init(), this.deviceModule = new Uo(this), this.deviceType = this.deviceModule.getDeviceType(), this.cameraModule = new ie(this), this.sceneModule = new Vo(this), this.scene = this.sceneModule.scene, this.renderModule = new Wo(this), this.renderer = this.renderModule.createRenderer(), this.camera = this.cameraModule.perspectiveCamera, this.scene.camera = this.camera, this.renderer) {
|
|
21166
21172
|
const o = this.renderer;
|
|
21167
21173
|
o.interactionCullingEnabled = !0, o.interactionActive = !1, o.interactionRenderScene = this.scene, o.interactionFrameBudgetMs = this.options.interactionFrameBudgetMs ?? 6, o.interactionSkipShadows = this.options.interactionSkipShadows ?? !0;
|
|
21168
21174
|
}
|
|
21169
|
-
this.controlModule = new
|
|
21175
|
+
this.controlModule = new ir(this), this.controlModule.switchDefaultMode(), this.controls = this.controlModule.orbitControls, this.clipping = new _l(this), this.clipping.init(), this.composerModule = new sr(this), this.composerModule.init(), this.events = new ya();
|
|
21170
21176
|
const t = this.events.trigger.bind(this.events);
|
|
21171
21177
|
this.events.trigger = ((o, r) => {
|
|
21172
21178
|
t(o, r), String(o) !== String(ne.EngineBusy) && this.requestComposerRender();
|
|
21173
|
-
}), this.engineStatus = new
|
|
21179
|
+
}), this.engineStatus = new fa(this), this.engineStatus.init(), this.loaderModule = new ve(this), this.lightModule = new Oa(this), this.lightModule.init(), this.viewCube = new ja(this), this.viewCube.init(), this.options.showViewCube == !1 && this.viewCube.hide(), this.octreeBox = Ya(this), this.rangeScale = new Xa(this), this.rangeScale.init(), this.setting = new fl(this), this.engineModelModule.init(), this.handelBehaved = Gi(this), this.modelMapperBatch = new Ol(this), this.measure = new Al(this), this.modelToolModule = new Na(this), this.modelLink3d = new Pc(this, this.options.linkOptions ?? {}), this.modelLink3d.init(), this.modelProperties = new Ll(this), this.search = new Rl(this), this.interactionModule = new Fa(this), this.interactionModule.init(), this.interactionModule.active(), this.hoverHighLight = new ni(this), this.modelEdge = new ml(this), this.nodeBox = new Hl(this), this.modelTree = new Dl(this), this.viewTree = new Ki(this), this.merge2d = new lc(this), this.engineInfo = new kl(this), this.pathRoaming = new Gl(this), this.pathRoaming.init(), this.oneClickEncoding = new Ql(this), this.minMap = new ql(this), this.linkElement2d3d = new Yl(this), this.linkView2d3d = new Xl(this), this.grid = new Za(this), this.level = new sl(this), this.issueReport = new Kl(this), this.fabricDraw = new Ec(this), this.drawingPin = new Ac(this), this.label = new Tc(this), this.annotation3d = new hh(this), this.calibration = new dt(this), this.modelPlace = new mh(this), this.modelComparison = new gh(this), this.modelExplode = new fh(this), this.materialTool = new bh(this, this.options.materialEditorOptions ?? {}), this.materialTool.init(), this.pathDraw = new Sh(this), this.text = new jl(this), this.hdr = new tl(this), this.ground = new qi(this), this.ground.init(), this.skyManager = new gl(this), this.setting.init(), this.worldToScreen = new fe(this.camera, this.renderer, this.scene), this.options.showStats && (this.stats = new Ho(), this.stats.showPanel(0), this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0px", this.stats.dom.style.left = "0px", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom));
|
|
21174
21180
|
let i = document.createElement("div");
|
|
21175
21181
|
i.className = "versionText", this.versionEl = i, this.updateVersionDisplay(), this.container.appendChild(i);
|
|
21176
21182
|
let n = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
@@ -21286,7 +21292,7 @@ class Rh {
|
|
|
21286
21292
|
* 解析得到多个模型地址时,共用同一份加载选项,包括是否加载边线。
|
|
21287
21293
|
*/
|
|
21288
21294
|
async loadModelByViewToken(e, t) {
|
|
21289
|
-
const i = await
|
|
21295
|
+
const i = await Bo(
|
|
21290
21296
|
this.options,
|
|
21291
21297
|
e,
|
|
21292
21298
|
"3d"
|
|
@@ -21396,7 +21402,7 @@ class Rh {
|
|
|
21396
21402
|
const i = this.getViewportSize(e, t);
|
|
21397
21403
|
e = i.width, t = i.height;
|
|
21398
21404
|
const n = this.camera.position.clone(), s = this.camera.quaternion.clone(), o = this.camera.up.clone(), r = this.controls?.target?.clone?.(), l = this.controlModule?.orbitControls?.origin?.clone?.();
|
|
21399
|
-
this.renderer.setPixelRatio(
|
|
21405
|
+
this.renderer.setPixelRatio(es(this)), this.renderer.setSize(e, t, !1);
|
|
21400
21406
|
const c = this.renderer.domElement.clientWidth || e, h = this.renderer.domElement.clientHeight || t;
|
|
21401
21407
|
if (!c || !h)
|
|
21402
21408
|
return;
|
|
@@ -21463,7 +21469,7 @@ class Rh {
|
|
|
21463
21469
|
if (!e) return;
|
|
21464
21470
|
[...e.children].forEach((i) => {
|
|
21465
21471
|
this.clearScene(i);
|
|
21466
|
-
}), e.parent && e.parent.remove(e), e instanceof z && !(e instanceof V) && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((i) => this.disposeMaterial(i)) : this.disposeMaterial(e.material))), e instanceof Lt && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof
|
|
21472
|
+
}), e.parent && e.parent.remove(e), e instanceof z && !(e instanceof V) && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((i) => this.disposeMaterial(i)) : this.disposeMaterial(e.material))), e instanceof Lt && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof Io && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof V && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((i) => this.disposeMaterial(i)) : this.disposeMaterial(e.material)), e.instanceMatrix && (e.instanceMatrix = null), e.instanceColor && (e.instanceColor = null)), e instanceof wi && e.material && this.disposeMaterial(e.material), e instanceof _o && e.shadow?.dispose?.();
|
|
21467
21473
|
}
|
|
21468
21474
|
/**
|
|
21469
21475
|
* 清理材质及其纹理
|
|
@@ -21518,6 +21524,6 @@ class Rh {
|
|
|
21518
21524
|
}
|
|
21519
21525
|
}
|
|
21520
21526
|
export {
|
|
21521
|
-
|
|
21522
|
-
|
|
21527
|
+
Oh as E,
|
|
21528
|
+
bh as M
|
|
21523
21529
|
};
|