viral-viewer-2 6.4.2 → 6.4.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.
@@ -0,0 +1,7 @@
1
+ import { ViralViewerTool } from "../../..";
2
+ import { ViralTools } from "../viral-tools";
3
+ export declare class ViralToolAvatar {
4
+ viralTools: ViralTools;
5
+ constructor(viralTools: ViralTools);
6
+ activate(input: ViralViewerTool): void;
7
+ }
@@ -1,12 +1,14 @@
1
1
  import { ViralViewerTool } from "../..";
2
2
  import { ViralViewerApi } from "../../viral-viewer-api";
3
3
  import { ViralToolAmbientOcclusion } from "./tools/viral-tool-ambient-occlusion";
4
+ import { ViralToolAvatar } from "./tools/viral-tool-avatar";
4
5
  import { ViralToolDarkMode } from "./tools/viral-tool-dark-mode";
5
6
  import { ViralToolElevation } from "./tools/viral-tool-elevation";
6
7
  import { ViralToolMeasure } from "./tools/viral-tool-measure";
7
8
  import { ViralToolSunlight } from "./tools/viral-tool-sunlight";
8
9
  export declare class ViralTools {
9
10
  viralViewerApi: ViralViewerApi;
11
+ viralToolAvatar: ViralToolAvatar;
10
12
  viralToolDarkMode: ViralToolDarkMode;
11
13
  viralToolSunlight: ViralToolSunlight;
12
14
  viralToolElevation: ViralToolElevation;
package/dist/index.mjs CHANGED
@@ -1,19 +1,19 @@
1
- class nR {
1
+ class s3 {
2
2
  constructor() {
3
3
  this.MaterialIndex = 0, this.Vertices = [], this.Indices = [], this.Name = "", this.Instances = [];
4
4
  }
5
5
  }
6
- class sR {
6
+ class r3 {
7
7
  constructor() {
8
8
  this.MaterialIndex = 0, this.Elements = [];
9
9
  }
10
10
  }
11
- class rR {
11
+ class a3 {
12
12
  constructor() {
13
13
  this.Vertices = [], this.Indices = [], this.Instances = [], this.Id = "";
14
14
  }
15
15
  }
16
- class aR {
16
+ class o3 {
17
17
  constructor() {
18
18
  this.Vertices = [], this.Indices = [], this.Transform = null;
19
19
  }
@@ -60,12 +60,12 @@ class Pl {
60
60
  return Object.keys(this.items).length;
61
61
  }
62
62
  }
63
- class oR {
63
+ class l3 {
64
64
  constructor() {
65
65
  this.Solids = [], this.Id = "", this.Instances = [];
66
66
  }
67
67
  }
68
- class lR {
68
+ class c3 {
69
69
  constructor() {
70
70
  this.MaterialIndex = 0, this.Vertices = [], this.Indices = [], this.Buffer = [];
71
71
  }
@@ -80,7 +80,7 @@ class Zx {
80
80
  this.min = new na(), this.max = new na();
81
81
  }
82
82
  }
83
- class cR {
83
+ class h3 {
84
84
  constructor() {
85
85
  this.Data = {}, this.CameraData = new qx();
86
86
  }
@@ -1808,7 +1808,7 @@ var yw = oc, xw = kf, vw = gw, bw = kf, ww = rc, _w = {
1808
1808
  ungzip: bw,
1809
1809
  constants: ww
1810
1810
  };
1811
- const { Inflate: hR, inflate: Mw, inflateRaw: uR, ungzip: dR } = _w;
1811
+ const { Inflate: u3, inflate: Mw, inflateRaw: d3, ungzip: f3 } = _w;
1812
1812
  var Sw = Mw;
1813
1813
  class Aw {
1814
1814
  pakoUnzip(e) {
@@ -26601,7 +26601,9 @@ class fP {
26601
26601
  this.viralViewerApi.viralLoader.pointCloudLoader.pointClouds,
26602
26602
  this.viralViewerApi.viralCamera.camera,
26603
26603
  this.viralViewerApi.viralRenderer.renderer
26604
- ), requestAnimationFrame(() => {
26604
+ ), this.viralViewerApi.viralAvatarManager.avatars.length > 0 && (this.viralViewerApi.viralAvatarManager.avatars.forEach((a) => {
26605
+ a.isReady && a.render(e);
26606
+ }), this.viralViewerApi.viralRenderer.render()), requestAnimationFrame(() => {
26605
26607
  this.animation();
26606
26608
  }), t && (this.viralViewerApi.viralRenderer.render(), this.viralViewerApi.viralNavigationCube && this.viralViewerApi.viralNavigationCube.cubeCamera && this.viralViewerApi.viralNavigationCube.cubeCamera.updateCubeCamera()), this.viralViewerApi.viralNavigationCube && this.viralViewerApi.viralNavigationCube.cubeCamera && this.viralViewerApi.viralNavigationCube.cubeCamera.cameraControls && ((s = this.viralViewerApi.viralNavigationCube.cubeCamera.cameraControls) != null && s.update(
26607
26609
  e
@@ -40694,7 +40696,7 @@ function JC(n, e, t, i, s, r) {
40694
40696
  mu(a, e, t, f, r);
40695
40697
  }
40696
40698
  }
40697
- function e3(n, e, t, i, s) {
40699
+ function eR(n, e, t, i, s) {
40698
40700
  const { geometry: r, _indirectBuffer: a } = n;
40699
40701
  let l = 1 / 0, h = null;
40700
40702
  for (let u = i, f = i + s; u < f; u++) {
@@ -40703,7 +40705,7 @@ function e3(n, e, t, i, s) {
40703
40705
  }
40704
40706
  return h;
40705
40707
  }
40706
- function t3(n, e, t, i, s, r, a) {
40708
+ function tR(n, e, t, i, s, r, a) {
40707
40709
  const { geometry: l } = t, { index: h } = l, u = l.attributes.position;
40708
40710
  for (let f = n, p = e + n; f < p; f++) {
40709
40711
  let g;
@@ -40713,7 +40715,7 @@ function t3(n, e, t, i, s, r, a) {
40713
40715
  return !1;
40714
40716
  }
40715
40717
  const G0 = /* @__PURE__ */ new G();
40716
- function i3(n, e, t, i, s) {
40718
+ function iR(n, e, t, i, s) {
40717
40719
  Fi.setBuffer(n._roots[e]), Ef(0, n, t, i, s), Fi.clearBuffer();
40718
40720
  }
40719
40721
  function Ef(n, e, t, i, s) {
@@ -40728,8 +40730,8 @@ function Ef(n, e, t, i, s) {
40728
40730
  kr(p, r, i, G0) && Ef(p, e, t, i, s);
40729
40731
  }
40730
40732
  }
40731
- const W0 = /* @__PURE__ */ new G(), n3 = ["x", "y", "z"];
40732
- function s3(n, e, t, i) {
40733
+ const W0 = /* @__PURE__ */ new G(), nR = ["x", "y", "z"];
40734
+ function sR(n, e, t, i) {
40733
40735
  Fi.setBuffer(n._roots[e]);
40734
40736
  const s = Pf(0, n, t, i);
40735
40737
  return Fi.clearBuffer(), s;
@@ -40741,7 +40743,7 @@ function Pf(n, e, t, i) {
40741
40743
  const u = nr(n, a), f = Br(l, r);
40742
40744
  return jC(e, t, i, u, f);
40743
40745
  } else {
40744
- const u = Wx(n, a), f = n3[u], g = i.direction[f] >= 0;
40746
+ const u = Wx(n, a), f = nR[u], g = i.direction[f] >= 0;
40745
40747
  let x, w;
40746
40748
  g ? (x = zr(n), w = Ur(n, a)) : (x = Ur(n, a), w = zr(n));
40747
40749
  const b = kr(x, s, i, W0) ? Pf(x, e, t, i) : null;
@@ -40758,7 +40760,7 @@ function Pf(n, e, t, i) {
40758
40760
  }
40759
40761
  }
40760
40762
  const Lh = /* @__PURE__ */ new di(), oo = /* @__PURE__ */ new ds(), lo = /* @__PURE__ */ new ds(), Sl = /* @__PURE__ */ new nt(), Q0 = /* @__PURE__ */ new En(), Ih = /* @__PURE__ */ new En();
40761
- function r3(n, e, t, i) {
40763
+ function rR(n, e, t, i) {
40762
40764
  Fi.setBuffer(n._roots[e]);
40763
40765
  const s = Cf(0, n, t, i);
40764
40766
  return Fi.clearBuffer(), s;
@@ -40790,12 +40792,12 @@ function Cf(n, e, t, i, s = null) {
40790
40792
  return Gn(f, r, Lh), !!(s.intersectsBox(Lh) && Cf(f, e, t, i, s) || (Gn(p, r, Lh), s.intersectsBox(Lh) && Cf(p, e, t, i, s)));
40791
40793
  }
40792
40794
  }
40793
- const Dh = /* @__PURE__ */ new nt(), Hd = /* @__PURE__ */ new En(), Al = /* @__PURE__ */ new En(), a3 = /* @__PURE__ */ new G(), o3 = /* @__PURE__ */ new G(), l3 = /* @__PURE__ */ new G(), c3 = /* @__PURE__ */ new G();
40794
- function h3(n, e, t, i = {}, s = {}, r = 0, a = 1 / 0) {
40795
+ const Dh = /* @__PURE__ */ new nt(), Hd = /* @__PURE__ */ new En(), Al = /* @__PURE__ */ new En(), aR = /* @__PURE__ */ new G(), oR = /* @__PURE__ */ new G(), lR = /* @__PURE__ */ new G(), cR = /* @__PURE__ */ new G();
40796
+ function hR(n, e, t, i = {}, s = {}, r = 0, a = 1 / 0) {
40795
40797
  e.boundingBox || e.computeBoundingBox(), Hd.set(e.boundingBox.min, e.boundingBox.max, t), Hd.needsUpdate = !0;
40796
40798
  const l = n.geometry, h = l.attributes.position, u = l.index, f = e.attributes.position, p = e.index, g = an.getPrimitive(), x = an.getPrimitive();
40797
- let w = a3, E = o3, b = null, v = null;
40798
- s && (b = l3, v = c3);
40799
+ let w = aR, E = oR, b = null, v = null;
40800
+ s && (b = lR, v = cR);
40799
40801
  let C = 1 / 0, T = null, S = null;
40800
40802
  return Dh.copy(t).invert(), Al.matrix.copy(Dh), n.shapecast(
40801
40803
  {
@@ -40835,7 +40837,7 @@ function h3(n, e, t, i = {}, s = {}, r = 0, a = 1 / 0) {
40835
40837
  ), an.releasePrimitive(g), an.releasePrimitive(x), C === 1 / 0 ? null : (i.point ? i.point.copy(E) : i.point = E.clone(), i.distance = C, i.faceIndex = T, s && (s.point ? s.point.copy(v) : s.point = v.clone(), s.point.applyMatrix4(Dh), E.applyMatrix4(Dh), s.distance = E.sub(s.point).length(), s.faceIndex = S), i);
40836
40838
  }
40837
40839
  const q0 = new nt(), Yd = /* @__PURE__ */ new di(), Gd = /* @__PURE__ */ new di();
40838
- function u3(n, e, t, i) {
40840
+ function uR(n, e, t, i) {
40839
40841
  let {
40840
40842
  intersectsRanges: s,
40841
40843
  intersectsTriangles: r
@@ -40871,7 +40873,7 @@ function u3(n, e, t, i) {
40871
40873
  });
40872
40874
  return an.releasePrimitive(f), an.releasePrimitive(p), g;
40873
40875
  }
40874
- function d3(n, e = null) {
40876
+ function dR(n, e = null) {
40875
40877
  e && Array.isArray(e) && (e = new Set(e));
40876
40878
  const t = n.geometry, i = t.index ? t.index.array : null, s = t.attributes.position;
40877
40879
  let r, a, l, h, u = 0;
@@ -40913,7 +40915,7 @@ function d3(n, e = null) {
40913
40915
  }
40914
40916
  }
40915
40917
  const Z0 = /* @__PURE__ */ new G();
40916
- function f3(n, e, t, i, s) {
40918
+ function fR(n, e, t, i, s) {
40917
40919
  Fi.setBuffer(n._roots[e]), Rf(0, n, t, i, s), Fi.clearBuffer();
40918
40920
  }
40919
40921
  function Rf(n, e, t, i, s) {
@@ -40928,8 +40930,8 @@ function Rf(n, e, t, i, s) {
40928
40930
  kr(p, r, i, Z0) && Rf(p, e, t, i, s);
40929
40931
  }
40930
40932
  }
40931
- const j0 = /* @__PURE__ */ new G(), p3 = ["x", "y", "z"];
40932
- function m3(n, e, t, i) {
40933
+ const j0 = /* @__PURE__ */ new G(), pR = ["x", "y", "z"];
40934
+ function mR(n, e, t, i) {
40933
40935
  Fi.setBuffer(n._roots[e]);
40934
40936
  const s = Lf(0, n, t, i);
40935
40937
  return Fi.clearBuffer(), s;
@@ -40939,9 +40941,9 @@ function Lf(n, e, t, i) {
40939
40941
  let l = n * 2;
40940
40942
  if (us(l, r)) {
40941
40943
  const u = nr(n, a), f = Br(l, r);
40942
- return e3(e, t, i, u, f);
40944
+ return eR(e, t, i, u, f);
40943
40945
  } else {
40944
- const u = Wx(n, a), f = p3[u], g = i.direction[f] >= 0;
40946
+ const u = Wx(n, a), f = pR[u], g = i.direction[f] >= 0;
40945
40947
  let x, w;
40946
40948
  g ? (x = zr(n), w = Ur(n, a)) : (x = Ur(n, a), w = zr(n));
40947
40949
  const b = kr(x, s, i, j0) ? Lf(x, e, t, i) : null;
@@ -40958,7 +40960,7 @@ function Lf(n, e, t, i) {
40958
40960
  }
40959
40961
  }
40960
40962
  const Oh = /* @__PURE__ */ new di(), co = /* @__PURE__ */ new ds(), ho = /* @__PURE__ */ new ds(), Tl = /* @__PURE__ */ new nt(), K0 = /* @__PURE__ */ new En(), Nh = /* @__PURE__ */ new En();
40961
- function g3(n, e, t, i) {
40963
+ function gR(n, e, t, i) {
40962
40964
  Fi.setBuffer(n._roots[e]);
40963
40965
  const s = If(0, n, t, i);
40964
40966
  return Fi.clearBuffer(), s;
@@ -40991,12 +40993,12 @@ function If(n, e, t, i, s = null) {
40991
40993
  return Gn(f, r, Oh), !!(s.intersectsBox(Oh) && If(f, e, t, i, s) || (Gn(p, r, Oh), s.intersectsBox(Oh) && If(p, e, t, i, s)));
40992
40994
  }
40993
40995
  }
40994
- const Bh = /* @__PURE__ */ new nt(), Wd = /* @__PURE__ */ new En(), El = /* @__PURE__ */ new En(), y3 = /* @__PURE__ */ new G(), x3 = /* @__PURE__ */ new G(), v3 = /* @__PURE__ */ new G(), b3 = /* @__PURE__ */ new G();
40995
- function w3(n, e, t, i = {}, s = {}, r = 0, a = 1 / 0) {
40996
+ const Bh = /* @__PURE__ */ new nt(), Wd = /* @__PURE__ */ new En(), El = /* @__PURE__ */ new En(), yR = /* @__PURE__ */ new G(), xR = /* @__PURE__ */ new G(), vR = /* @__PURE__ */ new G(), bR = /* @__PURE__ */ new G();
40997
+ function wR(n, e, t, i = {}, s = {}, r = 0, a = 1 / 0) {
40996
40998
  e.boundingBox || e.computeBoundingBox(), Wd.set(e.boundingBox.min, e.boundingBox.max, t), Wd.needsUpdate = !0;
40997
40999
  const l = n.geometry, h = l.attributes.position, u = l.index, f = e.attributes.position, p = e.index, g = an.getPrimitive(), x = an.getPrimitive();
40998
- let w = y3, E = x3, b = null, v = null;
40999
- s && (b = v3, v = b3);
41000
+ let w = yR, E = xR, b = null, v = null;
41001
+ s && (b = vR, v = bR);
41000
41002
  let C = 1 / 0, T = null, S = null;
41001
41003
  return Bh.copy(t).invert(), El.matrix.copy(Bh), n.shapecast(
41002
41004
  {
@@ -41040,7 +41042,7 @@ function w3(n, e, t, i = {}, s = {}, r = 0, a = 1 / 0) {
41040
41042
  ), an.releasePrimitive(g), an.releasePrimitive(x), C === 1 / 0 ? null : (i.point ? i.point.copy(E) : i.point = E.clone(), i.distance = C, i.faceIndex = T, s && (s.point ? s.point.copy(v) : s.point = v.clone(), s.point.applyMatrix4(Bh), E.applyMatrix4(Bh), s.distance = E.sub(s.point).length(), s.faceIndex = S), i);
41041
41043
  }
41042
41044
  const $0 = new nt(), Qd = /* @__PURE__ */ new di(), qd = /* @__PURE__ */ new di();
41043
- function _3(n, e, t, i) {
41045
+ function _R(n, e, t, i) {
41044
41046
  let {
41045
41047
  intersectsRanges: s,
41046
41048
  intersectsTriangles: r
@@ -41079,7 +41081,7 @@ function _3(n, e, t, i) {
41079
41081
  });
41080
41082
  return an.releasePrimitive(f), an.releasePrimitive(p), g;
41081
41083
  }
41082
- function M3() {
41084
+ function MR() {
41083
41085
  return typeof SharedArrayBuffer < "u";
41084
41086
  }
41085
41087
  const zh = /* @__PURE__ */ new En(), J0 = /* @__PURE__ */ new di();
@@ -41139,14 +41141,14 @@ class Sp {
41139
41141
  // undocumented options
41140
41142
  // Whether to skip generating the tree. Used for deserialization.
41141
41143
  [kd]: !1
41142
- }, t), t.useSharedArrayBuffer && !M3())
41144
+ }, t), t.useSharedArrayBuffer && !MR())
41143
41145
  throw new Error("MeshBVH: SharedArrayBuffer is not available.");
41144
41146
  this.geometry = e, this._roots = null, this._indirectBuffer = null, t[kd] || (kC(this, t), !e.boundingBox && t.setBoundingBox && (e.boundingBox = this.getBoundingBox(new di())));
41145
41147
  const { _indirectBuffer: i } = this;
41146
41148
  this.resolveTriangleIndex = t.indirect ? (s) => i[s] : (s) => s;
41147
41149
  }
41148
41150
  refit(e = null) {
41149
- return (this.indirect ? d3 : $C)(this, e);
41151
+ return (this.indirect ? dR : $C)(this, e);
41150
41152
  }
41151
41153
  traverse(e, t = 0) {
41152
41154
  const i = this._roots[t], s = new Uint32Array(i), r = new Uint16Array(i);
@@ -41164,7 +41166,7 @@ class Sp {
41164
41166
  }
41165
41167
  /* Core Cast Functions */
41166
41168
  raycast(e, t = is) {
41167
- const i = this._roots, s = this.geometry, r = [], a = t.isMaterial, l = Array.isArray(t), h = s.groups, u = a ? t.side : t, f = this.indirect ? f3 : i3;
41169
+ const i = this._roots, s = this.geometry, r = [], a = t.isMaterial, l = Array.isArray(t), h = s.groups, u = a ? t.side : t, f = this.indirect ? fR : iR;
41168
41170
  for (let p = 0, g = i.length; p < g; p++) {
41169
41171
  const x = l ? t[h[p].materialIndex].side : u, w = r.length;
41170
41172
  if (f(this, p, x, e, r), l) {
@@ -41178,7 +41180,7 @@ class Sp {
41178
41180
  raycastFirst(e, t = is) {
41179
41181
  const i = this._roots, s = this.geometry, r = t.isMaterial, a = Array.isArray(t);
41180
41182
  let l = null;
41181
- const h = s.groups, u = r ? t.side : t, f = this.indirect ? m3 : s3;
41183
+ const h = s.groups, u = r ? t.side : t, f = this.indirect ? mR : sR;
41182
41184
  for (let p = 0, g = i.length; p < g; p++) {
41183
41185
  const x = a ? t[h[p].materialIndex].side : u, w = f(this, p, x, e);
41184
41186
  w != null && (l == null || w.distance < l.distance) && (l = w, a && (w.face.materialIndex = h[p].materialIndex));
@@ -41187,13 +41189,13 @@ class Sp {
41187
41189
  }
41188
41190
  intersectsGeometry(e, t) {
41189
41191
  let i = !1;
41190
- const s = this._roots, r = this.indirect ? g3 : r3;
41192
+ const s = this._roots, r = this.indirect ? gR : rR;
41191
41193
  for (let a = 0, l = s.length; a < l && (i = r(this, a, e, t), !i); a++)
41192
41194
  ;
41193
41195
  return i;
41194
41196
  }
41195
41197
  shapecast(e) {
41196
- const t = an.getPrimitive(), i = this.indirect ? t3 : KC;
41198
+ const t = an.getPrimitive(), i = this.indirect ? tR : KC;
41197
41199
  let {
41198
41200
  boundsTraverseOrder: s,
41199
41201
  intersectsBounds: r,
@@ -41216,7 +41218,7 @@ class Sp {
41216
41218
  return an.releasePrimitive(t), h;
41217
41219
  }
41218
41220
  bvhcast(e, t, i) {
41219
- return (this.indirect ? _3 : u3)(this, e, t, i);
41221
+ return (this.indirect ? _R : uR)(this, e, t, i);
41220
41222
  }
41221
41223
  /* Derived Cast Functions */
41222
41224
  intersectsBox(e, t) {
@@ -41236,7 +41238,7 @@ class Sp {
41236
41238
  );
41237
41239
  }
41238
41240
  closestPointToGeometry(e, t, i = {}, s = {}, r = 0, a = 1 / 0) {
41239
- return (this.indirect ? w3 : h3)(
41241
+ return (this.indirect ? wR : hR)(
41240
41242
  this,
41241
41243
  e,
41242
41244
  t,
@@ -41264,8 +41266,8 @@ class Sp {
41264
41266
  function ey(n, e, t) {
41265
41267
  return n === null || (n.point.applyMatrix4(e.matrixWorld), n.distance = n.point.distanceTo(t.ray.origin), n.object = e, n.distance < t.near || n.distance > t.far) ? null : n;
41266
41268
  }
41267
- const Zd = /* @__PURE__ */ new Xo(), ty = /* @__PURE__ */ new nt(), S3 = fe.prototype.raycast;
41268
- function A3(n, e) {
41269
+ const Zd = /* @__PURE__ */ new Xo(), ty = /* @__PURE__ */ new nt(), SR = fe.prototype.raycast;
41270
+ function AR(n, e) {
41269
41271
  if (this.geometry.boundsTree) {
41270
41272
  if (this.material === void 0)
41271
41273
  return;
@@ -41282,23 +41284,23 @@ function A3(n, e) {
41282
41284
  }
41283
41285
  }
41284
41286
  } else
41285
- S3.call(this, n, e);
41287
+ SR.call(this, n, e);
41286
41288
  }
41287
- function T3(n) {
41289
+ function TR(n) {
41288
41290
  return this.boundsTree = new Sp(this, n), this.boundsTree;
41289
41291
  }
41290
- function E3() {
41292
+ function ER() {
41291
41293
  this.boundsTree = null;
41292
41294
  }
41293
- class P3 {
41295
+ class PR {
41294
41296
  constructor() {
41295
- Xt.prototype.computeBoundsTree = T3, Xt.prototype.disposeBoundsTree = E3, fe.prototype.raycast = A3;
41297
+ Xt.prototype.computeBoundsTree = TR, Xt.prototype.disposeBoundsTree = ER, fe.prototype.raycast = AR;
41296
41298
  }
41297
41299
  applyThreeMeshBVH(e) {
41298
41300
  e.boundsTree || e.computeBoundsTree();
41299
41301
  }
41300
41302
  }
41301
- class C3 {
41303
+ class CR {
41302
41304
  constructor(e) {
41303
41305
  this.viralViewerApi = e, this.hoverMaterial = new Nr({
41304
41306
  color: vn.hexToThreejsColor(kt.secondary),
@@ -41341,7 +41343,7 @@ void main() {
41341
41343
  }), this.materials = new Pl(), this.viralViewerApi.lifeCycleEvent.emit(Pi.LOADED_MATERIAL_MANAGER);
41342
41344
  }
41343
41345
  }
41344
- class R3 {
41346
+ class RR {
41345
41347
  constructor() {
41346
41348
  this.events = {
41347
41349
  [Pi.LOADED_SCENE]: [],
@@ -41363,7 +41365,7 @@ class R3 {
41363
41365
  i && i.forEach((s) => s(...t));
41364
41366
  }
41365
41367
  }
41366
- class L3 {
41368
+ class LR {
41367
41369
  constructor(e, t) {
41368
41370
  this.eventDispatcher = e, this.options = t, this.eventDispatcher.on(
41369
41371
  Pi.LOADED_SCENE,
@@ -41427,14 +41429,14 @@ const Qx = {
41427
41429
  importLink: "https://fonts.googleapis.com/css2?family=Quicksand:wght@300&display=swap",
41428
41430
  fontFamily: "Quicksand, sans-serif"
41429
41431
  }
41430
- }, I3 = (n) => {
41432
+ }, IR = (n) => {
41431
41433
  const e = document.createElement("style");
41432
41434
  e.innerHTML = `@import url(${Qx[n]});`, document.head.appendChild(e);
41433
- }, D3 = (n, e) => {
41435
+ }, DR = (n, e) => {
41434
41436
  let t = Qx[e];
41435
41437
  n && t && (n.style.fontFamily = t.fontFamily);
41436
41438
  };
41437
- class O3 {
41439
+ class OR {
41438
41440
  constructor(e) {
41439
41441
  this.viralViewerApi = e, this.hoverMeshes = [], this.hoverInstancedMesh = null, this.selectedMeshes = [], this.selectedInstancedMeshes = [], this.isolateMeshes = [], this.isolateInstancedMeshes = [], this.hiddenMeshes = [], this.hiddenInstancedMeshes = [];
41440
41442
  }
@@ -41493,7 +41495,7 @@ class O3 {
41493
41495
  }
41494
41496
  }
41495
41497
  }
41496
- function N3() {
41498
+ function NR() {
41497
41499
  self.addEventListener(
41498
41500
  "message",
41499
41501
  (n) => {
@@ -41527,10 +41529,10 @@ function N3() {
41527
41529
  !1
41528
41530
  );
41529
41531
  }
41530
- const B3 = N3;
41531
- class z3 {
41532
+ const BR = NR;
41533
+ class zR {
41532
41534
  constructor() {
41533
- const e = new Blob([`(${B3})()`]), t = URL.createObjectURL(e);
41535
+ const e = new Blob([`(${BR})()`]), t = URL.createObjectURL(e);
41534
41536
  this.workerPool = new nc(
41535
41537
  2,
41536
41538
  t
@@ -41538,20 +41540,20 @@ class z3 {
41538
41540
  }
41539
41541
  fetch(e, t = (r) => {
41540
41542
  }, i, s) {
41541
- let r = new U3(e, i, s);
41543
+ let r = new UR(e, i, s);
41542
41544
  this.workerPool.Enqueue(r, (a) => {
41543
41545
  t(a);
41544
41546
  });
41545
41547
  }
41546
41548
  }
41547
- class U3 {
41549
+ class UR {
41548
41550
  constructor(e, t, i) {
41549
41551
  this.url = "", this.url = e, this.byteRangeStart = t, this.byteRangeEnd = i;
41550
41552
  }
41551
41553
  }
41552
- class k3 {
41554
+ class kR {
41553
41555
  constructor(e) {
41554
- this.viralViewerApi = e, this.elementData = {}, this.fetchDataWorker = new z3();
41556
+ this.viralViewerApi = e, this.elementData = {}, this.fetchDataWorker = new zR();
41555
41557
  }
41556
41558
  normalFetch(e, t, i) {
41557
41559
  return t !== void 0 && t >= 0 && i !== void 0 && i > 0 ? fetch(e, {
@@ -41574,7 +41576,7 @@ class k3 {
41574
41576
  }, i, s);
41575
41577
  }
41576
41578
  }
41577
- class F3 {
41579
+ class FR {
41578
41580
  constructor(e) {
41579
41581
  this.viralViewerApi = e, this.spinner = null, this.logo = `<svg
41580
41582
  width="348.25488"
@@ -41649,7 +41651,7 @@ class F3 {
41649
41651
  this.spinner && this.spinner.style.setProperty("display", "none");
41650
41652
  }
41651
41653
  }
41652
- class X3 {
41654
+ class XR {
41653
41655
  constructor(e) {
41654
41656
  this.viralViewerApi = e, this.modal = null, this.modalTitle = null, this.modalBody = null, this.modalBodyLeft = null, this.modalBodyRight = null, this.properties = {}, this.rawModal = `<div class="modal" id="myModal">
41655
41657
  <div class="modal-content">
@@ -41755,7 +41757,7 @@ class X3 {
41755
41757
  }
41756
41758
  }
41757
41759
  }
41758
- class V3 {
41760
+ class VR {
41759
41761
  constructor(e) {
41760
41762
  this.viralTools = e;
41761
41763
  }
@@ -41764,7 +41766,15 @@ class V3 {
41764
41766
  console.log(this.viralTools.viralViewerApi.viralRenderer.renderer.info.render.calls), e.activate && console.log((t = this.viralTools.viralViewerApi.viralCamera.camera) == null ? void 0 : t.position);
41765
41767
  }
41766
41768
  }
41767
- class H3 {
41769
+ class HR {
41770
+ constructor(e) {
41771
+ this.viralTools = e;
41772
+ }
41773
+ activate(e) {
41774
+ this.viralTools.viralViewerApi.targetElement && e.activate;
41775
+ }
41776
+ }
41777
+ class YR {
41768
41778
  constructor(e) {
41769
41779
  this.viralTools = e;
41770
41780
  }
@@ -41772,7 +41782,7 @@ class H3 {
41772
41782
  this.viralTools.viralViewerApi.targetElement && (e.activate ? this.viralTools.viralViewerApi.targetElement.style.setProperty("background-color", "#303030") : this.viralTools.viralViewerApi.targetElement.style.setProperty("background-color", "unset"), this.viralTools.viralViewerApi.localStorageService.setObject("viral-viewer-tool", this.viralTools.tools));
41773
41783
  }
41774
41784
  }
41775
- class Y3 {
41785
+ class GR {
41776
41786
  constructor(e) {
41777
41787
  this.viralTools = e, this.isActivated = !1;
41778
41788
  }
@@ -41792,7 +41802,7 @@ class Y3 {
41792
41802
  }
41793
41803
  }
41794
41804
  }
41795
- class G3 {
41805
+ class WR {
41796
41806
  constructor(e) {
41797
41807
  this.viralTools = e, this.viralToolMeasureScene = new wa(), this.isActivated = !1, this.measures = [], this.point1 = null, this.point2 = null, this.tempPoint2 = null, this.defaultSprite = this.makeSprite(), this.measureObject = new fe(), this.tempMeasure = new fe(), this.tempSprite1 = null, this.tempLine = null, this.tempSprite2 = null;
41798
41808
  }
@@ -41892,7 +41902,7 @@ class G3 {
41892
41902
  e.code == "Escape" && (vn.clearChildren(this.tempMeasure), this.point1 = null, this.point2 = null, this.tempPoint2 = null, this.viralTools.viralViewerApi.viralRenderer.render());
41893
41903
  }
41894
41904
  }
41895
- class W3 {
41905
+ class QR {
41896
41906
  constructor(e) {
41897
41907
  this.viralTools = e;
41898
41908
  }
@@ -41928,14 +41938,14 @@ class W3 {
41928
41938
  }
41929
41939
  }
41930
41940
  }
41931
- class Q3 {
41941
+ class qR {
41932
41942
  constructor(e) {
41933
41943
  this.viralViewerApi = e, this.tools = [
41934
41944
  {
41935
41945
  name: "navigation",
41936
41946
  tools: [
41937
41947
  {
41938
- svg: `<svg fill="${kt.primary}" style="height: 30px;" 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>`,
41948
+ svg: `<svg fill="${kt.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>`,
41939
41949
  index: 0,
41940
41950
  activate: !0,
41941
41951
  allowDehydrated: !1,
@@ -41944,13 +41954,12 @@ class Q3 {
41944
41954
  }
41945
41955
  },
41946
41956
  {
41947
- svg: `<svg fill="${kt.primary}" style="height: 30px;" 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>`,
41957
+ svg: `<svg fill="${kt.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>`,
41948
41958
  index: 1,
41949
41959
  activate: !1,
41950
41960
  allowDehydrated: !1,
41951
41961
  name: "first-person",
41952
- action: () => {
41953
- }
41962
+ action: (t) => this.viralToolAvatar.activate(t)
41954
41963
  }
41955
41964
  ]
41956
41965
  },
@@ -41958,7 +41967,7 @@ class Q3 {
41958
41967
  name: "helper",
41959
41968
  tools: [
41960
41969
  {
41961
- svg: `<svg fill="${kt.primary}" style="height: 30px;" 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>`,
41970
+ svg: `<svg fill="${kt.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>`,
41962
41971
  index: 0,
41963
41972
  activate: !1,
41964
41973
  allowDehydrated: !1,
@@ -41966,7 +41975,7 @@ class Q3 {
41966
41975
  action: (t) => this.viralToolElevation.activate(t)
41967
41976
  },
41968
41977
  {
41969
- svg: `<svg fill="${kt.primary}" style="height: 30px;" 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>`,
41978
+ svg: `<svg fill="${kt.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>`,
41970
41979
  index: 1,
41971
41980
  activate: !1,
41972
41981
  allowDehydrated: !1,
@@ -41974,7 +41983,7 @@ class Q3 {
41974
41983
  action: (t) => this.viralToolMeasure.activate(t)
41975
41984
  },
41976
41985
  {
41977
- svg: `<svg fill="${kt.primary}" style="height: 30px;" 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>`,
41986
+ svg: `<svg fill="${kt.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>`,
41978
41987
  index: 2,
41979
41988
  activate: !1,
41980
41989
  allowDehydrated: !1,
@@ -41988,7 +41997,7 @@ class Q3 {
41988
41997
  name: "environment",
41989
41998
  tools: [
41990
41999
  {
41991
- svg: `<svg fill="${kt.primary}" style="height: 30px;" 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>`,
42000
+ svg: `<svg fill="${kt.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>`,
41992
42001
  index: 0,
41993
42002
  activate: !1,
41994
42003
  allowDehydrated: !1,
@@ -41996,7 +42005,7 @@ class Q3 {
41996
42005
  action: (t) => this.viralToolSunlight.activate(t)
41997
42006
  },
41998
42007
  {
41999
- svg: `<svg fill="${kt.primary}" style="height: 30px;" 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>`,
42008
+ svg: `<svg fill="${kt.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>`,
42000
42009
  index: 1,
42001
42010
  activate: !1,
42002
42011
  allowDehydrated: !1,
@@ -42009,7 +42018,7 @@ class Q3 {
42009
42018
  name: "theme",
42010
42019
  tools: [
42011
42020
  {
42012
- svg: `<svg fill="${kt.primary}" style="height: 30px;" 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>`,
42021
+ svg: `<svg fill="${kt.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>`,
42013
42022
  index: 0,
42014
42023
  activate: !1,
42015
42024
  allowDehydrated: !0,
@@ -42018,7 +42027,7 @@ class Q3 {
42018
42027
  }
42019
42028
  ]
42020
42029
  }
42021
- ], this.items = [], this.viralToolDarkMode = new H3(this), this.viralToolSunlight = new W3(this), this.viralToolElevation = new Y3(this), this.viralToolMeasure = new G3(this), this.viralToolAmbientOcclusion = new V3(this), this.dehydratedCachedData(), this.executeToolsByDefault(), this.injectTools(), this.viralViewerApi.lifeCycleEvent.emit(Pi.LOADED_TOOLS);
42030
+ ], this.items = [], this.viralToolAvatar = new HR(this), this.viralToolDarkMode = new YR(this), this.viralToolSunlight = new QR(this), this.viralToolElevation = new GR(this), this.viralToolMeasure = new WR(this), this.viralToolAmbientOcclusion = new VR(this), this.dehydratedCachedData(), this.executeToolsByDefault(), this.injectTools(), this.viralViewerApi.lifeCycleEvent.emit(Pi.LOADED_TOOLS);
42022
42031
  }
42023
42032
  //#region Init
42024
42033
  injectTools() {
@@ -42105,7 +42114,7 @@ class Q3 {
42105
42114
  }
42106
42115
  //#endregion
42107
42116
  }
42108
- const q3 = {
42117
+ const ZR = {
42109
42118
  Vector2: Se,
42110
42119
  Vector3: G,
42111
42120
  Vector4: ai,
@@ -42117,14 +42126,14 @@ const q3 = {
42117
42126
  Raycaster: fc,
42118
42127
  MathUtils: Wf
42119
42128
  };
42120
- class Z3 {
42129
+ class jR {
42121
42130
  constructor(e) {
42122
42131
  this.viralNavigationCube = e, this.camera = null, this.cameraControls = null, this.cameraControlOldPosition = new G(), this.cameraControlNewPosition = new G(), this.cameraControlHasMoved = !1, this.setupCamera(), this.setupHandle();
42123
42132
  }
42124
42133
  setupCamera() {
42125
42134
  if (this.viralNavigationCube.targetElement && this.viralNavigationCube.cubeRenderer) {
42126
42135
  const e = this.viralNavigationCube.targetElement.offsetWidth, t = this.viralNavigationCube.targetElement.offsetHeight;
42127
- this.camera = new un(60, e / t, 0.01, 100), this.camera.position.set(0, 0, 2), vs.install({ THREE: q3 }), this.cameraControls = new vs(this.camera, this.viralNavigationCube.cubeRenderer.renderer.domElement), 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 = vs.ACTION.NONE, this.cameraControls.mouseButtons.wheel = vs.ACTION.NONE;
42136
+ this.camera = new un(60, e / t, 0.01, 100), this.camera.position.set(0, 0, 2), vs.install({ THREE: ZR }), this.cameraControls = new vs(this.camera, this.viralNavigationCube.cubeRenderer.renderer.domElement), 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 = vs.ACTION.NONE, this.cameraControls.mouseButtons.wheel = vs.ACTION.NONE;
42128
42137
  }
42129
42138
  }
42130
42139
  updateCubeCamera() {
@@ -42146,7 +42155,7 @@ class Z3 {
42146
42155
  window.addEventListener("mousedown", e, !1), window.addEventListener("mousemove", t, !1), window.addEventListener("touchstart", e, !1), window.addEventListener("touchmove", t, !0);
42147
42156
  }
42148
42157
  }
42149
- class j3 {
42158
+ class KR {
42150
42159
  constructor(e) {
42151
42160
  this.viralNavigationCube = e, this.renderer = new Kf({
42152
42161
  alpha: !0,
@@ -42175,7 +42184,7 @@ class j3 {
42175
42184
  // }
42176
42185
  // }
42177
42186
  }
42178
- class K3 {
42187
+ class $R {
42179
42188
  constructor(e) {
42180
42189
  this.viralNavigationCube = e, this.scene = new wa(), this.objects = [], this.cube = null, this.activePlane = null, this.addCube(), this.addPlanes();
42181
42190
  }
@@ -42355,7 +42364,7 @@ class K3 {
42355
42364
  li.name = "corner8", li.add(O), li.add(me), li.add(Le), this.addObject(li);
42356
42365
  }
42357
42366
  }
42358
- class $3 {
42367
+ class JR {
42359
42368
  constructor(e) {
42360
42369
  this.viralNavigationCube = e, this.handleClick = async (t) => {
42361
42370
  var f, p, g, x, w, E, b, v, C, T, S, B, z, F, Q, $, O, k, le, he, J;
@@ -42421,9 +42430,9 @@ class $3 {
42421
42430
  }
42422
42431
  //#endregion
42423
42432
  }
42424
- class J3 {
42433
+ class e3 {
42425
42434
  constructor(e) {
42426
- this.viralViewerApi = e, this.targetElement = null, this.cubeScene = null, this.cubeRenderer = null, this.cubeCamera = null, this.cubeMouse = null, this.injectCubeWrapperElement(), this.targetElement = document.getElementById("orientCubeWrapper"), this.targetElement && (this.cubeScene = new K3(this), this.cubeRenderer = new j3(this), this.cubeCamera = new Z3(this), this.cubeMouse = new $3(this)), this.viralViewerApi.lifeCycleEvent.emit(Pi.LOADED_CUBE);
42435
+ this.viralViewerApi = e, this.targetElement = null, this.cubeScene = null, this.cubeRenderer = null, this.cubeCamera = null, this.cubeMouse = null, this.injectCubeWrapperElement(), this.targetElement = document.getElementById("orientCubeWrapper"), this.targetElement && (this.cubeScene = new $R(this), this.cubeRenderer = new KR(this), this.cubeCamera = new jR(this), this.cubeMouse = new JR(this)), this.viralViewerApi.lifeCycleEvent.emit(Pi.LOADED_CUBE);
42427
42436
  }
42428
42437
  injectCubeWrapperElement() {
42429
42438
  if (this.viralViewerApi.targetElement) {
@@ -42441,8 +42450,8 @@ class J3 {
42441
42450
  this.viralViewerApi.viralCamera.focusModelByName();
42442
42451
  }
42443
42452
  }
42444
- const eR = 0.064;
42445
- class tR {
42453
+ const t3 = 0.064;
42454
+ class i3 {
42446
42455
  constructor(e, t, i, s) {
42447
42456
  this.viralViewerApi = e, this.mixer = null, this.idleAnimation = null, this.walkAnimation = null, this.avatar = null, this.destination = null, this.isReady = !1, this.viralViewerApi.viralLoader.threeLoader.loadGLTF(
42448
42457
  t,
@@ -42475,7 +42484,7 @@ class tR {
42475
42484
  if (this.avatar && this.mixer) {
42476
42485
  let t = this.avatar.getObjectByName("Hips");
42477
42486
  if (this.mixer.update(e), t.position.set(0, t.position.y, 0), this.destination && this.avatar.position.distanceTo(this.destination) > 0.1) {
42478
- const i = this.avatar.position.clone().sub(this.destination).normalize().multiplyScalar(eR);
42487
+ const i = this.avatar.position.clone().sub(this.destination).normalize().multiplyScalar(t3);
42479
42488
  this.avatar.position.sub(i), this.avatar.lookAt(this.destination), this.idle();
42480
42489
  } else
42481
42490
  this.walk();
@@ -42485,12 +42494,12 @@ class tR {
42485
42494
  this.destination = e;
42486
42495
  }
42487
42496
  }
42488
- class iR {
42497
+ class n3 {
42489
42498
  constructor(e) {
42490
42499
  this.viralViewerApi = e, this.avatars = [];
42491
42500
  }
42492
42501
  load(e, t, i) {
42493
- let s = new tR(
42502
+ let s = new i3(
42494
42503
  this.viralViewerApi,
42495
42504
  e,
42496
42505
  t,
@@ -42499,7 +42508,7 @@ class iR {
42499
42508
  return this.avatars.push(s), s;
42500
42509
  }
42501
42510
  }
42502
- class yR {
42511
+ class x3 {
42503
42512
  constructor(e = {
42504
42513
  isDev: !1,
42505
42514
  cameraZUp: !1,
@@ -42508,10 +42517,10 @@ class yR {
42508
42517
  enableNavigationCube: !0,
42509
42518
  enableTools: !0
42510
42519
  }) {
42511
- this.lifeCycleEvent = new R3(), this.viralCompressProcessor = new Aw(), this.localStorageService = new pP(), this.viralStats = null, this.options = e, this.viralLifecycleEventHandler = new L3(
42520
+ this.lifeCycleEvent = new RR(), this.viralCompressProcessor = new Aw(), this.localStorageService = new pP(), this.viralStats = null, this.options = e, this.viralLifecycleEventHandler = new LR(
42512
42521
  this.lifeCycleEvent,
42513
42522
  this.options
42514
- ), this.targetElement = e.container, I3("QUICK_SAND"), D3(this.targetElement, "QUICK_SAND"), this.options.enableNavigationCube && (this.viralNavigationCube = new J3(this)), this.options.enableTools && (this.viralTools = new Q3(this)), this.viralSpinner = new F3(this), this.viralDraggableModal = new X3(this), this.viralContextMenu = new gP(this), this.viralScene = new G2(this), this.viralMaterialManager = new C3(this), this.viralRenderer = new dP(this), this.viralCamera = new O2(this), this.viralMouse = new N2(this), this.viralKeyboard = new mP(this), this.viralAnimation = new fP(this), this.viralVisibilityManager = new O3(this), this.viralCentralizedEventHandler = new yP(this), this.viralLoader = new bC(this), this.viralBVH = new P3(), this.viralDataManager = new k3(this), this.viralAvatarManager = new iR(this), this.options.isDev && (this.viralStats = new wC(this)), this.options.isDev ? this.viralAnimation.devAnimation() : this.viralAnimation.animation();
42523
+ ), this.targetElement = e.container, IR("QUICK_SAND"), DR(this.targetElement, "QUICK_SAND"), this.options.enableNavigationCube && (this.viralNavigationCube = new e3(this)), this.options.enableTools && (this.viralTools = new qR(this)), this.viralSpinner = new FR(this), this.viralDraggableModal = new XR(this), this.viralContextMenu = new gP(this), this.viralScene = new G2(this), this.viralMaterialManager = new CR(this), this.viralRenderer = new dP(this), this.viralCamera = new O2(this), this.viralMouse = new N2(this), this.viralKeyboard = new mP(this), this.viralAnimation = new fP(this), this.viralVisibilityManager = new OR(this), this.viralCentralizedEventHandler = new yP(this), this.viralLoader = new bC(this), this.viralBVH = new PR(), this.viralDataManager = new kR(this), this.viralAvatarManager = new n3(this), this.options.isDev && (this.viralStats = new wC(this)), this.options.isDev ? this.viralAnimation.devAnimation() : this.viralAnimation.animation();
42515
42524
  let t = window;
42516
42525
  t.VIRAL_VIEWER = this;
42517
42526
  }
@@ -42519,8 +42528,8 @@ class yR {
42519
42528
  export {
42520
42529
  jx as DebouncedEventHandler,
42521
42530
  Pl as Dictionary,
42522
- rR as ElementFragment,
42523
- sR as Fragment,
42531
+ a3 as ElementFragment,
42532
+ r3 as Fragment,
42524
42533
  fu as HTMLUtil,
42525
42534
  Sn as LogUtil,
42526
42535
  vn as THREEUtil,
@@ -42529,13 +42538,13 @@ export {
42529
42538
  _o as ViralKeyboardEventType,
42530
42539
  Mn as ViralMouseEventType,
42531
42540
  na as ViralPoint,
42532
- yR as ViralViewerApi,
42533
- aR as ViralViewerRevitGeometry,
42534
- nR as ViralViewerRevitNoneStructuralGeometry,
42541
+ x3 as ViralViewerApi,
42542
+ o3 as ViralViewerRevitGeometry,
42543
+ s3 as ViralViewerRevitNoneStructuralGeometry,
42535
42544
  Zx as ViralutionBox,
42536
42545
  qx as ViralutionCamera,
42537
- oR as ViralutionElement,
42546
+ l3 as ViralutionElement,
42538
42547
  Pi as ViralutionEvent,
42539
- lR as ViralutionSolid,
42540
- cR as ViralutionTrackingModel
42548
+ c3 as ViralutionSolid,
42549
+ h3 as ViralutionTrackingModel
42541
42550
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viral-viewer-2",
3
- "version": "6.4.2",
3
+ "version": "6.4.3",
4
4
  "description": "",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",