u-space 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -3
- package/dist/index.js +377 -331
- package/dist/plugins/atmosphere/index.cjs +1 -1
- package/dist/plugins/atmosphere/index.js +3255 -129
- package/dist/plugins/atmosphere/threeR185Compat.d.ts +2 -0
- package/dist/plugins/fire/FireEffect.d.ts +90 -0
- package/dist/plugins/fire/index.cjs +1 -0
- package/dist/plugins/fire/index.d.ts +1 -0
- package/dist/plugins/fire/index.js +433 -0
- package/dist/plugins/u-manager/index.cjs +57 -57
- package/dist/plugins/u-manager/index.d.ts +1 -0
- package/dist/plugins/u-manager/index.js +8791 -8291
- package/dist/plugins/u-manager/loaders/SceneInstancedLayer.d.ts +29 -0
- package/dist/plugins/u-manager/loaders/SceneLoader.d.ts +5 -5
- package/dist/plugins/u-manager/semantics/objects/FacilityInstancedLayer.d.ts +23 -8
- package/dist/src/tools/AnnotationManager.d.ts +4 -1
- package/dist/src/viewers/RenderPipeline.d.ts +6 -5
- package/docs/api-effects.md +2 -0
- package/docs/api-interactions.md +1 -0
- package/docs/api-managers.md +1 -1
- package/docs/api-plugin-fire.md +174 -0
- package/docs/api-plugin-u-manager.md +145 -8
- package/docs/api-tools.md +1 -1
- package/docs/changelog.md +21 -0
- package/docs/examples-guide.md +13 -1
- package/docs/getting-started.md +1 -1
- package/docs/index.md +1 -0
- package/docs/mcp.md +27 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { Raycaster as
|
|
2
|
-
import { pass as
|
|
3
|
-
import { bloom as
|
|
4
|
-
import { ssgi as
|
|
5
|
-
import { traa as
|
|
6
|
-
import
|
|
7
|
-
import { RoomEnvironment as
|
|
8
|
-
import { ViewHelper as
|
|
9
|
-
import { CSS2DRenderer as
|
|
10
|
-
import { CSS2DObject as
|
|
11
|
-
import { CSS3DRenderer as
|
|
12
|
-
import { CSS3DObject as
|
|
13
|
-
import { GLTFLoader as
|
|
14
|
-
import { FBXLoader as
|
|
15
|
-
import { OBJLoader as
|
|
16
|
-
import { STLLoader as
|
|
17
|
-
import { DRACOLoader as
|
|
18
|
-
import { KTX2Loader as
|
|
19
|
-
import { MeshoptDecoder as
|
|
20
|
-
import { HDRLoader as
|
|
21
|
-
import { clone as
|
|
22
|
-
import { Easing as f, Tween as
|
|
23
|
-
class
|
|
1
|
+
import { Raycaster as ze, Vector2 as S, EventDispatcher as Ne, Box2 as rt, Matrix4 as De, Vector3 as v, Box3 as X, Scene as ke, Color as M, AmbientLight as ot, DirectionalLight as ye, PointLight as we, SpotLight as ve, HemisphereLight as be, DirectionalLightHelper as at, PointLightHelper as ct, SpotLightHelper as ht, HemisphereLightHelper as lt, RenderPipeline as dt, PerspectiveCamera as te, Sphere as je, Spherical as T, Quaternion as pt, Vector4 as ut, MathUtils as mt, PMREMGenerator as ft, OrthographicCamera as se, TimestampQuery as J, Cache as gt, Timer as yt, WebGPURenderer as wt, PCFShadowMap as vt, AgXToneMapping as bt, Fog as xt, FogExp2 as Ct, MeshStandardNodeMaterial as L, Loader as St, LoaderUtils as B, FileLoader as Ue, TextureLoader as He, Group as R, SRGBColorSpace as Fe, RepeatWrapping as xe, BufferGeometry as K, BufferAttribute as Ce, Mesh as k, FrontSide as Mt, BackSide as Tt, DoubleSide as _t, REVISION as Se, CubeTextureLoader as Et, EquirectangularReflectionMapping as Pt, Sprite as Ot, AnimationMixer as At, LoopRepeat as It, LoopOnce as Bt, SphereGeometry as Rt, TubeGeometry as Lt, LineCurve3 as zt, CatmullRomCurve3 as Nt, SpriteNodeMaterial as Dt, CanvasTexture as kt, ShapeGeometry as jt, Shape as Ge, ExtrudeGeometry as Ut, PlaneGeometry as Ht, CircleGeometry as Ft, ClippingGroup as Gt, Plane as $t, PlaneHelper as Wt, LineBasicMaterial as ne, Line as ie } from "three/webgpu";
|
|
2
|
+
import { pass as fe, mrt as Kt, output as Qt, add as Me, blendColor as qt, emissive as Xt, normalView as Yt, velocity as Vt, color as H, uv as Te, time as re, pow as oe, sin as ge, mix as ae, mx_noise_float as _e, Fn as $e, userData as I, materialColor as Ee, select as ce, materialOpacity as Jt, vec3 as Zt } from "three/tsl";
|
|
3
|
+
import { bloom as es } from "three/addons/tsl/display/BloomNode.js";
|
|
4
|
+
import { ssgi as ts } from "three/addons/tsl/display/SSGINode.js";
|
|
5
|
+
import { traa as ss } from "three/addons/tsl/display/TRAANode.js";
|
|
6
|
+
import We from "camera-controls";
|
|
7
|
+
import { RoomEnvironment as ns } from "three/addons/environments/RoomEnvironment.js";
|
|
8
|
+
import { ViewHelper as is } from "three/addons/helpers/ViewHelper.js";
|
|
9
|
+
import { CSS2DRenderer as rs, CSS2DObject as os } from "three/addons/renderers/CSS2DRenderer.js";
|
|
10
|
+
import { CSS2DObject as Fn } from "three/addons/renderers/CSS2DRenderer.js";
|
|
11
|
+
import { CSS3DRenderer as as, CSS3DSprite as cs, CSS3DObject as hs } from "three/addons/renderers/CSS3DRenderer.js";
|
|
12
|
+
import { CSS3DObject as $n, CSS3DSprite as Wn } from "three/addons/renderers/CSS3DRenderer.js";
|
|
13
|
+
import { GLTFLoader as Ke } from "three/addons/loaders/GLTFLoader.js";
|
|
14
|
+
import { FBXLoader as ls } from "three/addons/loaders/FBXLoader.js";
|
|
15
|
+
import { OBJLoader as ds } from "three/addons/loaders/OBJLoader.js";
|
|
16
|
+
import { STLLoader as ps } from "three/addons/loaders/STLLoader.js";
|
|
17
|
+
import { DRACOLoader as us } from "three/addons/loaders/DRACOLoader.js";
|
|
18
|
+
import { KTX2Loader as ms } from "three/addons/loaders/KTX2Loader.js";
|
|
19
|
+
import { MeshoptDecoder as Pe } from "three/addons/libs/meshopt_decoder.module.js";
|
|
20
|
+
import { HDRLoader as fs } from "three/addons/loaders/HDRLoader.js";
|
|
21
|
+
import { clone as gs } from "three/addons/utils/SkeletonUtils.js";
|
|
22
|
+
import { Easing as f, Tween as ys } from "three/addons/libs/tween.module.js";
|
|
23
|
+
class ws {
|
|
24
24
|
/** The type of event (e.g., 'click', 'pointerdown'). */
|
|
25
25
|
type;
|
|
26
26
|
/** The original 3D object that triggered the event. */
|
|
@@ -48,15 +48,15 @@ class gs {
|
|
|
48
48
|
return this._propagationStopped;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
class
|
|
51
|
+
class vs {
|
|
52
52
|
domElement;
|
|
53
53
|
scene;
|
|
54
54
|
camera;
|
|
55
|
-
raycaster = new
|
|
56
|
-
pointer = new
|
|
55
|
+
raycaster = new ze();
|
|
56
|
+
pointer = new S();
|
|
57
57
|
hoveredObject = null;
|
|
58
58
|
pointerDownTime = 0;
|
|
59
|
-
pointerDownPos = new
|
|
59
|
+
pointerDownPos = new S();
|
|
60
60
|
clickTimer = null;
|
|
61
61
|
longPressThreshold = 500;
|
|
62
62
|
moveThreshold = 0.01;
|
|
@@ -143,7 +143,7 @@ class ys {
|
|
|
143
143
|
* Dispatches an event to the target object and bubbles up the parent chain.
|
|
144
144
|
*/
|
|
145
145
|
_dispatchToTarget(e, t, s, n) {
|
|
146
|
-
const i = new
|
|
146
|
+
const i = new ws({
|
|
147
147
|
type: e,
|
|
148
148
|
target: t,
|
|
149
149
|
intersect: s,
|
|
@@ -205,7 +205,7 @@ class ys {
|
|
|
205
205
|
this.domElement.removeEventListener("click", this._onClick), this.domElement.removeEventListener("dblclick", this._onDblClick), this.domElement.removeEventListener("contextmenu", this._onContextMenu), this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.clickTimer && (clearTimeout(this.clickTimer), this.clickTimer = null), this.hoveredObject = null, this._excludeSet.clear();
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
class
|
|
208
|
+
class Tn extends Ne {
|
|
209
209
|
scene;
|
|
210
210
|
camera;
|
|
211
211
|
domElement;
|
|
@@ -215,8 +215,8 @@ class xn extends Ie {
|
|
|
215
215
|
// Box selection state
|
|
216
216
|
_boxSelectionEnabled = !1;
|
|
217
217
|
_isSelecting = !1;
|
|
218
|
-
_startPoint = new
|
|
219
|
-
_endPoint = new
|
|
218
|
+
_startPoint = new S();
|
|
219
|
+
_endPoint = new S();
|
|
220
220
|
_selectionBox = null;
|
|
221
221
|
_deep = !0;
|
|
222
222
|
/**
|
|
@@ -315,21 +315,21 @@ class xn extends Ie {
|
|
|
315
315
|
this._selectionBox.style.left = `${e}px`, this._selectionBox.style.top = `${t}px`, this._selectionBox.style.width = `${s}px`, this._selectionBox.style.height = `${n}px`;
|
|
316
316
|
}
|
|
317
317
|
_getObjectsInBox() {
|
|
318
|
-
const e = this._container.getBoundingClientRect(), t = e.width, s = e.height, n = new
|
|
318
|
+
const e = this._container.getBoundingClientRect(), t = e.width, s = e.height, n = new S(
|
|
319
319
|
this._startPoint.x / t * 2 - 1,
|
|
320
320
|
-(this._startPoint.y / s) * 2 + 1
|
|
321
|
-
), i = new
|
|
321
|
+
), i = new S(
|
|
322
322
|
this._endPoint.x / t * 2 - 1,
|
|
323
323
|
-(this._endPoint.y / s) * 2 + 1
|
|
324
|
-
), r = new
|
|
325
|
-
new
|
|
326
|
-
new
|
|
327
|
-
), o = this.targetObjects || this.scene.children, a = [], c = new
|
|
324
|
+
), r = new rt(
|
|
325
|
+
new S(Math.min(n.x, i.x), Math.min(n.y, i.y)),
|
|
326
|
+
new S(Math.max(n.x, i.x), Math.max(n.y, i.y))
|
|
327
|
+
), o = this.targetObjects || this.scene.children, a = [], c = new De();
|
|
328
328
|
c.multiplyMatrices(this.camera.projectionMatrix, this.camera.matrixWorldInverse);
|
|
329
329
|
const l = (d) => {
|
|
330
330
|
if (!d.visible) return;
|
|
331
331
|
const p = new v();
|
|
332
|
-
if (p.setFromMatrixPosition(d.matrixWorld), p.applyMatrix4(c), p.z > -1 && p.z < 1 && r.containsPoint(new
|
|
332
|
+
if (p.setFromMatrixPosition(d.matrixWorld), p.applyMatrix4(c), p.z > -1 && p.z < 1 && r.containsPoint(new S(p.x, p.y)) && a.push(d), this._deep)
|
|
333
333
|
for (const u of d.children)
|
|
334
334
|
l(u);
|
|
335
335
|
};
|
|
@@ -341,7 +341,19 @@ class xn extends Ie {
|
|
|
341
341
|
this.disableBoxSelection(), this._selected.clear();
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
|
|
344
|
+
function Z(h, e) {
|
|
345
|
+
const t = h;
|
|
346
|
+
if (t.setSceneInstanceVisible) {
|
|
347
|
+
t.setSceneInstanceVisible(e);
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
if (t.setFacilityVisible) {
|
|
351
|
+
t.setFacilityVisible(e);
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
h.visible = e, t.markSceneInstanceRenderDirty?.(), t.markFacilityRenderDirty?.();
|
|
355
|
+
}
|
|
356
|
+
class bs {
|
|
345
357
|
idMap = /* @__PURE__ */ new Map();
|
|
346
358
|
nameMap = /* @__PURE__ */ new Map();
|
|
347
359
|
typeMap = /* @__PURE__ */ new Map();
|
|
@@ -448,35 +460,47 @@ class ws {
|
|
|
448
460
|
*/
|
|
449
461
|
show(e) {
|
|
450
462
|
const t = this.idMap.get(e);
|
|
451
|
-
t && (t
|
|
463
|
+
t && Z(t, !0);
|
|
452
464
|
}
|
|
453
465
|
/**
|
|
454
466
|
* Hide an object by id.
|
|
455
467
|
*/
|
|
456
468
|
hide(e) {
|
|
457
469
|
const t = this.idMap.get(e);
|
|
458
|
-
t && (t
|
|
470
|
+
t && Z(t, !1);
|
|
459
471
|
}
|
|
460
472
|
/**
|
|
461
473
|
* Show only the specified objects, hide all others.
|
|
462
474
|
*/
|
|
463
475
|
isolate(e) {
|
|
464
476
|
const t = new Set(e);
|
|
465
|
-
for (const
|
|
466
|
-
n
|
|
477
|
+
for (const s of this.allObjects) {
|
|
478
|
+
const n = this.objectIds.get(s) ?? /* @__PURE__ */ new Set();
|
|
479
|
+
Z(s, [...n].some((i) => t.has(i)));
|
|
480
|
+
}
|
|
467
481
|
}
|
|
468
482
|
/**
|
|
469
483
|
* Set the opacity of an object's materials.
|
|
470
484
|
*/
|
|
471
485
|
setOpacity(e, t) {
|
|
472
486
|
const s = this.idMap.get(e);
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
487
|
+
if (!s) return;
|
|
488
|
+
const n = s;
|
|
489
|
+
if (n.setSceneInstanceOpacity) {
|
|
490
|
+
n.setSceneInstanceOpacity(t);
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
if (n.setFacilityOpacity) {
|
|
494
|
+
n.setFacilityOpacity(t);
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
s.traverse((i) => {
|
|
498
|
+
if (!i.isMesh) return;
|
|
499
|
+
const r = i.material;
|
|
500
|
+
if (!r) return;
|
|
501
|
+
const o = Array.isArray(r) ? r : [r];
|
|
502
|
+
for (const a of o)
|
|
503
|
+
a.transparent = t < 1, a.opacity = t, a.needsUpdate = !0;
|
|
480
504
|
});
|
|
481
505
|
}
|
|
482
506
|
/**
|
|
@@ -515,10 +539,10 @@ class ws {
|
|
|
515
539
|
*/
|
|
516
540
|
showAll() {
|
|
517
541
|
for (const e of this.allObjects)
|
|
518
|
-
e
|
|
542
|
+
Z(e, !0);
|
|
519
543
|
}
|
|
520
544
|
}
|
|
521
|
-
class
|
|
545
|
+
class _n {
|
|
522
546
|
scenes = /* @__PURE__ */ new Map();
|
|
523
547
|
_activeSceneKey = null;
|
|
524
548
|
/**
|
|
@@ -531,8 +555,8 @@ class Cn {
|
|
|
531
555
|
* Create and register a new scene.
|
|
532
556
|
*/
|
|
533
557
|
create(e, t = {}) {
|
|
534
|
-
const s = new
|
|
535
|
-
return t.background !== void 0 && (s.background = new
|
|
558
|
+
const s = new ke();
|
|
559
|
+
return t.background !== void 0 && (s.background = new M(t.background)), this.scenes.set(e, s), s;
|
|
536
560
|
}
|
|
537
561
|
/**
|
|
538
562
|
* Get a scene by key.
|
|
@@ -571,7 +595,7 @@ class Cn {
|
|
|
571
595
|
const t = this.scenes.get(e);
|
|
572
596
|
if (!t) return null;
|
|
573
597
|
let s = null;
|
|
574
|
-
return t.background instanceof
|
|
598
|
+
return t.background instanceof M && (s = `#${t.background.getHexString()}`), {
|
|
575
599
|
name: t.name || e,
|
|
576
600
|
background: s,
|
|
577
601
|
environmentRotation: {
|
|
@@ -592,7 +616,7 @@ class Cn {
|
|
|
592
616
|
return this.scenes.size;
|
|
593
617
|
}
|
|
594
618
|
}
|
|
595
|
-
class
|
|
619
|
+
class En {
|
|
596
620
|
scene;
|
|
597
621
|
lights = /* @__PURE__ */ new Map();
|
|
598
622
|
helpers = /* @__PURE__ */ new Map();
|
|
@@ -600,15 +624,15 @@ class Mn {
|
|
|
600
624
|
this.scene = e;
|
|
601
625
|
}
|
|
602
626
|
addAmbient(e, t = {}) {
|
|
603
|
-
const { color: s = 16777215, intensity: n = 0.5 } = t, i = new
|
|
627
|
+
const { color: s = 16777215, intensity: n = 0.5 } = t, i = new ot(s, n);
|
|
604
628
|
return i.name = e, this._register(e, i), i;
|
|
605
629
|
}
|
|
606
630
|
addDirectional(e, t = {}) {
|
|
607
|
-
const { color: s = 16777215, intensity: n = 1, position: i = { x: 5, y: 10, z: 5 }, castShadow: r = !1, shadowMapSize: o = 1024 } = t, a = new
|
|
631
|
+
const { color: s = 16777215, intensity: n = 1, position: i = { x: 5, y: 10, z: 5 }, castShadow: r = !1, shadowMapSize: o = 1024 } = t, a = new ye(s, n);
|
|
608
632
|
return a.position.set(i.x, i.y, i.z), a.castShadow = r, r && a.shadow.mapSize.setScalar(o), a.name = e, this._register(e, a), a;
|
|
609
633
|
}
|
|
610
634
|
addPoint(e, t = {}) {
|
|
611
|
-
const { color: s = 16777215, intensity: n = 1, distance: i = 0, decay: r = 2, position: o = { x: 0, y: 5, z: 0 }, castShadow: a = !1 } = t, c = new
|
|
635
|
+
const { color: s = 16777215, intensity: n = 1, distance: i = 0, decay: r = 2, position: o = { x: 0, y: 5, z: 0 }, castShadow: a = !1 } = t, c = new we(s, n, i, r);
|
|
612
636
|
return c.position.set(o.x, o.y, o.z), c.castShadow = a, c.name = e, this._register(e, c), c;
|
|
613
637
|
}
|
|
614
638
|
addSpot(e, t = {}) {
|
|
@@ -622,11 +646,11 @@ class Mn {
|
|
|
622
646
|
position: c = { x: 0, y: 10, z: 0 },
|
|
623
647
|
target: l,
|
|
624
648
|
castShadow: d = !1
|
|
625
|
-
} = t, p = new
|
|
649
|
+
} = t, p = new ve(s, n, i, r, o, a);
|
|
626
650
|
return p.position.set(c.x, c.y, c.z), l && p.target.position.set(l.x, l.y, l.z), p.castShadow = d, p.name = e, this._register(e, p), p;
|
|
627
651
|
}
|
|
628
652
|
addHemisphere(e, t = {}) {
|
|
629
|
-
const { skyColor: s = 8900331, groundColor: n = 3549447, intensity: i = 0.6 } = t, r = new
|
|
653
|
+
const { skyColor: s = 8900331, groundColor: n = 3549447, intensity: i = 0.6 } = t, r = new be(s, n, i);
|
|
630
654
|
return r.name = e, this._register(e, r), r;
|
|
631
655
|
}
|
|
632
656
|
/**
|
|
@@ -677,7 +701,7 @@ class Mn {
|
|
|
677
701
|
const t = this.lights.get(e);
|
|
678
702
|
if (!t) return;
|
|
679
703
|
let s = null;
|
|
680
|
-
t instanceof
|
|
704
|
+
t instanceof ye ? s = new at(t, 1) : t instanceof we ? s = new ct(t, 0.5) : t instanceof ve ? s = new ht(t) : t instanceof be && (s = new lt(t, 1)), s && (this.scene.add(s), this.helpers.set(e, s));
|
|
681
705
|
}
|
|
682
706
|
/**
|
|
683
707
|
* Hide (remove) the helper for a light.
|
|
@@ -708,7 +732,7 @@ class Mn {
|
|
|
708
732
|
this.removeAll(), this.hideAllHelpers();
|
|
709
733
|
}
|
|
710
734
|
}
|
|
711
|
-
class
|
|
735
|
+
class xs extends dt {
|
|
712
736
|
scene;
|
|
713
737
|
camera;
|
|
714
738
|
scenePass;
|
|
@@ -737,7 +761,7 @@ class vs extends ht {
|
|
|
737
761
|
#f = !0;
|
|
738
762
|
constructor(...e) {
|
|
739
763
|
const [t, s, n] = e;
|
|
740
|
-
super(t), this.scene = s, this.camera = n, this.scenePass =
|
|
764
|
+
super(t), this.scene = s, this.camera = n, this.scenePass = fe(s, n), this.needsUpdateOutputNode = !0, this.#t = /* @__PURE__ */ new Set(), this.#e = [], this.#d = /* @__PURE__ */ new Set(), this.#c = /* @__PURE__ */ new Map(), this.#g();
|
|
741
765
|
}
|
|
742
766
|
/** @deprecated Use `scenePass` instead */
|
|
743
767
|
get currentOutputNode() {
|
|
@@ -804,14 +828,14 @@ class vs extends ht {
|
|
|
804
828
|
}
|
|
805
829
|
#i() {
|
|
806
830
|
const e = this.scenePass;
|
|
807
|
-
this.scenePass =
|
|
831
|
+
this.scenePass = fe(this.scene, this.camera), this.#g(), this.needsUpdateOutputNode = !0, e.dispose();
|
|
808
832
|
}
|
|
809
833
|
#g() {
|
|
810
834
|
if (this.#s || this.#o || this.#h || this.#c.size > 0) {
|
|
811
|
-
const t = { output:
|
|
835
|
+
const t = { output: Qt };
|
|
812
836
|
this.#c.forEach((s, n) => {
|
|
813
837
|
n !== "output" && (t[n] = s);
|
|
814
|
-
}), this.#s && (t.emissive =
|
|
838
|
+
}), this.#s && (t.emissive = Xt), this.#o && (t.normal = Yt), this.#h && (t.velocity = Vt), this.scenePass.setMRT(Kt(t));
|
|
815
839
|
}
|
|
816
840
|
}
|
|
817
841
|
#y() {
|
|
@@ -822,20 +846,20 @@ class vs extends ht {
|
|
|
822
846
|
#w() {
|
|
823
847
|
let e = this.scenePass.getTextureNode();
|
|
824
848
|
if (this.#o)
|
|
825
|
-
if (!(this.camera instanceof
|
|
849
|
+
if (!(this.camera instanceof te))
|
|
826
850
|
console.warn("RenderPipeline: SSGI requires a PerspectiveCamera, skipping.");
|
|
827
851
|
else {
|
|
828
|
-
const t = this.scenePass.getTextureNode(), s = this.scenePass.getTextureNode("depth"), n = this.scenePass.getTextureNode("normal"), i =
|
|
829
|
-
i.sliceCount.value = this.#a.sliceCount, i.stepCount.value = this.#a.stepCount, i.aoIntensity.value = this.#a.aoIntensity, i.giIntensity.value = this.#a.giIntensity, i.radius.value = this.#a.radius, i.thickness.value = this.#a.thickness, this.#p = i, e =
|
|
852
|
+
const t = this.scenePass.getTextureNode(), s = this.scenePass.getTextureNode("depth"), n = this.scenePass.getTextureNode("normal"), i = ts(t, s, n, this.camera);
|
|
853
|
+
i.sliceCount.value = this.#a.sliceCount, i.stepCount.value = this.#a.stepCount, i.aoIntensity.value = this.#a.aoIntensity, i.giIntensity.value = this.#a.giIntensity, i.radius.value = this.#a.radius, i.thickness.value = this.#a.thickness, this.#p = i, e = Me(e, i), this.#e.push(i);
|
|
830
854
|
}
|
|
831
855
|
if (this.#s) {
|
|
832
856
|
const t = this.scenePass.getTextureNode("emissive");
|
|
833
|
-
this.#n =
|
|
857
|
+
this.#n = es(
|
|
834
858
|
t,
|
|
835
859
|
this.#r.strength,
|
|
836
860
|
this.#r.radius,
|
|
837
861
|
this.#r.threshold
|
|
838
|
-
), e =
|
|
862
|
+
), e = Me(e, this.#n), this.#e.push(this.#n);
|
|
839
863
|
}
|
|
840
864
|
return e;
|
|
841
865
|
}
|
|
@@ -850,11 +874,11 @@ class vs extends ht {
|
|
|
850
874
|
t ||= i.includesTemporalAntialias === !0, s ||= i.includesOutputTransform === !0, e = i(this.scenePass, e);
|
|
851
875
|
}), this.#v(s), this.#h && !t) {
|
|
852
876
|
const i = this.scenePass.getTextureNode("depth"), r = this.scenePass.getTextureNode("velocity");
|
|
853
|
-
this.#l =
|
|
877
|
+
this.#l = ss(e, i, r, this.camera), this.#e.push(this.#l), e = this.#l;
|
|
854
878
|
} else
|
|
855
879
|
this.#l = null;
|
|
856
880
|
this.#t.size > 0 && this.#t.forEach((i) => {
|
|
857
|
-
const r =
|
|
881
|
+
const r = qt(e, i);
|
|
858
882
|
this.#e.push(r), e = r;
|
|
859
883
|
}), this.outputNode = e, this.needsUpdate = !0;
|
|
860
884
|
}
|
|
@@ -865,19 +889,19 @@ class vs extends ht {
|
|
|
865
889
|
this.#y(), this.scenePass.dispose(), super.dispose();
|
|
866
890
|
}
|
|
867
891
|
}
|
|
868
|
-
const
|
|
869
|
-
Vector2:
|
|
892
|
+
const Cs = {
|
|
893
|
+
Vector2: S,
|
|
870
894
|
Vector3: v,
|
|
871
|
-
Vector4:
|
|
872
|
-
Quaternion:
|
|
873
|
-
Matrix4:
|
|
874
|
-
Spherical:
|
|
895
|
+
Vector4: ut,
|
|
896
|
+
Quaternion: pt,
|
|
897
|
+
Matrix4: De,
|
|
898
|
+
Spherical: T,
|
|
875
899
|
Box3: X,
|
|
876
900
|
Sphere: je,
|
|
877
|
-
Raycaster:
|
|
901
|
+
Raycaster: ze
|
|
878
902
|
};
|
|
879
|
-
|
|
880
|
-
class
|
|
903
|
+
We.install({ THREE: Cs });
|
|
904
|
+
class Ss extends We {
|
|
881
905
|
constructor(...e) {
|
|
882
906
|
super(...e), this.minDistance = 0.2, this.smoothTime = 0.2, this.dollySpeed = 0.2;
|
|
883
907
|
}
|
|
@@ -885,7 +909,7 @@ class xs extends Ge {
|
|
|
885
909
|
* Set absolute angle for azimuth to avoid spinning
|
|
886
910
|
*/
|
|
887
911
|
absoluteRotations() {
|
|
888
|
-
this.azimuthAngle =
|
|
912
|
+
this.azimuthAngle = Ms(this.azimuthAngle, 0);
|
|
889
913
|
}
|
|
890
914
|
async flyToBox(e, t = {}) {
|
|
891
915
|
if (e.isEmpty())
|
|
@@ -893,7 +917,7 @@ class xs extends Ge {
|
|
|
893
917
|
this.absoluteRotations();
|
|
894
918
|
const { viewpoint: s = "frontTop", enableTransition: n = !0, padding: i = 0.1, cover: r = !1 } = t, o = [];
|
|
895
919
|
if (s !== "current") {
|
|
896
|
-
const a =
|
|
920
|
+
const a = Oe[s.toUpperCase()] ?? Oe.FRONTTOP, c = a.theta, l = a.phi;
|
|
897
921
|
o.push(
|
|
898
922
|
this.fitToBox(e, n, {
|
|
899
923
|
paddingLeft: i,
|
|
@@ -961,33 +985,33 @@ class xs extends Ge {
|
|
|
961
985
|
]);
|
|
962
986
|
}
|
|
963
987
|
}
|
|
964
|
-
const
|
|
965
|
-
LEFT: new
|
|
966
|
-
RIGHT: new
|
|
967
|
-
FRONT: new
|
|
968
|
-
BACK: new
|
|
969
|
-
TOP: new
|
|
970
|
-
BOTTOM: new
|
|
971
|
-
FRONTTOP: new
|
|
972
|
-
BACKTOP: new
|
|
973
|
-
LEFTTOP: new
|
|
974
|
-
RIGHTTOP: new
|
|
975
|
-
LEFTFRONTTOP: new
|
|
976
|
-
RIGHTFRONTTOP: new
|
|
977
|
-
LEFTBACKTOP: new
|
|
978
|
-
RIGHTBACKTOP: new
|
|
988
|
+
const Oe = {
|
|
989
|
+
LEFT: new T(0, Math.PI / 2, -Math.PI / 2),
|
|
990
|
+
RIGHT: new T(0, Math.PI / 2, Math.PI / 2),
|
|
991
|
+
FRONT: new T(0, Math.PI / 2, 0),
|
|
992
|
+
BACK: new T(0, Math.PI / 2, Math.PI),
|
|
993
|
+
TOP: new T(0, 0, 0),
|
|
994
|
+
BOTTOM: new T(0, Math.PI, 0),
|
|
995
|
+
FRONTTOP: new T(0, Math.PI / 4, 0),
|
|
996
|
+
BACKTOP: new T(0, Math.PI / 4, Math.PI),
|
|
997
|
+
LEFTTOP: new T(0, Math.PI / 4, -Math.PI / 2),
|
|
998
|
+
RIGHTTOP: new T(0, Math.PI / 4, Math.PI / 2),
|
|
999
|
+
LEFTFRONTTOP: new T(0, Math.PI / 4, -Math.PI / 4),
|
|
1000
|
+
RIGHTFRONTTOP: new T(0, Math.PI / 4, Math.PI / 4),
|
|
1001
|
+
LEFTBACKTOP: new T(0, Math.PI / 4, -Math.PI / 4 * 3),
|
|
1002
|
+
RIGHTBACKTOP: new T(0, Math.PI / 4, Math.PI / 4 * 3)
|
|
979
1003
|
};
|
|
980
|
-
function
|
|
1004
|
+
function Ms(h, e) {
|
|
981
1005
|
const t = h - e;
|
|
982
|
-
return
|
|
1006
|
+
return mt.euclideanModulo(t + Math.PI, Math.PI * 2) - Math.PI;
|
|
983
1007
|
}
|
|
984
|
-
class
|
|
985
|
-
environment = new
|
|
1008
|
+
class Ts {
|
|
1009
|
+
environment = new ns();
|
|
986
1010
|
renderer;
|
|
987
1011
|
pmremGenerator;
|
|
988
1012
|
envMap = null;
|
|
989
1013
|
constructor(e) {
|
|
990
|
-
this.renderer = e, this.pmremGenerator = new
|
|
1014
|
+
this.renderer = e, this.pmremGenerator = new ft(e);
|
|
991
1015
|
}
|
|
992
1016
|
update() {
|
|
993
1017
|
this.envMap || (this.envMap = this.pmremGenerator.fromScene(this.environment).texture);
|
|
@@ -996,20 +1020,20 @@ class Ms {
|
|
|
996
1020
|
this.pmremGenerator.dispose(), this.envMap?.dispose();
|
|
997
1021
|
}
|
|
998
1022
|
}
|
|
999
|
-
const
|
|
1000
|
-
class
|
|
1023
|
+
const ee = 128;
|
|
1024
|
+
class _s extends is {
|
|
1001
1025
|
viewer;
|
|
1002
1026
|
overlayPass;
|
|
1003
1027
|
constructor(e) {
|
|
1004
1028
|
super(e.camera, e.el), this.viewer = e;
|
|
1005
|
-
const t = new
|
|
1006
|
-
t.position.set(0, 0, 2), this.overlayPass =
|
|
1029
|
+
const t = new se(-2, 2, 2, -2, 0, 4);
|
|
1030
|
+
t.position.set(0, 0, 2), this.overlayPass = fe(this, t), this.setLabels("x", "y", "z");
|
|
1007
1031
|
}
|
|
1008
1032
|
_update = () => {
|
|
1009
1033
|
this.quaternion.copy(this.viewer.camera.quaternion).invert();
|
|
1010
1034
|
const e = this.location;
|
|
1011
1035
|
let t, s;
|
|
1012
|
-
e.left !== null ? t = e.left : t = this.viewer.el.offsetWidth -
|
|
1036
|
+
e.left !== null ? t = e.left : t = this.viewer.el.offsetWidth - ee - e.right, e.top !== null ? s = e.top : s = this.viewer.el.offsetHeight - ee - e.bottom, this.overlayPass.setViewport(t, s, ee, ee);
|
|
1013
1037
|
};
|
|
1014
1038
|
enable() {
|
|
1015
1039
|
return this.viewer.renderPipeline.addOverlayPass(this.overlayPass), this.viewer.addEventListener("beforeRender", this._update), this.viewer.render(), this;
|
|
@@ -1018,8 +1042,8 @@ class Ss extends ss {
|
|
|
1018
1042
|
return this.viewer.renderPipeline.removeOverlayPass(this.overlayPass), this.viewer.removeEventListener("beforeRender", this._update), this.viewer.render(), this;
|
|
1019
1043
|
}
|
|
1020
1044
|
}
|
|
1021
|
-
const
|
|
1022
|
-
class
|
|
1045
|
+
const Qe = "position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden;", Es = Qe + "z-index:0;", Ps = Qe + "z-index:1;";
|
|
1046
|
+
class Os {
|
|
1023
1047
|
el;
|
|
1024
1048
|
css2dRenderer = null;
|
|
1025
1049
|
css3dRenderer = null;
|
|
@@ -1027,21 +1051,21 @@ class Es {
|
|
|
1027
1051
|
this.el = e, getComputedStyle(e).position === "static" && (e.style.position = "relative");
|
|
1028
1052
|
}
|
|
1029
1053
|
initCSS2DRenderer() {
|
|
1030
|
-
const e = new
|
|
1031
|
-
return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText =
|
|
1054
|
+
const e = new rs();
|
|
1055
|
+
return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText = Ps, this.el.appendChild(e.domElement), this.css2dRenderer = e, e;
|
|
1032
1056
|
}
|
|
1033
1057
|
initCSS3DRenderer() {
|
|
1034
|
-
const e = new
|
|
1035
|
-
return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText =
|
|
1058
|
+
const e = new as();
|
|
1059
|
+
return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText = Es, this.el.appendChild(e.domElement), this.css3dRenderer = e, e;
|
|
1036
1060
|
}
|
|
1037
1061
|
createCSS2DObject(e) {
|
|
1038
|
-
return this.css2dRenderer || this.initCSS2DRenderer(), new
|
|
1062
|
+
return this.css2dRenderer || this.initCSS2DRenderer(), new os(e);
|
|
1039
1063
|
}
|
|
1040
1064
|
createCSS25DObject(e) {
|
|
1041
|
-
return this.css3dRenderer || this.initCSS3DRenderer(), new
|
|
1065
|
+
return this.css3dRenderer || this.initCSS3DRenderer(), new cs(e);
|
|
1042
1066
|
}
|
|
1043
1067
|
createCSS3DObject(e) {
|
|
1044
|
-
return this.css3dRenderer || this.initCSS3DRenderer(), new
|
|
1068
|
+
return this.css3dRenderer || this.initCSS3DRenderer(), new hs(e);
|
|
1045
1069
|
}
|
|
1046
1070
|
render(e, t) {
|
|
1047
1071
|
this.css2dRenderer && this.css2dRenderer.render(e, t), this.css3dRenderer && this.css3dRenderer.render(e, t);
|
|
@@ -1053,8 +1077,8 @@ class Es {
|
|
|
1053
1077
|
this.css2dRenderer && (this.el.removeChild(this.css2dRenderer.domElement), this.css2dRenderer = null), this.css3dRenderer && (this.el.removeChild(this.css3dRenderer.domElement), this.css3dRenderer = null);
|
|
1054
1078
|
}
|
|
1055
1079
|
}
|
|
1056
|
-
const
|
|
1057
|
-
class
|
|
1080
|
+
const As = "timestamp-query";
|
|
1081
|
+
class Is {
|
|
1058
1082
|
el;
|
|
1059
1083
|
renderer;
|
|
1060
1084
|
container;
|
|
@@ -1105,7 +1129,7 @@ class Os {
|
|
|
1105
1129
|
}
|
|
1106
1130
|
#s() {
|
|
1107
1131
|
try {
|
|
1108
|
-
return this.renderer.hasFeature(
|
|
1132
|
+
return this.renderer.hasFeature(As);
|
|
1109
1133
|
} catch {
|
|
1110
1134
|
return !0;
|
|
1111
1135
|
}
|
|
@@ -1127,8 +1151,8 @@ class Os {
|
|
|
1127
1151
|
this.#n(J.RENDER), this.#n(J.COMPUTE);
|
|
1128
1152
|
}
|
|
1129
1153
|
}
|
|
1130
|
-
|
|
1131
|
-
class
|
|
1154
|
+
gt.enabled = !0;
|
|
1155
|
+
class Pn extends Ne {
|
|
1132
1156
|
el;
|
|
1133
1157
|
renderer;
|
|
1134
1158
|
scene;
|
|
@@ -1145,11 +1169,11 @@ class Sn extends Ie {
|
|
|
1145
1169
|
frameCount = 1;
|
|
1146
1170
|
frameloop = "demand";
|
|
1147
1171
|
constructor({ el: e, rendererOptions: t }) {
|
|
1148
|
-
super(), this.el = e, this.renderer = this._initRenderer(t), this.scene = this.createScene(), this.camera = this.createPerspectiveCamera(), this.info = new
|
|
1172
|
+
super(), this.el = e, this.renderer = this._initRenderer(t), this.scene = this.createScene(), this.camera = this.createPerspectiveCamera(), this.info = new Is(this.el, this.renderer), this.controls = new Ss(this.camera, this.renderer.domElement), this.renderPipeline = new xs(this.renderer, this.scene, this.camera), this.timer = new yt(), this.roomEnvironment = new Ts(this.renderer), this.interactionManager = new vs(this.renderer.domElement, this.scene, this.camera), this.objectManager = new bs(), this.viewerHelper = new _s(this), this.cssRenderer = new Os(this.el), window.addEventListener("resize", this.onWindowResize);
|
|
1149
1173
|
}
|
|
1150
1174
|
onWindowResize = () => {
|
|
1151
1175
|
const e = this.el.clientWidth, t = this.el.clientHeight;
|
|
1152
|
-
this.camera instanceof
|
|
1176
|
+
this.camera instanceof te ? (this.camera.aspect = e / t, this.camera.updateProjectionMatrix()) : this.camera instanceof se && (this.camera.left = -e / 2, this.camera.right = e / 2, this.camera.top = t / 2, this.camera.bottom = -t / 2, this.camera.updateProjectionMatrix()), this.renderer.setSize(e, t), this.cssRenderer.resize(e, t), this.render();
|
|
1153
1177
|
};
|
|
1154
1178
|
async init() {
|
|
1155
1179
|
await this.renderer.init(), this.roomEnvironment.update(), this.scene.environment = this.roomEnvironment.envMap;
|
|
@@ -1158,7 +1182,7 @@ class Sn extends Ie {
|
|
|
1158
1182
|
this.camera = e, this.controls.camera = e, this.interactionManager.setCamera(e), this.renderPipeline.setCamera(e), this.onWindowResize(), this.dispatchEvent({ type: "cameraChange", camera: e });
|
|
1159
1183
|
}
|
|
1160
1184
|
setCameraByType(e) {
|
|
1161
|
-
e === "perspective" && !(this.camera instanceof
|
|
1185
|
+
e === "perspective" && !(this.camera instanceof te) ? this.setCamera(this.createPerspectiveCamera()) : e === "orthographic" && !(this.camera instanceof se) && this.setCamera(this.createOrthographicCamera());
|
|
1162
1186
|
}
|
|
1163
1187
|
render(e = 1) {
|
|
1164
1188
|
return this.frameCount += e, new Promise((t) => {
|
|
@@ -1176,25 +1200,25 @@ class Sn extends Ie {
|
|
|
1176
1200
|
this.dispatchEvent({ type: "afterControlsUpdate", time: e, delta: t }), this.frameCount > 0 && (this.frameCount--, s = !0), this.frameloop === "always" && (s = !0), s && (this.dispatchEvent({ type: "beforeRender", time: e, delta: t }), this.renderer.info.reset(), this.renderPipeline.render(), this.cssRenderer.render(this.scene, this.camera), this.info.update(), this.dispatchEvent({ type: "afterRender", time: e, delta: t }));
|
|
1177
1201
|
};
|
|
1178
1202
|
_initRenderer(e) {
|
|
1179
|
-
const t = new
|
|
1180
|
-
|
|
1203
|
+
const t = new wt({
|
|
1204
|
+
reversedDepthBuffer: !0,
|
|
1181
1205
|
antialias: !1,
|
|
1182
1206
|
depth: !1,
|
|
1183
1207
|
trackTimestamp: !1,
|
|
1184
1208
|
...e
|
|
1185
1209
|
});
|
|
1186
|
-
return t.setSize(this.el.clientWidth, this.el.clientHeight), t.shadowMap.enabled = !0, t.shadowMap.type =
|
|
1210
|
+
return t.setSize(this.el.clientWidth, this.el.clientHeight), t.shadowMap.enabled = !0, t.shadowMap.type = vt, t.toneMapping = bt, t.toneMappingExposure = 1, t.info.autoReset = !1, t.setPixelRatio(Math.min(window.devicePixelRatio, 1.5)), t.setAnimationLoop(this.animate), this.el.appendChild(t.domElement), t;
|
|
1187
1211
|
}
|
|
1188
1212
|
createScene() {
|
|
1189
|
-
const e = new
|
|
1190
|
-
return e.background = new
|
|
1213
|
+
const e = new ke();
|
|
1214
|
+
return e.background = new M(0), e;
|
|
1191
1215
|
}
|
|
1192
1216
|
createPerspectiveCamera() {
|
|
1193
|
-
const e = new
|
|
1217
|
+
const e = new te(50, this.el.clientWidth / this.el.clientHeight, 0.1, 1e5);
|
|
1194
1218
|
return e.position.setScalar(5), e;
|
|
1195
1219
|
}
|
|
1196
1220
|
createOrthographicCamera() {
|
|
1197
|
-
const e = new
|
|
1221
|
+
const e = new se(
|
|
1198
1222
|
-this.el.clientWidth / 2,
|
|
1199
1223
|
this.el.clientWidth / 2,
|
|
1200
1224
|
this.el.clientHeight / 2,
|
|
@@ -1223,7 +1247,7 @@ class Sn extends Ie {
|
|
|
1223
1247
|
* Set the scene background color, texture, or null.
|
|
1224
1248
|
*/
|
|
1225
1249
|
setBackground(e) {
|
|
1226
|
-
e === null ? this.scene.background = null : e instanceof
|
|
1250
|
+
e === null ? this.scene.background = null : e instanceof M || typeof e == "number" || typeof e == "string" ? this.scene.background = new M(e) : this.scene.background = e, this.render();
|
|
1227
1251
|
}
|
|
1228
1252
|
/**
|
|
1229
1253
|
* Set the scene environment map for reflections / IBL.
|
|
@@ -1248,14 +1272,14 @@ class Sn extends Ie {
|
|
|
1248
1272
|
*/
|
|
1249
1273
|
enableFog(e = {}) {
|
|
1250
1274
|
const { color: t = 13421772, near: s = 10, far: n = 100 } = e;
|
|
1251
|
-
this.scene.fog = new
|
|
1275
|
+
this.scene.fog = new xt(t, s, n), this.render();
|
|
1252
1276
|
}
|
|
1253
1277
|
/**
|
|
1254
1278
|
* Enable exponential fog.
|
|
1255
1279
|
*/
|
|
1256
1280
|
enableFogExp2(e = {}) {
|
|
1257
1281
|
const { color: t = 13421772, density: s = 0.01 } = e;
|
|
1258
|
-
this.scene.fog = new
|
|
1282
|
+
this.scene.fog = new Ct(t, s), this.render();
|
|
1259
1283
|
}
|
|
1260
1284
|
/**
|
|
1261
1285
|
* Disable fog.
|
|
@@ -1267,19 +1291,19 @@ class Sn extends Ie {
|
|
|
1267
1291
|
this.el.removeChild(this.renderer.domElement), window.removeEventListener("resize", this.onWindowResize), this.info.dispose(), this.interactionManager.dispose(), this.roomEnvironment.dispose(), this.cssRenderer.dispose(), this.renderPipeline.dispose(), this.renderer.dispose();
|
|
1268
1292
|
}
|
|
1269
1293
|
}
|
|
1270
|
-
class
|
|
1294
|
+
class Bs extends Ke {
|
|
1271
1295
|
constructor(e) {
|
|
1272
1296
|
super(e);
|
|
1273
1297
|
}
|
|
1274
1298
|
parse(e, t, s, n) {
|
|
1275
|
-
if (
|
|
1299
|
+
if (Rs(e.slice(0, 8)) === "SBMG----") {
|
|
1276
1300
|
const r = Ls(e.slice(8));
|
|
1277
1301
|
return super.parse(r, t, s, n);
|
|
1278
1302
|
} else
|
|
1279
1303
|
return super.parse(e, t, s, n);
|
|
1280
1304
|
}
|
|
1281
1305
|
}
|
|
1282
|
-
function
|
|
1306
|
+
function Rs(h) {
|
|
1283
1307
|
return new TextDecoder().decode(new Uint8Array(h));
|
|
1284
1308
|
}
|
|
1285
1309
|
function Ls(h) {
|
|
@@ -1290,59 +1314,59 @@ function Ls(h) {
|
|
|
1290
1314
|
}
|
|
1291
1315
|
return e.buffer;
|
|
1292
1316
|
}
|
|
1293
|
-
const
|
|
1294
|
-
function
|
|
1295
|
-
let e =
|
|
1317
|
+
const zs = 8, Ns = 130, Ae = 66, Ds = "SBK-----", ks = "SBM-----", qe = new TextDecoder(), js = new TextEncoder();
|
|
1318
|
+
function Us(h) {
|
|
1319
|
+
let e = zs;
|
|
1296
1320
|
const t = new Uint8Array(h, 0, e);
|
|
1297
|
-
if (
|
|
1321
|
+
if (qe.decode(t) !== Ds)
|
|
1298
1322
|
return h;
|
|
1299
|
-
e +=
|
|
1323
|
+
e += Ns;
|
|
1300
1324
|
const n = new Uint8Array(h, 0, e);
|
|
1301
1325
|
if (n[40] === 1) {
|
|
1302
|
-
const r = js.encode(
|
|
1303
|
-
let l =
|
|
1304
|
-
const d = e +
|
|
1326
|
+
const r = js.encode(ks), o = new Uint8Array([n[41]]), a = Hs(n), c = Fs(a);
|
|
1327
|
+
let l = Ae % c.length;
|
|
1328
|
+
const d = e + Ae, p = new Uint8Array(h, d), u = new Uint8Array(p.length);
|
|
1305
1329
|
for (let w = 0; w < p.length; w++)
|
|
1306
1330
|
u[w] = p[w] ^ c[l], l = (l + 1) % c.length;
|
|
1307
1331
|
const m = new Uint8Array(r.length + o.length + u.length);
|
|
1308
1332
|
return m.set(r), m.set(o, r.length), m.set(u, r.length + o.length), m.buffer;
|
|
1309
1333
|
}
|
|
1310
1334
|
}
|
|
1311
|
-
function
|
|
1335
|
+
function Hs(h) {
|
|
1312
1336
|
const e = new Uint8Array(128);
|
|
1313
1337
|
return e.set(h.slice(42, 74), 0), e.set(h.slice(74, 138), 32), e.set(h.slice(8, 40), 96), e;
|
|
1314
1338
|
}
|
|
1315
|
-
function
|
|
1339
|
+
function Fs(h) {
|
|
1316
1340
|
const e = new Uint8Array(64);
|
|
1317
1341
|
return e.set(h.slice(0, 8), 0), e.set(h.slice(24, 32), 8), e.set(h.slice(40, 56), 16), e.set(h.slice(64, 88), 32), e.set(h.slice(96, 104), 56), e;
|
|
1318
1342
|
}
|
|
1319
|
-
const
|
|
1343
|
+
const Gs = (h, e, t) => {
|
|
1320
1344
|
const s = h.buffer.slice(t, t + e);
|
|
1321
|
-
let n =
|
|
1345
|
+
let n = qe.decode(s);
|
|
1322
1346
|
return n = n.replace("\\", "/"), n.startsWith("Maps/") || (n = `Maps/${n}`), n;
|
|
1323
|
-
},
|
|
1347
|
+
}, $s = (h, e, t) => {
|
|
1324
1348
|
const [s, n, i, r, o] = e, a = t || r < 1;
|
|
1325
|
-
return new
|
|
1349
|
+
return new L({
|
|
1326
1350
|
name: h,
|
|
1327
|
-
color: new
|
|
1351
|
+
color: new M(s, n, i),
|
|
1328
1352
|
opacity: r,
|
|
1329
1353
|
transparent: a,
|
|
1330
1354
|
alphaTest: 0.01,
|
|
1331
1355
|
side: o
|
|
1332
1356
|
});
|
|
1333
|
-
},
|
|
1334
|
-
class
|
|
1357
|
+
}, Ws = (h) => h?.toLowerCase().endsWith(".png") ?? !1;
|
|
1358
|
+
class Ks {
|
|
1335
1359
|
data;
|
|
1336
1360
|
options;
|
|
1337
1361
|
textureLoader;
|
|
1338
1362
|
littleEndian = !0;
|
|
1339
1363
|
materials = /* @__PURE__ */ new Map();
|
|
1340
1364
|
constructor(e, t) {
|
|
1341
|
-
this.data = e, this.options = t, this.textureLoader = new
|
|
1365
|
+
this.data = e, this.options = t, this.textureLoader = new He(t.manager), this.textureLoader.setCrossOrigin(t.crossOrigin), this.textureLoader.setRequestHeader(t.requestHeader);
|
|
1342
1366
|
}
|
|
1343
1367
|
parse(e, t) {
|
|
1344
1368
|
let s = this.data;
|
|
1345
|
-
const n =
|
|
1369
|
+
const n = Us(this.data);
|
|
1346
1370
|
n && (s = n);
|
|
1347
1371
|
const i = new DataView(s);
|
|
1348
1372
|
let r = 8;
|
|
@@ -1366,14 +1390,14 @@ class $s {
|
|
|
1366
1390
|
const p = e.getFloat32(t, this.littleEndian);
|
|
1367
1391
|
t += 4, t += 4, t += 4, t += 4, t += 4;
|
|
1368
1392
|
let u = e.getUint8(t);
|
|
1369
|
-
t += 1, u === 0 ? u =
|
|
1393
|
+
t += 1, u === 0 ? u = Mt : u === 1 ? u = Tt : u === 2 && (u = _t);
|
|
1370
1394
|
const m = e.getUint16(t, this.littleEndian);
|
|
1371
1395
|
t += 2;
|
|
1372
|
-
const w = m > 0 ?
|
|
1396
|
+
const w = m > 0 ? Gs(e, m, t) : "";
|
|
1373
1397
|
if (t += m, !this.materials.has(a)) {
|
|
1374
|
-
const x =
|
|
1375
|
-
this.materials.set(a, x), w && this.options.path && this.textureLoader.load(
|
|
1376
|
-
y.colorSpace =
|
|
1398
|
+
const x = $s(a, [c, l, d, p, u], Ws(w));
|
|
1399
|
+
this.materials.set(a, x), w && this.options.path && this.textureLoader.load(B.resolveURL(w, this.options.path), (y) => {
|
|
1400
|
+
y.colorSpace = Fe, y.wrapS = xe, y.wrapT = xe, y.flipY = !1, y.anisotropy = 16, x.map = y;
|
|
1377
1401
|
});
|
|
1378
1402
|
}
|
|
1379
1403
|
}
|
|
@@ -1395,7 +1419,7 @@ class $s {
|
|
|
1395
1419
|
const C = e.getUint16(t, this.littleEndian);
|
|
1396
1420
|
if (t += 2, C > 0)
|
|
1397
1421
|
for (let g = 0; g < C; g++) {
|
|
1398
|
-
const b = new
|
|
1422
|
+
const b = new S();
|
|
1399
1423
|
b.setX(e.getFloat32(t, this.littleEndian)), t += 4, b.setY(e.getFloat32(t, this.littleEndian)), t += 4, d.push(b);
|
|
1400
1424
|
}
|
|
1401
1425
|
const x = e.getUint16(t, this.littleEndian);
|
|
@@ -1414,13 +1438,13 @@ class $s {
|
|
|
1414
1438
|
for (let g = 0; g < p.length; g++) {
|
|
1415
1439
|
const b = p[g], z = l[b[0]], N = l[b[1]], P = l[b[2]];
|
|
1416
1440
|
y.push(...z.toArray(), ...N.toArray(), ...P.toArray());
|
|
1417
|
-
let
|
|
1441
|
+
let V = new S(), $ = new S(), j = new S();
|
|
1418
1442
|
const U = u[g];
|
|
1419
|
-
U !== void 0 && (
|
|
1443
|
+
U !== void 0 && (V = U[0], $ = U[1], j = U[2]), _.push(...V.toArray(), ...$.toArray(), ...j.toArray());
|
|
1420
1444
|
}
|
|
1421
1445
|
const O = new Float32Array(y), A = new Float32Array(_), E = new K();
|
|
1422
|
-
if (O.length > 0 && E.setAttribute("position", new
|
|
1423
|
-
const g = new
|
|
1446
|
+
if (O.length > 0 && E.setAttribute("position", new Ce(O, 3)), A.length > 0 && E.setAttribute("uv", new Ce(A, 2)), E.computeVertexNormals(), this.materials.has(c)) {
|
|
1447
|
+
const g = new k(E, this.materials.get(c));
|
|
1424
1448
|
g.name = a, g.castShadow = !0, g.receiveShadow = !0, n.add(g);
|
|
1425
1449
|
}
|
|
1426
1450
|
}
|
|
@@ -1431,20 +1455,20 @@ class $s {
|
|
|
1431
1455
|
console.warn("SBMLoader: SBM version 3 is not supported yet."), s(n);
|
|
1432
1456
|
}
|
|
1433
1457
|
}
|
|
1434
|
-
class
|
|
1458
|
+
class Qs extends St {
|
|
1435
1459
|
load(e, t, s, n) {
|
|
1436
1460
|
let i;
|
|
1437
1461
|
if (this.resourcePath !== "")
|
|
1438
1462
|
i = this.resourcePath;
|
|
1439
1463
|
else if (this.path !== "") {
|
|
1440
|
-
const a =
|
|
1441
|
-
i =
|
|
1464
|
+
const a = B.extractUrlBase(e);
|
|
1465
|
+
i = B.resolveURL(a, this.path);
|
|
1442
1466
|
} else
|
|
1443
|
-
i =
|
|
1467
|
+
i = B.extractUrlBase(e);
|
|
1444
1468
|
this.manager.itemStart(e);
|
|
1445
1469
|
const r = (a) => {
|
|
1446
1470
|
n ? n(a) : console.error(a), this.manager.itemError(e), this.manager.itemEnd(e);
|
|
1447
|
-
}, o = new
|
|
1471
|
+
}, o = new Ue(this.manager);
|
|
1448
1472
|
o.setPath(this.path), o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(
|
|
1449
1473
|
e,
|
|
1450
1474
|
(a) => {
|
|
@@ -1471,7 +1495,7 @@ class Ws extends xt {
|
|
|
1471
1495
|
n?.(new Error(`SBMLoader: Invalid SBM format: ${i}`));
|
|
1472
1496
|
return;
|
|
1473
1497
|
}
|
|
1474
|
-
new
|
|
1498
|
+
new Ks(e, {
|
|
1475
1499
|
path: t,
|
|
1476
1500
|
crossOrigin: this.crossOrigin,
|
|
1477
1501
|
requestHeader: this.requestHeader,
|
|
@@ -1493,7 +1517,7 @@ class Ws extends xt {
|
|
|
1493
1517
|
});
|
|
1494
1518
|
}
|
|
1495
1519
|
}
|
|
1496
|
-
const
|
|
1520
|
+
const qs = [
|
|
1497
1521
|
"map",
|
|
1498
1522
|
"alphaMap",
|
|
1499
1523
|
"aoMap",
|
|
@@ -1522,12 +1546,12 @@ const Ks = [
|
|
|
1522
1546
|
];
|
|
1523
1547
|
function W(h) {
|
|
1524
1548
|
return h.traverse((e) => {
|
|
1525
|
-
if (!(e instanceof
|
|
1549
|
+
if (!(e instanceof k)) return;
|
|
1526
1550
|
const t = Array.isArray(e.material) ? e.material : [e.material];
|
|
1527
1551
|
for (const s of t) {
|
|
1528
1552
|
if (!s) continue;
|
|
1529
1553
|
let n = !1;
|
|
1530
|
-
for (const i of
|
|
1554
|
+
for (const i of qs) {
|
|
1531
1555
|
const r = s[i];
|
|
1532
1556
|
r?.isTexture && r.image == null && (r.dispose(), s[i] = null, n = !0);
|
|
1533
1557
|
}
|
|
@@ -1535,21 +1559,21 @@ function W(h) {
|
|
|
1535
1559
|
}
|
|
1536
1560
|
}), h;
|
|
1537
1561
|
}
|
|
1538
|
-
class
|
|
1562
|
+
class D {
|
|
1539
1563
|
static CACHE_NAME = "u-space-model-loader-cache";
|
|
1540
|
-
static fileLoader = new
|
|
1541
|
-
static dracoLoader = new
|
|
1542
|
-
`https://cdn.jsdelivr.net/npm/three@0.${
|
|
1564
|
+
static fileLoader = new Ue().setResponseType("arraybuffer");
|
|
1565
|
+
static dracoLoader = new us().setDecoderPath(
|
|
1566
|
+
`https://cdn.jsdelivr.net/npm/three@0.${Se}.0/examples/jsm/libs/draco/`
|
|
1543
1567
|
);
|
|
1544
|
-
static ktx2Loader = new
|
|
1545
|
-
`https://cdn.jsdelivr.net/npm/three@0.${
|
|
1568
|
+
static ktx2Loader = new ms().setTranscoderPath(
|
|
1569
|
+
`https://cdn.jsdelivr.net/npm/three@0.${Se}.0/examples/jsm/libs/basis/`
|
|
1546
1570
|
);
|
|
1547
|
-
static gltfLoader = new
|
|
1548
|
-
static sbmxLoader = new
|
|
1549
|
-
static sbmLoader = new
|
|
1550
|
-
static fbxLoader = new
|
|
1551
|
-
static objLoader = new
|
|
1552
|
-
static stlLoader = new
|
|
1571
|
+
static gltfLoader = new Ke().setDRACOLoader(D.dracoLoader).setKTX2Loader(D.ktx2Loader).setMeshoptDecoder(Pe);
|
|
1572
|
+
static sbmxLoader = new Bs().setDRACOLoader(D.dracoLoader).setKTX2Loader(D.ktx2Loader).setMeshoptDecoder(Pe);
|
|
1573
|
+
static sbmLoader = new Qs();
|
|
1574
|
+
static fbxLoader = new ls();
|
|
1575
|
+
static objLoader = new ds();
|
|
1576
|
+
static stlLoader = new ps();
|
|
1553
1577
|
static setLoadingManager(e) {
|
|
1554
1578
|
this.fileLoader.manager = e, this.dracoLoader.manager = e, this.ktx2Loader.manager = e, this.gltfLoader.manager = e, this.sbmxLoader.manager = e, this.sbmLoader.manager = e, this.fbxLoader.manager = e, this.objLoader.manager = e, this.stlLoader.manager = e;
|
|
1555
1579
|
}
|
|
@@ -1577,23 +1601,23 @@ class j {
|
|
|
1577
1601
|
switch (t.persistent && typeof caches < "u" ? n = await this.getPersistentData(e) : n = await this.fileLoader.loadAsync(e), s) {
|
|
1578
1602
|
case "gltf":
|
|
1579
1603
|
case "glb":
|
|
1580
|
-
const i = await this.gltfLoader.parseAsync(n,
|
|
1604
|
+
const i = await this.gltfLoader.parseAsync(n, B.extractUrlBase(e));
|
|
1581
1605
|
return i.scene.animations = i.animations, W(i.scene);
|
|
1582
1606
|
case "sbmx":
|
|
1583
|
-
const r = await this.sbmxLoader.parseAsync(n,
|
|
1607
|
+
const r = await this.sbmxLoader.parseAsync(n, B.extractUrlBase(e));
|
|
1584
1608
|
return r.scene.animations = r.animations, W(r.scene);
|
|
1585
1609
|
case "sbm":
|
|
1586
|
-
const o = await this.sbmLoader.parseAsync(n,
|
|
1610
|
+
const o = await this.sbmLoader.parseAsync(n, B.extractUrlBase(e));
|
|
1587
1611
|
return W(o);
|
|
1588
1612
|
case "fbx":
|
|
1589
|
-
const a = this.fbxLoader.parse(n,
|
|
1613
|
+
const a = this.fbxLoader.parse(n, B.extractUrlBase(e));
|
|
1590
1614
|
return W(a);
|
|
1591
1615
|
case "obj":
|
|
1592
1616
|
const c = new TextDecoder().decode(n), l = this.objLoader.parse(c);
|
|
1593
1617
|
return W(l);
|
|
1594
1618
|
case "stl":
|
|
1595
1619
|
const d = this.stlLoader.parse(n);
|
|
1596
|
-
return new
|
|
1620
|
+
return new k(d, new L());
|
|
1597
1621
|
default:
|
|
1598
1622
|
throw new Error(`Unsupported model format: ${s}`);
|
|
1599
1623
|
}
|
|
@@ -1610,10 +1634,10 @@ class j {
|
|
|
1610
1634
|
}
|
|
1611
1635
|
}
|
|
1612
1636
|
}
|
|
1613
|
-
class
|
|
1614
|
-
static textureLoader = new
|
|
1615
|
-
static hdrLoader = new
|
|
1616
|
-
static cubeTextureLoader = new
|
|
1637
|
+
class On {
|
|
1638
|
+
static textureLoader = new He();
|
|
1639
|
+
static hdrLoader = new fs();
|
|
1640
|
+
static cubeTextureLoader = new Et();
|
|
1617
1641
|
static setLoadingManager(e) {
|
|
1618
1642
|
this.textureLoader.manager = e, this.hdrLoader.manager = e, this.cubeTextureLoader.manager = e;
|
|
1619
1643
|
}
|
|
@@ -1622,13 +1646,13 @@ class Tn {
|
|
|
1622
1646
|
}
|
|
1623
1647
|
static async loadAsyncHDR(e) {
|
|
1624
1648
|
const t = await this.hdrLoader.loadAsync(e);
|
|
1625
|
-
return t.mapping =
|
|
1649
|
+
return t.mapping = Pt, t;
|
|
1626
1650
|
}
|
|
1627
1651
|
static async loadAsyncCubeTexture(e, t) {
|
|
1628
1652
|
return this.cubeTextureLoader.setPath(e), await this.cubeTextureLoader.loadAsync(t);
|
|
1629
1653
|
}
|
|
1630
1654
|
}
|
|
1631
|
-
class G extends
|
|
1655
|
+
class G extends k {
|
|
1632
1656
|
isBaseMesh = !0;
|
|
1633
1657
|
type = "BaseMesh";
|
|
1634
1658
|
castShadow = !0;
|
|
@@ -1641,7 +1665,7 @@ class G extends D {
|
|
|
1641
1665
|
return this.visible === !1 && this.ignoreInvisibleWhenRaycast === !0 ? !1 : super.raycast(e, t);
|
|
1642
1666
|
}
|
|
1643
1667
|
}
|
|
1644
|
-
class
|
|
1668
|
+
class Xe extends R {
|
|
1645
1669
|
isBaseGroup = !0;
|
|
1646
1670
|
type = "BaseGroup";
|
|
1647
1671
|
ignoreInvisibleWhenRaycast = !0;
|
|
@@ -1652,7 +1676,7 @@ class Qe extends R {
|
|
|
1652
1676
|
return this.visible === !1 && this.ignoreInvisibleWhenRaycast === !0 ? !1 : super.raycast(e, t);
|
|
1653
1677
|
}
|
|
1654
1678
|
}
|
|
1655
|
-
class
|
|
1679
|
+
class Xs extends Ot {
|
|
1656
1680
|
isBaseSprite = !0;
|
|
1657
1681
|
type = "BaseSprite";
|
|
1658
1682
|
ignoreInvisibleWhenRaycast = !0;
|
|
@@ -1663,7 +1687,7 @@ class Qs extends Et {
|
|
|
1663
1687
|
return this.visible === !1 && this.ignoreInvisibleWhenRaycast === !0 ? !1 : super.raycast(e, t);
|
|
1664
1688
|
}
|
|
1665
1689
|
}
|
|
1666
|
-
class
|
|
1690
|
+
class he extends Xe {
|
|
1667
1691
|
isModel = !0;
|
|
1668
1692
|
type = "Model";
|
|
1669
1693
|
static memoryCache = /* @__PURE__ */ new Map();
|
|
@@ -1677,9 +1701,9 @@ class ae extends Qe {
|
|
|
1677
1701
|
const { url: t, cache: s = !0, persistent: n = !0 } = e;
|
|
1678
1702
|
try {
|
|
1679
1703
|
let i;
|
|
1680
|
-
s ?
|
|
1681
|
-
const r = await i, o =
|
|
1682
|
-
return this.add(o), o.animations && o.animations.length > 0 && (this.animations = o.animations, this.mixer = new
|
|
1704
|
+
s ? he.memoryCache.has(t) ? i = he.memoryCache.get(t) : (i = D.loadAsync(t, { persistent: n }), he.memoryCache.set(t, i)) : i = D.loadAsync(t, { persistent: n });
|
|
1705
|
+
const r = await i, o = gs(r);
|
|
1706
|
+
return this.add(o), o.animations && o.animations.length > 0 && (this.animations = o.animations, this.mixer = new At(o)), o;
|
|
1683
1707
|
} catch (i) {
|
|
1684
1708
|
return console.error(`[Model] Failed to load model from ${t}:`, i), null;
|
|
1685
1709
|
}
|
|
@@ -1691,7 +1715,7 @@ class ae extends Qe {
|
|
|
1691
1715
|
if (e === void 0 ? o = this.animations[0] : typeof e == "number" ? o = this.animations[e] : o = this.animations.find((c) => c.name === e), !o)
|
|
1692
1716
|
return console.warn(`[Model] Animation not found: ${e}`), null;
|
|
1693
1717
|
let a = this.actions.get(o.name);
|
|
1694
|
-
return a || (a = this.mixer.clipAction(o), this.actions.set(o.name, a)), a.setLoop(s ?
|
|
1718
|
+
return a || (a = this.mixer.clipAction(o), this.actions.set(o.name, a)), a.setLoop(s ? It : Bt, n), a.clampWhenFinished = r, a.timeScale = i, a.reset().play(), a;
|
|
1695
1719
|
}
|
|
1696
1720
|
playAllAnimations(e = {}) {
|
|
1697
1721
|
return this.animations.map((t, s) => this.playAnimation(s, e)).filter((t) => t !== null);
|
|
@@ -1726,7 +1750,7 @@ class ae extends Qe {
|
|
|
1726
1750
|
*/
|
|
1727
1751
|
setMaterial(e) {
|
|
1728
1752
|
this.traverse((t) => {
|
|
1729
|
-
t instanceof
|
|
1753
|
+
t instanceof k && (t.material = e);
|
|
1730
1754
|
});
|
|
1731
1755
|
}
|
|
1732
1756
|
static clearMemoryCache() {
|
|
@@ -1736,11 +1760,11 @@ class ae extends Qe {
|
|
|
1736
1760
|
typeof caches < "u" && await caches.delete("u-space-loader-cache");
|
|
1737
1761
|
}
|
|
1738
1762
|
}
|
|
1739
|
-
class
|
|
1763
|
+
class Ys extends G {
|
|
1740
1764
|
isSphereMesh = !0;
|
|
1741
1765
|
type = "SphereMesh";
|
|
1742
1766
|
constructor({ geometryParameters: e, materialParameters: t } = {}) {
|
|
1743
|
-
super(), this.geometry = new
|
|
1767
|
+
super(), this.geometry = new Rt(
|
|
1744
1768
|
e?.radius,
|
|
1745
1769
|
e?.widthSegments,
|
|
1746
1770
|
e?.heightSegments,
|
|
@@ -1748,10 +1772,10 @@ class qs extends G {
|
|
|
1748
1772
|
e?.phiLength,
|
|
1749
1773
|
e?.thetaStart,
|
|
1750
1774
|
e?.thetaLength
|
|
1751
|
-
), this.material = new
|
|
1775
|
+
), this.material = new L(t);
|
|
1752
1776
|
}
|
|
1753
1777
|
}
|
|
1754
|
-
class
|
|
1778
|
+
class Ie extends G {
|
|
1755
1779
|
isTubeMesh = !0;
|
|
1756
1780
|
type = "TubeMesh";
|
|
1757
1781
|
constructor({ geometryParameters: e, materialParameters: t } = {}) {
|
|
@@ -1761,10 +1785,10 @@ class Oe extends G {
|
|
|
1761
1785
|
e?.radius,
|
|
1762
1786
|
e?.radialSegments,
|
|
1763
1787
|
e?.closed
|
|
1764
|
-
), this.material = new
|
|
1788
|
+
), this.material = new L(t);
|
|
1765
1789
|
}
|
|
1766
1790
|
}
|
|
1767
|
-
class
|
|
1791
|
+
class An extends Xe {
|
|
1768
1792
|
isTopology = !0;
|
|
1769
1793
|
type = "Topology";
|
|
1770
1794
|
// Visuals
|
|
@@ -1868,7 +1892,7 @@ class _n extends Qe {
|
|
|
1868
1892
|
*/
|
|
1869
1893
|
renderGraph() {
|
|
1870
1894
|
this.clearGraph(), this.graphGroup = new R();
|
|
1871
|
-
const e = new
|
|
1895
|
+
const e = new Ys({
|
|
1872
1896
|
geometryParameters: {
|
|
1873
1897
|
radius: this.parameters.nodeRadius,
|
|
1874
1898
|
widthSegments: 16,
|
|
@@ -1890,7 +1914,7 @@ class _n extends Qe {
|
|
|
1890
1914
|
t.add(o);
|
|
1891
1915
|
const a = this.nodes.get(n), c = this.nodes.get(r);
|
|
1892
1916
|
if (a && c) {
|
|
1893
|
-
const l = new
|
|
1917
|
+
const l = new zt(a, c), d = new Ie({
|
|
1894
1918
|
geometryParameters: {
|
|
1895
1919
|
path: l,
|
|
1896
1920
|
tubularSegments: 1,
|
|
@@ -1909,7 +1933,7 @@ class _n extends Qe {
|
|
|
1909
1933
|
}
|
|
1910
1934
|
clearGraph() {
|
|
1911
1935
|
this.graphGroup && (this.remove(this.graphGroup), this.graphGroup.traverse((e) => {
|
|
1912
|
-
e instanceof
|
|
1936
|
+
e instanceof k && (e.geometry.dispose(), e.material.dispose());
|
|
1913
1937
|
}), this.graphGroup = null);
|
|
1914
1938
|
}
|
|
1915
1939
|
/**
|
|
@@ -1917,7 +1941,7 @@ class _n extends Qe {
|
|
|
1917
1941
|
*/
|
|
1918
1942
|
renderPath(e, t = this.parameters.pathColor) {
|
|
1919
1943
|
if (e.length < 2) return;
|
|
1920
|
-
const s = new
|
|
1944
|
+
const s = new Nt(e, !1, "catmullrom", 0), n = new Ie({
|
|
1921
1945
|
geometryParameters: {
|
|
1922
1946
|
path: s,
|
|
1923
1947
|
tubularSegments: e.length * 10,
|
|
@@ -1967,7 +1991,7 @@ class _n extends Qe {
|
|
|
1967
1991
|
return this.adjacencyMap.get(e);
|
|
1968
1992
|
}
|
|
1969
1993
|
}
|
|
1970
|
-
class
|
|
1994
|
+
class In extends Xs {
|
|
1971
1995
|
isPoi = !0;
|
|
1972
1996
|
type = "Poi";
|
|
1973
1997
|
parameters = {
|
|
@@ -1986,7 +2010,7 @@ class En extends Qs {
|
|
|
1986
2010
|
_canvas = document.createElement("canvas");
|
|
1987
2011
|
_lastParametersJSON = "";
|
|
1988
2012
|
constructor(e = {}) {
|
|
1989
|
-
super(new
|
|
2013
|
+
super(new Dt()), Object.assign(this.parameters, e), this.updateAsync();
|
|
1990
2014
|
}
|
|
1991
2015
|
/**
|
|
1992
2016
|
* Update the POI with new parameters
|
|
@@ -2024,11 +2048,11 @@ class En extends Qs {
|
|
|
2024
2048
|
const N = y + l * 2, P = _ + l * 2;
|
|
2025
2049
|
if (s.width = N, s.height = P, n.font = `${o}px ${this.parameters.fontFamily}`, d && (n.fillStyle = d, this._drawRoundedRect(n, 0, 0, N, P, p), n.fill()), b && n.drawImage(i, O + l, A + l, c, c), z) {
|
|
2026
2050
|
n.fillStyle = a;
|
|
2027
|
-
const
|
|
2028
|
-
n.textBaseline = "alphabetic", n.fillText(r, E + l, g + l +
|
|
2051
|
+
const j = n.measureText(r), U = j.actualBoundingBoxAscent + j.actualBoundingBoxDescent, it = j.actualBoundingBoxAscent - U / 2;
|
|
2052
|
+
n.textBaseline = "alphabetic", n.fillText(r, E + l, g + l + it);
|
|
2029
2053
|
}
|
|
2030
|
-
const
|
|
2031
|
-
$.colorSpace =
|
|
2054
|
+
const V = this.material.map, $ = new kt(s);
|
|
2055
|
+
$.colorSpace = Fe, this.material.map = $, V?.dispose(), this.scale.set(N * m, P * m, 1);
|
|
2032
2056
|
}
|
|
2033
2057
|
_loadImage(e) {
|
|
2034
2058
|
return new Promise((t, s) => {
|
|
@@ -2046,80 +2070,80 @@ class En extends Qs {
|
|
|
2046
2070
|
this.material.map?.dispose(), this.material.dispose();
|
|
2047
2071
|
}
|
|
2048
2072
|
}
|
|
2049
|
-
class
|
|
2073
|
+
class Ye extends G {
|
|
2050
2074
|
isShapeMesh = !0;
|
|
2051
2075
|
type = "ShapeMesh";
|
|
2052
2076
|
constructor({ geometryParameters: e, materialParameters: t } = {}) {
|
|
2053
|
-
super(), this.geometry = new jt(e?.shape, e?.curveSegments), this.material = new
|
|
2077
|
+
super(), this.geometry = new jt(e?.shape, e?.curveSegments), this.material = new L(t), this.geometry.rotateX(-Math.PI / 2);
|
|
2054
2078
|
}
|
|
2055
2079
|
static createFromPoints(e, t = {}) {
|
|
2056
|
-
return new
|
|
2080
|
+
return new Ye({
|
|
2057
2081
|
...t,
|
|
2058
2082
|
geometryParameters: {
|
|
2059
2083
|
...t.geometryParameters,
|
|
2060
|
-
shape: new
|
|
2084
|
+
shape: new Ge(e.map((s) => new S(s.x, -s.z)))
|
|
2061
2085
|
}
|
|
2062
2086
|
});
|
|
2063
2087
|
}
|
|
2064
2088
|
}
|
|
2065
|
-
class
|
|
2089
|
+
class Ve extends G {
|
|
2066
2090
|
isExtrudeMesh = !0;
|
|
2067
2091
|
type = "ExtrudeMesh";
|
|
2068
2092
|
constructor({ geometryParameters: e, materialParameters: t } = {}) {
|
|
2069
|
-
super(), this.geometry = new
|
|
2093
|
+
super(), this.geometry = new Ut(e?.shape, e?.options), this.material = new L(t), this.geometry.rotateX(-Math.PI / 2);
|
|
2070
2094
|
}
|
|
2071
2095
|
static createFromPoints(e, t = {}) {
|
|
2072
|
-
return e && e.length === 0 && (e = void 0), new
|
|
2096
|
+
return e && e.length === 0 && (e = void 0), new Ve({
|
|
2073
2097
|
...t,
|
|
2074
2098
|
geometryParameters: {
|
|
2075
2099
|
...t.geometryParameters,
|
|
2076
|
-
shape: new
|
|
2100
|
+
shape: new Ge(e?.map((s) => new S(s.x, -s.z)))
|
|
2077
2101
|
}
|
|
2078
2102
|
});
|
|
2079
2103
|
}
|
|
2080
2104
|
}
|
|
2081
|
-
class
|
|
2105
|
+
class Bn extends G {
|
|
2082
2106
|
isPlaneMesh = !0;
|
|
2083
2107
|
type = "PlaneMesh";
|
|
2084
2108
|
constructor({ geometryParameters: e, materialParameters: t } = {}) {
|
|
2085
|
-
super(), this.geometry = new
|
|
2109
|
+
super(), this.geometry = new Ht(
|
|
2086
2110
|
e?.width,
|
|
2087
2111
|
e?.height,
|
|
2088
2112
|
e?.widthSegments,
|
|
2089
2113
|
e?.heightSegments
|
|
2090
|
-
), this.material = new
|
|
2114
|
+
), this.material = new L(t);
|
|
2091
2115
|
}
|
|
2092
2116
|
}
|
|
2093
|
-
class
|
|
2117
|
+
class Rn extends G {
|
|
2094
2118
|
isCircleMesh = !0;
|
|
2095
2119
|
type = "CircleMesh";
|
|
2096
2120
|
constructor({ geometryParameters: e, materialParameters: t } = {}) {
|
|
2097
2121
|
super(
|
|
2098
|
-
new
|
|
2122
|
+
new Ft(
|
|
2099
2123
|
e?.radius,
|
|
2100
2124
|
e?.segments,
|
|
2101
2125
|
e?.thetaStart,
|
|
2102
2126
|
e?.thetaLength
|
|
2103
2127
|
),
|
|
2104
|
-
new
|
|
2128
|
+
new L(t)
|
|
2105
2129
|
), this.geometry.rotateX(-Math.PI / 2);
|
|
2106
2130
|
}
|
|
2107
2131
|
}
|
|
2108
2132
|
class F {
|
|
2109
2133
|
static traverseMeshes(e, t) {
|
|
2110
2134
|
e.traverse((s) => {
|
|
2111
|
-
s instanceof
|
|
2135
|
+
s instanceof k && t(s);
|
|
2112
2136
|
});
|
|
2113
2137
|
}
|
|
2114
2138
|
}
|
|
2115
|
-
class
|
|
2139
|
+
class Ln {
|
|
2116
2140
|
static flow(e = {}) {
|
|
2117
|
-
const { baseColor: t = 16777215, flowColor: s = 65280, speed: n = 1, scale: i = 3, intensity: r = 4 } = e, o = H(new
|
|
2118
|
-
return
|
|
2141
|
+
const { baseColor: t = 16777215, flowColor: s = 65280, speed: n = 1, scale: i = 3, intensity: r = 4 } = e, o = H(new M(t)), a = H(new M(s)), c = Te().x.mul(i).sub(re.mul(n)), l = oe(ge(c).add(1).mul(0.5), r);
|
|
2142
|
+
return ae(o, a, l);
|
|
2119
2143
|
}
|
|
2120
2144
|
static breathe(e = {}) {
|
|
2121
|
-
const { baseColor: t = 16777215, breathColor: s = 65280, speed: n = 1, intensity: i = 2 } = e, r = H(new
|
|
2122
|
-
return
|
|
2145
|
+
const { baseColor: t = 16777215, breathColor: s = 65280, speed: n = 1, intensity: i = 2 } = e, r = H(new M(t)), o = H(new M(s)), a = ge(re.mul(n)).add(1).mul(0.5), c = oe(a, i);
|
|
2146
|
+
return ae(r, o, c);
|
|
2123
2147
|
}
|
|
2124
2148
|
static fluid(e = {}) {
|
|
2125
2149
|
const {
|
|
@@ -2129,50 +2153,70 @@ class An {
|
|
|
2129
2153
|
scale: i = 1,
|
|
2130
2154
|
intensity: r = 1,
|
|
2131
2155
|
distortion: o = 0.5
|
|
2132
|
-
} = e, a = H(new
|
|
2133
|
-
return
|
|
2156
|
+
} = e, a = H(new M(t)), c = H(new M(s)), l = Te().mul(i), d = re.mul(n), p = _e(l.add(d), 1, 0), u = l.add(p.mul(o)), m = _e(u, 1, 0).add(1).mul(0.5), w = oe(m, r);
|
|
2157
|
+
return ae(a, c, w);
|
|
2134
2158
|
}
|
|
2135
2159
|
}
|
|
2136
|
-
function
|
|
2160
|
+
function zn(h) {
|
|
2137
2161
|
}
|
|
2138
|
-
const
|
|
2139
|
-
const h =
|
|
2140
|
-
return
|
|
2141
|
-
})(),
|
|
2142
|
-
const h =
|
|
2143
|
-
return
|
|
2162
|
+
const Y = "uSpaceHighlight", q = `${Y}/enabled`, Je = `${Y}/opacity`, Ze = `${Y}/color`, et = `${Y}/overwrite`, de = `${Y}/instancedOriginalOpacity`, me = "uSpaceBreathe", pe = `${me}/enabled`, tt = `${me}/color`, st = `${me}/speed`, nt = `${me}/intensity`, ue = /* @__PURE__ */ new WeakMap(), Vs = $e(() => {
|
|
2163
|
+
const h = I(q, "uint"), e = I(Ze, "uint"), t = I(et, "uint"), s = Le(e), n = Ee.mul(s), i = ce(t.greaterThan(0), s, n), r = ce(h.greaterThan(0), i, Ee), o = I(pe, "uint"), a = I(tt, "uint"), c = I(st, "float"), l = I(nt, "float"), d = Le(a), p = ge(re.mul(c)).add(1).mul(0.5), u = oe(p, l), m = ae(r, d, u);
|
|
2164
|
+
return ce(o.greaterThan(0), m, r);
|
|
2165
|
+
})(), Js = $e(() => {
|
|
2166
|
+
const h = I(q, "uint"), e = I(Je, "float");
|
|
2167
|
+
return ce(h.greaterThan(0), e, Jt);
|
|
2144
2168
|
})();
|
|
2145
2169
|
function Q(h) {
|
|
2146
2170
|
return Array.isArray(h.material) ? h.material : [h.material];
|
|
2147
2171
|
}
|
|
2148
|
-
function
|
|
2172
|
+
function Be(h) {
|
|
2149
2173
|
Q(h).forEach((t) => {
|
|
2150
2174
|
if (!t) return;
|
|
2151
|
-
let s =
|
|
2175
|
+
let s = ue.get(t);
|
|
2152
2176
|
s || (s = {
|
|
2153
2177
|
colorNode: t.colorNode,
|
|
2154
2178
|
opacityNode: t.opacityNode,
|
|
2155
2179
|
transparent: t.transparent,
|
|
2156
2180
|
depthWrite: t.depthWrite,
|
|
2157
2181
|
activeMeshes: /* @__PURE__ */ new Set()
|
|
2158
|
-
},
|
|
2182
|
+
}, ue.set(t, s)), s.activeMeshes.add(h), t.transparent = !0, t.colorNode = Vs, t.opacityNode = Js, t.needsUpdate = !0;
|
|
2159
2183
|
});
|
|
2160
2184
|
}
|
|
2161
|
-
function
|
|
2162
|
-
const e = h.userData[q], t = h.userData[
|
|
2185
|
+
function Re(h) {
|
|
2186
|
+
const e = h.userData[q], t = h.userData[pe];
|
|
2163
2187
|
if (e || t) return;
|
|
2164
2188
|
Q(h).forEach((n) => {
|
|
2165
2189
|
if (!n) return;
|
|
2166
|
-
const i =
|
|
2167
|
-
i && (i.activeMeshes.delete(h), !(i.activeMeshes.size > 0) && (n.colorNode = i.colorNode, n.opacityNode = i.opacityNode, n.transparent = i.transparent, n.depthWrite = i.depthWrite, n.needsUpdate = !0,
|
|
2190
|
+
const i = ue.get(n);
|
|
2191
|
+
i && (i.activeMeshes.delete(h), !(i.activeMeshes.size > 0) && (n.colorNode = i.colorNode, n.opacityNode = i.opacityNode, n.transparent = i.transparent, n.depthWrite = i.depthWrite, n.needsUpdate = !0, ue.delete(n)));
|
|
2168
2192
|
});
|
|
2169
2193
|
}
|
|
2170
|
-
|
|
2194
|
+
function Zs(h, e, t, s) {
|
|
2195
|
+
const n = h, i = n.setSceneInstanceHighlight ?? n.setFacilityHighlight;
|
|
2196
|
+
if (i)
|
|
2197
|
+
return i.call(h, e, t, s), !0;
|
|
2198
|
+
const r = n.setSceneInstanceColor ?? n.setFacilityColor, o = n.setSceneInstanceOpacity ?? n.setFacilityOpacity, a = n.getSceneInstanceOpacity ?? n.getFacilityOpacity, c = n.getSceneInstanceColor ?? n.getFacilityColor, l = n.hasSceneInstanceColor ?? n.hasFacilityColor;
|
|
2199
|
+
return !r || !o ? !1 : (h.userData[de] === void 0 && (h.userData[de] = {
|
|
2200
|
+
hasColor: l?.call(h) ?? !1,
|
|
2201
|
+
color: c?.call(h, new M()).getHex() ?? 16777215,
|
|
2202
|
+
opacity: a?.call(h) ?? 1
|
|
2203
|
+
}), r.call(h, e), o.call(h, t), !0);
|
|
2204
|
+
}
|
|
2205
|
+
function en(h) {
|
|
2206
|
+
const e = h, t = e.clearSceneInstanceHighlight ?? e.clearFacilityHighlight;
|
|
2207
|
+
if (t)
|
|
2208
|
+
return t.call(h), !0;
|
|
2209
|
+
const s = e.resetSceneInstanceColor ?? e.resetFacilityColor, n = e.setSceneInstanceColor ?? e.setFacilityColor, i = e.setSceneInstanceOpacity ?? e.setFacilityOpacity;
|
|
2210
|
+
if (!s || !i) return !1;
|
|
2211
|
+
const r = h.userData[de];
|
|
2212
|
+
return r && (r.hasColor && n ? n.call(h, r.color) : s.call(h), i.call(h, r.opacity), Reflect.deleteProperty(h.userData, de)), !0;
|
|
2213
|
+
}
|
|
2214
|
+
class le {
|
|
2171
2215
|
static highlightColor(e, t = {}) {
|
|
2172
|
-
const s = Array.isArray(e) ? e : [e], { opacity: n = 0.5, color: i = 16711680, overwrite: r = !1, depthWrite: o } = t, a = new
|
|
2216
|
+
const s = Array.isArray(e) ? e : [e], { opacity: n = 0.5, color: i = 16711680, overwrite: r = !1, depthWrite: o } = t, a = new M(i).getHex();
|
|
2173
2217
|
for (const c of s)
|
|
2174
|
-
F.traverseMeshes(c, (l) => {
|
|
2175
|
-
l.userData[q] = 1, l.userData[
|
|
2218
|
+
Zs(c, i, n, r) || F.traverseMeshes(c, (l) => {
|
|
2219
|
+
l.userData[q] = 1, l.userData[Je] = n, l.userData[Ze] = a, l.userData[et] = r ? 1 : 0, Be(l), o !== void 0 && Q(l).forEach((p) => {
|
|
2176
2220
|
p && (p.depthWrite = o);
|
|
2177
2221
|
});
|
|
2178
2222
|
});
|
|
@@ -2180,8 +2224,8 @@ class ce {
|
|
|
2180
2224
|
static removeHighlightColor(e) {
|
|
2181
2225
|
const t = Array.isArray(e) ? e : [e];
|
|
2182
2226
|
for (const s of t)
|
|
2183
|
-
F.traverseMeshes(s, (n) => {
|
|
2184
|
-
n.userData[q] = 0,
|
|
2227
|
+
en(s) || F.traverseMeshes(s, (n) => {
|
|
2228
|
+
n.userData[q] = 0, Re(n);
|
|
2185
2229
|
});
|
|
2186
2230
|
}
|
|
2187
2231
|
static breatheColor(e, t = {}) {
|
|
@@ -2193,17 +2237,17 @@ class ce {
|
|
|
2193
2237
|
},
|
|
2194
2238
|
t
|
|
2195
2239
|
);
|
|
2196
|
-
n.color = new
|
|
2240
|
+
n.color = new M(n.color).getHex();
|
|
2197
2241
|
for (const i of s)
|
|
2198
2242
|
F.traverseMeshes(i, (r) => {
|
|
2199
|
-
r.userData[
|
|
2243
|
+
r.userData[pe] = 1, r.userData[tt] = n.color, r.userData[st] = n.speed, r.userData[nt] = n.intensity, Be(r);
|
|
2200
2244
|
});
|
|
2201
2245
|
}
|
|
2202
2246
|
static removeBreatheColor(e) {
|
|
2203
2247
|
const t = Array.isArray(e) ? e : [e];
|
|
2204
2248
|
for (const s of t)
|
|
2205
2249
|
F.traverseMeshes(s, (n) => {
|
|
2206
|
-
n.userData[
|
|
2250
|
+
n.userData[pe] = 0, Re(n);
|
|
2207
2251
|
});
|
|
2208
2252
|
}
|
|
2209
2253
|
/**
|
|
@@ -2224,7 +2268,7 @@ class ce {
|
|
|
2224
2268
|
* Remove wireframe mode.
|
|
2225
2269
|
*/
|
|
2226
2270
|
static removeWireframe(e) {
|
|
2227
|
-
|
|
2271
|
+
le.wireframe(e, !1);
|
|
2228
2272
|
}
|
|
2229
2273
|
/**
|
|
2230
2274
|
* Fade in object(s) from fully transparent to original opacity.
|
|
@@ -2232,7 +2276,7 @@ class ce {
|
|
|
2232
2276
|
*/
|
|
2233
2277
|
static fadeIn(e, t = {}) {
|
|
2234
2278
|
const { duration: s = 500 } = t;
|
|
2235
|
-
return
|
|
2279
|
+
return le._fade(e, 0, 1, s);
|
|
2236
2280
|
}
|
|
2237
2281
|
/**
|
|
2238
2282
|
* Fade out object(s) to fully transparent.
|
|
@@ -2240,7 +2284,7 @@ class ce {
|
|
|
2240
2284
|
*/
|
|
2241
2285
|
static fadeOut(e, t = {}) {
|
|
2242
2286
|
const { duration: s = 500 } = t;
|
|
2243
|
-
return
|
|
2287
|
+
return le._fade(e, 1, 0, s);
|
|
2244
2288
|
}
|
|
2245
2289
|
static _fade(e, t, s, n) {
|
|
2246
2290
|
const i = Array.isArray(e) ? e : [e], r = /* @__PURE__ */ new Map();
|
|
@@ -2283,9 +2327,9 @@ class ce {
|
|
|
2283
2327
|
}
|
|
2284
2328
|
const Le = (h) => {
|
|
2285
2329
|
const e = h.shiftRight(16).bitAnd(255).toFloat().div(255), t = h.shiftRight(8).bitAnd(255).toFloat().div(255), s = h.bitAnd(255).toFloat().div(255);
|
|
2286
|
-
return
|
|
2330
|
+
return Zt(e, t, s);
|
|
2287
2331
|
};
|
|
2288
|
-
class
|
|
2332
|
+
class tn extends ys {
|
|
2289
2333
|
viewer;
|
|
2290
2334
|
constructor(e, t) {
|
|
2291
2335
|
super(t), this.viewer = e;
|
|
@@ -2294,7 +2338,7 @@ class Js extends fs {
|
|
|
2294
2338
|
this.update(e) && this.viewer.render();
|
|
2295
2339
|
};
|
|
2296
2340
|
easingByMode(e) {
|
|
2297
|
-
const t =
|
|
2341
|
+
const t = sn[e];
|
|
2298
2342
|
return super.easing(t);
|
|
2299
2343
|
}
|
|
2300
2344
|
start(e, t) {
|
|
@@ -2304,9 +2348,9 @@ class Js extends fs {
|
|
|
2304
2348
|
return this.viewer.removeEventListener("afterControlsUpdate", this._update), super.stop();
|
|
2305
2349
|
}
|
|
2306
2350
|
}
|
|
2307
|
-
function
|
|
2351
|
+
function Nn(h, e, t, s = {}, n, i) {
|
|
2308
2352
|
return new Promise((r, o) => {
|
|
2309
|
-
const { duration: a = 1e3, delay: c = 0, repeat: l = !1, mode: d = "Linear.None", yoyo: p = !1 } = s, u = new
|
|
2353
|
+
const { duration: a = 1e3, delay: c = 0, repeat: l = !1, mode: d = "Linear.None", yoyo: p = !1 } = s, u = new tn(h, e).to(t, a).easingByMode(d).delay(c).onUpdate((m) => {
|
|
2310
2354
|
n?.(m, u);
|
|
2311
2355
|
}).onComplete(() => {
|
|
2312
2356
|
r();
|
|
@@ -2318,7 +2362,7 @@ function Ln(h, e, t, s = {}, n, i) {
|
|
|
2318
2362
|
typeof l == "number" ? u.repeat(l) : typeof l == "boolean" && l && u.repeat(1 / 0), p && u.repeatDelay(20), u.yoyo(p), u.start();
|
|
2319
2363
|
});
|
|
2320
2364
|
}
|
|
2321
|
-
const
|
|
2365
|
+
const sn = {
|
|
2322
2366
|
"Linear.None": f.Linear.None,
|
|
2323
2367
|
"Quadratic.In": f.Quadratic.In,
|
|
2324
2368
|
"Quadratic.Out": f.Quadratic.Out,
|
|
@@ -2351,7 +2395,7 @@ const Vs = {
|
|
|
2351
2395
|
"Bounce.Out": f.Bounce.Out,
|
|
2352
2396
|
"Bounce.InOut": f.Bounce.InOut
|
|
2353
2397
|
};
|
|
2354
|
-
class
|
|
2398
|
+
class Dn {
|
|
2355
2399
|
scene;
|
|
2356
2400
|
planes = /* @__PURE__ */ new Map();
|
|
2357
2401
|
helpers = /* @__PURE__ */ new Map();
|
|
@@ -2360,7 +2404,7 @@ class Rn {
|
|
|
2360
2404
|
*/
|
|
2361
2405
|
group;
|
|
2362
2406
|
constructor(e) {
|
|
2363
|
-
this.scene = e, this.group = new
|
|
2407
|
+
this.scene = e, this.group = new Gt(), this.group.name = "__clippingToolGroup", this.scene.add(this.group);
|
|
2364
2408
|
}
|
|
2365
2409
|
/**
|
|
2366
2410
|
* Move all current scene children (except the clipping group itself) into the ClippingGroup,
|
|
@@ -2401,7 +2445,7 @@ class Rn {
|
|
|
2401
2445
|
showHelper: i = !1,
|
|
2402
2446
|
helperSize: r = 5,
|
|
2403
2447
|
helperColor: o = 16711680
|
|
2404
|
-
} = t, a = new
|
|
2448
|
+
} = t, a = new $t(new v(s.x, s.y, s.z), n);
|
|
2405
2449
|
return this.planes.set(e, a), this._syncPlanes(), i && this.showHelper(e, r, o), a;
|
|
2406
2450
|
}
|
|
2407
2451
|
/**
|
|
@@ -2467,7 +2511,7 @@ class Rn {
|
|
|
2467
2511
|
this.hideHelper(e);
|
|
2468
2512
|
const n = this.planes.get(e);
|
|
2469
2513
|
if (!n) return;
|
|
2470
|
-
const i = new
|
|
2514
|
+
const i = new Wt(n, t, new M(s).getHex());
|
|
2471
2515
|
i.name = e, this.helpers.set(e, i), this.scene.add(i);
|
|
2472
2516
|
}
|
|
2473
2517
|
/**
|
|
@@ -2493,7 +2537,7 @@ class Rn {
|
|
|
2493
2537
|
this.detach(), this.removeAll(), this.scene.remove(this.group);
|
|
2494
2538
|
}
|
|
2495
2539
|
}
|
|
2496
|
-
class
|
|
2540
|
+
class kn {
|
|
2497
2541
|
scene;
|
|
2498
2542
|
measurements = /* @__PURE__ */ new Map();
|
|
2499
2543
|
_idCounter = 0;
|
|
@@ -2506,7 +2550,7 @@ class In {
|
|
|
2506
2550
|
measureDistance(e, t, s = {}) {
|
|
2507
2551
|
const { lineColor: n = 16776960 } = s, i = new v(e.x, e.y, e.z), r = new v(t.x, t.y, t.z), o = i.distanceTo(r), a = `measure_dist_${this._idCounter++}`, c = new R();
|
|
2508
2552
|
c.name = a;
|
|
2509
|
-
const l = new K().setFromPoints([i, r]), d = new
|
|
2553
|
+
const l = new K().setFromPoints([i, r]), d = new ne({ color: n }), p = new ie(l, d);
|
|
2510
2554
|
c.add(p), this.scene.add(c);
|
|
2511
2555
|
const u = {
|
|
2512
2556
|
id: a,
|
|
@@ -2527,7 +2571,7 @@ class In {
|
|
|
2527
2571
|
throw new Error("MeasureTool.measureArea requires at least 3 points");
|
|
2528
2572
|
const n = e.map((u) => new v(u.x, u.y, u.z)), i = this._calculatePolygonArea(n), r = `measure_area_${this._idCounter++}`, o = new R();
|
|
2529
2573
|
o.name = r;
|
|
2530
|
-
const a = [...n, n[0]], c = new K().setFromPoints(a), l = new
|
|
2574
|
+
const a = [...n, n[0]], c = new K().setFromPoints(a), l = new ne({ color: s }), d = new ie(c, l);
|
|
2531
2575
|
o.add(d), this.scene.add(o);
|
|
2532
2576
|
const p = {
|
|
2533
2577
|
id: r,
|
|
@@ -2545,7 +2589,7 @@ class In {
|
|
|
2545
2589
|
measureAngle(e, t, s, n = {}) {
|
|
2546
2590
|
const { lineColor: i = 16746496 } = n, r = new v(e.x, e.y, e.z), o = new v(t.x, t.y, t.z), a = new v(s.x, s.y, s.z), c = r.clone().sub(o).normalize(), l = a.clone().sub(o).normalize(), p = Math.acos(Math.max(-1, Math.min(1, c.dot(l)))) * 180 / Math.PI, u = `measure_angle_${this._idCounter++}`, m = new R();
|
|
2547
2591
|
m.name = u;
|
|
2548
|
-
const w = new K().setFromPoints([r, o, a]), C = new
|
|
2592
|
+
const w = new K().setFromPoints([r, o, a]), C = new ne({ color: i }), x = new ie(w, C);
|
|
2549
2593
|
m.add(x), this.scene.add(m);
|
|
2550
2594
|
const y = {
|
|
2551
2595
|
id: u,
|
|
@@ -2606,7 +2650,7 @@ class In {
|
|
|
2606
2650
|
this.removeAll();
|
|
2607
2651
|
}
|
|
2608
2652
|
}
|
|
2609
|
-
class
|
|
2653
|
+
class jn {
|
|
2610
2654
|
scene;
|
|
2611
2655
|
annotations = /* @__PURE__ */ new Map();
|
|
2612
2656
|
_idCounter = 0;
|
|
@@ -2640,16 +2684,18 @@ class zn {
|
|
|
2640
2684
|
pointer-events: auto;
|
|
2641
2685
|
white-space: nowrap;
|
|
2642
2686
|
`, t.labelStyle)
|
|
2643
|
-
for (const
|
|
2687
|
+
for (const c of Object.keys(t.labelStyle)) {
|
|
2688
|
+
const l = t.labelStyle[c];
|
|
2644
2689
|
l !== void 0 && (i.style[c] = l);
|
|
2690
|
+
}
|
|
2645
2691
|
let r = null;
|
|
2646
2692
|
const o = t.labelOffset || { x: 0, y: 2, z: 0 };
|
|
2647
2693
|
if (t.showLeaderLine !== !1) {
|
|
2648
2694
|
const { lineColor: c = 16777215 } = t, l = new K().setFromPoints([
|
|
2649
2695
|
new v(0, 0, 0),
|
|
2650
2696
|
new v(o.x, o.y, o.z)
|
|
2651
|
-
]), d = new
|
|
2652
|
-
r = new
|
|
2697
|
+
]), d = new ne({ color: c });
|
|
2698
|
+
r = new ie(l, d), s.add(r);
|
|
2653
2699
|
}
|
|
2654
2700
|
if (this._createCSSObject) {
|
|
2655
2701
|
const c = this._createCSSObject(i);
|
|
@@ -2757,47 +2803,47 @@ class zn {
|
|
|
2757
2803
|
this.removeAll();
|
|
2758
2804
|
}
|
|
2759
2805
|
}
|
|
2760
|
-
const
|
|
2761
|
-
window.__USPACE__ = { version:
|
|
2806
|
+
const nn = "0.0.27";
|
|
2807
|
+
window.__USPACE__ = { version: nn };
|
|
2762
2808
|
export {
|
|
2763
|
-
|
|
2764
|
-
|
|
2809
|
+
jn as AnnotationManager,
|
|
2810
|
+
Xe as BaseGroup,
|
|
2765
2811
|
G as BaseMesh,
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2812
|
+
Xs as BaseSprite,
|
|
2813
|
+
Fn as CSS2DObject,
|
|
2814
|
+
$n as CSS3DObject,
|
|
2815
|
+
Wn as CSS3DSprite,
|
|
2816
|
+
Os as CSSRenderer,
|
|
2817
|
+
Ss as CameraControls,
|
|
2818
|
+
Rn as CircleMesh,
|
|
2819
|
+
Dn as ClippingTool,
|
|
2820
|
+
Ve as ExtrudeMesh,
|
|
2821
|
+
ws as InteractionEvent,
|
|
2822
|
+
vs as InteractionManager,
|
|
2823
|
+
En as LightManager,
|
|
2824
|
+
le as MaterialEffects,
|
|
2825
|
+
kn as MeasureTool,
|
|
2826
|
+
he as Model,
|
|
2827
|
+
D as ModelLoaderManager,
|
|
2828
|
+
bs as ObjectManager,
|
|
2783
2829
|
F as ObjectUtils,
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2830
|
+
Bn as PlaneMesh,
|
|
2831
|
+
In as Poi,
|
|
2832
|
+
xs as RenderPipeline,
|
|
2833
|
+
Ts as RoomEnvironment,
|
|
2834
|
+
Qs as SBMLoader,
|
|
2835
|
+
Bs as SBMXLoader,
|
|
2836
|
+
_n as SceneManager,
|
|
2837
|
+
Tn as Selection,
|
|
2838
|
+
Ye as ShapeMesh,
|
|
2839
|
+
Ys as SphereMesh,
|
|
2840
|
+
Ln as TSLEffects,
|
|
2841
|
+
On as TextureLoaderManager,
|
|
2842
|
+
An as Topology,
|
|
2843
|
+
Ie as TubeMesh,
|
|
2844
|
+
tn as Tween,
|
|
2845
|
+
Pn as Viewer,
|
|
2846
|
+
zn as reinterpretType,
|
|
2847
|
+
Nn as tweenAnimation,
|
|
2848
|
+
nn as version
|
|
2803
2849
|
};
|