@thatopen/components 2.0.0-alpha.5 → 2.0.0-alpha.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/Cullers/src/culler-renderer.d.ts +3 -2
- package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +1 -0
- package/dist/core/Types/src/async-event.d.ts +34 -0
- package/dist/core/Types/src/index.d.ts +1 -0
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +106 -0
- package/dist/ifc/index.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +1245 -1110
- package/dist/namespace.d.ts +840 -729
- package/package.json +2 -2
- package/dist/ifc/IfcPropertiesIndexer/index.d.ts +0 -31
package/dist/index.mjs
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
1
|
var vn = Object.defineProperty;
|
|
2
|
-
var Bn = (
|
|
3
|
-
var I = (
|
|
2
|
+
var Bn = (l, s, t) => s in l ? vn(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
|
|
3
|
+
var I = (l, s, t) => (Bn(l, typeof s != "symbol" ? s + "" : s, t), t);
|
|
4
4
|
import * as O from "three";
|
|
5
|
-
import { BufferAttribute as An, Vector3 as M, Vector2 as fe, Plane as pi, Line3 as
|
|
5
|
+
import { BufferAttribute as An, Vector3 as M, Vector2 as fe, Plane as pi, Line3 as Pt, Triangle as ue, Sphere as Yn, Matrix4 as Mt, Box3 as Ot, BackSide as Gn, DoubleSide as Fn, FrontSide as _i, Mesh as v, Ray as Vn, Raycaster as zn, Quaternion as Lt, Object3D as ei, Euler as Hn, MeshBasicMaterial as gn, LineBasicMaterial as kn, CylinderGeometry as ct, BoxGeometry as rt, BufferGeometry as Ni, Float32BufferAttribute as yi, OctahedronGeometry as Qe, Line as Ut, SphereGeometry as Wn, TorusGeometry as me, PlaneGeometry as Xn } from "three";
|
|
6
6
|
import * as b from "web-ifc";
|
|
7
7
|
import * as $t from "@thatopen/fragments";
|
|
8
8
|
import { Serializer as Zn } from "@thatopen/fragments";
|
|
9
|
-
const On = 0, Qn = 1, jn = 2,
|
|
10
|
-
function $n(
|
|
11
|
-
return
|
|
9
|
+
const On = 0, Qn = 1, jn = 2, Li = 2, Us = 1.25, Pi = 1, Ts = 6 * 4 + 4 + 4, Ls = 65535, qn = Math.pow(2, -24), xs = Symbol("SKIP_GENERATION");
|
|
10
|
+
function $n(l) {
|
|
11
|
+
return l.index ? l.index.count : l.attributes.position.count;
|
|
12
12
|
}
|
|
13
|
-
function pe(
|
|
14
|
-
return $n(
|
|
13
|
+
function pe(l) {
|
|
14
|
+
return $n(l) / 3;
|
|
15
15
|
}
|
|
16
|
-
function Kn(
|
|
17
|
-
return
|
|
16
|
+
function Kn(l, s = ArrayBuffer) {
|
|
17
|
+
return l > 65535 ? new Uint32Array(new s(4 * l)) : new Uint16Array(new s(2 * l));
|
|
18
18
|
}
|
|
19
|
-
function Jn(
|
|
20
|
-
if (!
|
|
21
|
-
const t =
|
|
22
|
-
|
|
19
|
+
function Jn(l, s) {
|
|
20
|
+
if (!l.index) {
|
|
21
|
+
const t = l.attributes.position.count, e = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, i = Kn(t, e);
|
|
22
|
+
l.setIndex(new An(i, 1));
|
|
23
23
|
for (let o = 0; o < t; o++)
|
|
24
24
|
i[o] = o;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function Sn(
|
|
28
|
-
const s = pe(
|
|
27
|
+
function Sn(l) {
|
|
28
|
+
const s = pe(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)
|
|
32
32
|
}];
|
|
33
33
|
}
|
|
34
|
-
function _n(
|
|
35
|
-
if (!
|
|
36
|
-
return Sn(
|
|
37
|
-
const s = [], t = /* @__PURE__ */ new Set(), e =
|
|
38
|
-
for (const r of
|
|
39
|
-
const a = r.start / 3,
|
|
40
|
-
t.add(Math.max(i, a)), t.add(Math.min(o,
|
|
34
|
+
function _n(l) {
|
|
35
|
+
if (!l.groups || !l.groups.length)
|
|
36
|
+
return Sn(l);
|
|
37
|
+
const s = [], t = /* @__PURE__ */ new Set(), e = l.drawRange, i = e.start / 3, o = (e.start + e.count) / 3;
|
|
38
|
+
for (const r of l.groups) {
|
|
39
|
+
const a = r.start / 3, c = (r.start + r.count) / 3;
|
|
40
|
+
t.add(Math.max(i, a)), t.add(Math.min(o, c));
|
|
41
41
|
}
|
|
42
42
|
const n = Array.from(t.values()).sort((r, a) => r - a);
|
|
43
43
|
for (let r = 0; r < n.length - 1; r++) {
|
|
44
|
-
const a = n[r],
|
|
44
|
+
const a = n[r], c = n[r + 1];
|
|
45
45
|
s.push({
|
|
46
46
|
offset: Math.floor(a),
|
|
47
|
-
count: Math.floor(
|
|
47
|
+
count: Math.floor(c - a)
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
return s;
|
|
51
51
|
}
|
|
52
|
-
function to(
|
|
53
|
-
if (
|
|
52
|
+
function to(l) {
|
|
53
|
+
if (l.groups.length === 0)
|
|
54
54
|
return !1;
|
|
55
|
-
const s = pe(
|
|
55
|
+
const s = pe(l), t = _n(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;
|
|
59
59
|
}
|
|
60
|
-
function $(
|
|
61
|
-
return t.min.x = s[
|
|
60
|
+
function $(l, s, t) {
|
|
61
|
+
return t.min.x = s[l], t.min.y = s[l + 1], t.min.z = s[l + 2], t.max.x = s[l + 3], t.max.y = s[l + 4], t.max.z = s[l + 5], t;
|
|
62
62
|
}
|
|
63
|
-
function eo(
|
|
64
|
-
|
|
63
|
+
function eo(l) {
|
|
64
|
+
l[0] = l[1] = l[2] = 1 / 0, l[3] = l[4] = l[5] = -1 / 0;
|
|
65
65
|
}
|
|
66
|
-
function Mi(
|
|
66
|
+
function Mi(l) {
|
|
67
67
|
let s = -1, t = -1 / 0;
|
|
68
68
|
for (let e = 0; e < 3; e++) {
|
|
69
|
-
const i =
|
|
69
|
+
const i = l[e + 3] - l[e];
|
|
70
70
|
i > t && (t = i, s = e);
|
|
71
71
|
}
|
|
72
72
|
return s;
|
|
73
73
|
}
|
|
74
|
-
function wi(
|
|
75
|
-
s.set(
|
|
74
|
+
function wi(l, s) {
|
|
75
|
+
s.set(l);
|
|
76
76
|
}
|
|
77
|
-
function Di(
|
|
77
|
+
function Di(l, s, t) {
|
|
78
78
|
let e, i;
|
|
79
79
|
for (let o = 0; o < 3; o++) {
|
|
80
80
|
const n = o + 3;
|
|
81
|
-
e =
|
|
81
|
+
e = l[o], i = s[o], t[o] = e < i ? e : i, e = l[n], i = s[n], t[n] = e > i ? e : i;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
function je(
|
|
84
|
+
function je(l, s, t) {
|
|
85
85
|
for (let e = 0; e < 3; e++) {
|
|
86
|
-
const i = s[
|
|
86
|
+
const i = s[l + 2 * e], o = s[l + 2 * e + 1], n = i - o, r = i + o;
|
|
87
87
|
n < t[e] && (t[e] = n), r > t[e + 3] && (t[e + 3] = r);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
function Re(
|
|
91
|
-
const s =
|
|
90
|
+
function Re(l) {
|
|
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
|
}
|
|
94
|
-
function bs(
|
|
95
|
-
let o = 1 / 0, n = 1 / 0, r = 1 / 0, a = -1 / 0,
|
|
94
|
+
function bs(l, s, t, e, i = null) {
|
|
95
|
+
let o = 1 / 0, n = 1 / 0, r = 1 / 0, a = -1 / 0, c = -1 / 0, E = -1 / 0, d = 1 / 0, h = 1 / 0, u = 1 / 0, p = -1 / 0, R = -1 / 0, A = -1 / 0;
|
|
96
96
|
const C = i !== null;
|
|
97
97
|
for (let T = s * 6, F = (s + t) * 6; T < F; T += 6) {
|
|
98
|
-
const f =
|
|
98
|
+
const f = l[T + 0], m = l[T + 1], g = f - m, S = f + m;
|
|
99
99
|
g < o && (o = g), S > a && (a = S), C && f < d && (d = f), C && f > p && (p = f);
|
|
100
|
-
const _ =
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
x < r && (r = x), B > E && (E = B), C &&
|
|
100
|
+
const _ = l[T + 2], N = l[T + 3], L = _ - N, w = _ + N;
|
|
101
|
+
L < n && (n = L), w > c && (c = w), C && _ < h && (h = _), C && _ > R && (R = _);
|
|
102
|
+
const P = l[T + 4], D = l[T + 5], x = P - D, B = P + D;
|
|
103
|
+
x < r && (r = x), B > E && (E = B), C && P < u && (u = P), C && P > A && (A = P);
|
|
104
104
|
}
|
|
105
|
-
e[0] = o, e[1] = n, e[2] = r, e[3] = a, e[4] =
|
|
105
|
+
e[0] = o, e[1] = n, e[2] = r, e[3] = a, e[4] = c, e[5] = E, C && (i[0] = d, i[1] = h, i[2] = u, i[3] = p, i[4] = R, i[5] = A);
|
|
106
106
|
}
|
|
107
|
-
function so(
|
|
108
|
-
let i = 1 / 0, o = 1 / 0, n = 1 / 0, r = -1 / 0, a = -1 / 0,
|
|
107
|
+
function so(l, s, t, e) {
|
|
108
|
+
let i = 1 / 0, o = 1 / 0, n = 1 / 0, r = -1 / 0, a = -1 / 0, c = -1 / 0;
|
|
109
109
|
for (let E = s * 6, d = (s + t) * 6; E < d; E += 6) {
|
|
110
|
-
const h =
|
|
110
|
+
const h = l[E + 0];
|
|
111
111
|
h < i && (i = h), h > r && (r = h);
|
|
112
|
-
const u =
|
|
112
|
+
const u = l[E + 2];
|
|
113
113
|
u < o && (o = u), u > a && (a = u);
|
|
114
|
-
const p =
|
|
115
|
-
p < n && (n = p), p >
|
|
114
|
+
const p = l[E + 4];
|
|
115
|
+
p < n && (n = p), p > c && (c = p);
|
|
116
116
|
}
|
|
117
|
-
e[0] = i, e[1] = o, e[2] = n, e[3] = r, e[4] = a, e[5] =
|
|
117
|
+
e[0] = i, e[1] = o, e[2] = n, e[3] = r, e[4] = a, e[5] = c;
|
|
118
118
|
}
|
|
119
|
-
function io(
|
|
119
|
+
function io(l, s) {
|
|
120
120
|
eo(s);
|
|
121
|
-
const t =
|
|
122
|
-
let
|
|
123
|
-
t.isInterleavedBufferAttribute && (
|
|
121
|
+
const t = l.attributes.position, e = l.index ? l.index.array : null, i = pe(l), o = new Float32Array(i * 6), n = t.normalized, r = t.array, a = t.offset || 0;
|
|
122
|
+
let c = 3;
|
|
123
|
+
t.isInterleavedBufferAttribute && (c = t.data.stride);
|
|
124
124
|
const E = ["getX", "getY", "getZ"];
|
|
125
125
|
for (let d = 0; d < i; d++) {
|
|
126
126
|
const h = d * 3, u = d * 6;
|
|
127
127
|
let p = h + 0, R = h + 1, A = h + 2;
|
|
128
|
-
e && (p = e[p], R = e[R], A = e[A]), n || (p = p *
|
|
128
|
+
e && (p = e[p], R = e[R], A = e[A]), n || (p = p * c + a, R = R * c + a, A = A * c + a);
|
|
129
129
|
for (let C = 0; C < 3; C++) {
|
|
130
130
|
let T, F, f;
|
|
131
131
|
n ? (T = t[E[C]](p), F = t[E[C]](R), f = t[E[C]](A)) : (T = r[p + C], F = r[R + C], f = r[A + C]);
|
|
@@ -139,22 +139,22 @@ function io(c, s) {
|
|
|
139
139
|
}
|
|
140
140
|
return o;
|
|
141
141
|
}
|
|
142
|
-
const wt = 32, no = (
|
|
142
|
+
const wt = 32, no = (l, s) => l.candidate - s.candidate, xt = new Array(wt).fill().map(() => ({
|
|
143
143
|
count: 0,
|
|
144
144
|
bounds: new Float32Array(6),
|
|
145
145
|
rightCacheBounds: new Float32Array(6),
|
|
146
146
|
leftCacheBounds: new Float32Array(6),
|
|
147
147
|
candidate: 0
|
|
148
148
|
})), qe = new Float32Array(6);
|
|
149
|
-
function oo(
|
|
149
|
+
function oo(l, s, t, e, i, o) {
|
|
150
150
|
let n = -1, r = 0;
|
|
151
151
|
if (o === On)
|
|
152
152
|
n = Mi(s), n !== -1 && (r = (s[n] + s[n + 3]) / 2);
|
|
153
153
|
else if (o === Qn)
|
|
154
|
-
n = Mi(
|
|
154
|
+
n = Mi(l), n !== -1 && (r = ro(t, e, i, n));
|
|
155
155
|
else if (o === jn) {
|
|
156
|
-
const a = Re(
|
|
157
|
-
let
|
|
156
|
+
const a = Re(l);
|
|
157
|
+
let c = Us * i;
|
|
158
158
|
const E = e * 6, d = (e + i) * 6;
|
|
159
159
|
for (let h = 0; h < 3; h++) {
|
|
160
160
|
const u = s[h], A = (s[h + 3] - u) / wt;
|
|
@@ -190,12 +190,12 @@ function oo(c, s, t, e, i, o) {
|
|
|
190
190
|
}
|
|
191
191
|
for (let f = 0; f < F; f++) {
|
|
192
192
|
const m = C[f], g = m.count, S = i - m.count, _ = m.leftCacheBounds, N = m.rightCacheBounds;
|
|
193
|
-
let
|
|
194
|
-
g !== 0 && (
|
|
193
|
+
let L = 0;
|
|
194
|
+
g !== 0 && (L = Re(_) / a);
|
|
195
195
|
let w = 0;
|
|
196
196
|
S !== 0 && (w = Re(N) / a);
|
|
197
|
-
const
|
|
198
|
-
|
|
197
|
+
const P = Pi + Us * (L * g + w * S);
|
|
198
|
+
P < c && (n = h, c = P, r = m.candidate);
|
|
199
199
|
}
|
|
200
200
|
} else {
|
|
201
201
|
for (let F = 0; F < wt; F++) {
|
|
@@ -221,12 +221,12 @@ function oo(c, s, t, e, i, o) {
|
|
|
221
221
|
for (let F = 0; F < wt - 1; F++) {
|
|
222
222
|
const f = xt[F], m = f.count, g = f.bounds, _ = xt[F + 1].rightCacheBounds;
|
|
223
223
|
m !== 0 && (T === 0 ? wi(g, qe) : Di(g, qe, qe)), T += m;
|
|
224
|
-
let N = 0,
|
|
224
|
+
let N = 0, L = 0;
|
|
225
225
|
T !== 0 && (N = Re(qe) / a);
|
|
226
226
|
const w = i - T;
|
|
227
|
-
w !== 0 && (
|
|
228
|
-
const
|
|
229
|
-
|
|
227
|
+
w !== 0 && (L = Re(_) / a);
|
|
228
|
+
const P = Pi + Us * (N * T + L * w);
|
|
229
|
+
P < c && (n = h, c = P, r = f.candidate);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
@@ -234,23 +234,23 @@ function oo(c, s, t, e, i, o) {
|
|
|
234
234
|
console.warn(`MeshBVH: Invalid build strategy value ${o} used.`);
|
|
235
235
|
return { axis: n, pos: r };
|
|
236
236
|
}
|
|
237
|
-
function ro(
|
|
237
|
+
function ro(l, s, t, e) {
|
|
238
238
|
let i = 0;
|
|
239
239
|
for (let o = s, n = s + t; o < n; o++)
|
|
240
|
-
i +=
|
|
240
|
+
i += l[o * 6 + e * 2];
|
|
241
241
|
return i / t;
|
|
242
242
|
}
|
|
243
243
|
class $e {
|
|
244
244
|
constructor() {
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
function ao(
|
|
247
|
+
function ao(l, s, t, e, i, o) {
|
|
248
248
|
let n = e, r = e + i - 1;
|
|
249
|
-
const a = o.pos,
|
|
249
|
+
const a = o.pos, c = o.axis * 2;
|
|
250
250
|
for (; ; ) {
|
|
251
|
-
for (; n <= r && t[n * 6 +
|
|
251
|
+
for (; n <= r && t[n * 6 + c] < a; )
|
|
252
252
|
n++;
|
|
253
|
-
for (; n <= r && t[r * 6 +
|
|
253
|
+
for (; n <= r && t[r * 6 + c] >= a; )
|
|
254
254
|
r--;
|
|
255
255
|
if (n < r) {
|
|
256
256
|
for (let E = 0; E < 3; E++) {
|
|
@@ -266,17 +266,17 @@ function ao(c, s, t, e, i, o) {
|
|
|
266
266
|
return n;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
function co(
|
|
269
|
+
function co(l, s, t, e, i, o) {
|
|
270
270
|
let n = e, r = e + i - 1;
|
|
271
|
-
const a = o.pos,
|
|
271
|
+
const a = o.pos, c = o.axis * 2;
|
|
272
272
|
for (; ; ) {
|
|
273
|
-
for (; n <= r && t[n * 6 +
|
|
273
|
+
for (; n <= r && t[n * 6 + c] < a; )
|
|
274
274
|
n++;
|
|
275
|
-
for (; n <= r && t[r * 6 +
|
|
275
|
+
for (; n <= r && t[r * 6 + c] >= a; )
|
|
276
276
|
r--;
|
|
277
277
|
if (n < r) {
|
|
278
|
-
let E =
|
|
279
|
-
|
|
278
|
+
let E = l[n];
|
|
279
|
+
l[n] = l[r], l[r] = E;
|
|
280
280
|
for (let d = 0; d < 6; d++) {
|
|
281
281
|
let h = t[n * 6 + d];
|
|
282
282
|
t[n * 6 + d] = t[r * 6 + d], t[r * 6 + d] = h;
|
|
@@ -286,14 +286,14 @@ function co(c, s, t, e, i, o) {
|
|
|
286
286
|
return n;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
function lo(
|
|
290
|
-
const t = (
|
|
289
|
+
function lo(l, s) {
|
|
290
|
+
const t = (l.index ? l.index.count : l.attributes.position.count) / 3, e = t > 2 ** 16, i = e ? 4 : 2, o = s ? new SharedArrayBuffer(t * i) : new ArrayBuffer(t * i), n = e ? new Uint32Array(o) : new Uint16Array(o);
|
|
291
291
|
for (let r = 0, a = n.length; r < a; r++)
|
|
292
292
|
n[r] = r;
|
|
293
293
|
return n;
|
|
294
294
|
}
|
|
295
|
-
function ho(
|
|
296
|
-
const t =
|
|
295
|
+
function ho(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 = pe(t), E = l._indirectBuffer;
|
|
297
297
|
let d = !1;
|
|
298
298
|
const h = new Float32Array(6), u = new Float32Array(6), p = io(t, h), R = s.indirect ? co : ao, A = [], C = s.indirect ? Sn(t) : _n(t);
|
|
299
299
|
if (C.length === 1) {
|
|
@@ -306,7 +306,7 @@ function ho(c, s) {
|
|
|
306
306
|
}
|
|
307
307
|
return A;
|
|
308
308
|
function T(f) {
|
|
309
|
-
a && a(f /
|
|
309
|
+
a && a(f / c);
|
|
310
310
|
}
|
|
311
311
|
function F(f, m, g, S = null, _ = 0) {
|
|
312
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)
|
|
@@ -314,37 +314,37 @@ function ho(c, s) {
|
|
|
314
314
|
const N = oo(f.boundingData, S, p, m, g, r);
|
|
315
315
|
if (N.axis === -1)
|
|
316
316
|
return T(m + g), f.offset = m, f.count = g, f;
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
317
|
+
const L = R(E, e, p, m, g, N);
|
|
318
|
+
if (L === m || L === m + g)
|
|
319
319
|
T(m + g), f.offset = m, f.count = g;
|
|
320
320
|
else {
|
|
321
321
|
f.splitAxis = N.axis;
|
|
322
|
-
const w = new $e(),
|
|
323
|
-
f.left = w, w.boundingData = new Float32Array(6), bs(p,
|
|
324
|
-
const x = new $e(), B =
|
|
322
|
+
const w = new $e(), P = m, D = L - m;
|
|
323
|
+
f.left = w, w.boundingData = new Float32Array(6), bs(p, P, D, w.boundingData, u), F(w, P, D, u, _ + 1);
|
|
324
|
+
const x = new $e(), B = L, H = g - D;
|
|
325
325
|
f.right = x, x.boundingData = new Float32Array(6), bs(p, B, H, x.boundingData, u), F(x, B, H, u, _ + 1);
|
|
326
326
|
}
|
|
327
327
|
return f;
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
function Eo(
|
|
331
|
-
const t =
|
|
332
|
-
s.indirect && (
|
|
330
|
+
function Eo(l, s) {
|
|
331
|
+
const t = l.geometry;
|
|
332
|
+
s.indirect && (l._indirectBuffer = lo(t, s.useSharedArrayBuffer), to(t) && !s.verbose && console.warn(
|
|
333
333
|
'MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.'
|
|
334
|
-
)),
|
|
335
|
-
const e = ho(
|
|
334
|
+
)), l._indirectBuffer || Jn(t, s);
|
|
335
|
+
const e = ho(l, s);
|
|
336
336
|
let i, o, n;
|
|
337
337
|
const r = [], a = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer;
|
|
338
338
|
for (let d = 0; d < e.length; d++) {
|
|
339
339
|
const h = e[d];
|
|
340
|
-
let u =
|
|
340
|
+
let u = c(h);
|
|
341
341
|
const p = new a(Ts * u);
|
|
342
342
|
i = new Float32Array(p), o = new Uint32Array(p), n = new Uint16Array(p), E(0, h), r.push(p);
|
|
343
343
|
}
|
|
344
|
-
|
|
344
|
+
l._roots = r;
|
|
345
345
|
return;
|
|
346
|
-
function
|
|
347
|
-
return d.count ? 1 : 1 +
|
|
346
|
+
function c(d) {
|
|
347
|
+
return d.count ? 1 : 1 + c(d.left) + c(d.right);
|
|
348
348
|
}
|
|
349
349
|
function E(d, h) {
|
|
350
350
|
const u = d / 4, p = d / 2, R = !!h.count, A = h.boundingData;
|
|
@@ -352,7 +352,7 @@ function Eo(c, s) {
|
|
|
352
352
|
i[u + C] = A[C];
|
|
353
353
|
if (R) {
|
|
354
354
|
const C = h.offset, T = h.count;
|
|
355
|
-
return o[u + 6] = C, n[p + 14] = T, n[p + 15] =
|
|
355
|
+
return o[u + 6] = C, n[p + 14] = T, n[p + 15] = Ls, d + Ts;
|
|
356
356
|
} else {
|
|
357
357
|
const C = h.left, T = h.right, F = h.splitAxis;
|
|
358
358
|
let f;
|
|
@@ -387,48 +387,48 @@ class Dt {
|
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
Dt.prototype.setFromBox = function() {
|
|
390
|
-
const
|
|
390
|
+
const l = new M();
|
|
391
391
|
return function(t, e) {
|
|
392
392
|
const i = e.min, o = e.max;
|
|
393
393
|
let n = 1 / 0, r = -1 / 0;
|
|
394
394
|
for (let a = 0; a <= 1; a++)
|
|
395
|
-
for (let
|
|
395
|
+
for (let c = 0; c <= 1; c++)
|
|
396
396
|
for (let E = 0; E <= 1; E++) {
|
|
397
|
-
|
|
398
|
-
const d = t.dot(
|
|
397
|
+
l.x = i.x * a + o.x * (1 - a), l.y = i.y * c + o.y * (1 - c), l.z = i.z * E + o.z * (1 - E);
|
|
398
|
+
const d = t.dot(l);
|
|
399
399
|
n = Math.min(d, n), r = Math.max(d, r);
|
|
400
400
|
}
|
|
401
401
|
this.min = n, this.max = r;
|
|
402
402
|
};
|
|
403
403
|
}();
|
|
404
404
|
const uo = function() {
|
|
405
|
-
const
|
|
405
|
+
const l = new M(), s = new M(), t = new M();
|
|
406
406
|
return function(i, o, n) {
|
|
407
|
-
const r = i.start, a =
|
|
408
|
-
t.subVectors(r,
|
|
407
|
+
const r = i.start, a = l, c = o.start, E = s;
|
|
408
|
+
t.subVectors(r, c), l.subVectors(i.end, i.start), s.subVectors(o.end, o.start);
|
|
409
409
|
const d = t.dot(E), h = E.dot(a), u = E.dot(E), p = t.dot(a), A = a.dot(a) * u - h * h;
|
|
410
410
|
let C, T;
|
|
411
411
|
A !== 0 ? C = (d * h - p * u) / A : C = 0, T = (d + C * h) / u, n.x = C, n.y = T;
|
|
412
412
|
};
|
|
413
413
|
}(), Ci = function() {
|
|
414
|
-
const
|
|
414
|
+
const l = new fe(), s = new M(), t = new M();
|
|
415
415
|
return function(i, o, n, r) {
|
|
416
|
-
uo(i, o,
|
|
417
|
-
let a =
|
|
418
|
-
if (a >= 0 && a <= 1 &&
|
|
419
|
-
i.at(a, n), o.at(
|
|
416
|
+
uo(i, o, l);
|
|
417
|
+
let a = l.x, c = l.y;
|
|
418
|
+
if (a >= 0 && a <= 1 && c >= 0 && c <= 1) {
|
|
419
|
+
i.at(a, n), o.at(c, r);
|
|
420
420
|
return;
|
|
421
421
|
} else if (a >= 0 && a <= 1) {
|
|
422
|
-
|
|
422
|
+
c < 0 ? o.at(0, r) : o.at(1, r), i.closestPointToPoint(r, !0, n);
|
|
423
423
|
return;
|
|
424
|
-
} else if (
|
|
424
|
+
} else if (c >= 0 && c <= 1) {
|
|
425
425
|
a < 0 ? i.at(0, n) : i.at(1, n), o.closestPointToPoint(n, !0, r);
|
|
426
426
|
return;
|
|
427
427
|
} else {
|
|
428
428
|
let E;
|
|
429
429
|
a < 0 ? E = i.start : E = i.end;
|
|
430
430
|
let d;
|
|
431
|
-
|
|
431
|
+
c < 0 ? d = o.start : d = o.end;
|
|
432
432
|
const h = s, u = t;
|
|
433
433
|
if (i.closestPointToPoint(d, !0, s), o.closestPointToPoint(E, !0, t), h.distanceToSquared(d) <= u.distanceToSquared(E)) {
|
|
434
434
|
n.copy(h), r.copy(d);
|
|
@@ -440,10 +440,10 @@ const uo = function() {
|
|
|
440
440
|
}
|
|
441
441
|
};
|
|
442
442
|
}(), Io = function() {
|
|
443
|
-
const
|
|
443
|
+
const l = new M(), s = new M(), t = new pi(), e = new Pt();
|
|
444
444
|
return function(o, n) {
|
|
445
|
-
const { radius: r, center: a } = o, { a:
|
|
446
|
-
if (e.start =
|
|
445
|
+
const { radius: r, center: a } = o, { a: c, b: E, c: d } = n;
|
|
446
|
+
if (e.start = c, e.end = E, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r || (e.start = c, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r) || (e.start = E, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r))
|
|
447
447
|
return !0;
|
|
448
448
|
const R = n.getPlane(t);
|
|
449
449
|
if (Math.abs(R.distanceToPoint(a)) <= r) {
|
|
@@ -454,8 +454,8 @@ const uo = function() {
|
|
|
454
454
|
return !1;
|
|
455
455
|
};
|
|
456
456
|
}(), fo = 1e-15;
|
|
457
|
-
function vs(
|
|
458
|
-
return Math.abs(
|
|
457
|
+
function vs(l) {
|
|
458
|
+
return Math.abs(l) < fo;
|
|
459
459
|
}
|
|
460
460
|
class gt extends ue {
|
|
461
461
|
constructor(...s) {
|
|
@@ -467,8 +467,8 @@ class gt extends ue {
|
|
|
467
467
|
update() {
|
|
468
468
|
const s = this.a, t = this.b, e = this.c, i = this.points, o = this.satAxes, n = this.satBounds, r = o[0], a = n[0];
|
|
469
469
|
this.getNormal(r), a.setFromPoints(r, i);
|
|
470
|
-
const
|
|
471
|
-
|
|
470
|
+
const c = o[1], E = n[1];
|
|
471
|
+
c.subVectors(s, t), E.setFromPoints(c, i);
|
|
472
472
|
const d = o[2], h = n[2];
|
|
473
473
|
d.subVectors(t, e), h.setFromPoints(d, i);
|
|
474
474
|
const u = o[3], p = n[3];
|
|
@@ -476,19 +476,19 @@ class gt extends ue {
|
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
478
|
gt.prototype.closestPointToSegment = function() {
|
|
479
|
-
const
|
|
479
|
+
const l = new M(), s = new M(), t = new Pt();
|
|
480
480
|
return function(i, o = null, n = null) {
|
|
481
|
-
const { start: r, end: a } = i,
|
|
481
|
+
const { start: r, end: a } = i, c = this.points;
|
|
482
482
|
let E, d = 1 / 0;
|
|
483
483
|
for (let h = 0; h < 3; h++) {
|
|
484
484
|
const u = (h + 1) % 3;
|
|
485
|
-
t.start.copy(
|
|
485
|
+
t.start.copy(c[h]), t.end.copy(c[u]), Ci(t, i, l, s), E = l.distanceToSquared(s), E < d && (d = E, o && o.copy(l), n && n.copy(s));
|
|
486
486
|
}
|
|
487
|
-
return this.closestPointToPoint(r,
|
|
487
|
+
return this.closestPointToPoint(r, l), E = r.distanceToSquared(l), E < d && (d = E, o && o.copy(l), n && n.copy(r)), this.closestPointToPoint(a, l), E = a.distanceToSquared(l), E < d && (d = E, o && o.copy(l), n && n.copy(a)), Math.sqrt(d);
|
|
488
488
|
};
|
|
489
489
|
}();
|
|
490
490
|
gt.prototype.intersectsTriangle = function() {
|
|
491
|
-
const
|
|
491
|
+
const l = new gt(), s = new Array(3), t = new Array(3), e = new Dt(), i = new Dt(), o = new M(), n = new M(), r = new M(), a = new M(), c = new M(), E = new Pt(), d = new Pt(), h = new Pt(), u = new M();
|
|
492
492
|
function p(R, A, C) {
|
|
493
493
|
const T = R.points;
|
|
494
494
|
let F = 0, f = -1;
|
|
@@ -515,28 +515,28 @@ gt.prototype.intersectsTriangle = function() {
|
|
|
515
515
|
return F;
|
|
516
516
|
}
|
|
517
517
|
return function(A, C = null, T = !1) {
|
|
518
|
-
this.needsUpdate && this.update(), A.isExtendedTriangle ? A.needsUpdate && A.update() : (
|
|
518
|
+
this.needsUpdate && this.update(), A.isExtendedTriangle ? A.needsUpdate && A.update() : (l.copy(A), l.update(), A = l);
|
|
519
519
|
const F = this.plane, f = A.plane;
|
|
520
520
|
if (Math.abs(F.normal.dot(f.normal)) > 1 - 1e-10) {
|
|
521
521
|
const m = this.satBounds, g = this.satAxes;
|
|
522
522
|
t[0] = A.a, t[1] = A.b, t[2] = A.c;
|
|
523
523
|
for (let N = 0; N < 4; N++) {
|
|
524
|
-
const
|
|
525
|
-
if (e.setFromPoints(w, t),
|
|
524
|
+
const L = m[N], w = g[N];
|
|
525
|
+
if (e.setFromPoints(w, t), L.isSeparated(e))
|
|
526
526
|
return !1;
|
|
527
527
|
}
|
|
528
528
|
const S = A.satBounds, _ = A.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 L = S[N], w = _[N];
|
|
532
|
+
if (e.setFromPoints(w, s), L.isSeparated(e))
|
|
533
533
|
return !1;
|
|
534
534
|
}
|
|
535
535
|
for (let N = 0; N < 4; N++) {
|
|
536
|
-
const
|
|
536
|
+
const L = g[N];
|
|
537
537
|
for (let w = 0; w < 4; w++) {
|
|
538
|
-
const
|
|
539
|
-
if (o.crossVectors(
|
|
538
|
+
const P = _[w];
|
|
539
|
+
if (o.crossVectors(L, P), e.setFromPoints(o, s), i.setFromPoints(o, t), e.isSeparated(i))
|
|
540
540
|
return !1;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
@@ -553,42 +553,42 @@ gt.prototype.intersectsTriangle = function() {
|
|
|
553
553
|
if (g !== 2)
|
|
554
554
|
return !1;
|
|
555
555
|
if (d.delta(r), h.delta(a), r.dot(a) < 0) {
|
|
556
|
-
let
|
|
557
|
-
h.start = h.end, h.end =
|
|
556
|
+
let D = h.start;
|
|
557
|
+
h.start = h.end, h.end = D;
|
|
558
558
|
}
|
|
559
|
-
const S = d.start.dot(r), _ = d.end.dot(r), N = h.start.dot(r),
|
|
560
|
-
return S !==
|
|
559
|
+
const S = d.start.dot(r), _ = d.end.dot(r), N = h.start.dot(r), L = h.end.dot(r), w = _ < N, P = S < L;
|
|
560
|
+
return S !== L && N !== _ && w === P ? !1 : (C && (c.subVectors(d.start, h.start), c.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(h.start), c.subVectors(d.end, h.end), c.dot(r) < 0 ? C.end.copy(d.end) : C.end.copy(h.end)), !0);
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
563
|
}();
|
|
564
564
|
gt.prototype.distanceToPoint = function() {
|
|
565
|
-
const
|
|
565
|
+
const l = new M();
|
|
566
566
|
return function(t) {
|
|
567
|
-
return this.closestPointToPoint(t,
|
|
567
|
+
return this.closestPointToPoint(t, l), t.distanceTo(l);
|
|
568
568
|
};
|
|
569
569
|
}();
|
|
570
570
|
gt.prototype.distanceToTriangle = function() {
|
|
571
|
-
const
|
|
571
|
+
const l = new M(), s = new M(), t = ["a", "b", "c"], e = new Pt(), i = new Pt();
|
|
572
572
|
return function(n, r = null, a = null) {
|
|
573
|
-
const
|
|
574
|
-
if (this.intersectsTriangle(n,
|
|
575
|
-
return (r || a) && (r &&
|
|
573
|
+
const c = r || a ? e : null;
|
|
574
|
+
if (this.intersectsTriangle(n, c))
|
|
575
|
+
return (r || a) && (r && c.getCenter(r), a && c.getCenter(a)), 0;
|
|
576
576
|
let E = 1 / 0;
|
|
577
577
|
for (let d = 0; d < 3; d++) {
|
|
578
578
|
let h;
|
|
579
579
|
const u = t[d], p = n[u];
|
|
580
|
-
this.closestPointToPoint(p,
|
|
580
|
+
this.closestPointToPoint(p, l), h = p.distanceToSquared(l), h < E && (E = h, r && r.copy(l), a && a.copy(p));
|
|
581
581
|
const R = this[u];
|
|
582
|
-
n.closestPointToPoint(R,
|
|
582
|
+
n.closestPointToPoint(R, l), h = R.distanceToSquared(l), h < E && (E = h, r && r.copy(R), a && a.copy(l));
|
|
583
583
|
}
|
|
584
584
|
for (let d = 0; d < 3; d++) {
|
|
585
585
|
const h = t[d], u = t[(d + 1) % 3];
|
|
586
586
|
e.set(this[h], this[u]);
|
|
587
587
|
for (let p = 0; p < 3; p++) {
|
|
588
588
|
const R = t[p], A = t[(p + 1) % 3];
|
|
589
|
-
i.set(n[R], n[A]), Ci(e, i,
|
|
590
|
-
const C =
|
|
591
|
-
C < E && (E = C, r && r.copy(
|
|
589
|
+
i.set(n[R], n[A]), Ci(e, i, l, s);
|
|
590
|
+
const C = l.distanceToSquared(s);
|
|
591
|
+
C < E && (E = C, r && r.copy(l), a && a.copy(s));
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
594
|
return Math.sqrt(E);
|
|
@@ -608,15 +608,15 @@ class at {
|
|
|
608
608
|
at.prototype.update = /* @__PURE__ */ function() {
|
|
609
609
|
return function() {
|
|
610
610
|
const s = this.matrix, t = this.min, e = this.max, i = this.points;
|
|
611
|
-
for (let
|
|
611
|
+
for (let c = 0; c <= 1; c++)
|
|
612
612
|
for (let E = 0; E <= 1; E++)
|
|
613
613
|
for (let d = 0; d <= 1; d++) {
|
|
614
|
-
const h = 1 *
|
|
615
|
-
u.x =
|
|
614
|
+
const h = 1 * c | 2 * E | 4 * d, u = i[h];
|
|
615
|
+
u.x = c ? e.x : t.x, u.y = E ? e.y : t.y, u.z = d ? e.z : t.z, u.applyMatrix4(s);
|
|
616
616
|
}
|
|
617
617
|
const o = this.satBounds, n = this.satAxes, r = i[0];
|
|
618
|
-
for (let
|
|
619
|
-
const E = n[
|
|
618
|
+
for (let c = 0; c < 3; c++) {
|
|
619
|
+
const E = n[c], d = o[c], h = 1 << c, u = i[h];
|
|
620
620
|
E.subVectors(r, u), d.setFromPoints(E, i);
|
|
621
621
|
}
|
|
622
622
|
const a = this.alignedSatBounds;
|
|
@@ -624,24 +624,24 @@ at.prototype.update = /* @__PURE__ */ function() {
|
|
|
624
624
|
};
|
|
625
625
|
}();
|
|
626
626
|
at.prototype.intersectsBox = function() {
|
|
627
|
-
const
|
|
627
|
+
const l = new Dt();
|
|
628
628
|
return function(t) {
|
|
629
629
|
this.needsUpdate && this.update();
|
|
630
630
|
const e = t.min, i = t.max, o = this.satBounds, n = this.satAxes, r = this.alignedSatBounds;
|
|
631
|
-
if (
|
|
631
|
+
if (l.min = e.x, l.max = i.x, r[0].isSeparated(l) || (l.min = e.y, l.max = i.y, r[1].isSeparated(l)) || (l.min = e.z, l.max = i.z, r[2].isSeparated(l)))
|
|
632
632
|
return !1;
|
|
633
633
|
for (let a = 0; a < 3; a++) {
|
|
634
|
-
const
|
|
635
|
-
if (
|
|
634
|
+
const c = n[a], E = o[a];
|
|
635
|
+
if (l.setFromBox(c, t), E.isSeparated(l))
|
|
636
636
|
return !1;
|
|
637
637
|
}
|
|
638
638
|
return !0;
|
|
639
639
|
};
|
|
640
640
|
}();
|
|
641
641
|
at.prototype.intersectsTriangle = function() {
|
|
642
|
-
const
|
|
642
|
+
const l = new gt(), s = new Array(3), t = new Dt(), e = new Dt(), i = new M();
|
|
643
643
|
return function(n) {
|
|
644
|
-
this.needsUpdate && this.update(), n.isExtendedTriangle ? n.needsUpdate && n.update() : (
|
|
644
|
+
this.needsUpdate && this.update(), n.isExtendedTriangle ? n.needsUpdate && n.update() : (l.copy(n), l.update(), n = l);
|
|
645
645
|
const r = this.satBounds, a = this.satAxes;
|
|
646
646
|
s[0] = n.a, s[1] = n.b, s[2] = n.c;
|
|
647
647
|
for (let h = 0; h < 3; h++) {
|
|
@@ -649,9 +649,9 @@ at.prototype.intersectsTriangle = function() {
|
|
|
649
649
|
if (t.setFromPoints(p, s), u.isSeparated(t))
|
|
650
650
|
return !1;
|
|
651
651
|
}
|
|
652
|
-
const
|
|
652
|
+
const c = n.satBounds, E = n.satAxes, d = this.points;
|
|
653
653
|
for (let h = 0; h < 3; h++) {
|
|
654
|
-
const u =
|
|
654
|
+
const u = c[h], p = E[h];
|
|
655
655
|
if (t.setFromPoints(p, d), u.isSeparated(t))
|
|
656
656
|
return !1;
|
|
657
657
|
}
|
|
@@ -672,23 +672,23 @@ at.prototype.closestPointToPoint = /* @__PURE__ */ function() {
|
|
|
672
672
|
};
|
|
673
673
|
}();
|
|
674
674
|
at.prototype.distanceToPoint = function() {
|
|
675
|
-
const
|
|
675
|
+
const l = new M();
|
|
676
676
|
return function(t) {
|
|
677
|
-
return this.closestPointToPoint(t,
|
|
677
|
+
return this.closestPointToPoint(t, l), t.distanceTo(l);
|
|
678
678
|
};
|
|
679
679
|
}();
|
|
680
680
|
at.prototype.distanceToBox = function() {
|
|
681
|
-
const
|
|
682
|
-
return function(n, r = 0, a = null,
|
|
681
|
+
const l = ["x", "y", "z"], s = new Array(12).fill().map(() => new Pt()), t = new Array(12).fill().map(() => new Pt()), e = new M(), i = new M();
|
|
682
|
+
return function(n, r = 0, a = null, c = null) {
|
|
683
683
|
if (this.needsUpdate && this.update(), this.intersectsBox(n))
|
|
684
|
-
return (a ||
|
|
684
|
+
return (a || c) && (n.getCenter(i), this.closestPointToPoint(i, e), n.closestPointToPoint(e, i), a && a.copy(e), c && c.copy(i)), 0;
|
|
685
685
|
const E = r * r, d = n.min, h = n.max, u = this.points;
|
|
686
686
|
let p = 1 / 0;
|
|
687
687
|
for (let A = 0; A < 8; A++) {
|
|
688
688
|
const C = u[A];
|
|
689
689
|
i.copy(C).clamp(d, h);
|
|
690
690
|
const T = C.distanceToSquared(i);
|
|
691
|
-
if (T < p && (p = T, a && a.copy(C),
|
|
691
|
+
if (T < p && (p = T, a && a.copy(C), c && c.copy(i), T < E))
|
|
692
692
|
return Math.sqrt(T);
|
|
693
693
|
}
|
|
694
694
|
let R = 0;
|
|
@@ -697,15 +697,15 @@ at.prototype.distanceToBox = function() {
|
|
|
697
697
|
for (let T = 0; T <= 1; T++) {
|
|
698
698
|
const F = (A + 1) % 3, f = (A + 2) % 3, m = C << F | T << f, g = 1 << A | C << F | T << f, S = u[m], _ = u[g];
|
|
699
699
|
s[R].set(S, _);
|
|
700
|
-
const
|
|
701
|
-
x[
|
|
700
|
+
const L = l[A], w = l[F], P = l[f], D = t[R], x = D.start, B = D.end;
|
|
701
|
+
x[L] = d[L], x[w] = C ? d[w] : h[w], x[P] = T ? d[P] : h[w], B[L] = h[L], B[w] = C ? d[w] : h[w], B[P] = T ? d[P] : h[w], R++;
|
|
702
702
|
}
|
|
703
703
|
for (let A = 0; A <= 1; A++)
|
|
704
704
|
for (let C = 0; C <= 1; C++)
|
|
705
705
|
for (let T = 0; T <= 1; T++) {
|
|
706
706
|
i.x = A ? h.x : d.x, i.y = C ? h.y : d.y, i.z = T ? h.z : d.z, this.closestPointToPoint(i, e);
|
|
707
707
|
const F = i.distanceToSquared(e);
|
|
708
|
-
if (F < p && (p = F, a && a.copy(e),
|
|
708
|
+
if (F < p && (p = F, a && a.copy(e), c && c.copy(i), F < E))
|
|
709
709
|
return Math.sqrt(F);
|
|
710
710
|
}
|
|
711
711
|
for (let A = 0; A < 12; A++) {
|
|
@@ -714,7 +714,7 @@ at.prototype.distanceToBox = function() {
|
|
|
714
714
|
const F = t[T];
|
|
715
715
|
Ci(C, F, e, i);
|
|
716
716
|
const f = e.distanceToSquared(i);
|
|
717
|
-
if (f < p && (p = f, a && a.copy(e),
|
|
717
|
+
if (f < p && (p = f, a && a.copy(e), c && c.copy(i), f < E))
|
|
718
718
|
return Math.sqrt(f);
|
|
719
719
|
}
|
|
720
720
|
}
|
|
@@ -739,23 +739,23 @@ class po extends Ti {
|
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
741
|
const It = /* @__PURE__ */ new po();
|
|
742
|
-
function ht(
|
|
743
|
-
return s[
|
|
742
|
+
function ht(l, s) {
|
|
743
|
+
return s[l + 15] === 65535;
|
|
744
744
|
}
|
|
745
|
-
function Et(
|
|
746
|
-
return s[
|
|
745
|
+
function Et(l, s) {
|
|
746
|
+
return s[l + 6];
|
|
747
747
|
}
|
|
748
|
-
function ft(
|
|
749
|
-
return s[
|
|
748
|
+
function ft(l, s) {
|
|
749
|
+
return s[l + 14];
|
|
750
750
|
}
|
|
751
|
-
function pt(
|
|
752
|
-
return
|
|
751
|
+
function pt(l) {
|
|
752
|
+
return l + 8;
|
|
753
753
|
}
|
|
754
|
-
function Ct(
|
|
755
|
-
return s[
|
|
754
|
+
function Ct(l, s) {
|
|
755
|
+
return s[l + 6];
|
|
756
756
|
}
|
|
757
|
-
function Nn(
|
|
758
|
-
return s[
|
|
757
|
+
function Nn(l, s) {
|
|
758
|
+
return s[l + 7];
|
|
759
759
|
}
|
|
760
760
|
class Co {
|
|
761
761
|
constructor() {
|
|
@@ -770,48 +770,48 @@ class Co {
|
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
772
|
const Z = new Co();
|
|
773
|
-
let
|
|
773
|
+
let Gt, Ie;
|
|
774
774
|
const Jt = [], Ke = /* @__PURE__ */ new Ti(() => new Ot());
|
|
775
|
-
function To(
|
|
776
|
-
|
|
777
|
-
const n = si(0,
|
|
778
|
-
Z.clearBuffer(), Ke.releasePrimitive(
|
|
775
|
+
function To(l, s, t, e, i, o) {
|
|
776
|
+
Gt = Ke.getPrimitive(), Ie = Ke.getPrimitive(), Jt.push(Gt, Ie), Z.setBuffer(l._roots[s]);
|
|
777
|
+
const n = si(0, l.geometry, t, e, i, o);
|
|
778
|
+
Z.clearBuffer(), Ke.releasePrimitive(Gt), Ke.releasePrimitive(Ie), Jt.pop(), Jt.pop();
|
|
779
779
|
const r = Jt.length;
|
|
780
|
-
return r > 0 && (Ie = Jt[r - 1],
|
|
780
|
+
return r > 0 && (Ie = Jt[r - 1], Gt = Jt[r - 2]), n;
|
|
781
781
|
}
|
|
782
|
-
function si(
|
|
783
|
-
const { float32Array: r, uint16Array: a, uint32Array:
|
|
784
|
-
let E =
|
|
782
|
+
function si(l, s, t, e, i = null, o = 0, n = 0) {
|
|
783
|
+
const { float32Array: r, uint16Array: a, uint32Array: c } = Z;
|
|
784
|
+
let E = l * 2;
|
|
785
785
|
if (ht(E, a)) {
|
|
786
|
-
const h = Et(
|
|
787
|
-
return $(
|
|
786
|
+
const h = Et(l, c), u = ft(E, a);
|
|
787
|
+
return $(l, r, Gt), e(h, u, !1, n, o + l, Gt);
|
|
788
788
|
} else {
|
|
789
|
-
let
|
|
790
|
-
const { uint16Array:
|
|
791
|
-
let B =
|
|
792
|
-
for (; !ht(B,
|
|
793
|
-
|
|
794
|
-
return Et(
|
|
795
|
-
}, w = function(
|
|
796
|
-
const { uint16Array:
|
|
797
|
-
let B =
|
|
798
|
-
for (; !ht(B,
|
|
799
|
-
|
|
800
|
-
return Et(
|
|
789
|
+
let L = function(P) {
|
|
790
|
+
const { uint16Array: D, uint32Array: x } = Z;
|
|
791
|
+
let B = P * 2;
|
|
792
|
+
for (; !ht(B, D); )
|
|
793
|
+
P = pt(P), B = P * 2;
|
|
794
|
+
return Et(P, x);
|
|
795
|
+
}, w = function(P) {
|
|
796
|
+
const { uint16Array: D, uint32Array: x } = Z;
|
|
797
|
+
let B = P * 2;
|
|
798
|
+
for (; !ht(B, D); )
|
|
799
|
+
P = Ct(P, x), B = P * 2;
|
|
800
|
+
return Et(P, x) + ft(B, D);
|
|
801
801
|
};
|
|
802
|
-
const h = pt(
|
|
802
|
+
const h = pt(l), u = Ct(l, c);
|
|
803
803
|
let p = h, R = u, A, C, T, F;
|
|
804
|
-
if (i && (T =
|
|
804
|
+
if (i && (T = Gt, F = Ie, $(p, r, T), $(R, r, F), A = i(T), C = i(F), C < A)) {
|
|
805
805
|
p = u, R = h;
|
|
806
|
-
const
|
|
807
|
-
A = C, C =
|
|
806
|
+
const P = A;
|
|
807
|
+
A = C, C = P, T = F;
|
|
808
808
|
}
|
|
809
|
-
T || (T =
|
|
809
|
+
T || (T = Gt, $(p, r, T));
|
|
810
810
|
const f = ht(p * 2, a), m = t(T, f, A, n + 1, o + p);
|
|
811
811
|
let g;
|
|
812
|
-
if (m ===
|
|
813
|
-
const
|
|
814
|
-
g = e(
|
|
812
|
+
if (m === Li) {
|
|
813
|
+
const P = L(p), x = w(p) - P;
|
|
814
|
+
g = e(P, x, !0, n + 1, o + p, T);
|
|
815
815
|
} else
|
|
816
816
|
g = m && si(
|
|
817
817
|
p,
|
|
@@ -827,9 +827,9 @@ function si(c, s, t, e, i = null, o = 0, n = 0) {
|
|
|
827
827
|
F = Ie, $(R, r, F);
|
|
828
828
|
const S = ht(R * 2, a), _ = t(F, S, C, n + 1, o + R);
|
|
829
829
|
let N;
|
|
830
|
-
if (_ ===
|
|
831
|
-
const
|
|
832
|
-
N = e(
|
|
830
|
+
if (_ === Li) {
|
|
831
|
+
const P = L(R), x = w(R) - P;
|
|
832
|
+
N = e(P, x, !0, n + 1, o + R, F);
|
|
833
833
|
} else
|
|
834
834
|
N = _ && si(
|
|
835
835
|
R,
|
|
@@ -844,10 +844,10 @@ function si(c, s, t, e, i = null, o = 0, n = 0) {
|
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
846
|
const Ae = /* @__PURE__ */ new M(), Bs = /* @__PURE__ */ new M();
|
|
847
|
-
function mo(
|
|
847
|
+
function mo(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
|
-
if (
|
|
850
|
+
if (l.shapecast(
|
|
851
851
|
{
|
|
852
852
|
boundsTraverseOrder: (E) => (Ae.copy(s).clamp(E.min, E.max), Ae.distanceToSquared(s)),
|
|
853
853
|
intersectsBounds: (E, d, h) => h < r && h < n,
|
|
@@ -859,22 +859,22 @@ function mo(c, s, t = {}, e = 0, i = 1 / 0) {
|
|
|
859
859
|
}
|
|
860
860
|
), r === 1 / 0)
|
|
861
861
|
return null;
|
|
862
|
-
const
|
|
863
|
-
return t.point ? t.point.copy(Bs) : t.point = Bs.clone(), t.distance =
|
|
862
|
+
const c = Math.sqrt(r);
|
|
863
|
+
return t.point ? t.point.copy(Bs) : t.point = Bs.clone(), t.distance = c, t.faceIndex = a, t;
|
|
864
864
|
}
|
|
865
865
|
const te = /* @__PURE__ */ new M(), ee = /* @__PURE__ */ new M(), se = /* @__PURE__ */ new M(), Je = /* @__PURE__ */ new fe(), ts = /* @__PURE__ */ new fe(), es = /* @__PURE__ */ new fe(), Ui = /* @__PURE__ */ new M(), xi = /* @__PURE__ */ new M(), bi = /* @__PURE__ */ new M(), ss = /* @__PURE__ */ new M();
|
|
866
|
-
function Ro(
|
|
866
|
+
function Ro(l, s, t, e, i, o) {
|
|
867
867
|
let n;
|
|
868
|
-
return o ===
|
|
869
|
-
distance:
|
|
868
|
+
return o === Gn ? n = l.intersectTriangle(e, t, s, !0, i) : n = l.intersectTriangle(s, t, e, o !== Fn, i), n === null ? null : {
|
|
869
|
+
distance: l.origin.distanceTo(i),
|
|
870
870
|
point: i.clone()
|
|
871
871
|
};
|
|
872
872
|
}
|
|
873
|
-
function Ao(
|
|
873
|
+
function Ao(l, s, t, e, i, o, n, r, a) {
|
|
874
874
|
te.fromBufferAttribute(s, o), ee.fromBufferAttribute(s, n), se.fromBufferAttribute(s, r);
|
|
875
|
-
const
|
|
876
|
-
if (
|
|
877
|
-
e && (Je.fromBufferAttribute(e, o), ts.fromBufferAttribute(e, n), es.fromBufferAttribute(e, r),
|
|
875
|
+
const c = Ro(l, te, ee, se, ss, a);
|
|
876
|
+
if (c) {
|
|
877
|
+
e && (Je.fromBufferAttribute(e, o), ts.fromBufferAttribute(e, n), es.fromBufferAttribute(e, r), c.uv = ue.getInterpolation(ss, te, ee, se, Je, ts, es, new fe())), i && (Je.fromBufferAttribute(i, o), ts.fromBufferAttribute(i, n), es.fromBufferAttribute(i, r), c.uv1 = ue.getInterpolation(ss, te, ee, se, Je, ts, es, new fe())), t && (Ui.fromBufferAttribute(t, o), xi.fromBufferAttribute(t, n), bi.fromBufferAttribute(t, r), c.normal = ue.getInterpolation(ss, te, ee, se, Ui, xi, bi, new M()), c.normal.dot(l.direction) > 0 && c.normal.multiplyScalar(-1));
|
|
878
878
|
const E = {
|
|
879
879
|
a: o,
|
|
880
880
|
b: n,
|
|
@@ -882,62 +882,62 @@ function Ao(c, s, t, e, i, o, n, r, a) {
|
|
|
882
882
|
normal: new M(),
|
|
883
883
|
materialIndex: 0
|
|
884
884
|
};
|
|
885
|
-
ue.getNormal(te, ee, se, E.normal),
|
|
885
|
+
ue.getNormal(te, ee, se, E.normal), c.face = E, c.faceIndex = o;
|
|
886
886
|
}
|
|
887
|
-
return
|
|
887
|
+
return c;
|
|
888
888
|
}
|
|
889
|
-
function
|
|
889
|
+
function Ps(l, s, t, e, i) {
|
|
890
890
|
const o = e * 3;
|
|
891
891
|
let n = o + 0, r = o + 1, a = o + 2;
|
|
892
|
-
const
|
|
893
|
-
|
|
894
|
-
const { position: E, normal: d, uv: h, uv1: u } =
|
|
892
|
+
const c = l.index;
|
|
893
|
+
l.index && (n = c.getX(n), r = c.getX(r), a = c.getX(a));
|
|
894
|
+
const { position: E, normal: d, uv: h, uv1: u } = l.attributes, p = Ao(t, E, d, h, u, n, r, a, s);
|
|
895
895
|
return p ? (p.faceIndex = e, i && i.push(p), p) : null;
|
|
896
896
|
}
|
|
897
|
-
function tt(
|
|
898
|
-
const i =
|
|
899
|
-
let r = s, a = s + 1,
|
|
900
|
-
t && (r = t.getX(r), a = t.getX(a),
|
|
897
|
+
function tt(l, s, t, e) {
|
|
898
|
+
const i = l.a, o = l.b, n = l.c;
|
|
899
|
+
let r = s, a = s + 1, c = s + 2;
|
|
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 Fo(
|
|
903
|
-
const { geometry: n, _indirectBuffer: r } =
|
|
904
|
-
for (let a = e,
|
|
905
|
-
|
|
902
|
+
function Fo(l, s, t, e, i, o) {
|
|
903
|
+
const { geometry: n, _indirectBuffer: r } = l;
|
|
904
|
+
for (let a = e, c = e + i; a < c; a++)
|
|
905
|
+
Ps(n, s, t, a, o);
|
|
906
906
|
}
|
|
907
|
-
function go(
|
|
908
|
-
const { geometry: o, _indirectBuffer: n } =
|
|
907
|
+
function go(l, s, t, e, i) {
|
|
908
|
+
const { geometry: o, _indirectBuffer: n } = l;
|
|
909
909
|
let r = 1 / 0, a = null;
|
|
910
|
-
for (let
|
|
910
|
+
for (let c = e, E = e + i; c < E; c++) {
|
|
911
911
|
let d;
|
|
912
|
-
d =
|
|
912
|
+
d = Ps(o, s, t, c), d && d.distance < r && (a = d, r = d.distance);
|
|
913
913
|
}
|
|
914
914
|
return a;
|
|
915
915
|
}
|
|
916
|
-
function Oo(
|
|
917
|
-
const { geometry: r } = t, { index: a } = r,
|
|
918
|
-
for (let E =
|
|
916
|
+
function Oo(l, s, t, e, i, o, n) {
|
|
917
|
+
const { geometry: r } = t, { index: a } = r, c = r.attributes.position;
|
|
918
|
+
for (let E = l, d = s + l; E < d; E++) {
|
|
919
919
|
let h;
|
|
920
|
-
if (h = E, tt(n, h * 3, a,
|
|
920
|
+
if (h = E, tt(n, h * 3, a, c), n.needsUpdate = !0, e(n, h, i, o))
|
|
921
921
|
return !0;
|
|
922
922
|
}
|
|
923
923
|
return !1;
|
|
924
924
|
}
|
|
925
|
-
function So(
|
|
925
|
+
function So(l, s = null) {
|
|
926
926
|
s && Array.isArray(s) && (s = new Set(s));
|
|
927
|
-
const t =
|
|
928
|
-
let o, n, r, a,
|
|
929
|
-
const E =
|
|
927
|
+
const t = l.geometry, e = t.index ? t.index.array : null, i = t.attributes.position;
|
|
928
|
+
let o, n, r, a, c = 0;
|
|
929
|
+
const E = l._roots;
|
|
930
930
|
for (let h = 0, u = E.length; h < u; h++)
|
|
931
|
-
o = E[h], n = new Uint32Array(o), r = new Uint16Array(o), a = new Float32Array(o), d(0,
|
|
931
|
+
o = E[h], n = new Uint32Array(o), r = new Uint16Array(o), a = new Float32Array(o), d(0, c), c += o.byteLength;
|
|
932
932
|
function d(h, u, p = !1) {
|
|
933
933
|
const R = h * 2;
|
|
934
|
-
if (r[R + 15] ===
|
|
934
|
+
if (r[R + 15] === Ls) {
|
|
935
935
|
const C = n[h + 6], T = r[R + 14];
|
|
936
936
|
let F = 1 / 0, f = 1 / 0, m = 1 / 0, g = -1 / 0, S = -1 / 0, _ = -1 / 0;
|
|
937
|
-
for (let N = 3 * C,
|
|
937
|
+
for (let N = 3 * C, L = 3 * (C + T); N < L; N++) {
|
|
938
938
|
let w = e[N];
|
|
939
|
-
const
|
|
940
|
-
|
|
939
|
+
const P = i.getX(w), D = i.getY(w), x = i.getZ(w);
|
|
940
|
+
P < F && (F = P), P > g && (g = P), D < f && (f = D), D > S && (S = D), x < m && (m = x), x > _ && (_ = x);
|
|
941
941
|
}
|
|
942
942
|
return a[h + 0] !== F || a[h + 1] !== f || a[h + 2] !== m || a[h + 3] !== g || a[h + 4] !== S || a[h + 5] !== _ ? (a[h + 0] = F, a[h + 1] = f, a[h + 2] = m, a[h + 3] = g, a[h + 4] = S, a[h + 5] = _, !0) : !1;
|
|
943
943
|
} else {
|
|
@@ -945,107 +945,107 @@ function So(c, s = null) {
|
|
|
945
945
|
let m = p, g = !1, S = !1;
|
|
946
946
|
s ? m || (g = s.has(F), S = s.has(f), m = !g && !S) : (g = !0, S = !0);
|
|
947
947
|
const _ = m || g, N = m || S;
|
|
948
|
-
let
|
|
949
|
-
_ && (
|
|
948
|
+
let L = !1;
|
|
949
|
+
_ && (L = d(C, u, m));
|
|
950
950
|
let w = !1;
|
|
951
951
|
N && (w = d(T, u, m));
|
|
952
|
-
const
|
|
953
|
-
if (
|
|
954
|
-
for (let
|
|
955
|
-
const x = C +
|
|
956
|
-
a[h +
|
|
952
|
+
const P = L || w;
|
|
953
|
+
if (P)
|
|
954
|
+
for (let D = 0; D < 3; D++) {
|
|
955
|
+
const x = C + D, B = T + D, H = a[x], q = a[x + 3], et = a[B], Q = a[B + 3];
|
|
956
|
+
a[h + D] = H < et ? H : et, a[h + D + 3] = q > Q ? q : Q;
|
|
957
957
|
}
|
|
958
|
-
return
|
|
958
|
+
return P;
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
961
|
}
|
|
962
962
|
const vi = /* @__PURE__ */ new Ot();
|
|
963
|
-
function
|
|
964
|
-
return $(
|
|
963
|
+
function Vt(l, s, t, e) {
|
|
964
|
+
return $(l, s, vi), t.intersectBox(vi, e);
|
|
965
965
|
}
|
|
966
|
-
function _o(
|
|
967
|
-
const { geometry: n, _indirectBuffer: r } =
|
|
968
|
-
for (let a = e,
|
|
966
|
+
function _o(l, s, t, e, i, o) {
|
|
967
|
+
const { geometry: n, _indirectBuffer: r } = l;
|
|
968
|
+
for (let a = e, c = e + i; a < c; a++) {
|
|
969
969
|
let E = r ? r[a] : a;
|
|
970
|
-
|
|
970
|
+
Ps(n, s, t, E, o);
|
|
971
971
|
}
|
|
972
972
|
}
|
|
973
|
-
function No(
|
|
974
|
-
const { geometry: o, _indirectBuffer: n } =
|
|
973
|
+
function No(l, s, t, e, i) {
|
|
974
|
+
const { geometry: o, _indirectBuffer: n } = l;
|
|
975
975
|
let r = 1 / 0, a = null;
|
|
976
|
-
for (let
|
|
976
|
+
for (let c = e, E = e + i; c < E; c++) {
|
|
977
977
|
let d;
|
|
978
|
-
d =
|
|
978
|
+
d = Ps(o, s, t, n ? n[c] : c), d && d.distance < r && (a = d, r = d.distance);
|
|
979
979
|
}
|
|
980
980
|
return a;
|
|
981
981
|
}
|
|
982
|
-
function
|
|
983
|
-
const { geometry: r } = t, { index: a } = r,
|
|
984
|
-
for (let E =
|
|
982
|
+
function yo(l, s, t, e, i, o, n) {
|
|
983
|
+
const { geometry: r } = t, { index: a } = r, c = r.attributes.position;
|
|
984
|
+
for (let E = l, d = s + l; E < d; E++) {
|
|
985
985
|
let h;
|
|
986
|
-
if (h = t.resolveTriangleIndex(E), tt(n, h * 3, a,
|
|
986
|
+
if (h = t.resolveTriangleIndex(E), tt(n, h * 3, a, c), n.needsUpdate = !0, e(n, h, i, o))
|
|
987
987
|
return !0;
|
|
988
988
|
}
|
|
989
989
|
return !1;
|
|
990
990
|
}
|
|
991
991
|
const Bi = /* @__PURE__ */ new M();
|
|
992
|
-
function
|
|
993
|
-
Z.setBuffer(
|
|
992
|
+
function Lo(l, s, t, e, i) {
|
|
993
|
+
Z.setBuffer(l._roots[s]), ii(0, l, t, e, i), Z.clearBuffer();
|
|
994
994
|
}
|
|
995
|
-
function ii(
|
|
996
|
-
const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a =
|
|
995
|
+
function ii(l, s, t, e, i) {
|
|
996
|
+
const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = l * 2;
|
|
997
997
|
if (ht(a, n)) {
|
|
998
|
-
const E = Et(
|
|
998
|
+
const E = Et(l, r), d = ft(a, n);
|
|
999
999
|
Fo(s, t, e, E, d, i);
|
|
1000
1000
|
} else {
|
|
1001
|
-
const E = pt(
|
|
1002
|
-
|
|
1003
|
-
const d = Ct(
|
|
1004
|
-
|
|
1001
|
+
const E = pt(l);
|
|
1002
|
+
Vt(E, o, e, Bi) && ii(E, s, t, e, i);
|
|
1003
|
+
const d = Ct(l, r);
|
|
1004
|
+
Vt(d, o, e, Bi) && ii(d, s, t, e, i);
|
|
1005
1005
|
}
|
|
1006
1006
|
}
|
|
1007
|
-
const Yi = /* @__PURE__ */ new M(),
|
|
1008
|
-
function Mo(
|
|
1009
|
-
Z.setBuffer(
|
|
1010
|
-
const i = ni(0,
|
|
1007
|
+
const Yi = /* @__PURE__ */ new M(), Po = ["x", "y", "z"];
|
|
1008
|
+
function Mo(l, s, t, e) {
|
|
1009
|
+
Z.setBuffer(l._roots[s]);
|
|
1010
|
+
const i = ni(0, l, t, e);
|
|
1011
1011
|
return Z.clearBuffer(), i;
|
|
1012
1012
|
}
|
|
1013
|
-
function ni(
|
|
1013
|
+
function ni(l, s, t, e) {
|
|
1014
1014
|
const { float32Array: i, uint16Array: o, uint32Array: n } = Z;
|
|
1015
|
-
let r =
|
|
1015
|
+
let r = l * 2;
|
|
1016
1016
|
if (ht(r, o)) {
|
|
1017
|
-
const
|
|
1018
|
-
return go(s, t, e,
|
|
1017
|
+
const c = Et(l, n), E = ft(r, o);
|
|
1018
|
+
return go(s, t, e, c, E);
|
|
1019
1019
|
} else {
|
|
1020
|
-
const
|
|
1020
|
+
const c = Nn(l, n), E = Po[c], h = e.direction[E] >= 0;
|
|
1021
1021
|
let u, p;
|
|
1022
|
-
h ? (u = pt(
|
|
1023
|
-
const A =
|
|
1022
|
+
h ? (u = pt(l), p = Ct(l, n)) : (u = Ct(l, n), p = pt(l));
|
|
1023
|
+
const A = Vt(u, i, e, Yi) ? ni(u, s, t, e) : null;
|
|
1024
1024
|
if (A) {
|
|
1025
1025
|
const F = A.point[E];
|
|
1026
|
-
if (h ? F <= i[p +
|
|
1026
|
+
if (h ? F <= i[p + c] : (
|
|
1027
1027
|
// min bounding data
|
|
1028
|
-
F >= i[p +
|
|
1028
|
+
F >= i[p + c + 3]
|
|
1029
1029
|
))
|
|
1030
1030
|
return A;
|
|
1031
1031
|
}
|
|
1032
|
-
const T =
|
|
1032
|
+
const T = Vt(p, i, e, Yi) ? ni(p, s, t, e) : null;
|
|
1033
1033
|
return A && T ? A.distance <= T.distance ? A : T : A || T || null;
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
|
-
const is = /* @__PURE__ */ new Ot(), ie = /* @__PURE__ */ new gt(), ne = /* @__PURE__ */ new gt(), Fe = /* @__PURE__ */ new Mt(),
|
|
1037
|
-
function wo(
|
|
1038
|
-
Z.setBuffer(
|
|
1039
|
-
const i = oi(0,
|
|
1036
|
+
const is = /* @__PURE__ */ new Ot(), ie = /* @__PURE__ */ new gt(), ne = /* @__PURE__ */ new gt(), Fe = /* @__PURE__ */ new Mt(), Gi = /* @__PURE__ */ new at(), ns = /* @__PURE__ */ new at();
|
|
1037
|
+
function wo(l, s, t, e) {
|
|
1038
|
+
Z.setBuffer(l._roots[s]);
|
|
1039
|
+
const i = oi(0, l, t, e);
|
|
1040
1040
|
return Z.clearBuffer(), i;
|
|
1041
1041
|
}
|
|
1042
|
-
function oi(
|
|
1042
|
+
function oi(l, s, t, e, i = null) {
|
|
1043
1043
|
const { float32Array: o, uint16Array: n, uint32Array: r } = Z;
|
|
1044
|
-
let a =
|
|
1045
|
-
if (i === null && (t.boundingBox || t.computeBoundingBox(),
|
|
1046
|
-
const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, R = Et(
|
|
1044
|
+
let a = l * 2;
|
|
1045
|
+
if (i === null && (t.boundingBox || t.computeBoundingBox(), Gi.set(t.boundingBox.min, t.boundingBox.max, e), i = Gi), ht(a, n)) {
|
|
1046
|
+
const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, R = Et(l, r), A = ft(a, n);
|
|
1047
1047
|
if (Fe.copy(e).invert(), t.boundsTree)
|
|
1048
|
-
return $(
|
|
1048
|
+
return $(l, o, ns), ns.matrix.copy(Fe), ns.needsUpdate = !0, t.boundsTree.shapecast({
|
|
1049
1049
|
intersectsBounds: (T) => ns.intersectsBox(T),
|
|
1050
1050
|
intersectsTriangle: (T) => {
|
|
1051
1051
|
T.a.applyMatrix4(e), T.b.applyMatrix4(e), T.c.applyMatrix4(e), T.needsUpdate = !0;
|
|
@@ -1062,18 +1062,18 @@ function oi(c, s, t, e, i = null) {
|
|
|
1062
1062
|
return !0;
|
|
1063
1063
|
}
|
|
1064
1064
|
} else {
|
|
1065
|
-
const E =
|
|
1065
|
+
const E = l + 8, d = r[l + 6];
|
|
1066
1066
|
return $(E, o, is), !!(i.intersectsBox(is) && oi(E, s, t, e, i) || ($(d, o, is), i.intersectsBox(is) && oi(d, s, t, e, i)));
|
|
1067
1067
|
}
|
|
1068
1068
|
}
|
|
1069
1069
|
const os = /* @__PURE__ */ new Mt(), Ys = /* @__PURE__ */ new at(), ge = /* @__PURE__ */ new at(), Do = /* @__PURE__ */ new M(), Uo = /* @__PURE__ */ new M(), xo = /* @__PURE__ */ new M(), bo = /* @__PURE__ */ new M();
|
|
1070
|
-
function vo(
|
|
1070
|
+
function vo(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
1071
1071
|
s.boundingBox || s.computeBoundingBox(), Ys.set(s.boundingBox.min, s.boundingBox.max, t), Ys.needsUpdate = !0;
|
|
1072
|
-
const r =
|
|
1072
|
+
const r = l.geometry, a = r.attributes.position, c = r.index, E = s.attributes.position, d = s.index, h = It.getPrimitive(), u = It.getPrimitive();
|
|
1073
1073
|
let p = Do, R = Uo, A = null, C = null;
|
|
1074
1074
|
i && (A = xo, C = bo);
|
|
1075
1075
|
let T = 1 / 0, F = null, f = null;
|
|
1076
|
-
return os.copy(t).invert(), ge.matrix.copy(os),
|
|
1076
|
+
return os.copy(t).invert(), ge.matrix.copy(os), l.shapecast(
|
|
1077
1077
|
{
|
|
1078
1078
|
boundsTraverseOrder: (m) => Ys.distanceToBox(m),
|
|
1079
1079
|
intersectsBounds: (m, g, S) => S < T && S < n ? (g && (ge.min.copy(m.min), ge.max.copy(m.max), ge.needsUpdate = !0), !0) : !1,
|
|
@@ -1081,14 +1081,14 @@ function vo(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1081
1081
|
if (s.boundsTree)
|
|
1082
1082
|
return s.boundsTree.shapecast({
|
|
1083
1083
|
boundsTraverseOrder: (_) => ge.distanceToBox(_),
|
|
1084
|
-
intersectsBounds: (_, N,
|
|
1084
|
+
intersectsBounds: (_, N, L) => L < T && L < n,
|
|
1085
1085
|
intersectsRange: (_, N) => {
|
|
1086
|
-
for (let
|
|
1087
|
-
tt(u, 3 *
|
|
1088
|
-
for (let
|
|
1089
|
-
tt(h, 3 *
|
|
1086
|
+
for (let L = _, w = _ + N; L < w; L++) {
|
|
1087
|
+
tt(u, 3 * L, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1088
|
+
for (let P = m, D = m + g; P < D; P++) {
|
|
1089
|
+
tt(h, 3 * P, c, a), h.needsUpdate = !0;
|
|
1090
1090
|
const x = h.distanceToTriangle(u, p, A);
|
|
1091
|
-
if (x < T && (R.copy(p), C && C.copy(A), T = x, F =
|
|
1091
|
+
if (x < T && (R.copy(p), C && C.copy(A), T = x, F = P, f = L), x < o)
|
|
1092
1092
|
return !0;
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
@@ -1098,10 +1098,10 @@ function vo(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1098
1098
|
const S = pe(s);
|
|
1099
1099
|
for (let _ = 0, N = S; _ < N; _++) {
|
|
1100
1100
|
tt(u, 3 * _, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1101
|
-
for (let
|
|
1102
|
-
tt(h, 3 *
|
|
1103
|
-
const
|
|
1104
|
-
if (
|
|
1101
|
+
for (let L = m, w = m + g; L < w; L++) {
|
|
1102
|
+
tt(h, 3 * L, c, a), h.needsUpdate = !0;
|
|
1103
|
+
const P = h.distanceToTriangle(u, p, A);
|
|
1104
|
+
if (P < T && (R.copy(p), C && C.copy(A), T = P, F = L, f = _), P < o)
|
|
1105
1105
|
return !0;
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
@@ -1110,24 +1110,24 @@ function vo(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
), It.releasePrimitive(h), It.releasePrimitive(u), T === 1 / 0 ? null : (e.point ? e.point.copy(R) : e.point = R.clone(), e.distance = T, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(os), R.applyMatrix4(os), i.distance = R.sub(i.point).length(), i.faceIndex = f), e);
|
|
1112
1112
|
}
|
|
1113
|
-
function Bo(
|
|
1113
|
+
function Bo(l, s = null) {
|
|
1114
1114
|
s && Array.isArray(s) && (s = new Set(s));
|
|
1115
|
-
const t =
|
|
1116
|
-
let o, n, r, a,
|
|
1117
|
-
const E =
|
|
1115
|
+
const t = l.geometry, e = t.index ? t.index.array : null, i = t.attributes.position;
|
|
1116
|
+
let o, n, r, a, c = 0;
|
|
1117
|
+
const E = l._roots;
|
|
1118
1118
|
for (let h = 0, u = E.length; h < u; h++)
|
|
1119
|
-
o = E[h], n = new Uint32Array(o), r = new Uint16Array(o), a = new Float32Array(o), d(0,
|
|
1119
|
+
o = E[h], n = new Uint32Array(o), r = new Uint16Array(o), a = new Float32Array(o), d(0, c), c += o.byteLength;
|
|
1120
1120
|
function d(h, u, p = !1) {
|
|
1121
1121
|
const R = h * 2;
|
|
1122
|
-
if (r[R + 15] ===
|
|
1122
|
+
if (r[R + 15] === Ls) {
|
|
1123
1123
|
const C = n[h + 6], T = r[R + 14];
|
|
1124
1124
|
let F = 1 / 0, f = 1 / 0, m = 1 / 0, g = -1 / 0, S = -1 / 0, _ = -1 / 0;
|
|
1125
|
-
for (let N = C,
|
|
1126
|
-
const w = 3 *
|
|
1127
|
-
for (let
|
|
1128
|
-
let
|
|
1129
|
-
|
|
1130
|
-
const x = i.getX(
|
|
1125
|
+
for (let N = C, L = C + T; N < L; N++) {
|
|
1126
|
+
const w = 3 * l.resolveTriangleIndex(N);
|
|
1127
|
+
for (let P = 0; P < 3; P++) {
|
|
1128
|
+
let D = w + P;
|
|
1129
|
+
D = e ? e[D] : D;
|
|
1130
|
+
const x = i.getX(D), B = i.getY(D), H = i.getZ(D);
|
|
1131
1131
|
x < F && (F = x), x > g && (g = x), B < f && (f = B), B > S && (S = B), H < m && (m = H), H > _ && (_ = H);
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
@@ -1137,78 +1137,78 @@ function Bo(c, s = null) {
|
|
|
1137
1137
|
let m = p, g = !1, S = !1;
|
|
1138
1138
|
s ? m || (g = s.has(F), S = s.has(f), m = !g && !S) : (g = !0, S = !0);
|
|
1139
1139
|
const _ = m || g, N = m || S;
|
|
1140
|
-
let
|
|
1141
|
-
_ && (
|
|
1140
|
+
let L = !1;
|
|
1141
|
+
_ && (L = d(C, u, m));
|
|
1142
1142
|
let w = !1;
|
|
1143
1143
|
N && (w = d(T, u, m));
|
|
1144
|
-
const
|
|
1145
|
-
if (
|
|
1146
|
-
for (let
|
|
1147
|
-
const x = C +
|
|
1148
|
-
a[h +
|
|
1144
|
+
const P = L || w;
|
|
1145
|
+
if (P)
|
|
1146
|
+
for (let D = 0; D < 3; D++) {
|
|
1147
|
+
const x = C + D, B = T + D, H = a[x], q = a[x + 3], et = a[B], Q = a[B + 3];
|
|
1148
|
+
a[h + D] = H < et ? H : et, a[h + D + 3] = q > Q ? q : Q;
|
|
1149
1149
|
}
|
|
1150
|
-
return
|
|
1150
|
+
return P;
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
|
-
const
|
|
1155
|
-
function Yo(
|
|
1156
|
-
Z.setBuffer(
|
|
1154
|
+
const Vi = /* @__PURE__ */ new M();
|
|
1155
|
+
function Yo(l, s, t, e, i) {
|
|
1156
|
+
Z.setBuffer(l._roots[s]), ri(0, l, t, e, i), Z.clearBuffer();
|
|
1157
1157
|
}
|
|
1158
|
-
function ri(
|
|
1159
|
-
const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a =
|
|
1158
|
+
function ri(l, s, t, e, i) {
|
|
1159
|
+
const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = l * 2;
|
|
1160
1160
|
if (ht(a, n)) {
|
|
1161
|
-
const E = Et(
|
|
1161
|
+
const E = Et(l, r), d = ft(a, n);
|
|
1162
1162
|
_o(s, t, e, E, d, i);
|
|
1163
1163
|
} else {
|
|
1164
|
-
const E = pt(
|
|
1165
|
-
|
|
1166
|
-
const d = Ct(
|
|
1167
|
-
|
|
1164
|
+
const E = pt(l);
|
|
1165
|
+
Vt(E, o, e, Vi) && ri(E, s, t, e, i);
|
|
1166
|
+
const d = Ct(l, r);
|
|
1167
|
+
Vt(d, o, e, Vi) && ri(d, s, t, e, i);
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
|
-
const zi = /* @__PURE__ */ new M(),
|
|
1171
|
-
function
|
|
1172
|
-
Z.setBuffer(
|
|
1173
|
-
const i = ai(0,
|
|
1170
|
+
const zi = /* @__PURE__ */ new M(), Go = ["x", "y", "z"];
|
|
1171
|
+
function Vo(l, s, t, e) {
|
|
1172
|
+
Z.setBuffer(l._roots[s]);
|
|
1173
|
+
const i = ai(0, l, t, e);
|
|
1174
1174
|
return Z.clearBuffer(), i;
|
|
1175
1175
|
}
|
|
1176
|
-
function ai(
|
|
1176
|
+
function ai(l, s, t, e) {
|
|
1177
1177
|
const { float32Array: i, uint16Array: o, uint32Array: n } = Z;
|
|
1178
|
-
let r =
|
|
1178
|
+
let r = l * 2;
|
|
1179
1179
|
if (ht(r, o)) {
|
|
1180
|
-
const
|
|
1181
|
-
return No(s, t, e,
|
|
1180
|
+
const c = Et(l, n), E = ft(r, o);
|
|
1181
|
+
return No(s, t, e, c, E);
|
|
1182
1182
|
} else {
|
|
1183
|
-
const
|
|
1183
|
+
const c = Nn(l, n), E = Go[c], h = e.direction[E] >= 0;
|
|
1184
1184
|
let u, p;
|
|
1185
|
-
h ? (u = pt(
|
|
1186
|
-
const A =
|
|
1185
|
+
h ? (u = pt(l), p = Ct(l, n)) : (u = Ct(l, n), p = pt(l));
|
|
1186
|
+
const A = Vt(u, i, e, zi) ? ai(u, s, t, e) : null;
|
|
1187
1187
|
if (A) {
|
|
1188
1188
|
const F = A.point[E];
|
|
1189
|
-
if (h ? F <= i[p +
|
|
1189
|
+
if (h ? F <= i[p + c] : (
|
|
1190
1190
|
// min bounding data
|
|
1191
|
-
F >= i[p +
|
|
1191
|
+
F >= i[p + c + 3]
|
|
1192
1192
|
))
|
|
1193
1193
|
return A;
|
|
1194
1194
|
}
|
|
1195
|
-
const T =
|
|
1195
|
+
const T = Vt(p, i, e, zi) ? ai(p, s, t, e) : null;
|
|
1196
1196
|
return A && T ? A.distance <= T.distance ? A : T : A || T || null;
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
1199
1199
|
const rs = /* @__PURE__ */ new Ot(), oe = /* @__PURE__ */ new gt(), re = /* @__PURE__ */ new gt(), Oe = /* @__PURE__ */ new Mt(), Hi = /* @__PURE__ */ new at(), as = /* @__PURE__ */ new at();
|
|
1200
|
-
function zo(
|
|
1201
|
-
Z.setBuffer(
|
|
1202
|
-
const i = ci(0,
|
|
1200
|
+
function zo(l, s, t, e) {
|
|
1201
|
+
Z.setBuffer(l._roots[s]);
|
|
1202
|
+
const i = ci(0, l, t, e);
|
|
1203
1203
|
return Z.clearBuffer(), i;
|
|
1204
1204
|
}
|
|
1205
|
-
function ci(
|
|
1205
|
+
function ci(l, s, t, e, i = null) {
|
|
1206
1206
|
const { float32Array: o, uint16Array: n, uint32Array: r } = Z;
|
|
1207
|
-
let a =
|
|
1207
|
+
let a = l * 2;
|
|
1208
1208
|
if (i === null && (t.boundingBox || t.computeBoundingBox(), Hi.set(t.boundingBox.min, t.boundingBox.max, e), i = Hi), ht(a, n)) {
|
|
1209
|
-
const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, R = Et(
|
|
1209
|
+
const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, R = Et(l, r), A = ft(a, n);
|
|
1210
1210
|
if (Oe.copy(e).invert(), t.boundsTree)
|
|
1211
|
-
return $(
|
|
1211
|
+
return $(l, o, as), as.matrix.copy(Oe), as.needsUpdate = !0, t.boundsTree.shapecast({
|
|
1212
1212
|
intersectsBounds: (T) => as.intersectsBox(T),
|
|
1213
1213
|
intersectsTriangle: (T) => {
|
|
1214
1214
|
T.a.applyMatrix4(e), T.b.applyMatrix4(e), T.c.applyMatrix4(e), T.needsUpdate = !0;
|
|
@@ -1226,36 +1226,36 @@ function ci(c, s, t, e, i = null) {
|
|
|
1226
1226
|
return !0;
|
|
1227
1227
|
}
|
|
1228
1228
|
} else {
|
|
1229
|
-
const E =
|
|
1229
|
+
const E = l + 8, d = r[l + 6];
|
|
1230
1230
|
return $(E, o, rs), !!(i.intersectsBox(rs) && ci(E, s, t, e, i) || ($(d, o, rs), i.intersectsBox(rs) && ci(d, s, t, e, i)));
|
|
1231
1231
|
}
|
|
1232
1232
|
}
|
|
1233
|
-
const cs = /* @__PURE__ */ new Mt(),
|
|
1234
|
-
function Zo(
|
|
1235
|
-
s.boundingBox || s.computeBoundingBox(),
|
|
1236
|
-
const r =
|
|
1233
|
+
const cs = /* @__PURE__ */ new Mt(), Gs = /* @__PURE__ */ new at(), Se = /* @__PURE__ */ new at(), Ho = /* @__PURE__ */ new M(), ko = /* @__PURE__ */ new M(), Wo = /* @__PURE__ */ new M(), Xo = /* @__PURE__ */ new M();
|
|
1234
|
+
function Zo(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
1235
|
+
s.boundingBox || s.computeBoundingBox(), Gs.set(s.boundingBox.min, s.boundingBox.max, t), Gs.needsUpdate = !0;
|
|
1236
|
+
const r = l.geometry, a = r.attributes.position, c = r.index, E = s.attributes.position, d = s.index, h = It.getPrimitive(), u = It.getPrimitive();
|
|
1237
1237
|
let p = Ho, R = ko, A = null, C = null;
|
|
1238
1238
|
i && (A = Wo, C = Xo);
|
|
1239
1239
|
let T = 1 / 0, F = null, f = null;
|
|
1240
|
-
return cs.copy(t).invert(), Se.matrix.copy(cs),
|
|
1240
|
+
return cs.copy(t).invert(), Se.matrix.copy(cs), l.shapecast(
|
|
1241
1241
|
{
|
|
1242
|
-
boundsTraverseOrder: (m) =>
|
|
1242
|
+
boundsTraverseOrder: (m) => Gs.distanceToBox(m),
|
|
1243
1243
|
intersectsBounds: (m, g, S) => S < T && S < n ? (g && (Se.min.copy(m.min), Se.max.copy(m.max), Se.needsUpdate = !0), !0) : !1,
|
|
1244
1244
|
intersectsRange: (m, g) => {
|
|
1245
1245
|
if (s.boundsTree) {
|
|
1246
1246
|
const S = s.boundsTree;
|
|
1247
1247
|
return S.shapecast({
|
|
1248
1248
|
boundsTraverseOrder: (_) => Se.distanceToBox(_),
|
|
1249
|
-
intersectsBounds: (_, N,
|
|
1249
|
+
intersectsBounds: (_, N, L) => L < T && L < n,
|
|
1250
1250
|
intersectsRange: (_, N) => {
|
|
1251
|
-
for (let
|
|
1252
|
-
const
|
|
1253
|
-
tt(u, 3 *
|
|
1254
|
-
for (let
|
|
1255
|
-
const B =
|
|
1256
|
-
tt(h, 3 * B,
|
|
1251
|
+
for (let L = _, w = _ + N; L < w; L++) {
|
|
1252
|
+
const P = S.resolveTriangleIndex(L);
|
|
1253
|
+
tt(u, 3 * P, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1254
|
+
for (let D = m, x = m + g; D < x; D++) {
|
|
1255
|
+
const B = l.resolveTriangleIndex(D);
|
|
1256
|
+
tt(h, 3 * B, c, a), h.needsUpdate = !0;
|
|
1257
1257
|
const H = h.distanceToTriangle(u, p, A);
|
|
1258
|
-
if (H < T && (R.copy(p), C && C.copy(A), T = H, F =
|
|
1258
|
+
if (H < T && (R.copy(p), C && C.copy(A), T = H, F = D, f = L), H < o)
|
|
1259
1259
|
return !0;
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
@@ -1265,11 +1265,11 @@ function Zo(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1265
1265
|
const S = pe(s);
|
|
1266
1266
|
for (let _ = 0, N = S; _ < N; _++) {
|
|
1267
1267
|
tt(u, 3 * _, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1268
|
-
for (let
|
|
1269
|
-
const
|
|
1270
|
-
tt(h, 3 *
|
|
1271
|
-
const
|
|
1272
|
-
if (
|
|
1268
|
+
for (let L = m, w = m + g; L < w; L++) {
|
|
1269
|
+
const P = l.resolveTriangleIndex(L);
|
|
1270
|
+
tt(h, 3 * P, c, a), h.needsUpdate = !0;
|
|
1271
|
+
const D = h.distanceToTriangle(u, p, A);
|
|
1272
|
+
if (D < T && (R.copy(p), C && C.copy(A), T = D, F = L, f = _), D < o)
|
|
1273
1273
|
return !0;
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
@@ -1281,24 +1281,24 @@ function Zo(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
|
1281
1281
|
function Qo() {
|
|
1282
1282
|
return typeof SharedArrayBuffer < "u";
|
|
1283
1283
|
}
|
|
1284
|
-
const xe = new Z.constructor(), As = new Z.constructor(), Bt = new Ti(() => new Ot()), ae = new Ot(), ce = new Ot(),
|
|
1284
|
+
const xe = new Z.constructor(), As = new Z.constructor(), Bt = new Ti(() => new Ot()), ae = new Ot(), ce = new Ot(), Vs = new Ot(), zs = new Ot();
|
|
1285
1285
|
let Hs = !1;
|
|
1286
|
-
function jo(
|
|
1286
|
+
function jo(l, s, t, e) {
|
|
1287
1287
|
if (Hs)
|
|
1288
1288
|
throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");
|
|
1289
1289
|
Hs = !0;
|
|
1290
|
-
const i =
|
|
1290
|
+
const i = l._roots, o = s._roots;
|
|
1291
1291
|
let n, r = 0, a = 0;
|
|
1292
|
-
const
|
|
1292
|
+
const c = new Mt().copy(t).invert();
|
|
1293
1293
|
for (let E = 0, d = i.length; E < d; E++) {
|
|
1294
1294
|
xe.setBuffer(i[E]), a = 0;
|
|
1295
1295
|
const h = Bt.getPrimitive();
|
|
1296
|
-
$(0, xe.float32Array, h), h.applyMatrix4(
|
|
1296
|
+
$(0, xe.float32Array, h), h.applyMatrix4(c);
|
|
1297
1297
|
for (let u = 0, p = o.length; u < p && (As.setBuffer(o[E]), n = Tt(
|
|
1298
1298
|
0,
|
|
1299
1299
|
0,
|
|
1300
1300
|
t,
|
|
1301
|
-
|
|
1301
|
+
c,
|
|
1302
1302
|
e,
|
|
1303
1303
|
r,
|
|
1304
1304
|
a,
|
|
@@ -1312,37 +1312,37 @@ function jo(c, s, t, e) {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
return Hs = !1, n;
|
|
1314
1314
|
}
|
|
1315
|
-
function Tt(
|
|
1315
|
+
function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
|
|
1316
1316
|
let d, h;
|
|
1317
1317
|
E ? (d = As, h = xe) : (d = xe, h = As);
|
|
1318
|
-
const u = d.float32Array, p = d.uint32Array, R = d.uint16Array, A = h.float32Array, C = h.uint32Array, T = h.uint16Array, F =
|
|
1318
|
+
const u = d.float32Array, p = d.uint32Array, R = d.uint16Array, A = h.float32Array, C = h.uint32Array, T = h.uint16Array, F = l * 2, f = s * 2, m = ht(F, R), g = ht(f, T);
|
|
1319
1319
|
let S = !1;
|
|
1320
1320
|
if (g && m)
|
|
1321
1321
|
E ? S = i(
|
|
1322
1322
|
Et(s, C),
|
|
1323
1323
|
ft(s * 2, T),
|
|
1324
|
-
Et(
|
|
1325
|
-
ft(
|
|
1324
|
+
Et(l, p),
|
|
1325
|
+
ft(l * 2, R),
|
|
1326
1326
|
a,
|
|
1327
1327
|
n + s,
|
|
1328
1328
|
r,
|
|
1329
|
-
o +
|
|
1329
|
+
o + l
|
|
1330
1330
|
) : S = i(
|
|
1331
|
-
Et(
|
|
1332
|
-
ft(
|
|
1331
|
+
Et(l, p),
|
|
1332
|
+
ft(l * 2, R),
|
|
1333
1333
|
Et(s, C),
|
|
1334
1334
|
ft(s * 2, T),
|
|
1335
1335
|
r,
|
|
1336
|
-
o +
|
|
1336
|
+
o + l,
|
|
1337
1337
|
a,
|
|
1338
1338
|
n + s
|
|
1339
1339
|
);
|
|
1340
1340
|
else if (g) {
|
|
1341
1341
|
const _ = Bt.getPrimitive();
|
|
1342
1342
|
$(s, A, _), _.applyMatrix4(t);
|
|
1343
|
-
const N = pt(
|
|
1344
|
-
$(N, u, ae), $(
|
|
1345
|
-
const w = _.intersectsBox(ae),
|
|
1343
|
+
const N = pt(l), L = Ct(l, p);
|
|
1344
|
+
$(N, u, ae), $(L, u, ce);
|
|
1345
|
+
const w = _.intersectsBox(ae), P = _.intersectsBox(ce);
|
|
1346
1346
|
S = w && Tt(
|
|
1347
1347
|
s,
|
|
1348
1348
|
N,
|
|
@@ -1355,9 +1355,9 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
|
|
|
1355
1355
|
r + 1,
|
|
1356
1356
|
_,
|
|
1357
1357
|
!E
|
|
1358
|
-
) ||
|
|
1358
|
+
) || P && Tt(
|
|
1359
1359
|
s,
|
|
1360
|
-
|
|
1360
|
+
L,
|
|
1361
1361
|
e,
|
|
1362
1362
|
t,
|
|
1363
1363
|
i,
|
|
@@ -1370,11 +1370,11 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
|
|
|
1370
1370
|
), Bt.releasePrimitive(_);
|
|
1371
1371
|
} else {
|
|
1372
1372
|
const _ = pt(s), N = Ct(s, C);
|
|
1373
|
-
$(_, A,
|
|
1374
|
-
const
|
|
1375
|
-
if (
|
|
1373
|
+
$(_, A, Vs), $(N, A, zs);
|
|
1374
|
+
const L = c.intersectsBox(Vs), w = c.intersectsBox(zs);
|
|
1375
|
+
if (L && w)
|
|
1376
1376
|
S = Tt(
|
|
1377
|
-
|
|
1377
|
+
l,
|
|
1378
1378
|
_,
|
|
1379
1379
|
t,
|
|
1380
1380
|
e,
|
|
@@ -1383,10 +1383,10 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
|
|
|
1383
1383
|
n,
|
|
1384
1384
|
r,
|
|
1385
1385
|
a + 1,
|
|
1386
|
-
|
|
1386
|
+
c,
|
|
1387
1387
|
E
|
|
1388
1388
|
) || Tt(
|
|
1389
|
-
|
|
1389
|
+
l,
|
|
1390
1390
|
N,
|
|
1391
1391
|
t,
|
|
1392
1392
|
e,
|
|
@@ -1395,13 +1395,13 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
|
|
|
1395
1395
|
n,
|
|
1396
1396
|
r,
|
|
1397
1397
|
a + 1,
|
|
1398
|
-
|
|
1398
|
+
c,
|
|
1399
1399
|
E
|
|
1400
1400
|
);
|
|
1401
|
-
else if (
|
|
1401
|
+
else if (L)
|
|
1402
1402
|
if (m)
|
|
1403
1403
|
S = Tt(
|
|
1404
|
-
|
|
1404
|
+
l,
|
|
1405
1405
|
_,
|
|
1406
1406
|
t,
|
|
1407
1407
|
e,
|
|
@@ -1410,18 +1410,18 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
|
|
|
1410
1410
|
n,
|
|
1411
1411
|
r,
|
|
1412
1412
|
a + 1,
|
|
1413
|
-
|
|
1413
|
+
c,
|
|
1414
1414
|
E
|
|
1415
1415
|
);
|
|
1416
1416
|
else {
|
|
1417
|
-
const
|
|
1418
|
-
|
|
1419
|
-
const
|
|
1420
|
-
$(
|
|
1421
|
-
const B =
|
|
1417
|
+
const P = Bt.getPrimitive();
|
|
1418
|
+
P.copy(Vs).applyMatrix4(t);
|
|
1419
|
+
const D = pt(l), x = Ct(l, p);
|
|
1420
|
+
$(D, u, ae), $(x, u, ce);
|
|
1421
|
+
const B = P.intersectsBox(ae), H = P.intersectsBox(ce);
|
|
1422
1422
|
S = B && Tt(
|
|
1423
1423
|
_,
|
|
1424
|
-
|
|
1424
|
+
D,
|
|
1425
1425
|
e,
|
|
1426
1426
|
t,
|
|
1427
1427
|
i,
|
|
@@ -1429,7 +1429,7 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
|
|
|
1429
1429
|
o,
|
|
1430
1430
|
a,
|
|
1431
1431
|
r + 1,
|
|
1432
|
-
|
|
1432
|
+
P,
|
|
1433
1433
|
!E
|
|
1434
1434
|
) || H && Tt(
|
|
1435
1435
|
_,
|
|
@@ -1441,14 +1441,14 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
|
|
|
1441
1441
|
o,
|
|
1442
1442
|
a,
|
|
1443
1443
|
r + 1,
|
|
1444
|
-
|
|
1444
|
+
P,
|
|
1445
1445
|
!E
|
|
1446
|
-
), Bt.releasePrimitive(
|
|
1446
|
+
), Bt.releasePrimitive(P);
|
|
1447
1447
|
}
|
|
1448
1448
|
else if (w)
|
|
1449
1449
|
if (m)
|
|
1450
1450
|
S = Tt(
|
|
1451
|
-
|
|
1451
|
+
l,
|
|
1452
1452
|
N,
|
|
1453
1453
|
t,
|
|
1454
1454
|
e,
|
|
@@ -1457,18 +1457,18 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
|
|
|
1457
1457
|
n,
|
|
1458
1458
|
r,
|
|
1459
1459
|
a + 1,
|
|
1460
|
-
|
|
1460
|
+
c,
|
|
1461
1461
|
E
|
|
1462
1462
|
);
|
|
1463
1463
|
else {
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1466
|
-
const
|
|
1467
|
-
$(
|
|
1468
|
-
const B =
|
|
1464
|
+
const P = Bt.getPrimitive();
|
|
1465
|
+
P.copy(zs).applyMatrix4(t);
|
|
1466
|
+
const D = pt(l), x = Ct(l, p);
|
|
1467
|
+
$(D, u, ae), $(x, u, ce);
|
|
1468
|
+
const B = P.intersectsBox(ae), H = P.intersectsBox(ce);
|
|
1469
1469
|
S = B && Tt(
|
|
1470
1470
|
N,
|
|
1471
|
-
|
|
1471
|
+
D,
|
|
1472
1472
|
e,
|
|
1473
1473
|
t,
|
|
1474
1474
|
i,
|
|
@@ -1476,7 +1476,7 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
|
|
|
1476
1476
|
o,
|
|
1477
1477
|
a,
|
|
1478
1478
|
r + 1,
|
|
1479
|
-
|
|
1479
|
+
P,
|
|
1480
1480
|
!E
|
|
1481
1481
|
) || H && Tt(
|
|
1482
1482
|
N,
|
|
@@ -1488,9 +1488,9 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
|
|
|
1488
1488
|
o,
|
|
1489
1489
|
a,
|
|
1490
1490
|
r + 1,
|
|
1491
|
-
|
|
1491
|
+
P,
|
|
1492
1492
|
!E
|
|
1493
|
-
), Bt.releasePrimitive(
|
|
1493
|
+
), Bt.releasePrimitive(P);
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
1496
1496
|
return S;
|
|
@@ -1524,8 +1524,8 @@ class mi {
|
|
|
1524
1524
|
if (r._roots = o, r._indirectBuffer = n || null, e.setIndex) {
|
|
1525
1525
|
const a = t.getIndex();
|
|
1526
1526
|
if (a === null) {
|
|
1527
|
-
const
|
|
1528
|
-
t.setIndex(
|
|
1527
|
+
const c = new An(s.index, 1, !1);
|
|
1528
|
+
t.setIndex(c);
|
|
1529
1529
|
} else
|
|
1530
1530
|
a.array !== i && (a.array.set(i), a.needsUpdate = !0);
|
|
1531
1531
|
}
|
|
@@ -1565,9 +1565,9 @@ class mi {
|
|
|
1565
1565
|
const e = this._roots[t], i = new Uint32Array(e), o = new Uint16Array(e);
|
|
1566
1566
|
n(0);
|
|
1567
1567
|
function n(r, a = 0) {
|
|
1568
|
-
const
|
|
1568
|
+
const c = r * 2, E = o[c + 15] === Ls;
|
|
1569
1569
|
if (E) {
|
|
1570
|
-
const d = i[r + 6], h = o[
|
|
1570
|
+
const d = i[r + 6], h = o[c + 14];
|
|
1571
1571
|
s(a, E, new Float32Array(e, r * 4, 6), d, h);
|
|
1572
1572
|
} else {
|
|
1573
1573
|
const d = r + Ts / 4, h = i[r + 6], u = i[r + 7];
|
|
@@ -1577,9 +1577,9 @@ class mi {
|
|
|
1577
1577
|
}
|
|
1578
1578
|
/* Core Cast Functions */
|
|
1579
1579
|
raycast(s, t = _i) {
|
|
1580
|
-
const e = this._roots, i = this.geometry, o = [], n = t.isMaterial, r = Array.isArray(t), a = i.groups,
|
|
1580
|
+
const e = this._roots, i = this.geometry, o = [], n = t.isMaterial, r = Array.isArray(t), a = i.groups, c = n ? t.side : t, E = this.indirect ? Yo : Lo;
|
|
1581
1581
|
for (let d = 0, h = e.length; d < h; d++) {
|
|
1582
|
-
const u = r ? t[a[d].materialIndex].side :
|
|
1582
|
+
const u = r ? t[a[d].materialIndex].side : c, p = o.length;
|
|
1583
1583
|
if (E(this, d, u, s, o), r) {
|
|
1584
1584
|
const R = a[d].materialIndex;
|
|
1585
1585
|
for (let A = p, C = o.length; A < C; A++)
|
|
@@ -1591,9 +1591,9 @@ class mi {
|
|
|
1591
1591
|
raycastFirst(s, t = _i) {
|
|
1592
1592
|
const e = this._roots, i = this.geometry, o = t.isMaterial, n = Array.isArray(t);
|
|
1593
1593
|
let r = null;
|
|
1594
|
-
const a = i.groups,
|
|
1594
|
+
const a = i.groups, c = o ? t.side : t, E = this.indirect ? Vo : Mo;
|
|
1595
1595
|
for (let d = 0, h = e.length; d < h; d++) {
|
|
1596
|
-
const u = n ? t[a[d].materialIndex].side :
|
|
1596
|
+
const u = n ? t[a[d].materialIndex].side : c, p = E(this, d, u, s);
|
|
1597
1597
|
p != null && (r == null || p.distance < r.distance) && (r = p, n && (p.face.materialIndex = a[d].materialIndex));
|
|
1598
1598
|
}
|
|
1599
1599
|
return r;
|
|
@@ -1606,7 +1606,7 @@ class mi {
|
|
|
1606
1606
|
return e;
|
|
1607
1607
|
}
|
|
1608
1608
|
shapecast(s) {
|
|
1609
|
-
const t = It.getPrimitive(), e = this.indirect ?
|
|
1609
|
+
const t = It.getPrimitive(), e = this.indirect ? yo : Oo;
|
|
1610
1610
|
let {
|
|
1611
1611
|
boundsTraverseOrder: i,
|
|
1612
1612
|
intersectsBounds: o,
|
|
@@ -1618,13 +1618,13 @@ class mi {
|
|
|
1618
1618
|
n = (h, u, p, R, A) => d(h, u, p, R, A) ? !0 : e(h, u, this, r, p, R, t);
|
|
1619
1619
|
} else
|
|
1620
1620
|
n || (r ? n = (d, h, u, p) => e(d, h, this, r, u, p, t) : n = (d, h, u) => u);
|
|
1621
|
-
let a = !1,
|
|
1621
|
+
let a = !1, c = 0;
|
|
1622
1622
|
const E = this._roots;
|
|
1623
1623
|
for (let d = 0, h = E.length; d < h; d++) {
|
|
1624
1624
|
const u = E[d];
|
|
1625
|
-
if (a = To(this, d, o, n, i,
|
|
1625
|
+
if (a = To(this, d, o, n, i, c), a)
|
|
1626
1626
|
break;
|
|
1627
|
-
|
|
1627
|
+
c += u.byteLength;
|
|
1628
1628
|
}
|
|
1629
1629
|
return It.releasePrimitive(t), a;
|
|
1630
1630
|
}
|
|
@@ -1633,7 +1633,7 @@ class mi {
|
|
|
1633
1633
|
intersectsRanges: i,
|
|
1634
1634
|
intersectsTriangles: o
|
|
1635
1635
|
} = e;
|
|
1636
|
-
const n = It.getPrimitive(), r = this.geometry.index, a = this.geometry.attributes.position,
|
|
1636
|
+
const n = It.getPrimitive(), r = this.geometry.index, a = this.geometry.attributes.position, c = this.indirect ? (p) => {
|
|
1637
1637
|
const R = this.resolveTriangleIndex(p);
|
|
1638
1638
|
tt(n, R * 3, r, a);
|
|
1639
1639
|
} : (p) => {
|
|
@@ -1648,8 +1648,8 @@ class mi {
|
|
|
1648
1648
|
const p = (R, A, C, T, F, f, m, g) => {
|
|
1649
1649
|
for (let S = C, _ = C + T; S < _; S++) {
|
|
1650
1650
|
u(S), E.a.applyMatrix4(t), E.b.applyMatrix4(t), E.c.applyMatrix4(t), E.needsUpdate = !0;
|
|
1651
|
-
for (let N = R,
|
|
1652
|
-
if (
|
|
1651
|
+
for (let N = R, L = R + A; N < L; N++)
|
|
1652
|
+
if (c(N), n.needsUpdate = !0, o(n, E, N, S, F, f, m, g))
|
|
1653
1653
|
return !0;
|
|
1654
1654
|
}
|
|
1655
1655
|
return !1;
|
|
@@ -1707,36 +1707,36 @@ class mi {
|
|
|
1707
1707
|
}), s;
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
|
-
function Wi(
|
|
1711
|
-
return
|
|
1710
|
+
function Wi(l, s, t) {
|
|
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 ks = /* @__PURE__ */ new
|
|
1714
|
-
function $o(
|
|
1713
|
+
const ks = /* @__PURE__ */ new Vn(), Xi = /* @__PURE__ */ new Mt(), qo = v.prototype.raycast;
|
|
1714
|
+
function $o(l, s) {
|
|
1715
1715
|
if (this.geometry.boundsTree) {
|
|
1716
1716
|
if (this.material === void 0)
|
|
1717
1717
|
return;
|
|
1718
|
-
Xi.copy(this.matrixWorld).invert(), ks.copy(
|
|
1718
|
+
Xi.copy(this.matrixWorld).invert(), ks.copy(l.ray).applyMatrix4(Xi);
|
|
1719
1719
|
const t = this.geometry.boundsTree;
|
|
1720
|
-
if (
|
|
1721
|
-
const e = Wi(t.raycastFirst(ks, this.material), this,
|
|
1720
|
+
if (l.firstHitOnly === !0) {
|
|
1721
|
+
const e = Wi(t.raycastFirst(ks, this.material), this, l);
|
|
1722
1722
|
e && s.push(e);
|
|
1723
1723
|
} else {
|
|
1724
1724
|
const e = t.raycast(ks, this.material);
|
|
1725
1725
|
for (let i = 0, o = e.length; i < o; i++) {
|
|
1726
|
-
const n = Wi(e[i], this,
|
|
1726
|
+
const n = Wi(e[i], this, l);
|
|
1727
1727
|
n && s.push(n);
|
|
1728
1728
|
}
|
|
1729
1729
|
}
|
|
1730
1730
|
} else
|
|
1731
|
-
qo.call(this,
|
|
1731
|
+
qo.call(this, l, s);
|
|
1732
1732
|
}
|
|
1733
|
-
function Ko(
|
|
1734
|
-
return this.boundsTree = new mi(this,
|
|
1733
|
+
function Ko(l) {
|
|
1734
|
+
return this.boundsTree = new mi(this, l), this.boundsTree;
|
|
1735
1735
|
}
|
|
1736
1736
|
function Jo() {
|
|
1737
1737
|
this.boundsTree = null;
|
|
1738
1738
|
}
|
|
1739
|
-
class
|
|
1739
|
+
class U {
|
|
1740
1740
|
constructor() {
|
|
1741
1741
|
/** Triggers all the callbacks assigned to this event. */
|
|
1742
1742
|
I(this, "trigger", (s) => {
|
|
@@ -1765,6 +1765,35 @@ class D {
|
|
|
1765
1765
|
this.handlers.length = 0;
|
|
1766
1766
|
}
|
|
1767
1767
|
}
|
|
1768
|
+
class tr {
|
|
1769
|
+
constructor() {
|
|
1770
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
1771
|
+
I(this, "trigger", async (s) => {
|
|
1772
|
+
const t = this.handlers.slice(0);
|
|
1773
|
+
for (const e of t)
|
|
1774
|
+
await e(s);
|
|
1775
|
+
});
|
|
1776
|
+
I(this, "handlers", []);
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* Add a callback to this event instance.
|
|
1780
|
+
* @param handler - the callback to be added to this event.
|
|
1781
|
+
*/
|
|
1782
|
+
add(s) {
|
|
1783
|
+
this.handlers.push(s);
|
|
1784
|
+
}
|
|
1785
|
+
/**
|
|
1786
|
+
* Removes a callback from this event instance.
|
|
1787
|
+
* @param handler - the callback to be removed from this event.
|
|
1788
|
+
*/
|
|
1789
|
+
remove(s) {
|
|
1790
|
+
this.handlers = this.handlers.filter((t) => t !== s);
|
|
1791
|
+
}
|
|
1792
|
+
/** Gets rid of all the suscribed events. */
|
|
1793
|
+
reset() {
|
|
1794
|
+
this.handlers.length = 0;
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1768
1797
|
class Ri {
|
|
1769
1798
|
constructor(s) {
|
|
1770
1799
|
/** Whether is component is {@link Disposable}. */
|
|
@@ -1786,35 +1815,35 @@ class Ai extends Ri {
|
|
|
1786
1815
|
constructor(t) {
|
|
1787
1816
|
super(t);
|
|
1788
1817
|
I(this, "worlds", /* @__PURE__ */ new Map());
|
|
1789
|
-
I(this, "onWorldChanged", new
|
|
1818
|
+
I(this, "onWorldChanged", new U());
|
|
1790
1819
|
I(this, "currentWorld", null);
|
|
1791
1820
|
this.onWorldChanged.add(({ world: e, action: i }) => {
|
|
1792
1821
|
i === "removed" && this.worlds.delete(e.uuid);
|
|
1793
1822
|
});
|
|
1794
1823
|
}
|
|
1795
1824
|
}
|
|
1796
|
-
class
|
|
1825
|
+
class er extends Ai {
|
|
1797
1826
|
constructor() {
|
|
1798
1827
|
super(...arguments);
|
|
1799
1828
|
/** Whether is instance is {@link CameraControllable}. */
|
|
1800
1829
|
I(this, "hasCameraControls", () => "controls" in this);
|
|
1801
1830
|
}
|
|
1802
1831
|
}
|
|
1803
|
-
class
|
|
1832
|
+
class sr extends Ai {
|
|
1804
1833
|
constructor() {
|
|
1805
1834
|
super(...arguments);
|
|
1806
1835
|
/** {@link Updateable.onBeforeUpdate} */
|
|
1807
|
-
I(this, "onAfterUpdate", new
|
|
1836
|
+
I(this, "onAfterUpdate", new U());
|
|
1808
1837
|
/** {@link Updateable.onAfterUpdate} */
|
|
1809
|
-
I(this, "onBeforeUpdate", new
|
|
1838
|
+
I(this, "onBeforeUpdate", new U());
|
|
1810
1839
|
/** {@link Disposable.onDisposed} */
|
|
1811
|
-
I(this, "onDisposed", new
|
|
1812
|
-
I(this, "onResize", new
|
|
1840
|
+
I(this, "onDisposed", new U());
|
|
1841
|
+
I(this, "onResize", new U());
|
|
1813
1842
|
/**
|
|
1814
1843
|
* Event that fires when there has been a change to the list of clipping
|
|
1815
1844
|
* planes used by the active renderer.
|
|
1816
1845
|
*/
|
|
1817
|
-
I(this, "onClippingPlanesUpdated", new
|
|
1846
|
+
I(this, "onClippingPlanesUpdated", new U());
|
|
1818
1847
|
/**
|
|
1819
1848
|
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
|
|
1820
1849
|
* instance of the renderer.
|
|
@@ -1903,11 +1932,11 @@ const be = class be extends it {
|
|
|
1903
1932
|
};
|
|
1904
1933
|
I(be, "uuid", "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");
|
|
1905
1934
|
let zt = be;
|
|
1906
|
-
class
|
|
1935
|
+
class ir extends Ai {
|
|
1907
1936
|
constructor(t) {
|
|
1908
1937
|
super(t);
|
|
1909
1938
|
/** {@link Disposable.onDisposed} */
|
|
1910
|
-
I(this, "onDisposed", new
|
|
1939
|
+
I(this, "onDisposed", new U());
|
|
1911
1940
|
}
|
|
1912
1941
|
/** {@link Disposable.dispose} */
|
|
1913
1942
|
dispose() {
|
|
@@ -1919,8 +1948,8 @@ class sr extends Ai {
|
|
|
1919
1948
|
this.three.children = [], this.onDisposed.trigger(), this.onDisposed.reset();
|
|
1920
1949
|
}
|
|
1921
1950
|
}
|
|
1922
|
-
const ms = 0,
|
|
1923
|
-
class
|
|
1951
|
+
const ms = 0, nr = 1, or = new M(), Zi = new Pt(), Ws = new pi(), Qi = new M(), hs = new ue();
|
|
1952
|
+
class rr {
|
|
1924
1953
|
constructor() {
|
|
1925
1954
|
this.tolerance = -1, this.faces = [], this.newFaces = [], this.assigned = new ji(), this.unassigned = new ji(), this.vertices = [];
|
|
1926
1955
|
}
|
|
@@ -1928,7 +1957,7 @@ class or {
|
|
|
1928
1957
|
if (s.length >= 4) {
|
|
1929
1958
|
this.makeEmpty();
|
|
1930
1959
|
for (let t = 0, e = s.length; t < e; t++)
|
|
1931
|
-
this.vertices.push(new
|
|
1960
|
+
this.vertices.push(new ar(s[t]));
|
|
1932
1961
|
this.compute();
|
|
1933
1962
|
}
|
|
1934
1963
|
return this;
|
|
@@ -1958,17 +1987,17 @@ class or {
|
|
|
1958
1987
|
const e = this.faces;
|
|
1959
1988
|
let i = -1 / 0, o = 1 / 0;
|
|
1960
1989
|
for (let n = 0, r = e.length; n < r; n++) {
|
|
1961
|
-
const a = e[n],
|
|
1962
|
-
if (
|
|
1990
|
+
const a = e[n], c = a.distanceToPoint(s.origin), E = a.normal.dot(s.direction);
|
|
1991
|
+
if (c > 0 && E >= 0)
|
|
1963
1992
|
return null;
|
|
1964
|
-
const d = E !== 0 ? -
|
|
1993
|
+
const d = E !== 0 ? -c / E : 0;
|
|
1965
1994
|
if (!(d <= 0) && (E > 0 ? o = Math.min(d, o) : i = Math.max(d, i), i > o))
|
|
1966
1995
|
return null;
|
|
1967
1996
|
}
|
|
1968
1997
|
return i !== -1 / 0 ? s.at(i, t) : s.at(o, t), t;
|
|
1969
1998
|
}
|
|
1970
1999
|
intersectsRay(s) {
|
|
1971
|
-
return this.intersectRay(s,
|
|
2000
|
+
return this.intersectRay(s, or) !== null;
|
|
1972
2001
|
}
|
|
1973
2002
|
makeEmpty() {
|
|
1974
2003
|
return this.faces = [], this.vertices = [], this;
|
|
@@ -2034,10 +2063,10 @@ class or {
|
|
|
2034
2063
|
s.copy(this.vertices[0].point), t.copy(this.vertices[0].point);
|
|
2035
2064
|
for (let o = 0, n = this.vertices.length; o < n; o++) {
|
|
2036
2065
|
const r = this.vertices[o], a = r.point;
|
|
2037
|
-
for (let
|
|
2038
|
-
a.getComponent(
|
|
2039
|
-
for (let
|
|
2040
|
-
a.getComponent(
|
|
2066
|
+
for (let c = 0; c < 3; c++)
|
|
2067
|
+
a.getComponent(c) < s.getComponent(c) && (s.setComponent(c, a.getComponent(c)), e[c] = r);
|
|
2068
|
+
for (let c = 0; c < 3; c++)
|
|
2069
|
+
a.getComponent(c) > t.getComponent(c) && (t.setComponent(c, a.getComponent(c)), i[c] = r);
|
|
2041
2070
|
}
|
|
2042
2071
|
return this.tolerance = 3 * Number.EPSILON * (Math.max(Math.abs(s.x), Math.abs(t.x)) + Math.max(Math.abs(s.y), Math.abs(t.y)) + Math.max(Math.abs(s.z), Math.abs(t.z))), { min: e, max: i };
|
|
2043
2072
|
}
|
|
@@ -2051,20 +2080,20 @@ class or {
|
|
|
2051
2080
|
u > o && (o = u, n = h);
|
|
2052
2081
|
}
|
|
2053
2082
|
const r = e[n], a = i[n];
|
|
2054
|
-
let
|
|
2083
|
+
let c, E;
|
|
2055
2084
|
o = 0, Zi.set(r.point, a.point);
|
|
2056
2085
|
for (let h = 0, u = this.vertices.length; h < u; h++) {
|
|
2057
2086
|
const p = s[h];
|
|
2058
2087
|
if (p !== r && p !== a) {
|
|
2059
2088
|
Zi.closestPointToPoint(p.point, !0, Qi);
|
|
2060
2089
|
const R = Qi.distanceToSquared(p.point);
|
|
2061
|
-
R > o && (o = R,
|
|
2090
|
+
R > o && (o = R, c = p);
|
|
2062
2091
|
}
|
|
2063
2092
|
}
|
|
2064
|
-
o = -1, Ws.setFromCoplanarPoints(r.point, a.point,
|
|
2093
|
+
o = -1, Ws.setFromCoplanarPoints(r.point, a.point, c.point);
|
|
2065
2094
|
for (let h = 0, u = this.vertices.length; h < u; h++) {
|
|
2066
2095
|
const p = s[h];
|
|
2067
|
-
if (p !== r && p !== a && p !==
|
|
2096
|
+
if (p !== r && p !== a && p !== c) {
|
|
2068
2097
|
const R = Math.abs(Ws.distanceToPoint(p.point));
|
|
2069
2098
|
R > o && (o = R, E = p);
|
|
2070
2099
|
}
|
|
@@ -2072,10 +2101,10 @@ class or {
|
|
|
2072
2101
|
const d = [];
|
|
2073
2102
|
if (Ws.distanceToPoint(E.point) < 0) {
|
|
2074
2103
|
d.push(
|
|
2075
|
-
Rt.create(r, a,
|
|
2104
|
+
Rt.create(r, a, c),
|
|
2076
2105
|
Rt.create(E, a, r),
|
|
2077
|
-
Rt.create(E,
|
|
2078
|
-
Rt.create(E, r,
|
|
2106
|
+
Rt.create(E, c, a),
|
|
2107
|
+
Rt.create(E, r, c)
|
|
2079
2108
|
);
|
|
2080
2109
|
for (let h = 0; h < 3; h++) {
|
|
2081
2110
|
const u = (h + 1) % 3;
|
|
@@ -2083,10 +2112,10 @@ class or {
|
|
|
2083
2112
|
}
|
|
2084
2113
|
} else {
|
|
2085
2114
|
d.push(
|
|
2086
|
-
Rt.create(r,
|
|
2115
|
+
Rt.create(r, c, a),
|
|
2087
2116
|
Rt.create(E, r, a),
|
|
2088
|
-
Rt.create(E, a,
|
|
2089
|
-
Rt.create(E,
|
|
2117
|
+
Rt.create(E, a, c),
|
|
2118
|
+
Rt.create(E, c, r)
|
|
2090
2119
|
);
|
|
2091
2120
|
for (let h = 0; h < 3; h++) {
|
|
2092
2121
|
const u = (h + 1) % 3;
|
|
@@ -2097,7 +2126,7 @@ class or {
|
|
|
2097
2126
|
this.faces.push(d[h]);
|
|
2098
2127
|
for (let h = 0, u = s.length; h < u; h++) {
|
|
2099
2128
|
const p = s[h];
|
|
2100
|
-
if (p !== r && p !== a && p !==
|
|
2129
|
+
if (p !== r && p !== a && p !== c && p !== E) {
|
|
2101
2130
|
o = this.tolerance;
|
|
2102
2131
|
let R = null;
|
|
2103
2132
|
for (let A = 0; A < 4; A++) {
|
|
@@ -2135,7 +2164,7 @@ class or {
|
|
|
2135
2164
|
// For an edge to be part of the horizon it must join a face that can see
|
|
2136
2165
|
// 'eyePoint' and a face that cannot see 'eyePoint'.
|
|
2137
2166
|
computeHorizon(s, t, e, i) {
|
|
2138
|
-
this.deleteFaceVertices(e), e.mark =
|
|
2167
|
+
this.deleteFaceVertices(e), e.mark = nr;
|
|
2139
2168
|
let o;
|
|
2140
2169
|
t === null ? o = t = e.getEdge(0) : o = t.next;
|
|
2141
2170
|
do {
|
|
@@ -2221,7 +2250,7 @@ class Xs {
|
|
|
2221
2250
|
return this.twin = s, s.twin = this, this;
|
|
2222
2251
|
}
|
|
2223
2252
|
}
|
|
2224
|
-
class
|
|
2253
|
+
class ar {
|
|
2225
2254
|
constructor(s) {
|
|
2226
2255
|
this.point = s, this.prev = null, this.next = null, this.face = null;
|
|
2227
2256
|
}
|
|
@@ -2270,57 +2299,57 @@ class ji {
|
|
|
2270
2299
|
}
|
|
2271
2300
|
}
|
|
2272
2301
|
const li = [2, 2, 1], hi = [1, 0, 0];
|
|
2273
|
-
function
|
|
2274
|
-
return
|
|
2302
|
+
function yt(l, s) {
|
|
2303
|
+
return l * 3 + s;
|
|
2275
2304
|
}
|
|
2276
|
-
function
|
|
2277
|
-
const s =
|
|
2305
|
+
function cr(l) {
|
|
2306
|
+
const s = l.elements;
|
|
2278
2307
|
let t = 0;
|
|
2279
2308
|
for (let e = 0; e < 9; e++)
|
|
2280
2309
|
t += s[e] * s[e];
|
|
2281
2310
|
return Math.sqrt(t);
|
|
2282
2311
|
}
|
|
2283
|
-
function
|
|
2284
|
-
const s =
|
|
2312
|
+
function lr(l) {
|
|
2313
|
+
const s = l.elements;
|
|
2285
2314
|
let t = 0;
|
|
2286
2315
|
for (let e = 0; e < 3; e++) {
|
|
2287
|
-
const i = s[
|
|
2316
|
+
const i = s[yt(li[e], hi[e])];
|
|
2288
2317
|
t += 2 * i * i;
|
|
2289
2318
|
}
|
|
2290
2319
|
return Math.sqrt(t);
|
|
2291
2320
|
}
|
|
2292
|
-
function
|
|
2321
|
+
function hr(l, s) {
|
|
2293
2322
|
let t = 0, e = 1;
|
|
2294
|
-
const i =
|
|
2295
|
-
for (let
|
|
2296
|
-
const E = Math.abs(i[
|
|
2297
|
-
E > t && (t = E, e =
|
|
2323
|
+
const i = l.elements;
|
|
2324
|
+
for (let c = 0; c < 3; c++) {
|
|
2325
|
+
const E = Math.abs(i[yt(li[c], hi[c])]);
|
|
2326
|
+
E > t && (t = E, e = c);
|
|
2298
2327
|
}
|
|
2299
2328
|
let o = 1, n = 0;
|
|
2300
2329
|
const r = hi[e], a = li[e];
|
|
2301
|
-
if (Math.abs(i[
|
|
2302
|
-
const
|
|
2330
|
+
if (Math.abs(i[yt(a, r)]) > Number.EPSILON) {
|
|
2331
|
+
const c = i[yt(a, a)], E = i[yt(r, r)], d = i[yt(a, r)], h = (c - E) / 2 / d;
|
|
2303
2332
|
let u;
|
|
2304
2333
|
h < 0 ? u = -1 / (-h + Math.sqrt(1 + h * h)) : u = 1 / (h + Math.sqrt(1 + h * h)), o = 1 / Math.sqrt(1 + u * u), n = u * o;
|
|
2305
2334
|
}
|
|
2306
|
-
return s.identity(), s.elements[
|
|
2335
|
+
return s.identity(), s.elements[yt(r, r)] = o, s.elements[yt(a, a)] = o, s.elements[yt(a, r)] = n, s.elements[yt(r, a)] = -n, s;
|
|
2307
2336
|
}
|
|
2308
|
-
function
|
|
2337
|
+
function Er(l, s) {
|
|
2309
2338
|
let t = 0, e = 0;
|
|
2310
2339
|
const i = 10;
|
|
2311
|
-
s.unitary.identity(), s.diagonal.copy(
|
|
2312
|
-
const o = s.unitary, n = s.diagonal, r = new O.Matrix3(), a = new O.Matrix3(),
|
|
2313
|
-
for (; e < i &&
|
|
2314
|
-
|
|
2340
|
+
s.unitary.identity(), s.diagonal.copy(l);
|
|
2341
|
+
const o = s.unitary, n = s.diagonal, r = new O.Matrix3(), a = new O.Matrix3(), c = Number.EPSILON * cr(n);
|
|
2342
|
+
for (; e < i && lr(n) > c; )
|
|
2343
|
+
hr(n, r), a.copy(r).transpose(), n.multiply(r), n.premultiply(a), o.multiply(r), ++t > 2 && (e++, t = 0);
|
|
2315
2344
|
return s;
|
|
2316
2345
|
}
|
|
2317
|
-
function
|
|
2346
|
+
function dr(l) {
|
|
2318
2347
|
const s = [];
|
|
2319
|
-
for (let st = 0; st <
|
|
2320
|
-
const Xt =
|
|
2348
|
+
for (let st = 0; st < l.length - 2; st += 3) {
|
|
2349
|
+
const Xt = l[st], J = l[st + 1], Kt = l[st + 2];
|
|
2321
2350
|
s.push(new O.Vector3(Xt, J, Kt));
|
|
2322
2351
|
}
|
|
2323
|
-
const t = new
|
|
2352
|
+
const t = new rr();
|
|
2324
2353
|
t.setFromPoints(s);
|
|
2325
2354
|
const e = {
|
|
2326
2355
|
unitary: new O.Matrix3(),
|
|
@@ -2339,26 +2368,26 @@ function Er(c) {
|
|
|
2339
2368
|
n.push(Ms.point.x, Ms.point.y, Ms.point.z), n.push(ws.point.x, ws.point.y, ws.point.z), n.push(Ds.point.x, Ds.point.y, Ds.point.z);
|
|
2340
2369
|
}
|
|
2341
2370
|
}
|
|
2342
|
-
const r = new O.Vector3(), a = new O.Vector3(),
|
|
2371
|
+
const r = new O.Vector3(), a = new O.Vector3(), c = new O.Vector3(), E = new O.Vector3(), d = new O.Vector3(), h = new O.Vector3(), u = new O.Vector3(), p = new O.Vector3();
|
|
2343
2372
|
let R = 0, A = 0, C = 0, T = 0, F = 0, f = 0, m = 0;
|
|
2344
2373
|
for (let st = 0, Xt = n.length; st < Xt; st += 9) {
|
|
2345
|
-
r.fromArray(n, st), a.fromArray(n, st + 3),
|
|
2374
|
+
r.fromArray(n, st), a.fromArray(n, st + 3), c.fromArray(n, st + 6), u.set(0, 0, 0), u.add(r).add(a).add(c).divideScalar(3), E.subVectors(a, r), d.subVectors(c, r);
|
|
2346
2375
|
const J = h.crossVectors(E, d).length() / 2;
|
|
2347
|
-
p.add(h.copy(u).multiplyScalar(J)), R += J, A += (9 * u.x * u.x + r.x * r.x + a.x * a.x +
|
|
2376
|
+
p.add(h.copy(u).multiplyScalar(J)), R += J, A += (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), T += (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), f += (9 * u.y * u.z + r.y * r.z + a.y * a.z + c.y * c.z) * (J / 12), m += (9 * u.z * u.z + r.z * r.z + a.z * a.z + c.z * c.z) * (J / 12);
|
|
2348
2377
|
}
|
|
2349
2378
|
p.divideScalar(R), A /= R, C /= R, T /= R, F /= R, f /= R, m /= R, A -= p.x * p.x, C -= p.x * p.y, T -= p.x * p.z, F -= p.y * p.y, f -= p.y * p.z, m -= p.z * p.z;
|
|
2350
2379
|
const g = new O.Matrix3();
|
|
2351
|
-
g.elements[0] = A, g.elements[1] = C, g.elements[2] = T, g.elements[3] = C, g.elements[4] = F, g.elements[5] = f, g.elements[6] = T, g.elements[7] = f, g.elements[8] = m,
|
|
2352
|
-
const S = e.unitary, _ = new O.Vector3(), N = new O.Vector3(),
|
|
2353
|
-
S.extractBasis(_, N,
|
|
2354
|
-
let w = -1 / 0,
|
|
2380
|
+
g.elements[0] = A, g.elements[1] = C, g.elements[2] = T, g.elements[3] = C, g.elements[4] = F, g.elements[5] = f, g.elements[6] = T, g.elements[7] = f, g.elements[8] = m, Er(g, e);
|
|
2381
|
+
const S = e.unitary, _ = new O.Vector3(), N = new O.Vector3(), L = new O.Vector3();
|
|
2382
|
+
S.extractBasis(_, N, L);
|
|
2383
|
+
let w = -1 / 0, P = -1 / 0, D = -1 / 0, x = 1 / 0, B = 1 / 0, H = 1 / 0;
|
|
2355
2384
|
for (let st = 0, Xt = s.length; st < Xt; st++) {
|
|
2356
2385
|
const J = s[st];
|
|
2357
|
-
w = Math.max(_.dot(J), w),
|
|
2386
|
+
w = Math.max(_.dot(J), w), P = Math.max(N.dot(J), P), D = Math.max(L.dot(J), D), x = Math.min(_.dot(J), x), B = Math.min(N.dot(J), B), H = Math.min(L.dot(J), H);
|
|
2358
2387
|
}
|
|
2359
|
-
_.multiplyScalar(0.5 * (x + w)), N.multiplyScalar(0.5 * (B +
|
|
2388
|
+
_.multiplyScalar(0.5 * (x + w)), N.multiplyScalar(0.5 * (B + P)), L.multiplyScalar(0.5 * (H + D));
|
|
2360
2389
|
const q = new O.Vector3(), et = new O.Vector3(), Q = new O.Matrix3();
|
|
2361
|
-
q.add(_).add(N).add(
|
|
2390
|
+
q.add(_).add(N).add(L), et.x = w - x, et.y = P - B, et.z = D - H, et.multiplyScalar(0.5), Q.copy(S);
|
|
2362
2391
|
const { x: Ht, y: kt, z: Wt } = et, Xe = new O.Matrix4();
|
|
2363
2392
|
Xe.makeScale(Ht * 2, kt * 2, Wt * 2);
|
|
2364
2393
|
const Ce = new O.Matrix4();
|
|
@@ -2370,11 +2399,11 @@ function Er(c) {
|
|
|
2370
2399
|
const Te = new O.Matrix4();
|
|
2371
2400
|
return Te.multiply(Oi), Te.multiply(Si), Te.multiply(Ce), Te.multiply(Xe), { center: q, halfSizes: et, rotation: Q, transformation: Te };
|
|
2372
2401
|
}
|
|
2373
|
-
function
|
|
2402
|
+
function ur(l, s, t) {
|
|
2374
2403
|
const e = [
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2404
|
+
l[0] - s[0],
|
|
2405
|
+
l[1] - s[1],
|
|
2406
|
+
l[2] - s[2]
|
|
2378
2407
|
];
|
|
2379
2408
|
return t[0] * e[0] + t[1] * e[1] + t[2] * e[2] > 0;
|
|
2380
2409
|
}
|
|
@@ -2661,18 +2690,18 @@ I(K, "_lut", [
|
|
|
2661
2690
|
"ff"
|
|
2662
2691
|
]);
|
|
2663
2692
|
let He = K;
|
|
2664
|
-
class
|
|
2693
|
+
class jr extends it {
|
|
2665
2694
|
constructor(t, e) {
|
|
2666
2695
|
super(t);
|
|
2667
|
-
I(this, "onVertexFound", new
|
|
2668
|
-
I(this, "onVertexLost", new
|
|
2696
|
+
I(this, "onVertexFound", new U());
|
|
2697
|
+
I(this, "onVertexLost", new U());
|
|
2669
2698
|
I(this, "components");
|
|
2670
2699
|
I(this, "_pickedPoint", null);
|
|
2671
2700
|
I(this, "_config");
|
|
2672
2701
|
I(this, "_enabled", !1);
|
|
2673
2702
|
I(this, "_workingPlane", null);
|
|
2674
2703
|
/** {@link Disposable.onDisposed} */
|
|
2675
|
-
I(this, "onDisposed", new
|
|
2704
|
+
I(this, "onDisposed", new U());
|
|
2676
2705
|
this.components = t, this.config = {
|
|
2677
2706
|
snapDistance: 0.25,
|
|
2678
2707
|
showOnlyVertex: !1,
|
|
@@ -2747,7 +2776,7 @@ class Qr extends it {
|
|
|
2747
2776
|
const Fs = class Fs {
|
|
2748
2777
|
constructor() {
|
|
2749
2778
|
/** {@link Disposable.onDisposed} */
|
|
2750
|
-
I(this, "onDisposed", new
|
|
2779
|
+
I(this, "onDisposed", new U());
|
|
2751
2780
|
/** The list of components created in this app. */
|
|
2752
2781
|
I(this, "list", /* @__PURE__ */ new Map());
|
|
2753
2782
|
/** If disabled, the animation loop will be stopped. */
|
|
@@ -2820,12 +2849,12 @@ const Fs = class Fs {
|
|
|
2820
2849
|
};
|
|
2821
2850
|
I(Fs, "release", "1.4.21");
|
|
2822
2851
|
let Ei = Fs;
|
|
2823
|
-
class
|
|
2852
|
+
class Ir {
|
|
2824
2853
|
constructor(s) {
|
|
2825
2854
|
I(this, "_event");
|
|
2826
2855
|
I(this, "_position", new O.Vector2());
|
|
2827
2856
|
/** {@link Disposable.onDisposed} */
|
|
2828
|
-
I(this, "onDisposed", new
|
|
2857
|
+
I(this, "onDisposed", new U());
|
|
2829
2858
|
I(this, "updateMouseInfo", (s) => {
|
|
2830
2859
|
this._event = s;
|
|
2831
2860
|
});
|
|
@@ -2855,13 +2884,13 @@ class ur {
|
|
|
2855
2884
|
s ? this.dom.addEventListener("mousemove", this.updateMouseInfo) : this.dom.removeEventListener("mousemove", this.updateMouseInfo);
|
|
2856
2885
|
}
|
|
2857
2886
|
}
|
|
2858
|
-
class
|
|
2887
|
+
class fr {
|
|
2859
2888
|
constructor(s, t) {
|
|
2860
2889
|
/** {@link Component.enabled} */
|
|
2861
2890
|
I(this, "enabled", !0);
|
|
2862
2891
|
I(this, "components");
|
|
2863
2892
|
/** {@link Disposable.onDisposed} */
|
|
2864
|
-
I(this, "onDisposed", new
|
|
2893
|
+
I(this, "onDisposed", new U());
|
|
2865
2894
|
/** The position of the mouse in the screen. */
|
|
2866
2895
|
I(this, "mouse");
|
|
2867
2896
|
I(this, "three", new O.Raycaster());
|
|
@@ -2869,7 +2898,7 @@ class Ir {
|
|
|
2869
2898
|
const e = t.renderer;
|
|
2870
2899
|
if (!e)
|
|
2871
2900
|
throw new Error("A renderer is needed for the raycaster to work!");
|
|
2872
|
-
this.world = t, this.mouse = new
|
|
2901
|
+
this.world = t, this.mouse = new Ir(e.three.domElement), this.components = s;
|
|
2873
2902
|
}
|
|
2874
2903
|
/** {@link Disposable.dispose} */
|
|
2875
2904
|
dispose() {
|
|
@@ -2914,13 +2943,13 @@ const gs = class gs extends it {
|
|
|
2914
2943
|
super(t);
|
|
2915
2944
|
I(this, "enabled", !0);
|
|
2916
2945
|
I(this, "list", /* @__PURE__ */ new Map());
|
|
2917
|
-
I(this, "onDisposed", new
|
|
2946
|
+
I(this, "onDisposed", new U());
|
|
2918
2947
|
t.add(gs.uuid, this);
|
|
2919
2948
|
}
|
|
2920
2949
|
get(t) {
|
|
2921
2950
|
if (this.list.has(t.uuid))
|
|
2922
2951
|
return this.list.get(t.uuid);
|
|
2923
|
-
const e = new
|
|
2952
|
+
const e = new fr(this.components, t);
|
|
2924
2953
|
return this.list.set(t.uuid, e), t.onDisposed.add(() => {
|
|
2925
2954
|
this.delete(t);
|
|
2926
2955
|
}), e;
|
|
@@ -2937,18 +2966,18 @@ const gs = class gs extends it {
|
|
|
2937
2966
|
};
|
|
2938
2967
|
I(gs, "uuid", "d5d8bdf0-db25-4952-b951-b643af207ace");
|
|
2939
2968
|
let ke = gs;
|
|
2940
|
-
class
|
|
2969
|
+
class pr extends Ri {
|
|
2941
2970
|
constructor(t) {
|
|
2942
2971
|
super(t);
|
|
2943
2972
|
/**
|
|
2944
2973
|
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
|
|
2945
2974
|
*/
|
|
2946
2975
|
I(this, "meshes", /* @__PURE__ */ new Set());
|
|
2947
|
-
I(this, "onAfterUpdate", new
|
|
2948
|
-
I(this, "onBeforeUpdate", new
|
|
2976
|
+
I(this, "onAfterUpdate", new U());
|
|
2977
|
+
I(this, "onBeforeUpdate", new U());
|
|
2949
2978
|
I(this, "enabled", !0);
|
|
2950
2979
|
I(this, "uuid", He.create());
|
|
2951
|
-
I(this, "onDisposed", new
|
|
2980
|
+
I(this, "onDisposed", new U());
|
|
2952
2981
|
I(this, "_scene");
|
|
2953
2982
|
I(this, "_camera");
|
|
2954
2983
|
I(this, "_renderer", null);
|
|
@@ -2989,14 +3018,14 @@ class fr extends Ri {
|
|
|
2989
3018
|
this._scene = null, this._camera = null, this._renderer = null, this.onDisposed.trigger();
|
|
2990
3019
|
}
|
|
2991
3020
|
}
|
|
2992
|
-
class
|
|
3021
|
+
class qr extends ir {
|
|
2993
3022
|
constructor(t) {
|
|
2994
3023
|
super(t);
|
|
2995
3024
|
/** {@link Configurable.isSetup} */
|
|
2996
3025
|
I(this, "isSetup", !1);
|
|
2997
3026
|
I(this, "three");
|
|
2998
3027
|
/** {@link Configurable.onSetup} */
|
|
2999
|
-
I(this, "onSetup", new
|
|
3028
|
+
I(this, "onSetup", new U());
|
|
3000
3029
|
I(this, "config", {
|
|
3001
3030
|
directionalLight: {
|
|
3002
3031
|
color: new O.Color("white"),
|
|
@@ -3025,7 +3054,7 @@ class jr extends sr {
|
|
|
3025
3054
|
this.three.add(e, i), this.isSetup = !0, this.onSetup.trigger(this);
|
|
3026
3055
|
}
|
|
3027
3056
|
}
|
|
3028
|
-
class
|
|
3057
|
+
class $r extends sr {
|
|
3029
3058
|
constructor(t, e, i) {
|
|
3030
3059
|
super(t);
|
|
3031
3060
|
/** {@link Component.enabled} */
|
|
@@ -3035,7 +3064,7 @@ class qr extends er {
|
|
|
3035
3064
|
I(this, "three");
|
|
3036
3065
|
I(this, "_canvas");
|
|
3037
3066
|
I(this, "_parameters");
|
|
3038
|
-
I(this, "onContainerUpdated", new
|
|
3067
|
+
I(this, "onContainerUpdated", new U());
|
|
3039
3068
|
/** {@link Resizeable.resize} */
|
|
3040
3069
|
I(this, "resize", (t) => {
|
|
3041
3070
|
if (this.updateContainer(), !this.container)
|
|
@@ -3104,11 +3133,11 @@ class qr extends er {
|
|
|
3104
3133
|
* (c) 2017 @yomotsu
|
|
3105
3134
|
* Released under the MIT License.
|
|
3106
3135
|
*/
|
|
3107
|
-
const
|
|
3136
|
+
const G = {
|
|
3108
3137
|
LEFT: 1,
|
|
3109
3138
|
RIGHT: 2,
|
|
3110
3139
|
MIDDLE: 4
|
|
3111
|
-
},
|
|
3140
|
+
}, y = Object.freeze({
|
|
3112
3141
|
NONE: 0,
|
|
3113
3142
|
ROTATE: 1,
|
|
3114
3143
|
TRUCK: 2,
|
|
@@ -3131,66 +3160,66 @@ const V = {
|
|
|
3131
3160
|
IN: 1,
|
|
3132
3161
|
OUT: -1
|
|
3133
3162
|
};
|
|
3134
|
-
function Zt(
|
|
3135
|
-
return
|
|
3163
|
+
function Zt(l) {
|
|
3164
|
+
return l.isPerspectiveCamera;
|
|
3136
3165
|
}
|
|
3137
|
-
function vt(
|
|
3138
|
-
return
|
|
3166
|
+
function vt(l) {
|
|
3167
|
+
return l.isOrthographicCamera;
|
|
3139
3168
|
}
|
|
3140
|
-
const he = Math.PI * 2, $i = Math.PI / 2,
|
|
3141
|
-
function mt(
|
|
3142
|
-
return Math.max(s, Math.min(t,
|
|
3169
|
+
const he = Math.PI * 2, $i = Math.PI / 2, yn = 1e-5, _e = Math.PI / 180;
|
|
3170
|
+
function mt(l, s, t) {
|
|
3171
|
+
return Math.max(s, Math.min(t, l));
|
|
3143
3172
|
}
|
|
3144
|
-
function X(
|
|
3145
|
-
return Math.abs(
|
|
3173
|
+
function X(l, s = yn) {
|
|
3174
|
+
return Math.abs(l) < s;
|
|
3146
3175
|
}
|
|
3147
|
-
function k(
|
|
3148
|
-
return X(
|
|
3176
|
+
function k(l, s, t = yn) {
|
|
3177
|
+
return X(l - s, t);
|
|
3149
3178
|
}
|
|
3150
|
-
function Ki(
|
|
3151
|
-
return Math.round(
|
|
3179
|
+
function Ki(l, s) {
|
|
3180
|
+
return Math.round(l / s) * s;
|
|
3152
3181
|
}
|
|
3153
|
-
function Ne(
|
|
3154
|
-
return isFinite(
|
|
3182
|
+
function Ne(l) {
|
|
3183
|
+
return isFinite(l) ? l : l < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
|
3155
3184
|
}
|
|
3156
|
-
function
|
|
3157
|
-
return Math.abs(
|
|
3185
|
+
function ye(l) {
|
|
3186
|
+
return Math.abs(l) < Number.MAX_VALUE ? l : l * (1 / 0);
|
|
3158
3187
|
}
|
|
3159
|
-
function Es(
|
|
3188
|
+
function Es(l, s, t, e, i = 1 / 0, o) {
|
|
3160
3189
|
e = Math.max(1e-4, e);
|
|
3161
3190
|
const n = 2 / e, r = n * o, a = 1 / (1 + r + 0.48 * r * r + 0.235 * r * r * r);
|
|
3162
|
-
let
|
|
3191
|
+
let c = l - s;
|
|
3163
3192
|
const E = s, d = i * e;
|
|
3164
|
-
|
|
3165
|
-
const h = (t.value + n *
|
|
3193
|
+
c = mt(c, -d, d), s = l - c;
|
|
3194
|
+
const h = (t.value + n * c) * o;
|
|
3166
3195
|
t.value = (t.value - n * h) * a;
|
|
3167
|
-
let u = s + (
|
|
3168
|
-
return E -
|
|
3196
|
+
let u = s + (c + h) * a;
|
|
3197
|
+
return E - l > 0 == u > E && (u = E, t.value = (u - E) / o), u;
|
|
3169
3198
|
}
|
|
3170
|
-
function Ji(
|
|
3199
|
+
function Ji(l, s, t, e, i = 1 / 0, o, n) {
|
|
3171
3200
|
e = Math.max(1e-4, e);
|
|
3172
|
-
const r = 2 / e, a = r * o,
|
|
3173
|
-
let E = s.x, d = s.y, h = s.z, u =
|
|
3201
|
+
const r = 2 / e, a = r * o, c = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
|
|
3202
|
+
let E = s.x, d = s.y, h = s.z, u = l.x - E, p = l.y - d, R = l.z - h;
|
|
3174
3203
|
const A = E, C = d, T = h, F = i * e, f = F * F, m = u * u + p * p + R * R;
|
|
3175
3204
|
if (m > f) {
|
|
3176
3205
|
const B = Math.sqrt(m);
|
|
3177
3206
|
u = u / B * F, p = p / B * F, R = R / B * F;
|
|
3178
3207
|
}
|
|
3179
|
-
E =
|
|
3208
|
+
E = l.x - u, d = l.y - p, h = l.z - R;
|
|
3180
3209
|
const g = (t.x + r * u) * o, S = (t.y + r * p) * o, _ = (t.z + r * R) * o;
|
|
3181
|
-
t.x = (t.x - r * g) *
|
|
3182
|
-
const N = A -
|
|
3183
|
-
return N *
|
|
3210
|
+
t.x = (t.x - r * g) * c, t.y = (t.y - r * S) * c, t.z = (t.z - r * _) * c, n.x = E + (u + g) * c, n.y = d + (p + S) * c, n.z = h + (R + _) * c;
|
|
3211
|
+
const N = A - l.x, L = C - l.y, w = T - l.z, P = n.x - A, D = n.y - C, x = n.z - T;
|
|
3212
|
+
return N * P + L * D + w * x > 0 && (n.x = A, n.y = C, n.z = T, t.x = (n.x - A) / o, t.y = (n.y - C) / o, t.z = (n.z - T) / o), n;
|
|
3184
3213
|
}
|
|
3185
|
-
function Zs(
|
|
3186
|
-
s.set(0, 0),
|
|
3214
|
+
function Zs(l, s) {
|
|
3215
|
+
s.set(0, 0), l.forEach((t) => {
|
|
3187
3216
|
s.x += t.clientX, s.y += t.clientY;
|
|
3188
|
-
}), s.x /=
|
|
3217
|
+
}), s.x /= l.length, s.y /= l.length;
|
|
3189
3218
|
}
|
|
3190
|
-
function Qs(
|
|
3191
|
-
return vt(
|
|
3219
|
+
function Qs(l, s) {
|
|
3220
|
+
return vt(l) ? (console.warn(`${s} is not supported in OrthographicCamera`), !0) : !1;
|
|
3192
3221
|
}
|
|
3193
|
-
class
|
|
3222
|
+
class Cr {
|
|
3194
3223
|
constructor() {
|
|
3195
3224
|
this._listeners = {};
|
|
3196
3225
|
}
|
|
@@ -3254,9 +3283,9 @@ class pr {
|
|
|
3254
3283
|
}
|
|
3255
3284
|
}
|
|
3256
3285
|
}
|
|
3257
|
-
const
|
|
3258
|
-
let Y, tn, us, js, lt,
|
|
3259
|
-
class ot extends
|
|
3286
|
+
const Tr = "2.7.3", ds = 1 / 8, Ln = typeof window < "u", mr = Ln && /Mac/.test(navigator.platform), Rr = !(Ln && "PointerEvent" in window);
|
|
3287
|
+
let Y, tn, us, js, lt, V, z, Ee, Le, St, _t, Qt, en, sn, ut, Pe, de, nn, qs, on, $s, Ks, Is;
|
|
3288
|
+
class ot extends Cr {
|
|
3260
3289
|
/**
|
|
3261
3290
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
|
3262
3291
|
*
|
|
@@ -3298,14 +3327,14 @@ class ot extends pr {
|
|
|
3298
3327
|
* @category Statics
|
|
3299
3328
|
*/
|
|
3300
3329
|
static install(s) {
|
|
3301
|
-
Y = s.THREE, tn = Object.freeze(new Y.Vector3(0, 0, 0)), us = Object.freeze(new Y.Vector3(0, 1, 0)), js = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(),
|
|
3330
|
+
Y = s.THREE, tn = Object.freeze(new Y.Vector3(0, 0, 0)), us = Object.freeze(new Y.Vector3(0, 1, 0)), js = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), V = new Y.Vector3(), z = new Y.Vector3(), Ee = new Y.Vector3(), Le = new Y.Vector3(), St = new Y.Vector3(), _t = new Y.Vector3(), Qt = new Y.Vector3(), en = new Y.Vector3(), sn = new Y.Vector3(), ut = new Y.Spherical(), Pe = new Y.Spherical(), de = new Y.Box3(), nn = new Y.Box3(), qs = new Y.Sphere(), on = new Y.Quaternion(), $s = new Y.Quaternion(), Ks = new Y.Matrix4(), Is = new Y.Raycaster();
|
|
3302
3331
|
}
|
|
3303
3332
|
/**
|
|
3304
3333
|
* list all ACTIONs
|
|
3305
3334
|
* @category Statics
|
|
3306
3335
|
*/
|
|
3307
3336
|
static get ACTION() {
|
|
3308
|
-
return
|
|
3337
|
+
return y;
|
|
3309
3338
|
}
|
|
3310
3339
|
/**
|
|
3311
3340
|
* Creates a `CameraControls` instance.
|
|
@@ -3326,10 +3355,10 @@ class ot extends pr {
|
|
|
3326
3355
|
*/
|
|
3327
3356
|
constructor(s, t) {
|
|
3328
3357
|
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 = () => {
|
|
3329
|
-
}, this._enabled = !0, this._state =
|
|
3358
|
+
}, this._enabled = !0, this._state = y.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = le.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new Y.Vector3(), this._focalOffsetVelocity = new Y.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (f, m, g) => {
|
|
3330
3359
|
let S, _;
|
|
3331
3360
|
if (Zt(this._camera)) {
|
|
3332
|
-
const N =
|
|
3361
|
+
const N = V.copy(this._camera.position).sub(this._target), L = this._camera.getEffectiveFOV() * _e, w = N.length() * Math.tan(L * 0.5);
|
|
3333
3362
|
S = this.truckSpeed * f * w / this._elementRect.height, _ = this.truckSpeed * m * w / this._elementRect.height;
|
|
3334
3363
|
} else if (vt(this._camera)) {
|
|
3335
3364
|
const N = this._camera;
|
|
@@ -3341,25 +3370,25 @@ class ot extends pr {
|
|
|
3341
3370
|
const g = he * this.azimuthRotateSpeed * f / this._elementRect.height, S = he * this.polarRotateSpeed * m / this._elementRect.height;
|
|
3342
3371
|
this.rotate(g, S, !0);
|
|
3343
3372
|
}, this._dollyInternal = (f, m, g) => {
|
|
3344
|
-
const S = Math.pow(0.95, -f * this.dollySpeed), _ = this._sphericalEnd.radius, N = this._sphericalEnd.radius * S,
|
|
3345
|
-
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(w, !0), this._dollyToNoClamp(
|
|
3373
|
+
const S = Math.pow(0.95, -f * this.dollySpeed), _ = this._sphericalEnd.radius, N = this._sphericalEnd.radius * S, L = mt(N, this.minDistance, this.maxDistance), w = L - N;
|
|
3374
|
+
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(w, !0), this._dollyToNoClamp(L, !0)) : this._dollyToNoClamp(L, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : L) - _, this._dollyControlCoord.set(m, g)), this._lastDollyDirection = Math.sign(-f);
|
|
3346
3375
|
}, this._zoomInternal = (f, m, g) => {
|
|
3347
3376
|
const S = Math.pow(0.95, f * this.dollySpeed), _ = this._zoom, N = this._zoom * S;
|
|
3348
3377
|
this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N - _, this._dollyControlCoord.set(m, g));
|
|
3349
|
-
}, 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, us), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state =
|
|
3378
|
+
}, 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, us), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = y.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(V.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 = [
|
|
3350
3379
|
new Y.Vector3(),
|
|
3351
3380
|
new Y.Vector3(),
|
|
3352
3381
|
new Y.Vector3(),
|
|
3353
3382
|
new Y.Vector3()
|
|
3354
3383
|
], this._updateNearPlaneCorners(), this._boundary = new Y.Box3(new Y.Vector3(-1 / 0, -1 / 0, -1 / 0), new Y.Vector3(1 / 0, 1 / 0, 1 / 0)), this._cameraUp0 = this._camera.up.clone(), this._target0 = this._target.clone(), this._position0 = this._camera.position.clone(), this._zoom0 = this._zoom, this._focalOffset0 = this._focalOffset.clone(), this._dollyControlCoord = new Y.Vector2(), this.mouseButtons = {
|
|
3355
|
-
left:
|
|
3356
|
-
middle:
|
|
3357
|
-
right:
|
|
3358
|
-
wheel: Zt(this._camera) ?
|
|
3384
|
+
left: y.ROTATE,
|
|
3385
|
+
middle: y.DOLLY,
|
|
3386
|
+
right: y.TRUCK,
|
|
3387
|
+
wheel: Zt(this._camera) ? y.DOLLY : vt(this._camera) ? y.ZOOM : y.NONE
|
|
3359
3388
|
}, this.touches = {
|
|
3360
|
-
one:
|
|
3361
|
-
two: Zt(this._camera) ?
|
|
3362
|
-
three:
|
|
3389
|
+
one: y.TOUCH_ROTATE,
|
|
3390
|
+
two: Zt(this._camera) ? y.TOUCH_DOLLY_TRUCK : vt(this._camera) ? y.TOUCH_ZOOM_TRUCK : y.NONE,
|
|
3391
|
+
three: y.TOUCH_TRUCK
|
|
3363
3392
|
};
|
|
3364
3393
|
const e = new Y.Vector2(), i = new Y.Vector2(), o = new Y.Vector2(), n = (f) => {
|
|
3365
3394
|
if (!this._enabled || !this._domElement)
|
|
@@ -3369,12 +3398,12 @@ class ot extends pr {
|
|
|
3369
3398
|
if (_ < this._interactiveArea.left || _ > this._interactiveArea.right || N < this._interactiveArea.top || N > this._interactiveArea.bottom)
|
|
3370
3399
|
return;
|
|
3371
3400
|
}
|
|
3372
|
-
const m = f.pointerType !== "mouse" ? null : (f.buttons &
|
|
3401
|
+
const m = f.pointerType !== "mouse" ? null : (f.buttons & G.LEFT) === G.LEFT ? G.LEFT : (f.buttons & G.MIDDLE) === G.MIDDLE ? G.MIDDLE : (f.buttons & G.RIGHT) === G.RIGHT ? G.RIGHT : null;
|
|
3373
3402
|
if (m !== null) {
|
|
3374
3403
|
const S = this._findPointerByMouseButton(m);
|
|
3375
3404
|
S && this._disposePointer(S);
|
|
3376
3405
|
}
|
|
3377
|
-
if ((f.buttons &
|
|
3406
|
+
if ((f.buttons & G.LEFT) === G.LEFT && this._lockedPointer)
|
|
3378
3407
|
return;
|
|
3379
3408
|
const g = {
|
|
3380
3409
|
pointerId: f.pointerId,
|
|
@@ -3393,7 +3422,7 @@ class ot extends pr {
|
|
|
3393
3422
|
if (_ < this._interactiveArea.left || _ > this._interactiveArea.right || N < this._interactiveArea.top || N > this._interactiveArea.bottom)
|
|
3394
3423
|
return;
|
|
3395
3424
|
}
|
|
3396
|
-
const m = (f.buttons &
|
|
3425
|
+
const m = (f.buttons & G.LEFT) === G.LEFT ? G.LEFT : (f.buttons & G.MIDDLE) === G.MIDDLE ? G.MIDDLE : (f.buttons & G.RIGHT) === G.RIGHT ? G.RIGHT : null;
|
|
3397
3426
|
if (m !== null) {
|
|
3398
3427
|
const S = this._findPointerByMouseButton(m);
|
|
3399
3428
|
S && this._disposePointer(S);
|
|
@@ -3404,9 +3433,9 @@ class ot extends pr {
|
|
|
3404
3433
|
clientY: f.clientY,
|
|
3405
3434
|
deltaX: 0,
|
|
3406
3435
|
deltaY: 0,
|
|
3407
|
-
mouseButton: (f.buttons &
|
|
3436
|
+
mouseButton: (f.buttons & G.LEFT) === G.LEFT ? G.LEFT : (f.buttons & G.MIDDLE) === G.LEFT ? G.MIDDLE : (f.buttons & G.RIGHT) === G.LEFT ? G.RIGHT : null
|
|
3408
3437
|
};
|
|
3409
|
-
this._activePointers.push(g), this._domElement.ownerDocument.removeEventListener("mousemove",
|
|
3438
|
+
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(f);
|
|
3410
3439
|
}, a = (f) => {
|
|
3411
3440
|
f.cancelable && f.preventDefault();
|
|
3412
3441
|
const m = f.pointerId, g = this._lockedPointer || this._findPointerById(m);
|
|
@@ -3424,19 +3453,19 @@ class ot extends pr {
|
|
|
3424
3453
|
break;
|
|
3425
3454
|
}
|
|
3426
3455
|
else
|
|
3427
|
-
(!this._isDragging && this._lockedPointer || this._isDragging && (f.buttons &
|
|
3456
|
+
(!this._isDragging && this._lockedPointer || this._isDragging && (f.buttons & G.LEFT) === G.LEFT) && (this._state = this._state | this.mouseButtons.left), this._isDragging && (f.buttons & G.MIDDLE) === G.MIDDLE && (this._state = this._state | this.mouseButtons.middle), this._isDragging && (f.buttons & G.RIGHT) === G.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
3428
3457
|
A();
|
|
3429
3458
|
}
|
|
3430
|
-
},
|
|
3459
|
+
}, c = (f) => {
|
|
3431
3460
|
const m = this._lockedPointer || this._findPointerById(1);
|
|
3432
|
-
m && (m.clientX = f.clientX, m.clientY = f.clientY, m.deltaX = f.movementX, m.deltaY = f.movementY, this._state = 0, (this._lockedPointer || (f.buttons &
|
|
3461
|
+
m && (m.clientX = f.clientX, m.clientY = f.clientY, m.deltaX = f.movementX, m.deltaY = f.movementY, this._state = 0, (this._lockedPointer || (f.buttons & G.LEFT) === G.LEFT) && (this._state = this._state | this.mouseButtons.left), (f.buttons & G.MIDDLE) === G.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (f.buttons & G.RIGHT) === G.RIGHT && (this._state = this._state | this.mouseButtons.right), A());
|
|
3433
3462
|
}, E = (f) => {
|
|
3434
3463
|
const m = this._findPointerById(f.pointerId);
|
|
3435
3464
|
if (!(m && m === this._lockedPointer)) {
|
|
3436
3465
|
if (m && this._disposePointer(m), f.pointerType === "touch")
|
|
3437
3466
|
switch (this._activePointers.length) {
|
|
3438
3467
|
case 0:
|
|
3439
|
-
this._state =
|
|
3468
|
+
this._state = y.NONE;
|
|
3440
3469
|
break;
|
|
3441
3470
|
case 1:
|
|
3442
3471
|
this._state = this.touches.one;
|
|
@@ -3449,45 +3478,45 @@ class ot extends pr {
|
|
|
3449
3478
|
break;
|
|
3450
3479
|
}
|
|
3451
3480
|
else
|
|
3452
|
-
this._state =
|
|
3481
|
+
this._state = y.NONE;
|
|
3453
3482
|
C();
|
|
3454
3483
|
}
|
|
3455
3484
|
}, d = () => {
|
|
3456
3485
|
const f = this._findPointerById(1);
|
|
3457
|
-
f && f === this._lockedPointer || (f && this._disposePointer(f), this._state =
|
|
3486
|
+
f && f === this._lockedPointer || (f && this._disposePointer(f), this._state = y.NONE, C());
|
|
3458
3487
|
};
|
|
3459
3488
|
let h = -1;
|
|
3460
3489
|
const u = (f) => {
|
|
3461
|
-
if (!this._domElement || !this._enabled || this.mouseButtons.wheel ===
|
|
3490
|
+
if (!this._domElement || !this._enabled || this.mouseButtons.wheel === y.NONE)
|
|
3462
3491
|
return;
|
|
3463
3492
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
3464
|
-
const N = this._domElement.getBoundingClientRect(),
|
|
3465
|
-
if (
|
|
3493
|
+
const N = this._domElement.getBoundingClientRect(), L = f.clientX / N.width, w = f.clientY / N.height;
|
|
3494
|
+
if (L < this._interactiveArea.left || L > this._interactiveArea.right || w < this._interactiveArea.top || w > this._interactiveArea.bottom)
|
|
3466
3495
|
return;
|
|
3467
3496
|
}
|
|
3468
|
-
if (f.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel ===
|
|
3497
|
+
if (f.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === y.ROTATE || this.mouseButtons.wheel === y.TRUCK) {
|
|
3469
3498
|
const N = performance.now();
|
|
3470
3499
|
h - N < 1e3 && this._getClientRect(this._elementRect), h = N;
|
|
3471
3500
|
}
|
|
3472
|
-
const m =
|
|
3501
|
+
const m = mr ? -1 : -3, g = f.deltaMode === 1 ? f.deltaY / m : f.deltaY / (m * 10), S = this.dollyToCursor ? (f.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, _ = this.dollyToCursor ? (f.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
3473
3502
|
switch (this.mouseButtons.wheel) {
|
|
3474
|
-
case
|
|
3503
|
+
case y.ROTATE: {
|
|
3475
3504
|
this._rotateInternal(f.deltaX, f.deltaY), this._isUserControllingRotate = !0;
|
|
3476
3505
|
break;
|
|
3477
3506
|
}
|
|
3478
|
-
case
|
|
3507
|
+
case y.TRUCK: {
|
|
3479
3508
|
this._truckInternal(f.deltaX, f.deltaY, !1), this._isUserControllingTruck = !0;
|
|
3480
3509
|
break;
|
|
3481
3510
|
}
|
|
3482
|
-
case
|
|
3511
|
+
case y.OFFSET: {
|
|
3483
3512
|
this._truckInternal(f.deltaX, f.deltaY, !0), this._isUserControllingOffset = !0;
|
|
3484
3513
|
break;
|
|
3485
3514
|
}
|
|
3486
|
-
case
|
|
3515
|
+
case y.DOLLY: {
|
|
3487
3516
|
this._dollyInternal(-g, S, _), this._isUserControllingDolly = !0;
|
|
3488
3517
|
break;
|
|
3489
3518
|
}
|
|
3490
|
-
case
|
|
3519
|
+
case y.ZOOM: {
|
|
3491
3520
|
this._zoomInternal(-g, S, _), this._isUserControllingZoom = !0;
|
|
3492
3521
|
break;
|
|
3493
3522
|
}
|
|
@@ -3497,7 +3526,7 @@ class ot extends pr {
|
|
|
3497
3526
|
if (!(!this._domElement || !this._enabled)) {
|
|
3498
3527
|
if (this.mouseButtons.right === ot.ACTION.NONE) {
|
|
3499
3528
|
const m = f instanceof PointerEvent ? f.pointerId : (f instanceof MouseEvent, 0), g = this._findPointerById(m);
|
|
3500
|
-
g && this._disposePointer(g), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mousemove",
|
|
3529
|
+
g && this._disposePointer(g), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("mouseup", d);
|
|
3501
3530
|
return;
|
|
3502
3531
|
}
|
|
3503
3532
|
f.preventDefault();
|
|
@@ -3508,8 +3537,8 @@ class ot extends pr {
|
|
|
3508
3537
|
if (Zs(this._activePointers, lt), this._getClientRect(this._elementRect), e.copy(lt), i.copy(lt), this._activePointers.length >= 2) {
|
|
3509
3538
|
const g = lt.x - this._activePointers[1].clientX, S = lt.y - this._activePointers[1].clientY, _ = Math.sqrt(g * g + S * S);
|
|
3510
3539
|
o.set(0, _);
|
|
3511
|
-
const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5,
|
|
3512
|
-
i.set(N,
|
|
3540
|
+
const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, L = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
|
3541
|
+
i.set(N, L);
|
|
3513
3542
|
}
|
|
3514
3543
|
if (this._state = 0, !f)
|
|
3515
3544
|
this._lockedPointer && (this._state = this._state | this.mouseButtons.left);
|
|
@@ -3526,26 +3555,26 @@ class ot extends pr {
|
|
|
3526
3555
|
break;
|
|
3527
3556
|
}
|
|
3528
3557
|
else
|
|
3529
|
-
!this._lockedPointer && (f.buttons &
|
|
3530
|
-
((this._state &
|
|
3558
|
+
!this._lockedPointer && (f.buttons & G.LEFT) === G.LEFT && (this._state = this._state | this.mouseButtons.left), (f.buttons & G.MIDDLE) === G.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (f.buttons & G.RIGHT) === G.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
3559
|
+
((this._state & y.ROTATE) === y.ROTATE || (this._state & y.TOUCH_ROTATE) === y.TOUCH_ROTATE || (this._state & y.TOUCH_DOLLY_ROTATE) === y.TOUCH_DOLLY_ROTATE || (this._state & y.TOUCH_ZOOM_ROTATE) === y.TOUCH_ZOOM_ROTATE) && (this._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), ((this._state & y.TRUCK) === y.TRUCK || (this._state & y.TOUCH_TRUCK) === y.TOUCH_TRUCK || (this._state & y.TOUCH_DOLLY_TRUCK) === y.TOUCH_DOLLY_TRUCK || (this._state & y.TOUCH_ZOOM_TRUCK) === y.TOUCH_ZOOM_TRUCK) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & y.DOLLY) === y.DOLLY || (this._state & y.TOUCH_DOLLY) === y.TOUCH_DOLLY || (this._state & y.TOUCH_DOLLY_TRUCK) === y.TOUCH_DOLLY_TRUCK || (this._state & y.TOUCH_DOLLY_OFFSET) === y.TOUCH_DOLLY_OFFSET || (this._state & y.TOUCH_DOLLY_ROTATE) === y.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & y.ZOOM) === y.ZOOM || (this._state & y.TOUCH_ZOOM) === y.TOUCH_ZOOM || (this._state & y.TOUCH_ZOOM_TRUCK) === y.TOUCH_ZOOM_TRUCK || (this._state & y.TOUCH_ZOOM_OFFSET) === y.TOUCH_ZOOM_OFFSET || (this._state & y.TOUCH_ZOOM_ROTATE) === y.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & y.OFFSET) === y.OFFSET || (this._state & y.TOUCH_OFFSET) === y.TOUCH_OFFSET || (this._state & y.TOUCH_DOLLY_OFFSET) === y.TOUCH_DOLLY_OFFSET || (this._state & y.TOUCH_ZOOM_OFFSET) === y.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
|
|
3531
3560
|
}, A = () => {
|
|
3532
3561
|
if (!this._enabled || !this._dragNeedsUpdate)
|
|
3533
3562
|
return;
|
|
3534
3563
|
this._dragNeedsUpdate = !1, Zs(this._activePointers, lt);
|
|
3535
3564
|
const m = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, g = m ? -m.deltaX : i.x - lt.x, S = m ? -m.deltaY : i.y - lt.y;
|
|
3536
|
-
if (i.copy(lt), ((this._state &
|
|
3537
|
-
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,
|
|
3538
|
-
(this._state &
|
|
3565
|
+
if (i.copy(lt), ((this._state & y.ROTATE) === y.ROTATE || (this._state & y.TOUCH_ROTATE) === y.TOUCH_ROTATE || (this._state & y.TOUCH_DOLLY_ROTATE) === y.TOUCH_DOLLY_ROTATE || (this._state & y.TOUCH_ZOOM_ROTATE) === y.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(g, S), this._isUserControllingRotate = !0), (this._state & y.DOLLY) === y.DOLLY || (this._state & y.ZOOM) === y.ZOOM) {
|
|
3566
|
+
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, L = this.dollyDragInverted ? -1 : 1;
|
|
3567
|
+
(this._state & y.DOLLY) === y.DOLLY ? (this._dollyInternal(L * S * ds, _, N), this._isUserControllingDolly = !0) : (this._zoomInternal(L * S * ds, _, N), this._isUserControllingZoom = !0);
|
|
3539
3568
|
}
|
|
3540
|
-
if ((this._state &
|
|
3541
|
-
const _ = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY,
|
|
3542
|
-
o.set(0,
|
|
3543
|
-
const
|
|
3544
|
-
(this._state &
|
|
3569
|
+
if ((this._state & y.TOUCH_DOLLY) === y.TOUCH_DOLLY || (this._state & y.TOUCH_ZOOM) === y.TOUCH_ZOOM || (this._state & y.TOUCH_DOLLY_TRUCK) === y.TOUCH_DOLLY_TRUCK || (this._state & y.TOUCH_ZOOM_TRUCK) === y.TOUCH_ZOOM_TRUCK || (this._state & y.TOUCH_DOLLY_OFFSET) === y.TOUCH_DOLLY_OFFSET || (this._state & y.TOUCH_ZOOM_OFFSET) === y.TOUCH_ZOOM_OFFSET || (this._state & y.TOUCH_DOLLY_ROTATE) === y.TOUCH_DOLLY_ROTATE || (this._state & y.TOUCH_ZOOM_ROTATE) === y.TOUCH_ZOOM_ROTATE) {
|
|
3570
|
+
const _ = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY, L = Math.sqrt(_ * _ + N * N), w = o.y - L;
|
|
3571
|
+
o.set(0, L);
|
|
3572
|
+
const P = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, D = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
3573
|
+
(this._state & y.TOUCH_DOLLY) === y.TOUCH_DOLLY || (this._state & y.TOUCH_DOLLY_ROTATE) === y.TOUCH_DOLLY_ROTATE || (this._state & y.TOUCH_DOLLY_TRUCK) === y.TOUCH_DOLLY_TRUCK || (this._state & y.TOUCH_DOLLY_OFFSET) === y.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(w * ds, P, D), this._isUserControllingDolly = !0) : (this._zoomInternal(w * ds, P, D), this._isUserControllingZoom = !0);
|
|
3545
3574
|
}
|
|
3546
|
-
((this._state &
|
|
3575
|
+
((this._state & y.TRUCK) === y.TRUCK || (this._state & y.TOUCH_TRUCK) === y.TOUCH_TRUCK || (this._state & y.TOUCH_DOLLY_TRUCK) === y.TOUCH_DOLLY_TRUCK || (this._state & y.TOUCH_ZOOM_TRUCK) === y.TOUCH_ZOOM_TRUCK) && (this._truckInternal(g, S, !1), this._isUserControllingTruck = !0), ((this._state & y.OFFSET) === y.OFFSET || (this._state & y.TOUCH_OFFSET) === y.TOUCH_OFFSET || (this._state & y.TOUCH_DOLLY_OFFSET) === y.TOUCH_DOLLY_OFFSET || (this._state & y.TOUCH_ZOOM_OFFSET) === y.TOUCH_ZOOM_OFFSET) && (this._truckInternal(g, S, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
3547
3576
|
}, C = () => {
|
|
3548
|
-
Zs(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",
|
|
3577
|
+
Zs(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", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this.dispatchEvent({ type: "controlend" }));
|
|
3549
3578
|
};
|
|
3550
3579
|
this.lockPointer = () => {
|
|
3551
3580
|
!this._enabled || !this._domElement || (this.cancel(), this._lockedPointer = {
|
|
@@ -3565,11 +3594,11 @@ class ot extends pr {
|
|
|
3565
3594
|
this.unlockPointer();
|
|
3566
3595
|
};
|
|
3567
3596
|
this._addAllEventListeners = (f) => {
|
|
3568
|
-
this._domElement = f, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n),
|
|
3597
|
+
this._domElement = f, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), Rr && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", E), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", p);
|
|
3569
3598
|
}, this._removeAllEventListeners = () => {
|
|
3570
|
-
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", E), this._domElement.removeEventListener("wheel", u, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove",
|
|
3599
|
+
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", E), this._domElement.removeEventListener("wheel", u, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.removeEventListener("pointerlockchange", T), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
|
|
3571
3600
|
}, this.cancel = () => {
|
|
3572
|
-
this._state !==
|
|
3601
|
+
this._state !== y.NONE && (this._state = y.NONE, this._activePointers.length = 0, C());
|
|
3573
3602
|
}, t && this.connect(t), this.update(0);
|
|
3574
3603
|
}
|
|
3575
3604
|
/**
|
|
@@ -3825,7 +3854,7 @@ class ot extends pr {
|
|
|
3825
3854
|
* @category Methods
|
|
3826
3855
|
*/
|
|
3827
3856
|
dollyInFixed(s, t = !1) {
|
|
3828
|
-
this._targetEnd.add(this._getCameraDirection(
|
|
3857
|
+
this._targetEnd.add(this._getCameraDirection(Le).multiplyScalar(s)), t || this._target.copy(this._targetEnd);
|
|
3829
3858
|
const e = !t || k(this._target.x, this._targetEnd.x, this.restThreshold) && k(this._target.y, this._targetEnd.y, this.restThreshold) && k(this._target.z, this._targetEnd.z, this.restThreshold);
|
|
3830
3859
|
return this._createOnRestPromise(e);
|
|
3831
3860
|
}
|
|
@@ -3867,7 +3896,7 @@ class ot extends pr {
|
|
|
3867
3896
|
*/
|
|
3868
3897
|
truck(s, t, e = !1) {
|
|
3869
3898
|
this._camera.updateMatrix(), St.setFromMatrixColumn(this._camera.matrix, 0), _t.setFromMatrixColumn(this._camera.matrix, 1), St.multiplyScalar(s), _t.multiplyScalar(-t);
|
|
3870
|
-
const i =
|
|
3899
|
+
const i = V.copy(St).add(_t), o = z.copy(this._targetEnd).add(i);
|
|
3871
3900
|
return this.moveTo(o.x, o.y, o.z, e);
|
|
3872
3901
|
}
|
|
3873
3902
|
/**
|
|
@@ -3877,8 +3906,8 @@ class ot extends pr {
|
|
|
3877
3906
|
* @category Methods
|
|
3878
3907
|
*/
|
|
3879
3908
|
forward(s, t = !1) {
|
|
3880
|
-
|
|
3881
|
-
const e = z.copy(this._targetEnd).add(
|
|
3909
|
+
V.setFromMatrixColumn(this._camera.matrix, 0), V.crossVectors(this._camera.up, V), V.multiplyScalar(s);
|
|
3910
|
+
const e = z.copy(this._targetEnd).add(V);
|
|
3882
3911
|
return this.moveTo(e.x, e.y, e.z, t);
|
|
3883
3912
|
}
|
|
3884
3913
|
/**
|
|
@@ -3888,7 +3917,7 @@ class ot extends pr {
|
|
|
3888
3917
|
* @category Methods
|
|
3889
3918
|
*/
|
|
3890
3919
|
elevate(s, t = !1) {
|
|
3891
|
-
return
|
|
3920
|
+
return V.copy(this._camera.up).multiplyScalar(s), this.moveTo(this._targetEnd.x + V.x, this._targetEnd.y + V.y, this._targetEnd.z + V.z, t);
|
|
3892
3921
|
}
|
|
3893
3922
|
/**
|
|
3894
3923
|
* Move target position to given point.
|
|
@@ -3900,7 +3929,7 @@ class ot extends pr {
|
|
|
3900
3929
|
*/
|
|
3901
3930
|
moveTo(s, t, e, i = !1) {
|
|
3902
3931
|
this._isUserControllingTruck = !1;
|
|
3903
|
-
const o =
|
|
3932
|
+
const o = V.set(s, t, e).sub(this._targetEnd);
|
|
3904
3933
|
this._encloseToBoundary(this._targetEnd, o, this.boundaryFriction), this._needsUpdate = !0, i || this._target.copy(this._targetEnd);
|
|
3905
3934
|
const n = !i || 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);
|
|
3906
3935
|
return this._createOnRestPromise(n);
|
|
@@ -3915,7 +3944,7 @@ class ot extends pr {
|
|
|
3915
3944
|
* @category Methods
|
|
3916
3945
|
*/
|
|
3917
3946
|
lookInDirectionOf(s, t, e, i = !1) {
|
|
3918
|
-
const r =
|
|
3947
|
+
const r = V.set(s, t, e).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);
|
|
3919
3948
|
return this.setPosition(r.x, r.y, r.z, i);
|
|
3920
3949
|
}
|
|
3921
3950
|
/**
|
|
@@ -3932,15 +3961,15 @@ class ot extends pr {
|
|
|
3932
3961
|
* @category Methods
|
|
3933
3962
|
*/
|
|
3934
3963
|
fitToBox(s, t, { cover: e = !1, paddingLeft: i = 0, paddingRight: o = 0, paddingBottom: n = 0, paddingTop: r = 0 } = {}) {
|
|
3935
|
-
const a = [],
|
|
3936
|
-
|
|
3964
|
+
const a = [], c = s.isBox3 ? de.copy(s) : de.setFromObject(s);
|
|
3965
|
+
c.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
|
|
3937
3966
|
const E = Ki(this._sphericalEnd.theta, $i), d = Ki(this._sphericalEnd.phi, $i);
|
|
3938
3967
|
a.push(this.rotateTo(E, d, t));
|
|
3939
|
-
const h =
|
|
3968
|
+
const h = V.setFromSpherical(this._sphericalEnd).normalize(), u = on.setFromUnitVectors(h, js), p = k(Math.abs(h.y), 1);
|
|
3940
3969
|
p && u.multiply($s.setFromAxisAngle(us, E)), u.multiply(this._yAxisUpSpaceInverse);
|
|
3941
3970
|
const R = nn.makeEmpty();
|
|
3942
|
-
z.copy(
|
|
3943
|
-
const A = R.getSize(
|
|
3971
|
+
z.copy(c.min).applyQuaternion(u), R.expandByPoint(z), z.copy(c.min).setX(c.max.x).applyQuaternion(u), R.expandByPoint(z), z.copy(c.min).setY(c.max.y).applyQuaternion(u), R.expandByPoint(z), z.copy(c.max).setZ(c.min.z).applyQuaternion(u), R.expandByPoint(z), z.copy(c.min).setZ(c.max.z).applyQuaternion(u), R.expandByPoint(z), z.copy(c.max).setY(c.min.y).applyQuaternion(u), R.expandByPoint(z), z.copy(c.max).setX(c.min.x).applyQuaternion(u), R.expandByPoint(z), z.copy(c.max).applyQuaternion(u), R.expandByPoint(z), R.min.x -= i, R.min.y -= n, R.max.x += o, R.max.y += r, u.setFromUnitVectors(js, h), p && u.premultiply($s.invert()), u.premultiply(this._yAxisUpSpace);
|
|
3972
|
+
const A = R.getSize(V), C = R.getCenter(z).applyQuaternion(u);
|
|
3944
3973
|
if (Zt(this._camera)) {
|
|
3945
3974
|
const T = this.getDistanceToFitBox(A.x, A.y, A.z, e);
|
|
3946
3975
|
a.push(this.moveTo(C.x, C.y, C.z, t)), a.push(this.dollyTo(T, t)), a.push(this.setFocalOffset(0, 0, 0, t));
|
|
@@ -3962,8 +3991,8 @@ class ot extends pr {
|
|
|
3962
3991
|
const n = this.getDistanceToFitSphere(o.radius);
|
|
3963
3992
|
e.push(this.dollyTo(n, t));
|
|
3964
3993
|
} else if (vt(this._camera)) {
|
|
3965
|
-
const n = this._camera.right - this._camera.left, r = this._camera.top - this._camera.bottom, a = 2 * o.radius,
|
|
3966
|
-
e.push(this.zoomTo(
|
|
3994
|
+
const n = this._camera.right - this._camera.left, r = this._camera.top - this._camera.bottom, a = 2 * o.radius, c = Math.min(n / a, r / a);
|
|
3995
|
+
e.push(this.zoomTo(c, t));
|
|
3967
3996
|
}
|
|
3968
3997
|
return e.push(this.setFocalOffset(0, 0, 0, t)), Promise.all(e);
|
|
3969
3998
|
}
|
|
@@ -3980,8 +4009,8 @@ class ot extends pr {
|
|
|
3980
4009
|
*/
|
|
3981
4010
|
setLookAt(s, t, e, i, o, n, r = !1) {
|
|
3982
4011
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = le.NONE, this._changedDolly = 0;
|
|
3983
|
-
const a = z.set(i, o, n),
|
|
3984
|
-
this._targetEnd.copy(a), this._sphericalEnd.setFromVector3(
|
|
4012
|
+
const a = z.set(i, o, n), c = V.set(s, t, e);
|
|
4013
|
+
this._targetEnd.copy(a), this._sphericalEnd.setFromVector3(c.sub(a).applyQuaternion(this._yAxisUpSpace)), this.normalizeRotations(), this._needsUpdate = !0, r || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
3985
4014
|
const E = !r || 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);
|
|
3986
4015
|
return this._createOnRestPromise(E);
|
|
3987
4016
|
}
|
|
@@ -4003,13 +4032,13 @@ class ot extends pr {
|
|
|
4003
4032
|
* @param enableTransition
|
|
4004
4033
|
* @category Methods
|
|
4005
4034
|
*/
|
|
4006
|
-
lerpLookAt(s, t, e, i, o, n, r, a,
|
|
4035
|
+
lerpLookAt(s, t, e, i, o, n, r, a, c, E, d, h, u, p = !1) {
|
|
4007
4036
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = le.NONE, this._changedDolly = 0;
|
|
4008
|
-
const R =
|
|
4037
|
+
const R = V.set(i, o, n), A = z.set(s, t, e);
|
|
4009
4038
|
ut.setFromVector3(A.sub(R).applyQuaternion(this._yAxisUpSpace));
|
|
4010
|
-
const C = Ee.set(E, d, h), T = z.set(r, a,
|
|
4011
|
-
|
|
4012
|
-
const F =
|
|
4039
|
+
const C = Ee.set(E, d, h), T = z.set(r, a, c);
|
|
4040
|
+
Pe.setFromVector3(T.sub(C).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(R.lerp(C, u));
|
|
4041
|
+
const F = Pe.theta - ut.theta, f = Pe.phi - ut.phi, m = Pe.radius - ut.radius;
|
|
4013
4042
|
this._sphericalEnd.set(ut.radius + m * u, ut.phi + f * u, ut.theta + F * u), this.normalizeRotations(), this._needsUpdate = !0, p || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
4014
4043
|
const g = !p || 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);
|
|
4015
4044
|
return this._createOnRestPromise(g);
|
|
@@ -4036,7 +4065,7 @@ class ot extends pr {
|
|
|
4036
4065
|
* @category Methods
|
|
4037
4066
|
*/
|
|
4038
4067
|
setTarget(s, t, e, i = !1) {
|
|
4039
|
-
const o = this.getPosition(
|
|
4068
|
+
const o = this.getPosition(V), n = this.setLookAt(o.x, o.y, o.z, s, t, e, i);
|
|
4040
4069
|
return this._sphericalEnd.phi = mt(this._sphericalEnd.phi, this.minPolarAngle, this.maxPolarAngle), n;
|
|
4041
4070
|
}
|
|
4042
4071
|
/**
|
|
@@ -4062,8 +4091,8 @@ class ot extends pr {
|
|
|
4062
4091
|
*/
|
|
4063
4092
|
setOrbitPoint(s, t, e) {
|
|
4064
4093
|
this._camera.updateMatrixWorld(), St.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), _t.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), Qt.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
|
|
4065
|
-
const i =
|
|
4066
|
-
St.multiplyScalar(n.x), _t.multiplyScalar(n.y), Qt.multiplyScalar(n.z),
|
|
4094
|
+
const i = V.set(s, t, e), o = i.distanceTo(this._camera.position), n = i.sub(this._camera.position);
|
|
4095
|
+
St.multiplyScalar(n.x), _t.multiplyScalar(n.y), Qt.multiplyScalar(n.z), V.copy(St).add(_t).add(Qt), V.z = V.z + o, this.dollyTo(o, !1), this.setFocalOffset(-V.x, V.y, -V.z, !1), this.moveTo(s, t, e, !1);
|
|
4067
4096
|
}
|
|
4068
4097
|
/**
|
|
4069
4098
|
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
|
@@ -4170,7 +4199,7 @@ class ot extends pr {
|
|
|
4170
4199
|
reset(s = !1) {
|
|
4171
4200
|
if (!k(this._camera.up.x, this._cameraUp0.x) || !k(this._camera.up.y, this._cameraUp0.y) || !k(this._camera.up.z, this._cameraUp0.z)) {
|
|
4172
4201
|
this._camera.up.copy(this._cameraUp0);
|
|
4173
|
-
const e = this.getPosition(
|
|
4202
|
+
const e = this.getPosition(V);
|
|
4174
4203
|
this.updateCameraUp(), this.setPosition(e.x, e.y, e.z);
|
|
4175
4204
|
}
|
|
4176
4205
|
const t = [
|
|
@@ -4201,9 +4230,9 @@ class ot extends pr {
|
|
|
4201
4230
|
* @category Methods
|
|
4202
4231
|
*/
|
|
4203
4232
|
applyCameraUp() {
|
|
4204
|
-
const s =
|
|
4233
|
+
const s = V.subVectors(this._target, this._camera.position).normalize(), t = z.crossVectors(s, this._camera.up);
|
|
4205
4234
|
this._camera.up.crossVectors(t, s).normalize(), this._camera.updateMatrixWorld();
|
|
4206
|
-
const e = this.getPosition(
|
|
4235
|
+
const e = this.getPosition(V);
|
|
4207
4236
|
this.updateCameraUp(), this.setPosition(e.x, e.y, e.z);
|
|
4208
4237
|
}
|
|
4209
4238
|
/**
|
|
@@ -4253,9 +4282,9 @@ class ot extends pr {
|
|
|
4253
4282
|
}
|
|
4254
4283
|
if (this.dollyToCursor) {
|
|
4255
4284
|
if (Zt(this._camera) && this._changedDolly !== 0) {
|
|
4256
|
-
const d = this._spherical.radius - this._lastDistance, h = this._camera, u = this._getCameraDirection(
|
|
4285
|
+
const d = this._spherical.radius - this._lastDistance, h = this._camera, u = this._getCameraDirection(Le), p = V.copy(u).cross(h.up).normalize();
|
|
4257
4286
|
p.lengthSq() === 0 && (p.x = 1);
|
|
4258
|
-
const R = z.crossVectors(p, u), A = this._sphericalEnd.radius * Math.tan(h.getEffectiveFOV() * _e * 0.5), T = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = Ee.copy(this._targetEnd).add(p.multiplyScalar(this._dollyControlCoord.x * A * h.aspect)).add(R.multiplyScalar(this._dollyControlCoord.y * A)), f =
|
|
4287
|
+
const R = z.crossVectors(p, u), A = this._sphericalEnd.radius * Math.tan(h.getEffectiveFOV() * _e * 0.5), T = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = Ee.copy(this._targetEnd).add(p.multiplyScalar(this._dollyControlCoord.x * A * h.aspect)).add(R.multiplyScalar(this._dollyControlCoord.y * A)), f = V.copy(this._targetEnd).lerp(F, T), m = this._lastDollyDirection === le.IN && this._spherical.radius <= this.minDistance, g = this._lastDollyDirection === le.OUT && this.maxDistance <= this._spherical.radius;
|
|
4259
4288
|
if (this.infinityDolly && (m || g)) {
|
|
4260
4289
|
this._sphericalEnd.radius -= d, this._spherical.radius -= d;
|
|
4261
4290
|
const _ = z.copy(u).multiplyScalar(-d);
|
|
@@ -4265,7 +4294,7 @@ class ot extends pr {
|
|
|
4265
4294
|
const S = z.subVectors(f, this._targetEnd);
|
|
4266
4295
|
this._targetEnd.copy(f), this._target.add(S), this._changedDolly -= d, X(this._changedDolly) && (this._changedDolly = 0);
|
|
4267
4296
|
} else if (vt(this._camera) && this._changedZoom !== 0) {
|
|
4268
|
-
const d = this._zoom - this._lastZoom, h = this._camera, u =
|
|
4297
|
+
const d = this._zoom - this._lastZoom, h = this._camera, u = V.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (h.near + h.far) / (h.near - h.far)).unproject(h), p = z.set(0, 0, -1).applyQuaternion(h.quaternion), R = Ee.copy(u).add(p.multiplyScalar(-u.dot(h.up))), C = -(this._zoom - d - this._zoom) / this._zoom, T = this._getCameraDirection(Le), F = this._targetEnd.dot(T), f = V.copy(this._targetEnd).lerp(R, C), m = f.dot(T), g = T.multiplyScalar(m - F);
|
|
4269
4298
|
f.sub(g), this._boundary.clampPoint(f, f);
|
|
4270
4299
|
const S = z.subVectors(f, this._targetEnd);
|
|
4271
4300
|
this._targetEnd.copy(f), this._target.add(S), this._changedZoom -= d, X(this._changedZoom) && (this._changedZoom = 0);
|
|
@@ -4273,7 +4302,7 @@ class ot extends pr {
|
|
|
4273
4302
|
}
|
|
4274
4303
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
|
4275
4304
|
const a = this._collisionTest();
|
|
4276
|
-
this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), St.setFromMatrixColumn(this._camera.matrix, 0), _t.setFromMatrixColumn(this._camera.matrix, 1), Qt.setFromMatrixColumn(this._camera.matrix, 2), St.multiplyScalar(this._focalOffset.x), _t.multiplyScalar(-this._focalOffset.y), Qt.multiplyScalar(this._focalOffset.z),
|
|
4305
|
+
this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), St.setFromMatrixColumn(this._camera.matrix, 0), _t.setFromMatrixColumn(this._camera.matrix, 1), Qt.setFromMatrixColumn(this._camera.matrix, 2), St.multiplyScalar(this._focalOffset.x), _t.multiplyScalar(-this._focalOffset.y), Qt.multiplyScalar(this._focalOffset.z), V.copy(St).add(_t).add(Qt), this._camera.position.add(V)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), V.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
|
|
4277
4306
|
const E = this._needsUpdate;
|
|
4278
4307
|
return E && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : E ? (this.dispatchEvent({ type: "update" }), X(t, this.restThreshold) && X(e, this.restThreshold) && X(i, this.restThreshold) && X(o.x, this.restThreshold) && X(o.y, this.restThreshold) && X(o.z, this.restThreshold) && X(n.x, this.restThreshold) && X(n.y, this.restThreshold) && X(n.z, this.restThreshold) && X(r, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !E && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = E, this._needsUpdate = !1, E;
|
|
4279
4308
|
}
|
|
@@ -4299,7 +4328,7 @@ class ot extends pr {
|
|
|
4299
4328
|
dollyToCursor: this.dollyToCursor,
|
|
4300
4329
|
verticalDragToForward: this.verticalDragToForward,
|
|
4301
4330
|
target: this._targetEnd.toArray(),
|
|
4302
|
-
position:
|
|
4331
|
+
position: V.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),
|
|
4303
4332
|
zoom: this._zoomEnd,
|
|
4304
4333
|
focalOffset: this._focalOffsetEnd.toArray(),
|
|
4305
4334
|
target0: this._target0.toArray(),
|
|
@@ -4316,7 +4345,7 @@ class ot extends pr {
|
|
|
4316
4345
|
*/
|
|
4317
4346
|
fromJSON(s, t = !1) {
|
|
4318
4347
|
const e = JSON.parse(s);
|
|
4319
|
-
this.enabled = e.enabled, this.minDistance = e.minDistance, this.maxDistance =
|
|
4348
|
+
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(V.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;
|
|
4320
4349
|
}
|
|
4321
4350
|
/**
|
|
4322
4351
|
* Attach all internal event handlers to enable drag control.
|
|
@@ -4327,7 +4356,7 @@ class ot extends pr {
|
|
|
4327
4356
|
console.warn("camera-controls is already connected.");
|
|
4328
4357
|
return;
|
|
4329
4358
|
}
|
|
4330
|
-
s.setAttribute("data-camera-controls-version",
|
|
4359
|
+
s.setAttribute("data-camera-controls-version", Tr), this._addAllEventListeners(s), this._getClientRect(this._elementRect);
|
|
4331
4360
|
}
|
|
4332
4361
|
/**
|
|
4333
4362
|
* Detach all internal event handlers to disable drag control.
|
|
@@ -4371,8 +4400,8 @@ class ot extends pr {
|
|
|
4371
4400
|
if (e === 0)
|
|
4372
4401
|
return s.add(t).add(r);
|
|
4373
4402
|
{
|
|
4374
|
-
const
|
|
4375
|
-
return s.add(z.copy(t).multiplyScalar(
|
|
4403
|
+
const c = 1 + e * a / t.dot(r);
|
|
4404
|
+
return s.add(z.copy(t).multiplyScalar(c)).add(r.multiplyScalar(1 - e));
|
|
4376
4405
|
}
|
|
4377
4406
|
}
|
|
4378
4407
|
_updateNearPlaneCorners() {
|
|
@@ -4389,7 +4418,7 @@ class ot extends pr {
|
|
|
4389
4418
|
let s = 1 / 0;
|
|
4390
4419
|
if (!(this.colliderMeshes.length >= 1) || Qs(this._camera, "_collisionTest"))
|
|
4391
4420
|
return s;
|
|
4392
|
-
const e = this._getTargetDirection(
|
|
4421
|
+
const e = this._getTargetDirection(Le);
|
|
4393
4422
|
Ks.lookAt(tn, e, this._camera.up);
|
|
4394
4423
|
for (let i = 0; i < 4; i++) {
|
|
4395
4424
|
const o = z.copy(this._nearPlaneCorners[i]);
|
|
@@ -4468,20 +4497,20 @@ class ot extends pr {
|
|
|
4468
4497
|
a.applyMatrix4(r.matrixWorld);
|
|
4469
4498
|
const E = a.attributes.position;
|
|
4470
4499
|
for (let d = 0, h = E.count; d < h; d++)
|
|
4471
|
-
|
|
4500
|
+
V.fromBufferAttribute(E, d), o = Math.max(o, i.distanceToSquared(V));
|
|
4472
4501
|
}), e.radius = Math.sqrt(o), e;
|
|
4473
4502
|
}
|
|
4474
4503
|
}
|
|
4475
|
-
class We extends
|
|
4504
|
+
class We extends er {
|
|
4476
4505
|
constructor(t) {
|
|
4477
4506
|
super(t);
|
|
4478
4507
|
/** {@link Updateable.onBeforeUpdate} */
|
|
4479
|
-
I(this, "onBeforeUpdate", new
|
|
4508
|
+
I(this, "onBeforeUpdate", new U());
|
|
4480
4509
|
/** {@link Updateable.onAfterUpdate} */
|
|
4481
|
-
I(this, "onAfterUpdate", new
|
|
4482
|
-
I(this, "onAspectUpdated", new
|
|
4510
|
+
I(this, "onAfterUpdate", new U());
|
|
4511
|
+
I(this, "onAspectUpdated", new U());
|
|
4483
4512
|
/** {@link Disposable.onDisposed} */
|
|
4484
|
-
I(this, "onDisposed", new
|
|
4513
|
+
I(this, "onDisposed", new U());
|
|
4485
4514
|
I(this, "three");
|
|
4486
4515
|
I(this, "_allControls", /* @__PURE__ */ new Map());
|
|
4487
4516
|
/**
|
|
@@ -4573,15 +4602,15 @@ class We extends tr {
|
|
|
4573
4602
|
const Os = class Os extends it {
|
|
4574
4603
|
constructor(t) {
|
|
4575
4604
|
super(t);
|
|
4576
|
-
I(this, "onAfterUpdate", new
|
|
4577
|
-
I(this, "onBeforeUpdate", new
|
|
4578
|
-
I(this, "onDisposed", new
|
|
4605
|
+
I(this, "onAfterUpdate", new U());
|
|
4606
|
+
I(this, "onBeforeUpdate", new U());
|
|
4607
|
+
I(this, "onDisposed", new U());
|
|
4579
4608
|
I(this, "list", /* @__PURE__ */ new Map());
|
|
4580
4609
|
I(this, "enabled", !0);
|
|
4581
4610
|
t.add(Os.uuid, this);
|
|
4582
4611
|
}
|
|
4583
4612
|
create() {
|
|
4584
|
-
const t = new
|
|
4613
|
+
const t = new pr(this.components), e = t.uuid;
|
|
4585
4614
|
if (this.list.has(e))
|
|
4586
4615
|
throw new Error("There is already a world with this name!");
|
|
4587
4616
|
return this.list.set(e, t), t;
|
|
@@ -4603,10 +4632,10 @@ const Os = class Os extends it {
|
|
|
4603
4632
|
};
|
|
4604
4633
|
I(Os, "uuid", "fdb61dc4-2ec1-4966-b83d-54ea795fad4a");
|
|
4605
4634
|
let di = Os;
|
|
4606
|
-
class
|
|
4635
|
+
class Ar {
|
|
4607
4636
|
constructor(s, t, e) {
|
|
4608
4637
|
/** {@link Disposable.onDisposed} */
|
|
4609
|
-
I(this, "onDisposed", new
|
|
4638
|
+
I(this, "onDisposed", new U());
|
|
4610
4639
|
I(this, "world");
|
|
4611
4640
|
I(this, "components");
|
|
4612
4641
|
I(this, "_grid");
|
|
@@ -4617,7 +4646,7 @@ class Rr {
|
|
|
4617
4646
|
this.world = t;
|
|
4618
4647
|
const { color: i, size1: o, size2: n, distance: r } = e;
|
|
4619
4648
|
this.components = s;
|
|
4620
|
-
const a = new O.PlaneGeometry(2, 2, 1, 1),
|
|
4649
|
+
const a = new O.PlaneGeometry(2, 2, 1, 1), c = new O.ShaderMaterial({
|
|
4621
4650
|
side: O.DoubleSide,
|
|
4622
4651
|
uniforms: {
|
|
4623
4652
|
uSize1: {
|
|
@@ -4707,7 +4736,7 @@ class Rr {
|
|
|
4707
4736
|
derivatives: !0
|
|
4708
4737
|
}
|
|
4709
4738
|
});
|
|
4710
|
-
this._grid = new O.Mesh(a,
|
|
4739
|
+
this._grid = new O.Mesh(a, c), this._grid.frustumCulled = !1, t.scene.three.add(this._grid), this.setupEvents(!0);
|
|
4711
4740
|
}
|
|
4712
4741
|
/** {@link Hideable.visible} */
|
|
4713
4742
|
get visible() {
|
|
@@ -4753,11 +4782,11 @@ class Rr {
|
|
|
4753
4782
|
s ? t.addEventListener("update", this.updateZoom) : t.removeEventListener("update", this.updateZoom);
|
|
4754
4783
|
}
|
|
4755
4784
|
}
|
|
4756
|
-
class
|
|
4785
|
+
class Fr extends it {
|
|
4757
4786
|
constructor() {
|
|
4758
4787
|
super(...arguments);
|
|
4759
4788
|
I(this, "list", /* @__PURE__ */ new Map());
|
|
4760
|
-
I(this, "onDisposed", new
|
|
4789
|
+
I(this, "onDisposed", new U());
|
|
4761
4790
|
I(this, "config", {
|
|
4762
4791
|
color: new O.Color(12303291),
|
|
4763
4792
|
size1: 1,
|
|
@@ -4770,7 +4799,7 @@ class Ar extends it {
|
|
|
4770
4799
|
create(t) {
|
|
4771
4800
|
if (this.list.has(t.uuid))
|
|
4772
4801
|
throw new Error("This world already has a grid!");
|
|
4773
|
-
const e = new
|
|
4802
|
+
const e = new Ar(this.components, t, this.config);
|
|
4774
4803
|
this.list.set(t.uuid, e), t.onDisposed.add(() => {
|
|
4775
4804
|
this.delete(t);
|
|
4776
4805
|
});
|
|
@@ -4785,18 +4814,18 @@ class Ar extends it {
|
|
|
4785
4814
|
this.list.clear(), this.onDisposed.trigger();
|
|
4786
4815
|
}
|
|
4787
4816
|
}
|
|
4788
|
-
I(
|
|
4789
|
-
const jt = new zn(), nt = new M(), bt = new M(), j = new
|
|
4817
|
+
I(Fr, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
|
|
4818
|
+
const jt = new zn(), nt = new M(), bt = new M(), j = new Lt(), rn = {
|
|
4790
4819
|
X: new M(1, 0, 0),
|
|
4791
4820
|
Y: new M(0, 1, 0),
|
|
4792
4821
|
Z: new M(0, 0, 1)
|
|
4793
4822
|
}, Js = { type: "change" }, an = { type: "mouseDown" }, cn = { type: "mouseUp", mode: null }, ln = { type: "objectChange" };
|
|
4794
|
-
class
|
|
4823
|
+
class gr extends ei {
|
|
4795
4824
|
constructor(s, t) {
|
|
4796
4825
|
super(), t === void 0 && (console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'), t = document), this.isTransformControls = !0, this.visible = !1, this.domElement = t, this.domElement.style.touchAction = "none";
|
|
4797
|
-
const e = new
|
|
4826
|
+
const e = new Lr();
|
|
4798
4827
|
this._gizmo = e, this.add(e);
|
|
4799
|
-
const i = new
|
|
4828
|
+
const i = new Pr();
|
|
4800
4829
|
this._plane = i, this.add(i);
|
|
4801
4830
|
const o = this;
|
|
4802
4831
|
function n(T, F) {
|
|
@@ -4811,8 +4840,8 @@ class Fr extends ei {
|
|
|
4811
4840
|
}), o[T] = F, i[T] = F, e[T] = F;
|
|
4812
4841
|
}
|
|
4813
4842
|
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);
|
|
4814
|
-
const r = new M(), a = new M(),
|
|
4815
|
-
n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion",
|
|
4843
|
+
const r = new M(), a = new M(), c = new Lt(), E = new Lt(), d = new M(), h = new Lt(), u = new M(), p = new M(), R = new M(), A = 0, C = new M();
|
|
4844
|
+
n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", E), n("cameraPosition", d), n("cameraQuaternion", h), n("pointStart", u), n("pointEnd", p), n("rotationAxis", R), n("rotationAngle", A), n("eye", C), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new Lt(), this._parentQuaternionInv = new Lt(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new Lt(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new Lt(), this._scaleStart = new M(), this._getPointer = Or.bind(this), this._onPointerDown = _r.bind(this), this._onPointerHover = Sr.bind(this), this._onPointerMove = Nr.bind(this), this._onPointerUp = yr.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
|
|
4816
4845
|
}
|
|
4817
4846
|
// updateMatrixWorld updates key transformation variables
|
|
4818
4847
|
updateMatrixWorld() {
|
|
@@ -4903,49 +4932,49 @@ class Fr extends ei {
|
|
|
4903
4932
|
this.space = s;
|
|
4904
4933
|
}
|
|
4905
4934
|
}
|
|
4906
|
-
function
|
|
4935
|
+
function Or(l) {
|
|
4907
4936
|
if (this.domElement.ownerDocument.pointerLockElement)
|
|
4908
4937
|
return {
|
|
4909
4938
|
x: 0,
|
|
4910
4939
|
y: 0,
|
|
4911
|
-
button:
|
|
4940
|
+
button: l.button
|
|
4912
4941
|
};
|
|
4913
4942
|
{
|
|
4914
4943
|
const s = this.domElement.getBoundingClientRect();
|
|
4915
4944
|
return {
|
|
4916
|
-
x: (
|
|
4917
|
-
y: -(
|
|
4918
|
-
button:
|
|
4945
|
+
x: (l.clientX - s.left) / s.width * 2 - 1,
|
|
4946
|
+
y: -(l.clientY - s.top) / s.height * 2 + 1,
|
|
4947
|
+
button: l.button
|
|
4919
4948
|
};
|
|
4920
4949
|
}
|
|
4921
4950
|
}
|
|
4922
|
-
function
|
|
4951
|
+
function Sr(l) {
|
|
4923
4952
|
if (this.enabled)
|
|
4924
|
-
switch (
|
|
4953
|
+
switch (l.pointerType) {
|
|
4925
4954
|
case "mouse":
|
|
4926
4955
|
case "pen":
|
|
4927
|
-
this.pointerHover(this._getPointer(
|
|
4956
|
+
this.pointerHover(this._getPointer(l));
|
|
4928
4957
|
break;
|
|
4929
4958
|
}
|
|
4930
4959
|
}
|
|
4931
|
-
function
|
|
4932
|
-
this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(
|
|
4960
|
+
function _r(l) {
|
|
4961
|
+
this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(l.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(l)), this.pointerDown(this._getPointer(l)));
|
|
4933
4962
|
}
|
|
4934
|
-
function
|
|
4935
|
-
this.enabled && this.pointerMove(this._getPointer(
|
|
4963
|
+
function Nr(l) {
|
|
4964
|
+
this.enabled && this.pointerMove(this._getPointer(l));
|
|
4936
4965
|
}
|
|
4937
|
-
function
|
|
4938
|
-
this.enabled && (this.domElement.releasePointerCapture(
|
|
4966
|
+
function yr(l) {
|
|
4967
|
+
this.enabled && (this.domElement.releasePointerCapture(l.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(l)));
|
|
4939
4968
|
}
|
|
4940
|
-
function ti(
|
|
4941
|
-
const e = s.intersectObject(
|
|
4969
|
+
function ti(l, s, t) {
|
|
4970
|
+
const e = s.intersectObject(l, !0);
|
|
4942
4971
|
for (let i = 0; i < e.length; i++)
|
|
4943
4972
|
if (e[i].object.visible || t)
|
|
4944
4973
|
return e[i];
|
|
4945
4974
|
return !1;
|
|
4946
4975
|
}
|
|
4947
|
-
const fs = new Hn(), W = new M(0, 1, 0), hn = new M(0, 0, 0), En = new Mt(), ps = new
|
|
4948
|
-
class
|
|
4976
|
+
const fs = new Hn(), W = new M(0, 1, 0), hn = new M(0, 0, 0), En = new Mt(), ps = new Lt(), Rs = new Lt(), Nt = new M(), dn = new Mt(), De = new M(1, 0, 0), qt = new M(0, 1, 0), Ue = new M(0, 0, 1), Cs = new M(), Me = new M(), we = new M();
|
|
4977
|
+
class Lr extends ei {
|
|
4949
4978
|
constructor() {
|
|
4950
4979
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
|
4951
4980
|
const s = new gn({
|
|
@@ -4972,8 +5001,8 @@ class Pr extends ei {
|
|
|
4972
5001
|
r.color.setHex(255);
|
|
4973
5002
|
const a = s.clone();
|
|
4974
5003
|
a.color.setHex(16711680), a.opacity = 0.5;
|
|
4975
|
-
const
|
|
4976
|
-
|
|
5004
|
+
const c = s.clone();
|
|
5005
|
+
c.color.setHex(65280), c.opacity = 0.5;
|
|
4977
5006
|
const E = s.clone();
|
|
4978
5007
|
E.color.setHex(255), E.opacity = 0.5;
|
|
4979
5008
|
const d = s.clone();
|
|
@@ -4987,7 +5016,7 @@ class Pr extends ei {
|
|
|
4987
5016
|
const A = new rt(0.08, 0.08, 0.08);
|
|
4988
5017
|
A.translate(0, 0.04, 0);
|
|
4989
5018
|
const C = new Ni();
|
|
4990
|
-
C.setAttribute("position", new
|
|
5019
|
+
C.setAttribute("position", new yi([0, 0, 0, 1, 0, 0], 3));
|
|
4991
5020
|
const T = new ct(75e-4, 75e-4, 0.5, 3);
|
|
4992
5021
|
T.translate(0, 0.25, 0);
|
|
4993
5022
|
function F(B, H) {
|
|
@@ -4996,7 +5025,7 @@ class Pr extends ei {
|
|
|
4996
5025
|
}
|
|
4997
5026
|
function f() {
|
|
4998
5027
|
const B = new Ni();
|
|
4999
|
-
return B.setAttribute("position", new
|
|
5028
|
+
return B.setAttribute("position", new yi([0, 0, 0, 1, 1, 1], 3)), B;
|
|
5000
5029
|
}
|
|
5001
5030
|
const m = {
|
|
5002
5031
|
X: [
|
|
@@ -5024,7 +5053,7 @@ class Pr extends ei {
|
|
|
5024
5053
|
[new v(new rt(0.15, 0.15, 0.01), a.clone()), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
5025
5054
|
],
|
|
5026
5055
|
XZ: [
|
|
5027
|
-
[new v(new rt(0.15, 0.15, 0.01),
|
|
5056
|
+
[new v(new rt(0.15, 0.15, 0.01), c.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
5028
5057
|
]
|
|
5029
5058
|
}, g = {
|
|
5030
5059
|
X: [
|
|
@@ -5090,7 +5119,7 @@ class Pr extends ei {
|
|
|
5090
5119
|
AXIS: [
|
|
5091
5120
|
[new Ut(C, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
5092
5121
|
]
|
|
5093
|
-
},
|
|
5122
|
+
}, L = {
|
|
5094
5123
|
XYZE: [
|
|
5095
5124
|
[new v(new Wn(0.25, 10, 8), e)]
|
|
5096
5125
|
],
|
|
@@ -5129,12 +5158,12 @@ class Pr extends ei {
|
|
|
5129
5158
|
[new v(new rt(0.15, 0.15, 0.01), a), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
5130
5159
|
],
|
|
5131
5160
|
XZ: [
|
|
5132
|
-
[new v(new rt(0.15, 0.15, 0.01),
|
|
5161
|
+
[new v(new rt(0.15, 0.15, 0.01), c), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
5133
5162
|
],
|
|
5134
5163
|
XYZ: [
|
|
5135
5164
|
[new v(new rt(0.1, 0.1, 0.1), d.clone())]
|
|
5136
5165
|
]
|
|
5137
|
-
},
|
|
5166
|
+
}, P = {
|
|
5138
5167
|
X: [
|
|
5139
5168
|
[new v(new ct(0.2, 0, 0.6, 4), e), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
|
|
5140
5169
|
[new v(new ct(0.2, 0, 0.6, 4), e), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
|
|
@@ -5159,7 +5188,7 @@ class Pr extends ei {
|
|
|
5159
5188
|
XYZ: [
|
|
5160
5189
|
[new v(new rt(0.2, 0.2, 0.2), e), [0, 0, 0]]
|
|
5161
5190
|
]
|
|
5162
|
-
},
|
|
5191
|
+
}, D = {
|
|
5163
5192
|
X: [
|
|
5164
5193
|
[new Ut(C, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
5165
5194
|
],
|
|
@@ -5181,7 +5210,7 @@ class Pr extends ei {
|
|
|
5181
5210
|
}
|
|
5182
5211
|
return H;
|
|
5183
5212
|
}
|
|
5184
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = x(m)), 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(
|
|
5213
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = x(m)), 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(L)), this.add(this.picker.scale = x(P)), this.add(this.helper.translate = x(S)), this.add(this.helper.rotate = x(N)), this.add(this.helper.scale = x(D)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
5185
5214
|
}
|
|
5186
5215
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
5187
5216
|
updateMatrixWorld(s) {
|
|
@@ -5204,7 +5233,7 @@ class Pr extends ei {
|
|
|
5204
5233
|
super.updateMatrixWorld(s);
|
|
5205
5234
|
}
|
|
5206
5235
|
}
|
|
5207
|
-
class
|
|
5236
|
+
class Pr extends v {
|
|
5208
5237
|
constructor() {
|
|
5209
5238
|
super(
|
|
5210
5239
|
new Xn(1e5, 1e5, 2, 2),
|
|
@@ -5251,11 +5280,11 @@ class yr extends v {
|
|
|
5251
5280
|
class Fi {
|
|
5252
5281
|
constructor(s, t, e, i, o, n = 5, r = !0) {
|
|
5253
5282
|
/** Event that fires when the user starts dragging a clipping plane. */
|
|
5254
|
-
I(this, "onDraggingStarted", new
|
|
5283
|
+
I(this, "onDraggingStarted", new U());
|
|
5255
5284
|
/** Event that fires when the user stops dragging a clipping plane. */
|
|
5256
|
-
I(this, "onDraggingEnded", new
|
|
5285
|
+
I(this, "onDraggingEnded", new U());
|
|
5257
5286
|
/** {@link Disposable.onDisposed} */
|
|
5258
|
-
I(this, "onDisposed", new
|
|
5287
|
+
I(this, "onDisposed", new U());
|
|
5259
5288
|
I(this, "normal");
|
|
5260
5289
|
I(this, "origin");
|
|
5261
5290
|
I(this, "three", new O.Plane());
|
|
@@ -5348,7 +5377,7 @@ class Fi {
|
|
|
5348
5377
|
newTransformControls() {
|
|
5349
5378
|
if (!this.world.renderer)
|
|
5350
5379
|
throw new Error("No renderer found for clipping plane!");
|
|
5351
|
-
const s = this.world.camera.three, t = this.world.renderer.three.domElement, e = new
|
|
5380
|
+
const s = this.world.camera.three, t = this.world.renderer.three.domElement, e = new gr(s, t);
|
|
5352
5381
|
return this.initializeControls(e), this.world.scene.three.add(e), e;
|
|
5353
5382
|
}
|
|
5354
5383
|
initializeControls(s) {
|
|
@@ -5376,19 +5405,19 @@ const ve = class ve extends it {
|
|
|
5376
5405
|
constructor(t) {
|
|
5377
5406
|
super(t);
|
|
5378
5407
|
/** {@link Createable.onAfterCreate} */
|
|
5379
|
-
I(this, "onAfterCreate", new
|
|
5408
|
+
I(this, "onAfterCreate", new U());
|
|
5380
5409
|
/** {@link Createable.onAfterDelete} */
|
|
5381
|
-
I(this, "onAfterDelete", new
|
|
5410
|
+
I(this, "onAfterDelete", new U());
|
|
5382
5411
|
/** Event that fires when the user starts dragging a clipping plane. */
|
|
5383
|
-
I(this, "onBeforeDrag", new
|
|
5412
|
+
I(this, "onBeforeDrag", new U());
|
|
5384
5413
|
/** Event that fires when the user stops dragging a clipping plane. */
|
|
5385
|
-
I(this, "onAfterDrag", new
|
|
5386
|
-
I(this, "onBeforeCreate", new
|
|
5387
|
-
I(this, "onBeforeCancel", new
|
|
5388
|
-
I(this, "onAfterCancel", new
|
|
5389
|
-
I(this, "onBeforeDelete", new
|
|
5414
|
+
I(this, "onAfterDrag", new U());
|
|
5415
|
+
I(this, "onBeforeCreate", new U());
|
|
5416
|
+
I(this, "onBeforeCancel", new U());
|
|
5417
|
+
I(this, "onAfterCancel", new U());
|
|
5418
|
+
I(this, "onBeforeDelete", new U());
|
|
5390
5419
|
/** {@link Disposable.onDisposed} */
|
|
5391
|
-
I(this, "onDisposed", new
|
|
5420
|
+
I(this, "onDisposed", new U());
|
|
5392
5421
|
/**
|
|
5393
5422
|
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
5394
5423
|
* (up). This is desirable when clipping a building horizontally and a
|
|
@@ -5546,8 +5575,8 @@ const ve = class ve extends it {
|
|
|
5546
5575
|
const i = t.object;
|
|
5547
5576
|
let o = t.object.matrixWorld.clone();
|
|
5548
5577
|
if (i instanceof O.InstancedMesh && t.instanceId !== void 0) {
|
|
5549
|
-
const
|
|
5550
|
-
i.getMatrixAt(t.instanceId,
|
|
5578
|
+
const c = new O.Matrix4();
|
|
5579
|
+
i.getMatrixAt(t.instanceId, c), o = c.multiply(o);
|
|
5551
5580
|
}
|
|
5552
5581
|
const r = new O.Matrix3().getNormalMatrix(o), a = e.clone().applyMatrix3(r).normalize();
|
|
5553
5582
|
return this.normalizePlaneDirectionY(a), a;
|
|
@@ -5593,7 +5622,7 @@ const Be = class Be extends it {
|
|
|
5593
5622
|
I(this, "enabled", !0);
|
|
5594
5623
|
I(this, "_originalBackground", /* @__PURE__ */ new Map());
|
|
5595
5624
|
/** {@link Disposable.onDisposed} */
|
|
5596
|
-
I(this, "onDisposed", new
|
|
5625
|
+
I(this, "onDisposed", new U());
|
|
5597
5626
|
I(this, "list", {});
|
|
5598
5627
|
I(this, "_originals", {});
|
|
5599
5628
|
this.components.add(Be.uuid, this);
|
|
@@ -5682,15 +5711,15 @@ const Be = class Be extends it {
|
|
|
5682
5711
|
};
|
|
5683
5712
|
I(Be, "uuid", "24989d27-fa2f-4797-8b08-35918f74e502");
|
|
5684
5713
|
let In = Be;
|
|
5685
|
-
function
|
|
5714
|
+
function Mr(l, s, t, e) {
|
|
5686
5715
|
return new Promise((i, o) => {
|
|
5687
5716
|
function n() {
|
|
5688
|
-
const r =
|
|
5689
|
-
if (r ===
|
|
5717
|
+
const r = l.clientWaitSync(s, t, 0);
|
|
5718
|
+
if (r === l.WAIT_FAILED) {
|
|
5690
5719
|
o();
|
|
5691
5720
|
return;
|
|
5692
5721
|
}
|
|
5693
|
-
if (r ===
|
|
5722
|
+
if (r === l.TIMEOUT_EXPIRED) {
|
|
5694
5723
|
setTimeout(n, e);
|
|
5695
5724
|
return;
|
|
5696
5725
|
}
|
|
@@ -5699,24 +5728,24 @@ function Lr(c, s, t, e) {
|
|
|
5699
5728
|
n();
|
|
5700
5729
|
});
|
|
5701
5730
|
}
|
|
5702
|
-
async function
|
|
5703
|
-
const r =
|
|
5704
|
-
|
|
5731
|
+
async function wr(l, s, t, e, i, o, n) {
|
|
5732
|
+
const r = l.fenceSync(l.SYNC_GPU_COMMANDS_COMPLETE, 0);
|
|
5733
|
+
l.flush(), await Mr(l, r, 0, 10), l.deleteSync(r), l.bindBuffer(s, t), l.getBufferSubData(s, e, i, o, n), l.bindBuffer(s, null);
|
|
5705
5734
|
}
|
|
5706
|
-
async function
|
|
5707
|
-
const a =
|
|
5708
|
-
return
|
|
5735
|
+
async function Dr(l, s, t, e, i, o, n, r) {
|
|
5736
|
+
const a = l.createBuffer();
|
|
5737
|
+
return l.bindBuffer(l.PIXEL_PACK_BUFFER, a), l.bufferData(l.PIXEL_PACK_BUFFER, r.byteLength, l.STREAM_READ), l.readPixels(s, t, e, i, o, n, 0), l.bindBuffer(l.PIXEL_PACK_BUFFER, null), await wr(l, l.PIXEL_PACK_BUFFER, a, 0, r), l.deleteBuffer(a), r;
|
|
5709
5738
|
}
|
|
5710
|
-
class
|
|
5739
|
+
class Ur {
|
|
5711
5740
|
constructor(s, t, e) {
|
|
5712
5741
|
/** {@link Disposable.onDisposed} */
|
|
5713
|
-
I(this, "onDisposed", new
|
|
5742
|
+
I(this, "onDisposed", new U());
|
|
5714
5743
|
/**
|
|
5715
5744
|
* Fires after making the visibility check to the meshes. It lists the
|
|
5716
5745
|
* meshes that are currently visible, and the ones that were visible
|
|
5717
5746
|
* just before but not anymore.
|
|
5718
5747
|
*/
|
|
5719
|
-
I(this, "onViewUpdated", new
|
|
5748
|
+
I(this, "onViewUpdated", new tr());
|
|
5720
5749
|
/** {@link Component.enabled} */
|
|
5721
5750
|
I(this, "enabled", !0);
|
|
5722
5751
|
/**
|
|
@@ -5742,6 +5771,8 @@ class Dr {
|
|
|
5742
5771
|
I(this, "renderTarget");
|
|
5743
5772
|
I(this, "bufferSize");
|
|
5744
5773
|
I(this, "_buffer");
|
|
5774
|
+
// Prevents worker being fired multiple times
|
|
5775
|
+
I(this, "_isWorkerBusy", !1);
|
|
5745
5776
|
/**
|
|
5746
5777
|
* The function that the culler uses to reprocess the scene. Generally it's
|
|
5747
5778
|
* better to call needsUpdate, but you can also call this to force it.
|
|
@@ -5749,12 +5780,13 @@ class Dr {
|
|
|
5749
5780
|
* not true.
|
|
5750
5781
|
*/
|
|
5751
5782
|
I(this, "updateVisibility", async (s) => {
|
|
5752
|
-
if (!this.enabled || !this.needsUpdate && !s)
|
|
5783
|
+
if (!this.enabled || !this.needsUpdate && !s || this._isWorkerBusy)
|
|
5753
5784
|
return;
|
|
5785
|
+
this._isWorkerBusy = !0;
|
|
5754
5786
|
const t = this.world.camera.three;
|
|
5755
5787
|
t.updateMatrix(), this.renderer.setSize(this._width, this._height), this.renderer.setRenderTarget(this.renderTarget), this.renderer.render(this.scene, t);
|
|
5756
5788
|
const e = this.renderer.getContext();
|
|
5757
|
-
await
|
|
5789
|
+
await Dr(
|
|
5758
5790
|
e,
|
|
5759
5791
|
0,
|
|
5760
5792
|
0,
|
|
@@ -5826,18 +5858,19 @@ class Dr {
|
|
|
5826
5858
|
s && (s.updateInterval !== void 0 && (this.updateInterval = s.updateInterval), s.height !== void 0 && (this._height = s.height), s.width !== void 0 && (this._width = s.width), s.autoUpdate !== void 0 && (this.autoUpdate = s.autoUpdate));
|
|
5827
5859
|
}
|
|
5828
5860
|
}
|
|
5829
|
-
class
|
|
5861
|
+
class xr extends Ur {
|
|
5830
5862
|
constructor(t, e, i) {
|
|
5831
5863
|
super(t, e, i);
|
|
5832
5864
|
/* Pixels in screen a geometry must occupy to be considered "seen". */
|
|
5833
5865
|
I(this, "threshold", 100);
|
|
5834
|
-
I(this, "onViewUpdated", new
|
|
5866
|
+
I(this, "onViewUpdated", new U());
|
|
5835
5867
|
I(this, "colorMeshes", /* @__PURE__ */ new Map());
|
|
5836
5868
|
I(this, "isProcessing", !1);
|
|
5837
5869
|
I(this, "_colorCodeMeshMap", /* @__PURE__ */ new Map());
|
|
5838
5870
|
I(this, "_meshIDColorCodeMap", /* @__PURE__ */ new Map());
|
|
5839
5871
|
I(this, "_currentVisibleMeshes", /* @__PURE__ */ new Set());
|
|
5840
5872
|
I(this, "_recentlyHiddenMeshes", /* @__PURE__ */ new Set());
|
|
5873
|
+
I(this, "_intervalID", null);
|
|
5841
5874
|
I(this, "_transparentMat", new O.MeshBasicMaterial({
|
|
5842
5875
|
transparent: !0,
|
|
5843
5876
|
opacity: 0
|
|
@@ -5856,7 +5889,7 @@ class Ur extends Dr {
|
|
|
5856
5889
|
this.onViewUpdated.trigger({
|
|
5857
5890
|
seen: this._currentVisibleMeshes,
|
|
5858
5891
|
unseen: this._recentlyHiddenMeshes
|
|
5859
|
-
});
|
|
5892
|
+
}), this._isWorkerBusy = !1;
|
|
5860
5893
|
});
|
|
5861
5894
|
this.worker.addEventListener("message", this.handleWorkerMessage), this.autoUpdate && window.setInterval(async () => {
|
|
5862
5895
|
this.isProcessing || await this.updateVisibility();
|
|
@@ -5868,7 +5901,7 @@ class Ur extends Dr {
|
|
|
5868
5901
|
});
|
|
5869
5902
|
}
|
|
5870
5903
|
dispose() {
|
|
5871
|
-
super.dispose(), this._currentVisibleMeshes.clear(), this._recentlyHiddenMeshes.clear(), this._meshIDColorCodeMap.clear(), this._transparentMat.dispose(), this._colorCodeMeshMap.clear();
|
|
5904
|
+
super.dispose(), this._intervalID !== null && (window.clearInterval(this._intervalID), this._intervalID = null), this._currentVisibleMeshes.clear(), this._recentlyHiddenMeshes.clear(), this._meshIDColorCodeMap.clear(), this._transparentMat.dispose(), this._colorCodeMeshMap.clear();
|
|
5872
5905
|
const t = this.components.get(zt);
|
|
5873
5906
|
for (const e in this.colorMeshes) {
|
|
5874
5907
|
const i = this.colorMeshes.get(e);
|
|
@@ -5902,7 +5935,7 @@ class Ur extends Dr {
|
|
|
5902
5935
|
} else
|
|
5903
5936
|
a = n;
|
|
5904
5937
|
this._colorCodeMeshMap.set(r, t), this._meshIDColorCodeMap.set(t.uuid, r);
|
|
5905
|
-
const
|
|
5938
|
+
const c = e ? t.count : 1, E = new O.InstancedMesh(i, a, c);
|
|
5906
5939
|
e ? E.instanceMatrix = t.instanceMatrix : E.setMatrixAt(0, new O.Matrix4()), t.visible = !1, E.applyMatrix4(t.matrix), E.updateMatrix(), this.scene.add(E), this.colorMeshes.set(t.uuid, E), this.increaseColor(), this.isProcessing = !1;
|
|
5907
5940
|
}
|
|
5908
5941
|
remove(t) {
|
|
@@ -5926,12 +5959,12 @@ class Ur extends Dr {
|
|
|
5926
5959
|
const r = new O.Color(`rgb(${t}, ${e}, ${i})`);
|
|
5927
5960
|
if (!this.world.renderer)
|
|
5928
5961
|
throw new Error("Renderer not found in the world!");
|
|
5929
|
-
const a = this.world.renderer.clippingPlanes,
|
|
5962
|
+
const a = this.world.renderer.clippingPlanes, c = new O.MeshBasicMaterial({
|
|
5930
5963
|
color: r,
|
|
5931
5964
|
clippingPlanes: a,
|
|
5932
5965
|
side: O.DoubleSide
|
|
5933
5966
|
});
|
|
5934
|
-
return O.ColorManagement.enabled = n, { colorMaterial:
|
|
5967
|
+
return O.ColorManagement.enabled = n, { colorMaterial: c, code: o };
|
|
5935
5968
|
}
|
|
5936
5969
|
}
|
|
5937
5970
|
const Ye = class Ye extends it {
|
|
@@ -5940,7 +5973,7 @@ const Ye = class Ye extends it {
|
|
|
5940
5973
|
I(this, "_enabled", !0);
|
|
5941
5974
|
I(this, "list", /* @__PURE__ */ new Map());
|
|
5942
5975
|
/** {@link Disposable.onDisposed} */
|
|
5943
|
-
I(this, "onDisposed", new
|
|
5976
|
+
I(this, "onDisposed", new U());
|
|
5944
5977
|
t.add(Ye.uuid, this);
|
|
5945
5978
|
}
|
|
5946
5979
|
/** {@link Component.enabled} */
|
|
@@ -5955,7 +5988,7 @@ const Ye = class Ye extends it {
|
|
|
5955
5988
|
create(t, e) {
|
|
5956
5989
|
if (this.list.has(t.uuid))
|
|
5957
5990
|
return this.list.get(t.uuid);
|
|
5958
|
-
const i = new
|
|
5991
|
+
const i = new xr(this.components, t, e);
|
|
5959
5992
|
return this.list.set(t.uuid, i), i;
|
|
5960
5993
|
}
|
|
5961
5994
|
delete(t) {
|
|
@@ -5978,7 +6011,7 @@ const At = class At extends it {
|
|
|
5978
6011
|
/** {@link Component.enabled} */
|
|
5979
6012
|
I(this, "enabled", !0);
|
|
5980
6013
|
/** {@link Disposable.onDisposed} */
|
|
5981
|
-
I(this, "onDisposed", new
|
|
6014
|
+
I(this, "onDisposed", new U());
|
|
5982
6015
|
I(this, "_absoluteMin");
|
|
5983
6016
|
I(this, "_absoluteMax");
|
|
5984
6017
|
I(this, "_meshes", []);
|
|
@@ -6018,8 +6051,8 @@ const At = class At extends it {
|
|
|
6018
6051
|
return new O.Sphere(r, a);
|
|
6019
6052
|
}
|
|
6020
6053
|
getMesh() {
|
|
6021
|
-
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),
|
|
6022
|
-
return this._meshes.push(
|
|
6054
|
+
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);
|
|
6055
|
+
return this._meshes.push(c), c.position.copy(r), c;
|
|
6023
6056
|
}
|
|
6024
6057
|
reset() {
|
|
6025
6058
|
this._absoluteMin = At.newBound(!0), this._absoluteMax = At.newBound(!1);
|
|
@@ -6035,8 +6068,8 @@ const At = class At extends it {
|
|
|
6035
6068
|
t.updateMatrixWorld();
|
|
6036
6069
|
const i = t.matrixWorld, o = new O.Matrix4(), n = t instanceof O.InstancedMesh, r = n ? t.count : 1;
|
|
6037
6070
|
for (let a = 0; a < r; a++) {
|
|
6038
|
-
const
|
|
6039
|
-
n && (t.getMatrixAt(a, o),
|
|
6071
|
+
const c = e.min.clone(), E = e.max.clone();
|
|
6072
|
+
n && (t.getMatrixAt(a, o), c.applyMatrix4(o), E.applyMatrix4(o)), c.applyMatrix4(i), E.applyMatrix4(i), c.x < this._absoluteMin.x && (this._absoluteMin.x = c.x), c.y < this._absoluteMin.y && (this._absoluteMin.y = c.y), c.z < this._absoluteMin.z && (this._absoluteMin.z = c.z), c.x > this._absoluteMax.x && (this._absoluteMax.x = c.x), c.y > this._absoluteMax.y && (this._absoluteMax.y = c.y), c.z > this._absoluteMax.z && (this._absoluteMax.z = c.z), E.x > this._absoluteMax.x && (this._absoluteMax.x = E.x), E.y > this._absoluteMax.y && (this._absoluteMax.y = E.y), E.z > this._absoluteMax.z && (this._absoluteMax.z = E.z), E.x < this._absoluteMin.x && (this._absoluteMin.x = E.x), E.y < this._absoluteMin.y && (this._absoluteMin.y = E.y), E.z < this._absoluteMin.z && (this._absoluteMin.z = E.z);
|
|
6040
6073
|
}
|
|
6041
6074
|
}
|
|
6042
6075
|
static getFragmentBounds(t) {
|
|
@@ -6044,12 +6077,12 @@ const At = class At extends it {
|
|
|
6044
6077
|
if (!t.geometry.index)
|
|
6045
6078
|
throw new Error("Geometry must be indexed!");
|
|
6046
6079
|
const a = Array.from(t.geometry.index.array);
|
|
6047
|
-
for (let
|
|
6048
|
-
if (
|
|
6049
|
-
|
|
6080
|
+
for (let c = 0; c < a.length; c++) {
|
|
6081
|
+
if (c % 3 === 0 && a[c] === 0 && a[c + 1] === 0 && a[c + 2] === 0) {
|
|
6082
|
+
c += 2;
|
|
6050
6083
|
continue;
|
|
6051
6084
|
}
|
|
6052
|
-
const E = a[
|
|
6085
|
+
const E = a[c], d = e.getX(E), h = e.getY(E), u = e.getZ(E);
|
|
6053
6086
|
d < n.x && (n.x = d), h < n.y && (n.y = h), u < n.z && (n.z = u), d > r.x && (r.x = d), h > r.y && (r.y = h), u > r.z && (r.z = u);
|
|
6054
6087
|
}
|
|
6055
6088
|
return new O.Box3(n, r);
|
|
@@ -6057,7 +6090,7 @@ const At = class At extends it {
|
|
|
6057
6090
|
};
|
|
6058
6091
|
I(At, "uuid", "d1444724-dba6-4cdd-a0c7-68ee1450d166");
|
|
6059
6092
|
let fn = At;
|
|
6060
|
-
const
|
|
6093
|
+
const Pn = /* @__PURE__ */ new Set([
|
|
6061
6094
|
1123145078,
|
|
6062
6095
|
574549367,
|
|
6063
6096
|
1675464909,
|
|
@@ -6192,7 +6225,7 @@ const Ln = /* @__PURE__ */ new Set([
|
|
|
6192
6225
|
2830218821,
|
|
6193
6226
|
427810014
|
|
6194
6227
|
]);
|
|
6195
|
-
class
|
|
6228
|
+
class br {
|
|
6196
6229
|
/**
|
|
6197
6230
|
* Exports all the properties of an IFC into an array of JS objects.
|
|
6198
6231
|
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
@@ -6212,18 +6245,18 @@ class xr {
|
|
|
6212
6245
|
for (const a of r)
|
|
6213
6246
|
n.add(a);
|
|
6214
6247
|
for (const a of n) {
|
|
6215
|
-
if (
|
|
6248
|
+
if (Pn.has(a))
|
|
6216
6249
|
continue;
|
|
6217
|
-
const
|
|
6250
|
+
const c = r.has(a) && i, E = s.GetLineIDsWithType(t, a);
|
|
6218
6251
|
for (const d of E) {
|
|
6219
|
-
const h = s.GetLine(0, d,
|
|
6252
|
+
const h = s.GetLine(0, d, c, e);
|
|
6220
6253
|
o[h.expressID] = h;
|
|
6221
6254
|
}
|
|
6222
6255
|
}
|
|
6223
6256
|
return o;
|
|
6224
6257
|
}
|
|
6225
6258
|
}
|
|
6226
|
-
const
|
|
6259
|
+
const vr = {
|
|
6227
6260
|
103090709: "IFCPROJECT",
|
|
6228
6261
|
4097777520: "IFCSITE",
|
|
6229
6262
|
4031249490: "IFCBUILDING",
|
|
@@ -6362,13 +6395,13 @@ const br = {
|
|
|
6362
6395
|
4292641817: "IFCUNITARYEQUIPMENT",
|
|
6363
6396
|
3009204131: "IFCGRID"
|
|
6364
6397
|
};
|
|
6365
|
-
class
|
|
6398
|
+
class Kr {
|
|
6366
6399
|
getAll(s, t) {
|
|
6367
|
-
const e = {}, i = Object.keys(
|
|
6400
|
+
const e = {}, i = Object.keys(vr).map((o) => parseInt(o, 10));
|
|
6368
6401
|
for (let o = 0; o < i.length; o++) {
|
|
6369
6402
|
const n = i[o], r = s.GetLineIDsWithType(t, n), a = r.size();
|
|
6370
|
-
for (let
|
|
6371
|
-
e[r.get(
|
|
6403
|
+
for (let c = 0; c < a; c++)
|
|
6404
|
+
e[r.get(c)] = n;
|
|
6372
6405
|
}
|
|
6373
6406
|
return e;
|
|
6374
6407
|
}
|
|
@@ -7547,8 +7580,8 @@ class Ft {
|
|
|
7547
7580
|
var a;
|
|
7548
7581
|
const o = e ?? (() => {
|
|
7549
7582
|
}), n = {}, r = s.getAllPropertiesIDs();
|
|
7550
|
-
for (const
|
|
7551
|
-
const E = await s.getProperties(
|
|
7583
|
+
for (const c of r) {
|
|
7584
|
+
const E = await s.getProperties(c);
|
|
7552
7585
|
if (!E)
|
|
7553
7586
|
continue;
|
|
7554
7587
|
const d = E.type === t, h = Object.keys(E).find(
|
|
@@ -7569,12 +7602,12 @@ class Ft {
|
|
|
7569
7602
|
static async getQsetQuantities(s, t, e) {
|
|
7570
7603
|
const o = e ?? (() => {
|
|
7571
7604
|
}), n = await s.getProperties(t);
|
|
7572
|
-
return !n || n.type !== b.IFCELEMENTQUANTITY ? null : (n.Quantities ?? [{}]).map((
|
|
7605
|
+
return !n || n.type !== b.IFCELEMENTQUANTITY ? null : (n.Quantities ?? [{}]).map((c) => (c.value && o(c.value), c.value)).filter((c) => c !== null);
|
|
7573
7606
|
}
|
|
7574
7607
|
static async getPsetProps(s, t, e) {
|
|
7575
7608
|
const o = e ?? (() => {
|
|
7576
7609
|
}), n = await s.getProperties(t);
|
|
7577
|
-
return !n || n.type !== b.IFCPROPERTYSET ? null : (n.HasProperties ?? [{}]).map((
|
|
7610
|
+
return !n || n.type !== b.IFCPROPERTYSET ? null : (n.HasProperties ?? [{}]).map((c) => (c.value && o(c.value), c.value)).filter((c) => c !== null);
|
|
7578
7611
|
}
|
|
7579
7612
|
static async getPsetRel(s, t) {
|
|
7580
7613
|
var r;
|
|
@@ -7654,9 +7687,9 @@ const Ss = class Ss extends it {
|
|
|
7654
7687
|
constructor(t) {
|
|
7655
7688
|
super(t);
|
|
7656
7689
|
/** {@link Disposable.onDisposed} */
|
|
7657
|
-
I(this, "onDisposed", new
|
|
7658
|
-
I(this, "onFragmentsLoaded", new
|
|
7659
|
-
I(this, "onFragmentsDisposed", new
|
|
7690
|
+
I(this, "onDisposed", new U());
|
|
7691
|
+
I(this, "onFragmentsLoaded", new U());
|
|
7692
|
+
I(this, "onFragmentsDisposed", new U());
|
|
7660
7693
|
/** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
|
|
7661
7694
|
I(this, "list", /* @__PURE__ */ new Map());
|
|
7662
7695
|
I(this, "groups", /* @__PURE__ */ new Map());
|
|
@@ -7728,12 +7761,12 @@ const Ss = class Ss extends it {
|
|
|
7728
7761
|
};
|
|
7729
7762
|
I(Ss, "uuid", "fef46874-46a3-461b-8c44-2922ab77c806");
|
|
7730
7763
|
let dt = Ss;
|
|
7731
|
-
class
|
|
7764
|
+
class Jr extends it {
|
|
7732
7765
|
constructor(t) {
|
|
7733
7766
|
super(t);
|
|
7734
|
-
I(this, "onFound", new
|
|
7767
|
+
I(this, "onFound", new U());
|
|
7735
7768
|
/** {@link Disposable.onDisposed} */
|
|
7736
|
-
I(this, "onDisposed", new
|
|
7769
|
+
I(this, "onDisposed", new U());
|
|
7737
7770
|
I(this, "enabled", !0);
|
|
7738
7771
|
I(this, "indexedModels", {});
|
|
7739
7772
|
I(this, "_conditionFunctions");
|
|
@@ -7759,8 +7792,8 @@ class Kr extends it {
|
|
|
7759
7792
|
});
|
|
7760
7793
|
for (const a of n) {
|
|
7761
7794
|
e[o].add(a);
|
|
7762
|
-
for (const
|
|
7763
|
-
e[
|
|
7795
|
+
for (const c of r)
|
|
7796
|
+
e[c].add(a);
|
|
7764
7797
|
e[a] || (e[a] = /* @__PURE__ */ new Set()), e[a].add(a);
|
|
7765
7798
|
}
|
|
7766
7799
|
}
|
|
@@ -7785,13 +7818,13 @@ class Kr extends it {
|
|
|
7785
7818
|
async find(t, e) {
|
|
7786
7819
|
const i = this.components.get(dt), o = e || i.groups.values(), n = {};
|
|
7787
7820
|
for (const a of o) {
|
|
7788
|
-
let
|
|
7789
|
-
|
|
7821
|
+
let c = this.indexedModels[a.uuid];
|
|
7822
|
+
c || (c = await this.indexEntityRelations(a));
|
|
7790
7823
|
let E = [];
|
|
7791
7824
|
for (const [u, p] of t.entries()) {
|
|
7792
7825
|
const R = /* @__PURE__ */ new Set(), A = this.simpleQuery(a, p, R), C = [];
|
|
7793
7826
|
for (const T of A) {
|
|
7794
|
-
const F =
|
|
7827
|
+
const F = c[T];
|
|
7795
7828
|
if (F) {
|
|
7796
7829
|
C.push(T);
|
|
7797
7830
|
for (const f of F)
|
|
@@ -7819,9 +7852,9 @@ class Kr extends it {
|
|
|
7819
7852
|
continue;
|
|
7820
7853
|
const r = t[o].modelEntities;
|
|
7821
7854
|
for (const a of r) {
|
|
7822
|
-
const
|
|
7823
|
-
if (
|
|
7824
|
-
for (const E of
|
|
7855
|
+
const c = n.data.get(a);
|
|
7856
|
+
if (c)
|
|
7857
|
+
for (const E of c[0]) {
|
|
7825
7858
|
const d = n.keyFragments.get(E);
|
|
7826
7859
|
if (!d)
|
|
7827
7860
|
throw new Error("Fragment ID not found!");
|
|
@@ -7836,24 +7869,24 @@ class Kr extends it {
|
|
|
7836
7869
|
if (!o)
|
|
7837
7870
|
throw new Error("Model has no properties");
|
|
7838
7871
|
let n = {}, r = 0, a = [];
|
|
7839
|
-
for (const
|
|
7872
|
+
for (const c of e.queries) {
|
|
7840
7873
|
let E = [];
|
|
7841
|
-
const d =
|
|
7842
|
-
if (
|
|
7874
|
+
const d = c.operator === "AND" ? n : o;
|
|
7875
|
+
if (c.condition) {
|
|
7843
7876
|
const u = this.getMatchingEntities(
|
|
7844
7877
|
d,
|
|
7845
|
-
|
|
7878
|
+
c,
|
|
7846
7879
|
i
|
|
7847
7880
|
);
|
|
7848
7881
|
E = u.expressIDs, n = { ...n, ...u.entities };
|
|
7849
7882
|
} else
|
|
7850
7883
|
E = [
|
|
7851
|
-
...this.simpleQuery(t,
|
|
7884
|
+
...this.simpleQuery(t, c, i)
|
|
7852
7885
|
];
|
|
7853
7886
|
a = r === 0 ? E : this.combineArrays(
|
|
7854
7887
|
a,
|
|
7855
7888
|
E,
|
|
7856
|
-
|
|
7889
|
+
c.operator ?? "AND"
|
|
7857
7890
|
// Defaults to AND if iterations > 0 and query.operator is not defined
|
|
7858
7891
|
), r++;
|
|
7859
7892
|
}
|
|
@@ -7862,7 +7895,7 @@ class Kr extends it {
|
|
|
7862
7895
|
getMatchingEntities(t, e, i) {
|
|
7863
7896
|
const { attribute: o, condition: n } = e;
|
|
7864
7897
|
let { value: r } = e;
|
|
7865
|
-
const a = !this._noHandleAttributes.includes(o),
|
|
7898
|
+
const a = !this._noHandleAttributes.includes(o), c = [], E = [];
|
|
7866
7899
|
for (const d in t) {
|
|
7867
7900
|
const h = t[d];
|
|
7868
7901
|
if (h === void 0)
|
|
@@ -7881,9 +7914,9 @@ class Kr extends it {
|
|
|
7881
7914
|
e.negateResult && i.add(h.expressID);
|
|
7882
7915
|
continue;
|
|
7883
7916
|
}
|
|
7884
|
-
|
|
7917
|
+
c.push(h.expressID), E.push(h);
|
|
7885
7918
|
}
|
|
7886
|
-
return { expressIDs:
|
|
7919
|
+
return { expressIDs: c, entities: E, excludedItems: i };
|
|
7887
7920
|
}
|
|
7888
7921
|
combineArrays(t, e, i) {
|
|
7889
7922
|
return i ? i === "AND" ? this.arrayIntersection(t, e) : this.arrayUnion(t, e) : e;
|
|
@@ -7915,138 +7948,237 @@ class Kr extends it {
|
|
|
7915
7948
|
};
|
|
7916
7949
|
}
|
|
7917
7950
|
}
|
|
7918
|
-
const
|
|
7951
|
+
const Ge = class Ge extends it {
|
|
7919
7952
|
constructor(t) {
|
|
7920
7953
|
super(t);
|
|
7921
7954
|
/** {@link Disposable.onDisposed} */
|
|
7922
|
-
I(this, "onDisposed", new
|
|
7955
|
+
I(this, "onDisposed", new U());
|
|
7923
7956
|
I(this, "enabled", !0);
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7957
|
+
/**
|
|
7958
|
+
* All the inverse attributes this component can processes.
|
|
7959
|
+
*/
|
|
7960
|
+
I(this, "inverseAttributes", [
|
|
7961
|
+
"IsDecomposedBy",
|
|
7962
|
+
"Decomposes",
|
|
7963
|
+
"AssociatedTo",
|
|
7964
|
+
"HasAssociations",
|
|
7965
|
+
"ClassificationForObjects",
|
|
7966
|
+
"IsGroupedBy",
|
|
7967
|
+
"HasAssignments",
|
|
7968
|
+
"IsDefinedBy",
|
|
7969
|
+
"DefinesOcurrence",
|
|
7970
|
+
"IsTypedBy",
|
|
7971
|
+
"Types",
|
|
7972
|
+
"Defines",
|
|
7973
|
+
"ContainedInStructure",
|
|
7974
|
+
"ContainsElements"
|
|
7975
|
+
]);
|
|
7976
|
+
I(this, "inverseAttributesToProcess", [
|
|
7977
|
+
"HasAssignments",
|
|
7978
|
+
"IsDecomposedBy",
|
|
7979
|
+
"IsDefinedBy",
|
|
7980
|
+
"IsTypedBy",
|
|
7981
|
+
"HasAssociations",
|
|
7982
|
+
"ContainedInStructure"
|
|
7931
7983
|
]);
|
|
7932
|
-
I(this, "
|
|
7933
|
-
|
|
7934
|
-
|
|
7984
|
+
I(this, "_relToAttributesMap", /* @__PURE__ */ new Map());
|
|
7985
|
+
/**
|
|
7986
|
+
* Holds the relationship mappings for each model processed by the indexer.
|
|
7987
|
+
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
7988
|
+
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
7989
|
+
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
7990
|
+
* that are related through that relation type. This structure allows for efficient querying
|
|
7991
|
+
* of entity relationships within a model.
|
|
7992
|
+
*/
|
|
7993
|
+
I(this, "relationMaps", {});
|
|
7935
7994
|
I(this, "onFragmentsDisposed", (t) => {
|
|
7936
|
-
delete this.
|
|
7995
|
+
delete this.relationMaps[t.groupID];
|
|
7937
7996
|
});
|
|
7938
|
-
this.components.add(
|
|
7939
|
-
}
|
|
7940
|
-
// private _entityUIPool: UIPool<TreeView>;
|
|
7941
|
-
set propertiesManager(t) {
|
|
7942
|
-
this._propertiesManager || (this._propertiesManager = t, t && (t.onElementToPset.add(async ({ model: e, psetID: i, elementID: o }) => {
|
|
7943
|
-
this.indexMap[e.uuid] && this.setEntityIndex(e, o).add(i);
|
|
7944
|
-
}), this.onPropertiesManagerSet.trigger(t)));
|
|
7945
|
-
}
|
|
7946
|
-
get propertiesManager() {
|
|
7947
|
-
return this._propertiesManager;
|
|
7948
|
-
}
|
|
7949
|
-
async dispose() {
|
|
7950
|
-
this.indexMap = {}, this.propertiesManager = null, this.onPropertiesManagerSet.reset(), this.components.get(dt).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(Ve.uuid), this.onDisposed.reset();
|
|
7951
|
-
}
|
|
7952
|
-
async getProperties(t, e) {
|
|
7953
|
-
if (!t.hasProperties)
|
|
7954
|
-
return null;
|
|
7955
|
-
const i = t.getLocalProperties();
|
|
7956
|
-
if (i === void 0)
|
|
7957
|
-
return null;
|
|
7958
|
-
const o = this.indexMap[t.uuid];
|
|
7959
|
-
if (!o)
|
|
7960
|
-
return null;
|
|
7961
|
-
const n = o[e], r = parseInt(e, 10), a = await t.getProperties(r);
|
|
7962
|
-
if (!a)
|
|
7963
|
-
throw new Error("Properties not found!");
|
|
7964
|
-
const l = this.cloneProperty(a);
|
|
7965
|
-
if (!l)
|
|
7966
|
-
throw new Error("Properties not found!");
|
|
7967
|
-
const E = [l];
|
|
7968
|
-
if (n)
|
|
7969
|
-
for (const d of n) {
|
|
7970
|
-
const h = await t.getProperties(d);
|
|
7971
|
-
if (!h)
|
|
7972
|
-
continue;
|
|
7973
|
-
const u = this.cloneProperty(h);
|
|
7974
|
-
u && (this.getPsetProperties(u, i), this.getNestedPsets(u, i), E.push(u));
|
|
7975
|
-
}
|
|
7976
|
-
return E;
|
|
7997
|
+
this.components.add(Ge.uuid, this), t.get(dt).onFragmentsDisposed.add(this.onFragmentsDisposed), this.setRelMap();
|
|
7977
7998
|
}
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7999
|
+
getAttributeRels(t) {
|
|
8000
|
+
const e = [];
|
|
8001
|
+
for (const [i, o] of this._relToAttributesMap.entries()) {
|
|
8002
|
+
const { forRelating: n, forRelated: r } = o;
|
|
8003
|
+
(n === t || r === t) && e.push(i);
|
|
8004
|
+
}
|
|
8005
|
+
return e;
|
|
7984
8006
|
}
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
8007
|
+
// TODO: Construct this based on the IFC EXPRESS long form schema?
|
|
8008
|
+
setRelMap() {
|
|
8009
|
+
this._relToAttributesMap.set(b.IFCRELAGGREGATES, {
|
|
8010
|
+
forRelating: "IsDecomposedBy",
|
|
8011
|
+
forRelated: "Decomposes"
|
|
8012
|
+
}), this._relToAttributesMap.set(b.IFCRELASSOCIATESMATERIAL, {
|
|
8013
|
+
forRelating: "AssociatedTo",
|
|
8014
|
+
forRelated: "HasAssociations"
|
|
8015
|
+
}), this._relToAttributesMap.set(b.IFCRELASSOCIATESCLASSIFICATION, {
|
|
8016
|
+
forRelating: "ClassificationForObjects",
|
|
8017
|
+
forRelated: "HasAssociations"
|
|
8018
|
+
}), this._relToAttributesMap.set(b.IFCRELASSIGNSTOGROUP, {
|
|
8019
|
+
forRelating: "IsGroupedBy",
|
|
8020
|
+
forRelated: "HasAssignments"
|
|
8021
|
+
}), this._relToAttributesMap.set(b.IFCRELDEFINESBYPROPERTIES, {
|
|
8022
|
+
forRelated: "IsDefinedBy",
|
|
8023
|
+
forRelating: "DefinesOcurrence"
|
|
8024
|
+
}), this._relToAttributesMap.set(b.IFCRELDEFINESBYTYPE, {
|
|
8025
|
+
forRelated: "IsTypedBy",
|
|
8026
|
+
forRelating: "Types"
|
|
8027
|
+
}), this._relToAttributesMap.set(b.IFCRELDEFINESBYTEMPLATE, {
|
|
8028
|
+
forRelated: "IsDefinedBy",
|
|
8029
|
+
forRelating: "Defines"
|
|
8030
|
+
}), this._relToAttributesMap.set(b.IFCRELCONTAINEDINSPATIALSTRUCTURE, {
|
|
8031
|
+
forRelated: "ContainedInStructure",
|
|
8032
|
+
forRelating: "ContainsElements"
|
|
8033
|
+
});
|
|
7991
8034
|
}
|
|
8035
|
+
/**
|
|
8036
|
+
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
8037
|
+
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
8038
|
+
* and maps them in a structured way to facilitate quick access to related entities.
|
|
8039
|
+
*
|
|
8040
|
+
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
8041
|
+
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
8042
|
+
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
8043
|
+
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
8044
|
+
* of entities that are related through that attribute.
|
|
8045
|
+
*
|
|
8046
|
+
* @param model The `FragmentsGroup` model to be processed. It must have properties loaded.
|
|
8047
|
+
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
8048
|
+
* representation of the relations indexed by entity expressIDs and relation types.
|
|
8049
|
+
* @throws An error if the model does not have properties loaded.
|
|
8050
|
+
*/
|
|
7992
8051
|
async process(t) {
|
|
7993
8052
|
if (!t.hasProperties)
|
|
7994
8053
|
throw new Error("FragmentsGroup properties not found");
|
|
7995
|
-
this.
|
|
7996
|
-
const e = [
|
|
7997
|
-
for (const i of this.
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
|
|
8007
|
-
|
|
8054
|
+
this.relationMaps[t.uuid] = /* @__PURE__ */ new Map();
|
|
8055
|
+
const e = this.relationMaps[t.uuid];
|
|
8056
|
+
for (const i of this.inverseAttributesToProcess) {
|
|
8057
|
+
const o = this.getAttributeRels(i);
|
|
8058
|
+
for (const n of o)
|
|
8059
|
+
await Ft.getRelationMap(
|
|
8060
|
+
t,
|
|
8061
|
+
n,
|
|
8062
|
+
async (r, a) => {
|
|
8063
|
+
const c = this._relToAttributesMap.get(n);
|
|
8064
|
+
if (!c)
|
|
8065
|
+
return;
|
|
8066
|
+
const { forRelated: E, forRelating: d } = c;
|
|
8067
|
+
if (d && this.inverseAttributesToProcess.includes(d)) {
|
|
8068
|
+
const h = e.get(r) ?? /* @__PURE__ */ new Map(), u = this.inverseAttributes.indexOf(d);
|
|
8069
|
+
h.set(u, a), e.set(r, h);
|
|
8070
|
+
}
|
|
8071
|
+
if (E && this.inverseAttributesToProcess.includes(E))
|
|
8072
|
+
for (const h of a) {
|
|
8073
|
+
const u = e.get(h) ?? /* @__PURE__ */ new Map(), p = this.inverseAttributes.indexOf(E), R = u.get(p) ?? [];
|
|
8074
|
+
R.push(r), u.set(p, R), e.set(h, u);
|
|
8075
|
+
}
|
|
8008
8076
|
}
|
|
8009
|
-
|
|
8010
|
-
|
|
8077
|
+
);
|
|
8078
|
+
}
|
|
8079
|
+
return e;
|
|
8011
8080
|
}
|
|
8012
|
-
|
|
8013
|
-
|
|
8081
|
+
/**
|
|
8082
|
+
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
8083
|
+
* This method searches the indexed relation maps for the specified model and entity,
|
|
8084
|
+
* returning the IDs of related entities if a match is found.
|
|
8085
|
+
*
|
|
8086
|
+
* @param model The `FragmentsGroup` model containing the entity.
|
|
8087
|
+
* @param expressID The unique identifier of the entity within the model.
|
|
8088
|
+
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
8089
|
+
* @returns An array of express IDs representing the related entities, or `null` if no relations are found
|
|
8090
|
+
* or the specified relation name is not indexed.
|
|
8091
|
+
*/
|
|
8092
|
+
getEntityRelations(t, e, i) {
|
|
8093
|
+
const o = this.relationMaps[t.uuid];
|
|
8094
|
+
if (!o)
|
|
8095
|
+
return null;
|
|
8096
|
+
const n = o.get(e), r = this.inverseAttributes.indexOf(i);
|
|
8097
|
+
if (!n || r === -1)
|
|
8098
|
+
return null;
|
|
8099
|
+
const a = n.get(r);
|
|
8100
|
+
return a || null;
|
|
8014
8101
|
}
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8102
|
+
/**
|
|
8103
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
8104
|
+
* This method iterates through the relations indexed for the given model,
|
|
8105
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
8106
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
8107
|
+
* The resulting object is then serialized into a JSON string.
|
|
8108
|
+
*
|
|
8109
|
+
* @param model The `FragmentsGroup` model whose relations are to be serialized.
|
|
8110
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
8111
|
+
* If the model has no indexed relations, `null` is returned.
|
|
8112
|
+
*/
|
|
8113
|
+
serializeModelRelations(t) {
|
|
8114
|
+
const e = this.relationMaps[t.uuid];
|
|
8115
|
+
if (!e)
|
|
8116
|
+
return null;
|
|
8117
|
+
const i = {};
|
|
8118
|
+
for (const [o, n] of e.entries()) {
|
|
8119
|
+
i[o] || (i[o] = {});
|
|
8120
|
+
for (const [r, a] of n.entries())
|
|
8121
|
+
i[o][r] = a;
|
|
8030
8122
|
}
|
|
8031
|
-
return
|
|
8123
|
+
return JSON.stringify(i);
|
|
8032
8124
|
}
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8125
|
+
/**
|
|
8126
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
8127
|
+
* This method iterates through each model's relations indexed in `relationMaps`, organizing them
|
|
8128
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
8129
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
8130
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
8131
|
+
*
|
|
8132
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
8133
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
8134
|
+
*/
|
|
8135
|
+
serializeRelations() {
|
|
8136
|
+
const t = {};
|
|
8137
|
+
for (const e in this.relationMaps) {
|
|
8138
|
+
const i = this.relationMaps[e], o = {};
|
|
8139
|
+
for (const [n, r] of i.entries()) {
|
|
8140
|
+
o[n] || (o[n] = {});
|
|
8141
|
+
for (const [a, c] of r.entries())
|
|
8142
|
+
o[n][a] = c;
|
|
8143
|
+
}
|
|
8144
|
+
t[e] = o;
|
|
8044
8145
|
}
|
|
8146
|
+
return JSON.stringify(t);
|
|
8147
|
+
}
|
|
8148
|
+
/**
|
|
8149
|
+
* Converts a JSON string representing relations between entities into a structured map.
|
|
8150
|
+
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
8151
|
+
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
8152
|
+
* and the values are maps where each key is a relation type ID and its value is an array
|
|
8153
|
+
* of express IDs of entities related through that relation type.
|
|
8154
|
+
*
|
|
8155
|
+
* @param json The JSON string to be parsed into the relations map.
|
|
8156
|
+
* @returns A `Map` where the key is the express ID of an entity as a number, and the value
|
|
8157
|
+
* is another `Map`. This inner map's key is the relation type ID as a number, and its value
|
|
8158
|
+
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
8159
|
+
*/
|
|
8160
|
+
getRelationsMapFromJSON(t) {
|
|
8161
|
+
const e = JSON.parse(t), i = /* @__PURE__ */ new Map();
|
|
8162
|
+
for (const o in e) {
|
|
8163
|
+
const n = e[o], r = /* @__PURE__ */ new Map();
|
|
8164
|
+
for (const a in n)
|
|
8165
|
+
r.set(Number(a), n[a]);
|
|
8166
|
+
i.set(Number(o), r);
|
|
8167
|
+
}
|
|
8168
|
+
return i;
|
|
8169
|
+
}
|
|
8170
|
+
/**
|
|
8171
|
+
* Disposes the component, cleaning up resources and detaching event listeners.
|
|
8172
|
+
* This ensures that the component is properly cleaned up and does not leave behind any
|
|
8173
|
+
* references that could prevent garbage collection.
|
|
8174
|
+
*/
|
|
8175
|
+
dispose() {
|
|
8176
|
+
this.relationMaps = {}, this.components.get(dt).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(Ge.uuid), this.onDisposed.reset();
|
|
8045
8177
|
}
|
|
8046
8178
|
};
|
|
8047
|
-
I(
|
|
8048
|
-
let pn =
|
|
8049
|
-
class
|
|
8179
|
+
I(Ge, "uuid", "23a889ab-83b3-44a4-8bee-ead83438370b");
|
|
8180
|
+
let pn = Ge;
|
|
8181
|
+
class Br {
|
|
8050
8182
|
constructor() {
|
|
8051
8183
|
I(this, "factor", 1);
|
|
8052
8184
|
I(this, "complement", 1);
|
|
@@ -8107,7 +8239,7 @@ class vr {
|
|
|
8107
8239
|
class wn {
|
|
8108
8240
|
constructor() {
|
|
8109
8241
|
I(this, "itemsByFloor", {});
|
|
8110
|
-
I(this, "_units", new
|
|
8242
|
+
I(this, "_units", new Br());
|
|
8111
8243
|
}
|
|
8112
8244
|
// TODO: Maybe make this more flexible so that it also support more exotic spatial structures?
|
|
8113
8245
|
setUp(s) {
|
|
@@ -8117,11 +8249,11 @@ class wn {
|
|
|
8117
8249
|
0,
|
|
8118
8250
|
b.IFCRELCONTAINEDINSPATIALSTRUCTURE
|
|
8119
8251
|
), e = /* @__PURE__ */ new Set(), i = s.GetLineIDsWithType(0, b.IFCSPACE);
|
|
8120
|
-
for (let
|
|
8121
|
-
e.add(i.get(
|
|
8252
|
+
for (let c = 0; c < i.size(); c++)
|
|
8253
|
+
e.add(i.get(c));
|
|
8122
8254
|
const o = s.GetLineIDsWithType(0, b.IFCRELAGGREGATES), n = o.size();
|
|
8123
|
-
for (let
|
|
8124
|
-
const E = o.get(
|
|
8255
|
+
for (let c = 0; c < n; c++) {
|
|
8256
|
+
const E = o.get(c), d = s.GetLine(0, E);
|
|
8125
8257
|
if (!d || !d.RelatingObject || !d.RelatedObjects)
|
|
8126
8258
|
continue;
|
|
8127
8259
|
const h = d.RelatingObject.value, u = d.RelatedObjects;
|
|
@@ -8131,8 +8263,8 @@ class wn {
|
|
|
8131
8263
|
}
|
|
8132
8264
|
}
|
|
8133
8265
|
const r = {}, a = t.size();
|
|
8134
|
-
for (let
|
|
8135
|
-
const E = t.get(
|
|
8266
|
+
for (let c = 0; c < a; c++) {
|
|
8267
|
+
const E = t.get(c), d = s.GetLine(0, E);
|
|
8136
8268
|
if (!d || !d.RelatingStructure || !d.RelatedElements)
|
|
8137
8269
|
continue;
|
|
8138
8270
|
const h = d.RelatingStructure.value, u = d.RelatedElements;
|
|
@@ -8148,16 +8280,16 @@ class wn {
|
|
|
8148
8280
|
this.itemsByFloor[R] = h;
|
|
8149
8281
|
}
|
|
8150
8282
|
}
|
|
8151
|
-
for (const
|
|
8152
|
-
const E = this.itemsByFloor[
|
|
8283
|
+
for (const c in r) {
|
|
8284
|
+
const E = this.itemsByFloor[c];
|
|
8153
8285
|
if (E !== void 0) {
|
|
8154
|
-
const d = r[
|
|
8286
|
+
const d = r[c];
|
|
8155
8287
|
for (const h of d)
|
|
8156
8288
|
this.itemsByFloor[h] = E;
|
|
8157
8289
|
}
|
|
8158
8290
|
}
|
|
8159
|
-
for (let
|
|
8160
|
-
const E = o.get(
|
|
8291
|
+
for (let c = 0; c < n; c++) {
|
|
8292
|
+
const E = o.get(c), d = s.GetLine(0, E);
|
|
8161
8293
|
if (!d || !d.RelatingObject || !d.RelatedObjects)
|
|
8162
8294
|
continue;
|
|
8163
8295
|
const h = d.RelatingObject.value, u = d.RelatedObjects;
|
|
@@ -8241,8 +8373,8 @@ class Dn {
|
|
|
8241
8373
|
const { x: u, y: p, z: R } = r[h];
|
|
8242
8374
|
a[h * 3] = u, a[h * 3 + 1] = p, a[h * 3 + 2] = R || 0;
|
|
8243
8375
|
}
|
|
8244
|
-
const
|
|
8245
|
-
E.setAttribute("position",
|
|
8376
|
+
const c = new O.BufferAttribute(a, 3), E = new O.EdgesGeometry();
|
|
8377
|
+
E.setAttribute("position", c);
|
|
8246
8378
|
const d = new $t.CurveMesh(
|
|
8247
8379
|
i,
|
|
8248
8380
|
n,
|
|
@@ -8271,13 +8403,13 @@ class Un {
|
|
|
8271
8403
|
return e;
|
|
8272
8404
|
}
|
|
8273
8405
|
}
|
|
8274
|
-
const
|
|
8406
|
+
const Ve = class Ve extends it {
|
|
8275
8407
|
constructor(t) {
|
|
8276
8408
|
super(t);
|
|
8277
|
-
I(this, "onIfcStartedLoading", new
|
|
8278
|
-
I(this, "onSetup", new
|
|
8409
|
+
I(this, "onIfcStartedLoading", new U());
|
|
8410
|
+
I(this, "onSetup", new U());
|
|
8279
8411
|
/** {@link Disposable.onDisposed} */
|
|
8280
|
-
I(this, "onDisposed", new
|
|
8412
|
+
I(this, "onDisposed", new U());
|
|
8281
8413
|
I(this, "settings", new gi());
|
|
8282
8414
|
I(this, "enabled", !0);
|
|
8283
8415
|
I(this, "webIfc", new b.IfcAPI());
|
|
@@ -8286,16 +8418,16 @@ const Ge = class Ge extends it {
|
|
|
8286
8418
|
I(this, "_metaData", new Un());
|
|
8287
8419
|
I(this, "_fragmentInstances", /* @__PURE__ */ new Map());
|
|
8288
8420
|
I(this, "_civil", new Dn());
|
|
8289
|
-
I(this, "_propertyExporter", new
|
|
8421
|
+
I(this, "_propertyExporter", new br());
|
|
8290
8422
|
I(this, "_visitedFragments", /* @__PURE__ */ new Map());
|
|
8291
8423
|
I(this, "_materialT", new O.MeshLambertMaterial({
|
|
8292
8424
|
transparent: !0,
|
|
8293
8425
|
opacity: 0.5
|
|
8294
8426
|
}));
|
|
8295
|
-
this.components.add(
|
|
8427
|
+
this.components.add(Ve.uuid, this), this.settings.excludedCategories.add(b.IFCOPENINGELEMENT);
|
|
8296
8428
|
}
|
|
8297
8429
|
dispose() {
|
|
8298
|
-
this.webIfc = null, this.onDisposed.trigger(
|
|
8430
|
+
this.webIfc = null, this.onDisposed.trigger(Ve.uuid), this.onDisposed.reset();
|
|
8299
8431
|
}
|
|
8300
8432
|
async setup(t) {
|
|
8301
8433
|
this.settings = { ...this.settings, ...t }, this.settings.autoSetWasm && await this.autoSetWasm(), this.onSetup.trigger();
|
|
@@ -8328,9 +8460,9 @@ const Ge = class Ge extends it {
|
|
|
8328
8460
|
for (const a of t) {
|
|
8329
8461
|
if (!this.webIfc.IsIfcElement(a) && a !== b.IFCSPACE || this.settings.excludedCategories.has(a))
|
|
8330
8462
|
continue;
|
|
8331
|
-
const
|
|
8463
|
+
const c = this.webIfc.GetLineIDsWithType(0, a), E = c.size();
|
|
8332
8464
|
for (let d = 0; d < E; d++) {
|
|
8333
|
-
const h =
|
|
8465
|
+
const h = c.get(d);
|
|
8334
8466
|
n.push(h);
|
|
8335
8467
|
const u = this._spatialTree.itemsByFloor[h] || 0;
|
|
8336
8468
|
e.data.set(h, [[], [u, a]]);
|
|
@@ -8340,15 +8472,15 @@ const Ge = class Ge extends it {
|
|
|
8340
8472
|
this.getMesh(a, e);
|
|
8341
8473
|
});
|
|
8342
8474
|
for (const a of this._visitedFragments) {
|
|
8343
|
-
const { index:
|
|
8344
|
-
e.keyFragments.set(
|
|
8475
|
+
const { index: c, fragment: E } = a[1];
|
|
8476
|
+
e.keyFragments.set(c, E.id);
|
|
8345
8477
|
}
|
|
8346
8478
|
for (const a of e.items) {
|
|
8347
|
-
const
|
|
8348
|
-
if (!
|
|
8479
|
+
const c = this._fragmentInstances.get(a.id);
|
|
8480
|
+
if (!c)
|
|
8349
8481
|
throw new Error("Fragment not found!");
|
|
8350
8482
|
const E = [];
|
|
8351
|
-
for (const [d, h] of
|
|
8483
|
+
for (const [d, h] of c)
|
|
8352
8484
|
E.push(h);
|
|
8353
8485
|
a.add(E);
|
|
8354
8486
|
}
|
|
@@ -8361,14 +8493,14 @@ const Ge = class Ge extends it {
|
|
|
8361
8493
|
getMesh(t, e) {
|
|
8362
8494
|
const i = t.geometries.size(), o = t.expressID;
|
|
8363
8495
|
for (let n = 0; n < i; n++) {
|
|
8364
|
-
const r = t.geometries.get(n), { x: a, y:
|
|
8496
|
+
const r = t.geometries.get(n), { x: a, y: c, z: E, w: d } = r.color, h = d !== 1, { geometryExpressID: u } = r, p = `${u}-${h}`;
|
|
8365
8497
|
if (!this._visitedFragments.has(p)) {
|
|
8366
8498
|
const m = this.getGeometry(this.webIfc, u), g = h ? this._materialT : this._material, S = new $t.Fragment(m, g, 1);
|
|
8367
8499
|
e.add(S.mesh), e.items.push(S);
|
|
8368
8500
|
const _ = this._visitedFragments.size;
|
|
8369
8501
|
this._visitedFragments.set(p, { index: _, fragment: S });
|
|
8370
8502
|
}
|
|
8371
|
-
const R = new O.Color().setRGB(a,
|
|
8503
|
+
const R = new O.Color().setRGB(a, c, E, "srgb"), A = new O.Matrix4();
|
|
8372
8504
|
A.fromArray(r.flatTransformation);
|
|
8373
8505
|
const C = this._visitedFragments.get(p);
|
|
8374
8506
|
if (C === void 0)
|
|
@@ -8401,8 +8533,8 @@ const Ge = class Ge extends it {
|
|
|
8401
8533
|
), r = new Float32Array(n.length / 2), a = new Float32Array(n.length / 2);
|
|
8402
8534
|
for (let h = 0; h < n.length; h += 6)
|
|
8403
8535
|
r[h / 2] = n[h], r[h / 2 + 1] = n[h + 1], r[h / 2 + 2] = n[h + 2], a[h / 2] = n[h + 3], a[h / 2 + 1] = n[h + 4], a[h / 2 + 2] = n[h + 5];
|
|
8404
|
-
const
|
|
8405
|
-
return
|
|
8536
|
+
const c = new O.BufferGeometry(), E = new O.BufferAttribute(r, 3), d = new O.BufferAttribute(a, 3);
|
|
8537
|
+
return c.setAttribute("position", E), c.setAttribute("normal", d), c.setIndex(Array.from(o)), i.delete(), c;
|
|
8406
8538
|
}
|
|
8407
8539
|
async autoSetWasm() {
|
|
8408
8540
|
const t = await fetch(
|
|
@@ -8425,19 +8557,19 @@ const Ge = class Ge extends it {
|
|
|
8425
8557
|
}
|
|
8426
8558
|
}
|
|
8427
8559
|
};
|
|
8428
|
-
I(
|
|
8429
|
-
let Ii =
|
|
8560
|
+
I(Ve, "uuid", "a659add7-1418-4771-a0d6-7d4d438e4624");
|
|
8561
|
+
let Ii = Ve;
|
|
8430
8562
|
const Yt = class Yt extends it {
|
|
8431
8563
|
constructor(t) {
|
|
8432
8564
|
super(t);
|
|
8433
8565
|
/** {@link Disposable.onDisposed} */
|
|
8434
|
-
I(this, "onDisposed", new
|
|
8435
|
-
I(this, "onRequestFile", new
|
|
8566
|
+
I(this, "onDisposed", new U());
|
|
8567
|
+
I(this, "onRequestFile", new U());
|
|
8436
8568
|
I(this, "ifcToExport", null);
|
|
8437
|
-
I(this, "onElementToPset", new
|
|
8438
|
-
I(this, "onPropToPset", new
|
|
8439
|
-
I(this, "onPsetRemoved", new
|
|
8440
|
-
I(this, "onDataChanged", new
|
|
8569
|
+
I(this, "onElementToPset", new U());
|
|
8570
|
+
I(this, "onPropToPset", new U());
|
|
8571
|
+
I(this, "onPsetRemoved", new U());
|
|
8572
|
+
I(this, "onDataChanged", new U());
|
|
8441
8573
|
I(this, "wasm", {
|
|
8442
8574
|
path: "/",
|
|
8443
8575
|
absolute: !1
|
|
@@ -8488,11 +8620,11 @@ const Yt = class Yt extends it {
|
|
|
8488
8620
|
}
|
|
8489
8621
|
}
|
|
8490
8622
|
async newPset(t, e, i) {
|
|
8491
|
-
const o = Yt.getIFCSchema(t), { ownerHistoryHandle: n } = await this.getOwnerHistory(t), r = this.newGUID(t), a = new b[o].IfcLabel(e),
|
|
8623
|
+
const o = Yt.getIFCSchema(t), { ownerHistoryHandle: n } = await this.getOwnerHistory(t), r = this.newGUID(t), a = new b[o].IfcLabel(e), c = i ? new b[o].IfcText(i) : null, E = new b[o].IfcPropertySet(
|
|
8492
8624
|
r,
|
|
8493
8625
|
n,
|
|
8494
8626
|
a,
|
|
8495
|
-
|
|
8627
|
+
c,
|
|
8496
8628
|
[]
|
|
8497
8629
|
);
|
|
8498
8630
|
E.expressID = this.increaseMaxID(t);
|
|
@@ -8520,13 +8652,13 @@ const Yt = class Yt extends it {
|
|
|
8520
8652
|
}
|
|
8521
8653
|
}
|
|
8522
8654
|
async newSingleProperty(t, e, i, o) {
|
|
8523
|
-
const n = Yt.getIFCSchema(t), r = new b[n].IfcIdentifier(i), a = new b[n][e](o),
|
|
8655
|
+
const n = Yt.getIFCSchema(t), r = new b[n].IfcIdentifier(i), a = new b[n][e](o), c = new b[n].IfcPropertySingleValue(
|
|
8524
8656
|
r,
|
|
8525
8657
|
null,
|
|
8526
8658
|
a,
|
|
8527
8659
|
null
|
|
8528
8660
|
);
|
|
8529
|
-
return
|
|
8661
|
+
return c.expressID = this.increaseMaxID(t), await this.setData(t, c), c;
|
|
8530
8662
|
}
|
|
8531
8663
|
newSingleStringProperty(t, e, i, o) {
|
|
8532
8664
|
return this.newSingleProperty(t, e, i, o);
|
|
@@ -8572,8 +8704,8 @@ const Yt = class Yt extends it {
|
|
|
8572
8704
|
}
|
|
8573
8705
|
async saveToIfc(t, e) {
|
|
8574
8706
|
const i = this.components.get(Ii), o = i.webIfc, n = await i.readIfcFile(e), r = this._changeMap[t.uuid] ?? [];
|
|
8575
|
-
for (const
|
|
8576
|
-
const E = await t.getProperties(
|
|
8707
|
+
for (const c of r) {
|
|
8708
|
+
const E = await t.getProperties(c);
|
|
8577
8709
|
if (E)
|
|
8578
8710
|
try {
|
|
8579
8711
|
o.WriteLine(n, E);
|
|
@@ -8581,7 +8713,7 @@ const Yt = class Yt extends it {
|
|
|
8581
8713
|
}
|
|
8582
8714
|
else
|
|
8583
8715
|
try {
|
|
8584
|
-
o.DeleteLine(n,
|
|
8716
|
+
o.DeleteLine(n, c);
|
|
8585
8717
|
} catch {
|
|
8586
8718
|
}
|
|
8587
8719
|
}
|
|
@@ -8604,15 +8736,15 @@ const Yt = class Yt extends it {
|
|
|
8604
8736
|
const a = r.value;
|
|
8605
8737
|
if (a === void 0 || a == null)
|
|
8606
8738
|
throw new Error(`Attribute ${i} has a badly defined handle.`);
|
|
8607
|
-
const
|
|
8739
|
+
const c = new U();
|
|
8608
8740
|
return Object.defineProperty(n[i], "value", {
|
|
8609
8741
|
get() {
|
|
8610
8742
|
return this._value;
|
|
8611
8743
|
},
|
|
8612
8744
|
async set(E) {
|
|
8613
|
-
this._value = E,
|
|
8745
|
+
this._value = E, c.trigger(E);
|
|
8614
8746
|
}
|
|
8615
|
-
}), n[i].value = a, this.attributeListeners[t.uuid][e] || (this.attributeListeners[t.uuid][e] = {}), this.attributeListeners[t.uuid][e][i] =
|
|
8747
|
+
}), n[i].value = a, this.attributeListeners[t.uuid][e] || (this.attributeListeners[t.uuid][e] = {}), this.attributeListeners[t.uuid][e][i] = c, c;
|
|
8616
8748
|
}
|
|
8617
8749
|
};
|
|
8618
8750
|
I(Yt, "uuid", "58c2d9f0-183c-48d6-a402-dfcf5b9a34df");
|
|
@@ -8624,7 +8756,7 @@ const _s = class _s extends it {
|
|
|
8624
8756
|
I(this, "enabled", !0);
|
|
8625
8757
|
I(this, "_groupSystems", {});
|
|
8626
8758
|
/** {@link Disposable.onDisposed} */
|
|
8627
|
-
I(this, "onDisposed", new
|
|
8759
|
+
I(this, "onDisposed", new U());
|
|
8628
8760
|
I(this, "onFragmentsDisposed", (t) => {
|
|
8629
8761
|
const { groupID: e, fragmentIDs: i } = t;
|
|
8630
8762
|
for (const o in this._groupSystems) {
|
|
@@ -8633,10 +8765,10 @@ const _s = class _s extends it {
|
|
|
8633
8765
|
delete n[e], Object.values(n).length === 0 && delete this._groupSystems[o];
|
|
8634
8766
|
else
|
|
8635
8767
|
for (const a of r) {
|
|
8636
|
-
const
|
|
8768
|
+
const c = n[a];
|
|
8637
8769
|
for (const E of i)
|
|
8638
|
-
delete
|
|
8639
|
-
Object.values(
|
|
8770
|
+
delete c[E];
|
|
8771
|
+
Object.values(c).length === 0 && delete n[a];
|
|
8640
8772
|
}
|
|
8641
8773
|
}
|
|
8642
8774
|
});
|
|
@@ -8662,8 +8794,8 @@ const _s = class _s extends it {
|
|
|
8662
8794
|
const e = this.components.get(dt);
|
|
8663
8795
|
if (!t) {
|
|
8664
8796
|
const r = {};
|
|
8665
|
-
for (const [a,
|
|
8666
|
-
r[a] = new Set(
|
|
8797
|
+
for (const [a, c] of e.list)
|
|
8798
|
+
r[a] = new Set(c.ids);
|
|
8667
8799
|
return r;
|
|
8668
8800
|
}
|
|
8669
8801
|
const i = Object.keys(t).length, o = {};
|
|
@@ -8673,8 +8805,8 @@ const _s = class _s extends it {
|
|
|
8673
8805
|
console.warn(`Classification ${r} does not exist.`);
|
|
8674
8806
|
continue;
|
|
8675
8807
|
}
|
|
8676
|
-
for (const
|
|
8677
|
-
const E = this._groupSystems[r][
|
|
8808
|
+
for (const c of a) {
|
|
8809
|
+
const E = this._groupSystems[r][c];
|
|
8678
8810
|
if (E)
|
|
8679
8811
|
for (const d in E) {
|
|
8680
8812
|
o[d] || (o[d] = /* @__PURE__ */ new Map());
|
|
@@ -8688,10 +8820,10 @@ const _s = class _s extends it {
|
|
|
8688
8820
|
const n = {};
|
|
8689
8821
|
for (const r in o) {
|
|
8690
8822
|
const a = o[r];
|
|
8691
|
-
for (const [
|
|
8823
|
+
for (const [c, E] of a) {
|
|
8692
8824
|
if (E === void 0)
|
|
8693
8825
|
throw new Error("Malformed fragments map!");
|
|
8694
|
-
E === i && (n[r] || (n[r] = /* @__PURE__ */ new Set()), n[r].add(
|
|
8826
|
+
E === i && (n[r] || (n[r] = /* @__PURE__ */ new Set()), n[r].add(c));
|
|
8695
8827
|
}
|
|
8696
8828
|
}
|
|
8697
8829
|
return n;
|
|
@@ -8703,8 +8835,8 @@ const _s = class _s extends it {
|
|
|
8703
8835
|
const o = i[t];
|
|
8704
8836
|
for (const [n, r] of e.data) {
|
|
8705
8837
|
const a = r[0];
|
|
8706
|
-
for (const
|
|
8707
|
-
const E = e.keyFragments.get(
|
|
8838
|
+
for (const c of a) {
|
|
8839
|
+
const E = e.keyFragments.get(c);
|
|
8708
8840
|
E && (o[E] || (o[E] = /* @__PURE__ */ new Set()), o[E].add(n));
|
|
8709
8841
|
}
|
|
8710
8842
|
}
|
|
@@ -8719,14 +8851,14 @@ const _s = class _s extends it {
|
|
|
8719
8851
|
continue;
|
|
8720
8852
|
const a = String((o = r.PredefinedType) == null ? void 0 : o.value).toUpperCase();
|
|
8721
8853
|
e[a] || (e[a] = {});
|
|
8722
|
-
const
|
|
8854
|
+
const c = e[a];
|
|
8723
8855
|
for (const [E, d] of t.data) {
|
|
8724
8856
|
const h = d[0];
|
|
8725
8857
|
for (const u of h) {
|
|
8726
8858
|
const p = t.keyFragments.get(u);
|
|
8727
8859
|
if (!p)
|
|
8728
8860
|
throw new Error("Fragment ID not found!");
|
|
8729
|
-
|
|
8861
|
+
c[p] || (c[p] = /* @__PURE__ */ new Set()), c[p].add(r.expressID);
|
|
8730
8862
|
}
|
|
8731
8863
|
}
|
|
8732
8864
|
}
|
|
@@ -8770,8 +8902,8 @@ const _s = class _s extends it {
|
|
|
8770
8902
|
for (const r of n[0]) {
|
|
8771
8903
|
const a = t.keyFragments.get(r);
|
|
8772
8904
|
if (a) {
|
|
8773
|
-
const
|
|
8774
|
-
|
|
8905
|
+
const c = this._groupSystems[e];
|
|
8906
|
+
c[i] || (c[i] = {}), c[i][a] || (c[i][a] = /* @__PURE__ */ new Set()), c[i][a].add(o);
|
|
8775
8907
|
}
|
|
8776
8908
|
}
|
|
8777
8909
|
}
|
|
@@ -8785,7 +8917,7 @@ const ze = class ze extends it {
|
|
|
8785
8917
|
I(this, "height", 10);
|
|
8786
8918
|
I(this, "groupName", "storeys");
|
|
8787
8919
|
/** {@link Disposable.onDisposed} */
|
|
8788
|
-
I(this, "onDisposed", new
|
|
8920
|
+
I(this, "onDisposed", new U());
|
|
8789
8921
|
I(this, "list", /* @__PURE__ */ new Set());
|
|
8790
8922
|
t.add(ze.uuid, this);
|
|
8791
8923
|
}
|
|
@@ -8802,14 +8934,14 @@ const ze = class ze extends it {
|
|
|
8802
8934
|
const t = this.components.get(fi), e = this.components.get(dt), i = this.enabled ? 1 : -1;
|
|
8803
8935
|
let o = 0;
|
|
8804
8936
|
const r = t.get()[this.groupName], a = new O.Matrix4();
|
|
8805
|
-
for (const
|
|
8937
|
+
for (const c in r) {
|
|
8806
8938
|
a.elements[13] = o * i * this.height;
|
|
8807
|
-
for (const E in r[
|
|
8808
|
-
const d = e.list.get(E), h =
|
|
8939
|
+
for (const E in r[c]) {
|
|
8940
|
+
const d = e.list.get(E), h = c + E, u = this.list.has(h);
|
|
8809
8941
|
if (!d || this.enabled && u || !this.enabled && !u)
|
|
8810
8942
|
continue;
|
|
8811
8943
|
this.enabled ? this.list.add(h) : this.list.delete(h);
|
|
8812
|
-
const p = r[
|
|
8944
|
+
const p = r[c][E];
|
|
8813
8945
|
d.applyTransform(p, a);
|
|
8814
8946
|
}
|
|
8815
8947
|
o++;
|
|
@@ -8851,14 +8983,14 @@ const Ns = class Ns extends it {
|
|
|
8851
8983
|
};
|
|
8852
8984
|
I(Ns, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
|
|
8853
8985
|
let mn = Ns;
|
|
8854
|
-
class
|
|
8986
|
+
class Yr extends gi {
|
|
8855
8987
|
constructor() {
|
|
8856
8988
|
super(...arguments);
|
|
8857
8989
|
I(this, "minGeometrySize", 10);
|
|
8858
8990
|
I(this, "minAssetsSize", 1e3);
|
|
8859
8991
|
}
|
|
8860
8992
|
}
|
|
8861
|
-
class
|
|
8993
|
+
class Gr extends gi {
|
|
8862
8994
|
constructor() {
|
|
8863
8995
|
super(...arguments);
|
|
8864
8996
|
I(this, "propertiesSize", 100);
|
|
@@ -8867,13 +8999,13 @@ class Yr extends gi {
|
|
|
8867
8999
|
class Vr extends it {
|
|
8868
9000
|
constructor() {
|
|
8869
9001
|
super(...arguments);
|
|
8870
|
-
I(this, "onPropertiesStreamed", new
|
|
8871
|
-
I(this, "onProgress", new
|
|
8872
|
-
I(this, "onIndicesStreamed", new
|
|
9002
|
+
I(this, "onPropertiesStreamed", new U());
|
|
9003
|
+
I(this, "onProgress", new U());
|
|
9004
|
+
I(this, "onIndicesStreamed", new U());
|
|
8873
9005
|
/** {@link Disposable.onDisposed} */
|
|
8874
|
-
I(this, "onDisposed", new
|
|
9006
|
+
I(this, "onDisposed", new U());
|
|
8875
9007
|
I(this, "enabled", !0);
|
|
8876
|
-
I(this, "settings", new
|
|
9008
|
+
I(this, "settings", new Gr());
|
|
8877
9009
|
I(this, "webIfc", new b.IfcAPI());
|
|
8878
9010
|
}
|
|
8879
9011
|
async dispose() {
|
|
@@ -8914,7 +9046,7 @@ class Vr extends it {
|
|
|
8914
9046
|
e.add(E);
|
|
8915
9047
|
let r = 0.01, a = 0;
|
|
8916
9048
|
for (const E of e) {
|
|
8917
|
-
if (a++,
|
|
9049
|
+
if (a++, Pn.has(E))
|
|
8918
9050
|
continue;
|
|
8919
9051
|
const d = n.has(E), h = this.webIfc.GetLineIDsWithType(0, E), u = h.size();
|
|
8920
9052
|
let p = 0;
|
|
@@ -8948,10 +9080,10 @@ class Vr extends it {
|
|
|
8948
9080
|
const R = a / e.size;
|
|
8949
9081
|
R > r && (r += 0.01, r = Math.max(r, R), await this.onProgress.trigger(Math.round(r * 100) / 100));
|
|
8950
9082
|
}
|
|
8951
|
-
const
|
|
9083
|
+
const c = [];
|
|
8952
9084
|
for (const [E, d] of o)
|
|
8953
|
-
|
|
8954
|
-
await this.onIndicesStreamed.trigger(
|
|
9085
|
+
c.push([E, ...d]);
|
|
9086
|
+
await this.onIndicesStreamed.trigger(c);
|
|
8955
9087
|
}
|
|
8956
9088
|
getIndices(t, e, i) {
|
|
8957
9089
|
const o = t.RelatedObjects || t.RelatedElements;
|
|
@@ -8970,8 +9102,8 @@ class Vr extends it {
|
|
|
8970
9102
|
for (const a of o) {
|
|
8971
9103
|
if (a.value === void 0 || a.value === null)
|
|
8972
9104
|
continue;
|
|
8973
|
-
const
|
|
8974
|
-
i.has(
|
|
9105
|
+
const c = a.value;
|
|
9106
|
+
i.has(c) || i.set(c, /* @__PURE__ */ new Set()), i.get(c).add(r);
|
|
8975
9107
|
}
|
|
8976
9108
|
}
|
|
8977
9109
|
cleanUp() {
|
|
@@ -8979,16 +9111,16 @@ class Vr extends it {
|
|
|
8979
9111
|
}
|
|
8980
9112
|
}
|
|
8981
9113
|
I(Vr, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
|
|
8982
|
-
const
|
|
9114
|
+
const ys = class ys extends it {
|
|
8983
9115
|
constructor(t) {
|
|
8984
9116
|
super(t);
|
|
8985
|
-
I(this, "onGeometryStreamed", new
|
|
8986
|
-
I(this, "onAssetStreamed", new
|
|
8987
|
-
I(this, "onProgress", new
|
|
8988
|
-
I(this, "onIfcLoaded", new
|
|
9117
|
+
I(this, "onGeometryStreamed", new U());
|
|
9118
|
+
I(this, "onAssetStreamed", new U());
|
|
9119
|
+
I(this, "onProgress", new U());
|
|
9120
|
+
I(this, "onIfcLoaded", new U());
|
|
8989
9121
|
/** {@link Disposable.onDisposed} */
|
|
8990
|
-
I(this, "onDisposed", new
|
|
8991
|
-
I(this, "settings", new
|
|
9122
|
+
I(this, "onDisposed", new U());
|
|
9123
|
+
I(this, "settings", new Yr());
|
|
8992
9124
|
I(this, "enabled", !0);
|
|
8993
9125
|
I(this, "webIfc", new b.IfcAPI());
|
|
8994
9126
|
I(this, "_spatialTree", new wn());
|
|
@@ -9001,7 +9133,7 @@ const Ps = class Ps extends it {
|
|
|
9001
9133
|
I(this, "_groupSerializer", new $t.Serializer());
|
|
9002
9134
|
I(this, "_assets", []);
|
|
9003
9135
|
I(this, "_meshesWithHoles", /* @__PURE__ */ new Set());
|
|
9004
|
-
this.components.add(
|
|
9136
|
+
this.components.add(ys.uuid, this), this.settings.excludedCategories.add(b.IFCOPENINGELEMENT);
|
|
9005
9137
|
}
|
|
9006
9138
|
dispose() {
|
|
9007
9139
|
this.onIfcLoaded.reset(), this.onGeometryStreamed.reset(), this.onAssetStreamed.reset(), this.webIfc = null, this.onDisposed.trigger(), this.onDisposed.reset();
|
|
@@ -9032,17 +9164,19 @@ const Ps = class Ps extends it {
|
|
|
9032
9164
|
schema: this.webIfc.GetModelSchema(0) || "IFC2X3",
|
|
9033
9165
|
maxExpressID: this.webIfc.GetMaxExpressID(0)
|
|
9034
9166
|
};
|
|
9035
|
-
let
|
|
9167
|
+
let c = 0, E = 0;
|
|
9036
9168
|
for (const T of i) {
|
|
9037
9169
|
if (!this.webIfc.IsIfcElement(T) && T !== b.IFCSPACE || this.settings.excludedCategories.has(T))
|
|
9038
9170
|
continue;
|
|
9039
9171
|
const F = this.webIfc.GetLineIDsWithType(0, T), f = F.size();
|
|
9040
9172
|
for (let m = 0; m < f; m++) {
|
|
9041
|
-
|
|
9173
|
+
c > t && (c = 0, E++, o.push([]));
|
|
9042
9174
|
const g = F.get(m);
|
|
9175
|
+
if (g !== 9056429)
|
|
9176
|
+
continue;
|
|
9043
9177
|
o[E].push(g);
|
|
9044
9178
|
const S = this._spatialTree.itemsByFloor[g] || 0;
|
|
9045
|
-
n.data.set(g, [[], [S, T]]),
|
|
9179
|
+
n.data.set(g, [[], [S, T]]), c++;
|
|
9046
9180
|
}
|
|
9047
9181
|
}
|
|
9048
9182
|
this._spatialTree.cleanUp();
|
|
@@ -9074,7 +9208,7 @@ const Ps = class Ps extends it {
|
|
|
9074
9208
|
getMesh(t, e, i) {
|
|
9075
9209
|
const o = e.geometries.size(), n = e.expressID, r = { id: n, geometries: [] };
|
|
9076
9210
|
for (let a = 0; a < o; a++) {
|
|
9077
|
-
const
|
|
9211
|
+
const c = e.geometries.get(a), E = c.geometryExpressID, d = c.color.w === 1 ? 1 : -1, h = E * d;
|
|
9078
9212
|
if (!this._visitedGeometries.has(h)) {
|
|
9079
9213
|
this._visitedGeometries.has(E) || this.getGeometry(t, E);
|
|
9080
9214
|
const m = this._visitedGeometries.size, g = O.MathUtils.generateUUID();
|
|
@@ -9087,7 +9221,7 @@ const Ps = class Ps extends it {
|
|
|
9087
9221
|
if (!p)
|
|
9088
9222
|
throw new Error("Data not found!");
|
|
9089
9223
|
p[0].push(u.index);
|
|
9090
|
-
const { x: R, y: A, z: C, w: T } =
|
|
9224
|
+
const { x: R, y: A, z: C, w: T } = c.color, F = [R, A, C, T], f = c.flatTransformation;
|
|
9091
9225
|
r.geometries.push({ color: F, geometryID: E, transformation: f });
|
|
9092
9226
|
}
|
|
9093
9227
|
this._assets.push(r);
|
|
@@ -9102,11 +9236,11 @@ const Ps = class Ps extends it {
|
|
|
9102
9236
|
), r = new Float32Array(n.length / 2), a = new Float32Array(n.length / 2);
|
|
9103
9237
|
for (let u = 0; u < n.length; u += 6)
|
|
9104
9238
|
r[u / 2] = n[u], r[u / 2 + 1] = n[u + 1], r[u / 2 + 2] = n[u + 2], a[u / 2] = n[u + 3], a[u / 2 + 1] = n[u + 4], a[u / 2 + 2] = n[u + 5];
|
|
9105
|
-
const
|
|
9239
|
+
const c = dr(r), E = new Float32Array(c.transformation.elements), d = [c.center.x, c.center.y, c.center.z];
|
|
9106
9240
|
let h = !1;
|
|
9107
9241
|
for (let u = 0; u < r.length - 2; u += 3) {
|
|
9108
9242
|
const p = r[u], R = r[u + 1], A = r[u + 2], C = a[u], T = a[u + 1], F = a[u + 2];
|
|
9109
|
-
if (
|
|
9243
|
+
if (ur(d, [p, R, A], [C, T, F])) {
|
|
9110
9244
|
h = !0;
|
|
9111
9245
|
break;
|
|
9112
9246
|
}
|
|
@@ -9129,9 +9263,9 @@ const Ps = class Ps extends it {
|
|
|
9129
9263
|
this.onGeometryStreamed.trigger({ data: e, buffer: t }), e = null, t = null, this._geometries.clear(), this._geometryCount = 0;
|
|
9130
9264
|
}
|
|
9131
9265
|
};
|
|
9132
|
-
I(
|
|
9133
|
-
let Rn =
|
|
9134
|
-
class
|
|
9266
|
+
I(ys, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
|
|
9267
|
+
let Rn = ys;
|
|
9268
|
+
class zr {
|
|
9135
9269
|
constructor(s) {
|
|
9136
9270
|
/** {@link NavigationMode.enabled} */
|
|
9137
9271
|
I(this, "enabled", !1);
|
|
@@ -9158,7 +9292,7 @@ class Gr {
|
|
|
9158
9292
|
), s.truckSpeed = 50, s.mouseButtons.wheel = ot.ACTION.DOLLY, s.touches.two = ot.ACTION.TOUCH_ZOOM_TRUCK;
|
|
9159
9293
|
}
|
|
9160
9294
|
}
|
|
9161
|
-
class
|
|
9295
|
+
class Hr {
|
|
9162
9296
|
constructor(s) {
|
|
9163
9297
|
/** {@link NavigationMode.enabled} */
|
|
9164
9298
|
I(this, "enabled", !0);
|
|
@@ -9181,7 +9315,7 @@ class zr {
|
|
|
9181
9315
|
s.moveTo(n.x, n.y, n.z);
|
|
9182
9316
|
}
|
|
9183
9317
|
}
|
|
9184
|
-
class
|
|
9318
|
+
class kr {
|
|
9185
9319
|
constructor(s) {
|
|
9186
9320
|
/** {@link NavigationMode.enabled} */
|
|
9187
9321
|
I(this, "enabled", !1);
|
|
@@ -9201,12 +9335,12 @@ class Hr {
|
|
|
9201
9335
|
t.azimuthRotateSpeed = s ? 0 : this.defaultAzimuthSpeed, t.polarRotateSpeed = s ? 0 : this.defaultPolarSpeed, this.mouseInitialized || (this.mouseAction1 = t.touches.one, this.mouseAction2 = t.touches.two, this.mouseInitialized = !0), s ? (t.mouseButtons.left = ot.ACTION.TRUCK, t.touches.one = ot.ACTION.TOUCH_TRUCK, t.touches.two = ot.ACTION.TOUCH_ZOOM) : (t.mouseButtons.left = ot.ACTION.ROTATE, t.touches.one = this.mouseAction1, t.touches.two = this.mouseAction2);
|
|
9202
9336
|
}
|
|
9203
9337
|
}
|
|
9204
|
-
class
|
|
9338
|
+
class Wr {
|
|
9205
9339
|
constructor(s) {
|
|
9206
9340
|
/**
|
|
9207
9341
|
* Event that fires when the {@link CameraProjection} changes.
|
|
9208
9342
|
*/
|
|
9209
|
-
I(this, "onChanged", new
|
|
9343
|
+
I(this, "onChanged", new U());
|
|
9210
9344
|
I(this, "current", "Perspective");
|
|
9211
9345
|
I(this, "camera");
|
|
9212
9346
|
I(this, "_component");
|
|
@@ -9250,8 +9384,8 @@ class kr {
|
|
|
9250
9384
|
this._component.three.getWorldDirection(t);
|
|
9251
9385
|
const e = new O.Vector3();
|
|
9252
9386
|
this._component.controls.getTarget(e);
|
|
9253
|
-
const o = e.clone().sub(this._component.three.position).dot(t), n = s.renderer.getSize(), r = n.x / n.y, a = this._component.three,
|
|
9254
|
-
return { width:
|
|
9387
|
+
const o = e.clone().sub(this._component.three.position).dot(t), n = s.renderer.getSize(), r = n.x / n.y, a = this._component.three, c = o * 2 * Math.atan(a.fov * (Math.PI / 180) / 2);
|
|
9388
|
+
return { width: c * r, height: c };
|
|
9255
9389
|
}
|
|
9256
9390
|
setupOrthoCamera(s, t) {
|
|
9257
9391
|
this._component.controls.mouseButtons.wheel = ot.ACTION.ZOOM, this._component.controls.mouseButtons.middle = ot.ACTION.ZOOM;
|
|
@@ -9268,7 +9402,7 @@ class kr {
|
|
|
9268
9402
|
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";
|
|
9269
9403
|
}
|
|
9270
9404
|
}
|
|
9271
|
-
class
|
|
9405
|
+
class ta extends We {
|
|
9272
9406
|
constructor(t) {
|
|
9273
9407
|
super(t);
|
|
9274
9408
|
/**
|
|
@@ -9280,7 +9414,7 @@ class Jr extends We {
|
|
|
9280
9414
|
I(this, "_userInputButtons", {});
|
|
9281
9415
|
I(this, "_frustumSize", 50);
|
|
9282
9416
|
I(this, "_navigationModes", /* @__PURE__ */ new Map());
|
|
9283
|
-
this.threeOrtho = this.newOrthoCamera(), this._navigationModes.set("Orbit", new
|
|
9417
|
+
this.threeOrtho = this.newOrthoCamera(), this._navigationModes.set("Orbit", new Hr(this)), this._navigationModes.set("FirstPerson", new zr(this)), this._navigationModes.set("Plan", new kr(this)), this.mode = this._navigationModes.get("Orbit"), this.mode.set(!0, { preventTargetAdjustment: !0 }), this.projection = new Wr(this), this.onAspectUpdated.add(() => this.setOrthoCameraAspect());
|
|
9284
9418
|
}
|
|
9285
9419
|
get current() {
|
|
9286
9420
|
return this.projection.camera;
|
|
@@ -9316,11 +9450,11 @@ class Jr extends We {
|
|
|
9316
9450
|
const p = new O.Box3().setFromObject(u);
|
|
9317
9451
|
p.min.x < n.x && (n.x = p.min.x), p.min.y < n.y && (n.y = p.min.y), p.min.z < n.z && (n.z = p.min.z), p.max.x > r.x && (r.x = p.max.x), p.max.y > r.y && (r.y = p.max.y), p.max.z > r.z && (r.z = p.max.z);
|
|
9318
9452
|
}
|
|
9319
|
-
const a = new O.Box3(n, r),
|
|
9320
|
-
a.getSize(
|
|
9453
|
+
const a = new O.Box3(n, r), c = new O.Vector3();
|
|
9454
|
+
a.getSize(c);
|
|
9321
9455
|
const E = new O.Vector3();
|
|
9322
9456
|
a.getCenter(E);
|
|
9323
|
-
const d = Math.max(
|
|
9457
|
+
const d = Math.max(c.x, c.y, c.z) * e, h = new O.Sphere(E, d);
|
|
9324
9458
|
await this.controls.fitToSphere(h, !0);
|
|
9325
9459
|
}
|
|
9326
9460
|
/**
|
|
@@ -9355,7 +9489,7 @@ class Jr extends We {
|
|
|
9355
9489
|
this.threeOrtho.left = -this._frustumSize * e / 2, this.threeOrtho.right = this._frustumSize * e / 2, this.threeOrtho.top = this._frustumSize / 2, this.threeOrtho.bottom = -this._frustumSize / 2, this.threeOrtho.updateProjectionMatrix();
|
|
9356
9490
|
}
|
|
9357
9491
|
}
|
|
9358
|
-
class
|
|
9492
|
+
class ea {
|
|
9359
9493
|
static getFace(s, t, e) {
|
|
9360
9494
|
if (!s.geometry.index)
|
|
9361
9495
|
throw new Error("Geometry must be indexed!");
|
|
@@ -9373,19 +9507,19 @@ class ta {
|
|
|
9373
9507
|
}
|
|
9374
9508
|
}
|
|
9375
9509
|
let a = 0;
|
|
9376
|
-
const
|
|
9510
|
+
const c = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
|
|
9377
9511
|
for (const { index: d, edges: h } of r) {
|
|
9378
9512
|
const u = /* @__PURE__ */ new Map();
|
|
9379
9513
|
for (const { id: f } of h)
|
|
9380
|
-
if (
|
|
9381
|
-
const m =
|
|
9514
|
+
if (c.has(f)) {
|
|
9515
|
+
const m = c.get(f);
|
|
9382
9516
|
u.set(f, m);
|
|
9383
9517
|
}
|
|
9384
9518
|
const p = h.map((f) => f.id);
|
|
9385
9519
|
if (!u.size) {
|
|
9386
9520
|
const f = a++;
|
|
9387
9521
|
for (const { id: m } of h)
|
|
9388
|
-
|
|
9522
|
+
c.set(m, f);
|
|
9389
9523
|
E.set(f, {
|
|
9390
9524
|
edges: new Set(p),
|
|
9391
9525
|
indices: /* @__PURE__ */ new Set([d])
|
|
@@ -9395,7 +9529,7 @@ class ta {
|
|
|
9395
9529
|
let R = null;
|
|
9396
9530
|
const A = /* @__PURE__ */ new Set(), C = new Set(p);
|
|
9397
9531
|
for (const [f, m] of u) {
|
|
9398
|
-
R === null ? R = m : m !== R && A.add(m),
|
|
9532
|
+
R === null ? R = m : m !== R && A.add(m), c.delete(f);
|
|
9399
9533
|
const { edges: g } = E.get(m);
|
|
9400
9534
|
g.delete(f), C.delete(f);
|
|
9401
9535
|
}
|
|
@@ -9404,16 +9538,16 @@ class ta {
|
|
|
9404
9538
|
const T = E.get(R), { indices: F } = T;
|
|
9405
9539
|
F.add(d);
|
|
9406
9540
|
for (const f of C) {
|
|
9407
|
-
|
|
9541
|
+
c.set(f, R);
|
|
9408
9542
|
const { edges: m } = T;
|
|
9409
9543
|
m.add(f);
|
|
9410
9544
|
}
|
|
9411
9545
|
for (const f of A) {
|
|
9412
|
-
const m = E.get(f), { edges: g, indices: S } = m, _ = E.get(R), { edges: N, indices:
|
|
9546
|
+
const m = E.get(f), { edges: g, indices: S } = m, _ = E.get(R), { edges: N, indices: L } = _;
|
|
9413
9547
|
for (const w of g)
|
|
9414
|
-
N.add(w),
|
|
9548
|
+
N.add(w), c.set(w, R);
|
|
9415
9549
|
for (const w of S)
|
|
9416
|
-
|
|
9550
|
+
L.add(w);
|
|
9417
9551
|
E.delete(f);
|
|
9418
9552
|
}
|
|
9419
9553
|
}
|
|
@@ -9435,17 +9569,17 @@ class ta {
|
|
|
9435
9569
|
static getFaceData(s, t, e) {
|
|
9436
9570
|
const i = this.getVerticesAndNormal(e, s, t), { p1: o, p2: n, p3: r, faceNormal: a } = i;
|
|
9437
9571
|
this.round(o), this.round(n), this.round(r), this.round(a);
|
|
9438
|
-
const
|
|
9572
|
+
const c = [
|
|
9439
9573
|
{ id: `${o.x}|${o.y}|${o.z}`, value: o },
|
|
9440
9574
|
{ id: `${n.x}|${n.y}|${n.z}`, value: n },
|
|
9441
9575
|
{ id: `${r.x}|${r.y}|${r.z}`, value: r }
|
|
9442
9576
|
];
|
|
9443
|
-
|
|
9577
|
+
c.sort((T, F) => T.id < F.id ? -1 : T.id > F.id ? 1 : 0);
|
|
9444
9578
|
const [
|
|
9445
9579
|
{ id: E, value: d },
|
|
9446
9580
|
{ id: h, value: u },
|
|
9447
9581
|
{ id: p, value: R }
|
|
9448
|
-
] =
|
|
9582
|
+
] = c, A = [
|
|
9449
9583
|
{
|
|
9450
9584
|
id: `${E}|${h}`,
|
|
9451
9585
|
distance: d.distanceTo(u),
|
|
@@ -9467,7 +9601,7 @@ class ta {
|
|
|
9467
9601
|
static getVerticesAndNormal(s, t, e) {
|
|
9468
9602
|
if (!s.geometry.index)
|
|
9469
9603
|
throw new Error("Geometry must be indexed!");
|
|
9470
|
-
const i = s.geometry.index.array, o = s.geometry.attributes.position.array, n = s.geometry.attributes.normal.array, r = i[t * 3] * 3, a = i[t * 3 + 1] * 3,
|
|
9604
|
+
const i = s.geometry.index.array, o = s.geometry.attributes.position.array, n = s.geometry.attributes.normal.array, r = i[t * 3] * 3, a = i[t * 3 + 1] * 3, c = i[t * 3 + 2] * 3, E = new O.Vector3(o[r], o[r + 1], o[r + 2]), d = new O.Vector3(o[a], o[a + 1], o[a + 2]), h = new O.Vector3(o[c], o[c + 1], o[c + 2]), u = new O.Vector3(n[r], n[r + 1], n[r + 2]), p = new O.Vector3(n[a], n[a + 1], n[a + 2]), R = new O.Vector3(n[c], n[c + 1], n[c + 2]), A = (u.x + p.x + R.x) / 3, C = (u.y + p.y + R.y) / 3, T = (u.z + p.z + R.z) / 3, F = new O.Vector3(A, C, T);
|
|
9471
9605
|
if (!F.x && !F.y && !F.z && console.log("hey"), e !== void 0 && s instanceof O.InstancedMesh) {
|
|
9472
9606
|
const f = new O.Matrix4();
|
|
9473
9607
|
s.getMatrixAt(e, f);
|
|
@@ -9481,19 +9615,20 @@ class ta {
|
|
|
9481
9615
|
}
|
|
9482
9616
|
}
|
|
9483
9617
|
export {
|
|
9618
|
+
tr as AsyncEvent,
|
|
9484
9619
|
Ri as Base,
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9620
|
+
er as BaseCamera,
|
|
9621
|
+
sr as BaseRenderer,
|
|
9622
|
+
ir as BaseScene,
|
|
9488
9623
|
Ai as BaseWorldItem,
|
|
9489
9624
|
un as Clipper,
|
|
9490
9625
|
it as Component,
|
|
9491
9626
|
Ei as Components,
|
|
9492
|
-
|
|
9627
|
+
Ur as CullerRenderer,
|
|
9493
9628
|
ui as Cullers,
|
|
9494
9629
|
zt as Disposer,
|
|
9495
|
-
|
|
9496
|
-
|
|
9630
|
+
U as Event,
|
|
9631
|
+
zr as FirstPersonMode,
|
|
9497
9632
|
fn as FragmentBoundingBox,
|
|
9498
9633
|
fi as FragmentClassifier,
|
|
9499
9634
|
Tn as FragmentExploder,
|
|
@@ -9502,35 +9637,35 @@ export {
|
|
|
9502
9637
|
Rn as FragmentIfcStreamConverter,
|
|
9503
9638
|
dt as FragmentManager,
|
|
9504
9639
|
Vr as FragmentPropsStreamConverter,
|
|
9505
|
-
|
|
9506
|
-
|
|
9640
|
+
Fr as Grids,
|
|
9641
|
+
Kr as IfcCategories,
|
|
9507
9642
|
Mn as IfcCategoryMap,
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
pn as IfcPropertiesIndexer,
|
|
9643
|
+
vr as IfcElements,
|
|
9644
|
+
br as IfcJsonExporter,
|
|
9645
|
+
Jr as IfcPropertiesFinder,
|
|
9512
9646
|
Cn as IfcPropertiesManager,
|
|
9513
9647
|
Ft as IfcPropertiesUtils,
|
|
9514
|
-
|
|
9648
|
+
pn as IfcRelationsIndexer,
|
|
9649
|
+
Yr as IfcStreamingSettings,
|
|
9515
9650
|
In as Materials,
|
|
9516
9651
|
qi as MaterialsUtils,
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9652
|
+
ea as MeasurementUtils,
|
|
9653
|
+
xr as MeshCullerRenderer,
|
|
9654
|
+
Hr as OrbitMode,
|
|
9655
|
+
ta as OrthoPerspectiveCamera,
|
|
9656
|
+
kr as PlanMode,
|
|
9657
|
+
Wr as ProjectionManager,
|
|
9658
|
+
Gr as PropertiesStreamingSettings,
|
|
9524
9659
|
ke as Raycasters,
|
|
9525
9660
|
We as SimpleCamera,
|
|
9526
9661
|
Fi as SimplePlane,
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9662
|
+
$r as SimpleRenderer,
|
|
9663
|
+
qr as SimpleScene,
|
|
9664
|
+
pr as SimpleWorld,
|
|
9530
9665
|
He as UUID,
|
|
9531
|
-
|
|
9666
|
+
jr as VertexPicker,
|
|
9532
9667
|
di as Worlds,
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9668
|
+
ur as isPointInFrontOfPlane,
|
|
9669
|
+
dr as obbFromPoints,
|
|
9670
|
+
Dr as readPixelsAsync
|
|
9536
9671
|
};
|