@thatopen/components 2.1.5 → 2.1.7
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/FragmentsManager/index.d.ts +15 -0
- package/dist/ifc/IfcPropertiesManager/index.d.ts +5 -5
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +14 -2
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +727 -666
- package/dist/namespace.d.ts +1308 -1281
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var kn = Object.defineProperty;
|
|
2
2
|
var Wn = (l, s, t) => s in l ? kn(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
|
|
3
3
|
var I = (l, s, t) => (Wn(l, typeof s != "symbol" ? s + "" : s, t), t);
|
|
4
|
-
import * as
|
|
5
|
-
import { BufferAttribute as Pn, Vector3 as M, Vector2 as fe, Plane as Fi, Line3 as
|
|
4
|
+
import * as O from "three";
|
|
5
|
+
import { BufferAttribute as Pn, Vector3 as M, Vector2 as fe, Plane as Fi, Line3 as yt, Triangle as ue, Sphere as Xn, Matrix4 as Lt, Box3 as gt, BackSide as Zn, DoubleSide as yn, FrontSide as wi, Mesh as v, Ray as Qn, Raycaster as jn, Quaternion as Pt, Object3D as ri, Euler as qn, MeshBasicMaterial as Ln, 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 Re, 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";
|
|
@@ -10,7 +10,7 @@ const Mn = 0, eo = 1, so = 2, xi = 2, Ys = 1.25, bi = 1, Cs = 6 * 4 + 4 + 4, Us
|
|
|
10
10
|
function no(l) {
|
|
11
11
|
return l.index ? l.index.count : l.attributes.position.count;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Ce(l) {
|
|
14
14
|
return no(l) / 3;
|
|
15
15
|
}
|
|
16
16
|
function oo(l, s = ArrayBuffer) {
|
|
@@ -25,7 +25,7 @@ function ro(l, s) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
function wn(l) {
|
|
28
|
-
const s =
|
|
28
|
+
const s = Ce(l), t = l.drawRange, e = t.start / 3, i = (t.start + t.count) / 3, o = Math.max(0, e), n = Math.min(s, i) - o;
|
|
29
29
|
return [{
|
|
30
30
|
offset: Math.floor(o),
|
|
31
31
|
count: Math.floor(n)
|
|
@@ -52,7 +52,7 @@ function Dn(l) {
|
|
|
52
52
|
function ao(l) {
|
|
53
53
|
if (l.groups.length === 0)
|
|
54
54
|
return !1;
|
|
55
|
-
const s =
|
|
55
|
+
const s = Ce(l), t = Dn(l).sort((o, n) => o.offset - n.offset), e = t[t.length - 1];
|
|
56
56
|
e.count = Math.min(s - e.offset, e.count);
|
|
57
57
|
let i = 0;
|
|
58
58
|
return t.forEach(({ count: o }) => i += o), s !== i;
|
|
@@ -87,7 +87,7 @@ function Qe(l, s, t) {
|
|
|
87
87
|
n < t[e] && (t[e] = n), r > t[e + 3] && (t[e + 3] = r);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function Ae(l) {
|
|
91
91
|
const s = l[3] - l[0], t = l[4] - l[1], e = l[5] - l[2];
|
|
92
92
|
return 2 * (s * t + t * e + e * s);
|
|
93
93
|
}
|
|
@@ -95,12 +95,12 @@ function Gs(l, s, t, e, i = null) {
|
|
|
95
95
|
let o = 1 / 0, n = 1 / 0, r = 1 / 0, a = -1 / 0, c = -1 / 0, h = -1 / 0, d = 1 / 0, E = 1 / 0, u = 1 / 0, f = -1 / 0, R = -1 / 0, m = -1 / 0;
|
|
96
96
|
const C = i !== null;
|
|
97
97
|
for (let A = s * 6, F = (s + t) * 6; A < F; A += 6) {
|
|
98
|
-
const p = l[A + 0], T = l[A + 1],
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
x < r && (r = x), B > h && (h = B), C &&
|
|
98
|
+
const p = l[A + 0], T = l[A + 1], g = p - T, S = p + T;
|
|
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], y = _ - N, w = _ + N;
|
|
101
|
+
y < n && (n = y), w > c && (c = w), C && _ < E && (E = _), C && _ > R && (R = _);
|
|
102
|
+
const L = l[A + 4], U = l[A + 5], x = L - U, B = L + U;
|
|
103
|
+
x < r && (r = x), B > h && (h = B), C && L < u && (u = L), C && L > m && (m = L);
|
|
104
104
|
}
|
|
105
105
|
e[0] = o, e[1] = n, e[2] = r, e[3] = a, e[4] = c, e[5] = h, C && (i[0] = d, i[1] = E, i[2] = u, i[3] = f, i[4] = R, i[5] = m);
|
|
106
106
|
}
|
|
@@ -118,7 +118,7 @@ function lo(l, s, t, e) {
|
|
|
118
118
|
}
|
|
119
119
|
function ho(l, s) {
|
|
120
120
|
co(s);
|
|
121
|
-
const t = l.attributes.position, e = l.index ? l.index.array : null, i =
|
|
121
|
+
const t = l.attributes.position, e = l.index ? l.index.array : null, i = Ce(l), o = new Float32Array(i * 6), n = t.normalized, r = t.array, a = t.offset || 0;
|
|
122
122
|
let c = 3;
|
|
123
123
|
t.isInterleavedBufferAttribute && (c = t.data.stride);
|
|
124
124
|
const h = ["getX", "getY", "getZ"];
|
|
@@ -131,10 +131,10 @@ function ho(l, s) {
|
|
|
131
131
|
n ? (A = t[h[C]](f), F = t[h[C]](R), p = t[h[C]](m)) : (A = r[f + C], F = r[R + C], p = r[m + C]);
|
|
132
132
|
let T = A;
|
|
133
133
|
F < T && (T = F), p < T && (T = p);
|
|
134
|
-
let
|
|
135
|
-
F >
|
|
136
|
-
const
|
|
137
|
-
o[u +
|
|
134
|
+
let g = A;
|
|
135
|
+
F > g && (g = F), p > g && (g = p);
|
|
136
|
+
const S = (g - T) / 2, _ = C * 2;
|
|
137
|
+
o[u + _ + 0] = T + S, o[u + _ + 1] = S + (Math.abs(T) + S) * io, T < s[C] && (s[C] = T), g > s[C + 3] && (s[C + 3] = g);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
return o;
|
|
@@ -153,7 +153,7 @@ function uo(l, s, t, e, i, o) {
|
|
|
153
153
|
else if (o === eo)
|
|
154
154
|
n = vi(l), n !== -1 && (r = Io(t, e, i, n));
|
|
155
155
|
else if (o === so) {
|
|
156
|
-
const a =
|
|
156
|
+
const a = Ae(l);
|
|
157
157
|
let c = Ys * i;
|
|
158
158
|
const h = e * 6, d = (e + i) * 6;
|
|
159
159
|
for (let E = 0; E < 3; E++) {
|
|
@@ -166,13 +166,13 @@ function uo(l, s, t, e, i, o) {
|
|
|
166
166
|
const T = C[A];
|
|
167
167
|
T.candidate = t[p + 2 * E], T.count = 0;
|
|
168
168
|
const {
|
|
169
|
-
bounds:
|
|
170
|
-
leftCacheBounds:
|
|
171
|
-
rightCacheBounds:
|
|
169
|
+
bounds: g,
|
|
170
|
+
leftCacheBounds: S,
|
|
171
|
+
rightCacheBounds: _
|
|
172
172
|
} = T;
|
|
173
173
|
for (let N = 0; N < 3; N++)
|
|
174
|
-
|
|
175
|
-
Qe(p, t,
|
|
174
|
+
_[N] = 1 / 0, _[N + 3] = -1 / 0, S[N] = 1 / 0, S[N + 3] = -1 / 0, g[N] = 1 / 0, g[N + 3] = -1 / 0;
|
|
175
|
+
Qe(p, t, g);
|
|
176
176
|
}
|
|
177
177
|
C.sort(Eo);
|
|
178
178
|
let F = i;
|
|
@@ -183,33 +183,33 @@ function uo(l, s, t, e, i, o) {
|
|
|
183
183
|
}
|
|
184
184
|
for (let p = h; p < d; p += 6) {
|
|
185
185
|
const T = t[p + 2 * E];
|
|
186
|
-
for (let
|
|
187
|
-
const
|
|
188
|
-
T >=
|
|
186
|
+
for (let g = 0; g < F; g++) {
|
|
187
|
+
const S = C[g];
|
|
188
|
+
T >= S.candidate ? Qe(p, t, S.rightCacheBounds) : (Qe(p, t, S.leftCacheBounds), S.count++);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
for (let p = 0; p < F; p++) {
|
|
192
|
-
const T = C[p],
|
|
193
|
-
let
|
|
194
|
-
|
|
192
|
+
const T = C[p], g = T.count, S = i - T.count, _ = T.leftCacheBounds, N = T.rightCacheBounds;
|
|
193
|
+
let y = 0;
|
|
194
|
+
g !== 0 && (y = Ae(_) / a);
|
|
195
195
|
let w = 0;
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
|
|
196
|
+
S !== 0 && (w = Ae(N) / a);
|
|
197
|
+
const L = bi + Ys * (y * g + w * S);
|
|
198
|
+
L < c && (n = E, c = L, r = T.candidate);
|
|
199
199
|
}
|
|
200
200
|
} else {
|
|
201
201
|
for (let F = 0; F < Mt; F++) {
|
|
202
202
|
const p = Ut[F];
|
|
203
203
|
p.count = 0, p.candidate = u + m + F * m;
|
|
204
204
|
const T = p.bounds;
|
|
205
|
-
for (let
|
|
206
|
-
T[
|
|
205
|
+
for (let g = 0; g < 3; g++)
|
|
206
|
+
T[g] = 1 / 0, T[g + 3] = -1 / 0;
|
|
207
207
|
}
|
|
208
208
|
for (let F = h; F < d; F += 6) {
|
|
209
|
-
let
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
|
|
209
|
+
let g = ~~((t[F + 2 * E] - u) / m);
|
|
210
|
+
g >= Mt && (g = Mt - 1);
|
|
211
|
+
const S = Ut[g];
|
|
212
|
+
S.count++, Qe(F, t, S.bounds);
|
|
213
213
|
}
|
|
214
214
|
const C = Ut[Mt - 1];
|
|
215
215
|
Bi(C.bounds, C.rightCacheBounds);
|
|
@@ -219,14 +219,14 @@ function uo(l, s, t, e, i, o) {
|
|
|
219
219
|
}
|
|
220
220
|
let A = 0;
|
|
221
221
|
for (let F = 0; F < Mt - 1; F++) {
|
|
222
|
-
const p = Ut[F], T = p.count,
|
|
223
|
-
T !== 0 && (A === 0 ? Bi(
|
|
224
|
-
let N = 0,
|
|
225
|
-
A !== 0 && (N =
|
|
222
|
+
const p = Ut[F], T = p.count, g = p.bounds, _ = Ut[F + 1].rightCacheBounds;
|
|
223
|
+
T !== 0 && (A === 0 ? Bi(g, je) : Yi(g, je, je)), A += T;
|
|
224
|
+
let N = 0, y = 0;
|
|
225
|
+
A !== 0 && (N = Ae(je) / a);
|
|
226
226
|
const w = i - A;
|
|
227
|
-
w !== 0 && (
|
|
228
|
-
const
|
|
229
|
-
|
|
227
|
+
w !== 0 && (y = Ae(_) / a);
|
|
228
|
+
const L = bi + Ys * (N * A + y * w);
|
|
229
|
+
L < c && (n = E, c = L, r = p.candidate);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
@@ -293,7 +293,7 @@ function Co(l, s) {
|
|
|
293
293
|
return n;
|
|
294
294
|
}
|
|
295
295
|
function To(l, s) {
|
|
296
|
-
const t = l.geometry, e = t.index ? t.index.array : null, i = s.maxDepth, o = s.verbose, n = s.maxLeafTris, r = s.strategy, a = s.onProgress, c =
|
|
296
|
+
const t = l.geometry, e = t.index ? t.index.array : null, i = s.maxDepth, o = s.verbose, n = s.maxLeafTris, r = s.strategy, a = s.onProgress, c = Ce(t), h = l._indirectBuffer;
|
|
297
297
|
let d = !1;
|
|
298
298
|
const E = new Float32Array(6), u = new Float32Array(6), f = ho(t, E), R = s.indirect ? po : fo, m = [], C = s.indirect ? wn(t) : Dn(t);
|
|
299
299
|
if (C.length === 1) {
|
|
@@ -308,21 +308,21 @@ function To(l, s) {
|
|
|
308
308
|
function A(p) {
|
|
309
309
|
a && a(p / c);
|
|
310
310
|
}
|
|
311
|
-
function F(p, T,
|
|
312
|
-
if (!d &&
|
|
313
|
-
return A(T +
|
|
314
|
-
const N = uo(p.boundingData,
|
|
311
|
+
function F(p, T, g, S = null, _ = 0) {
|
|
312
|
+
if (!d && _ >= i && (d = !0, o && (console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`), console.warn(t))), g <= n || _ >= i)
|
|
313
|
+
return A(T + g), p.offset = T, p.count = g, p;
|
|
314
|
+
const N = uo(p.boundingData, S, f, T, g, r);
|
|
315
315
|
if (N.axis === -1)
|
|
316
|
-
return A(T +
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
319
|
-
A(T +
|
|
316
|
+
return A(T + g), p.offset = T, p.count = g, p;
|
|
317
|
+
const y = R(h, e, f, T, g, N);
|
|
318
|
+
if (y === T || y === T + g)
|
|
319
|
+
A(T + g), p.offset = T, p.count = g;
|
|
320
320
|
else {
|
|
321
321
|
p.splitAxis = N.axis;
|
|
322
|
-
const w = new qe(),
|
|
323
|
-
p.left = w, w.boundingData = new Float32Array(6), Gs(f,
|
|
324
|
-
const x = new qe(), B =
|
|
325
|
-
p.right = x, x.boundingData = new Float32Array(6), Gs(f, B, H, x.boundingData, u), F(x, B, H, u,
|
|
322
|
+
const w = new qe(), L = T, U = y - T;
|
|
323
|
+
p.left = w, w.boundingData = new Float32Array(6), Gs(f, L, U, w.boundingData, u), F(w, L, U, u, _ + 1);
|
|
324
|
+
const x = new qe(), B = y, H = g - U;
|
|
325
|
+
p.right = x, x.boundingData = new Float32Array(6), Gs(f, B, H, x.boundingData, u), F(x, B, H, u, _ + 1);
|
|
326
326
|
}
|
|
327
327
|
return p;
|
|
328
328
|
}
|
|
@@ -410,7 +410,7 @@ const Ro = function() {
|
|
|
410
410
|
let C, A;
|
|
411
411
|
m !== 0 ? C = (d * E - f * u) / m : C = 0, A = (d + C * E) / u, n.x = C, n.y = A;
|
|
412
412
|
};
|
|
413
|
-
}(),
|
|
413
|
+
}(), gi = function() {
|
|
414
414
|
const l = new fe(), s = new M(), t = new M();
|
|
415
415
|
return function(i, o, n, r) {
|
|
416
416
|
Ro(i, o, l);
|
|
@@ -440,7 +440,7 @@ const Ro = function() {
|
|
|
440
440
|
}
|
|
441
441
|
};
|
|
442
442
|
}(), Ao = 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 yt();
|
|
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,34 +476,34 @@ 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 yt();
|
|
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;
|
|
483
483
|
for (let E = 0; E < 3; E++) {
|
|
484
484
|
const u = (E + 1) % 3;
|
|
485
|
-
t.start.copy(c[E]), t.end.copy(c[u]),
|
|
485
|
+
t.start.copy(c[E]), t.end.copy(c[u]), gi(t, i, l, s), h = l.distanceToSquared(s), h < d && (d = h, o && o.copy(l), n && n.copy(s));
|
|
486
486
|
}
|
|
487
487
|
return this.closestPointToPoint(r, l), h = r.distanceToSquared(l), h < d && (d = h, o && o.copy(l), n && n.copy(r)), this.closestPointToPoint(a, l), h = a.distanceToSquared(l), h < d && (d = h, o && o.copy(l), n && n.copy(a)), Math.sqrt(d);
|
|
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 yt(), d = new yt(), E = new yt(), u = new M();
|
|
492
492
|
function f(R, m, C) {
|
|
493
493
|
const A = R.points;
|
|
494
494
|
let F = 0, p = -1;
|
|
495
495
|
for (let T = 0; T < 3; T++) {
|
|
496
|
-
const { start:
|
|
497
|
-
|
|
498
|
-
const
|
|
499
|
-
if (zs(m.normal.dot(n)) &&
|
|
496
|
+
const { start: g, end: S } = h;
|
|
497
|
+
g.copy(A[T]), S.copy(A[(T + 1) % 3]), h.delta(n);
|
|
498
|
+
const _ = zs(m.distanceToPoint(g));
|
|
499
|
+
if (zs(m.normal.dot(n)) && _) {
|
|
500
500
|
C.copy(h), F = 2;
|
|
501
501
|
break;
|
|
502
502
|
}
|
|
503
503
|
const N = m.intersectLine(h, u);
|
|
504
|
-
if (!N &&
|
|
504
|
+
if (!N && _ && u.copy(g), (N || _) && !zs(u.distanceTo(S))) {
|
|
505
505
|
if (F <= 1)
|
|
506
|
-
(F === 1 ? C.start : C.end).copy(u),
|
|
506
|
+
(F === 1 ? C.start : C.end).copy(u), _ && (p = F);
|
|
507
507
|
else if (F >= 2) {
|
|
508
508
|
(p === 1 ? C.start : C.end).copy(u), F = 2;
|
|
509
509
|
break;
|
|
@@ -518,25 +518,25 @@ Ft.prototype.intersectsTriangle = function() {
|
|
|
518
518
|
this.needsUpdate && this.update(), m.isExtendedTriangle ? m.needsUpdate && m.update() : (l.copy(m), l.update(), m = l);
|
|
519
519
|
const F = this.plane, p = m.plane;
|
|
520
520
|
if (Math.abs(F.normal.dot(p.normal)) > 1 - 1e-10) {
|
|
521
|
-
const T = this.satBounds,
|
|
521
|
+
const T = this.satBounds, g = 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 (e.setFromPoints(w, t),
|
|
524
|
+
const y = T[N], w = g[N];
|
|
525
|
+
if (e.setFromPoints(w, t), y.isSeparated(e))
|
|
526
526
|
return !1;
|
|
527
527
|
}
|
|
528
|
-
const
|
|
528
|
+
const S = m.satBounds, _ = m.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(w, s),
|
|
531
|
+
const y = S[N], w = _[N];
|
|
532
|
+
if (e.setFromPoints(w, s), y.isSeparated(e))
|
|
533
533
|
return !1;
|
|
534
534
|
}
|
|
535
535
|
for (let N = 0; N < 4; N++) {
|
|
536
|
-
const
|
|
536
|
+
const y = g[N];
|
|
537
537
|
for (let w = 0; w < 4; w++) {
|
|
538
|
-
const
|
|
539
|
-
if (o.crossVectors(
|
|
538
|
+
const L = _[w];
|
|
539
|
+
if (o.crossVectors(y, L), e.setFromPoints(o, s), i.setFromPoints(o, t), e.isSeparated(i))
|
|
540
540
|
return !1;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
@@ -547,17 +547,17 @@ Ft.prototype.intersectsTriangle = function() {
|
|
|
547
547
|
return C && (C.start.copy(d.end), C.end.copy(d.end)), !0;
|
|
548
548
|
if (T !== 2)
|
|
549
549
|
return !1;
|
|
550
|
-
const
|
|
551
|
-
if (
|
|
550
|
+
const g = f(m, F, E);
|
|
551
|
+
if (g === 1 && this.containsPoint(E.end))
|
|
552
552
|
return C && (C.start.copy(E.end), C.end.copy(E.end)), !0;
|
|
553
|
-
if (
|
|
553
|
+
if (g !== 2)
|
|
554
554
|
return !1;
|
|
555
555
|
if (d.delta(r), E.delta(a), r.dot(a) < 0) {
|
|
556
556
|
let U = E.start;
|
|
557
557
|
E.start = E.end, E.end = U;
|
|
558
558
|
}
|
|
559
|
-
const
|
|
560
|
-
return
|
|
559
|
+
const S = d.start.dot(r), _ = d.end.dot(r), N = E.start.dot(r), y = E.end.dot(r), w = _ < N, L = S < y;
|
|
560
|
+
return S !== y && N !== _ && w === L ? !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 yt(), i = new yt();
|
|
572
572
|
return function(n, r = null, a = null) {
|
|
573
573
|
const c = r || a ? e : null;
|
|
574
574
|
if (this.intersectsTriangle(n, c))
|
|
@@ -586,7 +586,7 @@ Ft.prototype.distanceToTriangle = function() {
|
|
|
586
586
|
e.set(this[E], this[u]);
|
|
587
587
|
for (let f = 0; f < 3; f++) {
|
|
588
588
|
const R = t[f], m = t[(f + 1) % 3];
|
|
589
|
-
i.set(n[R], n[m]),
|
|
589
|
+
i.set(n[R], n[m]), gi(e, i, l, s);
|
|
590
590
|
const C = l.distanceToSquared(s);
|
|
591
591
|
C < h && (h = C, r && r.copy(l), a && a.copy(s));
|
|
592
592
|
}
|
|
@@ -596,7 +596,7 @@ Ft.prototype.distanceToTriangle = function() {
|
|
|
596
596
|
}();
|
|
597
597
|
class at {
|
|
598
598
|
constructor(s, t, e) {
|
|
599
|
-
this.isOrientedBox = !0, this.min = new M(), this.max = new M(), this.matrix = new
|
|
599
|
+
this.isOrientedBox = !0, this.min = new M(), this.max = new M(), this.matrix = new Lt(), this.invMatrix = new Lt(), this.points = new Array(8).fill().map(() => new M()), this.satAxes = new Array(3).fill().map(() => new M()), this.satBounds = new Array(3).fill().map(() => new wt()), this.alignedSatBounds = new Array(3).fill().map(() => new wt()), this.needsUpdate = !1, s && this.min.copy(s), t && this.max.copy(t), e && this.matrix.copy(e);
|
|
600
600
|
}
|
|
601
601
|
set(s, t, e) {
|
|
602
602
|
this.min.copy(s), this.max.copy(t), this.matrix.copy(e), this.needsUpdate = !0;
|
|
@@ -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 yt()), t = new Array(12).fill().map(() => new yt()), 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;
|
|
@@ -695,10 +695,10 @@ at.prototype.distanceToBox = function() {
|
|
|
695
695
|
for (let m = 0; m < 3; m++)
|
|
696
696
|
for (let C = 0; C <= 1; C++)
|
|
697
697
|
for (let A = 0; A <= 1; A++) {
|
|
698
|
-
const F = (m + 1) % 3, p = (m + 2) % 3, T = C << F | A << p,
|
|
699
|
-
s[R].set(
|
|
700
|
-
const
|
|
701
|
-
x[
|
|
698
|
+
const F = (m + 1) % 3, p = (m + 2) % 3, T = C << F | A << p, g = 1 << m | C << F | A << p, S = u[T], _ = u[g];
|
|
699
|
+
s[R].set(S, _);
|
|
700
|
+
const y = l[m], w = l[F], L = l[p], U = t[R], x = U.start, B = U.end;
|
|
701
|
+
x[y] = d[y], x[w] = C ? d[w] : E[w], x[L] = A ? d[L] : E[w], B[y] = E[y], B[w] = C ? d[w] : E[w], B[L] = A ? d[L] : E[w], R++;
|
|
702
702
|
}
|
|
703
703
|
for (let m = 0; m <= 1; m++)
|
|
704
704
|
for (let C = 0; C <= 1; C++)
|
|
@@ -712,7 +712,7 @@ at.prototype.distanceToBox = function() {
|
|
|
712
712
|
const C = s[m];
|
|
713
713
|
for (let A = 0; A < 12; A++) {
|
|
714
714
|
const F = t[A];
|
|
715
|
-
|
|
715
|
+
gi(C, F, e, i);
|
|
716
716
|
const p = e.distanceToSquared(i);
|
|
717
717
|
if (p < f && (f = p, a && a.copy(e), c && c.copy(i), p < h))
|
|
718
718
|
return Math.sqrt(p);
|
|
@@ -721,7 +721,7 @@ at.prototype.distanceToBox = function() {
|
|
|
721
721
|
return Math.sqrt(f);
|
|
722
722
|
};
|
|
723
723
|
}();
|
|
724
|
-
class
|
|
724
|
+
class Oi {
|
|
725
725
|
constructor(s) {
|
|
726
726
|
this._getNewPrimitive = s, this._primitives = [];
|
|
727
727
|
}
|
|
@@ -733,12 +733,12 @@ class gi {
|
|
|
733
733
|
this._primitives.push(s);
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
|
-
class
|
|
736
|
+
class go extends Oi {
|
|
737
737
|
constructor() {
|
|
738
738
|
super(() => new Ft());
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
|
-
const It = /* @__PURE__ */ new
|
|
741
|
+
const It = /* @__PURE__ */ new go();
|
|
742
742
|
function Et(l, s) {
|
|
743
743
|
return s[l + 15] === 65535;
|
|
744
744
|
}
|
|
@@ -757,7 +757,7 @@ function Ct(l, s) {
|
|
|
757
757
|
function Un(l, s) {
|
|
758
758
|
return s[l + 7];
|
|
759
759
|
}
|
|
760
|
-
class
|
|
760
|
+
class Oo {
|
|
761
761
|
constructor() {
|
|
762
762
|
this.float32Array = null, this.uint16Array = null, this.uint32Array = null;
|
|
763
763
|
const s = [];
|
|
@@ -769,10 +769,10 @@ class go {
|
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
|
-
const Z = new
|
|
772
|
+
const Z = new Oo();
|
|
773
773
|
let Yt, Ie;
|
|
774
|
-
const Jt = [], Ke = /* @__PURE__ */ new
|
|
775
|
-
function
|
|
774
|
+
const Jt = [], Ke = /* @__PURE__ */ new Oi(() => new gt());
|
|
775
|
+
function So(l, s, t, e, i, o) {
|
|
776
776
|
Yt = Ke.getPrimitive(), Ie = Ke.getPrimitive(), Jt.push(Yt, Ie), Z.setBuffer(l._roots[s]);
|
|
777
777
|
const n = ai(0, l.geometry, t, e, i, o);
|
|
778
778
|
Z.clearBuffer(), Ke.releasePrimitive(Yt), Ke.releasePrimitive(Ie), Jt.pop(), Jt.pop();
|
|
@@ -786,34 +786,34 @@ 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 y = function(L) {
|
|
790
790
|
const { uint16Array: U, uint32Array: x } = Z;
|
|
791
|
-
let B =
|
|
791
|
+
let B = L * 2;
|
|
792
792
|
for (; !Et(B, U); )
|
|
793
|
-
|
|
794
|
-
return dt(
|
|
795
|
-
}, w = function(
|
|
793
|
+
L = pt(L), B = L * 2;
|
|
794
|
+
return dt(L, x);
|
|
795
|
+
}, w = function(L) {
|
|
796
796
|
const { uint16Array: U, uint32Array: x } = Z;
|
|
797
|
-
let B =
|
|
797
|
+
let B = L * 2;
|
|
798
798
|
for (; !Et(B, U); )
|
|
799
|
-
|
|
800
|
-
return dt(
|
|
799
|
+
L = Ct(L, x), B = L * 2;
|
|
800
|
+
return dt(L, x) + ft(B, U);
|
|
801
801
|
};
|
|
802
802
|
const E = pt(l), u = Ct(l, c);
|
|
803
803
|
let f = E, R = u, m, C, A, F;
|
|
804
804
|
if (i && (A = Yt, F = Ie, K(f, r, A), K(R, r, F), m = i(A), C = i(F), C < m)) {
|
|
805
805
|
f = u, R = E;
|
|
806
|
-
const
|
|
807
|
-
m = C, C =
|
|
806
|
+
const L = m;
|
|
807
|
+
m = C, C = L, A = F;
|
|
808
808
|
}
|
|
809
809
|
A || (A = Yt, K(f, r, A));
|
|
810
810
|
const p = Et(f * 2, a), T = t(A, p, m, n + 1, o + f);
|
|
811
|
-
let
|
|
811
|
+
let g;
|
|
812
812
|
if (T === xi) {
|
|
813
|
-
const
|
|
814
|
-
|
|
813
|
+
const L = y(f), x = w(f) - L;
|
|
814
|
+
g = e(L, x, !0, n + 1, o + f, A);
|
|
815
815
|
} else
|
|
816
|
-
|
|
816
|
+
g = T && ai(
|
|
817
817
|
f,
|
|
818
818
|
s,
|
|
819
819
|
t,
|
|
@@ -822,16 +822,16 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
|
|
|
822
822
|
o,
|
|
823
823
|
n + 1
|
|
824
824
|
);
|
|
825
|
-
if (
|
|
825
|
+
if (g)
|
|
826
826
|
return !0;
|
|
827
827
|
F = Ie, K(R, r, F);
|
|
828
|
-
const
|
|
828
|
+
const S = Et(R * 2, a), _ = t(F, S, C, n + 1, o + R);
|
|
829
829
|
let N;
|
|
830
|
-
if (
|
|
831
|
-
const
|
|
832
|
-
N = e(
|
|
830
|
+
if (_ === xi) {
|
|
831
|
+
const L = y(R), x = w(R) - L;
|
|
832
|
+
N = e(L, x, !0, n + 1, o + R, F);
|
|
833
833
|
} else
|
|
834
|
-
N =
|
|
834
|
+
N = _ && ai(
|
|
835
835
|
R,
|
|
836
836
|
s,
|
|
837
837
|
t,
|
|
@@ -843,18 +843,18 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
|
|
|
843
843
|
return !!N;
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
const
|
|
847
|
-
function
|
|
846
|
+
const Fe = /* @__PURE__ */ new M(), Hs = /* @__PURE__ */ new M();
|
|
847
|
+
function _o(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(
|
|
851
851
|
{
|
|
852
|
-
boundsTraverseOrder: (h) => (
|
|
852
|
+
boundsTraverseOrder: (h) => (Fe.copy(s).clamp(h.min, h.max), Fe.distanceToSquared(s)),
|
|
853
853
|
intersectsBounds: (h, d, E) => E < r && E < n,
|
|
854
854
|
intersectsTriangle: (h, d) => {
|
|
855
|
-
h.closestPointToPoint(s,
|
|
856
|
-
const E = s.distanceToSquared(
|
|
857
|
-
return E < r && (Hs.copy(
|
|
855
|
+
h.closestPointToPoint(s, Fe);
|
|
856
|
+
const E = s.distanceToSquared(Fe);
|
|
857
|
+
return E < r && (Hs.copy(Fe), r = E, a = d), E < o;
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
860
|
), r === 1 / 0)
|
|
@@ -865,7 +865,7 @@ function So(l, s, t = {}, e = 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, s, t, e, i, o) {
|
|
867
867
|
let n;
|
|
868
|
-
return o === Zn ? n = l.intersectTriangle(e, t, s, !0, i) : n = l.intersectTriangle(s, t, e, o !==
|
|
868
|
+
return o === Zn ? 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),
|
|
870
870
|
point: i.clone()
|
|
871
871
|
};
|
|
@@ -899,12 +899,12 @@ function tt(l, s, t, e) {
|
|
|
899
899
|
let r = s, a = s + 1, c = s + 2;
|
|
900
900
|
t && (r = t.getX(r), a = t.getX(a), c = t.getX(c)), i.x = e.getX(r), i.y = e.getY(r), i.z = e.getZ(r), o.x = e.getX(a), o.y = e.getY(a), o.z = e.getZ(a), n.x = e.getX(c), n.y = e.getY(c), n.z = e.getZ(c);
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function yo(l, s, t, e, i, o) {
|
|
903
903
|
const { geometry: n, _indirectBuffer: r } = l;
|
|
904
904
|
for (let a = e, c = e + i; a < c; a++)
|
|
905
905
|
xs(n, s, t, a, o);
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function Lo(l, s, t, e, i) {
|
|
908
908
|
const { geometry: o, _indirectBuffer: n } = l;
|
|
909
909
|
let r = 1 / 0, a = null;
|
|
910
910
|
for (let c = e, h = e + i; c < h; c++) {
|
|
@@ -933,33 +933,33 @@ function wo(l, s = null) {
|
|
|
933
933
|
const R = E * 2;
|
|
934
934
|
if (r[R + 15] === Us) {
|
|
935
935
|
const C = n[E + 6], A = r[R + 14];
|
|
936
|
-
let F = 1 / 0, p = 1 / 0, T = 1 / 0,
|
|
937
|
-
for (let N = 3 * C,
|
|
936
|
+
let F = 1 / 0, p = 1 / 0, T = 1 / 0, g = -1 / 0, S = -1 / 0, _ = -1 / 0;
|
|
937
|
+
for (let N = 3 * C, y = 3 * (C + A); N < y; N++) {
|
|
938
938
|
let w = e[N];
|
|
939
|
-
const
|
|
940
|
-
|
|
939
|
+
const L = i.getX(w), U = i.getY(w), x = i.getZ(w);
|
|
940
|
+
L < F && (F = L), L > g && (g = L), U < p && (p = U), U > S && (S = U), x < T && (T = x), x > _ && (_ = x);
|
|
941
941
|
}
|
|
942
|
-
return a[E + 0] !== F || a[E + 1] !== p || a[E + 2] !== T || a[E + 3] !==
|
|
942
|
+
return a[E + 0] !== F || a[E + 1] !== p || a[E + 2] !== T || a[E + 3] !== g || a[E + 4] !== S || a[E + 5] !== _ ? (a[E + 0] = F, a[E + 1] = p, a[E + 2] = T, a[E + 3] = g, a[E + 4] = S, a[E + 5] = _, !0) : !1;
|
|
943
943
|
} else {
|
|
944
944
|
const C = E + 8, A = n[E + 6], F = C + u, p = A + u;
|
|
945
|
-
let T = f,
|
|
946
|
-
s ? T || (
|
|
947
|
-
const
|
|
948
|
-
let
|
|
949
|
-
|
|
945
|
+
let T = f, g = !1, S = !1;
|
|
946
|
+
s ? T || (g = s.has(F), S = s.has(p), T = !g && !S) : (g = !0, S = !0);
|
|
947
|
+
const _ = T || g, N = T || S;
|
|
948
|
+
let y = !1;
|
|
949
|
+
_ && (y = d(C, u, T));
|
|
950
950
|
let w = !1;
|
|
951
951
|
N && (w = d(A, u, T));
|
|
952
|
-
const
|
|
953
|
-
if (
|
|
952
|
+
const L = y || w;
|
|
953
|
+
if (L)
|
|
954
954
|
for (let U = 0; U < 3; U++) {
|
|
955
955
|
const x = C + U, B = A + U, H = a[x], q = a[x + 3], st = a[B], Q = a[B + 3];
|
|
956
956
|
a[E + U] = H < st ? H : st, a[E + U + 3] = q > Q ? q : Q;
|
|
957
957
|
}
|
|
958
|
-
return
|
|
958
|
+
return L;
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
961
|
}
|
|
962
|
-
const Hi = /* @__PURE__ */ new
|
|
962
|
+
const Hi = /* @__PURE__ */ new gt();
|
|
963
963
|
function Gt(l, s, t, e) {
|
|
964
964
|
return K(l, s, Hi), t.intersectBox(Hi, e);
|
|
965
965
|
}
|
|
@@ -996,7 +996,7 @@ function ci(l, s, t, e, i) {
|
|
|
996
996
|
const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = l * 2;
|
|
997
997
|
if (Et(a, n)) {
|
|
998
998
|
const h = dt(l, r), d = ft(a, n);
|
|
999
|
-
|
|
999
|
+
yo(s, t, e, h, d, i);
|
|
1000
1000
|
} else {
|
|
1001
1001
|
const h = pt(l);
|
|
1002
1002
|
Gt(h, o, e, ki) && ci(h, s, t, e, i);
|
|
@@ -1015,7 +1015,7 @@ function li(l, s, t, e) {
|
|
|
1015
1015
|
let r = l * 2;
|
|
1016
1016
|
if (Et(r, o)) {
|
|
1017
1017
|
const c = dt(l, n), h = ft(r, o);
|
|
1018
|
-
return
|
|
1018
|
+
return Lo(s, t, e, c, h);
|
|
1019
1019
|
} else {
|
|
1020
1020
|
const c = Un(l, n), h = vo[c], E = e.direction[h] >= 0;
|
|
1021
1021
|
let u, f;
|
|
@@ -1033,7 +1033,7 @@ function li(l, s, t, e) {
|
|
|
1033
1033
|
return m && A ? m.distance <= A.distance ? m : A : m || A || null;
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
|
-
const ss = /* @__PURE__ */ new
|
|
1036
|
+
const ss = /* @__PURE__ */ new gt(), ie = /* @__PURE__ */ new Ft(), ne = /* @__PURE__ */ new Ft(), ge = /* @__PURE__ */ new Lt(), Xi = /* @__PURE__ */ new at(), is = /* @__PURE__ */ new at();
|
|
1037
1037
|
function Yo(l, s, t, e) {
|
|
1038
1038
|
Z.setBuffer(l._roots[s]);
|
|
1039
1039
|
const i = hi(0, l, t, e);
|
|
@@ -1044,8 +1044,8 @@ function hi(l, s, t, e, i = null) {
|
|
|
1044
1044
|
let a = l * 2;
|
|
1045
1045
|
if (i === null && (t.boundingBox || t.computeBoundingBox(), Xi.set(t.boundingBox.min, t.boundingBox.max, e), i = Xi), Et(a, n)) {
|
|
1046
1046
|
const h = s.geometry, d = h.index, E = h.attributes.position, u = t.index, f = t.attributes.position, R = dt(l, r), m = ft(a, n);
|
|
1047
|
-
if (
|
|
1048
|
-
return K(l, o, is), is.matrix.copy(
|
|
1047
|
+
if (ge.copy(e).invert(), t.boundsTree)
|
|
1048
|
+
return K(l, o, is), is.matrix.copy(ge), is.needsUpdate = !0, t.boundsTree.shapecast({
|
|
1049
1049
|
intersectsBounds: (A) => is.intersectsBox(A),
|
|
1050
1050
|
intersectsTriangle: (A) => {
|
|
1051
1051
|
A.a.applyMatrix4(e), A.b.applyMatrix4(e), A.c.applyMatrix4(e), A.needsUpdate = !0;
|
|
@@ -1056,7 +1056,7 @@ function hi(l, s, t, e, i = null) {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
});
|
|
1058
1058
|
for (let C = R * 3, A = (m + R) * 3; C < A; C += 3) {
|
|
1059
|
-
tt(ie, C, d, E), ie.a.applyMatrix4(
|
|
1059
|
+
tt(ie, C, d, E), ie.a.applyMatrix4(ge), ie.b.applyMatrix4(ge), ie.c.applyMatrix4(ge), ie.needsUpdate = !0;
|
|
1060
1060
|
for (let F = 0, p = u.count; F < p; F += 3)
|
|
1061
1061
|
if (tt(ne, F, u, f), ne.needsUpdate = !0, ie.intersectsTriangle(ne))
|
|
1062
1062
|
return !0;
|
|
@@ -1066,7 +1066,7 @@ function hi(l, s, t, e, i = null) {
|
|
|
1066
1066
|
return K(h, o, ss), !!(i.intersectsBox(ss) && hi(h, s, t, e, i) || (K(d, o, ss), i.intersectsBox(ss) && hi(d, s, t, e, i)));
|
|
1067
1067
|
}
|
|
1068
1068
|
}
|
|
1069
|
-
const ns = /* @__PURE__ */ new
|
|
1069
|
+
const ns = /* @__PURE__ */ new Lt(), ks = /* @__PURE__ */ new at(), Oe = /* @__PURE__ */ new at(), Vo = /* @__PURE__ */ new M(), Go = /* @__PURE__ */ new M(), zo = /* @__PURE__ */ new M(), Ho = /* @__PURE__ */ new M();
|
|
1070
1070
|
function ko(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
1071
1071
|
s.boundingBox || s.computeBoundingBox(), ks.set(s.boundingBox.min, s.boundingBox.max, t), ks.needsUpdate = !0;
|
|
1072
1072
|
const r = l.geometry, a = r.attributes.position, c = r.index, h = s.attributes.position, d = s.index, E = It.getPrimitive(), u = It.getPrimitive();
|
|
@@ -1076,32 +1076,32 @@ function ko(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1076
1076
|
return ns.copy(t).invert(), Oe.matrix.copy(ns), l.shapecast(
|
|
1077
1077
|
{
|
|
1078
1078
|
boundsTraverseOrder: (T) => ks.distanceToBox(T),
|
|
1079
|
-
intersectsBounds: (T,
|
|
1080
|
-
intersectsRange: (T,
|
|
1079
|
+
intersectsBounds: (T, g, S) => S < A && S < n ? (g && (Oe.min.copy(T.min), Oe.max.copy(T.max), Oe.needsUpdate = !0), !0) : !1,
|
|
1080
|
+
intersectsRange: (T, g) => {
|
|
1081
1081
|
if (s.boundsTree)
|
|
1082
1082
|
return s.boundsTree.shapecast({
|
|
1083
|
-
boundsTraverseOrder: (
|
|
1084
|
-
intersectsBounds: (
|
|
1085
|
-
intersectsRange: (
|
|
1086
|
-
for (let
|
|
1087
|
-
tt(u, 3 *
|
|
1088
|
-
for (let
|
|
1089
|
-
tt(E, 3 *
|
|
1083
|
+
boundsTraverseOrder: (_) => Oe.distanceToBox(_),
|
|
1084
|
+
intersectsBounds: (_, N, y) => y < A && y < n,
|
|
1085
|
+
intersectsRange: (_, N) => {
|
|
1086
|
+
for (let y = _, w = _ + N; y < w; y++) {
|
|
1087
|
+
tt(u, 3 * y, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1088
|
+
for (let L = T, U = T + g; L < U; L++) {
|
|
1089
|
+
tt(E, 3 * L, c, a), E.needsUpdate = !0;
|
|
1090
1090
|
const x = E.distanceToTriangle(u, f, m);
|
|
1091
|
-
if (x < A && (R.copy(f), C && C.copy(m), A = x, F =
|
|
1091
|
+
if (x < A && (R.copy(f), C && C.copy(m), A = x, F = L, p = y), x < o)
|
|
1092
1092
|
return !0;
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
1096
|
});
|
|
1097
1097
|
{
|
|
1098
|
-
const
|
|
1099
|
-
for (let
|
|
1100
|
-
tt(u, 3 *
|
|
1101
|
-
for (let
|
|
1102
|
-
tt(E, 3 *
|
|
1103
|
-
const
|
|
1104
|
-
if (
|
|
1098
|
+
const S = Ce(s);
|
|
1099
|
+
for (let _ = 0, N = S; _ < N; _++) {
|
|
1100
|
+
tt(u, 3 * _, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1101
|
+
for (let y = T, w = T + g; y < w; y++) {
|
|
1102
|
+
tt(E, 3 * y, c, a), E.needsUpdate = !0;
|
|
1103
|
+
const L = E.distanceToTriangle(u, f, m);
|
|
1104
|
+
if (L < A && (R.copy(f), C && C.copy(m), A = L, F = y, p = _), L < o)
|
|
1105
1105
|
return !0;
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
@@ -1121,33 +1121,33 @@ function Wo(l, s = null) {
|
|
|
1121
1121
|
const R = E * 2;
|
|
1122
1122
|
if (r[R + 15] === Us) {
|
|
1123
1123
|
const C = n[E + 6], A = r[R + 14];
|
|
1124
|
-
let F = 1 / 0, p = 1 / 0, T = 1 / 0,
|
|
1125
|
-
for (let N = C,
|
|
1124
|
+
let F = 1 / 0, p = 1 / 0, T = 1 / 0, g = -1 / 0, S = -1 / 0, _ = -1 / 0;
|
|
1125
|
+
for (let N = C, y = C + A; N < y; N++) {
|
|
1126
1126
|
const w = 3 * l.resolveTriangleIndex(N);
|
|
1127
|
-
for (let
|
|
1128
|
-
let U = w +
|
|
1127
|
+
for (let L = 0; L < 3; L++) {
|
|
1128
|
+
let U = w + L;
|
|
1129
1129
|
U = e ? e[U] : U;
|
|
1130
1130
|
const x = i.getX(U), B = i.getY(U), H = i.getZ(U);
|
|
1131
|
-
x < F && (F = x), x >
|
|
1131
|
+
x < F && (F = x), x > g && (g = x), B < p && (p = B), B > S && (S = B), H < T && (T = H), H > _ && (_ = H);
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
|
-
return a[E + 0] !== F || a[E + 1] !== p || a[E + 2] !== T || a[E + 3] !==
|
|
1134
|
+
return a[E + 0] !== F || a[E + 1] !== p || a[E + 2] !== T || a[E + 3] !== g || a[E + 4] !== S || a[E + 5] !== _ ? (a[E + 0] = F, a[E + 1] = p, a[E + 2] = T, a[E + 3] = g, a[E + 4] = S, a[E + 5] = _, !0) : !1;
|
|
1135
1135
|
} else {
|
|
1136
1136
|
const C = E + 8, A = n[E + 6], F = C + u, p = A + u;
|
|
1137
|
-
let T = f,
|
|
1138
|
-
s ? T || (
|
|
1139
|
-
const
|
|
1140
|
-
let
|
|
1141
|
-
|
|
1137
|
+
let T = f, g = !1, S = !1;
|
|
1138
|
+
s ? T || (g = s.has(F), S = s.has(p), T = !g && !S) : (g = !0, S = !0);
|
|
1139
|
+
const _ = T || g, N = T || S;
|
|
1140
|
+
let y = !1;
|
|
1141
|
+
_ && (y = d(C, u, T));
|
|
1142
1142
|
let w = !1;
|
|
1143
1143
|
N && (w = d(A, u, T));
|
|
1144
|
-
const
|
|
1145
|
-
if (
|
|
1144
|
+
const L = y || w;
|
|
1145
|
+
if (L)
|
|
1146
1146
|
for (let U = 0; U < 3; U++) {
|
|
1147
1147
|
const x = C + U, B = A + U, H = a[x], q = a[x + 3], st = a[B], Q = a[B + 3];
|
|
1148
1148
|
a[E + U] = H < st ? H : st, a[E + U + 3] = q > Q ? q : Q;
|
|
1149
1149
|
}
|
|
1150
|
-
return
|
|
1150
|
+
return L;
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
@@ -1196,7 +1196,7 @@ function di(l, s, t, e) {
|
|
|
1196
1196
|
return m && A ? m.distance <= A.distance ? m : A : m || A || null;
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
1199
|
-
const os = /* @__PURE__ */ new
|
|
1199
|
+
const os = /* @__PURE__ */ new gt(), oe = /* @__PURE__ */ new Ft(), re = /* @__PURE__ */ new Ft(), Se = /* @__PURE__ */ new Lt(), ji = /* @__PURE__ */ new at(), rs = /* @__PURE__ */ new at();
|
|
1200
1200
|
function jo(l, s, t, e) {
|
|
1201
1201
|
Z.setBuffer(l._roots[s]);
|
|
1202
1202
|
const i = ui(0, l, t, e);
|
|
@@ -1207,8 +1207,8 @@ function ui(l, s, t, e, i = null) {
|
|
|
1207
1207
|
let a = l * 2;
|
|
1208
1208
|
if (i === null && (t.boundingBox || t.computeBoundingBox(), ji.set(t.boundingBox.min, t.boundingBox.max, e), i = ji), Et(a, n)) {
|
|
1209
1209
|
const h = s.geometry, d = h.index, E = h.attributes.position, u = t.index, f = t.attributes.position, R = dt(l, r), m = ft(a, n);
|
|
1210
|
-
if (
|
|
1211
|
-
return K(l, o, rs), rs.matrix.copy(
|
|
1210
|
+
if (Se.copy(e).invert(), t.boundsTree)
|
|
1211
|
+
return K(l, o, rs), rs.matrix.copy(Se), rs.needsUpdate = !0, t.boundsTree.shapecast({
|
|
1212
1212
|
intersectsBounds: (A) => rs.intersectsBox(A),
|
|
1213
1213
|
intersectsTriangle: (A) => {
|
|
1214
1214
|
A.a.applyMatrix4(e), A.b.applyMatrix4(e), A.c.applyMatrix4(e), A.needsUpdate = !0;
|
|
@@ -1220,7 +1220,7 @@ function ui(l, s, t, e, i = null) {
|
|
|
1220
1220
|
});
|
|
1221
1221
|
for (let C = R, A = m + R; C < A; C++) {
|
|
1222
1222
|
const F = s.resolveTriangleIndex(C);
|
|
1223
|
-
tt(oe, 3 * F, d, E), oe.a.applyMatrix4(
|
|
1223
|
+
tt(oe, 3 * F, d, E), oe.a.applyMatrix4(Se), oe.b.applyMatrix4(Se), oe.c.applyMatrix4(Se), oe.needsUpdate = !0;
|
|
1224
1224
|
for (let p = 0, T = u.count; p < T; p += 3)
|
|
1225
1225
|
if (tt(re, p, u, f), re.needsUpdate = !0, oe.intersectsTriangle(re))
|
|
1226
1226
|
return !0;
|
|
@@ -1230,7 +1230,7 @@ function ui(l, s, t, e, i = null) {
|
|
|
1230
1230
|
return K(h, o, os), !!(i.intersectsBox(os) && ui(h, s, t, e, i) || (K(d, o, os), i.intersectsBox(os) && ui(d, s, t, e, i)));
|
|
1231
1231
|
}
|
|
1232
1232
|
}
|
|
1233
|
-
const as = /* @__PURE__ */ new
|
|
1233
|
+
const as = /* @__PURE__ */ new Lt(), Ws = /* @__PURE__ */ new at(), _e = /* @__PURE__ */ new at(), qo = /* @__PURE__ */ new M(), Ko = /* @__PURE__ */ new M(), $o = /* @__PURE__ */ new M(), Jo = /* @__PURE__ */ new M();
|
|
1234
1234
|
function tr(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
1235
1235
|
s.boundingBox || s.computeBoundingBox(), Ws.set(s.boundingBox.min, s.boundingBox.max, t), Ws.needsUpdate = !0;
|
|
1236
1236
|
const r = l.geometry, a = r.attributes.position, c = r.index, h = s.attributes.position, d = s.index, E = It.getPrimitive(), u = It.getPrimitive();
|
|
@@ -1240,36 +1240,36 @@ function tr(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1240
1240
|
return as.copy(t).invert(), _e.matrix.copy(as), l.shapecast(
|
|
1241
1241
|
{
|
|
1242
1242
|
boundsTraverseOrder: (T) => Ws.distanceToBox(T),
|
|
1243
|
-
intersectsBounds: (T,
|
|
1244
|
-
intersectsRange: (T,
|
|
1243
|
+
intersectsBounds: (T, g, S) => S < A && S < n ? (g && (_e.min.copy(T.min), _e.max.copy(T.max), _e.needsUpdate = !0), !0) : !1,
|
|
1244
|
+
intersectsRange: (T, g) => {
|
|
1245
1245
|
if (s.boundsTree) {
|
|
1246
|
-
const
|
|
1247
|
-
return
|
|
1248
|
-
boundsTraverseOrder: (
|
|
1249
|
-
intersectsBounds: (
|
|
1250
|
-
intersectsRange: (
|
|
1251
|
-
for (let
|
|
1252
|
-
const
|
|
1253
|
-
tt(u, 3 *
|
|
1254
|
-
for (let U = T, x = T +
|
|
1246
|
+
const S = s.boundsTree;
|
|
1247
|
+
return S.shapecast({
|
|
1248
|
+
boundsTraverseOrder: (_) => _e.distanceToBox(_),
|
|
1249
|
+
intersectsBounds: (_, N, y) => y < A && y < n,
|
|
1250
|
+
intersectsRange: (_, N) => {
|
|
1251
|
+
for (let y = _, w = _ + N; y < w; y++) {
|
|
1252
|
+
const L = S.resolveTriangleIndex(y);
|
|
1253
|
+
tt(u, 3 * L, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1254
|
+
for (let U = T, x = T + g; 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, f, m);
|
|
1258
|
-
if (H < A && (R.copy(f), C && C.copy(m), A = H, F = U, p =
|
|
1258
|
+
if (H < A && (R.copy(f), C && C.copy(m), A = H, F = U, p = y), H < o)
|
|
1259
1259
|
return !0;
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
1262
1262
|
}
|
|
1263
1263
|
});
|
|
1264
1264
|
} else {
|
|
1265
|
-
const
|
|
1266
|
-
for (let
|
|
1267
|
-
tt(u, 3 *
|
|
1268
|
-
for (let
|
|
1269
|
-
const
|
|
1270
|
-
tt(E, 3 *
|
|
1265
|
+
const S = Ce(s);
|
|
1266
|
+
for (let _ = 0, N = S; _ < N; _++) {
|
|
1267
|
+
tt(u, 3 * _, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1268
|
+
for (let y = T, w = T + g; y < w; y++) {
|
|
1269
|
+
const L = l.resolveTriangleIndex(y);
|
|
1270
|
+
tt(E, 3 * L, c, a), E.needsUpdate = !0;
|
|
1271
1271
|
const U = E.distanceToTriangle(u, f, m);
|
|
1272
|
-
if (U < A && (R.copy(f), C && C.copy(m), A = U, F =
|
|
1272
|
+
if (U < A && (R.copy(f), C && C.copy(m), A = U, F = y, p = _), U < o)
|
|
1273
1273
|
return !0;
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
@@ -1281,7 +1281,7 @@ function tr(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1281
1281
|
function er() {
|
|
1282
1282
|
return typeof SharedArrayBuffer < "u";
|
|
1283
1283
|
}
|
|
1284
|
-
const
|
|
1284
|
+
const be = new Z.constructor(), As = new Z.constructor(), vt = new Oi(() => new gt()), ae = new gt(), ce = new gt(), Xs = new gt(), Zs = new gt();
|
|
1285
1285
|
let Qs = !1;
|
|
1286
1286
|
function sr(l, s, t, e) {
|
|
1287
1287
|
if (Qs)
|
|
@@ -1289,11 +1289,11 @@ function sr(l, s, t, e) {
|
|
|
1289
1289
|
Qs = !0;
|
|
1290
1290
|
const i = l._roots, o = s._roots;
|
|
1291
1291
|
let n, r = 0, a = 0;
|
|
1292
|
-
const c = new
|
|
1292
|
+
const c = new Lt().copy(t).invert();
|
|
1293
1293
|
for (let h = 0, d = i.length; h < d; h++) {
|
|
1294
|
-
|
|
1294
|
+
be.setBuffer(i[h]), a = 0;
|
|
1295
1295
|
const E = vt.getPrimitive();
|
|
1296
|
-
K(0,
|
|
1296
|
+
K(0, be.float32Array, E), E.applyMatrix4(c);
|
|
1297
1297
|
for (let u = 0, f = o.length; u < f && (As.setBuffer(o[h]), n = Tt(
|
|
1298
1298
|
0,
|
|
1299
1299
|
0,
|
|
@@ -1307,18 +1307,18 @@ function sr(l, s, t, e) {
|
|
|
1307
1307
|
E
|
|
1308
1308
|
), As.clearBuffer(), a += o[u].length, !n); u++)
|
|
1309
1309
|
;
|
|
1310
|
-
if (vt.releasePrimitive(E),
|
|
1310
|
+
if (vt.releasePrimitive(E), be.clearBuffer(), r += i[h].length, n)
|
|
1311
1311
|
break;
|
|
1312
1312
|
}
|
|
1313
1313
|
return Qs = !1, n;
|
|
1314
1314
|
}
|
|
1315
1315
|
function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
1316
1316
|
let d, E;
|
|
1317
|
-
h ? (d = As, E =
|
|
1318
|
-
const u = d.float32Array, f = d.uint32Array, R = d.uint16Array, m = E.float32Array, C = E.uint32Array, A = E.uint16Array, F = l * 2, p = s * 2, T = Et(F, R),
|
|
1319
|
-
let
|
|
1320
|
-
if (
|
|
1321
|
-
h ?
|
|
1317
|
+
h ? (d = As, E = be) : (d = be, E = As);
|
|
1318
|
+
const u = d.float32Array, f = d.uint32Array, R = d.uint16Array, m = E.float32Array, C = E.uint32Array, A = E.uint16Array, F = l * 2, p = s * 2, T = Et(F, R), g = Et(p, A);
|
|
1319
|
+
let S = !1;
|
|
1320
|
+
if (g && T)
|
|
1321
|
+
h ? S = i(
|
|
1322
1322
|
dt(s, C),
|
|
1323
1323
|
ft(s * 2, A),
|
|
1324
1324
|
dt(l, f),
|
|
@@ -1327,7 +1327,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1327
1327
|
n + s,
|
|
1328
1328
|
r,
|
|
1329
1329
|
o + l
|
|
1330
|
-
) :
|
|
1330
|
+
) : S = i(
|
|
1331
1331
|
dt(l, f),
|
|
1332
1332
|
ft(l * 2, R),
|
|
1333
1333
|
dt(s, C),
|
|
@@ -1337,13 +1337,13 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1337
1337
|
a,
|
|
1338
1338
|
n + s
|
|
1339
1339
|
);
|
|
1340
|
-
else if (
|
|
1341
|
-
const
|
|
1342
|
-
K(s, m,
|
|
1343
|
-
const N = pt(l),
|
|
1344
|
-
K(N, u, ae), K(
|
|
1345
|
-
const w =
|
|
1346
|
-
|
|
1340
|
+
else if (g) {
|
|
1341
|
+
const _ = vt.getPrimitive();
|
|
1342
|
+
K(s, m, _), _.applyMatrix4(t);
|
|
1343
|
+
const N = pt(l), y = Ct(l, f);
|
|
1344
|
+
K(N, u, ae), K(y, u, ce);
|
|
1345
|
+
const w = _.intersectsBox(ae), L = _.intersectsBox(ce);
|
|
1346
|
+
S = w && Tt(
|
|
1347
1347
|
s,
|
|
1348
1348
|
N,
|
|
1349
1349
|
e,
|
|
@@ -1353,11 +1353,11 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1353
1353
|
o,
|
|
1354
1354
|
a,
|
|
1355
1355
|
r + 1,
|
|
1356
|
-
|
|
1356
|
+
_,
|
|
1357
1357
|
!h
|
|
1358
|
-
) ||
|
|
1358
|
+
) || L && Tt(
|
|
1359
1359
|
s,
|
|
1360
|
-
|
|
1360
|
+
y,
|
|
1361
1361
|
e,
|
|
1362
1362
|
t,
|
|
1363
1363
|
i,
|
|
@@ -1365,17 +1365,17 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1365
1365
|
o,
|
|
1366
1366
|
a,
|
|
1367
1367
|
r + 1,
|
|
1368
|
-
|
|
1368
|
+
_,
|
|
1369
1369
|
!h
|
|
1370
|
-
), vt.releasePrimitive(
|
|
1370
|
+
), vt.releasePrimitive(_);
|
|
1371
1371
|
} else {
|
|
1372
|
-
const
|
|
1373
|
-
K(
|
|
1374
|
-
const
|
|
1375
|
-
if (
|
|
1376
|
-
|
|
1372
|
+
const _ = pt(s), N = Ct(s, C);
|
|
1373
|
+
K(_, m, Xs), K(N, m, Zs);
|
|
1374
|
+
const y = c.intersectsBox(Xs), w = c.intersectsBox(Zs);
|
|
1375
|
+
if (y && w)
|
|
1376
|
+
S = Tt(
|
|
1377
1377
|
l,
|
|
1378
|
-
|
|
1378
|
+
_,
|
|
1379
1379
|
t,
|
|
1380
1380
|
e,
|
|
1381
1381
|
i,
|
|
@@ -1398,11 +1398,11 @@ 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 (y)
|
|
1402
1402
|
if (T)
|
|
1403
|
-
|
|
1403
|
+
S = Tt(
|
|
1404
1404
|
l,
|
|
1405
|
-
|
|
1405
|
+
_,
|
|
1406
1406
|
t,
|
|
1407
1407
|
e,
|
|
1408
1408
|
i,
|
|
@@ -1414,13 +1414,13 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1414
1414
|
h
|
|
1415
1415
|
);
|
|
1416
1416
|
else {
|
|
1417
|
-
const
|
|
1418
|
-
|
|
1417
|
+
const L = vt.getPrimitive();
|
|
1418
|
+
L.copy(Xs).applyMatrix4(t);
|
|
1419
1419
|
const U = pt(l), x = Ct(l, f);
|
|
1420
1420
|
K(U, u, ae), K(x, u, ce);
|
|
1421
|
-
const B =
|
|
1422
|
-
|
|
1423
|
-
|
|
1421
|
+
const B = L.intersectsBox(ae), H = L.intersectsBox(ce);
|
|
1422
|
+
S = B && Tt(
|
|
1423
|
+
_,
|
|
1424
1424
|
U,
|
|
1425
1425
|
e,
|
|
1426
1426
|
t,
|
|
@@ -1429,10 +1429,10 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1429
1429
|
o,
|
|
1430
1430
|
a,
|
|
1431
1431
|
r + 1,
|
|
1432
|
-
|
|
1432
|
+
L,
|
|
1433
1433
|
!h
|
|
1434
1434
|
) || H && Tt(
|
|
1435
|
-
|
|
1435
|
+
_,
|
|
1436
1436
|
x,
|
|
1437
1437
|
e,
|
|
1438
1438
|
t,
|
|
@@ -1441,13 +1441,13 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1441
1441
|
o,
|
|
1442
1442
|
a,
|
|
1443
1443
|
r + 1,
|
|
1444
|
-
|
|
1444
|
+
L,
|
|
1445
1445
|
!h
|
|
1446
|
-
), vt.releasePrimitive(
|
|
1446
|
+
), vt.releasePrimitive(L);
|
|
1447
1447
|
}
|
|
1448
1448
|
else if (w)
|
|
1449
1449
|
if (T)
|
|
1450
|
-
|
|
1450
|
+
S = Tt(
|
|
1451
1451
|
l,
|
|
1452
1452
|
N,
|
|
1453
1453
|
t,
|
|
@@ -1461,12 +1461,12 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1461
1461
|
h
|
|
1462
1462
|
);
|
|
1463
1463
|
else {
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1464
|
+
const L = vt.getPrimitive();
|
|
1465
|
+
L.copy(Zs).applyMatrix4(t);
|
|
1466
1466
|
const U = pt(l), x = Ct(l, f);
|
|
1467
1467
|
K(U, u, ae), K(x, u, ce);
|
|
1468
|
-
const B =
|
|
1469
|
-
|
|
1468
|
+
const B = L.intersectsBox(ae), H = L.intersectsBox(ce);
|
|
1469
|
+
S = B && Tt(
|
|
1470
1470
|
N,
|
|
1471
1471
|
U,
|
|
1472
1472
|
e,
|
|
@@ -1476,7 +1476,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1476
1476
|
o,
|
|
1477
1477
|
a,
|
|
1478
1478
|
r + 1,
|
|
1479
|
-
|
|
1479
|
+
L,
|
|
1480
1480
|
!h
|
|
1481
1481
|
) || H && Tt(
|
|
1482
1482
|
N,
|
|
@@ -1488,15 +1488,15 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
|
|
|
1488
1488
|
o,
|
|
1489
1489
|
a,
|
|
1490
1490
|
r + 1,
|
|
1491
|
-
|
|
1491
|
+
L,
|
|
1492
1492
|
!h
|
|
1493
|
-
), vt.releasePrimitive(
|
|
1493
|
+
), vt.releasePrimitive(L);
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
1496
|
-
return
|
|
1496
|
+
return S;
|
|
1497
1497
|
}
|
|
1498
|
-
const cs = /* @__PURE__ */ new at(), qi = /* @__PURE__ */ new
|
|
1499
|
-
class
|
|
1498
|
+
const cs = /* @__PURE__ */ new at(), qi = /* @__PURE__ */ new gt();
|
|
1499
|
+
class Si {
|
|
1500
1500
|
static serialize(s, t = {}) {
|
|
1501
1501
|
t = {
|
|
1502
1502
|
cloneBuffers: !0,
|
|
@@ -1520,7 +1520,7 @@ class _i {
|
|
|
1520
1520
|
indirect: !!s.indirectBuffer,
|
|
1521
1521
|
...e
|
|
1522
1522
|
};
|
|
1523
|
-
const { index: i, roots: o, indirectBuffer: n } = s, r = new
|
|
1523
|
+
const { index: i, roots: o, indirectBuffer: n } = s, r = new Si(t, { ...e, [Vs]: !0 });
|
|
1524
1524
|
if (r._roots = o, r._indirectBuffer = n || null, e.setIndex) {
|
|
1525
1525
|
const a = t.getIndex();
|
|
1526
1526
|
if (a === null) {
|
|
@@ -1554,7 +1554,7 @@ class _i {
|
|
|
1554
1554
|
[Vs]: !1
|
|
1555
1555
|
}, t), t.useSharedArrayBuffer && !er())
|
|
1556
1556
|
throw new Error("MeshBVH: SharedArrayBuffer is not available.");
|
|
1557
|
-
this.geometry = s, this._roots = null, this._indirectBuffer = null, t[Vs] || (mo(this, t), !s.boundingBox && t.setBoundingBox && (s.boundingBox = this.getBoundingBox(new
|
|
1557
|
+
this.geometry = s, this._roots = null, this._indirectBuffer = null, t[Vs] || (mo(this, t), !s.boundingBox && t.setBoundingBox && (s.boundingBox = this.getBoundingBox(new gt())));
|
|
1558
1558
|
const { _indirectBuffer: e } = this;
|
|
1559
1559
|
this.resolveTriangleIndex = t.indirect ? (i) => e[i] : (i) => i;
|
|
1560
1560
|
}
|
|
@@ -1622,7 +1622,7 @@ class _i {
|
|
|
1622
1622
|
const h = this._roots;
|
|
1623
1623
|
for (let d = 0, E = h.length; d < E; d++) {
|
|
1624
1624
|
const u = h[d];
|
|
1625
|
-
if (a =
|
|
1625
|
+
if (a = So(this, d, o, n, i, c), a)
|
|
1626
1626
|
break;
|
|
1627
1627
|
c += u.byteLength;
|
|
1628
1628
|
}
|
|
@@ -1645,19 +1645,19 @@ class _i {
|
|
|
1645
1645
|
tt(h, f * 3, d, E);
|
|
1646
1646
|
};
|
|
1647
1647
|
if (o) {
|
|
1648
|
-
const f = (R, m, C, A, F, p, T,
|
|
1649
|
-
for (let
|
|
1650
|
-
u(
|
|
1651
|
-
for (let N = R,
|
|
1652
|
-
if (c(N), n.needsUpdate = !0, o(n, h, N,
|
|
1648
|
+
const f = (R, m, C, A, F, p, T, g) => {
|
|
1649
|
+
for (let S = C, _ = C + A; S < _; S++) {
|
|
1650
|
+
u(S), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
|
|
1651
|
+
for (let N = R, y = R + m; N < y; N++)
|
|
1652
|
+
if (c(N), n.needsUpdate = !0, o(n, h, N, S, F, p, T, g))
|
|
1653
1653
|
return !0;
|
|
1654
1654
|
}
|
|
1655
1655
|
return !1;
|
|
1656
1656
|
};
|
|
1657
1657
|
if (i) {
|
|
1658
1658
|
const R = i;
|
|
1659
|
-
i = function(m, C, A, F, p, T,
|
|
1660
|
-
return R(m, C, A, F, p, T,
|
|
1659
|
+
i = function(m, C, A, F, p, T, g, S) {
|
|
1660
|
+
return R(m, C, A, F, p, T, g, S) ? !0 : f(m, C, A, F, p, T, g, S);
|
|
1661
1661
|
};
|
|
1662
1662
|
} else
|
|
1663
1663
|
i = f;
|
|
@@ -1693,7 +1693,7 @@ class _i {
|
|
|
1693
1693
|
);
|
|
1694
1694
|
}
|
|
1695
1695
|
closestPointToPoint(s, t = {}, e = 0, i = 1 / 0) {
|
|
1696
|
-
return
|
|
1696
|
+
return _o(
|
|
1697
1697
|
this,
|
|
1698
1698
|
s,
|
|
1699
1699
|
t,
|
|
@@ -1710,7 +1710,7 @@ class _i {
|
|
|
1710
1710
|
function Ki(l, s, t) {
|
|
1711
1711
|
return l === null || (l.point.applyMatrix4(s.matrixWorld), l.distance = l.point.distanceTo(t.ray.origin), l.object = s, l.distance < t.near || l.distance > t.far) ? null : l;
|
|
1712
1712
|
}
|
|
1713
|
-
const js = /* @__PURE__ */ new Qn(), $i = /* @__PURE__ */ new
|
|
1713
|
+
const js = /* @__PURE__ */ new Qn(), $i = /* @__PURE__ */ new Lt(), ir = v.prototype.raycast;
|
|
1714
1714
|
function nr(l, s) {
|
|
1715
1715
|
if (this.geometry.boundsTree) {
|
|
1716
1716
|
if (this.material === void 0)
|
|
@@ -1731,7 +1731,7 @@ function nr(l, s) {
|
|
|
1731
1731
|
ir.call(this, l, s);
|
|
1732
1732
|
}
|
|
1733
1733
|
function or(l) {
|
|
1734
|
-
return this.boundsTree = new
|
|
1734
|
+
return this.boundsTree = new Si(this, l), this.boundsTree;
|
|
1735
1735
|
}
|
|
1736
1736
|
function rr() {
|
|
1737
1737
|
this.boundsTree = null;
|
|
@@ -1794,7 +1794,7 @@ class Ts {
|
|
|
1794
1794
|
this.handlers.length = 0;
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
1797
|
-
class
|
|
1797
|
+
class _i {
|
|
1798
1798
|
constructor(s) {
|
|
1799
1799
|
/** Whether is component is {@link Disposable}. */
|
|
1800
1800
|
I(this, "isDisposeable", () => "dispose" in this && "onDisposed" in this);
|
|
@@ -1809,9 +1809,9 @@ class Si {
|
|
|
1809
1809
|
this.components = s;
|
|
1810
1810
|
}
|
|
1811
1811
|
}
|
|
1812
|
-
class et extends
|
|
1812
|
+
class et extends _i {
|
|
1813
1813
|
}
|
|
1814
|
-
class Ni extends
|
|
1814
|
+
class Ni extends _i {
|
|
1815
1815
|
constructor(t) {
|
|
1816
1816
|
super(t);
|
|
1817
1817
|
I(this, "worlds", /* @__PURE__ */ new Map());
|
|
@@ -1893,13 +1893,13 @@ class cr extends Ni {
|
|
|
1893
1893
|
);
|
|
1894
1894
|
}
|
|
1895
1895
|
}
|
|
1896
|
-
const
|
|
1896
|
+
const ve = class ve extends et {
|
|
1897
1897
|
constructor(t) {
|
|
1898
1898
|
super(t);
|
|
1899
1899
|
I(this, "_disposedComponents", /* @__PURE__ */ new Set());
|
|
1900
1900
|
/** {@link Component.enabled} */
|
|
1901
1901
|
I(this, "enabled", !0);
|
|
1902
|
-
t.add(
|
|
1902
|
+
t.add(ve.uuid, this);
|
|
1903
1903
|
}
|
|
1904
1904
|
// TODO: Remove this?
|
|
1905
1905
|
/**
|
|
@@ -1937,7 +1937,7 @@ const be = class be extends et {
|
|
|
1937
1937
|
}
|
|
1938
1938
|
disposeGeometryAndMaterials(t, e) {
|
|
1939
1939
|
const i = t;
|
|
1940
|
-
i.geometry && this.disposeGeometry(i.geometry), e && i.material &&
|
|
1940
|
+
i.geometry && this.disposeGeometry(i.geometry), e && i.material && ve.disposeMaterial(i), i.material = [], i.geometry = null;
|
|
1941
1941
|
}
|
|
1942
1942
|
disposeChildren(t) {
|
|
1943
1943
|
for (const e of t.children)
|
|
@@ -1956,8 +1956,8 @@ const be = class be extends et {
|
|
|
1956
1956
|
* A unique identifier for the component.
|
|
1957
1957
|
* This UUID is used to register the component within the Components system.
|
|
1958
1958
|
*/
|
|
1959
|
-
I(
|
|
1960
|
-
let zt =
|
|
1959
|
+
I(ve, "uuid", "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");
|
|
1960
|
+
let zt = ve;
|
|
1961
1961
|
class lr extends Ni {
|
|
1962
1962
|
constructor(t) {
|
|
1963
1963
|
super(t);
|
|
@@ -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 yt(), 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 = [];
|
|
@@ -2364,7 +2364,7 @@ function Cr(l, s) {
|
|
|
2364
2364
|
let t = 0, e = 0;
|
|
2365
2365
|
const i = 10;
|
|
2366
2366
|
s.unitary.identity(), s.diagonal.copy(l);
|
|
2367
|
-
const o = s.unitary, n = s.diagonal, r = new
|
|
2367
|
+
const o = s.unitary, n = s.diagonal, r = new O.Matrix3(), a = new O.Matrix3(), c = Number.EPSILON * Ir(n);
|
|
2368
2368
|
for (; e < i && fr(n) > c; )
|
|
2369
2369
|
pr(n, r), a.copy(r).transpose(), n.multiply(r), n.premultiply(a), o.multiply(r), ++t > 2 && (e++, t = 0);
|
|
2370
2370
|
return s;
|
|
@@ -2373,13 +2373,13 @@ function Tr(l) {
|
|
|
2373
2373
|
const s = [];
|
|
2374
2374
|
for (let it = 0; it < l.length - 2; it += 3) {
|
|
2375
2375
|
const Xt = l[it], J = l[it + 1], $t = l[it + 2];
|
|
2376
|
-
s.push(new
|
|
2376
|
+
s.push(new O.Vector3(Xt, J, $t));
|
|
2377
2377
|
}
|
|
2378
2378
|
const t = new dr();
|
|
2379
2379
|
t.setFromPoints(s);
|
|
2380
2380
|
const e = {
|
|
2381
|
-
unitary: new
|
|
2382
|
-
diagonal: new
|
|
2381
|
+
unitary: new O.Matrix3(),
|
|
2382
|
+
diagonal: new O.Matrix3()
|
|
2383
2383
|
}, i = t.faces, o = [], n = [];
|
|
2384
2384
|
for (let it = 0, Xt = i.length; it < Xt; it++) {
|
|
2385
2385
|
const J = i[it];
|
|
@@ -2394,7 +2394,7 @@ function Tr(l) {
|
|
|
2394
2394
|
n.push(bs.point.x, bs.point.y, bs.point.z), n.push(vs.point.x, vs.point.y, vs.point.z), n.push(Bs.point.x, Bs.point.y, Bs.point.z);
|
|
2395
2395
|
}
|
|
2396
2396
|
}
|
|
2397
|
-
const r = new
|
|
2397
|
+
const r = new O.Vector3(), a = new O.Vector3(), c = new O.Vector3(), h = new O.Vector3(), d = new O.Vector3(), E = new O.Vector3(), u = new O.Vector3(), f = new O.Vector3();
|
|
2398
2398
|
let R = 0, m = 0, C = 0, A = 0, F = 0, p = 0, T = 0;
|
|
2399
2399
|
for (let it = 0, Xt = n.length; it < Xt; it += 9) {
|
|
2400
2400
|
r.fromArray(n, it), a.fromArray(n, it + 3), c.fromArray(n, it + 6), u.set(0, 0, 0), u.add(r).add(a).add(c).divideScalar(3), h.subVectors(a, r), d.subVectors(c, r);
|
|
@@ -2402,28 +2402,28 @@ function Tr(l) {
|
|
|
2402
2402
|
f.add(E.copy(u).multiplyScalar(J)), R += J, m += (9 * u.x * u.x + r.x * r.x + a.x * a.x + c.x * c.x) * (J / 12), C += (9 * u.x * u.y + r.x * r.y + a.x * a.y + c.x * c.y) * (J / 12), A += (9 * u.x * u.z + r.x * r.z + a.x * a.z + c.x * c.z) * (J / 12), F += (9 * u.y * u.y + r.y * r.y + a.y * a.y + c.y * c.y) * (J / 12), p += (9 * u.y * u.z + r.y * r.z + a.y * a.z + c.y * c.z) * (J / 12), T += (9 * u.z * u.z + r.z * r.z + a.z * a.z + c.z * c.z) * (J / 12);
|
|
2403
2403
|
}
|
|
2404
2404
|
f.divideScalar(R), m /= R, C /= R, A /= R, F /= R, p /= R, T /= R, m -= f.x * f.x, C -= f.x * f.y, A -= f.x * f.z, F -= f.y * f.y, p -= f.y * f.z, T -= f.z * f.z;
|
|
2405
|
-
const
|
|
2406
|
-
|
|
2407
|
-
const
|
|
2408
|
-
|
|
2409
|
-
let w = -1 / 0,
|
|
2405
|
+
const g = new O.Matrix3();
|
|
2406
|
+
g.elements[0] = m, 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] = T, Cr(g, e);
|
|
2407
|
+
const S = e.unitary, _ = new O.Vector3(), N = new O.Vector3(), y = new O.Vector3();
|
|
2408
|
+
S.extractBasis(_, N, y);
|
|
2409
|
+
let w = -1 / 0, L = -1 / 0, U = -1 / 0, x = 1 / 0, B = 1 / 0, H = 1 / 0;
|
|
2410
2410
|
for (let it = 0, Xt = s.length; it < Xt; it++) {
|
|
2411
2411
|
const J = s[it];
|
|
2412
|
-
w = Math.max(
|
|
2412
|
+
w = Math.max(_.dot(J), w), L = Math.max(N.dot(J), L), U = Math.max(y.dot(J), U), x = Math.min(_.dot(J), x), B = Math.min(N.dot(J), B), H = Math.min(y.dot(J), H);
|
|
2413
2413
|
}
|
|
2414
|
-
|
|
2415
|
-
const q = new
|
|
2416
|
-
q.add(
|
|
2417
|
-
const { x: Ht, y: kt, z: Wt } = st, We = new
|
|
2414
|
+
_.multiplyScalar(0.5 * (x + w)), N.multiplyScalar(0.5 * (B + L)), y.multiplyScalar(0.5 * (H + U));
|
|
2415
|
+
const q = new O.Vector3(), st = new O.Vector3(), Q = new O.Matrix3();
|
|
2416
|
+
q.add(_).add(N).add(y), st.x = w - x, st.y = L - B, st.z = U - H, st.multiplyScalar(0.5), Q.copy(S);
|
|
2417
|
+
const { x: Ht, y: kt, z: Wt } = st, We = new O.Matrix4();
|
|
2418
2418
|
We.makeScale(Ht * 2, kt * 2, Wt * 2);
|
|
2419
|
-
const
|
|
2420
|
-
|
|
2421
|
-
const
|
|
2422
|
-
|
|
2423
|
-
const Mi = new
|
|
2419
|
+
const Te = new O.Matrix4();
|
|
2420
|
+
Te.makeTranslation(-Ht, -kt, -Wt);
|
|
2421
|
+
const Li = new O.Matrix4();
|
|
2422
|
+
Li.makeTranslation(q.x, q.y, q.z);
|
|
2423
|
+
const Mi = new O.Matrix4();
|
|
2424
2424
|
Mi.setFromMatrix3(Q);
|
|
2425
|
-
const
|
|
2426
|
-
return
|
|
2425
|
+
const me = new O.Matrix4();
|
|
2426
|
+
return me.multiply(Li), me.multiply(Mi), me.multiply(Te), me.multiply(We), { center: q, halfSizes: st, rotation: Q, transformation: me };
|
|
2427
2427
|
}
|
|
2428
2428
|
function mr(l, s, t) {
|
|
2429
2429
|
const e = [
|
|
@@ -2715,7 +2715,7 @@ I($, "_lut", [
|
|
|
2715
2715
|
"fe",
|
|
2716
2716
|
"ff"
|
|
2717
2717
|
]);
|
|
2718
|
-
let
|
|
2718
|
+
let ze = $;
|
|
2719
2719
|
class ea extends et {
|
|
2720
2720
|
constructor(t, e) {
|
|
2721
2721
|
super(t);
|
|
@@ -2825,14 +2825,14 @@ class ea extends et {
|
|
|
2825
2825
|
get(t) {
|
|
2826
2826
|
if (!this.enabled)
|
|
2827
2827
|
return this._pickedPoint;
|
|
2828
|
-
const o = this.components.get(
|
|
2828
|
+
const o = this.components.get(He).get(t).castRay();
|
|
2829
2829
|
if (!o)
|
|
2830
2830
|
return this._pickedPoint !== null && (this.onVertexLost.trigger(), this._pickedPoint = null), this._pickedPoint;
|
|
2831
2831
|
const n = this.getClosestVertex(o);
|
|
2832
2832
|
return n ? (this.workingPlane ? Math.abs(this.workingPlane.distanceToPoint(n)) < 1e-3 : !0) ? ((this._pickedPoint === null || !this._pickedPoint.equals(n)) && (this._pickedPoint = n.clone(), this.onVertexFound.trigger(this._pickedPoint)), this._pickedPoint) : (this._pickedPoint = null, this._pickedPoint) : (this._pickedPoint !== null && (this.onVertexLost.trigger(), this._pickedPoint = null), this._pickedPoint);
|
|
2833
2833
|
}
|
|
2834
2834
|
getClosestVertex(t) {
|
|
2835
|
-
let e = new
|
|
2835
|
+
let e = new O.Vector3(), i = !1, o = Number.MAX_SAFE_INTEGER;
|
|
2836
2836
|
const n = this.getVertices(t);
|
|
2837
2837
|
if (n === null)
|
|
2838
2838
|
return null;
|
|
@@ -2848,7 +2848,7 @@ class ea extends et {
|
|
|
2848
2848
|
const e = t.object;
|
|
2849
2849
|
if (!t.face || !e)
|
|
2850
2850
|
return null;
|
|
2851
|
-
const i = e.geometry, o = new
|
|
2851
|
+
const i = e.geometry, o = new O.Matrix4(), { instanceId: n } = t, r = n !== void 0, a = e instanceof O.InstancedMesh;
|
|
2852
2852
|
return a && r && e.getMatrixAt(n, o), [
|
|
2853
2853
|
this.getVertex(t.face.a, i),
|
|
2854
2854
|
this.getVertex(t.face.b, i),
|
|
@@ -2859,7 +2859,7 @@ class ea extends et {
|
|
|
2859
2859
|
if (t === void 0)
|
|
2860
2860
|
return null;
|
|
2861
2861
|
const i = e.attributes.position;
|
|
2862
|
-
return new
|
|
2862
|
+
return new O.Vector3(
|
|
2863
2863
|
i.getX(t),
|
|
2864
2864
|
i.getY(t),
|
|
2865
2865
|
i.getZ(t)
|
|
@@ -2889,7 +2889,7 @@ const Fs = class Fs {
|
|
|
2889
2889
|
e.enabled && e.isUpdateable() && e.update(s);
|
|
2890
2890
|
requestAnimationFrame(this.update);
|
|
2891
2891
|
});
|
|
2892
|
-
this._clock = new
|
|
2892
|
+
this._clock = new O.Clock(), Fs.setupBVH();
|
|
2893
2893
|
}
|
|
2894
2894
|
/**
|
|
2895
2895
|
* Adds a component to the list of components.
|
|
@@ -2907,7 +2907,7 @@ const Fs = class Fs {
|
|
|
2907
2907
|
throw new Error(
|
|
2908
2908
|
"You're trying to add a component that already exists in the components instance. Use Components.get() instead."
|
|
2909
2909
|
);
|
|
2910
|
-
|
|
2910
|
+
ze.validate(s), this.list.set(s, t);
|
|
2911
2911
|
}
|
|
2912
2912
|
/**
|
|
2913
2913
|
* Retrieves a component instance by its constructor function.
|
|
@@ -2962,18 +2962,18 @@ const Fs = class Fs {
|
|
|
2962
2962
|
this._clock.stop(), this.onDisposed.trigger(), this.onDisposed.reset();
|
|
2963
2963
|
}
|
|
2964
2964
|
static setupBVH() {
|
|
2965
|
-
|
|
2965
|
+
O.BufferGeometry.prototype.computeBoundsTree = or, O.BufferGeometry.prototype.disposeBoundsTree = rr, O.Mesh.prototype.raycast = nr;
|
|
2966
2966
|
}
|
|
2967
2967
|
};
|
|
2968
2968
|
/**
|
|
2969
2969
|
* The version of the @thatopen/components library.
|
|
2970
2970
|
*/
|
|
2971
|
-
I(Fs, "release", "2.1.
|
|
2971
|
+
I(Fs, "release", "2.1.7");
|
|
2972
2972
|
let pi = Fs;
|
|
2973
2973
|
class Rr {
|
|
2974
2974
|
constructor(s) {
|
|
2975
2975
|
I(this, "_event");
|
|
2976
|
-
I(this, "_position", new
|
|
2976
|
+
I(this, "_position", new O.Vector2());
|
|
2977
2977
|
/** {@link Disposable.onDisposed} */
|
|
2978
2978
|
I(this, "onDisposed", new D());
|
|
2979
2979
|
I(this, "updateMouseInfo", (s) => {
|
|
@@ -3019,7 +3019,7 @@ class Ar {
|
|
|
3019
3019
|
* A reference to the Three.js Raycaster instance.
|
|
3020
3020
|
* This is used for raycasting operations.
|
|
3021
3021
|
*/
|
|
3022
|
-
I(this, "three", new
|
|
3022
|
+
I(this, "three", new O.Raycaster());
|
|
3023
3023
|
/**
|
|
3024
3024
|
* A reference to the world instance to which this Raycaster belongs.
|
|
3025
3025
|
* This is used to access the camera and meshes.
|
|
@@ -3077,7 +3077,7 @@ class Ar {
|
|
|
3077
3077
|
);
|
|
3078
3078
|
}
|
|
3079
3079
|
}
|
|
3080
|
-
const
|
|
3080
|
+
const gs = class gs extends et {
|
|
3081
3081
|
constructor(t) {
|
|
3082
3082
|
super(t);
|
|
3083
3083
|
/** {@link Component.enabled} */
|
|
@@ -3089,7 +3089,7 @@ const Os = class Os extends et {
|
|
|
3089
3089
|
I(this, "list", /* @__PURE__ */ new Map());
|
|
3090
3090
|
/** {@link Disposable.onDisposed} */
|
|
3091
3091
|
I(this, "onDisposed", new D());
|
|
3092
|
-
t.add(
|
|
3092
|
+
t.add(gs.uuid, this);
|
|
3093
3093
|
}
|
|
3094
3094
|
/**
|
|
3095
3095
|
* Retrieves a SimpleRaycaster instance for the given world.
|
|
@@ -3129,9 +3129,9 @@ const Os = class Os extends et {
|
|
|
3129
3129
|
* A unique identifier for the component.
|
|
3130
3130
|
* This UUID is used to register the component within the Components system.
|
|
3131
3131
|
*/
|
|
3132
|
-
I(
|
|
3133
|
-
let
|
|
3134
|
-
class Fr extends
|
|
3132
|
+
I(gs, "uuid", "d5d8bdf0-db25-4952-b951-b643af207ace");
|
|
3133
|
+
let He = gs;
|
|
3134
|
+
class Fr extends _i {
|
|
3135
3135
|
constructor() {
|
|
3136
3136
|
super(...arguments);
|
|
3137
3137
|
/**
|
|
@@ -3156,7 +3156,7 @@ class Fr extends Si {
|
|
|
3156
3156
|
/**
|
|
3157
3157
|
* A unique identifier for the world.
|
|
3158
3158
|
*/
|
|
3159
|
-
I(this, "uuid",
|
|
3159
|
+
I(this, "uuid", ze.create());
|
|
3160
3160
|
/**
|
|
3161
3161
|
* An optional name for the world.
|
|
3162
3162
|
*/
|
|
@@ -3249,26 +3249,26 @@ class sa extends lr {
|
|
|
3249
3249
|
*/
|
|
3250
3250
|
I(this, "config", {
|
|
3251
3251
|
directionalLight: {
|
|
3252
|
-
color: new
|
|
3252
|
+
color: new O.Color("white"),
|
|
3253
3253
|
intensity: 1.5,
|
|
3254
|
-
position: new
|
|
3254
|
+
position: new O.Vector3(5, 10, 3)
|
|
3255
3255
|
},
|
|
3256
3256
|
ambientLight: {
|
|
3257
|
-
color: new
|
|
3257
|
+
color: new O.Color("white"),
|
|
3258
3258
|
intensity: 1
|
|
3259
3259
|
}
|
|
3260
3260
|
});
|
|
3261
|
-
this.three = new
|
|
3261
|
+
this.three = new O.Scene(), this.three.background = new O.Color(2107698);
|
|
3262
3262
|
}
|
|
3263
3263
|
/** {@link Configurable.setup} */
|
|
3264
3264
|
setup(t) {
|
|
3265
3265
|
this.config = { ...this.config, ...t };
|
|
3266
|
-
const e = new
|
|
3266
|
+
const e = new O.DirectionalLight(
|
|
3267
3267
|
this.config.directionalLight.color,
|
|
3268
3268
|
this.config.directionalLight.intensity
|
|
3269
3269
|
);
|
|
3270
3270
|
e.position.copy(this.config.directionalLight.position);
|
|
3271
|
-
const i = new
|
|
3271
|
+
const i = new O.AmbientLight(
|
|
3272
3272
|
this.config.ambientLight.color,
|
|
3273
3273
|
this.config.ambientLight.intensity
|
|
3274
3274
|
);
|
|
@@ -3309,7 +3309,7 @@ class ia extends cr {
|
|
|
3309
3309
|
return;
|
|
3310
3310
|
this._resizing = !0, this.onContainerUpdated.trigger();
|
|
3311
3311
|
const e = t ? t.x : this.container.clientWidth, i = t ? t.y : this.container.clientHeight;
|
|
3312
|
-
this.three.setSize(e, i), this.onResize.trigger(new
|
|
3312
|
+
this.three.setSize(e, i), this.onResize.trigger(new O.Vector2(e, i)), this._resizing = !1;
|
|
3313
3313
|
});
|
|
3314
3314
|
I(this, "resizeEvent", () => {
|
|
3315
3315
|
this.resize();
|
|
@@ -3318,14 +3318,14 @@ class ia extends cr {
|
|
|
3318
3318
|
t.preventDefault(), this.enabled = !1;
|
|
3319
3319
|
});
|
|
3320
3320
|
I(this, "onContextBack", () => {
|
|
3321
|
-
this.three.setRenderTarget(null), this.three.dispose(), this.three = new
|
|
3321
|
+
this.three.setRenderTarget(null), this.three.dispose(), this.three = new O.WebGLRenderer({
|
|
3322
3322
|
canvas: this._canvas,
|
|
3323
3323
|
antialias: !0,
|
|
3324
3324
|
alpha: !0,
|
|
3325
3325
|
...this._parameters
|
|
3326
3326
|
}), this.enabled = !0;
|
|
3327
3327
|
});
|
|
3328
|
-
this.container = e, this._parameters = i, this.three = new
|
|
3328
|
+
this.container = e, this._parameters = i, this.three = new O.WebGLRenderer({
|
|
3329
3329
|
antialias: !0,
|
|
3330
3330
|
alpha: !0,
|
|
3331
3331
|
...i
|
|
@@ -3347,7 +3347,7 @@ class ia extends cr {
|
|
|
3347
3347
|
}
|
|
3348
3348
|
/** {@link Resizeable.getSize}. */
|
|
3349
3349
|
getSize() {
|
|
3350
|
-
return new
|
|
3350
|
+
return new O.Vector2(
|
|
3351
3351
|
this.three.domElement.clientWidth,
|
|
3352
3352
|
this.three.domElement.clientHeight
|
|
3353
3353
|
);
|
|
@@ -3408,7 +3408,7 @@ function Zt(l) {
|
|
|
3408
3408
|
function bt(l) {
|
|
3409
3409
|
return l.isOrthographicCamera;
|
|
3410
3410
|
}
|
|
3411
|
-
const he = Math.PI * 2, nn = Math.PI / 2, xn = 1e-5,
|
|
3411
|
+
const he = Math.PI * 2, nn = Math.PI / 2, xn = 1e-5, Ne = Math.PI / 180;
|
|
3412
3412
|
function mt(l, s, t) {
|
|
3413
3413
|
return Math.max(s, Math.min(t, l));
|
|
3414
3414
|
}
|
|
@@ -3421,10 +3421,10 @@ function k(l, s, t = xn) {
|
|
|
3421
3421
|
function on(l, s) {
|
|
3422
3422
|
return Math.round(l / s) * s;
|
|
3423
3423
|
}
|
|
3424
|
-
function
|
|
3424
|
+
function Pe(l) {
|
|
3425
3425
|
return isFinite(l) ? l : l < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
|
3426
3426
|
}
|
|
3427
|
-
function
|
|
3427
|
+
function ye(l) {
|
|
3428
3428
|
return Math.abs(l) < Number.MAX_VALUE ? l : l * (1 / 0);
|
|
3429
3429
|
}
|
|
3430
3430
|
function hs(l, s, t, e, i = 1 / 0, o) {
|
|
@@ -3448,10 +3448,10 @@ function rn(l, s, t, e, i = 1 / 0, o, n) {
|
|
|
3448
3448
|
u = u / B * F, f = f / B * F, R = R / B * F;
|
|
3449
3449
|
}
|
|
3450
3450
|
h = l.x - u, d = l.y - f, E = l.z - R;
|
|
3451
|
-
const
|
|
3452
|
-
t.x = (t.x - r *
|
|
3453
|
-
const N = m - l.x,
|
|
3454
|
-
return N *
|
|
3451
|
+
const g = (t.x + r * u) * o, S = (t.y + r * f) * o, _ = (t.z + r * R) * o;
|
|
3452
|
+
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 + (R + _) * c;
|
|
3453
|
+
const N = m - l.x, y = C - l.y, w = A - l.z, L = n.x - m, U = n.y - C, x = n.z - A;
|
|
3454
|
+
return N * L + y * U + w * x > 0 && (n.x = m, n.y = C, n.z = A, t.x = (n.x - m) / o, t.y = (n.y - C) / o, t.z = (n.z - A) / o), n;
|
|
3455
3455
|
}
|
|
3456
3456
|
function $s(l, s) {
|
|
3457
3457
|
s.set(0, 0), l.forEach((t) => {
|
|
@@ -3461,7 +3461,7 @@ function $s(l, s) {
|
|
|
3461
3461
|
function Js(l, s) {
|
|
3462
3462
|
return bt(l) ? (console.warn(`${s} is not supported in OrthographicCamera`), !0) : !1;
|
|
3463
3463
|
}
|
|
3464
|
-
class
|
|
3464
|
+
class gr {
|
|
3465
3465
|
constructor() {
|
|
3466
3466
|
this._listeners = {};
|
|
3467
3467
|
}
|
|
@@ -3525,9 +3525,9 @@ class Or {
|
|
|
3525
3525
|
}
|
|
3526
3526
|
}
|
|
3527
3527
|
}
|
|
3528
|
-
const
|
|
3529
|
-
let Y, an, ds, ti, lt, G, z, Ee, Le,
|
|
3530
|
-
class ot extends
|
|
3528
|
+
const Or = "2.7.3", Es = 1 / 8, bn = typeof window < "u", Sr = bn && /Mac/.test(navigator.platform), _r = !(bn && "PointerEvent" in window);
|
|
3529
|
+
let Y, an, ds, ti, lt, G, z, Ee, Le, Ot, St, Qt, cn, ln, ut, Me, de, hn, ei, En, si, ii, us;
|
|
3530
|
+
class ot extends gr {
|
|
3531
3531
|
/**
|
|
3532
3532
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
|
3533
3533
|
*
|
|
@@ -3569,7 +3569,7 @@ class ot extends Or {
|
|
|
3569
3569
|
* @category Statics
|
|
3570
3570
|
*/
|
|
3571
3571
|
static install(s) {
|
|
3572
|
-
Y = s.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(),
|
|
3572
|
+
Y = s.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(), Ot = new Y.Vector3(), St = new Y.Vector3(), Qt = new Y.Vector3(), cn = new Y.Vector3(), ln = new Y.Vector3(), ut = new Y.Spherical(), Me = 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();
|
|
3573
3573
|
}
|
|
3574
3574
|
/**
|
|
3575
3575
|
* list all ACTIONs
|
|
@@ -3597,26 +3597,26 @@ class ot extends Or {
|
|
|
3597
3597
|
*/
|
|
3598
3598
|
constructor(s, t) {
|
|
3599
3599
|
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 = () => {
|
|
3600
|
-
}, 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 = (p, T,
|
|
3601
|
-
let
|
|
3600
|
+
}, 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 = (p, T, g) => {
|
|
3601
|
+
let S, _;
|
|
3602
3602
|
if (Zt(this._camera)) {
|
|
3603
|
-
const N = G.copy(this._camera.position).sub(this._target),
|
|
3604
|
-
|
|
3603
|
+
const N = G.copy(this._camera.position).sub(this._target), y = this._camera.getEffectiveFOV() * Ne, w = N.length() * Math.tan(y * 0.5);
|
|
3604
|
+
S = this.truckSpeed * p * w / this._elementRect.height, _ = this.truckSpeed * T * w / this._elementRect.height;
|
|
3605
3605
|
} else if (bt(this._camera)) {
|
|
3606
3606
|
const N = this._camera;
|
|
3607
|
-
|
|
3607
|
+
S = p * (N.right - N.left) / N.zoom / this._elementRect.width, _ = T * (N.top - N.bottom) / N.zoom / this._elementRect.height;
|
|
3608
3608
|
} else
|
|
3609
3609
|
return;
|
|
3610
|
-
this.verticalDragToForward ? (
|
|
3610
|
+
this.verticalDragToForward ? (g ? this.setFocalOffset(this._focalOffsetEnd.x + S, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(S, 0, !0), this.forward(-_, !0)) : g ? this.setFocalOffset(this._focalOffsetEnd.x + S, this._focalOffsetEnd.y + _, this._focalOffsetEnd.z, !0) : this.truck(S, _, !0);
|
|
3611
3611
|
}, this._rotateInternal = (p, T) => {
|
|
3612
|
-
const
|
|
3613
|
-
this.rotate(
|
|
3614
|
-
}, this._dollyInternal = (p, T,
|
|
3615
|
-
const
|
|
3616
|
-
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(w, !0), this._dollyToNoClamp(
|
|
3617
|
-
}, this._zoomInternal = (p, T,
|
|
3618
|
-
const
|
|
3619
|
-
this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N -
|
|
3612
|
+
const g = he * this.azimuthRotateSpeed * p / this._elementRect.height, S = he * this.polarRotateSpeed * T / this._elementRect.height;
|
|
3613
|
+
this.rotate(g, S, !0);
|
|
3614
|
+
}, this._dollyInternal = (p, T, g) => {
|
|
3615
|
+
const S = Math.pow(0.95, -p * this.dollySpeed), _ = this._sphericalEnd.radius, N = this._sphericalEnd.radius * S, y = mt(N, this.minDistance, this.maxDistance), w = y - N;
|
|
3616
|
+
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(w, !0), this._dollyToNoClamp(y, !0)) : this._dollyToNoClamp(y, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : y) - _, this._dollyControlCoord.set(T, g)), this._lastDollyDirection = Math.sign(-p);
|
|
3617
|
+
}, this._zoomInternal = (p, T, g) => {
|
|
3618
|
+
const S = Math.pow(0.95, p * this.dollySpeed), _ = this._zoom, N = this._zoom * S;
|
|
3619
|
+
this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N - _, this._dollyControlCoord.set(T, g));
|
|
3620
3620
|
}, 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 = 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 = [
|
|
3621
3621
|
new Y.Vector3(),
|
|
3622
3622
|
new Y.Vector3(),
|
|
@@ -3636,18 +3636,18 @@ class ot extends Or {
|
|
|
3636
3636
|
if (!this._enabled || !this._domElement)
|
|
3637
3637
|
return;
|
|
3638
3638
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
3639
|
-
const
|
|
3640
|
-
if (
|
|
3639
|
+
const S = this._domElement.getBoundingClientRect(), _ = p.clientX / S.width, N = p.clientY / S.height;
|
|
3640
|
+
if (_ < this._interactiveArea.left || _ > this._interactiveArea.right || N < this._interactiveArea.top || N > this._interactiveArea.bottom)
|
|
3641
3641
|
return;
|
|
3642
3642
|
}
|
|
3643
3643
|
const T = p.pointerType !== "mouse" ? null : (p.buttons & V.LEFT) === V.LEFT ? V.LEFT : (p.buttons & V.MIDDLE) === V.MIDDLE ? V.MIDDLE : (p.buttons & V.RIGHT) === V.RIGHT ? V.RIGHT : null;
|
|
3644
3644
|
if (T !== null) {
|
|
3645
|
-
const
|
|
3646
|
-
|
|
3645
|
+
const S = this._findPointerByMouseButton(T);
|
|
3646
|
+
S && this._disposePointer(S);
|
|
3647
3647
|
}
|
|
3648
3648
|
if ((p.buttons & V.LEFT) === V.LEFT && this._lockedPointer)
|
|
3649
3649
|
return;
|
|
3650
|
-
const
|
|
3650
|
+
const g = {
|
|
3651
3651
|
pointerId: p.pointerId,
|
|
3652
3652
|
clientX: p.clientX,
|
|
3653
3653
|
clientY: p.clientY,
|
|
@@ -3655,21 +3655,21 @@ class ot extends Or {
|
|
|
3655
3655
|
deltaY: 0,
|
|
3656
3656
|
mouseButton: T
|
|
3657
3657
|
};
|
|
3658
|
-
this._activePointers.push(
|
|
3658
|
+
this._activePointers.push(g), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.addEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", h), this._isDragging = !0, R(p);
|
|
3659
3659
|
}, r = (p) => {
|
|
3660
3660
|
if (!this._enabled || !this._domElement || this._lockedPointer)
|
|
3661
3661
|
return;
|
|
3662
3662
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
3663
|
-
const
|
|
3664
|
-
if (
|
|
3663
|
+
const S = this._domElement.getBoundingClientRect(), _ = p.clientX / S.width, N = p.clientY / S.height;
|
|
3664
|
+
if (_ < this._interactiveArea.left || _ > this._interactiveArea.right || N < this._interactiveArea.top || N > this._interactiveArea.bottom)
|
|
3665
3665
|
return;
|
|
3666
3666
|
}
|
|
3667
3667
|
const T = (p.buttons & V.LEFT) === V.LEFT ? V.LEFT : (p.buttons & V.MIDDLE) === V.MIDDLE ? V.MIDDLE : (p.buttons & V.RIGHT) === V.RIGHT ? V.RIGHT : null;
|
|
3668
3668
|
if (T !== null) {
|
|
3669
|
-
const
|
|
3670
|
-
|
|
3669
|
+
const S = this._findPointerByMouseButton(T);
|
|
3670
|
+
S && this._disposePointer(S);
|
|
3671
3671
|
}
|
|
3672
|
-
const
|
|
3672
|
+
const g = {
|
|
3673
3673
|
pointerId: 1,
|
|
3674
3674
|
clientX: p.clientX,
|
|
3675
3675
|
clientY: p.clientY,
|
|
@@ -3677,12 +3677,12 @@ class ot extends Or {
|
|
|
3677
3677
|
deltaY: 0,
|
|
3678
3678
|
mouseButton: (p.buttons & V.LEFT) === V.LEFT ? V.LEFT : (p.buttons & V.MIDDLE) === V.LEFT ? V.MIDDLE : (p.buttons & V.RIGHT) === V.LEFT ? V.RIGHT : null
|
|
3679
3679
|
};
|
|
3680
|
-
this._activePointers.push(
|
|
3680
|
+
this._activePointers.push(g), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.addEventListener("mousemove", c), this._domElement.ownerDocument.addEventListener("mouseup", d), this._isDragging = !0, R(p);
|
|
3681
3681
|
}, a = (p) => {
|
|
3682
3682
|
p.cancelable && p.preventDefault();
|
|
3683
|
-
const T = p.pointerId,
|
|
3684
|
-
if (
|
|
3685
|
-
if (
|
|
3683
|
+
const T = p.pointerId, g = this._lockedPointer || this._findPointerById(T);
|
|
3684
|
+
if (g) {
|
|
3685
|
+
if (g.clientX = p.clientX, g.clientY = p.clientY, g.deltaX = p.movementX, g.deltaY = p.movementY, this._state = 0, p.pointerType === "touch")
|
|
3686
3686
|
switch (this._activePointers.length) {
|
|
3687
3687
|
case 1:
|
|
3688
3688
|
this._state = this.touches.one;
|
|
@@ -3732,15 +3732,15 @@ class ot extends Or {
|
|
|
3732
3732
|
if (!this._domElement || !this._enabled || this.mouseButtons.wheel === P.NONE)
|
|
3733
3733
|
return;
|
|
3734
3734
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
3735
|
-
const N = this._domElement.getBoundingClientRect(),
|
|
3736
|
-
if (
|
|
3735
|
+
const N = this._domElement.getBoundingClientRect(), y = p.clientX / N.width, w = p.clientY / N.height;
|
|
3736
|
+
if (y < this._interactiveArea.left || y > this._interactiveArea.right || w < this._interactiveArea.top || w > this._interactiveArea.bottom)
|
|
3737
3737
|
return;
|
|
3738
3738
|
}
|
|
3739
3739
|
if (p.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === P.ROTATE || this.mouseButtons.wheel === P.TRUCK) {
|
|
3740
3740
|
const N = performance.now();
|
|
3741
3741
|
E - N < 1e3 && this._getClientRect(this._elementRect), E = N;
|
|
3742
3742
|
}
|
|
3743
|
-
const T =
|
|
3743
|
+
const T = Sr ? -1 : -3, g = p.deltaMode === 1 ? p.deltaY / T : p.deltaY / (T * 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;
|
|
3744
3744
|
switch (this.mouseButtons.wheel) {
|
|
3745
3745
|
case P.ROTATE: {
|
|
3746
3746
|
this._rotateInternal(p.deltaX, p.deltaY), this._isUserControllingRotate = !0;
|
|
@@ -3755,11 +3755,11 @@ class ot extends Or {
|
|
|
3755
3755
|
break;
|
|
3756
3756
|
}
|
|
3757
3757
|
case P.DOLLY: {
|
|
3758
|
-
this._dollyInternal(-
|
|
3758
|
+
this._dollyInternal(-g, S, _), this._isUserControllingDolly = !0;
|
|
3759
3759
|
break;
|
|
3760
3760
|
}
|
|
3761
3761
|
case P.ZOOM: {
|
|
3762
|
-
this._zoomInternal(-
|
|
3762
|
+
this._zoomInternal(-g, S, _), this._isUserControllingZoom = !0;
|
|
3763
3763
|
break;
|
|
3764
3764
|
}
|
|
3765
3765
|
}
|
|
@@ -3767,8 +3767,8 @@ class ot extends Or {
|
|
|
3767
3767
|
}, f = (p) => {
|
|
3768
3768
|
if (!(!this._domElement || !this._enabled)) {
|
|
3769
3769
|
if (this.mouseButtons.right === ot.ACTION.NONE) {
|
|
3770
|
-
const T = p instanceof PointerEvent ? p.pointerId : (p instanceof MouseEvent, 0),
|
|
3771
|
-
|
|
3770
|
+
const T = p instanceof PointerEvent ? p.pointerId : (p instanceof MouseEvent, 0), g = this._findPointerById(T);
|
|
3771
|
+
g && this._disposePointer(g), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("mouseup", d);
|
|
3772
3772
|
return;
|
|
3773
3773
|
}
|
|
3774
3774
|
p.preventDefault();
|
|
@@ -3777,10 +3777,10 @@ class ot extends Or {
|
|
|
3777
3777
|
if (!this._enabled)
|
|
3778
3778
|
return;
|
|
3779
3779
|
if ($s(this._activePointers, lt), this._getClientRect(this._elementRect), e.copy(lt), i.copy(lt), this._activePointers.length >= 2) {
|
|
3780
|
-
const
|
|
3781
|
-
o.set(0,
|
|
3782
|
-
const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5,
|
|
3783
|
-
i.set(N,
|
|
3780
|
+
const g = lt.x - this._activePointers[1].clientX, S = lt.y - this._activePointers[1].clientY, _ = Math.sqrt(g * g + S * S);
|
|
3781
|
+
o.set(0, _);
|
|
3782
|
+
const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, y = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
|
3783
|
+
i.set(N, y);
|
|
3784
3784
|
}
|
|
3785
3785
|
if (this._state = 0, !p)
|
|
3786
3786
|
this._lockedPointer && (this._state = this._state | this.mouseButtons.left);
|
|
@@ -3803,18 +3803,18 @@ class ot extends Or {
|
|
|
3803
3803
|
if (!this._enabled || !this._dragNeedsUpdate)
|
|
3804
3804
|
return;
|
|
3805
3805
|
this._dragNeedsUpdate = !1, $s(this._activePointers, lt);
|
|
3806
|
-
const T = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null,
|
|
3807
|
-
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(
|
|
3808
|
-
const
|
|
3809
|
-
(this._state & P.DOLLY) === P.DOLLY ? (this._dollyInternal(
|
|
3806
|
+
const T = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, g = T ? -T.deltaX : i.x - lt.x, S = T ? -T.deltaY : i.y - lt.y;
|
|
3807
|
+
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(g, S), this._isUserControllingRotate = !0), (this._state & P.DOLLY) === P.DOLLY || (this._state & P.ZOOM) === P.ZOOM) {
|
|
3808
|
+
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, y = this.dollyDragInverted ? -1 : 1;
|
|
3809
|
+
(this._state & P.DOLLY) === P.DOLLY ? (this._dollyInternal(y * S * Es, _, N), this._isUserControllingDolly = !0) : (this._zoomInternal(y * S * Es, _, N), this._isUserControllingZoom = !0);
|
|
3810
3810
|
}
|
|
3811
3811
|
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) {
|
|
3812
|
-
const
|
|
3813
|
-
o.set(0,
|
|
3814
|
-
const
|
|
3815
|
-
(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,
|
|
3812
|
+
const _ = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY, y = Math.sqrt(_ * _ + N * N), w = o.y - y;
|
|
3813
|
+
o.set(0, y);
|
|
3814
|
+
const L = 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;
|
|
3815
|
+
(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, L, U), this._isUserControllingDolly = !0) : (this._zoomInternal(w * Es, L, U), this._isUserControllingZoom = !0);
|
|
3816
3816
|
}
|
|
3817
|
-
((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(
|
|
3817
|
+
((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(g, S, !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(g, S, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
3818
3818
|
}, C = () => {
|
|
3819
3819
|
$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" }));
|
|
3820
3820
|
};
|
|
@@ -3836,7 +3836,7 @@ class ot extends Or {
|
|
|
3836
3836
|
this.unlockPointer();
|
|
3837
3837
|
};
|
|
3838
3838
|
this._addAllEventListeners = (p) => {
|
|
3839
|
-
this._domElement = p, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n),
|
|
3839
|
+
this._domElement = p, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), _r && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", h), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", f);
|
|
3840
3840
|
}, this._removeAllEventListeners = () => {
|
|
3841
3841
|
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));
|
|
3842
3842
|
}, this.cancel = () => {
|
|
@@ -4137,8 +4137,8 @@ class ot extends Or {
|
|
|
4137
4137
|
* @category Methods
|
|
4138
4138
|
*/
|
|
4139
4139
|
truck(s, t, e = !1) {
|
|
4140
|
-
this._camera.updateMatrix(),
|
|
4141
|
-
const i = G.copy(
|
|
4140
|
+
this._camera.updateMatrix(), Ot.setFromMatrixColumn(this._camera.matrix, 0), St.setFromMatrixColumn(this._camera.matrix, 1), Ot.multiplyScalar(s), St.multiplyScalar(-t);
|
|
4141
|
+
const i = G.copy(Ot).add(St), o = z.copy(this._targetEnd).add(i);
|
|
4142
4142
|
return this.moveTo(o.x, o.y, o.z, e);
|
|
4143
4143
|
}
|
|
4144
4144
|
/**
|
|
@@ -4279,11 +4279,11 @@ class ot extends Or {
|
|
|
4279
4279
|
const R = G.set(i, o, n), m = z.set(s, t, e);
|
|
4280
4280
|
ut.setFromVector3(m.sub(R).applyQuaternion(this._yAxisUpSpace));
|
|
4281
4281
|
const C = Ee.set(h, d, E), A = z.set(r, a, c);
|
|
4282
|
-
|
|
4283
|
-
const F =
|
|
4282
|
+
Me.setFromVector3(A.sub(C).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(R.lerp(C, u));
|
|
4283
|
+
const F = Me.theta - ut.theta, p = Me.phi - ut.phi, T = Me.radius - ut.radius;
|
|
4284
4284
|
this._sphericalEnd.set(ut.radius + T * u, ut.phi + p * u, ut.theta + F * u), this.normalizeRotations(), this._needsUpdate = !0, f || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
4285
|
-
const
|
|
4286
|
-
return this._createOnRestPromise(
|
|
4285
|
+
const g = !f || 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) && k(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && k(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && k(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
|
4286
|
+
return this._createOnRestPromise(g);
|
|
4287
4287
|
}
|
|
4288
4288
|
/**
|
|
4289
4289
|
* Set angle and distance by given position.
|
|
@@ -4332,9 +4332,9 @@ class ot extends Or {
|
|
|
4332
4332
|
* @category Methods
|
|
4333
4333
|
*/
|
|
4334
4334
|
setOrbitPoint(s, t, e) {
|
|
4335
|
-
this._camera.updateMatrixWorld(),
|
|
4335
|
+
this._camera.updateMatrixWorld(), Ot.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), St.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), Qt.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
|
|
4336
4336
|
const i = G.set(s, t, e), o = i.distanceTo(this._camera.position), n = i.sub(this._camera.position);
|
|
4337
|
-
|
|
4337
|
+
Ot.multiplyScalar(n.x), St.multiplyScalar(n.y), Qt.multiplyScalar(n.z), G.copy(Ot).add(St).add(Qt), G.z = G.z + o, this.dollyTo(o, !1), this.setFocalOffset(-G.x, G.y, -G.z, !1), this.moveTo(s, t, e, !1);
|
|
4338
4338
|
}
|
|
4339
4339
|
/**
|
|
4340
4340
|
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
|
@@ -4375,7 +4375,7 @@ class ot extends Or {
|
|
|
4375
4375
|
getDistanceToFitBox(s, t, e, i = !1) {
|
|
4376
4376
|
if (Js(this._camera, "getDistanceToFitBox"))
|
|
4377
4377
|
return this._spherical.radius;
|
|
4378
|
-
const o = s / t, n = this._camera.getEffectiveFOV() *
|
|
4378
|
+
const o = s / t, n = this._camera.getEffectiveFOV() * Ne, r = this._camera.aspect;
|
|
4379
4379
|
return ((i ? o > r : o < r) ? t : s / r) * 0.5 / Math.tan(n * 0.5) + e * 0.5;
|
|
4380
4380
|
}
|
|
4381
4381
|
/**
|
|
@@ -4387,7 +4387,7 @@ class ot extends Or {
|
|
|
4387
4387
|
getDistanceToFitSphere(s) {
|
|
4388
4388
|
if (Js(this._camera, "getDistanceToFitSphere"))
|
|
4389
4389
|
return this._spherical.radius;
|
|
4390
|
-
const t = this._camera.getEffectiveFOV() *
|
|
4390
|
+
const t = this._camera.getEffectiveFOV() * Ne, e = Math.atan(Math.tan(t * 0.5) * this._camera.aspect) * 2, i = 1 < this._camera.aspect ? t : e;
|
|
4391
4391
|
return s / Math.sin(i * 0.5);
|
|
4392
4392
|
}
|
|
4393
4393
|
/**
|
|
@@ -4526,25 +4526,25 @@ class ot extends Or {
|
|
|
4526
4526
|
if (Zt(this._camera) && this._changedDolly !== 0) {
|
|
4527
4527
|
const d = this._spherical.radius - this._lastDistance, E = this._camera, u = this._getCameraDirection(Le), f = G.copy(u).cross(E.up).normalize();
|
|
4528
4528
|
f.lengthSq() === 0 && (f.x = 1);
|
|
4529
|
-
const R = z.crossVectors(f, u), m = this._sphericalEnd.radius * Math.tan(E.getEffectiveFOV() *
|
|
4530
|
-
if (this.infinityDolly && (T ||
|
|
4529
|
+
const R = z.crossVectors(f, u), m = this._sphericalEnd.radius * Math.tan(E.getEffectiveFOV() * Ne * 0.5), A = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = Ee.copy(this._targetEnd).add(f.multiplyScalar(this._dollyControlCoord.x * m * E.aspect)).add(R.multiplyScalar(this._dollyControlCoord.y * m)), p = G.copy(this._targetEnd).lerp(F, A), T = this._lastDollyDirection === le.IN && this._spherical.radius <= this.minDistance, g = this._lastDollyDirection === le.OUT && this.maxDistance <= this._spherical.radius;
|
|
4530
|
+
if (this.infinityDolly && (T || g)) {
|
|
4531
4531
|
this._sphericalEnd.radius -= d, this._spherical.radius -= d;
|
|
4532
|
-
const
|
|
4533
|
-
p.add(
|
|
4532
|
+
const _ = z.copy(u).multiplyScalar(-d);
|
|
4533
|
+
p.add(_);
|
|
4534
4534
|
}
|
|
4535
4535
|
this._boundary.clampPoint(p, p);
|
|
4536
|
-
const
|
|
4537
|
-
this._targetEnd.copy(p), this._target.add(
|
|
4536
|
+
const S = z.subVectors(p, this._targetEnd);
|
|
4537
|
+
this._targetEnd.copy(p), this._target.add(S), this._changedDolly -= d, X(this._changedDolly) && (this._changedDolly = 0);
|
|
4538
4538
|
} else if (bt(this._camera) && this._changedZoom !== 0) {
|
|
4539
|
-
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), f = z.set(0, 0, -1).applyQuaternion(E.quaternion), R = Ee.copy(u).add(f.multiplyScalar(-u.dot(E.up))), C = -(this._zoom - d - this._zoom) / this._zoom, A = this._getCameraDirection(Le), F = this._targetEnd.dot(A), p = G.copy(this._targetEnd).lerp(R, C), T = p.dot(A),
|
|
4540
|
-
p.sub(
|
|
4541
|
-
const
|
|
4542
|
-
this._targetEnd.copy(p), this._target.add(
|
|
4539
|
+
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), f = z.set(0, 0, -1).applyQuaternion(E.quaternion), R = Ee.copy(u).add(f.multiplyScalar(-u.dot(E.up))), C = -(this._zoom - d - this._zoom) / this._zoom, A = this._getCameraDirection(Le), F = this._targetEnd.dot(A), p = G.copy(this._targetEnd).lerp(R, C), T = p.dot(A), g = A.multiplyScalar(T - F);
|
|
4540
|
+
p.sub(g), this._boundary.clampPoint(p, p);
|
|
4541
|
+
const S = z.subVectors(p, this._targetEnd);
|
|
4542
|
+
this._targetEnd.copy(p), this._target.add(S), this._changedZoom -= d, X(this._changedZoom) && (this._changedZoom = 0);
|
|
4543
4543
|
}
|
|
4544
4544
|
}
|
|
4545
4545
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
|
4546
4546
|
const a = this._collisionTest();
|
|
4547
|
-
this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(),
|
|
4547
|
+
this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Ot.setFromMatrixColumn(this._camera.matrix, 0), St.setFromMatrixColumn(this._camera.matrix, 1), Qt.setFromMatrixColumn(this._camera.matrix, 2), Ot.multiplyScalar(this._focalOffset.x), St.multiplyScalar(-this._focalOffset.y), Qt.multiplyScalar(this._focalOffset.z), G.copy(Ot).add(St).add(Qt), this._camera.position.add(G)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), G.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
|
|
4548
4548
|
const h = this._needsUpdate;
|
|
4549
4549
|
return h && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : h ? (this.dispatchEvent({ type: "update" }), X(t, this.restThreshold) && X(e, this.restThreshold) && X(i, this.restThreshold) && X(o.x, this.restThreshold) && X(o.y, this.restThreshold) && X(o.z, this.restThreshold) && X(n.x, this.restThreshold) && X(n.y, this.restThreshold) && X(n.z, this.restThreshold) && X(r, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !h && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = h, this._needsUpdate = !1, h;
|
|
4550
4550
|
}
|
|
@@ -4556,13 +4556,13 @@ class ot extends Or {
|
|
|
4556
4556
|
return JSON.stringify({
|
|
4557
4557
|
enabled: this._enabled,
|
|
4558
4558
|
minDistance: this.minDistance,
|
|
4559
|
-
maxDistance:
|
|
4559
|
+
maxDistance: Pe(this.maxDistance),
|
|
4560
4560
|
minZoom: this.minZoom,
|
|
4561
|
-
maxZoom:
|
|
4561
|
+
maxZoom: Pe(this.maxZoom),
|
|
4562
4562
|
minPolarAngle: this.minPolarAngle,
|
|
4563
|
-
maxPolarAngle:
|
|
4564
|
-
minAzimuthAngle:
|
|
4565
|
-
maxAzimuthAngle:
|
|
4563
|
+
maxPolarAngle: Pe(this.maxPolarAngle),
|
|
4564
|
+
minAzimuthAngle: Pe(this.minAzimuthAngle),
|
|
4565
|
+
maxAzimuthAngle: Pe(this.maxAzimuthAngle),
|
|
4566
4566
|
smoothTime: this.smoothTime,
|
|
4567
4567
|
draggingSmoothTime: this.draggingSmoothTime,
|
|
4568
4568
|
dollySpeed: this.dollySpeed,
|
|
@@ -4587,7 +4587,7 @@ class ot extends Or {
|
|
|
4587
4587
|
*/
|
|
4588
4588
|
fromJSON(s, t = !1) {
|
|
4589
4589
|
const e = JSON.parse(s);
|
|
4590
|
-
this.enabled = e.enabled, this.minDistance = e.minDistance, this.maxDistance =
|
|
4590
|
+
this.enabled = e.enabled, this.minDistance = e.minDistance, this.maxDistance = ye(e.maxDistance), this.minZoom = e.minZoom, this.maxZoom = ye(e.maxZoom), this.minPolarAngle = e.minPolarAngle, this.maxPolarAngle = ye(e.maxPolarAngle), this.minAzimuthAngle = ye(e.minAzimuthAngle), this.maxAzimuthAngle = ye(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;
|
|
4591
4591
|
}
|
|
4592
4592
|
/**
|
|
4593
4593
|
* Attach all internal event handlers to enable drag control.
|
|
@@ -4598,7 +4598,7 @@ class ot extends Or {
|
|
|
4598
4598
|
console.warn("camera-controls is already connected.");
|
|
4599
4599
|
return;
|
|
4600
4600
|
}
|
|
4601
|
-
s.setAttribute("data-camera-controls-version",
|
|
4601
|
+
s.setAttribute("data-camera-controls-version", Or), this._addAllEventListeners(s), this._getClientRect(this._elementRect);
|
|
4602
4602
|
}
|
|
4603
4603
|
/**
|
|
4604
4604
|
* Detach all internal event handlers to disable drag control.
|
|
@@ -4648,7 +4648,7 @@ class ot extends Or {
|
|
|
4648
4648
|
}
|
|
4649
4649
|
_updateNearPlaneCorners() {
|
|
4650
4650
|
if (Zt(this._camera)) {
|
|
4651
|
-
const s = this._camera, t = s.near, e = s.getEffectiveFOV() *
|
|
4651
|
+
const s = this._camera, t = s.near, e = s.getEffectiveFOV() * Ne, i = Math.tan(e * 0.5) * t, o = i * s.aspect;
|
|
4652
4652
|
this._nearPlaneCorners[0].set(-o, -i, 0), this._nearPlaneCorners[1].set(o, -i, 0), this._nearPlaneCorners[2].set(o, i, 0), this._nearPlaneCorners[3].set(-o, i, 0);
|
|
4653
4653
|
} else if (bt(this._camera)) {
|
|
4654
4654
|
const s = this._camera, t = 1 / s.zoom, e = s.left * t, i = s.right * t, o = s.top * t, n = s.bottom * t;
|
|
@@ -4743,7 +4743,7 @@ class ot extends Or {
|
|
|
4743
4743
|
}), e.radius = Math.sqrt(o), e;
|
|
4744
4744
|
}
|
|
4745
4745
|
}
|
|
4746
|
-
class
|
|
4746
|
+
class ke extends ar {
|
|
4747
4747
|
constructor(t) {
|
|
4748
4748
|
super(t);
|
|
4749
4749
|
/** {@link Updateable.onBeforeUpdate} */
|
|
@@ -4770,7 +4770,7 @@ class He extends ar {
|
|
|
4770
4770
|
I(this, "updateAspect", () => {
|
|
4771
4771
|
var t;
|
|
4772
4772
|
if (!(!this.currentWorld || !this.currentWorld.renderer)) {
|
|
4773
|
-
if (this.three instanceof
|
|
4773
|
+
if (this.three instanceof O.OrthographicCamera) {
|
|
4774
4774
|
this.onAspectUpdated.trigger();
|
|
4775
4775
|
return;
|
|
4776
4776
|
}
|
|
@@ -4835,15 +4835,15 @@ class He extends ar {
|
|
|
4835
4835
|
this.enabled && (this.onBeforeUpdate.trigger(this), this.controls.update(t), this.onAfterUpdate.trigger(this));
|
|
4836
4836
|
}
|
|
4837
4837
|
setupCamera() {
|
|
4838
|
-
const t = window.innerWidth / window.innerHeight, e = new
|
|
4839
|
-
return e.position.set(50, 50, 50), e.lookAt(new
|
|
4838
|
+
const t = window.innerWidth / window.innerHeight, e = new O.PerspectiveCamera(60, t, 1, 1e3);
|
|
4839
|
+
return e.position.set(50, 50, 50), e.lookAt(new O.Vector3(0, 0, 0)), e;
|
|
4840
4840
|
}
|
|
4841
4841
|
newCameraControls() {
|
|
4842
4842
|
if (!this.currentWorld)
|
|
4843
4843
|
throw new Error("This camera needs a world to work!");
|
|
4844
4844
|
if (!this.currentWorld.renderer)
|
|
4845
4845
|
throw new Error("This camera needs a renderer to work!");
|
|
4846
|
-
ot.install({ THREE:
|
|
4846
|
+
ot.install({ THREE: ke.getSubsetOfThree() });
|
|
4847
4847
|
const { domElement: t } = this.currentWorld.renderer.three, e = new ot(this.three, t);
|
|
4848
4848
|
return e.smoothTime = 0.2, e.dollyToCursor = !0, e.infinityDolly = !0, e;
|
|
4849
4849
|
}
|
|
@@ -4852,21 +4852,21 @@ class He extends ar {
|
|
|
4852
4852
|
}
|
|
4853
4853
|
static getSubsetOfThree() {
|
|
4854
4854
|
return {
|
|
4855
|
-
MOUSE:
|
|
4856
|
-
Vector2:
|
|
4857
|
-
Vector3:
|
|
4858
|
-
Vector4:
|
|
4859
|
-
Quaternion:
|
|
4860
|
-
Matrix4:
|
|
4861
|
-
Spherical:
|
|
4862
|
-
Box3:
|
|
4863
|
-
Sphere:
|
|
4864
|
-
Raycaster:
|
|
4865
|
-
MathUtils:
|
|
4855
|
+
MOUSE: O.MOUSE,
|
|
4856
|
+
Vector2: O.Vector2,
|
|
4857
|
+
Vector3: O.Vector3,
|
|
4858
|
+
Vector4: O.Vector4,
|
|
4859
|
+
Quaternion: O.Quaternion,
|
|
4860
|
+
Matrix4: O.Matrix4,
|
|
4861
|
+
Spherical: O.Spherical,
|
|
4862
|
+
Box3: O.Box3,
|
|
4863
|
+
Sphere: O.Sphere,
|
|
4864
|
+
Raycaster: O.Raycaster,
|
|
4865
|
+
MathUtils: O.MathUtils
|
|
4866
4866
|
};
|
|
4867
4867
|
}
|
|
4868
4868
|
}
|
|
4869
|
-
const
|
|
4869
|
+
const Os = class Os extends et {
|
|
4870
4870
|
constructor(t) {
|
|
4871
4871
|
super(t);
|
|
4872
4872
|
/** {@link Updateable.onAfterUpdate} */
|
|
@@ -4892,7 +4892,7 @@ const gs = class gs extends et {
|
|
|
4892
4892
|
I(this, "list", /* @__PURE__ */ new Map());
|
|
4893
4893
|
/** {@link Component.enabled} */
|
|
4894
4894
|
I(this, "enabled", !0);
|
|
4895
|
-
t.add(
|
|
4895
|
+
t.add(Os.uuid, this);
|
|
4896
4896
|
}
|
|
4897
4897
|
/**
|
|
4898
4898
|
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
@@ -4948,8 +4948,8 @@ const gs = class gs extends et {
|
|
|
4948
4948
|
* A unique identifier for the component.
|
|
4949
4949
|
* This UUID is used to register the component within the Components system.
|
|
4950
4950
|
*/
|
|
4951
|
-
I(
|
|
4952
|
-
let Ci =
|
|
4951
|
+
I(Os, "uuid", "fdb61dc4-2ec1-4966-b83d-54ea795fad4a");
|
|
4952
|
+
let Ci = Os;
|
|
4953
4953
|
class Nr {
|
|
4954
4954
|
constructor(s, t, e) {
|
|
4955
4955
|
/** {@link Disposable.onDisposed} */
|
|
@@ -4962,13 +4962,13 @@ class Nr {
|
|
|
4962
4962
|
I(this, "three");
|
|
4963
4963
|
I(this, "_fade", 3);
|
|
4964
4964
|
I(this, "updateZoom", () => {
|
|
4965
|
-
this.world.camera instanceof
|
|
4965
|
+
this.world.camera instanceof ke && (this.material.uniforms.uZoom.value = this.world.camera.three.zoom);
|
|
4966
4966
|
});
|
|
4967
4967
|
this.world = t;
|
|
4968
4968
|
const { color: i, size1: o, size2: n, distance: r } = e;
|
|
4969
4969
|
this.components = s;
|
|
4970
|
-
const a = new
|
|
4971
|
-
side:
|
|
4970
|
+
const a = new O.PlaneGeometry(2, 2, 1, 1), c = new O.ShaderMaterial({
|
|
4971
|
+
side: O.DoubleSide,
|
|
4972
4972
|
uniforms: {
|
|
4973
4973
|
uSize1: {
|
|
4974
4974
|
value: o
|
|
@@ -5057,7 +5057,7 @@ class Nr {
|
|
|
5057
5057
|
derivatives: !0
|
|
5058
5058
|
}
|
|
5059
5059
|
});
|
|
5060
|
-
this.three = new
|
|
5060
|
+
this.three = new O.Mesh(a, c), this.three.frustumCulled = !1, t.scene.three.add(this.three), this.setupEvents(!0);
|
|
5061
5061
|
}
|
|
5062
5062
|
/** {@link Hideable.visible} */
|
|
5063
5063
|
get visible() {
|
|
@@ -5090,13 +5090,13 @@ class Nr {
|
|
|
5090
5090
|
this.setupEvents(!1), this.components.get(zt).destroy(this.three), this.onDisposed.trigger(), this.onDisposed.reset(), this.world = null, this.components = null;
|
|
5091
5091
|
}
|
|
5092
5092
|
setupEvents(s) {
|
|
5093
|
-
if (this.world.isDisposing || !(this.world.camera instanceof
|
|
5093
|
+
if (this.world.isDisposing || !(this.world.camera instanceof ke))
|
|
5094
5094
|
return;
|
|
5095
5095
|
const t = this.world.camera.controls;
|
|
5096
5096
|
s ? t.addEventListener("update", this.updateZoom) : t.removeEventListener("update", this.updateZoom);
|
|
5097
5097
|
}
|
|
5098
5098
|
}
|
|
5099
|
-
const
|
|
5099
|
+
const Ss = class Ss extends et {
|
|
5100
5100
|
constructor(t) {
|
|
5101
5101
|
super(t);
|
|
5102
5102
|
/**
|
|
@@ -5107,7 +5107,7 @@ const _s = class _s extends et {
|
|
|
5107
5107
|
* The default configuration for grid creation.
|
|
5108
5108
|
*/
|
|
5109
5109
|
I(this, "config", {
|
|
5110
|
-
color: new
|
|
5110
|
+
color: new O.Color(12303291),
|
|
5111
5111
|
size1: 1,
|
|
5112
5112
|
size2: 10,
|
|
5113
5113
|
distance: 500
|
|
@@ -5116,7 +5116,7 @@ const _s = class _s extends et {
|
|
|
5116
5116
|
I(this, "onDisposed", new D());
|
|
5117
5117
|
/** {@link Component.enabled} */
|
|
5118
5118
|
I(this, "enabled", !0);
|
|
5119
|
-
t.add(
|
|
5119
|
+
t.add(Ss.uuid, this);
|
|
5120
5120
|
}
|
|
5121
5121
|
/**
|
|
5122
5122
|
* Creates a new grid for the given world.
|
|
@@ -5160,8 +5160,8 @@ const _s = class _s extends et {
|
|
|
5160
5160
|
* A unique identifier for the component.
|
|
5161
5161
|
* This UUID is used to register the component within the Components system.
|
|
5162
5162
|
*/
|
|
5163
|
-
I(
|
|
5164
|
-
let dn =
|
|
5163
|
+
I(Ss, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
|
|
5164
|
+
let dn = Ss;
|
|
5165
5165
|
const jt = new jn(), nt = new M(), xt = new M(), j = new Pt(), un = {
|
|
5166
5166
|
X: new M(1, 0, 0),
|
|
5167
5167
|
Y: new M(0, 1, 0),
|
|
@@ -5188,7 +5188,7 @@ class Pr extends ri {
|
|
|
5188
5188
|
}
|
|
5189
5189
|
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);
|
|
5190
5190
|
const r = new M(), a = new M(), c = new Pt(), h = new Pt(), d = new M(), E = new Pt(), u = new M(), f = new M(), R = new M(), m = 0, C = new M();
|
|
5191
|
-
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", R), 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 =
|
|
5191
|
+
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", R), 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 = yr.bind(this), this._onPointerDown = Mr.bind(this), this._onPointerHover = Lr.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);
|
|
5192
5192
|
}
|
|
5193
5193
|
// updateMatrixWorld updates key transformation variables
|
|
5194
5194
|
updateMatrixWorld() {
|
|
@@ -5279,7 +5279,7 @@ class Pr extends ri {
|
|
|
5279
5279
|
this.space = s;
|
|
5280
5280
|
}
|
|
5281
5281
|
}
|
|
5282
|
-
function
|
|
5282
|
+
function yr(l) {
|
|
5283
5283
|
if (this.domElement.ownerDocument.pointerLockElement)
|
|
5284
5284
|
return {
|
|
5285
5285
|
x: 0,
|
|
@@ -5295,7 +5295,7 @@ function Lr(l) {
|
|
|
5295
5295
|
};
|
|
5296
5296
|
}
|
|
5297
5297
|
}
|
|
5298
|
-
function
|
|
5298
|
+
function Lr(l) {
|
|
5299
5299
|
if (this.enabled)
|
|
5300
5300
|
switch (l.pointerType) {
|
|
5301
5301
|
case "mouse":
|
|
@@ -5320,11 +5320,11 @@ function oi(l, s, t) {
|
|
|
5320
5320
|
return e[i];
|
|
5321
5321
|
return !1;
|
|
5322
5322
|
}
|
|
5323
|
-
const Is = new qn(), W = new M(0, 1, 0), Cn = new M(0, 0, 0), Tn = new
|
|
5323
|
+
const Is = new qn(), W = new M(0, 1, 0), Cn = new M(0, 0, 0), Tn = new Lt(), fs = new Pt(), Rs = new Pt(), _t = new M(), mn = new Lt(), 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();
|
|
5324
5324
|
class Ur extends ri {
|
|
5325
5325
|
constructor() {
|
|
5326
5326
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
|
5327
|
-
const s = new
|
|
5327
|
+
const s = new Ln({
|
|
5328
5328
|
depthTest: !1,
|
|
5329
5329
|
depthWrite: !1,
|
|
5330
5330
|
fog: !1,
|
|
@@ -5367,7 +5367,7 @@ class Ur extends ri {
|
|
|
5367
5367
|
const A = new ct(75e-4, 75e-4, 0.5, 3);
|
|
5368
5368
|
A.translate(0, 0.25, 0);
|
|
5369
5369
|
function F(B, H) {
|
|
5370
|
-
const q = new
|
|
5370
|
+
const q = new Re(B, 75e-4, 3, 64, H * Math.PI * 2);
|
|
5371
5371
|
return q.rotateY(Math.PI / 2), q.rotateX(Math.PI / 2), q;
|
|
5372
5372
|
}
|
|
5373
5373
|
function p() {
|
|
@@ -5402,7 +5402,7 @@ class Ur extends ri {
|
|
|
5402
5402
|
XZ: [
|
|
5403
5403
|
[new v(new rt(0.15, 0.15, 0.01), c.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
5404
5404
|
]
|
|
5405
|
-
},
|
|
5405
|
+
}, g = {
|
|
5406
5406
|
X: [
|
|
5407
5407
|
[new v(new ct(0.2, 0, 0.6, 4), e), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
|
5408
5408
|
[new v(new ct(0.2, 0, 0.6, 4), e), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
|
@@ -5427,7 +5427,7 @@ class Ur extends ri {
|
|
|
5427
5427
|
XZ: [
|
|
5428
5428
|
[new v(new rt(0.2, 0.2, 0.01), e), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
5429
5429
|
]
|
|
5430
|
-
},
|
|
5430
|
+
}, S = {
|
|
5431
5431
|
START: [
|
|
5432
5432
|
[new v(new Ze(0.01, 2), i), null, null, null, "helper"]
|
|
5433
5433
|
],
|
|
@@ -5446,7 +5446,7 @@ class Ur extends ri {
|
|
|
5446
5446
|
Z: [
|
|
5447
5447
|
[new Dt(C, i.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
|
5448
5448
|
]
|
|
5449
|
-
},
|
|
5449
|
+
}, _ = {
|
|
5450
5450
|
XYZE: [
|
|
5451
5451
|
[new v(F(0.5, 1), f), null, [0, Math.PI / 2, 0]]
|
|
5452
5452
|
],
|
|
@@ -5466,21 +5466,21 @@ class Ur extends ri {
|
|
|
5466
5466
|
AXIS: [
|
|
5467
5467
|
[new Dt(C, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
5468
5468
|
]
|
|
5469
|
-
},
|
|
5469
|
+
}, y = {
|
|
5470
5470
|
XYZE: [
|
|
5471
5471
|
[new v(new $n(0.25, 10, 8), e)]
|
|
5472
5472
|
],
|
|
5473
5473
|
X: [
|
|
5474
|
-
[new v(new
|
|
5474
|
+
[new v(new Re(0.5, 0.1, 4, 24), e), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
|
|
5475
5475
|
],
|
|
5476
5476
|
Y: [
|
|
5477
|
-
[new v(new
|
|
5477
|
+
[new v(new Re(0.5, 0.1, 4, 24), e), [0, 0, 0], [Math.PI / 2, 0, 0]]
|
|
5478
5478
|
],
|
|
5479
5479
|
Z: [
|
|
5480
|
-
[new v(new
|
|
5480
|
+
[new v(new Re(0.5, 0.1, 4, 24), e), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
5481
5481
|
],
|
|
5482
5482
|
E: [
|
|
5483
|
-
[new v(new
|
|
5483
|
+
[new v(new Re(0.75, 0.1, 2, 24), e)]
|
|
5484
5484
|
]
|
|
5485
5485
|
}, w = {
|
|
5486
5486
|
X: [
|
|
@@ -5510,7 +5510,7 @@ class Ur extends ri {
|
|
|
5510
5510
|
XYZ: [
|
|
5511
5511
|
[new v(new rt(0.1, 0.1, 0.1), d.clone())]
|
|
5512
5512
|
]
|
|
5513
|
-
},
|
|
5513
|
+
}, L = {
|
|
5514
5514
|
X: [
|
|
5515
5515
|
[new v(new ct(0.2, 0, 0.6, 4), e), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
|
5516
5516
|
[new v(new ct(0.2, 0, 0.6, 4), e), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
|
@@ -5552,12 +5552,12 @@ class Ur extends ri {
|
|
|
5552
5552
|
for (let st = B[q].length; st--; ) {
|
|
5553
5553
|
const Q = B[q][st][0].clone(), Ht = B[q][st][1], kt = B[q][st][2], Wt = B[q][st][3], We = B[q][st][4];
|
|
5554
5554
|
Q.name = q, Q.tag = We, Ht && Q.position.set(Ht[0], Ht[1], Ht[2]), kt && Q.rotation.set(kt[0], kt[1], kt[2]), Wt && Q.scale.set(Wt[0], Wt[1], Wt[2]), Q.updateMatrix();
|
|
5555
|
-
const
|
|
5556
|
-
|
|
5555
|
+
const Te = Q.geometry.clone();
|
|
5556
|
+
Te.applyMatrix4(Q.matrix), Q.geometry = Te, Q.renderOrder = 1 / 0, Q.position.set(0, 0, 0), Q.rotation.set(0, 0, 0), Q.scale.set(1, 1, 1), H.add(Q);
|
|
5557
5557
|
}
|
|
5558
5558
|
return H;
|
|
5559
5559
|
}
|
|
5560
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = x(T)), this.add(this.gizmo.rotate = x(
|
|
5560
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = x(T)), this.add(this.gizmo.rotate = x(_)), this.add(this.gizmo.scale = x(w)), this.add(this.picker.translate = x(g)), this.add(this.picker.rotate = x(y)), this.add(this.picker.scale = x(L)), this.add(this.helper.translate = x(S)), 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;
|
|
5561
5561
|
}
|
|
5562
5562
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
5563
5563
|
updateMatrixWorld(s) {
|
|
@@ -5570,10 +5570,10 @@ class Ur extends ri {
|
|
|
5570
5570
|
n.visible = !0, n.rotation.set(0, 0, 0), n.position.copy(this.worldPosition);
|
|
5571
5571
|
let r;
|
|
5572
5572
|
if (this.camera.isOrthographicCamera ? r = (this.camera.top - this.camera.bottom) / this.camera.zoom : r = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), n.scale.set(1, 1, 1).multiplyScalar(r * this.size / 4), n.tag === "helper") {
|
|
5573
|
-
n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(Is.set(0, 0, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(
|
|
5573
|
+
n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(Is.set(0, 0, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Y" && (j.setFromEuler(Is.set(0, 0, Math.PI / 2)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(qt).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (j.setFromEuler(Is.set(0, Math.PI / 2, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "XYZE" && (j.setFromEuler(Is.set(0, Math.PI / 2, 0)), W.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(Tn.lookAt(Cn, W, qt)), n.quaternion.multiply(j), n.visible = this.dragging), this.axis === "E" && (n.visible = !1)) : n.name === "START" ? (n.position.copy(this.worldPositionStart), n.visible = this.dragging) : n.name === "END" ? (n.position.copy(this.worldPosition), n.visible = this.dragging) : n.name === "DELTA" ? (n.position.copy(this.worldPositionStart), n.quaternion.copy(this.worldQuaternionStart), nt.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), nt.applyQuaternion(this.worldQuaternionStart.clone().invert()), n.scale.copy(nt), n.visible = this.dragging) : (n.quaternion.copy(e), this.dragging ? n.position.copy(this.worldPositionStart) : n.position.copy(this.worldPosition), this.axis && (n.visible = this.axis.search(n.name) !== -1));
|
|
5574
5574
|
continue;
|
|
5575
5575
|
}
|
|
5576
|
-
n.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(W.copy(
|
|
5576
|
+
n.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Y" && Math.abs(W.copy(qt).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Z" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XY" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "YZ" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XZ" && Math.abs(W.copy(qt).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (fs.copy(e), W.copy(this.eye).applyQuaternion(j.copy(e).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(Tn.lookAt(this.eye, Cn, qt)), n.name === "X" && (j.setFromAxisAngle(Ue, Math.atan2(-W.y, W.z)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j)), n.name === "Y" && (j.setFromAxisAngle(qt, Math.atan2(W.x, W.z)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j)), n.name === "Z" && (j.setFromAxisAngle(xe, Math.atan2(W.y, W.x)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j))), n.visible = n.visible && (n.name.indexOf("X") === -1 || this.showX), n.visible = n.visible && (n.name.indexOf("Y") === -1 || this.showY), n.visible = n.visible && (n.name.indexOf("Z") === -1 || this.showZ), n.visible = n.visible && (n.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), n.material._color = n.material._color || n.material.color.clone(), n.material._opacity = n.material._opacity || n.material.opacity, n.material.color.copy(n.material._color), n.material.opacity = n.material._opacity, this.enabled && this.axis && (n.name === this.axis || this.axis.split("").some(function(a) {
|
|
5577
5577
|
return n.name === a;
|
|
5578
5578
|
})) && (n.material.color.setHex(16776960), n.material.opacity = 1);
|
|
5579
5579
|
}
|
|
@@ -5584,44 +5584,44 @@ class xr extends v {
|
|
|
5584
5584
|
constructor() {
|
|
5585
5585
|
super(
|
|
5586
5586
|
new Jn(1e5, 1e5, 2, 2),
|
|
5587
|
-
new
|
|
5587
|
+
new Ln({ visible: !1, wireframe: !0, side: yn, transparent: !0, opacity: 0.1, toneMapped: !1 })
|
|
5588
5588
|
), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
|
|
5589
5589
|
}
|
|
5590
5590
|
updateMatrixWorld(s) {
|
|
5591
5591
|
let t = this.space;
|
|
5592
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), ps.copy(
|
|
5592
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), ps.copy(Ue).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), we.copy(qt).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), De.copy(xe).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), W.copy(we), this.mode) {
|
|
5593
5593
|
case "translate":
|
|
5594
5594
|
case "scale":
|
|
5595
5595
|
switch (this.axis) {
|
|
5596
5596
|
case "X":
|
|
5597
|
-
W.copy(this.eye).cross(ps),
|
|
5597
|
+
W.copy(this.eye).cross(ps), _t.copy(ps).cross(W);
|
|
5598
5598
|
break;
|
|
5599
5599
|
case "Y":
|
|
5600
|
-
W.copy(this.eye).cross(
|
|
5600
|
+
W.copy(this.eye).cross(we), _t.copy(we).cross(W);
|
|
5601
5601
|
break;
|
|
5602
5602
|
case "Z":
|
|
5603
|
-
W.copy(this.eye).cross(
|
|
5603
|
+
W.copy(this.eye).cross(De), _t.copy(De).cross(W);
|
|
5604
5604
|
break;
|
|
5605
5605
|
case "XY":
|
|
5606
|
-
|
|
5606
|
+
_t.copy(De);
|
|
5607
5607
|
break;
|
|
5608
5608
|
case "YZ":
|
|
5609
|
-
|
|
5609
|
+
_t.copy(ps);
|
|
5610
5610
|
break;
|
|
5611
5611
|
case "XZ":
|
|
5612
|
-
W.copy(
|
|
5612
|
+
W.copy(De), _t.copy(we);
|
|
5613
5613
|
break;
|
|
5614
5614
|
case "XYZ":
|
|
5615
5615
|
case "E":
|
|
5616
|
-
|
|
5616
|
+
_t.set(0, 0, 0);
|
|
5617
5617
|
break;
|
|
5618
5618
|
}
|
|
5619
5619
|
break;
|
|
5620
5620
|
case "rotate":
|
|
5621
5621
|
default:
|
|
5622
|
-
|
|
5622
|
+
_t.set(0, 0, 0);
|
|
5623
5623
|
}
|
|
5624
|
-
|
|
5624
|
+
_t.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (mn.lookAt(nt.set(0, 0, 0), _t, W), this.quaternion.setFromRotationMatrix(mn)), super.updateMatrixWorld(s);
|
|
5625
5625
|
}
|
|
5626
5626
|
}
|
|
5627
5627
|
class Pi {
|
|
@@ -5643,7 +5643,7 @@ class Pi {
|
|
|
5643
5643
|
/**
|
|
5644
5644
|
* The THREE.js Plane object representing the clipping plane.
|
|
5645
5645
|
*/
|
|
5646
|
-
I(this, "three", new
|
|
5646
|
+
I(this, "three", new O.Plane());
|
|
5647
5647
|
/** The components instance to which this plane belongs. */
|
|
5648
5648
|
I(this, "components");
|
|
5649
5649
|
/** The world instance to which this plane belongs. */
|
|
@@ -5654,10 +5654,10 @@ class Pi {
|
|
|
5654
5654
|
I(this, "_visible", !0);
|
|
5655
5655
|
I(this, "_enabled", !0);
|
|
5656
5656
|
I(this, "_controlsActive", !1);
|
|
5657
|
-
I(this, "_arrowBoundBox", new
|
|
5657
|
+
I(this, "_arrowBoundBox", new O.Mesh());
|
|
5658
5658
|
I(this, "_planeMesh");
|
|
5659
5659
|
I(this, "_controls");
|
|
5660
|
-
I(this, "_hiddenMaterial", new
|
|
5660
|
+
I(this, "_hiddenMaterial", new O.MeshBasicMaterial({
|
|
5661
5661
|
visible: !1
|
|
5662
5662
|
}));
|
|
5663
5663
|
/** {@link Updateable.update} */
|
|
@@ -5747,7 +5747,7 @@ class Pi {
|
|
|
5747
5747
|
this._enabled = !1, this.onDraggingStarted.reset(), this.onDraggingEnded.reset(), this._helper.removeFromParent(), this.world.renderer && this.world.renderer.setPlane(!1, this.three), this._arrowBoundBox.removeFromParent(), this._arrowBoundBox.geometry.dispose(), this._planeMesh.geometry.dispose(), this._controls.removeFromParent(), this._controls.dispose(), this.onDisposed.trigger(), this.onDisposed.reset();
|
|
5748
5748
|
}
|
|
5749
5749
|
reset() {
|
|
5750
|
-
const s = new
|
|
5750
|
+
const s = new O.Vector3(1, 0, 0), t = new O.Vector3();
|
|
5751
5751
|
this.normal.equals(s) || (this.normal.copy(s), this._helper.lookAt(s)), this.origin.copy(t), this._helper.position.copy(t), this._helper.updateMatrix();
|
|
5752
5752
|
}
|
|
5753
5753
|
toggleControls(s) {
|
|
@@ -5769,7 +5769,7 @@ class Pi {
|
|
|
5769
5769
|
s.attach(this._helper), s.showX = !1, s.showY = !1, s.setSpace("local"), this.createArrowBoundingBox(), s.children[0].children[0].add(this._arrowBoundBox);
|
|
5770
5770
|
}
|
|
5771
5771
|
createArrowBoundingBox() {
|
|
5772
|
-
this._arrowBoundBox.geometry = new
|
|
5772
|
+
this._arrowBoundBox.geometry = new O.CylinderGeometry(0.18, 0.18, 1.2), this._arrowBoundBox.material = this._hiddenMaterial, this._arrowBoundBox.rotateX(Math.PI / 2), this._arrowBoundBox.updateMatrix(), this._arrowBoundBox.geometry.applyMatrix4(this._arrowBoundBox.matrix);
|
|
5773
5773
|
}
|
|
5774
5774
|
notifyDraggingChanged(s) {
|
|
5775
5775
|
s.value ? this.onDraggingStarted.trigger() : this.onDraggingEnded.trigger();
|
|
@@ -5778,15 +5778,15 @@ class Pi {
|
|
|
5778
5778
|
this.world.camera.enabled = this._visible;
|
|
5779
5779
|
}
|
|
5780
5780
|
newHelper() {
|
|
5781
|
-
const s = new
|
|
5781
|
+
const s = new O.Object3D();
|
|
5782
5782
|
return s.lookAt(this.normal), s.position.copy(this.origin), this._planeMesh.position.z += 0.01, s.add(this._planeMesh), this.world.scene.three.add(s), s;
|
|
5783
5783
|
}
|
|
5784
5784
|
static newPlaneMesh(s, t) {
|
|
5785
|
-
const e = new
|
|
5785
|
+
const e = new O.PlaneGeometry(1), i = new O.Mesh(e, t);
|
|
5786
5786
|
return i.scale.set(s, s, s), i;
|
|
5787
5787
|
}
|
|
5788
5788
|
}
|
|
5789
|
-
const
|
|
5789
|
+
const Be = class Be extends et {
|
|
5790
5790
|
constructor(t) {
|
|
5791
5791
|
super(t);
|
|
5792
5792
|
/** Event that fires when the user starts dragging a clipping plane. */
|
|
@@ -5844,9 +5844,9 @@ const ve = class ve extends et {
|
|
|
5844
5844
|
*/
|
|
5845
5845
|
I(this, "list", []);
|
|
5846
5846
|
/** The material used in all the clipping planes. */
|
|
5847
|
-
I(this, "_material", new
|
|
5847
|
+
I(this, "_material", new O.MeshBasicMaterial({
|
|
5848
5848
|
color: 12255487,
|
|
5849
|
-
side:
|
|
5849
|
+
side: O.DoubleSide,
|
|
5850
5850
|
transparent: !0,
|
|
5851
5851
|
opacity: 0.2
|
|
5852
5852
|
}));
|
|
@@ -5859,7 +5859,7 @@ const ve = class ve extends et {
|
|
|
5859
5859
|
I(this, "_onEndDragging", () => {
|
|
5860
5860
|
this.onAfterDrag.trigger();
|
|
5861
5861
|
});
|
|
5862
|
-
this.components.add(
|
|
5862
|
+
this.components.add(Be.uuid, this);
|
|
5863
5863
|
}
|
|
5864
5864
|
/** {@link Component.enabled} */
|
|
5865
5865
|
get enabled() {
|
|
@@ -5907,11 +5907,11 @@ const ve = class ve extends et {
|
|
|
5907
5907
|
this._enabled = !1;
|
|
5908
5908
|
for (const t of this.list)
|
|
5909
5909
|
t.dispose();
|
|
5910
|
-
this.list.length = 0, this._material.dispose(), this.onBeforeCreate.reset(), this.onBeforeCancel.reset(), this.onBeforeDelete.reset(), this.onBeforeDrag.reset(), this.onAfterCreate.reset(), this.onAfterCancel.reset(), this.onAfterDelete.reset(), this.onAfterDrag.reset(), this.onDisposed.trigger(
|
|
5910
|
+
this.list.length = 0, this._material.dispose(), this.onBeforeCreate.reset(), this.onBeforeCancel.reset(), this.onBeforeDelete.reset(), this.onBeforeDrag.reset(), this.onAfterCreate.reset(), this.onAfterCancel.reset(), this.onAfterDelete.reset(), this.onAfterDrag.reset(), this.onDisposed.trigger(Be.uuid), this.onDisposed.reset();
|
|
5911
5911
|
}
|
|
5912
5912
|
/** {@link Createable.create} */
|
|
5913
5913
|
create(t) {
|
|
5914
|
-
const o = this.components.get(
|
|
5914
|
+
const o = this.components.get(He).get(t).castRay();
|
|
5915
5915
|
return o ? this.createPlaneFromIntersection(t, o) : null;
|
|
5916
5916
|
}
|
|
5917
5917
|
/**
|
|
@@ -5960,7 +5960,7 @@ const ve = class ve extends et {
|
|
|
5960
5960
|
}
|
|
5961
5961
|
}
|
|
5962
5962
|
pickPlane(t) {
|
|
5963
|
-
const i = this.components.get(
|
|
5963
|
+
const i = this.components.get(He).get(t), o = this.getAllPlaneMeshes(), n = i.castRay(o);
|
|
5964
5964
|
if (n) {
|
|
5965
5965
|
const r = n.object;
|
|
5966
5966
|
return this.list.find((a) => a.meshes.includes(r));
|
|
@@ -5976,7 +5976,7 @@ const ve = class ve extends et {
|
|
|
5976
5976
|
var a;
|
|
5977
5977
|
if (!t.renderer)
|
|
5978
5978
|
throw new Error("The given world must have a renderer!");
|
|
5979
|
-
const i = e.point.distanceTo(new
|
|
5979
|
+
const i = e.point.distanceTo(new O.Vector3(0, 0, 0)), o = (a = e.face) == null ? void 0 : a.normal;
|
|
5980
5980
|
if (!i || !o)
|
|
5981
5981
|
return null;
|
|
5982
5982
|
const n = this.getWorldNormal(e, o), r = this.newPlane(t, e.point, n.negate());
|
|
@@ -5985,11 +5985,11 @@ const ve = class ve extends et {
|
|
|
5985
5985
|
getWorldNormal(t, e) {
|
|
5986
5986
|
const i = t.object;
|
|
5987
5987
|
let o = t.object.matrixWorld.clone();
|
|
5988
|
-
if (i instanceof
|
|
5989
|
-
const c = new
|
|
5988
|
+
if (i instanceof O.InstancedMesh && t.instanceId !== void 0) {
|
|
5989
|
+
const c = new O.Matrix4();
|
|
5990
5990
|
i.getMatrixAt(t.instanceId, c), o = c.multiply(o);
|
|
5991
5991
|
}
|
|
5992
|
-
const r = new
|
|
5992
|
+
const r = new O.Matrix3().getNormalMatrix(o), a = e.clone().applyMatrix3(r).normalize();
|
|
5993
5993
|
return this.normalizePlaneDirectionY(a), a;
|
|
5994
5994
|
}
|
|
5995
5995
|
normalizePlaneDirectionY(t) {
|
|
@@ -6026,8 +6026,8 @@ const ve = class ve extends et {
|
|
|
6026
6026
|
* A unique identifier for the component.
|
|
6027
6027
|
* This UUID is used to register the component within the Components system.
|
|
6028
6028
|
*/
|
|
6029
|
-
I(
|
|
6030
|
-
let Rn =
|
|
6029
|
+
I(Be, "uuid", "66290bc5-18c4-4cd1-9379-2e17a0617611");
|
|
6030
|
+
let Rn = Be;
|
|
6031
6031
|
function br(l, s, t, e) {
|
|
6032
6032
|
return new Promise((i, o) => {
|
|
6033
6033
|
function n() {
|
|
@@ -6086,7 +6086,7 @@ class Yr {
|
|
|
6086
6086
|
I(this, "autoUpdate", !0);
|
|
6087
6087
|
I(this, "updateInterval", 1e3);
|
|
6088
6088
|
I(this, "worker");
|
|
6089
|
-
I(this, "scene", new
|
|
6089
|
+
I(this, "scene", new O.Scene());
|
|
6090
6090
|
I(this, "_width", 512);
|
|
6091
6091
|
I(this, "_height", 512);
|
|
6092
6092
|
I(this, "_availableColor", 1);
|
|
@@ -6123,7 +6123,7 @@ class Yr {
|
|
|
6123
6123
|
});
|
|
6124
6124
|
if (!t.renderer)
|
|
6125
6125
|
throw new Error("The given world must have a renderer!");
|
|
6126
|
-
this.components = s, this.applySettings(e), this.world = t, this.renderer = new
|
|
6126
|
+
this.components = s, this.applySettings(e), this.world = t, this.renderer = new O.WebGLRenderer(), this.renderTarget = new O.WebGLRenderTarget(this._width, this._height), this.bufferSize = this._width * this._height * 4, this._buffer = new Uint8Array(this.bufferSize), this.renderer.clippingPlanes = t.renderer.clippingPlanes;
|
|
6127
6127
|
const i = `
|
|
6128
6128
|
addEventListener("message", (event) => {
|
|
6129
6129
|
const { buffer } = event.data;
|
|
@@ -6208,7 +6208,7 @@ class Vr extends Yr {
|
|
|
6208
6208
|
I(this, "_currentVisibleMeshes", /* @__PURE__ */ new Set());
|
|
6209
6209
|
I(this, "_recentlyHiddenMeshes", /* @__PURE__ */ new Set());
|
|
6210
6210
|
I(this, "_intervalID", null);
|
|
6211
|
-
I(this, "_transparentMat", new
|
|
6211
|
+
I(this, "_transparentMat", new O.MeshBasicMaterial({
|
|
6212
6212
|
transparent: !0,
|
|
6213
6213
|
opacity: 0
|
|
6214
6214
|
}));
|
|
@@ -6260,7 +6260,7 @@ class Vr extends Yr {
|
|
|
6260
6260
|
return;
|
|
6261
6261
|
}
|
|
6262
6262
|
this.isProcessing = !0;
|
|
6263
|
-
const e = t instanceof
|
|
6263
|
+
const e = t instanceof O.InstancedMesh, { geometry: i, material: o } = t, { colorMaterial: n, code: r } = this.getAvailableMaterial();
|
|
6264
6264
|
let a;
|
|
6265
6265
|
if (Array.isArray(o)) {
|
|
6266
6266
|
let d = !0;
|
|
@@ -6278,8 +6278,8 @@ class Vr extends Yr {
|
|
|
6278
6278
|
} else
|
|
6279
6279
|
a = n;
|
|
6280
6280
|
this._colorCodeMeshMap.set(r, t), this._meshIDColorCodeMap.set(t.uuid, r);
|
|
6281
|
-
const c = e ? t.count : 1, h = new
|
|
6282
|
-
e ? h.instanceMatrix = t.instanceMatrix : h.setMatrixAt(0, new
|
|
6281
|
+
const c = e ? t.count : 1, h = new O.InstancedMesh(i, a, c);
|
|
6282
|
+
e ? h.instanceMatrix = t.instanceMatrix : h.setMatrixAt(0, new O.Matrix4()), t.visible = !1, t.updateWorldMatrix(!0, !1), h.applyMatrix4(t.matrixWorld), h.updateMatrix(), this.scene.add(h), this.colorMeshes.set(t.uuid, h), this.increaseColor(), this.isProcessing = !1;
|
|
6283
6283
|
}
|
|
6284
6284
|
/**
|
|
6285
6285
|
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
@@ -6303,20 +6303,20 @@ class Vr extends Yr {
|
|
|
6303
6303
|
this._colorCodeMeshMap.delete(o), this._meshIDColorCodeMap.delete(t.uuid), this.colorMeshes.delete(t.uuid), i.geometry = void 0, i.material = [], e.destroy(i, !0), this._recentlyHiddenMeshes.delete(t), this._currentVisibleMeshes.delete(t), this.isProcessing = !1;
|
|
6304
6304
|
}
|
|
6305
6305
|
getAvailableMaterial() {
|
|
6306
|
-
const { r: t, g: e, b: i, code: o } = this.getAvailableColor(), n =
|
|
6307
|
-
|
|
6308
|
-
const r = new
|
|
6306
|
+
const { r: t, g: e, b: i, code: o } = this.getAvailableColor(), n = O.ColorManagement.enabled;
|
|
6307
|
+
O.ColorManagement.enabled = !1;
|
|
6308
|
+
const r = new O.Color(`rgb(${t}, ${e}, ${i})`);
|
|
6309
6309
|
if (!this.world.renderer)
|
|
6310
6310
|
throw new Error("Renderer not found in the world!");
|
|
6311
|
-
const a = this.world.renderer.clippingPlanes, c = new
|
|
6311
|
+
const a = this.world.renderer.clippingPlanes, c = new O.MeshBasicMaterial({
|
|
6312
6312
|
color: r,
|
|
6313
6313
|
clippingPlanes: a,
|
|
6314
|
-
side:
|
|
6314
|
+
side: O.DoubleSide
|
|
6315
6315
|
});
|
|
6316
|
-
return
|
|
6316
|
+
return O.ColorManagement.enabled = n, { colorMaterial: c, code: o };
|
|
6317
6317
|
}
|
|
6318
6318
|
}
|
|
6319
|
-
const
|
|
6319
|
+
const Ye = class Ye extends et {
|
|
6320
6320
|
constructor(t) {
|
|
6321
6321
|
super(t);
|
|
6322
6322
|
/**
|
|
@@ -6328,7 +6328,7 @@ const Be = class Be extends et {
|
|
|
6328
6328
|
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
6329
6329
|
*/
|
|
6330
6330
|
I(this, "list", /* @__PURE__ */ new Map());
|
|
6331
|
-
t.add(
|
|
6331
|
+
t.add(Ye.uuid, this);
|
|
6332
6332
|
}
|
|
6333
6333
|
/** {@link Component.enabled} */
|
|
6334
6334
|
get enabled() {
|
|
@@ -6369,7 +6369,7 @@ const Be = class Be extends et {
|
|
|
6369
6369
|
}
|
|
6370
6370
|
/** {@link Disposable.dispose} */
|
|
6371
6371
|
dispose() {
|
|
6372
|
-
this.enabled = !1, this.onDisposed.trigger(
|
|
6372
|
+
this.enabled = !1, this.onDisposed.trigger(Ye.uuid), this.onDisposed.reset();
|
|
6373
6373
|
for (const [t, e] of this.list)
|
|
6374
6374
|
e.dispose();
|
|
6375
6375
|
this.list.clear();
|
|
@@ -6379,8 +6379,8 @@ const Be = class Be extends et {
|
|
|
6379
6379
|
* A unique identifier for the component.
|
|
6380
6380
|
* This UUID is used to register the component within the Components system.
|
|
6381
6381
|
*/
|
|
6382
|
-
I(
|
|
6383
|
-
let Ti =
|
|
6382
|
+
I(Ye, "uuid", "69f2a50d-c266-44fc-b1bd-fa4d34be89e6");
|
|
6383
|
+
let Ti = Ye;
|
|
6384
6384
|
class Gr {
|
|
6385
6385
|
constructor(s) {
|
|
6386
6386
|
/** {@link Disposable.onDisposed} */
|
|
@@ -6401,12 +6401,12 @@ class Gr {
|
|
|
6401
6401
|
* The override material for the minimap.
|
|
6402
6402
|
* It is used to render the depth information of the world onto the minimap.
|
|
6403
6403
|
*/
|
|
6404
|
-
I(this, "overrideMaterial", new
|
|
6404
|
+
I(this, "overrideMaterial", new O.MeshDepthMaterial());
|
|
6405
6405
|
/**
|
|
6406
6406
|
* The background color of the minimap.
|
|
6407
6407
|
* It is used to set the background color of the minimap's renderer.
|
|
6408
6408
|
*/
|
|
6409
|
-
I(this, "backgroundColor", new
|
|
6409
|
+
I(this, "backgroundColor", new O.Color(395274));
|
|
6410
6410
|
/**
|
|
6411
6411
|
* The WebGL renderer for the minimap.
|
|
6412
6412
|
* It is used to render the minimap onto the screen.
|
|
@@ -6425,11 +6425,11 @@ class Gr {
|
|
|
6425
6425
|
I(this, "_lockRotation", !0);
|
|
6426
6426
|
I(this, "_camera");
|
|
6427
6427
|
I(this, "_plane");
|
|
6428
|
-
I(this, "_size", new
|
|
6429
|
-
I(this, "_tempVector1", new
|
|
6430
|
-
I(this, "_tempVector2", new
|
|
6431
|
-
I(this, "_tempTarget", new
|
|
6432
|
-
I(this, "down", new
|
|
6428
|
+
I(this, "_size", new O.Vector2(320, 160));
|
|
6429
|
+
I(this, "_tempVector1", new O.Vector3());
|
|
6430
|
+
I(this, "_tempVector2", new O.Vector3());
|
|
6431
|
+
I(this, "_tempTarget", new O.Vector3());
|
|
6432
|
+
I(this, "down", new O.Vector3(0, -1, 0));
|
|
6433
6433
|
I(this, "updatePlanes", () => {
|
|
6434
6434
|
if (!this.world.renderer)
|
|
6435
6435
|
throw new Error("The given world must have a renderer!");
|
|
@@ -6440,14 +6440,14 @@ class Gr {
|
|
|
6440
6440
|
});
|
|
6441
6441
|
if (this.world = s, !this.world.renderer)
|
|
6442
6442
|
throw new Error("The given world must have a renderer!");
|
|
6443
|
-
this.renderer = new
|
|
6443
|
+
this.renderer = new O.WebGLRenderer(), this.renderer.setSize(this._size.x, this._size.y);
|
|
6444
6444
|
const t = 1, e = this._size.x / this._size.y;
|
|
6445
|
-
this._camera = new
|
|
6445
|
+
this._camera = new O.OrthographicCamera(
|
|
6446
6446
|
t * e / -2,
|
|
6447
6447
|
t * e / 2,
|
|
6448
6448
|
t / 2,
|
|
6449
6449
|
t / -2
|
|
6450
|
-
), this.world.renderer.onClippingPlanesUpdated.add(this.updatePlanes), this._camera.position.set(0, 200, 0), this._camera.zoom = 0.1, this._camera.rotation.x = -Math.PI / 2, this._plane = new
|
|
6450
|
+
), this.world.renderer.onClippingPlanesUpdated.add(this.updatePlanes), this._camera.position.set(0, 200, 0), this._camera.zoom = 0.1, this._camera.rotation.x = -Math.PI / 2, this._plane = new O.Plane(this.down, 200), this.updatePlanes();
|
|
6451
6451
|
}
|
|
6452
6452
|
/**
|
|
6453
6453
|
* Gets or sets whether the minimap rotation is locked.
|
|
@@ -6496,7 +6496,7 @@ class Gr {
|
|
|
6496
6496
|
const s = this.world.scene.three, t = this.world.camera;
|
|
6497
6497
|
if (!t.hasCameraControls())
|
|
6498
6498
|
throw new Error("The given world must use camera controls!");
|
|
6499
|
-
if (!(s instanceof
|
|
6499
|
+
if (!(s instanceof O.Scene))
|
|
6500
6500
|
throw new Error("The given world must have a THREE.Scene as a root!");
|
|
6501
6501
|
const e = t.controls;
|
|
6502
6502
|
if (e.getPosition(this._tempVector1), this._camera.position.x = this._tempVector1.x, this._camera.position.z = this._tempVector1.z, this.frontOffset !== 0 && (e.getTarget(this._tempVector2), this._tempVector2.sub(this._tempVector1), this._tempVector2.normalize().multiplyScalar(this.frontOffset), this._camera.position.x += this._tempVector2.x, this._camera.position.z += this._tempVector2.z), !this._lockRotation) {
|
|
@@ -6522,7 +6522,7 @@ class Gr {
|
|
|
6522
6522
|
this._camera.left = e * t / -2, this._camera.right = e * t / 2, this._camera.top = e / 2, this._camera.bottom = -e / 2, this._camera.updateProjectionMatrix(), this.onResize.trigger(s);
|
|
6523
6523
|
}
|
|
6524
6524
|
}
|
|
6525
|
-
const
|
|
6525
|
+
const _s = class _s extends et {
|
|
6526
6526
|
constructor(t) {
|
|
6527
6527
|
super(t);
|
|
6528
6528
|
/** {@link Updateable.onAfterUpdate} */
|
|
@@ -6537,7 +6537,7 @@ const Ss = class Ss extends et {
|
|
|
6537
6537
|
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
6538
6538
|
*/
|
|
6539
6539
|
I(this, "list", /* @__PURE__ */ new Map());
|
|
6540
|
-
this.components.add(
|
|
6540
|
+
this.components.add(_s.uuid, this);
|
|
6541
6541
|
}
|
|
6542
6542
|
/**
|
|
6543
6543
|
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
@@ -6580,8 +6580,8 @@ const Ss = class Ss extends et {
|
|
|
6580
6580
|
* A unique identifier for the component.
|
|
6581
6581
|
* This UUID is used to register the component within the Components system.
|
|
6582
6582
|
*/
|
|
6583
|
-
I(
|
|
6584
|
-
let An =
|
|
6583
|
+
I(_s, "uuid", "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");
|
|
6584
|
+
let An = _s;
|
|
6585
6585
|
class zr {
|
|
6586
6586
|
constructor(s) {
|
|
6587
6587
|
/** {@link NavigationMode.enabled} */
|
|
@@ -6601,7 +6601,7 @@ class zr {
|
|
|
6601
6601
|
}
|
|
6602
6602
|
}
|
|
6603
6603
|
setupFirstPersonCamera() {
|
|
6604
|
-
const s = this.camera.controls, t = new
|
|
6604
|
+
const s = this.camera.controls, t = new O.Vector3();
|
|
6605
6605
|
s.distance--, s.getPosition(t), s.minDistance = 1, s.maxDistance = 1, s.distance = 1, s.moveTo(
|
|
6606
6606
|
t.x,
|
|
6607
6607
|
t.y,
|
|
@@ -6624,11 +6624,11 @@ class Hr {
|
|
|
6624
6624
|
activateOrbitControls() {
|
|
6625
6625
|
const s = this.camera.controls;
|
|
6626
6626
|
s.minDistance = 1, s.maxDistance = 300;
|
|
6627
|
-
const t = new
|
|
6627
|
+
const t = new O.Vector3();
|
|
6628
6628
|
s.getPosition(t);
|
|
6629
6629
|
const e = t.length();
|
|
6630
6630
|
s.distance = e, s.truckSpeed = 2;
|
|
6631
|
-
const { rotation: i } = this.camera.three, o = new
|
|
6631
|
+
const { rotation: i } = this.camera.three, o = new O.Vector3(0, 0, -1).applyEuler(i), n = t.addScaledVector(o, e);
|
|
6632
6632
|
s.moveTo(n.x, n.y, n.z);
|
|
6633
6633
|
}
|
|
6634
6634
|
}
|
|
@@ -6705,9 +6705,9 @@ class Wr {
|
|
|
6705
6705
|
const s = this._component.currentWorld;
|
|
6706
6706
|
if (!s || !s.renderer)
|
|
6707
6707
|
return null;
|
|
6708
|
-
const t = new
|
|
6708
|
+
const t = new O.Vector3();
|
|
6709
6709
|
this._component.threePersp.getWorldDirection(t);
|
|
6710
|
-
const e = new
|
|
6710
|
+
const e = new O.Vector3();
|
|
6711
6711
|
this._component.controls.getTarget(e);
|
|
6712
6712
|
const o = e.clone().sub(this._component.threePersp.position).dot(t), n = s.renderer.getSize(), r = n.x / n.y, a = this._component.threePersp, c = o * 2 * Math.atan(a.fov * (Math.PI / 180) / 2);
|
|
6713
6713
|
return { width: c * r, height: c };
|
|
@@ -6727,7 +6727,7 @@ class Wr {
|
|
|
6727
6727
|
s.position.copy(t.position), s.quaternion.copy(t.quaternion), this._component.controls.mouseButtons.wheel = ot.ACTION.DOLLY, this.matchOrthoDistanceEnabled ? this._component.controls.distance = this.getDistance() : this._component.controls.distance = this._previousDistance, await this._component.controls.zoomTo(1), s.updateProjectionMatrix(), this._component.controls.camera = s, this.camera = s, this.current = "Perspective";
|
|
6728
6728
|
}
|
|
6729
6729
|
}
|
|
6730
|
-
class na extends
|
|
6730
|
+
class na extends ke {
|
|
6731
6731
|
constructor(t) {
|
|
6732
6732
|
super(t);
|
|
6733
6733
|
/**
|
|
@@ -6798,16 +6798,16 @@ class na extends He {
|
|
|
6798
6798
|
async fit(t, e = 1.5) {
|
|
6799
6799
|
if (!this.enabled)
|
|
6800
6800
|
return;
|
|
6801
|
-
const i = Number.MAX_VALUE, o = Number.MIN_VALUE, n = new
|
|
6801
|
+
const i = Number.MAX_VALUE, o = Number.MIN_VALUE, n = new O.Vector3(i, i, i), r = new O.Vector3(o, o, o);
|
|
6802
6802
|
for (const u of t) {
|
|
6803
|
-
const f = new
|
|
6803
|
+
const f = new O.Box3().setFromObject(u);
|
|
6804
6804
|
f.min.x < n.x && (n.x = f.min.x), f.min.y < n.y && (n.y = f.min.y), f.min.z < n.z && (n.z = f.min.z), f.max.x > r.x && (r.x = f.max.x), f.max.y > r.y && (r.y = f.max.y), f.max.z > r.z && (r.z = f.max.z);
|
|
6805
6805
|
}
|
|
6806
|
-
const a = new
|
|
6806
|
+
const a = new O.Box3(n, r), c = new O.Vector3();
|
|
6807
6807
|
a.getSize(c);
|
|
6808
|
-
const h = new
|
|
6808
|
+
const h = new O.Vector3();
|
|
6809
6809
|
a.getCenter(h);
|
|
6810
|
-
const d = Math.max(c.x, c.y, c.z) * e, E = new
|
|
6810
|
+
const d = Math.max(c.x, c.y, c.z) * e, E = new O.Sphere(h, d);
|
|
6811
6811
|
await this.controls.fitToSphere(E, !0);
|
|
6812
6812
|
}
|
|
6813
6813
|
/**
|
|
@@ -6826,7 +6826,7 @@ class na extends He {
|
|
|
6826
6826
|
}
|
|
6827
6827
|
newOrthoCamera() {
|
|
6828
6828
|
const t = window.innerWidth / window.innerHeight;
|
|
6829
|
-
return new
|
|
6829
|
+
return new O.OrthographicCamera(
|
|
6830
6830
|
this._frustumSize * t / -2,
|
|
6831
6831
|
this._frustumSize * t / 2,
|
|
6832
6832
|
this._frustumSize / 2,
|
|
@@ -6899,7 +6899,7 @@ const Xr = /* @__PURE__ */ new Map([
|
|
|
6899
6899
|
forRelating: "ContainsElements"
|
|
6900
6900
|
}
|
|
6901
6901
|
]
|
|
6902
|
-
]),
|
|
6902
|
+
]), Ve = class Ve extends et {
|
|
6903
6903
|
constructor(t) {
|
|
6904
6904
|
super(t);
|
|
6905
6905
|
/** {@link Disposable.onDisposed} */
|
|
@@ -6954,7 +6954,7 @@ const Xr = /* @__PURE__ */ new Map([
|
|
|
6954
6954
|
I(this, "onFragmentsDisposed", (t) => {
|
|
6955
6955
|
delete this.relationMaps[t.groupID];
|
|
6956
6956
|
});
|
|
6957
|
-
this.components.add(
|
|
6957
|
+
this.components.add(Ve.uuid, this), t.get(ht).onFragmentsDisposed.add(this.onFragmentsDisposed);
|
|
6958
6958
|
}
|
|
6959
6959
|
indexRelations(t, e, i, o) {
|
|
6960
6960
|
const n = Object.keys(e).find(
|
|
@@ -6964,13 +6964,20 @@ const Xr = /* @__PURE__ */ new Map([
|
|
|
6964
6964
|
);
|
|
6965
6965
|
if (!(n && r))
|
|
6966
6966
|
return;
|
|
6967
|
-
const a = e[n].value, c = e[r].map((E) => E.value), h = t.get(a) ?? /* @__PURE__ */ new Map(), d = this.
|
|
6968
|
-
h.set(d, c), t.set(a, h);
|
|
6967
|
+
const a = e[n].value, c = e[r].map((E) => E.value), h = t.get(a) ?? /* @__PURE__ */ new Map(), d = this.getAttributeIndex(o);
|
|
6968
|
+
d && (h.set(d, c), t.set(a, h));
|
|
6969
6969
|
for (const E of c) {
|
|
6970
|
-
const u = t.get(E) ?? /* @__PURE__ */ new Map(), f = this.
|
|
6970
|
+
const u = t.get(E) ?? /* @__PURE__ */ new Map(), f = this.getAttributeIndex(i);
|
|
6971
|
+
if (!f)
|
|
6972
|
+
continue;
|
|
6973
|
+
const R = u.get(f) ?? [];
|
|
6971
6974
|
R.push(a), u.set(f, R), t.set(E, u);
|
|
6972
6975
|
}
|
|
6973
6976
|
}
|
|
6977
|
+
getAttributeIndex(t) {
|
|
6978
|
+
const e = this._inverseAttributes.indexOf(t);
|
|
6979
|
+
return e === -1 ? null : e;
|
|
6980
|
+
}
|
|
6974
6981
|
/**
|
|
6975
6982
|
* Adds a relation map to the model's relations map.
|
|
6976
6983
|
*
|
|
@@ -7065,9 +7072,11 @@ const Xr = /* @__PURE__ */ new Map([
|
|
|
7065
7072
|
getEntityRelations(t, e, i) {
|
|
7066
7073
|
const o = this.relationMaps[t.uuid];
|
|
7067
7074
|
if (!o)
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7075
|
+
throw new Error(
|
|
7076
|
+
`IfcRelationsIndexer: model ${t.uuid} has no relations indexed.`
|
|
7077
|
+
);
|
|
7078
|
+
const n = o.get(e), r = this.getAttributeIndex(i);
|
|
7079
|
+
if (!(n && r))
|
|
7071
7080
|
return null;
|
|
7072
7081
|
const a = n.get(r);
|
|
7073
7082
|
return a || null;
|
|
@@ -7152,30 +7161,62 @@ const Xr = /* @__PURE__ */ new Map([
|
|
|
7152
7161
|
}
|
|
7153
7162
|
/** {@link Disposable.dispose} */
|
|
7154
7163
|
dispose() {
|
|
7155
|
-
this.relationMaps = {}, this.components.get(ht).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(
|
|
7164
|
+
this.relationMaps = {}, this.components.get(ht).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(Ve.uuid), this.onDisposed.reset();
|
|
7165
|
+
}
|
|
7166
|
+
/**
|
|
7167
|
+
* Adds relations between an entity and other entities in a BIM model.
|
|
7168
|
+
*
|
|
7169
|
+
* @param model - The BIM model to which the relations will be added.
|
|
7170
|
+
* @param expressID - The expressID of the entity within the model.
|
|
7171
|
+
* @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
|
|
7172
|
+
* @param relIDs - The expressIDs of the related entities within the model.
|
|
7173
|
+
*
|
|
7174
|
+
* @throws An error if the relation name is not a valid relation name.
|
|
7175
|
+
*/
|
|
7176
|
+
addEntityRelations(t, e, i, ...o) {
|
|
7177
|
+
const n = this.getEntityRelations(
|
|
7178
|
+
t,
|
|
7179
|
+
e,
|
|
7180
|
+
i
|
|
7181
|
+
);
|
|
7182
|
+
if (n)
|
|
7183
|
+
n.push(...o);
|
|
7184
|
+
else {
|
|
7185
|
+
const r = this.getAttributeIndex(i);
|
|
7186
|
+
if (!r)
|
|
7187
|
+
throw new Error(
|
|
7188
|
+
`IfcRelationsIndexer: ${i} is not a valid relation name.`
|
|
7189
|
+
);
|
|
7190
|
+
const a = this.relationMaps[t.uuid].get(e);
|
|
7191
|
+
a == null || a.set(r, o);
|
|
7192
|
+
}
|
|
7156
7193
|
}
|
|
7157
7194
|
/**
|
|
7158
7195
|
* Gets the children of the given element recursively. E.g. in a model with project - site - building - storeys - rooms, passing a storey will include all its children and the children of the rooms contained in it.
|
|
7159
7196
|
*
|
|
7160
7197
|
* @param model The BIM model whose children to get.
|
|
7161
|
-
* @param
|
|
7198
|
+
* @param expressID The expressID of the item whose children to get.
|
|
7162
7199
|
* @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
|
|
7163
7200
|
*
|
|
7164
7201
|
* @returns A `Set` with the expressIDs of the found items.
|
|
7165
7202
|
*/
|
|
7166
|
-
|
|
7203
|
+
getEntityChildren(t, e, i = /* @__PURE__ */ new Set()) {
|
|
7167
7204
|
if (i.add(e), this.relationMaps[t.uuid] === void 0)
|
|
7168
7205
|
throw new Error(
|
|
7169
7206
|
"The provided model has no indices. You have to generate them first."
|
|
7170
7207
|
);
|
|
7171
|
-
const n = this.getEntityRelations(
|
|
7208
|
+
const n = this.getEntityRelations(
|
|
7209
|
+
t,
|
|
7210
|
+
e,
|
|
7211
|
+
"IsDecomposedBy"
|
|
7212
|
+
);
|
|
7172
7213
|
if (n)
|
|
7173
7214
|
for (const a of n)
|
|
7174
|
-
this.
|
|
7215
|
+
this.getEntityChildren(t, a, i);
|
|
7175
7216
|
const r = this.getEntityRelations(t, e, "ContainsElements");
|
|
7176
7217
|
if (r)
|
|
7177
7218
|
for (const a of r)
|
|
7178
|
-
this.
|
|
7219
|
+
this.getEntityChildren(t, a, i);
|
|
7179
7220
|
return i;
|
|
7180
7221
|
}
|
|
7181
7222
|
};
|
|
@@ -7183,8 +7224,8 @@ const Xr = /* @__PURE__ */ new Map([
|
|
|
7183
7224
|
* A unique identifier for the component.
|
|
7184
7225
|
* This UUID is used to register the component within the Components system.
|
|
7185
7226
|
*/
|
|
7186
|
-
I(
|
|
7187
|
-
let
|
|
7227
|
+
I(Ve, "uuid", "23a889ab-83b3-44a4-8bee-ead83438370b");
|
|
7228
|
+
let pe = Ve;
|
|
7188
7229
|
const Ns = class Ns extends et {
|
|
7189
7230
|
constructor(t) {
|
|
7190
7231
|
super(t);
|
|
@@ -7209,7 +7250,7 @@ const Ns = class Ns extends et {
|
|
|
7209
7250
|
*/
|
|
7210
7251
|
I(this, "groups", /* @__PURE__ */ new Map());
|
|
7211
7252
|
I(this, "baseCoordinationModel", "");
|
|
7212
|
-
I(this, "baseCoordinationMatrix", new
|
|
7253
|
+
I(this, "baseCoordinationMatrix", new O.Matrix4());
|
|
7213
7254
|
/** {@link Component.enabled} */
|
|
7214
7255
|
I(this, "enabled", !0);
|
|
7215
7256
|
I(this, "_loader", new to());
|
|
@@ -7261,7 +7302,7 @@ const Ns = class Ns extends et {
|
|
|
7261
7302
|
r && (h.name = r);
|
|
7262
7303
|
for (const d of h.items)
|
|
7263
7304
|
d.group = h, this.list.set(d.id, d);
|
|
7264
|
-
return n && this.coordinate([h]), this.groups.set(h.uuid, h), a && h.setLocalProperties(a), c && this.components.get(
|
|
7305
|
+
return n && this.coordinate([h]), this.groups.set(h.uuid, h), a && h.setLocalProperties(a), c && this.components.get(pe).setRelationMap(h, c), this.onFragmentsLoaded.trigger(h), h;
|
|
7265
7306
|
}
|
|
7266
7307
|
/**
|
|
7267
7308
|
* Export the specified fragmentsgroup to binary data.
|
|
@@ -7329,7 +7370,24 @@ const Ns = class Ns extends et {
|
|
|
7329
7370
|
}
|
|
7330
7371
|
if (t.length)
|
|
7331
7372
|
for (const i of t)
|
|
7332
|
-
i.coordinationMatrix.equals(this.baseCoordinationMatrix) || (i.position.set(0, 0, 0), i.rotation.set(0, 0, 0), i.scale.set(1, 1, 1), i.updateMatrix(),
|
|
7373
|
+
i.coordinationMatrix.equals(this.baseCoordinationMatrix) || (i.position.set(0, 0, 0), i.rotation.set(0, 0, 0), i.scale.set(1, 1, 1), i.updateMatrix(), this.applyBaseCoordinateSystem(i, i.coordinationMatrix));
|
|
7374
|
+
}
|
|
7375
|
+
/**
|
|
7376
|
+
* Applies the base coordinate system to the provided object.
|
|
7377
|
+
*
|
|
7378
|
+
* This function takes an object and its original coordinate system as input.
|
|
7379
|
+
* It then inverts the original coordinate system and applies the base coordinate system
|
|
7380
|
+
* to the object. This ensures that the object's position, rotation, and scale are
|
|
7381
|
+
* transformed to match the base coordinate system (which is taken from the first model loaded).
|
|
7382
|
+
*
|
|
7383
|
+
* @param object - The object to which the base coordinate system will be applied.
|
|
7384
|
+
* This should be an instance of THREE.Object3D.
|
|
7385
|
+
*
|
|
7386
|
+
* @param originalCoordinateSystem - The original coordinate system of the object.
|
|
7387
|
+
* This should be a THREE.Matrix4 representing the object's transformation matrix.
|
|
7388
|
+
*/
|
|
7389
|
+
applyBaseCoordinateSystem(t, e) {
|
|
7390
|
+
t.applyMatrix4(e.clone().invert()), t.applyMatrix4(this.baseCoordinationMatrix);
|
|
7333
7391
|
}
|
|
7334
7392
|
};
|
|
7335
7393
|
/**
|
|
@@ -7357,7 +7415,7 @@ const At = class At extends et {
|
|
|
7357
7415
|
* @returns An object containing the width, height, depth, and center of the bounding box.
|
|
7358
7416
|
*/
|
|
7359
7417
|
static getDimensions(t) {
|
|
7360
|
-
const { min: e, max: i } = t, o = Math.abs(i.x - e.x), n = Math.abs(i.y - e.y), r = Math.abs(i.z - e.z), a = new
|
|
7418
|
+
const { min: e, max: i } = t, o = Math.abs(i.x - e.x), n = Math.abs(i.y - e.y), r = Math.abs(i.z - e.z), a = new O.Vector3();
|
|
7361
7419
|
return a.subVectors(i, e).divideScalar(2).add(e), { width: o, height: n, depth: r, center: a };
|
|
7362
7420
|
}
|
|
7363
7421
|
/**
|
|
@@ -7382,7 +7440,7 @@ const At = class At extends et {
|
|
|
7382
7440
|
*/
|
|
7383
7441
|
static newBound(t) {
|
|
7384
7442
|
const e = t ? 1 : -1;
|
|
7385
|
-
return new
|
|
7443
|
+
return new O.Vector3(
|
|
7386
7444
|
e * Number.MAX_VALUE,
|
|
7387
7445
|
e * Number.MAX_VALUE,
|
|
7388
7446
|
e * Number.MAX_VALUE
|
|
@@ -7416,7 +7474,7 @@ const At = class At extends et {
|
|
|
7416
7474
|
const o = i || this.newBound(!1), n = e || this.newBound(!0);
|
|
7417
7475
|
for (const r of t)
|
|
7418
7476
|
r.x < n.x && (n.x = r.x), r.y < n.y && (n.y = r.y), r.z < n.z && (n.z = r.z), r.x > o.x && (o.x = r.x), r.y > o.y && (o.y = r.y), r.z > o.z && (o.z = r.z);
|
|
7419
|
-
return new
|
|
7477
|
+
return new O.Box3(e, i);
|
|
7420
7478
|
}
|
|
7421
7479
|
/** {@link Disposable.dispose} */
|
|
7422
7480
|
dispose() {
|
|
@@ -7442,7 +7500,7 @@ const At = class At extends et {
|
|
|
7442
7500
|
*/
|
|
7443
7501
|
get() {
|
|
7444
7502
|
const t = this._absoluteMin.clone(), e = this._absoluteMax.clone();
|
|
7445
|
-
return new
|
|
7503
|
+
return new O.Box3(t, e);
|
|
7446
7504
|
}
|
|
7447
7505
|
/**
|
|
7448
7506
|
* Calculates and returns a sphere that encompasses the entire bounding box.
|
|
@@ -7463,8 +7521,8 @@ const At = class At extends et {
|
|
|
7463
7521
|
* ```
|
|
7464
7522
|
*/
|
|
7465
7523
|
getSphere() {
|
|
7466
|
-
const t = this._absoluteMin.clone(), e = this._absoluteMax.clone(), i = Math.abs((e.x - t.x) / 2), o = Math.abs((e.y - t.y) / 2), n = Math.abs((e.z - t.z) / 2), r = new
|
|
7467
|
-
return new
|
|
7524
|
+
const t = this._absoluteMin.clone(), e = this._absoluteMax.clone(), i = Math.abs((e.x - t.x) / 2), o = Math.abs((e.y - t.y) / 2), n = Math.abs((e.z - t.z) / 2), r = new O.Vector3(t.x + i, t.y + o, t.z + n), a = r.distanceTo(t);
|
|
7525
|
+
return new O.Sphere(r, a);
|
|
7468
7526
|
}
|
|
7469
7527
|
/**
|
|
7470
7528
|
* Returns a THREE.Mesh instance representing the bounding box.
|
|
@@ -7486,7 +7544,7 @@ const At = class At extends et {
|
|
|
7486
7544
|
* ```
|
|
7487
7545
|
*/
|
|
7488
7546
|
getMesh() {
|
|
7489
|
-
const t = new
|
|
7547
|
+
const t = new O.Box3(this._absoluteMin, this._absoluteMax), e = At.getDimensions(t), { width: i, height: o, depth: n, center: r } = e, a = new O.BoxGeometry(i, o, n), c = new O.Mesh(a);
|
|
7490
7548
|
return this._meshes.push(c), c.position.copy(r), c;
|
|
7491
7549
|
}
|
|
7492
7550
|
/**
|
|
@@ -7549,7 +7607,7 @@ const At = class At extends et {
|
|
|
7549
7607
|
return;
|
|
7550
7608
|
const i = At.getFragmentBounds(t);
|
|
7551
7609
|
t.updateMatrixWorld();
|
|
7552
|
-
const o = t.matrixWorld, n = new
|
|
7610
|
+
const o = t.matrixWorld, n = new O.Matrix4(), r = t instanceof O.InstancedMesh, a = /* @__PURE__ */ new Set();
|
|
7553
7611
|
if (e && t instanceof Vt.FragmentMesh)
|
|
7554
7612
|
for (const c of e) {
|
|
7555
7613
|
const h = t.fragment.getInstancesIDs(c);
|
|
@@ -7597,7 +7655,7 @@ const At = class At extends et {
|
|
|
7597
7655
|
}
|
|
7598
7656
|
}
|
|
7599
7657
|
static getFragmentBounds(t) {
|
|
7600
|
-
const e = t.geometry.attributes.position, i = Number.MAX_VALUE, o = -i, n = new
|
|
7658
|
+
const e = t.geometry.attributes.position, i = Number.MAX_VALUE, o = -i, n = new O.Vector3(i, i, i), r = new O.Vector3(o, o, o);
|
|
7601
7659
|
if (!t.geometry.index)
|
|
7602
7660
|
throw new Error("Geometry must be indexed!");
|
|
7603
7661
|
const a = Array.from(t.geometry.index.array);
|
|
@@ -7609,7 +7667,7 @@ const At = class At extends et {
|
|
|
7609
7667
|
const h = a[c], d = e.getX(h), E = e.getY(h), u = e.getZ(h);
|
|
7610
7668
|
d < n.x && (n.x = d), E < n.y && (n.y = E), u < n.z && (n.z = u), d > r.x && (r.x = d), E > r.y && (r.y = E), u > r.z && (r.z = u);
|
|
7611
7669
|
}
|
|
7612
|
-
return new
|
|
7670
|
+
return new O.Box3(n, r);
|
|
7613
7671
|
}
|
|
7614
7672
|
};
|
|
7615
7673
|
I(At, "uuid", "d1444724-dba6-4cdd-a0c7-68ee1450d166");
|
|
@@ -9255,7 +9313,7 @@ class Qr {
|
|
|
9255
9313
|
}
|
|
9256
9314
|
getScaleMatrix() {
|
|
9257
9315
|
const s = this.factor;
|
|
9258
|
-
return new
|
|
9316
|
+
return new O.Matrix4().fromArray([
|
|
9259
9317
|
s,
|
|
9260
9318
|
0,
|
|
9261
9319
|
0,
|
|
@@ -9345,7 +9403,7 @@ class Yn {
|
|
|
9345
9403
|
this.itemsByFloor = {};
|
|
9346
9404
|
}
|
|
9347
9405
|
}
|
|
9348
|
-
class
|
|
9406
|
+
class yi {
|
|
9349
9407
|
constructor() {
|
|
9350
9408
|
/** Whether to extract the IFC properties into a JSON. */
|
|
9351
9409
|
I(this, "includeProperties", !0);
|
|
@@ -9391,7 +9449,7 @@ class Li {
|
|
|
9391
9449
|
}
|
|
9392
9450
|
class Vn {
|
|
9393
9451
|
constructor() {
|
|
9394
|
-
I(this, "defLineMat", new
|
|
9452
|
+
I(this, "defLineMat", new O.LineBasicMaterial({ color: 16777215 }));
|
|
9395
9453
|
}
|
|
9396
9454
|
read(s) {
|
|
9397
9455
|
const t = s.GetAllAlignments(0), e = s.GetAllCrossSections2D(0), i = s.GetAllCrossSections3D(0), o = {
|
|
@@ -9408,7 +9466,7 @@ class Vn {
|
|
|
9408
9466
|
const i = new Vt.Alignment();
|
|
9409
9467
|
i.absolute = this.getCurves(e.curve3D, i), i.horizontal = this.getCurves(e.horizontal, i), i.vertical = this.getCurves(e.vertical, i), t.set(t.size, i);
|
|
9410
9468
|
}
|
|
9411
|
-
return { alignments: t, coordinationMatrix: new
|
|
9469
|
+
return { alignments: t, coordinationMatrix: new O.Matrix4() };
|
|
9412
9470
|
}
|
|
9413
9471
|
}
|
|
9414
9472
|
getCurves(s, t) {
|
|
@@ -9426,7 +9484,7 @@ class Vn {
|
|
|
9426
9484
|
const { x: u, y: f, z: R } = r[E];
|
|
9427
9485
|
a[E * 3] = u, a[E * 3 + 1] = f, a[E * 3 + 2] = R || 0;
|
|
9428
9486
|
}
|
|
9429
|
-
const c = new
|
|
9487
|
+
const c = new O.BufferAttribute(a, 3), h = new O.EdgesGeometry();
|
|
9430
9488
|
h.setAttribute("position", c);
|
|
9431
9489
|
const d = new Vt.CurveMesh(
|
|
9432
9490
|
i,
|
|
@@ -9475,7 +9533,7 @@ class Gn {
|
|
|
9475
9533
|
return o != null && o.value && (t.implementationLevel = o.value), t;
|
|
9476
9534
|
}
|
|
9477
9535
|
}
|
|
9478
|
-
const
|
|
9536
|
+
const Ge = class Ge extends et {
|
|
9479
9537
|
constructor(t) {
|
|
9480
9538
|
super(t);
|
|
9481
9539
|
/** {@link Disposable.onDisposed} */
|
|
@@ -9492,28 +9550,28 @@ const Ve = class Ve extends et {
|
|
|
9492
9550
|
* The settings for the IfcLoader.
|
|
9493
9551
|
* It includes options for excluding categories, setting WASM paths, and more.
|
|
9494
9552
|
*/
|
|
9495
|
-
I(this, "settings", new
|
|
9553
|
+
I(this, "settings", new yi());
|
|
9496
9554
|
/**
|
|
9497
9555
|
* The instance of the Web-IFC library used for handling IFC data.
|
|
9498
9556
|
*/
|
|
9499
9557
|
I(this, "webIfc", new b.IfcAPI());
|
|
9500
9558
|
/** {@link Component.enabled} */
|
|
9501
9559
|
I(this, "enabled", !0);
|
|
9502
|
-
I(this, "_material", new
|
|
9560
|
+
I(this, "_material", new O.MeshLambertMaterial());
|
|
9503
9561
|
I(this, "_spatialTree", new Yn());
|
|
9504
9562
|
I(this, "_metaData", new Gn());
|
|
9505
9563
|
I(this, "_fragmentInstances", /* @__PURE__ */ new Map());
|
|
9506
9564
|
I(this, "_civil", new Vn());
|
|
9507
9565
|
I(this, "_visitedFragments", /* @__PURE__ */ new Map());
|
|
9508
|
-
I(this, "_materialT", new
|
|
9566
|
+
I(this, "_materialT", new O.MeshLambertMaterial({
|
|
9509
9567
|
transparent: !0,
|
|
9510
9568
|
opacity: 0.5
|
|
9511
9569
|
}));
|
|
9512
|
-
this.components.add(
|
|
9570
|
+
this.components.add(Ge.uuid, this), this.settings.excludedCategories.add(b.IFCOPENINGELEMENT);
|
|
9513
9571
|
}
|
|
9514
9572
|
/** {@link Disposable.dispose} */
|
|
9515
9573
|
dispose() {
|
|
9516
|
-
this.webIfc.Dispose(), this.webIfc = null, this.onDisposed.trigger(
|
|
9574
|
+
this.webIfc.Dispose(), this.webIfc = null, this.onDisposed.trigger(Ge.uuid), this.onDisposed.reset();
|
|
9517
9575
|
}
|
|
9518
9576
|
/**
|
|
9519
9577
|
* Sets up the IfcLoader component with the provided configuration.
|
|
@@ -9653,12 +9711,12 @@ const Ve = class Ve extends et {
|
|
|
9653
9711
|
for (let n = 0; n < i; n++) {
|
|
9654
9712
|
const r = t.geometries.get(n), { x: a, y: c, z: h, w: d } = r.color, E = d !== 1, { geometryExpressID: u } = r, f = `${u}-${E}`;
|
|
9655
9713
|
if (!this._visitedFragments.has(f)) {
|
|
9656
|
-
const T = this.getGeometry(this.webIfc, u),
|
|
9657
|
-
e.add(
|
|
9658
|
-
const
|
|
9659
|
-
this._visitedFragments.set(f, { index:
|
|
9714
|
+
const T = this.getGeometry(this.webIfc, u), g = E ? this._materialT : this._material, S = new Vt.Fragment(T, g, 1);
|
|
9715
|
+
e.add(S.mesh), e.items.push(S);
|
|
9716
|
+
const _ = this._visitedFragments.size;
|
|
9717
|
+
this._visitedFragments.set(f, { index: _, fragment: S });
|
|
9660
9718
|
}
|
|
9661
|
-
const R = new
|
|
9719
|
+
const R = new O.Color().setRGB(a, c, h, "srgb"), m = new O.Matrix4();
|
|
9662
9720
|
m.fromArray(r.flatTransformation);
|
|
9663
9721
|
const C = this._visitedFragments.get(f);
|
|
9664
9722
|
if (C === void 0)
|
|
@@ -9691,7 +9749,7 @@ const Ve = class Ve extends et {
|
|
|
9691
9749
|
), r = new Float32Array(n.length / 2), a = new Float32Array(n.length / 2);
|
|
9692
9750
|
for (let E = 0; E < n.length; E += 6)
|
|
9693
9751
|
r[E / 2] = n[E], r[E / 2 + 1] = n[E + 1], r[E / 2 + 2] = n[E + 2], a[E / 2] = n[E + 3], a[E / 2 + 1] = n[E + 4], a[E / 2 + 2] = n[E + 5];
|
|
9694
|
-
const c = new
|
|
9752
|
+
const c = new O.BufferGeometry(), h = new O.BufferAttribute(r, 3), d = new O.BufferAttribute(a, 3);
|
|
9695
9753
|
return c.setAttribute("position", h), c.setAttribute("normal", d), c.setIndex(Array.from(o)), i.delete(), c;
|
|
9696
9754
|
}
|
|
9697
9755
|
async autoSetWasm() {
|
|
@@ -9719,8 +9777,8 @@ const Ve = class Ve extends et {
|
|
|
9719
9777
|
* A unique identifier for the component.
|
|
9720
9778
|
* This UUID is used to register the component within the Components system.
|
|
9721
9779
|
*/
|
|
9722
|
-
I(
|
|
9723
|
-
let Ri =
|
|
9780
|
+
I(Ge, "uuid", "a659add7-1418-4771-a0d6-7d4d438e4624");
|
|
9781
|
+
let Ri = Ge;
|
|
9724
9782
|
const Bt = class Bt extends et {
|
|
9725
9783
|
constructor(t) {
|
|
9726
9784
|
super(t);
|
|
@@ -9798,7 +9856,7 @@ const Bt = class Bt extends et {
|
|
|
9798
9856
|
* Each object must have an `expressID` property, which is the express ID of the entity in the model.
|
|
9799
9857
|
* The rest of the properties will be set as the properties of the entity.
|
|
9800
9858
|
*
|
|
9801
|
-
* @returns
|
|
9859
|
+
* @returns A promise that resolves when all the properties have been set.
|
|
9802
9860
|
*
|
|
9803
9861
|
* @throws Will throw an error if any of the `expressID` properties are missing in the `dataToSave` array.
|
|
9804
9862
|
*/
|
|
@@ -9845,7 +9903,7 @@ const Bt = class Bt extends et {
|
|
|
9845
9903
|
* @param model - The FragmentsGroup model from which to remove the Pset.
|
|
9846
9904
|
* @param psetID - The express IDs of the Psets to be removed.
|
|
9847
9905
|
*
|
|
9848
|
-
* @returns
|
|
9906
|
+
* @returns A promise that resolves when all the Psets have been removed.
|
|
9849
9907
|
*
|
|
9850
9908
|
* @throws Will throw an error if any of the `expressID` properties are missing in the `psetID` array.
|
|
9851
9909
|
* @throws Will throw an error if the Pset to be removed is not of type `IFCPROPERTYSET`.
|
|
@@ -9919,7 +9977,7 @@ const Bt = class Bt extends et {
|
|
|
9919
9977
|
* @param psetID - The express ID of the Pset from which to remove the property.
|
|
9920
9978
|
* @param propID - The express ID of the property to be removed.
|
|
9921
9979
|
*
|
|
9922
|
-
* @returns
|
|
9980
|
+
* @returns A promise that resolves when the property has been removed.
|
|
9923
9981
|
*
|
|
9924
9982
|
* @throws Will throw an error if the Pset or the property to be removed are not found in the model.
|
|
9925
9983
|
* @throws Will throw an error if the Pset to be removed is not of type `IFCPROPERTYSET`.
|
|
@@ -9933,17 +9991,20 @@ const Bt = class Bt extends et {
|
|
|
9933
9991
|
if (!o)
|
|
9934
9992
|
return;
|
|
9935
9993
|
const n = await t.getProperties(o);
|
|
9936
|
-
if (n)
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
}
|
|
9945
|
-
this.registerChange(t, e);
|
|
9994
|
+
if (!n)
|
|
9995
|
+
return;
|
|
9996
|
+
for (const a of i) {
|
|
9997
|
+
const c = new b.Handle(a);
|
|
9998
|
+
n.RelatedObjects.push(c), this.onElementToPset.trigger({
|
|
9999
|
+
model: t,
|
|
10000
|
+
psetID: e,
|
|
10001
|
+
elementID: a
|
|
10002
|
+
});
|
|
9946
10003
|
}
|
|
10004
|
+
this.registerChange(t, e);
|
|
10005
|
+
const r = this.components.get(pe);
|
|
10006
|
+
for (const a of i)
|
|
10007
|
+
r.addEntityRelations(t, a, "IsDefinedBy", e);
|
|
9947
10008
|
}
|
|
9948
10009
|
/**
|
|
9949
10010
|
* Adds elements to a Property Set (Pset) in the given model.
|
|
@@ -9952,7 +10013,7 @@ const Bt = class Bt extends et {
|
|
|
9952
10013
|
* @param psetID - The express ID of the Pset to which to add the elements.
|
|
9953
10014
|
* @param elementID - The express IDs of the elements to be added.
|
|
9954
10015
|
*
|
|
9955
|
-
* @returns
|
|
10016
|
+
* @returns A promise that resolves when all the elements have been added.
|
|
9956
10017
|
*
|
|
9957
10018
|
* @throws Will throw an error if the Pset or the elements to be added are not found in the model.
|
|
9958
10019
|
* @throws Will throw an error if the Pset to be added to is not of type `IFCPROPERTYSET`.
|
|
@@ -10043,7 +10104,7 @@ const Bt = class Bt extends et {
|
|
|
10043
10104
|
}
|
|
10044
10105
|
newGUID(t) {
|
|
10045
10106
|
const e = Bt.getIFCSchema(t);
|
|
10046
|
-
return new b[e].IfcGloballyUniqueId(
|
|
10107
|
+
return new b[e].IfcGloballyUniqueId(ze.create());
|
|
10047
10108
|
}
|
|
10048
10109
|
async getOwnerHistory(t) {
|
|
10049
10110
|
const e = await t.getAllPropertiesOfType(
|
|
@@ -10074,8 +10135,8 @@ const Bt = class Bt extends et {
|
|
|
10074
10135
|
* This UUID is used to register the component within the Components system.
|
|
10075
10136
|
*/
|
|
10076
10137
|
I(Bt, "uuid", "58c2d9f0-183c-48d6-a402-dfcf5b9a34df");
|
|
10077
|
-
let
|
|
10078
|
-
const
|
|
10138
|
+
let gn = Bt;
|
|
10139
|
+
const ys = class ys extends et {
|
|
10079
10140
|
constructor(t) {
|
|
10080
10141
|
super(t);
|
|
10081
10142
|
/** {@link Component.enabled} */
|
|
@@ -10102,7 +10163,7 @@ const Ls = class Ls extends et {
|
|
|
10102
10163
|
}
|
|
10103
10164
|
}
|
|
10104
10165
|
});
|
|
10105
|
-
t.add(
|
|
10166
|
+
t.add(ys.uuid, this), t.get(ht).onFragmentsDisposed.add(this.onFragmentsDisposed);
|
|
10106
10167
|
}
|
|
10107
10168
|
/** {@link Disposable.dispose} */
|
|
10108
10169
|
dispose() {
|
|
@@ -10309,7 +10370,7 @@ const Ls = class Ls extends et {
|
|
|
10309
10370
|
*/
|
|
10310
10371
|
async bySpatialStructure(t, e = { useProperties: !0 }) {
|
|
10311
10372
|
var r, a;
|
|
10312
|
-
const i = this.components.get(
|
|
10373
|
+
const i = this.components.get(pe), o = i.relationMaps[t.uuid];
|
|
10313
10374
|
if (!o)
|
|
10314
10375
|
throw new Error(
|
|
10315
10376
|
`Classifier: model relations of ${t.name || t.uuid} have to exists to group by spatial structure.`
|
|
@@ -10420,9 +10481,9 @@ const Ls = class Ls extends et {
|
|
|
10420
10481
|
* A unique identifier for the component.
|
|
10421
10482
|
* This UUID is used to register the component within the Components system.
|
|
10422
10483
|
*/
|
|
10423
|
-
I(
|
|
10424
|
-
let Ai =
|
|
10425
|
-
const
|
|
10484
|
+
I(ys, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
|
|
10485
|
+
let Ai = ys;
|
|
10486
|
+
const Ls = class Ls extends et {
|
|
10426
10487
|
constructor(t) {
|
|
10427
10488
|
super(t);
|
|
10428
10489
|
/** {@link Disposable.onDisposed} */
|
|
@@ -10446,7 +10507,7 @@ const ys = class ys extends et {
|
|
|
10446
10507
|
* This set is used to keep track of which items have been exploded.
|
|
10447
10508
|
*/
|
|
10448
10509
|
I(this, "list", /* @__PURE__ */ new Set());
|
|
10449
|
-
t.add(
|
|
10510
|
+
t.add(Ls.uuid, this);
|
|
10450
10511
|
}
|
|
10451
10512
|
/** {@link Disposable.dispose} */
|
|
10452
10513
|
dispose() {
|
|
@@ -10471,7 +10532,7 @@ const ys = class ys extends et {
|
|
|
10471
10532
|
return;
|
|
10472
10533
|
const e = this.components.get(Ai), i = this.components.get(ht), o = t ? 1 : -1;
|
|
10473
10534
|
let n = 0;
|
|
10474
|
-
const r = e.list[this.groupName], a = new
|
|
10535
|
+
const r = e.list[this.groupName], a = new O.Matrix4();
|
|
10475
10536
|
for (const c in r) {
|
|
10476
10537
|
a.elements[13] = n * o * this.height;
|
|
10477
10538
|
for (const h in r[c].map) {
|
|
@@ -10490,8 +10551,8 @@ const ys = class ys extends et {
|
|
|
10490
10551
|
* A unique identifier for the component.
|
|
10491
10552
|
* This UUID is used to register the component within the Components system.
|
|
10492
10553
|
*/
|
|
10493
|
-
I(
|
|
10494
|
-
let
|
|
10554
|
+
I(Ls, "uuid", "d260618b-ce88-4c7d-826c-6debb91de3e2");
|
|
10555
|
+
let On = Ls;
|
|
10495
10556
|
const Ms = class Ms extends et {
|
|
10496
10557
|
constructor(t) {
|
|
10497
10558
|
super(t);
|
|
@@ -10547,8 +10608,8 @@ const Ms = class Ms extends et {
|
|
|
10547
10608
|
* This UUID is used to register the component within the Components system.
|
|
10548
10609
|
*/
|
|
10549
10610
|
I(Ms, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
|
|
10550
|
-
let
|
|
10551
|
-
class jr extends
|
|
10611
|
+
let Sn = Ms;
|
|
10612
|
+
class jr extends yi {
|
|
10552
10613
|
constructor() {
|
|
10553
10614
|
super(...arguments);
|
|
10554
10615
|
/**
|
|
@@ -10678,11 +10739,11 @@ const ws = class ws extends et {
|
|
|
10678
10739
|
o[a].push(p);
|
|
10679
10740
|
const T = this.webIfc.GetLine(0, p);
|
|
10680
10741
|
if (T.GlobalId) {
|
|
10681
|
-
const
|
|
10682
|
-
n.globalToExpressIDs.set(
|
|
10742
|
+
const S = (T == null ? void 0 : T.GlobalId.value) || (T == null ? void 0 : T.GlobalId);
|
|
10743
|
+
n.globalToExpressIDs.set(S, p);
|
|
10683
10744
|
}
|
|
10684
|
-
const
|
|
10685
|
-
n.data.set(p, [[], [
|
|
10745
|
+
const g = this._spatialTree.itemsByFloor[p] || 0;
|
|
10746
|
+
n.data.set(p, [[], [g, m]]), r++;
|
|
10686
10747
|
}
|
|
10687
10748
|
}
|
|
10688
10749
|
this._spatialTree.cleanUp();
|
|
@@ -10717,8 +10778,8 @@ const ws = class ws extends et {
|
|
|
10717
10778
|
const c = e.geometries.get(a), h = c.geometryExpressID, d = c.color.w === 1 ? 1 : -1, E = h * d;
|
|
10718
10779
|
if (!this._visitedGeometries.has(E)) {
|
|
10719
10780
|
this._visitedGeometries.has(h) || this.getGeometry(t, h);
|
|
10720
|
-
const T = this._visitedGeometries.size,
|
|
10721
|
-
this._visitedGeometries.set(E, { uuid:
|
|
10781
|
+
const T = this._visitedGeometries.size, g = O.MathUtils.generateUUID();
|
|
10782
|
+
this._visitedGeometries.set(E, { uuid: g, index: T });
|
|
10722
10783
|
}
|
|
10723
10784
|
const u = this._visitedGeometries.get(E);
|
|
10724
10785
|
if (u === void 0)
|
|
@@ -10774,8 +10835,8 @@ const ws = class ws extends et {
|
|
|
10774
10835
|
* This UUID is used to register the component within the Components system.
|
|
10775
10836
|
*/
|
|
10776
10837
|
I(ws, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
|
|
10777
|
-
let
|
|
10778
|
-
class qr extends
|
|
10838
|
+
let _n = ws;
|
|
10839
|
+
class qr extends yi {
|
|
10779
10840
|
constructor() {
|
|
10780
10841
|
super(...arguments);
|
|
10781
10842
|
/**
|
|
@@ -10892,7 +10953,7 @@ class Kr extends et {
|
|
|
10892
10953
|
n / e.size > o && (o = Math.round(o * 100) / 100, await this.onProgress.trigger(o), o += 0.01);
|
|
10893
10954
|
}
|
|
10894
10955
|
await this.onProgress.trigger(1);
|
|
10895
|
-
const a = await this.components.get(
|
|
10956
|
+
const a = await this.components.get(pe).processFromWebIfc(this.webIfc, 0);
|
|
10896
10957
|
await this.onIndicesStreamed.trigger(a);
|
|
10897
10958
|
}
|
|
10898
10959
|
cleanUp() {
|
|
@@ -10921,7 +10982,7 @@ const Ds = class Ds extends et {
|
|
|
10921
10982
|
* @returns The distance from the point to the line segment.
|
|
10922
10983
|
*/
|
|
10923
10984
|
static distanceFromPointToLine(t, e, i, o = !1) {
|
|
10924
|
-
const n = new
|
|
10985
|
+
const n = new O.Line3(), r = new O.Vector3();
|
|
10925
10986
|
return n.set(e, i), n.closestPointToPoint(t, o, r), r.distanceTo(t);
|
|
10926
10987
|
}
|
|
10927
10988
|
/**
|
|
@@ -10955,14 +11016,14 @@ const Ds = class Ds extends et {
|
|
|
10955
11016
|
const f = /* @__PURE__ */ new Map();
|
|
10956
11017
|
for (const { id: T } of u)
|
|
10957
11018
|
if (h.has(T)) {
|
|
10958
|
-
const
|
|
10959
|
-
f.set(T,
|
|
11019
|
+
const g = h.get(T);
|
|
11020
|
+
f.set(T, g);
|
|
10960
11021
|
}
|
|
10961
11022
|
const R = u.map((T) => T.id);
|
|
10962
11023
|
if (!f.size) {
|
|
10963
11024
|
const T = c++;
|
|
10964
|
-
for (const { id:
|
|
10965
|
-
h.set(
|
|
11025
|
+
for (const { id: g } of u)
|
|
11026
|
+
h.set(g, T);
|
|
10966
11027
|
d.set(T, {
|
|
10967
11028
|
edges: new Set(R),
|
|
10968
11029
|
indices: /* @__PURE__ */ new Set([E])
|
|
@@ -10971,10 +11032,10 @@ const Ds = class Ds extends et {
|
|
|
10971
11032
|
}
|
|
10972
11033
|
let m = null;
|
|
10973
11034
|
const C = /* @__PURE__ */ new Set(), A = new Set(R);
|
|
10974
|
-
for (const [T,
|
|
10975
|
-
m === null ? m =
|
|
10976
|
-
const { edges:
|
|
10977
|
-
|
|
11035
|
+
for (const [T, g] of f) {
|
|
11036
|
+
m === null ? m = g : g !== m && C.add(g), h.delete(T);
|
|
11037
|
+
const { edges: S } = d.get(g);
|
|
11038
|
+
S.delete(T), A.delete(T);
|
|
10978
11039
|
}
|
|
10979
11040
|
if (m === null)
|
|
10980
11041
|
throw new Error("Error computing face!");
|
|
@@ -10982,15 +11043,15 @@ const Ds = class Ds extends et {
|
|
|
10982
11043
|
p.add(E);
|
|
10983
11044
|
for (const T of A) {
|
|
10984
11045
|
h.set(T, m);
|
|
10985
|
-
const { edges:
|
|
10986
|
-
|
|
11046
|
+
const { edges: g } = F;
|
|
11047
|
+
g.add(T);
|
|
10987
11048
|
}
|
|
10988
11049
|
for (const T of C) {
|
|
10989
|
-
const
|
|
10990
|
-
for (const
|
|
10991
|
-
|
|
10992
|
-
for (const
|
|
10993
|
-
w.add(
|
|
11050
|
+
const g = d.get(T), { edges: S, indices: _ } = g, N = d.get(m), { edges: y, indices: w } = N;
|
|
11051
|
+
for (const L of S)
|
|
11052
|
+
y.add(L), h.set(L, m);
|
|
11053
|
+
for (const L of _)
|
|
11054
|
+
w.add(L);
|
|
10994
11055
|
d.delete(T);
|
|
10995
11056
|
}
|
|
10996
11057
|
}
|
|
@@ -11018,12 +11079,12 @@ const Ds = class Ds extends et {
|
|
|
11018
11079
|
getVerticesAndNormal(t, e, i) {
|
|
11019
11080
|
if (!t.geometry.index)
|
|
11020
11081
|
throw new Error("Geometry must be indexed!");
|
|
11021
|
-
const o = t.geometry.index.array, n = t.geometry.attributes.position.array, r = t.geometry.attributes.normal.array, a = o[e * 3] * 3, c = o[e * 3 + 1] * 3, h = o[e * 3 + 2] * 3, d = new
|
|
11022
|
-
if (i !== void 0 && t instanceof
|
|
11023
|
-
const T = new
|
|
11082
|
+
const o = t.geometry.index.array, n = t.geometry.attributes.position.array, r = t.geometry.attributes.normal.array, a = o[e * 3] * 3, c = o[e * 3 + 1] * 3, h = o[e * 3 + 2] * 3, d = new O.Vector3(n[a], n[a + 1], n[a + 2]), E = new O.Vector3(n[c], n[c + 1], n[c + 2]), u = new O.Vector3(n[h], n[h + 1], n[h + 2]), f = new O.Vector3(r[a], r[a + 1], r[a + 2]), R = new O.Vector3(r[c], r[c + 1], r[c + 2]), m = new O.Vector3(r[h], r[h + 1], r[h + 2]), C = (f.x + R.x + m.x) / 3, A = (f.y + R.y + m.y) / 3, F = (f.z + R.z + m.z) / 3, p = new O.Vector3(C, A, F);
|
|
11083
|
+
if (i !== void 0 && t instanceof O.InstancedMesh) {
|
|
11084
|
+
const T = new O.Matrix4();
|
|
11024
11085
|
t.getMatrixAt(i, T);
|
|
11025
|
-
const
|
|
11026
|
-
|
|
11086
|
+
const g = new O.Matrix4();
|
|
11087
|
+
g.extractRotation(T), p.applyMatrix4(g), d.applyMatrix4(T), E.applyMatrix4(T), u.applyMatrix4(T);
|
|
11027
11088
|
}
|
|
11028
11089
|
return { p1: d, p2: E, p3: u, faceNormal: p };
|
|
11029
11090
|
}
|
|
@@ -11051,7 +11112,7 @@ const Ds = class Ds extends et {
|
|
|
11051
11112
|
* @throws Will throw an error if the fragment manager is not available.
|
|
11052
11113
|
*/
|
|
11053
11114
|
getVolumeFromFragments(t) {
|
|
11054
|
-
const e = this.components.get(ht), i = new
|
|
11115
|
+
const e = this.components.get(ht), i = new O.Matrix4(), o = [];
|
|
11055
11116
|
for (const r in t) {
|
|
11056
11117
|
const a = e.list.get(r);
|
|
11057
11118
|
if (!a)
|
|
@@ -11062,7 +11123,7 @@ const Ds = class Ds extends et {
|
|
|
11062
11123
|
const f = a.getInstancesIDs(u);
|
|
11063
11124
|
f && (h += f.size);
|
|
11064
11125
|
}
|
|
11065
|
-
const d = new
|
|
11126
|
+
const d = new O.InstancedMesh(
|
|
11066
11127
|
a.mesh.geometry,
|
|
11067
11128
|
void 0,
|
|
11068
11129
|
h
|
|
@@ -11127,23 +11188,23 @@ const Ds = class Ds extends et {
|
|
|
11127
11188
|
distance: E.distanceTo(m),
|
|
11128
11189
|
points: [E, m]
|
|
11129
11190
|
}
|
|
11130
|
-
], A = new
|
|
11191
|
+
], A = new O.Plane();
|
|
11131
11192
|
return A.setFromNormalAndCoplanarPoint(c, n), A.constant = Math.round(A.constant * 10) / 10, { plane: A, edges: C };
|
|
11132
11193
|
}
|
|
11133
11194
|
// https://stackoverflow.com/a/1568551
|
|
11134
11195
|
getVolumeOfMesh(t) {
|
|
11135
11196
|
let e = 0;
|
|
11136
|
-
const i = new
|
|
11197
|
+
const i = new O.Vector3(), o = new O.Vector3(), n = new O.Vector3(), { index: r } = t.geometry, a = t.geometry.attributes.position.array;
|
|
11137
11198
|
if (!r)
|
|
11138
11199
|
return console.warn("Geometry must be indexed to compute its volume!"), 0;
|
|
11139
11200
|
const c = [];
|
|
11140
|
-
if (t instanceof
|
|
11201
|
+
if (t instanceof O.InstancedMesh)
|
|
11141
11202
|
for (let d = 0; d < t.count; d++) {
|
|
11142
|
-
const E = new
|
|
11203
|
+
const E = new O.Matrix4();
|
|
11143
11204
|
t.getMatrixAt(d, E), c.push(E);
|
|
11144
11205
|
}
|
|
11145
11206
|
else
|
|
11146
|
-
c.push(new
|
|
11207
|
+
c.push(new O.Matrix4().identity());
|
|
11147
11208
|
const { matrixWorld: h } = t;
|
|
11148
11209
|
for (let d = 0; d < r.array.length - 2; d += 3)
|
|
11149
11210
|
for (const E of c) {
|
|
@@ -11165,7 +11226,7 @@ I(Ds, "uuid", "267ca032-672f-4cb0-afa9-d24e904f39d6");
|
|
|
11165
11226
|
let Nn = Ds;
|
|
11166
11227
|
export {
|
|
11167
11228
|
Ts as AsyncEvent,
|
|
11168
|
-
|
|
11229
|
+
_i as Base,
|
|
11169
11230
|
ar as BaseCamera,
|
|
11170
11231
|
cr as BaseRenderer,
|
|
11171
11232
|
lr as BaseScene,
|
|
@@ -11179,23 +11240,23 @@ export {
|
|
|
11179
11240
|
Ti as Cullers,
|
|
11180
11241
|
zt as Disposer,
|
|
11181
11242
|
D as Event,
|
|
11182
|
-
|
|
11243
|
+
On as Exploder,
|
|
11183
11244
|
zr as FirstPersonMode,
|
|
11184
11245
|
ht as FragmentsManager,
|
|
11185
11246
|
vn as GeometryTypes,
|
|
11186
11247
|
dn as Grids,
|
|
11187
|
-
|
|
11248
|
+
Sn as Hider,
|
|
11188
11249
|
oa as IfcCategories,
|
|
11189
11250
|
Bn as IfcCategoryMap,
|
|
11190
11251
|
Zr as IfcElements,
|
|
11191
|
-
|
|
11192
|
-
|
|
11252
|
+
yi as IfcFragmentSettings,
|
|
11253
|
+
_n as IfcGeometryTiler,
|
|
11193
11254
|
mi as IfcJsonExporter,
|
|
11194
11255
|
Ri as IfcLoader,
|
|
11195
|
-
|
|
11256
|
+
gn as IfcPropertiesManager,
|
|
11196
11257
|
Kr as IfcPropertiesTiler,
|
|
11197
11258
|
Kt as IfcPropertiesUtils,
|
|
11198
|
-
|
|
11259
|
+
pe as IfcRelationsIndexer,
|
|
11199
11260
|
jr as IfcStreamingSettings,
|
|
11200
11261
|
sn as MaterialsUtils,
|
|
11201
11262
|
Nn as MeasurementUtils,
|
|
@@ -11208,15 +11269,15 @@ export {
|
|
|
11208
11269
|
kr as PlanMode,
|
|
11209
11270
|
Wr as ProjectionManager,
|
|
11210
11271
|
qr as PropertiesStreamingSettings,
|
|
11211
|
-
|
|
11212
|
-
|
|
11272
|
+
He as Raycasters,
|
|
11273
|
+
ke as SimpleCamera,
|
|
11213
11274
|
Nr as SimpleGrid,
|
|
11214
11275
|
Pi as SimplePlane,
|
|
11215
11276
|
Ar as SimpleRaycaster,
|
|
11216
11277
|
ia as SimpleRenderer,
|
|
11217
11278
|
sa as SimpleScene,
|
|
11218
11279
|
Fr as SimpleWorld,
|
|
11219
|
-
|
|
11280
|
+
ze as UUID,
|
|
11220
11281
|
ea as VertexPicker,
|
|
11221
11282
|
Ci as Worlds,
|
|
11222
11283
|
mr as isPointInFrontOfPlane,
|