@thatopen/components 2.0.22 → 2.0.23
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/core/Components/index.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +160 -160
- package/dist/namespace.d.ts +1128 -1128
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ var kn = Object.defineProperty;
|
|
|
2
2
|
var Wn = (l, e, t) => e in l ? kn(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
|
|
3
3
|
var I = (l, e, t) => (Wn(l, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
4
|
import * as g from "three";
|
|
5
|
-
import { BufferAttribute as
|
|
5
|
+
import { BufferAttribute as Pn, Vector3 as M, Vector2 as fe, Plane as Fi, Line3 as Lt, Triangle as ue, Sphere as Xn, Matrix4 as yt, Box3 as Ot, BackSide as Zn, DoubleSide as Ln, FrontSide as wi, Mesh as v, Ray as Qn, Raycaster as jn, Quaternion as Pt, Object3D as ri, Euler as qn, MeshBasicMaterial as yn, LineBasicMaterial as Kn, CylinderGeometry as ct, BoxGeometry as rt, BufferGeometry as Di, Float32BufferAttribute as Ui, OctahedronGeometry as Ze, Line as Dt, SphereGeometry as $n, TorusGeometry as me, PlaneGeometry as Jn } from "three";
|
|
6
6
|
import * as Vt from "@thatopen/fragments";
|
|
7
7
|
import { Serializer as to } from "@thatopen/fragments";
|
|
8
8
|
import * as b from "web-ifc";
|
|
@@ -19,7 +19,7 @@ function oo(l, e = ArrayBuffer) {
|
|
|
19
19
|
function ro(l, e) {
|
|
20
20
|
if (!l.index) {
|
|
21
21
|
const t = l.attributes.position.count, s = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, i = oo(t, s);
|
|
22
|
-
l.setIndex(new
|
|
22
|
+
l.setIndex(new Pn(i, 1));
|
|
23
23
|
for (let o = 0; o < t; o++)
|
|
24
24
|
i[o] = o;
|
|
25
25
|
}
|
|
@@ -97,8 +97,8 @@ function Gs(l, e, t, s, i = null) {
|
|
|
97
97
|
for (let R = e * 6, F = (e + t) * 6; R < F; R += 6) {
|
|
98
98
|
const f = l[R + 0], T = l[R + 1], O = f - T, _ = f + T;
|
|
99
99
|
O < o && (o = O), _ > a && (a = _), C && f < d && (d = f), C && f > p && (p = f);
|
|
100
|
-
const S = l[R + 2], N = l[R + 3],
|
|
101
|
-
|
|
100
|
+
const S = l[R + 2], N = l[R + 3], L = S - N, w = S + N;
|
|
101
|
+
L < n && (n = L), w > c && (c = w), C && S < E && (E = S), C && S > A && (A = S);
|
|
102
102
|
const y = l[R + 4], U = l[R + 5], x = y - U, B = y + U;
|
|
103
103
|
x < r && (r = x), B > h && (h = B), C && y < u && (u = y), C && y > m && (m = y);
|
|
104
104
|
}
|
|
@@ -190,11 +190,11 @@ function uo(l, e, t, s, i, o) {
|
|
|
190
190
|
}
|
|
191
191
|
for (let f = 0; f < F; f++) {
|
|
192
192
|
const T = C[f], O = T.count, _ = i - T.count, S = T.leftCacheBounds, N = T.rightCacheBounds;
|
|
193
|
-
let
|
|
194
|
-
O !== 0 && (
|
|
193
|
+
let L = 0;
|
|
194
|
+
O !== 0 && (L = Re(S) / a);
|
|
195
195
|
let w = 0;
|
|
196
196
|
_ !== 0 && (w = Re(N) / a);
|
|
197
|
-
const y = bi + Ys * (
|
|
197
|
+
const y = bi + Ys * (L * O + w * _);
|
|
198
198
|
y < c && (n = E, c = y, r = T.candidate);
|
|
199
199
|
}
|
|
200
200
|
} else {
|
|
@@ -221,11 +221,11 @@ function uo(l, e, t, s, i, o) {
|
|
|
221
221
|
for (let F = 0; F < Mt - 1; F++) {
|
|
222
222
|
const f = Ut[F], T = f.count, O = f.bounds, S = Ut[F + 1].rightCacheBounds;
|
|
223
223
|
T !== 0 && (R === 0 ? Bi(O, je) : Yi(O, je, je)), R += T;
|
|
224
|
-
let N = 0,
|
|
224
|
+
let N = 0, L = 0;
|
|
225
225
|
R !== 0 && (N = Re(je) / a);
|
|
226
226
|
const w = i - R;
|
|
227
|
-
w !== 0 && (
|
|
228
|
-
const y = bi + Ys * (N * R +
|
|
227
|
+
w !== 0 && (L = Re(S) / a);
|
|
228
|
+
const y = bi + Ys * (N * R + L * w);
|
|
229
229
|
y < c && (n = E, c = y, r = f.candidate);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -314,14 +314,14 @@ function To(l, e) {
|
|
|
314
314
|
const N = uo(f.boundingData, _, p, T, O, r);
|
|
315
315
|
if (N.axis === -1)
|
|
316
316
|
return R(T + O), f.offset = T, f.count = O, f;
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
317
|
+
const L = A(h, s, p, T, O, N);
|
|
318
|
+
if (L === T || L === T + O)
|
|
319
319
|
R(T + O), f.offset = T, f.count = O;
|
|
320
320
|
else {
|
|
321
321
|
f.splitAxis = N.axis;
|
|
322
|
-
const w = new qe(), y = T, U =
|
|
322
|
+
const w = new qe(), y = T, U = L - T;
|
|
323
323
|
f.left = w, w.boundingData = new Float32Array(6), Gs(p, y, U, w.boundingData, u), F(w, y, U, u, S + 1);
|
|
324
|
-
const x = new qe(), B =
|
|
324
|
+
const x = new qe(), B = L, H = O - U;
|
|
325
325
|
f.right = x, x.boundingData = new Float32Array(6), Gs(p, B, H, x.boundingData, u), F(x, B, H, u, S + 1);
|
|
326
326
|
}
|
|
327
327
|
return f;
|
|
@@ -440,7 +440,7 @@ const Ro = function() {
|
|
|
440
440
|
}
|
|
441
441
|
};
|
|
442
442
|
}(), Ao = function() {
|
|
443
|
-
const l = new M(), e = new M(), t = new Fi(), s = new
|
|
443
|
+
const l = new M(), e = new M(), t = new Fi(), s = new Lt();
|
|
444
444
|
return function(o, n) {
|
|
445
445
|
const { radius: r, center: a } = o, { a: c, b: h, c: d } = n;
|
|
446
446
|
if (s.start = c, s.end = h, s.closestPointToPoint(a, !0, l).distanceTo(a) <= r || (s.start = c, s.end = d, s.closestPointToPoint(a, !0, l).distanceTo(a) <= r) || (s.start = h, s.end = d, s.closestPointToPoint(a, !0, l).distanceTo(a) <= r))
|
|
@@ -476,7 +476,7 @@ class Ft extends ue {
|
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
478
|
Ft.prototype.closestPointToSegment = function() {
|
|
479
|
-
const l = new M(), e = new M(), t = new
|
|
479
|
+
const l = new M(), e = new M(), t = new Lt();
|
|
480
480
|
return function(i, o = null, n = null) {
|
|
481
481
|
const { start: r, end: a } = i, c = this.points;
|
|
482
482
|
let h, d = 1 / 0;
|
|
@@ -488,7 +488,7 @@ Ft.prototype.closestPointToSegment = function() {
|
|
|
488
488
|
};
|
|
489
489
|
}();
|
|
490
490
|
Ft.prototype.intersectsTriangle = function() {
|
|
491
|
-
const l = new Ft(), e = new Array(3), t = new Array(3), s = new wt(), i = new wt(), o = new M(), n = new M(), r = new M(), a = new M(), c = new M(), h = new
|
|
491
|
+
const l = new Ft(), e = new Array(3), t = new Array(3), s = new wt(), i = new wt(), o = new M(), n = new M(), r = new M(), a = new M(), c = new M(), h = new Lt(), d = new Lt(), E = new Lt(), u = new M();
|
|
492
492
|
function p(A, m, C) {
|
|
493
493
|
const R = A.points;
|
|
494
494
|
let F = 0, f = -1;
|
|
@@ -521,22 +521,22 @@ Ft.prototype.intersectsTriangle = function() {
|
|
|
521
521
|
const T = this.satBounds, O = this.satAxes;
|
|
522
522
|
t[0] = m.a, t[1] = m.b, t[2] = m.c;
|
|
523
523
|
for (let N = 0; N < 4; N++) {
|
|
524
|
-
const
|
|
525
|
-
if (s.setFromPoints(w, t),
|
|
524
|
+
const L = T[N], w = O[N];
|
|
525
|
+
if (s.setFromPoints(w, t), L.isSeparated(s))
|
|
526
526
|
return !1;
|
|
527
527
|
}
|
|
528
528
|
const _ = m.satBounds, S = m.satAxes;
|
|
529
529
|
e[0] = this.a, e[1] = this.b, e[2] = this.c;
|
|
530
530
|
for (let N = 0; N < 4; N++) {
|
|
531
|
-
const
|
|
532
|
-
if (s.setFromPoints(w, e),
|
|
531
|
+
const L = _[N], w = S[N];
|
|
532
|
+
if (s.setFromPoints(w, e), L.isSeparated(s))
|
|
533
533
|
return !1;
|
|
534
534
|
}
|
|
535
535
|
for (let N = 0; N < 4; N++) {
|
|
536
|
-
const
|
|
536
|
+
const L = O[N];
|
|
537
537
|
for (let w = 0; w < 4; w++) {
|
|
538
538
|
const y = S[w];
|
|
539
|
-
if (o.crossVectors(
|
|
539
|
+
if (o.crossVectors(L, y), s.setFromPoints(o, e), i.setFromPoints(o, t), s.isSeparated(i))
|
|
540
540
|
return !1;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
@@ -556,8 +556,8 @@ Ft.prototype.intersectsTriangle = function() {
|
|
|
556
556
|
let U = E.start;
|
|
557
557
|
E.start = E.end, E.end = U;
|
|
558
558
|
}
|
|
559
|
-
const _ = d.start.dot(r), S = d.end.dot(r), N = E.start.dot(r),
|
|
560
|
-
return _ !==
|
|
559
|
+
const _ = d.start.dot(r), S = d.end.dot(r), N = E.start.dot(r), L = E.end.dot(r), w = S < N, y = _ < L;
|
|
560
|
+
return _ !== L && N !== S && w === y ? !1 : (C && (c.subVectors(d.start, E.start), c.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(E.start), c.subVectors(d.end, E.end), c.dot(r) < 0 ? C.end.copy(d.end) : C.end.copy(E.end)), !0);
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
563
|
}();
|
|
@@ -568,7 +568,7 @@ Ft.prototype.distanceToPoint = function() {
|
|
|
568
568
|
};
|
|
569
569
|
}();
|
|
570
570
|
Ft.prototype.distanceToTriangle = function() {
|
|
571
|
-
const l = new M(), e = new M(), t = ["a", "b", "c"], s = new
|
|
571
|
+
const l = new M(), e = new M(), t = ["a", "b", "c"], s = new Lt(), i = new Lt();
|
|
572
572
|
return function(n, r = null, a = null) {
|
|
573
573
|
const c = r || a ? s : null;
|
|
574
574
|
if (this.intersectsTriangle(n, c))
|
|
@@ -678,7 +678,7 @@ at.prototype.distanceToPoint = function() {
|
|
|
678
678
|
};
|
|
679
679
|
}();
|
|
680
680
|
at.prototype.distanceToBox = function() {
|
|
681
|
-
const l = ["x", "y", "z"], e = new Array(12).fill().map(() => new
|
|
681
|
+
const l = ["x", "y", "z"], e = new Array(12).fill().map(() => new Lt()), t = new Array(12).fill().map(() => new Lt()), s = new M(), i = new M();
|
|
682
682
|
return function(n, r = 0, a = null, c = null) {
|
|
683
683
|
if (this.needsUpdate && this.update(), this.intersectsBox(n))
|
|
684
684
|
return (a || c) && (n.getCenter(i), this.closestPointToPoint(i, s), n.closestPointToPoint(s, i), a && a.copy(s), c && c.copy(i)), 0;
|
|
@@ -697,8 +697,8 @@ at.prototype.distanceToBox = function() {
|
|
|
697
697
|
for (let R = 0; R <= 1; R++) {
|
|
698
698
|
const F = (m + 1) % 3, f = (m + 2) % 3, T = C << F | R << f, O = 1 << m | C << F | R << f, _ = u[T], S = u[O];
|
|
699
699
|
e[A].set(_, S);
|
|
700
|
-
const
|
|
701
|
-
x[
|
|
700
|
+
const L = l[m], w = l[F], y = l[f], U = t[A], x = U.start, B = U.end;
|
|
701
|
+
x[L] = d[L], x[w] = C ? d[w] : E[w], x[y] = R ? d[y] : E[w], B[L] = E[L], B[w] = C ? d[w] : E[w], B[y] = R ? d[y] : E[w], A++;
|
|
702
702
|
}
|
|
703
703
|
for (let m = 0; m <= 1; m++)
|
|
704
704
|
for (let C = 0; C <= 1; C++)
|
|
@@ -786,7 +786,7 @@ function ai(l, e, t, s, i = null, o = 0, n = 0) {
|
|
|
786
786
|
const E = Et(l, c), u = ft(h, a);
|
|
787
787
|
return K(l, r, Yt), s(E, u, !1, n, o + l, Yt);
|
|
788
788
|
} else {
|
|
789
|
-
let
|
|
789
|
+
let L = function(y) {
|
|
790
790
|
const { uint16Array: U, uint32Array: x } = Z;
|
|
791
791
|
let B = y * 2;
|
|
792
792
|
for (; !ht(B, U); )
|
|
@@ -810,7 +810,7 @@ function ai(l, e, t, s, i = null, o = 0, n = 0) {
|
|
|
810
810
|
const f = ht(p * 2, a), T = t(R, f, m, n + 1, o + p);
|
|
811
811
|
let O;
|
|
812
812
|
if (T === xi) {
|
|
813
|
-
const y =
|
|
813
|
+
const y = L(p), x = w(p) - y;
|
|
814
814
|
O = s(y, x, !0, n + 1, o + p, R);
|
|
815
815
|
} else
|
|
816
816
|
O = T && ai(
|
|
@@ -828,7 +828,7 @@ function ai(l, e, t, s, i = null, o = 0, n = 0) {
|
|
|
828
828
|
const _ = ht(A * 2, a), S = t(F, _, C, n + 1, o + A);
|
|
829
829
|
let N;
|
|
830
830
|
if (S === xi) {
|
|
831
|
-
const y =
|
|
831
|
+
const y = L(A), x = w(A) - y;
|
|
832
832
|
N = s(y, x, !0, n + 1, o + A, F);
|
|
833
833
|
} else
|
|
834
834
|
N = S && ai(
|
|
@@ -865,12 +865,12 @@ function So(l, e, t = {}, s = 0, i = 1 / 0) {
|
|
|
865
865
|
const te = /* @__PURE__ */ new M(), ee = /* @__PURE__ */ new M(), se = /* @__PURE__ */ new M(), $e = /* @__PURE__ */ new fe(), Je = /* @__PURE__ */ new fe(), ts = /* @__PURE__ */ new fe(), Vi = /* @__PURE__ */ new M(), Gi = /* @__PURE__ */ new M(), zi = /* @__PURE__ */ new M(), es = /* @__PURE__ */ new M();
|
|
866
866
|
function No(l, e, t, s, i, o) {
|
|
867
867
|
let n;
|
|
868
|
-
return o === Zn ? n = l.intersectTriangle(s, t, e, !0, i) : n = l.intersectTriangle(e, t, s, o !==
|
|
868
|
+
return o === Zn ? n = l.intersectTriangle(s, t, e, !0, i) : n = l.intersectTriangle(e, t, s, o !== Ln, i), n === null ? null : {
|
|
869
869
|
distance: l.origin.distanceTo(i),
|
|
870
870
|
point: i.clone()
|
|
871
871
|
};
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function Po(l, e, t, s, i, o, n, r, a) {
|
|
874
874
|
te.fromBufferAttribute(e, o), ee.fromBufferAttribute(e, n), se.fromBufferAttribute(e, r);
|
|
875
875
|
const c = No(l, te, ee, se, es, a);
|
|
876
876
|
if (c) {
|
|
@@ -891,7 +891,7 @@ function xs(l, e, t, s, i) {
|
|
|
891
891
|
let n = o + 0, r = o + 1, a = o + 2;
|
|
892
892
|
const c = l.index;
|
|
893
893
|
l.index && (n = c.getX(n), r = c.getX(r), a = c.getX(a));
|
|
894
|
-
const { position: h, normal: d, uv: E, uv1: u } = l.attributes, p =
|
|
894
|
+
const { position: h, normal: d, uv: E, uv1: u } = l.attributes, p = Po(t, h, d, E, u, n, r, a, e);
|
|
895
895
|
return p ? (p.faceIndex = s, i && i.push(p), p) : null;
|
|
896
896
|
}
|
|
897
897
|
function tt(l, e, t, s) {
|
|
@@ -899,7 +899,7 @@ function tt(l, e, t, s) {
|
|
|
899
899
|
let r = e, a = e + 1, c = e + 2;
|
|
900
900
|
t && (r = t.getX(r), a = t.getX(a), c = t.getX(c)), i.x = s.getX(r), i.y = s.getY(r), i.z = s.getZ(r), o.x = s.getX(a), o.y = s.getY(a), o.z = s.getZ(a), n.x = s.getX(c), n.y = s.getY(c), n.z = s.getZ(c);
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function Lo(l, e, t, s, i, o) {
|
|
903
903
|
const { geometry: n, _indirectBuffer: r } = l;
|
|
904
904
|
for (let a = s, c = s + i; a < c; a++)
|
|
905
905
|
xs(n, e, t, a, o);
|
|
@@ -934,7 +934,7 @@ function wo(l, e = null) {
|
|
|
934
934
|
if (r[A + 15] === Us) {
|
|
935
935
|
const C = n[E + 6], R = r[A + 14];
|
|
936
936
|
let F = 1 / 0, f = 1 / 0, T = 1 / 0, O = -1 / 0, _ = -1 / 0, S = -1 / 0;
|
|
937
|
-
for (let N = 3 * C,
|
|
937
|
+
for (let N = 3 * C, L = 3 * (C + R); N < L; N++) {
|
|
938
938
|
let w = s[N];
|
|
939
939
|
const y = i.getX(w), U = i.getY(w), x = i.getZ(w);
|
|
940
940
|
y < F && (F = y), y > O && (O = y), U < f && (f = U), U > _ && (_ = U), x < T && (T = x), x > S && (S = x);
|
|
@@ -945,11 +945,11 @@ function wo(l, e = null) {
|
|
|
945
945
|
let T = p, O = !1, _ = !1;
|
|
946
946
|
e ? T || (O = e.has(F), _ = e.has(f), T = !O && !_) : (O = !0, _ = !0);
|
|
947
947
|
const S = T || O, N = T || _;
|
|
948
|
-
let
|
|
949
|
-
S && (
|
|
948
|
+
let L = !1;
|
|
949
|
+
S && (L = d(C, u, T));
|
|
950
950
|
let w = !1;
|
|
951
951
|
N && (w = d(R, u, T));
|
|
952
|
-
const y =
|
|
952
|
+
const y = L || w;
|
|
953
953
|
if (y)
|
|
954
954
|
for (let U = 0; U < 3; U++) {
|
|
955
955
|
const x = C + U, B = R + U, H = a[x], q = a[x + 3], st = a[B], Q = a[B + 3];
|
|
@@ -996,7 +996,7 @@ function ci(l, e, t, s, i) {
|
|
|
996
996
|
const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = l * 2;
|
|
997
997
|
if (ht(a, n)) {
|
|
998
998
|
const h = Et(l, r), d = ft(a, n);
|
|
999
|
-
|
|
999
|
+
Lo(e, t, s, h, d, i);
|
|
1000
1000
|
} else {
|
|
1001
1001
|
const h = pt(l);
|
|
1002
1002
|
Gt(h, o, s, ki) && ci(h, e, t, s, i);
|
|
@@ -1081,14 +1081,14 @@ function ko(l, e, t, s = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1081
1081
|
if (e.boundsTree)
|
|
1082
1082
|
return e.boundsTree.shapecast({
|
|
1083
1083
|
boundsTraverseOrder: (S) => Oe.distanceToBox(S),
|
|
1084
|
-
intersectsBounds: (S, N,
|
|
1084
|
+
intersectsBounds: (S, N, L) => L < R && L < n,
|
|
1085
1085
|
intersectsRange: (S, N) => {
|
|
1086
|
-
for (let
|
|
1087
|
-
tt(u, 3 *
|
|
1086
|
+
for (let L = S, w = S + N; L < w; L++) {
|
|
1087
|
+
tt(u, 3 * L, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1088
1088
|
for (let y = T, U = T + O; y < U; y++) {
|
|
1089
1089
|
tt(E, 3 * y, c, a), E.needsUpdate = !0;
|
|
1090
1090
|
const x = E.distanceToTriangle(u, p, m);
|
|
1091
|
-
if (x < R && (A.copy(p), C && C.copy(m), R = x, F = y, f =
|
|
1091
|
+
if (x < R && (A.copy(p), C && C.copy(m), R = x, F = y, f = L), x < o)
|
|
1092
1092
|
return !0;
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
@@ -1098,10 +1098,10 @@ function ko(l, e, t, s = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1098
1098
|
const _ = pe(e);
|
|
1099
1099
|
for (let S = 0, N = _; S < N; S++) {
|
|
1100
1100
|
tt(u, 3 * S, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1101
|
-
for (let
|
|
1102
|
-
tt(E, 3 *
|
|
1101
|
+
for (let L = T, w = T + O; L < w; L++) {
|
|
1102
|
+
tt(E, 3 * L, c, a), E.needsUpdate = !0;
|
|
1103
1103
|
const y = E.distanceToTriangle(u, p, m);
|
|
1104
|
-
if (y < R && (A.copy(p), C && C.copy(m), R = y, F =
|
|
1104
|
+
if (y < R && (A.copy(p), C && C.copy(m), R = y, F = L, f = S), y < o)
|
|
1105
1105
|
return !0;
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
@@ -1122,7 +1122,7 @@ function Wo(l, e = null) {
|
|
|
1122
1122
|
if (r[A + 15] === Us) {
|
|
1123
1123
|
const C = n[E + 6], R = r[A + 14];
|
|
1124
1124
|
let F = 1 / 0, f = 1 / 0, T = 1 / 0, O = -1 / 0, _ = -1 / 0, S = -1 / 0;
|
|
1125
|
-
for (let N = C,
|
|
1125
|
+
for (let N = C, L = C + R; N < L; N++) {
|
|
1126
1126
|
const w = 3 * l.resolveTriangleIndex(N);
|
|
1127
1127
|
for (let y = 0; y < 3; y++) {
|
|
1128
1128
|
let U = w + y;
|
|
@@ -1137,11 +1137,11 @@ function Wo(l, e = null) {
|
|
|
1137
1137
|
let T = p, O = !1, _ = !1;
|
|
1138
1138
|
e ? T || (O = e.has(F), _ = e.has(f), T = !O && !_) : (O = !0, _ = !0);
|
|
1139
1139
|
const S = T || O, N = T || _;
|
|
1140
|
-
let
|
|
1141
|
-
S && (
|
|
1140
|
+
let L = !1;
|
|
1141
|
+
S && (L = d(C, u, T));
|
|
1142
1142
|
let w = !1;
|
|
1143
1143
|
N && (w = d(R, u, T));
|
|
1144
|
-
const y =
|
|
1144
|
+
const y = L || w;
|
|
1145
1145
|
if (y)
|
|
1146
1146
|
for (let U = 0; U < 3; U++) {
|
|
1147
1147
|
const x = C + U, B = R + U, H = a[x], q = a[x + 3], st = a[B], Q = a[B + 3];
|
|
@@ -1246,16 +1246,16 @@ function tr(l, e, t, s = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1246
1246
|
const _ = e.boundsTree;
|
|
1247
1247
|
return _.shapecast({
|
|
1248
1248
|
boundsTraverseOrder: (S) => _e.distanceToBox(S),
|
|
1249
|
-
intersectsBounds: (S, N,
|
|
1249
|
+
intersectsBounds: (S, N, L) => L < R && L < n,
|
|
1250
1250
|
intersectsRange: (S, N) => {
|
|
1251
|
-
for (let
|
|
1252
|
-
const y = _.resolveTriangleIndex(
|
|
1251
|
+
for (let L = S, w = S + N; L < w; L++) {
|
|
1252
|
+
const y = _.resolveTriangleIndex(L);
|
|
1253
1253
|
tt(u, 3 * y, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1254
1254
|
for (let U = T, x = T + O; U < x; U++) {
|
|
1255
1255
|
const B = l.resolveTriangleIndex(U);
|
|
1256
1256
|
tt(E, 3 * B, c, a), E.needsUpdate = !0;
|
|
1257
1257
|
const H = E.distanceToTriangle(u, p, m);
|
|
1258
|
-
if (H < R && (A.copy(p), C && C.copy(m), R = H, F = U, f =
|
|
1258
|
+
if (H < R && (A.copy(p), C && C.copy(m), R = H, F = U, f = L), H < o)
|
|
1259
1259
|
return !0;
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
@@ -1265,11 +1265,11 @@ function tr(l, e, t, s = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1265
1265
|
const _ = pe(e);
|
|
1266
1266
|
for (let S = 0, N = _; S < N; S++) {
|
|
1267
1267
|
tt(u, 3 * S, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1268
|
-
for (let
|
|
1269
|
-
const y = l.resolveTriangleIndex(
|
|
1268
|
+
for (let L = T, w = T + O; L < w; L++) {
|
|
1269
|
+
const y = l.resolveTriangleIndex(L);
|
|
1270
1270
|
tt(E, 3 * y, c, a), E.needsUpdate = !0;
|
|
1271
1271
|
const U = E.distanceToTriangle(u, p, m);
|
|
1272
|
-
if (U < R && (A.copy(p), C && C.copy(m), R = U, F =
|
|
1272
|
+
if (U < R && (A.copy(p), C && C.copy(m), R = U, F = L, f = S), U < o)
|
|
1273
1273
|
return !0;
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
@@ -1340,8 +1340,8 @@ function Tt(l, e, t, s, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1340
1340
|
else if (O) {
|
|
1341
1341
|
const S = vt.getPrimitive();
|
|
1342
1342
|
K(e, m, S), S.applyMatrix4(t);
|
|
1343
|
-
const N = pt(l),
|
|
1344
|
-
K(N, u, ae), K(
|
|
1343
|
+
const N = pt(l), L = Ct(l, p);
|
|
1344
|
+
K(N, u, ae), K(L, u, ce);
|
|
1345
1345
|
const w = S.intersectsBox(ae), y = S.intersectsBox(ce);
|
|
1346
1346
|
_ = w && Tt(
|
|
1347
1347
|
e,
|
|
@@ -1357,7 +1357,7 @@ function Tt(l, e, t, s, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1357
1357
|
!h
|
|
1358
1358
|
) || y && Tt(
|
|
1359
1359
|
e,
|
|
1360
|
-
|
|
1360
|
+
L,
|
|
1361
1361
|
s,
|
|
1362
1362
|
t,
|
|
1363
1363
|
i,
|
|
@@ -1371,8 +1371,8 @@ function Tt(l, e, t, s, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1371
1371
|
} else {
|
|
1372
1372
|
const S = pt(e), N = Ct(e, C);
|
|
1373
1373
|
K(S, m, Xs), K(N, m, Zs);
|
|
1374
|
-
const
|
|
1375
|
-
if (
|
|
1374
|
+
const L = c.intersectsBox(Xs), w = c.intersectsBox(Zs);
|
|
1375
|
+
if (L && w)
|
|
1376
1376
|
_ = Tt(
|
|
1377
1377
|
l,
|
|
1378
1378
|
S,
|
|
@@ -1398,7 +1398,7 @@ function Tt(l, e, t, s, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1398
1398
|
c,
|
|
1399
1399
|
h
|
|
1400
1400
|
);
|
|
1401
|
-
else if (
|
|
1401
|
+
else if (L)
|
|
1402
1402
|
if (T)
|
|
1403
1403
|
_ = Tt(
|
|
1404
1404
|
l,
|
|
@@ -1524,7 +1524,7 @@ class _i {
|
|
|
1524
1524
|
if (r._roots = o, r._indirectBuffer = n || null, s.setIndex) {
|
|
1525
1525
|
const a = t.getIndex();
|
|
1526
1526
|
if (a === null) {
|
|
1527
|
-
const c = new
|
|
1527
|
+
const c = new Pn(e.index, 1, !1);
|
|
1528
1528
|
t.setIndex(c);
|
|
1529
1529
|
} else
|
|
1530
1530
|
a.array !== i && (a.array.set(i), a.needsUpdate = !0);
|
|
@@ -1648,7 +1648,7 @@ class _i {
|
|
|
1648
1648
|
const p = (A, m, C, R, F, f, T, O) => {
|
|
1649
1649
|
for (let _ = C, S = C + R; _ < S; _++) {
|
|
1650
1650
|
u(_), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
|
|
1651
|
-
for (let N = A,
|
|
1651
|
+
for (let N = A, L = A + m; N < L; N++)
|
|
1652
1652
|
if (c(N), n.needsUpdate = !0, o(n, h, N, _, F, f, T, O))
|
|
1653
1653
|
return !0;
|
|
1654
1654
|
}
|
|
@@ -1974,7 +1974,7 @@ class lr extends Ni {
|
|
|
1974
1974
|
this.three.children = [], this.onDisposed.trigger(), this.onDisposed.reset();
|
|
1975
1975
|
}
|
|
1976
1976
|
}
|
|
1977
|
-
const ms = 0, hr = 1, Er = new M(), Ji = new
|
|
1977
|
+
const ms = 0, hr = 1, Er = new M(), Ji = new Lt(), qs = new Fi(), tn = new M(), ls = new ue();
|
|
1978
1978
|
class dr {
|
|
1979
1979
|
constructor() {
|
|
1980
1980
|
this.tolerance = -1, this.faces = [], this.newFaces = [], this.assigned = new en(), this.unassigned = new en(), this.vertices = [];
|
|
@@ -2404,16 +2404,16 @@ function Tr(l) {
|
|
|
2404
2404
|
p.divideScalar(A), m /= A, C /= A, R /= A, F /= A, f /= A, T /= A, m -= p.x * p.x, C -= p.x * p.y, R -= p.x * p.z, F -= p.y * p.y, f -= p.y * p.z, T -= p.z * p.z;
|
|
2405
2405
|
const O = new g.Matrix3();
|
|
2406
2406
|
O.elements[0] = m, O.elements[1] = C, O.elements[2] = R, O.elements[3] = C, O.elements[4] = F, O.elements[5] = f, O.elements[6] = R, O.elements[7] = f, O.elements[8] = T, Cr(O, s);
|
|
2407
|
-
const _ = s.unitary, S = new g.Vector3(), N = new g.Vector3(),
|
|
2408
|
-
_.extractBasis(S, N,
|
|
2407
|
+
const _ = s.unitary, S = new g.Vector3(), N = new g.Vector3(), L = new g.Vector3();
|
|
2408
|
+
_.extractBasis(S, N, L);
|
|
2409
2409
|
let w = -1 / 0, y = -1 / 0, U = -1 / 0, x = 1 / 0, B = 1 / 0, H = 1 / 0;
|
|
2410
2410
|
for (let it = 0, Xt = e.length; it < Xt; it++) {
|
|
2411
2411
|
const J = e[it];
|
|
2412
|
-
w = Math.max(S.dot(J), w), y = Math.max(N.dot(J), y), U = Math.max(
|
|
2412
|
+
w = Math.max(S.dot(J), w), y = Math.max(N.dot(J), y), U = Math.max(L.dot(J), U), x = Math.min(S.dot(J), x), B = Math.min(N.dot(J), B), H = Math.min(L.dot(J), H);
|
|
2413
2413
|
}
|
|
2414
|
-
S.multiplyScalar(0.5 * (x + w)), N.multiplyScalar(0.5 * (B + y)),
|
|
2414
|
+
S.multiplyScalar(0.5 * (x + w)), N.multiplyScalar(0.5 * (B + y)), L.multiplyScalar(0.5 * (H + U));
|
|
2415
2415
|
const q = new g.Vector3(), st = new g.Vector3(), Q = new g.Matrix3();
|
|
2416
|
-
q.add(S).add(N).add(
|
|
2416
|
+
q.add(S).add(N).add(L), st.x = w - x, st.y = y - B, st.z = U - H, st.multiplyScalar(0.5), Q.copy(_);
|
|
2417
2417
|
const { x: Ht, y: kt, z: Wt } = st, We = new g.Matrix4();
|
|
2418
2418
|
We.makeScale(Ht * 2, kt * 2, Wt * 2);
|
|
2419
2419
|
const Ce = new g.Matrix4();
|
|
@@ -2964,7 +2964,7 @@ const Fs = class Fs {
|
|
|
2964
2964
|
/**
|
|
2965
2965
|
* The version of the @thatopen/components library.
|
|
2966
2966
|
*/
|
|
2967
|
-
I(Fs, "release", "2.0.
|
|
2967
|
+
I(Fs, "release", "2.0.23");
|
|
2968
2968
|
let pi = Fs;
|
|
2969
2969
|
class Rr {
|
|
2970
2970
|
constructor(e) {
|
|
@@ -3375,7 +3375,7 @@ const V = {
|
|
|
3375
3375
|
LEFT: 1,
|
|
3376
3376
|
RIGHT: 2,
|
|
3377
3377
|
MIDDLE: 4
|
|
3378
|
-
},
|
|
3378
|
+
}, P = Object.freeze({
|
|
3379
3379
|
NONE: 0,
|
|
3380
3380
|
ROTATE: 1,
|
|
3381
3381
|
TRUCK: 2,
|
|
@@ -3420,7 +3420,7 @@ function on(l, e) {
|
|
|
3420
3420
|
function Ne(l) {
|
|
3421
3421
|
return isFinite(l) ? l : l < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
|
3422
3422
|
}
|
|
3423
|
-
function
|
|
3423
|
+
function Pe(l) {
|
|
3424
3424
|
return Math.abs(l) < Number.MAX_VALUE ? l : l * (1 / 0);
|
|
3425
3425
|
}
|
|
3426
3426
|
function hs(l, e, t, s, i = 1 / 0, o) {
|
|
@@ -3446,8 +3446,8 @@ function rn(l, e, t, s, i = 1 / 0, o, n) {
|
|
|
3446
3446
|
h = l.x - u, d = l.y - p, E = l.z - A;
|
|
3447
3447
|
const O = (t.x + r * u) * o, _ = (t.y + r * p) * o, S = (t.z + r * A) * o;
|
|
3448
3448
|
t.x = (t.x - r * O) * c, t.y = (t.y - r * _) * c, t.z = (t.z - r * S) * c, n.x = h + (u + O) * c, n.y = d + (p + _) * c, n.z = E + (A + S) * c;
|
|
3449
|
-
const N = m - l.x,
|
|
3450
|
-
return N * y +
|
|
3449
|
+
const N = m - l.x, L = C - l.y, w = R - l.z, y = n.x - m, U = n.y - C, x = n.z - R;
|
|
3450
|
+
return N * y + L * U + w * x > 0 && (n.x = m, n.y = C, n.z = R, t.x = (n.x - m) / o, t.y = (n.y - C) / o, t.z = (n.z - R) / o), n;
|
|
3451
3451
|
}
|
|
3452
3452
|
function $s(l, e) {
|
|
3453
3453
|
e.set(0, 0), l.forEach((t) => {
|
|
@@ -3522,7 +3522,7 @@ class Or {
|
|
|
3522
3522
|
}
|
|
3523
3523
|
}
|
|
3524
3524
|
const gr = "2.7.3", Es = 1 / 8, bn = typeof window < "u", _r = bn && /Mac/.test(navigator.platform), Sr = !(bn && "PointerEvent" in window);
|
|
3525
|
-
let Y, an, ds, ti, lt, G, z, Ee,
|
|
3525
|
+
let Y, an, ds, ti, lt, G, z, Ee, Le, gt, _t, Qt, cn, ln, dt, ye, de, hn, ei, En, si, ii, us;
|
|
3526
3526
|
class ot extends Or {
|
|
3527
3527
|
/**
|
|
3528
3528
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
|
@@ -3565,14 +3565,14 @@ class ot extends Or {
|
|
|
3565
3565
|
* @category Statics
|
|
3566
3566
|
*/
|
|
3567
3567
|
static install(e) {
|
|
3568
|
-
Y = e.THREE, an = Object.freeze(new Y.Vector3(0, 0, 0)), ds = Object.freeze(new Y.Vector3(0, 1, 0)), ti = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), Ee = new Y.Vector3(),
|
|
3568
|
+
Y = e.THREE, an = Object.freeze(new Y.Vector3(0, 0, 0)), ds = Object.freeze(new Y.Vector3(0, 1, 0)), ti = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), Ee = new Y.Vector3(), Le = new Y.Vector3(), gt = new Y.Vector3(), _t = new Y.Vector3(), Qt = new Y.Vector3(), cn = new Y.Vector3(), ln = new Y.Vector3(), dt = new Y.Spherical(), ye = new Y.Spherical(), de = new Y.Box3(), hn = new Y.Box3(), ei = new Y.Sphere(), En = new Y.Quaternion(), si = new Y.Quaternion(), ii = new Y.Matrix4(), us = new Y.Raycaster();
|
|
3569
3569
|
}
|
|
3570
3570
|
/**
|
|
3571
3571
|
* list all ACTIONs
|
|
3572
3572
|
* @category Statics
|
|
3573
3573
|
*/
|
|
3574
3574
|
static get ACTION() {
|
|
3575
|
-
return
|
|
3575
|
+
return P;
|
|
3576
3576
|
}
|
|
3577
3577
|
/**
|
|
3578
3578
|
* Creates a `CameraControls` instance.
|
|
@@ -3593,10 +3593,10 @@ class ot extends Or {
|
|
|
3593
3593
|
*/
|
|
3594
3594
|
constructor(e, t) {
|
|
3595
3595
|
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 = () => {
|
|
3596
|
-
}, this._enabled = !0, this._state =
|
|
3596
|
+
}, this._enabled = !0, this._state = P.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 = le.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, T, O) => {
|
|
3597
3597
|
let _, S;
|
|
3598
3598
|
if (Zt(this._camera)) {
|
|
3599
|
-
const N = G.copy(this._camera.position).sub(this._target),
|
|
3599
|
+
const N = G.copy(this._camera.position).sub(this._target), L = this._camera.getEffectiveFOV() * Se, w = N.length() * Math.tan(L * 0.5);
|
|
3600
3600
|
_ = this.truckSpeed * f * w / this._elementRect.height, S = this.truckSpeed * T * w / this._elementRect.height;
|
|
3601
3601
|
} else if (bt(this._camera)) {
|
|
3602
3602
|
const N = this._camera;
|
|
@@ -3608,25 +3608,25 @@ class ot extends Or {
|
|
|
3608
3608
|
const O = he * this.azimuthRotateSpeed * f / this._elementRect.height, _ = he * this.polarRotateSpeed * T / this._elementRect.height;
|
|
3609
3609
|
this.rotate(O, _, !0);
|
|
3610
3610
|
}, this._dollyInternal = (f, T, O) => {
|
|
3611
|
-
const _ = Math.pow(0.95, -f * this.dollySpeed), S = this._sphericalEnd.radius, N = this._sphericalEnd.radius * _,
|
|
3612
|
-
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(w, !0), this._dollyToNoClamp(
|
|
3611
|
+
const _ = Math.pow(0.95, -f * this.dollySpeed), S = this._sphericalEnd.radius, N = this._sphericalEnd.radius * _, L = mt(N, this.minDistance, this.maxDistance), w = L - N;
|
|
3612
|
+
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(w, !0), this._dollyToNoClamp(L, !0)) : this._dollyToNoClamp(L, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : L) - S, this._dollyControlCoord.set(T, O)), this._lastDollyDirection = Math.sign(-f);
|
|
3613
3613
|
}, this._zoomInternal = (f, T, O) => {
|
|
3614
3614
|
const _ = Math.pow(0.95, f * this.dollySpeed), S = this._zoom, N = this._zoom * _;
|
|
3615
3615
|
this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N - S, this._dollyControlCoord.set(T, O));
|
|
3616
|
-
}, typeof Y > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = e, this._yAxisUpSpace = new Y.Quaternion().setFromUnitVectors(this._camera.up, ds), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state =
|
|
3616
|
+
}, typeof Y > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = e, this._yAxisUpSpace = new Y.Quaternion().setFromUnitVectors(this._camera.up, ds), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = P.NONE, this._target = new Y.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new Y.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new Y.Spherical().setFromVector3(G.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
|
|
3617
3617
|
new Y.Vector3(),
|
|
3618
3618
|
new Y.Vector3(),
|
|
3619
3619
|
new Y.Vector3(),
|
|
3620
3620
|
new Y.Vector3()
|
|
3621
3621
|
], this._updateNearPlaneCorners(), this._boundary = new Y.Box3(new Y.Vector3(-1 / 0, -1 / 0, -1 / 0), new Y.Vector3(1 / 0, 1 / 0, 1 / 0)), this._cameraUp0 = this._camera.up.clone(), this._target0 = this._target.clone(), this._position0 = this._camera.position.clone(), this._zoom0 = this._zoom, this._focalOffset0 = this._focalOffset.clone(), this._dollyControlCoord = new Y.Vector2(), this.mouseButtons = {
|
|
3622
|
-
left:
|
|
3623
|
-
middle:
|
|
3624
|
-
right:
|
|
3625
|
-
wheel: Zt(this._camera) ?
|
|
3622
|
+
left: P.ROTATE,
|
|
3623
|
+
middle: P.DOLLY,
|
|
3624
|
+
right: P.TRUCK,
|
|
3625
|
+
wheel: Zt(this._camera) ? P.DOLLY : bt(this._camera) ? P.ZOOM : P.NONE
|
|
3626
3626
|
}, this.touches = {
|
|
3627
|
-
one:
|
|
3628
|
-
two: Zt(this._camera) ?
|
|
3629
|
-
three:
|
|
3627
|
+
one: P.TOUCH_ROTATE,
|
|
3628
|
+
two: Zt(this._camera) ? P.TOUCH_DOLLY_TRUCK : bt(this._camera) ? P.TOUCH_ZOOM_TRUCK : P.NONE,
|
|
3629
|
+
three: P.TOUCH_TRUCK
|
|
3630
3630
|
};
|
|
3631
3631
|
const s = new Y.Vector2(), i = new Y.Vector2(), o = new Y.Vector2(), n = (f) => {
|
|
3632
3632
|
if (!this._enabled || !this._domElement)
|
|
@@ -3703,7 +3703,7 @@ class ot extends Or {
|
|
|
3703
3703
|
if (T && this._disposePointer(T), f.pointerType === "touch")
|
|
3704
3704
|
switch (this._activePointers.length) {
|
|
3705
3705
|
case 0:
|
|
3706
|
-
this._state =
|
|
3706
|
+
this._state = P.NONE;
|
|
3707
3707
|
break;
|
|
3708
3708
|
case 1:
|
|
3709
3709
|
this._state = this.touches.one;
|
|
@@ -3716,45 +3716,45 @@ class ot extends Or {
|
|
|
3716
3716
|
break;
|
|
3717
3717
|
}
|
|
3718
3718
|
else
|
|
3719
|
-
this._state =
|
|
3719
|
+
this._state = P.NONE;
|
|
3720
3720
|
C();
|
|
3721
3721
|
}
|
|
3722
3722
|
}, d = () => {
|
|
3723
3723
|
const f = this._findPointerById(1);
|
|
3724
|
-
f && f === this._lockedPointer || (f && this._disposePointer(f), this._state =
|
|
3724
|
+
f && f === this._lockedPointer || (f && this._disposePointer(f), this._state = P.NONE, C());
|
|
3725
3725
|
};
|
|
3726
3726
|
let E = -1;
|
|
3727
3727
|
const u = (f) => {
|
|
3728
|
-
if (!this._domElement || !this._enabled || this.mouseButtons.wheel ===
|
|
3728
|
+
if (!this._domElement || !this._enabled || this.mouseButtons.wheel === P.NONE)
|
|
3729
3729
|
return;
|
|
3730
3730
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
3731
|
-
const N = this._domElement.getBoundingClientRect(),
|
|
3732
|
-
if (
|
|
3731
|
+
const N = this._domElement.getBoundingClientRect(), L = f.clientX / N.width, w = f.clientY / N.height;
|
|
3732
|
+
if (L < this._interactiveArea.left || L > this._interactiveArea.right || w < this._interactiveArea.top || w > this._interactiveArea.bottom)
|
|
3733
3733
|
return;
|
|
3734
3734
|
}
|
|
3735
|
-
if (f.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel ===
|
|
3735
|
+
if (f.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === P.ROTATE || this.mouseButtons.wheel === P.TRUCK) {
|
|
3736
3736
|
const N = performance.now();
|
|
3737
3737
|
E - N < 1e3 && this._getClientRect(this._elementRect), E = N;
|
|
3738
3738
|
}
|
|
3739
3739
|
const T = _r ? -1 : -3, O = f.deltaMode === 1 ? f.deltaY / T : f.deltaY / (T * 10), _ = this.dollyToCursor ? (f.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, S = this.dollyToCursor ? (f.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
3740
3740
|
switch (this.mouseButtons.wheel) {
|
|
3741
|
-
case
|
|
3741
|
+
case P.ROTATE: {
|
|
3742
3742
|
this._rotateInternal(f.deltaX, f.deltaY), this._isUserControllingRotate = !0;
|
|
3743
3743
|
break;
|
|
3744
3744
|
}
|
|
3745
|
-
case
|
|
3745
|
+
case P.TRUCK: {
|
|
3746
3746
|
this._truckInternal(f.deltaX, f.deltaY, !1), this._isUserControllingTruck = !0;
|
|
3747
3747
|
break;
|
|
3748
3748
|
}
|
|
3749
|
-
case
|
|
3749
|
+
case P.OFFSET: {
|
|
3750
3750
|
this._truckInternal(f.deltaX, f.deltaY, !0), this._isUserControllingOffset = !0;
|
|
3751
3751
|
break;
|
|
3752
3752
|
}
|
|
3753
|
-
case
|
|
3753
|
+
case P.DOLLY: {
|
|
3754
3754
|
this._dollyInternal(-O, _, S), this._isUserControllingDolly = !0;
|
|
3755
3755
|
break;
|
|
3756
3756
|
}
|
|
3757
|
-
case
|
|
3757
|
+
case P.ZOOM: {
|
|
3758
3758
|
this._zoomInternal(-O, _, S), this._isUserControllingZoom = !0;
|
|
3759
3759
|
break;
|
|
3760
3760
|
}
|
|
@@ -3775,8 +3775,8 @@ class ot extends Or {
|
|
|
3775
3775
|
if ($s(this._activePointers, lt), this._getClientRect(this._elementRect), s.copy(lt), i.copy(lt), this._activePointers.length >= 2) {
|
|
3776
3776
|
const O = lt.x - this._activePointers[1].clientX, _ = lt.y - this._activePointers[1].clientY, S = Math.sqrt(O * O + _ * _);
|
|
3777
3777
|
o.set(0, S);
|
|
3778
|
-
const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5,
|
|
3779
|
-
i.set(N,
|
|
3778
|
+
const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, L = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
|
3779
|
+
i.set(N, L);
|
|
3780
3780
|
}
|
|
3781
3781
|
if (this._state = 0, !f)
|
|
3782
3782
|
this._lockedPointer && (this._state = this._state | this.mouseButtons.left);
|
|
@@ -3794,23 +3794,23 @@ class ot extends Or {
|
|
|
3794
3794
|
}
|
|
3795
3795
|
else
|
|
3796
3796
|
!this._lockedPointer && (f.buttons & V.LEFT) === V.LEFT && (this._state = this._state | this.mouseButtons.left), (f.buttons & V.MIDDLE) === V.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (f.buttons & V.RIGHT) === V.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
3797
|
-
((this._state &
|
|
3797
|
+
((this._state & P.ROTATE) === P.ROTATE || (this._state & P.TOUCH_ROTATE) === P.TOUCH_ROTATE || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), ((this._state & P.TRUCK) === P.TRUCK || (this._state & P.TOUCH_TRUCK) === P.TOUCH_TRUCK || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & P.DOLLY) === P.DOLLY || (this._state & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & P.ZOOM) === P.ZOOM || (this._state & P.TOUCH_ZOOM) === P.TOUCH_ZOOM || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & P.OFFSET) === P.OFFSET || (this._state & P.TOUCH_OFFSET) === P.TOUCH_OFFSET || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
|
|
3798
3798
|
}, m = () => {
|
|
3799
3799
|
if (!this._enabled || !this._dragNeedsUpdate)
|
|
3800
3800
|
return;
|
|
3801
3801
|
this._dragNeedsUpdate = !1, $s(this._activePointers, lt);
|
|
3802
3802
|
const T = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, O = T ? -T.deltaX : i.x - lt.x, _ = T ? -T.deltaY : i.y - lt.y;
|
|
3803
|
-
if (i.copy(lt), ((this._state &
|
|
3804
|
-
const S = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, N = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0,
|
|
3805
|
-
(this._state &
|
|
3803
|
+
if (i.copy(lt), ((this._state & P.ROTATE) === P.ROTATE || (this._state & P.TOUCH_ROTATE) === P.TOUCH_ROTATE || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(O, _), this._isUserControllingRotate = !0), (this._state & P.DOLLY) === P.DOLLY || (this._state & P.ZOOM) === P.ZOOM) {
|
|
3804
|
+
const S = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, N = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, L = this.dollyDragInverted ? -1 : 1;
|
|
3805
|
+
(this._state & P.DOLLY) === P.DOLLY ? (this._dollyInternal(L * _ * Es, S, N), this._isUserControllingDolly = !0) : (this._zoomInternal(L * _ * Es, S, N), this._isUserControllingZoom = !0);
|
|
3806
3806
|
}
|
|
3807
|
-
if ((this._state &
|
|
3808
|
-
const S = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY,
|
|
3809
|
-
o.set(0,
|
|
3807
|
+
if ((this._state & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_ZOOM) === P.TOUCH_ZOOM || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) {
|
|
3808
|
+
const S = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY, L = Math.sqrt(S * S + N * N), w = o.y - L;
|
|
3809
|
+
o.set(0, L);
|
|
3810
3810
|
const y = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, U = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
3811
|
-
(this._state &
|
|
3811
|
+
(this._state & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(w * Es, y, U), this._isUserControllingDolly = !0) : (this._zoomInternal(w * Es, y, U), this._isUserControllingZoom = !0);
|
|
3812
3812
|
}
|
|
3813
|
-
((this._state &
|
|
3813
|
+
((this._state & P.TRUCK) === P.TRUCK || (this._state & P.TOUCH_TRUCK) === P.TOUCH_TRUCK || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK) && (this._truckInternal(O, _, !1), this._isUserControllingTruck = !0), ((this._state & P.OFFSET) === P.OFFSET || (this._state & P.TOUCH_OFFSET) === P.TOUCH_OFFSET || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET) && (this._truckInternal(O, _, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
3814
3814
|
}, C = () => {
|
|
3815
3815
|
$s(this._activePointers, lt), i.copy(lt), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.removeEventListener("mouseup", d), this.dispatchEvent({ type: "controlend" }));
|
|
3816
3816
|
};
|
|
@@ -3836,7 +3836,7 @@ class ot extends Or {
|
|
|
3836
3836
|
}, this._removeAllEventListeners = () => {
|
|
3837
3837
|
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", n), this._domElement.removeEventListener("mousedown", r), this._domElement.removeEventListener("pointercancel", h), this._domElement.removeEventListener("wheel", u, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.removeEventListener("pointerlockchange", R), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
|
|
3838
3838
|
}, this.cancel = () => {
|
|
3839
|
-
this._state !==
|
|
3839
|
+
this._state !== P.NONE && (this._state = P.NONE, this._activePointers.length = 0, C());
|
|
3840
3840
|
}, t && this.connect(t), this.update(0);
|
|
3841
3841
|
}
|
|
3842
3842
|
/**
|
|
@@ -4092,7 +4092,7 @@ class ot extends Or {
|
|
|
4092
4092
|
* @category Methods
|
|
4093
4093
|
*/
|
|
4094
4094
|
dollyInFixed(e, t = !1) {
|
|
4095
|
-
this._targetEnd.add(this._getCameraDirection(
|
|
4095
|
+
this._targetEnd.add(this._getCameraDirection(Le).multiplyScalar(e)), t || this._target.copy(this._targetEnd);
|
|
4096
4096
|
const s = !t || k(this._target.x, this._targetEnd.x, this.restThreshold) && k(this._target.y, this._targetEnd.y, this.restThreshold) && k(this._target.z, this._targetEnd.z, this.restThreshold);
|
|
4097
4097
|
return this._createOnRestPromise(s);
|
|
4098
4098
|
}
|
|
@@ -4520,7 +4520,7 @@ class ot extends Or {
|
|
|
4520
4520
|
}
|
|
4521
4521
|
if (this.dollyToCursor) {
|
|
4522
4522
|
if (Zt(this._camera) && this._changedDolly !== 0) {
|
|
4523
|
-
const d = this._spherical.radius - this._lastDistance, E = this._camera, u = this._getCameraDirection(
|
|
4523
|
+
const d = this._spherical.radius - this._lastDistance, E = this._camera, u = this._getCameraDirection(Le), p = G.copy(u).cross(E.up).normalize();
|
|
4524
4524
|
p.lengthSq() === 0 && (p.x = 1);
|
|
4525
4525
|
const A = z.crossVectors(p, u), m = this._sphericalEnd.radius * Math.tan(E.getEffectiveFOV() * Se * 0.5), R = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = Ee.copy(this._targetEnd).add(p.multiplyScalar(this._dollyControlCoord.x * m * E.aspect)).add(A.multiplyScalar(this._dollyControlCoord.y * m)), f = G.copy(this._targetEnd).lerp(F, R), T = this._lastDollyDirection === le.IN && this._spherical.radius <= this.minDistance, O = this._lastDollyDirection === le.OUT && this.maxDistance <= this._spherical.radius;
|
|
4526
4526
|
if (this.infinityDolly && (T || O)) {
|
|
@@ -4532,7 +4532,7 @@ class ot extends Or {
|
|
|
4532
4532
|
const _ = z.subVectors(f, this._targetEnd);
|
|
4533
4533
|
this._targetEnd.copy(f), this._target.add(_), this._changedDolly -= d, X(this._changedDolly) && (this._changedDolly = 0);
|
|
4534
4534
|
} else if (bt(this._camera) && this._changedZoom !== 0) {
|
|
4535
|
-
const d = this._zoom - this._lastZoom, E = this._camera, u = G.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (E.near + E.far) / (E.near - E.far)).unproject(E), p = z.set(0, 0, -1).applyQuaternion(E.quaternion), A = Ee.copy(u).add(p.multiplyScalar(-u.dot(E.up))), C = -(this._zoom - d - this._zoom) / this._zoom, R = this._getCameraDirection(
|
|
4535
|
+
const d = this._zoom - this._lastZoom, E = this._camera, u = G.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (E.near + E.far) / (E.near - E.far)).unproject(E), p = z.set(0, 0, -1).applyQuaternion(E.quaternion), A = Ee.copy(u).add(p.multiplyScalar(-u.dot(E.up))), C = -(this._zoom - d - this._zoom) / this._zoom, R = this._getCameraDirection(Le), F = this._targetEnd.dot(R), f = G.copy(this._targetEnd).lerp(A, C), T = f.dot(R), O = R.multiplyScalar(T - F);
|
|
4536
4536
|
f.sub(O), this._boundary.clampPoint(f, f);
|
|
4537
4537
|
const _ = z.subVectors(f, this._targetEnd);
|
|
4538
4538
|
this._targetEnd.copy(f), this._target.add(_), this._changedZoom -= d, X(this._changedZoom) && (this._changedZoom = 0);
|
|
@@ -4583,7 +4583,7 @@ class ot extends Or {
|
|
|
4583
4583
|
*/
|
|
4584
4584
|
fromJSON(e, t = !1) {
|
|
4585
4585
|
const s = JSON.parse(e);
|
|
4586
|
-
this.enabled = s.enabled, this.minDistance = s.minDistance, this.maxDistance =
|
|
4586
|
+
this.enabled = s.enabled, this.minDistance = s.minDistance, this.maxDistance = Pe(s.maxDistance), this.minZoom = s.minZoom, this.maxZoom = Pe(s.maxZoom), this.minPolarAngle = s.minPolarAngle, this.maxPolarAngle = Pe(s.maxPolarAngle), this.minAzimuthAngle = Pe(s.minAzimuthAngle), this.maxAzimuthAngle = Pe(s.maxAzimuthAngle), this.smoothTime = s.smoothTime, this.draggingSmoothTime = s.draggingSmoothTime, this.dollySpeed = s.dollySpeed, this.truckSpeed = s.truckSpeed, this.dollyToCursor = s.dollyToCursor, this.verticalDragToForward = s.verticalDragToForward, this._target0.fromArray(s.target0), this._position0.fromArray(s.position0), this._zoom0 = s.zoom0, this._focalOffset0.fromArray(s.focalOffset0), this.moveTo(s.target[0], s.target[1], s.target[2], t), dt.setFromVector3(G.fromArray(s.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)), this.rotateTo(dt.theta, dt.phi, t), this.dollyTo(dt.radius, t), this.zoomTo(s.zoom, t), this.setFocalOffset(s.focalOffset[0], s.focalOffset[1], s.focalOffset[2], t), this._needsUpdate = !0;
|
|
4587
4587
|
}
|
|
4588
4588
|
/**
|
|
4589
4589
|
* Attach all internal event handlers to enable drag control.
|
|
@@ -4656,7 +4656,7 @@ class ot extends Or {
|
|
|
4656
4656
|
let e = 1 / 0;
|
|
4657
4657
|
if (!(this.colliderMeshes.length >= 1) || Js(this._camera, "_collisionTest"))
|
|
4658
4658
|
return e;
|
|
4659
|
-
const s = this._getTargetDirection(
|
|
4659
|
+
const s = this._getTargetDirection(Le);
|
|
4660
4660
|
ii.lookAt(an, s, this._camera.up);
|
|
4661
4661
|
for (let i = 0; i < 4; i++) {
|
|
4662
4662
|
const o = z.copy(this._nearPlaneCorners[i]);
|
|
@@ -5158,12 +5158,12 @@ const _s = class _s extends et {
|
|
|
5158
5158
|
*/
|
|
5159
5159
|
I(_s, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
|
|
5160
5160
|
let dn = _s;
|
|
5161
|
-
const jt = new jn(), nt = new M(), xt = new M(), j = new
|
|
5161
|
+
const jt = new jn(), nt = new M(), xt = new M(), j = new Pt(), un = {
|
|
5162
5162
|
X: new M(1, 0, 0),
|
|
5163
5163
|
Y: new M(0, 1, 0),
|
|
5164
5164
|
Z: new M(0, 0, 1)
|
|
5165
5165
|
}, ni = { type: "change" }, In = { type: "mouseDown" }, fn = { type: "mouseUp", mode: null }, pn = { type: "objectChange" };
|
|
5166
|
-
class
|
|
5166
|
+
class Pr extends ri {
|
|
5167
5167
|
constructor(e, t) {
|
|
5168
5168
|
super(), t === void 0 && (console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'), t = document), this.isTransformControls = !0, this.visible = !1, this.domElement = t, this.domElement.style.touchAction = "none";
|
|
5169
5169
|
const s = new Ur();
|
|
@@ -5183,8 +5183,8 @@ class Lr extends ri {
|
|
|
5183
5183
|
}), o[R] = F, i[R] = F, s[R] = F;
|
|
5184
5184
|
}
|
|
5185
5185
|
n("camera", e), n("object", void 0), n("enabled", !0), n("axis", null), n("mode", "translate"), n("translationSnap", null), n("rotationSnap", null), n("scaleSnap", null), n("space", "world"), n("size", 1), n("dragging", !1), n("showX", !0), n("showY", !0), n("showZ", !0);
|
|
5186
|
-
const r = new M(), a = new M(), c = new
|
|
5187
|
-
n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", h), n("cameraPosition", d), n("cameraQuaternion", E), n("pointStart", u), n("pointEnd", p), n("rotationAxis", A), n("rotationAngle", m), n("eye", C), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new
|
|
5186
|
+
const r = new M(), a = new M(), c = new Pt(), h = new Pt(), d = new M(), E = new Pt(), u = new M(), p = new M(), A = new M(), m = 0, C = new M();
|
|
5187
|
+
n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", h), n("cameraPosition", d), n("cameraQuaternion", E), n("pointStart", u), n("pointEnd", p), n("rotationAxis", A), n("rotationAngle", m), n("eye", C), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new Pt(), this._parentQuaternionInv = new Pt(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new Pt(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new Pt(), this._scaleStart = new M(), this._getPointer = Lr.bind(this), this._onPointerDown = Mr.bind(this), this._onPointerHover = yr.bind(this), this._onPointerMove = wr.bind(this), this._onPointerUp = Dr.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
|
|
5188
5188
|
}
|
|
5189
5189
|
// updateMatrixWorld updates key transformation variables
|
|
5190
5190
|
updateMatrixWorld() {
|
|
@@ -5275,7 +5275,7 @@ class Lr extends ri {
|
|
|
5275
5275
|
this.space = e;
|
|
5276
5276
|
}
|
|
5277
5277
|
}
|
|
5278
|
-
function
|
|
5278
|
+
function Lr(l) {
|
|
5279
5279
|
if (this.domElement.ownerDocument.pointerLockElement)
|
|
5280
5280
|
return {
|
|
5281
5281
|
x: 0,
|
|
@@ -5316,7 +5316,7 @@ function oi(l, e, t) {
|
|
|
5316
5316
|
return s[i];
|
|
5317
5317
|
return !1;
|
|
5318
5318
|
}
|
|
5319
|
-
const Is = new qn(), W = new M(0, 1, 0), Cn = new M(0, 0, 0), Tn = new yt(), fs = new
|
|
5319
|
+
const Is = new qn(), W = new M(0, 1, 0), Cn = new M(0, 0, 0), Tn = new yt(), fs = new Pt(), Rs = new Pt(), St = new M(), mn = new yt(), De = new M(1, 0, 0), qt = new M(0, 1, 0), Ue = new M(0, 0, 1), ps = new M(), Me = new M(), we = new M();
|
|
5320
5320
|
class Ur extends ri {
|
|
5321
5321
|
constructor() {
|
|
5322
5322
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
|
@@ -5462,7 +5462,7 @@ class Ur extends ri {
|
|
|
5462
5462
|
AXIS: [
|
|
5463
5463
|
[new Dt(C, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
5464
5464
|
]
|
|
5465
|
-
},
|
|
5465
|
+
}, L = {
|
|
5466
5466
|
XYZE: [
|
|
5467
5467
|
[new v(new $n(0.25, 10, 8), s)]
|
|
5468
5468
|
],
|
|
@@ -5553,7 +5553,7 @@ class Ur extends ri {
|
|
|
5553
5553
|
}
|
|
5554
5554
|
return H;
|
|
5555
5555
|
}
|
|
5556
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = x(T)), this.add(this.gizmo.rotate = x(S)), this.add(this.gizmo.scale = x(w)), this.add(this.picker.translate = x(O)), this.add(this.picker.rotate = x(
|
|
5556
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = x(T)), this.add(this.gizmo.rotate = x(S)), this.add(this.gizmo.scale = x(w)), this.add(this.picker.translate = x(O)), this.add(this.picker.rotate = x(L)), this.add(this.picker.scale = x(y)), this.add(this.helper.translate = x(_)), this.add(this.helper.rotate = x(N)), this.add(this.helper.scale = x(U)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
5557
5557
|
}
|
|
5558
5558
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
5559
5559
|
updateMatrixWorld(e) {
|
|
@@ -5580,7 +5580,7 @@ class xr extends v {
|
|
|
5580
5580
|
constructor() {
|
|
5581
5581
|
super(
|
|
5582
5582
|
new Jn(1e5, 1e5, 2, 2),
|
|
5583
|
-
new yn({ visible: !1, wireframe: !0, side:
|
|
5583
|
+
new yn({ visible: !1, wireframe: !0, side: Ln, transparent: !0, opacity: 0.1, toneMapped: !1 })
|
|
5584
5584
|
), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
|
|
5585
5585
|
}
|
|
5586
5586
|
updateMatrixWorld(e) {
|
|
@@ -5620,7 +5620,7 @@ class xr extends v {
|
|
|
5620
5620
|
St.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (mn.lookAt(nt.set(0, 0, 0), St, W), this.quaternion.setFromRotationMatrix(mn)), super.updateMatrixWorld(e);
|
|
5621
5621
|
}
|
|
5622
5622
|
}
|
|
5623
|
-
class
|
|
5623
|
+
class Pi {
|
|
5624
5624
|
constructor(e, t, s, i, o, n = 5, r = !0) {
|
|
5625
5625
|
/** Event that fires when the user starts dragging a clipping plane. */
|
|
5626
5626
|
I(this, "onDraggingStarted", new D());
|
|
@@ -5666,7 +5666,7 @@ class Li {
|
|
|
5666
5666
|
});
|
|
5667
5667
|
if (this.components = e, this.world = t, !t.renderer)
|
|
5668
5668
|
throw new Error("The given world must have a renderer!");
|
|
5669
|
-
this.normal = i, this.origin = s, t.renderer.setPlane(!0, this.three), this._planeMesh =
|
|
5669
|
+
this.normal = i, this.origin = s, t.renderer.setPlane(!0, this.three), this._planeMesh = Pi.newPlaneMesh(n, o), this._helper = this.newHelper(), this._controls = this.newTransformControls(), this.three.setFromNormalAndCoplanarPoint(i, s), r && this.toggleControls(!0);
|
|
5670
5670
|
}
|
|
5671
5671
|
/**
|
|
5672
5672
|
* Getter for the enabled state of the clipping plane.
|
|
@@ -5756,7 +5756,7 @@ class Li {
|
|
|
5756
5756
|
newTransformControls() {
|
|
5757
5757
|
if (!this.world.renderer)
|
|
5758
5758
|
throw new Error("No renderer found for clipping plane!");
|
|
5759
|
-
const e = this.world.camera.three, t = this.world.renderer.three.domElement, s = new
|
|
5759
|
+
const e = this.world.camera.three, t = this.world.renderer.three.domElement, s = new Pr(e, t);
|
|
5760
5760
|
return this.initializeControls(s), this.world.scene.three.add(s), s;
|
|
5761
5761
|
}
|
|
5762
5762
|
initializeControls(e) {
|
|
@@ -5832,7 +5832,7 @@ const ve = class ve extends et {
|
|
|
5832
5832
|
* The type of clipping plane to be created.
|
|
5833
5833
|
* Default is {@link SimplePlane}.
|
|
5834
5834
|
*/
|
|
5835
|
-
I(this, "Type",
|
|
5835
|
+
I(this, "Type", Pi);
|
|
5836
5836
|
/**
|
|
5837
5837
|
* A list of all the clipping planes created by this component.
|
|
5838
5838
|
*/
|
|
@@ -7250,7 +7250,7 @@ const vn = /* @__PURE__ */ new Set([
|
|
|
7250
7250
|
*/
|
|
7251
7251
|
I(Ns, "uuid", "b32c4332-cd67-436e-ba7f-196646c7a635");
|
|
7252
7252
|
let mi = Ns;
|
|
7253
|
-
const
|
|
7253
|
+
const Ps = class Ps extends et {
|
|
7254
7254
|
constructor(t) {
|
|
7255
7255
|
super(t);
|
|
7256
7256
|
/** {@link Disposable.onDisposed} */
|
|
@@ -7277,7 +7277,7 @@ const Ls = class Ls extends et {
|
|
|
7277
7277
|
/** {@link Component.enabled} */
|
|
7278
7278
|
I(this, "enabled", !0);
|
|
7279
7279
|
I(this, "_loader", new to());
|
|
7280
|
-
this.components.add(
|
|
7280
|
+
this.components.add(Ps.uuid, this);
|
|
7281
7281
|
}
|
|
7282
7282
|
/**
|
|
7283
7283
|
* Getter for the meshes of all fragments in the FragmentsManager.
|
|
@@ -7408,8 +7408,8 @@ const Ls = class Ls extends et {
|
|
|
7408
7408
|
* A unique identifier for the component.
|
|
7409
7409
|
* This UUID is used to register the component within the Components system.
|
|
7410
7410
|
*/
|
|
7411
|
-
I(
|
|
7412
|
-
let ut =
|
|
7411
|
+
I(Ps, "uuid", "fef46874-46a3-461b-8c44-2922ab77c806");
|
|
7412
|
+
let ut = Ps;
|
|
7413
7413
|
const Xr = /* @__PURE__ */ new Map([
|
|
7414
7414
|
[
|
|
7415
7415
|
b.IFCRELAGGREGATES,
|
|
@@ -9023,19 +9023,19 @@ const Bn = {
|
|
|
9023
9023
|
};
|
|
9024
9024
|
class Kt {
|
|
9025
9025
|
static async getUnits(e) {
|
|
9026
|
-
var n;
|
|
9026
|
+
var n, r, a;
|
|
9027
9027
|
const { IFCUNITASSIGNMENT: t } = b, s = await e.getAllPropertiesOfType(t);
|
|
9028
9028
|
if (!s)
|
|
9029
9029
|
return 1;
|
|
9030
9030
|
const i = Object.keys(s), o = s[parseInt(i[0], 10)];
|
|
9031
|
-
for (const
|
|
9032
|
-
if (
|
|
9031
|
+
for (const c of o.Units) {
|
|
9032
|
+
if (c.value === void 0 || c.value === null)
|
|
9033
9033
|
continue;
|
|
9034
|
-
const
|
|
9035
|
-
if (!
|
|
9034
|
+
const h = await e.getProperties(c.value);
|
|
9035
|
+
if (!h || !h.UnitType || !h.UnitType.value || h.UnitType.value !== "LENGTHUNIT")
|
|
9036
9036
|
continue;
|
|
9037
|
-
let
|
|
9038
|
-
return
|
|
9037
|
+
let E = 1, u = 1;
|
|
9038
|
+
return h.Name.value === "METRE" && (u = 1), h.Name.value === "FOOT" && (u = 0.3048), ((n = h.Prefix) == null ? void 0 : n.value) === "MILLI" ? E = 1e-3 : (((r = h.Prefix) == null ? void 0 : r.value) === "CENTI" || ((a = h.Prefix) == null ? void 0 : a.value) === "DECI") && (E = 0.01), u * E;
|
|
9039
9039
|
}
|
|
9040
9040
|
return 1;
|
|
9041
9041
|
}
|
|
@@ -9166,13 +9166,13 @@ class Qr {
|
|
|
9166
9166
|
e.copy(s);
|
|
9167
9167
|
}
|
|
9168
9168
|
setUp(e) {
|
|
9169
|
-
var o;
|
|
9169
|
+
var o, n, r;
|
|
9170
9170
|
this.factor = 1;
|
|
9171
9171
|
const t = this.getLengthUnits(e);
|
|
9172
9172
|
if (!t)
|
|
9173
9173
|
return;
|
|
9174
9174
|
const s = t == null, i = t.Name === void 0 || t.Name === null;
|
|
9175
|
-
s || i || (t.Name.value === "FOOT"
|
|
9175
|
+
s || i || (t.Name.value === "FOOT" && (this.factor = 0.3048), ((o = t.Prefix) == null ? void 0 : o.value) === "MILLI" ? this.complement = 1e-3 : ((n = t.Prefix) == null ? void 0 : n.value) === "CENTI" ? this.complement = 0.01 : ((r = t.Prefix) == null ? void 0 : r.value) === "DECI" && (this.complement = 0.01));
|
|
9176
9176
|
}
|
|
9177
9177
|
getLengthUnits(e) {
|
|
9178
9178
|
try {
|
|
@@ -9284,7 +9284,7 @@ class Yn {
|
|
|
9284
9284
|
this.itemsByFloor = {};
|
|
9285
9285
|
}
|
|
9286
9286
|
}
|
|
9287
|
-
class
|
|
9287
|
+
class Li {
|
|
9288
9288
|
constructor() {
|
|
9289
9289
|
/** Whether to extract the IFC properties into a JSON. */
|
|
9290
9290
|
I(this, "includeProperties", !0);
|
|
@@ -9431,7 +9431,7 @@ const Ve = class Ve extends et {
|
|
|
9431
9431
|
* The settings for the IfcLoader.
|
|
9432
9432
|
* It includes options for excluding categories, setting WASM paths, and more.
|
|
9433
9433
|
*/
|
|
9434
|
-
I(this, "settings", new
|
|
9434
|
+
I(this, "settings", new Li());
|
|
9435
9435
|
/**
|
|
9436
9436
|
* The instance of the Web-IFC library used for handling IFC data.
|
|
9437
9437
|
*/
|
|
@@ -10014,7 +10014,7 @@ const Bt = class Bt extends et {
|
|
|
10014
10014
|
*/
|
|
10015
10015
|
I(Bt, "uuid", "58c2d9f0-183c-48d6-a402-dfcf5b9a34df");
|
|
10016
10016
|
let On = Bt;
|
|
10017
|
-
const
|
|
10017
|
+
const Ls = class Ls extends et {
|
|
10018
10018
|
constructor(t) {
|
|
10019
10019
|
super(t);
|
|
10020
10020
|
/** {@link Component.enabled} */
|
|
@@ -10041,7 +10041,7 @@ const Ps = class Ps extends et {
|
|
|
10041
10041
|
}
|
|
10042
10042
|
}
|
|
10043
10043
|
});
|
|
10044
|
-
t.add(
|
|
10044
|
+
t.add(Ls.uuid, this), t.get(ut).onFragmentsDisposed.add(this.onFragmentsDisposed);
|
|
10045
10045
|
}
|
|
10046
10046
|
/** {@link Disposable.dispose} */
|
|
10047
10047
|
dispose() {
|
|
@@ -10332,8 +10332,8 @@ const Ps = class Ps extends et {
|
|
|
10332
10332
|
* A unique identifier for the component.
|
|
10333
10333
|
* This UUID is used to register the component within the Components system.
|
|
10334
10334
|
*/
|
|
10335
|
-
I(
|
|
10336
|
-
let Ai =
|
|
10335
|
+
I(Ls, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
|
|
10336
|
+
let Ai = Ls;
|
|
10337
10337
|
const ys = class ys extends et {
|
|
10338
10338
|
constructor(t) {
|
|
10339
10339
|
super(t);
|
|
@@ -10460,7 +10460,7 @@ const Ms = class Ms extends et {
|
|
|
10460
10460
|
*/
|
|
10461
10461
|
I(Ms, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
|
|
10462
10462
|
let _n = Ms;
|
|
10463
|
-
class jr extends
|
|
10463
|
+
class jr extends Li {
|
|
10464
10464
|
constructor() {
|
|
10465
10465
|
super(...arguments);
|
|
10466
10466
|
/**
|
|
@@ -10687,7 +10687,7 @@ const ws = class ws extends et {
|
|
|
10687
10687
|
*/
|
|
10688
10688
|
I(ws, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
|
|
10689
10689
|
let Sn = ws;
|
|
10690
|
-
class qr extends
|
|
10690
|
+
class qr extends Li {
|
|
10691
10691
|
constructor() {
|
|
10692
10692
|
super(...arguments);
|
|
10693
10693
|
/**
|
|
@@ -10898,9 +10898,9 @@ const Ds = class Ds extends et {
|
|
|
10898
10898
|
O.add(T);
|
|
10899
10899
|
}
|
|
10900
10900
|
for (const T of C) {
|
|
10901
|
-
const O = d.get(T), { edges: _, indices: S } = O, N = d.get(m), { edges:
|
|
10901
|
+
const O = d.get(T), { edges: _, indices: S } = O, N = d.get(m), { edges: L, indices: w } = N;
|
|
10902
10902
|
for (const y of _)
|
|
10903
|
-
|
|
10903
|
+
L.add(y), h.set(y, m);
|
|
10904
10904
|
for (const y of S)
|
|
10905
10905
|
w.add(y);
|
|
10906
10906
|
d.delete(T);
|
|
@@ -11013,7 +11013,7 @@ export {
|
|
|
11013
11013
|
oa as IfcCategories,
|
|
11014
11014
|
Bn as IfcCategoryMap,
|
|
11015
11015
|
Zr as IfcElements,
|
|
11016
|
-
|
|
11016
|
+
Li as IfcFragmentSettings,
|
|
11017
11017
|
Sn as IfcGeometryTiler,
|
|
11018
11018
|
mi as IfcJsonExporter,
|
|
11019
11019
|
Ri as IfcLoader,
|
|
@@ -11036,7 +11036,7 @@ export {
|
|
|
11036
11036
|
ze as Raycasters,
|
|
11037
11037
|
He as SimpleCamera,
|
|
11038
11038
|
Nr as SimpleGrid,
|
|
11039
|
-
|
|
11039
|
+
Pi as SimplePlane,
|
|
11040
11040
|
Ar as SimpleRaycaster,
|
|
11041
11041
|
ia as SimpleRenderer,
|
|
11042
11042
|
sa as SimpleScene,
|