viral-viewer-2 7.2.2 → 7.2.3
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 +12 -0
- package/dist/components/custom-objects/viral-instanced-mesh-v2.d.ts +20 -1
- package/dist/components/post-processing/alpha-selection-outline-pass.d.ts +49 -0
- package/dist/components/post-processing/post-processing-renderer.d.ts +41 -0
- package/dist/components/post-processing/stencil-selection-outline-pass.d.ts +54 -0
- package/dist/components/visibility-manager/viral-visibility-manager.d.ts +34 -0
- package/dist/index.mjs +1055 -724
- package/package.json +1 -1
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 N, Mesh as x, BufferAttribute as L, BufferGeometry as Z, EdgesGeometry as Et, MeshBasicMaterial as G, PointLight as Ht, Object3D as Ft, InstancedMesh as le, Color as k, InstancedBufferAttribute as je, Matrix4 as re, LineSegments as yt, Line as gt, Points as St, Clock as ii, AnimationMixer as si, Vector2 as z, Vector4 as ni, Quaternion as ri, Spherical as Wt, Sphere as Gt, Raycaster as Tt, MathUtils as ai, PerspectiveCamera as Fe, OrthographicCamera as Ct, Euler as oi, MeshPhongMaterial as ft, FrontSide as li, MeshStandardMaterial as J, DoubleSide as te, ObjectLoader as ci, ShaderMaterial as ee, WebGLRenderTarget as ue, DepthTexture as At, UnsignedShortType as _t, MeshNormalMaterial as hi, RGBAFormat as Ut, HalfFloatType as qt, NearestFilter as Rt, Scene as vt, WebGLRenderer as Qt, SRGBColorSpace as di, VSMShadowMap as ui, SphereGeometry as Lt, DirectionalLight as pt, AmbientLight as pi, CameraHelper as mi, BoxGeometry as Pt, AxesHelper as gi, BoxHelper as fi, Box3Helper as vi, PlaneGeometry as oe, Plane as he, Fog as bi, PointsMaterial as wi, LOD as yi, TextureLoader as xi, CanvasTexture as kt, SpriteMaterial as Bt, Sprite as zt, LineBasicMaterial as Mi } from "three";
|
|
2
|
+
import { SimplifyModifier as Ei } from "three/examples/jsm/modifiers/SimplifyModifier";
|
|
3
|
+
import { LineSegmentsGeometry as Zt, LineSegments2 as Yt, SSAARenderPass as Si, FXAAShader as Ci, TAARenderPass as Ai, SAOPass as _i, SSAOPass as mt } from "three/examples/jsm/Addons";
|
|
4
|
+
import { computeBoundsTree as Ii, disposeBoundsTree as Vi, acceleratedRaycast as Ti } from "three-mesh-bvh";
|
|
5
5
|
import pe from "camera-controls";
|
|
6
|
-
import { 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 Oi } from "pako";
|
|
7
|
+
import { Potree as Di, PointSizeType as Ri, PointShape as Li, PointColorType as ki } from "potree-core-viral";
|
|
8
|
+
import { GLTFLoader as Bi } from "three/examples/jsm/loaders/GLTFLoader";
|
|
9
|
+
import { LineMaterial as Xt } from "three/examples/jsm/lines/LineMaterial";
|
|
10
|
+
import { N8AOPass as zi } from "n8ao";
|
|
11
|
+
import { EffectComposer as Ni } from "three/examples/jsm/postprocessing/EffectComposer";
|
|
12
|
+
import { OutlinePass as $i } from "three/examples/jsm/postprocessing/OutlinePass";
|
|
13
|
+
import { OutputPass as ji } from "three/examples/jsm/postprocessing/OutputPass";
|
|
14
|
+
import { RenderPass as Hi } 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 Fi } 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 Ot, FullScreenQuad as Dt } from "three/examples/jsm/postprocessing/Pass";
|
|
19
|
+
import { TransformControls as Gi } from "three/examples/jsm/controls/TransformControls";
|
|
20
|
+
import { LineSegments2 as Ui } from "three/examples/jsm/lines/LineSegments2";
|
|
21
|
+
import { LineSegmentsGeometry as qi } from "three/examples/jsm/lines/LineSegmentsGeometry";
|
|
22
|
+
class bt {
|
|
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
|
+
}, y = Qi;
|
|
41
41
|
class Q {
|
|
42
42
|
static information(e) {
|
|
43
43
|
console.log(
|
|
44
44
|
`%c ${e}`,
|
|
45
|
-
`color: ${
|
|
45
|
+
`color: ${y.primary}; background: ${y.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: ${y.accent}; background: ${y.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 N();
|
|
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 Ei();
|
|
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 x(s, e.material);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
const
|
|
126
|
-
class Y extends
|
|
125
|
+
const Zi = D.hexToRGB(y.accent), Yi = 0.99;
|
|
126
|
+
class Y extends x {
|
|
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
|
}
|
|
@@ -369,8 +369,8 @@ class Y extends y {
|
|
|
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 Zt();
|
|
373
|
+
r.setPositions(i), this._edgeLines = new Yt(r, this._edgeMaterial), this.add(this._edgeLines);
|
|
374
374
|
}
|
|
375
375
|
/** Show edges ONLY for the given elements */
|
|
376
376
|
isolateEdge(e) {
|
|
@@ -429,13 +429,43 @@ class Y extends y {
|
|
|
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, Zi), this._setSelectionAlpha(this._selectedElements, Yi);
|
|
433
433
|
}
|
|
434
434
|
get selectedElements() {
|
|
435
435
|
return this._selectedElements;
|
|
436
436
|
}
|
|
437
437
|
unselect() {
|
|
438
|
-
this._selectedElements.length !== 0 && (this.resetColor(this._selectedElements), this._selectedElements = []);
|
|
438
|
+
this._selectedElements.length !== 0 && (this._setSelectionAlpha(this._selectedElements, 1), this.resetColor(this._selectedElements), this._selectedElements = []);
|
|
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
|
+
}
|
|
439
469
|
}
|
|
440
470
|
//#endregion
|
|
441
471
|
//#region Hide/Isolate/Show
|
|
@@ -625,7 +655,7 @@ class Y extends y {
|
|
|
625
655
|
depthWrite: !0,
|
|
626
656
|
side: e == null ? void 0 : e.side
|
|
627
657
|
});
|
|
628
|
-
this._depthPrePassMesh = new
|
|
658
|
+
this._depthPrePassMesh = new x(this.geometry, t), this._depthPrePassMesh.renderOrder = 0, this._depthPrePassMesh.matrixAutoUpdate = !1, this._depthPrePassMesh.matrixWorld.copy(this.matrixWorld), this.parent && this.parent.add(this._depthPrePassMesh);
|
|
629
659
|
}
|
|
630
660
|
/**
|
|
631
661
|
* Remove and dispose the depth pre-pass mesh
|
|
@@ -957,7 +987,7 @@ class Y extends y {
|
|
|
957
987
|
}
|
|
958
988
|
});
|
|
959
989
|
const t = D.getCenterPoint(e), i = this.getFarthestDistance(t, e);
|
|
960
|
-
t && !this._pointLight && (this._pointLight = new
|
|
990
|
+
t && !this._pointLight && (this._pointLight = new Ht(16562741, 1, i, 0.1), this._pointLight.position.copy(t), this.add(this._pointLight)), this._isGeneratedLights = !0;
|
|
961
991
|
}
|
|
962
992
|
this._pointLight && (this._pointLight.visible = !0);
|
|
963
993
|
}
|
|
@@ -992,7 +1022,7 @@ class Y extends y {
|
|
|
992
1022
|
);
|
|
993
1023
|
if (t.length === 0)
|
|
994
1024
|
return null;
|
|
995
|
-
const i = new
|
|
1025
|
+
const i = new N(), s = new E();
|
|
996
1026
|
for (const n of t)
|
|
997
1027
|
if (n.buffer)
|
|
998
1028
|
for (let r = 0; r < n.buffer.length; r += 3)
|
|
@@ -1086,12 +1116,12 @@ class Y extends y {
|
|
|
1086
1116
|
}), 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;
|
|
1087
1117
|
}
|
|
1088
1118
|
}
|
|
1089
|
-
let
|
|
1090
|
-
class
|
|
1119
|
+
let Xi = 1;
|
|
1120
|
+
class Nt {
|
|
1091
1121
|
constructor(e) {
|
|
1092
1122
|
this._worker = new Worker(e), this._worker.onmessage = (t) => {
|
|
1093
1123
|
this._OnMessage(t);
|
|
1094
|
-
}, this._resolve = null, this._id =
|
|
1124
|
+
}, this._resolve = null, this._id = Xi++;
|
|
1095
1125
|
}
|
|
1096
1126
|
_OnMessage(e) {
|
|
1097
1127
|
const t = this._resolve;
|
|
@@ -1107,14 +1137,14 @@ class Bt {
|
|
|
1107
1137
|
this._worker.terminate();
|
|
1108
1138
|
}
|
|
1109
1139
|
}
|
|
1110
|
-
class
|
|
1140
|
+
class ie {
|
|
1111
1141
|
/**
|
|
1112
1142
|
*
|
|
1113
1143
|
* @param maxSize maximum number of worker
|
|
1114
1144
|
* @param scriptPath javascript path for worker execute
|
|
1115
1145
|
*/
|
|
1116
1146
|
constructor(e, t) {
|
|
1117
|
-
this._workers = [], this.maximumNumberOfWorker = e, this.scriptPath = t, this._workers.push(new
|
|
1147
|
+
this._workers = [], this.maximumNumberOfWorker = e, this.scriptPath = t, this._workers.push(new Nt(t)), this._free = [...this._workers], this._busy = {}, this._queue = [];
|
|
1118
1148
|
}
|
|
1119
1149
|
get length() {
|
|
1120
1150
|
return this._workers.length;
|
|
@@ -1133,7 +1163,7 @@ class te {
|
|
|
1133
1163
|
_PumpQueue() {
|
|
1134
1164
|
for (; this._queue.length > 0; ) {
|
|
1135
1165
|
if (this._free.length == 0 && this._workers.length < this.maximumNumberOfWorker) {
|
|
1136
|
-
const s = new
|
|
1166
|
+
const s = new Nt(this.scriptPath);
|
|
1137
1167
|
this._workers.push(s), this._free.push(s);
|
|
1138
1168
|
}
|
|
1139
1169
|
if (this._free.length == 0)
|
|
@@ -1150,7 +1180,7 @@ class te {
|
|
|
1150
1180
|
this._workers.forEach((e) => e.dispose()), this._workers = [], this._free = [], this._busy = {}, this._queue = [];
|
|
1151
1181
|
}
|
|
1152
1182
|
}
|
|
1153
|
-
const
|
|
1183
|
+
const Ki = D.hexToRGB(y.accent), Ge = class Ge extends Ft {
|
|
1154
1184
|
constructor(e) {
|
|
1155
1185
|
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);
|
|
1156
1186
|
}
|
|
@@ -1191,23 +1221,25 @@ const Yi = D.hexToRGB(x.accent), Fe = class Fe extends $t {
|
|
|
1191
1221
|
);
|
|
1192
1222
|
}
|
|
1193
1223
|
_createInstancedMesh(e, t, i) {
|
|
1194
|
-
const s = this._createGeometryFromBuffer(e.buffer), n = new
|
|
1195
|
-
t.forEach(({ element:
|
|
1196
|
-
const
|
|
1197
|
-
n.setMatrixAt(
|
|
1198
|
-
const
|
|
1199
|
-
this._originalTransforms.has(
|
|
1200
|
-
const
|
|
1201
|
-
r[
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1224
|
+
const s = this._createGeometryFromBuffer(e.buffer), n = new le(s, this.material, t.length), r = new Float32Array(t.length * 3);
|
|
1225
|
+
t.forEach(({ element: l, instanceData: c }, h) => {
|
|
1226
|
+
const d = this._transformArrayToMatrix4(c.transform);
|
|
1227
|
+
n.setMatrixAt(h, d);
|
|
1228
|
+
const u = l.modelId.toString(), p = c.elementId;
|
|
1229
|
+
this._originalTransforms.has(u) || this._originalTransforms.set(u, /* @__PURE__ */ new Map()), this._originalTransforms.get(u).set(p, d.clone());
|
|
1230
|
+
const m = this._originalColor || new k(1, 1, 1);
|
|
1231
|
+
r[h * 3] = m.r, r[h * 3 + 1] = m.g, r[h * 3 + 2] = m.b, this._elementMap.has(u) || this._elementMap.set(u, /* @__PURE__ */ new Map());
|
|
1232
|
+
const f = this._elementMap.get(u);
|
|
1233
|
+
f.has(p) || f.set(p, []), f.get(p).push({
|
|
1204
1234
|
geometryKey: i,
|
|
1205
|
-
instanceIndex:
|
|
1235
|
+
instanceIndex: h,
|
|
1206
1236
|
instancedMesh: n
|
|
1207
1237
|
});
|
|
1208
|
-
}), n.instanceColor = new
|
|
1238
|
+
}), n.instanceColor = new je(r, 3), n.instanceMatrix.needsUpdate = !0;
|
|
1209
1239
|
const o = new Float32Array(t.length);
|
|
1210
|
-
|
|
1240
|
+
o.fill(1), s.setAttribute("instanceOpacity", new je(o, 1));
|
|
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;
|
|
1211
1243
|
}
|
|
1212
1244
|
_createGeometryFromBuffer(e) {
|
|
1213
1245
|
const t = new Z();
|
|
@@ -1229,9 +1261,9 @@ const Yi = D.hexToRGB(x.accent), Fe = class Fe extends $t {
|
|
|
1229
1261
|
}
|
|
1230
1262
|
_transformArrayToMatrix4(e) {
|
|
1231
1263
|
if (e.length === 16)
|
|
1232
|
-
return new
|
|
1264
|
+
return new re().fromArray(e);
|
|
1233
1265
|
if (e.length === 12) {
|
|
1234
|
-
const t = new
|
|
1266
|
+
const t = new re();
|
|
1235
1267
|
return t.set(
|
|
1236
1268
|
e[0],
|
|
1237
1269
|
e[1],
|
|
@@ -1251,7 +1283,7 @@ const Yi = D.hexToRGB(x.accent), Fe = class Fe extends $t {
|
|
|
1251
1283
|
1
|
|
1252
1284
|
), t;
|
|
1253
1285
|
} else
|
|
1254
|
-
return console.warn("Unsupported transform array length:", e.length), new
|
|
1286
|
+
return console.warn("Unsupported transform array length:", e.length), new re().identity();
|
|
1255
1287
|
}
|
|
1256
1288
|
_generateGeometryKey(e) {
|
|
1257
1289
|
let t = e.length.toString();
|
|
@@ -1267,10 +1299,29 @@ const Yi = D.hexToRGB(x.accent), Fe = class Fe extends $t {
|
|
|
1267
1299
|
}
|
|
1268
1300
|
//#region Selection and Color Control
|
|
1269
1301
|
select(e, t = []) {
|
|
1270
|
-
this.unselect(), this._selectedElements = e, this.changeColor(this._selectedElements,
|
|
1302
|
+
this.unselect(), this._selectedElements = e, this.changeColor(this._selectedElements, Ki), this._setInstanceSelection(this._selectedElements, 1);
|
|
1271
1303
|
}
|
|
1272
1304
|
unselect() {
|
|
1273
|
-
this._selectedElements.length > 0 && (this.resetColor(this._selectedElements), this._selectedElements = []);
|
|
1305
|
+
this._selectedElements.length > 0 && (this._setInstanceSelection(this._selectedElements, 0), this.resetColor(this._selectedElements), this._selectedElements = []);
|
|
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
|
+
}
|
|
1274
1325
|
}
|
|
1275
1326
|
/**
|
|
1276
1327
|
* Changes the color of multiple elements.
|
|
@@ -1394,7 +1445,7 @@ const Yi = D.hexToRGB(x.accent), Fe = class Fe extends $t {
|
|
|
1394
1445
|
var r;
|
|
1395
1446
|
const n = (r = this._elementMap.get(i)) == null ? void 0 : r.get(s);
|
|
1396
1447
|
n && n.forEach(({ instancedMesh: o, instanceIndex: a }) => {
|
|
1397
|
-
o.setMatrixAt(a,
|
|
1448
|
+
o.setMatrixAt(a, Ge.ZERO_MATRIX), o.instanceMatrix.needsUpdate = !0;
|
|
1398
1449
|
});
|
|
1399
1450
|
}));
|
|
1400
1451
|
}
|
|
@@ -1412,7 +1463,7 @@ const Yi = D.hexToRGB(x.accent), Fe = class Fe extends $t {
|
|
|
1412
1463
|
this._isolatedSet.add(s);
|
|
1413
1464
|
}), this._isolatingElements = [...t], this._isolatedSet.size === 0 ? (this.visible = !1, this._isolatingElements) : (this._instancedMeshes.forEach((i) => {
|
|
1414
1465
|
for (let s = 0; s < i.count; s++)
|
|
1415
|
-
i.setMatrixAt(s,
|
|
1466
|
+
i.setMatrixAt(s, Ge.ZERO_MATRIX);
|
|
1416
1467
|
i.instanceMatrix.needsUpdate = !0;
|
|
1417
1468
|
}), t.forEach(({ modelId: i, elementId: s }) => {
|
|
1418
1469
|
var o, a;
|
|
@@ -1482,7 +1533,10 @@ const Yi = D.hexToRGB(x.accent), Fe = class Fe extends $t {
|
|
|
1482
1533
|
//#endregion
|
|
1483
1534
|
//#region Opacity Control (Per-Instance Transparency)
|
|
1484
1535
|
/**
|
|
1485
|
-
* Inject per-instance opacity shader into material
|
|
1536
|
+
* Inject per-instance opacity and selection shader into material
|
|
1537
|
+
* Enables:
|
|
1538
|
+
* - Per-instance opacity (ghosting, hiding)
|
|
1539
|
+
* - Selection alpha marker (for fast outline detection via AlphaSelectionOutlinePass)
|
|
1486
1540
|
* Must be called after material is set and before rendering
|
|
1487
1541
|
*/
|
|
1488
1542
|
injectOpacityShader() {
|
|
@@ -1494,19 +1548,28 @@ const Yi = D.hexToRGB(x.accent), Fe = class Fe extends $t {
|
|
|
1494
1548
|
"#include <common>",
|
|
1495
1549
|
`#include <common>
|
|
1496
1550
|
attribute float instanceOpacity;
|
|
1497
|
-
|
|
1551
|
+
attribute float instanceSelected;
|
|
1552
|
+
varying float vInstanceOpacity;
|
|
1553
|
+
varying float vInstanceSelected;`
|
|
1498
1554
|
), t.vertexShader = t.vertexShader.replace(
|
|
1499
1555
|
"#include <begin_vertex>",
|
|
1500
1556
|
`#include <begin_vertex>
|
|
1501
|
-
vInstanceOpacity = instanceOpacity
|
|
1557
|
+
vInstanceOpacity = instanceOpacity;
|
|
1558
|
+
vInstanceSelected = instanceSelected;`
|
|
1502
1559
|
), t.fragmentShader = t.fragmentShader.replace(
|
|
1503
1560
|
"#include <common>",
|
|
1504
1561
|
`#include <common>
|
|
1505
|
-
varying float vInstanceOpacity
|
|
1562
|
+
varying float vInstanceOpacity;
|
|
1563
|
+
varying float vInstanceSelected;`
|
|
1506
1564
|
), t.fragmentShader = t.fragmentShader.replace(
|
|
1507
1565
|
"#include <dithering_fragment>",
|
|
1508
1566
|
`#include <dithering_fragment>
|
|
1567
|
+
// Apply per-instance opacity
|
|
1509
1568
|
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
|
+
}
|
|
1510
1573
|
if (gl_FragColor.a < 0.01) discard;`
|
|
1511
1574
|
);
|
|
1512
1575
|
}, e._opacityInjected = !0, e.needsUpdate = !0);
|
|
@@ -1519,11 +1582,25 @@ if (gl_FragColor.a < 0.01) discard;`
|
|
|
1519
1582
|
if (!e.geometry.getAttribute("instanceOpacity")) {
|
|
1520
1583
|
const t = new Float32Array(e.count);
|
|
1521
1584
|
t.fill(1);
|
|
1522
|
-
const i = new
|
|
1585
|
+
const i = new je(t, 1);
|
|
1523
1586
|
e.geometry.setAttribute("instanceOpacity", i);
|
|
1524
1587
|
}
|
|
1525
1588
|
});
|
|
1526
1589
|
}
|
|
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
|
+
}
|
|
1527
1604
|
/**
|
|
1528
1605
|
* Update opacity for specific instances
|
|
1529
1606
|
*/
|
|
@@ -1623,7 +1700,7 @@ varying float vInstanceOpacity;`
|
|
|
1623
1700
|
if (vInstanceOpacity < 0.5) discard;`
|
|
1624
1701
|
);
|
|
1625
1702
|
}, i.needsUpdate = !0;
|
|
1626
|
-
const s = new
|
|
1703
|
+
const s = new le(
|
|
1627
1704
|
e.geometry,
|
|
1628
1705
|
i,
|
|
1629
1706
|
e.count
|
|
@@ -1758,7 +1835,7 @@ if (vInstanceOpacity < 0.5) discard;`
|
|
|
1758
1835
|
r.length * o
|
|
1759
1836
|
);
|
|
1760
1837
|
for (let c = 0; c < o; c++) {
|
|
1761
|
-
const h = new
|
|
1838
|
+
const h = new re();
|
|
1762
1839
|
e.getMatrixAt(c, h);
|
|
1763
1840
|
const d = c * r.length;
|
|
1764
1841
|
for (let u = 0; u < r.length; u += 3) {
|
|
@@ -1770,9 +1847,9 @@ if (vInstanceOpacity < 0.5) discard;`
|
|
|
1770
1847
|
p.applyMatrix4(h), a[d + u] = p.x, a[d + u + 1] = p.y, a[d + u + 2] = p.z;
|
|
1771
1848
|
}
|
|
1772
1849
|
}
|
|
1773
|
-
const l = new
|
|
1850
|
+
const l = new Zt();
|
|
1774
1851
|
if (l.setPositions(a), this._edgeMaterial) {
|
|
1775
|
-
const c = new
|
|
1852
|
+
const c = new Yt(l, this._edgeMaterial);
|
|
1776
1853
|
this.add(c), this._edgeLines.set(t, c);
|
|
1777
1854
|
}
|
|
1778
1855
|
}
|
|
@@ -1802,7 +1879,7 @@ if (vInstanceOpacity < 0.5) discard;`
|
|
|
1802
1879
|
* Custom raycast function for instanced meshes
|
|
1803
1880
|
*/
|
|
1804
1881
|
_instancedRaycast(e, t, i) {
|
|
1805
|
-
const s =
|
|
1882
|
+
const s = le.prototype.raycast, n = [];
|
|
1806
1883
|
s.call(e, t, n), n.forEach((r) => {
|
|
1807
1884
|
if (r.instanceId !== void 0) {
|
|
1808
1885
|
const o = this.findElementByInstancedMeshAndIndex(
|
|
@@ -1853,15 +1930,15 @@ if (vInstanceOpacity < 0.5) discard;`
|
|
|
1853
1930
|
}
|
|
1854
1931
|
getElementBoxs(e) {
|
|
1855
1932
|
var s;
|
|
1856
|
-
const t = new
|
|
1933
|
+
const t = new N();
|
|
1857
1934
|
let i = !1;
|
|
1858
1935
|
for (const n of e) {
|
|
1859
1936
|
const r = (s = this._elementMap.get(n.modelId)) == null ? void 0 : s.get(n.elementId);
|
|
1860
1937
|
if (!(!r || r.length === 0))
|
|
1861
1938
|
for (const { instancedMesh: o, instanceIndex: a } of r) {
|
|
1862
|
-
const l = new
|
|
1939
|
+
const l = new re();
|
|
1863
1940
|
o.getMatrixAt(a, l);
|
|
1864
|
-
const c = new
|
|
1941
|
+
const c = new N().setFromBufferAttribute(
|
|
1865
1942
|
o.geometry.getAttribute("position")
|
|
1866
1943
|
);
|
|
1867
1944
|
c.applyMatrix4(l), t.union(c), i = !0;
|
|
@@ -1894,7 +1971,7 @@ if (vInstanceOpacity < 0.5) discard;`
|
|
|
1894
1971
|
}
|
|
1895
1972
|
});
|
|
1896
1973
|
const t = D.getCenterPoint(e), i = this.getFarthestDistance(t, e);
|
|
1897
|
-
t && !this._pointLight && (this._pointLight = new
|
|
1974
|
+
t && !this._pointLight && (this._pointLight = new Ht(16562741, 1, i, 0.1), this._pointLight.position.copy(t), this.add(this._pointLight)), this._isGeneratedLights = !0;
|
|
1898
1975
|
}
|
|
1899
1976
|
this._pointLight && (this._pointLight.visible = !0);
|
|
1900
1977
|
}
|
|
@@ -1930,9 +2007,9 @@ if (vInstanceOpacity < 0.5) discard;`
|
|
|
1930
2007
|
}
|
|
1931
2008
|
//#endregion
|
|
1932
2009
|
};
|
|
1933
|
-
|
|
1934
|
-
let ce =
|
|
1935
|
-
const
|
|
2010
|
+
Ge.ZERO_MATRIX = new re().makeScale(0, 0, 0);
|
|
2011
|
+
let ce = Ge;
|
|
2012
|
+
const Ji = `
|
|
1936
2013
|
// Web Worker code as string (to be created as blob URL)
|
|
1937
2014
|
self.onmessage = function(e) {
|
|
1938
2015
|
const {
|
|
@@ -2046,16 +2123,16 @@ self.onmessage = function(e) {
|
|
|
2046
2123
|
}
|
|
2047
2124
|
};
|
|
2048
2125
|
`;
|
|
2049
|
-
class
|
|
2126
|
+
class es extends x {
|
|
2050
2127
|
constructor() {
|
|
2051
2128
|
super(), this.workerPool = null, this.bimModels = [], this.isReady = !1, this._batchedMeshes = [], this._instancedMeshes = [], this._isolatingElements = [], this._initializeWorkerPool(4);
|
|
2052
2129
|
}
|
|
2053
2130
|
_initializeWorkerPool(e) {
|
|
2054
2131
|
try {
|
|
2055
|
-
const t = new Blob([
|
|
2132
|
+
const t = new Blob([Ji], {
|
|
2056
2133
|
type: "application/javascript"
|
|
2057
2134
|
}), i = URL.createObjectURL(t);
|
|
2058
|
-
this.workerPool = new
|
|
2135
|
+
this.workerPool = new ie(
|
|
2059
2136
|
e || navigator.hardwareConcurrency || 4,
|
|
2060
2137
|
i
|
|
2061
2138
|
), console.log(
|
|
@@ -2067,9 +2144,9 @@ class Ki extends y {
|
|
|
2067
2144
|
}
|
|
2068
2145
|
get bounds() {
|
|
2069
2146
|
try {
|
|
2070
|
-
return new
|
|
2147
|
+
return new N().setFromObject(this);
|
|
2071
2148
|
} catch {
|
|
2072
|
-
return new
|
|
2149
|
+
return new N();
|
|
2073
2150
|
}
|
|
2074
2151
|
}
|
|
2075
2152
|
setReady(e) {
|
|
@@ -2119,9 +2196,9 @@ class Ki extends y {
|
|
|
2119
2196
|
}
|
|
2120
2197
|
hide(e) {
|
|
2121
2198
|
this._batchedMeshes.forEach((t) => {
|
|
2122
|
-
t.hide(e)
|
|
2199
|
+
t.hide(e);
|
|
2123
2200
|
}), this._instancedMeshes.forEach((t) => {
|
|
2124
|
-
t.hide(e)
|
|
2201
|
+
t.hide(e);
|
|
2125
2202
|
});
|
|
2126
2203
|
}
|
|
2127
2204
|
isolate(e) {
|
|
@@ -2234,7 +2311,7 @@ class Ki extends y {
|
|
|
2234
2311
|
return null;
|
|
2235
2312
|
const n = new Float32Array(s);
|
|
2236
2313
|
let r = 0;
|
|
2237
|
-
const o = new
|
|
2314
|
+
const o = new re(), a = new E();
|
|
2238
2315
|
for (const l of i)
|
|
2239
2316
|
if (l.buffer)
|
|
2240
2317
|
if (l.instances && l.instances.length > 0)
|
|
@@ -2354,67 +2431,67 @@ class Ki extends y {
|
|
|
2354
2431
|
this.isReady = !1, this._batchedMeshes.forEach((e) => e.dispose()), this._batchedMeshes = [], this._instancedMeshes.forEach((e) => e.dispose()), this._instancedMeshes = [], this.children = [];
|
|
2355
2432
|
}
|
|
2356
2433
|
}
|
|
2357
|
-
class
|
|
2434
|
+
class ur {
|
|
2358
2435
|
constructor() {
|
|
2359
2436
|
this.MaterialIndex = 0, this.Vertices = [], this.Indices = [], this.Name = "", this.Instances = [];
|
|
2360
2437
|
}
|
|
2361
2438
|
}
|
|
2362
|
-
class
|
|
2439
|
+
class pr {
|
|
2363
2440
|
constructor() {
|
|
2364
2441
|
this.MaterialIndex = 0, this.Elements = [];
|
|
2365
2442
|
}
|
|
2366
2443
|
}
|
|
2367
|
-
class
|
|
2444
|
+
class mr {
|
|
2368
2445
|
constructor() {
|
|
2369
2446
|
this.Vertices = [], this.Indices = [], this.Instances = [], this.Id = "";
|
|
2370
2447
|
}
|
|
2371
2448
|
}
|
|
2372
|
-
class
|
|
2449
|
+
class gr {
|
|
2373
2450
|
constructor() {
|
|
2374
2451
|
this.Vertices = [], this.Indices = [], this.Transform = null;
|
|
2375
2452
|
}
|
|
2376
2453
|
}
|
|
2377
|
-
class
|
|
2454
|
+
class fr {
|
|
2378
2455
|
constructor() {
|
|
2379
2456
|
this.buffer = null, this.instances = [];
|
|
2380
2457
|
}
|
|
2381
2458
|
}
|
|
2382
|
-
class
|
|
2459
|
+
class vr {
|
|
2383
2460
|
constructor() {
|
|
2384
2461
|
this.Solids = [], this.Id = "", this.Instances = [];
|
|
2385
2462
|
}
|
|
2386
2463
|
}
|
|
2387
|
-
class
|
|
2464
|
+
class br {
|
|
2388
2465
|
constructor() {
|
|
2389
|
-
this.Materials = [], this.Elements = [], this.Camera = new
|
|
2466
|
+
this.Materials = [], this.Elements = [], this.Camera = new Kt();
|
|
2390
2467
|
}
|
|
2391
2468
|
}
|
|
2392
|
-
class
|
|
2469
|
+
class wr {
|
|
2393
2470
|
constructor() {
|
|
2394
2471
|
this.MaterialIndex = 0, this.Vertices = [], this.Indices = [], this.Buffer = [];
|
|
2395
2472
|
}
|
|
2396
2473
|
}
|
|
2397
|
-
class
|
|
2474
|
+
class Kt {
|
|
2398
2475
|
constructor() {
|
|
2399
|
-
this.scale = 0, this.origin = new
|
|
2476
|
+
this.scale = 0, this.origin = new ae(), this.eyePosition = new ae(), this.upDirection = new ae(), this.forwardDirection = new ae(), this.target = new ae(), this.box = new ts();
|
|
2400
2477
|
}
|
|
2401
2478
|
}
|
|
2402
|
-
class
|
|
2479
|
+
class ts {
|
|
2403
2480
|
constructor() {
|
|
2404
|
-
this.min = new
|
|
2481
|
+
this.min = new ae(), this.max = new ae();
|
|
2405
2482
|
}
|
|
2406
2483
|
}
|
|
2407
|
-
class
|
|
2484
|
+
class yr {
|
|
2408
2485
|
constructor() {
|
|
2409
|
-
this.Data = {}, this.CameraData = new
|
|
2486
|
+
this.Data = {}, this.CameraData = new Kt(), this.Translation = [];
|
|
2410
2487
|
}
|
|
2411
2488
|
}
|
|
2412
|
-
class
|
|
2489
|
+
class ae {
|
|
2413
2490
|
constructor() {
|
|
2414
2491
|
this.X = 0, this.Y = 0, this.Z = 0;
|
|
2415
2492
|
}
|
|
2416
2493
|
}
|
|
2417
|
-
const
|
|
2494
|
+
const is = {
|
|
2418
2495
|
enabled: !0,
|
|
2419
2496
|
castShadow: !0,
|
|
2420
2497
|
intensity: 5,
|
|
@@ -2425,7 +2502,7 @@ const es = {
|
|
|
2425
2502
|
indirectLightIntensity: 1.2,
|
|
2426
2503
|
shadowcatcher: !0
|
|
2427
2504
|
};
|
|
2428
|
-
function
|
|
2505
|
+
function ss() {
|
|
2429
2506
|
function g(i) {
|
|
2430
2507
|
let s = 0;
|
|
2431
2508
|
for (let n = 0; n < i.length; n++)
|
|
@@ -2458,21 +2535,21 @@ function ts() {
|
|
|
2458
2535
|
w.vx = 0, w.vy = 0, i.forEach((S) => {
|
|
2459
2536
|
if (b.id === S.id)
|
|
2460
2537
|
return;
|
|
2461
|
-
const A = u.get(S.id), C = w.x - A.x, M = w.y - A.y, _ = C * C + M * M,
|
|
2462
|
-
w.vx += C /
|
|
2538
|
+
const A = u.get(S.id), C = w.x - A.x, M = w.y - A.y, _ = C * C + M * M, I = Math.sqrt(_) || 1, O = d * d / I;
|
|
2539
|
+
w.vx += C / I * O, w.vy += M / I * O;
|
|
2463
2540
|
});
|
|
2464
2541
|
}), s.forEach((b) => {
|
|
2465
2542
|
const w = String(b.source), S = String(b.target), A = u.get(w), C = u.get(S);
|
|
2466
2543
|
if (!A || !C)
|
|
2467
2544
|
return;
|
|
2468
|
-
const M = A.x - C.x, _ = A.y - C.y,
|
|
2469
|
-
A.vx -=
|
|
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, T = _ / I * O;
|
|
2546
|
+
A.vx -= V, A.vy -= T, C.vx += V, C.vy += T;
|
|
2470
2547
|
}), i.forEach((b) => {
|
|
2471
2548
|
const w = u.get(b.id), S = Math.sqrt(w.vx * w.vx + w.vy * w.vy) || 1, A = Math.min(S, p);
|
|
2472
2549
|
if (w.x += w.vx / S * A, w.y += w.vy / S * A, l === "circular") {
|
|
2473
|
-
const C = r / 2, M = o / 2, _ = Math.min(r, o) / 2,
|
|
2474
|
-
if (Math.sqrt(
|
|
2475
|
-
const T = Math.atan2(O,
|
|
2550
|
+
const C = r / 2, M = o / 2, _ = Math.min(r, o) / 2, I = w.x - C, O = w.y - M;
|
|
2551
|
+
if (Math.sqrt(I * I + O * O) > _) {
|
|
2552
|
+
const T = Math.atan2(O, I);
|
|
2476
2553
|
w.x = C + _ * Math.cos(T), w.y = M + _ * Math.sin(T);
|
|
2477
2554
|
}
|
|
2478
2555
|
} else
|
|
@@ -2507,11 +2584,11 @@ function ts() {
|
|
|
2507
2584
|
}
|
|
2508
2585
|
};
|
|
2509
2586
|
}
|
|
2510
|
-
const
|
|
2511
|
-
class
|
|
2587
|
+
const ns = ss;
|
|
2588
|
+
class rs {
|
|
2512
2589
|
constructor() {
|
|
2513
|
-
const e = new Blob([`(${
|
|
2514
|
-
this.workerPool = new
|
|
2590
|
+
const e = new Blob([`(${ns})()`]), t = URL.createObjectURL(e);
|
|
2591
|
+
this.workerPool = new ie(2, t);
|
|
2515
2592
|
}
|
|
2516
2593
|
computeLayout(e, t, i, s) {
|
|
2517
2594
|
const n = {
|
|
@@ -2530,7 +2607,7 @@ class ss {
|
|
|
2530
2607
|
this.workerPool.dispose();
|
|
2531
2608
|
}
|
|
2532
2609
|
}
|
|
2533
|
-
class
|
|
2610
|
+
class as {
|
|
2534
2611
|
constructor(e, t) {
|
|
2535
2612
|
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 = {
|
|
2536
2613
|
ON_LEVEL: "HAS_ELEMENT",
|
|
@@ -2810,7 +2887,7 @@ class ns {
|
|
|
2810
2887
|
}), l("Building nodes", d.length, d.length);
|
|
2811
2888
|
const u = d.map((f) => f.id), p = this._calculateNodeLevels(c, u);
|
|
2812
2889
|
a += r, l("Calculating levels", d.length, d.length);
|
|
2813
|
-
const m = new
|
|
2890
|
+
const m = new rs();
|
|
2814
2891
|
l(
|
|
2815
2892
|
"Computing layout",
|
|
2816
2893
|
0,
|
|
@@ -2866,22 +2943,22 @@ class ns {
|
|
|
2866
2943
|
b.vx = 0, b.vy = 0, e.forEach((w) => {
|
|
2867
2944
|
if (v.id === w.id)
|
|
2868
2945
|
return;
|
|
2869
|
-
const S = h.get(w.id), A = b.x - S.x, C = b.y - S.y, M = A * A + C * C, _ = Math.sqrt(M) || 1,
|
|
2870
|
-
b.vx += A / _ *
|
|
2946
|
+
const S = h.get(w.id), A = b.x - S.x, C = b.y - S.y, M = A * A + C * C, _ = Math.sqrt(M) || 1, I = c * c / _;
|
|
2947
|
+
b.vx += A / _ * I, b.vy += C / _ * I;
|
|
2871
2948
|
});
|
|
2872
2949
|
}), t.forEach((v) => {
|
|
2873
2950
|
const b = String(v.source), w = String(v.target), S = h.get(b), A = h.get(w);
|
|
2874
2951
|
if (!S || !A)
|
|
2875
2952
|
return;
|
|
2876
|
-
const C = S.x - A.x, M = S.y - A.y, _ = Math.sqrt(C * C + M * M) || 1,
|
|
2877
|
-
S.vx -= O, S.vy -=
|
|
2953
|
+
const C = S.x - A.x, M = S.y - A.y, _ = Math.sqrt(C * C + M * M) || 1, I = _ * _ / c, O = C / _ * I, V = M / _ * I;
|
|
2954
|
+
S.vx -= O, S.vy -= V, A.vx += O, A.vy += V;
|
|
2878
2955
|
}), e.forEach((v) => {
|
|
2879
2956
|
const b = h.get(v.id), w = Math.sqrt(b.vx * b.vx + b.vy * b.vy) || 1, S = Math.min(w, u);
|
|
2880
2957
|
if (b.x += b.vx / w * S, b.y += b.vy / w * S, o === "circular") {
|
|
2881
|
-
const A = s / 2, C = n / 2, M = Math.min(s, n) / 2, _ = b.x - A,
|
|
2882
|
-
if (Math.sqrt(_ * _ +
|
|
2883
|
-
const
|
|
2884
|
-
b.x = A + M * Math.cos(
|
|
2958
|
+
const A = s / 2, C = n / 2, M = Math.min(s, n) / 2, _ = b.x - A, I = b.y - C;
|
|
2959
|
+
if (Math.sqrt(_ * _ + I * I) > M) {
|
|
2960
|
+
const V = Math.atan2(I, _);
|
|
2961
|
+
b.x = A + M * Math.cos(V), b.y = C + M * Math.sin(V);
|
|
2885
2962
|
}
|
|
2886
2963
|
} else
|
|
2887
2964
|
b.x = Math.max(0, Math.min(s, b.x)), b.y = Math.max(0, Math.min(n, b.y));
|
|
@@ -2909,13 +2986,13 @@ class ns {
|
|
|
2909
2986
|
}
|
|
2910
2987
|
//#endregion
|
|
2911
2988
|
}
|
|
2912
|
-
class
|
|
2989
|
+
class xr {
|
|
2913
2990
|
constructor() {
|
|
2914
2991
|
this.children = /* @__PURE__ */ new Map(), this.keys = /* @__PURE__ */ new Set();
|
|
2915
2992
|
}
|
|
2916
2993
|
}
|
|
2917
|
-
var
|
|
2918
|
-
class
|
|
2994
|
+
var B = /* @__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))(B || {}), K = /* @__PURE__ */ ((g) => (g[g.ON_WAKE = 0] = "ON_WAKE", g[g.ON_SLEEP = 1] = "ON_SLEEP", g[g.ON_UPDATE = 2] = "ON_UPDATE", g))(K || {}), 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
|
+
class It {
|
|
2919
2996
|
constructor() {
|
|
2920
2997
|
this.items = {};
|
|
2921
2998
|
}
|
|
@@ -2951,7 +3028,7 @@ class Vt {
|
|
|
2951
3028
|
return Object.keys(this.items).length;
|
|
2952
3029
|
}
|
|
2953
3030
|
}
|
|
2954
|
-
class
|
|
3031
|
+
class Mr {
|
|
2955
3032
|
constructor(e, t) {
|
|
2956
3033
|
this.delay = e, this.eventHandler = t, this.timerId = null, this.handleEvent = (i) => {
|
|
2957
3034
|
this.timerId && clearTimeout(this.timerId), this.timerId = setTimeout(() => {
|
|
@@ -2960,22 +3037,22 @@ class vr {
|
|
|
2960
3037
|
};
|
|
2961
3038
|
}
|
|
2962
3039
|
}
|
|
2963
|
-
class
|
|
3040
|
+
class os {
|
|
2964
3041
|
constructor() {
|
|
2965
3042
|
this.deleted = [], this.added = [], this.modified = [], this.notChanged = [];
|
|
2966
3043
|
}
|
|
2967
3044
|
}
|
|
2968
|
-
class
|
|
3045
|
+
class ls {
|
|
2969
3046
|
constructor() {
|
|
2970
|
-
this.clashes = new
|
|
3047
|
+
this.clashes = new It();
|
|
2971
3048
|
}
|
|
2972
3049
|
}
|
|
2973
|
-
class
|
|
3050
|
+
class cs {
|
|
2974
3051
|
constructor() {
|
|
2975
3052
|
this.value = {}, this.elementIds = [], this.modelId = -1;
|
|
2976
3053
|
}
|
|
2977
3054
|
}
|
|
2978
|
-
class
|
|
3055
|
+
class hs {
|
|
2979
3056
|
constructor(e) {
|
|
2980
3057
|
this.viralViewerApi = e, this.panel = null, this.batchListContainer = null, this.isVisible = !1, this.selectedBatchMesh = null, this.inject();
|
|
2981
3058
|
}
|
|
@@ -2990,7 +3067,7 @@ class ls {
|
|
|
2990
3067
|
right: 10px;
|
|
2991
3068
|
width: 300px;
|
|
2992
3069
|
max-height: 80vh;
|
|
2993
|
-
background-color: ${
|
|
3070
|
+
background-color: ${y.background};
|
|
2994
3071
|
border: 1px solid #ccc;
|
|
2995
3072
|
border-radius: 8px;
|
|
2996
3073
|
padding: 15px;
|
|
@@ -3004,8 +3081,8 @@ class ls {
|
|
|
3004
3081
|
const e = document.createElement("div");
|
|
3005
3082
|
e.innerHTML = `
|
|
3006
3083
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
|
|
3007
|
-
<h3 style="margin: 0; color: ${
|
|
3008
|
-
<span id="batch-debug-close" style="cursor: pointer; font-size: 20px; color: ${
|
|
3084
|
+
<h3 style="margin: 0; color: ${y.secondary}; font-size: 16px;">Batch Debug Panel</h3>
|
|
3085
|
+
<span id="batch-debug-close" style="cursor: pointer; font-size: 20px; color: ${y.secondary};">×</span>
|
|
3009
3086
|
</div>
|
|
3010
3087
|
`, this.panel.appendChild(e);
|
|
3011
3088
|
const t = document.createElement("div");
|
|
@@ -3014,7 +3091,7 @@ class ls {
|
|
|
3014
3091
|
t.appendChild(i), t.appendChild(s), this.panel.appendChild(t);
|
|
3015
3092
|
const n = document.createElement("div");
|
|
3016
3093
|
n.innerHTML = `
|
|
3017
|
-
<h4 style="margin: 10px 0 5px 0; color: ${
|
|
3094
|
+
<h4 style="margin: 10px 0 5px 0; color: ${y.secondary}; font-size: 14px;">Batched Meshes</h4>
|
|
3018
3095
|
`, this.panel.appendChild(n), this.batchListContainer = document.createElement("div"), this.batchListContainer.setAttribute(
|
|
3019
3096
|
"style",
|
|
3020
3097
|
`
|
|
@@ -3031,7 +3108,7 @@ class ls {
|
|
|
3031
3108
|
`
|
|
3032
3109
|
flex: 1;
|
|
3033
3110
|
padding: 8px;
|
|
3034
|
-
background-color: ${
|
|
3111
|
+
background-color: ${y.primary};
|
|
3035
3112
|
color: white;
|
|
3036
3113
|
border: none;
|
|
3037
3114
|
border-radius: 4px;
|
|
@@ -3041,9 +3118,9 @@ class ls {
|
|
|
3041
3118
|
transition: background-color 0.2s;
|
|
3042
3119
|
`
|
|
3043
3120
|
), i.addEventListener("mouseenter", () => {
|
|
3044
|
-
i.style.backgroundColor =
|
|
3121
|
+
i.style.backgroundColor = y.accent;
|
|
3045
3122
|
}), i.addEventListener("mouseleave", () => {
|
|
3046
|
-
i.style.backgroundColor =
|
|
3123
|
+
i.style.backgroundColor = y.primary;
|
|
3047
3124
|
}), i;
|
|
3048
3125
|
}
|
|
3049
3126
|
injectStyles() {
|
|
@@ -3062,12 +3139,12 @@ class ls {
|
|
|
3062
3139
|
background-color: rgba(0, 0, 0, 0.1);
|
|
3063
3140
|
}
|
|
3064
3141
|
.batch-item.selected {
|
|
3065
|
-
border-color: ${
|
|
3142
|
+
border-color: ${y.accent};
|
|
3066
3143
|
background-color: rgba(128, 214, 218, 0.2);
|
|
3067
3144
|
}
|
|
3068
3145
|
.batch-item-title {
|
|
3069
3146
|
font-weight: 600;
|
|
3070
|
-
color: ${
|
|
3147
|
+
color: ${y.secondary};
|
|
3071
3148
|
font-size: 13px;
|
|
3072
3149
|
margin-bottom: 4px;
|
|
3073
3150
|
}
|
|
@@ -3148,7 +3225,7 @@ class ls {
|
|
|
3148
3225
|
background-color: rgba(128, 214, 218, 0.1);
|
|
3149
3226
|
border-radius: 4px;
|
|
3150
3227
|
font-size: 11px;
|
|
3151
|
-
color: ${
|
|
3228
|
+
color: ${y.secondary};
|
|
3152
3229
|
text-align: center;
|
|
3153
3230
|
`
|
|
3154
3231
|
), i.innerHTML = `
|
|
@@ -3191,7 +3268,7 @@ class ls {
|
|
|
3191
3268
|
this.clearIsolation(), this.panel && (this.panel.remove(), this.panel = null);
|
|
3192
3269
|
}
|
|
3193
3270
|
}
|
|
3194
|
-
class
|
|
3271
|
+
class ds {
|
|
3195
3272
|
constructor(e) {
|
|
3196
3273
|
this.viralViewerApi = e, this.panel = null, this.instancedListContainer = null, this.isVisible = !1, this.selectedInstancedMesh = null, this.selectedInternalMesh = null, this.inject();
|
|
3197
3274
|
}
|
|
@@ -3206,7 +3283,7 @@ class cs {
|
|
|
3206
3283
|
right: 320px;
|
|
3207
3284
|
width: 350px;
|
|
3208
3285
|
max-height: 80vh;
|
|
3209
|
-
background-color: ${
|
|
3286
|
+
background-color: ${y.background};
|
|
3210
3287
|
border: 1px solid #ccc;
|
|
3211
3288
|
border-radius: 8px;
|
|
3212
3289
|
padding: 15px;
|
|
@@ -3220,8 +3297,8 @@ class cs {
|
|
|
3220
3297
|
const e = document.createElement("div");
|
|
3221
3298
|
e.innerHTML = `
|
|
3222
3299
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
|
|
3223
|
-
<h3 style="margin: 0; color: ${
|
|
3224
|
-
<span id="instanced-debug-close" style="cursor: pointer; font-size: 20px; color: ${
|
|
3300
|
+
<h3 style="margin: 0; color: ${y.secondary}; font-size: 16px;">🔄 Instanced Debug Panel</h3>
|
|
3301
|
+
<span id="instanced-debug-close" style="cursor: pointer; font-size: 20px; color: ${y.secondary};">×</span>
|
|
3225
3302
|
</div>
|
|
3226
3303
|
`, this.panel.appendChild(e);
|
|
3227
3304
|
const t = document.createElement("div");
|
|
@@ -3233,7 +3310,7 @@ class cs {
|
|
|
3233
3310
|
t.appendChild(i), t.appendChild(s), t.appendChild(n), this.panel.appendChild(t);
|
|
3234
3311
|
const r = document.createElement("div");
|
|
3235
3312
|
r.innerHTML = `
|
|
3236
|
-
<h4 style="margin: 10px 0 5px 0; color: ${
|
|
3313
|
+
<h4 style="margin: 10px 0 5px 0; color: ${y.secondary}; font-size: 14px;">Instanced Meshes (ViralInstancedMeshV2)</h4>
|
|
3237
3314
|
`, this.panel.appendChild(r), this.instancedListContainer = document.createElement("div"), this.instancedListContainer.setAttribute(
|
|
3238
3315
|
"style",
|
|
3239
3316
|
`
|
|
@@ -3250,7 +3327,7 @@ class cs {
|
|
|
3250
3327
|
`
|
|
3251
3328
|
flex: 1;
|
|
3252
3329
|
padding: 8px;
|
|
3253
|
-
background-color: ${
|
|
3330
|
+
background-color: ${y.primary};
|
|
3254
3331
|
color: white;
|
|
3255
3332
|
border: none;
|
|
3256
3333
|
border-radius: 4px;
|
|
@@ -3261,9 +3338,9 @@ class cs {
|
|
|
3261
3338
|
min-width: 80px;
|
|
3262
3339
|
`
|
|
3263
3340
|
), i.addEventListener("mouseenter", () => {
|
|
3264
|
-
i.style.backgroundColor =
|
|
3341
|
+
i.style.backgroundColor = y.accent;
|
|
3265
3342
|
}), i.addEventListener("mouseleave", () => {
|
|
3266
|
-
i.style.backgroundColor =
|
|
3343
|
+
i.style.backgroundColor = y.primary;
|
|
3267
3344
|
}), i;
|
|
3268
3345
|
}
|
|
3269
3346
|
injectStyles() {
|
|
@@ -3284,12 +3361,12 @@ class cs {
|
|
|
3284
3361
|
background-color: rgba(0, 0, 0, 0.1);
|
|
3285
3362
|
}
|
|
3286
3363
|
.instanced-item.selected {
|
|
3287
|
-
border-color: ${
|
|
3364
|
+
border-color: ${y.accent};
|
|
3288
3365
|
background-color: rgba(128, 214, 218, 0.2);
|
|
3289
3366
|
}
|
|
3290
3367
|
.instanced-item-title {
|
|
3291
3368
|
font-weight: 600;
|
|
3292
|
-
color: ${
|
|
3369
|
+
color: ${y.secondary};
|
|
3293
3370
|
font-size: 13px;
|
|
3294
3371
|
margin-bottom: 4px;
|
|
3295
3372
|
}
|
|
@@ -3336,7 +3413,7 @@ class cs {
|
|
|
3336
3413
|
}
|
|
3337
3414
|
.internal-mesh-item.selected {
|
|
3338
3415
|
background-color: rgba(33, 150, 243, 0.2);
|
|
3339
|
-
border-left-color: ${
|
|
3416
|
+
border-left-color: ${y.accent};
|
|
3340
3417
|
}
|
|
3341
3418
|
`, document.head.appendChild(e);
|
|
3342
3419
|
}
|
|
@@ -3439,8 +3516,8 @@ class cs {
|
|
|
3439
3516
|
Base Triangles: ${Math.floor(C).toLocaleString()}<br>
|
|
3440
3517
|
Total Rendered: ${(A * b.count).toLocaleString()} verts
|
|
3441
3518
|
</div>
|
|
3442
|
-
`, M.addEventListener("click", (
|
|
3443
|
-
|
|
3519
|
+
`, M.addEventListener("click", (I) => {
|
|
3520
|
+
I.stopPropagation(), this.isolateInternalMesh(r, b, M);
|
|
3444
3521
|
}), p.appendChild(M);
|
|
3445
3522
|
}), d.appendChild(u), d.appendChild(p), this.instancedListContainer.appendChild(d);
|
|
3446
3523
|
});
|
|
@@ -3453,7 +3530,7 @@ class cs {
|
|
|
3453
3530
|
background-color: rgba(128, 214, 218, 0.1);
|
|
3454
3531
|
border-radius: 4px;
|
|
3455
3532
|
font-size: 11px;
|
|
3456
|
-
color: ${
|
|
3533
|
+
color: ${y.secondary};
|
|
3457
3534
|
text-align: center;
|
|
3458
3535
|
`
|
|
3459
3536
|
), n.innerHTML = `
|
|
@@ -3587,7 +3664,7 @@ class cs {
|
|
|
3587
3664
|
this.clearIsolation(), this.panel && (this.panel.remove(), this.panel = null);
|
|
3588
3665
|
}
|
|
3589
3666
|
}
|
|
3590
|
-
class
|
|
3667
|
+
class us {
|
|
3591
3668
|
constructor(e) {
|
|
3592
3669
|
this.viralViewerApi = e, this.panel = null, this.contentContainer = null, this.isVisible = !1, this.lastAnalysis = null, this.inject();
|
|
3593
3670
|
}
|
|
@@ -3602,7 +3679,7 @@ class hs {
|
|
|
3602
3679
|
left: 10px;
|
|
3603
3680
|
width: 450px;
|
|
3604
3681
|
max-height: 85vh;
|
|
3605
|
-
background-color: ${
|
|
3682
|
+
background-color: ${y.background};
|
|
3606
3683
|
border: 1px solid #ccc;
|
|
3607
3684
|
border-radius: 8px;
|
|
3608
3685
|
padding: 15px;
|
|
@@ -3617,8 +3694,8 @@ class hs {
|
|
|
3617
3694
|
const e = document.createElement("div");
|
|
3618
3695
|
e.innerHTML = `
|
|
3619
3696
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
|
|
3620
|
-
<h3 style="margin: 0; color: ${
|
|
3621
|
-
<span id="render-debug-close" style="cursor: pointer; font-size: 20px; color: ${
|
|
3697
|
+
<h3 style="margin: 0; color: ${y.secondary}; font-size: 16px;">🔍 Render Debug Panel</h3>
|
|
3698
|
+
<span id="render-debug-close" style="cursor: pointer; font-size: 20px; color: ${y.secondary};">×</span>
|
|
3622
3699
|
</div>
|
|
3623
3700
|
`, this.panel.appendChild(e);
|
|
3624
3701
|
const t = document.createElement("div");
|
|
@@ -3642,7 +3719,7 @@ class hs {
|
|
|
3642
3719
|
"style",
|
|
3643
3720
|
`
|
|
3644
3721
|
padding: 8px 12px;
|
|
3645
|
-
background-color: ${
|
|
3722
|
+
background-color: ${y.primary};
|
|
3646
3723
|
color: white;
|
|
3647
3724
|
border: none;
|
|
3648
3725
|
border-radius: 4px;
|
|
@@ -3652,9 +3729,9 @@ class hs {
|
|
|
3652
3729
|
transition: background-color 0.2s;
|
|
3653
3730
|
`
|
|
3654
3731
|
), i.addEventListener("mouseenter", () => {
|
|
3655
|
-
i.style.backgroundColor =
|
|
3732
|
+
i.style.backgroundColor = y.accent;
|
|
3656
3733
|
}), i.addEventListener("mouseleave", () => {
|
|
3657
|
-
i.style.backgroundColor =
|
|
3734
|
+
i.style.backgroundColor = y.primary;
|
|
3658
3735
|
}), i;
|
|
3659
3736
|
}
|
|
3660
3737
|
injectStyles() {
|
|
@@ -3668,7 +3745,7 @@ class hs {
|
|
|
3668
3745
|
}
|
|
3669
3746
|
.render-section-title {
|
|
3670
3747
|
font-weight: 600;
|
|
3671
|
-
color: ${
|
|
3748
|
+
color: ${y.secondary};
|
|
3672
3749
|
font-size: 13px;
|
|
3673
3750
|
margin-bottom: 8px;
|
|
3674
3751
|
display: flex;
|
|
@@ -3714,7 +3791,7 @@ class hs {
|
|
|
3714
3791
|
}
|
|
3715
3792
|
.stat-value {
|
|
3716
3793
|
font-weight: 600;
|
|
3717
|
-
color: ${
|
|
3794
|
+
color: ${y.secondary};
|
|
3718
3795
|
}
|
|
3719
3796
|
.warning-box {
|
|
3720
3797
|
padding: 8px;
|
|
@@ -3817,7 +3894,7 @@ class hs {
|
|
|
3817
3894
|
);
|
|
3818
3895
|
} else
|
|
3819
3896
|
i.set(n.id, r);
|
|
3820
|
-
if (n instanceof
|
|
3897
|
+
if (n instanceof x && n.geometry) {
|
|
3821
3898
|
const o = this.getGeometryHash(n);
|
|
3822
3899
|
o !== "no-geometry" && o !== "no-position" && r.vertices > 0 && (s.has(o) || s.set(o, []), s.get(o).push(r));
|
|
3823
3900
|
}
|
|
@@ -3892,10 +3969,10 @@ class hs {
|
|
|
3892
3969
|
extractObjectInfo(e) {
|
|
3893
3970
|
var a, l;
|
|
3894
3971
|
let t = 0, i = 0, s = 0, n = "N/A";
|
|
3895
|
-
if (e instanceof
|
|
3972
|
+
if (e instanceof x) {
|
|
3896
3973
|
const c = e.geometry;
|
|
3897
|
-
c && (c.attributes.position && (t = c.attributes.position.count), c.index ? i = c.index.count / 3 : i = t / 3), e instanceof
|
|
3898
|
-
} else if (e instanceof yt || e instanceof
|
|
3974
|
+
c && (c.attributes.position && (t = c.attributes.position.count), c.index ? i = c.index.count / 3 : i = t / 3), e instanceof le ? (s = 1, n = "Instanced", i *= e.count) : e instanceof Y ? (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");
|
|
3975
|
+
} else if (e instanceof yt || e instanceof gt) {
|
|
3899
3976
|
s = e.visible ? 1 : 0, n = "Line";
|
|
3900
3977
|
const c = e.geometry;
|
|
3901
3978
|
c && c.attributes.position && (t = c.attributes.position.count);
|
|
@@ -3922,7 +3999,7 @@ class hs {
|
|
|
3922
3999
|
};
|
|
3923
4000
|
}
|
|
3924
4001
|
isRenderable(e) {
|
|
3925
|
-
return e instanceof
|
|
4002
|
+
return e instanceof x || e instanceof yt || e instanceof gt || e instanceof St;
|
|
3926
4003
|
}
|
|
3927
4004
|
isVisibleInHierarchy(e) {
|
|
3928
4005
|
let t = e;
|
|
@@ -3948,7 +4025,7 @@ class hs {
|
|
|
3948
4025
|
return `v${s}_i${n}_${r}`;
|
|
3949
4026
|
}
|
|
3950
4027
|
categorizeObject(e, t, i) {
|
|
3951
|
-
e instanceof Y ? i.batchedMeshes.push(t) : e instanceof ce || e instanceof
|
|
4028
|
+
e instanceof Y ? i.batchedMeshes.push(t) : e instanceof ce || e instanceof le ? i.instancedMeshes.push(t) : e instanceof x ? i.regularMeshes.push(t) : e instanceof yt || e instanceof gt ? i.edgeMeshes.push(t) : this.isRenderable(e) && i.otherObjects.push(t);
|
|
3952
4029
|
}
|
|
3953
4030
|
analyzeMergedModel(e) {
|
|
3954
4031
|
const t = this.viralViewerApi.viralScene.bimWorld, i = t.getDiagnostics();
|
|
@@ -4117,7 +4194,7 @@ class hs {
|
|
|
4117
4194
|
n.id === e && (i = n);
|
|
4118
4195
|
}), i !== void 0) {
|
|
4119
4196
|
const n = i;
|
|
4120
|
-
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
|
|
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 x && (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");
|
|
4121
4198
|
}
|
|
4122
4199
|
}
|
|
4123
4200
|
logToConsole() {
|
|
@@ -4209,7 +4286,7 @@ class hs {
|
|
|
4209
4286
|
var a;
|
|
4210
4287
|
const i = " ".repeat(t), s = e.visible ? "✅" : "❌", n = e.constructor.name, r = e.children.length;
|
|
4211
4288
|
let o = "";
|
|
4212
|
-
e instanceof
|
|
4289
|
+
e instanceof x && e.geometry && (o = ` [V:${((a = e.geometry.attributes.position) == null ? void 0 : a.count) || 0}]`), e instanceof le && (o += ` [Instances:${e.count}]`), console.log(
|
|
4213
4290
|
`${i}${s} ${e.name || "[unnamed]"} (${n})${o} [${r} children]`
|
|
4214
4291
|
), t < 3 ? e.children.forEach((l) => {
|
|
4215
4292
|
this.logObjectTree(l, t + 1);
|
|
@@ -4234,10 +4311,10 @@ class hs {
|
|
|
4234
4311
|
this.panel && (this.panel.remove(), this.panel = null);
|
|
4235
4312
|
}
|
|
4236
4313
|
}
|
|
4237
|
-
class
|
|
4314
|
+
class ps {
|
|
4238
4315
|
// 5 seconds for cleanup
|
|
4239
4316
|
constructor(e) {
|
|
4240
|
-
this.viralViewerApi = e, this.clock = new
|
|
4317
|
+
this.viralViewerApi = e, this.clock = new ii(), this.lastSpatialUpdateTime = 0, this.lastCleanupTime = 0, this.spatialUpdateInterval = 16, this.cleanupInterval = 5e3, this.isRainEnabled = !1;
|
|
4241
4318
|
}
|
|
4242
4319
|
devAnimation() {
|
|
4243
4320
|
var i, s, n, r, o;
|
|
@@ -4280,7 +4357,7 @@ class ds {
|
|
|
4280
4357
|
this.isRainEnabled = e, this.isRainEnabled && this.rainAnimation();
|
|
4281
4358
|
}
|
|
4282
4359
|
}
|
|
4283
|
-
class
|
|
4360
|
+
class ms {
|
|
4284
4361
|
static generateRandomString(e) {
|
|
4285
4362
|
const t = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
4286
4363
|
let i = "";
|
|
@@ -4291,19 +4368,19 @@ class us {
|
|
|
4291
4368
|
return i;
|
|
4292
4369
|
}
|
|
4293
4370
|
}
|
|
4294
|
-
const
|
|
4295
|
-
class
|
|
4371
|
+
const gs = 0.032;
|
|
4372
|
+
class fs {
|
|
4296
4373
|
constructor(e, t, i, s, n = 2, r = 1, o, a) {
|
|
4297
|
-
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 =
|
|
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 = ms.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(
|
|
4298
4375
|
"style",
|
|
4299
4376
|
"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"
|
|
4300
4377
|
), this.nameDiv.id = this.id, this.nameDiv.append(this.name), this.viralViewerApi.targetElement.appendChild(this.nameDiv)), this.chatDiv = document.createElement("div"), this.chatDiv.setAttribute(
|
|
4301
4378
|
"style",
|
|
4302
4379
|
"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"
|
|
4303
|
-
), this.viralViewerApi.targetElement.appendChild(this.chatDiv), this.MOVEMENT_SPEED =
|
|
4380
|
+
), this.viralViewerApi.targetElement.appendChild(this.chatDiv), this.MOVEMENT_SPEED = gs * r, this.viralViewerApi.viralLoader.threeLoader.loadGLTF(t, (l) => {
|
|
4304
4381
|
this.avatar = l.scene;
|
|
4305
4382
|
const c = new E(n, n, n);
|
|
4306
|
-
this.avatar.scale.copy(c), console.log(this.avatar), this.mixer = new
|
|
4383
|
+
this.avatar.scale.copy(c), console.log(this.avatar), this.mixer = new si(l.scene), this.viralViewerApi.viralScene.scene.add(l.scene), this.viralViewerApi.viralRenderer.render(), this.viralViewerApi.viralLoader.threeLoader.loadGLTF(i, (h) => {
|
|
4307
4384
|
this.idleAnimation = this.mixer.clipAction(h.animations[0]), this.viralViewerApi.viralLoader.threeLoader.loadGLTF(s, (d) => {
|
|
4308
4385
|
this.walkAnimation = this.mixer.clipAction(d.animations[0]), Q.information("load avatar succeed!"), this.isReady = !0, this.idle();
|
|
4309
4386
|
});
|
|
@@ -4363,12 +4440,12 @@ class ms {
|
|
|
4363
4440
|
(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);
|
|
4364
4441
|
}
|
|
4365
4442
|
}
|
|
4366
|
-
class
|
|
4443
|
+
class vs {
|
|
4367
4444
|
constructor(e) {
|
|
4368
4445
|
this.viralViewerApi = e, this.avatars = [];
|
|
4369
4446
|
}
|
|
4370
4447
|
load(e, t, i, s = 2, n = 1, r, o) {
|
|
4371
|
-
const a = new
|
|
4448
|
+
const a = new fs(
|
|
4372
4449
|
this.viralViewerApi,
|
|
4373
4450
|
e,
|
|
4374
4451
|
t,
|
|
@@ -4385,33 +4462,33 @@ class gs {
|
|
|
4385
4462
|
t && t.dispose(), this.avatars = this.avatars.filter((i) => i.id !== e);
|
|
4386
4463
|
}
|
|
4387
4464
|
}
|
|
4388
|
-
class
|
|
4465
|
+
class bs {
|
|
4389
4466
|
constructor() {
|
|
4390
|
-
Z.prototype.computeBoundsTree =
|
|
4467
|
+
Z.prototype.computeBoundsTree = Ii, Z.prototype.disposeBoundsTree = Vi, x.prototype.raycast = Ti;
|
|
4391
4468
|
}
|
|
4392
4469
|
applyThreeMeshBVH(e) {
|
|
4393
4470
|
e.boundsTree || e.computeBoundsTree();
|
|
4394
4471
|
}
|
|
4395
4472
|
}
|
|
4396
|
-
const
|
|
4397
|
-
Vector2:
|
|
4473
|
+
const ws = {
|
|
4474
|
+
Vector2: z,
|
|
4398
4475
|
Vector3: E,
|
|
4399
|
-
Vector4:
|
|
4400
|
-
Quaternion:
|
|
4401
|
-
Matrix4:
|
|
4402
|
-
Spherical:
|
|
4403
|
-
Box3:
|
|
4404
|
-
Sphere:
|
|
4476
|
+
Vector4: ni,
|
|
4477
|
+
Quaternion: ri,
|
|
4478
|
+
Matrix4: re,
|
|
4479
|
+
Spherical: Wt,
|
|
4480
|
+
Box3: N,
|
|
4481
|
+
Sphere: Gt,
|
|
4405
4482
|
Raycaster: Tt,
|
|
4406
|
-
MathUtils:
|
|
4483
|
+
MathUtils: ai
|
|
4407
4484
|
};
|
|
4408
|
-
pe.install({ THREE:
|
|
4409
|
-
class
|
|
4485
|
+
pe.install({ THREE: ws });
|
|
4486
|
+
class ys {
|
|
4410
4487
|
constructor(e) {
|
|
4411
4488
|
this.viralViewerApi = e, this.raycaster = new Tt(), 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);
|
|
4412
4489
|
}
|
|
4413
4490
|
setupCamera() {
|
|
4414
|
-
this._perspectiveCamera = new
|
|
4491
|
+
this._perspectiveCamera = new Fe(
|
|
4415
4492
|
60,
|
|
4416
4493
|
this.targetElement.clientWidth / this.targetElement.clientHeight,
|
|
4417
4494
|
0.1,
|
|
@@ -4460,7 +4537,7 @@ class bs {
|
|
|
4460
4537
|
*/
|
|
4461
4538
|
resizeCanvas() {
|
|
4462
4539
|
if (this.camera) {
|
|
4463
|
-
if (this.camera instanceof
|
|
4540
|
+
if (this.camera instanceof Fe && (this.camera.aspect = this.targetElement.clientWidth / this.targetElement.clientHeight), this.camera instanceof Ct) {
|
|
4464
4541
|
const e = this.targetElement.offsetWidth / this.targetElement.offsetHeight;
|
|
4465
4542
|
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;
|
|
4466
4543
|
}
|
|
@@ -4471,7 +4548,7 @@ class bs {
|
|
|
4471
4548
|
}
|
|
4472
4549
|
}
|
|
4473
4550
|
resizeCanvas2() {
|
|
4474
|
-
this.camera && (this.camera instanceof
|
|
4551
|
+
this.camera && (this.camera instanceof Fe && (this.camera.aspect = this.targetElement.offsetWidth / this.targetElement.offsetHeight), this.camera.updateProjectionMatrix(), this.viralViewerApi.viralRenderer.updateSize(
|
|
4475
4552
|
this.targetElement.offsetWidth,
|
|
4476
4553
|
this.targetElement.offsetHeight
|
|
4477
4554
|
), this.viralViewerApi.viralRenderer.render());
|
|
@@ -4581,7 +4658,7 @@ class bs {
|
|
|
4581
4658
|
const t = this.viralViewerApi.viralScene.scene;
|
|
4582
4659
|
if (!t || !this.camera)
|
|
4583
4660
|
return;
|
|
4584
|
-
const s = new
|
|
4661
|
+
const s = new N().setFromObject(t).getSize(new E()), n = Math.max(s.x, s.y, s.z);
|
|
4585
4662
|
this.camera.far = n + e, this.camera.updateProjectionMatrix(), this.cameraControls && (this.cameraControls.maxDistance = this.camera.far * 0.95);
|
|
4586
4663
|
}
|
|
4587
4664
|
/**
|
|
@@ -4653,7 +4730,7 @@ class bs {
|
|
|
4653
4730
|
2 * l / 2,
|
|
4654
4731
|
-(2 * l) / 2
|
|
4655
4732
|
));
|
|
4656
|
-
const c = new
|
|
4733
|
+
const c = new N(i, s);
|
|
4657
4734
|
await ((m = this.viralViewerApi.viralCamera.cameraControls) == null ? void 0 : m.fitToBox(c, !1));
|
|
4658
4735
|
const h = new E();
|
|
4659
4736
|
(f = this.viralViewerApi.viralCamera.cameraControls) == null || f.getPosition(h);
|
|
@@ -4667,17 +4744,17 @@ class bs {
|
|
|
4667
4744
|
}
|
|
4668
4745
|
//#endregion
|
|
4669
4746
|
}
|
|
4670
|
-
class
|
|
4747
|
+
class xs {
|
|
4671
4748
|
pakoUnzip(e) {
|
|
4672
4749
|
const t = new Uint8Array(e);
|
|
4673
|
-
return
|
|
4750
|
+
return Pi(t);
|
|
4674
4751
|
}
|
|
4675
4752
|
pakoStreamUnzip(e) {
|
|
4676
|
-
const t = new
|
|
4753
|
+
const t = new Oi();
|
|
4677
4754
|
return t.push(e, !0), t.result;
|
|
4678
4755
|
}
|
|
4679
4756
|
}
|
|
4680
|
-
class
|
|
4757
|
+
class ne {
|
|
4681
4758
|
constructor(e, t, i) {
|
|
4682
4759
|
this.x = 0, this.y = 0, this.z = 0, this.x = e, this.y = t, this.z = i;
|
|
4683
4760
|
}
|
|
@@ -4745,7 +4822,7 @@ class P {
|
|
|
4745
4822
|
const t = Math.sqrt(
|
|
4746
4823
|
e.x * e.x + e.y * e.y + e.z * e.z
|
|
4747
4824
|
);
|
|
4748
|
-
return t < 1e-7 ? new
|
|
4825
|
+
return t < 1e-7 ? new ne(0, 0, 0) : new ne(e.x / t, e.y / t, e.z / t);
|
|
4749
4826
|
}
|
|
4750
4827
|
static distance(e, t) {
|
|
4751
4828
|
return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2 + (e.z - t.z) ** 2);
|
|
@@ -4755,9 +4832,9 @@ class P {
|
|
|
4755
4832
|
}
|
|
4756
4833
|
static objectsIntersect(e, t, i = 1e-3) {
|
|
4757
4834
|
for (let s = 0; s < e.length; s += 9) {
|
|
4758
|
-
const n = new
|
|
4835
|
+
const n = new ne(e[s], e[s + 1], e[s + 2]), r = new ne(e[s + 3], e[s + 4], e[s + 5]), o = new ne(e[s + 6], e[s + 7], e[s + 8]);
|
|
4759
4836
|
for (let a = 0; a < t.length; a += 9) {
|
|
4760
|
-
const l = new
|
|
4837
|
+
const l = new ne(t[a], t[a + 1], t[a + 2]), c = new ne(t[a + 3], t[a + 4], t[a + 5]), h = new ne(t[a + 6], t[a + 7], t[a + 8]);
|
|
4761
4838
|
if (P.doesEdgeIncludePlane(n, r, l, c, h, i) && P.doesEdgeIncludePlane(r, o, l, c, h, i))
|
|
4762
4839
|
return console.log("belong to face"), !1;
|
|
4763
4840
|
if (P.doTrianglesIntersect(n, r, o, l, c, h, i))
|
|
@@ -4771,7 +4848,7 @@ class P {
|
|
|
4771
4848
|
return i && s && n;
|
|
4772
4849
|
}
|
|
4773
4850
|
}
|
|
4774
|
-
function
|
|
4851
|
+
function Ms() {
|
|
4775
4852
|
class g {
|
|
4776
4853
|
constructor(t, i, s) {
|
|
4777
4854
|
this.X = 0, this.Y = 0, this.Z = 0, this.X = t, this.Y = i, this.Z = s;
|
|
@@ -4793,11 +4870,11 @@ function ys() {
|
|
|
4793
4870
|
self.postMessage(i());
|
|
4794
4871
|
};
|
|
4795
4872
|
}
|
|
4796
|
-
const
|
|
4797
|
-
class
|
|
4873
|
+
const Es = Ms;
|
|
4874
|
+
class Ss {
|
|
4798
4875
|
constructor() {
|
|
4799
|
-
const e = new Blob([`(${
|
|
4800
|
-
this.workerPool = new
|
|
4876
|
+
const e = new Blob([`(${Es})()`]), t = URL.createObjectURL(e);
|
|
4877
|
+
this.workerPool = new ie(navigator.hardwareConcurrency || 10, t);
|
|
4801
4878
|
}
|
|
4802
4879
|
getBoundingBox(e, t = (i) => {
|
|
4803
4880
|
}) {
|
|
@@ -4809,7 +4886,7 @@ class Ms {
|
|
|
4809
4886
|
);
|
|
4810
4887
|
}
|
|
4811
4888
|
}
|
|
4812
|
-
function
|
|
4889
|
+
function Cs() {
|
|
4813
4890
|
self.onmessage = (g) => {
|
|
4814
4891
|
const e = g.data;
|
|
4815
4892
|
function t(s, n, r = 0.1) {
|
|
@@ -4827,11 +4904,11 @@ function Es() {
|
|
|
4827
4904
|
self.postMessage(i);
|
|
4828
4905
|
};
|
|
4829
4906
|
}
|
|
4830
|
-
const
|
|
4831
|
-
class
|
|
4907
|
+
const As = Cs;
|
|
4908
|
+
class _s {
|
|
4832
4909
|
constructor() {
|
|
4833
|
-
const e = new Blob([`(${
|
|
4834
|
-
this.workerPool = new
|
|
4910
|
+
const e = new Blob([`(${As})()`]), t = URL.createObjectURL(e);
|
|
4911
|
+
this.workerPool = new ie(4, t);
|
|
4835
4912
|
}
|
|
4836
4913
|
checkIntersect(e, t = (i) => {
|
|
4837
4914
|
}) {
|
|
@@ -4840,7 +4917,7 @@ class Cs {
|
|
|
4840
4917
|
});
|
|
4841
4918
|
}
|
|
4842
4919
|
}
|
|
4843
|
-
function
|
|
4920
|
+
function Is() {
|
|
4844
4921
|
class g {
|
|
4845
4922
|
constructor() {
|
|
4846
4923
|
this.children = /* @__PURE__ */ new Map(), this.keys = /* @__PURE__ */ new Set();
|
|
@@ -4932,11 +5009,11 @@ function As() {
|
|
|
4932
5009
|
}
|
|
4933
5010
|
};
|
|
4934
5011
|
}
|
|
4935
|
-
const
|
|
4936
|
-
class
|
|
5012
|
+
const Vs = Is;
|
|
5013
|
+
class Ts {
|
|
4937
5014
|
constructor() {
|
|
4938
|
-
const e = new Blob([`(${
|
|
4939
|
-
this.workerPool = new
|
|
5015
|
+
const e = new Blob([`(${Vs})()`]), t = URL.createObjectURL(e);
|
|
5016
|
+
this.workerPool = new ie(2, t);
|
|
4940
5017
|
}
|
|
4941
5018
|
buildTreeNode(e, t = (i) => {
|
|
4942
5019
|
}) {
|
|
@@ -4945,7 +5022,7 @@ class Vs {
|
|
|
4945
5022
|
});
|
|
4946
5023
|
}
|
|
4947
5024
|
}
|
|
4948
|
-
function
|
|
5025
|
+
function Ps() {
|
|
4949
5026
|
class g {
|
|
4950
5027
|
constructor(u, p, m) {
|
|
4951
5028
|
this.x = 0, this.y = 0, this.z = 0, this.x = u, this.y = p, this.z = m;
|
|
@@ -4980,7 +5057,7 @@ function Is() {
|
|
|
4980
5057
|
return Math.sqrt((d.x - u.x) ** 2 + (d.y - u.y) ** 2 + (d.z - u.z) ** 2);
|
|
4981
5058
|
}
|
|
4982
5059
|
function a(d, u, p, m, f = 1e-7) {
|
|
4983
|
-
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),
|
|
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(_), T = r(I), j = s(O, V), H = s(V, T);
|
|
4984
5061
|
return j > 1 - f && H > 1 - f;
|
|
4985
5062
|
}
|
|
4986
5063
|
function l(d, u, p, m, f, v, b = 1e-3) {
|
|
@@ -4990,8 +5067,8 @@ function Is() {
|
|
|
4990
5067
|
const b = e(m, p), w = e(f, p), S = n(b, w), A = -s(S, p), C = s(S, d) + A, M = s(S, u) + A;
|
|
4991
5068
|
if (Math.abs(C) > v || Math.abs(M) > v)
|
|
4992
5069
|
return !1;
|
|
4993
|
-
const _ = a(d, p, m, f, v),
|
|
4994
|
-
return !(!_ || !
|
|
5070
|
+
const _ = a(d, p, m, f, v), I = a(u, p, m, f, v);
|
|
5071
|
+
return !(!_ || !I);
|
|
4995
5072
|
}
|
|
4996
5073
|
function h(d, u, p, m, f, v = 5) {
|
|
4997
5074
|
const b = e(m, p), w = e(f, p), S = n(b, w), A = -s(S, p), C = e(u, d), M = s(S, C);
|
|
@@ -5000,8 +5077,8 @@ function Is() {
|
|
|
5000
5077
|
const _ = -(s(S, d) + A) / M;
|
|
5001
5078
|
if (_ < -v || _ > 1 + v)
|
|
5002
5079
|
return !1;
|
|
5003
|
-
const
|
|
5004
|
-
return O < v ||
|
|
5080
|
+
const I = t(d, i(C, _)), O = o(I, d), V = o(I, u);
|
|
5081
|
+
return O < v || V < v ? !1 : a(I, p, m, f, v);
|
|
5005
5082
|
}
|
|
5006
5083
|
self.onmessage = (d) => {
|
|
5007
5084
|
const u = d.data, p = u.buffer1, m = u.buffer2, f = 1e-3;
|
|
@@ -5015,11 +5092,11 @@ function Is() {
|
|
|
5015
5092
|
self.postMessage(!1);
|
|
5016
5093
|
};
|
|
5017
5094
|
}
|
|
5018
|
-
const
|
|
5019
|
-
class
|
|
5095
|
+
const Os = Ps;
|
|
5096
|
+
class Ds {
|
|
5020
5097
|
constructor() {
|
|
5021
|
-
const e = new Blob([`(${
|
|
5022
|
-
this.workerPool = new
|
|
5098
|
+
const e = new Blob([`(${Os})()`]), t = URL.createObjectURL(e);
|
|
5099
|
+
this.workerPool = new ie(navigator.hardwareConcurrency || 10, t);
|
|
5023
5100
|
}
|
|
5024
5101
|
checkClash(e, t = (i) => {
|
|
5025
5102
|
}) {
|
|
@@ -5028,7 +5105,7 @@ class Ps {
|
|
|
5028
5105
|
});
|
|
5029
5106
|
}
|
|
5030
5107
|
}
|
|
5031
|
-
function
|
|
5108
|
+
function Rs() {
|
|
5032
5109
|
self.addEventListener(
|
|
5033
5110
|
"message",
|
|
5034
5111
|
(g) => {
|
|
@@ -5062,28 +5139,28 @@ function Os() {
|
|
|
5062
5139
|
!1
|
|
5063
5140
|
);
|
|
5064
5141
|
}
|
|
5065
|
-
const
|
|
5066
|
-
class
|
|
5142
|
+
const Ls = Rs;
|
|
5143
|
+
class ks {
|
|
5067
5144
|
constructor() {
|
|
5068
|
-
const e = new Blob([`(${
|
|
5069
|
-
this.workerPool = new
|
|
5145
|
+
const e = new Blob([`(${Ls})()`]), t = URL.createObjectURL(e);
|
|
5146
|
+
this.workerPool = new ie(2, t);
|
|
5070
5147
|
}
|
|
5071
5148
|
fetch(e, t = (n) => {
|
|
5072
5149
|
}, i, s) {
|
|
5073
|
-
const n = new
|
|
5150
|
+
const n = new Bs(e, i, s);
|
|
5074
5151
|
this.workerPool.Enqueue(n, (r) => {
|
|
5075
5152
|
t(r);
|
|
5076
5153
|
});
|
|
5077
5154
|
}
|
|
5078
5155
|
}
|
|
5079
|
-
class
|
|
5156
|
+
class Bs {
|
|
5080
5157
|
constructor(e, t, i) {
|
|
5081
5158
|
this.url = "", this.url = e, this.byteRangeStart = t, this.byteRangeEnd = i;
|
|
5082
5159
|
}
|
|
5083
5160
|
}
|
|
5084
|
-
class
|
|
5161
|
+
class zs {
|
|
5085
5162
|
constructor(e) {
|
|
5086
|
-
this.viralViewerApi = e, this.dataTree = [], this.trackingData = /* @__PURE__ */ new Map(), this.fetchDataWorker = new
|
|
5163
|
+
this.viralViewerApi = e, this.dataTree = [], this.trackingData = /* @__PURE__ */ new Map(), this.fetchDataWorker = new ks(), this.buildTreeNodeWorker = new Ts(), this._boundingBoxWorker = new Ss(), this._boundingBoxIntersectWorker = new _s(), this._checkClashWorker = new Ds(), 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());
|
|
5087
5164
|
}
|
|
5088
5165
|
addTrackingData(e, t) {
|
|
5089
5166
|
this.trackingData.set(e, t);
|
|
@@ -5133,7 +5210,7 @@ class ks {
|
|
|
5133
5210
|
addData(e) {
|
|
5134
5211
|
const t = performance.now(), i = Object.keys(e.Data).length;
|
|
5135
5212
|
console.log(`[DataManager] Adding ${i} elements to data tree...`);
|
|
5136
|
-
const s = new
|
|
5213
|
+
const s = new as();
|
|
5137
5214
|
s.addElements(e.Data), e.Relationships && (s.addRelationships(e.Relationships), s.buildGraphIndex()), this.dataTree.push(s), this.viralViewerApi.emit(R.LOADED_DATA, {
|
|
5138
5215
|
modelId: this.dataTree.length - 1
|
|
5139
5216
|
}), console.log(
|
|
@@ -5211,7 +5288,7 @@ class ks {
|
|
|
5211
5288
|
* @returns
|
|
5212
5289
|
*/
|
|
5213
5290
|
compareModels(e = 0, t = 1) {
|
|
5214
|
-
const i = new
|
|
5291
|
+
const i = new os();
|
|
5215
5292
|
if (!this.dataTree[e] || !this.dataTree[t])
|
|
5216
5293
|
return i;
|
|
5217
5294
|
const s = this.dataTree[e].elementData, n = this.dataTree[t].elementData, r = this._getDiffKeys(s[0], n[0]);
|
|
@@ -5239,46 +5316,46 @@ class ks {
|
|
|
5239
5316
|
}
|
|
5240
5317
|
return this.viralViewerApi.viralVisibilityManager.exceptElements = [], this.viralViewerApi.viralScene.bimWorld.changeColor(
|
|
5241
5318
|
i.deleted.map((a) => ({ elementId: a.toString(), modelId: e.toString() })),
|
|
5242
|
-
D.hexToRGB(
|
|
5319
|
+
D.hexToRGB(y.deleted),
|
|
5243
5320
|
!0
|
|
5244
5321
|
), this.viralViewerApi.viralVisibilityManager.exceptElements.push({
|
|
5245
5322
|
elements: i.deleted.map((a) => ({ elementId: a.toString(), modelId: e.toString() })),
|
|
5246
|
-
color: D.hexToRGB(
|
|
5323
|
+
color: D.hexToRGB(y.deleted)
|
|
5247
5324
|
}), this.viralViewerApi.viralScene.bimWorld.changeColor(
|
|
5248
5325
|
i.added.map((a) => ({ elementId: a.toString(), modelId: t.toString() })),
|
|
5249
|
-
D.hexToRGB(
|
|
5326
|
+
D.hexToRGB(y.added),
|
|
5250
5327
|
!0
|
|
5251
5328
|
), this.viralViewerApi.viralVisibilityManager.exceptElements.push({
|
|
5252
5329
|
elements: i.added.map((a) => ({ elementId: a.toString(), modelId: t.toString() })),
|
|
5253
|
-
color: D.hexToRGB(
|
|
5330
|
+
color: D.hexToRGB(y.added)
|
|
5254
5331
|
}), this.viralViewerApi.viralScene.bimWorld.changeColor(
|
|
5255
5332
|
i.modified.map((a) => ({ elementId: a.toString(), modelId: e.toString() })),
|
|
5256
|
-
D.hexToRGB(
|
|
5333
|
+
D.hexToRGB(y.modified),
|
|
5257
5334
|
!0
|
|
5258
5335
|
), this.viralViewerApi.viralScene.bimWorld.changeColor(
|
|
5259
5336
|
i.modified.map((a) => ({ elementId: a.toString(), modelId: t.toString() })),
|
|
5260
|
-
D.hexToRGB(
|
|
5337
|
+
D.hexToRGB(y.modified),
|
|
5261
5338
|
!0
|
|
5262
5339
|
), this.viralViewerApi.viralVisibilityManager.exceptElements.push({
|
|
5263
5340
|
elements: i.modified.map((a) => ({ elementId: a.toString(), modelId: e.toString() })),
|
|
5264
|
-
color: D.hexToRGB(
|
|
5341
|
+
color: D.hexToRGB(y.modified)
|
|
5265
5342
|
}), this.viralViewerApi.viralVisibilityManager.exceptElements.push({
|
|
5266
5343
|
elements: i.modified.map((a) => ({ elementId: a.toString(), modelId: t.toString() })),
|
|
5267
|
-
color: D.hexToRGB(
|
|
5344
|
+
color: D.hexToRGB(y.modified)
|
|
5268
5345
|
}), this.viralViewerApi.viralScene.bimWorld.changeColor(
|
|
5269
5346
|
i.notChanged.map((a) => ({ elementId: a.toString(), modelId: e.toString() })),
|
|
5270
|
-
D.hexToRGB(
|
|
5347
|
+
D.hexToRGB(y.notChanged),
|
|
5271
5348
|
!0
|
|
5272
5349
|
), this.viralViewerApi.viralScene.bimWorld.changeColor(
|
|
5273
5350
|
i.notChanged.map((a) => ({ elementId: a.toString(), modelId: t.toString() })),
|
|
5274
|
-
D.hexToRGB(
|
|
5351
|
+
D.hexToRGB(y.notChanged),
|
|
5275
5352
|
!0
|
|
5276
5353
|
), this.viralViewerApi.viralVisibilityManager.exceptElements.push({
|
|
5277
5354
|
elements: i.notChanged.map((a) => ({ elementId: a.toString(), modelId: e.toString() })),
|
|
5278
|
-
color: D.hexToRGB(
|
|
5355
|
+
color: D.hexToRGB(y.notChanged)
|
|
5279
5356
|
}), this.viralViewerApi.viralVisibilityManager.exceptElements.push({
|
|
5280
5357
|
elements: i.notChanged.map((a) => ({ elementId: a.toString(), modelId: t.toString() })),
|
|
5281
|
-
color: D.hexToRGB(
|
|
5358
|
+
color: D.hexToRGB(y.notChanged)
|
|
5282
5359
|
}), this.viralViewerApi.viralRenderer.render(), i;
|
|
5283
5360
|
}
|
|
5284
5361
|
uncompareModels() {
|
|
@@ -5320,7 +5397,7 @@ class ks {
|
|
|
5320
5397
|
* @param secondModelIndex
|
|
5321
5398
|
*/
|
|
5322
5399
|
async checkClashModels(e = 0, t = 0) {
|
|
5323
|
-
const i = new
|
|
5400
|
+
const i = new ls(), s = this.viralViewerApi.viralScene.bimWorld.getElementsByModel(e), n = e === t ? s : this.viralViewerApi.viralScene.bimWorld.getElementsByModel(t);
|
|
5324
5401
|
if (s.length === 0 || n.length === 0)
|
|
5325
5402
|
return i;
|
|
5326
5403
|
const r = (h) => new Promise((d) => {
|
|
@@ -5411,7 +5488,7 @@ class ks {
|
|
|
5411
5488
|
(h) => this._shallowCompare(h.value, l)
|
|
5412
5489
|
);
|
|
5413
5490
|
if (c < 0) {
|
|
5414
|
-
const h = new
|
|
5491
|
+
const h = new cs();
|
|
5415
5492
|
h.value = l, h.modelId = s, h.elementIds = [], h.elementIds.push(Number(o)), t.push(h);
|
|
5416
5493
|
} else
|
|
5417
5494
|
t[c].elementIds.push(Number(o));
|
|
@@ -5438,7 +5515,7 @@ class ks {
|
|
|
5438
5515
|
}
|
|
5439
5516
|
//#endregion
|
|
5440
5517
|
}
|
|
5441
|
-
class
|
|
5518
|
+
class Ns {
|
|
5442
5519
|
constructor() {
|
|
5443
5520
|
this.events = {
|
|
5444
5521
|
[R.LOADED_SCENE]: [],
|
|
@@ -5480,7 +5557,7 @@ class Bs {
|
|
|
5480
5557
|
i && i.forEach((s) => s(...t));
|
|
5481
5558
|
}
|
|
5482
5559
|
}
|
|
5483
|
-
class
|
|
5560
|
+
class $s {
|
|
5484
5561
|
constructor(e) {
|
|
5485
5562
|
this.viralViewerApi = e, this.keydownQueuedEvents = [], this.keyupQueuedEvents = [], this.setupKeyPress();
|
|
5486
5563
|
}
|
|
@@ -5528,9 +5605,9 @@ class zs {
|
|
|
5528
5605
|
}
|
|
5529
5606
|
//#endregion
|
|
5530
5607
|
}
|
|
5531
|
-
class
|
|
5608
|
+
class js {
|
|
5532
5609
|
constructor(e) {
|
|
5533
|
-
this.viralViewerApi = e, this.position = new
|
|
5610
|
+
this.viralViewerApi = e, this.position = new z(), this.rawPosition = new z(), this.mouseMoveQueuedEvents = [], this.mouseDownLeftQueuedEvents = [], this.mouseUpLeftQueuedEvents = [], this.mouseDownRightQueuedEvents = [], this.mouseUpRightQueuedEvents = [], this.mouseDoubleClickQueuedEvents = [], this.handleClick = async (t) => {
|
|
5534
5611
|
var i, s, n;
|
|
5535
5612
|
if (this.viralViewerApi) {
|
|
5536
5613
|
if (t.button === 0) {
|
|
@@ -5574,7 +5651,7 @@ class Ns {
|
|
|
5574
5651
|
}
|
|
5575
5652
|
l = c;
|
|
5576
5653
|
break;
|
|
5577
|
-
} else if (c.object instanceof
|
|
5654
|
+
} else if (c.object instanceof le) {
|
|
5578
5655
|
l = c;
|
|
5579
5656
|
break;
|
|
5580
5657
|
}
|
|
@@ -5628,53 +5705,53 @@ class Ns {
|
|
|
5628
5705
|
*/
|
|
5629
5706
|
addEventListener(e, t, i) {
|
|
5630
5707
|
switch (e) {
|
|
5631
|
-
case
|
|
5708
|
+
case B.ON_MOUSE_MOVE:
|
|
5632
5709
|
this.mouseMoveQueuedEvents.push([t, i]);
|
|
5633
5710
|
break;
|
|
5634
|
-
case
|
|
5711
|
+
case B.ON_MOUSE_DOWN_LEFT:
|
|
5635
5712
|
this.mouseDownLeftQueuedEvents.push([t, i]);
|
|
5636
5713
|
break;
|
|
5637
|
-
case
|
|
5714
|
+
case B.ON_MOUSE_UP_LEFT:
|
|
5638
5715
|
this.mouseUpLeftQueuedEvents.push([t, i]);
|
|
5639
5716
|
break;
|
|
5640
|
-
case
|
|
5717
|
+
case B.ON_MOUSE_DOWN_RIGHT:
|
|
5641
5718
|
this.mouseDownRightQueuedEvents.push([t, i]);
|
|
5642
5719
|
break;
|
|
5643
|
-
case
|
|
5720
|
+
case B.ON_MOUSE_UP_RIGHT:
|
|
5644
5721
|
this.mouseUpRightQueuedEvents.push([t, i]);
|
|
5645
5722
|
break;
|
|
5646
|
-
case
|
|
5723
|
+
case B.ON_MOUSE_DOUBLE_CLICK:
|
|
5647
5724
|
this.mouseDoubleClickQueuedEvents.push([t, i]);
|
|
5648
5725
|
break;
|
|
5649
5726
|
}
|
|
5650
5727
|
}
|
|
5651
5728
|
removeEventListener(e, t) {
|
|
5652
5729
|
switch (e) {
|
|
5653
|
-
case
|
|
5730
|
+
case B.ON_MOUSE_MOVE:
|
|
5654
5731
|
{
|
|
5655
5732
|
const i = this.mouseMoveQueuedEvents.findIndex((s) => s[0] === t);
|
|
5656
5733
|
this.mouseMoveQueuedEvents.splice(i, 1);
|
|
5657
5734
|
}
|
|
5658
5735
|
break;
|
|
5659
|
-
case
|
|
5736
|
+
case B.ON_MOUSE_DOWN_LEFT:
|
|
5660
5737
|
{
|
|
5661
5738
|
const i = this.mouseDownLeftQueuedEvents.findIndex((s) => s[0] === t);
|
|
5662
5739
|
this.mouseDownLeftQueuedEvents.splice(i, 1);
|
|
5663
5740
|
}
|
|
5664
5741
|
break;
|
|
5665
|
-
case
|
|
5742
|
+
case B.ON_MOUSE_UP_LEFT:
|
|
5666
5743
|
{
|
|
5667
5744
|
const i = this.mouseUpLeftQueuedEvents.findIndex((s) => s[0] === t);
|
|
5668
5745
|
this.mouseUpLeftQueuedEvents.splice(i, 1);
|
|
5669
5746
|
}
|
|
5670
5747
|
break;
|
|
5671
|
-
case
|
|
5748
|
+
case B.ON_MOUSE_DOWN_RIGHT:
|
|
5672
5749
|
{
|
|
5673
5750
|
const i = this.mouseDownRightQueuedEvents.findIndex((s) => s[0] === t);
|
|
5674
5751
|
this.mouseDownRightQueuedEvents.splice(i, 1);
|
|
5675
5752
|
}
|
|
5676
5753
|
break;
|
|
5677
|
-
case
|
|
5754
|
+
case B.ON_MOUSE_UP_RIGHT:
|
|
5678
5755
|
{
|
|
5679
5756
|
const i = this.mouseUpRightQueuedEvents.findIndex((s) => s[0] === t);
|
|
5680
5757
|
this.mouseUpRightQueuedEvents.splice(i, 1);
|
|
@@ -5702,14 +5779,14 @@ class Ns {
|
|
|
5702
5779
|
}
|
|
5703
5780
|
//#endregion
|
|
5704
5781
|
}
|
|
5705
|
-
const
|
|
5782
|
+
const He = {
|
|
5706
5783
|
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>`,
|
|
5707
5784
|
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>`,
|
|
5708
5785
|
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>`,
|
|
5709
5786
|
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>`,
|
|
5710
5787
|
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>`
|
|
5711
5788
|
};
|
|
5712
|
-
class
|
|
5789
|
+
class Hs {
|
|
5713
5790
|
constructor(e) {
|
|
5714
5791
|
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;
|
|
5715
5792
|
}
|
|
@@ -5717,40 +5794,40 @@ class $s {
|
|
|
5717
5794
|
this.viralViewerApi.viralContextMenu && (this.viralViewerApi.viralContextMenu.addContextItem(
|
|
5718
5795
|
0,
|
|
5719
5796
|
"Show all elements",
|
|
5720
|
-
|
|
5797
|
+
He.showAll(void 0, y.primary),
|
|
5721
5798
|
(e) => {
|
|
5722
5799
|
this._visibilityManager.showAll2(), this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
5723
5800
|
}
|
|
5724
5801
|
), this.viralViewerApi.viralContextMenu.addContextItem(
|
|
5725
5802
|
1,
|
|
5726
5803
|
"Isolate",
|
|
5727
|
-
|
|
5804
|
+
He.isolate(void 0, y.primary),
|
|
5728
5805
|
(e) => {
|
|
5729
5806
|
this._visibilityManager.isolate2(), this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
5730
5807
|
}
|
|
5731
5808
|
), this.viralViewerApi.viralContextMenu.addContextItem(
|
|
5732
5809
|
2,
|
|
5733
5810
|
"Hide",
|
|
5734
|
-
|
|
5811
|
+
He.hide(void 0, y.primary),
|
|
5735
5812
|
(e) => {
|
|
5736
5813
|
this._visibilityManager.hide2(), this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
5737
5814
|
}
|
|
5738
5815
|
), this.viralViewerApi.viralContextMenu.addContextItem(
|
|
5739
5816
|
3,
|
|
5740
5817
|
"Focus",
|
|
5741
|
-
|
|
5818
|
+
He.focus(void 0, y.primary),
|
|
5742
5819
|
(e) => {
|
|
5743
5820
|
this._visibilityManager.zoomTo(), this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
5744
5821
|
}
|
|
5745
5822
|
), this.viralViewerApi.viralContextMenu.addContextItem(
|
|
5746
5823
|
4,
|
|
5747
5824
|
"Properties",
|
|
5748
|
-
|
|
5825
|
+
He.properties(void 0, y.secondary),
|
|
5749
5826
|
(e) => {
|
|
5750
5827
|
this.viralViewerApi.viralDraggableModal.show(), this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
5751
5828
|
}
|
|
5752
5829
|
)), this.viralViewerApi.viralMouse && (this.viralViewerApi.viralMouse.addEventListener(
|
|
5753
|
-
|
|
5830
|
+
B.ON_MOUSE_DOWN_RIGHT,
|
|
5754
5831
|
"ShowContextMenu",
|
|
5755
5832
|
(e) => {
|
|
5756
5833
|
this.viralViewerApi.viralContextMenu.showContextMenu(
|
|
@@ -5760,7 +5837,7 @@ class $s {
|
|
|
5760
5837
|
);
|
|
5761
5838
|
}
|
|
5762
5839
|
), this.viralViewerApi.viralMouse.addEventListener(
|
|
5763
|
-
|
|
5840
|
+
B.ON_MOUSE_DOWN_LEFT,
|
|
5764
5841
|
"HideContextMenu",
|
|
5765
5842
|
(e) => {
|
|
5766
5843
|
this.viralViewerApi.viralContextMenu.hideContextMenu();
|
|
@@ -5802,13 +5879,13 @@ class $s {
|
|
|
5802
5879
|
let e = null;
|
|
5803
5880
|
const t = 250;
|
|
5804
5881
|
this.viralViewerApi.viralMouse.addEventListener(
|
|
5805
|
-
|
|
5882
|
+
B.ON_MOUSE_DOWN_LEFT,
|
|
5806
5883
|
"SelectElement",
|
|
5807
5884
|
(i) => {
|
|
5808
5885
|
e = performance.now();
|
|
5809
5886
|
}
|
|
5810
5887
|
), this.viralViewerApi.viralMouse.addEventListener(
|
|
5811
|
-
|
|
5888
|
+
B.ON_MOUSE_UP_LEFT,
|
|
5812
5889
|
"SelectElementUp",
|
|
5813
5890
|
(i) => {
|
|
5814
5891
|
var s, n;
|
|
@@ -5896,7 +5973,7 @@ class $s {
|
|
|
5896
5973
|
//#region Double Click element handler
|
|
5897
5974
|
doubleClickElementHandler() {
|
|
5898
5975
|
this.viralViewerApi.viralMouse.addEventListener(
|
|
5899
|
-
|
|
5976
|
+
B.ON_MOUSE_DOUBLE_CLICK,
|
|
5900
5977
|
"DoubleClickElement",
|
|
5901
5978
|
(e) => {
|
|
5902
5979
|
const t = this.viralViewerApi.viralCamera.clientToWorld();
|
|
@@ -5955,7 +6032,7 @@ class $s {
|
|
|
5955
6032
|
}
|
|
5956
6033
|
//#endregion
|
|
5957
6034
|
}
|
|
5958
|
-
class
|
|
6035
|
+
class Fs {
|
|
5959
6036
|
constructor(e, t) {
|
|
5960
6037
|
this.viralViewerApi = e, this.options = t, this.viralViewerApi.on(R.LOADED_SCENE, () => this.loadedScene()), this.viralViewerApi.on(
|
|
5961
6038
|
R.LOADED_MATERIAL_MANAGER,
|
|
@@ -5998,9 +6075,9 @@ class js {
|
|
|
5998
6075
|
});
|
|
5999
6076
|
}
|
|
6000
6077
|
}
|
|
6001
|
-
class
|
|
6078
|
+
class Ws {
|
|
6002
6079
|
constructor(e) {
|
|
6003
|
-
this.viralViewerApi = e, this.potree = new
|
|
6080
|
+
this.viralViewerApi = e, this.potree = new Di(), this.pointClouds = [];
|
|
6004
6081
|
}
|
|
6005
6082
|
/**
|
|
6006
6083
|
*
|
|
@@ -6016,13 +6093,13 @@ class Hs {
|
|
|
6016
6093
|
(r = this.viralViewerApi.viralRenderer.postProcessingRenderer) == null || r.disableOutline(), this.potree.pointBudget = s, this.potree.loadPointCloudCustom(e, t, i).then((o) => {
|
|
6017
6094
|
var d;
|
|
6018
6095
|
const a = o.material;
|
|
6019
|
-
a.size = 1, a.pointSizeType =
|
|
6020
|
-
const l = new E(0, -1.5, 3), c = new
|
|
6096
|
+
a.size = 1, a.pointSizeType = Ri.ADAPTIVE, a.shape = Li.CIRCLE, a.pointColorType = ki.RGB, a.inputColorEncoding = 1, a.outputColorEncoding = 1, console.log(o.boundingBox);
|
|
6097
|
+
const l = new E(0, -1.5, 3), c = new oi(-Math.PI / 2, 0, 0), h = new E(2, 2, 2);
|
|
6021
6098
|
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);
|
|
6022
6099
|
});
|
|
6023
6100
|
}
|
|
6024
6101
|
}
|
|
6025
|
-
class
|
|
6102
|
+
class Gs {
|
|
6026
6103
|
static getDeviceType() {
|
|
6027
6104
|
const e = navigator.userAgent.toLowerCase(), t = /iphone|ipod|android.*mobile|blackberry|opera mini|windows phone/i.test(
|
|
6028
6105
|
e
|
|
@@ -6030,7 +6107,7 @@ class Ws {
|
|
|
6030
6107
|
return t ? "mobile" : i ? "tablet" : "pc";
|
|
6031
6108
|
}
|
|
6032
6109
|
}
|
|
6033
|
-
class
|
|
6110
|
+
class Us {
|
|
6034
6111
|
constructor() {
|
|
6035
6112
|
this.gl = null, this.specs = null, this.initWebGL(), this.detectSpecs();
|
|
6036
6113
|
}
|
|
@@ -6174,16 +6251,16 @@ class Fs {
|
|
|
6174
6251
|
});
|
|
6175
6252
|
}
|
|
6176
6253
|
}
|
|
6177
|
-
class
|
|
6254
|
+
class qs {
|
|
6178
6255
|
constructor() {
|
|
6179
|
-
this.modelId = -1, this.elements = [], this.materials = [], this.mapMaterialsToMaterialManager = new
|
|
6256
|
+
this.modelId = -1, this.elements = [], this.materials = [], this.mapMaterialsToMaterialManager = new It();
|
|
6180
6257
|
}
|
|
6181
6258
|
//#endregion
|
|
6182
6259
|
dispose() {
|
|
6183
|
-
this.elements = [], this.materials = [], this.mapMaterialsToMaterialManager = new
|
|
6260
|
+
this.elements = [], this.materials = [], this.mapMaterialsToMaterialManager = new It();
|
|
6184
6261
|
}
|
|
6185
6262
|
}
|
|
6186
|
-
class
|
|
6263
|
+
class Qs {
|
|
6187
6264
|
constructor() {
|
|
6188
6265
|
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;
|
|
6189
6266
|
}
|
|
@@ -6332,8 +6409,8 @@ class Us {
|
|
|
6332
6409
|
}
|
|
6333
6410
|
}
|
|
6334
6411
|
}
|
|
6335
|
-
const
|
|
6336
|
-
function
|
|
6412
|
+
const Zs = new Qs();
|
|
6413
|
+
function Ys() {
|
|
6337
6414
|
class g {
|
|
6338
6415
|
constructor() {
|
|
6339
6416
|
this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
@@ -6418,8 +6495,8 @@ function Qs() {
|
|
|
6418
6495
|
}), self.postMessage(r);
|
|
6419
6496
|
};
|
|
6420
6497
|
}
|
|
6421
|
-
const
|
|
6422
|
-
function
|
|
6498
|
+
const Xs = Ys;
|
|
6499
|
+
function Ks() {
|
|
6423
6500
|
class g {
|
|
6424
6501
|
constructor() {
|
|
6425
6502
|
this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
@@ -6509,19 +6586,19 @@ function Ys() {
|
|
|
6509
6586
|
}), self.postMessage(r);
|
|
6510
6587
|
};
|
|
6511
6588
|
}
|
|
6512
|
-
const
|
|
6513
|
-
class
|
|
6589
|
+
const Js = Ks;
|
|
6590
|
+
class en {
|
|
6514
6591
|
// Or 5K objects
|
|
6515
6592
|
//#endregion
|
|
6516
6593
|
constructor(e) {
|
|
6517
6594
|
this.viralViewerApi = e, this.lastRenderTime = 0, this.elementBuffer = /* @__PURE__ */ new Map(), this.BATCH_THRESHOLD_VERTICES = 1e5, this.BATCH_THRESHOLD_OBJECTS = 5e3;
|
|
6518
|
-
const t = new Blob([`(${
|
|
6519
|
-
this.workerPool = new
|
|
6595
|
+
const t = new Blob([`(${Xs})()`]), i = URL.createObjectURL(t);
|
|
6596
|
+
this.workerPool = new ie(
|
|
6520
6597
|
navigator.hardwareConcurrency || this.viralViewerApi.options.numberOfWorker,
|
|
6521
6598
|
i
|
|
6522
6599
|
);
|
|
6523
|
-
const s = new Blob([`(${
|
|
6524
|
-
this.workerPool2 = new
|
|
6600
|
+
const s = new Blob([`(${Js})()`]), n = URL.createObjectURL(s);
|
|
6601
|
+
this.workerPool2 = new ie(
|
|
6525
6602
|
this.viralViewerApi.options.numberOfWorker,
|
|
6526
6603
|
n
|
|
6527
6604
|
);
|
|
@@ -6533,7 +6610,7 @@ class Ks {
|
|
|
6533
6610
|
*/
|
|
6534
6611
|
initial(e) {
|
|
6535
6612
|
console.log(e);
|
|
6536
|
-
const t = new
|
|
6613
|
+
const t = new qs();
|
|
6537
6614
|
t.modelId = this.viralViewerApi.viralScene.bimWorld.bimModels.length, this.viralViewerApi.viralScene.bimWorld.bimModels.push(t);
|
|
6538
6615
|
const i = this.viralViewerApi.viralScene.bimWorld.bimModels.length - 1;
|
|
6539
6616
|
for (let s = 0; s < e.length; s++) {
|
|
@@ -6545,7 +6622,7 @@ class Ks {
|
|
|
6545
6622
|
(a) => a.userData.red === n.Red && a.userData.green === n.Green && a.userData.blue === n.Blue && a.userData.opacity === n.Opacity
|
|
6546
6623
|
);
|
|
6547
6624
|
if (o < 0) {
|
|
6548
|
-
const a = new
|
|
6625
|
+
const a = new ft({
|
|
6549
6626
|
color: r,
|
|
6550
6627
|
opacity: n.Opacity,
|
|
6551
6628
|
transparent: n.Opacity !== 1,
|
|
@@ -6556,7 +6633,7 @@ class Ks {
|
|
|
6556
6633
|
// polygonOffset: true,
|
|
6557
6634
|
// polygonOffsetFactor: 1,
|
|
6558
6635
|
// polygonOffsetUnits: 0.1,
|
|
6559
|
-
side:
|
|
6636
|
+
side: li
|
|
6560
6637
|
// 🔧 FIX: Changed from DoubleSide to halve draw calls
|
|
6561
6638
|
});
|
|
6562
6639
|
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);
|
|
@@ -6572,7 +6649,7 @@ class Ks {
|
|
|
6572
6649
|
*/
|
|
6573
6650
|
loadElement(e, t, i = () => {
|
|
6574
6651
|
}, s = null) {
|
|
6575
|
-
const { highDuplicationElements: n, lowDuplicationElements: r } =
|
|
6652
|
+
const { highDuplicationElements: n, lowDuplicationElements: r } = Zs.analyze(t), o = r.map((p) => p.element), a = n.map((p) => p.element), l = o.length > 0, c = a.length > 0;
|
|
6576
6653
|
if (!l && !c) {
|
|
6577
6654
|
i();
|
|
6578
6655
|
return;
|
|
@@ -6680,14 +6757,14 @@ class Ks {
|
|
|
6680
6757
|
* Uses onBeforeCompile to inject custom shader code for RGBA vertex colors
|
|
6681
6758
|
*/
|
|
6682
6759
|
createOptimizedMaterial(e) {
|
|
6683
|
-
const t =
|
|
6760
|
+
const t = Gs.getDeviceType() === "pc", i = (r, o = 2) => {
|
|
6684
6761
|
if (!r)
|
|
6685
6762
|
return 16777215;
|
|
6686
6763
|
const a = r.clone();
|
|
6687
6764
|
return a.multiplyScalar(o), a;
|
|
6688
6765
|
}, s = e.transparent || e.opacity < 1, n = t ? new J({
|
|
6689
6766
|
vertexColors: !0,
|
|
6690
|
-
side:
|
|
6767
|
+
side: te,
|
|
6691
6768
|
// 🔧 FIX: Changed from DoubleSide to halve draw calls
|
|
6692
6769
|
opacity: e.opacity,
|
|
6693
6770
|
transparent: !0,
|
|
@@ -6851,9 +6928,9 @@ class Ks {
|
|
|
6851
6928
|
}
|
|
6852
6929
|
//#endregion
|
|
6853
6930
|
}
|
|
6854
|
-
class
|
|
6931
|
+
class tn {
|
|
6855
6932
|
constructor(e) {
|
|
6856
|
-
this.viralViewerApi = e, this.elements = [], this._loadBatchedElementWorker = new
|
|
6933
|
+
this.viralViewerApi = e, this.elements = [], this._loadBatchedElementWorker = new en(e);
|
|
6857
6934
|
}
|
|
6858
6935
|
//#region Load worker
|
|
6859
6936
|
async load(e, t, i, s = () => {
|
|
@@ -6997,9 +7074,9 @@ class Js {
|
|
|
6997
7074
|
}), this.viralViewerApi.viralMaterialManager.mergeMaterials = [], this.viralViewerApi.viralVisibilityManager.disableGroundShadow(), this.viralViewerApi.viralRenderer.render(), this.viralViewerApi.viralDataManager.dataTree = [], this.viralViewerApi.viralScene.selectables = [];
|
|
6998
7075
|
}
|
|
6999
7076
|
}
|
|
7000
|
-
class
|
|
7077
|
+
class sn {
|
|
7001
7078
|
constructor(e) {
|
|
7002
|
-
this.viralViewerApi = e, this.objectLoader = new
|
|
7079
|
+
this.viralViewerApi = e, this.objectLoader = new ci(), this.gltfLoader = new Bi();
|
|
7003
7080
|
}
|
|
7004
7081
|
parseObject(e) {
|
|
7005
7082
|
return this.objectLoader.parse(e);
|
|
@@ -7011,31 +7088,31 @@ class en {
|
|
|
7011
7088
|
this.gltfLoader.load(e, t, i, s);
|
|
7012
7089
|
}
|
|
7013
7090
|
}
|
|
7014
|
-
class
|
|
7091
|
+
class nn {
|
|
7015
7092
|
constructor(e) {
|
|
7016
|
-
this.viralViewerApi = e, this.revitLoader = new
|
|
7093
|
+
this.viralViewerApi = e, this.revitLoader = new tn(this.viralViewerApi), this.pointCloudLoader = new Ws(this.viralViewerApi), this.threeLoader = new sn(this.viralViewerApi);
|
|
7017
7094
|
}
|
|
7018
7095
|
}
|
|
7019
|
-
class
|
|
7096
|
+
class rn {
|
|
7020
7097
|
constructor(e) {
|
|
7021
|
-
this.viralViewerApi = e, this.hoverMaterial = new
|
|
7022
|
-
color: D.hexToThreejsColor(
|
|
7098
|
+
this.viralViewerApi = e, this.hoverMaterial = new ft({
|
|
7099
|
+
color: D.hexToThreejsColor(y.secondary),
|
|
7023
7100
|
opacity: 0.7,
|
|
7024
7101
|
transparent: !0,
|
|
7025
7102
|
depthTest: !1,
|
|
7026
7103
|
name: "Render Material",
|
|
7027
7104
|
flatShading: !0
|
|
7028
|
-
}), this.selectedMaterial = new
|
|
7029
|
-
color: D.hexToThreejsColor(
|
|
7105
|
+
}), this.selectedMaterial = new ft({
|
|
7106
|
+
color: D.hexToThreejsColor(y.secondary),
|
|
7030
7107
|
opacity: 0.7,
|
|
7031
7108
|
transparent: !0,
|
|
7032
7109
|
name: "Render Material",
|
|
7033
7110
|
depthTest: !1,
|
|
7034
7111
|
flatShading: !0
|
|
7035
|
-
}), this.edgeMaterial = new
|
|
7036
|
-
color: D.hexToThreejsColor(
|
|
7112
|
+
}), this.edgeMaterial = new Xt({
|
|
7113
|
+
color: D.hexToThreejsColor(y.edge),
|
|
7037
7114
|
linewidth: 2,
|
|
7038
|
-
resolution: new
|
|
7115
|
+
resolution: new z(window.innerWidth, window.innerHeight),
|
|
7039
7116
|
transparent: !0,
|
|
7040
7117
|
opacity: 0.8
|
|
7041
7118
|
}), this.outlineMaterial = new J({
|
|
@@ -7063,13 +7140,141 @@ class sn {
|
|
|
7063
7140
|
resetToOriginal() {
|
|
7064
7141
|
for (let e = 0; e < this.materials.length; e++) {
|
|
7065
7142
|
const t = this.materials[e];
|
|
7066
|
-
t instanceof
|
|
7143
|
+
t instanceof ft && t.color.set(this.originalColors[e]);
|
|
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;
|
|
7067
7264
|
}
|
|
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();
|
|
7068
7273
|
}
|
|
7069
7274
|
}
|
|
7070
|
-
function
|
|
7071
|
-
const g = new
|
|
7072
|
-
side:
|
|
7275
|
+
function cn() {
|
|
7276
|
+
const g = new hi({
|
|
7277
|
+
side: te
|
|
7073
7278
|
});
|
|
7074
7279
|
return g.onBeforeCompile = (e) => {
|
|
7075
7280
|
e.vertexShader = `attribute vec4 color;
|
|
@@ -7089,10 +7294,10 @@ function nn() {
|
|
|
7089
7294
|
);
|
|
7090
7295
|
}, g;
|
|
7091
7296
|
}
|
|
7092
|
-
function
|
|
7297
|
+
function hn() {
|
|
7093
7298
|
const g = new G({
|
|
7094
7299
|
colorWrite: !1,
|
|
7095
|
-
side:
|
|
7300
|
+
side: te
|
|
7096
7301
|
});
|
|
7097
7302
|
return g.onBeforeCompile = (e) => {
|
|
7098
7303
|
e.vertexShader = `attribute vec4 color;
|
|
@@ -7112,8 +7317,8 @@ function rn() {
|
|
|
7112
7317
|
);
|
|
7113
7318
|
}, g;
|
|
7114
7319
|
}
|
|
7115
|
-
const
|
|
7116
|
-
edgeColor: new
|
|
7320
|
+
const dn = {
|
|
7321
|
+
edgeColor: new k(0),
|
|
7117
7322
|
edgeOpacity: 0.6,
|
|
7118
7323
|
// Reduced for subtlety, better perf
|
|
7119
7324
|
edgeThickness: 1,
|
|
@@ -7130,14 +7335,14 @@ const an = {
|
|
|
7130
7335
|
// Keep - good for creases
|
|
7131
7336
|
enableObjectIdEdges: !1
|
|
7132
7337
|
// Disable by default - most expensive (extra render pass)
|
|
7133
|
-
},
|
|
7338
|
+
}, un = `
|
|
7134
7339
|
varying vec2 vUv;
|
|
7135
7340
|
|
|
7136
7341
|
void main() {
|
|
7137
7342
|
vUv = uv;
|
|
7138
7343
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
7139
7344
|
}
|
|
7140
|
-
`,
|
|
7345
|
+
`, pn = `
|
|
7141
7346
|
precision highp float;
|
|
7142
7347
|
|
|
7143
7348
|
uniform sampler2D tDiffuse; // Color buffer (from main render)
|
|
@@ -7303,7 +7508,7 @@ void main() {
|
|
|
7303
7508
|
|
|
7304
7509
|
gl_FragColor = vec4(finalColor, color.a);
|
|
7305
7510
|
}
|
|
7306
|
-
`,
|
|
7511
|
+
`, mn = `
|
|
7307
7512
|
attribute float objectIndex;
|
|
7308
7513
|
varying float vObjectIndex;
|
|
7309
7514
|
|
|
@@ -7311,7 +7516,7 @@ void main() {
|
|
|
7311
7516
|
vObjectIndex = objectIndex;
|
|
7312
7517
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
7313
7518
|
}
|
|
7314
|
-
`,
|
|
7519
|
+
`, gn = `
|
|
7315
7520
|
precision highp float;
|
|
7316
7521
|
varying float vObjectIndex;
|
|
7317
7522
|
|
|
@@ -7327,14 +7532,14 @@ void main() {
|
|
|
7327
7532
|
gl_FragColor = vec4(packIndex(vObjectIndex), 1.0);
|
|
7328
7533
|
}
|
|
7329
7534
|
`;
|
|
7330
|
-
class
|
|
7535
|
+
class fn extends Ot {
|
|
7331
7536
|
constructor(e, t, i, s) {
|
|
7332
|
-
super(), this.excludeObjects = [], this.bypass = !1, this.scene = e, this.camera = t, this.resolution = i || new
|
|
7537
|
+
super(), this.excludeObjects = [], this.bypass = !1, this.scene = e, this.camera = t, this.resolution = i || new z(window.innerWidth, window.innerHeight), this.options = { ...dn, ...s };
|
|
7333
7538
|
const n = {
|
|
7334
|
-
format:
|
|
7335
|
-
type:
|
|
7336
|
-
minFilter:
|
|
7337
|
-
magFilter:
|
|
7539
|
+
format: Ut,
|
|
7540
|
+
type: qt,
|
|
7541
|
+
minFilter: Rt,
|
|
7542
|
+
magFilter: Rt
|
|
7338
7543
|
};
|
|
7339
7544
|
this.normalTarget = new ue(this.resolution.x, this.resolution.y, {
|
|
7340
7545
|
...n,
|
|
@@ -7350,11 +7555,11 @@ class dn extends Zt {
|
|
|
7350
7555
|
this.resolution.x,
|
|
7351
7556
|
this.resolution.y,
|
|
7352
7557
|
_t
|
|
7353
|
-
), this.objectIdTarget = new ue(this.resolution.x, this.resolution.y, n), this.normalMaterial =
|
|
7354
|
-
vertexShader:
|
|
7355
|
-
fragmentShader:
|
|
7356
|
-
side:
|
|
7357
|
-
}), this.edgeMaterial = new
|
|
7558
|
+
), this.objectIdTarget = new ue(this.resolution.x, this.resolution.y, n), this.normalMaterial = cn(), this.depthMaterial = hn(), this.objectIdMaterial = new ee({
|
|
7559
|
+
vertexShader: mn,
|
|
7560
|
+
fragmentShader: gn,
|
|
7561
|
+
side: te
|
|
7562
|
+
}), this.edgeMaterial = new ee({
|
|
7358
7563
|
uniforms: {
|
|
7359
7564
|
tDiffuse: { value: null },
|
|
7360
7565
|
tDepth: { value: null },
|
|
@@ -7375,9 +7580,9 @@ class dn extends Zt {
|
|
|
7375
7580
|
enableNormalEdges: { value: this.options.enableNormalEdges },
|
|
7376
7581
|
enableObjectIdEdges: { value: this.options.enableObjectIdEdges }
|
|
7377
7582
|
},
|
|
7378
|
-
vertexShader:
|
|
7379
|
-
fragmentShader:
|
|
7380
|
-
}), this.copyMaterial = new
|
|
7583
|
+
vertexShader: un,
|
|
7584
|
+
fragmentShader: pn
|
|
7585
|
+
}), this.copyMaterial = new ee({
|
|
7381
7586
|
uniforms: {
|
|
7382
7587
|
tDiffuse: { value: null }
|
|
7383
7588
|
},
|
|
@@ -7395,7 +7600,7 @@ class dn extends Zt {
|
|
|
7395
7600
|
gl_FragColor = texture2D(tDiffuse, vUv);
|
|
7396
7601
|
}
|
|
7397
7602
|
`
|
|
7398
|
-
}), this.fsQuad = new
|
|
7603
|
+
}), this.fsQuad = new Dt(this.edgeMaterial);
|
|
7399
7604
|
}
|
|
7400
7605
|
/**
|
|
7401
7606
|
* Update options
|
|
@@ -7453,8 +7658,8 @@ class dn extends Zt {
|
|
|
7453
7658
|
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();
|
|
7454
7659
|
}
|
|
7455
7660
|
}
|
|
7456
|
-
const
|
|
7457
|
-
outlineColor: new
|
|
7661
|
+
const vn = {
|
|
7662
|
+
outlineColor: new k(y.accent),
|
|
7458
7663
|
outlineOpacity: 1,
|
|
7459
7664
|
outlineThickness: 2,
|
|
7460
7665
|
showOccluded: !0,
|
|
@@ -7465,7 +7670,7 @@ void main() {
|
|
|
7465
7670
|
vUv = uv;
|
|
7466
7671
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
7467
7672
|
}
|
|
7468
|
-
`,
|
|
7673
|
+
`, bn = `
|
|
7469
7674
|
precision highp float;
|
|
7470
7675
|
|
|
7471
7676
|
uniform sampler2D tDiffuse; // Original scene
|
|
@@ -7554,9 +7759,9 @@ void main() {
|
|
|
7554
7759
|
gl_FragColor = vec4(finalColor, sceneColor.a);
|
|
7555
7760
|
}
|
|
7556
7761
|
`;
|
|
7557
|
-
class
|
|
7762
|
+
class wn extends Ot {
|
|
7558
7763
|
constructor(e, t, i, s = {}) {
|
|
7559
|
-
super(), this.copyMaterial = null, this.selectionMesh = null, this.hasSelection = !1, this.bypass = !1, this.camera = t, this.resolution = i, this.options = { ...
|
|
7764
|
+
super(), this.copyMaterial = null, this.selectionMesh = null, this.hasSelection = !1, this.bypass = !1, this.camera = t, this.resolution = i, this.options = { ...vn, ...s };
|
|
7560
7765
|
const n = i.clone().multiplyScalar(0.5);
|
|
7561
7766
|
this.maskRenderTarget = new ue(n.x, n.y, {
|
|
7562
7767
|
depthBuffer: !0
|
|
@@ -7564,11 +7769,11 @@ class mn extends Zt {
|
|
|
7564
7769
|
depthBuffer: !0
|
|
7565
7770
|
}), this.maskMaterial = new G({
|
|
7566
7771
|
color: 16777215,
|
|
7567
|
-
side:
|
|
7772
|
+
side: te,
|
|
7568
7773
|
depthTest: !this.options.showOccluded,
|
|
7569
7774
|
// Disable depth test to capture occluded parts
|
|
7570
7775
|
depthWrite: !0
|
|
7571
|
-
}), this.outlineMaterial = new
|
|
7776
|
+
}), this.outlineMaterial = new ee({
|
|
7572
7777
|
uniforms: {
|
|
7573
7778
|
tDiffuse: { value: null },
|
|
7574
7779
|
tMask: { value: this.maskRenderTarget.texture },
|
|
@@ -7582,8 +7787,8 @@ class mn extends Zt {
|
|
|
7582
7787
|
occludedOpacity: { value: this.options.occludedOpacity }
|
|
7583
7788
|
},
|
|
7584
7789
|
vertexShader: Mt,
|
|
7585
|
-
fragmentShader:
|
|
7586
|
-
}), this.selectionGeometry = new Z(), this.maskScene = new
|
|
7790
|
+
fragmentShader: bn
|
|
7791
|
+
}), this.selectionGeometry = new Z(), this.maskScene = new vt(), this.fsQuad = new Dt(this.outlineMaterial);
|
|
7587
7792
|
}
|
|
7588
7793
|
/**
|
|
7589
7794
|
* Update selection geometry from buffer elements
|
|
@@ -7595,7 +7800,7 @@ class mn extends Zt {
|
|
|
7595
7800
|
this.hasSelection = !1, this.selectionMesh && (this.maskScene.remove(this.selectionMesh), this.selectionMesh = null);
|
|
7596
7801
|
return;
|
|
7597
7802
|
}
|
|
7598
|
-
this.hasSelection = !0, this.selectionGeometry.setAttribute("position", new L(e, 3)), this.selectionGeometry.computeBoundingSphere(), this.selectionMesh ? this.selectionMesh.geometry = this.selectionGeometry : (this.selectionMesh = new
|
|
7803
|
+
this.hasSelection = !0, this.selectionGeometry.setAttribute("position", new L(e, 3)), this.selectionGeometry.computeBoundingSphere(), this.selectionMesh ? this.selectionMesh.geometry = this.selectionGeometry : (this.selectionMesh = new x(this.selectionGeometry, this.maskMaterial), this.selectionMesh.frustumCulled = !1, this.maskScene.add(this.selectionMesh));
|
|
7599
7804
|
}
|
|
7600
7805
|
/**
|
|
7601
7806
|
* Get whether there's an active selection
|
|
@@ -7611,7 +7816,7 @@ class mn extends Zt {
|
|
|
7611
7816
|
}
|
|
7612
7817
|
render(e, t, i, s, n) {
|
|
7613
7818
|
if (this.bypass) {
|
|
7614
|
-
this.copyMaterial || (this.copyMaterial = new
|
|
7819
|
+
this.copyMaterial || (this.copyMaterial = new ee({
|
|
7615
7820
|
uniforms: { tDiffuse: { value: null } },
|
|
7616
7821
|
vertexShader: Mt,
|
|
7617
7822
|
fragmentShader: `
|
|
@@ -7625,7 +7830,7 @@ class mn extends Zt {
|
|
|
7625
7830
|
return;
|
|
7626
7831
|
}
|
|
7627
7832
|
if (!this.hasSelection || !this.enabled || !this.selectionMesh) {
|
|
7628
|
-
this.copyMaterial || (this.copyMaterial = new
|
|
7833
|
+
this.copyMaterial || (this.copyMaterial = new ee({
|
|
7629
7834
|
uniforms: { tDiffuse: { value: null } },
|
|
7630
7835
|
vertexShader: Mt,
|
|
7631
7836
|
fragmentShader: `
|
|
@@ -7651,10 +7856,10 @@ class mn extends Zt {
|
|
|
7651
7856
|
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);
|
|
7652
7857
|
}
|
|
7653
7858
|
}
|
|
7654
|
-
new
|
|
7655
|
-
class
|
|
7859
|
+
new z(1024, 1024), new k(0);
|
|
7860
|
+
class yn {
|
|
7656
7861
|
constructor(e, t) {
|
|
7657
|
-
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
|
|
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.alphaSelectionOutlinePass = null, this.perfChecker = new Us(), this._whiteShader = {
|
|
7658
7863
|
uniforms: {
|
|
7659
7864
|
tDiffuse: { value: null },
|
|
7660
7865
|
shadowTexture: { value: null },
|
|
@@ -7685,15 +7890,15 @@ class gn {
|
|
|
7685
7890
|
}
|
|
7686
7891
|
`
|
|
7687
7892
|
};
|
|
7688
|
-
const i = new
|
|
7893
|
+
const i = new z();
|
|
7689
7894
|
e.getSize(i);
|
|
7690
7895
|
const s = new ue(i.x, i.y, {
|
|
7691
|
-
format:
|
|
7692
|
-
type:
|
|
7896
|
+
format: Ut,
|
|
7897
|
+
type: qt,
|
|
7693
7898
|
depthBuffer: !0,
|
|
7694
7899
|
stencilBuffer: !1
|
|
7695
7900
|
});
|
|
7696
|
-
s.depthTexture = new At(i.x, i.y, _t), this.composer = new
|
|
7901
|
+
s.depthTexture = new At(i.x, i.y, _t), this.composer = new Ni(this.renderer, s), this.composer.setSize(window.innerWidth, window.innerHeight);
|
|
7697
7902
|
}
|
|
7698
7903
|
isWebGL2Available() {
|
|
7699
7904
|
return !!window.WebGL2RenderingContext;
|
|
@@ -7702,7 +7907,7 @@ class gn {
|
|
|
7702
7907
|
this.composer.render();
|
|
7703
7908
|
}
|
|
7704
7909
|
initRenderPass(e, t) {
|
|
7705
|
-
this.renderPass = new
|
|
7910
|
+
this.renderPass = new Hi(e, t), this.composer.addPass(this.renderPass);
|
|
7706
7911
|
const i = this.perfChecker.getSpecs();
|
|
7707
7912
|
if (console.log(i), this.perfChecker.canHandleExpensiveEffects()) {
|
|
7708
7913
|
//! this pass cause slow render on weak machine, turn it off when camera moving
|
|
@@ -7712,9 +7917,9 @@ class gn {
|
|
|
7712
7917
|
this.initn8aoPass(e, t);
|
|
7713
7918
|
} else
|
|
7714
7919
|
this.perfChecker.canHandleBasicEffects();
|
|
7715
|
-
this.initScreenSpaceEdgesPass(e, t), this.initSelectionOutlinePass(e, t);
|
|
7920
|
+
this.initScreenSpaceEdgesPass(e, t), this.initSelectionOutlinePass(e, t), this.initAlphaSelectionOutlinePass(), this.alphaSelectionOutlinePass && (this.alphaSelectionOutlinePass.enabled = !1);
|
|
7716
7921
|
//! this pass slow render too, turn it off when we dont use
|
|
7717
|
-
const s = new
|
|
7922
|
+
const s = new ji();
|
|
7718
7923
|
this.composer.addPass(s);
|
|
7719
7924
|
}
|
|
7720
7925
|
initGammaPass() {
|
|
@@ -7723,7 +7928,7 @@ class gn {
|
|
|
7723
7928
|
//#region N8AOPass
|
|
7724
7929
|
initn8aoPass(e, t) {
|
|
7725
7930
|
//! need to optimize this base on performance
|
|
7726
|
-
this.n8aoPass = new
|
|
7931
|
+
this.n8aoPass = new zi(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);
|
|
7727
7932
|
}
|
|
7728
7933
|
enableN8AOPass() {
|
|
7729
7934
|
this.n8aoPass && (this.n8aoPass.setDisplayMode("Combined"), this.n8aoPass.enabled = !0);
|
|
@@ -7740,19 +7945,19 @@ class gn {
|
|
|
7740
7945
|
//#endregion
|
|
7741
7946
|
//#region Anti Aliases Passes
|
|
7742
7947
|
initSMAAPass() {
|
|
7743
|
-
this.smaaPass = new
|
|
7948
|
+
this.smaaPass = new Fi(), this.smaaPass.renderToScreen = !0, this.composer.addPass(this.smaaPass);
|
|
7744
7949
|
}
|
|
7745
7950
|
initSSAAPass(e, t) {
|
|
7746
|
-
this.ssaaPass = new
|
|
7951
|
+
this.ssaaPass = new Si(e, t), this.ssaaPass.unbiased = !0, this.ssaaPass.sampleLevel = 2, this.composer.addPass(this.ssaaPass);
|
|
7747
7952
|
}
|
|
7748
7953
|
initFXAAPass() {
|
|
7749
|
-
this.fxaaPass = new xt(
|
|
7954
|
+
this.fxaaPass = new xt(Ci), this.fxaaPass.uniforms.resolution.value.set(
|
|
7750
7955
|
1 / window.innerWidth,
|
|
7751
7956
|
1 / window.innerHeight
|
|
7752
7957
|
), this.composer.addPass(this.fxaaPass);
|
|
7753
7958
|
}
|
|
7754
7959
|
initTAAPass(e, t) {
|
|
7755
|
-
this.taaPass = new
|
|
7960
|
+
this.taaPass = new Ai(e, t), this.taaPass.sampleLevel = 2, this.taaPass.unbiased = !1, this.composer.addPass(this.taaPass);
|
|
7756
7961
|
}
|
|
7757
7962
|
enableTAA() {
|
|
7758
7963
|
this.taaPass && (this.taaPass.enabled = !0);
|
|
@@ -7763,18 +7968,18 @@ class gn {
|
|
|
7763
7968
|
//#endregion
|
|
7764
7969
|
//#region SAO
|
|
7765
7970
|
initSAOPass(e, t) {
|
|
7766
|
-
this.saoPass = new
|
|
7971
|
+
this.saoPass = new _i(e, t), this.saoPass.params.saoIntensity = 1e-4, this.saoPass.params.saoKernelRadius = 10, this.composer.addPass(this.saoPass);
|
|
7767
7972
|
}
|
|
7768
7973
|
//#endregion
|
|
7769
7974
|
//#region SSAO
|
|
7770
7975
|
initSSAOPass(e, t) {
|
|
7771
|
-
this.ssaoPass = new
|
|
7976
|
+
this.ssaoPass = new mt(e, t), this.ssaoPass.output = mt.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);
|
|
7772
7977
|
}
|
|
7773
7978
|
enableSSAO() {
|
|
7774
|
-
this.ssaoPass && (this.ssaoPass.output =
|
|
7979
|
+
this.ssaoPass && (this.ssaoPass.output = mt.OUTPUT.SSAO, this.ssaoPass.kernelRadius = 64, this.ssaoPass.minDistance = 1e-3, this.ssaoPass.maxDistance = 0.02);
|
|
7775
7980
|
}
|
|
7776
7981
|
disableSSAO() {
|
|
7777
|
-
this.ssaoPass && (this.ssaoPass.output =
|
|
7982
|
+
this.ssaoPass && (this.ssaoPass.output = mt.OUTPUT.Default, this.ssaoPass.kernelRadius = 1, this.ssaoPass.minDistance = 5e-4, this.ssaoPass.maxDistance = 0.3);
|
|
7778
7983
|
}
|
|
7779
7984
|
//#endregion
|
|
7780
7985
|
//#region SOBEL
|
|
@@ -7794,12 +7999,12 @@ class gn {
|
|
|
7794
7999
|
* - Object ID discontinuity detection (object boundaries)
|
|
7795
8000
|
*/
|
|
7796
8001
|
initScreenSpaceEdgesPass(e, t) {
|
|
7797
|
-
this.screenSpaceEdgesPass = new
|
|
8002
|
+
this.screenSpaceEdgesPass = new fn(
|
|
7798
8003
|
e,
|
|
7799
8004
|
t,
|
|
7800
|
-
new
|
|
8005
|
+
new z(window.innerWidth, window.innerHeight),
|
|
7801
8006
|
{
|
|
7802
|
-
edgeColor: new
|
|
8007
|
+
edgeColor: new k(0),
|
|
7803
8008
|
edgeOpacity: 1,
|
|
7804
8009
|
edgeThickness: 2,
|
|
7805
8010
|
depthMultiplier: 1.5,
|
|
@@ -7850,7 +8055,7 @@ class gn {
|
|
|
7850
8055
|
*/
|
|
7851
8056
|
setScreenSpaceEdgeColor(e) {
|
|
7852
8057
|
if (this.screenSpaceEdgesPass) {
|
|
7853
|
-
const t = typeof e == "number" ? new
|
|
8058
|
+
const t = typeof e == "number" ? new k(e) : e;
|
|
7854
8059
|
this.screenSpaceEdgesPass.setOptions({ edgeColor: t });
|
|
7855
8060
|
}
|
|
7856
8061
|
}
|
|
@@ -7881,7 +8086,7 @@ class gn {
|
|
|
7881
8086
|
*/
|
|
7882
8087
|
setScreenSpaceEdgesPenMode() {
|
|
7883
8088
|
this.screenSpaceEdgesPass && this.screenSpaceEdgesPass.setOptions({
|
|
7884
|
-
edgeColor: new
|
|
8089
|
+
edgeColor: new k(0),
|
|
7885
8090
|
edgeOpacity: 1,
|
|
7886
8091
|
edgeThickness: 1.5
|
|
7887
8092
|
});
|
|
@@ -7891,7 +8096,7 @@ class gn {
|
|
|
7891
8096
|
*/
|
|
7892
8097
|
setScreenSpaceEdgesShadedMode() {
|
|
7893
8098
|
this.screenSpaceEdgesPass && this.screenSpaceEdgesPass.setOptions({
|
|
7894
|
-
edgeColor: new
|
|
8099
|
+
edgeColor: new k(0),
|
|
7895
8100
|
edgeOpacity: 0.8,
|
|
7896
8101
|
edgeThickness: 1.5
|
|
7897
8102
|
});
|
|
@@ -7902,13 +8107,13 @@ class gn {
|
|
|
7902
8107
|
//#endregion
|
|
7903
8108
|
//#region Outline Pass
|
|
7904
8109
|
initOutlinePass(e, t) {
|
|
7905
|
-
this.outlinePass = new
|
|
7906
|
-
new
|
|
8110
|
+
this.outlinePass = new $i(
|
|
8111
|
+
new z(window.innerWidth, window.innerHeight),
|
|
7907
8112
|
e,
|
|
7908
8113
|
t,
|
|
7909
8114
|
// TODO : investigate why this effect when render new model
|
|
7910
8115
|
[this.viralViewerApi.viralScene.outlineModel]
|
|
7911
|
-
), this.outlinePass.edgeStrength = 5, this.outlinePass.edgeGlow = 0.4, this.outlinePass.edgeThickness = 2, this.outlinePass.pulsePeriod = 0, this.outlinePass.visibleEdgeColor.set(
|
|
8116
|
+
), this.outlinePass.edgeStrength = 5, this.outlinePass.edgeGlow = 0.4, this.outlinePass.edgeThickness = 2, this.outlinePass.pulsePeriod = 0, this.outlinePass.visibleEdgeColor.set(y.accent), this.outlinePass.hiddenEdgeColor.set(y.accent), this.outlinePass.enabled = !1, this.outlinePass.renderToScreen = !1, this.composer.addPass(this.outlinePass);
|
|
7912
8117
|
}
|
|
7913
8118
|
enableOutline() {
|
|
7914
8119
|
this.outlinePass && (this.outlinePass.enabled = !0, this.outlinePass.renderToScreen = !0);
|
|
@@ -7924,12 +8129,12 @@ class gn {
|
|
|
7924
8129
|
* Cost: 1 extra draw call + 1 fullscreen pass
|
|
7925
8130
|
*/
|
|
7926
8131
|
initSelectionOutlinePass(e, t) {
|
|
7927
|
-
this.selectionOutlinePass = new
|
|
8132
|
+
this.selectionOutlinePass = new wn(
|
|
7928
8133
|
e,
|
|
7929
8134
|
t,
|
|
7930
|
-
new
|
|
8135
|
+
new z(window.innerWidth, window.innerHeight),
|
|
7931
8136
|
{
|
|
7932
|
-
outlineColor: new
|
|
8137
|
+
outlineColor: new k(y.accent),
|
|
7933
8138
|
outlineOpacity: 1,
|
|
7934
8139
|
outlineThickness: 2,
|
|
7935
8140
|
showOccluded: !0,
|
|
@@ -7983,7 +8188,7 @@ class gn {
|
|
|
7983
8188
|
*/
|
|
7984
8189
|
setSelectionOutlineColor(e) {
|
|
7985
8190
|
if (this.selectionOutlinePass) {
|
|
7986
|
-
const t = e instanceof
|
|
8191
|
+
const t = e instanceof k ? e : new k(e);
|
|
7987
8192
|
this.selectionOutlinePass.setOptions({ outlineColor: t });
|
|
7988
8193
|
}
|
|
7989
8194
|
}
|
|
@@ -7994,22 +8199,89 @@ class gn {
|
|
|
7994
8199
|
this.selectionOutlinePass && this.selectionOutlinePass.setOptions({ outlineThickness: e });
|
|
7995
8200
|
}
|
|
7996
8201
|
//#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
|
|
7997
8269
|
}
|
|
7998
|
-
class
|
|
8270
|
+
class xn {
|
|
7999
8271
|
constructor(e) {
|
|
8000
|
-
this.viralViewerApi = e, this.renderer = new
|
|
8272
|
+
this.viralViewerApi = e, this.renderer = new Qt({
|
|
8001
8273
|
alpha: !0,
|
|
8002
8274
|
antialias: !0,
|
|
8003
8275
|
stencil: !0,
|
|
8004
8276
|
logarithmicDepthBuffer: !0,
|
|
8005
8277
|
powerPreference: "high-performance",
|
|
8006
8278
|
preserveDrawingBuffer: !0
|
|
8007
|
-
}), this._t = 0, this._lastSpatialStatsTime = 0, this.renderTimeout = null, this.jitterOffsets = [], this.jitterIndex = 0, this.size = new
|
|
8279
|
+
}), this._t = 0, this._lastSpatialStatsTime = 0, this.renderTimeout = null, this.jitterOffsets = [], this.jitterIndex = 0, this.size = new z(window.innerWidth, window.innerHeight), this.samples = 4;
|
|
8008
8280
|
const t = this.renderer.getContext(), i = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS);
|
|
8009
8281
|
console.log("Max Fragment Uniform Vectors ->", i), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.setSize(
|
|
8010
8282
|
this.viralViewerApi.targetElement.offsetWidth,
|
|
8011
8283
|
this.viralViewerApi.targetElement.offsetHeight
|
|
8012
|
-
), this.renderer.outputColorSpace =
|
|
8284
|
+
), this.renderer.outputColorSpace = di, this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = ui, 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 yn(
|
|
8013
8285
|
this.renderer,
|
|
8014
8286
|
this.viralViewerApi
|
|
8015
8287
|
)), this.jitterOffsets = this.generateJitterOffsets(), this.viralViewerApi.emit(R.LOADED_RENDERER);
|
|
@@ -8100,7 +8372,7 @@ class fn {
|
|
|
8100
8372
|
o
|
|
8101
8373
|
);
|
|
8102
8374
|
} else
|
|
8103
|
-
i instanceof
|
|
8375
|
+
i instanceof Fe && (i.projectionMatrix.elements[8] = e / this.size.x, i.projectionMatrix.elements[9] = t / this.size.y);
|
|
8104
8376
|
this.jitterIndex = (this.jitterIndex + 1) % this.samples;
|
|
8105
8377
|
}
|
|
8106
8378
|
// Generates jitter offsets for the specified number of samples
|
|
@@ -8124,19 +8396,19 @@ const de = {
|
|
|
8124
8396
|
outlineModel: "viral_outline_model",
|
|
8125
8397
|
sunlight: "viral_sunlight"
|
|
8126
8398
|
};
|
|
8127
|
-
class
|
|
8399
|
+
class Mn {
|
|
8128
8400
|
constructor(e) {
|
|
8129
|
-
this.viralViewerApi = e, this.scene = new
|
|
8401
|
+
this.viralViewerApi = e, this.scene = new vt(), this.objects = [], this.models = [], this.bimWorld = new es(), this.outlineModel = new x(), this.hideables = [], this.selectables = [], this.edges = [], this.sunLight = null, this.lights = [], this.transformControls = null, this.lightHelpers = [], this.fullScreenQuadMaterial = new G({
|
|
8130
8402
|
map: null,
|
|
8131
8403
|
// Use the render target's texture
|
|
8132
|
-
side:
|
|
8404
|
+
side: te
|
|
8133
8405
|
}), 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);
|
|
8134
|
-
const t = new
|
|
8406
|
+
const t = new Lt(5, 32, 32), i = new J({
|
|
8135
8407
|
color: 16768256,
|
|
8136
8408
|
emissive: 16755200,
|
|
8137
8409
|
emissiveIntensity: 1
|
|
8138
8410
|
});
|
|
8139
|
-
this.sunSphere = new
|
|
8411
|
+
this.sunSphere = new x(t, i), this.sunSphere.visible = !1, this.addObject(this.sunSphere), this.addLights(), this.addPivotPoint(), this.viralViewerApi.options.isDev && this.addAxes();
|
|
8140
8412
|
}
|
|
8141
8413
|
//#region Add Main Objects
|
|
8142
8414
|
addObject(e) {
|
|
@@ -8162,28 +8434,28 @@ class vn {
|
|
|
8162
8434
|
}
|
|
8163
8435
|
//#region lights
|
|
8164
8436
|
addLights() {
|
|
8165
|
-
const e = new
|
|
8437
|
+
const e = new pt(16777215, 1);
|
|
8166
8438
|
e.position.set(1, 1, 1).normalize();
|
|
8167
|
-
const t = new
|
|
8439
|
+
const t = new pt(16777215, 1.5);
|
|
8168
8440
|
t.position.set(0, -1, 0).normalize();
|
|
8169
|
-
const i = new
|
|
8441
|
+
const i = new pt(16777215, 1);
|
|
8170
8442
|
i.position.set(-1, 1, -1).normalize();
|
|
8171
|
-
const s = new
|
|
8172
|
-
this.sunLight = new
|
|
8173
|
-
const n = new
|
|
8443
|
+
const s = new pi(16777215, 1);
|
|
8444
|
+
this.sunLight = new pt(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;
|
|
8445
|
+
const n = new mi(this.sunLight.shadow.camera);
|
|
8174
8446
|
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);
|
|
8175
8447
|
}
|
|
8176
8448
|
//#endregion
|
|
8177
8449
|
addPivotPoint() {
|
|
8178
|
-
const e = new
|
|
8179
|
-
color: D.hexToThreejsColor(
|
|
8450
|
+
const e = new Lt(1, 16, 16), t = new G({
|
|
8451
|
+
color: D.hexToThreejsColor(y.accent)
|
|
8180
8452
|
// transparent: true,
|
|
8181
8453
|
// opacity: 0.5,
|
|
8182
|
-
}), i = new
|
|
8454
|
+
}), i = new x(e, t);
|
|
8183
8455
|
i.name = de.pivotPoint, i.visible = !1, this.addObject(i);
|
|
8184
8456
|
}
|
|
8185
8457
|
addTransformControls(e) {
|
|
8186
|
-
this.transformControls = new
|
|
8458
|
+
this.transformControls = new Gi(
|
|
8187
8459
|
e,
|
|
8188
8460
|
this.viralViewerApi.viralRenderer.renderer.domElement
|
|
8189
8461
|
);
|
|
@@ -8200,7 +8472,7 @@ class vn {
|
|
|
8200
8472
|
//#region Helper
|
|
8201
8473
|
addCube() {
|
|
8202
8474
|
if (this.scene) {
|
|
8203
|
-
const e = new
|
|
8475
|
+
const e = new x(
|
|
8204
8476
|
new Pt(1, 1, 1),
|
|
8205
8477
|
new J({ color: 16711680 })
|
|
8206
8478
|
);
|
|
@@ -8209,7 +8481,7 @@ class vn {
|
|
|
8209
8481
|
}
|
|
8210
8482
|
addAxes() {
|
|
8211
8483
|
if (this.scene) {
|
|
8212
|
-
const e = new
|
|
8484
|
+
const e = new gi(10);
|
|
8213
8485
|
e.renderOrder = 999, e.material.depthTest = !1, e.material.depthWrite = !1, this.addObject(e);
|
|
8214
8486
|
}
|
|
8215
8487
|
}
|
|
@@ -8223,20 +8495,20 @@ class vn {
|
|
|
8223
8495
|
* Add box helper to check mesh
|
|
8224
8496
|
*/
|
|
8225
8497
|
addBoxHelper(e) {
|
|
8226
|
-
const t = new
|
|
8498
|
+
const t = new fi(e, 16711680);
|
|
8227
8499
|
this.addObject(t);
|
|
8228
8500
|
}
|
|
8229
8501
|
addBox3Helper(e) {
|
|
8230
|
-
const t = new
|
|
8502
|
+
const t = new vi(e, 16776960);
|
|
8231
8503
|
this.addObject(t);
|
|
8232
8504
|
}
|
|
8233
8505
|
addFullscreenQuad() {
|
|
8234
|
-
const e = new
|
|
8235
|
-
this.fullScreenQuad = new
|
|
8506
|
+
const e = new oe(window.innerWidth, window.innerHeight);
|
|
8507
|
+
this.fullScreenQuad = new x(e, this.fullScreenQuadMaterial), this.addObject(this.fullScreenQuad);
|
|
8236
8508
|
}
|
|
8237
8509
|
//#endregion
|
|
8238
8510
|
}
|
|
8239
|
-
const
|
|
8511
|
+
const jt = new Float32Array([
|
|
8240
8512
|
// Bottom face (Y = -1)
|
|
8241
8513
|
-1,
|
|
8242
8514
|
-1,
|
|
@@ -8312,7 +8584,7 @@ const zt = new Float32Array([
|
|
|
8312
8584
|
-1,
|
|
8313
8585
|
1,
|
|
8314
8586
|
1
|
|
8315
|
-
]),
|
|
8587
|
+
]), En = [
|
|
8316
8588
|
new E(1, 0, 0),
|
|
8317
8589
|
// 0: +X
|
|
8318
8590
|
new E(-1, 0, 0),
|
|
@@ -8325,9 +8597,9 @@ const zt = new Float32Array([
|
|
|
8325
8597
|
// 4: +Z
|
|
8326
8598
|
new E(0, 0, -1)
|
|
8327
8599
|
// 5: -Z
|
|
8328
|
-
],
|
|
8600
|
+
], Ue = class Ue {
|
|
8329
8601
|
constructor(e) {
|
|
8330
|
-
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
|
|
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 Ft(), this._selectedFaceIndex = -1, this._clippingPlanes = [], this._transformedEdges = new Float32Array(72);
|
|
8331
8603
|
}
|
|
8332
8604
|
/** Whether section box is active (clipping enabled) */
|
|
8333
8605
|
get isActive() {
|
|
@@ -8417,7 +8689,7 @@ const zt = new Float32Array([
|
|
|
8417
8689
|
}
|
|
8418
8690
|
const i = this._getFaceCenter(e);
|
|
8419
8691
|
this._dragAnchor.position.copy(i), this._dragAnchor.updateMatrixWorld(!0), t.attach(this._dragAnchor), t.setMode("translate");
|
|
8420
|
-
const s =
|
|
8692
|
+
const s = En[e];
|
|
8421
8693
|
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);
|
|
8422
8694
|
}
|
|
8423
8695
|
onDragAnchorChanged() {
|
|
@@ -8451,46 +8723,46 @@ const zt = new Float32Array([
|
|
|
8451
8723
|
}
|
|
8452
8724
|
// --- Private methods ---
|
|
8453
8725
|
_initFromBoundingBox() {
|
|
8454
|
-
const e = new
|
|
8726
|
+
const e = new N().setFromObject(this.viralViewerApi.viralScene.bimWorld);
|
|
8455
8727
|
e.getCenter(this._center), e.getSize(this._halfSize).multiplyScalar(0.5), this._initialCenter.copy(this._center), this._initialHalfSize.copy(this._halfSize), this._isGenerated = !0;
|
|
8456
8728
|
}
|
|
8457
8729
|
_createVisuals() {
|
|
8458
8730
|
if (this._boxOutline)
|
|
8459
8731
|
return;
|
|
8460
|
-
this._outlineMaterial = new
|
|
8461
|
-
color: D.hexToThreejsColor(
|
|
8732
|
+
this._outlineMaterial = new Xt({
|
|
8733
|
+
color: D.hexToThreejsColor(y.accent),
|
|
8462
8734
|
linewidth: 2,
|
|
8463
|
-
resolution: new
|
|
8735
|
+
resolution: new z(window.innerWidth, window.innerHeight),
|
|
8464
8736
|
worldUnits: !1,
|
|
8465
8737
|
transparent: !1,
|
|
8466
8738
|
depthTest: !0,
|
|
8467
8739
|
depthWrite: !0
|
|
8468
|
-
}), this._outlineGeometry = new
|
|
8740
|
+
}), this._outlineGeometry = new qi(), this._outlineGeometry.setPositions(jt), this._boxOutline = new Ui(this._outlineGeometry, this._outlineMaterial), this._boxOutline.name = "SectionBoxOutline", this._boxOutline.renderOrder = 0, this._boxOutline.frustumCulled = !1, this.viralViewerApi.viralScene.addObject(this._boxOutline);
|
|
8469
8741
|
const e = new Pt(2, 2, 2), t = new G({
|
|
8470
8742
|
transparent: !0,
|
|
8471
8743
|
opacity: 0,
|
|
8472
|
-
side:
|
|
8744
|
+
side: te,
|
|
8473
8745
|
depthWrite: !1,
|
|
8474
8746
|
depthTest: !1
|
|
8475
8747
|
});
|
|
8476
|
-
this._hitBoxMesh = new
|
|
8748
|
+
this._hitBoxMesh = new x(e, t), this._hitBoxMesh.name = "SectionBoxHit", this._hitBoxMesh.visible = !0, this._hitBoxMesh.renderOrder = -1, this.viralViewerApi.viralScene.addObject(this._hitBoxMesh);
|
|
8477
8749
|
const i = new G({
|
|
8478
|
-
color: D.hexToThreejsColor(
|
|
8750
|
+
color: D.hexToThreejsColor(y.accent),
|
|
8479
8751
|
transparent: !0,
|
|
8480
8752
|
opacity: 0.15,
|
|
8481
|
-
side:
|
|
8753
|
+
side: te,
|
|
8482
8754
|
depthWrite: !1,
|
|
8483
8755
|
depthTest: !1,
|
|
8484
8756
|
polygonOffset: !0,
|
|
8485
8757
|
polygonOffsetFactor: 1,
|
|
8486
8758
|
polygonOffsetUnits: 1
|
|
8487
8759
|
});
|
|
8488
|
-
this._facePlaneMesh = new
|
|
8760
|
+
this._facePlaneMesh = new x(new oe(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);
|
|
8489
8761
|
}
|
|
8490
8762
|
_updateVisuals() {
|
|
8491
8763
|
if (!this._boxOutline || !this._outlineGeometry || !this._hitBoxMesh)
|
|
8492
8764
|
return;
|
|
8493
|
-
const e =
|
|
8765
|
+
const e = Ue.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 = jt, l = this._transformedEdges;
|
|
8494
8766
|
for (let c = 0; c < 72; c += 3)
|
|
8495
8767
|
l[c] = t + n * a[c], l[c + 1] = i + r * a[c + 1], l[c + 2] = s + o * a[c + 2];
|
|
8496
8768
|
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) {
|
|
@@ -8540,7 +8812,7 @@ const zt = new Float32Array([
|
|
|
8540
8812
|
_positionFaceHighlight(e) {
|
|
8541
8813
|
if (!this._facePlaneMesh)
|
|
8542
8814
|
return;
|
|
8543
|
-
const t = this._center, i =
|
|
8815
|
+
const t = this._center, i = Ue.VISUAL_INSET, s = this._halfSize.x * (1 - i), n = this._halfSize.y * (1 - i), r = this._halfSize.z * (1 - i);
|
|
8544
8816
|
switch (this._facePlaneMesh.visible = !0, this._facePlaneMesh.rotation.set(0, 0, 0), e) {
|
|
8545
8817
|
case 0:
|
|
8546
8818
|
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;
|
|
@@ -8590,8 +8862,8 @@ const zt = new Float32Array([
|
|
|
8590
8862
|
);
|
|
8591
8863
|
}
|
|
8592
8864
|
};
|
|
8593
|
-
|
|
8594
|
-
let
|
|
8865
|
+
Ue.VISUAL_INSET = 2e-3;
|
|
8866
|
+
let Vt = Ue;
|
|
8595
8867
|
var We = () => {
|
|
8596
8868
|
var g = 0, e = document.createElement("div");
|
|
8597
8869
|
e.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", e.addEventListener(
|
|
@@ -8670,14 +8942,14 @@ We.Panel = (g, e, t) => {
|
|
|
8670
8942
|
}
|
|
8671
8943
|
};
|
|
8672
8944
|
};
|
|
8673
|
-
class
|
|
8945
|
+
class Sn {
|
|
8674
8946
|
constructor(e) {
|
|
8675
8947
|
this.viralViewerApi = e, this.stats = null, this.viralViewerApi.targetElement && (this.stats = We(), this.stats.showPanel(0), this.viralViewerApi.targetElement.appendChild(this.stats.dom));
|
|
8676
8948
|
}
|
|
8677
8949
|
}
|
|
8678
|
-
class
|
|
8950
|
+
class Cn {
|
|
8679
8951
|
constructor(e) {
|
|
8680
|
-
this.viralViewerApi = e, this._selectionOutlineEnabled = !0, this.exceptElements = [], this.isolateModelId = "0", this.sunConfiguration =
|
|
8952
|
+
this.viralViewerApi = e, this._selectionOutlineEnabled = !0, this.exceptElements = [], this.isolateModelId = "0", this.sunConfiguration = is, this._ground = null, this._alphaSelectionOutlineEnabled = !1, this.opacity = 1, this._fog = new bi(13421772, 1, 1e3), this.rainGeometry = new Z(), 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;
|
|
8681
8953
|
}
|
|
8682
8954
|
/**
|
|
8683
8955
|
* show all elements and reset back to normal visualization
|
|
@@ -8736,7 +9008,7 @@ class yn {
|
|
|
8736
9008
|
* Select elements (replaces current selection)
|
|
8737
9009
|
*/
|
|
8738
9010
|
selectElements(e) {
|
|
8739
|
-
e.length > 0 && (this.viralViewerApi.emit(R.SELECT_ELEMENTS, e), this.viralViewerApi.viralScene.bimWorld.select(e, this.exceptElements), this.updateSelectionOutline(), this.viralViewerApi.viralRenderer.render());
|
|
9011
|
+
e.length > 0 && (this.viralViewerApi.emit(R.SELECT_ELEMENTS, e), this.viralViewerApi.viralScene.bimWorld.select(e, this.exceptElements), this.updateSelectionOutline(), this.updateAlphaSelectionOutline(), this.viralViewerApi.viralRenderer.render());
|
|
8740
9012
|
}
|
|
8741
9013
|
/**
|
|
8742
9014
|
* Add elements to current selection (multi-select with Shift)
|
|
@@ -8755,13 +9027,13 @@ class yn {
|
|
|
8755
9027
|
) || s.push(r);
|
|
8756
9028
|
});
|
|
8757
9029
|
const n = [...s, ...i];
|
|
8758
|
-
n.length > 0 ? (this.viralViewerApi.viralScene.bimWorld.select(n, this.exceptElements), this.updateSelectionOutline(), this.viralViewerApi.viralRenderer.render()) : this.unselectElements();
|
|
9030
|
+
n.length > 0 ? (this.viralViewerApi.viralScene.bimWorld.select(n, this.exceptElements), this.updateSelectionOutline(), this.updateAlphaSelectionOutline(), this.viralViewerApi.viralRenderer.render()) : this.unselectElements();
|
|
8759
9031
|
}
|
|
8760
9032
|
/**
|
|
8761
9033
|
* Unselect all elements
|
|
8762
9034
|
*/
|
|
8763
9035
|
unselectElements() {
|
|
8764
|
-
this.viralViewerApi.viralScene.bimWorld.unselect(), this.viralViewerApi.emit(R.UNSELECT_ELEMENTS), this.updateSelectionOutline(), this.viralViewerApi.viralRenderer.render();
|
|
9036
|
+
this.viralViewerApi.viralScene.bimWorld.unselect(), this.viralViewerApi.emit(R.UNSELECT_ELEMENTS), this.updateSelectionOutline(), this.updateAlphaSelectionOutline(), this.viralViewerApi.viralRenderer.render();
|
|
8765
9037
|
}
|
|
8766
9038
|
selectAllElements() {
|
|
8767
9039
|
console.time("⏱️ selectAllElements - gathering elements");
|
|
@@ -8801,15 +9073,15 @@ class yn {
|
|
|
8801
9073
|
this.viralViewerApi.viralScene.sunLight && (this.viralViewerApi.viralScene.sunLight.castShadow = !1), this.viralViewerApi.viralRenderer.render();
|
|
8802
9074
|
}
|
|
8803
9075
|
_adjustLightForMesh(e, t) {
|
|
8804
|
-
const i = new
|
|
9076
|
+
const i = new N().setFromObject(e), s = i.min, n = i.max, r = s.distanceTo(n), o = i.getCenter(new E()), a = t.shadow.camera;
|
|
8805
9077
|
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;
|
|
8806
9078
|
}
|
|
8807
9079
|
_updateDirectLights(e, t) {
|
|
8808
9080
|
const i = D.mergeBoundingBoxes(e), s = i.min, n = i.max;
|
|
8809
9081
|
s.distanceTo(n);
|
|
8810
9082
|
const r = i.getCenter(new E()), o = this.sunConfiguration.elevation, a = this.sunConfiguration.azimuth, l = this.sunConfiguration.radius || 0;
|
|
8811
|
-
this.sunConfiguration.castShadow !== void 0 && (t.castShadow = this.sunConfiguration.castShadow), this.sunConfiguration.intensity !== void 0 && (t.intensity = this.sunConfiguration.intensity), t.color = new
|
|
8812
|
-
const c = i.getBoundingSphere(new
|
|
9083
|
+
this.sunConfiguration.castShadow !== void 0 && (t.castShadow = this.sunConfiguration.castShadow), this.sunConfiguration.intensity !== void 0 && (t.intensity = this.sunConfiguration.intensity), t.color = new k(this.sunConfiguration.color), this.sunConfiguration.enabled !== void 0 && (t.visible = this.sunConfiguration.enabled), t.position.copy(r);
|
|
9084
|
+
const c = i.getBoundingSphere(new Gt()), h = new Wt(c.radius + l, o, a);
|
|
8813
9085
|
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);
|
|
8814
9086
|
}
|
|
8815
9087
|
_updateLightShadowCamera(e, t) {
|
|
@@ -8824,7 +9096,7 @@ class yn {
|
|
|
8824
9096
|
new E(s.x, s.y, s.z)
|
|
8825
9097
|
];
|
|
8826
9098
|
n.forEach((o) => o.applyMatrix4(e.shadow.camera.matrixWorldInverse));
|
|
8827
|
-
const r = new
|
|
9099
|
+
const r = new N().setFromPoints(n);
|
|
8828
9100
|
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;
|
|
8829
9101
|
}
|
|
8830
9102
|
//#endregion
|
|
@@ -8905,7 +9177,7 @@ class yn {
|
|
|
8905
9177
|
enableAllWhite() {
|
|
8906
9178
|
this.viralViewerApi.viralMaterialManager.mergeMaterials.forEach(
|
|
8907
9179
|
(e) => {
|
|
8908
|
-
e.vertexColors = !1, e.color = new
|
|
9180
|
+
e.vertexColors = !1, e.color = new k(16448250), e.needsUpdate = !0;
|
|
8909
9181
|
}
|
|
8910
9182
|
), this.viralViewerApi.viralRenderer.render();
|
|
8911
9183
|
}
|
|
@@ -8938,18 +9210,18 @@ class yn {
|
|
|
8938
9210
|
if (this._ground)
|
|
8939
9211
|
this._ground.visible = !0, this.viralViewerApi.viralRenderer.render();
|
|
8940
9212
|
else {
|
|
8941
|
-
let t = new
|
|
9213
|
+
let t = new N();
|
|
8942
9214
|
if (e)
|
|
8943
|
-
t = new
|
|
9215
|
+
t = new N().setFromObject(e);
|
|
8944
9216
|
else {
|
|
8945
9217
|
const a = [this.viralViewerApi.viralScene.bimWorld.bounds];
|
|
8946
9218
|
t = D.mergeBoundingBoxes(a);
|
|
8947
9219
|
}
|
|
8948
9220
|
const i = new E();
|
|
8949
9221
|
t.getSize(i);
|
|
8950
|
-
const s = t.max.x - t.min.x, n = t.max.z - t.min.z, r = t.min.y, o = new
|
|
9222
|
+
const s = t.max.x - t.min.x, n = t.max.z - t.min.z, r = t.min.y, o = new ee({
|
|
8951
9223
|
uniforms: {
|
|
8952
|
-
color: { value: new
|
|
9224
|
+
color: { value: new k(0) },
|
|
8953
9225
|
opacity: { value: 0.5 }
|
|
8954
9226
|
},
|
|
8955
9227
|
vertexShader: `
|
|
@@ -8971,8 +9243,8 @@ class yn {
|
|
|
8971
9243
|
`,
|
|
8972
9244
|
transparent: !0
|
|
8973
9245
|
});
|
|
8974
|
-
this._ground = new
|
|
8975
|
-
new
|
|
9246
|
+
this._ground = new x(
|
|
9247
|
+
new oe(s * 1.5, n * 1.5),
|
|
8976
9248
|
o
|
|
8977
9249
|
// Semi-transparent shadow material
|
|
8978
9250
|
), this._ground.rotation.x = -Math.PI / 2, this._ground.position.set(
|
|
@@ -9014,7 +9286,7 @@ class yn {
|
|
|
9014
9286
|
if (s.buffer) {
|
|
9015
9287
|
const n = new Z();
|
|
9016
9288
|
n.setAttribute("position", new L(s.buffer, 3));
|
|
9017
|
-
const r = new
|
|
9289
|
+
const r = new x(
|
|
9018
9290
|
n,
|
|
9019
9291
|
this.viralViewerApi.viralMaterialManager.outlineMaterial
|
|
9020
9292
|
);
|
|
@@ -9062,6 +9334,65 @@ class yn {
|
|
|
9062
9334
|
get selectionOutlineEnabled() {
|
|
9063
9335
|
return this._selectionOutlineEnabled;
|
|
9064
9336
|
}
|
|
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
|
+
}
|
|
9065
9396
|
//#endregion
|
|
9066
9397
|
//#region night
|
|
9067
9398
|
enableNight() {
|
|
@@ -9123,7 +9454,7 @@ class yn {
|
|
|
9123
9454
|
for (let n = 0; n < t; n++)
|
|
9124
9455
|
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;
|
|
9125
9456
|
this.rainGeometry.setAttribute("position", new L(i, 3));
|
|
9126
|
-
const s = new
|
|
9457
|
+
const s = new wi({
|
|
9127
9458
|
color: 11184810,
|
|
9128
9459
|
size: 0.2,
|
|
9129
9460
|
transparent: !0,
|
|
@@ -9202,7 +9533,7 @@ class yn {
|
|
|
9202
9533
|
generateLOD() {
|
|
9203
9534
|
this.viralViewerApi.viralScene.bimWorld.children.forEach((e) => {
|
|
9204
9535
|
if (e.isMesh) {
|
|
9205
|
-
const t = new
|
|
9536
|
+
const t = new yi(), i = D.createLowResMesh(e, 0.5);
|
|
9206
9537
|
t.addLevel(e, 50), t.addLevel(i, 200), this.viralViewerApi.viralScene.bimWorld.add(t), this.viralViewerApi.viralScene.bimWorld.remove(e);
|
|
9207
9538
|
}
|
|
9208
9539
|
});
|
|
@@ -9211,7 +9542,7 @@ class yn {
|
|
|
9211
9542
|
* Generate a random but distinct color for each material ID
|
|
9212
9543
|
*/
|
|
9213
9544
|
_generateDistinctColor(e) {
|
|
9214
|
-
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
|
|
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 k();
|
|
9215
9546
|
return r.setHSL(i, s, n), r;
|
|
9216
9547
|
}
|
|
9217
9548
|
/**
|
|
@@ -9310,7 +9641,7 @@ class yn {
|
|
|
9310
9641
|
}
|
|
9311
9642
|
//#endregion
|
|
9312
9643
|
}
|
|
9313
|
-
class
|
|
9644
|
+
class An {
|
|
9314
9645
|
constructor(e) {
|
|
9315
9646
|
this.viralViewerApi = e, this.contextMenu = null, this.contextItems = [], this.injectContextMenu();
|
|
9316
9647
|
}
|
|
@@ -9320,14 +9651,14 @@ class xn {
|
|
|
9320
9651
|
transition: background-color 0.3s ease;
|
|
9321
9652
|
}
|
|
9322
9653
|
.hover-element:hover {
|
|
9323
|
-
background-color: ${
|
|
9654
|
+
background-color: ${y.hover};
|
|
9324
9655
|
|
|
9325
9656
|
}`, t = document.createElement("style");
|
|
9326
9657
|
t.innerHTML = e, document.head.appendChild(t), this.viralViewerApi.targetElement && (this.contextMenu = document.createElement("div"), this.contextMenu.addEventListener("contextmenu", (i) => {
|
|
9327
9658
|
i.preventDefault();
|
|
9328
9659
|
}), this.contextMenu.setAttribute(
|
|
9329
9660
|
"style",
|
|
9330
|
-
`position: absolute;top:0px;left:0px;background-color: ${
|
|
9661
|
+
`position: absolute;top:0px;left:0px;background-color: ${y.background};justify-content: center;display:none; z-index: 100; flex-direction:column; padding: 10px 0; border-radius:10px`
|
|
9331
9662
|
), this.viralViewerApi.targetElement.appendChild(this.contextMenu));
|
|
9332
9663
|
}
|
|
9333
9664
|
showContextMenu(e, t, i) {
|
|
@@ -9343,8 +9674,8 @@ class xn {
|
|
|
9343
9674
|
for (let i = 0; i < this.contextItems.length; i++) {
|
|
9344
9675
|
if (e.findIndex((l) => l == this.contextItems[i][0]) < 0)
|
|
9345
9676
|
continue;
|
|
9346
|
-
const [s, n, r, o] = this.contextItems[i], a =
|
|
9347
|
-
`<div class="hover-element" style="padding: 5px 10px; cursor: pointer; color:${
|
|
9677
|
+
const [s, n, r, o] = this.contextItems[i], a = bt.createElementFromHTML(
|
|
9678
|
+
`<div class="hover-element" style="padding: 5px 10px; cursor: pointer; color:${y.primary}; display:flex; align-items:center">${r} <p style="margin:0px !important;padding-left:5px">${n}</p></div>`
|
|
9348
9679
|
);
|
|
9349
9680
|
a.addEventListener("click", (l) => {
|
|
9350
9681
|
l.stopPropagation(), o(l);
|
|
@@ -9360,7 +9691,7 @@ class xn {
|
|
|
9360
9691
|
this.contextItems.push([e, t, i, s]);
|
|
9361
9692
|
}
|
|
9362
9693
|
}
|
|
9363
|
-
class
|
|
9694
|
+
class _n {
|
|
9364
9695
|
constructor(e) {
|
|
9365
9696
|
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">
|
|
9366
9697
|
<div class="modal-content">
|
|
@@ -9372,7 +9703,7 @@ class Mn {
|
|
|
9372
9703
|
flex-shrink: 0;
|
|
9373
9704
|
">
|
|
9374
9705
|
<span class="close" id="closeBtn">×</span>
|
|
9375
|
-
<h2 style="margin: 0px !important;color:${
|
|
9706
|
+
<h2 style="margin: 0px !important;color:${y.secondary};white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" id="modal-title">
|
|
9376
9707
|
</h2>
|
|
9377
9708
|
</div>
|
|
9378
9709
|
<div id="modal-body" style="overflow-y: auto;overflow-x: hidden;flex: 1;min-height: 0;">
|
|
@@ -9393,7 +9724,7 @@ class Mn {
|
|
|
9393
9724
|
}
|
|
9394
9725
|
|
|
9395
9726
|
.modal-content {
|
|
9396
|
-
background-color: ${
|
|
9727
|
+
background-color: ${y.background};
|
|
9397
9728
|
border: 1px solid #ccc;
|
|
9398
9729
|
border-radius: 5px;
|
|
9399
9730
|
padding: 10px;
|
|
@@ -9413,7 +9744,7 @@ class Mn {
|
|
|
9413
9744
|
width: 15px;
|
|
9414
9745
|
height: 15px;
|
|
9415
9746
|
cursor: nwse-resize;
|
|
9416
|
-
background: linear-gradient(135deg, transparent 0%, transparent 50%, ${
|
|
9747
|
+
background: linear-gradient(135deg, transparent 0%, transparent 50%, ${y.secondary} 50%, ${y.secondary} 100%);
|
|
9417
9748
|
opacity: 0.5;
|
|
9418
9749
|
border-bottom-right-radius: 5px;
|
|
9419
9750
|
}
|
|
@@ -9437,7 +9768,7 @@ class Mn {
|
|
|
9437
9768
|
}
|
|
9438
9769
|
|
|
9439
9770
|
.close:hover {
|
|
9440
|
-
color: ${
|
|
9771
|
+
color: ${y.accent};
|
|
9441
9772
|
}
|
|
9442
9773
|
::-webkit-scrollbar {
|
|
9443
9774
|
width: 5px;
|
|
@@ -9470,7 +9801,7 @@ class Mn {
|
|
|
9470
9801
|
inject() {
|
|
9471
9802
|
if (this.viralViewerApi.targetElement) {
|
|
9472
9803
|
const e = document.createElement("style");
|
|
9473
|
-
e.innerHTML = this.rawModalStyle, document.head.appendChild(e), this.modal =
|
|
9804
|
+
e.innerHTML = this.rawModalStyle, document.head.appendChild(e), this.modal = bt.createElementFromHTML(this.rawModal), this.viralViewerApi.targetElement.appendChild(this.modal);
|
|
9474
9805
|
const t = this.viralViewerApi.targetElement.getBoundingClientRect(), i = this.modal.querySelector(".modal-content");
|
|
9475
9806
|
i && (i.style.maxHeight = `${t.height - 20}px`);
|
|
9476
9807
|
const s = document.getElementById("modal-header"), n = document.getElementById("resizeHandle"), r = document.getElementById("column-resizer");
|
|
@@ -9546,27 +9877,27 @@ class Mn {
|
|
|
9546
9877
|
for (let o = 0; o < r.length; o++) {
|
|
9547
9878
|
const a = r[o], l = this.properties[a], c = (l == null ? void 0 : l.name) || a;
|
|
9548
9879
|
let h = ((n = l == null ? void 0 : l.value) == null ? void 0 : n.toString()) || (l == null ? void 0 : l.toString());
|
|
9549
|
-
(l == null ? void 0 : l.value) === "<None>" && (h = "None"), this.modalBodyLeft.innerHTML += `<p style="margin:0px !important;color:${
|
|
9880
|
+
(l == null ? void 0 : l.value) === "<None>" && (h = "None"), this.modalBodyLeft.innerHTML += `<p style="margin:0px !important;color:${y.primary};font-weight:600;font-size:14px;line-height:20px;" title="${c}">${c}</p>`, this.modalBodyRight.innerHTML += `<p style="margin:0px !important;color:${y.primary};font-size:14px;line-height:20px;" title="${h}">${h}</p>`;
|
|
9550
9881
|
}
|
|
9551
9882
|
}
|
|
9552
9883
|
}
|
|
9553
9884
|
}
|
|
9554
|
-
const
|
|
9885
|
+
const Jt = {
|
|
9555
9886
|
QUICK_SAND: {
|
|
9556
9887
|
importLink: "https://fonts.googleapis.com/css2?family=Quicksand:wght@300&display=swap",
|
|
9557
9888
|
fontFamily: "Quicksand, sans-serif"
|
|
9558
9889
|
}
|
|
9559
|
-
},
|
|
9890
|
+
}, In = (g) => {
|
|
9560
9891
|
const e = document.createElement("style");
|
|
9561
|
-
e.innerHTML = `@import url(${
|
|
9562
|
-
},
|
|
9563
|
-
const t =
|
|
9892
|
+
e.innerHTML = `@import url(${Jt[g]});`, document.head.appendChild(e);
|
|
9893
|
+
}, Vn = (g, e) => {
|
|
9894
|
+
const t = Jt[e];
|
|
9564
9895
|
g && t && (g.style.fontFamily = t.fontFamily);
|
|
9565
9896
|
};
|
|
9566
|
-
class
|
|
9897
|
+
class Tn {
|
|
9567
9898
|
constructor(e) {
|
|
9568
9899
|
this.viralNavigationCube = e, this._mouseDownTime = null, this.clickThreshold = 250, this._handleClick = async (t) => {
|
|
9569
|
-
var c, h, d, u, p, m, f, v, b, w, S, A, C, M, _,
|
|
9900
|
+
var c, h, d, u, p, m, f, v, b, w, S, A, C, M, _, I, O, V, T, j, H;
|
|
9570
9901
|
if (!((c = this.viralNavigationCube.cubeScene) != null && c.activePlane) || (h = this.viralNavigationCube.cubeCamera) != null && h.cameraControlHasMoved)
|
|
9571
9902
|
return console.log("false"), !1;
|
|
9572
9903
|
let i = new E(
|
|
@@ -9576,9 +9907,9 @@ class Cn {
|
|
|
9576
9907
|
);
|
|
9577
9908
|
if (((m = this.viralNavigationCube.cubeScene) == null ? void 0 : m.activePlane.children.length) > 0) {
|
|
9578
9909
|
let q = 0, $ = 0, U = 0;
|
|
9579
|
-
for (let
|
|
9580
|
-
const
|
|
9581
|
-
q +=
|
|
9910
|
+
for (let F = 0; F < ((f = this.viralNavigationCube.cubeScene) == null ? void 0 : f.activePlane.children.length); F++) {
|
|
9911
|
+
const W = (v = this.viralNavigationCube.cubeScene) == null ? void 0 : v.activePlane.children[F];
|
|
9912
|
+
q += W.position.x, $ += W.position.y, U += W.position.z;
|
|
9582
9913
|
}
|
|
9583
9914
|
i = new E(
|
|
9584
9915
|
q / ((b = this.viralNavigationCube.cubeScene) == null ? void 0 : b.activePlane.children.length),
|
|
@@ -9593,7 +9924,7 @@ class Cn {
|
|
|
9593
9924
|
(M = (C = this.viralNavigationCube.cubeCamera) == null ? void 0 : C.camera) == null ? void 0 : M.position
|
|
9594
9925
|
);
|
|
9595
9926
|
const r = new E();
|
|
9596
|
-
(
|
|
9927
|
+
(I = this.viralNavigationCube.viralViewerApi.viralCamera) == null || I.cameraControls.getTarget(r);
|
|
9597
9928
|
const o = new E();
|
|
9598
9929
|
(O = this.viralNavigationCube.viralViewerApi.viralCamera) == null || O.cameraControls.getPosition(
|
|
9599
9930
|
o
|
|
@@ -9603,7 +9934,7 @@ class Cn {
|
|
|
9603
9934
|
Math.round(n.y),
|
|
9604
9935
|
Math.round(n.z)
|
|
9605
9936
|
);
|
|
9606
|
-
l.multiplyScalar(a), (
|
|
9937
|
+
l.multiplyScalar(a), (V = this.viralNavigationCube.viralViewerApi.viralCamera.camera) == null || V.updateMatrixWorld(), (T = this.viralNavigationCube.viralViewerApi.viralCamera.cameraControls) == null || T.setTarget(0, 0, 0), n.multiplyScalar(2), (j = this.viralNavigationCube.cubeCamera) == null || j.cameraControls.setPosition(
|
|
9607
9938
|
n.x,
|
|
9608
9939
|
n.y,
|
|
9609
9940
|
n.z,
|
|
@@ -9625,22 +9956,22 @@ class Cn {
|
|
|
9625
9956
|
(o = this.viralNavigationCube.cubeScene) == null ? void 0 : o.activePlane.position.z
|
|
9626
9957
|
);
|
|
9627
9958
|
if (((a = this.viralNavigationCube.cubeScene) == null ? void 0 : a.activePlane.children.length) > 0) {
|
|
9628
|
-
let U = 0,
|
|
9959
|
+
let U = 0, F = 0, W = 0;
|
|
9629
9960
|
for (let X = 0; X < ((l = this.viralNavigationCube.cubeScene) == null ? void 0 : l.activePlane.children.length); X++) {
|
|
9630
|
-
const
|
|
9631
|
-
U +=
|
|
9961
|
+
const se = (c = this.viralNavigationCube.cubeScene) == null ? void 0 : c.activePlane.children[X];
|
|
9962
|
+
U += se.position.x, F += se.position.y, W += se.position.z;
|
|
9632
9963
|
}
|
|
9633
9964
|
O = new E(
|
|
9634
9965
|
U / ((h = this.viralNavigationCube.cubeScene) == null ? void 0 : h.activePlane.children.length),
|
|
9635
|
-
|
|
9636
|
-
|
|
9966
|
+
F / ((d = this.viralNavigationCube.cubeScene) == null ? void 0 : d.activePlane.children.length),
|
|
9967
|
+
W / ((u = this.viralNavigationCube.cubeScene) == null ? void 0 : u.activePlane.children.length)
|
|
9637
9968
|
);
|
|
9638
9969
|
}
|
|
9639
|
-
const
|
|
9970
|
+
const V = new E();
|
|
9640
9971
|
(p = this.viralNavigationCube.cubeCamera) == null || p.cameraControls.getTarget(
|
|
9641
|
-
|
|
9972
|
+
V
|
|
9642
9973
|
);
|
|
9643
|
-
const T = O.clone().sub(
|
|
9974
|
+
const T = O.clone().sub(V).normalize();
|
|
9644
9975
|
(v = this.viralNavigationCube.cubeCamera) == null || v.cameraControlOldPosition.copy(
|
|
9645
9976
|
(f = (m = this.viralNavigationCube.cubeCamera) == null ? void 0 : m.camera) == null ? void 0 : f.position
|
|
9646
9977
|
);
|
|
@@ -9684,7 +10015,7 @@ class Cn {
|
|
|
9684
10015
|
}
|
|
9685
10016
|
this.viralNavigationCube.cubeScene.activePlane = null;
|
|
9686
10017
|
}
|
|
9687
|
-
const i = t.offsetX, s = t.offsetY, n = (c = this.viralNavigationCube.cubeRenderer) == null ? void 0 : c.renderer.getSize(new
|
|
10018
|
+
const i = t.offsetX, s = t.offsetY, n = (c = this.viralNavigationCube.cubeRenderer) == null ? void 0 : c.renderer.getSize(new z()), r = new z(i / n.width * 2 - 1, -s / n.height * 2 + 1), o = new Tt();
|
|
9688
10019
|
o.setFromCamera(r, (h = this.viralNavigationCube.cubeCamera) == null ? void 0 : h.camera);
|
|
9689
10020
|
const a = o.intersectObjects((d = this.viralNavigationCube.cubeScene) == null ? void 0 : d.objects);
|
|
9690
10021
|
if (a.length > 0 && a[0].object != ((u = this.viralNavigationCube.cubeScene) == null ? void 0 : u.cube)) {
|
|
@@ -9711,14 +10042,14 @@ class Cn {
|
|
|
9711
10042
|
}
|
|
9712
10043
|
//#endregion
|
|
9713
10044
|
}
|
|
9714
|
-
class
|
|
10045
|
+
class Pn {
|
|
9715
10046
|
constructor(e) {
|
|
9716
10047
|
this.viralNavigationCube = e, this.camera = null, this.cameraControls = null, this.cameraControlOldPosition = new E(), this.cameraControlNewPosition = new E(), this.cameraControlHasMoved = !1, this.setupCamera(), this.setupHandle();
|
|
9717
10048
|
}
|
|
9718
10049
|
setupCamera() {
|
|
9719
10050
|
if (this.viralNavigationCube.targetElement && this.viralNavigationCube.cubeRenderer) {
|
|
9720
10051
|
const e = this.viralNavigationCube.targetElement.offsetWidth, t = this.viralNavigationCube.targetElement.offsetHeight;
|
|
9721
|
-
this.camera = new
|
|
10052
|
+
this.camera = new Fe(60, e / t, 0.01, 100), this.camera.position.set(0, 0, 2), this.cameraControls = new pe(
|
|
9722
10053
|
this.camera,
|
|
9723
10054
|
this.viralNavigationCube.cubeRenderer.renderer.domElement
|
|
9724
10055
|
), 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) => {
|
|
@@ -9749,9 +10080,9 @@ class An {
|
|
|
9749
10080
|
window.addEventListener("mousedown", e, !1), window.addEventListener("mousemove", t, !1), window.addEventListener("touchstart", e, !1), window.addEventListener("touchmove", t, !0);
|
|
9750
10081
|
}
|
|
9751
10082
|
}
|
|
9752
|
-
class
|
|
10083
|
+
class On {
|
|
9753
10084
|
constructor(e) {
|
|
9754
|
-
this.viralNavigationCube = e, this.renderer = new
|
|
10085
|
+
this.viralNavigationCube = e, this.renderer = new Qt({
|
|
9755
10086
|
alpha: !0,
|
|
9756
10087
|
antialias: !0,
|
|
9757
10088
|
logarithmicDepthBuffer: !0
|
|
@@ -9784,191 +10115,191 @@ class _n {
|
|
|
9784
10115
|
// }
|
|
9785
10116
|
// }
|
|
9786
10117
|
}
|
|
9787
|
-
class
|
|
10118
|
+
class Dn {
|
|
9788
10119
|
constructor(e, t = 1) {
|
|
9789
|
-
this.viralNavigationCube = e, this.scene = new
|
|
10120
|
+
this.viralNavigationCube = e, this.scene = new vt(), 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();
|
|
9790
10121
|
}
|
|
9791
10122
|
addObject(e) {
|
|
9792
10123
|
this.scene.add(e), this.objects.push(e);
|
|
9793
10124
|
}
|
|
9794
10125
|
addCube() {
|
|
9795
|
-
const e = [], t = ["RIGHT", "LEFT", "TOP", "BOTTOM", "FRONT", "BACK"], i = new
|
|
10126
|
+
const e = [], t = ["RIGHT", "LEFT", "TOP", "BOTTOM", "FRONT", "BACK"], i = new xi(), s = document.createElement("canvas"), n = s.getContext("2d"), r = 64;
|
|
9796
10127
|
if (s.width = r, s.height = r, n) {
|
|
9797
10128
|
n.font = 'bolder 12px "Open sans", Arial', n.textBaseline = "middle", n.textAlign = "center";
|
|
9798
|
-
const o = `${
|
|
10129
|
+
const o = `${y.background}`;
|
|
9799
10130
|
for (let l = 0; l < 6; l++)
|
|
9800
|
-
t[l] == "TOP" || t[l] == "BOTTOM", n.fillStyle = o, n.fillRect(0, 0, r, r), n.strokeStyle = `${
|
|
10131
|
+
t[l] == "TOP" || t[l] == "BOTTOM", n.fillStyle = o, n.fillRect(0, 0, r, r), n.strokeStyle = `${y.primary}`, n.setLineDash([8, 8]), n.lineWidth = 4, n.strokeRect(0, 0, r, r), n.fillStyle = `${y.primary}`, n.fillText(t[l], r / 2, r / 2), e[l] = new G({
|
|
9801
10132
|
map: i.load(s.toDataURL())
|
|
9802
10133
|
});
|
|
9803
10134
|
const a = this.cubeScale;
|
|
9804
|
-
this.cube = new
|
|
10135
|
+
this.cube = new x(new Pt(a, a, a), e), this.addObject(this.cube);
|
|
9805
10136
|
}
|
|
9806
10137
|
}
|
|
9807
10138
|
addPlanes() {
|
|
9808
10139
|
const e = this.cubeScale, t = new G({
|
|
9809
|
-
side:
|
|
10140
|
+
side: te,
|
|
9810
10141
|
color: 6659921,
|
|
9811
10142
|
transparent: !0,
|
|
9812
10143
|
opacity: 0,
|
|
9813
10144
|
depthTest: !1
|
|
9814
|
-
}), i = 0.7 * e, s = 0.7 * e, n = 0.15 * e, r = new
|
|
10145
|
+
}), i = 0.7 * e, s = 0.7 * e, n = 0.15 * e, r = new oe(i, i), o = new oe(n, s), a = new oe(n, n), l = 0.51 * e, c = new x(r, t.clone());
|
|
9815
10146
|
c.position.z = l, c.name = "FRONT";
|
|
9816
|
-
const h = new
|
|
10147
|
+
const h = new x(o, t.clone());
|
|
9817
10148
|
h.position.z = l, h.position.x = i / 2 + n / 2;
|
|
9818
|
-
const d = new
|
|
10149
|
+
const d = new x(o, t.clone());
|
|
9819
10150
|
d.position.z = l, d.position.x = -(i / 2 + n / 2);
|
|
9820
|
-
const u = new
|
|
10151
|
+
const u = new x(o, t.clone());
|
|
9821
10152
|
u.position.z = l, u.rotation.z = Math.PI / 2, u.position.y = i / 2 + n / 2;
|
|
9822
|
-
const p = new
|
|
10153
|
+
const p = new x(o, t.clone());
|
|
9823
10154
|
p.position.z = l, p.rotation.z = Math.PI / 2, p.position.y = -(i / 2 + n / 2);
|
|
9824
|
-
const m = new
|
|
10155
|
+
const m = new x(a, t.clone());
|
|
9825
10156
|
m.position.z = l, m.position.x = -(i / 2 + n / 2), m.position.y = i / 2 + n / 2;
|
|
9826
|
-
const f = new
|
|
10157
|
+
const f = new x(a, t.clone());
|
|
9827
10158
|
f.position.z = l, f.position.x = i / 2 + n / 2, f.position.y = i / 2 + n / 2;
|
|
9828
|
-
const v = new
|
|
10159
|
+
const v = new x(a, t.clone());
|
|
9829
10160
|
v.position.z = l, v.position.x = i / 2 + n / 2, v.position.y = -(i / 2 + n / 2);
|
|
9830
|
-
const b = new
|
|
10161
|
+
const b = new x(a, t.clone());
|
|
9831
10162
|
b.position.z = l, b.position.x = -(i / 2 + n / 2), b.position.y = -(i / 2 + n / 2);
|
|
9832
|
-
const w = new
|
|
10163
|
+
const w = new x(r, t.clone());
|
|
9833
10164
|
w.position.z = -l, w.name = "BACK";
|
|
9834
|
-
const S = new
|
|
10165
|
+
const S = new x(o, t.clone());
|
|
9835
10166
|
S.position.z = -l, S.position.x = i / 2 + n / 2;
|
|
9836
|
-
const A = new
|
|
10167
|
+
const A = new x(o, t.clone());
|
|
9837
10168
|
A.position.z = -l, A.position.x = -(i / 2 + n / 2);
|
|
9838
|
-
const C = new
|
|
10169
|
+
const C = new x(o, t.clone());
|
|
9839
10170
|
C.position.z = -l, C.rotation.z = Math.PI / 2, C.position.y = i / 2 + n / 2;
|
|
9840
|
-
const M = new
|
|
10171
|
+
const M = new x(o, t.clone());
|
|
9841
10172
|
M.position.z = -l, M.rotation.z = Math.PI / 2, M.position.y = -(i / 2 + n / 2);
|
|
9842
|
-
const _ = new
|
|
10173
|
+
const _ = new x(a, t.clone());
|
|
9843
10174
|
_.position.z = -l, _.position.x = i / 2 + n / 2, _.position.y = i / 2 + n / 2;
|
|
9844
|
-
const
|
|
9845
|
-
|
|
9846
|
-
const O = new
|
|
10175
|
+
const I = new x(a, t.clone());
|
|
10176
|
+
I.position.z = -l, I.position.x = -(i / 2 + n / 2), I.position.y = i / 2 + n / 2;
|
|
10177
|
+
const O = new x(a, t.clone());
|
|
9847
10178
|
O.position.z = -l, O.position.x = -(i / 2 + n / 2), O.position.y = -(i / 2 + n / 2);
|
|
9848
|
-
const
|
|
9849
|
-
|
|
9850
|
-
const T = new
|
|
10179
|
+
const V = new x(a, t.clone());
|
|
10180
|
+
V.position.z = -l, V.position.x = i / 2 + n / 2, V.position.y = -(i / 2 + n / 2);
|
|
10181
|
+
const T = new x(r, t.clone());
|
|
9851
10182
|
T.rotation.y = Math.PI / 2, T.position.x = l, T.name = "RIGHT";
|
|
9852
|
-
const j = new
|
|
10183
|
+
const j = new x(o, t.clone());
|
|
9853
10184
|
j.rotation.y = Math.PI / 2, j.position.x = l, j.position.z = i / 2 + n / 2;
|
|
9854
|
-
const H = new
|
|
10185
|
+
const H = new x(o, t.clone());
|
|
9855
10186
|
H.rotation.y = Math.PI / 2, H.position.x = l, H.position.z = -(i / 2 + n / 2);
|
|
9856
|
-
const q = new
|
|
10187
|
+
const q = new x(o, t.clone());
|
|
9857
10188
|
q.rotation.y = Math.PI / 2, q.position.x = l, q.rotation.z = Math.PI / 2, q.position.y = i / 2 + n / 2;
|
|
9858
|
-
const $ = new
|
|
10189
|
+
const $ = new x(o, t.clone());
|
|
9859
10190
|
$.rotation.y = Math.PI / 2, $.position.x = l, $.rotation.z = Math.PI / 2, $.position.y = -(i / 2 + n / 2);
|
|
9860
|
-
const U = new
|
|
10191
|
+
const U = new x(a, t.clone());
|
|
9861
10192
|
U.rotation.y = Math.PI / 2, U.position.x = l, U.position.z = i / 2 + n / 2, U.position.y = i / 2 + n / 2;
|
|
9862
|
-
const
|
|
9863
|
-
|
|
9864
|
-
const
|
|
9865
|
-
|
|
9866
|
-
const X = new
|
|
10193
|
+
const F = new x(a, t.clone());
|
|
10194
|
+
F.rotation.y = Math.PI / 2, F.position.x = l, F.position.z = -(i / 2 + n / 2), F.position.y = i / 2 + n / 2;
|
|
10195
|
+
const W = new x(a, t.clone());
|
|
10196
|
+
W.rotation.y = Math.PI / 2, W.position.x = l, W.position.z = -(i / 2 + n / 2), W.position.y = -(i / 2 + n / 2);
|
|
10197
|
+
const X = new x(a, t.clone());
|
|
9867
10198
|
X.rotation.y = Math.PI / 2, X.position.x = l, X.position.z = i / 2 + n / 2, X.position.y = -(i / 2 + n / 2);
|
|
9868
|
-
const
|
|
9869
|
-
|
|
9870
|
-
const
|
|
9871
|
-
|
|
9872
|
-
const
|
|
9873
|
-
|
|
9874
|
-
const ge = new
|
|
10199
|
+
const se = new x(r, t.clone());
|
|
10200
|
+
se.rotation.y = Math.PI / 2, se.position.x = -l, se.name = "LEFT";
|
|
10201
|
+
const qe = new x(o, t.clone());
|
|
10202
|
+
qe.rotation.y = Math.PI / 2, qe.position.x = -l, qe.position.z = i / 2 + n / 2;
|
|
10203
|
+
const Qe = new x(o, t.clone());
|
|
10204
|
+
Qe.rotation.y = Math.PI / 2, Qe.position.x = -l, Qe.position.z = -(i / 2 + n / 2);
|
|
10205
|
+
const ge = new x(o, t.clone());
|
|
9875
10206
|
ge.rotation.y = Math.PI / 2, ge.position.x = -l, ge.rotation.z = Math.PI / 2, ge.position.y = i / 2 + n / 2;
|
|
9876
|
-
const fe = new
|
|
10207
|
+
const fe = new x(o, t.clone());
|
|
9877
10208
|
fe.rotation.y = Math.PI / 2, fe.position.x = -l, fe.rotation.z = Math.PI / 2, fe.position.y = -(i / 2 + n / 2);
|
|
9878
|
-
const ve = new
|
|
10209
|
+
const ve = new x(a, t.clone());
|
|
9879
10210
|
ve.rotation.y = Math.PI / 2, ve.position.x = -l, ve.position.z = -(i / 2 + n / 2), ve.position.y = i / 2 + n / 2;
|
|
9880
|
-
const be = new
|
|
10211
|
+
const be = new x(a, t.clone());
|
|
9881
10212
|
be.rotation.y = Math.PI / 2, be.position.x = -l, be.position.z = i / 2 + n / 2, be.position.y = i / 2 + n / 2;
|
|
9882
|
-
const we = new
|
|
10213
|
+
const we = new x(a, t.clone());
|
|
9883
10214
|
we.rotation.y = Math.PI / 2, we.position.x = -l, we.position.z = i / 2 + n / 2, we.position.y = -(i / 2 + n / 2);
|
|
9884
|
-
const ye = new
|
|
10215
|
+
const ye = new x(a, t.clone());
|
|
9885
10216
|
ye.rotation.y = Math.PI / 2, ye.position.x = -l, ye.position.z = -(i / 2 + n / 2), ye.position.y = -(i / 2 + n / 2);
|
|
9886
|
-
const
|
|
9887
|
-
|
|
9888
|
-
const
|
|
9889
|
-
|
|
9890
|
-
const
|
|
9891
|
-
|
|
9892
|
-
const xe = new
|
|
10217
|
+
const Ze = new x(r, t.clone());
|
|
10218
|
+
Ze.rotation.x = Math.PI / 2, Ze.position.y = l, Ze.name = "TOP";
|
|
10219
|
+
const Ye = new x(o, t.clone());
|
|
10220
|
+
Ye.rotation.x = Math.PI / 2, Ye.position.y = l, Ye.position.x = i / 2 + n / 2;
|
|
10221
|
+
const Xe = new x(o, t.clone());
|
|
10222
|
+
Xe.rotation.x = Math.PI / 2, Xe.position.y = l, Xe.position.x = -(i / 2 + n / 2);
|
|
10223
|
+
const xe = new x(o, t.clone());
|
|
9893
10224
|
xe.rotation.x = Math.PI / 2, xe.position.y = l, xe.rotation.z = Math.PI / 2, xe.position.z = i / 2 + n / 2;
|
|
9894
|
-
const Me = new
|
|
10225
|
+
const Me = new x(o, t.clone());
|
|
9895
10226
|
Me.rotation.x = Math.PI / 2, Me.position.y = l, Me.rotation.z = Math.PI / 2, Me.position.z = -(i / 2 + n / 2);
|
|
9896
|
-
const Ee = new
|
|
10227
|
+
const Ee = new x(a, t.clone());
|
|
9897
10228
|
Ee.rotation.x = Math.PI / 2, Ee.position.y = l, Ee.position.z = -(i / 2 + n / 2), Ee.position.x = -(i / 2 + n / 2);
|
|
9898
|
-
const Se = new
|
|
10229
|
+
const Se = new x(a, t.clone());
|
|
9899
10230
|
Se.rotation.x = Math.PI / 2, Se.position.y = l, Se.position.z = -(i / 2 + n / 2), Se.position.x = i / 2 + n / 2;
|
|
9900
|
-
const Ce = new
|
|
10231
|
+
const Ce = new x(a, t.clone());
|
|
9901
10232
|
Ce.rotation.x = Math.PI / 2, Ce.position.y = l, Ce.position.z = i / 2 + n / 2, Ce.position.x = i / 2 + n / 2;
|
|
9902
|
-
const Ae = new
|
|
10233
|
+
const Ae = new x(a, t.clone());
|
|
9903
10234
|
Ae.rotation.x = Math.PI / 2, Ae.position.y = l, Ae.position.z = i / 2 + n / 2, Ae.position.x = -(i / 2 + n / 2);
|
|
9904
|
-
const
|
|
9905
|
-
|
|
9906
|
-
const
|
|
9907
|
-
|
|
9908
|
-
const
|
|
9909
|
-
|
|
9910
|
-
const _e = new
|
|
10235
|
+
const Ke = new x(r, t.clone());
|
|
10236
|
+
Ke.rotation.x = Math.PI / 2, Ke.position.y = -l, Ke.name = "BOTTOM";
|
|
10237
|
+
const Je = new x(o, t.clone());
|
|
10238
|
+
Je.rotation.x = Math.PI / 2, Je.position.y = -l, Je.position.x = i / 2 + n / 2;
|
|
10239
|
+
const et = new x(o, t.clone());
|
|
10240
|
+
et.rotation.x = Math.PI / 2, et.position.y = -l, et.position.x = -(i / 2 + n / 2);
|
|
10241
|
+
const _e = new x(o, t.clone());
|
|
9911
10242
|
_e.rotation.x = Math.PI / 2, _e.position.y = -l, _e.rotation.z = Math.PI / 2, _e.position.z = i / 2 + n / 2;
|
|
9912
|
-
const
|
|
9913
|
-
|
|
9914
|
-
const
|
|
9915
|
-
|
|
9916
|
-
const Te = new
|
|
10243
|
+
const Ie = new x(o, t.clone());
|
|
10244
|
+
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 x(a, t.clone());
|
|
10246
|
+
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 Te = new x(a, t.clone());
|
|
9917
10248
|
Te.rotation.x = Math.PI / 2, Te.position.y = -l, Te.position.z = i / 2 + n / 2, Te.position.x = i / 2 + n / 2;
|
|
9918
|
-
const Pe = new
|
|
10249
|
+
const Pe = new x(a, t.clone());
|
|
9919
10250
|
Pe.rotation.x = Math.PI / 2, Pe.position.y = -l, Pe.position.z = -(i / 2 + n / 2), Pe.position.x = i / 2 + n / 2;
|
|
9920
|
-
const Oe = new
|
|
10251
|
+
const Oe = new x(a, t.clone());
|
|
9921
10252
|
Oe.rotation.x = Math.PI / 2, Oe.position.y = -l, Oe.position.z = -(i / 2 + n / 2), Oe.position.x = -(i / 2 + n / 2);
|
|
9922
|
-
const
|
|
10253
|
+
const ei = new G({
|
|
9923
10254
|
color: 11184810
|
|
9924
|
-
}),
|
|
9925
|
-
|
|
9926
|
-
const
|
|
9927
|
-
|
|
9928
|
-
const
|
|
9929
|
-
|
|
9930
|
-
const
|
|
9931
|
-
|
|
9932
|
-
const
|
|
9933
|
-
|
|
9934
|
-
const
|
|
9935
|
-
|
|
9936
|
-
const
|
|
9937
|
-
|
|
9938
|
-
const
|
|
9939
|
-
|
|
9940
|
-
const
|
|
9941
|
-
|
|
9942
|
-
const
|
|
9943
|
-
|
|
9944
|
-
const
|
|
9945
|
-
|
|
9946
|
-
const
|
|
9947
|
-
|
|
9948
|
-
const
|
|
9949
|
-
|
|
9950
|
-
const De = new
|
|
10255
|
+
}), ti = new oe(1 * e, 1 * e), wt = new x(ti, ei);
|
|
10256
|
+
wt.rotation.x = -Math.PI / 2, wt.position.y = -0.6 * e, this.addObject(c), this.addObject(w), this.addObject(T), this.addObject(se), this.addObject(Ze), this.addObject(Ke), this.addObject(wt);
|
|
10257
|
+
const tt = new x();
|
|
10258
|
+
tt.name = "1131", tt.add(h), tt.add(j), this.addObject(tt);
|
|
10259
|
+
const it = new x();
|
|
10260
|
+
it.name = "1241", it.add(d), it.add(qe), this.addObject(it);
|
|
10261
|
+
const st = new x();
|
|
10262
|
+
st.name = "1353", st.add(u), st.add(xe), this.addObject(st);
|
|
10263
|
+
const nt = new x();
|
|
10264
|
+
nt.name = "1463", nt.add(p), nt.add(_e), this.addObject(nt);
|
|
10265
|
+
const rt = new x();
|
|
10266
|
+
rt.name = "2464", rt.add(M), rt.add(Ie), this.addObject(rt);
|
|
10267
|
+
const at = new x();
|
|
10268
|
+
at.name = "3221", at.add(H), at.add(S), this.addObject(at);
|
|
10269
|
+
const ot = new x();
|
|
10270
|
+
ot.name = "3351", ot.add(q), ot.add(Ye), this.addObject(ot);
|
|
10271
|
+
const lt = new x();
|
|
10272
|
+
lt.name = "3461", lt.add($), lt.add(Je), this.addObject(lt);
|
|
10273
|
+
const ct = new x();
|
|
10274
|
+
ct.name = "4222", ct.add(Qe), ct.add(A), this.addObject(ct);
|
|
10275
|
+
const ht = new x();
|
|
10276
|
+
ht.name = "4352", ht.add(ge), ht.add(Xe), this.addObject(ht);
|
|
10277
|
+
const dt = new x();
|
|
10278
|
+
dt.name = "3462", dt.add(fe), dt.add(et), this.addObject(dt);
|
|
10279
|
+
const ut = new x();
|
|
10280
|
+
ut.name = "5423", ut.add(Me), ut.add(C), this.addObject(ut);
|
|
10281
|
+
const De = new x();
|
|
9951
10282
|
De.name = "corner1", De.add(m), De.add(Ae), De.add(be), this.addObject(De);
|
|
9952
|
-
const Re = new
|
|
10283
|
+
const Re = new x();
|
|
9953
10284
|
Re.name = "corner2", Re.add(f), Re.add(U), Re.add(Ce), this.addObject(Re);
|
|
9954
|
-
const Le = new
|
|
10285
|
+
const Le = new x();
|
|
9955
10286
|
Le.name = "corner3", Le.add(v), Le.add(X), Le.add(Te), this.addObject(Le);
|
|
9956
|
-
const ke = new
|
|
9957
|
-
ke.name = "corner4", ke.add(b), ke.add(we), ke.add(
|
|
9958
|
-
const Be = new
|
|
9959
|
-
Be.name = "corner5", Be.add(_), Be.add(
|
|
9960
|
-
const ze = new
|
|
9961
|
-
ze.name = "corner6", ze.add(
|
|
9962
|
-
const Ne = new
|
|
10287
|
+
const ke = new x();
|
|
10288
|
+
ke.name = "corner4", ke.add(b), ke.add(we), ke.add(Ve), this.addObject(ke);
|
|
10289
|
+
const Be = new x();
|
|
10290
|
+
Be.name = "corner5", Be.add(_), Be.add(F), Be.add(Se), this.addObject(Be);
|
|
10291
|
+
const ze = new x();
|
|
10292
|
+
ze.name = "corner6", ze.add(I), ze.add(Ee), ze.add(ve), this.addObject(ze);
|
|
10293
|
+
const Ne = new x();
|
|
9963
10294
|
Ne.name = "corner7", Ne.add(O), Ne.add(ye), Ne.add(Oe), this.addObject(Ne);
|
|
9964
|
-
const $e = new
|
|
9965
|
-
$e.name = "corner8", $e.add(
|
|
10295
|
+
const $e = new x();
|
|
10296
|
+
$e.name = "corner8", $e.add(V), $e.add(W), $e.add(Pe), this.addObject($e);
|
|
9966
10297
|
}
|
|
9967
10298
|
}
|
|
9968
|
-
class
|
|
10299
|
+
class Rn {
|
|
9969
10300
|
//* view cube from third party (new approach)
|
|
9970
10301
|
constructor(e, t = 1) {
|
|
9971
|
-
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
|
|
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 Dn(this, this.cubeScale), this.cubeRenderer = new On(this), this.cubeCamera = new Pn(this), this.cubeMouse = new Tn(this)), this.viralViewerApi.emit(R.LOADED_CUBE);
|
|
9972
10303
|
}
|
|
9973
10304
|
injectCubeWrapperElement() {
|
|
9974
10305
|
if (this.viralViewerApi.targetElement) {
|
|
@@ -9989,14 +10320,14 @@ class In {
|
|
|
9989
10320
|
this.viralViewerApi.viralCamera.backHome();
|
|
9990
10321
|
}
|
|
9991
10322
|
}
|
|
9992
|
-
class
|
|
10323
|
+
class Ln {
|
|
9993
10324
|
constructor(e) {
|
|
9994
10325
|
this.viralViewerApi = e, this.contextMenu = null, this.injectContextMenu();
|
|
9995
10326
|
}
|
|
9996
10327
|
injectContextMenu() {
|
|
9997
10328
|
this.viralViewerApi.targetElement && (this.contextMenu = document.createElement("div"), this.contextMenu.setAttribute("id", "viral-pivot-point"), this.contextMenu.setAttribute(
|
|
9998
10329
|
"style",
|
|
9999
|
-
`position: absolute;top:0px;left:0px;background-color: ${
|
|
10330
|
+
`position: absolute;top:0px;left:0px;background-color: ${y.secondary}; border-radius:5px; height: 10px; width:10px; opacity:80%; transform: translate(-50%, -50%);display: none`
|
|
10000
10331
|
), this.viralViewerApi.targetElement.appendChild(this.contextMenu));
|
|
10001
10332
|
}
|
|
10002
10333
|
show(e, t) {
|
|
@@ -10006,7 +10337,7 @@ class Tn {
|
|
|
10006
10337
|
this.contextMenu && this.contextMenu.style.setProperty("display", "none");
|
|
10007
10338
|
}
|
|
10008
10339
|
}
|
|
10009
|
-
class
|
|
10340
|
+
class kn {
|
|
10010
10341
|
constructor(e) {
|
|
10011
10342
|
this.viralViewerApi = e, this.spinner = null, this.logo = `<svg
|
|
10012
10343
|
width="348.25488"
|
|
@@ -10069,14 +10400,14 @@ class Pn {
|
|
|
10069
10400
|
if (t.innerHTML = e, document.head.appendChild(t), this.viralViewerApi.targetElement) {
|
|
10070
10401
|
this.spinner = document.createElement("div"), this.spinner.setAttribute(
|
|
10071
10402
|
"style",
|
|
10072
|
-
`position: absolute;top:0px;left:0px;right:0px;bottom:0px;background-color: ${
|
|
10403
|
+
`position: absolute;top:0px;left:0px;right:0px;bottom:0px;background-color: ${y.background};justify-content: center;align-items: center;display:none; z-index: 100`
|
|
10073
10404
|
);
|
|
10074
10405
|
const i = document.createElement("div"), s = document.createElement("div");
|
|
10075
10406
|
s.setAttribute(
|
|
10076
10407
|
"style",
|
|
10077
|
-
`width: 200px; height: 200px; border-radius: 50%; border: 2px solid #ccc; border-top: 2px solid ${
|
|
10408
|
+
`width: 200px; height: 200px; border-radius: 50%; border: 2px solid #ccc; border-top: 2px solid ${y.primary}; animation: spin 1.5s linear infinite;`
|
|
10078
10409
|
);
|
|
10079
|
-
const n =
|
|
10410
|
+
const n = bt.createElementFromHTML(this.logo);
|
|
10080
10411
|
n.setAttribute(
|
|
10081
10412
|
"style",
|
|
10082
10413
|
"height:150px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)"
|
|
@@ -10090,7 +10421,7 @@ class Pn {
|
|
|
10090
10421
|
this.spinner && this.spinner.style.setProperty("display", "none");
|
|
10091
10422
|
}
|
|
10092
10423
|
}
|
|
10093
|
-
class
|
|
10424
|
+
class Bn {
|
|
10094
10425
|
constructor(e) {
|
|
10095
10426
|
this.viralTools = e;
|
|
10096
10427
|
}
|
|
@@ -10099,7 +10430,7 @@ class On {
|
|
|
10099
10430
|
e.activate && console.log((t = this.viralTools.viralViewerApi.viralCamera.camera) == null ? void 0 : t.position);
|
|
10100
10431
|
}
|
|
10101
10432
|
}
|
|
10102
|
-
class
|
|
10433
|
+
class zn {
|
|
10103
10434
|
constructor(e) {
|
|
10104
10435
|
this.viralTools = e;
|
|
10105
10436
|
}
|
|
@@ -10107,7 +10438,7 @@ class Dn {
|
|
|
10107
10438
|
this.viralTools.viralViewerApi.targetElement && e.activate;
|
|
10108
10439
|
}
|
|
10109
10440
|
}
|
|
10110
|
-
class
|
|
10441
|
+
class Nn {
|
|
10111
10442
|
constructor(e) {
|
|
10112
10443
|
this.viralTools = e;
|
|
10113
10444
|
}
|
|
@@ -10124,7 +10455,7 @@ class Rn {
|
|
|
10124
10455
|
));
|
|
10125
10456
|
}
|
|
10126
10457
|
}
|
|
10127
|
-
class
|
|
10458
|
+
class $n {
|
|
10128
10459
|
constructor(e) {
|
|
10129
10460
|
this.viralTools = e, this.isActivated = !1;
|
|
10130
10461
|
}
|
|
@@ -10144,9 +10475,9 @@ class Ln {
|
|
|
10144
10475
|
}
|
|
10145
10476
|
}
|
|
10146
10477
|
}
|
|
10147
|
-
class
|
|
10478
|
+
class jn {
|
|
10148
10479
|
constructor(e) {
|
|
10149
|
-
this.viralTools = e, this.viralToolMeasureScene = new
|
|
10480
|
+
this.viralTools = e, this.viralToolMeasureScene = new vt(), this.isActivated = !1, this.measures = [], this.point1 = null, this.point2 = null, this.tempPoint2 = null, this.defaultSprite = this.makeSprite(), this.measureObject = new x(), this.tempMeasure = new x(), this.tempSprite1 = null, this.tempLine = null, this.tempSprite2 = null;
|
|
10150
10481
|
}
|
|
10151
10482
|
activate(e) {
|
|
10152
10483
|
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();
|
|
@@ -10208,20 +10539,20 @@ class kn {
|
|
|
10208
10539
|
const n = document.createElement("canvas"), r = n.getContext("2d"), o = 32;
|
|
10209
10540
|
n.width = o, n.height = o;
|
|
10210
10541
|
const a = o * 0.8 / 2;
|
|
10211
|
-
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 =
|
|
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 = y.primary, r.beginPath(), r.arc(o / 2, o / 2, a * 0.5, 0, Math.PI * 2), r.closePath(), r.fill()), n;
|
|
10212
10543
|
}
|
|
10213
|
-
const t = new
|
|
10544
|
+
const t = new kt(e()), i = new Bt({
|
|
10214
10545
|
map: t,
|
|
10215
10546
|
sizeAttenuation: !1
|
|
10216
|
-
}), s = new
|
|
10547
|
+
}), s = new zt(i);
|
|
10217
10548
|
return s.scale.setScalar(0.08), s;
|
|
10218
10549
|
}
|
|
10219
10550
|
makeLine(e, t) {
|
|
10220
|
-
const i = new
|
|
10221
|
-
color: D.hexToThreejsColor(
|
|
10551
|
+
const i = new Mi({
|
|
10552
|
+
color: D.hexToThreejsColor(y.primary),
|
|
10222
10553
|
linewidth: 20
|
|
10223
10554
|
}), s = [e, t], n = new Z().setFromPoints(s);
|
|
10224
|
-
return new
|
|
10555
|
+
return new gt(n, i);
|
|
10225
10556
|
}
|
|
10226
10557
|
makeDistanceSprite(e, t) {
|
|
10227
10558
|
function i(c, h, d, u, p, m) {
|
|
@@ -10231,7 +10562,7 @@ class kn {
|
|
|
10231
10562
|
if (n) {
|
|
10232
10563
|
n.font = "bolder " + r + 'px "Open Sans", Arial';
|
|
10233
10564
|
const h = "~ " + Math.round(e.distanceTo(t)), d = n.measureText(h), u = 20, p = 10, m = 10;
|
|
10234
|
-
s.width = d.width + u * 2 + m * 2, s.height = r + p * 2 + m * 2, n.shadowBlur = 10, n.shadowColor = "#555", n.fillStyle =
|
|
10565
|
+
s.width = d.width + u * 2 + m * 2, s.height = r + p * 2 + m * 2, n.shadowBlur = 10, n.shadowColor = "#555", n.fillStyle = y.primary, i(
|
|
10235
10566
|
n,
|
|
10236
10567
|
m,
|
|
10237
10568
|
m,
|
|
@@ -10240,8 +10571,8 @@ class kn {
|
|
|
10240
10571
|
10
|
|
10241
10572
|
), 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);
|
|
10242
10573
|
}
|
|
10243
|
-
const o = new
|
|
10244
|
-
new
|
|
10574
|
+
const o = new kt(s), a = new zt(
|
|
10575
|
+
new Bt({
|
|
10245
10576
|
map: o,
|
|
10246
10577
|
sizeAttenuation: !1
|
|
10247
10578
|
})
|
|
@@ -10257,7 +10588,7 @@ class kn {
|
|
|
10257
10588
|
e.code == "Escape" && (D.clearChildren(this.tempMeasure), this.point1 = null, this.point2 = null, this.tempPoint2 = null, this.viralTools.viralViewerApi.viralRenderer.render());
|
|
10258
10589
|
}
|
|
10259
10590
|
}
|
|
10260
|
-
class
|
|
10591
|
+
class Hn {
|
|
10261
10592
|
constructor(e) {
|
|
10262
10593
|
this.viralTools = e;
|
|
10263
10594
|
}
|
|
@@ -10269,7 +10600,7 @@ class Bn {
|
|
|
10269
10600
|
if (e.activate) {
|
|
10270
10601
|
if (t) {
|
|
10271
10602
|
if (t.visible = !0, this.viralTools.viralViewerApi.viralScene.models.length > 0) {
|
|
10272
|
-
const i = new
|
|
10603
|
+
const i = new N().setFromObject(
|
|
10273
10604
|
this.viralTools.viralViewerApi.viralScene.models[0]
|
|
10274
10605
|
), s = new E();
|
|
10275
10606
|
i.getSize(s);
|
|
@@ -10292,14 +10623,14 @@ class Bn {
|
|
|
10292
10623
|
}
|
|
10293
10624
|
}
|
|
10294
10625
|
}
|
|
10295
|
-
class
|
|
10626
|
+
class Fn {
|
|
10296
10627
|
constructor(e) {
|
|
10297
10628
|
this.viralViewerApi = e, this.tools = [
|
|
10298
10629
|
{
|
|
10299
10630
|
name: "navigation",
|
|
10300
10631
|
tools: [
|
|
10301
10632
|
{
|
|
10302
|
-
svg: `<svg fill="${
|
|
10633
|
+
svg: `<svg fill="${y.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>`,
|
|
10303
10634
|
index: 0,
|
|
10304
10635
|
activate: !0,
|
|
10305
10636
|
allowDehydrated: !1,
|
|
@@ -10308,7 +10639,7 @@ class zn {
|
|
|
10308
10639
|
}
|
|
10309
10640
|
},
|
|
10310
10641
|
{
|
|
10311
|
-
svg: `<svg fill="${
|
|
10642
|
+
svg: `<svg fill="${y.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>`,
|
|
10312
10643
|
index: 1,
|
|
10313
10644
|
activate: !1,
|
|
10314
10645
|
allowDehydrated: !1,
|
|
@@ -10321,7 +10652,7 @@ class zn {
|
|
|
10321
10652
|
name: "helper",
|
|
10322
10653
|
tools: [
|
|
10323
10654
|
{
|
|
10324
|
-
svg: `<svg fill="${
|
|
10655
|
+
svg: `<svg fill="${y.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>`,
|
|
10325
10656
|
index: 0,
|
|
10326
10657
|
activate: !1,
|
|
10327
10658
|
allowDehydrated: !1,
|
|
@@ -10329,7 +10660,7 @@ class zn {
|
|
|
10329
10660
|
action: (t) => this.viralToolElevation.activate(t)
|
|
10330
10661
|
},
|
|
10331
10662
|
{
|
|
10332
|
-
svg: `<svg fill="${
|
|
10663
|
+
svg: `<svg fill="${y.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>`,
|
|
10333
10664
|
index: 1,
|
|
10334
10665
|
activate: !1,
|
|
10335
10666
|
allowDehydrated: !1,
|
|
@@ -10337,7 +10668,7 @@ class zn {
|
|
|
10337
10668
|
action: (t) => this.viralToolMeasure.activate(t)
|
|
10338
10669
|
},
|
|
10339
10670
|
{
|
|
10340
|
-
svg: `<svg fill="${
|
|
10671
|
+
svg: `<svg fill="${y.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>`,
|
|
10341
10672
|
index: 2,
|
|
10342
10673
|
activate: !1,
|
|
10343
10674
|
allowDehydrated: !1,
|
|
@@ -10351,7 +10682,7 @@ class zn {
|
|
|
10351
10682
|
name: "environment",
|
|
10352
10683
|
tools: [
|
|
10353
10684
|
{
|
|
10354
|
-
svg: `<svg fill="${
|
|
10685
|
+
svg: `<svg fill="${y.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>`,
|
|
10355
10686
|
index: 0,
|
|
10356
10687
|
activate: !1,
|
|
10357
10688
|
allowDehydrated: !1,
|
|
@@ -10359,7 +10690,7 @@ class zn {
|
|
|
10359
10690
|
action: (t) => this.viralToolSunlight.activate(t)
|
|
10360
10691
|
},
|
|
10361
10692
|
{
|
|
10362
|
-
svg: `<svg fill="${
|
|
10693
|
+
svg: `<svg fill="${y.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>`,
|
|
10363
10694
|
index: 1,
|
|
10364
10695
|
activate: !1,
|
|
10365
10696
|
allowDehydrated: !1,
|
|
@@ -10372,7 +10703,7 @@ class zn {
|
|
|
10372
10703
|
name: "theme",
|
|
10373
10704
|
tools: [
|
|
10374
10705
|
{
|
|
10375
|
-
svg: `<svg fill="${
|
|
10706
|
+
svg: `<svg fill="${y.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>`,
|
|
10376
10707
|
index: 0,
|
|
10377
10708
|
activate: !1,
|
|
10378
10709
|
allowDehydrated: !0,
|
|
@@ -10385,7 +10716,7 @@ class zn {
|
|
|
10385
10716
|
name: "debug",
|
|
10386
10717
|
tools: [
|
|
10387
10718
|
{
|
|
10388
|
-
svg: `<svg fill="${
|
|
10719
|
+
svg: `<svg fill="${y.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>`,
|
|
10389
10720
|
index: 0,
|
|
10390
10721
|
activate: !1,
|
|
10391
10722
|
allowDehydrated: !1,
|
|
@@ -10396,7 +10727,7 @@ class zn {
|
|
|
10396
10727
|
}
|
|
10397
10728
|
]
|
|
10398
10729
|
}
|
|
10399
|
-
], this.items = [], this.viralToolAvatar = new
|
|
10730
|
+
], this.items = [], this.viralToolAvatar = new zn(this), this.viralToolDarkMode = new Nn(this), this.viralToolSunlight = new Hn(this), this.viralToolElevation = new $n(this), this.viralToolMeasure = new jn(this), this.viralToolAmbientOcclusion = new Bn(this), this.dehydratedCachedData(), this.executeToolsByDefault(), this.injectTools(), this.viralViewerApi.emit(R.LOADED_TOOLS);
|
|
10400
10731
|
}
|
|
10401
10732
|
//#region Init
|
|
10402
10733
|
injectTools() {
|
|
@@ -10410,7 +10741,7 @@ class zn {
|
|
|
10410
10741
|
const i = this.tools[t], s = document.createElement("div");
|
|
10411
10742
|
s.setAttribute(
|
|
10412
10743
|
"style",
|
|
10413
|
-
`padding: 8px 10px 10px 10px; display: flex;flex-direction: row;justify-content: center; align-items: center; background-color: ${
|
|
10744
|
+
`padding: 8px 10px 10px 10px; display: flex;flex-direction: row;justify-content: center; align-items: center; background-color: ${y.background}; border-radius: 10px; pointer-events: visible;margin: 0 2.5px;`
|
|
10414
10745
|
);
|
|
10415
10746
|
for (let n = 0; n < i.tools.length; n++) {
|
|
10416
10747
|
const r = i.tools[n], o = document.createElement("div");
|
|
@@ -10423,10 +10754,10 @@ class zn {
|
|
|
10423
10754
|
const a = document.createElement("div");
|
|
10424
10755
|
a.setAttribute(
|
|
10425
10756
|
"style",
|
|
10426
|
-
`border-top: 2px solid ; padding-bottom: 2px; border-color: ${
|
|
10757
|
+
`border-top: 2px solid ; padding-bottom: 2px; border-color: ${y.background};`
|
|
10427
10758
|
), r.activate && a.setAttribute(
|
|
10428
10759
|
"style",
|
|
10429
|
-
`border-top: 2px solid ; padding-bottom: 2px; border-color: ${
|
|
10760
|
+
`border-top: 2px solid ; padding-bottom: 2px; border-color: ${y.secondary};`
|
|
10430
10761
|
), o.appendChild(a);
|
|
10431
10762
|
const l = document.createElement("div");
|
|
10432
10763
|
l.setAttribute(
|
|
@@ -10440,8 +10771,8 @@ class zn {
|
|
|
10440
10771
|
}, l.onmouseleave = () => {
|
|
10441
10772
|
l.style.setProperty("background-color", "unset");
|
|
10442
10773
|
};
|
|
10443
|
-
const c =
|
|
10444
|
-
r.activate && c && c.setAttribute("fill", `${
|
|
10774
|
+
const c = bt.createElementFromHTML(r.svg);
|
|
10775
|
+
r.activate && c && c.setAttribute("fill", `${y.secondary}`), l.appendChild(c), o.appendChild(l), s.appendChild(o);
|
|
10445
10776
|
}
|
|
10446
10777
|
e.appendChild(s);
|
|
10447
10778
|
}
|
|
@@ -10475,12 +10806,12 @@ class zn {
|
|
|
10475
10806
|
if (s) {
|
|
10476
10807
|
s.activate = !s.activate;
|
|
10477
10808
|
const n = t.children[0], o = t.children[1].children[0];
|
|
10478
|
-
s.activate ? (n.style.setProperty("border-color", `${
|
|
10809
|
+
s.activate ? (n.style.setProperty("border-color", `${y.secondary}`), o.setAttribute("fill", `${y.secondary}`)) : (n.style.setProperty("border-color", `${y.background}`), o.setAttribute("fill", `${y.primary}`)), s.action(s);
|
|
10479
10810
|
}
|
|
10480
10811
|
}
|
|
10481
10812
|
//#endregion
|
|
10482
10813
|
}
|
|
10483
|
-
class
|
|
10814
|
+
class Wn {
|
|
10484
10815
|
set(e, t) {
|
|
10485
10816
|
localStorage[e] = t;
|
|
10486
10817
|
}
|
|
@@ -10529,7 +10860,7 @@ class Nn {
|
|
|
10529
10860
|
localStorage.clear();
|
|
10530
10861
|
}
|
|
10531
10862
|
}
|
|
10532
|
-
class
|
|
10863
|
+
class Er extends Ns {
|
|
10533
10864
|
constructor(e = {
|
|
10534
10865
|
isDev: !1,
|
|
10535
10866
|
cameraZUp: !1,
|
|
@@ -10541,12 +10872,12 @@ class br extends Bs {
|
|
|
10541
10872
|
adaptiveEdges: !0,
|
|
10542
10873
|
adaptiveAmbientOcclusion: !0
|
|
10543
10874
|
}) {
|
|
10544
|
-
super(), this.viralCompressProcessor = new
|
|
10875
|
+
super(), this.viralCompressProcessor = new xs(), this.localStorageService = new Wn(), 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, In("QUICK_SAND"), Vn(this.targetElement, "QUICK_SAND"), this.options.enableTools && (this.viralTools = new Fn(this)), this.viralSpinner = new kn(this), this.viralDraggableModal = new _n(this), this.viralContextMenu = new An(this), this.viralPivotPoint = new Ln(this), this.viralScene = new Mn(this), this.viralMaterialManager = new rn(this), this.viralRenderer = new xn(this), this.viralCamera = new ys(this), this.options.enableNavigationCube && (this.viralNavigationCube = new Rn(
|
|
10545
10876
|
this,
|
|
10546
10877
|
this.options.navigationCubeScale || 1
|
|
10547
|
-
)), this.viralMouse = new
|
|
10878
|
+
)), this.viralMouse = new js(this), this.viralKeyboard = new $s(this), this.viralAnimation = new ps(this), this.viralVisibilityManager = new Cn(this), this.viralCentralizedEventHandler = new Hs(this), this.viralLoader = new nn(this), this.viralBVH = new bs(), this.viralDataManager = new zs(this), this.viralAvatarManager = new vs(this), this.options.isDev && (this.viralStats = new Sn(this)), this.options.isDev ? this.viralAnimation.devAnimation() : this.viralAnimation.animation();
|
|
10548
10879
|
const t = window;
|
|
10549
|
-
t.VIRAL_VIEWER = this, this.viralSectionBox = new
|
|
10880
|
+
t.VIRAL_VIEWER = this, this.viralSectionBox = new Vt(this), this.viralBatchDebugPanel = new hs(this), this.viralRenderDebugPanel = new us(this), this.viralInstancedDebugPanel = new ds(this), this.options.isDev && import("./lil-gui.esm-BtfdsiIY.mjs").then(({ GUI: i }) => {
|
|
10550
10881
|
var b, w, S, A, C;
|
|
10551
10882
|
const s = new i({ title: "Controls" }), n = s.addFolder("Sun Light");
|
|
10552
10883
|
n.add(this.viralScene.sunLight, "visible").onChange(() => {
|
|
@@ -10657,40 +10988,40 @@ class br extends Bs {
|
|
|
10657
10988
|
1,
|
|
10658
10989
|
64,
|
|
10659
10990
|
1
|
|
10660
|
-
).onChange((
|
|
10661
|
-
this.viralRenderer.postProcessingRenderer.n8aoPass.configuration.aoSamples =
|
|
10991
|
+
).onChange((V) => {
|
|
10992
|
+
this.viralRenderer.postProcessingRenderer.n8aoPass.configuration.aoSamples = V, this.viralRenderer.render();
|
|
10662
10993
|
}), _.add(
|
|
10663
10994
|
(w = this.viralRenderer.postProcessingRenderer) == null ? void 0 : w.n8aoPass.configuration,
|
|
10664
10995
|
"aoRadius",
|
|
10665
10996
|
1,
|
|
10666
10997
|
10,
|
|
10667
10998
|
0.01
|
|
10668
|
-
).onChange((
|
|
10669
|
-
this.viralRenderer.postProcessingRenderer.n8aoPass.configuration.aoRadius =
|
|
10999
|
+
).onChange((V) => {
|
|
11000
|
+
this.viralRenderer.postProcessingRenderer.n8aoPass.configuration.aoRadius = V, this.viralRenderer.render();
|
|
10670
11001
|
}), _.add(
|
|
10671
11002
|
(S = this.viralRenderer.postProcessingRenderer) == null ? void 0 : S.n8aoPass.configuration,
|
|
10672
11003
|
"denoiseRadius",
|
|
10673
11004
|
0,
|
|
10674
11005
|
24,
|
|
10675
11006
|
0.01
|
|
10676
|
-
).onChange((
|
|
10677
|
-
this.viralRenderer.postProcessingRenderer.n8aoPass.configuration.denoiseRadius =
|
|
11007
|
+
).onChange((V) => {
|
|
11008
|
+
this.viralRenderer.postProcessingRenderer.n8aoPass.configuration.denoiseRadius = V, this.viralRenderer.render();
|
|
10678
11009
|
}), _.add(
|
|
10679
11010
|
(A = this.viralRenderer.postProcessingRenderer) == null ? void 0 : A.n8aoPass.configuration,
|
|
10680
11011
|
"intensity",
|
|
10681
11012
|
0,
|
|
10682
11013
|
10,
|
|
10683
11014
|
0.01
|
|
10684
|
-
).onChange((
|
|
10685
|
-
this.viralRenderer.postProcessingRenderer.n8aoPass.configuration.intensity =
|
|
11015
|
+
).onChange((V) => {
|
|
11016
|
+
this.viralRenderer.postProcessingRenderer.n8aoPass.configuration.intensity = V, this.viralRenderer.render();
|
|
10686
11017
|
}), _.add(
|
|
10687
11018
|
(C = this.viralRenderer.postProcessingRenderer) == null ? void 0 : C.n8aoPass.configuration,
|
|
10688
11019
|
"distanceFalloff",
|
|
10689
11020
|
0,
|
|
10690
11021
|
10,
|
|
10691
11022
|
0.01
|
|
10692
|
-
).onChange((
|
|
10693
|
-
this.viralRenderer.postProcessingRenderer.n8aoPass.configuration.distanceFalloff =
|
|
11023
|
+
).onChange((V) => {
|
|
11024
|
+
this.viralRenderer.postProcessingRenderer.n8aoPass.configuration.distanceFalloff = V, this.viralRenderer.render();
|
|
10694
11025
|
}), M.add(
|
|
10695
11026
|
this.viralRenderer.postProcessingRenderer,
|
|
10696
11027
|
"enableSobel"
|
|
@@ -10698,11 +11029,11 @@ class br extends Bs {
|
|
|
10698
11029
|
this.viralRenderer.postProcessingRenderer,
|
|
10699
11030
|
"disableSobel"
|
|
10700
11031
|
);
|
|
10701
|
-
const
|
|
10702
|
-
|
|
11032
|
+
const I = M.addFolder("Screen-Space Edges");
|
|
11033
|
+
I.add(this.viralRenderer.postProcessingRenderer, "enableScreenSpaceEdges").name("Enable"), I.add(this.viralRenderer.postProcessingRenderer, "disableScreenSpaceEdges").name("Disable"), I.add(
|
|
10703
11034
|
this.viralRenderer.postProcessingRenderer,
|
|
10704
11035
|
"setScreenSpaceEdgesPenMode"
|
|
10705
|
-
).name("Pen Mode"),
|
|
11036
|
+
).name("Pen Mode"), I.add(
|
|
10706
11037
|
this.viralRenderer.postProcessingRenderer,
|
|
10707
11038
|
"setScreenSpaceEdgesShadedMode"
|
|
10708
11039
|
).name("Shaded Mode");
|
|
@@ -10725,48 +11056,48 @@ class br extends Bs {
|
|
|
10725
11056
|
enableObjectIdEdges: !1
|
|
10726
11057
|
// Disable - most expensive
|
|
10727
11058
|
};
|
|
10728
|
-
|
|
11059
|
+
I.addColor(O, "edgeColor").name("Edge Color").onChange((V) => {
|
|
10729
11060
|
var T;
|
|
10730
11061
|
(T = this.viralRenderer.postProcessingRenderer) == null || T.setScreenSpaceEdgeColor(
|
|
10731
|
-
parseInt(
|
|
11062
|
+
parseInt(V.replace("#", "0x"))
|
|
10732
11063
|
), this.viralRenderer.render();
|
|
10733
|
-
}),
|
|
11064
|
+
}), I.add(O, "edgeOpacity", 0, 1, 0.05).name("Opacity").onChange((V) => {
|
|
10734
11065
|
var T;
|
|
10735
|
-
(T = this.viralRenderer.postProcessingRenderer) == null || T.setScreenSpaceEdgeOpacity(
|
|
10736
|
-
}),
|
|
11066
|
+
(T = this.viralRenderer.postProcessingRenderer) == null || T.setScreenSpaceEdgeOpacity(V), this.viralRenderer.render();
|
|
11067
|
+
}), I.add(O, "edgeThickness", 0.5, 5, 0.1).name("Thickness").onChange((V) => {
|
|
10737
11068
|
var T;
|
|
10738
11069
|
(T = this.viralRenderer.postProcessingRenderer) == null || T.setScreenSpaceEdgeThickness(
|
|
10739
|
-
|
|
11070
|
+
V
|
|
10740
11071
|
), this.viralRenderer.render();
|
|
10741
|
-
}),
|
|
11072
|
+
}), I.add(O, "depthMultiplier", 0, 3, 0.1).name("Depth Sensitivity").onChange((V) => {
|
|
10742
11073
|
var T;
|
|
10743
11074
|
(T = this.viralRenderer.postProcessingRenderer) == null || T.setScreenSpaceEdgesOptions({
|
|
10744
|
-
depthMultiplier:
|
|
11075
|
+
depthMultiplier: V
|
|
10745
11076
|
}), this.viralRenderer.render();
|
|
10746
|
-
}),
|
|
11077
|
+
}), I.add(O, "normalMultiplier", 0, 3, 0.1).name("Normal Sensitivity").onChange((V) => {
|
|
10747
11078
|
var T;
|
|
10748
11079
|
(T = this.viralRenderer.postProcessingRenderer) == null || T.setScreenSpaceEdgesOptions({
|
|
10749
|
-
normalMultiplier:
|
|
11080
|
+
normalMultiplier: V
|
|
10750
11081
|
}), this.viralRenderer.render();
|
|
10751
|
-
}),
|
|
11082
|
+
}), I.add(O, "normalBias", 0, 1, 0.01).name("Normal Bias").onChange((V) => {
|
|
10752
11083
|
var T;
|
|
10753
11084
|
(T = this.viralRenderer.postProcessingRenderer) == null || T.setScreenSpaceEdgesOptions({
|
|
10754
|
-
normalBias:
|
|
11085
|
+
normalBias: V
|
|
10755
11086
|
}), this.viralRenderer.render();
|
|
10756
|
-
}),
|
|
11087
|
+
}), I.add(O, "enableDepthEdges").name("Depth Edges").onChange((V) => {
|
|
10757
11088
|
var T;
|
|
10758
11089
|
(T = this.viralRenderer.postProcessingRenderer) == null || T.setScreenSpaceEdgeMethods({
|
|
10759
|
-
depth:
|
|
11090
|
+
depth: V
|
|
10760
11091
|
}), this.viralRenderer.render();
|
|
10761
|
-
}),
|
|
11092
|
+
}), I.add(O, "enableNormalEdges").name("Normal Edges").onChange((V) => {
|
|
10762
11093
|
var T;
|
|
10763
11094
|
(T = this.viralRenderer.postProcessingRenderer) == null || T.setScreenSpaceEdgeMethods({
|
|
10764
|
-
normal:
|
|
11095
|
+
normal: V
|
|
10765
11096
|
}), this.viralRenderer.render();
|
|
10766
|
-
}),
|
|
11097
|
+
}), I.add(O, "enableObjectIdEdges").name("Object ID Edges").onChange((V) => {
|
|
10767
11098
|
var T;
|
|
10768
11099
|
(T = this.viralRenderer.postProcessingRenderer) == null || T.setScreenSpaceEdgeMethods({
|
|
10769
|
-
objectId:
|
|
11100
|
+
objectId: V
|
|
10770
11101
|
}), this.viralRenderer.render();
|
|
10771
11102
|
});
|
|
10772
11103
|
}
|
|
@@ -10774,37 +11105,37 @@ class br extends Bs {
|
|
|
10774
11105
|
}
|
|
10775
11106
|
}
|
|
10776
11107
|
export {
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
11108
|
+
fr as BufferElement,
|
|
11109
|
+
ls as CheckClashResult,
|
|
11110
|
+
os as CompareModelsResult,
|
|
11111
|
+
as as DataTree,
|
|
11112
|
+
Mr as DebouncedEventHandler,
|
|
11113
|
+
is as DefaultLightConfiguration,
|
|
11114
|
+
It as Dictionary,
|
|
11115
|
+
mr as ElementFragment,
|
|
11116
|
+
pr as Fragment,
|
|
11117
|
+
cs as GroupByResult,
|
|
11118
|
+
bt as HTMLUtil,
|
|
10788
11119
|
Q as LogUtil,
|
|
10789
11120
|
D as THREEUtil,
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
11121
|
+
xr as TreeNode,
|
|
11122
|
+
es as ViralBIMWorld,
|
|
11123
|
+
hs as ViralBatchDebugPanel,
|
|
10793
11124
|
Y as ViralBatchedMesh,
|
|
10794
11125
|
K as ViralCameraEventType,
|
|
10795
|
-
|
|
11126
|
+
ds as ViralInstancedDebugPanel,
|
|
10796
11127
|
me as ViralKeyboardEventType,
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
11128
|
+
B as ViralMouseEventType,
|
|
11129
|
+
ae as ViralPoint,
|
|
11130
|
+
us as ViralRenderDebugPanel,
|
|
11131
|
+
Er as ViralViewerApi,
|
|
11132
|
+
gr as ViralViewerRevitGeometry,
|
|
11133
|
+
ur as ViralViewerRevitNoneStructuralGeometry,
|
|
11134
|
+
ts as ViralutionBox,
|
|
11135
|
+
Kt as ViralutionCamera,
|
|
11136
|
+
vr as ViralutionElement,
|
|
10806
11137
|
R as ViralutionEvent,
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
11138
|
+
wr as ViralutionSolid,
|
|
11139
|
+
br as ViralutionStandaloneModel,
|
|
11140
|
+
yr as ViralutionTrackingModel
|
|
10810
11141
|
};
|