@thatopen/components 2.0.0-alpha.8 → 2.0.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3,9 +3,9 @@ var zn = (l, s, t) => s in l ? Gn(l, s, { enumerable: !0, configurable: !0, writ
3
3
  var I = (l, s, t) => (zn(l, typeof s != "symbol" ? s + "" : s, t), t);
4
4
  import * as O from "three";
5
5
  import { BufferAttribute as Sn, Vector3 as w, Vector2 as pe, Plane as mi, Line3 as Lt, Triangle as Ie, Sphere as Hn, Matrix4 as wt, Box3 as Ot, BackSide as kn, DoubleSide as _n, FrontSide as Li, Mesh as v, Ray as Wn, Raycaster as Xn, Quaternion as Pt, Object3D as ii, Euler as Zn, MeshBasicMaterial as Nn, LineBasicMaterial as Qn, CylinderGeometry as lt, BoxGeometry as rt, BufferGeometry as wi, Float32BufferAttribute as Mi, OctahedronGeometry as je, Line as Ut, SphereGeometry as jn, TorusGeometry as Re, PlaneGeometry as qn } from "three";
6
- import * as x from "web-ifc";
7
- import * as $t from "@thatopen/fragments";
6
+ import * as Gt from "@thatopen/fragments";
8
7
  import { Serializer as $n } from "@thatopen/fragments";
8
+ import * as x from "web-ifc";
9
9
  const yn = 0, Kn = 1, Jn = 2, Di = 2, bs = 1.25, Ui = 1, ms = 6 * 4 + 4 + 4, ws = 65535, to = Math.pow(2, -24), vs = Symbol("SKIP_GENERATION");
10
10
  function eo(l) {
11
11
  return l.index ? l.index.count : l.attributes.position.count;
@@ -960,7 +960,7 @@ function Po(l, s = null) {
960
960
  }
961
961
  }
962
962
  const Gi = /* @__PURE__ */ new Ot();
963
- function Gt(l, s, t, e) {
963
+ function zt(l, s, t, e) {
964
964
  return $(l, s, Gi), t.intersectBox(Gi, e);
965
965
  }
966
966
  function Lo(l, s, t, e, i, o) {
@@ -999,9 +999,9 @@ function oi(l, s, t, e, i) {
999
999
  _o(s, t, e, E, d, i);
1000
1000
  } else {
1001
1001
  const E = pt(l);
1002
- Gt(E, o, e, zi) && oi(E, s, t, e, i);
1002
+ zt(E, o, e, zi) && oi(E, s, t, e, i);
1003
1003
  const d = Ct(l, r);
1004
- Gt(d, o, e, zi) && oi(d, s, t, e, i);
1004
+ zt(d, o, e, zi) && oi(d, s, t, e, i);
1005
1005
  }
1006
1006
  }
1007
1007
  const Hi = /* @__PURE__ */ new w(), Uo = ["x", "y", "z"];
@@ -1020,7 +1020,7 @@ function ri(l, s, t, e) {
1020
1020
  const c = wn(l, n), E = Uo[c], h = e.direction[E] >= 0;
1021
1021
  let u, p;
1022
1022
  h ? (u = pt(l), p = Ct(l, n)) : (u = Ct(l, n), p = pt(l));
1023
- const A = Gt(u, i, e, Hi) ? ri(u, s, t, e) : null;
1023
+ const A = zt(u, i, e, Hi) ? ri(u, s, t, e) : null;
1024
1024
  if (A) {
1025
1025
  const F = A.point[E];
1026
1026
  if (h ? F <= i[p + c] : (
@@ -1029,7 +1029,7 @@ function ri(l, s, t, e) {
1029
1029
  ))
1030
1030
  return A;
1031
1031
  }
1032
- const m = Gt(p, i, e, Hi) ? ri(p, s, t, e) : null;
1032
+ const m = zt(p, i, e, Hi) ? ri(p, s, t, e) : null;
1033
1033
  return A && m ? A.distance <= m.distance ? A : m : A || m || null;
1034
1034
  }
1035
1035
  }
@@ -1162,9 +1162,9 @@ function ci(l, s, t, e, i) {
1162
1162
  Lo(s, t, e, E, d, i);
1163
1163
  } else {
1164
1164
  const E = pt(l);
1165
- Gt(E, o, e, Wi) && ci(E, s, t, e, i);
1165
+ zt(E, o, e, Wi) && ci(E, s, t, e, i);
1166
1166
  const d = Ct(l, r);
1167
- Gt(d, o, e, Wi) && ci(d, s, t, e, i);
1167
+ zt(d, o, e, Wi) && ci(d, s, t, e, i);
1168
1168
  }
1169
1169
  }
1170
1170
  const Xi = /* @__PURE__ */ new w(), ko = ["x", "y", "z"];
@@ -1183,7 +1183,7 @@ function li(l, s, t, e) {
1183
1183
  const c = wn(l, n), E = ko[c], h = e.direction[E] >= 0;
1184
1184
  let u, p;
1185
1185
  h ? (u = pt(l), p = Ct(l, n)) : (u = Ct(l, n), p = pt(l));
1186
- const A = Gt(u, i, e, Xi) ? li(u, s, t, e) : null;
1186
+ const A = zt(u, i, e, Xi) ? li(u, s, t, e) : null;
1187
1187
  if (A) {
1188
1188
  const F = A.point[E];
1189
1189
  if (h ? F <= i[p + c] : (
@@ -1192,7 +1192,7 @@ function li(l, s, t, e) {
1192
1192
  ))
1193
1193
  return A;
1194
1194
  }
1195
- const m = Gt(p, i, e, Xi) ? li(p, s, t, e) : null;
1195
+ const m = zt(p, i, e, Xi) ? li(p, s, t, e) : null;
1196
1196
  return A && m ? A.distance <= m.distance ? A : m : A || m || null;
1197
1197
  }
1198
1198
  }
@@ -1931,7 +1931,7 @@ const ve = class ve extends J {
1931
1931
  }
1932
1932
  };
1933
1933
  I(ve, "uuid", "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");
1934
- let zt = ve;
1934
+ let Ht = ve;
1935
1935
  class rr extends Oi {
1936
1936
  constructor(t) {
1937
1937
  super(t);
@@ -1940,7 +1940,7 @@ class rr extends Oi {
1940
1940
  }
1941
1941
  /** {@link Disposable.dispose} */
1942
1942
  dispose() {
1943
- const t = this.components.get(zt);
1943
+ const t = this.components.get(Ht);
1944
1944
  for (const e of this.three.children) {
1945
1945
  const i = e;
1946
1946
  i.geometry && t.destroy(i);
@@ -2346,8 +2346,8 @@ function Ir(l, s) {
2346
2346
  function fr(l) {
2347
2347
  const s = [];
2348
2348
  for (let it = 0; it < l.length - 2; it += 3) {
2349
- const Xt = l[it], tt = l[it + 1], Jt = l[it + 2];
2350
- s.push(new O.Vector3(Xt, tt, Jt));
2349
+ const Zt = l[it], tt = l[it + 1], Jt = l[it + 2];
2350
+ s.push(new O.Vector3(Zt, tt, Jt));
2351
2351
  }
2352
2352
  const t = new lr();
2353
2353
  t.setFromPoints(s);
@@ -2355,7 +2355,7 @@ function fr(l) {
2355
2355
  unitary: new O.Matrix3(),
2356
2356
  diagonal: new O.Matrix3()
2357
2357
  }, i = t.faces, o = [], n = [];
2358
- for (let it = 0, Xt = i.length; it < Xt; it++) {
2358
+ for (let it = 0, Zt = i.length; it < Zt; it++) {
2359
2359
  const tt = i[it];
2360
2360
  let Jt = tt.edge;
2361
2361
  o.length = 0;
@@ -2370,7 +2370,7 @@ function fr(l) {
2370
2370
  }
2371
2371
  const r = new O.Vector3(), a = new O.Vector3(), c = new O.Vector3(), E = new O.Vector3(), d = new O.Vector3(), h = new O.Vector3(), u = new O.Vector3(), p = new O.Vector3();
2372
2372
  let T = 0, A = 0, C = 0, m = 0, F = 0, f = 0, R = 0;
2373
- for (let it = 0, Xt = n.length; it < Xt; it += 9) {
2373
+ for (let it = 0, Zt = n.length; it < Zt; it += 9) {
2374
2374
  r.fromArray(n, it), a.fromArray(n, it + 3), c.fromArray(n, it + 6), u.set(0, 0, 0), u.add(r).add(a).add(c).divideScalar(3), E.subVectors(a, r), d.subVectors(c, r);
2375
2375
  const tt = h.crossVectors(E, d).length() / 2;
2376
2376
  p.add(h.copy(u).multiplyScalar(tt)), T += tt, A += (9 * u.x * u.x + r.x * r.x + a.x * a.x + c.x * c.x) * (tt / 12), C += (9 * u.x * u.y + r.x * r.y + a.x * a.y + c.x * c.y) * (tt / 12), m += (9 * u.x * u.z + r.x * r.z + a.x * a.z + c.x * c.z) * (tt / 12), F += (9 * u.y * u.y + r.y * r.y + a.y * a.y + c.y * c.y) * (tt / 12), f += (9 * u.y * u.z + r.y * r.z + a.y * a.z + c.y * c.z) * (tt / 12), R += (9 * u.z * u.z + r.z * r.z + a.z * a.z + c.z * c.z) * (tt / 12);
@@ -2381,17 +2381,17 @@ function fr(l) {
2381
2381
  const S = e.unitary, _ = new O.Vector3(), N = new O.Vector3(), P = new O.Vector3();
2382
2382
  S.extractBasis(_, N, P);
2383
2383
  let M = -1 / 0, L = -1 / 0, U = -1 / 0, b = 1 / 0, B = 1 / 0, H = 1 / 0;
2384
- for (let it = 0, Xt = s.length; it < Xt; it++) {
2384
+ for (let it = 0, Zt = s.length; it < Zt; it++) {
2385
2385
  const tt = s[it];
2386
2386
  M = Math.max(_.dot(tt), M), L = Math.max(N.dot(tt), L), U = Math.max(P.dot(tt), U), b = Math.min(_.dot(tt), b), B = Math.min(N.dot(tt), B), H = Math.min(P.dot(tt), H);
2387
2387
  }
2388
2388
  _.multiplyScalar(0.5 * (b + M)), N.multiplyScalar(0.5 * (B + L)), P.multiplyScalar(0.5 * (H + U));
2389
2389
  const q = new O.Vector3(), st = new O.Vector3(), Q = new O.Matrix3();
2390
2390
  q.add(_).add(N).add(P), st.x = M - b, st.y = L - B, st.z = U - H, st.multiplyScalar(0.5), Q.copy(S);
2391
- const { x: Ht, y: kt, z: Wt } = st, Ze = new O.Matrix4();
2392
- Ze.makeScale(Ht * 2, kt * 2, Wt * 2);
2391
+ const { x: kt, y: Wt, z: Xt } = st, Ze = new O.Matrix4();
2392
+ Ze.makeScale(kt * 2, Wt * 2, Xt * 2);
2393
2393
  const Te = new O.Matrix4();
2394
- Te.makeTranslation(-Ht, -kt, -Wt);
2394
+ Te.makeTranslation(-kt, -Wt, -Xt);
2395
2395
  const yi = new O.Matrix4();
2396
2396
  yi.makeTranslation(q.x, q.y, q.z);
2397
2397
  const Pi = new O.Matrix4();
@@ -3009,7 +3009,7 @@ class mr extends gi {
3009
3009
  }
3010
3010
  dispose(t = !0) {
3011
3011
  if (this.enabled = !1, this.scene.onWorldChanged.trigger({ world: this, action: "removed" }), this.camera.onWorldChanged.trigger({ world: this, action: "removed" }), this.renderer && this.renderer.onWorldChanged.trigger({ world: this, action: "removed" }), t) {
3012
- const e = this.components.get(zt);
3012
+ const e = this.components.get(Ht);
3013
3013
  this.scene.dispose(), this.camera.isDisposeable() && this.camera.dispose(), this.renderer && this.renderer.dispose();
3014
3014
  for (const i of this.meshes)
3015
3015
  e.destroy(i);
@@ -3155,7 +3155,7 @@ const V = {
3155
3155
  IN: 1,
3156
3156
  OUT: -1
3157
3157
  };
3158
- function Zt(l) {
3158
+ function Qt(l) {
3159
3159
  return l.isPerspectiveCamera;
3160
3160
  }
3161
3161
  function vt(l) {
@@ -3279,7 +3279,7 @@ class Rr {
3279
3279
  }
3280
3280
  }
3281
3281
  const Ar = "2.7.3", us = 1 / 8, Dn = typeof window < "u", Fr = Dn && /Mac/.test(navigator.platform), gr = !(Dn && "PointerEvent" in window);
3282
- let Y, on, Is, $s, ht, G, z, de, Le, St, _t, Qt, rn, an, ut, we, ue, cn, Ks, ln, Js, ti, fs;
3282
+ let Y, on, Is, $s, ht, G, z, de, Le, St, _t, jt, rn, an, ut, we, ue, cn, Ks, ln, Js, ti, fs;
3283
3283
  class ot extends Rr {
3284
3284
  /**
3285
3285
  * Injects THREE as the dependency. You can then proceed to use CameraControls.
@@ -3322,7 +3322,7 @@ class ot extends Rr {
3322
3322
  * @category Statics
3323
3323
  */
3324
3324
  static install(s) {
3325
- Y = s.THREE, on = Object.freeze(new Y.Vector3(0, 0, 0)), Is = Object.freeze(new Y.Vector3(0, 1, 0)), $s = Object.freeze(new Y.Vector3(0, 0, 1)), ht = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), de = new Y.Vector3(), Le = new Y.Vector3(), St = new Y.Vector3(), _t = new Y.Vector3(), Qt = new Y.Vector3(), rn = new Y.Vector3(), an = new Y.Vector3(), ut = new Y.Spherical(), we = new Y.Spherical(), ue = new Y.Box3(), cn = new Y.Box3(), Ks = new Y.Sphere(), ln = new Y.Quaternion(), Js = new Y.Quaternion(), ti = new Y.Matrix4(), fs = new Y.Raycaster();
3325
+ Y = s.THREE, on = Object.freeze(new Y.Vector3(0, 0, 0)), Is = Object.freeze(new Y.Vector3(0, 1, 0)), $s = Object.freeze(new Y.Vector3(0, 0, 1)), ht = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), de = new Y.Vector3(), Le = new Y.Vector3(), St = new Y.Vector3(), _t = new Y.Vector3(), jt = new Y.Vector3(), rn = new Y.Vector3(), an = new Y.Vector3(), ut = new Y.Spherical(), we = new Y.Spherical(), ue = new Y.Box3(), cn = new Y.Box3(), Ks = new Y.Sphere(), ln = new Y.Quaternion(), Js = new Y.Quaternion(), ti = new Y.Matrix4(), fs = new Y.Raycaster();
3326
3326
  }
3327
3327
  /**
3328
3328
  * list all ACTIONs
@@ -3352,7 +3352,7 @@ class ot extends Rr {
3352
3352
  super(), this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.minDistance = Number.EPSILON, this.maxDistance = 1 / 0, this.infinityDolly = !1, this.minZoom = 0.01, this.maxZoom = 1 / 0, this.smoothTime = 0.25, this.draggingSmoothTime = 0.125, this.maxSpeed = 1 / 0, this.azimuthRotateSpeed = 1, this.polarRotateSpeed = 1, this.dollySpeed = 1, this.dollyDragInverted = !1, this.truckSpeed = 2, this.dollyToCursor = !1, this.dragToOffset = !1, this.verticalDragToForward = !1, this.boundaryFriction = 0, this.restThreshold = 0.01, this.colliderMeshes = [], this.cancel = () => {
3353
3353
  }, this._enabled = !0, this._state = y.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = he.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new Y.Vector3(), this._focalOffsetVelocity = new Y.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (f, R, g) => {
3354
3354
  let S, _;
3355
- if (Zt(this._camera)) {
3355
+ if (Qt(this._camera)) {
3356
3356
  const N = G.copy(this._camera.position).sub(this._target), P = this._camera.getEffectiveFOV() * Ne, M = N.length() * Math.tan(P * 0.5);
3357
3357
  S = this.truckSpeed * f * M / this._elementRect.height, _ = this.truckSpeed * R * M / this._elementRect.height;
3358
3358
  } else if (vt(this._camera)) {
@@ -3379,10 +3379,10 @@ class ot extends Rr {
3379
3379
  left: y.ROTATE,
3380
3380
  middle: y.DOLLY,
3381
3381
  right: y.TRUCK,
3382
- wheel: Zt(this._camera) ? y.DOLLY : vt(this._camera) ? y.ZOOM : y.NONE
3382
+ wheel: Qt(this._camera) ? y.DOLLY : vt(this._camera) ? y.ZOOM : y.NONE
3383
3383
  }, this.touches = {
3384
3384
  one: y.TOUCH_ROTATE,
3385
- two: Zt(this._camera) ? y.TOUCH_DOLLY_TRUCK : vt(this._camera) ? y.TOUCH_ZOOM_TRUCK : y.NONE,
3385
+ two: Qt(this._camera) ? y.TOUCH_DOLLY_TRUCK : vt(this._camera) ? y.TOUCH_ZOOM_TRUCK : y.NONE,
3386
3386
  three: y.TOUCH_TRUCK
3387
3387
  };
3388
3388
  const e = new Y.Vector2(), i = new Y.Vector2(), o = new Y.Vector2(), n = (f) => {
@@ -3965,7 +3965,7 @@ class ot extends Rr {
3965
3965
  const T = cn.makeEmpty();
3966
3966
  z.copy(c.min).applyQuaternion(u), T.expandByPoint(z), z.copy(c.min).setX(c.max.x).applyQuaternion(u), T.expandByPoint(z), z.copy(c.min).setY(c.max.y).applyQuaternion(u), T.expandByPoint(z), z.copy(c.max).setZ(c.min.z).applyQuaternion(u), T.expandByPoint(z), z.copy(c.min).setZ(c.max.z).applyQuaternion(u), T.expandByPoint(z), z.copy(c.max).setY(c.min.y).applyQuaternion(u), T.expandByPoint(z), z.copy(c.max).setX(c.min.x).applyQuaternion(u), T.expandByPoint(z), z.copy(c.max).applyQuaternion(u), T.expandByPoint(z), T.min.x -= i, T.min.y -= n, T.max.x += o, T.max.y += r, u.setFromUnitVectors($s, h), p && u.premultiply(Js.invert()), u.premultiply(this._yAxisUpSpace);
3967
3967
  const A = T.getSize(G), C = T.getCenter(z).applyQuaternion(u);
3968
- if (Zt(this._camera)) {
3968
+ if (Qt(this._camera)) {
3969
3969
  const m = this.getDistanceToFitBox(A.x, A.y, A.z, e);
3970
3970
  a.push(this.moveTo(C.x, C.y, C.z, t)), a.push(this.dollyTo(m, t)), a.push(this.setFocalOffset(0, 0, 0, t));
3971
3971
  } else if (vt(this._camera)) {
@@ -3982,7 +3982,7 @@ class ot extends Rr {
3982
3982
  */
3983
3983
  fitToSphere(s, t) {
3984
3984
  const e = [], o = s instanceof Y.Sphere ? Ks.copy(s) : ot.createBoundingSphere(s, Ks);
3985
- if (e.push(this.moveTo(o.center.x, o.center.y, o.center.z, t)), Zt(this._camera)) {
3985
+ if (e.push(this.moveTo(o.center.x, o.center.y, o.center.z, t)), Qt(this._camera)) {
3986
3986
  const n = this.getDistanceToFitSphere(o.radius);
3987
3987
  e.push(this.dollyTo(n, t));
3988
3988
  } else if (vt(this._camera)) {
@@ -4085,9 +4085,9 @@ class ot extends Rr {
4085
4085
  * @category Methods
4086
4086
  */
4087
4087
  setOrbitPoint(s, t, e) {
4088
- this._camera.updateMatrixWorld(), St.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), _t.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), Qt.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
4088
+ this._camera.updateMatrixWorld(), St.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), _t.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), jt.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
4089
4089
  const i = G.set(s, t, e), o = i.distanceTo(this._camera.position), n = i.sub(this._camera.position);
4090
- St.multiplyScalar(n.x), _t.multiplyScalar(n.y), Qt.multiplyScalar(n.z), G.copy(St).add(_t).add(Qt), G.z = G.z + o, this.dollyTo(o, !1), this.setFocalOffset(-G.x, G.y, -G.z, !1), this.moveTo(s, t, e, !1);
4090
+ St.multiplyScalar(n.x), _t.multiplyScalar(n.y), jt.multiplyScalar(n.z), G.copy(St).add(_t).add(jt), G.z = G.z + o, this.dollyTo(o, !1), this.setFocalOffset(-G.x, G.y, -G.z, !1), this.moveTo(s, t, e, !1);
4091
4091
  }
4092
4092
  /**
4093
4093
  * Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
@@ -4276,7 +4276,7 @@ class ot extends Rr {
4276
4276
  this._zoom = ds(this._zoom, this._zoomEnd, this._zoomVelocity, d, 1 / 0, s);
4277
4277
  }
4278
4278
  if (this.dollyToCursor) {
4279
- if (Zt(this._camera) && this._changedDolly !== 0) {
4279
+ if (Qt(this._camera) && this._changedDolly !== 0) {
4280
4280
  const d = this._spherical.radius - this._lastDistance, h = this._camera, u = this._getCameraDirection(Le), p = G.copy(u).cross(h.up).normalize();
4281
4281
  p.lengthSq() === 0 && (p.x = 1);
4282
4282
  const T = z.crossVectors(p, u), A = this._sphericalEnd.radius * Math.tan(h.getEffectiveFOV() * Ne * 0.5), m = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = de.copy(this._targetEnd).add(p.multiplyScalar(this._dollyControlCoord.x * A * h.aspect)).add(T.multiplyScalar(this._dollyControlCoord.y * A)), f = G.copy(this._targetEnd).lerp(F, m), R = this._lastDollyDirection === he.IN && this._spherical.radius <= this.minDistance, g = this._lastDollyDirection === he.OUT && this.maxDistance <= this._spherical.radius;
@@ -4297,7 +4297,7 @@ class ot extends Rr {
4297
4297
  }
4298
4298
  this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
4299
4299
  const a = this._collisionTest();
4300
- this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), St.setFromMatrixColumn(this._camera.matrix, 0), _t.setFromMatrixColumn(this._camera.matrix, 1), Qt.setFromMatrixColumn(this._camera.matrix, 2), St.multiplyScalar(this._focalOffset.x), _t.multiplyScalar(-this._focalOffset.y), Qt.multiplyScalar(this._focalOffset.z), G.copy(St).add(_t).add(Qt), this._camera.position.add(G)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), G.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
4300
+ this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), St.setFromMatrixColumn(this._camera.matrix, 0), _t.setFromMatrixColumn(this._camera.matrix, 1), jt.setFromMatrixColumn(this._camera.matrix, 2), St.multiplyScalar(this._focalOffset.x), _t.multiplyScalar(-this._focalOffset.y), jt.multiplyScalar(this._focalOffset.z), G.copy(St).add(_t).add(jt), this._camera.position.add(G)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), G.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
4301
4301
  const E = this._needsUpdate;
4302
4302
  return E && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : E ? (this.dispatchEvent({ type: "update" }), X(t, this.restThreshold) && X(e, this.restThreshold) && X(i, this.restThreshold) && X(o.x, this.restThreshold) && X(o.y, this.restThreshold) && X(o.z, this.restThreshold) && X(n.x, this.restThreshold) && X(n.y, this.restThreshold) && X(n.z, this.restThreshold) && X(r, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !E && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = E, this._needsUpdate = !1, E;
4303
4303
  }
@@ -4400,7 +4400,7 @@ class ot extends Rr {
4400
4400
  }
4401
4401
  }
4402
4402
  _updateNearPlaneCorners() {
4403
- if (Zt(this._camera)) {
4403
+ if (Qt(this._camera)) {
4404
4404
  const s = this._camera, t = s.near, e = s.getEffectiveFOV() * Ne, i = Math.tan(e * 0.5) * t, o = i * s.aspect;
4405
4405
  this._nearPlaneCorners[0].set(-o, -i, 0), this._nearPlaneCorners[1].set(o, -i, 0), this._nearPlaneCorners[2].set(o, i, 0), this._nearPlaneCorners[3].set(-o, i, 0);
4406
4406
  } else if (vt(this._camera)) {
@@ -4768,7 +4768,7 @@ class Or {
4768
4768
  }
4769
4769
  /** {@link Disposable.dispose} */
4770
4770
  dispose() {
4771
- this.setupEvents(!1), this.components.get(zt).destroy(this._grid), this.onDisposed.trigger(), this.onDisposed.reset(), this.world = null, this.components = null;
4771
+ this.setupEvents(!1), this.components.get(Ht).destroy(this._grid), this.onDisposed.trigger(), this.onDisposed.reset(), this.world = null, this.components = null;
4772
4772
  }
4773
4773
  setupEvents(s) {
4774
4774
  if (!(this.world.camera instanceof Xe))
@@ -4810,7 +4810,7 @@ class Sr extends J {
4810
4810
  }
4811
4811
  }
4812
4812
  I(Sr, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
4813
- const jt = new Xn(), nt = new w(), bt = new w(), j = new Pt(), hn = {
4813
+ const qt = new Xn(), nt = new w(), bt = new w(), j = new Pt(), hn = {
4814
4814
  X: new w(1, 0, 0),
4815
4815
  Y: new w(0, 1, 0),
4816
4816
  Z: new w(0, 0, 1)
@@ -4845,14 +4845,14 @@ class _r extends ii {
4845
4845
  pointerHover(s) {
4846
4846
  if (this.object === void 0 || this.dragging === !0)
4847
4847
  return;
4848
- jt.setFromCamera(s, this.camera);
4849
- const t = si(this._gizmo.picker[this.mode], jt);
4848
+ qt.setFromCamera(s, this.camera);
4849
+ const t = si(this._gizmo.picker[this.mode], qt);
4850
4850
  t ? this.axis = t.object.name : this.axis = null;
4851
4851
  }
4852
4852
  pointerDown(s) {
4853
4853
  if (!(this.object === void 0 || this.dragging === !0 || s.button !== 0) && this.axis !== null) {
4854
- jt.setFromCamera(s, this.camera);
4855
- const t = si(this._plane, jt, !0);
4854
+ qt.setFromCamera(s, this.camera);
4855
+ const t = si(this._plane, qt, !0);
4856
4856
  t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, En.mode = this.mode, this.dispatchEvent(En);
4857
4857
  }
4858
4858
  }
@@ -4861,8 +4861,8 @@ class _r extends ii {
4861
4861
  let o = this.space;
4862
4862
  if (e === "scale" ? o = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (o = "world"), i === void 0 || t === null || this.dragging === !1 || s.button !== -1)
4863
4863
  return;
4864
- jt.setFromCamera(s, this.camera);
4865
- const n = si(this._plane, jt, !0);
4864
+ qt.setFromCamera(s, this.camera);
4865
+ const n = si(this._plane, qt, !0);
4866
4866
  if (n) {
4867
4867
  if (this.pointEnd.copy(n.point).sub(this.worldPositionStart), e === "translate")
4868
4868
  this._offset.copy(this.pointEnd).sub(this.pointStart), o === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), o === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), i.position.copy(this._offset).add(this._positionStart), this.translationSnap && (o === "local" && (i.position.applyQuaternion(j.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (i.position.x = Math.round(i.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (i.position.y = Math.round(i.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (i.position.z = Math.round(i.position.z / this.translationSnap) * this.translationSnap), i.position.applyQuaternion(this._quaternionStart)), o === "world" && (i.parent && i.position.add(nt.setFromMatrixPosition(i.parent.matrixWorld)), t.search("X") !== -1 && (i.position.x = Math.round(i.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (i.position.y = Math.round(i.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (i.position.z = Math.round(i.position.z / this.translationSnap) * this.translationSnap), i.parent && i.position.sub(nt.setFromMatrixPosition(i.parent.matrixWorld))));
@@ -4902,7 +4902,7 @@ class _r extends ii {
4902
4902
  this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(ei), this.dispatchEvent(un), this.pointStart.copy(this.pointEnd));
4903
4903
  }
4904
4904
  getRaycaster() {
4905
- return jt;
4905
+ return qt;
4906
4906
  }
4907
4907
  // TODO: deprecate
4908
4908
  getMode() {
@@ -4968,7 +4968,7 @@ function si(l, s, t) {
4968
4968
  return e[i];
4969
4969
  return !1;
4970
4970
  }
4971
- const ps = new Zn(), W = new w(0, 1, 0), In = new w(0, 0, 0), fn = new wt(), Cs = new Pt(), As = new Pt(), Nt = new w(), pn = new wt(), Ue = new w(1, 0, 0), qt = new w(0, 1, 0), xe = new w(0, 0, 1), Ts = new w(), Me = new w(), De = new w();
4971
+ const ps = new Zn(), W = new w(0, 1, 0), In = new w(0, 0, 0), fn = new wt(), Cs = new Pt(), As = new Pt(), Nt = new w(), pn = new wt(), Ue = new w(1, 0, 0), $t = new w(0, 1, 0), xe = new w(0, 0, 1), Ts = new w(), Me = new w(), De = new w();
4972
4972
  class Mr extends ii {
4973
4973
  constructor() {
4974
4974
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
@@ -5198,8 +5198,8 @@ class Mr extends ii {
5198
5198
  const H = new ii();
5199
5199
  for (const q in B)
5200
5200
  for (let st = B[q].length; st--; ) {
5201
- const Q = B[q][st][0].clone(), Ht = B[q][st][1], kt = B[q][st][2], Wt = B[q][st][3], Ze = B[q][st][4];
5202
- Q.name = q, Q.tag = Ze, Ht && Q.position.set(Ht[0], Ht[1], Ht[2]), kt && Q.rotation.set(kt[0], kt[1], kt[2]), Wt && Q.scale.set(Wt[0], Wt[1], Wt[2]), Q.updateMatrix();
5201
+ const Q = B[q][st][0].clone(), kt = B[q][st][1], Wt = B[q][st][2], Xt = B[q][st][3], Ze = B[q][st][4];
5202
+ Q.name = q, Q.tag = Ze, kt && Q.position.set(kt[0], kt[1], kt[2]), Wt && Q.rotation.set(Wt[0], Wt[1], Wt[2]), Xt && Q.scale.set(Xt[0], Xt[1], Xt[2]), Q.updateMatrix();
5203
5203
  const Te = Q.geometry.clone();
5204
5204
  Te.applyMatrix4(Q.matrix), Q.geometry = Te, Q.renderOrder = 1 / 0, Q.position.set(0, 0, 0), Q.rotation.set(0, 0, 0), Q.scale.set(1, 1, 1), H.add(Q);
5205
5205
  }
@@ -5218,10 +5218,10 @@ class Mr extends ii {
5218
5218
  n.visible = !0, n.rotation.set(0, 0, 0), n.position.copy(this.worldPosition);
5219
5219
  let r;
5220
5220
  if (this.camera.isOrthographicCamera ? r = (this.camera.top - this.camera.bottom) / this.camera.zoom : r = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), n.scale.set(1, 1, 1).multiplyScalar(r * this.size / 4), n.tag === "helper") {
5221
- n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(ps.set(0, 0, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Y" && (j.setFromEuler(ps.set(0, 0, Math.PI / 2)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(qt).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (j.setFromEuler(ps.set(0, Math.PI / 2, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "XYZE" && (j.setFromEuler(ps.set(0, Math.PI / 2, 0)), W.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(fn.lookAt(In, W, qt)), n.quaternion.multiply(j), n.visible = this.dragging), this.axis === "E" && (n.visible = !1)) : n.name === "START" ? (n.position.copy(this.worldPositionStart), n.visible = this.dragging) : n.name === "END" ? (n.position.copy(this.worldPosition), n.visible = this.dragging) : n.name === "DELTA" ? (n.position.copy(this.worldPositionStart), n.quaternion.copy(this.worldQuaternionStart), nt.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), nt.applyQuaternion(this.worldQuaternionStart.clone().invert()), n.scale.copy(nt), n.visible = this.dragging) : (n.quaternion.copy(e), this.dragging ? n.position.copy(this.worldPositionStart) : n.position.copy(this.worldPosition), this.axis && (n.visible = this.axis.search(n.name) !== -1));
5221
+ n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(ps.set(0, 0, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Y" && (j.setFromEuler(ps.set(0, 0, Math.PI / 2)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy($t).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (j.setFromEuler(ps.set(0, Math.PI / 2, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "XYZE" && (j.setFromEuler(ps.set(0, Math.PI / 2, 0)), W.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(fn.lookAt(In, W, $t)), n.quaternion.multiply(j), n.visible = this.dragging), this.axis === "E" && (n.visible = !1)) : n.name === "START" ? (n.position.copy(this.worldPositionStart), n.visible = this.dragging) : n.name === "END" ? (n.position.copy(this.worldPosition), n.visible = this.dragging) : n.name === "DELTA" ? (n.position.copy(this.worldPositionStart), n.quaternion.copy(this.worldQuaternionStart), nt.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), nt.applyQuaternion(this.worldQuaternionStart.clone().invert()), n.scale.copy(nt), n.visible = this.dragging) : (n.quaternion.copy(e), this.dragging ? n.position.copy(this.worldPositionStart) : n.position.copy(this.worldPosition), this.axis && (n.visible = this.axis.search(n.name) !== -1));
5222
5222
  continue;
5223
5223
  }
5224
- n.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Y" && Math.abs(W.copy(qt).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Z" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XY" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "YZ" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XZ" && Math.abs(W.copy(qt).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (Cs.copy(e), W.copy(this.eye).applyQuaternion(j.copy(e).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(fn.lookAt(this.eye, In, qt)), n.name === "X" && (j.setFromAxisAngle(Ue, Math.atan2(-W.y, W.z)), j.multiplyQuaternions(Cs, j), n.quaternion.copy(j)), n.name === "Y" && (j.setFromAxisAngle(qt, Math.atan2(W.x, W.z)), j.multiplyQuaternions(Cs, j), n.quaternion.copy(j)), n.name === "Z" && (j.setFromAxisAngle(xe, Math.atan2(W.y, W.x)), j.multiplyQuaternions(Cs, j), n.quaternion.copy(j))), n.visible = n.visible && (n.name.indexOf("X") === -1 || this.showX), n.visible = n.visible && (n.name.indexOf("Y") === -1 || this.showY), n.visible = n.visible && (n.name.indexOf("Z") === -1 || this.showZ), n.visible = n.visible && (n.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), n.material._color = n.material._color || n.material.color.clone(), n.material._opacity = n.material._opacity || n.material.opacity, n.material.color.copy(n.material._color), n.material.opacity = n.material._opacity, this.enabled && this.axis && (n.name === this.axis || this.axis.split("").some(function(a) {
5224
+ n.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Y" && Math.abs(W.copy($t).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Z" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XY" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "YZ" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XZ" && Math.abs(W.copy($t).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (Cs.copy(e), W.copy(this.eye).applyQuaternion(j.copy(e).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(fn.lookAt(this.eye, In, $t)), n.name === "X" && (j.setFromAxisAngle(Ue, Math.atan2(-W.y, W.z)), j.multiplyQuaternions(Cs, j), n.quaternion.copy(j)), n.name === "Y" && (j.setFromAxisAngle($t, Math.atan2(W.x, W.z)), j.multiplyQuaternions(Cs, j), n.quaternion.copy(j)), n.name === "Z" && (j.setFromAxisAngle(xe, Math.atan2(W.y, W.x)), j.multiplyQuaternions(Cs, j), n.quaternion.copy(j))), n.visible = n.visible && (n.name.indexOf("X") === -1 || this.showX), n.visible = n.visible && (n.name.indexOf("Y") === -1 || this.showY), n.visible = n.visible && (n.name.indexOf("Z") === -1 || this.showZ), n.visible = n.visible && (n.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), n.material._color = n.material._color || n.material.color.clone(), n.material._opacity = n.material._opacity || n.material.opacity, n.material.color.copy(n.material._color), n.material.opacity = n.material._opacity, this.enabled && this.axis && (n.name === this.axis || this.axis.split("").some(function(a) {
5225
5225
  return n.name === a;
5226
5226
  })) && (n.material.color.setHex(16776960), n.material.opacity = 1);
5227
5227
  }
@@ -5237,7 +5237,7 @@ class Dr extends v {
5237
5237
  }
5238
5238
  updateMatrixWorld(s) {
5239
5239
  let t = this.space;
5240
- switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Ts.copy(Ue).applyQuaternion(t === "local" ? this.worldQuaternion : As), Me.copy(qt).applyQuaternion(t === "local" ? this.worldQuaternion : As), De.copy(xe).applyQuaternion(t === "local" ? this.worldQuaternion : As), W.copy(Me), this.mode) {
5240
+ switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Ts.copy(Ue).applyQuaternion(t === "local" ? this.worldQuaternion : As), Me.copy($t).applyQuaternion(t === "local" ? this.worldQuaternion : As), De.copy(xe).applyQuaternion(t === "local" ? this.worldQuaternion : As), W.copy(Me), this.mode) {
5241
5241
  case "translate":
5242
5242
  case "scale":
5243
5243
  switch (this.axis) {
@@ -5876,7 +5876,7 @@ class Br extends vr {
5876
5876
  }
5877
5877
  dispose() {
5878
5878
  super.dispose(), this._intervalID !== null && (window.clearInterval(this._intervalID), this._intervalID = null), this._currentVisibleMeshes.clear(), this._recentlyHiddenMeshes.clear(), this._meshIDColorCodeMap.clear(), this._transparentMat.dispose(), this._colorCodeMeshMap.clear();
5879
- const t = this.components.get(zt);
5879
+ const t = this.components.get(Ht);
5880
5880
  for (const e in this.colorMeshes) {
5881
5881
  const i = this.colorMeshes.get(e);
5882
5882
  i && t.destroy(i, !0);
@@ -5918,7 +5918,7 @@ class Br extends vr {
5918
5918
  return;
5919
5919
  }
5920
5920
  this.isProcessing = !0;
5921
- const e = this.components.get(zt);
5921
+ const e = this.components.get(Ht);
5922
5922
  this._currentVisibleMeshes.delete(t), this._recentlyHiddenMeshes.delete(t);
5923
5923
  const i = this.colorMeshes.get(t.uuid), o = this._meshIDColorCodeMap.get(t.uuid);
5924
5924
  if (!i || !o) {
@@ -6356,7 +6356,7 @@ const At = class At extends J {
6356
6356
  }
6357
6357
  /** {@link Disposable.dispose} */
6358
6358
  dispose() {
6359
- const t = this.components.get(zt);
6359
+ const t = this.components.get(Ht);
6360
6360
  for (const e of this._meshes)
6361
6361
  t.destroy(e);
6362
6362
  this._meshes = [], this.onDisposed.trigger(At.uuid), this.onDisposed.reset();
@@ -6380,15 +6380,24 @@ const At = class At extends J {
6380
6380
  for (const e of t.items)
6381
6381
  this.addMesh(e.mesh);
6382
6382
  }
6383
- addMesh(t) {
6383
+ addMesh(t, e) {
6384
6384
  if (!t.geometry.index)
6385
6385
  return;
6386
- const e = At.getFragmentBounds(t);
6386
+ const i = At.getFragmentBounds(t);
6387
6387
  t.updateMatrixWorld();
6388
- const i = t.matrixWorld, o = new O.Matrix4(), n = t instanceof O.InstancedMesh, r = n ? t.count : 1;
6389
- for (let a = 0; a < r; a++) {
6390
- const c = e.min.clone(), E = e.max.clone();
6391
- n && (t.getMatrixAt(a, o), c.applyMatrix4(o), E.applyMatrix4(o)), c.applyMatrix4(i), E.applyMatrix4(i), c.x < this._absoluteMin.x && (this._absoluteMin.x = c.x), c.y < this._absoluteMin.y && (this._absoluteMin.y = c.y), c.z < this._absoluteMin.z && (this._absoluteMin.z = c.z), c.x > this._absoluteMax.x && (this._absoluteMax.x = c.x), c.y > this._absoluteMax.y && (this._absoluteMax.y = c.y), c.z > this._absoluteMax.z && (this._absoluteMax.z = c.z), E.x > this._absoluteMax.x && (this._absoluteMax.x = E.x), E.y > this._absoluteMax.y && (this._absoluteMax.y = E.y), E.z > this._absoluteMax.z && (this._absoluteMax.z = E.z), E.x < this._absoluteMin.x && (this._absoluteMin.x = E.x), E.y < this._absoluteMin.y && (this._absoluteMin.y = E.y), E.z < this._absoluteMin.z && (this._absoluteMin.z = E.z);
6388
+ const o = t.matrixWorld, n = new O.Matrix4(), r = t instanceof O.InstancedMesh, a = /* @__PURE__ */ new Set();
6389
+ if (e && t instanceof Gt.FragmentMesh)
6390
+ for (const c of e) {
6391
+ const E = t.fragment.getInstancesIDs(c);
6392
+ if (E)
6393
+ for (const d of E)
6394
+ a.add(d);
6395
+ }
6396
+ else
6397
+ a.add(0);
6398
+ for (const c of a) {
6399
+ const E = i.min.clone(), d = i.max.clone();
6400
+ r && (t.getMatrixAt(c, n), E.applyMatrix4(n), d.applyMatrix4(n)), E.applyMatrix4(o), d.applyMatrix4(o), E.x < this._absoluteMin.x && (this._absoluteMin.x = E.x), E.y < this._absoluteMin.y && (this._absoluteMin.y = E.y), E.z < this._absoluteMin.z && (this._absoluteMin.z = E.z), E.x > this._absoluteMax.x && (this._absoluteMax.x = E.x), E.y > this._absoluteMax.y && (this._absoluteMax.y = E.y), E.z > this._absoluteMax.z && (this._absoluteMax.z = E.z), d.x > this._absoluteMax.x && (this._absoluteMax.x = d.x), d.y > this._absoluteMax.y && (this._absoluteMax.y = d.y), d.z > this._absoluteMax.z && (this._absoluteMax.z = d.z), d.x < this._absoluteMin.x && (this._absoluteMin.x = d.x), d.y < this._absoluteMin.y && (this._absoluteMin.y = d.y), d.z < this._absoluteMin.z && (this._absoluteMin.z = d.z);
6392
6401
  }
6393
6402
  }
6394
6403
  static getFragmentBounds(t) {
@@ -8777,7 +8786,7 @@ class bn {
8777
8786
  if (s.IfcAlignment) {
8778
8787
  const t = /* @__PURE__ */ new Map();
8779
8788
  for (const e of s.IfcAlignment) {
8780
- const i = new $t.Alignment();
8789
+ const i = new Gt.Alignment();
8781
8790
  i.absolute = this.getCurves(e.curve3D, i), i.horizontal = this.getCurves(e.horizontal, i), i.vertical = this.getCurves(e.vertical, i), t.set(t.size, i);
8782
8791
  }
8783
8792
  return { alignments: t, coordinationMatrix: new O.Matrix4() };
@@ -8800,7 +8809,7 @@ class bn {
8800
8809
  }
8801
8810
  const c = new O.BufferAttribute(a, 3), E = new O.EdgesGeometry();
8802
8811
  E.setAttribute("position", c);
8803
- const d = new $t.CurveMesh(
8812
+ const d = new Gt.CurveMesh(
8804
8813
  i,
8805
8814
  n,
8806
8815
  t,
@@ -8874,7 +8883,7 @@ const ze = class ze extends J {
8874
8883
  }
8875
8884
  async getAllGeometries() {
8876
8885
  this._spatialTree.setUp(this.webIfc);
8877
- const t = this.webIfc.GetIfcEntityList(0), e = new $t.FragmentsGroup(), { FILE_NAME: i, FILE_DESCRIPTION: o } = x;
8886
+ const t = this.webIfc.GetIfcEntityList(0), e = new Gt.FragmentsGroup(), { FILE_NAME: i, FILE_DESCRIPTION: o } = x;
8878
8887
  e.ifcMetadata = {
8879
8888
  name: this._metaData.get(this.webIfc, i),
8880
8889
  description: this._metaData.get(this.webIfc, o),
@@ -8920,7 +8929,7 @@ const ze = class ze extends J {
8920
8929
  for (let n = 0; n < i; n++) {
8921
8930
  const r = t.geometries.get(n), { x: a, y: c, z: E, w: d } = r.color, h = d !== 1, { geometryExpressID: u } = r, p = `${u}-${h}`;
8922
8931
  if (!this._visitedFragments.has(p)) {
8923
- const R = this.getGeometry(this.webIfc, u), g = h ? this._materialT : this._material, S = new $t.Fragment(R, g, 1);
8932
+ const R = this.getGeometry(this.webIfc, u), g = h ? this._materialT : this._material, S = new Gt.Fragment(R, g, 1);
8924
8933
  e.add(S.mesh), e.items.push(S);
8925
8934
  const _ = this._visitedFragments.size;
8926
8935
  this._visitedFragments.set(p, { index: _, fragment: S });
@@ -9316,14 +9325,14 @@ const ys = class ys extends J {
9316
9325
  }
9317
9326
  );
9318
9327
  }
9319
- setColor(t, e, i) {
9328
+ setColor(t, e, i = !1) {
9320
9329
  const o = this.components.get(at);
9321
9330
  for (const n in t) {
9322
9331
  const r = o.list.get(n);
9323
9332
  if (!r)
9324
9333
  continue;
9325
9334
  const a = t[n];
9326
- r.setColor(e, a);
9335
+ r.setColor(e, a, i);
9327
9336
  }
9328
9337
  }
9329
9338
  resetColor(t) {
@@ -9567,11 +9576,11 @@ const Ls = class Ls extends J {
9567
9576
  I(this, "_spatialTree", new xn());
9568
9577
  I(this, "_metaData", new vn());
9569
9578
  I(this, "_visitedGeometries", /* @__PURE__ */ new Map());
9570
- I(this, "_streamSerializer", new $t.StreamSerializer());
9579
+ I(this, "_streamSerializer", new Gt.StreamSerializer());
9571
9580
  I(this, "_geometries", /* @__PURE__ */ new Map());
9572
9581
  I(this, "_geometryCount", 0);
9573
9582
  I(this, "_civil", new bn());
9574
- I(this, "_groupSerializer", new $t.Serializer());
9583
+ I(this, "_groupSerializer", new Gt.Serializer());
9575
9584
  I(this, "_assets", []);
9576
9585
  I(this, "_meshesWithHoles", /* @__PURE__ */ new Set());
9577
9586
  this.components.add(Ls.uuid, this), this.settings.excludedCategories.add(x.IFCOPENINGELEMENT);
@@ -9598,7 +9607,7 @@ const Ls = class Ls extends J {
9598
9607
  async streamAllGeometries() {
9599
9608
  const { minGeometrySize: t, minAssetsSize: e } = this.settings;
9600
9609
  this._spatialTree.setUp(this.webIfc);
9601
- const i = this.webIfc.GetIfcEntityList(0), o = [[]], n = new $t.FragmentsGroup(), { FILE_NAME: r, FILE_DESCRIPTION: a } = x;
9610
+ const i = this.webIfc.GetIfcEntityList(0), o = [[]], n = new Gt.FragmentsGroup(), { FILE_NAME: r, FILE_DESCRIPTION: a } = x;
9602
9611
  n.ifcMetadata = {
9603
9612
  name: this._metaData.get(this.webIfc, r),
9604
9613
  description: this._metaData.get(this.webIfc, a),
@@ -9923,15 +9932,15 @@ export {
9923
9932
  or as BaseRenderer,
9924
9933
  rr as BaseScene,
9925
9934
  Oi as BaseWorldItem,
9935
+ Rn as BoundingBoxes,
9926
9936
  Cn as Clipper,
9927
9937
  J as Component,
9928
9938
  ui as Components,
9929
9939
  vr as CullerRenderer,
9930
9940
  fi as Cullers,
9931
- zt as Disposer,
9941
+ Ht as Disposer,
9932
9942
  D as Event,
9933
9943
  Vr as FirstPersonMode,
9934
- Rn as FragmentBoundingBox,
9935
9944
  Ti as FragmentClassifier,
9936
9945
  Fn as FragmentExploder,
9937
9946
  gn as FragmentHider,