viral-viewer-2 7.2.3 → 7.2.4
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/components/custom-objects/viral-batched-mesh.d.ts +0 -12
- package/dist/components/custom-objects/viral-bim-world.d.ts +6 -0
- package/dist/components/custom-objects/viral-instanced-mesh-v2.d.ts +1 -20
- package/dist/components/post-processing/post-processing-renderer.d.ts +0 -41
- package/dist/components/post-processing/selection-outline-pass.d.ts +2 -0
- package/dist/components/visibility-manager/viral-visibility-manager.d.ts +8 -34
- package/dist/components/worker/merge-positions.worker.d.ts +19 -0
- package/dist/components/worker-script/merge-positions.script.d.ts +1 -0
- package/dist/index.mjs +856 -1071
- package/package.json +49 -49
- package/dist/components/post-processing/alpha-selection-outline-pass.d.ts +0 -49
- package/dist/components/post-processing/stencil-selection-outline-pass.d.ts +0 -54
package/dist/index.mjs
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { Vector3 as E, Box3 as
|
|
2
|
-
import { SimplifyModifier as
|
|
3
|
-
import { LineSegmentsGeometry as
|
|
4
|
-
import { computeBoundsTree as
|
|
1
|
+
import { Vector3 as E, Box3 as z, Mesh as y, BufferAttribute as L, BufferGeometry as J, EdgesGeometry as Et, MeshBasicMaterial as G, PointLight as Nt, Object3D as $t, InstancedMesh as oe, Color as B, InstancedBufferAttribute as wt, Matrix4 as ne, LineSegments as yt, Line as mt, Points as St, Clock as ti, AnimationMixer as ii, Vector2 as N, Vector4 as si, Quaternion as ni, Spherical as jt, Sphere as Ht, Raycaster as Pt, MathUtils as ri, PerspectiveCamera as He, OrthographicCamera as Ct, Euler as ai, MeshPhongMaterial as gt, FrontSide as oi, MeshStandardMaterial as K, DoubleSide as ee, ObjectLoader as li, WebGLRenderTarget as ue, DepthTexture as At, UnsignedShortType as _t, ShaderMaterial as le, MeshNormalMaterial as ci, RGBAFormat as Wt, HalfFloatType as Ft, NearestFilter as Ot, Scene as ft, WebGLRenderer as Gt, SRGBColorSpace as hi, VSMShadowMap as di, SphereGeometry as Dt, DirectionalLight as ut, AmbientLight as ui, CameraHelper as pi, BoxGeometry as Tt, AxesHelper as mi, BoxHelper as gi, Box3Helper as fi, PlaneGeometry as ae, Plane as he, Fog as vi, PointsMaterial as bi, LOD as wi, TextureLoader as yi, CanvasTexture as Rt, SpriteMaterial as Lt, Sprite as kt, LineBasicMaterial as xi } from "three";
|
|
2
|
+
import { SimplifyModifier as Mi } from "three/examples/jsm/modifiers/SimplifyModifier";
|
|
3
|
+
import { LineSegmentsGeometry as Ut, LineSegments2 as qt, SSAARenderPass as Ei, FXAAShader as Si, TAARenderPass as Ci, SAOPass as Ai, SSAOPass as pt } from "three/examples/jsm/Addons";
|
|
4
|
+
import { computeBoundsTree as _i, disposeBoundsTree as Ii, acceleratedRaycast as Vi } from "three-mesh-bvh";
|
|
5
5
|
import pe from "camera-controls";
|
|
6
|
-
import { inflate as Pi, Inflate as
|
|
7
|
-
import { Potree as
|
|
8
|
-
import { GLTFLoader as
|
|
9
|
-
import { LineMaterial as
|
|
10
|
-
import { N8AOPass as
|
|
11
|
-
import { EffectComposer as
|
|
12
|
-
import { OutlinePass as
|
|
13
|
-
import { OutputPass as
|
|
14
|
-
import { RenderPass as
|
|
6
|
+
import { inflate as Pi, Inflate as Ti } from "pako";
|
|
7
|
+
import { Potree as Oi, PointSizeType as Di, PointShape as Ri, PointColorType as Li } from "potree-core-viral";
|
|
8
|
+
import { GLTFLoader as ki } from "three/examples/jsm/loaders/GLTFLoader";
|
|
9
|
+
import { LineMaterial as Qt } from "three/examples/jsm/lines/LineMaterial";
|
|
10
|
+
import { N8AOPass as Bi } from "n8ao";
|
|
11
|
+
import { EffectComposer as zi } from "three/examples/jsm/postprocessing/EffectComposer";
|
|
12
|
+
import { OutlinePass as Ni } from "three/examples/jsm/postprocessing/OutlinePass";
|
|
13
|
+
import { OutputPass as $i } from "three/examples/jsm/postprocessing/OutputPass";
|
|
14
|
+
import { RenderPass as ji } from "three/examples/jsm/postprocessing/RenderPass";
|
|
15
15
|
import { ShaderPass as xt } from "three/examples/jsm/postprocessing/ShaderPass";
|
|
16
|
-
import { SMAAPass as
|
|
16
|
+
import { SMAAPass as Hi } from "three/examples/jsm/postprocessing/SMAAPass";
|
|
17
17
|
import { GammaCorrectionShader as Wi } from "three/examples/jsm/shaders/GammaCorrectionShader";
|
|
18
|
-
import { Pass as
|
|
19
|
-
import { TransformControls as
|
|
20
|
-
import { LineSegments2 as
|
|
21
|
-
import { LineSegmentsGeometry as
|
|
22
|
-
class
|
|
18
|
+
import { Pass as Zt, FullScreenQuad as Yt } from "three/examples/jsm/postprocessing/Pass";
|
|
19
|
+
import { TransformControls as Fi } from "three/examples/jsm/controls/TransformControls";
|
|
20
|
+
import { LineSegments2 as Gi } from "three/examples/jsm/lines/LineSegments2";
|
|
21
|
+
import { LineSegmentsGeometry as Ui } from "three/examples/jsm/lines/LineSegmentsGeometry";
|
|
22
|
+
class vt {
|
|
23
23
|
static createElementFromHTML(e) {
|
|
24
24
|
const t = document.createElement("div");
|
|
25
25
|
return t.innerHTML = e.trim(), t.firstChild;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const qi = {
|
|
29
29
|
background: "#ffffff",
|
|
30
30
|
primary: "#17312c",
|
|
31
31
|
secondary: "#56b77e",
|
|
@@ -37,18 +37,18 @@ const Qi = {
|
|
|
37
37
|
added: "#16C47F",
|
|
38
38
|
modified: "#FFD65A",
|
|
39
39
|
notChanged: "#000000"
|
|
40
|
-
},
|
|
40
|
+
}, x = qi;
|
|
41
41
|
class Q {
|
|
42
42
|
static information(e) {
|
|
43
43
|
console.log(
|
|
44
44
|
`%c ${e}`,
|
|
45
|
-
`color: ${
|
|
45
|
+
`color: ${x.primary}; background: ${x.background}; font-size: 16px;`
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
static error(e) {
|
|
49
49
|
console.log(
|
|
50
50
|
`%c ${e}`,
|
|
51
|
-
`color: ${
|
|
51
|
+
`color: ${x.accent}; background: ${x.background}; font-size: 16px;`
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
static memory(e) {
|
|
@@ -107,23 +107,23 @@ class D {
|
|
|
107
107
|
return t.length == 1 ? "0" + t : t;
|
|
108
108
|
}
|
|
109
109
|
static mergeBoundingBoxes(e) {
|
|
110
|
-
const t = new
|
|
110
|
+
const t = new z();
|
|
111
111
|
return e.forEach((i) => {
|
|
112
112
|
t.union(i);
|
|
113
113
|
}), t;
|
|
114
114
|
}
|
|
115
115
|
static createLowResMesh(e, t = 0.5) {
|
|
116
|
-
const i = new
|
|
116
|
+
const i = new Mi();
|
|
117
117
|
console.log(e);
|
|
118
118
|
const s = i.modify(
|
|
119
119
|
e.geometry.clone(),
|
|
120
120
|
Math.floor(e.geometry.attributes.position.count * t)
|
|
121
121
|
);
|
|
122
|
-
return new
|
|
122
|
+
return new y(s, e.material);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
const
|
|
126
|
-
class
|
|
125
|
+
const Qi = D.hexToRGB(x.accent);
|
|
126
|
+
class Z extends y {
|
|
127
127
|
constructor(e, t, i) {
|
|
128
128
|
super(e, t), this.globalMaterialIndex = -1, this.workerPool = null, this._depthPrePassMesh = null, this._bufferElements = [], this._colors = null, this._originalColor = null, this._elementMap = /* @__PURE__ */ new Map(), this._isBatching = !1, this._batchQueue = [], this._isProcessingQueue = !1, this._edgeLines = null, this._edgeRanges = /* @__PURE__ */ new Map(), this._edgeThreshold = 60, this._edgeMaterial = null, this._selectedElements = [], this._hidingElements = [], this._isolatingElements = [], this._hiddenSet = /* @__PURE__ */ new Set(), this._isolatedSet = /* @__PURE__ */ new Set(), this._elementOpacityMap = /* @__PURE__ */ new Map(), this._isRGBAMode = !1, this._elementOriginalColors = /* @__PURE__ */ new Map(), this._temporaryColors = /* @__PURE__ */ new Map(), this._isGeneratedLights = !1, this._pointLight = null, this.workerPool = i || null;
|
|
129
129
|
}
|
|
@@ -329,7 +329,7 @@ class Y extends x {
|
|
|
329
329
|
if (this._edgeLines && (this.remove(this._edgeLines), this._edgeLines.geometry.dispose(), this._edgeLines = null), this._edgeRanges.clear(), !this._edgeMaterial)
|
|
330
330
|
return;
|
|
331
331
|
let e = 0;
|
|
332
|
-
const t = new
|
|
332
|
+
const t = new J();
|
|
333
333
|
for (const o of this._bufferElements) {
|
|
334
334
|
const a = o.buffer;
|
|
335
335
|
if (!a || a.length < 9)
|
|
@@ -350,7 +350,7 @@ class Y extends x {
|
|
|
350
350
|
const a = o.buffer;
|
|
351
351
|
if (!a || a.length < 9)
|
|
352
352
|
continue;
|
|
353
|
-
const l = new
|
|
353
|
+
const l = new J();
|
|
354
354
|
l.setAttribute("position", new L(a, 3));
|
|
355
355
|
const c = Math.floor(a.length / 3 / 3), h = new Uint32Array(c * 3);
|
|
356
356
|
for (let b = 0; b < c; b++) {
|
|
@@ -369,8 +369,8 @@ class Y extends x {
|
|
|
369
369
|
const n = new Uint32Array(e);
|
|
370
370
|
for (let o = 0; o < e; o++)
|
|
371
371
|
n[o] = o;
|
|
372
|
-
const r = new
|
|
373
|
-
r.setPositions(i), this._edgeLines = new
|
|
372
|
+
const r = new Ut();
|
|
373
|
+
r.setPositions(i), this._edgeLines = new qt(r, this._edgeMaterial), this.add(this._edgeLines);
|
|
374
374
|
}
|
|
375
375
|
/** Show edges ONLY for the given elements */
|
|
376
376
|
isolateEdge(e) {
|
|
@@ -429,43 +429,13 @@ class Y extends x {
|
|
|
429
429
|
* Select elements (highlights them with accent color)
|
|
430
430
|
*/
|
|
431
431
|
select(e, t = []) {
|
|
432
|
-
this.unselect(), this._selectedElements = e, this.changeColor(this._selectedElements,
|
|
432
|
+
this.unselect(), this._selectedElements = e, this.changeColor(this._selectedElements, Qi);
|
|
433
433
|
}
|
|
434
434
|
get selectedElements() {
|
|
435
435
|
return this._selectedElements;
|
|
436
436
|
}
|
|
437
437
|
unselect() {
|
|
438
|
-
this._selectedElements.length !== 0 && (this.
|
|
439
|
-
}
|
|
440
|
-
/**
|
|
441
|
-
* Set alpha value for elements (used for selection marking)
|
|
442
|
-
* This is VERY fast - only updates alpha channel, no geometry copying
|
|
443
|
-
*
|
|
444
|
-
* When setting alpha to 1.0 (removing selection), respects hidden/isolated state
|
|
445
|
-
*/
|
|
446
|
-
_setSelectionAlpha(e, t) {
|
|
447
|
-
var s;
|
|
448
|
-
if (!this._colors)
|
|
449
|
-
return;
|
|
450
|
-
const i = this.geometry.getAttribute("color");
|
|
451
|
-
if (i.itemSize === 4) {
|
|
452
|
-
for (const { modelId: n, elementId: r } of e) {
|
|
453
|
-
const o = (s = this._elementMap.get(n)) == null ? void 0 : s.get(r);
|
|
454
|
-
if (!o)
|
|
455
|
-
continue;
|
|
456
|
-
let a = t;
|
|
457
|
-
if (t === 1) {
|
|
458
|
-
const l = `${n}:${r}`, c = this._elementOpacityMap.get(l);
|
|
459
|
-
c !== void 0 ? a = c : this._isolatedSet.size > 0 ? a = this._isolatedSet.has(l) ? 1 : 0 : this._hiddenSet.has(l) && (a = 0);
|
|
460
|
-
}
|
|
461
|
-
for (const l of o)
|
|
462
|
-
for (let c = 0; c < l.count; c++) {
|
|
463
|
-
const h = (l.start + c) * 4 + 3;
|
|
464
|
-
this._colors[h] = a;
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
i.needsUpdate = !0;
|
|
468
|
-
}
|
|
438
|
+
this._selectedElements.length !== 0 && (this.resetColor(this._selectedElements), this._selectedElements = []);
|
|
469
439
|
}
|
|
470
440
|
//#endregion
|
|
471
441
|
//#region Hide/Isolate/Show
|
|
@@ -655,7 +625,7 @@ class Y extends x {
|
|
|
655
625
|
depthWrite: !0,
|
|
656
626
|
side: e == null ? void 0 : e.side
|
|
657
627
|
});
|
|
658
|
-
this._depthPrePassMesh = new
|
|
628
|
+
this._depthPrePassMesh = new y(this.geometry, t), this._depthPrePassMesh.renderOrder = 0, this._depthPrePassMesh.matrixAutoUpdate = !1, this._depthPrePassMesh.matrixWorld.copy(this.matrixWorld), this.parent && this.parent.add(this._depthPrePassMesh);
|
|
659
629
|
}
|
|
660
630
|
/**
|
|
661
631
|
* Remove and dispose the depth pre-pass mesh
|
|
@@ -987,7 +957,7 @@ class Y extends x {
|
|
|
987
957
|
}
|
|
988
958
|
});
|
|
989
959
|
const t = D.getCenterPoint(e), i = this.getFarthestDistance(t, e);
|
|
990
|
-
t && !this._pointLight && (this._pointLight = new
|
|
960
|
+
t && !this._pointLight && (this._pointLight = new Nt(16562741, 1, i, 0.1), this._pointLight.position.copy(t), this.add(this._pointLight)), this._isGeneratedLights = !0;
|
|
991
961
|
}
|
|
992
962
|
this._pointLight && (this._pointLight.visible = !0);
|
|
993
963
|
}
|
|
@@ -1022,7 +992,7 @@ class Y extends x {
|
|
|
1022
992
|
);
|
|
1023
993
|
if (t.length === 0)
|
|
1024
994
|
return null;
|
|
1025
|
-
const i = new
|
|
995
|
+
const i = new z(), s = new E();
|
|
1026
996
|
for (const n of t)
|
|
1027
997
|
if (n.buffer)
|
|
1028
998
|
for (let r = 0; r < n.buffer.length; r += 3)
|
|
@@ -1073,7 +1043,7 @@ class Y extends x {
|
|
|
1073
1043
|
o,
|
|
1074
1044
|
100
|
|
1075
1045
|
// Process 100 elements at a time
|
|
1076
|
-
), l = new
|
|
1046
|
+
), l = new Z(
|
|
1077
1047
|
void 0,
|
|
1078
1048
|
Array.isArray(this.material) ? this.material[0] : this.material,
|
|
1079
1049
|
this.workerPool
|
|
@@ -1116,12 +1086,12 @@ class Y extends x {
|
|
|
1116
1086
|
}), this.geometry.index && this.geometry.setIndex(null)), this._edgeLines && (this._edgeLines.geometry && this._edgeLines.geometry.dispose(), this.remove(this._edgeLines), this._edgeLines = null), this.geometry = null;
|
|
1117
1087
|
}
|
|
1118
1088
|
}
|
|
1119
|
-
let
|
|
1120
|
-
class
|
|
1089
|
+
let Zi = 1;
|
|
1090
|
+
class Bt {
|
|
1121
1091
|
constructor(e) {
|
|
1122
1092
|
this._worker = new Worker(e), this._worker.onmessage = (t) => {
|
|
1123
1093
|
this._OnMessage(t);
|
|
1124
|
-
}, this._resolve = null, this._id =
|
|
1094
|
+
}, this._resolve = null, this._id = Zi++;
|
|
1125
1095
|
}
|
|
1126
1096
|
_OnMessage(e) {
|
|
1127
1097
|
const t = this._resolve;
|
|
@@ -1137,14 +1107,14 @@ class Nt {
|
|
|
1137
1107
|
this._worker.terminate();
|
|
1138
1108
|
}
|
|
1139
1109
|
}
|
|
1140
|
-
class
|
|
1110
|
+
class te {
|
|
1141
1111
|
/**
|
|
1142
1112
|
*
|
|
1143
1113
|
* @param maxSize maximum number of worker
|
|
1144
1114
|
* @param scriptPath javascript path for worker execute
|
|
1145
1115
|
*/
|
|
1146
1116
|
constructor(e, t) {
|
|
1147
|
-
this._workers = [], this.maximumNumberOfWorker = e, this.scriptPath = t, this._workers.push(new
|
|
1117
|
+
this._workers = [], this.maximumNumberOfWorker = e, this.scriptPath = t, this._workers.push(new Bt(t)), this._free = [...this._workers], this._busy = {}, this._queue = [];
|
|
1148
1118
|
}
|
|
1149
1119
|
get length() {
|
|
1150
1120
|
return this._workers.length;
|
|
@@ -1163,7 +1133,7 @@ class ie {
|
|
|
1163
1133
|
_PumpQueue() {
|
|
1164
1134
|
for (; this._queue.length > 0; ) {
|
|
1165
1135
|
if (this._free.length == 0 && this._workers.length < this.maximumNumberOfWorker) {
|
|
1166
|
-
const s = new
|
|
1136
|
+
const s = new Bt(this.scriptPath);
|
|
1167
1137
|
this._workers.push(s), this._free.push(s);
|
|
1168
1138
|
}
|
|
1169
1139
|
if (this._free.length == 0)
|
|
@@ -1180,7 +1150,93 @@ class ie {
|
|
|
1180
1150
|
this._workers.forEach((e) => e.dispose()), this._workers = [], this._free = [], this._busy = {}, this._queue = [];
|
|
1181
1151
|
}
|
|
1182
1152
|
}
|
|
1183
|
-
|
|
1153
|
+
function Yi() {
|
|
1154
|
+
self.onmessage = (g) => {
|
|
1155
|
+
const {
|
|
1156
|
+
bufferElements: e,
|
|
1157
|
+
selectedKeys: t
|
|
1158
|
+
} = g.data, i = new Set(t);
|
|
1159
|
+
let s = 0;
|
|
1160
|
+
for (const o of e) {
|
|
1161
|
+
const a = new Float32Array(o.buffer);
|
|
1162
|
+
if (o.instances && o.instances.length > 0)
|
|
1163
|
+
for (const l of o.instances) {
|
|
1164
|
+
const c = `${o.modelId}-${l.elementId}`;
|
|
1165
|
+
i.has(c) && (s += a.length);
|
|
1166
|
+
}
|
|
1167
|
+
else
|
|
1168
|
+
s += a.length;
|
|
1169
|
+
}
|
|
1170
|
+
if (s === 0) {
|
|
1171
|
+
self.postMessage({ positions: null });
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
const n = new Float32Array(s);
|
|
1175
|
+
let r = 0;
|
|
1176
|
+
for (const o of e) {
|
|
1177
|
+
const a = new Float32Array(o.buffer);
|
|
1178
|
+
if (o.instances && o.instances.length > 0)
|
|
1179
|
+
for (const l of o.instances) {
|
|
1180
|
+
const c = `${o.modelId}-${l.elementId}`;
|
|
1181
|
+
if (!i.has(c))
|
|
1182
|
+
continue;
|
|
1183
|
+
const h = l.transform;
|
|
1184
|
+
for (let d = 0; d < a.length; d += 3) {
|
|
1185
|
+
const u = a[d], p = a[d + 1], m = a[d + 2], f = 1 / (h[3] * u + h[7] * p + h[11] * m + h[15]);
|
|
1186
|
+
n[r] = (h[0] * u + h[4] * p + h[8] * m + h[12]) * f, n[r + 1] = (h[1] * u + h[5] * p + h[9] * m + h[13]) * f, n[r + 2] = (h[2] * u + h[6] * p + h[10] * m + h[14]) * f, r += 3;
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
else
|
|
1190
|
+
n.set(a, r), r += a.length;
|
|
1191
|
+
}
|
|
1192
|
+
self.postMessage({ positions: n.buffer }, [n.buffer]);
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
const Xi = Yi;
|
|
1196
|
+
class Ki {
|
|
1197
|
+
constructor() {
|
|
1198
|
+
this._resolve = null, this._requestId = 0;
|
|
1199
|
+
const e = new Blob([`(${Xi})()`]), t = URL.createObjectURL(e);
|
|
1200
|
+
this._worker = new Worker(t), this._worker.onmessage = (i) => {
|
|
1201
|
+
const s = this._resolve;
|
|
1202
|
+
if (this._resolve = null, s) {
|
|
1203
|
+
const n = i.data.positions ? new Float32Array(i.data.positions) : null;
|
|
1204
|
+
s(n);
|
|
1205
|
+
}
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
* Merge selected element positions in a background thread.
|
|
1210
|
+
* Cancels any in-flight request automatically.
|
|
1211
|
+
*/
|
|
1212
|
+
merge(e, t) {
|
|
1213
|
+
this._resolve && (this._resolve(null), this._resolve = null);
|
|
1214
|
+
const i = ++this._requestId, s = [], n = e.filter((r) => r.buffer).map((r) => {
|
|
1215
|
+
const o = r.buffer.slice().buffer;
|
|
1216
|
+
return s.push(o), {
|
|
1217
|
+
buffer: o,
|
|
1218
|
+
modelId: r.modelId,
|
|
1219
|
+
instances: r.instances
|
|
1220
|
+
};
|
|
1221
|
+
});
|
|
1222
|
+
return new Promise((r) => {
|
|
1223
|
+
this._resolve = (o) => {
|
|
1224
|
+
if (i !== this._requestId) {
|
|
1225
|
+
r(null);
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1228
|
+
r(o);
|
|
1229
|
+
}, this._worker.postMessage(
|
|
1230
|
+
{ bufferElements: n, selectedKeys: t },
|
|
1231
|
+
s
|
|
1232
|
+
);
|
|
1233
|
+
});
|
|
1234
|
+
}
|
|
1235
|
+
dispose() {
|
|
1236
|
+
this._worker.terminate();
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
const Ji = D.hexToRGB(x.accent), Fe = class Fe extends $t {
|
|
1184
1240
|
constructor(e) {
|
|
1185
1241
|
super(), this.material = e, this.globalMaterialIndex = -1, this._depthPrePassMeshes = [], this._instancedMeshes = /* @__PURE__ */ new Map(), this._bufferElements = [], this._originalColor = null, this._elementMap = /* @__PURE__ */ new Map(), this._originalTransforms = /* @__PURE__ */ new Map(), this._elementOpacity = /* @__PURE__ */ new Map(), this._temporaryColors = /* @__PURE__ */ new Map(), this._selectedElements = [], this._hidingElements = [], this._isolatingElements = [], this._edgeLines = /* @__PURE__ */ new Map(), this._edgeRanges = /* @__PURE__ */ new Map(), this._edgeThreshold = 60, this._edgeMaterial = null, this._isGeneratedLights = !1, this._pointLight = null, this._hiddenSet = /* @__PURE__ */ new Set(), this._isolatedSet = /* @__PURE__ */ new Set(), this.material && "vertexColors" in this.material && (this.material.vertexColors = !0, this.material.needsUpdate = !0);
|
|
1186
1242
|
}
|
|
@@ -1221,28 +1277,26 @@ const Ki = D.hexToRGB(y.accent), Ge = class Ge extends Ft {
|
|
|
1221
1277
|
);
|
|
1222
1278
|
}
|
|
1223
1279
|
_createInstancedMesh(e, t, i) {
|
|
1224
|
-
const s = this._createGeometryFromBuffer(e.buffer), n = new
|
|
1225
|
-
t.forEach(({ element:
|
|
1226
|
-
const
|
|
1227
|
-
n.setMatrixAt(
|
|
1228
|
-
const
|
|
1229
|
-
this._originalTransforms.has(
|
|
1230
|
-
const
|
|
1231
|
-
r[
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1280
|
+
const s = this._createGeometryFromBuffer(e.buffer), n = new oe(s, this.material, t.length), r = new Float32Array(t.length * 3);
|
|
1281
|
+
t.forEach(({ element: a, instanceData: l }, c) => {
|
|
1282
|
+
const h = this._transformArrayToMatrix4(l.transform);
|
|
1283
|
+
n.setMatrixAt(c, h);
|
|
1284
|
+
const d = a.modelId.toString(), u = l.elementId;
|
|
1285
|
+
this._originalTransforms.has(d) || this._originalTransforms.set(d, /* @__PURE__ */ new Map()), this._originalTransforms.get(d).set(u, h.clone());
|
|
1286
|
+
const p = this._originalColor || new B(1, 1, 1);
|
|
1287
|
+
r[c * 3] = p.r, r[c * 3 + 1] = p.g, r[c * 3 + 2] = p.b, this._elementMap.has(d) || this._elementMap.set(d, /* @__PURE__ */ new Map());
|
|
1288
|
+
const m = this._elementMap.get(d);
|
|
1289
|
+
m.has(u) || m.set(u, []), m.get(u).push({
|
|
1234
1290
|
geometryKey: i,
|
|
1235
|
-
instanceIndex:
|
|
1291
|
+
instanceIndex: c,
|
|
1236
1292
|
instancedMesh: n
|
|
1237
1293
|
});
|
|
1238
|
-
}), n.instanceColor = new
|
|
1294
|
+
}), n.instanceColor = new wt(r, 3), n.instanceMatrix.needsUpdate = !0;
|
|
1239
1295
|
const o = new Float32Array(t.length);
|
|
1240
|
-
o.fill(1), s.setAttribute("instanceOpacity", new
|
|
1241
|
-
const a = new Float32Array(t.length);
|
|
1242
|
-
return a.fill(0), s.setAttribute("instanceSelected", new je(a, 1)), this.material && "vertexColors" in this.material && (this.material.vertexColors = !0, this.material.needsUpdate = !0), n;
|
|
1296
|
+
return o.fill(1), s.setAttribute("instanceOpacity", new wt(o, 1)), this.material && "vertexColors" in this.material && (this.material.vertexColors = !0, this.material.needsUpdate = !0), n;
|
|
1243
1297
|
}
|
|
1244
1298
|
_createGeometryFromBuffer(e) {
|
|
1245
|
-
const t = new
|
|
1299
|
+
const t = new J();
|
|
1246
1300
|
t.setAttribute("position", new L(e, 3));
|
|
1247
1301
|
const i = e.length / 3, s = Math.floor(i / 3), n = new Uint32Array(s * 3);
|
|
1248
1302
|
for (let o = 0; o < s; o++) {
|
|
@@ -1261,9 +1315,9 @@ const Ki = D.hexToRGB(y.accent), Ge = class Ge extends Ft {
|
|
|
1261
1315
|
}
|
|
1262
1316
|
_transformArrayToMatrix4(e) {
|
|
1263
1317
|
if (e.length === 16)
|
|
1264
|
-
return new
|
|
1318
|
+
return new ne().fromArray(e);
|
|
1265
1319
|
if (e.length === 12) {
|
|
1266
|
-
const t = new
|
|
1320
|
+
const t = new ne();
|
|
1267
1321
|
return t.set(
|
|
1268
1322
|
e[0],
|
|
1269
1323
|
e[1],
|
|
@@ -1283,7 +1337,7 @@ const Ki = D.hexToRGB(y.accent), Ge = class Ge extends Ft {
|
|
|
1283
1337
|
1
|
|
1284
1338
|
), t;
|
|
1285
1339
|
} else
|
|
1286
|
-
return console.warn("Unsupported transform array length:", e.length), new
|
|
1340
|
+
return console.warn("Unsupported transform array length:", e.length), new ne().identity();
|
|
1287
1341
|
}
|
|
1288
1342
|
_generateGeometryKey(e) {
|
|
1289
1343
|
let t = e.length.toString();
|
|
@@ -1299,29 +1353,10 @@ const Ki = D.hexToRGB(y.accent), Ge = class Ge extends Ft {
|
|
|
1299
1353
|
}
|
|
1300
1354
|
//#region Selection and Color Control
|
|
1301
1355
|
select(e, t = []) {
|
|
1302
|
-
this.unselect(), this._selectedElements = e, this.changeColor(this._selectedElements,
|
|
1356
|
+
this.unselect(), this._selectedElements = e, this.changeColor(this._selectedElements, Ji);
|
|
1303
1357
|
}
|
|
1304
1358
|
unselect() {
|
|
1305
|
-
this._selectedElements.length > 0 && (this.
|
|
1306
|
-
}
|
|
1307
|
-
/**
|
|
1308
|
-
* Set instance selection state for fast outline detection
|
|
1309
|
-
* @param elements - Elements to set selection for
|
|
1310
|
-
* @param selected - 1.0 = selected, 0.0 = not selected
|
|
1311
|
-
*/
|
|
1312
|
-
_setInstanceSelection(e, t) {
|
|
1313
|
-
var i;
|
|
1314
|
-
this._ensureSelectionAttributes();
|
|
1315
|
-
for (const { modelId: s, elementId: n } of e) {
|
|
1316
|
-
const r = (i = this._elementMap.get(s)) == null ? void 0 : i.get(n);
|
|
1317
|
-
if (r)
|
|
1318
|
-
for (const { instancedMesh: o, instanceIndex: a } of r) {
|
|
1319
|
-
const l = o.geometry.getAttribute(
|
|
1320
|
-
"instanceSelected"
|
|
1321
|
-
);
|
|
1322
|
-
l && (l.array[a] = t, l.needsUpdate = !0);
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1359
|
+
this._selectedElements.length > 0 && (this.resetColor(this._selectedElements), this._selectedElements = []);
|
|
1325
1360
|
}
|
|
1326
1361
|
/**
|
|
1327
1362
|
* Changes the color of multiple elements.
|
|
@@ -1445,7 +1480,7 @@ const Ki = D.hexToRGB(y.accent), Ge = class Ge extends Ft {
|
|
|
1445
1480
|
var r;
|
|
1446
1481
|
const n = (r = this._elementMap.get(i)) == null ? void 0 : r.get(s);
|
|
1447
1482
|
n && n.forEach(({ instancedMesh: o, instanceIndex: a }) => {
|
|
1448
|
-
o.setMatrixAt(a,
|
|
1483
|
+
o.setMatrixAt(a, Fe.ZERO_MATRIX), o.instanceMatrix.needsUpdate = !0;
|
|
1449
1484
|
});
|
|
1450
1485
|
}));
|
|
1451
1486
|
}
|
|
@@ -1463,7 +1498,7 @@ const Ki = D.hexToRGB(y.accent), Ge = class Ge extends Ft {
|
|
|
1463
1498
|
this._isolatedSet.add(s);
|
|
1464
1499
|
}), this._isolatingElements = [...t], this._isolatedSet.size === 0 ? (this.visible = !1, this._isolatingElements) : (this._instancedMeshes.forEach((i) => {
|
|
1465
1500
|
for (let s = 0; s < i.count; s++)
|
|
1466
|
-
i.setMatrixAt(s,
|
|
1501
|
+
i.setMatrixAt(s, Fe.ZERO_MATRIX);
|
|
1467
1502
|
i.instanceMatrix.needsUpdate = !0;
|
|
1468
1503
|
}), t.forEach(({ modelId: i, elementId: s }) => {
|
|
1469
1504
|
var o, a;
|
|
@@ -1533,10 +1568,7 @@ const Ki = D.hexToRGB(y.accent), Ge = class Ge extends Ft {
|
|
|
1533
1568
|
//#endregion
|
|
1534
1569
|
//#region Opacity Control (Per-Instance Transparency)
|
|
1535
1570
|
/**
|
|
1536
|
-
* Inject per-instance opacity
|
|
1537
|
-
* Enables:
|
|
1538
|
-
* - Per-instance opacity (ghosting, hiding)
|
|
1539
|
-
* - Selection alpha marker (for fast outline detection via AlphaSelectionOutlinePass)
|
|
1571
|
+
* Inject per-instance opacity shader into material
|
|
1540
1572
|
* Must be called after material is set and before rendering
|
|
1541
1573
|
*/
|
|
1542
1574
|
injectOpacityShader() {
|
|
@@ -1548,28 +1580,19 @@ const Ki = D.hexToRGB(y.accent), Ge = class Ge extends Ft {
|
|
|
1548
1580
|
"#include <common>",
|
|
1549
1581
|
`#include <common>
|
|
1550
1582
|
attribute float instanceOpacity;
|
|
1551
|
-
|
|
1552
|
-
varying float vInstanceOpacity;
|
|
1553
|
-
varying float vInstanceSelected;`
|
|
1583
|
+
varying float vInstanceOpacity;`
|
|
1554
1584
|
), t.vertexShader = t.vertexShader.replace(
|
|
1555
1585
|
"#include <begin_vertex>",
|
|
1556
1586
|
`#include <begin_vertex>
|
|
1557
|
-
vInstanceOpacity = instanceOpacity
|
|
1558
|
-
vInstanceSelected = instanceSelected;`
|
|
1587
|
+
vInstanceOpacity = instanceOpacity;`
|
|
1559
1588
|
), t.fragmentShader = t.fragmentShader.replace(
|
|
1560
1589
|
"#include <common>",
|
|
1561
1590
|
`#include <common>
|
|
1562
|
-
varying float vInstanceOpacity
|
|
1563
|
-
varying float vInstanceSelected;`
|
|
1591
|
+
varying float vInstanceOpacity;`
|
|
1564
1592
|
), t.fragmentShader = t.fragmentShader.replace(
|
|
1565
1593
|
"#include <dithering_fragment>",
|
|
1566
1594
|
`#include <dithering_fragment>
|
|
1567
|
-
// Apply per-instance opacity
|
|
1568
1595
|
gl_FragColor.a *= vInstanceOpacity;
|
|
1569
|
-
// If selected, set alpha to SELECTION_ALPHA (0.99) for outline detection
|
|
1570
|
-
if (vInstanceSelected > 0.5) {
|
|
1571
|
-
gl_FragColor.a = 0.99;
|
|
1572
|
-
}
|
|
1573
1596
|
if (gl_FragColor.a < 0.01) discard;`
|
|
1574
1597
|
);
|
|
1575
1598
|
}, e._opacityInjected = !0, e.needsUpdate = !0);
|
|
@@ -1582,25 +1605,11 @@ if (gl_FragColor.a < 0.01) discard;`
|
|
|
1582
1605
|
if (!e.geometry.getAttribute("instanceOpacity")) {
|
|
1583
1606
|
const t = new Float32Array(e.count);
|
|
1584
1607
|
t.fill(1);
|
|
1585
|
-
const i = new
|
|
1608
|
+
const i = new wt(t, 1);
|
|
1586
1609
|
e.geometry.setAttribute("instanceOpacity", i);
|
|
1587
1610
|
}
|
|
1588
1611
|
});
|
|
1589
1612
|
}
|
|
1590
|
-
/**
|
|
1591
|
-
* Ensure all instanced meshes have selection attribute
|
|
1592
|
-
* Used for fast outline detection via AlphaSelectionOutlinePass
|
|
1593
|
-
*/
|
|
1594
|
-
_ensureSelectionAttributes() {
|
|
1595
|
-
this._instancedMeshes.forEach((e) => {
|
|
1596
|
-
if (!e.geometry.getAttribute("instanceSelected")) {
|
|
1597
|
-
const t = new Float32Array(e.count);
|
|
1598
|
-
t.fill(0);
|
|
1599
|
-
const i = new je(t, 1);
|
|
1600
|
-
e.geometry.setAttribute("instanceSelected", i);
|
|
1601
|
-
}
|
|
1602
|
-
});
|
|
1603
|
-
}
|
|
1604
1613
|
/**
|
|
1605
1614
|
* Update opacity for specific instances
|
|
1606
1615
|
*/
|
|
@@ -1700,7 +1709,7 @@ varying float vInstanceOpacity;`
|
|
|
1700
1709
|
if (vInstanceOpacity < 0.5) discard;`
|
|
1701
1710
|
);
|
|
1702
1711
|
}, i.needsUpdate = !0;
|
|
1703
|
-
const s = new
|
|
1712
|
+
const s = new oe(
|
|
1704
1713
|
e.geometry,
|
|
1705
1714
|
i,
|
|
1706
1715
|
e.count
|
|
@@ -1835,7 +1844,7 @@ if (vInstanceOpacity < 0.5) discard;`
|
|
|
1835
1844
|
r.length * o
|
|
1836
1845
|
);
|
|
1837
1846
|
for (let c = 0; c < o; c++) {
|
|
1838
|
-
const h = new
|
|
1847
|
+
const h = new ne();
|
|
1839
1848
|
e.getMatrixAt(c, h);
|
|
1840
1849
|
const d = c * r.length;
|
|
1841
1850
|
for (let u = 0; u < r.length; u += 3) {
|
|
@@ -1847,9 +1856,9 @@ if (vInstanceOpacity < 0.5) discard;`
|
|
|
1847
1856
|
p.applyMatrix4(h), a[d + u] = p.x, a[d + u + 1] = p.y, a[d + u + 2] = p.z;
|
|
1848
1857
|
}
|
|
1849
1858
|
}
|
|
1850
|
-
const l = new
|
|
1859
|
+
const l = new Ut();
|
|
1851
1860
|
if (l.setPositions(a), this._edgeMaterial) {
|
|
1852
|
-
const c = new
|
|
1861
|
+
const c = new qt(l, this._edgeMaterial);
|
|
1853
1862
|
this.add(c), this._edgeLines.set(t, c);
|
|
1854
1863
|
}
|
|
1855
1864
|
}
|
|
@@ -1879,7 +1888,7 @@ if (vInstanceOpacity < 0.5) discard;`
|
|
|
1879
1888
|
* Custom raycast function for instanced meshes
|
|
1880
1889
|
*/
|
|
1881
1890
|
_instancedRaycast(e, t, i) {
|
|
1882
|
-
const s =
|
|
1891
|
+
const s = oe.prototype.raycast, n = [];
|
|
1883
1892
|
s.call(e, t, n), n.forEach((r) => {
|
|
1884
1893
|
if (r.instanceId !== void 0) {
|
|
1885
1894
|
const o = this.findElementByInstancedMeshAndIndex(
|
|
@@ -1930,15 +1939,15 @@ if (vInstanceOpacity < 0.5) discard;`
|
|
|
1930
1939
|
}
|
|
1931
1940
|
getElementBoxs(e) {
|
|
1932
1941
|
var s;
|
|
1933
|
-
const t = new
|
|
1942
|
+
const t = new z();
|
|
1934
1943
|
let i = !1;
|
|
1935
1944
|
for (const n of e) {
|
|
1936
1945
|
const r = (s = this._elementMap.get(n.modelId)) == null ? void 0 : s.get(n.elementId);
|
|
1937
1946
|
if (!(!r || r.length === 0))
|
|
1938
1947
|
for (const { instancedMesh: o, instanceIndex: a } of r) {
|
|
1939
|
-
const l = new
|
|
1948
|
+
const l = new ne();
|
|
1940
1949
|
o.getMatrixAt(a, l);
|
|
1941
|
-
const c = new
|
|
1950
|
+
const c = new z().setFromBufferAttribute(
|
|
1942
1951
|
o.geometry.getAttribute("position")
|
|
1943
1952
|
);
|
|
1944
1953
|
c.applyMatrix4(l), t.union(c), i = !0;
|
|
@@ -1971,7 +1980,7 @@ if (vInstanceOpacity < 0.5) discard;`
|
|
|
1971
1980
|
}
|
|
1972
1981
|
});
|
|
1973
1982
|
const t = D.getCenterPoint(e), i = this.getFarthestDistance(t, e);
|
|
1974
|
-
t && !this._pointLight && (this._pointLight = new
|
|
1983
|
+
t && !this._pointLight && (this._pointLight = new Nt(16562741, 1, i, 0.1), this._pointLight.position.copy(t), this.add(this._pointLight)), this._isGeneratedLights = !0;
|
|
1975
1984
|
}
|
|
1976
1985
|
this._pointLight && (this._pointLight.visible = !0);
|
|
1977
1986
|
}
|
|
@@ -2007,9 +2016,9 @@ if (vInstanceOpacity < 0.5) discard;`
|
|
|
2007
2016
|
}
|
|
2008
2017
|
//#endregion
|
|
2009
2018
|
};
|
|
2010
|
-
|
|
2011
|
-
let ce =
|
|
2012
|
-
const
|
|
2019
|
+
Fe.ZERO_MATRIX = new ne().makeScale(0, 0, 0);
|
|
2020
|
+
let ce = Fe;
|
|
2021
|
+
const es = `
|
|
2013
2022
|
// Web Worker code as string (to be created as blob URL)
|
|
2014
2023
|
self.onmessage = function(e) {
|
|
2015
2024
|
const {
|
|
@@ -2123,16 +2132,16 @@ self.onmessage = function(e) {
|
|
|
2123
2132
|
}
|
|
2124
2133
|
};
|
|
2125
2134
|
`;
|
|
2126
|
-
class
|
|
2135
|
+
class ts extends y {
|
|
2127
2136
|
constructor() {
|
|
2128
|
-
super(), this.workerPool = null, this.bimModels = [], this.isReady = !1, this._batchedMeshes = [], this._instancedMeshes = [], this._isolatingElements = [], this._initializeWorkerPool(4);
|
|
2137
|
+
super(), this.workerPool = null, this._mergePositionsWorker = null, this.bimModels = [], this.isReady = !1, this._batchedMeshes = [], this._instancedMeshes = [], this._isolatingElements = [], this._initializeWorkerPool(4);
|
|
2129
2138
|
}
|
|
2130
2139
|
_initializeWorkerPool(e) {
|
|
2131
2140
|
try {
|
|
2132
|
-
const t = new Blob([
|
|
2141
|
+
const t = new Blob([es], {
|
|
2133
2142
|
type: "application/javascript"
|
|
2134
2143
|
}), i = URL.createObjectURL(t);
|
|
2135
|
-
this.workerPool = new
|
|
2144
|
+
this.workerPool = new te(
|
|
2136
2145
|
e || navigator.hardwareConcurrency || 4,
|
|
2137
2146
|
i
|
|
2138
2147
|
), console.log(
|
|
@@ -2144,9 +2153,9 @@ class es extends x {
|
|
|
2144
2153
|
}
|
|
2145
2154
|
get bounds() {
|
|
2146
2155
|
try {
|
|
2147
|
-
return new
|
|
2156
|
+
return new z().setFromObject(this);
|
|
2148
2157
|
} catch {
|
|
2149
|
-
return new
|
|
2158
|
+
return new z();
|
|
2150
2159
|
}
|
|
2151
2160
|
}
|
|
2152
2161
|
setReady(e) {
|
|
@@ -2169,7 +2178,7 @@ class es extends x {
|
|
|
2169
2178
|
* Get diagnostic info about merged model structure
|
|
2170
2179
|
*/
|
|
2171
2180
|
getDiagnostics() {
|
|
2172
|
-
const e = this.children.filter((s) => s instanceof
|
|
2181
|
+
const e = this.children.filter((s) => s instanceof Z).length, t = this.children.filter(
|
|
2173
2182
|
(s) => s instanceof ce
|
|
2174
2183
|
).length;
|
|
2175
2184
|
let i = 0;
|
|
@@ -2196,9 +2205,9 @@ class es extends x {
|
|
|
2196
2205
|
}
|
|
2197
2206
|
hide(e) {
|
|
2198
2207
|
this._batchedMeshes.forEach((t) => {
|
|
2199
|
-
t.hide(e);
|
|
2208
|
+
t.hide(e), t.hideEdge(e);
|
|
2200
2209
|
}), this._instancedMeshes.forEach((t) => {
|
|
2201
|
-
t.hide(e);
|
|
2210
|
+
t.hide(e), t.hideEdge(e);
|
|
2202
2211
|
});
|
|
2203
2212
|
}
|
|
2204
2213
|
isolate(e) {
|
|
@@ -2311,7 +2320,7 @@ class es extends x {
|
|
|
2311
2320
|
return null;
|
|
2312
2321
|
const n = new Float32Array(s);
|
|
2313
2322
|
let r = 0;
|
|
2314
|
-
const o = new
|
|
2323
|
+
const o = new ne(), a = new E();
|
|
2315
2324
|
for (const l of i)
|
|
2316
2325
|
if (l.buffer)
|
|
2317
2326
|
if (l.instances && l.instances.length > 0)
|
|
@@ -2327,6 +2336,17 @@ class es extends x {
|
|
|
2327
2336
|
n.set(l.buffer, r), r += l.buffer.length;
|
|
2328
2337
|
return n;
|
|
2329
2338
|
}
|
|
2339
|
+
/**
|
|
2340
|
+
* Async version — offloads vertex merging to a Web Worker so the main thread stays unblocked.
|
|
2341
|
+
* Automatically cancels any in-flight request when called again.
|
|
2342
|
+
*/
|
|
2343
|
+
async getSelectedElementsPositionsAsync() {
|
|
2344
|
+
const e = this.getSelectedElements();
|
|
2345
|
+
if (e.length === 0)
|
|
2346
|
+
return null;
|
|
2347
|
+
const t = e.map((s) => `${s.modelId}-${s.elementId}`), i = this.getElements(e);
|
|
2348
|
+
return i.length === 0 ? null : (this._mergePositionsWorker || (this._mergePositionsWorker = new Ki()), this._mergePositionsWorker.merge(i, t));
|
|
2349
|
+
}
|
|
2330
2350
|
/**
|
|
2331
2351
|
* Changes the color of multiple elements in the merged mesh.
|
|
2332
2352
|
* Works with RGBA color buffer (preserves existing alpha values)
|
|
@@ -2428,70 +2448,71 @@ class es extends x {
|
|
|
2428
2448
|
* *then regenerate again
|
|
2429
2449
|
*/
|
|
2430
2450
|
dispose() {
|
|
2431
|
-
|
|
2451
|
+
var e;
|
|
2452
|
+
this.isReady = !1, this._batchedMeshes.forEach((t) => t.dispose()), this._batchedMeshes = [], this._instancedMeshes.forEach((t) => t.dispose()), this._instancedMeshes = [], (e = this._mergePositionsWorker) == null || e.dispose(), this._mergePositionsWorker = null, this.children = [];
|
|
2432
2453
|
}
|
|
2433
2454
|
}
|
|
2434
|
-
class
|
|
2455
|
+
class hr {
|
|
2435
2456
|
constructor() {
|
|
2436
2457
|
this.MaterialIndex = 0, this.Vertices = [], this.Indices = [], this.Name = "", this.Instances = [];
|
|
2437
2458
|
}
|
|
2438
2459
|
}
|
|
2439
|
-
class
|
|
2460
|
+
class dr {
|
|
2440
2461
|
constructor() {
|
|
2441
2462
|
this.MaterialIndex = 0, this.Elements = [];
|
|
2442
2463
|
}
|
|
2443
2464
|
}
|
|
2444
|
-
class
|
|
2465
|
+
class ur {
|
|
2445
2466
|
constructor() {
|
|
2446
2467
|
this.Vertices = [], this.Indices = [], this.Instances = [], this.Id = "";
|
|
2447
2468
|
}
|
|
2448
2469
|
}
|
|
2449
|
-
class
|
|
2470
|
+
class pr {
|
|
2450
2471
|
constructor() {
|
|
2451
2472
|
this.Vertices = [], this.Indices = [], this.Transform = null;
|
|
2452
2473
|
}
|
|
2453
2474
|
}
|
|
2454
|
-
class
|
|
2475
|
+
class mr {
|
|
2455
2476
|
constructor() {
|
|
2456
2477
|
this.buffer = null, this.instances = [];
|
|
2457
2478
|
}
|
|
2458
2479
|
}
|
|
2459
|
-
class
|
|
2480
|
+
class gr {
|
|
2460
2481
|
constructor() {
|
|
2461
2482
|
this.Solids = [], this.Id = "", this.Instances = [];
|
|
2462
2483
|
}
|
|
2463
2484
|
}
|
|
2464
|
-
class
|
|
2485
|
+
class fr {
|
|
2465
2486
|
constructor() {
|
|
2466
|
-
this.Materials = [], this.Elements = [], this.Camera = new
|
|
2487
|
+
this.Materials = [], this.Elements = [], this.Camera = new Xt();
|
|
2467
2488
|
}
|
|
2468
2489
|
}
|
|
2469
|
-
class
|
|
2490
|
+
class vr {
|
|
2470
2491
|
constructor() {
|
|
2471
2492
|
this.MaterialIndex = 0, this.Vertices = [], this.Indices = [], this.Buffer = [];
|
|
2472
2493
|
}
|
|
2473
2494
|
}
|
|
2474
|
-
class
|
|
2495
|
+
class Xt {
|
|
2475
2496
|
constructor() {
|
|
2476
|
-
this.scale = 0, this.origin = new
|
|
2497
|
+
this.scale = 0, this.origin = new re(), this.eyePosition = new re(), this.upDirection = new re(), this.forwardDirection = new re(), this.target = new re(), this.box = new is();
|
|
2477
2498
|
}
|
|
2478
2499
|
}
|
|
2479
|
-
class
|
|
2500
|
+
class is {
|
|
2480
2501
|
constructor() {
|
|
2481
|
-
this.min = new
|
|
2502
|
+
this.min = new re(), this.max = new re();
|
|
2482
2503
|
}
|
|
2483
2504
|
}
|
|
2484
|
-
class
|
|
2505
|
+
class br {
|
|
2485
2506
|
constructor() {
|
|
2486
|
-
this.Data = {}, this.CameraData = new
|
|
2507
|
+
this.Data = {}, this.CameraData = new Xt(), this.Translation = [];
|
|
2487
2508
|
}
|
|
2488
2509
|
}
|
|
2489
|
-
class
|
|
2510
|
+
class re {
|
|
2490
2511
|
constructor() {
|
|
2491
2512
|
this.X = 0, this.Y = 0, this.Z = 0;
|
|
2492
2513
|
}
|
|
2493
2514
|
}
|
|
2494
|
-
const
|
|
2515
|
+
const ss = {
|
|
2495
2516
|
enabled: !0,
|
|
2496
2517
|
castShadow: !0,
|
|
2497
2518
|
intensity: 5,
|
|
@@ -2502,7 +2523,7 @@ const is = {
|
|
|
2502
2523
|
indirectLightIntensity: 1.2,
|
|
2503
2524
|
shadowcatcher: !0
|
|
2504
2525
|
};
|
|
2505
|
-
function
|
|
2526
|
+
function ns() {
|
|
2506
2527
|
function g(i) {
|
|
2507
2528
|
let s = 0;
|
|
2508
2529
|
for (let n = 0; n < i.length; n++)
|
|
@@ -2542,15 +2563,15 @@ function ss() {
|
|
|
2542
2563
|
const w = String(b.source), S = String(b.target), A = u.get(w), C = u.get(S);
|
|
2543
2564
|
if (!A || !C)
|
|
2544
2565
|
return;
|
|
2545
|
-
const M = A.x - C.x, _ = A.y - C.y, I = Math.sqrt(M * M + _ * _) || 1, O = I * I / d, V = M / I * O,
|
|
2546
|
-
A.vx -= V, A.vy -=
|
|
2566
|
+
const M = A.x - C.x, _ = A.y - C.y, I = Math.sqrt(M * M + _ * _) || 1, O = I * I / d, V = M / I * O, P = _ / I * O;
|
|
2567
|
+
A.vx -= V, A.vy -= P, C.vx += V, C.vy += P;
|
|
2547
2568
|
}), i.forEach((b) => {
|
|
2548
2569
|
const w = u.get(b.id), S = Math.sqrt(w.vx * w.vx + w.vy * w.vy) || 1, A = Math.min(S, p);
|
|
2549
2570
|
if (w.x += w.vx / S * A, w.y += w.vy / S * A, l === "circular") {
|
|
2550
2571
|
const C = r / 2, M = o / 2, _ = Math.min(r, o) / 2, I = w.x - C, O = w.y - M;
|
|
2551
2572
|
if (Math.sqrt(I * I + O * O) > _) {
|
|
2552
|
-
const
|
|
2553
|
-
w.x = C + _ * Math.cos(
|
|
2573
|
+
const P = Math.atan2(O, I);
|
|
2574
|
+
w.x = C + _ * Math.cos(P), w.y = M + _ * Math.sin(P);
|
|
2554
2575
|
}
|
|
2555
2576
|
} else
|
|
2556
2577
|
w.x = Math.max(0, Math.min(r, w.x)), w.y = Math.max(0, Math.min(o, w.y));
|
|
@@ -2584,11 +2605,11 @@ function ss() {
|
|
|
2584
2605
|
}
|
|
2585
2606
|
};
|
|
2586
2607
|
}
|
|
2587
|
-
const
|
|
2588
|
-
class
|
|
2608
|
+
const rs = ns;
|
|
2609
|
+
class as {
|
|
2589
2610
|
constructor() {
|
|
2590
|
-
const e = new Blob([`(${
|
|
2591
|
-
this.workerPool = new
|
|
2611
|
+
const e = new Blob([`(${rs})()`]), t = URL.createObjectURL(e);
|
|
2612
|
+
this.workerPool = new te(2, t);
|
|
2592
2613
|
}
|
|
2593
2614
|
computeLayout(e, t, i, s) {
|
|
2594
2615
|
const n = {
|
|
@@ -2607,7 +2628,7 @@ class rs {
|
|
|
2607
2628
|
this.workerPool.dispose();
|
|
2608
2629
|
}
|
|
2609
2630
|
}
|
|
2610
|
-
class
|
|
2631
|
+
class os {
|
|
2611
2632
|
constructor(e, t) {
|
|
2612
2633
|
this._elementMap = /* @__PURE__ */ new Map(), this._relationships = [], this._searchIndex = null, this._searchIndexBuilt = !1, this._outEdges = /* @__PURE__ */ new Map(), this._inEdges = /* @__PURE__ */ new Map(), this._edgesByType = /* @__PURE__ */ new Map(), this.INVERSE = {
|
|
2613
2634
|
ON_LEVEL: "HAS_ELEMENT",
|
|
@@ -2887,7 +2908,7 @@ class as {
|
|
|
2887
2908
|
}), l("Building nodes", d.length, d.length);
|
|
2888
2909
|
const u = d.map((f) => f.id), p = this._calculateNodeLevels(c, u);
|
|
2889
2910
|
a += r, l("Calculating levels", d.length, d.length);
|
|
2890
|
-
const m = new
|
|
2911
|
+
const m = new as();
|
|
2891
2912
|
l(
|
|
2892
2913
|
"Computing layout",
|
|
2893
2914
|
0,
|
|
@@ -2986,12 +3007,12 @@ class as {
|
|
|
2986
3007
|
}
|
|
2987
3008
|
//#endregion
|
|
2988
3009
|
}
|
|
2989
|
-
class
|
|
3010
|
+
class wr {
|
|
2990
3011
|
constructor() {
|
|
2991
3012
|
this.children = /* @__PURE__ */ new Map(), this.keys = /* @__PURE__ */ new Set();
|
|
2992
3013
|
}
|
|
2993
3014
|
}
|
|
2994
|
-
var
|
|
3015
|
+
var k = /* @__PURE__ */ ((g) => (g[g.ON_MOUSE_MOVE = 0] = "ON_MOUSE_MOVE", g[g.ON_MOUSE_DOWN_LEFT = 1] = "ON_MOUSE_DOWN_LEFT", g[g.ON_MOUSE_UP_LEFT = 2] = "ON_MOUSE_UP_LEFT", g[g.ON_MOUSE_DOWN_RIGHT = 3] = "ON_MOUSE_DOWN_RIGHT", g[g.ON_MOUSE_UP_RIGHT = 4] = "ON_MOUSE_UP_RIGHT", g[g.ON_MOUSE_DOUBLE_CLICK = 5] = "ON_MOUSE_DOUBLE_CLICK", g))(k || {}), X = /* @__PURE__ */ ((g) => (g[g.ON_WAKE = 0] = "ON_WAKE", g[g.ON_SLEEP = 1] = "ON_SLEEP", g[g.ON_UPDATE = 2] = "ON_UPDATE", g))(X || {}), me = /* @__PURE__ */ ((g) => (g[g.KEYDOWN = 0] = "KEYDOWN", g[g.KEYUP = 1] = "KEYUP", g))(me || {}), R = /* @__PURE__ */ ((g) => (g[g.LOADED_SCENE = 0] = "LOADED_SCENE", g[g.LOADED_MATERIAL_MANAGER = 1] = "LOADED_MATERIAL_MANAGER", g[g.LOADED_RENDERER = 2] = "LOADED_RENDERER", g[g.LOADED_CAMERA = 3] = "LOADED_CAMERA", g[g.LOADED_CUBE = 4] = "LOADED_CUBE", g[g.LOADED_TOOLS = 5] = "LOADED_TOOLS", g[g.LOADED_SEPERATE_MODEL = 6] = "LOADED_SEPERATE_MODEL", g[g.GENERATED_MERGE_MODEL = 7] = "GENERATED_MERGE_MODEL", g[g.LOADED_DATA = 8] = "LOADED_DATA", g[g.SELECT_ELEMENTS = 9] = "SELECT_ELEMENTS", g[g.UNSELECT_ELEMENTS = 10] = "UNSELECT_ELEMENTS", g))(R || {});
|
|
2995
3016
|
class It {
|
|
2996
3017
|
constructor() {
|
|
2997
3018
|
this.items = {};
|
|
@@ -3028,7 +3049,7 @@ class It {
|
|
|
3028
3049
|
return Object.keys(this.items).length;
|
|
3029
3050
|
}
|
|
3030
3051
|
}
|
|
3031
|
-
class
|
|
3052
|
+
class yr {
|
|
3032
3053
|
constructor(e, t) {
|
|
3033
3054
|
this.delay = e, this.eventHandler = t, this.timerId = null, this.handleEvent = (i) => {
|
|
3034
3055
|
this.timerId && clearTimeout(this.timerId), this.timerId = setTimeout(() => {
|
|
@@ -3037,22 +3058,22 @@ class Mr {
|
|
|
3037
3058
|
};
|
|
3038
3059
|
}
|
|
3039
3060
|
}
|
|
3040
|
-
class
|
|
3061
|
+
class ls {
|
|
3041
3062
|
constructor() {
|
|
3042
3063
|
this.deleted = [], this.added = [], this.modified = [], this.notChanged = [];
|
|
3043
3064
|
}
|
|
3044
3065
|
}
|
|
3045
|
-
class
|
|
3066
|
+
class cs {
|
|
3046
3067
|
constructor() {
|
|
3047
3068
|
this.clashes = new It();
|
|
3048
3069
|
}
|
|
3049
3070
|
}
|
|
3050
|
-
class
|
|
3071
|
+
class hs {
|
|
3051
3072
|
constructor() {
|
|
3052
3073
|
this.value = {}, this.elementIds = [], this.modelId = -1;
|
|
3053
3074
|
}
|
|
3054
3075
|
}
|
|
3055
|
-
class
|
|
3076
|
+
class ds {
|
|
3056
3077
|
constructor(e) {
|
|
3057
3078
|
this.viralViewerApi = e, this.panel = null, this.batchListContainer = null, this.isVisible = !1, this.selectedBatchMesh = null, this.inject();
|
|
3058
3079
|
}
|
|
@@ -3067,7 +3088,7 @@ class hs {
|
|
|
3067
3088
|
right: 10px;
|
|
3068
3089
|
width: 300px;
|
|
3069
3090
|
max-height: 80vh;
|
|
3070
|
-
background-color: ${
|
|
3091
|
+
background-color: ${x.background};
|
|
3071
3092
|
border: 1px solid #ccc;
|
|
3072
3093
|
border-radius: 8px;
|
|
3073
3094
|
padding: 15px;
|
|
@@ -3081,8 +3102,8 @@ class hs {
|
|
|
3081
3102
|
const e = document.createElement("div");
|
|
3082
3103
|
e.innerHTML = `
|
|
3083
3104
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
|
|
3084
|
-
<h3 style="margin: 0; color: ${
|
|
3085
|
-
<span id="batch-debug-close" style="cursor: pointer; font-size: 20px; color: ${
|
|
3105
|
+
<h3 style="margin: 0; color: ${x.secondary}; font-size: 16px;">Batch Debug Panel</h3>
|
|
3106
|
+
<span id="batch-debug-close" style="cursor: pointer; font-size: 20px; color: ${x.secondary};">×</span>
|
|
3086
3107
|
</div>
|
|
3087
3108
|
`, this.panel.appendChild(e);
|
|
3088
3109
|
const t = document.createElement("div");
|
|
@@ -3091,7 +3112,7 @@ class hs {
|
|
|
3091
3112
|
t.appendChild(i), t.appendChild(s), this.panel.appendChild(t);
|
|
3092
3113
|
const n = document.createElement("div");
|
|
3093
3114
|
n.innerHTML = `
|
|
3094
|
-
<h4 style="margin: 10px 0 5px 0; color: ${
|
|
3115
|
+
<h4 style="margin: 10px 0 5px 0; color: ${x.secondary}; font-size: 14px;">Batched Meshes</h4>
|
|
3095
3116
|
`, this.panel.appendChild(n), this.batchListContainer = document.createElement("div"), this.batchListContainer.setAttribute(
|
|
3096
3117
|
"style",
|
|
3097
3118
|
`
|
|
@@ -3108,7 +3129,7 @@ class hs {
|
|
|
3108
3129
|
`
|
|
3109
3130
|
flex: 1;
|
|
3110
3131
|
padding: 8px;
|
|
3111
|
-
background-color: ${
|
|
3132
|
+
background-color: ${x.primary};
|
|
3112
3133
|
color: white;
|
|
3113
3134
|
border: none;
|
|
3114
3135
|
border-radius: 4px;
|
|
@@ -3118,9 +3139,9 @@ class hs {
|
|
|
3118
3139
|
transition: background-color 0.2s;
|
|
3119
3140
|
`
|
|
3120
3141
|
), i.addEventListener("mouseenter", () => {
|
|
3121
|
-
i.style.backgroundColor =
|
|
3142
|
+
i.style.backgroundColor = x.accent;
|
|
3122
3143
|
}), i.addEventListener("mouseleave", () => {
|
|
3123
|
-
i.style.backgroundColor =
|
|
3144
|
+
i.style.backgroundColor = x.primary;
|
|
3124
3145
|
}), i;
|
|
3125
3146
|
}
|
|
3126
3147
|
injectStyles() {
|
|
@@ -3139,12 +3160,12 @@ class hs {
|
|
|
3139
3160
|
background-color: rgba(0, 0, 0, 0.1);
|
|
3140
3161
|
}
|
|
3141
3162
|
.batch-item.selected {
|
|
3142
|
-
border-color: ${
|
|
3163
|
+
border-color: ${x.accent};
|
|
3143
3164
|
background-color: rgba(128, 214, 218, 0.2);
|
|
3144
3165
|
}
|
|
3145
3166
|
.batch-item-title {
|
|
3146
3167
|
font-weight: 600;
|
|
3147
|
-
color: ${
|
|
3168
|
+
color: ${x.secondary};
|
|
3148
3169
|
font-size: 13px;
|
|
3149
3170
|
margin-bottom: 4px;
|
|
3150
3171
|
}
|
|
@@ -3225,7 +3246,7 @@ class hs {
|
|
|
3225
3246
|
background-color: rgba(128, 214, 218, 0.1);
|
|
3226
3247
|
border-radius: 4px;
|
|
3227
3248
|
font-size: 11px;
|
|
3228
|
-
color: ${
|
|
3249
|
+
color: ${x.secondary};
|
|
3229
3250
|
text-align: center;
|
|
3230
3251
|
`
|
|
3231
3252
|
), i.innerHTML = `
|
|
@@ -3268,7 +3289,7 @@ class hs {
|
|
|
3268
3289
|
this.clearIsolation(), this.panel && (this.panel.remove(), this.panel = null);
|
|
3269
3290
|
}
|
|
3270
3291
|
}
|
|
3271
|
-
class
|
|
3292
|
+
class us {
|
|
3272
3293
|
constructor(e) {
|
|
3273
3294
|
this.viralViewerApi = e, this.panel = null, this.instancedListContainer = null, this.isVisible = !1, this.selectedInstancedMesh = null, this.selectedInternalMesh = null, this.inject();
|
|
3274
3295
|
}
|
|
@@ -3283,7 +3304,7 @@ class ds {
|
|
|
3283
3304
|
right: 320px;
|
|
3284
3305
|
width: 350px;
|
|
3285
3306
|
max-height: 80vh;
|
|
3286
|
-
background-color: ${
|
|
3307
|
+
background-color: ${x.background};
|
|
3287
3308
|
border: 1px solid #ccc;
|
|
3288
3309
|
border-radius: 8px;
|
|
3289
3310
|
padding: 15px;
|
|
@@ -3297,8 +3318,8 @@ class ds {
|
|
|
3297
3318
|
const e = document.createElement("div");
|
|
3298
3319
|
e.innerHTML = `
|
|
3299
3320
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
|
|
3300
|
-
<h3 style="margin: 0; color: ${
|
|
3301
|
-
<span id="instanced-debug-close" style="cursor: pointer; font-size: 20px; color: ${
|
|
3321
|
+
<h3 style="margin: 0; color: ${x.secondary}; font-size: 16px;">🔄 Instanced Debug Panel</h3>
|
|
3322
|
+
<span id="instanced-debug-close" style="cursor: pointer; font-size: 20px; color: ${x.secondary};">×</span>
|
|
3302
3323
|
</div>
|
|
3303
3324
|
`, this.panel.appendChild(e);
|
|
3304
3325
|
const t = document.createElement("div");
|
|
@@ -3310,7 +3331,7 @@ class ds {
|
|
|
3310
3331
|
t.appendChild(i), t.appendChild(s), t.appendChild(n), this.panel.appendChild(t);
|
|
3311
3332
|
const r = document.createElement("div");
|
|
3312
3333
|
r.innerHTML = `
|
|
3313
|
-
<h4 style="margin: 10px 0 5px 0; color: ${
|
|
3334
|
+
<h4 style="margin: 10px 0 5px 0; color: ${x.secondary}; font-size: 14px;">Instanced Meshes (ViralInstancedMeshV2)</h4>
|
|
3314
3335
|
`, this.panel.appendChild(r), this.instancedListContainer = document.createElement("div"), this.instancedListContainer.setAttribute(
|
|
3315
3336
|
"style",
|
|
3316
3337
|
`
|
|
@@ -3327,7 +3348,7 @@ class ds {
|
|
|
3327
3348
|
`
|
|
3328
3349
|
flex: 1;
|
|
3329
3350
|
padding: 8px;
|
|
3330
|
-
background-color: ${
|
|
3351
|
+
background-color: ${x.primary};
|
|
3331
3352
|
color: white;
|
|
3332
3353
|
border: none;
|
|
3333
3354
|
border-radius: 4px;
|
|
@@ -3338,9 +3359,9 @@ class ds {
|
|
|
3338
3359
|
min-width: 80px;
|
|
3339
3360
|
`
|
|
3340
3361
|
), i.addEventListener("mouseenter", () => {
|
|
3341
|
-
i.style.backgroundColor =
|
|
3362
|
+
i.style.backgroundColor = x.accent;
|
|
3342
3363
|
}), i.addEventListener("mouseleave", () => {
|
|
3343
|
-
i.style.backgroundColor =
|
|
3364
|
+
i.style.backgroundColor = x.primary;
|
|
3344
3365
|
}), i;
|
|
3345
3366
|
}
|
|
3346
3367
|
injectStyles() {
|
|
@@ -3361,12 +3382,12 @@ class ds {
|
|
|
3361
3382
|
background-color: rgba(0, 0, 0, 0.1);
|
|
3362
3383
|
}
|
|
3363
3384
|
.instanced-item.selected {
|
|
3364
|
-
border-color: ${
|
|
3385
|
+
border-color: ${x.accent};
|
|
3365
3386
|
background-color: rgba(128, 214, 218, 0.2);
|
|
3366
3387
|
}
|
|
3367
3388
|
.instanced-item-title {
|
|
3368
3389
|
font-weight: 600;
|
|
3369
|
-
color: ${
|
|
3390
|
+
color: ${x.secondary};
|
|
3370
3391
|
font-size: 13px;
|
|
3371
3392
|
margin-bottom: 4px;
|
|
3372
3393
|
}
|
|
@@ -3413,7 +3434,7 @@ class ds {
|
|
|
3413
3434
|
}
|
|
3414
3435
|
.internal-mesh-item.selected {
|
|
3415
3436
|
background-color: rgba(33, 150, 243, 0.2);
|
|
3416
|
-
border-left-color: ${
|
|
3437
|
+
border-left-color: ${x.accent};
|
|
3417
3438
|
}
|
|
3418
3439
|
`, document.head.appendChild(e);
|
|
3419
3440
|
}
|
|
@@ -3530,7 +3551,7 @@ class ds {
|
|
|
3530
3551
|
background-color: rgba(128, 214, 218, 0.1);
|
|
3531
3552
|
border-radius: 4px;
|
|
3532
3553
|
font-size: 11px;
|
|
3533
|
-
color: ${
|
|
3554
|
+
color: ${x.secondary};
|
|
3534
3555
|
text-align: center;
|
|
3535
3556
|
`
|
|
3536
3557
|
), n.innerHTML = `
|
|
@@ -3664,7 +3685,7 @@ class ds {
|
|
|
3664
3685
|
this.clearIsolation(), this.panel && (this.panel.remove(), this.panel = null);
|
|
3665
3686
|
}
|
|
3666
3687
|
}
|
|
3667
|
-
class
|
|
3688
|
+
class ps {
|
|
3668
3689
|
constructor(e) {
|
|
3669
3690
|
this.viralViewerApi = e, this.panel = null, this.contentContainer = null, this.isVisible = !1, this.lastAnalysis = null, this.inject();
|
|
3670
3691
|
}
|
|
@@ -3679,7 +3700,7 @@ class us {
|
|
|
3679
3700
|
left: 10px;
|
|
3680
3701
|
width: 450px;
|
|
3681
3702
|
max-height: 85vh;
|
|
3682
|
-
background-color: ${
|
|
3703
|
+
background-color: ${x.background};
|
|
3683
3704
|
border: 1px solid #ccc;
|
|
3684
3705
|
border-radius: 8px;
|
|
3685
3706
|
padding: 15px;
|
|
@@ -3694,8 +3715,8 @@ class us {
|
|
|
3694
3715
|
const e = document.createElement("div");
|
|
3695
3716
|
e.innerHTML = `
|
|
3696
3717
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
|
|
3697
|
-
<h3 style="margin: 0; color: ${
|
|
3698
|
-
<span id="render-debug-close" style="cursor: pointer; font-size: 20px; color: ${
|
|
3718
|
+
<h3 style="margin: 0; color: ${x.secondary}; font-size: 16px;">🔍 Render Debug Panel</h3>
|
|
3719
|
+
<span id="render-debug-close" style="cursor: pointer; font-size: 20px; color: ${x.secondary};">×</span>
|
|
3699
3720
|
</div>
|
|
3700
3721
|
`, this.panel.appendChild(e);
|
|
3701
3722
|
const t = document.createElement("div");
|
|
@@ -3719,7 +3740,7 @@ class us {
|
|
|
3719
3740
|
"style",
|
|
3720
3741
|
`
|
|
3721
3742
|
padding: 8px 12px;
|
|
3722
|
-
background-color: ${
|
|
3743
|
+
background-color: ${x.primary};
|
|
3723
3744
|
color: white;
|
|
3724
3745
|
border: none;
|
|
3725
3746
|
border-radius: 4px;
|
|
@@ -3729,9 +3750,9 @@ class us {
|
|
|
3729
3750
|
transition: background-color 0.2s;
|
|
3730
3751
|
`
|
|
3731
3752
|
), i.addEventListener("mouseenter", () => {
|
|
3732
|
-
i.style.backgroundColor =
|
|
3753
|
+
i.style.backgroundColor = x.accent;
|
|
3733
3754
|
}), i.addEventListener("mouseleave", () => {
|
|
3734
|
-
i.style.backgroundColor =
|
|
3755
|
+
i.style.backgroundColor = x.primary;
|
|
3735
3756
|
}), i;
|
|
3736
3757
|
}
|
|
3737
3758
|
injectStyles() {
|
|
@@ -3745,7 +3766,7 @@ class us {
|
|
|
3745
3766
|
}
|
|
3746
3767
|
.render-section-title {
|
|
3747
3768
|
font-weight: 600;
|
|
3748
|
-
color: ${
|
|
3769
|
+
color: ${x.secondary};
|
|
3749
3770
|
font-size: 13px;
|
|
3750
3771
|
margin-bottom: 8px;
|
|
3751
3772
|
display: flex;
|
|
@@ -3791,7 +3812,7 @@ class us {
|
|
|
3791
3812
|
}
|
|
3792
3813
|
.stat-value {
|
|
3793
3814
|
font-weight: 600;
|
|
3794
|
-
color: ${
|
|
3815
|
+
color: ${x.secondary};
|
|
3795
3816
|
}
|
|
3796
3817
|
.warning-box {
|
|
3797
3818
|
padding: 8px;
|
|
@@ -3894,7 +3915,7 @@ class us {
|
|
|
3894
3915
|
);
|
|
3895
3916
|
} else
|
|
3896
3917
|
i.set(n.id, r);
|
|
3897
|
-
if (n instanceof
|
|
3918
|
+
if (n instanceof y && n.geometry) {
|
|
3898
3919
|
const o = this.getGeometryHash(n);
|
|
3899
3920
|
o !== "no-geometry" && o !== "no-position" && r.vertices > 0 && (s.has(o) || s.set(o, []), s.get(o).push(r));
|
|
3900
3921
|
}
|
|
@@ -3969,10 +3990,10 @@ class us {
|
|
|
3969
3990
|
extractObjectInfo(e) {
|
|
3970
3991
|
var a, l;
|
|
3971
3992
|
let t = 0, i = 0, s = 0, n = "N/A";
|
|
3972
|
-
if (e instanceof
|
|
3993
|
+
if (e instanceof y) {
|
|
3973
3994
|
const c = e.geometry;
|
|
3974
|
-
c && (c.attributes.position && (t = c.attributes.position.count), c.index ? i = c.index.count / 3 : i = t / 3), e instanceof
|
|
3975
|
-
} else if (e instanceof yt || e instanceof
|
|
3995
|
+
c && (c.attributes.position && (t = c.attributes.position.count), c.index ? i = c.index.count / 3 : i = t / 3), e instanceof oe ? (s = 1, n = "Instanced", i *= e.count) : e instanceof Z ? (s = 1, n = "Batched") : (s = e.visible ? 1 : 0, n = Array.isArray(e.material) ? "Multi-Material" : ((a = e.material) == null ? void 0 : a.type) || "Unknown");
|
|
3996
|
+
} else if (e instanceof yt || e instanceof mt) {
|
|
3976
3997
|
s = e.visible ? 1 : 0, n = "Line";
|
|
3977
3998
|
const c = e.geometry;
|
|
3978
3999
|
c && c.attributes.position && (t = c.attributes.position.count);
|
|
@@ -3999,7 +4020,7 @@ class us {
|
|
|
3999
4020
|
};
|
|
4000
4021
|
}
|
|
4001
4022
|
isRenderable(e) {
|
|
4002
|
-
return e instanceof
|
|
4023
|
+
return e instanceof y || e instanceof yt || e instanceof mt || e instanceof St;
|
|
4003
4024
|
}
|
|
4004
4025
|
isVisibleInHierarchy(e) {
|
|
4005
4026
|
let t = e;
|
|
@@ -4025,7 +4046,7 @@ class us {
|
|
|
4025
4046
|
return `v${s}_i${n}_${r}`;
|
|
4026
4047
|
}
|
|
4027
4048
|
categorizeObject(e, t, i) {
|
|
4028
|
-
e instanceof
|
|
4049
|
+
e instanceof Z ? i.batchedMeshes.push(t) : e instanceof ce || e instanceof oe ? i.instancedMeshes.push(t) : e instanceof y ? i.regularMeshes.push(t) : e instanceof yt || e instanceof mt ? i.edgeMeshes.push(t) : this.isRenderable(e) && i.otherObjects.push(t);
|
|
4029
4050
|
}
|
|
4030
4051
|
analyzeMergedModel(e) {
|
|
4031
4052
|
const t = this.viralViewerApi.viralScene.bimWorld, i = t.getDiagnostics();
|
|
@@ -4194,7 +4215,7 @@ class us {
|
|
|
4194
4215
|
n.id === e && (i = n);
|
|
4195
4216
|
}), i !== void 0) {
|
|
4196
4217
|
const n = i;
|
|
4197
|
-
console.log("🔍 Selected object:", n), console.log(" - Name:", n.name), console.log(" - Type:", n.constructor.name), console.log(" - Visible:", n.visible), console.log(" - Position:", n.position), console.log(" - Parent:", ((s = n.parent) == null ? void 0 : s.name) || "Scene"), n instanceof
|
|
4218
|
+
console.log("🔍 Selected object:", n), console.log(" - Name:", n.name), console.log(" - Type:", n.constructor.name), console.log(" - Visible:", n.visible), console.log(" - Position:", n.position), console.log(" - Parent:", ((s = n.parent) == null ? void 0 : s.name) || "Scene"), n instanceof y && (console.log(" - Geometry:", n.geometry), console.log(" - Material:", n.material)), window.__VIRAL_DEBUG_SELECTED = n, console.log(" 📌 Object stored in window.__VIRAL_DEBUG_SELECTED for inspection");
|
|
4198
4219
|
}
|
|
4199
4220
|
}
|
|
4200
4221
|
logToConsole() {
|
|
@@ -4286,7 +4307,7 @@ class us {
|
|
|
4286
4307
|
var a;
|
|
4287
4308
|
const i = " ".repeat(t), s = e.visible ? "✅" : "❌", n = e.constructor.name, r = e.children.length;
|
|
4288
4309
|
let o = "";
|
|
4289
|
-
e instanceof
|
|
4310
|
+
e instanceof y && e.geometry && (o = ` [V:${((a = e.geometry.attributes.position) == null ? void 0 : a.count) || 0}]`), e instanceof oe && (o += ` [Instances:${e.count}]`), console.log(
|
|
4290
4311
|
`${i}${s} ${e.name || "[unnamed]"} (${n})${o} [${r} children]`
|
|
4291
4312
|
), t < 3 ? e.children.forEach((l) => {
|
|
4292
4313
|
this.logObjectTree(l, t + 1);
|
|
@@ -4311,10 +4332,10 @@ class us {
|
|
|
4311
4332
|
this.panel && (this.panel.remove(), this.panel = null);
|
|
4312
4333
|
}
|
|
4313
4334
|
}
|
|
4314
|
-
class
|
|
4335
|
+
class ms {
|
|
4315
4336
|
// 5 seconds for cleanup
|
|
4316
4337
|
constructor(e) {
|
|
4317
|
-
this.viralViewerApi = e, this.clock = new
|
|
4338
|
+
this.viralViewerApi = e, this.clock = new ti(), this.lastSpatialUpdateTime = 0, this.lastCleanupTime = 0, this.spatialUpdateInterval = 16, this.cleanupInterval = 5e3, this.isRainEnabled = !1;
|
|
4318
4339
|
}
|
|
4319
4340
|
devAnimation() {
|
|
4320
4341
|
var i, s, n, r, o;
|
|
@@ -4357,7 +4378,7 @@ class ps {
|
|
|
4357
4378
|
this.isRainEnabled = e, this.isRainEnabled && this.rainAnimation();
|
|
4358
4379
|
}
|
|
4359
4380
|
}
|
|
4360
|
-
class
|
|
4381
|
+
class gs {
|
|
4361
4382
|
static generateRandomString(e) {
|
|
4362
4383
|
const t = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
4363
4384
|
let i = "";
|
|
@@ -4368,19 +4389,19 @@ class ms {
|
|
|
4368
4389
|
return i;
|
|
4369
4390
|
}
|
|
4370
4391
|
}
|
|
4371
|
-
const
|
|
4372
|
-
class
|
|
4392
|
+
const fs = 0.032;
|
|
4393
|
+
class vs {
|
|
4373
4394
|
constructor(e, t, i, s, n = 2, r = 1, o, a) {
|
|
4374
|
-
this.viralViewerApi = e, this.scaleRatio = n, this.mixer = null, this.idleAnimation = null, this.walkAnimation = null, this.avatar = null, this.destination = null, this.isReady = !1, this.name = "", this.id =
|
|
4395
|
+
this.viralViewerApi = e, this.scaleRatio = n, this.mixer = null, this.idleAnimation = null, this.walkAnimation = null, this.avatar = null, this.destination = null, this.isReady = !1, this.name = "", this.id = gs.generateRandomString(10), this.MOVEMENT_SPEED = 0.032, this.talkContent = "", o && (this.id = o), a && (this.name = a, this.nameDiv = document.createElement("div"), this.nameDiv.setAttribute(
|
|
4375
4396
|
"style",
|
|
4376
4397
|
"position: absolute; top:0; left:0;transform: translateX(-50%); pointer-events: none; background-color:rgba(226, 230, 220,1); color:rgb(23, 49, 44); padding: 5px ; border-radius:5px; font-size:x-small"
|
|
4377
4398
|
), this.nameDiv.id = this.id, this.nameDiv.append(this.name), this.viralViewerApi.targetElement.appendChild(this.nameDiv)), this.chatDiv = document.createElement("div"), this.chatDiv.setAttribute(
|
|
4378
4399
|
"style",
|
|
4379
4400
|
"position: absolute;display:none; top:0; left:0;transform: translate(-50%, -100%); pointer-events: none; background-color:rgba(226, 230, 220,1); color:rgb(23, 49, 44); padding: 5px ; border-radius:5px; font-size:x-small"
|
|
4380
|
-
), this.viralViewerApi.targetElement.appendChild(this.chatDiv), this.MOVEMENT_SPEED =
|
|
4401
|
+
), this.viralViewerApi.targetElement.appendChild(this.chatDiv), this.MOVEMENT_SPEED = fs * r, this.viralViewerApi.viralLoader.threeLoader.loadGLTF(t, (l) => {
|
|
4381
4402
|
this.avatar = l.scene;
|
|
4382
4403
|
const c = new E(n, n, n);
|
|
4383
|
-
this.avatar.scale.copy(c), console.log(this.avatar), this.mixer = new
|
|
4404
|
+
this.avatar.scale.copy(c), console.log(this.avatar), this.mixer = new ii(l.scene), this.viralViewerApi.viralScene.scene.add(l.scene), this.viralViewerApi.viralRenderer.render(), this.viralViewerApi.viralLoader.threeLoader.loadGLTF(i, (h) => {
|
|
4384
4405
|
this.idleAnimation = this.mixer.clipAction(h.animations[0]), this.viralViewerApi.viralLoader.threeLoader.loadGLTF(s, (d) => {
|
|
4385
4406
|
this.walkAnimation = this.mixer.clipAction(d.animations[0]), Q.information("load avatar succeed!"), this.isReady = !0, this.idle();
|
|
4386
4407
|
});
|
|
@@ -4440,12 +4461,12 @@ class fs {
|
|
|
4440
4461
|
(e = this.avatar) == null || e.removeFromParent(), this.mixer = null, this.walkAnimation = null, this.avatar = null, (i = (t = this.nameDiv) == null ? void 0 : t.parentNode) == null || i.removeChild(this.nameDiv), (n = (s = this.chatDiv) == null ? void 0 : s.parentNode) == null || n.removeChild(this.chatDiv);
|
|
4441
4462
|
}
|
|
4442
4463
|
}
|
|
4443
|
-
class
|
|
4464
|
+
class bs {
|
|
4444
4465
|
constructor(e) {
|
|
4445
4466
|
this.viralViewerApi = e, this.avatars = [];
|
|
4446
4467
|
}
|
|
4447
4468
|
load(e, t, i, s = 2, n = 1, r, o) {
|
|
4448
|
-
const a = new
|
|
4469
|
+
const a = new vs(
|
|
4449
4470
|
this.viralViewerApi,
|
|
4450
4471
|
e,
|
|
4451
4472
|
t,
|
|
@@ -4462,33 +4483,33 @@ class vs {
|
|
|
4462
4483
|
t && t.dispose(), this.avatars = this.avatars.filter((i) => i.id !== e);
|
|
4463
4484
|
}
|
|
4464
4485
|
}
|
|
4465
|
-
class
|
|
4486
|
+
class ws {
|
|
4466
4487
|
constructor() {
|
|
4467
|
-
|
|
4488
|
+
J.prototype.computeBoundsTree = _i, J.prototype.disposeBoundsTree = Ii, y.prototype.raycast = Vi;
|
|
4468
4489
|
}
|
|
4469
4490
|
applyThreeMeshBVH(e) {
|
|
4470
4491
|
e.boundsTree || e.computeBoundsTree();
|
|
4471
4492
|
}
|
|
4472
4493
|
}
|
|
4473
|
-
const
|
|
4474
|
-
Vector2:
|
|
4494
|
+
const ys = {
|
|
4495
|
+
Vector2: N,
|
|
4475
4496
|
Vector3: E,
|
|
4476
|
-
Vector4:
|
|
4477
|
-
Quaternion:
|
|
4478
|
-
Matrix4:
|
|
4479
|
-
Spherical:
|
|
4480
|
-
Box3:
|
|
4481
|
-
Sphere:
|
|
4482
|
-
Raycaster:
|
|
4483
|
-
MathUtils:
|
|
4497
|
+
Vector4: si,
|
|
4498
|
+
Quaternion: ni,
|
|
4499
|
+
Matrix4: ne,
|
|
4500
|
+
Spherical: jt,
|
|
4501
|
+
Box3: z,
|
|
4502
|
+
Sphere: Ht,
|
|
4503
|
+
Raycaster: Pt,
|
|
4504
|
+
MathUtils: ri
|
|
4484
4505
|
};
|
|
4485
|
-
pe.install({ THREE:
|
|
4486
|
-
class
|
|
4506
|
+
pe.install({ THREE: ys });
|
|
4507
|
+
class xs {
|
|
4487
4508
|
constructor(e) {
|
|
4488
|
-
this.viralViewerApi = e, this.raycaster = new
|
|
4509
|
+
this.viralViewerApi = e, this.raycaster = new Pt(), this.camera = null, this._orthoCamera = null, this._perspectiveCamera = null, this._frustumSize = 200, this.cameraControls = null, this.onUsing = !1, this.modelId = "0", this.elementId = "243274", this.cameraWakeQueuedEvents = [], this.cameraSleepQueuedEvents = [], this.cameraUpdateQueuedEvents = [], this.targetElement = this.viralViewerApi.options.container, this.setupCamera(), this.viralViewerApi.emit(R.LOADED_CAMERA);
|
|
4489
4510
|
}
|
|
4490
4511
|
setupCamera() {
|
|
4491
|
-
this._perspectiveCamera = new
|
|
4512
|
+
this._perspectiveCamera = new He(
|
|
4492
4513
|
60,
|
|
4493
4514
|
this.targetElement.clientWidth / this.targetElement.clientHeight,
|
|
4494
4515
|
0.1,
|
|
@@ -4537,7 +4558,7 @@ class ys {
|
|
|
4537
4558
|
*/
|
|
4538
4559
|
resizeCanvas() {
|
|
4539
4560
|
if (this.camera) {
|
|
4540
|
-
if (this.camera instanceof
|
|
4561
|
+
if (this.camera instanceof He && (this.camera.aspect = this.targetElement.clientWidth / this.targetElement.clientHeight), this.camera instanceof Ct) {
|
|
4541
4562
|
const e = this.targetElement.offsetWidth / this.targetElement.offsetHeight;
|
|
4542
4563
|
this.camera.left = -this._frustumSize * e / 2, this.camera.right = this._frustumSize * e / 2, this.camera.top = this._frustumSize / 2, this.camera.bottom = -this._frustumSize / 2;
|
|
4543
4564
|
}
|
|
@@ -4548,7 +4569,7 @@ class ys {
|
|
|
4548
4569
|
}
|
|
4549
4570
|
}
|
|
4550
4571
|
resizeCanvas2() {
|
|
4551
|
-
this.camera && (this.camera instanceof
|
|
4572
|
+
this.camera && (this.camera instanceof He && (this.camera.aspect = this.targetElement.offsetWidth / this.targetElement.offsetHeight), this.camera.updateProjectionMatrix(), this.viralViewerApi.viralRenderer.updateSize(
|
|
4552
4573
|
this.targetElement.offsetWidth,
|
|
4553
4574
|
this.targetElement.offsetHeight
|
|
4554
4575
|
), this.viralViewerApi.viralRenderer.render());
|
|
@@ -4658,7 +4679,7 @@ class ys {
|
|
|
4658
4679
|
const t = this.viralViewerApi.viralScene.scene;
|
|
4659
4680
|
if (!t || !this.camera)
|
|
4660
4681
|
return;
|
|
4661
|
-
const s = new
|
|
4682
|
+
const s = new z().setFromObject(t).getSize(new E()), n = Math.max(s.x, s.y, s.z);
|
|
4662
4683
|
this.camera.far = n + e, this.camera.updateProjectionMatrix(), this.cameraControls && (this.cameraControls.maxDistance = this.camera.far * 0.95);
|
|
4663
4684
|
}
|
|
4664
4685
|
/**
|
|
@@ -4669,32 +4690,32 @@ class ys {
|
|
|
4669
4690
|
*/
|
|
4670
4691
|
addEventListener(e, t, i) {
|
|
4671
4692
|
switch (e) {
|
|
4672
|
-
case
|
|
4693
|
+
case X.ON_WAKE:
|
|
4673
4694
|
this.cameraWakeQueuedEvents.push([t, i]);
|
|
4674
4695
|
break;
|
|
4675
|
-
case
|
|
4696
|
+
case X.ON_SLEEP:
|
|
4676
4697
|
this.cameraSleepQueuedEvents.push([t, i]);
|
|
4677
4698
|
break;
|
|
4678
|
-
case
|
|
4699
|
+
case X.ON_UPDATE:
|
|
4679
4700
|
this.cameraUpdateQueuedEvents.push([t, i]);
|
|
4680
4701
|
break;
|
|
4681
4702
|
}
|
|
4682
4703
|
}
|
|
4683
4704
|
removeEventListener(e, t) {
|
|
4684
4705
|
switch (e) {
|
|
4685
|
-
case
|
|
4706
|
+
case X.ON_WAKE:
|
|
4686
4707
|
{
|
|
4687
4708
|
const i = this.cameraWakeQueuedEvents.findIndex((s) => s[0] === t);
|
|
4688
4709
|
this.cameraWakeQueuedEvents.splice(i, 1);
|
|
4689
4710
|
}
|
|
4690
4711
|
break;
|
|
4691
|
-
case
|
|
4712
|
+
case X.ON_SLEEP:
|
|
4692
4713
|
{
|
|
4693
4714
|
const i = this.cameraSleepQueuedEvents.findIndex((s) => s[0] === t);
|
|
4694
4715
|
this.cameraSleepQueuedEvents.splice(i, 1);
|
|
4695
4716
|
}
|
|
4696
4717
|
break;
|
|
4697
|
-
case
|
|
4718
|
+
case X.ON_UPDATE:
|
|
4698
4719
|
{
|
|
4699
4720
|
const i = this.cameraUpdateQueuedEvents.findIndex((s) => s[0] === t);
|
|
4700
4721
|
this.cameraUpdateQueuedEvents.splice(i, 1);
|
|
@@ -4730,7 +4751,7 @@ class ys {
|
|
|
4730
4751
|
2 * l / 2,
|
|
4731
4752
|
-(2 * l) / 2
|
|
4732
4753
|
));
|
|
4733
|
-
const c = new
|
|
4754
|
+
const c = new z(i, s);
|
|
4734
4755
|
await ((m = this.viralViewerApi.viralCamera.cameraControls) == null ? void 0 : m.fitToBox(c, !1));
|
|
4735
4756
|
const h = new E();
|
|
4736
4757
|
(f = this.viralViewerApi.viralCamera.cameraControls) == null || f.getPosition(h);
|
|
@@ -4744,27 +4765,27 @@ class ys {
|
|
|
4744
4765
|
}
|
|
4745
4766
|
//#endregion
|
|
4746
4767
|
}
|
|
4747
|
-
class
|
|
4768
|
+
class Ms {
|
|
4748
4769
|
pakoUnzip(e) {
|
|
4749
4770
|
const t = new Uint8Array(e);
|
|
4750
4771
|
return Pi(t);
|
|
4751
4772
|
}
|
|
4752
4773
|
pakoStreamUnzip(e) {
|
|
4753
|
-
const t = new
|
|
4774
|
+
const t = new Ti();
|
|
4754
4775
|
return t.push(e, !0), t.result;
|
|
4755
4776
|
}
|
|
4756
4777
|
}
|
|
4757
|
-
class
|
|
4778
|
+
class se {
|
|
4758
4779
|
constructor(e, t, i) {
|
|
4759
4780
|
this.x = 0, this.y = 0, this.z = 0, this.x = e, this.y = t, this.z = i;
|
|
4760
4781
|
}
|
|
4761
4782
|
}
|
|
4762
|
-
class
|
|
4783
|
+
class T {
|
|
4763
4784
|
static doesEdgeIncludePlane(e, t, i, s, n, r = 1e-7) {
|
|
4764
|
-
const o =
|
|
4785
|
+
const o = T.subtract(s, i), a = T.subtract(n, i), l = T.crossProduct(o, a), c = -T.dotProduct(l, i), h = T.dotProduct(l, e) + c, d = T.dotProduct(l, t) + c;
|
|
4765
4786
|
if (Math.abs(h) > r || Math.abs(d) > r)
|
|
4766
4787
|
return !1;
|
|
4767
|
-
const u =
|
|
4788
|
+
const u = T.isPointInTriangle(e, i, s, n, r), p = T.isPointInTriangle(t, i, s, n, r);
|
|
4768
4789
|
return !(!u || !p);
|
|
4769
4790
|
}
|
|
4770
4791
|
/**
|
|
@@ -4777,14 +4798,14 @@ class P {
|
|
|
4777
4798
|
* @returns boolean - Whether the edge intersects the triangle
|
|
4778
4799
|
*/
|
|
4779
4800
|
static doesEdgeIntersectTriangle(e, t, i, s, n, r = 5) {
|
|
4780
|
-
const o =
|
|
4801
|
+
const o = T.subtract(s, i), a = T.subtract(n, i), l = T.crossProduct(o, a), c = -T.dotProduct(l, i), h = T.subtract(t, e), d = T.dotProduct(l, h);
|
|
4781
4802
|
if (Math.abs(d) < 1e-7)
|
|
4782
4803
|
return !1;
|
|
4783
|
-
const u = -(
|
|
4804
|
+
const u = -(T.dotProduct(l, e) + c) / d;
|
|
4784
4805
|
if (u < -r || u > 1 + r)
|
|
4785
4806
|
return !1;
|
|
4786
|
-
const p =
|
|
4787
|
-
return m < r || f < r ? !1 :
|
|
4807
|
+
const p = T.add(e, T.scale(h, u)), m = T.distance(p, e), f = T.distance(p, t);
|
|
4808
|
+
return m < r || f < r ? !1 : T.isPointInTriangle(p, i, s, n, r);
|
|
4788
4809
|
}
|
|
4789
4810
|
/**
|
|
4790
4811
|
* Check if a point lies inside a triangle using barycentric coordinates
|
|
@@ -4795,7 +4816,7 @@ class P {
|
|
|
4795
4816
|
* @returns boolean - Whether the point lies inside the triangle
|
|
4796
4817
|
*/
|
|
4797
4818
|
static isPointInTriangle(e, t, i, s, n = 1e-7) {
|
|
4798
|
-
const r =
|
|
4819
|
+
const r = T.subtract(i, t), o = T.subtract(s, i), a = T.subtract(t, s), l = T.subtract(e, t), c = T.subtract(e, i), h = T.subtract(e, s), d = T.crossProduct(r, l), u = T.crossProduct(o, c), p = T.crossProduct(a, h), m = T.normalize(d), f = T.normalize(u), v = T.normalize(p), b = T.dotProduct(m, f), w = T.dotProduct(f, v);
|
|
4799
4820
|
return b > 1 - n && w > 1 - n;
|
|
4800
4821
|
}
|
|
4801
4822
|
// Vector math helper functions
|
|
@@ -4822,22 +4843,22 @@ class P {
|
|
|
4822
4843
|
const t = Math.sqrt(
|
|
4823
4844
|
e.x * e.x + e.y * e.y + e.z * e.z
|
|
4824
4845
|
);
|
|
4825
|
-
return t < 1e-7 ? new
|
|
4846
|
+
return t < 1e-7 ? new se(0, 0, 0) : new se(e.x / t, e.y / t, e.z / t);
|
|
4826
4847
|
}
|
|
4827
4848
|
static distance(e, t) {
|
|
4828
4849
|
return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2 + (e.z - t.z) ** 2);
|
|
4829
4850
|
}
|
|
4830
4851
|
static doTrianglesIntersect(e, t, i, s, n, r, o = 1e-3) {
|
|
4831
|
-
return !!(
|
|
4852
|
+
return !!(T.doesEdgeIntersectTriangle(e, t, s, n, r, o) || T.doesEdgeIntersectTriangle(t, i, s, n, r, o) || T.doesEdgeIntersectTriangle(i, e, s, n, r, o));
|
|
4832
4853
|
}
|
|
4833
4854
|
static objectsIntersect(e, t, i = 1e-3) {
|
|
4834
4855
|
for (let s = 0; s < e.length; s += 9) {
|
|
4835
|
-
const n = new
|
|
4856
|
+
const n = new se(e[s], e[s + 1], e[s + 2]), r = new se(e[s + 3], e[s + 4], e[s + 5]), o = new se(e[s + 6], e[s + 7], e[s + 8]);
|
|
4836
4857
|
for (let a = 0; a < t.length; a += 9) {
|
|
4837
|
-
const l = new
|
|
4838
|
-
if (
|
|
4858
|
+
const l = new se(t[a], t[a + 1], t[a + 2]), c = new se(t[a + 3], t[a + 4], t[a + 5]), h = new se(t[a + 6], t[a + 7], t[a + 8]);
|
|
4859
|
+
if (T.doesEdgeIncludePlane(n, r, l, c, h, i) && T.doesEdgeIncludePlane(r, o, l, c, h, i))
|
|
4839
4860
|
return console.log("belong to face"), !1;
|
|
4840
|
-
if (
|
|
4861
|
+
if (T.doTrianglesIntersect(n, r, o, l, c, h, i))
|
|
4841
4862
|
return !0;
|
|
4842
4863
|
}
|
|
4843
4864
|
}
|
|
@@ -4848,7 +4869,7 @@ class P {
|
|
|
4848
4869
|
return i && s && n;
|
|
4849
4870
|
}
|
|
4850
4871
|
}
|
|
4851
|
-
function
|
|
4872
|
+
function Es() {
|
|
4852
4873
|
class g {
|
|
4853
4874
|
constructor(t, i, s) {
|
|
4854
4875
|
this.X = 0, this.Y = 0, this.Z = 0, this.X = t, this.Y = i, this.Z = s;
|
|
@@ -4870,11 +4891,11 @@ function Ms() {
|
|
|
4870
4891
|
self.postMessage(i());
|
|
4871
4892
|
};
|
|
4872
4893
|
}
|
|
4873
|
-
const
|
|
4874
|
-
class
|
|
4894
|
+
const Ss = Es;
|
|
4895
|
+
class Cs {
|
|
4875
4896
|
constructor() {
|
|
4876
|
-
const e = new Blob([`(${
|
|
4877
|
-
this.workerPool = new
|
|
4897
|
+
const e = new Blob([`(${Ss})()`]), t = URL.createObjectURL(e);
|
|
4898
|
+
this.workerPool = new te(navigator.hardwareConcurrency || 10, t);
|
|
4878
4899
|
}
|
|
4879
4900
|
getBoundingBox(e, t = (i) => {
|
|
4880
4901
|
}) {
|
|
@@ -4886,7 +4907,7 @@ class Ss {
|
|
|
4886
4907
|
);
|
|
4887
4908
|
}
|
|
4888
4909
|
}
|
|
4889
|
-
function
|
|
4910
|
+
function As() {
|
|
4890
4911
|
self.onmessage = (g) => {
|
|
4891
4912
|
const e = g.data;
|
|
4892
4913
|
function t(s, n, r = 0.1) {
|
|
@@ -4904,11 +4925,11 @@ function Cs() {
|
|
|
4904
4925
|
self.postMessage(i);
|
|
4905
4926
|
};
|
|
4906
4927
|
}
|
|
4907
|
-
const
|
|
4908
|
-
class
|
|
4928
|
+
const _s = As;
|
|
4929
|
+
class Is {
|
|
4909
4930
|
constructor() {
|
|
4910
|
-
const e = new Blob([`(${
|
|
4911
|
-
this.workerPool = new
|
|
4931
|
+
const e = new Blob([`(${_s})()`]), t = URL.createObjectURL(e);
|
|
4932
|
+
this.workerPool = new te(4, t);
|
|
4912
4933
|
}
|
|
4913
4934
|
checkIntersect(e, t = (i) => {
|
|
4914
4935
|
}) {
|
|
@@ -4917,7 +4938,7 @@ class _s {
|
|
|
4917
4938
|
});
|
|
4918
4939
|
}
|
|
4919
4940
|
}
|
|
4920
|
-
function
|
|
4941
|
+
function Vs() {
|
|
4921
4942
|
class g {
|
|
4922
4943
|
constructor() {
|
|
4923
4944
|
this.children = /* @__PURE__ */ new Map(), this.keys = /* @__PURE__ */ new Set();
|
|
@@ -5009,11 +5030,11 @@ function Is() {
|
|
|
5009
5030
|
}
|
|
5010
5031
|
};
|
|
5011
5032
|
}
|
|
5012
|
-
const
|
|
5033
|
+
const Ps = Vs;
|
|
5013
5034
|
class Ts {
|
|
5014
5035
|
constructor() {
|
|
5015
|
-
const e = new Blob([`(${
|
|
5016
|
-
this.workerPool = new
|
|
5036
|
+
const e = new Blob([`(${Ps})()`]), t = URL.createObjectURL(e);
|
|
5037
|
+
this.workerPool = new te(2, t);
|
|
5017
5038
|
}
|
|
5018
5039
|
buildTreeNode(e, t = (i) => {
|
|
5019
5040
|
}) {
|
|
@@ -5022,7 +5043,7 @@ class Ts {
|
|
|
5022
5043
|
});
|
|
5023
5044
|
}
|
|
5024
5045
|
}
|
|
5025
|
-
function
|
|
5046
|
+
function Os() {
|
|
5026
5047
|
class g {
|
|
5027
5048
|
constructor(u, p, m) {
|
|
5028
5049
|
this.x = 0, this.y = 0, this.z = 0, this.x = u, this.y = p, this.z = m;
|
|
@@ -5057,7 +5078,7 @@ function Ps() {
|
|
|
5057
5078
|
return Math.sqrt((d.x - u.x) ** 2 + (d.y - u.y) ** 2 + (d.z - u.z) ** 2);
|
|
5058
5079
|
}
|
|
5059
5080
|
function a(d, u, p, m, f = 1e-7) {
|
|
5060
|
-
const v = e(p, u), b = e(m, p), w = e(u, m), S = e(d, u), A = e(d, p), C = e(d, m), M = n(v, S), _ = n(b, A), I = n(w, C), O = r(M), V = r(_),
|
|
5081
|
+
const v = e(p, u), b = e(m, p), w = e(u, m), S = e(d, u), A = e(d, p), C = e(d, m), M = n(v, S), _ = n(b, A), I = n(w, C), O = r(M), V = r(_), P = r(I), j = s(O, V), H = s(V, P);
|
|
5061
5082
|
return j > 1 - f && H > 1 - f;
|
|
5062
5083
|
}
|
|
5063
5084
|
function l(d, u, p, m, f, v, b = 1e-3) {
|
|
@@ -5092,11 +5113,11 @@ function Ps() {
|
|
|
5092
5113
|
self.postMessage(!1);
|
|
5093
5114
|
};
|
|
5094
5115
|
}
|
|
5095
|
-
const
|
|
5096
|
-
class
|
|
5116
|
+
const Ds = Os;
|
|
5117
|
+
class Rs {
|
|
5097
5118
|
constructor() {
|
|
5098
|
-
const e = new Blob([`(${
|
|
5099
|
-
this.workerPool = new
|
|
5119
|
+
const e = new Blob([`(${Ds})()`]), t = URL.createObjectURL(e);
|
|
5120
|
+
this.workerPool = new te(navigator.hardwareConcurrency || 10, t);
|
|
5100
5121
|
}
|
|
5101
5122
|
checkClash(e, t = (i) => {
|
|
5102
5123
|
}) {
|
|
@@ -5105,7 +5126,7 @@ class Ds {
|
|
|
5105
5126
|
});
|
|
5106
5127
|
}
|
|
5107
5128
|
}
|
|
5108
|
-
function
|
|
5129
|
+
function Ls() {
|
|
5109
5130
|
self.addEventListener(
|
|
5110
5131
|
"message",
|
|
5111
5132
|
(g) => {
|
|
@@ -5139,28 +5160,28 @@ function Rs() {
|
|
|
5139
5160
|
!1
|
|
5140
5161
|
);
|
|
5141
5162
|
}
|
|
5142
|
-
const
|
|
5143
|
-
class
|
|
5163
|
+
const ks = Ls;
|
|
5164
|
+
class Bs {
|
|
5144
5165
|
constructor() {
|
|
5145
|
-
const e = new Blob([`(${
|
|
5146
|
-
this.workerPool = new
|
|
5166
|
+
const e = new Blob([`(${ks})()`]), t = URL.createObjectURL(e);
|
|
5167
|
+
this.workerPool = new te(2, t);
|
|
5147
5168
|
}
|
|
5148
5169
|
fetch(e, t = (n) => {
|
|
5149
5170
|
}, i, s) {
|
|
5150
|
-
const n = new
|
|
5171
|
+
const n = new zs(e, i, s);
|
|
5151
5172
|
this.workerPool.Enqueue(n, (r) => {
|
|
5152
5173
|
t(r);
|
|
5153
5174
|
});
|
|
5154
5175
|
}
|
|
5155
5176
|
}
|
|
5156
|
-
class
|
|
5177
|
+
class zs {
|
|
5157
5178
|
constructor(e, t, i) {
|
|
5158
5179
|
this.url = "", this.url = e, this.byteRangeStart = t, this.byteRangeEnd = i;
|
|
5159
5180
|
}
|
|
5160
5181
|
}
|
|
5161
|
-
class
|
|
5182
|
+
class Ns {
|
|
5162
5183
|
constructor(e) {
|
|
5163
|
-
this.viralViewerApi = e, this.dataTree = [], this.trackingData = /* @__PURE__ */ new Map(), this.fetchDataWorker = new
|
|
5184
|
+
this.viralViewerApi = e, this.dataTree = [], this.trackingData = /* @__PURE__ */ new Map(), this.fetchDataWorker = new Bs(), this.buildTreeNodeWorker = new Ts(), this._boundingBoxWorker = new Cs(), this._boundingBoxIntersectWorker = new Is(), this._checkClashWorker = new Rs(), this.searchValue = "", this.firstElementId = "211850", this.secondElementId = "680539", this.groupByKeyword = "Category", this._shallowCompare = (t, i) => JSON.stringify(Object.keys(t).sort()) === JSON.stringify(Object.keys(i).sort()) && JSON.stringify(Object.values(t).sort()) === JSON.stringify(Object.values(i).sort());
|
|
5164
5185
|
}
|
|
5165
5186
|
addTrackingData(e, t) {
|
|
5166
5187
|
this.trackingData.set(e, t);
|
|
@@ -5210,7 +5231,7 @@ class zs {
|
|
|
5210
5231
|
addData(e) {
|
|
5211
5232
|
const t = performance.now(), i = Object.keys(e.Data).length;
|
|
5212
5233
|
console.log(`[DataManager] Adding ${i} elements to data tree...`);
|
|
5213
|
-
const s = new
|
|
5234
|
+
const s = new os();
|
|
5214
5235
|
s.addElements(e.Data), e.Relationships && (s.addRelationships(e.Relationships), s.buildGraphIndex()), this.dataTree.push(s), this.viralViewerApi.emit(R.LOADED_DATA, {
|
|
5215
5236
|
modelId: this.dataTree.length - 1
|
|
5216
5237
|
}), console.log(
|
|
@@ -5288,7 +5309,7 @@ class zs {
|
|
|
5288
5309
|
* @returns
|
|
5289
5310
|
*/
|
|
5290
5311
|
compareModels(e = 0, t = 1) {
|
|
5291
|
-
const i = new
|
|
5312
|
+
const i = new ls();
|
|
5292
5313
|
if (!this.dataTree[e] || !this.dataTree[t])
|
|
5293
5314
|
return i;
|
|
5294
5315
|
const s = this.dataTree[e].elementData, n = this.dataTree[t].elementData, r = this._getDiffKeys(s[0], n[0]);
|
|
@@ -5316,46 +5337,46 @@ class zs {
|
|
|
5316
5337
|
}
|
|
5317
5338
|
return this.viralViewerApi.viralVisibilityManager.exceptElements = [], this.viralViewerApi.viralScene.bimWorld.changeColor(
|
|
5318
5339
|
i.deleted.map((a) => ({ elementId: a.toString(), modelId: e.toString() })),
|
|
5319
|
-
D.hexToRGB(
|
|
5340
|
+
D.hexToRGB(x.deleted),
|
|
5320
5341
|
!0
|
|
5321
5342
|
), this.viralViewerApi.viralVisibilityManager.exceptElements.push({
|
|
5322
5343
|
elements: i.deleted.map((a) => ({ elementId: a.toString(), modelId: e.toString() })),
|
|
5323
|
-
color: D.hexToRGB(
|
|
5344
|
+
color: D.hexToRGB(x.deleted)
|
|
5324
5345
|
}), this.viralViewerApi.viralScene.bimWorld.changeColor(
|
|
5325
5346
|
i.added.map((a) => ({ elementId: a.toString(), modelId: t.toString() })),
|
|
5326
|
-
D.hexToRGB(
|
|
5347
|
+
D.hexToRGB(x.added),
|
|
5327
5348
|
!0
|
|
5328
5349
|
), this.viralViewerApi.viralVisibilityManager.exceptElements.push({
|
|
5329
5350
|
elements: i.added.map((a) => ({ elementId: a.toString(), modelId: t.toString() })),
|
|
5330
|
-
color: D.hexToRGB(
|
|
5351
|
+
color: D.hexToRGB(x.added)
|
|
5331
5352
|
}), this.viralViewerApi.viralScene.bimWorld.changeColor(
|
|
5332
5353
|
i.modified.map((a) => ({ elementId: a.toString(), modelId: e.toString() })),
|
|
5333
|
-
D.hexToRGB(
|
|
5354
|
+
D.hexToRGB(x.modified),
|
|
5334
5355
|
!0
|
|
5335
5356
|
), this.viralViewerApi.viralScene.bimWorld.changeColor(
|
|
5336
5357
|
i.modified.map((a) => ({ elementId: a.toString(), modelId: t.toString() })),
|
|
5337
|
-
D.hexToRGB(
|
|
5358
|
+
D.hexToRGB(x.modified),
|
|
5338
5359
|
!0
|
|
5339
5360
|
), this.viralViewerApi.viralVisibilityManager.exceptElements.push({
|
|
5340
5361
|
elements: i.modified.map((a) => ({ elementId: a.toString(), modelId: e.toString() })),
|
|
5341
|
-
color: D.hexToRGB(
|
|
5362
|
+
color: D.hexToRGB(x.modified)
|
|
5342
5363
|
}), this.viralViewerApi.viralVisibilityManager.exceptElements.push({
|
|
5343
5364
|
elements: i.modified.map((a) => ({ elementId: a.toString(), modelId: t.toString() })),
|
|
5344
|
-
color: D.hexToRGB(
|
|
5365
|
+
color: D.hexToRGB(x.modified)
|
|
5345
5366
|
}), this.viralViewerApi.viralScene.bimWorld.changeColor(
|
|
5346
5367
|
i.notChanged.map((a) => ({ elementId: a.toString(), modelId: e.toString() })),
|
|
5347
|
-
D.hexToRGB(
|
|
5368
|
+
D.hexToRGB(x.notChanged),
|
|
5348
5369
|
!0
|
|
5349
5370
|
), this.viralViewerApi.viralScene.bimWorld.changeColor(
|
|
5350
5371
|
i.notChanged.map((a) => ({ elementId: a.toString(), modelId: t.toString() })),
|
|
5351
|
-
D.hexToRGB(
|
|
5372
|
+
D.hexToRGB(x.notChanged),
|
|
5352
5373
|
!0
|
|
5353
5374
|
), this.viralViewerApi.viralVisibilityManager.exceptElements.push({
|
|
5354
5375
|
elements: i.notChanged.map((a) => ({ elementId: a.toString(), modelId: e.toString() })),
|
|
5355
|
-
color: D.hexToRGB(
|
|
5376
|
+
color: D.hexToRGB(x.notChanged)
|
|
5356
5377
|
}), this.viralViewerApi.viralVisibilityManager.exceptElements.push({
|
|
5357
5378
|
elements: i.notChanged.map((a) => ({ elementId: a.toString(), modelId: t.toString() })),
|
|
5358
|
-
color: D.hexToRGB(
|
|
5379
|
+
color: D.hexToRGB(x.notChanged)
|
|
5359
5380
|
}), this.viralViewerApi.viralRenderer.render(), i;
|
|
5360
5381
|
}
|
|
5361
5382
|
uncompareModels() {
|
|
@@ -5384,7 +5405,7 @@ class zs {
|
|
|
5384
5405
|
if (i.length > 0 && s.length > 0) {
|
|
5385
5406
|
const n = i[0], r = s[0];
|
|
5386
5407
|
console.log(
|
|
5387
|
-
|
|
5408
|
+
T.objectsIntersect(
|
|
5388
5409
|
Array.from(n.buffer),
|
|
5389
5410
|
Array.from(r.buffer)
|
|
5390
5411
|
)
|
|
@@ -5397,7 +5418,7 @@ class zs {
|
|
|
5397
5418
|
* @param secondModelIndex
|
|
5398
5419
|
*/
|
|
5399
5420
|
async checkClashModels(e = 0, t = 0) {
|
|
5400
|
-
const i = new
|
|
5421
|
+
const i = new cs(), s = this.viralViewerApi.viralScene.bimWorld.getElementsByModel(e), n = e === t ? s : this.viralViewerApi.viralScene.bimWorld.getElementsByModel(t);
|
|
5401
5422
|
if (s.length === 0 || n.length === 0)
|
|
5402
5423
|
return i;
|
|
5403
5424
|
const r = (h) => new Promise((d) => {
|
|
@@ -5488,7 +5509,7 @@ class zs {
|
|
|
5488
5509
|
(h) => this._shallowCompare(h.value, l)
|
|
5489
5510
|
);
|
|
5490
5511
|
if (c < 0) {
|
|
5491
|
-
const h = new
|
|
5512
|
+
const h = new hs();
|
|
5492
5513
|
h.value = l, h.modelId = s, h.elementIds = [], h.elementIds.push(Number(o)), t.push(h);
|
|
5493
5514
|
} else
|
|
5494
5515
|
t[c].elementIds.push(Number(o));
|
|
@@ -5515,7 +5536,7 @@ class zs {
|
|
|
5515
5536
|
}
|
|
5516
5537
|
//#endregion
|
|
5517
5538
|
}
|
|
5518
|
-
class
|
|
5539
|
+
class $s {
|
|
5519
5540
|
constructor() {
|
|
5520
5541
|
this.events = {
|
|
5521
5542
|
[R.LOADED_SCENE]: [],
|
|
@@ -5557,7 +5578,7 @@ class Ns {
|
|
|
5557
5578
|
i && i.forEach((s) => s(...t));
|
|
5558
5579
|
}
|
|
5559
5580
|
}
|
|
5560
|
-
class
|
|
5581
|
+
class js {
|
|
5561
5582
|
constructor(e) {
|
|
5562
5583
|
this.viralViewerApi = e, this.keydownQueuedEvents = [], this.keyupQueuedEvents = [], this.setupKeyPress();
|
|
5563
5584
|
}
|
|
@@ -5605,9 +5626,9 @@ class $s {
|
|
|
5605
5626
|
}
|
|
5606
5627
|
//#endregion
|
|
5607
5628
|
}
|
|
5608
|
-
class
|
|
5629
|
+
class Hs {
|
|
5609
5630
|
constructor(e) {
|
|
5610
|
-
this.viralViewerApi = e, this.position = new
|
|
5631
|
+
this.viralViewerApi = e, this.position = new N(), this.rawPosition = new N(), this.mouseMoveQueuedEvents = [], this.mouseDownLeftQueuedEvents = [], this.mouseUpLeftQueuedEvents = [], this.mouseDownRightQueuedEvents = [], this.mouseUpRightQueuedEvents = [], this.mouseDoubleClickQueuedEvents = [], this.handleClick = async (t) => {
|
|
5611
5632
|
var i, s, n;
|
|
5612
5633
|
if (this.viralViewerApi) {
|
|
5613
5634
|
if (t.button === 0) {
|
|
@@ -5619,7 +5640,7 @@ class js {
|
|
|
5619
5640
|
if (this.viralViewerApi.options.isDev && Q.information("Time to ray cast: " + (performance.now() - r)), o && o.length > 0 && !((i = this.viralViewerApi.viralSectionBox) != null && i.isVisible)) {
|
|
5620
5641
|
let l = null;
|
|
5621
5642
|
for (const c of o)
|
|
5622
|
-
if (c.object instanceof
|
|
5643
|
+
if (c.object instanceof Z) {
|
|
5623
5644
|
const h = c.object.findElementByFaceIndex(
|
|
5624
5645
|
((s = c.face) == null ? void 0 : s.a) ?? 0
|
|
5625
5646
|
);
|
|
@@ -5651,7 +5672,7 @@ class js {
|
|
|
5651
5672
|
}
|
|
5652
5673
|
l = c;
|
|
5653
5674
|
break;
|
|
5654
|
-
} else if (c.object instanceof
|
|
5675
|
+
} else if (c.object instanceof oe) {
|
|
5655
5676
|
l = c;
|
|
5656
5677
|
break;
|
|
5657
5678
|
}
|
|
@@ -5705,53 +5726,53 @@ class js {
|
|
|
5705
5726
|
*/
|
|
5706
5727
|
addEventListener(e, t, i) {
|
|
5707
5728
|
switch (e) {
|
|
5708
|
-
case
|
|
5729
|
+
case k.ON_MOUSE_MOVE:
|
|
5709
5730
|
this.mouseMoveQueuedEvents.push([t, i]);
|
|
5710
5731
|
break;
|
|
5711
|
-
case
|
|
5732
|
+
case k.ON_MOUSE_DOWN_LEFT:
|
|
5712
5733
|
this.mouseDownLeftQueuedEvents.push([t, i]);
|
|
5713
5734
|
break;
|
|
5714
|
-
case
|
|
5735
|
+
case k.ON_MOUSE_UP_LEFT:
|
|
5715
5736
|
this.mouseUpLeftQueuedEvents.push([t, i]);
|
|
5716
5737
|
break;
|
|
5717
|
-
case
|
|
5738
|
+
case k.ON_MOUSE_DOWN_RIGHT:
|
|
5718
5739
|
this.mouseDownRightQueuedEvents.push([t, i]);
|
|
5719
5740
|
break;
|
|
5720
|
-
case
|
|
5741
|
+
case k.ON_MOUSE_UP_RIGHT:
|
|
5721
5742
|
this.mouseUpRightQueuedEvents.push([t, i]);
|
|
5722
5743
|
break;
|
|
5723
|
-
case
|
|
5744
|
+
case k.ON_MOUSE_DOUBLE_CLICK:
|
|
5724
5745
|
this.mouseDoubleClickQueuedEvents.push([t, i]);
|
|
5725
5746
|
break;
|
|
5726
5747
|
}
|
|
5727
5748
|
}
|
|
5728
5749
|
removeEventListener(e, t) {
|
|
5729
5750
|
switch (e) {
|
|
5730
|
-
case
|
|
5751
|
+
case k.ON_MOUSE_MOVE:
|
|
5731
5752
|
{
|
|
5732
5753
|
const i = this.mouseMoveQueuedEvents.findIndex((s) => s[0] === t);
|
|
5733
5754
|
this.mouseMoveQueuedEvents.splice(i, 1);
|
|
5734
5755
|
}
|
|
5735
5756
|
break;
|
|
5736
|
-
case
|
|
5757
|
+
case k.ON_MOUSE_DOWN_LEFT:
|
|
5737
5758
|
{
|
|
5738
5759
|
const i = this.mouseDownLeftQueuedEvents.findIndex((s) => s[0] === t);
|
|
5739
5760
|
this.mouseDownLeftQueuedEvents.splice(i, 1);
|
|
5740
5761
|
}
|
|
5741
5762
|
break;
|
|
5742
|
-
case
|
|
5763
|
+
case k.ON_MOUSE_UP_LEFT:
|
|
5743
5764
|
{
|
|
5744
5765
|
const i = this.mouseUpLeftQueuedEvents.findIndex((s) => s[0] === t);
|
|
5745
5766
|
this.mouseUpLeftQueuedEvents.splice(i, 1);
|
|
5746
5767
|
}
|
|
5747
5768
|
break;
|
|
5748
|
-
case
|
|
5769
|
+
case k.ON_MOUSE_DOWN_RIGHT:
|
|
5749
5770
|
{
|
|
5750
5771
|
const i = this.mouseDownRightQueuedEvents.findIndex((s) => s[0] === t);
|
|
5751
5772
|
this.mouseDownRightQueuedEvents.splice(i, 1);
|
|
5752
5773
|
}
|
|
5753
5774
|
break;
|
|
5754
|
-
case
|
|
5775
|
+
case k.ON_MOUSE_UP_RIGHT:
|
|
5755
5776
|
{
|
|
5756
5777
|
const i = this.mouseUpRightQueuedEvents.findIndex((s) => s[0] === t);
|
|
5757
5778
|
this.mouseUpRightQueuedEvents.splice(i, 1);
|
|
@@ -5779,14 +5800,14 @@ class js {
|
|
|
5779
5800
|
}
|
|
5780
5801
|
//#endregion
|
|
5781
5802
|
}
|
|
5782
|
-
const
|
|
5803
|
+
const je = {
|
|
5783
5804
|
showAll: (g, e) => `<svg xmlns="http://www.w3.org/2000/svg" fill=${e || ""} height=${g || 24} viewBox="0 -960 960 960" width="24"><path d="M240-160q-33 0-56.5-23.5T160-240q0-33 23.5-56.5T240-320q33 0 56.5 23.5T320-240q0 33-23.5 56.5T240-160Zm240 0q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm240 0q-33 0-56.5-23.5T640-240q0-33 23.5-56.5T720-320q33 0 56.5 23.5T800-240q0 33-23.5 56.5T720-160ZM240-400q-33 0-56.5-23.5T160-480q0-33 23.5-56.5T240-560q33 0 56.5 23.5T320-480q0 33-23.5 56.5T240-400Zm240 0q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm240 0q-33 0-56.5-23.5T640-480q0-33 23.5-56.5T720-560q33 0 56.5 23.5T800-480q0 33-23.5 56.5T720-400ZM240-640q-33 0-56.5-23.5T160-720q0-33 23.5-56.5T240-800q33 0 56.5 23.5T320-720q0 33-23.5 56.5T240-640Zm240 0q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Zm240 0q-33 0-56.5-23.5T640-720q0-33 23.5-56.5T720-800q33 0 56.5 23.5T800-720q0 33-23.5 56.5T720-640Z"/></svg>`,
|
|
5784
5805
|
isolate: (g, e) => `<svg xmlns="http://www.w3.org/2000/svg" fill=${e || ""} height=${g || 24} viewBox="0 -960 960 960" width="24"><path d="M440-760v-80h80v80h-80Zm0 640v-80h80v80h-80ZM280-760v-80h80v80h-80Zm0 640v-80h80v80h-80ZM120-760v-80h80v80h-80Zm0 160v-80h80v80h-80Zm0 160v-80h80v80h-80Zm0 160v-80h80v80h-80Zm0 160v-80h80v80h-80Zm480 0v-80h80v-560h-80v-80h240v80h-80v560h80v80H600Z"/></svg>`,
|
|
5785
5806
|
hide: (g, e) => `<svg xmlns="http://www.w3.org/2000/svg" fill=${e || ""} height=${g || 24} viewBox="0 -960 960 960" width="24"><path d="M200-120q-33 0-56.5-23.5T120-200h80v80Zm-80-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160q0-33 23.5-56.5T200-840v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm60 640-56-56 142-142-142-142 56-56 142 142 142-142 56 56-142 142 142 142-56 56-142-142-142 142Zm100-640v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80q33 0 56.5 23.5T840-760h-80Z"/></svg>`,
|
|
5786
5807
|
focus: (g, e) => `<svg xmlns="http://www.w3.org/2000/svg" fill=${e || ""} height=${g || 24} viewBox="0 -960 960 960" width="24"><path d="M120-120v-200h80v120h120v80H120Zm520 0v-80h120v-120h80v200H640ZM120-640v-200h200v80H200v120h-80Zm640 0v-120H640v-80h200v200h-80Z"/></svg>`,
|
|
5787
5808
|
properties: (g, e) => `<svg xmlns="http://www.w3.org/2000/svg" fill=${e || ""} height=${g || 24} viewBox="0 -960 960 960" width="24"><path d="M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>`
|
|
5788
5809
|
};
|
|
5789
|
-
class
|
|
5810
|
+
class Ws {
|
|
5790
5811
|
constructor(e) {
|
|
5791
5812
|
this.viralViewerApi = e, this.elementProperties = {}, this._sleepDebounceTimer = null, this._sleepDebounceDelay = 150, this.resizeObserver = null, this.isShiftPressed = !1, this.windowHandler(), this.contextMenuEventHandler(), this.selectElementHandler2(), this.doubleClickElementHandler(), this.keyboardHandler(), this.cameraHandler(), this._visibilityManager = this.viralViewerApi.viralVisibilityManager;
|
|
5792
5813
|
}
|
|
@@ -5794,40 +5815,40 @@ class Hs {
|
|
|
5794
5815
|
this.viralViewerApi.viralContextMenu && (this.viralViewerApi.viralContextMenu.addContextItem(
|
|
5795
5816
|
0,
|
|
5796
5817
|
"Show all elements",
|
|
5797
|
-
|
|
5818
|
+
je.showAll(void 0, x.primary),
|
|
5798
5819
|
(e) => {
|
|
5799
5820
|
this._visibilityManager.showAll2(), this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
5800
5821
|
}
|
|
5801
5822
|
), this.viralViewerApi.viralContextMenu.addContextItem(
|
|
5802
5823
|
1,
|
|
5803
5824
|
"Isolate",
|
|
5804
|
-
|
|
5825
|
+
je.isolate(void 0, x.primary),
|
|
5805
5826
|
(e) => {
|
|
5806
5827
|
this._visibilityManager.isolate2(), this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
5807
5828
|
}
|
|
5808
5829
|
), this.viralViewerApi.viralContextMenu.addContextItem(
|
|
5809
5830
|
2,
|
|
5810
5831
|
"Hide",
|
|
5811
|
-
|
|
5832
|
+
je.hide(void 0, x.primary),
|
|
5812
5833
|
(e) => {
|
|
5813
5834
|
this._visibilityManager.hide2(), this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
5814
5835
|
}
|
|
5815
5836
|
), this.viralViewerApi.viralContextMenu.addContextItem(
|
|
5816
5837
|
3,
|
|
5817
5838
|
"Focus",
|
|
5818
|
-
|
|
5839
|
+
je.focus(void 0, x.primary),
|
|
5819
5840
|
(e) => {
|
|
5820
5841
|
this._visibilityManager.zoomTo(), this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
5821
5842
|
}
|
|
5822
5843
|
), this.viralViewerApi.viralContextMenu.addContextItem(
|
|
5823
5844
|
4,
|
|
5824
5845
|
"Properties",
|
|
5825
|
-
|
|
5846
|
+
je.properties(void 0, x.secondary),
|
|
5826
5847
|
(e) => {
|
|
5827
5848
|
this.viralViewerApi.viralDraggableModal.show(), this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
5828
5849
|
}
|
|
5829
5850
|
)), this.viralViewerApi.viralMouse && (this.viralViewerApi.viralMouse.addEventListener(
|
|
5830
|
-
|
|
5851
|
+
k.ON_MOUSE_DOWN_RIGHT,
|
|
5831
5852
|
"ShowContextMenu",
|
|
5832
5853
|
(e) => {
|
|
5833
5854
|
this.viralViewerApi.viralContextMenu.showContextMenu(
|
|
@@ -5837,7 +5858,7 @@ class Hs {
|
|
|
5837
5858
|
);
|
|
5838
5859
|
}
|
|
5839
5860
|
), this.viralViewerApi.viralMouse.addEventListener(
|
|
5840
|
-
|
|
5861
|
+
k.ON_MOUSE_DOWN_LEFT,
|
|
5841
5862
|
"HideContextMenu",
|
|
5842
5863
|
(e) => {
|
|
5843
5864
|
this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
@@ -5847,13 +5868,13 @@ class Hs {
|
|
|
5847
5868
|
// ms to wait before confirming camera is steady
|
|
5848
5869
|
cameraHandler() {
|
|
5849
5870
|
this.viralViewerApi.viralCamera && (this.viralViewerApi.viralCamera.addEventListener(
|
|
5850
|
-
|
|
5871
|
+
X.ON_WAKE,
|
|
5851
5872
|
"hide objects",
|
|
5852
5873
|
() => {
|
|
5853
5874
|
this._sleepDebounceTimer && (clearTimeout(this._sleepDebounceTimer), this._sleepDebounceTimer = null), this.viralViewerApi.viralVisibilityManager.bypassScreenSpaceEdge(), this.viralViewerApi.viralVisibilityManager.bypassSelectionOutline(), this.viralViewerApi.viralVisibilityManager.disableAmbientOcclusion(), this.viralViewerApi.viralVisibilityManager.disableSampling();
|
|
5854
5875
|
}
|
|
5855
5876
|
), this.viralViewerApi.viralCamera.addEventListener(
|
|
5856
|
-
|
|
5877
|
+
X.ON_SLEEP,
|
|
5857
5878
|
"unhide objects",
|
|
5858
5879
|
() => {
|
|
5859
5880
|
this._sleepDebounceTimer && clearTimeout(this._sleepDebounceTimer), this._sleepDebounceTimer = setTimeout(() => {
|
|
@@ -5879,13 +5900,13 @@ class Hs {
|
|
|
5879
5900
|
let e = null;
|
|
5880
5901
|
const t = 250;
|
|
5881
5902
|
this.viralViewerApi.viralMouse.addEventListener(
|
|
5882
|
-
|
|
5903
|
+
k.ON_MOUSE_DOWN_LEFT,
|
|
5883
5904
|
"SelectElement",
|
|
5884
5905
|
(i) => {
|
|
5885
5906
|
e = performance.now();
|
|
5886
5907
|
}
|
|
5887
5908
|
), this.viralViewerApi.viralMouse.addEventListener(
|
|
5888
|
-
|
|
5909
|
+
k.ON_MOUSE_UP_LEFT,
|
|
5889
5910
|
"SelectElementUp",
|
|
5890
5911
|
(i) => {
|
|
5891
5912
|
var s, n;
|
|
@@ -5908,7 +5929,7 @@ class Hs {
|
|
|
5908
5929
|
if (c)
|
|
5909
5930
|
break;
|
|
5910
5931
|
const d = h;
|
|
5911
|
-
if (d.object instanceof
|
|
5932
|
+
if (d.object instanceof Z && d.face) {
|
|
5912
5933
|
const u = d.object.findElementByFaceIndex(
|
|
5913
5934
|
d.face.a
|
|
5914
5935
|
);
|
|
@@ -5973,14 +5994,14 @@ class Hs {
|
|
|
5973
5994
|
//#region Double Click element handler
|
|
5974
5995
|
doubleClickElementHandler() {
|
|
5975
5996
|
this.viralViewerApi.viralMouse.addEventListener(
|
|
5976
|
-
|
|
5997
|
+
k.ON_MOUSE_DOUBLE_CLICK,
|
|
5977
5998
|
"DoubleClickElement",
|
|
5978
5999
|
(e) => {
|
|
5979
6000
|
const t = this.viralViewerApi.viralCamera.clientToWorld();
|
|
5980
6001
|
if (t && (t == null ? void 0 : t.length) > 0)
|
|
5981
6002
|
for (const s of t) {
|
|
5982
6003
|
const n = s;
|
|
5983
|
-
if (n.object instanceof
|
|
6004
|
+
if (n.object instanceof Z && n.face) {
|
|
5984
6005
|
const r = n.object.findElementByFaceIndex(
|
|
5985
6006
|
n.face.a
|
|
5986
6007
|
);
|
|
@@ -6065,7 +6086,7 @@ class Fs {
|
|
|
6065
6086
|
}
|
|
6066
6087
|
async loadedModels(e) {
|
|
6067
6088
|
this.options.isDev && Q.information(`model ${e.modelId} loaded!`), this.viralViewerApi.viralScene.selectables = [], this.viralViewerApi.viralScene.selectables = [], this.viralViewerApi.viralScene.bimWorld.children.forEach((t) => {
|
|
6068
|
-
if (t instanceof
|
|
6089
|
+
if (t instanceof Z) {
|
|
6069
6090
|
this.viralViewerApi.viralScene.selectables.push(t);
|
|
6070
6091
|
return;
|
|
6071
6092
|
}
|
|
@@ -6075,9 +6096,9 @@ class Fs {
|
|
|
6075
6096
|
});
|
|
6076
6097
|
}
|
|
6077
6098
|
}
|
|
6078
|
-
class
|
|
6099
|
+
class Gs {
|
|
6079
6100
|
constructor(e) {
|
|
6080
|
-
this.viralViewerApi = e, this.potree = new
|
|
6101
|
+
this.viralViewerApi = e, this.potree = new Oi(), this.pointClouds = [];
|
|
6081
6102
|
}
|
|
6082
6103
|
/**
|
|
6083
6104
|
*
|
|
@@ -6093,13 +6114,13 @@ class Ws {
|
|
|
6093
6114
|
(r = this.viralViewerApi.viralRenderer.postProcessingRenderer) == null || r.disableOutline(), this.potree.pointBudget = s, this.potree.loadPointCloudCustom(e, t, i).then((o) => {
|
|
6094
6115
|
var d;
|
|
6095
6116
|
const a = o.material;
|
|
6096
|
-
a.size = 1, a.pointSizeType =
|
|
6097
|
-
const l = new E(0, -1.5, 3), c = new
|
|
6117
|
+
a.size = 1, a.pointSizeType = Di.ADAPTIVE, a.shape = Ri.CIRCLE, a.pointColorType = Li.RGB, a.inputColorEncoding = 1, a.outputColorEncoding = 1, console.log(o.boundingBox);
|
|
6118
|
+
const l = new E(0, -1.5, 3), c = new ai(-Math.PI / 2, 0, 0), h = new E(2, 2, 2);
|
|
6098
6119
|
o.position.copy(l), o.rotation.copy(c), o.scale.copy(h), this.viralViewerApi.viralScene.addModel(o), this.viralViewerApi.viralScene.selectables.push(o), this.pointClouds.push(o), this.viralViewerApi.viralCamera.camera && ((d = this.viralViewerApi.viralCamera.cameraControls) == null || d.fitToBox(o.boundingBox, !0)), n(o);
|
|
6099
6120
|
});
|
|
6100
6121
|
}
|
|
6101
6122
|
}
|
|
6102
|
-
class
|
|
6123
|
+
class Us {
|
|
6103
6124
|
static getDeviceType() {
|
|
6104
6125
|
const e = navigator.userAgent.toLowerCase(), t = /iphone|ipod|android.*mobile|blackberry|opera mini|windows phone/i.test(
|
|
6105
6126
|
e
|
|
@@ -6107,7 +6128,7 @@ class Gs {
|
|
|
6107
6128
|
return t ? "mobile" : i ? "tablet" : "pc";
|
|
6108
6129
|
}
|
|
6109
6130
|
}
|
|
6110
|
-
class
|
|
6131
|
+
class qs {
|
|
6111
6132
|
constructor() {
|
|
6112
6133
|
this.gl = null, this.specs = null, this.initWebGL(), this.detectSpecs();
|
|
6113
6134
|
}
|
|
@@ -6251,7 +6272,7 @@ class Us {
|
|
|
6251
6272
|
});
|
|
6252
6273
|
}
|
|
6253
6274
|
}
|
|
6254
|
-
class
|
|
6275
|
+
class Qs {
|
|
6255
6276
|
constructor() {
|
|
6256
6277
|
this.modelId = -1, this.elements = [], this.materials = [], this.mapMaterialsToMaterialManager = new It();
|
|
6257
6278
|
}
|
|
@@ -6260,7 +6281,7 @@ class qs {
|
|
|
6260
6281
|
this.elements = [], this.materials = [], this.mapMaterialsToMaterialManager = new It();
|
|
6261
6282
|
}
|
|
6262
6283
|
}
|
|
6263
|
-
class
|
|
6284
|
+
class Zs {
|
|
6264
6285
|
constructor() {
|
|
6265
6286
|
this.MIN_VERTEX_INSTANCES_FOR_INSTANCING = 1e3, this.MIN_INSTANCES_FOR_INSTANCING = 3, this.MAX_DRAW_CALLS = 25, this.MIN_INSTANCED_VERTEX_RATIO = 0.6, this.HIGH_VERTEX_THRESHOLD = 500;
|
|
6266
6287
|
}
|
|
@@ -6409,8 +6430,8 @@ class Qs {
|
|
|
6409
6430
|
}
|
|
6410
6431
|
}
|
|
6411
6432
|
}
|
|
6412
|
-
const
|
|
6413
|
-
function
|
|
6433
|
+
const Ys = new Zs();
|
|
6434
|
+
function Xs() {
|
|
6414
6435
|
class g {
|
|
6415
6436
|
constructor() {
|
|
6416
6437
|
this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
@@ -6495,8 +6516,8 @@ function Ys() {
|
|
|
6495
6516
|
}), self.postMessage(r);
|
|
6496
6517
|
};
|
|
6497
6518
|
}
|
|
6498
|
-
const
|
|
6499
|
-
function
|
|
6519
|
+
const Ks = Xs;
|
|
6520
|
+
function Js() {
|
|
6500
6521
|
class g {
|
|
6501
6522
|
constructor() {
|
|
6502
6523
|
this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
@@ -6586,19 +6607,19 @@ function Ks() {
|
|
|
6586
6607
|
}), self.postMessage(r);
|
|
6587
6608
|
};
|
|
6588
6609
|
}
|
|
6589
|
-
const
|
|
6590
|
-
class
|
|
6610
|
+
const en = Js;
|
|
6611
|
+
class tn {
|
|
6591
6612
|
// Or 5K objects
|
|
6592
6613
|
//#endregion
|
|
6593
6614
|
constructor(e) {
|
|
6594
6615
|
this.viralViewerApi = e, this.lastRenderTime = 0, this.elementBuffer = /* @__PURE__ */ new Map(), this.BATCH_THRESHOLD_VERTICES = 1e5, this.BATCH_THRESHOLD_OBJECTS = 5e3;
|
|
6595
|
-
const t = new Blob([`(${
|
|
6596
|
-
this.workerPool = new
|
|
6616
|
+
const t = new Blob([`(${Ks})()`]), i = URL.createObjectURL(t);
|
|
6617
|
+
this.workerPool = new te(
|
|
6597
6618
|
navigator.hardwareConcurrency || this.viralViewerApi.options.numberOfWorker,
|
|
6598
6619
|
i
|
|
6599
6620
|
);
|
|
6600
|
-
const s = new Blob([`(${
|
|
6601
|
-
this.workerPool2 = new
|
|
6621
|
+
const s = new Blob([`(${en})()`]), n = URL.createObjectURL(s);
|
|
6622
|
+
this.workerPool2 = new te(
|
|
6602
6623
|
this.viralViewerApi.options.numberOfWorker,
|
|
6603
6624
|
n
|
|
6604
6625
|
);
|
|
@@ -6610,7 +6631,7 @@ class en {
|
|
|
6610
6631
|
*/
|
|
6611
6632
|
initial(e) {
|
|
6612
6633
|
console.log(e);
|
|
6613
|
-
const t = new
|
|
6634
|
+
const t = new Qs();
|
|
6614
6635
|
t.modelId = this.viralViewerApi.viralScene.bimWorld.bimModels.length, this.viralViewerApi.viralScene.bimWorld.bimModels.push(t);
|
|
6615
6636
|
const i = this.viralViewerApi.viralScene.bimWorld.bimModels.length - 1;
|
|
6616
6637
|
for (let s = 0; s < e.length; s++) {
|
|
@@ -6622,7 +6643,7 @@ class en {
|
|
|
6622
6643
|
(a) => a.userData.red === n.Red && a.userData.green === n.Green && a.userData.blue === n.Blue && a.userData.opacity === n.Opacity
|
|
6623
6644
|
);
|
|
6624
6645
|
if (o < 0) {
|
|
6625
|
-
const a = new
|
|
6646
|
+
const a = new gt({
|
|
6626
6647
|
color: r,
|
|
6627
6648
|
opacity: n.Opacity,
|
|
6628
6649
|
transparent: n.Opacity !== 1,
|
|
@@ -6633,7 +6654,7 @@ class en {
|
|
|
6633
6654
|
// polygonOffset: true,
|
|
6634
6655
|
// polygonOffsetFactor: 1,
|
|
6635
6656
|
// polygonOffsetUnits: 0.1,
|
|
6636
|
-
side:
|
|
6657
|
+
side: oi
|
|
6637
6658
|
// 🔧 FIX: Changed from DoubleSide to halve draw calls
|
|
6638
6659
|
});
|
|
6639
6660
|
a.userData.red = n.Red, a.userData.green = n.Green, a.userData.blue = n.Blue, a.userData.opacity = n.Opacity, this.viralViewerApi.viralMaterialManager.materials.push(a);
|
|
@@ -6649,7 +6670,7 @@ class en {
|
|
|
6649
6670
|
*/
|
|
6650
6671
|
loadElement(e, t, i = () => {
|
|
6651
6672
|
}, s = null) {
|
|
6652
|
-
const { highDuplicationElements: n, lowDuplicationElements: r } =
|
|
6673
|
+
const { highDuplicationElements: n, lowDuplicationElements: r } = Ys.analyze(t), o = r.map((p) => p.element), a = n.map((p) => p.element), l = o.length > 0, c = a.length > 0;
|
|
6653
6674
|
if (!l && !c) {
|
|
6654
6675
|
i();
|
|
6655
6676
|
return;
|
|
@@ -6739,7 +6760,7 @@ class en {
|
|
|
6739
6760
|
createSingleMergedMesh(e, t, i) {
|
|
6740
6761
|
const s = this.createOptimizedMaterial(t);
|
|
6741
6762
|
this.viralViewerApi.viralMaterialManager.mergeMaterials.push(s);
|
|
6742
|
-
const n = new
|
|
6763
|
+
const n = new Z(
|
|
6743
6764
|
void 0,
|
|
6744
6765
|
s,
|
|
6745
6766
|
this.viralViewerApi.viralScene.bimWorld.workerPool
|
|
@@ -6757,14 +6778,14 @@ class en {
|
|
|
6757
6778
|
* Uses onBeforeCompile to inject custom shader code for RGBA vertex colors
|
|
6758
6779
|
*/
|
|
6759
6780
|
createOptimizedMaterial(e) {
|
|
6760
|
-
const t =
|
|
6781
|
+
const t = Us.getDeviceType() === "pc", i = (r, o = 2) => {
|
|
6761
6782
|
if (!r)
|
|
6762
6783
|
return 16777215;
|
|
6763
6784
|
const a = r.clone();
|
|
6764
6785
|
return a.multiplyScalar(o), a;
|
|
6765
|
-
}, s = e.transparent || e.opacity < 1, n = t ? new
|
|
6786
|
+
}, s = e.transparent || e.opacity < 1, n = t ? new K({
|
|
6766
6787
|
vertexColors: !0,
|
|
6767
|
-
side:
|
|
6788
|
+
side: ee,
|
|
6768
6789
|
// 🔧 FIX: Changed from DoubleSide to halve draw calls
|
|
6769
6790
|
opacity: e.opacity,
|
|
6770
6791
|
transparent: !0,
|
|
@@ -6928,9 +6949,9 @@ class en {
|
|
|
6928
6949
|
}
|
|
6929
6950
|
//#endregion
|
|
6930
6951
|
}
|
|
6931
|
-
class
|
|
6952
|
+
class sn {
|
|
6932
6953
|
constructor(e) {
|
|
6933
|
-
this.viralViewerApi = e, this.elements = [], this._loadBatchedElementWorker = new
|
|
6954
|
+
this.viralViewerApi = e, this.elements = [], this._loadBatchedElementWorker = new tn(e);
|
|
6934
6955
|
}
|
|
6935
6956
|
//#region Load worker
|
|
6936
6957
|
async load(e, t, i, s = () => {
|
|
@@ -7074,9 +7095,9 @@ class tn {
|
|
|
7074
7095
|
}), this.viralViewerApi.viralMaterialManager.mergeMaterials = [], this.viralViewerApi.viralVisibilityManager.disableGroundShadow(), this.viralViewerApi.viralRenderer.render(), this.viralViewerApi.viralDataManager.dataTree = [], this.viralViewerApi.viralScene.selectables = [];
|
|
7075
7096
|
}
|
|
7076
7097
|
}
|
|
7077
|
-
class
|
|
7098
|
+
class nn {
|
|
7078
7099
|
constructor(e) {
|
|
7079
|
-
this.viralViewerApi = e, this.objectLoader = new
|
|
7100
|
+
this.viralViewerApi = e, this.objectLoader = new li(), this.gltfLoader = new ki();
|
|
7080
7101
|
}
|
|
7081
7102
|
parseObject(e) {
|
|
7082
7103
|
return this.objectLoader.parse(e);
|
|
@@ -7088,34 +7109,34 @@ class sn {
|
|
|
7088
7109
|
this.gltfLoader.load(e, t, i, s);
|
|
7089
7110
|
}
|
|
7090
7111
|
}
|
|
7091
|
-
class
|
|
7112
|
+
class rn {
|
|
7092
7113
|
constructor(e) {
|
|
7093
|
-
this.viralViewerApi = e, this.revitLoader = new
|
|
7114
|
+
this.viralViewerApi = e, this.revitLoader = new sn(this.viralViewerApi), this.pointCloudLoader = new Gs(this.viralViewerApi), this.threeLoader = new nn(this.viralViewerApi);
|
|
7094
7115
|
}
|
|
7095
7116
|
}
|
|
7096
|
-
class
|
|
7117
|
+
class an {
|
|
7097
7118
|
constructor(e) {
|
|
7098
|
-
this.viralViewerApi = e, this.hoverMaterial = new
|
|
7099
|
-
color: D.hexToThreejsColor(
|
|
7119
|
+
this.viralViewerApi = e, this.hoverMaterial = new gt({
|
|
7120
|
+
color: D.hexToThreejsColor(x.secondary),
|
|
7100
7121
|
opacity: 0.7,
|
|
7101
7122
|
transparent: !0,
|
|
7102
7123
|
depthTest: !1,
|
|
7103
7124
|
name: "Render Material",
|
|
7104
7125
|
flatShading: !0
|
|
7105
|
-
}), this.selectedMaterial = new
|
|
7106
|
-
color: D.hexToThreejsColor(
|
|
7126
|
+
}), this.selectedMaterial = new gt({
|
|
7127
|
+
color: D.hexToThreejsColor(x.secondary),
|
|
7107
7128
|
opacity: 0.7,
|
|
7108
7129
|
transparent: !0,
|
|
7109
7130
|
name: "Render Material",
|
|
7110
7131
|
depthTest: !1,
|
|
7111
7132
|
flatShading: !0
|
|
7112
|
-
}), this.edgeMaterial = new
|
|
7113
|
-
color: D.hexToThreejsColor(
|
|
7133
|
+
}), this.edgeMaterial = new Qt({
|
|
7134
|
+
color: D.hexToThreejsColor(x.edge),
|
|
7114
7135
|
linewidth: 2,
|
|
7115
|
-
resolution: new
|
|
7136
|
+
resolution: new N(window.innerWidth, window.innerHeight),
|
|
7116
7137
|
transparent: !0,
|
|
7117
7138
|
opacity: 0.8
|
|
7118
|
-
}), this.outlineMaterial = new
|
|
7139
|
+
}), this.outlineMaterial = new K({
|
|
7119
7140
|
transparent: !0,
|
|
7120
7141
|
opacity: 0
|
|
7121
7142
|
}), this.materials = [], this.mergeMaterials = [], this.originalColors = [], this.viralViewerApi.emit(R.LOADED_MATERIAL_MANAGER);
|
|
@@ -7140,141 +7161,13 @@ class rn {
|
|
|
7140
7161
|
resetToOriginal() {
|
|
7141
7162
|
for (let e = 0; e < this.materials.length; e++) {
|
|
7142
7163
|
const t = this.materials[e];
|
|
7143
|
-
t instanceof
|
|
7144
|
-
}
|
|
7145
|
-
}
|
|
7146
|
-
}
|
|
7147
|
-
const an = {
|
|
7148
|
-
outlineColor: new k(y.accent),
|
|
7149
|
-
outlineOpacity: 1,
|
|
7150
|
-
outlineThickness: 2,
|
|
7151
|
-
selectionAlpha: 0.99,
|
|
7152
|
-
alphaTolerance: 5e-3
|
|
7153
|
-
}, $t = `
|
|
7154
|
-
varying vec2 vUv;
|
|
7155
|
-
void main() {
|
|
7156
|
-
vUv = uv;
|
|
7157
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
7158
|
-
}
|
|
7159
|
-
`, on = `
|
|
7160
|
-
precision highp float;
|
|
7161
|
-
|
|
7162
|
-
uniform sampler2D tDiffuse;
|
|
7163
|
-
|
|
7164
|
-
uniform vec2 resolution;
|
|
7165
|
-
uniform vec3 outlineColor;
|
|
7166
|
-
uniform float outlineOpacity;
|
|
7167
|
-
uniform float outlineThickness;
|
|
7168
|
-
uniform float selectionAlpha;
|
|
7169
|
-
uniform float alphaTolerance;
|
|
7170
|
-
|
|
7171
|
-
varying vec2 vUv;
|
|
7172
|
-
|
|
7173
|
-
// Check if pixel is selected based on alpha
|
|
7174
|
-
float isSelected(vec4 color) {
|
|
7175
|
-
return abs(color.a - selectionAlpha) < alphaTolerance ? 1.0 : 0.0;
|
|
7176
|
-
}
|
|
7177
|
-
|
|
7178
|
-
// Edge detection - find boundaries between selected and non-selected
|
|
7179
|
-
float detectSelectionEdge(vec2 uv, vec2 texelSize) {
|
|
7180
|
-
// Sample center
|
|
7181
|
-
vec4 center = texture2D(tDiffuse, uv);
|
|
7182
|
-
float centerSelected = isSelected(center);
|
|
7183
|
-
|
|
7184
|
-
// If center is selected, check if any neighbor is NOT selected (inner edge)
|
|
7185
|
-
// If center is NOT selected, check if any neighbor IS selected (outer edge)
|
|
7186
|
-
|
|
7187
|
-
float maxDiff = 0.0;
|
|
7188
|
-
|
|
7189
|
-
// Sample 8 neighbors at outline thickness distance
|
|
7190
|
-
for (float y = -1.0; y <= 1.0; y += 1.0) {
|
|
7191
|
-
for (float x = -1.0; x <= 1.0; x += 1.0) {
|
|
7192
|
-
if (x == 0.0 && y == 0.0) continue;
|
|
7193
|
-
|
|
7194
|
-
vec2 offset = vec2(x, y) * texelSize * outlineThickness;
|
|
7195
|
-
vec4 neighbor = texture2D(tDiffuse, uv + offset);
|
|
7196
|
-
float neighborSelected = isSelected(neighbor);
|
|
7197
|
-
|
|
7198
|
-
maxDiff = max(maxDiff, abs(centerSelected - neighborSelected));
|
|
7199
|
-
}
|
|
7200
|
-
}
|
|
7201
|
-
|
|
7202
|
-
// Only draw outline OUTSIDE selection (where center is NOT selected but has selected neighbor)
|
|
7203
|
-
if (centerSelected > 0.5) {
|
|
7204
|
-
return 0.0; // Don't draw outline inside selected area
|
|
7205
|
-
}
|
|
7206
|
-
|
|
7207
|
-
return maxDiff;
|
|
7208
|
-
}
|
|
7209
|
-
|
|
7210
|
-
void main() {
|
|
7211
|
-
vec2 texelSize = 1.0 / resolution;
|
|
7212
|
-
vec4 sceneColor = texture2D(tDiffuse, vUv);
|
|
7213
|
-
|
|
7214
|
-
// Detect selection boundary
|
|
7215
|
-
float edge = detectSelectionEdge(vUv, texelSize);
|
|
7216
|
-
|
|
7217
|
-
if (edge < 0.5) {
|
|
7218
|
-
// Restore original alpha if it was selection marker
|
|
7219
|
-
float originalAlpha = isSelected(sceneColor) > 0.5 ? 1.0 : sceneColor.a;
|
|
7220
|
-
gl_FragColor = vec4(sceneColor.rgb, originalAlpha);
|
|
7221
|
-
return;
|
|
7222
|
-
}
|
|
7223
|
-
|
|
7224
|
-
// Apply outline
|
|
7225
|
-
vec3 finalColor = mix(sceneColor.rgb, outlineColor, outlineOpacity);
|
|
7226
|
-
gl_FragColor = vec4(finalColor, 1.0);
|
|
7227
|
-
}
|
|
7228
|
-
`;
|
|
7229
|
-
class ln extends Ot {
|
|
7230
|
-
constructor(e, t = {}) {
|
|
7231
|
-
super(), this.copyMaterial = null, this.bypass = !1, this.hasSelection = !1, this.resolution = e, this.options = { ...an, ...t }, this.outlineMaterial = new ee({
|
|
7232
|
-
uniforms: {
|
|
7233
|
-
tDiffuse: { value: null },
|
|
7234
|
-
resolution: { value: this.resolution },
|
|
7235
|
-
outlineColor: { value: this.options.outlineColor },
|
|
7236
|
-
outlineOpacity: { value: this.options.outlineOpacity },
|
|
7237
|
-
outlineThickness: { value: this.options.outlineThickness },
|
|
7238
|
-
selectionAlpha: { value: this.options.selectionAlpha },
|
|
7239
|
-
alphaTolerance: { value: this.options.alphaTolerance }
|
|
7240
|
-
},
|
|
7241
|
-
vertexShader: $t,
|
|
7242
|
-
fragmentShader: on
|
|
7243
|
-
}), this.fsQuad = new Dt(this.outlineMaterial);
|
|
7244
|
-
}
|
|
7245
|
-
setOptions(e) {
|
|
7246
|
-
this.options = { ...this.options, ...e };
|
|
7247
|
-
const t = this.outlineMaterial.uniforms;
|
|
7248
|
-
t.outlineColor.value = this.options.outlineColor, t.outlineOpacity.value = this.options.outlineOpacity, t.outlineThickness.value = this.options.outlineThickness, t.selectionAlpha.value = this.options.selectionAlpha, t.alphaTolerance.value = this.options.alphaTolerance;
|
|
7249
|
-
}
|
|
7250
|
-
render(e, t, i, s, n) {
|
|
7251
|
-
if (this.bypass || !this.hasSelection) {
|
|
7252
|
-
this.copyMaterial || (this.copyMaterial = new ee({
|
|
7253
|
-
uniforms: { tDiffuse: { value: null } },
|
|
7254
|
-
vertexShader: $t,
|
|
7255
|
-
fragmentShader: `
|
|
7256
|
-
uniform sampler2D tDiffuse;
|
|
7257
|
-
varying vec2 vUv;
|
|
7258
|
-
void main() {
|
|
7259
|
-
gl_FragColor = texture2D(tDiffuse, vUv);
|
|
7260
|
-
}
|
|
7261
|
-
`
|
|
7262
|
-
})), this.copyMaterial.uniforms.tDiffuse.value = i.texture, this.fsQuad.material = this.copyMaterial, e.setRenderTarget(this.renderToScreen ? null : t), this.fsQuad.render(e);
|
|
7263
|
-
return;
|
|
7164
|
+
t instanceof gt && t.color.set(this.originalColors[e]);
|
|
7264
7165
|
}
|
|
7265
|
-
this.outlineMaterial.uniforms.tDiffuse.value = i.texture, this.fsQuad.material = this.outlineMaterial, e.setRenderTarget(this.renderToScreen ? null : t), this.fsQuad.render(e);
|
|
7266
|
-
}
|
|
7267
|
-
setSize(e, t) {
|
|
7268
|
-
this.resolution.set(e, t), this.outlineMaterial.uniforms.resolution.value = this.resolution;
|
|
7269
|
-
}
|
|
7270
|
-
dispose() {
|
|
7271
|
-
var e;
|
|
7272
|
-
this.outlineMaterial.dispose(), (e = this.copyMaterial) == null || e.dispose(), this.fsQuad.dispose();
|
|
7273
7166
|
}
|
|
7274
7167
|
}
|
|
7275
|
-
function
|
|
7276
|
-
const g = new
|
|
7277
|
-
side:
|
|
7168
|
+
function on() {
|
|
7169
|
+
const g = new ci({
|
|
7170
|
+
side: ee
|
|
7278
7171
|
});
|
|
7279
7172
|
return g.onBeforeCompile = (e) => {
|
|
7280
7173
|
e.vertexShader = `attribute vec4 color;
|
|
@@ -7294,10 +7187,10 @@ function cn() {
|
|
|
7294
7187
|
);
|
|
7295
7188
|
}, g;
|
|
7296
7189
|
}
|
|
7297
|
-
function
|
|
7190
|
+
function ln() {
|
|
7298
7191
|
const g = new G({
|
|
7299
7192
|
colorWrite: !1,
|
|
7300
|
-
side:
|
|
7193
|
+
side: ee
|
|
7301
7194
|
});
|
|
7302
7195
|
return g.onBeforeCompile = (e) => {
|
|
7303
7196
|
e.vertexShader = `attribute vec4 color;
|
|
@@ -7317,8 +7210,8 @@ function hn() {
|
|
|
7317
7210
|
);
|
|
7318
7211
|
}, g;
|
|
7319
7212
|
}
|
|
7320
|
-
const
|
|
7321
|
-
edgeColor: new
|
|
7213
|
+
const cn = {
|
|
7214
|
+
edgeColor: new B(0),
|
|
7322
7215
|
edgeOpacity: 0.6,
|
|
7323
7216
|
// Reduced for subtlety, better perf
|
|
7324
7217
|
edgeThickness: 1,
|
|
@@ -7335,14 +7228,14 @@ const dn = {
|
|
|
7335
7228
|
// Keep - good for creases
|
|
7336
7229
|
enableObjectIdEdges: !1
|
|
7337
7230
|
// Disable by default - most expensive (extra render pass)
|
|
7338
|
-
},
|
|
7231
|
+
}, hn = `
|
|
7339
7232
|
varying vec2 vUv;
|
|
7340
7233
|
|
|
7341
7234
|
void main() {
|
|
7342
7235
|
vUv = uv;
|
|
7343
7236
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
7344
7237
|
}
|
|
7345
|
-
`,
|
|
7238
|
+
`, dn = `
|
|
7346
7239
|
precision highp float;
|
|
7347
7240
|
|
|
7348
7241
|
uniform sampler2D tDiffuse; // Color buffer (from main render)
|
|
@@ -7508,7 +7401,7 @@ void main() {
|
|
|
7508
7401
|
|
|
7509
7402
|
gl_FragColor = vec4(finalColor, color.a);
|
|
7510
7403
|
}
|
|
7511
|
-
`,
|
|
7404
|
+
`, un = `
|
|
7512
7405
|
attribute float objectIndex;
|
|
7513
7406
|
varying float vObjectIndex;
|
|
7514
7407
|
|
|
@@ -7516,7 +7409,7 @@ void main() {
|
|
|
7516
7409
|
vObjectIndex = objectIndex;
|
|
7517
7410
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
7518
7411
|
}
|
|
7519
|
-
`,
|
|
7412
|
+
`, pn = `
|
|
7520
7413
|
precision highp float;
|
|
7521
7414
|
varying float vObjectIndex;
|
|
7522
7415
|
|
|
@@ -7532,14 +7425,14 @@ void main() {
|
|
|
7532
7425
|
gl_FragColor = vec4(packIndex(vObjectIndex), 1.0);
|
|
7533
7426
|
}
|
|
7534
7427
|
`;
|
|
7535
|
-
class
|
|
7428
|
+
class mn extends Zt {
|
|
7536
7429
|
constructor(e, t, i, s) {
|
|
7537
|
-
super(), this.excludeObjects = [], this.bypass = !1, this.scene = e, this.camera = t, this.resolution = i || new
|
|
7430
|
+
super(), this.excludeObjects = [], this.bypass = !1, this.scene = e, this.camera = t, this.resolution = i || new N(window.innerWidth, window.innerHeight), this.options = { ...cn, ...s };
|
|
7538
7431
|
const n = {
|
|
7539
|
-
format:
|
|
7540
|
-
type:
|
|
7541
|
-
minFilter:
|
|
7542
|
-
magFilter:
|
|
7432
|
+
format: Wt,
|
|
7433
|
+
type: Ft,
|
|
7434
|
+
minFilter: Ot,
|
|
7435
|
+
magFilter: Ot
|
|
7543
7436
|
};
|
|
7544
7437
|
this.normalTarget = new ue(this.resolution.x, this.resolution.y, {
|
|
7545
7438
|
...n,
|
|
@@ -7555,11 +7448,11 @@ class fn extends Ot {
|
|
|
7555
7448
|
this.resolution.x,
|
|
7556
7449
|
this.resolution.y,
|
|
7557
7450
|
_t
|
|
7558
|
-
), this.objectIdTarget = new ue(this.resolution.x, this.resolution.y, n), this.normalMaterial =
|
|
7559
|
-
vertexShader:
|
|
7560
|
-
fragmentShader:
|
|
7561
|
-
side:
|
|
7562
|
-
}), this.edgeMaterial = new
|
|
7451
|
+
), this.objectIdTarget = new ue(this.resolution.x, this.resolution.y, n), this.normalMaterial = on(), this.depthMaterial = ln(), this.objectIdMaterial = new le({
|
|
7452
|
+
vertexShader: un,
|
|
7453
|
+
fragmentShader: pn,
|
|
7454
|
+
side: ee
|
|
7455
|
+
}), this.edgeMaterial = new le({
|
|
7563
7456
|
uniforms: {
|
|
7564
7457
|
tDiffuse: { value: null },
|
|
7565
7458
|
tDepth: { value: null },
|
|
@@ -7580,9 +7473,9 @@ class fn extends Ot {
|
|
|
7580
7473
|
enableNormalEdges: { value: this.options.enableNormalEdges },
|
|
7581
7474
|
enableObjectIdEdges: { value: this.options.enableObjectIdEdges }
|
|
7582
7475
|
},
|
|
7583
|
-
vertexShader:
|
|
7584
|
-
fragmentShader:
|
|
7585
|
-
}), this.copyMaterial = new
|
|
7476
|
+
vertexShader: hn,
|
|
7477
|
+
fragmentShader: dn
|
|
7478
|
+
}), this.copyMaterial = new le({
|
|
7586
7479
|
uniforms: {
|
|
7587
7480
|
tDiffuse: { value: null }
|
|
7588
7481
|
},
|
|
@@ -7600,7 +7493,7 @@ class fn extends Ot {
|
|
|
7600
7493
|
gl_FragColor = texture2D(tDiffuse, vUv);
|
|
7601
7494
|
}
|
|
7602
7495
|
`
|
|
7603
|
-
}), this.fsQuad = new
|
|
7496
|
+
}), this.fsQuad = new Yt(this.edgeMaterial);
|
|
7604
7497
|
}
|
|
7605
7498
|
/**
|
|
7606
7499
|
* Update options
|
|
@@ -7658,8 +7551,8 @@ class fn extends Ot {
|
|
|
7658
7551
|
this.normalTarget.dispose(), this.depthTarget.dispose(), this.objectIdTarget.dispose(), this.normalMaterial.dispose(), this.depthMaterial.dispose(), this.edgeMaterial.dispose(), this.objectIdMaterial.dispose(), this.copyMaterial.dispose(), this.fsQuad.dispose();
|
|
7659
7552
|
}
|
|
7660
7553
|
}
|
|
7661
|
-
const
|
|
7662
|
-
outlineColor: new
|
|
7554
|
+
const gn = {
|
|
7555
|
+
outlineColor: new B(x.accent),
|
|
7663
7556
|
outlineOpacity: 1,
|
|
7664
7557
|
outlineThickness: 2,
|
|
7665
7558
|
showOccluded: !0,
|
|
@@ -7670,7 +7563,7 @@ void main() {
|
|
|
7670
7563
|
vUv = uv;
|
|
7671
7564
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
7672
7565
|
}
|
|
7673
|
-
`,
|
|
7566
|
+
`, fn = `
|
|
7674
7567
|
precision highp float;
|
|
7675
7568
|
|
|
7676
7569
|
uniform sampler2D tDiffuse; // Original scene
|
|
@@ -7759,9 +7652,9 @@ void main() {
|
|
|
7759
7652
|
gl_FragColor = vec4(finalColor, sceneColor.a);
|
|
7760
7653
|
}
|
|
7761
7654
|
`;
|
|
7762
|
-
class
|
|
7655
|
+
class vn extends Zt {
|
|
7763
7656
|
constructor(e, t, i, s = {}) {
|
|
7764
|
-
super(), this.copyMaterial = null, this.selectionMesh = null, this.hasSelection = !1, this.bypass = !1, this.camera = t, this.resolution = i, this.options = { ...
|
|
7657
|
+
super(), this.copyMaterial = null, this.selectionMesh = null, this.selectionBuffer = null, this.selectionAttribute = null, this.hasSelection = !1, this.bypass = !1, this.camera = t, this.resolution = i, this.options = { ...gn, ...s };
|
|
7765
7658
|
const n = i.clone().multiplyScalar(0.5);
|
|
7766
7659
|
this.maskRenderTarget = new ue(n.x, n.y, {
|
|
7767
7660
|
depthBuffer: !0
|
|
@@ -7769,11 +7662,11 @@ class wn extends Ot {
|
|
|
7769
7662
|
depthBuffer: !0
|
|
7770
7663
|
}), this.maskMaterial = new G({
|
|
7771
7664
|
color: 16777215,
|
|
7772
|
-
side:
|
|
7665
|
+
side: ee,
|
|
7773
7666
|
depthTest: !this.options.showOccluded,
|
|
7774
7667
|
// Disable depth test to capture occluded parts
|
|
7775
7668
|
depthWrite: !0
|
|
7776
|
-
}), this.outlineMaterial = new
|
|
7669
|
+
}), this.outlineMaterial = new le({
|
|
7777
7670
|
uniforms: {
|
|
7778
7671
|
tDiffuse: { value: null },
|
|
7779
7672
|
tMask: { value: this.maskRenderTarget.texture },
|
|
@@ -7787,8 +7680,8 @@ class wn extends Ot {
|
|
|
7787
7680
|
occludedOpacity: { value: this.options.occludedOpacity }
|
|
7788
7681
|
},
|
|
7789
7682
|
vertexShader: Mt,
|
|
7790
|
-
fragmentShader:
|
|
7791
|
-
}), this.selectionGeometry = new
|
|
7683
|
+
fragmentShader: fn
|
|
7684
|
+
}), this.selectionGeometry = new J(), this.maskScene = new ft(), this.fsQuad = new Yt(this.outlineMaterial);
|
|
7792
7685
|
}
|
|
7793
7686
|
/**
|
|
7794
7687
|
* Update selection geometry from buffer elements
|
|
@@ -7796,11 +7689,13 @@ class wn extends Ot {
|
|
|
7796
7689
|
* @param positions - Merged Float32Array of all selected element positions
|
|
7797
7690
|
*/
|
|
7798
7691
|
updateSelectionGeometry(e) {
|
|
7799
|
-
if (
|
|
7800
|
-
this.hasSelection = !1, this.
|
|
7692
|
+
if (!e || e.length === 0) {
|
|
7693
|
+
this.hasSelection = !1, this.selectionGeometry.setDrawRange(0, 0);
|
|
7801
7694
|
return;
|
|
7802
7695
|
}
|
|
7803
|
-
this.hasSelection = !0
|
|
7696
|
+
this.hasSelection = !0;
|
|
7697
|
+
const t = e.length / 3;
|
|
7698
|
+
(!this.selectionBuffer || this.selectionBuffer.length < e.length) && (this.selectionBuffer = new Float32Array(e.length), this.selectionAttribute = new L(this.selectionBuffer, 3), this.selectionGeometry.setAttribute("position", this.selectionAttribute)), this.selectionBuffer.set(e), this.selectionAttribute && (this.selectionAttribute.needsUpdate = !0), this.selectionGeometry.setDrawRange(0, t), this.selectionMesh || (this.selectionMesh = new y(this.selectionGeometry, this.maskMaterial), this.selectionMesh.frustumCulled = !1, this.maskScene.add(this.selectionMesh));
|
|
7804
7699
|
}
|
|
7805
7700
|
/**
|
|
7806
7701
|
* Get whether there's an active selection
|
|
@@ -7816,7 +7711,7 @@ class wn extends Ot {
|
|
|
7816
7711
|
}
|
|
7817
7712
|
render(e, t, i, s, n) {
|
|
7818
7713
|
if (this.bypass) {
|
|
7819
|
-
this.copyMaterial || (this.copyMaterial = new
|
|
7714
|
+
this.copyMaterial || (this.copyMaterial = new le({
|
|
7820
7715
|
uniforms: { tDiffuse: { value: null } },
|
|
7821
7716
|
vertexShader: Mt,
|
|
7822
7717
|
fragmentShader: `
|
|
@@ -7830,7 +7725,7 @@ class wn extends Ot {
|
|
|
7830
7725
|
return;
|
|
7831
7726
|
}
|
|
7832
7727
|
if (!this.hasSelection || !this.enabled || !this.selectionMesh) {
|
|
7833
|
-
this.copyMaterial || (this.copyMaterial = new
|
|
7728
|
+
this.copyMaterial || (this.copyMaterial = new le({
|
|
7834
7729
|
uniforms: { tDiffuse: { value: null } },
|
|
7835
7730
|
vertexShader: Mt,
|
|
7836
7731
|
fragmentShader: `
|
|
@@ -7856,10 +7751,10 @@ class wn extends Ot {
|
|
|
7856
7751
|
this.maskRenderTarget.dispose(), this.maskDepthRenderTarget.dispose(), this.selectionGeometry.dispose(), this.maskMaterial.dispose(), this.outlineMaterial.dispose(), (e = this.copyMaterial) == null || e.dispose(), this.fsQuad.dispose(), this.selectionMesh && this.maskScene.remove(this.selectionMesh);
|
|
7857
7752
|
}
|
|
7858
7753
|
}
|
|
7859
|
-
new
|
|
7860
|
-
class
|
|
7754
|
+
new N(1024, 1024), new B(0);
|
|
7755
|
+
class bn {
|
|
7861
7756
|
constructor(e, t) {
|
|
7862
|
-
this.renderer = e, this.viralViewerApi = t, this.gammaPass = null, this.ssaoPass = null, this.saoPass = null, this.smaaPass = null, this.ssaaPass = null, this.fxaaPass = null, this.taaPass = null, this.sobelPass = null, this.whitePass = null, this.shadowRemovalPass = null, this.outlinePass = null, this.screenSpaceEdgesPass = null, this.selectionOutlinePass = null, this.
|
|
7757
|
+
this.renderer = e, this.viralViewerApi = t, this.gammaPass = null, this.ssaoPass = null, this.saoPass = null, this.smaaPass = null, this.ssaaPass = null, this.fxaaPass = null, this.taaPass = null, this.sobelPass = null, this.whitePass = null, this.shadowRemovalPass = null, this.outlinePass = null, this.screenSpaceEdgesPass = null, this.selectionOutlinePass = null, this.perfChecker = new qs(), this._whiteShader = {
|
|
7863
7758
|
uniforms: {
|
|
7864
7759
|
tDiffuse: { value: null },
|
|
7865
7760
|
shadowTexture: { value: null },
|
|
@@ -7890,15 +7785,15 @@ class yn {
|
|
|
7890
7785
|
}
|
|
7891
7786
|
`
|
|
7892
7787
|
};
|
|
7893
|
-
const i = new
|
|
7788
|
+
const i = new N();
|
|
7894
7789
|
e.getSize(i);
|
|
7895
7790
|
const s = new ue(i.x, i.y, {
|
|
7896
|
-
format:
|
|
7897
|
-
type:
|
|
7791
|
+
format: Wt,
|
|
7792
|
+
type: Ft,
|
|
7898
7793
|
depthBuffer: !0,
|
|
7899
7794
|
stencilBuffer: !1
|
|
7900
7795
|
});
|
|
7901
|
-
s.depthTexture = new At(i.x, i.y, _t), this.composer = new
|
|
7796
|
+
s.depthTexture = new At(i.x, i.y, _t), this.composer = new zi(this.renderer, s), this.composer.setSize(window.innerWidth, window.innerHeight);
|
|
7902
7797
|
}
|
|
7903
7798
|
isWebGL2Available() {
|
|
7904
7799
|
return !!window.WebGL2RenderingContext;
|
|
@@ -7907,7 +7802,7 @@ class yn {
|
|
|
7907
7802
|
this.composer.render();
|
|
7908
7803
|
}
|
|
7909
7804
|
initRenderPass(e, t) {
|
|
7910
|
-
this.renderPass = new
|
|
7805
|
+
this.renderPass = new ji(e, t), this.composer.addPass(this.renderPass);
|
|
7911
7806
|
const i = this.perfChecker.getSpecs();
|
|
7912
7807
|
if (console.log(i), this.perfChecker.canHandleExpensiveEffects()) {
|
|
7913
7808
|
//! this pass cause slow render on weak machine, turn it off when camera moving
|
|
@@ -7917,9 +7812,9 @@ class yn {
|
|
|
7917
7812
|
this.initn8aoPass(e, t);
|
|
7918
7813
|
} else
|
|
7919
7814
|
this.perfChecker.canHandleBasicEffects();
|
|
7920
|
-
this.initScreenSpaceEdgesPass(e, t), this.initSelectionOutlinePass(e, t)
|
|
7815
|
+
this.initScreenSpaceEdgesPass(e, t), this.initSelectionOutlinePass(e, t);
|
|
7921
7816
|
//! this pass slow render too, turn it off when we dont use
|
|
7922
|
-
const s = new
|
|
7817
|
+
const s = new $i();
|
|
7923
7818
|
this.composer.addPass(s);
|
|
7924
7819
|
}
|
|
7925
7820
|
initGammaPass() {
|
|
@@ -7928,7 +7823,7 @@ class yn {
|
|
|
7928
7823
|
//#region N8AOPass
|
|
7929
7824
|
initn8aoPass(e, t) {
|
|
7930
7825
|
//! need to optimize this base on performance
|
|
7931
|
-
this.n8aoPass = new
|
|
7826
|
+
this.n8aoPass = new Bi(e, t), this.n8aoPass.configuration.aoSamples = 16, this.n8aoPass.configuration.denoiseRadius = 16, this.n8aoPass.configuration.intensity = 5, this.n8aoPass.configuration.aoRadius = 10, this.n8aoPass.configuration.quality = "Low", this.n8aoPass.configuration.gammaCorrection = !1, this.n8aoPass.configuration.halfRes = !1, this.n8aoPass.configuration.distanceFalloff = 5, this.n8aoPass.configuration.accumulate = !1, this.n8aoPass.configuration.renderToScreen = !1, this.composer.addPass(this.n8aoPass);
|
|
7932
7827
|
}
|
|
7933
7828
|
enableN8AOPass() {
|
|
7934
7829
|
this.n8aoPass && (this.n8aoPass.setDisplayMode("Combined"), this.n8aoPass.enabled = !0);
|
|
@@ -7945,19 +7840,19 @@ class yn {
|
|
|
7945
7840
|
//#endregion
|
|
7946
7841
|
//#region Anti Aliases Passes
|
|
7947
7842
|
initSMAAPass() {
|
|
7948
|
-
this.smaaPass = new
|
|
7843
|
+
this.smaaPass = new Hi(), this.smaaPass.renderToScreen = !0, this.composer.addPass(this.smaaPass);
|
|
7949
7844
|
}
|
|
7950
7845
|
initSSAAPass(e, t) {
|
|
7951
|
-
this.ssaaPass = new
|
|
7846
|
+
this.ssaaPass = new Ei(e, t), this.ssaaPass.unbiased = !0, this.ssaaPass.sampleLevel = 2, this.composer.addPass(this.ssaaPass);
|
|
7952
7847
|
}
|
|
7953
7848
|
initFXAAPass() {
|
|
7954
|
-
this.fxaaPass = new xt(
|
|
7849
|
+
this.fxaaPass = new xt(Si), this.fxaaPass.uniforms.resolution.value.set(
|
|
7955
7850
|
1 / window.innerWidth,
|
|
7956
7851
|
1 / window.innerHeight
|
|
7957
7852
|
), this.composer.addPass(this.fxaaPass);
|
|
7958
7853
|
}
|
|
7959
7854
|
initTAAPass(e, t) {
|
|
7960
|
-
this.taaPass = new
|
|
7855
|
+
this.taaPass = new Ci(e, t), this.taaPass.sampleLevel = 2, this.taaPass.unbiased = !1, this.composer.addPass(this.taaPass);
|
|
7961
7856
|
}
|
|
7962
7857
|
enableTAA() {
|
|
7963
7858
|
this.taaPass && (this.taaPass.enabled = !0);
|
|
@@ -7968,18 +7863,18 @@ class yn {
|
|
|
7968
7863
|
//#endregion
|
|
7969
7864
|
//#region SAO
|
|
7970
7865
|
initSAOPass(e, t) {
|
|
7971
|
-
this.saoPass = new
|
|
7866
|
+
this.saoPass = new Ai(e, t), this.saoPass.params.saoIntensity = 1e-4, this.saoPass.params.saoKernelRadius = 10, this.composer.addPass(this.saoPass);
|
|
7972
7867
|
}
|
|
7973
7868
|
//#endregion
|
|
7974
7869
|
//#region SSAO
|
|
7975
7870
|
initSSAOPass(e, t) {
|
|
7976
|
-
this.ssaoPass = new
|
|
7871
|
+
this.ssaoPass = new pt(e, t), this.ssaoPass.output = pt.OUTPUT.Default, this.ssaoPass.kernelRadius = 8, this.ssaoPass.minDistance = 1e-5, this.ssaoPass.maxDistance = 0.02, this.ssaoPass.enabled = !0, this.ssaoPass.renderToScreen = !0, this.composer.addPass(this.ssaoPass);
|
|
7977
7872
|
}
|
|
7978
7873
|
enableSSAO() {
|
|
7979
|
-
this.ssaoPass && (this.ssaoPass.output =
|
|
7874
|
+
this.ssaoPass && (this.ssaoPass.output = pt.OUTPUT.SSAO, this.ssaoPass.kernelRadius = 64, this.ssaoPass.minDistance = 1e-3, this.ssaoPass.maxDistance = 0.02);
|
|
7980
7875
|
}
|
|
7981
7876
|
disableSSAO() {
|
|
7982
|
-
this.ssaoPass && (this.ssaoPass.output =
|
|
7877
|
+
this.ssaoPass && (this.ssaoPass.output = pt.OUTPUT.Default, this.ssaoPass.kernelRadius = 1, this.ssaoPass.minDistance = 5e-4, this.ssaoPass.maxDistance = 0.3);
|
|
7983
7878
|
}
|
|
7984
7879
|
//#endregion
|
|
7985
7880
|
//#region SOBEL
|
|
@@ -7999,12 +7894,12 @@ class yn {
|
|
|
7999
7894
|
* - Object ID discontinuity detection (object boundaries)
|
|
8000
7895
|
*/
|
|
8001
7896
|
initScreenSpaceEdgesPass(e, t) {
|
|
8002
|
-
this.screenSpaceEdgesPass = new
|
|
7897
|
+
this.screenSpaceEdgesPass = new mn(
|
|
8003
7898
|
e,
|
|
8004
7899
|
t,
|
|
8005
|
-
new
|
|
7900
|
+
new N(window.innerWidth, window.innerHeight),
|
|
8006
7901
|
{
|
|
8007
|
-
edgeColor: new
|
|
7902
|
+
edgeColor: new B(0),
|
|
8008
7903
|
edgeOpacity: 1,
|
|
8009
7904
|
edgeThickness: 2,
|
|
8010
7905
|
depthMultiplier: 1.5,
|
|
@@ -8055,7 +7950,7 @@ class yn {
|
|
|
8055
7950
|
*/
|
|
8056
7951
|
setScreenSpaceEdgeColor(e) {
|
|
8057
7952
|
if (this.screenSpaceEdgesPass) {
|
|
8058
|
-
const t = typeof e == "number" ? new
|
|
7953
|
+
const t = typeof e == "number" ? new B(e) : e;
|
|
8059
7954
|
this.screenSpaceEdgesPass.setOptions({ edgeColor: t });
|
|
8060
7955
|
}
|
|
8061
7956
|
}
|
|
@@ -8086,7 +7981,7 @@ class yn {
|
|
|
8086
7981
|
*/
|
|
8087
7982
|
setScreenSpaceEdgesPenMode() {
|
|
8088
7983
|
this.screenSpaceEdgesPass && this.screenSpaceEdgesPass.setOptions({
|
|
8089
|
-
edgeColor: new
|
|
7984
|
+
edgeColor: new B(0),
|
|
8090
7985
|
edgeOpacity: 1,
|
|
8091
7986
|
edgeThickness: 1.5
|
|
8092
7987
|
});
|
|
@@ -8096,7 +7991,7 @@ class yn {
|
|
|
8096
7991
|
*/
|
|
8097
7992
|
setScreenSpaceEdgesShadedMode() {
|
|
8098
7993
|
this.screenSpaceEdgesPass && this.screenSpaceEdgesPass.setOptions({
|
|
8099
|
-
edgeColor: new
|
|
7994
|
+
edgeColor: new B(0),
|
|
8100
7995
|
edgeOpacity: 0.8,
|
|
8101
7996
|
edgeThickness: 1.5
|
|
8102
7997
|
});
|
|
@@ -8107,13 +8002,13 @@ class yn {
|
|
|
8107
8002
|
//#endregion
|
|
8108
8003
|
//#region Outline Pass
|
|
8109
8004
|
initOutlinePass(e, t) {
|
|
8110
|
-
this.outlinePass = new
|
|
8111
|
-
new
|
|
8005
|
+
this.outlinePass = new Ni(
|
|
8006
|
+
new N(window.innerWidth, window.innerHeight),
|
|
8112
8007
|
e,
|
|
8113
8008
|
t,
|
|
8114
8009
|
// TODO : investigate why this effect when render new model
|
|
8115
8010
|
[this.viralViewerApi.viralScene.outlineModel]
|
|
8116
|
-
), this.outlinePass.edgeStrength = 5, this.outlinePass.edgeGlow = 0.4, this.outlinePass.edgeThickness = 2, this.outlinePass.pulsePeriod = 0, this.outlinePass.visibleEdgeColor.set(
|
|
8011
|
+
), this.outlinePass.edgeStrength = 5, this.outlinePass.edgeGlow = 0.4, this.outlinePass.edgeThickness = 2, this.outlinePass.pulsePeriod = 0, this.outlinePass.visibleEdgeColor.set(x.accent), this.outlinePass.hiddenEdgeColor.set(x.accent), this.outlinePass.enabled = !1, this.outlinePass.renderToScreen = !1, this.composer.addPass(this.outlinePass);
|
|
8117
8012
|
}
|
|
8118
8013
|
enableOutline() {
|
|
8119
8014
|
this.outlinePass && (this.outlinePass.enabled = !0, this.outlinePass.renderToScreen = !0);
|
|
@@ -8129,12 +8024,12 @@ class yn {
|
|
|
8129
8024
|
* Cost: 1 extra draw call + 1 fullscreen pass
|
|
8130
8025
|
*/
|
|
8131
8026
|
initSelectionOutlinePass(e, t) {
|
|
8132
|
-
this.selectionOutlinePass = new
|
|
8027
|
+
this.selectionOutlinePass = new vn(
|
|
8133
8028
|
e,
|
|
8134
8029
|
t,
|
|
8135
|
-
new
|
|
8030
|
+
new N(window.innerWidth, window.innerHeight),
|
|
8136
8031
|
{
|
|
8137
|
-
outlineColor: new
|
|
8032
|
+
outlineColor: new B(x.accent),
|
|
8138
8033
|
outlineOpacity: 1,
|
|
8139
8034
|
outlineThickness: 2,
|
|
8140
8035
|
showOccluded: !0,
|
|
@@ -8188,7 +8083,7 @@ class yn {
|
|
|
8188
8083
|
*/
|
|
8189
8084
|
setSelectionOutlineColor(e) {
|
|
8190
8085
|
if (this.selectionOutlinePass) {
|
|
8191
|
-
const t = e instanceof
|
|
8086
|
+
const t = e instanceof B ? e : new B(e);
|
|
8192
8087
|
this.selectionOutlinePass.setOptions({ outlineColor: t });
|
|
8193
8088
|
}
|
|
8194
8089
|
}
|
|
@@ -8199,89 +8094,22 @@ class yn {
|
|
|
8199
8094
|
this.selectionOutlinePass && this.selectionOutlinePass.setOptions({ outlineThickness: e });
|
|
8200
8095
|
}
|
|
8201
8096
|
//#endregion
|
|
8202
|
-
//#region Alpha Selection Outline Pass (Ultra-Fast)
|
|
8203
|
-
/**
|
|
8204
|
-
* Initialize alpha-based selection outline pass
|
|
8205
|
-
* ZERO extra render passes - detects selection via alpha channel in main render
|
|
8206
|
-
* Cost: 1 fullscreen pass only (no geometry re-render)
|
|
8207
|
-
*
|
|
8208
|
-
* This is MUCH faster than SelectionOutlinePass for large selections
|
|
8209
|
-
* Works with both batched meshes (per-vertex alpha) and instanced meshes (per-instance alpha)
|
|
8210
|
-
*/
|
|
8211
|
-
initAlphaSelectionOutlinePass() {
|
|
8212
|
-
this.alphaSelectionOutlinePass = new ln(
|
|
8213
|
-
new z(window.innerWidth, window.innerHeight),
|
|
8214
|
-
{
|
|
8215
|
-
outlineColor: new k(y.accent),
|
|
8216
|
-
outlineOpacity: 1,
|
|
8217
|
-
outlineThickness: 2
|
|
8218
|
-
}
|
|
8219
|
-
), this.alphaSelectionOutlinePass.enabled = !0, this.composer.addPass(this.alphaSelectionOutlinePass);
|
|
8220
|
-
}
|
|
8221
|
-
/**
|
|
8222
|
-
* Enable alpha selection outline rendering
|
|
8223
|
-
*/
|
|
8224
|
-
enableAlphaSelectionOutline() {
|
|
8225
|
-
this.alphaSelectionOutlinePass && (this.alphaSelectionOutlinePass.enabled = !0);
|
|
8226
|
-
}
|
|
8227
|
-
/**
|
|
8228
|
-
* Disable alpha selection outline rendering
|
|
8229
|
-
*/
|
|
8230
|
-
disableAlphaSelectionOutline() {
|
|
8231
|
-
this.alphaSelectionOutlinePass && (this.alphaSelectionOutlinePass.enabled = !1);
|
|
8232
|
-
}
|
|
8233
|
-
/**
|
|
8234
|
-
* Bypass alpha selection outline (instant, zero cost)
|
|
8235
|
-
*/
|
|
8236
|
-
bypassAlphaSelectionOutline() {
|
|
8237
|
-
this.alphaSelectionOutlinePass && (this.alphaSelectionOutlinePass.bypass = !0);
|
|
8238
|
-
}
|
|
8239
|
-
/**
|
|
8240
|
-
* Resume alpha selection outline after bypassing
|
|
8241
|
-
*/
|
|
8242
|
-
resumeAlphaSelectionOutline() {
|
|
8243
|
-
this.alphaSelectionOutlinePass && (this.alphaSelectionOutlinePass.bypass = !1);
|
|
8244
|
-
}
|
|
8245
|
-
/**
|
|
8246
|
-
* Set alpha selection outline color
|
|
8247
|
-
*/
|
|
8248
|
-
setAlphaSelectionOutlineColor(e) {
|
|
8249
|
-
if (this.alphaSelectionOutlinePass) {
|
|
8250
|
-
const t = e instanceof k ? e : new k(e);
|
|
8251
|
-
this.alphaSelectionOutlinePass.setOptions({ outlineColor: t });
|
|
8252
|
-
}
|
|
8253
|
-
}
|
|
8254
|
-
/**
|
|
8255
|
-
* Set alpha selection outline thickness in pixels
|
|
8256
|
-
*/
|
|
8257
|
-
setAlphaSelectionOutlineThickness(e) {
|
|
8258
|
-
this.alphaSelectionOutlinePass && this.alphaSelectionOutlinePass.setOptions({ outlineThickness: e });
|
|
8259
|
-
}
|
|
8260
|
-
/**
|
|
8261
|
-
* Update alpha selection outline state
|
|
8262
|
-
* Call this when selection changes
|
|
8263
|
-
* @param hasSelection - Whether there's any selection active
|
|
8264
|
-
*/
|
|
8265
|
-
updateAlphaSelectionOutline(e) {
|
|
8266
|
-
this.alphaSelectionOutlinePass && (this.alphaSelectionOutlinePass.hasSelection = e);
|
|
8267
|
-
}
|
|
8268
|
-
//#endregion
|
|
8269
8097
|
}
|
|
8270
|
-
class
|
|
8098
|
+
class wn {
|
|
8271
8099
|
constructor(e) {
|
|
8272
|
-
this.viralViewerApi = e, this.renderer = new
|
|
8100
|
+
this.viralViewerApi = e, this.renderer = new Gt({
|
|
8273
8101
|
alpha: !0,
|
|
8274
8102
|
antialias: !0,
|
|
8275
8103
|
stencil: !0,
|
|
8276
8104
|
logarithmicDepthBuffer: !0,
|
|
8277
8105
|
powerPreference: "high-performance",
|
|
8278
8106
|
preserveDrawingBuffer: !0
|
|
8279
|
-
}), this._t = 0, this._lastSpatialStatsTime = 0, this.renderTimeout = null, this.jitterOffsets = [], this.jitterIndex = 0, this.size = new
|
|
8107
|
+
}), this._t = 0, this._lastSpatialStatsTime = 0, this.renderTimeout = null, this.jitterOffsets = [], this.jitterIndex = 0, this.size = new N(window.innerWidth, window.innerHeight), this.samples = 4;
|
|
8280
8108
|
const t = this.renderer.getContext(), i = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS);
|
|
8281
8109
|
console.log("Max Fragment Uniform Vectors ->", i), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.setSize(
|
|
8282
8110
|
this.viralViewerApi.targetElement.offsetWidth,
|
|
8283
8111
|
this.viralViewerApi.targetElement.offsetHeight
|
|
8284
|
-
), this.renderer.outputColorSpace =
|
|
8112
|
+
), this.renderer.outputColorSpace = hi, this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = di, this.renderer.shadowMap.autoUpdate = !1, this.renderer.shadowMap.needsUpdate = !0, this.renderer.info.autoReset = !1, this.viralViewerApi.targetElement.appendChild(this.renderer.domElement), this.viralViewerApi.options.enablePostProcessing !== !1 && (this.postProcessingRenderer = new bn(
|
|
8285
8113
|
this.renderer,
|
|
8286
8114
|
this.viralViewerApi
|
|
8287
8115
|
)), this.jitterOffsets = this.generateJitterOffsets(), this.viralViewerApi.emit(R.LOADED_RENDERER);
|
|
@@ -8372,7 +8200,7 @@ class xn {
|
|
|
8372
8200
|
o
|
|
8373
8201
|
);
|
|
8374
8202
|
} else
|
|
8375
|
-
i instanceof
|
|
8203
|
+
i instanceof He && (i.projectionMatrix.elements[8] = e / this.size.x, i.projectionMatrix.elements[9] = t / this.size.y);
|
|
8376
8204
|
this.jitterIndex = (this.jitterIndex + 1) % this.samples;
|
|
8377
8205
|
}
|
|
8378
8206
|
// Generates jitter offsets for the specified number of samples
|
|
@@ -8396,19 +8224,19 @@ const de = {
|
|
|
8396
8224
|
outlineModel: "viral_outline_model",
|
|
8397
8225
|
sunlight: "viral_sunlight"
|
|
8398
8226
|
};
|
|
8399
|
-
class
|
|
8227
|
+
class yn {
|
|
8400
8228
|
constructor(e) {
|
|
8401
|
-
this.viralViewerApi = e, this.scene = new
|
|
8229
|
+
this.viralViewerApi = e, this.scene = new ft(), this.objects = [], this.models = [], this.bimWorld = new ts(), this.outlineModel = new y(), this.hideables = [], this.selectables = [], this.edges = [], this.sunLight = null, this.lights = [], this.transformControls = null, this.lightHelpers = [], this.fullScreenQuadMaterial = new G({
|
|
8402
8230
|
map: null,
|
|
8403
8231
|
// Use the render target's texture
|
|
8404
|
-
side:
|
|
8232
|
+
side: ee
|
|
8405
8233
|
}), this.fullScreenQuad = null, this.viralViewerApi.emit(R.LOADED_SCENE), this.bimWorld.name = de.mergedModel, this.addModel(this.bimWorld), this.outlineModel.name = de.outlineModel, this.outlineModel.renderOrder = 0, this.addModel(this.outlineModel);
|
|
8406
|
-
const t = new
|
|
8234
|
+
const t = new Dt(5, 32, 32), i = new K({
|
|
8407
8235
|
color: 16768256,
|
|
8408
8236
|
emissive: 16755200,
|
|
8409
8237
|
emissiveIntensity: 1
|
|
8410
8238
|
});
|
|
8411
|
-
this.sunSphere = new
|
|
8239
|
+
this.sunSphere = new y(t, i), this.sunSphere.visible = !1, this.addObject(this.sunSphere), this.addLights(), this.addPivotPoint(), this.viralViewerApi.options.isDev && this.addAxes();
|
|
8412
8240
|
}
|
|
8413
8241
|
//#region Add Main Objects
|
|
8414
8242
|
addObject(e) {
|
|
@@ -8434,28 +8262,28 @@ class Mn {
|
|
|
8434
8262
|
}
|
|
8435
8263
|
//#region lights
|
|
8436
8264
|
addLights() {
|
|
8437
|
-
const e = new
|
|
8265
|
+
const e = new ut(16777215, 1);
|
|
8438
8266
|
e.position.set(1, 1, 1).normalize();
|
|
8439
|
-
const t = new
|
|
8267
|
+
const t = new ut(16777215, 1.5);
|
|
8440
8268
|
t.position.set(0, -1, 0).normalize();
|
|
8441
|
-
const i = new
|
|
8269
|
+
const i = new ut(16777215, 1);
|
|
8442
8270
|
i.position.set(-1, 1, -1).normalize();
|
|
8443
|
-
const s = new
|
|
8444
|
-
this.sunLight = new
|
|
8445
|
-
const n = new
|
|
8271
|
+
const s = new ui(16777215, 1);
|
|
8272
|
+
this.sunLight = new ut(16777215, 4), this.sunLight.name = de.sunlight, this.sunLight.castShadow = !1, this.sunLight.position.set(50, 50, 50), this.sunLight.shadow.camera.top = 50, this.sunLight.shadow.camera.bottom = -50, this.sunLight.shadow.camera.left = -50, this.sunLight.shadow.camera.right = 50, this.sunLight.shadow.mapSize.x = 2048, this.sunLight.shadow.mapSize.y = 2048, this.sunLight.shadow.camera.near = 5, this.sunLight.shadow.camera.far = 350, this.sunLight.shadow.bias = -1e-3, this.sunLight.shadow.radius = 2, this.sunLight.visible = !0;
|
|
8273
|
+
const n = new pi(this.sunLight.shadow.camera);
|
|
8446
8274
|
n.visible = !1, this.addObject(e), this.addObject(t), this.addObject(i), this.addObject(s), this.addObject(this.sunLight), this.addObject(n), this.lights.push(e), this.lights.push(t), this.lights.push(i), this.lights.push(s), this.lights.push(this.sunLight), this.lightHelpers.push(n);
|
|
8447
8275
|
}
|
|
8448
8276
|
//#endregion
|
|
8449
8277
|
addPivotPoint() {
|
|
8450
|
-
const e = new
|
|
8451
|
-
color: D.hexToThreejsColor(
|
|
8278
|
+
const e = new Dt(1, 16, 16), t = new G({
|
|
8279
|
+
color: D.hexToThreejsColor(x.accent)
|
|
8452
8280
|
// transparent: true,
|
|
8453
8281
|
// opacity: 0.5,
|
|
8454
|
-
}), i = new
|
|
8282
|
+
}), i = new y(e, t);
|
|
8455
8283
|
i.name = de.pivotPoint, i.visible = !1, this.addObject(i);
|
|
8456
8284
|
}
|
|
8457
8285
|
addTransformControls(e) {
|
|
8458
|
-
this.transformControls = new
|
|
8286
|
+
this.transformControls = new Fi(
|
|
8459
8287
|
e,
|
|
8460
8288
|
this.viralViewerApi.viralRenderer.renderer.domElement
|
|
8461
8289
|
);
|
|
@@ -8472,16 +8300,16 @@ class Mn {
|
|
|
8472
8300
|
//#region Helper
|
|
8473
8301
|
addCube() {
|
|
8474
8302
|
if (this.scene) {
|
|
8475
|
-
const e = new
|
|
8476
|
-
new
|
|
8477
|
-
new
|
|
8303
|
+
const e = new y(
|
|
8304
|
+
new Tt(1, 1, 1),
|
|
8305
|
+
new K({ color: 16711680 })
|
|
8478
8306
|
);
|
|
8479
8307
|
e.castShadow = !0, e.receiveShadow = !0, this.addObject(e);
|
|
8480
8308
|
}
|
|
8481
8309
|
}
|
|
8482
8310
|
addAxes() {
|
|
8483
8311
|
if (this.scene) {
|
|
8484
|
-
const e = new
|
|
8312
|
+
const e = new mi(10);
|
|
8485
8313
|
e.renderOrder = 999, e.material.depthTest = !1, e.material.depthWrite = !1, this.addObject(e);
|
|
8486
8314
|
}
|
|
8487
8315
|
}
|
|
@@ -8495,20 +8323,20 @@ class Mn {
|
|
|
8495
8323
|
* Add box helper to check mesh
|
|
8496
8324
|
*/
|
|
8497
8325
|
addBoxHelper(e) {
|
|
8498
|
-
const t = new
|
|
8326
|
+
const t = new gi(e, 16711680);
|
|
8499
8327
|
this.addObject(t);
|
|
8500
8328
|
}
|
|
8501
8329
|
addBox3Helper(e) {
|
|
8502
|
-
const t = new
|
|
8330
|
+
const t = new fi(e, 16776960);
|
|
8503
8331
|
this.addObject(t);
|
|
8504
8332
|
}
|
|
8505
8333
|
addFullscreenQuad() {
|
|
8506
|
-
const e = new
|
|
8507
|
-
this.fullScreenQuad = new
|
|
8334
|
+
const e = new ae(window.innerWidth, window.innerHeight);
|
|
8335
|
+
this.fullScreenQuad = new y(e, this.fullScreenQuadMaterial), this.addObject(this.fullScreenQuad);
|
|
8508
8336
|
}
|
|
8509
8337
|
//#endregion
|
|
8510
8338
|
}
|
|
8511
|
-
const
|
|
8339
|
+
const zt = new Float32Array([
|
|
8512
8340
|
// Bottom face (Y = -1)
|
|
8513
8341
|
-1,
|
|
8514
8342
|
-1,
|
|
@@ -8584,7 +8412,7 @@ const jt = new Float32Array([
|
|
|
8584
8412
|
-1,
|
|
8585
8413
|
1,
|
|
8586
8414
|
1
|
|
8587
|
-
]),
|
|
8415
|
+
]), xn = [
|
|
8588
8416
|
new E(1, 0, 0),
|
|
8589
8417
|
// 0: +X
|
|
8590
8418
|
new E(-1, 0, 0),
|
|
@@ -8597,9 +8425,9 @@ const jt = new Float32Array([
|
|
|
8597
8425
|
// 4: +Z
|
|
8598
8426
|
new E(0, 0, -1)
|
|
8599
8427
|
// 5: -Z
|
|
8600
|
-
],
|
|
8428
|
+
], Ge = class Ge {
|
|
8601
8429
|
constructor(e) {
|
|
8602
|
-
this.viralViewerApi = e, this._isGenerated = !1, this._isActive = !1, this._isVisible = !1, this._initialCenter = new E(), this._initialHalfSize = new E(), this._center = new E(), this._halfSize = new E(), this._boxOutline = null, this._outlineGeometry = null, this._outlineMaterial = null, this._hitBoxMesh = null, this._facePlaneMesh = null, this._dragAnchor = new
|
|
8430
|
+
this.viralViewerApi = e, this._isGenerated = !1, this._isActive = !1, this._isVisible = !1, this._initialCenter = new E(), this._initialHalfSize = new E(), this._center = new E(), this._halfSize = new E(), this._boxOutline = null, this._outlineGeometry = null, this._outlineMaterial = null, this._hitBoxMesh = null, this._facePlaneMesh = null, this._dragAnchor = new $t(), this._selectedFaceIndex = -1, this._clippingPlanes = [], this._transformedEdges = new Float32Array(72);
|
|
8603
8431
|
}
|
|
8604
8432
|
/** Whether section box is active (clipping enabled) */
|
|
8605
8433
|
get isActive() {
|
|
@@ -8689,7 +8517,7 @@ const jt = new Float32Array([
|
|
|
8689
8517
|
}
|
|
8690
8518
|
const i = this._getFaceCenter(e);
|
|
8691
8519
|
this._dragAnchor.position.copy(i), this._dragAnchor.updateMatrixWorld(!0), t.attach(this._dragAnchor), t.setMode("translate");
|
|
8692
|
-
const s =
|
|
8520
|
+
const s = xn[e];
|
|
8693
8521
|
t.showX = Math.abs(s.x) > 0.5, t.showY = Math.abs(s.y) > 0.5, t.showZ = Math.abs(s.z) > 0.5, this._positionFaceHighlight(e);
|
|
8694
8522
|
}
|
|
8695
8523
|
onDragAnchorChanged() {
|
|
@@ -8723,46 +8551,46 @@ const jt = new Float32Array([
|
|
|
8723
8551
|
}
|
|
8724
8552
|
// --- Private methods ---
|
|
8725
8553
|
_initFromBoundingBox() {
|
|
8726
|
-
const e = new
|
|
8554
|
+
const e = new z().setFromObject(this.viralViewerApi.viralScene.bimWorld);
|
|
8727
8555
|
e.getCenter(this._center), e.getSize(this._halfSize).multiplyScalar(0.5), this._initialCenter.copy(this._center), this._initialHalfSize.copy(this._halfSize), this._isGenerated = !0;
|
|
8728
8556
|
}
|
|
8729
8557
|
_createVisuals() {
|
|
8730
8558
|
if (this._boxOutline)
|
|
8731
8559
|
return;
|
|
8732
|
-
this._outlineMaterial = new
|
|
8733
|
-
color: D.hexToThreejsColor(
|
|
8560
|
+
this._outlineMaterial = new Qt({
|
|
8561
|
+
color: D.hexToThreejsColor(x.accent),
|
|
8734
8562
|
linewidth: 2,
|
|
8735
|
-
resolution: new
|
|
8563
|
+
resolution: new N(window.innerWidth, window.innerHeight),
|
|
8736
8564
|
worldUnits: !1,
|
|
8737
8565
|
transparent: !1,
|
|
8738
8566
|
depthTest: !0,
|
|
8739
8567
|
depthWrite: !0
|
|
8740
|
-
}), this._outlineGeometry = new
|
|
8741
|
-
const e = new
|
|
8568
|
+
}), this._outlineGeometry = new Ui(), this._outlineGeometry.setPositions(zt), this._boxOutline = new Gi(this._outlineGeometry, this._outlineMaterial), this._boxOutline.name = "SectionBoxOutline", this._boxOutline.renderOrder = 0, this._boxOutline.frustumCulled = !1, this.viralViewerApi.viralScene.addObject(this._boxOutline);
|
|
8569
|
+
const e = new Tt(2, 2, 2), t = new G({
|
|
8742
8570
|
transparent: !0,
|
|
8743
8571
|
opacity: 0,
|
|
8744
|
-
side:
|
|
8572
|
+
side: ee,
|
|
8745
8573
|
depthWrite: !1,
|
|
8746
8574
|
depthTest: !1
|
|
8747
8575
|
});
|
|
8748
|
-
this._hitBoxMesh = new
|
|
8576
|
+
this._hitBoxMesh = new y(e, t), this._hitBoxMesh.name = "SectionBoxHit", this._hitBoxMesh.visible = !0, this._hitBoxMesh.renderOrder = -1, this.viralViewerApi.viralScene.addObject(this._hitBoxMesh);
|
|
8749
8577
|
const i = new G({
|
|
8750
|
-
color: D.hexToThreejsColor(
|
|
8578
|
+
color: D.hexToThreejsColor(x.accent),
|
|
8751
8579
|
transparent: !0,
|
|
8752
8580
|
opacity: 0.15,
|
|
8753
|
-
side:
|
|
8581
|
+
side: ee,
|
|
8754
8582
|
depthWrite: !1,
|
|
8755
8583
|
depthTest: !1,
|
|
8756
8584
|
polygonOffset: !0,
|
|
8757
8585
|
polygonOffsetFactor: 1,
|
|
8758
8586
|
polygonOffsetUnits: 1
|
|
8759
8587
|
});
|
|
8760
|
-
this._facePlaneMesh = new
|
|
8588
|
+
this._facePlaneMesh = new y(new ae(1, 1), i), this._facePlaneMesh.name = "SectionBoxFaceHighlight", this._facePlaneMesh.visible = !1, this._facePlaneMesh.renderOrder = 997, this.viralViewerApi.viralScene.addObject(this._facePlaneMesh), this._dragAnchor.name = "SectionBoxDragAnchor", this.viralViewerApi.viralScene.scene.add(this._dragAnchor);
|
|
8761
8589
|
}
|
|
8762
8590
|
_updateVisuals() {
|
|
8763
8591
|
if (!this._boxOutline || !this._outlineGeometry || !this._hitBoxMesh)
|
|
8764
8592
|
return;
|
|
8765
|
-
const e =
|
|
8593
|
+
const e = Ge.VISUAL_INSET, t = this._center.x, i = this._center.y, s = this._center.z, n = this._halfSize.x * (1 - e), r = this._halfSize.y * (1 - e), o = this._halfSize.z * (1 - e), a = zt, l = this._transformedEdges;
|
|
8766
8594
|
for (let c = 0; c < 72; c += 3)
|
|
8767
8595
|
l[c] = t + n * a[c], l[c + 1] = i + r * a[c + 1], l[c + 2] = s + o * a[c + 2];
|
|
8768
8596
|
if (this._outlineGeometry.setPositions(l), this._boxOutline.computeLineDistances(), this._boxOutline.geometry.computeBoundingSphere(), this._hitBoxMesh.position.copy(this._center), this._hitBoxMesh.scale.copy(this._halfSize), this._hitBoxMesh.updateMatrixWorld(!0), this._outlineMaterial) {
|
|
@@ -8812,7 +8640,7 @@ const jt = new Float32Array([
|
|
|
8812
8640
|
_positionFaceHighlight(e) {
|
|
8813
8641
|
if (!this._facePlaneMesh)
|
|
8814
8642
|
return;
|
|
8815
|
-
const t = this._center, i =
|
|
8643
|
+
const t = this._center, i = Ge.VISUAL_INSET, s = this._halfSize.x * (1 - i), n = this._halfSize.y * (1 - i), r = this._halfSize.z * (1 - i);
|
|
8816
8644
|
switch (this._facePlaneMesh.visible = !0, this._facePlaneMesh.rotation.set(0, 0, 0), e) {
|
|
8817
8645
|
case 0:
|
|
8818
8646
|
this._facePlaneMesh.scale.set(r * 2, n * 2, 1), this._facePlaneMesh.position.set(t.x + s, t.y, t.z), this._facePlaneMesh.rotation.y = Math.PI / 2;
|
|
@@ -8862,8 +8690,8 @@ const jt = new Float32Array([
|
|
|
8862
8690
|
);
|
|
8863
8691
|
}
|
|
8864
8692
|
};
|
|
8865
|
-
|
|
8866
|
-
let Vt =
|
|
8693
|
+
Ge.VISUAL_INSET = 2e-3;
|
|
8694
|
+
let Vt = Ge;
|
|
8867
8695
|
var We = () => {
|
|
8868
8696
|
var g = 0, e = document.createElement("div");
|
|
8869
8697
|
e.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", e.addEventListener(
|
|
@@ -8942,14 +8770,14 @@ We.Panel = (g, e, t) => {
|
|
|
8942
8770
|
}
|
|
8943
8771
|
};
|
|
8944
8772
|
};
|
|
8945
|
-
class
|
|
8773
|
+
class Mn {
|
|
8946
8774
|
constructor(e) {
|
|
8947
8775
|
this.viralViewerApi = e, this.stats = null, this.viralViewerApi.targetElement && (this.stats = We(), this.stats.showPanel(0), this.viralViewerApi.targetElement.appendChild(this.stats.dom));
|
|
8948
8776
|
}
|
|
8949
8777
|
}
|
|
8950
|
-
class
|
|
8778
|
+
class En {
|
|
8951
8779
|
constructor(e) {
|
|
8952
|
-
this.viralViewerApi = e, this._selectionOutlineEnabled = !0, this.exceptElements = [], this.isolateModelId = "0", this.sunConfiguration =
|
|
8780
|
+
this.viralViewerApi = e, this._selectionOutlineEnabled = !0, this._outlineUpdateScheduled = !1, this.exceptElements = [], this.isolateModelId = "0", this.sunConfiguration = ss, this._ground = null, this.opacity = 1, this._fog = new vi(13421772, 1, 1e3), this.rainGeometry = new J(), this.rain = null, this._isGeneratedRain = !1, this.ghostMode = !0, this._batchColors = /* @__PURE__ */ new Map(), this._originalBatchMaterials = /* @__PURE__ */ new Map(), this._batchVisualizationEnabled = !1, this.showHidePercentage = 100, this.randomColor = 100;
|
|
8953
8781
|
}
|
|
8954
8782
|
/**
|
|
8955
8783
|
* show all elements and reset back to normal visualization
|
|
@@ -9008,7 +8836,7 @@ class Cn {
|
|
|
9008
8836
|
* Select elements (replaces current selection)
|
|
9009
8837
|
*/
|
|
9010
8838
|
selectElements(e) {
|
|
9011
|
-
e.length > 0 && (this.viralViewerApi.emit(R.SELECT_ELEMENTS, e), this.viralViewerApi.viralScene.bimWorld.select(e, this.exceptElements), this.
|
|
8839
|
+
e.length > 0 && (this.viralViewerApi.emit(R.SELECT_ELEMENTS, e), this.viralViewerApi.viralScene.bimWorld.select(e, this.exceptElements), this.scheduleOutlineUpdate());
|
|
9012
8840
|
}
|
|
9013
8841
|
/**
|
|
9014
8842
|
* Add elements to current selection (multi-select with Shift)
|
|
@@ -9027,13 +8855,13 @@ class Cn {
|
|
|
9027
8855
|
) || s.push(r);
|
|
9028
8856
|
});
|
|
9029
8857
|
const n = [...s, ...i];
|
|
9030
|
-
n.length > 0 ? (this.viralViewerApi.viralScene.bimWorld.select(n, this.exceptElements), this.
|
|
8858
|
+
n.length > 0 ? (this.viralViewerApi.viralScene.bimWorld.select(n, this.exceptElements), this.scheduleOutlineUpdate()) : this.unselectElements();
|
|
9031
8859
|
}
|
|
9032
8860
|
/**
|
|
9033
8861
|
* Unselect all elements
|
|
9034
8862
|
*/
|
|
9035
8863
|
unselectElements() {
|
|
9036
|
-
this.viralViewerApi.viralScene.bimWorld.unselect(), this.viralViewerApi.emit(R.UNSELECT_ELEMENTS), this.updateSelectionOutline(), this.
|
|
8864
|
+
this.viralViewerApi.viralScene.bimWorld.unselect(), this.viralViewerApi.emit(R.UNSELECT_ELEMENTS), this.updateSelectionOutline(), this.viralViewerApi.viralRenderer.render();
|
|
9037
8865
|
}
|
|
9038
8866
|
selectAllElements() {
|
|
9039
8867
|
console.time("⏱️ selectAllElements - gathering elements");
|
|
@@ -9073,15 +8901,15 @@ class Cn {
|
|
|
9073
8901
|
this.viralViewerApi.viralScene.sunLight && (this.viralViewerApi.viralScene.sunLight.castShadow = !1), this.viralViewerApi.viralRenderer.render();
|
|
9074
8902
|
}
|
|
9075
8903
|
_adjustLightForMesh(e, t) {
|
|
9076
|
-
const i = new
|
|
8904
|
+
const i = new z().setFromObject(e), s = i.min, n = i.max, r = s.distanceTo(n), o = i.getCenter(new E()), a = t.shadow.camera;
|
|
9077
8905
|
a.left = -r / 2, a.right = r / 2, a.top = r / 2, a.bottom = -r / 2, a.near = 0.1, a.far = r + t.position.distanceTo(o), t.position.set(o.x + r / 2, o.y + r / 2, o.z + r / 2), t.target.position.copy(o), t.shadow.camera.updateProjectionMatrix(), t.castShadow = !0;
|
|
9078
8906
|
}
|
|
9079
8907
|
_updateDirectLights(e, t) {
|
|
9080
8908
|
const i = D.mergeBoundingBoxes(e), s = i.min, n = i.max;
|
|
9081
8909
|
s.distanceTo(n);
|
|
9082
8910
|
const r = i.getCenter(new E()), o = this.sunConfiguration.elevation, a = this.sunConfiguration.azimuth, l = this.sunConfiguration.radius || 0;
|
|
9083
|
-
this.sunConfiguration.castShadow !== void 0 && (t.castShadow = this.sunConfiguration.castShadow), this.sunConfiguration.intensity !== void 0 && (t.intensity = this.sunConfiguration.intensity), t.color = new
|
|
9084
|
-
const c = i.getBoundingSphere(new
|
|
8911
|
+
this.sunConfiguration.castShadow !== void 0 && (t.castShadow = this.sunConfiguration.castShadow), this.sunConfiguration.intensity !== void 0 && (t.intensity = this.sunConfiguration.intensity), t.color = new B(this.sunConfiguration.color), this.sunConfiguration.enabled !== void 0 && (t.visible = this.sunConfiguration.enabled), t.position.copy(r);
|
|
8912
|
+
const c = i.getBoundingSphere(new Ht()), h = new jt(c.radius + l, o, a);
|
|
9085
8913
|
t.position.setFromSpherical(h), t.position.add(r), t.updateWorldMatrix(!0, !0), t.shadow.updateMatrices(t), this._updateLightShadowCamera(t, i), this.viralViewerApi.viralScene.sunSphere.position.copy(t.position);
|
|
9086
8914
|
}
|
|
9087
8915
|
_updateLightShadowCamera(e, t) {
|
|
@@ -9096,7 +8924,7 @@ class Cn {
|
|
|
9096
8924
|
new E(s.x, s.y, s.z)
|
|
9097
8925
|
];
|
|
9098
8926
|
n.forEach((o) => o.applyMatrix4(e.shadow.camera.matrixWorldInverse));
|
|
9099
|
-
const r = new
|
|
8927
|
+
const r = new z().setFromPoints(n);
|
|
9100
8928
|
e.shadow.camera.left = r.min.x, e.shadow.camera.right = r.max.x, e.shadow.camera.top = r.min.y, e.shadow.camera.bottom = r.max.y, e.shadow.camera.near = Math.abs(r.max.z), e.shadow.camera.far = Math.abs(r.min.z), e.shadow.camera.updateProjectionMatrix(), this.viralViewerApi.viralRenderer.renderer.shadowMap.needsUpdate = !0;
|
|
9101
8929
|
}
|
|
9102
8930
|
//#endregion
|
|
@@ -9177,7 +9005,7 @@ class Cn {
|
|
|
9177
9005
|
enableAllWhite() {
|
|
9178
9006
|
this.viralViewerApi.viralMaterialManager.mergeMaterials.forEach(
|
|
9179
9007
|
(e) => {
|
|
9180
|
-
e.vertexColors = !1, e.color = new
|
|
9008
|
+
e.vertexColors = !1, e.color = new B(16448250), e.needsUpdate = !0;
|
|
9181
9009
|
}
|
|
9182
9010
|
), this.viralViewerApi.viralRenderer.render();
|
|
9183
9011
|
}
|
|
@@ -9210,18 +9038,18 @@ class Cn {
|
|
|
9210
9038
|
if (this._ground)
|
|
9211
9039
|
this._ground.visible = !0, this.viralViewerApi.viralRenderer.render();
|
|
9212
9040
|
else {
|
|
9213
|
-
let t = new
|
|
9041
|
+
let t = new z();
|
|
9214
9042
|
if (e)
|
|
9215
|
-
t = new
|
|
9043
|
+
t = new z().setFromObject(e);
|
|
9216
9044
|
else {
|
|
9217
9045
|
const a = [this.viralViewerApi.viralScene.bimWorld.bounds];
|
|
9218
9046
|
t = D.mergeBoundingBoxes(a);
|
|
9219
9047
|
}
|
|
9220
9048
|
const i = new E();
|
|
9221
9049
|
t.getSize(i);
|
|
9222
|
-
const s = t.max.x - t.min.x, n = t.max.z - t.min.z, r = t.min.y, o = new
|
|
9050
|
+
const s = t.max.x - t.min.x, n = t.max.z - t.min.z, r = t.min.y, o = new le({
|
|
9223
9051
|
uniforms: {
|
|
9224
|
-
color: { value: new
|
|
9052
|
+
color: { value: new B(0) },
|
|
9225
9053
|
opacity: { value: 0.5 }
|
|
9226
9054
|
},
|
|
9227
9055
|
vertexShader: `
|
|
@@ -9243,8 +9071,8 @@ class Cn {
|
|
|
9243
9071
|
`,
|
|
9244
9072
|
transparent: !0
|
|
9245
9073
|
});
|
|
9246
|
-
this._ground = new
|
|
9247
|
-
new
|
|
9074
|
+
this._ground = new y(
|
|
9075
|
+
new ae(s * 1.5, n * 1.5),
|
|
9248
9076
|
o
|
|
9249
9077
|
// Semi-transparent shadow material
|
|
9250
9078
|
), this._ground.rotation.x = -Math.PI / 2, this._ground.position.set(
|
|
@@ -9284,9 +9112,9 @@ class Cn {
|
|
|
9284
9112
|
for (let i = 0; i < t.length; i++) {
|
|
9285
9113
|
const s = t[i];
|
|
9286
9114
|
if (s.buffer) {
|
|
9287
|
-
const n = new
|
|
9115
|
+
const n = new J();
|
|
9288
9116
|
n.setAttribute("position", new L(s.buffer, 3));
|
|
9289
|
-
const r = new
|
|
9117
|
+
const r = new y(
|
|
9290
9118
|
n,
|
|
9291
9119
|
this.viralViewerApi.viralMaterialManager.outlineMaterial
|
|
9292
9120
|
);
|
|
@@ -9306,6 +9134,22 @@ class Cn {
|
|
|
9306
9134
|
const e = this.viralViewerApi.viralScene.bimWorld.getSelectedElementsPositions();
|
|
9307
9135
|
(t = this.viralViewerApi.viralRenderer.postProcessingRenderer) == null || t.updateSelectionOutline(e);
|
|
9308
9136
|
}
|
|
9137
|
+
/**
|
|
9138
|
+
* Schedule outline update for the next animation frame.
|
|
9139
|
+
* Batches multiple rapid selection changes into a single update.
|
|
9140
|
+
* Uses Web Worker to avoid blocking the main thread.
|
|
9141
|
+
*/
|
|
9142
|
+
scheduleOutlineUpdate() {
|
|
9143
|
+
this._outlineUpdateScheduled || (this._outlineUpdateScheduled = !0, requestAnimationFrame(async () => {
|
|
9144
|
+
var t;
|
|
9145
|
+
if (this._outlineUpdateScheduled = !1, !this._selectionOutlineEnabled)
|
|
9146
|
+
return;
|
|
9147
|
+
const e = await this.viralViewerApi.viralScene.bimWorld.getSelectedElementsPositionsAsync();
|
|
9148
|
+
(t = this.viralViewerApi.viralRenderer.postProcessingRenderer) == null || t.updateSelectionOutline(
|
|
9149
|
+
e
|
|
9150
|
+
), this.viralViewerApi.viralRenderer.render();
|
|
9151
|
+
}));
|
|
9152
|
+
}
|
|
9309
9153
|
/**
|
|
9310
9154
|
* Enable selection outline effect
|
|
9311
9155
|
*/
|
|
@@ -9334,83 +9178,24 @@ class Cn {
|
|
|
9334
9178
|
get selectionOutlineEnabled() {
|
|
9335
9179
|
return this._selectionOutlineEnabled;
|
|
9336
9180
|
}
|
|
9337
|
-
/**
|
|
9338
|
-
* Update alpha selection outline state
|
|
9339
|
-
* This is MUCH faster than updateSelectionOutline() - no geometry copying needed
|
|
9340
|
-
*/
|
|
9341
|
-
updateAlphaSelectionOutline() {
|
|
9342
|
-
var t;
|
|
9343
|
-
if (!this._alphaSelectionOutlineEnabled)
|
|
9344
|
-
return;
|
|
9345
|
-
const e = this.viralViewerApi.viralScene.bimWorld.getSelectedElements().length > 0;
|
|
9346
|
-
(t = this.viralViewerApi.viralRenderer.postProcessingRenderer) == null || t.updateAlphaSelectionOutline(
|
|
9347
|
-
e
|
|
9348
|
-
);
|
|
9349
|
-
}
|
|
9350
|
-
/**
|
|
9351
|
-
* Enable alpha selection outline effect
|
|
9352
|
-
* This is the FAST outline mode - constant cost regardless of selection size
|
|
9353
|
-
*/
|
|
9354
|
-
enableAlphaSelectionOutline() {
|
|
9355
|
-
var e;
|
|
9356
|
-
(e = this.viralViewerApi.viralRenderer.postProcessingRenderer) == null || e.enableAlphaSelectionOutline();
|
|
9357
|
-
}
|
|
9358
|
-
/**
|
|
9359
|
-
* Disable alpha selection outline effect
|
|
9360
|
-
*/
|
|
9361
|
-
disableAlphaSelectionOutline() {
|
|
9362
|
-
var e;
|
|
9363
|
-
(e = this.viralViewerApi.viralRenderer.postProcessingRenderer) == null || e.disableAlphaSelectionOutline();
|
|
9364
|
-
}
|
|
9365
|
-
/**
|
|
9366
|
-
* Set whether alpha selection outline mode is enabled
|
|
9367
|
-
* This is the recommended mode for large selections (1000+ elements)
|
|
9368
|
-
* @param enabled - true to enable, false to disable
|
|
9369
|
-
*/
|
|
9370
|
-
setAlphaSelectionOutlineMode(e) {
|
|
9371
|
-
var t;
|
|
9372
|
-
this._alphaSelectionOutlineEnabled = e, e ? (this.enableAlphaSelectionOutline(), this.updateAlphaSelectionOutline()) : ((t = this.viralViewerApi.viralRenderer.postProcessingRenderer) == null || t.updateAlphaSelectionOutline(
|
|
9373
|
-
!1
|
|
9374
|
-
), this.disableAlphaSelectionOutline()), this.viralViewerApi.viralRenderer.render();
|
|
9375
|
-
}
|
|
9376
|
-
/**
|
|
9377
|
-
* Get whether alpha selection outline mode is enabled
|
|
9378
|
-
*/
|
|
9379
|
-
get alphaSelectionOutlineEnabled() {
|
|
9380
|
-
return this._alphaSelectionOutlineEnabled;
|
|
9381
|
-
}
|
|
9382
|
-
/**
|
|
9383
|
-
* Bypass alpha selection outline (fast, for camera movement)
|
|
9384
|
-
*/
|
|
9385
|
-
bypassAlphaSelectionOutline() {
|
|
9386
|
-
var e;
|
|
9387
|
-
(e = this.viralViewerApi.viralRenderer.postProcessingRenderer) == null || e.bypassAlphaSelectionOutline();
|
|
9388
|
-
}
|
|
9389
|
-
/**
|
|
9390
|
-
* Resume alpha selection outline after bypass
|
|
9391
|
-
*/
|
|
9392
|
-
resumeAlphaSelectionOutline() {
|
|
9393
|
-
var e;
|
|
9394
|
-
(e = this.viralViewerApi.viralRenderer.postProcessingRenderer) == null || e.resumeAlphaSelectionOutline();
|
|
9395
|
-
}
|
|
9396
9181
|
//#endregion
|
|
9397
9182
|
//#region night
|
|
9398
9183
|
enableNight() {
|
|
9399
9184
|
this.viralViewerApi.viralScene.lights.forEach((e) => {
|
|
9400
9185
|
e.name !== de.sunlight && (e.visible = !1);
|
|
9401
9186
|
}), this.viralViewerApi.viralMaterialManager.mergeMaterials.forEach((e) => {
|
|
9402
|
-
e instanceof
|
|
9187
|
+
e instanceof K && e.transparent && (e.emissiveIntensity = 0.5);
|
|
9403
9188
|
}), this.viralViewerApi.viralScene.bimWorld.children.forEach((e) => {
|
|
9404
|
-
e.material instanceof
|
|
9189
|
+
e.material instanceof K && e.material.transparent && e.enableLights && e.enableLights();
|
|
9405
9190
|
}), this.viralViewerApi.viralRenderer.render();
|
|
9406
9191
|
}
|
|
9407
9192
|
disableNight() {
|
|
9408
9193
|
this.viralViewerApi.viralScene.lights.forEach((e) => {
|
|
9409
9194
|
e.name !== de.sunlight && (e.visible = !0);
|
|
9410
9195
|
}), this.viralViewerApi.viralMaterialManager.mergeMaterials.forEach((e) => {
|
|
9411
|
-
e instanceof
|
|
9196
|
+
e instanceof K && e.transparent && (e.emissiveIntensity = 0);
|
|
9412
9197
|
}), this.viralViewerApi.viralScene.bimWorld.children.forEach((e) => {
|
|
9413
|
-
e.material instanceof
|
|
9198
|
+
e.material instanceof K && e.material.transparent && e.disableLights && e.disableLights();
|
|
9414
9199
|
}), this.viralViewerApi.viralRenderer.render();
|
|
9415
9200
|
}
|
|
9416
9201
|
//#endregion
|
|
@@ -9454,7 +9239,7 @@ class Cn {
|
|
|
9454
9239
|
for (let n = 0; n < t; n++)
|
|
9455
9240
|
i[n * 3] = Math.random() * (e.max.x - e.min.x) + e.min.x, i[n * 3 + 1] = Math.random() * (e.max.y + 100 - e.min.y) + e.min.y, i[n * 3 + 2] = Math.random() * (e.max.z - e.min.z) + e.min.z;
|
|
9456
9241
|
this.rainGeometry.setAttribute("position", new L(i, 3));
|
|
9457
|
-
const s = new
|
|
9242
|
+
const s = new bi({
|
|
9458
9243
|
color: 11184810,
|
|
9459
9244
|
size: 0.2,
|
|
9460
9245
|
transparent: !0,
|
|
@@ -9533,7 +9318,7 @@ class Cn {
|
|
|
9533
9318
|
generateLOD() {
|
|
9534
9319
|
this.viralViewerApi.viralScene.bimWorld.children.forEach((e) => {
|
|
9535
9320
|
if (e.isMesh) {
|
|
9536
|
-
const t = new
|
|
9321
|
+
const t = new wi(), i = D.createLowResMesh(e, 0.5);
|
|
9537
9322
|
t.addLevel(e, 50), t.addLevel(i, 200), this.viralViewerApi.viralScene.bimWorld.add(t), this.viralViewerApi.viralScene.bimWorld.remove(e);
|
|
9538
9323
|
}
|
|
9539
9324
|
});
|
|
@@ -9542,7 +9327,7 @@ class Cn {
|
|
|
9542
9327
|
* Generate a random but distinct color for each material ID
|
|
9543
9328
|
*/
|
|
9544
9329
|
_generateDistinctColor(e) {
|
|
9545
|
-
const i = e * 0.618033988749895 % 1, s = 0.7 + Math.sin(e * 0.5) * 0.3, n = 0.5 + Math.cos(e * 0.7) * 0.2, r = new
|
|
9330
|
+
const i = e * 0.618033988749895 % 1, s = 0.7 + Math.sin(e * 0.5) * 0.3, n = 0.5 + Math.cos(e * 0.7) * 0.2, r = new B();
|
|
9546
9331
|
return r.setHSL(i, s, n), r;
|
|
9547
9332
|
}
|
|
9548
9333
|
/**
|
|
@@ -9558,7 +9343,7 @@ class Cn {
|
|
|
9558
9343
|
i,
|
|
9559
9344
|
this._generateDistinctColor(i)
|
|
9560
9345
|
);
|
|
9561
|
-
const s = this._batchColors.get(i), n = new
|
|
9346
|
+
const s = this._batchColors.get(i), n = new K({
|
|
9562
9347
|
color: s,
|
|
9563
9348
|
roughness: 0.7,
|
|
9564
9349
|
metalness: 0.2,
|
|
@@ -9641,7 +9426,7 @@ class Cn {
|
|
|
9641
9426
|
}
|
|
9642
9427
|
//#endregion
|
|
9643
9428
|
}
|
|
9644
|
-
class
|
|
9429
|
+
class Sn {
|
|
9645
9430
|
constructor(e) {
|
|
9646
9431
|
this.viralViewerApi = e, this.contextMenu = null, this.contextItems = [], this.injectContextMenu();
|
|
9647
9432
|
}
|
|
@@ -9651,14 +9436,14 @@ class An {
|
|
|
9651
9436
|
transition: background-color 0.3s ease;
|
|
9652
9437
|
}
|
|
9653
9438
|
.hover-element:hover {
|
|
9654
|
-
background-color: ${
|
|
9439
|
+
background-color: ${x.hover};
|
|
9655
9440
|
|
|
9656
9441
|
}`, t = document.createElement("style");
|
|
9657
9442
|
t.innerHTML = e, document.head.appendChild(t), this.viralViewerApi.targetElement && (this.contextMenu = document.createElement("div"), this.contextMenu.addEventListener("contextmenu", (i) => {
|
|
9658
9443
|
i.preventDefault();
|
|
9659
9444
|
}), this.contextMenu.setAttribute(
|
|
9660
9445
|
"style",
|
|
9661
|
-
`position: absolute;top:0px;left:0px;background-color: ${
|
|
9446
|
+
`position: absolute;top:0px;left:0px;background-color: ${x.background};justify-content: center;display:none; z-index: 100; flex-direction:column; padding: 10px 0; border-radius:10px`
|
|
9662
9447
|
), this.viralViewerApi.targetElement.appendChild(this.contextMenu));
|
|
9663
9448
|
}
|
|
9664
9449
|
showContextMenu(e, t, i) {
|
|
@@ -9674,8 +9459,8 @@ class An {
|
|
|
9674
9459
|
for (let i = 0; i < this.contextItems.length; i++) {
|
|
9675
9460
|
if (e.findIndex((l) => l == this.contextItems[i][0]) < 0)
|
|
9676
9461
|
continue;
|
|
9677
|
-
const [s, n, r, o] = this.contextItems[i], a =
|
|
9678
|
-
`<div class="hover-element" style="padding: 5px 10px; cursor: pointer; color:${
|
|
9462
|
+
const [s, n, r, o] = this.contextItems[i], a = vt.createElementFromHTML(
|
|
9463
|
+
`<div class="hover-element" style="padding: 5px 10px; cursor: pointer; color:${x.primary}; display:flex; align-items:center">${r} <p style="margin:0px !important;padding-left:5px">${n}</p></div>`
|
|
9679
9464
|
);
|
|
9680
9465
|
a.addEventListener("click", (l) => {
|
|
9681
9466
|
l.stopPropagation(), o(l);
|
|
@@ -9691,7 +9476,7 @@ class An {
|
|
|
9691
9476
|
this.contextItems.push([e, t, i, s]);
|
|
9692
9477
|
}
|
|
9693
9478
|
}
|
|
9694
|
-
class
|
|
9479
|
+
class Cn {
|
|
9695
9480
|
constructor(e) {
|
|
9696
9481
|
this.viralViewerApi = e, this.modal = null, this.modalTitle = null, this.modalBody = null, this.modalBodyLeft = null, this.modalBodyRight = null, this.properties = null, this.rawModal = `<div class="modal" id="myModal">
|
|
9697
9482
|
<div class="modal-content">
|
|
@@ -9703,7 +9488,7 @@ class _n {
|
|
|
9703
9488
|
flex-shrink: 0;
|
|
9704
9489
|
">
|
|
9705
9490
|
<span class="close" id="closeBtn">×</span>
|
|
9706
|
-
<h2 style="margin: 0px !important;color:${
|
|
9491
|
+
<h2 style="margin: 0px !important;color:${x.secondary};white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" id="modal-title">
|
|
9707
9492
|
</h2>
|
|
9708
9493
|
</div>
|
|
9709
9494
|
<div id="modal-body" style="overflow-y: auto;overflow-x: hidden;flex: 1;min-height: 0;">
|
|
@@ -9724,7 +9509,7 @@ class _n {
|
|
|
9724
9509
|
}
|
|
9725
9510
|
|
|
9726
9511
|
.modal-content {
|
|
9727
|
-
background-color: ${
|
|
9512
|
+
background-color: ${x.background};
|
|
9728
9513
|
border: 1px solid #ccc;
|
|
9729
9514
|
border-radius: 5px;
|
|
9730
9515
|
padding: 10px;
|
|
@@ -9744,7 +9529,7 @@ class _n {
|
|
|
9744
9529
|
width: 15px;
|
|
9745
9530
|
height: 15px;
|
|
9746
9531
|
cursor: nwse-resize;
|
|
9747
|
-
background: linear-gradient(135deg, transparent 0%, transparent 50%, ${
|
|
9532
|
+
background: linear-gradient(135deg, transparent 0%, transparent 50%, ${x.secondary} 50%, ${x.secondary} 100%);
|
|
9748
9533
|
opacity: 0.5;
|
|
9749
9534
|
border-bottom-right-radius: 5px;
|
|
9750
9535
|
}
|
|
@@ -9768,7 +9553,7 @@ class _n {
|
|
|
9768
9553
|
}
|
|
9769
9554
|
|
|
9770
9555
|
.close:hover {
|
|
9771
|
-
color: ${
|
|
9556
|
+
color: ${x.accent};
|
|
9772
9557
|
}
|
|
9773
9558
|
::-webkit-scrollbar {
|
|
9774
9559
|
width: 5px;
|
|
@@ -9801,7 +9586,7 @@ class _n {
|
|
|
9801
9586
|
inject() {
|
|
9802
9587
|
if (this.viralViewerApi.targetElement) {
|
|
9803
9588
|
const e = document.createElement("style");
|
|
9804
|
-
e.innerHTML = this.rawModalStyle, document.head.appendChild(e), this.modal =
|
|
9589
|
+
e.innerHTML = this.rawModalStyle, document.head.appendChild(e), this.modal = vt.createElementFromHTML(this.rawModal), this.viralViewerApi.targetElement.appendChild(this.modal);
|
|
9805
9590
|
const t = this.viralViewerApi.targetElement.getBoundingClientRect(), i = this.modal.querySelector(".modal-content");
|
|
9806
9591
|
i && (i.style.maxHeight = `${t.height - 20}px`);
|
|
9807
9592
|
const s = document.getElementById("modal-header"), n = document.getElementById("resizeHandle"), r = document.getElementById("column-resizer");
|
|
@@ -9877,27 +9662,27 @@ class _n {
|
|
|
9877
9662
|
for (let o = 0; o < r.length; o++) {
|
|
9878
9663
|
const a = r[o], l = this.properties[a], c = (l == null ? void 0 : l.name) || a;
|
|
9879
9664
|
let h = ((n = l == null ? void 0 : l.value) == null ? void 0 : n.toString()) || (l == null ? void 0 : l.toString());
|
|
9880
|
-
(l == null ? void 0 : l.value) === "<None>" && (h = "None"), this.modalBodyLeft.innerHTML += `<p style="margin:0px !important;color:${
|
|
9665
|
+
(l == null ? void 0 : l.value) === "<None>" && (h = "None"), this.modalBodyLeft.innerHTML += `<p style="margin:0px !important;color:${x.primary};font-weight:600;font-size:14px;line-height:20px;" title="${c}">${c}</p>`, this.modalBodyRight.innerHTML += `<p style="margin:0px !important;color:${x.primary};font-size:14px;line-height:20px;" title="${h}">${h}</p>`;
|
|
9881
9666
|
}
|
|
9882
9667
|
}
|
|
9883
9668
|
}
|
|
9884
9669
|
}
|
|
9885
|
-
const
|
|
9670
|
+
const Kt = {
|
|
9886
9671
|
QUICK_SAND: {
|
|
9887
9672
|
importLink: "https://fonts.googleapis.com/css2?family=Quicksand:wght@300&display=swap",
|
|
9888
9673
|
fontFamily: "Quicksand, sans-serif"
|
|
9889
9674
|
}
|
|
9890
|
-
},
|
|
9675
|
+
}, An = (g) => {
|
|
9891
9676
|
const e = document.createElement("style");
|
|
9892
|
-
e.innerHTML = `@import url(${
|
|
9893
|
-
},
|
|
9894
|
-
const t =
|
|
9677
|
+
e.innerHTML = `@import url(${Kt[g]});`, document.head.appendChild(e);
|
|
9678
|
+
}, _n = (g, e) => {
|
|
9679
|
+
const t = Kt[e];
|
|
9895
9680
|
g && t && (g.style.fontFamily = t.fontFamily);
|
|
9896
9681
|
};
|
|
9897
|
-
class
|
|
9682
|
+
class In {
|
|
9898
9683
|
constructor(e) {
|
|
9899
9684
|
this.viralNavigationCube = e, this._mouseDownTime = null, this.clickThreshold = 250, this._handleClick = async (t) => {
|
|
9900
|
-
var c, h, d, u, p, m, f, v, b, w, S, A, C, M, _, I, O, V,
|
|
9685
|
+
var c, h, d, u, p, m, f, v, b, w, S, A, C, M, _, I, O, V, P, j, H;
|
|
9901
9686
|
if (!((c = this.viralNavigationCube.cubeScene) != null && c.activePlane) || (h = this.viralNavigationCube.cubeCamera) != null && h.cameraControlHasMoved)
|
|
9902
9687
|
return console.log("false"), !1;
|
|
9903
9688
|
let i = new E(
|
|
@@ -9907,9 +9692,9 @@ class Tn {
|
|
|
9907
9692
|
);
|
|
9908
9693
|
if (((m = this.viralNavigationCube.cubeScene) == null ? void 0 : m.activePlane.children.length) > 0) {
|
|
9909
9694
|
let q = 0, $ = 0, U = 0;
|
|
9910
|
-
for (let
|
|
9911
|
-
const
|
|
9912
|
-
q +=
|
|
9695
|
+
for (let W = 0; W < ((f = this.viralNavigationCube.cubeScene) == null ? void 0 : f.activePlane.children.length); W++) {
|
|
9696
|
+
const F = (v = this.viralNavigationCube.cubeScene) == null ? void 0 : v.activePlane.children[W];
|
|
9697
|
+
q += F.position.x, $ += F.position.y, U += F.position.z;
|
|
9913
9698
|
}
|
|
9914
9699
|
i = new E(
|
|
9915
9700
|
q / ((b = this.viralNavigationCube.cubeScene) == null ? void 0 : b.activePlane.children.length),
|
|
@@ -9934,7 +9719,7 @@ class Tn {
|
|
|
9934
9719
|
Math.round(n.y),
|
|
9935
9720
|
Math.round(n.z)
|
|
9936
9721
|
);
|
|
9937
|
-
l.multiplyScalar(a), (V = this.viralNavigationCube.viralViewerApi.viralCamera.camera) == null || V.updateMatrixWorld(), (
|
|
9722
|
+
l.multiplyScalar(a), (V = this.viralNavigationCube.viralViewerApi.viralCamera.camera) == null || V.updateMatrixWorld(), (P = this.viralNavigationCube.viralViewerApi.viralCamera.cameraControls) == null || P.setTarget(0, 0, 0), n.multiplyScalar(2), (j = this.viralNavigationCube.cubeCamera) == null || j.cameraControls.setPosition(
|
|
9938
9723
|
n.x,
|
|
9939
9724
|
n.y,
|
|
9940
9725
|
n.z,
|
|
@@ -9956,22 +9741,22 @@ class Tn {
|
|
|
9956
9741
|
(o = this.viralNavigationCube.cubeScene) == null ? void 0 : o.activePlane.position.z
|
|
9957
9742
|
);
|
|
9958
9743
|
if (((a = this.viralNavigationCube.cubeScene) == null ? void 0 : a.activePlane.children.length) > 0) {
|
|
9959
|
-
let U = 0,
|
|
9960
|
-
for (let
|
|
9961
|
-
const
|
|
9962
|
-
U +=
|
|
9744
|
+
let U = 0, W = 0, F = 0;
|
|
9745
|
+
for (let Y = 0; Y < ((l = this.viralNavigationCube.cubeScene) == null ? void 0 : l.activePlane.children.length); Y++) {
|
|
9746
|
+
const ie = (c = this.viralNavigationCube.cubeScene) == null ? void 0 : c.activePlane.children[Y];
|
|
9747
|
+
U += ie.position.x, W += ie.position.y, F += ie.position.z;
|
|
9963
9748
|
}
|
|
9964
9749
|
O = new E(
|
|
9965
9750
|
U / ((h = this.viralNavigationCube.cubeScene) == null ? void 0 : h.activePlane.children.length),
|
|
9966
|
-
|
|
9967
|
-
|
|
9751
|
+
W / ((d = this.viralNavigationCube.cubeScene) == null ? void 0 : d.activePlane.children.length),
|
|
9752
|
+
F / ((u = this.viralNavigationCube.cubeScene) == null ? void 0 : u.activePlane.children.length)
|
|
9968
9753
|
);
|
|
9969
9754
|
}
|
|
9970
9755
|
const V = new E();
|
|
9971
9756
|
(p = this.viralNavigationCube.cubeCamera) == null || p.cameraControls.getTarget(
|
|
9972
9757
|
V
|
|
9973
9758
|
);
|
|
9974
|
-
const
|
|
9759
|
+
const P = O.clone().sub(V).normalize();
|
|
9975
9760
|
(v = this.viralNavigationCube.cubeCamera) == null || v.cameraControlOldPosition.copy(
|
|
9976
9761
|
(f = (m = this.viralNavigationCube.cubeCamera) == null ? void 0 : m.camera) == null ? void 0 : f.position
|
|
9977
9762
|
);
|
|
@@ -9984,18 +9769,18 @@ class Tn {
|
|
|
9984
9769
|
H
|
|
9985
9770
|
);
|
|
9986
9771
|
const q = H.clone().sub(j).length(), $ = new E(
|
|
9987
|
-
Math.round(
|
|
9988
|
-
Math.round(
|
|
9989
|
-
Math.round(
|
|
9772
|
+
Math.round(P.x),
|
|
9773
|
+
Math.round(P.y),
|
|
9774
|
+
Math.round(P.z)
|
|
9990
9775
|
);
|
|
9991
9776
|
$.multiplyScalar(q), (S = this.viralNavigationCube.viralViewerApi.viralCamera.camera) == null || S.updateMatrixWorld(), (A = this.viralNavigationCube.viralViewerApi.viralCamera.cameraControls) == null || A.setTarget(
|
|
9992
9777
|
0,
|
|
9993
9778
|
0,
|
|
9994
9779
|
0
|
|
9995
|
-
),
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9780
|
+
), P.multiplyScalar(2), (C = this.viralNavigationCube.cubeCamera) == null || C.cameraControls.setPosition(
|
|
9781
|
+
P.x,
|
|
9782
|
+
P.y,
|
|
9783
|
+
P.z,
|
|
9999
9784
|
!0
|
|
10000
9785
|
), (M = this.viralNavigationCube.viralViewerApi.viralCamera.cameraControls) == null || M.setPosition(
|
|
10001
9786
|
$.x,
|
|
@@ -10015,7 +9800,7 @@ class Tn {
|
|
|
10015
9800
|
}
|
|
10016
9801
|
this.viralNavigationCube.cubeScene.activePlane = null;
|
|
10017
9802
|
}
|
|
10018
|
-
const i = t.offsetX, s = t.offsetY, n = (c = this.viralNavigationCube.cubeRenderer) == null ? void 0 : c.renderer.getSize(new
|
|
9803
|
+
const i = t.offsetX, s = t.offsetY, n = (c = this.viralNavigationCube.cubeRenderer) == null ? void 0 : c.renderer.getSize(new N()), r = new N(i / n.width * 2 - 1, -s / n.height * 2 + 1), o = new Pt();
|
|
10019
9804
|
o.setFromCamera(r, (h = this.viralNavigationCube.cubeCamera) == null ? void 0 : h.camera);
|
|
10020
9805
|
const a = o.intersectObjects((d = this.viralNavigationCube.cubeScene) == null ? void 0 : d.objects);
|
|
10021
9806
|
if (a.length > 0 && a[0].object != ((u = this.viralNavigationCube.cubeScene) == null ? void 0 : u.cube)) {
|
|
@@ -10042,14 +9827,14 @@ class Tn {
|
|
|
10042
9827
|
}
|
|
10043
9828
|
//#endregion
|
|
10044
9829
|
}
|
|
10045
|
-
class
|
|
9830
|
+
class Vn {
|
|
10046
9831
|
constructor(e) {
|
|
10047
9832
|
this.viralNavigationCube = e, this.camera = null, this.cameraControls = null, this.cameraControlOldPosition = new E(), this.cameraControlNewPosition = new E(), this.cameraControlHasMoved = !1, this.setupCamera(), this.setupHandle();
|
|
10048
9833
|
}
|
|
10049
9834
|
setupCamera() {
|
|
10050
9835
|
if (this.viralNavigationCube.targetElement && this.viralNavigationCube.cubeRenderer) {
|
|
10051
9836
|
const e = this.viralNavigationCube.targetElement.offsetWidth, t = this.viralNavigationCube.targetElement.offsetHeight;
|
|
10052
|
-
this.camera = new
|
|
9837
|
+
this.camera = new He(60, e / t, 0.01, 100), this.camera.position.set(0, 0, 2), this.cameraControls = new pe(
|
|
10053
9838
|
this.camera,
|
|
10054
9839
|
this.viralNavigationCube.cubeRenderer.renderer.domElement
|
|
10055
9840
|
), this.cameraControls.dollyToCursor = !1, this.cameraControls.infinityDolly = !1, this.cameraControls.setTarget(0, 0, 0), this.cameraControls.polarRotateSpeed = 0.15, this.cameraControls.azimuthRotateSpeed = 0.15, this.cameraControls.mouseButtons.middle = pe.ACTION.NONE, this.cameraControls.mouseButtons.wheel = pe.ACTION.NONE, this.cameraControls.addEventListener("control", (i) => {
|
|
@@ -10080,9 +9865,9 @@ class Pn {
|
|
|
10080
9865
|
window.addEventListener("mousedown", e, !1), window.addEventListener("mousemove", t, !1), window.addEventListener("touchstart", e, !1), window.addEventListener("touchmove", t, !0);
|
|
10081
9866
|
}
|
|
10082
9867
|
}
|
|
10083
|
-
class
|
|
9868
|
+
class Pn {
|
|
10084
9869
|
constructor(e) {
|
|
10085
|
-
this.viralNavigationCube = e, this.renderer = new
|
|
9870
|
+
this.viralNavigationCube = e, this.renderer = new Gt({
|
|
10086
9871
|
alpha: !0,
|
|
10087
9872
|
antialias: !0,
|
|
10088
9873
|
logarithmicDepthBuffer: !0
|
|
@@ -10115,191 +9900,191 @@ class On {
|
|
|
10115
9900
|
// }
|
|
10116
9901
|
// }
|
|
10117
9902
|
}
|
|
10118
|
-
class
|
|
9903
|
+
class Tn {
|
|
10119
9904
|
constructor(e, t = 1) {
|
|
10120
|
-
this.viralNavigationCube = e, this.scene = new
|
|
9905
|
+
this.viralNavigationCube = e, this.scene = new ft(), this.objects = [], this.cube = null, this.activePlane = null, this.cubeScale = 1, this.cubeScale = Math.round(Math.max(0.1, Math.min(1, t)) * 10) / 10, this.addCube(), this.addPlanes();
|
|
10121
9906
|
}
|
|
10122
9907
|
addObject(e) {
|
|
10123
9908
|
this.scene.add(e), this.objects.push(e);
|
|
10124
9909
|
}
|
|
10125
9910
|
addCube() {
|
|
10126
|
-
const e = [], t = ["RIGHT", "LEFT", "TOP", "BOTTOM", "FRONT", "BACK"], i = new
|
|
9911
|
+
const e = [], t = ["RIGHT", "LEFT", "TOP", "BOTTOM", "FRONT", "BACK"], i = new yi(), s = document.createElement("canvas"), n = s.getContext("2d"), r = 64;
|
|
10127
9912
|
if (s.width = r, s.height = r, n) {
|
|
10128
9913
|
n.font = 'bolder 12px "Open sans", Arial', n.textBaseline = "middle", n.textAlign = "center";
|
|
10129
|
-
const o = `${
|
|
9914
|
+
const o = `${x.background}`;
|
|
10130
9915
|
for (let l = 0; l < 6; l++)
|
|
10131
|
-
t[l] == "TOP" || t[l] == "BOTTOM", n.fillStyle = o, n.fillRect(0, 0, r, r), n.strokeStyle = `${
|
|
9916
|
+
t[l] == "TOP" || t[l] == "BOTTOM", n.fillStyle = o, n.fillRect(0, 0, r, r), n.strokeStyle = `${x.primary}`, n.setLineDash([8, 8]), n.lineWidth = 4, n.strokeRect(0, 0, r, r), n.fillStyle = `${x.primary}`, n.fillText(t[l], r / 2, r / 2), e[l] = new G({
|
|
10132
9917
|
map: i.load(s.toDataURL())
|
|
10133
9918
|
});
|
|
10134
9919
|
const a = this.cubeScale;
|
|
10135
|
-
this.cube = new
|
|
9920
|
+
this.cube = new y(new Tt(a, a, a), e), this.addObject(this.cube);
|
|
10136
9921
|
}
|
|
10137
9922
|
}
|
|
10138
9923
|
addPlanes() {
|
|
10139
9924
|
const e = this.cubeScale, t = new G({
|
|
10140
|
-
side:
|
|
9925
|
+
side: ee,
|
|
10141
9926
|
color: 6659921,
|
|
10142
9927
|
transparent: !0,
|
|
10143
9928
|
opacity: 0,
|
|
10144
9929
|
depthTest: !1
|
|
10145
|
-
}), i = 0.7 * e, s = 0.7 * e, n = 0.15 * e, r = new
|
|
9930
|
+
}), i = 0.7 * e, s = 0.7 * e, n = 0.15 * e, r = new ae(i, i), o = new ae(n, s), a = new ae(n, n), l = 0.51 * e, c = new y(r, t.clone());
|
|
10146
9931
|
c.position.z = l, c.name = "FRONT";
|
|
10147
|
-
const h = new
|
|
9932
|
+
const h = new y(o, t.clone());
|
|
10148
9933
|
h.position.z = l, h.position.x = i / 2 + n / 2;
|
|
10149
|
-
const d = new
|
|
9934
|
+
const d = new y(o, t.clone());
|
|
10150
9935
|
d.position.z = l, d.position.x = -(i / 2 + n / 2);
|
|
10151
|
-
const u = new
|
|
9936
|
+
const u = new y(o, t.clone());
|
|
10152
9937
|
u.position.z = l, u.rotation.z = Math.PI / 2, u.position.y = i / 2 + n / 2;
|
|
10153
|
-
const p = new
|
|
9938
|
+
const p = new y(o, t.clone());
|
|
10154
9939
|
p.position.z = l, p.rotation.z = Math.PI / 2, p.position.y = -(i / 2 + n / 2);
|
|
10155
|
-
const m = new
|
|
9940
|
+
const m = new y(a, t.clone());
|
|
10156
9941
|
m.position.z = l, m.position.x = -(i / 2 + n / 2), m.position.y = i / 2 + n / 2;
|
|
10157
|
-
const f = new
|
|
9942
|
+
const f = new y(a, t.clone());
|
|
10158
9943
|
f.position.z = l, f.position.x = i / 2 + n / 2, f.position.y = i / 2 + n / 2;
|
|
10159
|
-
const v = new
|
|
9944
|
+
const v = new y(a, t.clone());
|
|
10160
9945
|
v.position.z = l, v.position.x = i / 2 + n / 2, v.position.y = -(i / 2 + n / 2);
|
|
10161
|
-
const b = new
|
|
9946
|
+
const b = new y(a, t.clone());
|
|
10162
9947
|
b.position.z = l, b.position.x = -(i / 2 + n / 2), b.position.y = -(i / 2 + n / 2);
|
|
10163
|
-
const w = new
|
|
9948
|
+
const w = new y(r, t.clone());
|
|
10164
9949
|
w.position.z = -l, w.name = "BACK";
|
|
10165
|
-
const S = new
|
|
9950
|
+
const S = new y(o, t.clone());
|
|
10166
9951
|
S.position.z = -l, S.position.x = i / 2 + n / 2;
|
|
10167
|
-
const A = new
|
|
9952
|
+
const A = new y(o, t.clone());
|
|
10168
9953
|
A.position.z = -l, A.position.x = -(i / 2 + n / 2);
|
|
10169
|
-
const C = new
|
|
9954
|
+
const C = new y(o, t.clone());
|
|
10170
9955
|
C.position.z = -l, C.rotation.z = Math.PI / 2, C.position.y = i / 2 + n / 2;
|
|
10171
|
-
const M = new
|
|
9956
|
+
const M = new y(o, t.clone());
|
|
10172
9957
|
M.position.z = -l, M.rotation.z = Math.PI / 2, M.position.y = -(i / 2 + n / 2);
|
|
10173
|
-
const _ = new
|
|
9958
|
+
const _ = new y(a, t.clone());
|
|
10174
9959
|
_.position.z = -l, _.position.x = i / 2 + n / 2, _.position.y = i / 2 + n / 2;
|
|
10175
|
-
const I = new
|
|
9960
|
+
const I = new y(a, t.clone());
|
|
10176
9961
|
I.position.z = -l, I.position.x = -(i / 2 + n / 2), I.position.y = i / 2 + n / 2;
|
|
10177
|
-
const O = new
|
|
9962
|
+
const O = new y(a, t.clone());
|
|
10178
9963
|
O.position.z = -l, O.position.x = -(i / 2 + n / 2), O.position.y = -(i / 2 + n / 2);
|
|
10179
|
-
const V = new
|
|
9964
|
+
const V = new y(a, t.clone());
|
|
10180
9965
|
V.position.z = -l, V.position.x = i / 2 + n / 2, V.position.y = -(i / 2 + n / 2);
|
|
10181
|
-
const
|
|
10182
|
-
|
|
10183
|
-
const j = new
|
|
9966
|
+
const P = new y(r, t.clone());
|
|
9967
|
+
P.rotation.y = Math.PI / 2, P.position.x = l, P.name = "RIGHT";
|
|
9968
|
+
const j = new y(o, t.clone());
|
|
10184
9969
|
j.rotation.y = Math.PI / 2, j.position.x = l, j.position.z = i / 2 + n / 2;
|
|
10185
|
-
const H = new
|
|
9970
|
+
const H = new y(o, t.clone());
|
|
10186
9971
|
H.rotation.y = Math.PI / 2, H.position.x = l, H.position.z = -(i / 2 + n / 2);
|
|
10187
|
-
const q = new
|
|
9972
|
+
const q = new y(o, t.clone());
|
|
10188
9973
|
q.rotation.y = Math.PI / 2, q.position.x = l, q.rotation.z = Math.PI / 2, q.position.y = i / 2 + n / 2;
|
|
10189
|
-
const $ = new
|
|
9974
|
+
const $ = new y(o, t.clone());
|
|
10190
9975
|
$.rotation.y = Math.PI / 2, $.position.x = l, $.rotation.z = Math.PI / 2, $.position.y = -(i / 2 + n / 2);
|
|
10191
|
-
const U = new
|
|
9976
|
+
const U = new y(a, t.clone());
|
|
10192
9977
|
U.rotation.y = Math.PI / 2, U.position.x = l, U.position.z = i / 2 + n / 2, U.position.y = i / 2 + n / 2;
|
|
10193
|
-
const
|
|
10194
|
-
|
|
10195
|
-
const
|
|
10196
|
-
|
|
10197
|
-
const
|
|
10198
|
-
|
|
10199
|
-
const
|
|
10200
|
-
|
|
10201
|
-
const
|
|
10202
|
-
|
|
10203
|
-
const
|
|
10204
|
-
|
|
10205
|
-
const ge = new
|
|
9978
|
+
const W = new y(a, t.clone());
|
|
9979
|
+
W.rotation.y = Math.PI / 2, W.position.x = l, W.position.z = -(i / 2 + n / 2), W.position.y = i / 2 + n / 2;
|
|
9980
|
+
const F = new y(a, t.clone());
|
|
9981
|
+
F.rotation.y = Math.PI / 2, F.position.x = l, F.position.z = -(i / 2 + n / 2), F.position.y = -(i / 2 + n / 2);
|
|
9982
|
+
const Y = new y(a, t.clone());
|
|
9983
|
+
Y.rotation.y = Math.PI / 2, Y.position.x = l, Y.position.z = i / 2 + n / 2, Y.position.y = -(i / 2 + n / 2);
|
|
9984
|
+
const ie = new y(r, t.clone());
|
|
9985
|
+
ie.rotation.y = Math.PI / 2, ie.position.x = -l, ie.name = "LEFT";
|
|
9986
|
+
const Ue = new y(o, t.clone());
|
|
9987
|
+
Ue.rotation.y = Math.PI / 2, Ue.position.x = -l, Ue.position.z = i / 2 + n / 2;
|
|
9988
|
+
const qe = new y(o, t.clone());
|
|
9989
|
+
qe.rotation.y = Math.PI / 2, qe.position.x = -l, qe.position.z = -(i / 2 + n / 2);
|
|
9990
|
+
const ge = new y(o, t.clone());
|
|
10206
9991
|
ge.rotation.y = Math.PI / 2, ge.position.x = -l, ge.rotation.z = Math.PI / 2, ge.position.y = i / 2 + n / 2;
|
|
10207
|
-
const fe = new
|
|
9992
|
+
const fe = new y(o, t.clone());
|
|
10208
9993
|
fe.rotation.y = Math.PI / 2, fe.position.x = -l, fe.rotation.z = Math.PI / 2, fe.position.y = -(i / 2 + n / 2);
|
|
10209
|
-
const ve = new
|
|
9994
|
+
const ve = new y(a, t.clone());
|
|
10210
9995
|
ve.rotation.y = Math.PI / 2, ve.position.x = -l, ve.position.z = -(i / 2 + n / 2), ve.position.y = i / 2 + n / 2;
|
|
10211
|
-
const be = new
|
|
9996
|
+
const be = new y(a, t.clone());
|
|
10212
9997
|
be.rotation.y = Math.PI / 2, be.position.x = -l, be.position.z = i / 2 + n / 2, be.position.y = i / 2 + n / 2;
|
|
10213
|
-
const we = new
|
|
9998
|
+
const we = new y(a, t.clone());
|
|
10214
9999
|
we.rotation.y = Math.PI / 2, we.position.x = -l, we.position.z = i / 2 + n / 2, we.position.y = -(i / 2 + n / 2);
|
|
10215
|
-
const ye = new
|
|
10000
|
+
const ye = new y(a, t.clone());
|
|
10216
10001
|
ye.rotation.y = Math.PI / 2, ye.position.x = -l, ye.position.z = -(i / 2 + n / 2), ye.position.y = -(i / 2 + n / 2);
|
|
10217
|
-
const
|
|
10218
|
-
|
|
10219
|
-
const
|
|
10220
|
-
|
|
10221
|
-
const
|
|
10222
|
-
|
|
10223
|
-
const xe = new
|
|
10002
|
+
const Qe = new y(r, t.clone());
|
|
10003
|
+
Qe.rotation.x = Math.PI / 2, Qe.position.y = l, Qe.name = "TOP";
|
|
10004
|
+
const Ze = new y(o, t.clone());
|
|
10005
|
+
Ze.rotation.x = Math.PI / 2, Ze.position.y = l, Ze.position.x = i / 2 + n / 2;
|
|
10006
|
+
const Ye = new y(o, t.clone());
|
|
10007
|
+
Ye.rotation.x = Math.PI / 2, Ye.position.y = l, Ye.position.x = -(i / 2 + n / 2);
|
|
10008
|
+
const xe = new y(o, t.clone());
|
|
10224
10009
|
xe.rotation.x = Math.PI / 2, xe.position.y = l, xe.rotation.z = Math.PI / 2, xe.position.z = i / 2 + n / 2;
|
|
10225
|
-
const Me = new
|
|
10010
|
+
const Me = new y(o, t.clone());
|
|
10226
10011
|
Me.rotation.x = Math.PI / 2, Me.position.y = l, Me.rotation.z = Math.PI / 2, Me.position.z = -(i / 2 + n / 2);
|
|
10227
|
-
const Ee = new
|
|
10012
|
+
const Ee = new y(a, t.clone());
|
|
10228
10013
|
Ee.rotation.x = Math.PI / 2, Ee.position.y = l, Ee.position.z = -(i / 2 + n / 2), Ee.position.x = -(i / 2 + n / 2);
|
|
10229
|
-
const Se = new
|
|
10014
|
+
const Se = new y(a, t.clone());
|
|
10230
10015
|
Se.rotation.x = Math.PI / 2, Se.position.y = l, Se.position.z = -(i / 2 + n / 2), Se.position.x = i / 2 + n / 2;
|
|
10231
|
-
const Ce = new
|
|
10016
|
+
const Ce = new y(a, t.clone());
|
|
10232
10017
|
Ce.rotation.x = Math.PI / 2, Ce.position.y = l, Ce.position.z = i / 2 + n / 2, Ce.position.x = i / 2 + n / 2;
|
|
10233
|
-
const Ae = new
|
|
10018
|
+
const Ae = new y(a, t.clone());
|
|
10234
10019
|
Ae.rotation.x = Math.PI / 2, Ae.position.y = l, Ae.position.z = i / 2 + n / 2, Ae.position.x = -(i / 2 + n / 2);
|
|
10235
|
-
const
|
|
10236
|
-
|
|
10237
|
-
const
|
|
10238
|
-
|
|
10239
|
-
const
|
|
10240
|
-
|
|
10241
|
-
const _e = new
|
|
10020
|
+
const Xe = new y(r, t.clone());
|
|
10021
|
+
Xe.rotation.x = Math.PI / 2, Xe.position.y = -l, Xe.name = "BOTTOM";
|
|
10022
|
+
const Ke = new y(o, t.clone());
|
|
10023
|
+
Ke.rotation.x = Math.PI / 2, Ke.position.y = -l, Ke.position.x = i / 2 + n / 2;
|
|
10024
|
+
const Je = new y(o, t.clone());
|
|
10025
|
+
Je.rotation.x = Math.PI / 2, Je.position.y = -l, Je.position.x = -(i / 2 + n / 2);
|
|
10026
|
+
const _e = new y(o, t.clone());
|
|
10242
10027
|
_e.rotation.x = Math.PI / 2, _e.position.y = -l, _e.rotation.z = Math.PI / 2, _e.position.z = i / 2 + n / 2;
|
|
10243
|
-
const Ie = new
|
|
10028
|
+
const Ie = new y(o, t.clone());
|
|
10244
10029
|
Ie.rotation.x = Math.PI / 2, Ie.position.y = -l, Ie.rotation.z = Math.PI / 2, Ie.position.z = -(i / 2 + n / 2);
|
|
10245
|
-
const Ve = new
|
|
10030
|
+
const Ve = new y(a, t.clone());
|
|
10246
10031
|
Ve.rotation.x = Math.PI / 2, Ve.position.y = -l, Ve.position.z = i / 2 + n / 2, Ve.position.x = -(i / 2 + n / 2);
|
|
10247
|
-
const
|
|
10248
|
-
|
|
10249
|
-
const
|
|
10250
|
-
|
|
10251
|
-
const Oe = new
|
|
10032
|
+
const Pe = new y(a, t.clone());
|
|
10033
|
+
Pe.rotation.x = Math.PI / 2, Pe.position.y = -l, Pe.position.z = i / 2 + n / 2, Pe.position.x = i / 2 + n / 2;
|
|
10034
|
+
const Te = new y(a, t.clone());
|
|
10035
|
+
Te.rotation.x = Math.PI / 2, Te.position.y = -l, Te.position.z = -(i / 2 + n / 2), Te.position.x = i / 2 + n / 2;
|
|
10036
|
+
const Oe = new y(a, t.clone());
|
|
10252
10037
|
Oe.rotation.x = Math.PI / 2, Oe.position.y = -l, Oe.position.z = -(i / 2 + n / 2), Oe.position.x = -(i / 2 + n / 2);
|
|
10253
|
-
const
|
|
10038
|
+
const Jt = new G({
|
|
10254
10039
|
color: 11184810
|
|
10255
|
-
}),
|
|
10256
|
-
|
|
10257
|
-
const
|
|
10258
|
-
|
|
10259
|
-
const
|
|
10260
|
-
|
|
10261
|
-
const
|
|
10262
|
-
|
|
10263
|
-
const
|
|
10264
|
-
|
|
10265
|
-
const
|
|
10266
|
-
|
|
10267
|
-
const
|
|
10268
|
-
|
|
10269
|
-
const
|
|
10270
|
-
|
|
10271
|
-
const
|
|
10272
|
-
|
|
10273
|
-
const
|
|
10274
|
-
|
|
10275
|
-
const
|
|
10276
|
-
|
|
10277
|
-
const
|
|
10278
|
-
|
|
10279
|
-
const
|
|
10280
|
-
|
|
10281
|
-
const De = new
|
|
10040
|
+
}), ei = new ae(1 * e, 1 * e), bt = new y(ei, Jt);
|
|
10041
|
+
bt.rotation.x = -Math.PI / 2, bt.position.y = -0.6 * e, this.addObject(c), this.addObject(w), this.addObject(P), this.addObject(ie), this.addObject(Qe), this.addObject(Xe), this.addObject(bt);
|
|
10042
|
+
const et = new y();
|
|
10043
|
+
et.name = "1131", et.add(h), et.add(j), this.addObject(et);
|
|
10044
|
+
const tt = new y();
|
|
10045
|
+
tt.name = "1241", tt.add(d), tt.add(Ue), this.addObject(tt);
|
|
10046
|
+
const it = new y();
|
|
10047
|
+
it.name = "1353", it.add(u), it.add(xe), this.addObject(it);
|
|
10048
|
+
const st = new y();
|
|
10049
|
+
st.name = "1463", st.add(p), st.add(_e), this.addObject(st);
|
|
10050
|
+
const nt = new y();
|
|
10051
|
+
nt.name = "2464", nt.add(M), nt.add(Ie), this.addObject(nt);
|
|
10052
|
+
const rt = new y();
|
|
10053
|
+
rt.name = "3221", rt.add(H), rt.add(S), this.addObject(rt);
|
|
10054
|
+
const at = new y();
|
|
10055
|
+
at.name = "3351", at.add(q), at.add(Ze), this.addObject(at);
|
|
10056
|
+
const ot = new y();
|
|
10057
|
+
ot.name = "3461", ot.add($), ot.add(Ke), this.addObject(ot);
|
|
10058
|
+
const lt = new y();
|
|
10059
|
+
lt.name = "4222", lt.add(qe), lt.add(A), this.addObject(lt);
|
|
10060
|
+
const ct = new y();
|
|
10061
|
+
ct.name = "4352", ct.add(ge), ct.add(Ye), this.addObject(ct);
|
|
10062
|
+
const ht = new y();
|
|
10063
|
+
ht.name = "3462", ht.add(fe), ht.add(Je), this.addObject(ht);
|
|
10064
|
+
const dt = new y();
|
|
10065
|
+
dt.name = "5423", dt.add(Me), dt.add(C), this.addObject(dt);
|
|
10066
|
+
const De = new y();
|
|
10282
10067
|
De.name = "corner1", De.add(m), De.add(Ae), De.add(be), this.addObject(De);
|
|
10283
|
-
const Re = new
|
|
10068
|
+
const Re = new y();
|
|
10284
10069
|
Re.name = "corner2", Re.add(f), Re.add(U), Re.add(Ce), this.addObject(Re);
|
|
10285
|
-
const Le = new
|
|
10286
|
-
Le.name = "corner3", Le.add(v), Le.add(
|
|
10287
|
-
const ke = new
|
|
10070
|
+
const Le = new y();
|
|
10071
|
+
Le.name = "corner3", Le.add(v), Le.add(Y), Le.add(Pe), this.addObject(Le);
|
|
10072
|
+
const ke = new y();
|
|
10288
10073
|
ke.name = "corner4", ke.add(b), ke.add(we), ke.add(Ve), this.addObject(ke);
|
|
10289
|
-
const Be = new
|
|
10290
|
-
Be.name = "corner5", Be.add(_), Be.add(
|
|
10291
|
-
const ze = new
|
|
10074
|
+
const Be = new y();
|
|
10075
|
+
Be.name = "corner5", Be.add(_), Be.add(W), Be.add(Se), this.addObject(Be);
|
|
10076
|
+
const ze = new y();
|
|
10292
10077
|
ze.name = "corner6", ze.add(I), ze.add(Ee), ze.add(ve), this.addObject(ze);
|
|
10293
|
-
const Ne = new
|
|
10078
|
+
const Ne = new y();
|
|
10294
10079
|
Ne.name = "corner7", Ne.add(O), Ne.add(ye), Ne.add(Oe), this.addObject(Ne);
|
|
10295
|
-
const $e = new
|
|
10296
|
-
$e.name = "corner8", $e.add(V), $e.add(
|
|
10080
|
+
const $e = new y();
|
|
10081
|
+
$e.name = "corner8", $e.add(V), $e.add(F), $e.add(Te), this.addObject($e);
|
|
10297
10082
|
}
|
|
10298
10083
|
}
|
|
10299
|
-
class
|
|
10084
|
+
class On {
|
|
10300
10085
|
//* view cube from third party (new approach)
|
|
10301
10086
|
constructor(e, t = 1) {
|
|
10302
|
-
this.viralViewerApi = e, this.targetElement = null, this.cubeScene = null, this.cubeRenderer = null, this.cubeCamera = null, this.cubeMouse = null, this.cubeScale = 1, this.cubeScale = Math.round(Math.max(0.1, Math.min(1, t)) * 10) / 10, this.injectCubeWrapperElement(), this.targetElement = document.getElementById("orientCubeWrapper"), this.targetElement && (this.cubeScene = new
|
|
10087
|
+
this.viralViewerApi = e, this.targetElement = null, this.cubeScene = null, this.cubeRenderer = null, this.cubeCamera = null, this.cubeMouse = null, this.cubeScale = 1, this.cubeScale = Math.round(Math.max(0.1, Math.min(1, t)) * 10) / 10, this.injectCubeWrapperElement(), this.targetElement = document.getElementById("orientCubeWrapper"), this.targetElement && (this.cubeScene = new Tn(this, this.cubeScale), this.cubeRenderer = new Pn(this), this.cubeCamera = new Vn(this), this.cubeMouse = new In(this)), this.viralViewerApi.emit(R.LOADED_CUBE);
|
|
10303
10088
|
}
|
|
10304
10089
|
injectCubeWrapperElement() {
|
|
10305
10090
|
if (this.viralViewerApi.targetElement) {
|
|
@@ -10320,14 +10105,14 @@ class Rn {
|
|
|
10320
10105
|
this.viralViewerApi.viralCamera.backHome();
|
|
10321
10106
|
}
|
|
10322
10107
|
}
|
|
10323
|
-
class
|
|
10108
|
+
class Dn {
|
|
10324
10109
|
constructor(e) {
|
|
10325
10110
|
this.viralViewerApi = e, this.contextMenu = null, this.injectContextMenu();
|
|
10326
10111
|
}
|
|
10327
10112
|
injectContextMenu() {
|
|
10328
10113
|
this.viralViewerApi.targetElement && (this.contextMenu = document.createElement("div"), this.contextMenu.setAttribute("id", "viral-pivot-point"), this.contextMenu.setAttribute(
|
|
10329
10114
|
"style",
|
|
10330
|
-
`position: absolute;top:0px;left:0px;background-color: ${
|
|
10115
|
+
`position: absolute;top:0px;left:0px;background-color: ${x.secondary}; border-radius:5px; height: 10px; width:10px; opacity:80%; transform: translate(-50%, -50%);display: none`
|
|
10331
10116
|
), this.viralViewerApi.targetElement.appendChild(this.contextMenu));
|
|
10332
10117
|
}
|
|
10333
10118
|
show(e, t) {
|
|
@@ -10337,7 +10122,7 @@ class Ln {
|
|
|
10337
10122
|
this.contextMenu && this.contextMenu.style.setProperty("display", "none");
|
|
10338
10123
|
}
|
|
10339
10124
|
}
|
|
10340
|
-
class
|
|
10125
|
+
class Rn {
|
|
10341
10126
|
constructor(e) {
|
|
10342
10127
|
this.viralViewerApi = e, this.spinner = null, this.logo = `<svg
|
|
10343
10128
|
width="348.25488"
|
|
@@ -10400,14 +10185,14 @@ class kn {
|
|
|
10400
10185
|
if (t.innerHTML = e, document.head.appendChild(t), this.viralViewerApi.targetElement) {
|
|
10401
10186
|
this.spinner = document.createElement("div"), this.spinner.setAttribute(
|
|
10402
10187
|
"style",
|
|
10403
|
-
`position: absolute;top:0px;left:0px;right:0px;bottom:0px;background-color: ${
|
|
10188
|
+
`position: absolute;top:0px;left:0px;right:0px;bottom:0px;background-color: ${x.background};justify-content: center;align-items: center;display:none; z-index: 100`
|
|
10404
10189
|
);
|
|
10405
10190
|
const i = document.createElement("div"), s = document.createElement("div");
|
|
10406
10191
|
s.setAttribute(
|
|
10407
10192
|
"style",
|
|
10408
|
-
`width: 200px; height: 200px; border-radius: 50%; border: 2px solid #ccc; border-top: 2px solid ${
|
|
10193
|
+
`width: 200px; height: 200px; border-radius: 50%; border: 2px solid #ccc; border-top: 2px solid ${x.primary}; animation: spin 1.5s linear infinite;`
|
|
10409
10194
|
);
|
|
10410
|
-
const n =
|
|
10195
|
+
const n = vt.createElementFromHTML(this.logo);
|
|
10411
10196
|
n.setAttribute(
|
|
10412
10197
|
"style",
|
|
10413
10198
|
"height:150px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)"
|
|
@@ -10421,7 +10206,7 @@ class kn {
|
|
|
10421
10206
|
this.spinner && this.spinner.style.setProperty("display", "none");
|
|
10422
10207
|
}
|
|
10423
10208
|
}
|
|
10424
|
-
class
|
|
10209
|
+
class Ln {
|
|
10425
10210
|
constructor(e) {
|
|
10426
10211
|
this.viralTools = e;
|
|
10427
10212
|
}
|
|
@@ -10430,7 +10215,7 @@ class Bn {
|
|
|
10430
10215
|
e.activate && console.log((t = this.viralTools.viralViewerApi.viralCamera.camera) == null ? void 0 : t.position);
|
|
10431
10216
|
}
|
|
10432
10217
|
}
|
|
10433
|
-
class
|
|
10218
|
+
class kn {
|
|
10434
10219
|
constructor(e) {
|
|
10435
10220
|
this.viralTools = e;
|
|
10436
10221
|
}
|
|
@@ -10438,7 +10223,7 @@ class zn {
|
|
|
10438
10223
|
this.viralTools.viralViewerApi.targetElement && e.activate;
|
|
10439
10224
|
}
|
|
10440
10225
|
}
|
|
10441
|
-
class
|
|
10226
|
+
class Bn {
|
|
10442
10227
|
constructor(e) {
|
|
10443
10228
|
this.viralTools = e;
|
|
10444
10229
|
}
|
|
@@ -10455,7 +10240,7 @@ class Nn {
|
|
|
10455
10240
|
));
|
|
10456
10241
|
}
|
|
10457
10242
|
}
|
|
10458
|
-
class
|
|
10243
|
+
class zn {
|
|
10459
10244
|
constructor(e) {
|
|
10460
10245
|
this.viralTools = e, this.isActivated = !1;
|
|
10461
10246
|
}
|
|
@@ -10475,9 +10260,9 @@ class $n {
|
|
|
10475
10260
|
}
|
|
10476
10261
|
}
|
|
10477
10262
|
}
|
|
10478
|
-
class
|
|
10263
|
+
class Nn {
|
|
10479
10264
|
constructor(e) {
|
|
10480
|
-
this.viralTools = e, this.viralToolMeasureScene = new
|
|
10265
|
+
this.viralTools = e, this.viralToolMeasureScene = new ft(), this.isActivated = !1, this.measures = [], this.point1 = null, this.point2 = null, this.tempPoint2 = null, this.defaultSprite = this.makeSprite(), this.measureObject = new y(), this.tempMeasure = new y(), this.tempSprite1 = null, this.tempLine = null, this.tempSprite2 = null;
|
|
10481
10266
|
}
|
|
10482
10267
|
activate(e) {
|
|
10483
10268
|
this.isActivated = e.activate, this.isActivated ? (this.viralToolMeasureScene.getObjectByName("measure-object") || (this.measureObject.name = "measure-object", this.viralToolMeasureScene.add(this.measureObject)), this.viralToolMeasureScene.getObjectByName("temp-measure") || (this.tempMeasure.name = "temp-measure", this.viralToolMeasureScene.add(this.tempMeasure))) : this.dispose();
|
|
@@ -10539,20 +10324,20 @@ class jn {
|
|
|
10539
10324
|
const n = document.createElement("canvas"), r = n.getContext("2d"), o = 32;
|
|
10540
10325
|
n.width = o, n.height = o;
|
|
10541
10326
|
const a = o * 0.8 / 2;
|
|
10542
|
-
return r && (r.shadowBlur = 5, r.shadowColor = "#555", r.fillStyle = "#fff", r.beginPath(), r.arc(o / 2, o / 2, a, 0, Math.PI * 2), r.closePath(), r.fill(), r.shadowBlur = 0, r.fillStyle =
|
|
10327
|
+
return r && (r.shadowBlur = 5, r.shadowColor = "#555", r.fillStyle = "#fff", r.beginPath(), r.arc(o / 2, o / 2, a, 0, Math.PI * 2), r.closePath(), r.fill(), r.shadowBlur = 0, r.fillStyle = x.primary, r.beginPath(), r.arc(o / 2, o / 2, a * 0.5, 0, Math.PI * 2), r.closePath(), r.fill()), n;
|
|
10543
10328
|
}
|
|
10544
|
-
const t = new
|
|
10329
|
+
const t = new Rt(e()), i = new Lt({
|
|
10545
10330
|
map: t,
|
|
10546
10331
|
sizeAttenuation: !1
|
|
10547
|
-
}), s = new
|
|
10332
|
+
}), s = new kt(i);
|
|
10548
10333
|
return s.scale.setScalar(0.08), s;
|
|
10549
10334
|
}
|
|
10550
10335
|
makeLine(e, t) {
|
|
10551
|
-
const i = new
|
|
10552
|
-
color: D.hexToThreejsColor(
|
|
10336
|
+
const i = new xi({
|
|
10337
|
+
color: D.hexToThreejsColor(x.primary),
|
|
10553
10338
|
linewidth: 20
|
|
10554
|
-
}), s = [e, t], n = new
|
|
10555
|
-
return new
|
|
10339
|
+
}), s = [e, t], n = new J().setFromPoints(s);
|
|
10340
|
+
return new mt(n, i);
|
|
10556
10341
|
}
|
|
10557
10342
|
makeDistanceSprite(e, t) {
|
|
10558
10343
|
function i(c, h, d, u, p, m) {
|
|
@@ -10562,7 +10347,7 @@ class jn {
|
|
|
10562
10347
|
if (n) {
|
|
10563
10348
|
n.font = "bolder " + r + 'px "Open Sans", Arial';
|
|
10564
10349
|
const h = "~ " + Math.round(e.distanceTo(t)), d = n.measureText(h), u = 20, p = 10, m = 10;
|
|
10565
|
-
s.width = d.width + u * 2 + m * 2, s.height = r + p * 2 + m * 2, n.shadowBlur = 10, n.shadowColor = "#555", n.fillStyle =
|
|
10350
|
+
s.width = d.width + u * 2 + m * 2, s.height = r + p * 2 + m * 2, n.shadowBlur = 10, n.shadowColor = "#555", n.fillStyle = x.primary, i(
|
|
10566
10351
|
n,
|
|
10567
10352
|
m,
|
|
10568
10353
|
m,
|
|
@@ -10571,8 +10356,8 @@ class jn {
|
|
|
10571
10356
|
10
|
|
10572
10357
|
), n.shadowBlur = 0, n.fillStyle = "#fff", n.textAlign = "left", n.textBaseline = "top", n.font = "bolder " + r + 'px "Open Sans", Arial', n.fillText(h, u + m, p + m);
|
|
10573
10358
|
}
|
|
10574
|
-
const o = new
|
|
10575
|
-
new
|
|
10359
|
+
const o = new Rt(s), a = new kt(
|
|
10360
|
+
new Lt({
|
|
10576
10361
|
map: o,
|
|
10577
10362
|
sizeAttenuation: !1
|
|
10578
10363
|
})
|
|
@@ -10588,7 +10373,7 @@ class jn {
|
|
|
10588
10373
|
e.code == "Escape" && (D.clearChildren(this.tempMeasure), this.point1 = null, this.point2 = null, this.tempPoint2 = null, this.viralTools.viralViewerApi.viralRenderer.render());
|
|
10589
10374
|
}
|
|
10590
10375
|
}
|
|
10591
|
-
class
|
|
10376
|
+
class $n {
|
|
10592
10377
|
constructor(e) {
|
|
10593
10378
|
this.viralTools = e;
|
|
10594
10379
|
}
|
|
@@ -10600,7 +10385,7 @@ class Hn {
|
|
|
10600
10385
|
if (e.activate) {
|
|
10601
10386
|
if (t) {
|
|
10602
10387
|
if (t.visible = !0, this.viralTools.viralViewerApi.viralScene.models.length > 0) {
|
|
10603
|
-
const i = new
|
|
10388
|
+
const i = new z().setFromObject(
|
|
10604
10389
|
this.viralTools.viralViewerApi.viralScene.models[0]
|
|
10605
10390
|
), s = new E();
|
|
10606
10391
|
i.getSize(s);
|
|
@@ -10623,14 +10408,14 @@ class Hn {
|
|
|
10623
10408
|
}
|
|
10624
10409
|
}
|
|
10625
10410
|
}
|
|
10626
|
-
class
|
|
10411
|
+
class jn {
|
|
10627
10412
|
constructor(e) {
|
|
10628
10413
|
this.viralViewerApi = e, this.tools = [
|
|
10629
10414
|
{
|
|
10630
10415
|
name: "navigation",
|
|
10631
10416
|
tools: [
|
|
10632
10417
|
{
|
|
10633
|
-
svg: `<svg fill="${
|
|
10418
|
+
svg: `<svg fill="${x.primary}" style="height: 20px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>cursor-move</title><path d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z" /></svg>`,
|
|
10634
10419
|
index: 0,
|
|
10635
10420
|
activate: !0,
|
|
10636
10421
|
allowDehydrated: !1,
|
|
@@ -10639,7 +10424,7 @@ class Fn {
|
|
|
10639
10424
|
}
|
|
10640
10425
|
},
|
|
10641
10426
|
{
|
|
10642
|
-
svg: `<svg fill="${
|
|
10427
|
+
svg: `<svg fill="${x.primary}" style="height: 20px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>nature-people-outline</title><path d="M16 20V16.12C19.47 15.71 22.17 12.76 22.17 9.17C22.17 5.3 19.04 2.17 15.17 2.17C13.31 2.17 11.53 2.91 10.22 4.22C8.91 5.53 8.17 7.31 8.17 9.17C8.17 9.95 8.3 10.69 8.53 11.38C8.64 11.71 8.77 12.03 8.93 12.33C9.91 14.27 11.78 15.68 14 16.06V20H6V17H7V12.95C7 12.72 6.89 12.5 6.74 12.33L6.71 12.29L6.66 12.25C6.5 12.09 6.25 12 6 12H3C2.76 12 2.5 12.09 2.34 12.25L2.29 12.29C2.11 12.5 2 12.74 2 13V17H3V22H19V20H16M15.08 14.22L14.33 14.09C11.96 13.69 10.17 11.64 10.17 9.17C10.17 7.84 10.7 6.57 11.63 5.63C12.57 4.7 13.85 4.17 15.17 4.17C17.93 4.17 20.17 6.41 20.17 9.17C20.17 11.73 18.24 13.84 15.77 14.13L15.08 14.21M4.5 11C5.33 11 6 10.33 6 9.5C6 8.67 5.33 8 4.5 8C3.67 8 3 8.67 3 9.5C3 10.33 3.67 11 4.5 11Z" /></svg>`,
|
|
10643
10428
|
index: 1,
|
|
10644
10429
|
activate: !1,
|
|
10645
10430
|
allowDehydrated: !1,
|
|
@@ -10652,7 +10437,7 @@ class Fn {
|
|
|
10652
10437
|
name: "helper",
|
|
10653
10438
|
tools: [
|
|
10654
10439
|
{
|
|
10655
|
-
svg: `<svg fill="${
|
|
10440
|
+
svg: `<svg fill="${x.primary}" style="height: 20px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>flag-variant-outline</title><path d="M6,3A1,1 0 0,1 7,4V4.88C8.06,4.44 9.5,4 11,4C14,4 14,6 16,6C19,6 20,4 20,4V12C20,12 19,14 16,14C13,14 13,12 11,12C8,12 7,14 7,14V21H5V4A1,1 0 0,1 6,3M7,7.25V11.5C7,11.5 9,10 11,10C13,10 14,12 16,12C18,12 18,11 18,11V7.5C18,7.5 17,8 16,8C14,8 13,6 11,6C9,6 7,7.25 7,7.25Z" /></svg>`,
|
|
10656
10441
|
index: 0,
|
|
10657
10442
|
activate: !1,
|
|
10658
10443
|
allowDehydrated: !1,
|
|
@@ -10660,7 +10445,7 @@ class Fn {
|
|
|
10660
10445
|
action: (t) => this.viralToolElevation.activate(t)
|
|
10661
10446
|
},
|
|
10662
10447
|
{
|
|
10663
|
-
svg: `<svg fill="${
|
|
10448
|
+
svg: `<svg fill="${x.primary}" style="height: 20px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>ruler</title><path d="M1.39,18.36L3.16,16.6L4.58,18L5.64,16.95L4.22,15.54L5.64,14.12L8.11,16.6L9.17,15.54L6.7,13.06L8.11,11.65L9.53,13.06L10.59,12L9.17,10.59L10.59,9.17L13.06,11.65L14.12,10.59L11.65,8.11L13.06,6.7L14.47,8.11L15.54,7.05L14.12,5.64L15.54,4.22L18,6.7L19.07,5.64L16.6,3.16L18.36,1.39L22.61,5.64L5.64,22.61L1.39,18.36Z" /></svg>`,
|
|
10664
10449
|
index: 1,
|
|
10665
10450
|
activate: !1,
|
|
10666
10451
|
allowDehydrated: !1,
|
|
@@ -10668,7 +10453,7 @@ class Fn {
|
|
|
10668
10453
|
action: (t) => this.viralToolMeasure.activate(t)
|
|
10669
10454
|
},
|
|
10670
10455
|
{
|
|
10671
|
-
svg: `<svg fill="${
|
|
10456
|
+
svg: `<svg fill="${x.primary}" style="height: 20px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>vector-intersection</title><path d="M3.14,1A2.14,2.14 0 0,0 1,3.14V5H3V3H5V1H3.14M7,1V3H10V1H7M12,1V3H14V5H16V3.14C16,1.96 15.04,1 13.86,1H12M1,7V10H3V7H1M9,7C7.89,7 7,7.89 7,9C7,11.33 7,16 7,16C7,16 11.57,16 13.86,16A2.14,2.14 0 0,0 16,13.86C16,11.57 16,7 16,7C16,7 11.33,7 9,7M18,7V9H20V11H22V9C22,7.89 21.11,7 20,7H18M9,9H14V14H9V9M1,12V13.86C1,15.04 1.96,16 3.14,16H5V14H3V12H1M20,13V16H22V13H20M7,18V20C7,21.11 7.89,22 9,22H11V20H9V18H7M20,18V20H18V22H20C21.11,22 22,21.11 22,20V18H20M13,20V22H16V20H13Z" /></svg>`,
|
|
10672
10457
|
index: 2,
|
|
10673
10458
|
activate: !1,
|
|
10674
10459
|
allowDehydrated: !1,
|
|
@@ -10682,7 +10467,7 @@ class Fn {
|
|
|
10682
10467
|
name: "environment",
|
|
10683
10468
|
tools: [
|
|
10684
10469
|
{
|
|
10685
|
-
svg: `<svg fill="${
|
|
10470
|
+
svg: `<svg fill="${x.primary}" style="height: 20px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>white-balance-sunny</title><path d="M3.55 19.09L4.96 20.5L6.76 18.71L5.34 17.29M12 6C8.69 6 6 8.69 6 12S8.69 18 12 18 18 15.31 18 12C18 8.68 15.31 6 12 6M20 13H23V11H20M17.24 18.71L19.04 20.5L20.45 19.09L18.66 17.29M20.45 5L19.04 3.6L17.24 5.39L18.66 6.81M13 1H11V4H13M6.76 5.39L4.96 3.6L3.55 5L5.34 6.81L6.76 5.39M1 13H4V11H1M13 20H11V23H13" /></svg>`,
|
|
10686
10471
|
index: 0,
|
|
10687
10472
|
activate: !1,
|
|
10688
10473
|
allowDehydrated: !1,
|
|
@@ -10690,7 +10475,7 @@ class Fn {
|
|
|
10690
10475
|
action: (t) => this.viralToolSunlight.activate(t)
|
|
10691
10476
|
},
|
|
10692
10477
|
{
|
|
10693
|
-
svg: `<svg fill="${
|
|
10478
|
+
svg: `<svg fill="${x.primary}" style="height: 20px;" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M480-120q-75 0-140.5-28.5t-114-77q-48.5-48.5-77-114T120-480q0-75 28.5-140.5t77-114q48.5-48.5 114-77T480-840q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-480q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-120ZM200-480q0 83 44.5 152T365-225q-42-51-63.5-120T280-492q0-66 16-125t46-107q-66 38-104 103t-38 141Zm348 272q75-19 130-74t74-130L548-208Zm-67-18 278-278q-2-14-4-28.5t-7-28.5L444-257q8 9 17.5 16.5T481-226Zm-74-79 315-315q-6-10-12-19.5T696-658L385-348q5 11 10.5 21.5T407-305Zm-40-108 286-287q-10-8-19.5-14.5T613-727L360-474q1 16 2.5 31t4.5 30Zm0-152 185-186q-15-4-30-6t-30-3q-49 29-81 79t-44 116Zm-25-159Z"/></svg>`,
|
|
10694
10479
|
index: 1,
|
|
10695
10480
|
activate: !1,
|
|
10696
10481
|
allowDehydrated: !1,
|
|
@@ -10703,7 +10488,7 @@ class Fn {
|
|
|
10703
10488
|
name: "theme",
|
|
10704
10489
|
tools: [
|
|
10705
10490
|
{
|
|
10706
|
-
svg: `<svg fill="${
|
|
10491
|
+
svg: `<svg fill="${x.primary}" style="height: 20px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>moon-waning-crescent</title><path d="M2 12A10 10 0 0 0 15 21.54A10 10 0 0 1 15 2.46A10 10 0 0 0 2 12Z" /></svg>`,
|
|
10707
10492
|
index: 0,
|
|
10708
10493
|
activate: !1,
|
|
10709
10494
|
allowDehydrated: !0,
|
|
@@ -10716,7 +10501,7 @@ class Fn {
|
|
|
10716
10501
|
name: "debug",
|
|
10717
10502
|
tools: [
|
|
10718
10503
|
{
|
|
10719
|
-
svg: `<svg fill="${
|
|
10504
|
+
svg: `<svg fill="${x.primary}" style="height: 20px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>cube-scan</title><path d="M17 22L22 19V13L17 16V22M17 8V2L22 5V11L17 8M1 8L6 11L11 8L6 5L1 8M6 13L1 10V16L6 19V13M13 16L8 13V19L13 22V16M13 8L8 5V11L13 8Z" /></svg>`,
|
|
10720
10505
|
index: 0,
|
|
10721
10506
|
activate: !1,
|
|
10722
10507
|
allowDehydrated: !1,
|
|
@@ -10727,7 +10512,7 @@ class Fn {
|
|
|
10727
10512
|
}
|
|
10728
10513
|
]
|
|
10729
10514
|
}
|
|
10730
|
-
], this.items = [], this.viralToolAvatar = new
|
|
10515
|
+
], this.items = [], this.viralToolAvatar = new kn(this), this.viralToolDarkMode = new Bn(this), this.viralToolSunlight = new $n(this), this.viralToolElevation = new zn(this), this.viralToolMeasure = new Nn(this), this.viralToolAmbientOcclusion = new Ln(this), this.dehydratedCachedData(), this.executeToolsByDefault(), this.injectTools(), this.viralViewerApi.emit(R.LOADED_TOOLS);
|
|
10731
10516
|
}
|
|
10732
10517
|
//#region Init
|
|
10733
10518
|
injectTools() {
|
|
@@ -10741,7 +10526,7 @@ class Fn {
|
|
|
10741
10526
|
const i = this.tools[t], s = document.createElement("div");
|
|
10742
10527
|
s.setAttribute(
|
|
10743
10528
|
"style",
|
|
10744
|
-
`padding: 8px 10px 10px 10px; display: flex;flex-direction: row;justify-content: center; align-items: center; background-color: ${
|
|
10529
|
+
`padding: 8px 10px 10px 10px; display: flex;flex-direction: row;justify-content: center; align-items: center; background-color: ${x.background}; border-radius: 10px; pointer-events: visible;margin: 0 2.5px;`
|
|
10745
10530
|
);
|
|
10746
10531
|
for (let n = 0; n < i.tools.length; n++) {
|
|
10747
10532
|
const r = i.tools[n], o = document.createElement("div");
|
|
@@ -10754,10 +10539,10 @@ class Fn {
|
|
|
10754
10539
|
const a = document.createElement("div");
|
|
10755
10540
|
a.setAttribute(
|
|
10756
10541
|
"style",
|
|
10757
|
-
`border-top: 2px solid ; padding-bottom: 2px; border-color: ${
|
|
10542
|
+
`border-top: 2px solid ; padding-bottom: 2px; border-color: ${x.background};`
|
|
10758
10543
|
), r.activate && a.setAttribute(
|
|
10759
10544
|
"style",
|
|
10760
|
-
`border-top: 2px solid ; padding-bottom: 2px; border-color: ${
|
|
10545
|
+
`border-top: 2px solid ; padding-bottom: 2px; border-color: ${x.secondary};`
|
|
10761
10546
|
), o.appendChild(a);
|
|
10762
10547
|
const l = document.createElement("div");
|
|
10763
10548
|
l.setAttribute(
|
|
@@ -10771,8 +10556,8 @@ class Fn {
|
|
|
10771
10556
|
}, l.onmouseleave = () => {
|
|
10772
10557
|
l.style.setProperty("background-color", "unset");
|
|
10773
10558
|
};
|
|
10774
|
-
const c =
|
|
10775
|
-
r.activate && c && c.setAttribute("fill", `${
|
|
10559
|
+
const c = vt.createElementFromHTML(r.svg);
|
|
10560
|
+
r.activate && c && c.setAttribute("fill", `${x.secondary}`), l.appendChild(c), o.appendChild(l), s.appendChild(o);
|
|
10776
10561
|
}
|
|
10777
10562
|
e.appendChild(s);
|
|
10778
10563
|
}
|
|
@@ -10806,12 +10591,12 @@ class Fn {
|
|
|
10806
10591
|
if (s) {
|
|
10807
10592
|
s.activate = !s.activate;
|
|
10808
10593
|
const n = t.children[0], o = t.children[1].children[0];
|
|
10809
|
-
s.activate ? (n.style.setProperty("border-color", `${
|
|
10594
|
+
s.activate ? (n.style.setProperty("border-color", `${x.secondary}`), o.setAttribute("fill", `${x.secondary}`)) : (n.style.setProperty("border-color", `${x.background}`), o.setAttribute("fill", `${x.primary}`)), s.action(s);
|
|
10810
10595
|
}
|
|
10811
10596
|
}
|
|
10812
10597
|
//#endregion
|
|
10813
10598
|
}
|
|
10814
|
-
class
|
|
10599
|
+
class Hn {
|
|
10815
10600
|
set(e, t) {
|
|
10816
10601
|
localStorage[e] = t;
|
|
10817
10602
|
}
|
|
@@ -10860,7 +10645,7 @@ class Wn {
|
|
|
10860
10645
|
localStorage.clear();
|
|
10861
10646
|
}
|
|
10862
10647
|
}
|
|
10863
|
-
class
|
|
10648
|
+
class xr extends $s {
|
|
10864
10649
|
constructor(e = {
|
|
10865
10650
|
isDev: !1,
|
|
10866
10651
|
cameraZUp: !1,
|
|
@@ -10872,12 +10657,12 @@ class Er extends Ns {
|
|
|
10872
10657
|
adaptiveEdges: !0,
|
|
10873
10658
|
adaptiveAmbientOcclusion: !0
|
|
10874
10659
|
}) {
|
|
10875
|
-
super(), this.viralCompressProcessor = new
|
|
10660
|
+
super(), this.viralCompressProcessor = new Ms(), this.localStorageService = new Hn(), this.viralStats = null, this.viralSectionBox = null, this.viralBatchDebugPanel = null, this.viralRenderDebugPanel = null, this.viralInstancedDebugPanel = null, this.options = e, this.viralLifecycleEventHandler = new Fs(this, this.options), this.targetElement = e.container, An("QUICK_SAND"), _n(this.targetElement, "QUICK_SAND"), this.options.enableTools && (this.viralTools = new jn(this)), this.viralSpinner = new Rn(this), this.viralDraggableModal = new Cn(this), this.viralContextMenu = new Sn(this), this.viralPivotPoint = new Dn(this), this.viralScene = new yn(this), this.viralMaterialManager = new an(this), this.viralRenderer = new wn(this), this.viralCamera = new xs(this), this.options.enableNavigationCube && (this.viralNavigationCube = new On(
|
|
10876
10661
|
this,
|
|
10877
10662
|
this.options.navigationCubeScale || 1
|
|
10878
|
-
)), this.viralMouse = new
|
|
10663
|
+
)), this.viralMouse = new Hs(this), this.viralKeyboard = new js(this), this.viralAnimation = new ms(this), this.viralVisibilityManager = new En(this), this.viralCentralizedEventHandler = new Ws(this), this.viralLoader = new rn(this), this.viralBVH = new ws(), this.viralDataManager = new Ns(this), this.viralAvatarManager = new bs(this), this.options.isDev && (this.viralStats = new Mn(this)), this.options.isDev ? this.viralAnimation.devAnimation() : this.viralAnimation.animation();
|
|
10879
10664
|
const t = window;
|
|
10880
|
-
t.VIRAL_VIEWER = this, this.viralSectionBox = new Vt(this), this.viralBatchDebugPanel = new
|
|
10665
|
+
t.VIRAL_VIEWER = this, this.viralSectionBox = new Vt(this), this.viralBatchDebugPanel = new ds(this), this.viralRenderDebugPanel = new ps(this), this.viralInstancedDebugPanel = new us(this), this.options.isDev && import("./lil-gui.esm-BtfdsiIY.mjs").then(({ GUI: i }) => {
|
|
10881
10666
|
var b, w, S, A, C;
|
|
10882
10667
|
const s = new i({ title: "Controls" }), n = s.addFolder("Sun Light");
|
|
10883
10668
|
n.add(this.viralScene.sunLight, "visible").onChange(() => {
|
|
@@ -11057,46 +10842,46 @@ class Er extends Ns {
|
|
|
11057
10842
|
// Disable - most expensive
|
|
11058
10843
|
};
|
|
11059
10844
|
I.addColor(O, "edgeColor").name("Edge Color").onChange((V) => {
|
|
11060
|
-
var
|
|
11061
|
-
(
|
|
10845
|
+
var P;
|
|
10846
|
+
(P = this.viralRenderer.postProcessingRenderer) == null || P.setScreenSpaceEdgeColor(
|
|
11062
10847
|
parseInt(V.replace("#", "0x"))
|
|
11063
10848
|
), this.viralRenderer.render();
|
|
11064
10849
|
}), I.add(O, "edgeOpacity", 0, 1, 0.05).name("Opacity").onChange((V) => {
|
|
11065
|
-
var
|
|
11066
|
-
(
|
|
10850
|
+
var P;
|
|
10851
|
+
(P = this.viralRenderer.postProcessingRenderer) == null || P.setScreenSpaceEdgeOpacity(V), this.viralRenderer.render();
|
|
11067
10852
|
}), I.add(O, "edgeThickness", 0.5, 5, 0.1).name("Thickness").onChange((V) => {
|
|
11068
|
-
var
|
|
11069
|
-
(
|
|
10853
|
+
var P;
|
|
10854
|
+
(P = this.viralRenderer.postProcessingRenderer) == null || P.setScreenSpaceEdgeThickness(
|
|
11070
10855
|
V
|
|
11071
10856
|
), this.viralRenderer.render();
|
|
11072
10857
|
}), I.add(O, "depthMultiplier", 0, 3, 0.1).name("Depth Sensitivity").onChange((V) => {
|
|
11073
|
-
var
|
|
11074
|
-
(
|
|
10858
|
+
var P;
|
|
10859
|
+
(P = this.viralRenderer.postProcessingRenderer) == null || P.setScreenSpaceEdgesOptions({
|
|
11075
10860
|
depthMultiplier: V
|
|
11076
10861
|
}), this.viralRenderer.render();
|
|
11077
10862
|
}), I.add(O, "normalMultiplier", 0, 3, 0.1).name("Normal Sensitivity").onChange((V) => {
|
|
11078
|
-
var
|
|
11079
|
-
(
|
|
10863
|
+
var P;
|
|
10864
|
+
(P = this.viralRenderer.postProcessingRenderer) == null || P.setScreenSpaceEdgesOptions({
|
|
11080
10865
|
normalMultiplier: V
|
|
11081
10866
|
}), this.viralRenderer.render();
|
|
11082
10867
|
}), I.add(O, "normalBias", 0, 1, 0.01).name("Normal Bias").onChange((V) => {
|
|
11083
|
-
var
|
|
11084
|
-
(
|
|
10868
|
+
var P;
|
|
10869
|
+
(P = this.viralRenderer.postProcessingRenderer) == null || P.setScreenSpaceEdgesOptions({
|
|
11085
10870
|
normalBias: V
|
|
11086
10871
|
}), this.viralRenderer.render();
|
|
11087
10872
|
}), I.add(O, "enableDepthEdges").name("Depth Edges").onChange((V) => {
|
|
11088
|
-
var
|
|
11089
|
-
(
|
|
10873
|
+
var P;
|
|
10874
|
+
(P = this.viralRenderer.postProcessingRenderer) == null || P.setScreenSpaceEdgeMethods({
|
|
11090
10875
|
depth: V
|
|
11091
10876
|
}), this.viralRenderer.render();
|
|
11092
10877
|
}), I.add(O, "enableNormalEdges").name("Normal Edges").onChange((V) => {
|
|
11093
|
-
var
|
|
11094
|
-
(
|
|
10878
|
+
var P;
|
|
10879
|
+
(P = this.viralRenderer.postProcessingRenderer) == null || P.setScreenSpaceEdgeMethods({
|
|
11095
10880
|
normal: V
|
|
11096
10881
|
}), this.viralRenderer.render();
|
|
11097
10882
|
}), I.add(O, "enableObjectIdEdges").name("Object ID Edges").onChange((V) => {
|
|
11098
|
-
var
|
|
11099
|
-
(
|
|
10883
|
+
var P;
|
|
10884
|
+
(P = this.viralRenderer.postProcessingRenderer) == null || P.setScreenSpaceEdgeMethods({
|
|
11100
10885
|
objectId: V
|
|
11101
10886
|
}), this.viralRenderer.render();
|
|
11102
10887
|
});
|
|
@@ -11105,37 +10890,37 @@ class Er extends Ns {
|
|
|
11105
10890
|
}
|
|
11106
10891
|
}
|
|
11107
10892
|
export {
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
10893
|
+
mr as BufferElement,
|
|
10894
|
+
cs as CheckClashResult,
|
|
10895
|
+
ls as CompareModelsResult,
|
|
10896
|
+
os as DataTree,
|
|
10897
|
+
yr as DebouncedEventHandler,
|
|
10898
|
+
ss as DefaultLightConfiguration,
|
|
11114
10899
|
It as Dictionary,
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
10900
|
+
ur as ElementFragment,
|
|
10901
|
+
dr as Fragment,
|
|
10902
|
+
hs as GroupByResult,
|
|
10903
|
+
vt as HTMLUtil,
|
|
11119
10904
|
Q as LogUtil,
|
|
11120
10905
|
D as THREEUtil,
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
10906
|
+
wr as TreeNode,
|
|
10907
|
+
ts as ViralBIMWorld,
|
|
10908
|
+
ds as ViralBatchDebugPanel,
|
|
10909
|
+
Z as ViralBatchedMesh,
|
|
10910
|
+
X as ViralCameraEventType,
|
|
10911
|
+
us as ViralInstancedDebugPanel,
|
|
11127
10912
|
me as ViralKeyboardEventType,
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
10913
|
+
k as ViralMouseEventType,
|
|
10914
|
+
re as ViralPoint,
|
|
10915
|
+
ps as ViralRenderDebugPanel,
|
|
10916
|
+
xr as ViralViewerApi,
|
|
10917
|
+
pr as ViralViewerRevitGeometry,
|
|
10918
|
+
hr as ViralViewerRevitNoneStructuralGeometry,
|
|
10919
|
+
is as ViralutionBox,
|
|
10920
|
+
Xt as ViralutionCamera,
|
|
10921
|
+
gr as ViralutionElement,
|
|
11137
10922
|
R as ViralutionEvent,
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
10923
|
+
vr as ViralutionSolid,
|
|
10924
|
+
fr as ViralutionStandaloneModel,
|
|
10925
|
+
br as ViralutionTrackingModel
|
|
11141
10926
|
};
|