@thatopen/components 2.1.17 → 2.1.19
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/fragments/IfcLoader/src/ifc-fragment-settings.d.ts +2 -0
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +1 -1
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +17 -0
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +170 -161
- package/dist/namespace.d.ts +2670 -2651
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ var Xn = Object.defineProperty;
|
|
|
2
2
|
var Zn = (l, s, t) => s in l ? Xn(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
|
|
3
3
|
var I = (l, s, t) => (Zn(l, typeof s != "symbol" ? s + "" : s, t), t);
|
|
4
4
|
import * as O from "three";
|
|
5
|
-
import { BufferAttribute as
|
|
5
|
+
import { BufferAttribute as Pn, Vector3 as M, Vector2 as fe, Plane as Fi, Line3 as Pt, Triangle as ue, Sphere as Qn, Matrix4 as yt, Box3 as gt, BackSide as jn, DoubleSide as yn, FrontSide as wi, Mesh as v, Ray as qn, Raycaster as Kn, Quaternion as Lt, Object3D as ri, Euler as $n, MeshBasicMaterial as Mn, LineBasicMaterial as Jn, CylinderGeometry as ct, BoxGeometry as rt, BufferGeometry as Di, Float32BufferAttribute as Ui, OctahedronGeometry as Ze, Line as Dt, SphereGeometry as to, TorusGeometry as Re, PlaneGeometry as eo } from "three";
|
|
6
6
|
import * as Vt from "@thatopen/fragments";
|
|
7
7
|
import { Serializer as so } from "@thatopen/fragments";
|
|
8
8
|
import * as U from "web-ifc";
|
|
@@ -19,7 +19,7 @@ function ao(l, s = ArrayBuffer) {
|
|
|
19
19
|
function co(l, s) {
|
|
20
20
|
if (!l.index) {
|
|
21
21
|
const t = l.attributes.position.count, e = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, i = ao(t, e);
|
|
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, s, t, e, i = null) {
|
|
|
97
97
|
for (let A = s * 6, F = (s + t) * 6; A < F; A += 6) {
|
|
98
98
|
const p = l[A + 0], m = l[A + 1], g = p - m, S = p + m;
|
|
99
99
|
g < o && (o = g), S > a && (a = S), C && p < d && (d = p), C && p > f && (f = p);
|
|
100
|
-
const _ = l[A + 2], N = l[A + 3],
|
|
101
|
-
|
|
100
|
+
const _ = l[A + 2], N = l[A + 3], P = _ - N, D = _ + N;
|
|
101
|
+
P < n && (n = P), D > c && (c = D), C && _ < E && (E = _), C && _ > T && (T = _);
|
|
102
102
|
const y = l[A + 4], x = l[A + 5], b = y - x, B = y + x;
|
|
103
103
|
b < r && (r = b), B > h && (h = B), C && y < u && (u = y), C && y > R && (R = y);
|
|
104
104
|
}
|
|
@@ -190,11 +190,11 @@ function fo(l, s, t, e, i, o) {
|
|
|
190
190
|
}
|
|
191
191
|
for (let p = 0; p < F; p++) {
|
|
192
192
|
const m = C[p], g = m.count, S = i - m.count, _ = m.leftCacheBounds, N = m.rightCacheBounds;
|
|
193
|
-
let
|
|
194
|
-
g !== 0 && (
|
|
193
|
+
let P = 0;
|
|
194
|
+
g !== 0 && (P = Ae(_) / a);
|
|
195
195
|
let D = 0;
|
|
196
196
|
S !== 0 && (D = Ae(N) / a);
|
|
197
|
-
const y = bi + Ys * (
|
|
197
|
+
const y = bi + Ys * (P * g + D * S);
|
|
198
198
|
y < c && (n = E, c = y, r = m.candidate);
|
|
199
199
|
}
|
|
200
200
|
} else {
|
|
@@ -221,11 +221,11 @@ function fo(l, s, t, e, i, o) {
|
|
|
221
221
|
for (let F = 0; F < Mt - 1; F++) {
|
|
222
222
|
const p = Ut[F], m = p.count, g = p.bounds, _ = Ut[F + 1].rightCacheBounds;
|
|
223
223
|
m !== 0 && (A === 0 ? Bi(g, je) : Yi(g, je, je)), A += m;
|
|
224
|
-
let N = 0,
|
|
224
|
+
let N = 0, P = 0;
|
|
225
225
|
A !== 0 && (N = Ae(je) / a);
|
|
226
226
|
const D = i - A;
|
|
227
|
-
D !== 0 && (
|
|
228
|
-
const y = bi + Ys * (N * A +
|
|
227
|
+
D !== 0 && (P = Ae(_) / a);
|
|
228
|
+
const y = bi + Ys * (N * A + P * D);
|
|
229
229
|
y < c && (n = E, c = y, r = p.candidate);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -314,14 +314,14 @@ function Ro(l, s) {
|
|
|
314
314
|
const N = fo(p.boundingData, S, f, m, g, r);
|
|
315
315
|
if (N.axis === -1)
|
|
316
316
|
return A(m + g), p.offset = m, p.count = g, p;
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
317
|
+
const P = T(h, e, f, m, g, N);
|
|
318
|
+
if (P === m || P === m + g)
|
|
319
319
|
A(m + g), p.offset = m, p.count = g;
|
|
320
320
|
else {
|
|
321
321
|
p.splitAxis = N.axis;
|
|
322
|
-
const D = new qe(), y = m, x =
|
|
322
|
+
const D = new qe(), y = m, x = P - m;
|
|
323
323
|
p.left = D, D.boundingData = new Float32Array(6), Gs(f, y, x, D.boundingData, u), F(D, y, x, u, _ + 1);
|
|
324
|
-
const b = new qe(), B =
|
|
324
|
+
const b = new qe(), B = P, H = g - x;
|
|
325
325
|
p.right = b, b.boundingData = new Float32Array(6), Gs(f, B, H, b.boundingData, u), F(b, B, H, u, _ + 1);
|
|
326
326
|
}
|
|
327
327
|
return p;
|
|
@@ -440,7 +440,7 @@ const Fo = function() {
|
|
|
440
440
|
}
|
|
441
441
|
};
|
|
442
442
|
}(), go = function() {
|
|
443
|
-
const l = new M(), s = new M(), t = new Fi(), e = new
|
|
443
|
+
const l = new M(), s = new M(), t = new Fi(), e = new Pt();
|
|
444
444
|
return function(o, n) {
|
|
445
445
|
const { radius: r, center: a } = o, { a: c, b: h, c: d } = n;
|
|
446
446
|
if (e.start = c, e.end = h, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r || (e.start = c, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r) || (e.start = h, e.end = d, e.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(), s = new M(), t = new
|
|
479
|
+
const l = new M(), s = new M(), t = new Pt();
|
|
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(), s = new Array(3), t = new Array(3), e = 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(), s = new Array(3), t = new Array(3), e = new wt(), i = new wt(), o = new M(), n = new M(), r = new M(), a = new M(), c = new M(), h = new Pt(), d = new Pt(), E = new Pt(), u = new M();
|
|
492
492
|
function f(T, R, C) {
|
|
493
493
|
const A = T.points;
|
|
494
494
|
let F = 0, p = -1;
|
|
@@ -521,22 +521,22 @@ Ft.prototype.intersectsTriangle = function() {
|
|
|
521
521
|
const m = this.satBounds, g = this.satAxes;
|
|
522
522
|
t[0] = R.a, t[1] = R.b, t[2] = R.c;
|
|
523
523
|
for (let N = 0; N < 4; N++) {
|
|
524
|
-
const
|
|
525
|
-
if (e.setFromPoints(D, t),
|
|
524
|
+
const P = m[N], D = g[N];
|
|
525
|
+
if (e.setFromPoints(D, t), P.isSeparated(e))
|
|
526
526
|
return !1;
|
|
527
527
|
}
|
|
528
528
|
const S = R.satBounds, _ = R.satAxes;
|
|
529
529
|
s[0] = this.a, s[1] = this.b, s[2] = this.c;
|
|
530
530
|
for (let N = 0; N < 4; N++) {
|
|
531
|
-
const
|
|
532
|
-
if (e.setFromPoints(D, s),
|
|
531
|
+
const P = S[N], D = _[N];
|
|
532
|
+
if (e.setFromPoints(D, s), P.isSeparated(e))
|
|
533
533
|
return !1;
|
|
534
534
|
}
|
|
535
535
|
for (let N = 0; N < 4; N++) {
|
|
536
|
-
const
|
|
536
|
+
const P = g[N];
|
|
537
537
|
for (let D = 0; D < 4; D++) {
|
|
538
538
|
const y = _[D];
|
|
539
|
-
if (o.crossVectors(
|
|
539
|
+
if (o.crossVectors(P, y), e.setFromPoints(o, s), i.setFromPoints(o, t), e.isSeparated(i))
|
|
540
540
|
return !1;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
@@ -556,8 +556,8 @@ Ft.prototype.intersectsTriangle = function() {
|
|
|
556
556
|
let x = E.start;
|
|
557
557
|
E.start = E.end, E.end = x;
|
|
558
558
|
}
|
|
559
|
-
const S = d.start.dot(r), _ = d.end.dot(r), N = E.start.dot(r),
|
|
560
|
-
return S !==
|
|
559
|
+
const S = d.start.dot(r), _ = d.end.dot(r), N = E.start.dot(r), P = E.end.dot(r), D = _ < N, y = S < P;
|
|
560
|
+
return S !== P && N !== _ && D === 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(), s = new M(), t = ["a", "b", "c"], e = new
|
|
571
|
+
const l = new M(), s = new M(), t = ["a", "b", "c"], e = new Pt(), i = new Pt();
|
|
572
572
|
return function(n, r = null, a = null) {
|
|
573
573
|
const c = r || a ? e : 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"], s = new Array(12).fill().map(() => new
|
|
681
|
+
const l = ["x", "y", "z"], s = new Array(12).fill().map(() => new Pt()), t = new Array(12).fill().map(() => new Pt()), e = 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, e), n.closestPointToPoint(e, i), a && a.copy(e), c && c.copy(i)), 0;
|
|
@@ -697,8 +697,8 @@ at.prototype.distanceToBox = function() {
|
|
|
697
697
|
for (let A = 0; A <= 1; A++) {
|
|
698
698
|
const F = (R + 1) % 3, p = (R + 2) % 3, m = C << F | A << p, g = 1 << R | C << F | A << p, S = u[m], _ = u[g];
|
|
699
699
|
s[T].set(S, _);
|
|
700
|
-
const
|
|
701
|
-
b[
|
|
700
|
+
const P = l[R], D = l[F], y = l[p], x = t[T], b = x.start, B = x.end;
|
|
701
|
+
b[P] = d[P], b[D] = C ? d[D] : E[D], b[y] = A ? d[y] : E[D], B[P] = E[P], B[D] = C ? d[D] : E[D], B[y] = A ? d[y] : E[D], T++;
|
|
702
702
|
}
|
|
703
703
|
for (let R = 0; R <= 1; R++)
|
|
704
704
|
for (let C = 0; C <= 1; C++)
|
|
@@ -786,7 +786,7 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
|
|
|
786
786
|
const E = dt(l, c), u = ft(h, a);
|
|
787
787
|
return K(l, r, Yt), e(E, u, !1, n, o + l, Yt);
|
|
788
788
|
} else {
|
|
789
|
-
let
|
|
789
|
+
let P = function(y) {
|
|
790
790
|
const { uint16Array: x, uint32Array: b } = Z;
|
|
791
791
|
let B = y * 2;
|
|
792
792
|
for (; !Et(B, x); )
|
|
@@ -810,7 +810,7 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
|
|
|
810
810
|
const p = Et(f * 2, a), m = t(A, p, R, n + 1, o + f);
|
|
811
811
|
let g;
|
|
812
812
|
if (m === xi) {
|
|
813
|
-
const y =
|
|
813
|
+
const y = P(f), b = D(f) - y;
|
|
814
814
|
g = e(y, b, !0, n + 1, o + f, A);
|
|
815
815
|
} else
|
|
816
816
|
g = m && ai(
|
|
@@ -828,7 +828,7 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
|
|
|
828
828
|
const S = Et(T * 2, a), _ = t(F, S, C, n + 1, o + T);
|
|
829
829
|
let N;
|
|
830
830
|
if (_ === xi) {
|
|
831
|
-
const y =
|
|
831
|
+
const y = P(T), b = D(T) - y;
|
|
832
832
|
N = e(y, b, !0, n + 1, o + T, F);
|
|
833
833
|
} else
|
|
834
834
|
N = _ && ai(
|
|
@@ -844,7 +844,7 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
|
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
846
|
const Fe = /* @__PURE__ */ new M(), Hs = /* @__PURE__ */ new M();
|
|
847
|
-
function
|
|
847
|
+
function Lo(l, s, t = {}, e = 0, i = 1 / 0) {
|
|
848
848
|
const o = e * e, n = i * i;
|
|
849
849
|
let r = 1 / 0, a = null;
|
|
850
850
|
if (l.shapecast(
|
|
@@ -863,7 +863,7 @@ function Po(l, s, t = {}, e = 0, i = 1 / 0) {
|
|
|
863
863
|
return t.point ? t.point.copy(Hs) : t.point = Hs.clone(), t.distance = c, t.faceIndex = a, t;
|
|
864
864
|
}
|
|
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
|
-
function
|
|
866
|
+
function Po(l, s, t, e, i, o) {
|
|
867
867
|
let n;
|
|
868
868
|
return o === jn ? n = l.intersectTriangle(e, t, s, !0, i) : n = l.intersectTriangle(s, t, e, o !== yn, i), n === null ? null : {
|
|
869
869
|
distance: l.origin.distanceTo(i),
|
|
@@ -872,7 +872,7 @@ function Lo(l, s, t, e, i, o) {
|
|
|
872
872
|
}
|
|
873
873
|
function yo(l, s, t, e, i, o, n, r, a) {
|
|
874
874
|
te.fromBufferAttribute(s, o), ee.fromBufferAttribute(s, n), se.fromBufferAttribute(s, r);
|
|
875
|
-
const c =
|
|
875
|
+
const c = Po(l, te, ee, se, es, a);
|
|
876
876
|
if (c) {
|
|
877
877
|
e && ($e.fromBufferAttribute(e, o), Je.fromBufferAttribute(e, n), ts.fromBufferAttribute(e, r), c.uv = ue.getInterpolation(es, te, ee, se, $e, Je, ts, new fe())), i && ($e.fromBufferAttribute(i, o), Je.fromBufferAttribute(i, n), ts.fromBufferAttribute(i, r), c.uv1 = ue.getInterpolation(es, te, ee, se, $e, Je, ts, new fe())), t && (Vi.fromBufferAttribute(t, o), Gi.fromBufferAttribute(t, n), zi.fromBufferAttribute(t, r), c.normal = ue.getInterpolation(es, te, ee, se, Vi, Gi, zi, new M()), c.normal.dot(l.direction) > 0 && c.normal.multiplyScalar(-1));
|
|
878
878
|
const h = {
|
|
@@ -934,7 +934,7 @@ function Uo(l, s = null) {
|
|
|
934
934
|
if (r[T + 15] === Us) {
|
|
935
935
|
const C = n[E + 6], A = r[T + 14];
|
|
936
936
|
let F = 1 / 0, p = 1 / 0, m = 1 / 0, g = -1 / 0, S = -1 / 0, _ = -1 / 0;
|
|
937
|
-
for (let N = 3 * C,
|
|
937
|
+
for (let N = 3 * C, P = 3 * (C + A); N < P; N++) {
|
|
938
938
|
let D = e[N];
|
|
939
939
|
const y = i.getX(D), x = i.getY(D), b = i.getZ(D);
|
|
940
940
|
y < F && (F = y), y > g && (g = y), x < p && (p = x), x > S && (S = x), b < m && (m = b), b > _ && (_ = b);
|
|
@@ -945,11 +945,11 @@ function Uo(l, s = null) {
|
|
|
945
945
|
let m = f, g = !1, S = !1;
|
|
946
946
|
s ? m || (g = s.has(F), S = s.has(p), m = !g && !S) : (g = !0, S = !0);
|
|
947
947
|
const _ = m || g, N = m || S;
|
|
948
|
-
let
|
|
949
|
-
_ && (
|
|
948
|
+
let P = !1;
|
|
949
|
+
_ && (P = d(C, u, m));
|
|
950
950
|
let D = !1;
|
|
951
951
|
N && (D = d(A, u, m));
|
|
952
|
-
const y =
|
|
952
|
+
const y = P || D;
|
|
953
953
|
if (y)
|
|
954
954
|
for (let x = 0; x < 3; x++) {
|
|
955
955
|
const b = C + x, B = A + x, H = a[b], q = a[b + 3], st = a[B], Q = a[B + 3];
|
|
@@ -1081,14 +1081,14 @@ function Xo(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1081
1081
|
if (s.boundsTree)
|
|
1082
1082
|
return s.boundsTree.shapecast({
|
|
1083
1083
|
boundsTraverseOrder: (_) => Oe.distanceToBox(_),
|
|
1084
|
-
intersectsBounds: (_, N,
|
|
1084
|
+
intersectsBounds: (_, N, P) => P < A && P < n,
|
|
1085
1085
|
intersectsRange: (_, N) => {
|
|
1086
|
-
for (let
|
|
1087
|
-
tt(u, 3 *
|
|
1086
|
+
for (let P = _, D = _ + N; P < D; P++) {
|
|
1087
|
+
tt(u, 3 * P, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1088
1088
|
for (let y = m, x = m + g; y < x; y++) {
|
|
1089
1089
|
tt(E, 3 * y, c, a), E.needsUpdate = !0;
|
|
1090
1090
|
const b = E.distanceToTriangle(u, f, R);
|
|
1091
|
-
if (b < A && (T.copy(f), C && C.copy(R), A = b, F = y, p =
|
|
1091
|
+
if (b < A && (T.copy(f), C && C.copy(R), A = b, F = y, p = P), b < o)
|
|
1092
1092
|
return !0;
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
@@ -1098,10 +1098,10 @@ function Xo(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1098
1098
|
const S = Ce(s);
|
|
1099
1099
|
for (let _ = 0, N = S; _ < N; _++) {
|
|
1100
1100
|
tt(u, 3 * _, 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 P = m, D = m + g; P < D; P++) {
|
|
1102
|
+
tt(E, 3 * P, c, a), E.needsUpdate = !0;
|
|
1103
1103
|
const y = E.distanceToTriangle(u, f, R);
|
|
1104
|
-
if (y < A && (T.copy(f), C && C.copy(R), A = y, F =
|
|
1104
|
+
if (y < A && (T.copy(f), C && C.copy(R), A = y, F = P, p = _), y < o)
|
|
1105
1105
|
return !0;
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
@@ -1122,7 +1122,7 @@ function Zo(l, s = null) {
|
|
|
1122
1122
|
if (r[T + 15] === Us) {
|
|
1123
1123
|
const C = n[E + 6], A = r[T + 14];
|
|
1124
1124
|
let F = 1 / 0, p = 1 / 0, m = 1 / 0, g = -1 / 0, S = -1 / 0, _ = -1 / 0;
|
|
1125
|
-
for (let N = C,
|
|
1125
|
+
for (let N = C, P = C + A; N < P; N++) {
|
|
1126
1126
|
const D = 3 * l.resolveTriangleIndex(N);
|
|
1127
1127
|
for (let y = 0; y < 3; y++) {
|
|
1128
1128
|
let x = D + y;
|
|
@@ -1137,11 +1137,11 @@ function Zo(l, s = null) {
|
|
|
1137
1137
|
let m = f, g = !1, S = !1;
|
|
1138
1138
|
s ? m || (g = s.has(F), S = s.has(p), m = !g && !S) : (g = !0, S = !0);
|
|
1139
1139
|
const _ = m || g, N = m || S;
|
|
1140
|
-
let
|
|
1141
|
-
_ && (
|
|
1140
|
+
let P = !1;
|
|
1141
|
+
_ && (P = d(C, u, m));
|
|
1142
1142
|
let D = !1;
|
|
1143
1143
|
N && (D = d(A, u, m));
|
|
1144
|
-
const y =
|
|
1144
|
+
const y = P || D;
|
|
1145
1145
|
if (y)
|
|
1146
1146
|
for (let x = 0; x < 3; x++) {
|
|
1147
1147
|
const b = C + x, B = A + x, H = a[b], q = a[b + 3], st = a[B], Q = a[B + 3];
|
|
@@ -1246,16 +1246,16 @@ function sr(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1246
1246
|
const S = s.boundsTree;
|
|
1247
1247
|
return S.shapecast({
|
|
1248
1248
|
boundsTraverseOrder: (_) => _e.distanceToBox(_),
|
|
1249
|
-
intersectsBounds: (_, N,
|
|
1249
|
+
intersectsBounds: (_, N, P) => P < A && P < n,
|
|
1250
1250
|
intersectsRange: (_, N) => {
|
|
1251
|
-
for (let
|
|
1252
|
-
const y = S.resolveTriangleIndex(
|
|
1251
|
+
for (let P = _, D = _ + N; P < D; P++) {
|
|
1252
|
+
const y = S.resolveTriangleIndex(P);
|
|
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 x = m, b = m + g; x < b; x++) {
|
|
1255
1255
|
const B = l.resolveTriangleIndex(x);
|
|
1256
1256
|
tt(E, 3 * B, c, a), E.needsUpdate = !0;
|
|
1257
1257
|
const H = E.distanceToTriangle(u, f, R);
|
|
1258
|
-
if (H < A && (T.copy(f), C && C.copy(R), A = H, F = x, p =
|
|
1258
|
+
if (H < A && (T.copy(f), C && C.copy(R), A = H, F = x, p = P), H < o)
|
|
1259
1259
|
return !0;
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
@@ -1265,11 +1265,11 @@ function sr(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1265
1265
|
const S = Ce(s);
|
|
1266
1266
|
for (let _ = 0, N = S; _ < N; _++) {
|
|
1267
1267
|
tt(u, 3 * _, 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 P = m, D = m + g; P < D; P++) {
|
|
1269
|
+
const y = l.resolveTriangleIndex(P);
|
|
1270
1270
|
tt(E, 3 * y, c, a), E.needsUpdate = !0;
|
|
1271
1271
|
const x = E.distanceToTriangle(u, f, R);
|
|
1272
|
-
if (x < A && (T.copy(f), C && C.copy(R), A = x, F =
|
|
1272
|
+
if (x < A && (T.copy(f), C && C.copy(R), A = x, F = P, p = _), x < o)
|
|
1273
1273
|
return !0;
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
@@ -1340,8 +1340,8 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1340
1340
|
else if (g) {
|
|
1341
1341
|
const _ = vt.getPrimitive();
|
|
1342
1342
|
K(s, R, _), _.applyMatrix4(t);
|
|
1343
|
-
const N = pt(l),
|
|
1344
|
-
K(N, u, ae), K(
|
|
1343
|
+
const N = pt(l), P = Ct(l, f);
|
|
1344
|
+
K(N, u, ae), K(P, u, ce);
|
|
1345
1345
|
const D = _.intersectsBox(ae), y = _.intersectsBox(ce);
|
|
1346
1346
|
S = D && Tt(
|
|
1347
1347
|
s,
|
|
@@ -1357,7 +1357,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1357
1357
|
!h
|
|
1358
1358
|
) || y && Tt(
|
|
1359
1359
|
s,
|
|
1360
|
-
|
|
1360
|
+
P,
|
|
1361
1361
|
e,
|
|
1362
1362
|
t,
|
|
1363
1363
|
i,
|
|
@@ -1371,8 +1371,8 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1371
1371
|
} else {
|
|
1372
1372
|
const _ = pt(s), N = Ct(s, C);
|
|
1373
1373
|
K(_, R, Xs), K(N, R, Zs);
|
|
1374
|
-
const
|
|
1375
|
-
if (
|
|
1374
|
+
const P = c.intersectsBox(Xs), D = c.intersectsBox(Zs);
|
|
1375
|
+
if (P && D)
|
|
1376
1376
|
S = Tt(
|
|
1377
1377
|
l,
|
|
1378
1378
|
_,
|
|
@@ -1398,7 +1398,7 @@ function Tt(l, s, t, e, 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 (P)
|
|
1402
1402
|
if (m)
|
|
1403
1403
|
S = Tt(
|
|
1404
1404
|
l,
|
|
@@ -1524,7 +1524,7 @@ class Si {
|
|
|
1524
1524
|
if (r._roots = o, r._indirectBuffer = n || null, e.setIndex) {
|
|
1525
1525
|
const a = t.getIndex();
|
|
1526
1526
|
if (a === null) {
|
|
1527
|
-
const c = new
|
|
1527
|
+
const c = new Pn(s.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 Si {
|
|
|
1648
1648
|
const f = (T, R, C, A, F, p, m, g) => {
|
|
1649
1649
|
for (let S = C, _ = C + A; S < _; S++) {
|
|
1650
1650
|
u(S), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
|
|
1651
|
-
for (let N = T,
|
|
1651
|
+
for (let N = T, P = T + R; N < P; N++)
|
|
1652
1652
|
if (c(N), n.needsUpdate = !0, o(n, h, N, S, F, p, m, g))
|
|
1653
1653
|
return !0;
|
|
1654
1654
|
}
|
|
@@ -1693,7 +1693,7 @@ class Si {
|
|
|
1693
1693
|
);
|
|
1694
1694
|
}
|
|
1695
1695
|
closestPointToPoint(s, t = {}, e = 0, i = 1 / 0) {
|
|
1696
|
-
return
|
|
1696
|
+
return Lo(
|
|
1697
1697
|
this,
|
|
1698
1698
|
s,
|
|
1699
1699
|
t,
|
|
@@ -2089,7 +2089,7 @@ class Ji extends Map {
|
|
|
2089
2089
|
this.clear(), this.onItemSet.reset(), this.onItemDeleted.reset(), this.onCleared.reset();
|
|
2090
2090
|
}
|
|
2091
2091
|
}
|
|
2092
|
-
const ms = 0, dr = 1, ur = new M(), tn = new
|
|
2092
|
+
const ms = 0, dr = 1, ur = new M(), tn = new Pt(), qs = new Fi(), en = new M(), ls = new ue();
|
|
2093
2093
|
class Ir {
|
|
2094
2094
|
constructor() {
|
|
2095
2095
|
this.tolerance = -1, this.faces = [], this.newFaces = [], this.assigned = new sn(), this.unassigned = new sn(), this.vertices = [];
|
|
@@ -2519,16 +2519,16 @@ function Rr(l) {
|
|
|
2519
2519
|
f.divideScalar(T), R /= T, C /= T, A /= T, F /= T, p /= T, m /= T, R -= f.x * f.x, C -= f.x * f.y, A -= f.x * f.z, F -= f.y * f.y, p -= f.y * f.z, m -= f.z * f.z;
|
|
2520
2520
|
const g = new O.Matrix3();
|
|
2521
2521
|
g.elements[0] = R, g.elements[1] = C, g.elements[2] = A, g.elements[3] = C, g.elements[4] = F, g.elements[5] = p, g.elements[6] = A, g.elements[7] = p, g.elements[8] = m, mr(g, e);
|
|
2522
|
-
const S = e.unitary, _ = new O.Vector3(), N = new O.Vector3(),
|
|
2523
|
-
S.extractBasis(_, N,
|
|
2522
|
+
const S = e.unitary, _ = new O.Vector3(), N = new O.Vector3(), P = new O.Vector3();
|
|
2523
|
+
S.extractBasis(_, N, P);
|
|
2524
2524
|
let D = -1 / 0, y = -1 / 0, x = -1 / 0, b = 1 / 0, B = 1 / 0, H = 1 / 0;
|
|
2525
2525
|
for (let it = 0, Xt = s.length; it < Xt; it++) {
|
|
2526
2526
|
const J = s[it];
|
|
2527
|
-
D = Math.max(_.dot(J), D), y = Math.max(N.dot(J), y), x = Math.max(
|
|
2527
|
+
D = Math.max(_.dot(J), D), y = Math.max(N.dot(J), y), x = Math.max(P.dot(J), x), b = Math.min(_.dot(J), b), B = Math.min(N.dot(J), B), H = Math.min(P.dot(J), H);
|
|
2528
2528
|
}
|
|
2529
|
-
_.multiplyScalar(0.5 * (b + D)), N.multiplyScalar(0.5 * (B + y)),
|
|
2529
|
+
_.multiplyScalar(0.5 * (b + D)), N.multiplyScalar(0.5 * (B + y)), P.multiplyScalar(0.5 * (H + x));
|
|
2530
2530
|
const q = new O.Vector3(), st = new O.Vector3(), Q = new O.Matrix3();
|
|
2531
|
-
q.add(_).add(N).add(
|
|
2531
|
+
q.add(_).add(N).add(P), st.x = D - b, st.y = y - B, st.z = x - H, st.multiplyScalar(0.5), Q.copy(S);
|
|
2532
2532
|
const { x: Ht, y: Wt, z: kt } = st, ke = new O.Matrix4();
|
|
2533
2533
|
ke.makeScale(Ht * 2, Wt * 2, kt * 2);
|
|
2534
2534
|
const Te = new O.Matrix4();
|
|
@@ -3083,7 +3083,7 @@ const Fs = class Fs {
|
|
|
3083
3083
|
/**
|
|
3084
3084
|
* The version of the @thatopen/components library.
|
|
3085
3085
|
*/
|
|
3086
|
-
I(Fs, "release", "2.1.
|
|
3086
|
+
I(Fs, "release", "2.1.19");
|
|
3087
3087
|
let pi = Fs;
|
|
3088
3088
|
class Fr {
|
|
3089
3089
|
constructor(s) {
|
|
@@ -3494,7 +3494,7 @@ const V = {
|
|
|
3494
3494
|
LEFT: 1,
|
|
3495
3495
|
RIGHT: 2,
|
|
3496
3496
|
MIDDLE: 4
|
|
3497
|
-
},
|
|
3497
|
+
}, L = Object.freeze({
|
|
3498
3498
|
NONE: 0,
|
|
3499
3499
|
ROTATE: 1,
|
|
3500
3500
|
TRUCK: 2,
|
|
@@ -3536,10 +3536,10 @@ function W(l, s, t = bn) {
|
|
|
3536
3536
|
function rn(l, s) {
|
|
3537
3537
|
return Math.round(l / s) * s;
|
|
3538
3538
|
}
|
|
3539
|
-
function
|
|
3539
|
+
function Le(l) {
|
|
3540
3540
|
return isFinite(l) ? l : l < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
|
3541
3541
|
}
|
|
3542
|
-
function
|
|
3542
|
+
function Pe(l) {
|
|
3543
3543
|
return Math.abs(l) < Number.MAX_VALUE ? l : l * (1 / 0);
|
|
3544
3544
|
}
|
|
3545
3545
|
function hs(l, s, t, e, i = 1 / 0, o) {
|
|
@@ -3565,8 +3565,8 @@ function an(l, s, t, e, i = 1 / 0, o, n) {
|
|
|
3565
3565
|
h = l.x - u, d = l.y - f, E = l.z - T;
|
|
3566
3566
|
const g = (t.x + r * u) * o, S = (t.y + r * f) * o, _ = (t.z + r * T) * o;
|
|
3567
3567
|
t.x = (t.x - r * g) * c, t.y = (t.y - r * S) * c, t.z = (t.z - r * _) * c, n.x = h + (u + g) * c, n.y = d + (f + S) * c, n.z = E + (T + _) * c;
|
|
3568
|
-
const N = R - l.x,
|
|
3569
|
-
return N * y +
|
|
3568
|
+
const N = R - l.x, P = C - l.y, D = A - l.z, y = n.x - R, x = n.y - C, b = n.z - A;
|
|
3569
|
+
return N * y + P * x + D * b > 0 && (n.x = R, n.y = C, n.z = A, t.x = (n.x - R) / o, t.y = (n.y - C) / o, t.z = (n.z - A) / o), n;
|
|
3570
3570
|
}
|
|
3571
3571
|
function $s(l, s) {
|
|
3572
3572
|
s.set(0, 0), l.forEach((t) => {
|
|
@@ -3640,7 +3640,7 @@ class Sr {
|
|
|
3640
3640
|
}
|
|
3641
3641
|
}
|
|
3642
3642
|
}
|
|
3643
|
-
const _r = "2.7.3", Es = 1 / 8, vn = typeof window < "u", Nr = vn && /Mac/.test(navigator.platform),
|
|
3643
|
+
const _r = "2.7.3", Es = 1 / 8, vn = typeof window < "u", Nr = vn && /Mac/.test(navigator.platform), Lr = !(vn && "PointerEvent" in window);
|
|
3644
3644
|
let Y, cn, ds, ti, lt, G, z, Ee, ye, Ot, St, Qt, ln, hn, ut, Me, de, En, ei, dn, si, ii, us;
|
|
3645
3645
|
class ot extends Sr {
|
|
3646
3646
|
/**
|
|
@@ -3691,7 +3691,7 @@ class ot extends Sr {
|
|
|
3691
3691
|
* @category Statics
|
|
3692
3692
|
*/
|
|
3693
3693
|
static get ACTION() {
|
|
3694
|
-
return
|
|
3694
|
+
return L;
|
|
3695
3695
|
}
|
|
3696
3696
|
/**
|
|
3697
3697
|
* Creates a `CameraControls` instance.
|
|
@@ -3712,10 +3712,10 @@ class ot extends Sr {
|
|
|
3712
3712
|
*/
|
|
3713
3713
|
constructor(s, t) {
|
|
3714
3714
|
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 = () => {
|
|
3715
|
-
}, this._enabled = !0, this._state =
|
|
3715
|
+
}, this._enabled = !0, this._state = L.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 = (p, m, g) => {
|
|
3716
3716
|
let S, _;
|
|
3717
3717
|
if (Zt(this._camera)) {
|
|
3718
|
-
const N = G.copy(this._camera.position).sub(this._target),
|
|
3718
|
+
const N = G.copy(this._camera.position).sub(this._target), P = this._camera.getEffectiveFOV() * Ne, D = N.length() * Math.tan(P * 0.5);
|
|
3719
3719
|
S = this.truckSpeed * p * D / this._elementRect.height, _ = this.truckSpeed * m * D / this._elementRect.height;
|
|
3720
3720
|
} else if (bt(this._camera)) {
|
|
3721
3721
|
const N = this._camera;
|
|
@@ -3727,25 +3727,25 @@ class ot extends Sr {
|
|
|
3727
3727
|
const g = he * this.azimuthRotateSpeed * p / this._elementRect.height, S = he * this.polarRotateSpeed * m / this._elementRect.height;
|
|
3728
3728
|
this.rotate(g, S, !0);
|
|
3729
3729
|
}, this._dollyInternal = (p, m, g) => {
|
|
3730
|
-
const S = Math.pow(0.95, -p * this.dollySpeed), _ = this._sphericalEnd.radius, N = this._sphericalEnd.radius * S,
|
|
3731
|
-
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(D, !0), this._dollyToNoClamp(
|
|
3730
|
+
const S = Math.pow(0.95, -p * this.dollySpeed), _ = this._sphericalEnd.radius, N = this._sphericalEnd.radius * S, P = mt(N, this.minDistance, this.maxDistance), D = P - N;
|
|
3731
|
+
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(D, !0), this._dollyToNoClamp(P, !0)) : this._dollyToNoClamp(P, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : P) - _, this._dollyControlCoord.set(m, g)), this._lastDollyDirection = Math.sign(-p);
|
|
3732
3732
|
}, this._zoomInternal = (p, m, g) => {
|
|
3733
3733
|
const S = Math.pow(0.95, p * this.dollySpeed), _ = this._zoom, N = this._zoom * S;
|
|
3734
3734
|
this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N - _, this._dollyControlCoord.set(m, g));
|
|
3735
|
-
}, 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 = s, this._yAxisUpSpace = new Y.Quaternion().setFromUnitVectors(this._camera.up, ds), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state =
|
|
3735
|
+
}, 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 = s, this._yAxisUpSpace = new Y.Quaternion().setFromUnitVectors(this._camera.up, ds), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = L.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 = [
|
|
3736
3736
|
new Y.Vector3(),
|
|
3737
3737
|
new Y.Vector3(),
|
|
3738
3738
|
new Y.Vector3(),
|
|
3739
3739
|
new Y.Vector3()
|
|
3740
3740
|
], 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 = {
|
|
3741
|
-
left:
|
|
3742
|
-
middle:
|
|
3743
|
-
right:
|
|
3744
|
-
wheel: Zt(this._camera) ?
|
|
3741
|
+
left: L.ROTATE,
|
|
3742
|
+
middle: L.DOLLY,
|
|
3743
|
+
right: L.TRUCK,
|
|
3744
|
+
wheel: Zt(this._camera) ? L.DOLLY : bt(this._camera) ? L.ZOOM : L.NONE
|
|
3745
3745
|
}, this.touches = {
|
|
3746
|
-
one:
|
|
3747
|
-
two: Zt(this._camera) ?
|
|
3748
|
-
three:
|
|
3746
|
+
one: L.TOUCH_ROTATE,
|
|
3747
|
+
two: Zt(this._camera) ? L.TOUCH_DOLLY_TRUCK : bt(this._camera) ? L.TOUCH_ZOOM_TRUCK : L.NONE,
|
|
3748
|
+
three: L.TOUCH_TRUCK
|
|
3749
3749
|
};
|
|
3750
3750
|
const e = new Y.Vector2(), i = new Y.Vector2(), o = new Y.Vector2(), n = (p) => {
|
|
3751
3751
|
if (!this._enabled || !this._domElement)
|
|
@@ -3822,7 +3822,7 @@ class ot extends Sr {
|
|
|
3822
3822
|
if (m && this._disposePointer(m), p.pointerType === "touch")
|
|
3823
3823
|
switch (this._activePointers.length) {
|
|
3824
3824
|
case 0:
|
|
3825
|
-
this._state =
|
|
3825
|
+
this._state = L.NONE;
|
|
3826
3826
|
break;
|
|
3827
3827
|
case 1:
|
|
3828
3828
|
this._state = this.touches.one;
|
|
@@ -3835,45 +3835,45 @@ class ot extends Sr {
|
|
|
3835
3835
|
break;
|
|
3836
3836
|
}
|
|
3837
3837
|
else
|
|
3838
|
-
this._state =
|
|
3838
|
+
this._state = L.NONE;
|
|
3839
3839
|
C();
|
|
3840
3840
|
}
|
|
3841
3841
|
}, d = () => {
|
|
3842
3842
|
const p = this._findPointerById(1);
|
|
3843
|
-
p && p === this._lockedPointer || (p && this._disposePointer(p), this._state =
|
|
3843
|
+
p && p === this._lockedPointer || (p && this._disposePointer(p), this._state = L.NONE, C());
|
|
3844
3844
|
};
|
|
3845
3845
|
let E = -1;
|
|
3846
3846
|
const u = (p) => {
|
|
3847
|
-
if (!this._domElement || !this._enabled || this.mouseButtons.wheel ===
|
|
3847
|
+
if (!this._domElement || !this._enabled || this.mouseButtons.wheel === L.NONE)
|
|
3848
3848
|
return;
|
|
3849
3849
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
3850
|
-
const N = this._domElement.getBoundingClientRect(),
|
|
3851
|
-
if (
|
|
3850
|
+
const N = this._domElement.getBoundingClientRect(), P = p.clientX / N.width, D = p.clientY / N.height;
|
|
3851
|
+
if (P < this._interactiveArea.left || P > this._interactiveArea.right || D < this._interactiveArea.top || D > this._interactiveArea.bottom)
|
|
3852
3852
|
return;
|
|
3853
3853
|
}
|
|
3854
|
-
if (p.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel ===
|
|
3854
|
+
if (p.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === L.ROTATE || this.mouseButtons.wheel === L.TRUCK) {
|
|
3855
3855
|
const N = performance.now();
|
|
3856
3856
|
E - N < 1e3 && this._getClientRect(this._elementRect), E = N;
|
|
3857
3857
|
}
|
|
3858
3858
|
const m = Nr ? -1 : -3, g = p.deltaMode === 1 ? p.deltaY / m : p.deltaY / (m * 10), S = this.dollyToCursor ? (p.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, _ = this.dollyToCursor ? (p.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
3859
3859
|
switch (this.mouseButtons.wheel) {
|
|
3860
|
-
case
|
|
3860
|
+
case L.ROTATE: {
|
|
3861
3861
|
this._rotateInternal(p.deltaX, p.deltaY), this._isUserControllingRotate = !0;
|
|
3862
3862
|
break;
|
|
3863
3863
|
}
|
|
3864
|
-
case
|
|
3864
|
+
case L.TRUCK: {
|
|
3865
3865
|
this._truckInternal(p.deltaX, p.deltaY, !1), this._isUserControllingTruck = !0;
|
|
3866
3866
|
break;
|
|
3867
3867
|
}
|
|
3868
|
-
case
|
|
3868
|
+
case L.OFFSET: {
|
|
3869
3869
|
this._truckInternal(p.deltaX, p.deltaY, !0), this._isUserControllingOffset = !0;
|
|
3870
3870
|
break;
|
|
3871
3871
|
}
|
|
3872
|
-
case
|
|
3872
|
+
case L.DOLLY: {
|
|
3873
3873
|
this._dollyInternal(-g, S, _), this._isUserControllingDolly = !0;
|
|
3874
3874
|
break;
|
|
3875
3875
|
}
|
|
3876
|
-
case
|
|
3876
|
+
case L.ZOOM: {
|
|
3877
3877
|
this._zoomInternal(-g, S, _), this._isUserControllingZoom = !0;
|
|
3878
3878
|
break;
|
|
3879
3879
|
}
|
|
@@ -3894,8 +3894,8 @@ class ot extends Sr {
|
|
|
3894
3894
|
if ($s(this._activePointers, lt), this._getClientRect(this._elementRect), e.copy(lt), i.copy(lt), this._activePointers.length >= 2) {
|
|
3895
3895
|
const g = lt.x - this._activePointers[1].clientX, S = lt.y - this._activePointers[1].clientY, _ = Math.sqrt(g * g + S * S);
|
|
3896
3896
|
o.set(0, _);
|
|
3897
|
-
const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5,
|
|
3898
|
-
i.set(N,
|
|
3897
|
+
const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, P = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
|
3898
|
+
i.set(N, P);
|
|
3899
3899
|
}
|
|
3900
3900
|
if (this._state = 0, !p)
|
|
3901
3901
|
this._lockedPointer && (this._state = this._state | this.mouseButtons.left);
|
|
@@ -3913,23 +3913,23 @@ class ot extends Sr {
|
|
|
3913
3913
|
}
|
|
3914
3914
|
else
|
|
3915
3915
|
!this._lockedPointer && (p.buttons & V.LEFT) === V.LEFT && (this._state = this._state | this.mouseButtons.left), (p.buttons & V.MIDDLE) === V.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (p.buttons & V.RIGHT) === V.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
3916
|
-
((this._state &
|
|
3916
|
+
((this._state & L.ROTATE) === L.ROTATE || (this._state & L.TOUCH_ROTATE) === L.TOUCH_ROTATE || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_ZOOM_ROTATE) === L.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 & L.TRUCK) === L.TRUCK || (this._state & L.TOUCH_TRUCK) === L.TOUCH_TRUCK || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & L.DOLLY) === L.DOLLY || (this._state & L.TOUCH_DOLLY) === L.TOUCH_DOLLY || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & L.ZOOM) === L.ZOOM || (this._state & L.TOUCH_ZOOM) === L.TOUCH_ZOOM || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET || (this._state & L.TOUCH_ZOOM_ROTATE) === L.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & L.OFFSET) === L.OFFSET || (this._state & L.TOUCH_OFFSET) === L.TOUCH_OFFSET || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
|
|
3917
3917
|
}, R = () => {
|
|
3918
3918
|
if (!this._enabled || !this._dragNeedsUpdate)
|
|
3919
3919
|
return;
|
|
3920
3920
|
this._dragNeedsUpdate = !1, $s(this._activePointers, lt);
|
|
3921
3921
|
const m = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, g = m ? -m.deltaX : i.x - lt.x, S = m ? -m.deltaY : i.y - lt.y;
|
|
3922
|
-
if (i.copy(lt), ((this._state &
|
|
3923
|
-
const _ = this.dollyToCursor ? (e.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, N = this.dollyToCursor ? (e.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0,
|
|
3924
|
-
(this._state &
|
|
3922
|
+
if (i.copy(lt), ((this._state & L.ROTATE) === L.ROTATE || (this._state & L.TOUCH_ROTATE) === L.TOUCH_ROTATE || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_ZOOM_ROTATE) === L.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(g, S), this._isUserControllingRotate = !0), (this._state & L.DOLLY) === L.DOLLY || (this._state & L.ZOOM) === L.ZOOM) {
|
|
3923
|
+
const _ = this.dollyToCursor ? (e.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, N = this.dollyToCursor ? (e.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, P = this.dollyDragInverted ? -1 : 1;
|
|
3924
|
+
(this._state & L.DOLLY) === L.DOLLY ? (this._dollyInternal(P * S * Es, _, N), this._isUserControllingDolly = !0) : (this._zoomInternal(P * S * Es, _, N), this._isUserControllingZoom = !0);
|
|
3925
3925
|
}
|
|
3926
|
-
if ((this._state &
|
|
3927
|
-
const _ = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY,
|
|
3928
|
-
o.set(0,
|
|
3926
|
+
if ((this._state & L.TOUCH_DOLLY) === L.TOUCH_DOLLY || (this._state & L.TOUCH_ZOOM) === L.TOUCH_ZOOM || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_ZOOM_ROTATE) === L.TOUCH_ZOOM_ROTATE) {
|
|
3927
|
+
const _ = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY, P = Math.sqrt(_ * _ + N * N), D = o.y - P;
|
|
3928
|
+
o.set(0, P);
|
|
3929
3929
|
const y = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, x = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
3930
|
-
(this._state &
|
|
3930
|
+
(this._state & L.TOUCH_DOLLY) === L.TOUCH_DOLLY || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(D * Es, y, x), this._isUserControllingDolly = !0) : (this._zoomInternal(D * Es, y, x), this._isUserControllingZoom = !0);
|
|
3931
3931
|
}
|
|
3932
|
-
((this._state &
|
|
3932
|
+
((this._state & L.TRUCK) === L.TRUCK || (this._state & L.TOUCH_TRUCK) === L.TOUCH_TRUCK || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK) && (this._truckInternal(g, S, !1), this._isUserControllingTruck = !0), ((this._state & L.OFFSET) === L.OFFSET || (this._state & L.TOUCH_OFFSET) === L.TOUCH_OFFSET || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET) && (this._truckInternal(g, S, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
3933
3933
|
}, C = () => {
|
|
3934
3934
|
$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" }));
|
|
3935
3935
|
};
|
|
@@ -3951,11 +3951,11 @@ class ot extends Sr {
|
|
|
3951
3951
|
this.unlockPointer();
|
|
3952
3952
|
};
|
|
3953
3953
|
this._addAllEventListeners = (p) => {
|
|
3954
|
-
this._domElement = p, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n),
|
|
3954
|
+
this._domElement = p, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), Lr && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", h), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", f);
|
|
3955
3955
|
}, this._removeAllEventListeners = () => {
|
|
3956
3956
|
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", f), 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", A), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
|
|
3957
3957
|
}, this.cancel = () => {
|
|
3958
|
-
this._state !==
|
|
3958
|
+
this._state !== L.NONE && (this._state = L.NONE, this._activePointers.length = 0, C());
|
|
3959
3959
|
}, t && this.connect(t), this.update(0);
|
|
3960
3960
|
}
|
|
3961
3961
|
/**
|
|
@@ -4671,13 +4671,13 @@ class ot extends Sr {
|
|
|
4671
4671
|
return JSON.stringify({
|
|
4672
4672
|
enabled: this._enabled,
|
|
4673
4673
|
minDistance: this.minDistance,
|
|
4674
|
-
maxDistance:
|
|
4674
|
+
maxDistance: Le(this.maxDistance),
|
|
4675
4675
|
minZoom: this.minZoom,
|
|
4676
|
-
maxZoom:
|
|
4676
|
+
maxZoom: Le(this.maxZoom),
|
|
4677
4677
|
minPolarAngle: this.minPolarAngle,
|
|
4678
|
-
maxPolarAngle:
|
|
4679
|
-
minAzimuthAngle:
|
|
4680
|
-
maxAzimuthAngle:
|
|
4678
|
+
maxPolarAngle: Le(this.maxPolarAngle),
|
|
4679
|
+
minAzimuthAngle: Le(this.minAzimuthAngle),
|
|
4680
|
+
maxAzimuthAngle: Le(this.maxAzimuthAngle),
|
|
4681
4681
|
smoothTime: this.smoothTime,
|
|
4682
4682
|
draggingSmoothTime: this.draggingSmoothTime,
|
|
4683
4683
|
dollySpeed: this.dollySpeed,
|
|
@@ -4702,7 +4702,7 @@ class ot extends Sr {
|
|
|
4702
4702
|
*/
|
|
4703
4703
|
fromJSON(s, t = !1) {
|
|
4704
4704
|
const e = JSON.parse(s);
|
|
4705
|
-
this.enabled = e.enabled, this.minDistance = e.minDistance, this.maxDistance =
|
|
4705
|
+
this.enabled = e.enabled, this.minDistance = e.minDistance, this.maxDistance = Pe(e.maxDistance), this.minZoom = e.minZoom, this.maxZoom = Pe(e.maxZoom), this.minPolarAngle = e.minPolarAngle, this.maxPolarAngle = Pe(e.maxPolarAngle), this.minAzimuthAngle = Pe(e.minAzimuthAngle), this.maxAzimuthAngle = Pe(e.maxAzimuthAngle), this.smoothTime = e.smoothTime, this.draggingSmoothTime = e.draggingSmoothTime, this.dollySpeed = e.dollySpeed, this.truckSpeed = e.truckSpeed, this.dollyToCursor = e.dollyToCursor, this.verticalDragToForward = e.verticalDragToForward, this._target0.fromArray(e.target0), this._position0.fromArray(e.position0), this._zoom0 = e.zoom0, this._focalOffset0.fromArray(e.focalOffset0), this.moveTo(e.target[0], e.target[1], e.target[2], t), ut.setFromVector3(G.fromArray(e.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)), this.rotateTo(ut.theta, ut.phi, t), this.dollyTo(ut.radius, t), this.zoomTo(e.zoom, t), this.setFocalOffset(e.focalOffset[0], e.focalOffset[1], e.focalOffset[2], t), this._needsUpdate = !0;
|
|
4706
4706
|
}
|
|
4707
4707
|
/**
|
|
4708
4708
|
* Attach all internal event handlers to enable drag control.
|
|
@@ -5065,7 +5065,7 @@ const Os = class Os extends et {
|
|
|
5065
5065
|
*/
|
|
5066
5066
|
I(Os, "uuid", "fdb61dc4-2ec1-4966-b83d-54ea795fad4a");
|
|
5067
5067
|
let Ci = Os;
|
|
5068
|
-
class
|
|
5068
|
+
class Pr {
|
|
5069
5069
|
constructor(s, t, e) {
|
|
5070
5070
|
/** {@link Disposable.onDisposed} */
|
|
5071
5071
|
I(this, "onDisposed", new w());
|
|
@@ -5245,7 +5245,7 @@ const Ss = class Ss extends et {
|
|
|
5245
5245
|
create(t) {
|
|
5246
5246
|
if (this.list.has(t.uuid))
|
|
5247
5247
|
throw new Error("This world already has a grid!");
|
|
5248
|
-
const e = new
|
|
5248
|
+
const e = new Pr(this.components, t, this.config);
|
|
5249
5249
|
return this.list.set(t.uuid, e), t.onDisposed.add(() => {
|
|
5250
5250
|
this.delete(t);
|
|
5251
5251
|
}), e;
|
|
@@ -5277,7 +5277,7 @@ const Ss = class Ss extends et {
|
|
|
5277
5277
|
*/
|
|
5278
5278
|
I(Ss, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
|
|
5279
5279
|
let un = Ss;
|
|
5280
|
-
const jt = new Kn(), nt = new M(), xt = new M(), j = new
|
|
5280
|
+
const jt = new Kn(), nt = new M(), xt = new M(), j = new Lt(), In = {
|
|
5281
5281
|
X: new M(1, 0, 0),
|
|
5282
5282
|
Y: new M(0, 1, 0),
|
|
5283
5283
|
Z: new M(0, 0, 1)
|
|
@@ -5302,8 +5302,8 @@ class yr extends ri {
|
|
|
5302
5302
|
}), o[A] = F, i[A] = F, e[A] = F;
|
|
5303
5303
|
}
|
|
5304
5304
|
n("camera", s), 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);
|
|
5305
|
-
const r = new M(), a = new M(), c = new
|
|
5306
|
-
n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", h), n("cameraPosition", d), n("cameraQuaternion", E), n("pointStart", u), n("pointEnd", f), n("rotationAxis", T), n("rotationAngle", R), 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
|
|
5305
|
+
const r = new M(), a = new M(), c = new Lt(), h = new Lt(), d = new M(), E = new Lt(), u = new M(), f = new M(), T = new M(), R = 0, C = new M();
|
|
5306
|
+
n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", h), n("cameraPosition", d), n("cameraQuaternion", E), n("pointStart", u), n("pointEnd", f), n("rotationAxis", T), n("rotationAngle", R), 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 Lt(), this._parentQuaternionInv = new Lt(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new Lt(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new Lt(), this._scaleStart = new M(), this._getPointer = Mr.bind(this), this._onPointerDown = Dr.bind(this), this._onPointerHover = wr.bind(this), this._onPointerMove = Ur.bind(this), this._onPointerUp = xr.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
|
|
5307
5307
|
}
|
|
5308
5308
|
// updateMatrixWorld updates key transformation variables
|
|
5309
5309
|
updateMatrixWorld() {
|
|
@@ -5435,7 +5435,7 @@ function oi(l, s, t) {
|
|
|
5435
5435
|
return e[i];
|
|
5436
5436
|
return !1;
|
|
5437
5437
|
}
|
|
5438
|
-
const Is = new $n(), k = new M(0, 1, 0), Tn = new M(0, 0, 0), mn = new yt(), fs = new
|
|
5438
|
+
const Is = new $n(), k = new M(0, 1, 0), Tn = new M(0, 0, 0), mn = new yt(), fs = new Lt(), Rs = new Lt(), _t = new M(), Rn = new yt(), Ue = new M(1, 0, 0), qt = new M(0, 1, 0), xe = new M(0, 0, 1), ps = new M(), we = new M(), De = new M();
|
|
5439
5439
|
class br extends ri {
|
|
5440
5440
|
constructor() {
|
|
5441
5441
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
|
@@ -5581,7 +5581,7 @@ class br extends ri {
|
|
|
5581
5581
|
AXIS: [
|
|
5582
5582
|
[new Dt(C, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
5583
5583
|
]
|
|
5584
|
-
},
|
|
5584
|
+
}, P = {
|
|
5585
5585
|
XYZE: [
|
|
5586
5586
|
[new v(new to(0.25, 10, 8), e)]
|
|
5587
5587
|
],
|
|
@@ -5672,7 +5672,7 @@ class br extends ri {
|
|
|
5672
5672
|
}
|
|
5673
5673
|
return H;
|
|
5674
5674
|
}
|
|
5675
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = b(m)), this.add(this.gizmo.rotate = b(_)), this.add(this.gizmo.scale = b(D)), this.add(this.picker.translate = b(g)), this.add(this.picker.rotate = b(
|
|
5675
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = b(m)), this.add(this.gizmo.rotate = b(_)), this.add(this.gizmo.scale = b(D)), this.add(this.picker.translate = b(g)), this.add(this.picker.rotate = b(P)), this.add(this.picker.scale = b(y)), this.add(this.helper.translate = b(S)), this.add(this.helper.rotate = b(N)), this.add(this.helper.scale = b(x)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
5676
5676
|
}
|
|
5677
5677
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
5678
5678
|
updateMatrixWorld(s) {
|
|
@@ -5739,7 +5739,7 @@ class vr extends v {
|
|
|
5739
5739
|
_t.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Rn.lookAt(nt.set(0, 0, 0), _t, k), this.quaternion.setFromRotationMatrix(Rn)), super.updateMatrixWorld(s);
|
|
5740
5740
|
}
|
|
5741
5741
|
}
|
|
5742
|
-
class
|
|
5742
|
+
class Li {
|
|
5743
5743
|
constructor(s, t, e, i, o, n = 5, r = !0) {
|
|
5744
5744
|
/** Event that fires when the user starts dragging a clipping plane. */
|
|
5745
5745
|
I(this, "onDraggingStarted", new w());
|
|
@@ -5787,7 +5787,7 @@ class Pi {
|
|
|
5787
5787
|
});
|
|
5788
5788
|
if (this.components = s, this.world = t, !t.renderer)
|
|
5789
5789
|
throw new Error("The given world must have a renderer!");
|
|
5790
|
-
this.normal = i, this.origin = e, t.renderer.setPlane(!0, this.three), this._planeMesh =
|
|
5790
|
+
this.normal = i, this.origin = e, t.renderer.setPlane(!0, this.three), this._planeMesh = Li.newPlaneMesh(n, o), this._helper = this.newHelper(), this._controls = this.newTransformControls(), this.three.setFromNormalAndCoplanarPoint(i, e), r && this.toggleControls(!0);
|
|
5791
5791
|
}
|
|
5792
5792
|
/**
|
|
5793
5793
|
* Getter for the enabled state of the clipping plane.
|
|
@@ -5953,7 +5953,7 @@ const Be = class Be extends et {
|
|
|
5953
5953
|
* The type of clipping plane to be created.
|
|
5954
5954
|
* Default is {@link SimplePlane}.
|
|
5955
5955
|
*/
|
|
5956
|
-
I(this, "Type",
|
|
5956
|
+
I(this, "Type", Li);
|
|
5957
5957
|
/**
|
|
5958
5958
|
* A list of all the clipping planes created by this component.
|
|
5959
5959
|
*/
|
|
@@ -7106,7 +7106,9 @@ const Qr = /* @__PURE__ */ new Map([
|
|
|
7106
7106
|
U.IFCRELDEFINESBYPROPERTIES,
|
|
7107
7107
|
U.IFCRELDEFINESBYTYPE,
|
|
7108
7108
|
U.IFCRELDEFINESBYTEMPLATE,
|
|
7109
|
-
U.IFCRELCONTAINEDINSPATIALSTRUCTURE
|
|
7109
|
+
U.IFCRELCONTAINEDINSPATIALSTRUCTURE,
|
|
7110
|
+
U.IFCRELFLOWCONTROLELEMENTS,
|
|
7111
|
+
U.IFCRELCONNECTSELEMENTS
|
|
7110
7112
|
]);
|
|
7111
7113
|
I(this, "onFragmentsDisposed", (t) => {
|
|
7112
7114
|
delete this.relationMaps[t.groupID];
|
|
@@ -7977,12 +7979,12 @@ const Bn = /* @__PURE__ */ new Set([
|
|
|
7977
7979
|
2513912981,
|
|
7978
7980
|
2830218821,
|
|
7979
7981
|
427810014
|
|
7980
|
-
]),
|
|
7982
|
+
]), Ls = class Ls extends et {
|
|
7981
7983
|
constructor(t) {
|
|
7982
7984
|
super(t);
|
|
7983
7985
|
/** {@link Component.enabled} */
|
|
7984
7986
|
I(this, "enabled", !0);
|
|
7985
|
-
t.add(
|
|
7987
|
+
t.add(Ls.uuid, this);
|
|
7986
7988
|
}
|
|
7987
7989
|
/**
|
|
7988
7990
|
* Exports all the properties of an IFC into an array of JS objects.
|
|
@@ -8018,8 +8020,8 @@ const Bn = /* @__PURE__ */ new Set([
|
|
|
8018
8020
|
* A unique identifier for the component.
|
|
8019
8021
|
* This UUID is used to register the component within the Components system.
|
|
8020
8022
|
*/
|
|
8021
|
-
I(
|
|
8022
|
-
let mi =
|
|
8023
|
+
I(Ls, "uuid", "b32c4332-cd67-436e-ba7f-196646c7a635");
|
|
8024
|
+
let mi = Ls;
|
|
8023
8025
|
const jr = {
|
|
8024
8026
|
103090709: "IFCPROJECT",
|
|
8025
8027
|
4097777520: "IFCSITE",
|
|
@@ -9575,7 +9577,7 @@ class Vn {
|
|
|
9575
9577
|
this.itemsByFloor = {};
|
|
9576
9578
|
}
|
|
9577
9579
|
}
|
|
9578
|
-
class
|
|
9580
|
+
class Pi {
|
|
9579
9581
|
constructor() {
|
|
9580
9582
|
/** Whether to extract the IFC properties into a JSON. */
|
|
9581
9583
|
I(this, "includeProperties", !0);
|
|
@@ -9594,6 +9596,8 @@ class Li {
|
|
|
9594
9596
|
});
|
|
9595
9597
|
/** List of categories that won't be converted to fragments. */
|
|
9596
9598
|
I(this, "excludedCategories", /* @__PURE__ */ new Set());
|
|
9599
|
+
/** Exclusive list of categories that will be converted to fragments. If this contains any category, any other categories will be ignored. */
|
|
9600
|
+
I(this, "includedCategories", /* @__PURE__ */ new Set());
|
|
9597
9601
|
/** Whether to save the absolute location of all IFC items. */
|
|
9598
9602
|
I(this, "saveLocations", !1);
|
|
9599
9603
|
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
@@ -9744,7 +9748,7 @@ const Ge = class Ge extends et {
|
|
|
9744
9748
|
* The settings for the IfcLoader.
|
|
9745
9749
|
* It includes options for excluding categories, setting WASM paths, and more.
|
|
9746
9750
|
*/
|
|
9747
|
-
I(this, "settings", new
|
|
9751
|
+
I(this, "settings", new Pi());
|
|
9748
9752
|
/**
|
|
9749
9753
|
* The instance of the Web-IFC library used for handling IFC data.
|
|
9750
9754
|
*/
|
|
@@ -9871,14 +9875,19 @@ const Ge = class Ge extends et {
|
|
|
9871
9875
|
};
|
|
9872
9876
|
const i = [];
|
|
9873
9877
|
for (const n of t) {
|
|
9874
|
-
if (!this.webIfc.IsIfcElement(n) && n !== U.IFCSPACE
|
|
9878
|
+
if (!this.webIfc.IsIfcElement(n) && n !== U.IFCSPACE)
|
|
9875
9879
|
continue;
|
|
9876
|
-
const r = this.
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9880
|
+
const r = this.settings.includedCategories;
|
|
9881
|
+
if (r.size > 0 && !r.has(n))
|
|
9882
|
+
continue;
|
|
9883
|
+
if (this.settings.excludedCategories.has(n))
|
|
9884
|
+
continue;
|
|
9885
|
+
const a = this.webIfc.GetLineIDsWithType(0, n), c = a.size();
|
|
9886
|
+
for (let h = 0; h < c; h++) {
|
|
9887
|
+
const d = a.get(h);
|
|
9888
|
+
i.push(d);
|
|
9889
|
+
const E = this._spatialTree.itemsByFloor[d] || 0;
|
|
9890
|
+
e.data.set(d, [[], [E, n]]);
|
|
9882
9891
|
}
|
|
9883
9892
|
}
|
|
9884
9893
|
this._spatialTree.cleanUp(), this.webIfc.StreamMeshes(0, i, (n) => {
|
|
@@ -10330,7 +10339,7 @@ const Bt = class Bt extends et {
|
|
|
10330
10339
|
*/
|
|
10331
10340
|
I(Bt, "uuid", "58c2d9f0-183c-48d6-a402-dfcf5b9a34df");
|
|
10332
10341
|
let On = Bt;
|
|
10333
|
-
const
|
|
10342
|
+
const Ps = class Ps extends et {
|
|
10334
10343
|
constructor(t) {
|
|
10335
10344
|
super(t);
|
|
10336
10345
|
/** {@link Component.enabled} */
|
|
@@ -10357,7 +10366,7 @@ const Ls = class Ls extends et {
|
|
|
10357
10366
|
}
|
|
10358
10367
|
}
|
|
10359
10368
|
});
|
|
10360
|
-
t.add(
|
|
10369
|
+
t.add(Ps.uuid, this), t.get(ht).onFragmentsDisposed.add(this.onFragmentsDisposed);
|
|
10361
10370
|
}
|
|
10362
10371
|
/** {@link Disposable.dispose} */
|
|
10363
10372
|
dispose() {
|
|
@@ -10685,8 +10694,8 @@ const Ls = class Ls extends et {
|
|
|
10685
10694
|
* A unique identifier for the component.
|
|
10686
10695
|
* This UUID is used to register the component within the Components system.
|
|
10687
10696
|
*/
|
|
10688
|
-
I(
|
|
10689
|
-
let Ai =
|
|
10697
|
+
I(Ps, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
|
|
10698
|
+
let Ai = Ps;
|
|
10690
10699
|
const ys = class ys extends et {
|
|
10691
10700
|
constructor(t) {
|
|
10692
10701
|
super(t);
|
|
@@ -10813,7 +10822,7 @@ const Ms = class Ms extends et {
|
|
|
10813
10822
|
*/
|
|
10814
10823
|
I(Ms, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
|
|
10815
10824
|
let _n = Ms;
|
|
10816
|
-
class Kr extends
|
|
10825
|
+
class Kr extends Pi {
|
|
10817
10826
|
constructor() {
|
|
10818
10827
|
super(...arguments);
|
|
10819
10828
|
/**
|
|
@@ -11036,7 +11045,7 @@ const ws = class ws extends et {
|
|
|
11036
11045
|
*/
|
|
11037
11046
|
I(ws, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
|
|
11038
11047
|
let Nn = ws;
|
|
11039
|
-
class $r extends
|
|
11048
|
+
class $r extends Pi {
|
|
11040
11049
|
constructor() {
|
|
11041
11050
|
super(...arguments);
|
|
11042
11051
|
/**
|
|
@@ -11247,9 +11256,9 @@ const Ds = class Ds extends et {
|
|
|
11247
11256
|
g.add(m);
|
|
11248
11257
|
}
|
|
11249
11258
|
for (const m of C) {
|
|
11250
|
-
const g = d.get(m), { edges: S, indices: _ } = g, N = d.get(R), { edges:
|
|
11259
|
+
const g = d.get(m), { edges: S, indices: _ } = g, N = d.get(R), { edges: P, indices: D } = N;
|
|
11251
11260
|
for (const y of S)
|
|
11252
|
-
|
|
11261
|
+
P.add(y), h.set(y, R);
|
|
11253
11262
|
for (const y of _)
|
|
11254
11263
|
D.add(y);
|
|
11255
11264
|
d.delete(m);
|
|
@@ -11423,7 +11432,7 @@ const Ds = class Ds extends et {
|
|
|
11423
11432
|
* This UUID is used to register the component within the Components system.
|
|
11424
11433
|
*/
|
|
11425
11434
|
I(Ds, "uuid", "267ca032-672f-4cb0-afa9-d24e904f39d6");
|
|
11426
|
-
let
|
|
11435
|
+
let Ln = Ds;
|
|
11427
11436
|
export {
|
|
11428
11437
|
Ts as AsyncEvent,
|
|
11429
11438
|
_i as Base,
|
|
@@ -11451,7 +11460,7 @@ export {
|
|
|
11451
11460
|
ca as IfcCategories,
|
|
11452
11461
|
Yn as IfcCategoryMap,
|
|
11453
11462
|
jr as IfcElements,
|
|
11454
|
-
|
|
11463
|
+
Pi as IfcFragmentSettings,
|
|
11455
11464
|
Nn as IfcGeometryTiler,
|
|
11456
11465
|
mi as IfcJsonExporter,
|
|
11457
11466
|
Ri as IfcLoader,
|
|
@@ -11461,7 +11470,7 @@ export {
|
|
|
11461
11470
|
pe as IfcRelationsIndexer,
|
|
11462
11471
|
Kr as IfcStreamingSettings,
|
|
11463
11472
|
nn as MaterialsUtils,
|
|
11464
|
-
|
|
11473
|
+
Ln as MeasurementUtils,
|
|
11465
11474
|
zr as MeshCullerRenderer,
|
|
11466
11475
|
Hr as MiniMap,
|
|
11467
11476
|
Fn as MiniMaps,
|
|
@@ -11473,8 +11482,8 @@ export {
|
|
|
11473
11482
|
$r as PropertiesStreamingSettings,
|
|
11474
11483
|
He as Raycasters,
|
|
11475
11484
|
We as SimpleCamera,
|
|
11476
|
-
|
|
11477
|
-
|
|
11485
|
+
Pr as SimpleGrid,
|
|
11486
|
+
Li as SimplePlane,
|
|
11478
11487
|
gr as SimpleRaycaster,
|
|
11479
11488
|
ra as SimpleRenderer,
|
|
11480
11489
|
oa as SimpleScene,
|