@thatopen/components 2.0.0-alpha.4 → 2.0.0-alpha.6
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/fragments/FragmentBoundingBox/index.d.ts +2 -2
- package/dist/fragments/FragmentClassifier/index.d.ts +1 -1
- package/dist/fragments/FragmentHider/index.d.ts +1 -1
- package/dist/fragments/FragmentIfcLoader/index.d.ts +1 -1
- package/dist/fragments/FragmentIfcLoader/src/civil-reader.d.ts +1 -1
- package/dist/fragments/FragmentManager/index.d.ts +1 -1
- package/dist/ifc/IfcJsonExporter/index.d.ts +1 -1
- package/dist/ifc/IfcPropertiesFinder/index.d.ts +2 -2
- package/dist/ifc/IfcPropertiesIndexer/index.d.ts +20 -66
- package/dist/ifc/IfcPropertiesManager/index.d.ts +2 -2
- package/dist/ifc/Utils/properties-utils.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +1051 -1089
- package/dist/namespace.d.ts +978 -988
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
1
|
var vn = Object.defineProperty;
|
|
2
|
-
var Bn = (
|
|
3
|
-
var I = (
|
|
2
|
+
var Bn = (c, s, t) => s in c ? vn(c, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[s] = t;
|
|
3
|
+
var I = (c, s, t) => (Bn(c, 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 Lt, Triangle as ue, Sphere as Yn, Matrix4 as Mt, Box3 as Ot, BackSide as Vn, DoubleSide as Fn, FrontSide as _i, Mesh as v, Ray as Gn, Raycaster as zn, Quaternion as yt, Object3D as ei, Euler as Hn, MeshBasicMaterial as gn, LineBasicMaterial as kn, CylinderGeometry as ct, BoxGeometry as rt, BufferGeometry as Ni, Float32BufferAttribute as Pi, 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
|
-
import * as $t from "
|
|
8
|
-
import { Serializer as Zn } from "
|
|
9
|
-
const On = 0, Qn = 1, jn = 2,
|
|
10
|
-
function $n(
|
|
11
|
-
return
|
|
12
|
-
}
|
|
13
|
-
function pe(
|
|
14
|
-
return $n(
|
|
15
|
-
}
|
|
16
|
-
function Kn(
|
|
17
|
-
return
|
|
18
|
-
}
|
|
19
|
-
function Jn(
|
|
20
|
-
if (!
|
|
21
|
-
const t =
|
|
22
|
-
|
|
7
|
+
import * as $t from "@thatopen/fragments";
|
|
8
|
+
import { Serializer as Zn } from "@thatopen/fragments";
|
|
9
|
+
const On = 0, Qn = 1, jn = 2, yi = 2, Us = 1.25, Li = 1, Ts = 6 * 4 + 4 + 4, ys = 65535, qn = Math.pow(2, -24), xs = Symbol("SKIP_GENERATION");
|
|
10
|
+
function $n(c) {
|
|
11
|
+
return c.index ? c.index.count : c.attributes.position.count;
|
|
12
|
+
}
|
|
13
|
+
function pe(c) {
|
|
14
|
+
return $n(c) / 3;
|
|
15
|
+
}
|
|
16
|
+
function Kn(c, s = ArrayBuffer) {
|
|
17
|
+
return c > 65535 ? new Uint32Array(new s(4 * c)) : new Uint16Array(new s(2 * c));
|
|
18
|
+
}
|
|
19
|
+
function Jn(c, s) {
|
|
20
|
+
if (!c.index) {
|
|
21
|
+
const t = c.attributes.position.count, e = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, i = Kn(t, e);
|
|
22
|
+
c.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(c) {
|
|
28
|
+
const s = pe(c), t = c.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(c) {
|
|
35
|
+
if (!c.groups || !c.groups.length)
|
|
36
|
+
return Sn(c);
|
|
37
|
+
const s = [], t = /* @__PURE__ */ new Set(), e = c.drawRange, i = e.start / 3, o = (e.start + e.count) / 3;
|
|
38
|
+
for (const r of c.groups) {
|
|
39
|
+
const a = r.start / 3, l = (r.start + r.count) / 3;
|
|
40
|
+
t.add(Math.max(i, a)), t.add(Math.min(o, l));
|
|
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], l = n[r + 1];
|
|
45
45
|
s.push({
|
|
46
46
|
offset: Math.floor(a),
|
|
47
|
-
count: Math.floor(
|
|
47
|
+
count: Math.floor(l - a)
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
return s;
|
|
51
51
|
}
|
|
52
|
-
function to(
|
|
53
|
-
if (
|
|
52
|
+
function to(c) {
|
|
53
|
+
if (c.groups.length === 0)
|
|
54
54
|
return !1;
|
|
55
|
-
const s = pe(
|
|
55
|
+
const s = pe(c), t = _n(c).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 $(c, s, t) {
|
|
61
|
+
return t.min.x = s[c], t.min.y = s[c + 1], t.min.z = s[c + 2], t.max.x = s[c + 3], t.max.y = s[c + 4], t.max.z = s[c + 5], t;
|
|
62
62
|
}
|
|
63
|
-
function eo(
|
|
64
|
-
|
|
63
|
+
function eo(c) {
|
|
64
|
+
c[0] = c[1] = c[2] = 1 / 0, c[3] = c[4] = c[5] = -1 / 0;
|
|
65
65
|
}
|
|
66
|
-
function Mi(
|
|
66
|
+
function Mi(c) {
|
|
67
67
|
let s = -1, t = -1 / 0;
|
|
68
68
|
for (let e = 0; e < 3; e++) {
|
|
69
|
-
const i =
|
|
69
|
+
const i = c[e + 3] - c[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(c, s) {
|
|
75
|
+
s.set(c);
|
|
76
76
|
}
|
|
77
|
-
function Di(
|
|
77
|
+
function Di(c, 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 = c[o], i = s[o], t[o] = e < i ? e : i, e = c[n], i = s[n], t[n] = e > i ? e : i;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
function je(
|
|
84
|
+
function je(c, s, t) {
|
|
85
85
|
for (let e = 0; e < 3; e++) {
|
|
86
|
-
const i = s[
|
|
86
|
+
const i = s[c + 2 * e], o = s[c + 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(c) {
|
|
91
|
+
const s = c[3] - c[0], t = c[4] - c[1], e = c[5] - c[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(c, s, t, e, i = null) {
|
|
95
|
+
let o = 1 / 0, n = 1 / 0, r = 1 / 0, a = -1 / 0, l = -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 = c[T + 0], m = c[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 _ = c[T + 2], N = c[T + 3], y = _ - N, w = _ + N;
|
|
101
|
+
y < n && (n = y), w > l && (l = w), C && _ < h && (h = _), C && _ > R && (R = _);
|
|
102
|
+
const L = c[T + 4], U = c[T + 5], x = L - U, B = L + U;
|
|
103
|
+
x < r && (r = x), B > E && (E = B), C && L < u && (u = L), C && L > A && (A = L);
|
|
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] = l, 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(c, s, t, e) {
|
|
108
|
+
let i = 1 / 0, o = 1 / 0, n = 1 / 0, r = -1 / 0, a = -1 / 0, l = -1 / 0;
|
|
109
109
|
for (let E = s * 6, d = (s + t) * 6; E < d; E += 6) {
|
|
110
|
-
const h =
|
|
110
|
+
const h = c[E + 0];
|
|
111
111
|
h < i && (i = h), h > r && (r = h);
|
|
112
|
-
const u =
|
|
112
|
+
const u = c[E + 2];
|
|
113
113
|
u < o && (o = u), u > a && (a = u);
|
|
114
|
-
const p =
|
|
115
|
-
p < n && (n = p), p >
|
|
114
|
+
const p = c[E + 4];
|
|
115
|
+
p < n && (n = p), p > l && (l = 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] = l;
|
|
118
118
|
}
|
|
119
|
-
function io(
|
|
119
|
+
function io(c, s) {
|
|
120
120
|
eo(s);
|
|
121
|
-
const t =
|
|
122
|
-
let
|
|
123
|
-
t.isInterleavedBufferAttribute && (
|
|
121
|
+
const t = c.attributes.position, e = c.index ? c.index.array : null, i = pe(c), o = new Float32Array(i * 6), n = t.normalized, r = t.array, a = t.offset || 0;
|
|
122
|
+
let l = 3;
|
|
123
|
+
t.isInterleavedBufferAttribute && (l = 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 * l + a, R = R * l + a, A = A * l + 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(l, s) {
|
|
|
139
139
|
}
|
|
140
140
|
return o;
|
|
141
141
|
}
|
|
142
|
-
const wt = 32, no = (
|
|
142
|
+
const wt = 32, no = (c, s) => c.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(c, 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(c), n !== -1 && (r = ro(t, e, i, n));
|
|
155
155
|
else if (o === jn) {
|
|
156
|
-
const a = Re(
|
|
157
|
-
let
|
|
156
|
+
const a = Re(c);
|
|
157
|
+
let l = 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(l, 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 y = 0;
|
|
194
|
+
g !== 0 && (y = Re(_) / a);
|
|
195
195
|
let w = 0;
|
|
196
196
|
S !== 0 && (w = Re(N) / a);
|
|
197
|
-
const
|
|
198
|
-
|
|
197
|
+
const L = Li + Us * (y * g + w * S);
|
|
198
|
+
L < l && (n = h, l = L, r = m.candidate);
|
|
199
199
|
}
|
|
200
200
|
} else {
|
|
201
201
|
for (let F = 0; F < wt; F++) {
|
|
@@ -221,12 +221,12 @@ function oo(l, 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, y = 0;
|
|
225
225
|
T !== 0 && (N = Re(qe) / a);
|
|
226
226
|
const w = i - T;
|
|
227
|
-
w !== 0 && (
|
|
228
|
-
const
|
|
229
|
-
|
|
227
|
+
w !== 0 && (y = Re(_) / a);
|
|
228
|
+
const L = Li + Us * (N * T + y * w);
|
|
229
|
+
L < l && (n = h, l = L, r = f.candidate);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
@@ -234,23 +234,23 @@ function oo(l, 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(c, s, t, e) {
|
|
238
238
|
let i = 0;
|
|
239
239
|
for (let o = s, n = s + t; o < n; o++)
|
|
240
|
-
i +=
|
|
240
|
+
i += c[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(c, s, t, e, i, o) {
|
|
248
248
|
let n = e, r = e + i - 1;
|
|
249
|
-
const a = o.pos,
|
|
249
|
+
const a = o.pos, l = o.axis * 2;
|
|
250
250
|
for (; ; ) {
|
|
251
|
-
for (; n <= r && t[n * 6 +
|
|
251
|
+
for (; n <= r && t[n * 6 + l] < a; )
|
|
252
252
|
n++;
|
|
253
|
-
for (; n <= r && t[r * 6 +
|
|
253
|
+
for (; n <= r && t[r * 6 + l] >= a; )
|
|
254
254
|
r--;
|
|
255
255
|
if (n < r) {
|
|
256
256
|
for (let E = 0; E < 3; E++) {
|
|
@@ -266,17 +266,17 @@ function ao(l, s, t, e, i, o) {
|
|
|
266
266
|
return n;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
function co(
|
|
269
|
+
function co(c, s, t, e, i, o) {
|
|
270
270
|
let n = e, r = e + i - 1;
|
|
271
|
-
const a = o.pos,
|
|
271
|
+
const a = o.pos, l = o.axis * 2;
|
|
272
272
|
for (; ; ) {
|
|
273
|
-
for (; n <= r && t[n * 6 +
|
|
273
|
+
for (; n <= r && t[n * 6 + l] < a; )
|
|
274
274
|
n++;
|
|
275
|
-
for (; n <= r && t[r * 6 +
|
|
275
|
+
for (; n <= r && t[r * 6 + l] >= a; )
|
|
276
276
|
r--;
|
|
277
277
|
if (n < r) {
|
|
278
|
-
let E =
|
|
279
|
-
|
|
278
|
+
let E = c[n];
|
|
279
|
+
c[n] = c[r], c[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(l, s, t, e, i, o) {
|
|
|
286
286
|
return n;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
function lo(
|
|
290
|
-
const t = (
|
|
289
|
+
function lo(c, s) {
|
|
290
|
+
const t = (c.index ? c.index.count : c.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(c, s) {
|
|
296
|
+
const t = c.geometry, e = t.index ? t.index.array : null, i = s.maxDepth, o = s.verbose, n = s.maxLeafTris, r = s.strategy, a = s.onProgress, l = pe(t), E = c._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(l, s) {
|
|
|
306
306
|
}
|
|
307
307
|
return A;
|
|
308
308
|
function T(f) {
|
|
309
|
-
a && a(f /
|
|
309
|
+
a && a(f / l);
|
|
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(l, 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 y = R(E, e, p, m, g, N);
|
|
318
|
+
if (y === m || y === 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(), L = m, U = y - m;
|
|
323
|
+
f.left = w, w.boundingData = new Float32Array(6), bs(p, L, U, w.boundingData, u), F(w, L, U, u, _ + 1);
|
|
324
|
+
const x = new $e(), B = y, H = g - U;
|
|
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(c, s) {
|
|
331
|
+
const t = c.geometry;
|
|
332
|
+
s.indirect && (c._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
|
+
)), c._indirectBuffer || Jn(t, s);
|
|
335
|
+
const e = ho(c, 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 = l(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
|
+
c._roots = r;
|
|
345
345
|
return;
|
|
346
|
-
function
|
|
347
|
-
return d.count ? 1 : 1 +
|
|
346
|
+
function l(d) {
|
|
347
|
+
return d.count ? 1 : 1 + l(d.left) + l(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(l, 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] = ys, 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 c = 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 l = 0; l <= 1; l++)
|
|
396
396
|
for (let E = 0; E <= 1; E++) {
|
|
397
|
-
|
|
398
|
-
const d = t.dot(
|
|
397
|
+
c.x = i.x * a + o.x * (1 - a), c.y = i.y * l + o.y * (1 - l), c.z = i.z * E + o.z * (1 - E);
|
|
398
|
+
const d = t.dot(c);
|
|
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 c = 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 = c, l = o.start, E = s;
|
|
408
|
+
t.subVectors(r, l), c.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 c = 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, c);
|
|
417
|
+
let a = c.x, l = c.y;
|
|
418
|
+
if (a >= 0 && a <= 1 && l >= 0 && l <= 1) {
|
|
419
|
+
i.at(a, n), o.at(l, r);
|
|
420
420
|
return;
|
|
421
421
|
} else if (a >= 0 && a <= 1) {
|
|
422
|
-
|
|
422
|
+
l < 0 ? o.at(0, r) : o.at(1, r), i.closestPointToPoint(r, !0, n);
|
|
423
423
|
return;
|
|
424
|
-
} else if (
|
|
424
|
+
} else if (l >= 0 && l <= 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
|
+
l < 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 c = new M(), s = new M(), t = new pi(), e = new Lt();
|
|
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: l, b: E, c: d } = n;
|
|
446
|
+
if (e.start = l, e.end = E, e.closestPointToPoint(a, !0, c).distanceTo(a) <= r || (e.start = l, e.end = d, e.closestPointToPoint(a, !0, c).distanceTo(a) <= r) || (e.start = E, e.end = d, e.closestPointToPoint(a, !0, c).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(c) {
|
|
458
|
+
return Math.abs(c) < 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 l = o[1], E = n[1];
|
|
471
|
+
l.subVectors(s, t), E.setFromPoints(l, 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 c = new M(), s = new M(), t = new Lt();
|
|
480
480
|
return function(i, o = null, n = null) {
|
|
481
|
-
const { start: r, end: a } = i,
|
|
481
|
+
const { start: r, end: a } = i, l = 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(l[h]), t.end.copy(l[u]), Ci(t, i, c, s), E = c.distanceToSquared(s), E < d && (d = E, o && o.copy(c), n && n.copy(s));
|
|
486
486
|
}
|
|
487
|
-
return this.closestPointToPoint(r,
|
|
487
|
+
return this.closestPointToPoint(r, c), E = r.distanceToSquared(c), E < d && (d = E, o && o.copy(c), n && n.copy(r)), this.closestPointToPoint(a, c), E = a.distanceToSquared(c), E < d && (d = E, o && o.copy(c), n && n.copy(a)), Math.sqrt(d);
|
|
488
488
|
};
|
|
489
489
|
}();
|
|
490
490
|
gt.prototype.intersectsTriangle = function() {
|
|
491
|
-
const
|
|
491
|
+
const c = 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(), l = new M(), E = new Lt(), d = new Lt(), h = new Lt(), 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() : (c.copy(A), c.update(), A = c);
|
|
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 y = m[N], w = g[N];
|
|
525
|
+
if (e.setFromPoints(w, t), y.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 y = S[N], w = _[N];
|
|
532
|
+
if (e.setFromPoints(w, s), y.isSeparated(e))
|
|
533
533
|
return !1;
|
|
534
534
|
}
|
|
535
535
|
for (let N = 0; N < 4; N++) {
|
|
536
|
-
const
|
|
536
|
+
const y = g[N];
|
|
537
537
|
for (let w = 0; w < 4; w++) {
|
|
538
|
-
const
|
|
539
|
-
if (o.crossVectors(
|
|
538
|
+
const L = _[w];
|
|
539
|
+
if (o.crossVectors(y, L), e.setFromPoints(o, s), i.setFromPoints(o, t), e.isSeparated(i))
|
|
540
540
|
return !1;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
@@ -556,39 +556,39 @@ gt.prototype.intersectsTriangle = function() {
|
|
|
556
556
|
let U = h.start;
|
|
557
557
|
h.start = h.end, h.end = U;
|
|
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), y = h.end.dot(r), w = _ < N, L = S < y;
|
|
560
|
+
return S !== y && N !== _ && w === L ? !1 : (C && (l.subVectors(d.start, h.start), l.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(h.start), l.subVectors(d.end, h.end), l.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 c = new M();
|
|
566
566
|
return function(t) {
|
|
567
|
-
return this.closestPointToPoint(t,
|
|
567
|
+
return this.closestPointToPoint(t, c), t.distanceTo(c);
|
|
568
568
|
};
|
|
569
569
|
}();
|
|
570
570
|
gt.prototype.distanceToTriangle = function() {
|
|
571
|
-
const
|
|
571
|
+
const c = new M(), s = new M(), t = ["a", "b", "c"], e = new Lt(), i = new Lt();
|
|
572
572
|
return function(n, r = null, a = null) {
|
|
573
|
-
const
|
|
574
|
-
if (this.intersectsTriangle(n,
|
|
575
|
-
return (r || a) && (r &&
|
|
573
|
+
const l = r || a ? e : null;
|
|
574
|
+
if (this.intersectsTriangle(n, l))
|
|
575
|
+
return (r || a) && (r && l.getCenter(r), a && l.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, c), h = p.distanceToSquared(c), h < E && (E = h, r && r.copy(c), a && a.copy(p));
|
|
581
581
|
const R = this[u];
|
|
582
|
-
n.closestPointToPoint(R,
|
|
582
|
+
n.closestPointToPoint(R, c), h = R.distanceToSquared(c), h < E && (E = h, r && r.copy(R), a && a.copy(c));
|
|
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, c, s);
|
|
590
|
+
const C = c.distanceToSquared(s);
|
|
591
|
+
C < E && (E = C, r && r.copy(c), 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 l = 0; l <= 1; l++)
|
|
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 * l | 2 * E | 4 * d, u = i[h];
|
|
615
|
+
u.x = l ? 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 l = 0; l < 3; l++) {
|
|
619
|
+
const E = n[l], d = o[l], h = 1 << l, 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 c = 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 (c.min = e.x, c.max = i.x, r[0].isSeparated(c) || (c.min = e.y, c.max = i.y, r[1].isSeparated(c)) || (c.min = e.z, c.max = i.z, r[2].isSeparated(c)))
|
|
632
632
|
return !1;
|
|
633
633
|
for (let a = 0; a < 3; a++) {
|
|
634
|
-
const
|
|
635
|
-
if (
|
|
634
|
+
const l = n[a], E = o[a];
|
|
635
|
+
if (c.setFromBox(l, t), E.isSeparated(c))
|
|
636
636
|
return !1;
|
|
637
637
|
}
|
|
638
638
|
return !0;
|
|
639
639
|
};
|
|
640
640
|
}();
|
|
641
641
|
at.prototype.intersectsTriangle = function() {
|
|
642
|
-
const
|
|
642
|
+
const c = 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() : (c.copy(n), c.update(), n = c);
|
|
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 l = n.satBounds, E = n.satAxes, d = this.points;
|
|
653
653
|
for (let h = 0; h < 3; h++) {
|
|
654
|
-
const u =
|
|
654
|
+
const u = l[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 c = new M();
|
|
676
676
|
return function(t) {
|
|
677
|
-
return this.closestPointToPoint(t,
|
|
677
|
+
return this.closestPointToPoint(t, c), t.distanceTo(c);
|
|
678
678
|
};
|
|
679
679
|
}();
|
|
680
680
|
at.prototype.distanceToBox = function() {
|
|
681
|
-
const
|
|
682
|
-
return function(n, r = 0, a = null,
|
|
681
|
+
const c = ["x", "y", "z"], s = new Array(12).fill().map(() => new Lt()), t = new Array(12).fill().map(() => new Lt()), e = new M(), i = new M();
|
|
682
|
+
return function(n, r = 0, a = null, l = null) {
|
|
683
683
|
if (this.needsUpdate && this.update(), this.intersectsBox(n))
|
|
684
|
-
return (a ||
|
|
684
|
+
return (a || l) && (n.getCenter(i), this.closestPointToPoint(i, e), n.closestPointToPoint(e, i), a && a.copy(e), l && l.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), l && l.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 y = c[A], w = c[F], L = c[f], U = t[R], x = U.start, B = U.end;
|
|
701
|
+
x[y] = d[y], x[w] = C ? d[w] : h[w], x[L] = T ? d[L] : h[w], B[y] = h[y], B[w] = C ? d[w] : h[w], B[L] = T ? d[L] : 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), l && l.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), l && l.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(c, s) {
|
|
743
|
+
return s[c + 15] === 65535;
|
|
744
744
|
}
|
|
745
|
-
function Et(
|
|
746
|
-
return s[
|
|
745
|
+
function Et(c, s) {
|
|
746
|
+
return s[c + 6];
|
|
747
747
|
}
|
|
748
|
-
function ft(
|
|
749
|
-
return s[
|
|
748
|
+
function ft(c, s) {
|
|
749
|
+
return s[c + 14];
|
|
750
750
|
}
|
|
751
|
-
function pt(
|
|
752
|
-
return
|
|
751
|
+
function pt(c) {
|
|
752
|
+
return c + 8;
|
|
753
753
|
}
|
|
754
|
-
function Ct(
|
|
755
|
-
return s[
|
|
754
|
+
function Ct(c, s) {
|
|
755
|
+
return s[c + 6];
|
|
756
756
|
}
|
|
757
|
-
function Nn(
|
|
758
|
-
return s[
|
|
757
|
+
function Nn(c, s) {
|
|
758
|
+
return s[c + 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 Vt, 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(c, s, t, e, i, o) {
|
|
776
|
+
Vt = Ke.getPrimitive(), Ie = Ke.getPrimitive(), Jt.push(Vt, Ie), Z.setBuffer(c._roots[s]);
|
|
777
|
+
const n = si(0, c.geometry, t, e, i, o);
|
|
778
|
+
Z.clearBuffer(), Ke.releasePrimitive(Vt), 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], Vt = Jt[r - 2]), n;
|
|
781
781
|
}
|
|
782
|
-
function si(
|
|
783
|
-
const { float32Array: r, uint16Array: a, uint32Array:
|
|
784
|
-
let E =
|
|
782
|
+
function si(c, s, t, e, i = null, o = 0, n = 0) {
|
|
783
|
+
const { float32Array: r, uint16Array: a, uint32Array: l } = Z;
|
|
784
|
+
let E = c * 2;
|
|
785
785
|
if (ht(E, a)) {
|
|
786
|
-
const h = Et(
|
|
787
|
-
return $(
|
|
786
|
+
const h = Et(c, l), u = ft(E, a);
|
|
787
|
+
return $(c, r, Vt), e(h, u, !1, n, o + c, Vt);
|
|
788
788
|
} else {
|
|
789
|
-
let
|
|
789
|
+
let y = function(L) {
|
|
790
790
|
const { uint16Array: U, uint32Array: x } = Z;
|
|
791
|
-
let B =
|
|
791
|
+
let B = L * 2;
|
|
792
792
|
for (; !ht(B, U); )
|
|
793
|
-
|
|
794
|
-
return Et(
|
|
795
|
-
}, w = function(
|
|
793
|
+
L = pt(L), B = L * 2;
|
|
794
|
+
return Et(L, x);
|
|
795
|
+
}, w = function(L) {
|
|
796
796
|
const { uint16Array: U, uint32Array: x } = Z;
|
|
797
|
-
let B =
|
|
797
|
+
let B = L * 2;
|
|
798
798
|
for (; !ht(B, U); )
|
|
799
|
-
|
|
800
|
-
return Et(
|
|
799
|
+
L = Ct(L, x), B = L * 2;
|
|
800
|
+
return Et(L, x) + ft(B, U);
|
|
801
801
|
};
|
|
802
|
-
const h = pt(
|
|
802
|
+
const h = pt(c), u = Ct(c, l);
|
|
803
803
|
let p = h, R = u, A, C, T, F;
|
|
804
|
-
if (i && (T =
|
|
804
|
+
if (i && (T = Vt, 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 L = A;
|
|
807
|
+
A = C, C = L, T = F;
|
|
808
808
|
}
|
|
809
|
-
T || (T =
|
|
809
|
+
T || (T = Vt, $(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 === yi) {
|
|
813
|
+
const L = y(p), x = w(p) - L;
|
|
814
|
+
g = e(L, x, !0, n + 1, o + p, T);
|
|
815
815
|
} else
|
|
816
816
|
g = m && si(
|
|
817
817
|
p,
|
|
@@ -827,9 +827,9 @@ function si(l, 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 (_ === yi) {
|
|
831
|
+
const L = y(R), x = w(R) - L;
|
|
832
|
+
N = e(L, x, !0, n + 1, o + R, F);
|
|
833
833
|
} else
|
|
834
834
|
N = _ && si(
|
|
835
835
|
R,
|
|
@@ -844,10 +844,10 @@ function si(l, 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(c, 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 (c.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(l, 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 l = Math.sqrt(r);
|
|
863
|
+
return t.point ? t.point.copy(Bs) : t.point = Bs.clone(), t.distance = l, 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(c, s, t, e, i, o) {
|
|
867
867
|
let n;
|
|
868
|
-
return o ===
|
|
869
|
-
distance:
|
|
868
|
+
return o === Vn ? n = c.intersectTriangle(e, t, s, !0, i) : n = c.intersectTriangle(s, t, e, o !== Fn, i), n === null ? null : {
|
|
869
|
+
distance: c.origin.distanceTo(i),
|
|
870
870
|
point: i.clone()
|
|
871
871
|
};
|
|
872
872
|
}
|
|
873
|
-
function Ao(
|
|
873
|
+
function Ao(c, 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 l = Ro(c, te, ee, se, ss, a);
|
|
876
|
+
if (l) {
|
|
877
|
+
e && (Je.fromBufferAttribute(e, o), ts.fromBufferAttribute(e, n), es.fromBufferAttribute(e, r), l.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), l.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), l.normal = ue.getInterpolation(ss, te, ee, se, Ui, xi, bi, new M()), l.normal.dot(c.direction) > 0 && l.normal.multiplyScalar(-1));
|
|
878
878
|
const E = {
|
|
879
879
|
a: o,
|
|
880
880
|
b: n,
|
|
@@ -882,62 +882,62 @@ function Ao(l, 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), l.face = E, l.faceIndex = o;
|
|
886
886
|
}
|
|
887
|
-
return
|
|
887
|
+
return l;
|
|
888
888
|
}
|
|
889
|
-
function
|
|
889
|
+
function Ls(c, 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 l = c.index;
|
|
893
|
+
c.index && (n = l.getX(n), r = l.getX(r), a = l.getX(a));
|
|
894
|
+
const { position: E, normal: d, uv: h, uv1: u } = c.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(c, s, t, e) {
|
|
898
|
+
const i = c.a, o = c.b, n = c.c;
|
|
899
|
+
let r = s, a = s + 1, l = s + 2;
|
|
900
|
+
t && (r = t.getX(r), a = t.getX(a), l = t.getX(l)), 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(l), n.y = e.getY(l), n.z = e.getZ(l);
|
|
901
901
|
}
|
|
902
|
-
function Fo(
|
|
903
|
-
const { geometry: n, _indirectBuffer: r } =
|
|
904
|
-
for (let a = e,
|
|
905
|
-
|
|
902
|
+
function Fo(c, s, t, e, i, o) {
|
|
903
|
+
const { geometry: n, _indirectBuffer: r } = c;
|
|
904
|
+
for (let a = e, l = e + i; a < l; a++)
|
|
905
|
+
Ls(n, s, t, a, o);
|
|
906
906
|
}
|
|
907
|
-
function go(
|
|
908
|
-
const { geometry: o, _indirectBuffer: n } =
|
|
907
|
+
function go(c, s, t, e, i) {
|
|
908
|
+
const { geometry: o, _indirectBuffer: n } = c;
|
|
909
909
|
let r = 1 / 0, a = null;
|
|
910
|
-
for (let
|
|
910
|
+
for (let l = e, E = e + i; l < E; l++) {
|
|
911
911
|
let d;
|
|
912
|
-
d =
|
|
912
|
+
d = Ls(o, s, t, l), 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(c, s, t, e, i, o, n) {
|
|
917
|
+
const { geometry: r } = t, { index: a } = r, l = r.attributes.position;
|
|
918
|
+
for (let E = c, d = s + c; 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, l), 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(c, 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 = c.geometry, e = t.index ? t.index.array : null, i = t.attributes.position;
|
|
928
|
+
let o, n, r, a, l = 0;
|
|
929
|
+
const E = c._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, l), l += 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] === ys) {
|
|
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, y = 3 * (C + T); N < y; N++) {
|
|
938
938
|
let w = e[N];
|
|
939
|
-
const
|
|
940
|
-
|
|
939
|
+
const L = i.getX(w), U = i.getY(w), x = i.getZ(w);
|
|
940
|
+
L < F && (F = L), L > g && (g = L), U < f && (f = U), U > S && (S = U), 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(l, 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 y = !1;
|
|
949
|
+
_ && (y = d(C, u, m));
|
|
950
950
|
let w = !1;
|
|
951
951
|
N && (w = d(T, u, m));
|
|
952
|
-
const
|
|
953
|
-
if (
|
|
952
|
+
const L = y || w;
|
|
953
|
+
if (L)
|
|
954
954
|
for (let U = 0; U < 3; U++) {
|
|
955
955
|
const x = C + U, B = T + U, H = a[x], q = a[x + 3], et = a[B], Q = a[B + 3];
|
|
956
956
|
a[h + U] = H < et ? H : et, a[h + U + 3] = q > Q ? q : Q;
|
|
957
957
|
}
|
|
958
|
-
return
|
|
958
|
+
return L;
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
961
|
}
|
|
962
962
|
const vi = /* @__PURE__ */ new Ot();
|
|
963
|
-
function
|
|
964
|
-
return $(
|
|
963
|
+
function Gt(c, s, t, e) {
|
|
964
|
+
return $(c, 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(c, s, t, e, i, o) {
|
|
967
|
+
const { geometry: n, _indirectBuffer: r } = c;
|
|
968
|
+
for (let a = e, l = e + i; a < l; a++) {
|
|
969
969
|
let E = r ? r[a] : a;
|
|
970
|
-
|
|
970
|
+
Ls(n, s, t, E, o);
|
|
971
971
|
}
|
|
972
972
|
}
|
|
973
|
-
function No(
|
|
974
|
-
const { geometry: o, _indirectBuffer: n } =
|
|
973
|
+
function No(c, s, t, e, i) {
|
|
974
|
+
const { geometry: o, _indirectBuffer: n } = c;
|
|
975
975
|
let r = 1 / 0, a = null;
|
|
976
|
-
for (let
|
|
976
|
+
for (let l = e, E = e + i; l < E; l++) {
|
|
977
977
|
let d;
|
|
978
|
-
d =
|
|
978
|
+
d = Ls(o, s, t, n ? n[l] : l), 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 Po(c, s, t, e, i, o, n) {
|
|
983
|
+
const { geometry: r } = t, { index: a } = r, l = r.attributes.position;
|
|
984
|
+
for (let E = c, d = s + c; 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, l), 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 yo(c, s, t, e, i) {
|
|
993
|
+
Z.setBuffer(c._roots[s]), ii(0, c, t, e, i), Z.clearBuffer();
|
|
994
994
|
}
|
|
995
|
-
function ii(
|
|
996
|
-
const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a =
|
|
995
|
+
function ii(c, s, t, e, i) {
|
|
996
|
+
const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = c * 2;
|
|
997
997
|
if (ht(a, n)) {
|
|
998
|
-
const E = Et(
|
|
998
|
+
const E = Et(c, 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(c);
|
|
1002
|
+
Gt(E, o, e, Bi) && ii(E, s, t, e, i);
|
|
1003
|
+
const d = Ct(c, r);
|
|
1004
|
+
Gt(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(), Lo = ["x", "y", "z"];
|
|
1008
|
+
function Mo(c, s, t, e) {
|
|
1009
|
+
Z.setBuffer(c._roots[s]);
|
|
1010
|
+
const i = ni(0, c, t, e);
|
|
1011
1011
|
return Z.clearBuffer(), i;
|
|
1012
1012
|
}
|
|
1013
|
-
function ni(
|
|
1013
|
+
function ni(c, s, t, e) {
|
|
1014
1014
|
const { float32Array: i, uint16Array: o, uint32Array: n } = Z;
|
|
1015
|
-
let r =
|
|
1015
|
+
let r = c * 2;
|
|
1016
1016
|
if (ht(r, o)) {
|
|
1017
|
-
const
|
|
1018
|
-
return go(s, t, e,
|
|
1017
|
+
const l = Et(c, n), E = ft(r, o);
|
|
1018
|
+
return go(s, t, e, l, E);
|
|
1019
1019
|
} else {
|
|
1020
|
-
const
|
|
1020
|
+
const l = Nn(c, n), E = Lo[l], h = e.direction[E] >= 0;
|
|
1021
1021
|
let u, p;
|
|
1022
|
-
h ? (u = pt(
|
|
1023
|
-
const A =
|
|
1022
|
+
h ? (u = pt(c), p = Ct(c, n)) : (u = Ct(c, n), p = pt(c));
|
|
1023
|
+
const A = Gt(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 + l] : (
|
|
1027
1027
|
// min bounding data
|
|
1028
|
-
F >= i[p +
|
|
1028
|
+
F >= i[p + l + 3]
|
|
1029
1029
|
))
|
|
1030
1030
|
return A;
|
|
1031
1031
|
}
|
|
1032
|
-
const T =
|
|
1032
|
+
const T = Gt(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(), Vi = /* @__PURE__ */ new at(), ns = /* @__PURE__ */ new at();
|
|
1037
|
+
function wo(c, s, t, e) {
|
|
1038
|
+
Z.setBuffer(c._roots[s]);
|
|
1039
|
+
const i = oi(0, c, t, e);
|
|
1040
1040
|
return Z.clearBuffer(), i;
|
|
1041
1041
|
}
|
|
1042
|
-
function oi(
|
|
1042
|
+
function oi(c, 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 = c * 2;
|
|
1045
|
+
if (i === null && (t.boundingBox || t.computeBoundingBox(), Vi.set(t.boundingBox.min, t.boundingBox.max, e), i = Vi), ht(a, n)) {
|
|
1046
|
+
const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, R = Et(c, r), A = ft(a, n);
|
|
1047
1047
|
if (Fe.copy(e).invert(), t.boundsTree)
|
|
1048
|
-
return $(
|
|
1048
|
+
return $(c, 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(l, s, t, e, i = null) {
|
|
|
1062
1062
|
return !0;
|
|
1063
1063
|
}
|
|
1064
1064
|
} else {
|
|
1065
|
-
const E =
|
|
1065
|
+
const E = c + 8, d = r[c + 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(c, 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 = c.geometry, a = r.attributes.position, l = 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), c.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(l, 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, y) => y < T && y < n,
|
|
1085
1085
|
intersectsRange: (_, N) => {
|
|
1086
|
-
for (let
|
|
1087
|
-
tt(u, 3 *
|
|
1088
|
-
for (let
|
|
1089
|
-
tt(h, 3 *
|
|
1086
|
+
for (let y = _, w = _ + N; y < w; y++) {
|
|
1087
|
+
tt(u, 3 * y, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1088
|
+
for (let L = m, U = m + g; L < U; L++) {
|
|
1089
|
+
tt(h, 3 * L, l, 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 = L, f = y), x < o)
|
|
1092
1092
|
return !0;
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
@@ -1098,10 +1098,10 @@ function vo(l, 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 y = m, w = m + g; y < w; y++) {
|
|
1102
|
+
tt(h, 3 * y, l, a), h.needsUpdate = !0;
|
|
1103
|
+
const L = h.distanceToTriangle(u, p, A);
|
|
1104
|
+
if (L < T && (R.copy(p), C && C.copy(A), T = L, F = y, f = _), L < o)
|
|
1105
1105
|
return !0;
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
@@ -1110,22 +1110,22 @@ function vo(l, 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(c, 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 = c.geometry, e = t.index ? t.index.array : null, i = t.attributes.position;
|
|
1116
|
+
let o, n, r, a, l = 0;
|
|
1117
|
+
const E = c._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, l), l += 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] === ys) {
|
|
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 U = w +
|
|
1125
|
+
for (let N = C, y = C + T; N < y; N++) {
|
|
1126
|
+
const w = 3 * c.resolveTriangleIndex(N);
|
|
1127
|
+
for (let L = 0; L < 3; L++) {
|
|
1128
|
+
let U = w + L;
|
|
1129
1129
|
U = e ? e[U] : U;
|
|
1130
1130
|
const x = i.getX(U), B = i.getY(U), H = i.getZ(U);
|
|
1131
1131
|
x < F && (F = x), x > g && (g = x), B < f && (f = B), B > S && (S = B), H < m && (m = H), H > _ && (_ = H);
|
|
@@ -1137,78 +1137,78 @@ function Bo(l, 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 y = !1;
|
|
1141
|
+
_ && (y = d(C, u, m));
|
|
1142
1142
|
let w = !1;
|
|
1143
1143
|
N && (w = d(T, u, m));
|
|
1144
|
-
const
|
|
1145
|
-
if (
|
|
1144
|
+
const L = y || w;
|
|
1145
|
+
if (L)
|
|
1146
1146
|
for (let U = 0; U < 3; U++) {
|
|
1147
1147
|
const x = C + U, B = T + U, H = a[x], q = a[x + 3], et = a[B], Q = a[B + 3];
|
|
1148
1148
|
a[h + U] = H < et ? H : et, a[h + U + 3] = q > Q ? q : Q;
|
|
1149
1149
|
}
|
|
1150
|
-
return
|
|
1150
|
+
return L;
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
|
-
const
|
|
1155
|
-
function Yo(
|
|
1156
|
-
Z.setBuffer(
|
|
1154
|
+
const Gi = /* @__PURE__ */ new M();
|
|
1155
|
+
function Yo(c, s, t, e, i) {
|
|
1156
|
+
Z.setBuffer(c._roots[s]), ri(0, c, t, e, i), Z.clearBuffer();
|
|
1157
1157
|
}
|
|
1158
|
-
function ri(
|
|
1159
|
-
const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a =
|
|
1158
|
+
function ri(c, s, t, e, i) {
|
|
1159
|
+
const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = c * 2;
|
|
1160
1160
|
if (ht(a, n)) {
|
|
1161
|
-
const E = Et(
|
|
1161
|
+
const E = Et(c, 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(c);
|
|
1165
|
+
Gt(E, o, e, Gi) && ri(E, s, t, e, i);
|
|
1166
|
+
const d = Ct(c, r);
|
|
1167
|
+
Gt(d, o, e, Gi) && 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(), Vo = ["x", "y", "z"];
|
|
1171
|
+
function Go(c, s, t, e) {
|
|
1172
|
+
Z.setBuffer(c._roots[s]);
|
|
1173
|
+
const i = ai(0, c, t, e);
|
|
1174
1174
|
return Z.clearBuffer(), i;
|
|
1175
1175
|
}
|
|
1176
|
-
function ai(
|
|
1176
|
+
function ai(c, s, t, e) {
|
|
1177
1177
|
const { float32Array: i, uint16Array: o, uint32Array: n } = Z;
|
|
1178
|
-
let r =
|
|
1178
|
+
let r = c * 2;
|
|
1179
1179
|
if (ht(r, o)) {
|
|
1180
|
-
const
|
|
1181
|
-
return No(s, t, e,
|
|
1180
|
+
const l = Et(c, n), E = ft(r, o);
|
|
1181
|
+
return No(s, t, e, l, E);
|
|
1182
1182
|
} else {
|
|
1183
|
-
const
|
|
1183
|
+
const l = Nn(c, n), E = Vo[l], h = e.direction[E] >= 0;
|
|
1184
1184
|
let u, p;
|
|
1185
|
-
h ? (u = pt(
|
|
1186
|
-
const A =
|
|
1185
|
+
h ? (u = pt(c), p = Ct(c, n)) : (u = Ct(c, n), p = pt(c));
|
|
1186
|
+
const A = Gt(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 + l] : (
|
|
1190
1190
|
// min bounding data
|
|
1191
|
-
F >= i[p +
|
|
1191
|
+
F >= i[p + l + 3]
|
|
1192
1192
|
))
|
|
1193
1193
|
return A;
|
|
1194
1194
|
}
|
|
1195
|
-
const T =
|
|
1195
|
+
const T = Gt(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(c, s, t, e) {
|
|
1201
|
+
Z.setBuffer(c._roots[s]);
|
|
1202
|
+
const i = ci(0, c, t, e);
|
|
1203
1203
|
return Z.clearBuffer(), i;
|
|
1204
1204
|
}
|
|
1205
|
-
function ci(
|
|
1205
|
+
function ci(c, s, t, e, i = null) {
|
|
1206
1206
|
const { float32Array: o, uint16Array: n, uint32Array: r } = Z;
|
|
1207
|
-
let a =
|
|
1207
|
+
let a = c * 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(c, r), A = ft(a, n);
|
|
1210
1210
|
if (Oe.copy(e).invert(), t.boundsTree)
|
|
1211
|
-
return $(
|
|
1211
|
+
return $(c, 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(l, s, t, e, i = null) {
|
|
|
1226
1226
|
return !0;
|
|
1227
1227
|
}
|
|
1228
1228
|
} else {
|
|
1229
|
-
const E =
|
|
1229
|
+
const E = c + 8, d = r[c + 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(), Vs = /* @__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(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
|
|
1235
|
+
s.boundingBox || s.computeBoundingBox(), Vs.set(s.boundingBox.min, s.boundingBox.max, t), Vs.needsUpdate = !0;
|
|
1236
|
+
const r = c.geometry, a = r.attributes.position, l = 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), c.shapecast(
|
|
1241
1241
|
{
|
|
1242
|
-
boundsTraverseOrder: (m) =>
|
|
1242
|
+
boundsTraverseOrder: (m) => Vs.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, y) => y < T && y < n,
|
|
1250
1250
|
intersectsRange: (_, N) => {
|
|
1251
|
-
for (let
|
|
1252
|
-
const
|
|
1253
|
-
tt(u, 3 *
|
|
1251
|
+
for (let y = _, w = _ + N; y < w; y++) {
|
|
1252
|
+
const L = S.resolveTriangleIndex(y);
|
|
1253
|
+
tt(u, 3 * L, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
|
|
1254
1254
|
for (let U = m, x = m + g; U < x; U++) {
|
|
1255
|
-
const B =
|
|
1256
|
-
tt(h, 3 * B,
|
|
1255
|
+
const B = c.resolveTriangleIndex(U);
|
|
1256
|
+
tt(h, 3 * B, l, 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 = U, f =
|
|
1258
|
+
if (H < T && (R.copy(p), C && C.copy(A), T = H, F = U, f = y), H < o)
|
|
1259
1259
|
return !0;
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
@@ -1265,11 +1265,11 @@ function Zo(l, 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 *
|
|
1268
|
+
for (let y = m, w = m + g; y < w; y++) {
|
|
1269
|
+
const L = c.resolveTriangleIndex(y);
|
|
1270
|
+
tt(h, 3 * L, l, a), h.needsUpdate = !0;
|
|
1271
1271
|
const U = h.distanceToTriangle(u, p, A);
|
|
1272
|
-
if (U < T && (R.copy(p), C && C.copy(A), T = U, F =
|
|
1272
|
+
if (U < T && (R.copy(p), C && C.copy(A), T = U, F = y, f = _), U < o)
|
|
1273
1273
|
return !0;
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
@@ -1281,24 +1281,24 @@ function Zo(l, 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(), Gs = new Ot(), zs = new Ot();
|
|
1285
1285
|
let Hs = !1;
|
|
1286
|
-
function jo(
|
|
1286
|
+
function jo(c, 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 = c._roots, o = s._roots;
|
|
1291
1291
|
let n, r = 0, a = 0;
|
|
1292
|
-
const
|
|
1292
|
+
const l = 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(l);
|
|
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
|
+
l,
|
|
1302
1302
|
e,
|
|
1303
1303
|
r,
|
|
1304
1304
|
a,
|
|
@@ -1312,37 +1312,37 @@ function jo(l, s, t, e) {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
return Hs = !1, n;
|
|
1314
1314
|
}
|
|
1315
|
-
function Tt(
|
|
1315
|
+
function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = 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 = c * 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(c, p),
|
|
1325
|
+
ft(c * 2, R),
|
|
1326
1326
|
a,
|
|
1327
1327
|
n + s,
|
|
1328
1328
|
r,
|
|
1329
|
-
o +
|
|
1329
|
+
o + c
|
|
1330
1330
|
) : S = i(
|
|
1331
|
-
Et(
|
|
1332
|
-
ft(
|
|
1331
|
+
Et(c, p),
|
|
1332
|
+
ft(c * 2, R),
|
|
1333
1333
|
Et(s, C),
|
|
1334
1334
|
ft(s * 2, T),
|
|
1335
1335
|
r,
|
|
1336
|
-
o +
|
|
1336
|
+
o + c,
|
|
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(c), y = Ct(c, p);
|
|
1344
|
+
$(N, u, ae), $(y, u, ce);
|
|
1345
|
+
const w = _.intersectsBox(ae), L = _.intersectsBox(ce);
|
|
1346
1346
|
S = w && Tt(
|
|
1347
1347
|
s,
|
|
1348
1348
|
N,
|
|
@@ -1355,9 +1355,9 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
|
|
|
1355
1355
|
r + 1,
|
|
1356
1356
|
_,
|
|
1357
1357
|
!E
|
|
1358
|
-
) ||
|
|
1358
|
+
) || L && Tt(
|
|
1359
1359
|
s,
|
|
1360
|
-
|
|
1360
|
+
y,
|
|
1361
1361
|
e,
|
|
1362
1362
|
t,
|
|
1363
1363
|
i,
|
|
@@ -1370,11 +1370,11 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = 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, Gs), $(N, A, zs);
|
|
1374
|
+
const y = l.intersectsBox(Gs), w = l.intersectsBox(zs);
|
|
1375
|
+
if (y && w)
|
|
1376
1376
|
S = Tt(
|
|
1377
|
-
|
|
1377
|
+
c,
|
|
1378
1378
|
_,
|
|
1379
1379
|
t,
|
|
1380
1380
|
e,
|
|
@@ -1383,10 +1383,10 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
|
|
|
1383
1383
|
n,
|
|
1384
1384
|
r,
|
|
1385
1385
|
a + 1,
|
|
1386
|
-
|
|
1386
|
+
l,
|
|
1387
1387
|
E
|
|
1388
1388
|
) || Tt(
|
|
1389
|
-
|
|
1389
|
+
c,
|
|
1390
1390
|
N,
|
|
1391
1391
|
t,
|
|
1392
1392
|
e,
|
|
@@ -1395,13 +1395,13 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
|
|
|
1395
1395
|
n,
|
|
1396
1396
|
r,
|
|
1397
1397
|
a + 1,
|
|
1398
|
-
|
|
1398
|
+
l,
|
|
1399
1399
|
E
|
|
1400
1400
|
);
|
|
1401
|
-
else if (
|
|
1401
|
+
else if (y)
|
|
1402
1402
|
if (m)
|
|
1403
1403
|
S = Tt(
|
|
1404
|
-
|
|
1404
|
+
c,
|
|
1405
1405
|
_,
|
|
1406
1406
|
t,
|
|
1407
1407
|
e,
|
|
@@ -1410,15 +1410,15 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
|
|
|
1410
1410
|
n,
|
|
1411
1411
|
r,
|
|
1412
1412
|
a + 1,
|
|
1413
|
-
|
|
1413
|
+
l,
|
|
1414
1414
|
E
|
|
1415
1415
|
);
|
|
1416
1416
|
else {
|
|
1417
|
-
const
|
|
1418
|
-
|
|
1419
|
-
const U = pt(
|
|
1417
|
+
const L = Bt.getPrimitive();
|
|
1418
|
+
L.copy(Gs).applyMatrix4(t);
|
|
1419
|
+
const U = pt(c), x = Ct(c, p);
|
|
1420
1420
|
$(U, u, ae), $(x, u, ce);
|
|
1421
|
-
const B =
|
|
1421
|
+
const B = L.intersectsBox(ae), H = L.intersectsBox(ce);
|
|
1422
1422
|
S = B && Tt(
|
|
1423
1423
|
_,
|
|
1424
1424
|
U,
|
|
@@ -1429,7 +1429,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
|
|
|
1429
1429
|
o,
|
|
1430
1430
|
a,
|
|
1431
1431
|
r + 1,
|
|
1432
|
-
|
|
1432
|
+
L,
|
|
1433
1433
|
!E
|
|
1434
1434
|
) || H && Tt(
|
|
1435
1435
|
_,
|
|
@@ -1441,14 +1441,14 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
|
|
|
1441
1441
|
o,
|
|
1442
1442
|
a,
|
|
1443
1443
|
r + 1,
|
|
1444
|
-
|
|
1444
|
+
L,
|
|
1445
1445
|
!E
|
|
1446
|
-
), Bt.releasePrimitive(
|
|
1446
|
+
), Bt.releasePrimitive(L);
|
|
1447
1447
|
}
|
|
1448
1448
|
else if (w)
|
|
1449
1449
|
if (m)
|
|
1450
1450
|
S = Tt(
|
|
1451
|
-
|
|
1451
|
+
c,
|
|
1452
1452
|
N,
|
|
1453
1453
|
t,
|
|
1454
1454
|
e,
|
|
@@ -1457,15 +1457,15 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
|
|
|
1457
1457
|
n,
|
|
1458
1458
|
r,
|
|
1459
1459
|
a + 1,
|
|
1460
|
-
|
|
1460
|
+
l,
|
|
1461
1461
|
E
|
|
1462
1462
|
);
|
|
1463
1463
|
else {
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1466
|
-
const U = pt(
|
|
1464
|
+
const L = Bt.getPrimitive();
|
|
1465
|
+
L.copy(zs).applyMatrix4(t);
|
|
1466
|
+
const U = pt(c), x = Ct(c, p);
|
|
1467
1467
|
$(U, u, ae), $(x, u, ce);
|
|
1468
|
-
const B =
|
|
1468
|
+
const B = L.intersectsBox(ae), H = L.intersectsBox(ce);
|
|
1469
1469
|
S = B && Tt(
|
|
1470
1470
|
N,
|
|
1471
1471
|
U,
|
|
@@ -1476,7 +1476,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
|
|
|
1476
1476
|
o,
|
|
1477
1477
|
a,
|
|
1478
1478
|
r + 1,
|
|
1479
|
-
|
|
1479
|
+
L,
|
|
1480
1480
|
!E
|
|
1481
1481
|
) || H && Tt(
|
|
1482
1482
|
N,
|
|
@@ -1488,9 +1488,9 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
|
|
|
1488
1488
|
o,
|
|
1489
1489
|
a,
|
|
1490
1490
|
r + 1,
|
|
1491
|
-
|
|
1491
|
+
L,
|
|
1492
1492
|
!E
|
|
1493
|
-
), Bt.releasePrimitive(
|
|
1493
|
+
), Bt.releasePrimitive(L);
|
|
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 l = new An(s.index, 1, !1);
|
|
1528
|
+
t.setIndex(l);
|
|
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 l = r * 2, E = o[l + 15] === ys;
|
|
1569
1569
|
if (E) {
|
|
1570
|
-
const d = i[r + 6], h = o[
|
|
1570
|
+
const d = i[r + 6], h = o[l + 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, l = n ? t.side : t, E = this.indirect ? Yo : yo;
|
|
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 : l, 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, l = o ? t.side : t, E = this.indirect ? Go : 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 : l, 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 ? Po : 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, l = 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, l), a)
|
|
1626
1626
|
break;
|
|
1627
|
-
|
|
1627
|
+
l += 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, l = 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, y = R + A; N < y; N++)
|
|
1652
|
+
if (l(N), n.needsUpdate = !0, o(n, E, N, S, F, f, m, g))
|
|
1653
1653
|
return !0;
|
|
1654
1654
|
}
|
|
1655
1655
|
return !1;
|
|
@@ -1707,31 +1707,31 @@ class mi {
|
|
|
1707
1707
|
}), s;
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
|
-
function Wi(
|
|
1711
|
-
return
|
|
1710
|
+
function Wi(c, s, t) {
|
|
1711
|
+
return c === null || (c.point.applyMatrix4(s.matrixWorld), c.distance = c.point.distanceTo(t.ray.origin), c.object = s, c.distance < t.near || c.distance > t.far) ? null : c;
|
|
1712
1712
|
}
|
|
1713
|
-
const ks = /* @__PURE__ */ new
|
|
1714
|
-
function $o(
|
|
1713
|
+
const ks = /* @__PURE__ */ new Gn(), Xi = /* @__PURE__ */ new Mt(), qo = v.prototype.raycast;
|
|
1714
|
+
function $o(c, 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(c.ray).applyMatrix4(Xi);
|
|
1719
1719
|
const t = this.geometry.boundsTree;
|
|
1720
|
-
if (
|
|
1721
|
-
const e = Wi(t.raycastFirst(ks, this.material), this,
|
|
1720
|
+
if (c.firstHitOnly === !0) {
|
|
1721
|
+
const e = Wi(t.raycastFirst(ks, this.material), this, c);
|
|
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, c);
|
|
1727
1727
|
n && s.push(n);
|
|
1728
1728
|
}
|
|
1729
1729
|
}
|
|
1730
1730
|
} else
|
|
1731
|
-
qo.call(this,
|
|
1731
|
+
qo.call(this, c, s);
|
|
1732
1732
|
}
|
|
1733
|
-
function Ko(
|
|
1734
|
-
return this.boundsTree = new mi(this,
|
|
1733
|
+
function Ko(c) {
|
|
1734
|
+
return this.boundsTree = new mi(this, c), this.boundsTree;
|
|
1735
1735
|
}
|
|
1736
1736
|
function Jo() {
|
|
1737
1737
|
this.boundsTree = null;
|
|
@@ -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}. */
|
|
@@ -1793,14 +1822,14 @@ class Ai extends Ri {
|
|
|
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} */
|
|
@@ -1903,7 +1932,7 @@ 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} */
|
|
@@ -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 Lt(), 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], l = a.distanceToPoint(s.origin), E = a.normal.dot(s.direction);
|
|
1991
|
+
if (l > 0 && E >= 0)
|
|
1963
1992
|
return null;
|
|
1964
|
-
const d = E !== 0 ? -
|
|
1993
|
+
const d = E !== 0 ? -l / 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 l = 0; l < 3; l++)
|
|
2067
|
+
a.getComponent(l) < s.getComponent(l) && (s.setComponent(l, a.getComponent(l)), e[l] = r);
|
|
2068
|
+
for (let l = 0; l < 3; l++)
|
|
2069
|
+
a.getComponent(l) > t.getComponent(l) && (t.setComponent(l, a.getComponent(l)), i[l] = 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 l, 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, l = p);
|
|
2062
2091
|
}
|
|
2063
2092
|
}
|
|
2064
|
-
o = -1, Ws.setFromCoplanarPoints(r.point, a.point,
|
|
2093
|
+
o = -1, Ws.setFromCoplanarPoints(r.point, a.point, l.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 !== l) {
|
|
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, l),
|
|
2076
2105
|
Rt.create(E, a, r),
|
|
2077
|
-
Rt.create(E,
|
|
2078
|
-
Rt.create(E, r,
|
|
2106
|
+
Rt.create(E, l, a),
|
|
2107
|
+
Rt.create(E, r, l)
|
|
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, l, a),
|
|
2087
2116
|
Rt.create(E, r, a),
|
|
2088
|
-
Rt.create(E, a,
|
|
2089
|
-
Rt.create(E,
|
|
2117
|
+
Rt.create(E, a, l),
|
|
2118
|
+
Rt.create(E, l, 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 !== l && 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 Pt(c, s) {
|
|
2303
|
+
return c * 3 + s;
|
|
2275
2304
|
}
|
|
2276
|
-
function
|
|
2277
|
-
const s =
|
|
2305
|
+
function cr(c) {
|
|
2306
|
+
const s = c.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(c) {
|
|
2313
|
+
const s = c.elements;
|
|
2285
2314
|
let t = 0;
|
|
2286
2315
|
for (let e = 0; e < 3; e++) {
|
|
2287
|
-
const i = s[
|
|
2316
|
+
const i = s[Pt(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(c, 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 = c.elements;
|
|
2324
|
+
for (let l = 0; l < 3; l++) {
|
|
2325
|
+
const E = Math.abs(i[Pt(li[l], hi[l])]);
|
|
2326
|
+
E > t && (t = E, e = l);
|
|
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[Pt(a, r)]) > Number.EPSILON) {
|
|
2331
|
+
const l = i[Pt(a, a)], E = i[Pt(r, r)], d = i[Pt(a, r)], h = (l - 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[Pt(r, r)] = o, s.elements[Pt(a, a)] = o, s.elements[Pt(a, r)] = n, s.elements[Pt(r, a)] = -n, s;
|
|
2307
2336
|
}
|
|
2308
|
-
function
|
|
2337
|
+
function Er(c, 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(c);
|
|
2341
|
+
const o = s.unitary, n = s.diagonal, r = new O.Matrix3(), a = new O.Matrix3(), l = Number.EPSILON * cr(n);
|
|
2342
|
+
for (; e < i && lr(n) > l; )
|
|
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(c) {
|
|
2318
2347
|
const s = [];
|
|
2319
|
-
for (let st = 0; st <
|
|
2320
|
-
const Xt =
|
|
2348
|
+
for (let st = 0; st < c.length - 2; st += 3) {
|
|
2349
|
+
const Xt = c[st], J = c[st + 1], Kt = c[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(l) {
|
|
|
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(), l = 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), l.fromArray(n, st + 6), u.set(0, 0, 0), u.add(r).add(a).add(l).divideScalar(3), E.subVectors(a, r), d.subVectors(l, 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 + l.x * l.x) * (J / 12), C += (9 * u.x * u.y + r.x * r.y + a.x * a.y + l.x * l.y) * (J / 12), T += (9 * u.x * u.z + r.x * r.z + a.x * a.z + l.x * l.z) * (J / 12), F += (9 * u.y * u.y + r.y * r.y + a.y * a.y + l.y * l.y) * (J / 12), f += (9 * u.y * u.z + r.y * r.z + a.y * a.z + l.y * l.z) * (J / 12), m += (9 * u.z * u.z + r.z * r.z + a.z * a.z + l.z * l.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(), y = new O.Vector3();
|
|
2382
|
+
S.extractBasis(_, N, y);
|
|
2383
|
+
let w = -1 / 0, L = -1 / 0, U = -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), L = Math.max(N.dot(J), L), U = Math.max(y.dot(J), U), x = Math.min(_.dot(J), x), B = Math.min(N.dot(J), B), H = Math.min(y.dot(J), H);
|
|
2358
2387
|
}
|
|
2359
|
-
_.multiplyScalar(0.5 * (x + w)), N.multiplyScalar(0.5 * (B +
|
|
2388
|
+
_.multiplyScalar(0.5 * (x + w)), N.multiplyScalar(0.5 * (B + L)), y.multiplyScalar(0.5 * (H + U));
|
|
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(y), et.x = w - x, et.y = L - B, et.z = U - 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(l) {
|
|
|
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(c, s, t) {
|
|
2374
2403
|
const e = [
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2404
|
+
c[0] - s[0],
|
|
2405
|
+
c[1] - s[1],
|
|
2406
|
+
c[2] - s[2]
|
|
2378
2407
|
];
|
|
2379
2408
|
return t[0] * e[0] + t[1] * e[1] + t[2] * e[2] > 0;
|
|
2380
2409
|
}
|
|
@@ -2661,7 +2690,7 @@ 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
2696
|
I(this, "onVertexFound", new D());
|
|
@@ -2820,7 +2849,7 @@ 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());
|
|
@@ -2855,7 +2884,7 @@ 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);
|
|
@@ -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() {
|
|
@@ -2920,7 +2949,7 @@ const gs = class gs extends it {
|
|
|
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,7 +2966,7 @@ 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
|
/**
|
|
@@ -2989,7 +3018,7 @@ 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} */
|
|
@@ -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} */
|
|
@@ -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 V = {
|
|
3108
3137
|
LEFT: 1,
|
|
3109
3138
|
RIGHT: 2,
|
|
3110
3139
|
MIDDLE: 4
|
|
3111
|
-
},
|
|
3140
|
+
}, P = Object.freeze({
|
|
3112
3141
|
NONE: 0,
|
|
3113
3142
|
ROTATE: 1,
|
|
3114
3143
|
TRUCK: 2,
|
|
@@ -3131,66 +3160,66 @@ const G = {
|
|
|
3131
3160
|
IN: 1,
|
|
3132
3161
|
OUT: -1
|
|
3133
3162
|
};
|
|
3134
|
-
function Zt(
|
|
3135
|
-
return
|
|
3163
|
+
function Zt(c) {
|
|
3164
|
+
return c.isPerspectiveCamera;
|
|
3136
3165
|
}
|
|
3137
|
-
function vt(
|
|
3138
|
-
return
|
|
3166
|
+
function vt(c) {
|
|
3167
|
+
return c.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, Pn = 1e-5, _e = Math.PI / 180;
|
|
3170
|
+
function mt(c, s, t) {
|
|
3171
|
+
return Math.max(s, Math.min(t, c));
|
|
3143
3172
|
}
|
|
3144
|
-
function X(
|
|
3145
|
-
return Math.abs(
|
|
3173
|
+
function X(c, s = Pn) {
|
|
3174
|
+
return Math.abs(c) < s;
|
|
3146
3175
|
}
|
|
3147
|
-
function k(
|
|
3148
|
-
return X(
|
|
3176
|
+
function k(c, s, t = Pn) {
|
|
3177
|
+
return X(c - s, t);
|
|
3149
3178
|
}
|
|
3150
|
-
function Ki(
|
|
3151
|
-
return Math.round(
|
|
3179
|
+
function Ki(c, s) {
|
|
3180
|
+
return Math.round(c / s) * s;
|
|
3152
3181
|
}
|
|
3153
|
-
function Ne(
|
|
3154
|
-
return isFinite(
|
|
3182
|
+
function Ne(c) {
|
|
3183
|
+
return isFinite(c) ? c : c < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
|
3155
3184
|
}
|
|
3156
|
-
function
|
|
3157
|
-
return Math.abs(
|
|
3185
|
+
function Pe(c) {
|
|
3186
|
+
return Math.abs(c) < Number.MAX_VALUE ? c : c * (1 / 0);
|
|
3158
3187
|
}
|
|
3159
|
-
function Es(
|
|
3188
|
+
function Es(c, 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 l = c - s;
|
|
3163
3192
|
const E = s, d = i * e;
|
|
3164
|
-
|
|
3165
|
-
const h = (t.value + n *
|
|
3193
|
+
l = mt(l, -d, d), s = c - l;
|
|
3194
|
+
const h = (t.value + n * l) * o;
|
|
3166
3195
|
t.value = (t.value - n * h) * a;
|
|
3167
|
-
let u = s + (
|
|
3168
|
-
return E -
|
|
3196
|
+
let u = s + (l + h) * a;
|
|
3197
|
+
return E - c > 0 == u > E && (u = E, t.value = (u - E) / o), u;
|
|
3169
3198
|
}
|
|
3170
|
-
function Ji(
|
|
3199
|
+
function Ji(c, 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, l = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
|
|
3202
|
+
let E = s.x, d = s.y, h = s.z, u = c.x - E, p = c.y - d, R = c.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 = c.x - u, d = c.y - p, h = c.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) * l, t.y = (t.y - r * S) * l, t.z = (t.z - r * _) * l, n.x = E + (u + g) * l, n.y = d + (p + S) * l, n.z = h + (R + _) * l;
|
|
3211
|
+
const N = A - c.x, y = C - c.y, w = T - c.z, L = n.x - A, U = n.y - C, x = n.z - T;
|
|
3212
|
+
return N * L + y * U + 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(c, s) {
|
|
3215
|
+
s.set(0, 0), c.forEach((t) => {
|
|
3187
3216
|
s.x += t.clientX, s.y += t.clientY;
|
|
3188
|
-
}), s.x /=
|
|
3217
|
+
}), s.x /= c.length, s.y /= c.length;
|
|
3189
3218
|
}
|
|
3190
|
-
function Qs(
|
|
3191
|
-
return vt(
|
|
3219
|
+
function Qs(c, s) {
|
|
3220
|
+
return vt(c) ? (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, yn = typeof window < "u", mr = yn && /Mac/.test(navigator.platform), Rr = !(yn && "PointerEvent" in window);
|
|
3287
|
+
let Y, tn, us, js, lt, G, z, Ee, ye, St, _t, Qt, en, sn, ut, Le, 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(), G = new Y.Vector3(), z = new Y.Vector3(), Ee = new Y.Vector3(), ye = 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(), Le = 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 P;
|
|
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 = P.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = le.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new Y.Vector3(), this._focalOffsetVelocity = new Y.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (f, m, g) => {
|
|
3330
3359
|
let S, _;
|
|
3331
3360
|
if (Zt(this._camera)) {
|
|
3332
|
-
const N =
|
|
3361
|
+
const N = G.copy(this._camera.position).sub(this._target), y = this._camera.getEffectiveFOV() * _e, w = N.length() * Math.tan(y * 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, y = mt(N, this.minDistance, this.maxDistance), w = y - N;
|
|
3374
|
+
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(w, !0), this._dollyToNoClamp(y, !0)) : this._dollyToNoClamp(y, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : y) - _, this._dollyControlCoord.set(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 = P.NONE, this._target = new Y.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new Y.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new Y.Spherical().setFromVector3(G.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
|
|
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: P.ROTATE,
|
|
3385
|
+
middle: P.DOLLY,
|
|
3386
|
+
right: P.TRUCK,
|
|
3387
|
+
wheel: Zt(this._camera) ? P.DOLLY : vt(this._camera) ? P.ZOOM : P.NONE
|
|
3359
3388
|
}, this.touches = {
|
|
3360
|
-
one:
|
|
3361
|
-
two: Zt(this._camera) ?
|
|
3362
|
-
three:
|
|
3389
|
+
one: P.TOUCH_ROTATE,
|
|
3390
|
+
two: Zt(this._camera) ? P.TOUCH_DOLLY_TRUCK : vt(this._camera) ? P.TOUCH_ZOOM_TRUCK : P.NONE,
|
|
3391
|
+
three: P.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 & V.LEFT) === V.LEFT ? V.LEFT : (f.buttons & V.MIDDLE) === V.MIDDLE ? V.MIDDLE : (f.buttons & V.RIGHT) === V.RIGHT ? V.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 & V.LEFT) === V.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 & V.LEFT) === V.LEFT ? V.LEFT : (f.buttons & V.MIDDLE) === V.MIDDLE ? V.MIDDLE : (f.buttons & V.RIGHT) === V.RIGHT ? V.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 & V.LEFT) === V.LEFT ? V.LEFT : (f.buttons & V.MIDDLE) === V.LEFT ? V.MIDDLE : (f.buttons & V.RIGHT) === V.LEFT ? V.RIGHT : null
|
|
3408
3437
|
};
|
|
3409
|
-
this._activePointers.push(g), this._domElement.ownerDocument.removeEventListener("mousemove",
|
|
3438
|
+
this._activePointers.push(g), this._domElement.ownerDocument.removeEventListener("mousemove", l), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.addEventListener("mousemove", l), 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 & V.LEFT) === V.LEFT) && (this._state = this._state | this.mouseButtons.left), this._isDragging && (f.buttons & V.MIDDLE) === V.MIDDLE && (this._state = this._state | this.mouseButtons.middle), this._isDragging && (f.buttons & V.RIGHT) === V.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
3428
3457
|
A();
|
|
3429
3458
|
}
|
|
3430
|
-
},
|
|
3459
|
+
}, l = (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 & V.LEFT) === V.LEFT) && (this._state = this._state | this.mouseButtons.left), (f.buttons & V.MIDDLE) === V.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (f.buttons & V.RIGHT) === V.RIGHT && (this._state = this._state | this.mouseButtons.right), 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 = P.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 = P.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 = P.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 === P.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(), y = f.clientX / N.width, w = f.clientY / N.height;
|
|
3494
|
+
if (y < this._interactiveArea.left || y > 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 === P.ROTATE || this.mouseButtons.wheel === P.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 P.ROTATE: {
|
|
3475
3504
|
this._rotateInternal(f.deltaX, f.deltaY), this._isUserControllingRotate = !0;
|
|
3476
3505
|
break;
|
|
3477
3506
|
}
|
|
3478
|
-
case
|
|
3507
|
+
case P.TRUCK: {
|
|
3479
3508
|
this._truckInternal(f.deltaX, f.deltaY, !1), this._isUserControllingTruck = !0;
|
|
3480
3509
|
break;
|
|
3481
3510
|
}
|
|
3482
|
-
case
|
|
3511
|
+
case P.OFFSET: {
|
|
3483
3512
|
this._truckInternal(f.deltaX, f.deltaY, !0), this._isUserControllingOffset = !0;
|
|
3484
3513
|
break;
|
|
3485
3514
|
}
|
|
3486
|
-
case
|
|
3515
|
+
case P.DOLLY: {
|
|
3487
3516
|
this._dollyInternal(-g, S, _), this._isUserControllingDolly = !0;
|
|
3488
3517
|
break;
|
|
3489
3518
|
}
|
|
3490
|
-
case
|
|
3519
|
+
case P.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", l), 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, y = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
|
3541
|
+
i.set(N, y);
|
|
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 & V.LEFT) === V.LEFT && (this._state = this._state | this.mouseButtons.left), (f.buttons & V.MIDDLE) === V.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (f.buttons & V.RIGHT) === V.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
3559
|
+
((this._state & P.ROTATE) === P.ROTATE || (this._state & P.TOUCH_ROTATE) === P.TOUCH_ROTATE || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), ((this._state & P.TRUCK) === P.TRUCK || (this._state & P.TOUCH_TRUCK) === P.TOUCH_TRUCK || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & P.DOLLY) === P.DOLLY || (this._state & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & P.ZOOM) === P.ZOOM || (this._state & P.TOUCH_ZOOM) === P.TOUCH_ZOOM || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & P.OFFSET) === P.OFFSET || (this._state & P.TOUCH_OFFSET) === P.TOUCH_OFFSET || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
|
|
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 & P.ROTATE) === P.ROTATE || (this._state & P.TOUCH_ROTATE) === P.TOUCH_ROTATE || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(g, S), this._isUserControllingRotate = !0), (this._state & P.DOLLY) === P.DOLLY || (this._state & P.ZOOM) === P.ZOOM) {
|
|
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, y = this.dollyDragInverted ? -1 : 1;
|
|
3567
|
+
(this._state & P.DOLLY) === P.DOLLY ? (this._dollyInternal(y * S * ds, _, N), this._isUserControllingDolly = !0) : (this._zoomInternal(y * 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 & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_ZOOM) === P.TOUCH_ZOOM || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) {
|
|
3570
|
+
const _ = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY, y = Math.sqrt(_ * _ + N * N), w = o.y - y;
|
|
3571
|
+
o.set(0, y);
|
|
3572
|
+
const L = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, U = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
3573
|
+
(this._state & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(w * ds, L, U), this._isUserControllingDolly = !0) : (this._zoomInternal(w * ds, L, U), this._isUserControllingZoom = !0);
|
|
3545
3574
|
}
|
|
3546
|
-
((this._state &
|
|
3575
|
+
((this._state & P.TRUCK) === P.TRUCK || (this._state & P.TOUCH_TRUCK) === P.TOUCH_TRUCK || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK) && (this._truckInternal(g, S, !1), this._isUserControllingTruck = !0), ((this._state & P.OFFSET) === P.OFFSET || (this._state & P.TOUCH_OFFSET) === P.TOUCH_OFFSET || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET) && (this._truckInternal(g, S, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
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", l), 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", l), 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 !== P.NONE && (this._state = P.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(ye).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 = G.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
|
+
G.setFromMatrixColumn(this._camera.matrix, 0), G.crossVectors(this._camera.up, G), G.multiplyScalar(s);
|
|
3910
|
+
const e = z.copy(this._targetEnd).add(G);
|
|
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 G.copy(this._camera.up).multiplyScalar(s), this.moveTo(this._targetEnd.x + G.x, this._targetEnd.y + G.y, this._targetEnd.z + G.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 = G.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 = G.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 = [], l = s.isBox3 ? de.copy(s) : de.setFromObject(s);
|
|
3965
|
+
l.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 = G.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(l.min).applyQuaternion(u), R.expandByPoint(z), z.copy(l.min).setX(l.max.x).applyQuaternion(u), R.expandByPoint(z), z.copy(l.min).setY(l.max.y).applyQuaternion(u), R.expandByPoint(z), z.copy(l.max).setZ(l.min.z).applyQuaternion(u), R.expandByPoint(z), z.copy(l.min).setZ(l.max.z).applyQuaternion(u), R.expandByPoint(z), z.copy(l.max).setY(l.min.y).applyQuaternion(u), R.expandByPoint(z), z.copy(l.max).setX(l.min.x).applyQuaternion(u), R.expandByPoint(z), z.copy(l.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(G), 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, l = Math.min(n / a, r / a);
|
|
3995
|
+
e.push(this.zoomTo(l, 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), l = G.set(s, t, e);
|
|
4013
|
+
this._targetEnd.copy(a), this._sphericalEnd.setFromVector3(l.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, l, 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 = G.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, l);
|
|
4040
|
+
Le.setFromVector3(T.sub(C).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(R.lerp(C, u));
|
|
4041
|
+
const F = Le.theta - ut.theta, f = Le.phi - ut.phi, m = Le.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(G), 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 = G.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), G.copy(St).add(_t).add(Qt), G.z = G.z + o, this.dollyTo(o, !1), this.setFocalOffset(-G.x, G.y, -G.z, !1), this.moveTo(s, t, e, !1);
|
|
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(G);
|
|
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 = G.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(G);
|
|
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(ye), p = G.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 = G.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 = G.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(ye), F = this._targetEnd.dot(T), f = G.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), G.copy(St).add(_t).add(Qt), this._camera.position.add(G)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), G.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
|
|
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: G.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 = Pe(e.maxDistance), this.minZoom = e.minZoom, this.maxZoom = Pe(e.maxZoom), this.minPolarAngle = e.minPolarAngle, this.maxPolarAngle = Pe(e.maxPolarAngle), this.minAzimuthAngle = Pe(e.minAzimuthAngle), this.maxAzimuthAngle = Pe(e.maxAzimuthAngle), this.smoothTime = e.smoothTime, this.draggingSmoothTime = e.draggingSmoothTime, this.dollySpeed = e.dollySpeed, this.truckSpeed = e.truckSpeed, this.dollyToCursor = e.dollyToCursor, this.verticalDragToForward = e.verticalDragToForward, this._target0.fromArray(e.target0), this._position0.fromArray(e.position0), this._zoom0 = e.zoom0, this._focalOffset0.fromArray(e.focalOffset0), this.moveTo(e.target[0], e.target[1], e.target[2], t), ut.setFromVector3(G.fromArray(e.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)), this.rotateTo(ut.theta, ut.phi, t), this.dollyTo(ut.radius, t), this.zoomTo(e.zoom, t), this.setFocalOffset(e.focalOffset[0], e.focalOffset[1], e.focalOffset[2], t), this._needsUpdate = !0;
|
|
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 l = 1 + e * a / t.dot(r);
|
|
4404
|
+
return s.add(z.copy(t).multiplyScalar(l)).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(ye);
|
|
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,11 +4497,11 @@ 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
|
+
G.fromBufferAttribute(E, d), o = Math.max(o, i.distanceToSquared(G));
|
|
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} */
|
|
@@ -4581,7 +4610,7 @@ const Os = class Os extends it {
|
|
|
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,7 +4632,7 @@ 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
4638
|
I(this, "onDisposed", new D());
|
|
@@ -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), l = 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, l), 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,7 +4782,7 @@ 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());
|
|
@@ -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,13 +4814,13 @@ 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 yt(), 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
4826
|
const e = new yr();
|
|
@@ -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(), l = new yt(), E = new yt(), d = new M(), h = new yt(), u = new M(), p = new M(), R = new M(), A = 0, C = new M();
|
|
4844
|
+
n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", l), 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 yt(), this._parentQuaternionInv = new yt(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new yt(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new yt(), 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 = Pr.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,48 +4932,48 @@ class Fr extends ei {
|
|
|
4903
4932
|
this.space = s;
|
|
4904
4933
|
}
|
|
4905
4934
|
}
|
|
4906
|
-
function
|
|
4935
|
+
function Or(c) {
|
|
4907
4936
|
if (this.domElement.ownerDocument.pointerLockElement)
|
|
4908
4937
|
return {
|
|
4909
4938
|
x: 0,
|
|
4910
4939
|
y: 0,
|
|
4911
|
-
button:
|
|
4940
|
+
button: c.button
|
|
4912
4941
|
};
|
|
4913
4942
|
{
|
|
4914
4943
|
const s = this.domElement.getBoundingClientRect();
|
|
4915
4944
|
return {
|
|
4916
|
-
x: (
|
|
4917
|
-
y: -(
|
|
4918
|
-
button:
|
|
4945
|
+
x: (c.clientX - s.left) / s.width * 2 - 1,
|
|
4946
|
+
y: -(c.clientY - s.top) / s.height * 2 + 1,
|
|
4947
|
+
button: c.button
|
|
4919
4948
|
};
|
|
4920
4949
|
}
|
|
4921
4950
|
}
|
|
4922
|
-
function
|
|
4951
|
+
function Sr(c) {
|
|
4923
4952
|
if (this.enabled)
|
|
4924
|
-
switch (
|
|
4953
|
+
switch (c.pointerType) {
|
|
4925
4954
|
case "mouse":
|
|
4926
4955
|
case "pen":
|
|
4927
|
-
this.pointerHover(this._getPointer(
|
|
4956
|
+
this.pointerHover(this._getPointer(c));
|
|
4928
4957
|
break;
|
|
4929
4958
|
}
|
|
4930
4959
|
}
|
|
4931
|
-
function
|
|
4932
|
-
this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(
|
|
4960
|
+
function _r(c) {
|
|
4961
|
+
this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(c.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(c)), this.pointerDown(this._getPointer(c)));
|
|
4933
4962
|
}
|
|
4934
|
-
function
|
|
4935
|
-
this.enabled && this.pointerMove(this._getPointer(
|
|
4963
|
+
function Nr(c) {
|
|
4964
|
+
this.enabled && this.pointerMove(this._getPointer(c));
|
|
4936
4965
|
}
|
|
4937
|
-
function
|
|
4938
|
-
this.enabled && (this.domElement.releasePointerCapture(
|
|
4966
|
+
function Pr(c) {
|
|
4967
|
+
this.enabled && (this.domElement.releasePointerCapture(c.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(c)));
|
|
4939
4968
|
}
|
|
4940
|
-
function ti(
|
|
4941
|
-
const e = s.intersectObject(
|
|
4969
|
+
function ti(c, s, t) {
|
|
4970
|
+
const e = s.intersectObject(c, !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
|
|
4976
|
+
const fs = new Hn(), W = new M(0, 1, 0), hn = new M(0, 0, 0), En = new Mt(), ps = new yt(), Rs = new yt(), 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();
|
|
4948
4977
|
class yr extends ei {
|
|
4949
4978
|
constructor() {
|
|
4950
4979
|
super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
|
|
@@ -4972,8 +5001,8 @@ class yr 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 l = s.clone();
|
|
5005
|
+
l.color.setHex(65280), l.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 yr 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 Pi([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 yr 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 Pi([0, 0, 0, 1, 1, 1], 3)), B;
|
|
5000
5029
|
}
|
|
5001
5030
|
const m = {
|
|
5002
5031
|
X: [
|
|
@@ -5024,7 +5053,7 @@ class yr 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), l.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
5028
5057
|
]
|
|
5029
5058
|
}, g = {
|
|
5030
5059
|
X: [
|
|
@@ -5090,7 +5119,7 @@ class yr extends ei {
|
|
|
5090
5119
|
AXIS: [
|
|
5091
5120
|
[new Ut(C, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
5092
5121
|
]
|
|
5093
|
-
},
|
|
5122
|
+
}, y = {
|
|
5094
5123
|
XYZE: [
|
|
5095
5124
|
[new v(new Wn(0.25, 10, 8), e)]
|
|
5096
5125
|
],
|
|
@@ -5129,12 +5158,12 @@ class yr 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), l), [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
|
+
}, L = {
|
|
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]]
|
|
@@ -5181,7 +5210,7 @@ class yr 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(y)), this.add(this.picker.scale = x(L)), this.add(this.helper.translate = x(S)), this.add(this.helper.rotate = x(N)), this.add(this.helper.scale = x(U)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
5185
5214
|
}
|
|
5186
5215
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
5187
5216
|
updateMatrixWorld(s) {
|
|
@@ -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) {
|
|
@@ -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 l = new O.Matrix4();
|
|
5579
|
+
i.getMatrixAt(t.instanceId, l), o = l.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;
|
|
@@ -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(c, s, t, e) {
|
|
5686
5715
|
return new Promise((i, o) => {
|
|
5687
5716
|
function n() {
|
|
5688
|
-
const r =
|
|
5689
|
-
if (r ===
|
|
5717
|
+
const r = c.clientWaitSync(s, t, 0);
|
|
5718
|
+
if (r === c.WAIT_FAILED) {
|
|
5690
5719
|
o();
|
|
5691
5720
|
return;
|
|
5692
5721
|
}
|
|
5693
|
-
if (r ===
|
|
5722
|
+
if (r === c.TIMEOUT_EXPIRED) {
|
|
5694
5723
|
setTimeout(n, e);
|
|
5695
5724
|
return;
|
|
5696
5725
|
}
|
|
@@ -5699,15 +5728,15 @@ function Pr(l, s, t, e) {
|
|
|
5699
5728
|
n();
|
|
5700
5729
|
});
|
|
5701
5730
|
}
|
|
5702
|
-
async function
|
|
5703
|
-
const r =
|
|
5704
|
-
|
|
5731
|
+
async function wr(c, s, t, e, i, o, n) {
|
|
5732
|
+
const r = c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE, 0);
|
|
5733
|
+
c.flush(), await Mr(c, r, 0, 10), c.deleteSync(r), c.bindBuffer(s, t), c.getBufferSubData(s, e, i, o, n), c.bindBuffer(s, null);
|
|
5705
5734
|
}
|
|
5706
|
-
async function
|
|
5707
|
-
const a =
|
|
5708
|
-
return
|
|
5735
|
+
async function Dr(c, s, t, e, i, o, n, r) {
|
|
5736
|
+
const a = c.createBuffer();
|
|
5737
|
+
return c.bindBuffer(c.PIXEL_PACK_BUFFER, a), c.bufferData(c.PIXEL_PACK_BUFFER, r.byteLength, c.STREAM_READ), c.readPixels(s, t, e, i, o, n, 0), c.bindBuffer(c.PIXEL_PACK_BUFFER, null), await wr(c, c.PIXEL_PACK_BUFFER, a, 0, r), c.deleteBuffer(a), r;
|
|
5709
5738
|
}
|
|
5710
|
-
class
|
|
5739
|
+
class Ur {
|
|
5711
5740
|
constructor(s, t, e) {
|
|
5712
5741
|
/** {@link Disposable.onDisposed} */
|
|
5713
5742
|
I(this, "onDisposed", new D());
|
|
@@ -5716,7 +5745,7 @@ class Dr {
|
|
|
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,7 +5858,7 @@ 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". */
|
|
@@ -5838,6 +5870,7 @@ class Ur extends Dr {
|
|
|
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 l = e ? t.count : 1, E = new O.InstancedMesh(i, a, l);
|
|
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, l = 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: l, code: o };
|
|
5935
5968
|
}
|
|
5936
5969
|
}
|
|
5937
5970
|
const Ye = class Ye extends it {
|
|
@@ -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) {
|
|
@@ -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), l = new O.Mesh(a);
|
|
6055
|
+
return this._meshes.push(l), l.position.copy(r), l;
|
|
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 l = e.min.clone(), E = e.max.clone();
|
|
6072
|
+
n && (t.getMatrixAt(a, o), l.applyMatrix4(o), E.applyMatrix4(o)), l.applyMatrix4(i), E.applyMatrix4(i), l.x < this._absoluteMin.x && (this._absoluteMin.x = l.x), l.y < this._absoluteMin.y && (this._absoluteMin.y = l.y), l.z < this._absoluteMin.z && (this._absoluteMin.z = l.z), l.x > this._absoluteMax.x && (this._absoluteMax.x = l.x), l.y > this._absoluteMax.y && (this._absoluteMax.y = l.y), l.z > this._absoluteMax.z && (this._absoluteMax.z = l.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 l = 0; l < a.length; l++) {
|
|
6081
|
+
if (l % 3 === 0 && a[l] === 0 && a[l + 1] === 0 && a[l + 2] === 0) {
|
|
6082
|
+
l += 2;
|
|
6050
6083
|
continue;
|
|
6051
6084
|
}
|
|
6052
|
-
const E = a[
|
|
6085
|
+
const E = a[l], 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 Ln = /* @__PURE__ */ new Set([
|
|
6061
6094
|
1123145078,
|
|
6062
6095
|
574549367,
|
|
6063
6096
|
1675464909,
|
|
@@ -6192,7 +6225,7 @@ const Pn = /* @__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 (Ln.has(a))
|
|
6216
6249
|
continue;
|
|
6217
|
-
const
|
|
6250
|
+
const l = 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, l, 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 l = 0; l < a; l++)
|
|
6404
|
+
e[r.get(l)] = 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 l of r) {
|
|
7584
|
+
const E = await s.getProperties(l);
|
|
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((l) => (l.value && o(l.value), l.value)).filter((l) => l !== 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((l) => (l.value && o(l.value), l.value)).filter((l) => l !== null);
|
|
7578
7611
|
}
|
|
7579
7612
|
static async getPsetRel(s, t) {
|
|
7580
7613
|
var r;
|
|
@@ -7728,7 +7761,7 @@ 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
7767
|
I(this, "onFound", new D());
|
|
@@ -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 l of r)
|
|
7796
|
+
e[l].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 l = this.indexedModels[a.uuid];
|
|
7822
|
+
l || (l = 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 = l[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 l = n.data.get(a);
|
|
7856
|
+
if (l)
|
|
7857
|
+
for (const E of l[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 l of e.queries) {
|
|
7840
7873
|
let E = [];
|
|
7841
|
-
const d =
|
|
7842
|
-
if (
|
|
7874
|
+
const d = l.operator === "AND" ? n : o;
|
|
7875
|
+
if (l.condition) {
|
|
7843
7876
|
const u = this.getMatchingEntities(
|
|
7844
7877
|
d,
|
|
7845
|
-
|
|
7878
|
+
l,
|
|
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, l, i)
|
|
7852
7885
|
];
|
|
7853
7886
|
a = r === 0 ? E : this.combineArrays(
|
|
7854
7887
|
a,
|
|
7855
7888
|
E,
|
|
7856
|
-
|
|
7889
|
+
l.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), l = [], 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
|
+
l.push(h.expressID), E.push(h);
|
|
7885
7918
|
}
|
|
7886
|
-
return { expressIDs:
|
|
7919
|
+
return { expressIDs: l, 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,212 +7948,138 @@ class Kr extends it {
|
|
|
7915
7948
|
};
|
|
7916
7949
|
}
|
|
7917
7950
|
}
|
|
7918
|
-
const
|
|
7951
|
+
const Ve = class Ve extends it {
|
|
7919
7952
|
constructor(t) {
|
|
7920
7953
|
super(t);
|
|
7921
7954
|
/** {@link Disposable.onDisposed} */
|
|
7922
7955
|
I(this, "onDisposed", new D());
|
|
7923
7956
|
I(this, "enabled", !0);
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
"HasAssociations",
|
|
7932
|
-
"ClassificationForObjects",
|
|
7933
|
-
"IsGroupedBy",
|
|
7934
|
-
"HasAssignments",
|
|
7935
|
-
"IsDefinedBy",
|
|
7936
|
-
"DefinesOcurrence",
|
|
7937
|
-
"IsTypedBy",
|
|
7938
|
-
"Types",
|
|
7939
|
-
"Defines",
|
|
7940
|
-
"ContainedInStructure",
|
|
7941
|
-
"ContainsElements"
|
|
7942
|
-
]);
|
|
7943
|
-
I(this, "inverseAttributesToProcess", [
|
|
7944
|
-
"HasAssignments",
|
|
7945
|
-
"IsDecomposedBy",
|
|
7946
|
-
"IsDefinedBy",
|
|
7947
|
-
"IsTypedBy",
|
|
7948
|
-
"HasAssociations",
|
|
7949
|
-
"ContainedInStructure"
|
|
7957
|
+
I(this, "relationsToProcess", [
|
|
7958
|
+
b.IFCRELDEFINESBYPROPERTIES,
|
|
7959
|
+
b.IFCRELDEFINESBYTYPE,
|
|
7960
|
+
b.IFCRELASSOCIATESMATERIAL,
|
|
7961
|
+
b.IFCRELCONTAINEDINSPATIALSTRUCTURE,
|
|
7962
|
+
b.IFCRELASSOCIATESCLASSIFICATION,
|
|
7963
|
+
b.IFCRELASSIGNSTOGROUP
|
|
7950
7964
|
]);
|
|
7951
|
-
I(this, "
|
|
7952
|
-
I(this, "
|
|
7965
|
+
I(this, "indexMap", {});
|
|
7966
|
+
I(this, "_propertiesManager", null);
|
|
7967
|
+
I(this, "onPropertiesManagerSet", new D());
|
|
7953
7968
|
I(this, "onFragmentsDisposed", (t) => {
|
|
7954
|
-
delete this.
|
|
7969
|
+
delete this.indexMap[t.groupID];
|
|
7955
7970
|
});
|
|
7956
|
-
this.components.add(
|
|
7971
|
+
this.components.add(Ve.uuid, this), t.get(dt).onFragmentsDisposed.add(this.onFragmentsDisposed);
|
|
7957
7972
|
}
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
}
|
|
7964
|
-
return e;
|
|
7973
|
+
// private _entityUIPool: UIPool<TreeView>;
|
|
7974
|
+
set propertiesManager(t) {
|
|
7975
|
+
this._propertiesManager || (this._propertiesManager = t, t && (t.onElementToPset.add(async ({ model: e, psetID: i, elementID: o }) => {
|
|
7976
|
+
this.indexMap[e.uuid] && this.setEntityIndex(e, o).add(i);
|
|
7977
|
+
}), this.onPropertiesManagerSet.trigger(t)));
|
|
7965
7978
|
}
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
this._relToAttributesMap.set(b.IFCRELAGGREGATES, {
|
|
7969
|
-
forRelating: "IsDecomposedBy",
|
|
7970
|
-
forRelated: "Decomposes"
|
|
7971
|
-
}), this._relToAttributesMap.set(b.IFCRELASSOCIATESMATERIAL, {
|
|
7972
|
-
forRelating: "AssociatedTo",
|
|
7973
|
-
forRelated: "HasAssociations"
|
|
7974
|
-
}), this._relToAttributesMap.set(b.IFCRELASSOCIATESCLASSIFICATION, {
|
|
7975
|
-
forRelating: "ClassificationForObjects",
|
|
7976
|
-
forRelated: "HasAssociations"
|
|
7977
|
-
}), this._relToAttributesMap.set(b.IFCRELASSIGNSTOGROUP, {
|
|
7978
|
-
forRelating: "IsGroupedBy",
|
|
7979
|
-
forRelated: "HasAssignments"
|
|
7980
|
-
}), this._relToAttributesMap.set(b.IFCRELDEFINESBYPROPERTIES, {
|
|
7981
|
-
forRelated: "IsDefinedBy",
|
|
7982
|
-
forRelating: "DefinesOcurrence"
|
|
7983
|
-
}), this._relToAttributesMap.set(b.IFCRELDEFINESBYTYPE, {
|
|
7984
|
-
forRelated: "IsTypedBy",
|
|
7985
|
-
forRelating: "Types"
|
|
7986
|
-
}), this._relToAttributesMap.set(b.IFCRELDEFINESBYTEMPLATE, {
|
|
7987
|
-
forRelated: "IsDefinedBy",
|
|
7988
|
-
forRelating: "Defines"
|
|
7989
|
-
}), this._relToAttributesMap.set(b.IFCRELCONTAINEDINSPATIALSTRUCTURE, {
|
|
7990
|
-
forRelated: "ContainedInStructure",
|
|
7991
|
-
forRelating: "ContainsElements"
|
|
7992
|
-
});
|
|
7979
|
+
get propertiesManager() {
|
|
7980
|
+
return this._propertiesManager;
|
|
7993
7981
|
}
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
7997
|
-
* and maps them in a structured way to facilitate quick access to related entities.
|
|
7998
|
-
*
|
|
7999
|
-
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
8000
|
-
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
8001
|
-
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
8002
|
-
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
8003
|
-
* of entities that are related through that attribute.
|
|
8004
|
-
*
|
|
8005
|
-
* @param model The `FragmentsGroup` model to be processed. It must have properties loaded.
|
|
8006
|
-
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
8007
|
-
* representation of the relations indexed by entity expressIDs and relation types.
|
|
8008
|
-
* @throws An error if the model does not have properties loaded.
|
|
8009
|
-
*/
|
|
8010
|
-
async process(t) {
|
|
8011
|
-
if (!t.hasProperties)
|
|
8012
|
-
throw new Error("FragmentsGroup properties not found");
|
|
8013
|
-
this.relationMaps[t.uuid] = /* @__PURE__ */ new Map();
|
|
8014
|
-
const e = this.relationMaps[t.uuid];
|
|
8015
|
-
for (const i of this.inverseAttributesToProcess) {
|
|
8016
|
-
const o = this.getAttributeRels(i);
|
|
8017
|
-
for (const n of o)
|
|
8018
|
-
await Ft.getRelationMap(
|
|
8019
|
-
t,
|
|
8020
|
-
n,
|
|
8021
|
-
async (r, a) => {
|
|
8022
|
-
const c = this._relToAttributesMap.get(n);
|
|
8023
|
-
if (!c)
|
|
8024
|
-
return;
|
|
8025
|
-
const { forRelated: E, forRelating: d } = c;
|
|
8026
|
-
if (d && this.inverseAttributesToProcess.includes(d)) {
|
|
8027
|
-
const h = e.get(r) ?? /* @__PURE__ */ new Map(), u = this.inverseAttributes.indexOf(d);
|
|
8028
|
-
h.set(u, a), e.set(r, h);
|
|
8029
|
-
}
|
|
8030
|
-
if (E && this.inverseAttributesToProcess.includes(E))
|
|
8031
|
-
for (const h of a) {
|
|
8032
|
-
const u = e.get(h) ?? /* @__PURE__ */ new Map(), p = this.inverseAttributes.indexOf(E), R = u.get(p) ?? [];
|
|
8033
|
-
R.push(r), u.set(p, R), e.set(h, u);
|
|
8034
|
-
}
|
|
8035
|
-
}
|
|
8036
|
-
);
|
|
8037
|
-
}
|
|
8038
|
-
return e;
|
|
7982
|
+
async dispose() {
|
|
7983
|
+
this.indexMap = {}, this.propertiesManager = null, this.onPropertiesManagerSet.reset(), this.components.get(dt).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(Ve.uuid), this.onDisposed.reset();
|
|
8039
7984
|
}
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
* This method searches the indexed relation maps for the specified model and entity,
|
|
8043
|
-
* returning the IDs of related entities if a match is found.
|
|
8044
|
-
*
|
|
8045
|
-
* @param model The `FragmentsGroup` model containing the entity.
|
|
8046
|
-
* @param expressID The unique identifier of the entity within the model.
|
|
8047
|
-
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
8048
|
-
* @returns An array of express IDs representing the related entities, or `null` if no relations are found
|
|
8049
|
-
* or the specified relation name is not indexed.
|
|
8050
|
-
*/
|
|
8051
|
-
getEntityRelations(t, e, i) {
|
|
8052
|
-
const o = this.relationMaps[t.uuid];
|
|
8053
|
-
if (!o)
|
|
7985
|
+
async getProperties(t, e) {
|
|
7986
|
+
if (!t.hasProperties)
|
|
8054
7987
|
return null;
|
|
8055
|
-
const
|
|
8056
|
-
if (
|
|
7988
|
+
const i = t.getLocalProperties();
|
|
7989
|
+
if (i === void 0)
|
|
8057
7990
|
return null;
|
|
8058
|
-
const
|
|
8059
|
-
|
|
8060
|
-
}
|
|
8061
|
-
/**
|
|
8062
|
-
* Serializes the relations of a specific model into a JSON string.
|
|
8063
|
-
* This method iterates through the relations indexed for the given model,
|
|
8064
|
-
* organizing them into a structured object where each key is an expressID of an entity,
|
|
8065
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
8066
|
-
* The resulting object is then serialized into a JSON string.
|
|
8067
|
-
*
|
|
8068
|
-
* @param model The `FragmentsGroup` model whose relations are to be serialized.
|
|
8069
|
-
* @returns A JSON string representing the serialized relations of the specified model.
|
|
8070
|
-
* If the model has no indexed relations, `null` is returned.
|
|
8071
|
-
*/
|
|
8072
|
-
serializeModelRelations(t) {
|
|
8073
|
-
const e = this.relationMaps[t.uuid];
|
|
8074
|
-
if (!e)
|
|
7991
|
+
const o = this.indexMap[t.uuid];
|
|
7992
|
+
if (!o)
|
|
8075
7993
|
return null;
|
|
8076
|
-
const
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
7994
|
+
const n = o[e], r = parseInt(e, 10), a = await t.getProperties(r);
|
|
7995
|
+
if (!a)
|
|
7996
|
+
throw new Error("Properties not found!");
|
|
7997
|
+
const l = this.cloneProperty(a);
|
|
7998
|
+
if (!l)
|
|
7999
|
+
throw new Error("Properties not found!");
|
|
8000
|
+
const E = [l];
|
|
8001
|
+
if (n)
|
|
8002
|
+
for (const d of n) {
|
|
8003
|
+
const h = await t.getProperties(d);
|
|
8004
|
+
if (!h)
|
|
8005
|
+
continue;
|
|
8006
|
+
const u = this.cloneProperty(h);
|
|
8007
|
+
u && (this.getPsetProperties(u, i), this.getNestedPsets(u, i), E.push(u));
|
|
8008
|
+
}
|
|
8009
|
+
return E;
|
|
8083
8010
|
}
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
8090
|
-
*
|
|
8091
|
-
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
8092
|
-
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
8093
|
-
*/
|
|
8094
|
-
serializeRelations() {
|
|
8095
|
-
const t = {};
|
|
8096
|
-
for (const e in this.relationMaps) {
|
|
8097
|
-
const i = this.relationMaps[e], o = {};
|
|
8098
|
-
for (const [n, r] of i.entries()) {
|
|
8099
|
-
o[n] || (o[n] = {});
|
|
8100
|
-
for (const [a, c] of r.entries())
|
|
8101
|
-
o[n][a] = c;
|
|
8011
|
+
getNestedPsets(t, e) {
|
|
8012
|
+
if (t.HasPropertySets)
|
|
8013
|
+
for (const i of t.HasPropertySets) {
|
|
8014
|
+
const o = i.value;
|
|
8015
|
+
i.value = this.cloneProperty(e[o]), this.getPsetProperties(i.value, e);
|
|
8102
8016
|
}
|
|
8103
|
-
t[e] = o;
|
|
8104
|
-
}
|
|
8105
|
-
return JSON.stringify(t);
|
|
8106
8017
|
}
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8018
|
+
getPsetProperties(t, e) {
|
|
8019
|
+
if (t.HasProperties)
|
|
8020
|
+
for (const i of t.HasProperties) {
|
|
8021
|
+
const o = i.value, n = this.cloneProperty(e[o]);
|
|
8022
|
+
i.value = { ...n };
|
|
8023
|
+
}
|
|
8024
|
+
}
|
|
8025
|
+
async process(t) {
|
|
8026
|
+
if (!t.hasProperties)
|
|
8027
|
+
throw new Error("FragmentsGroup properties not found");
|
|
8028
|
+
this.indexMap[t.uuid] = {};
|
|
8029
|
+
const e = [b.IFCPROPERTYSET, b.IFCELEMENTQUANTITY];
|
|
8030
|
+
for (const i of this.relationsToProcess)
|
|
8031
|
+
await Ft.getRelationMap(
|
|
8032
|
+
t,
|
|
8033
|
+
i,
|
|
8034
|
+
// eslint-disable-next-line no-loop-func
|
|
8035
|
+
async (o, n) => {
|
|
8036
|
+
const r = await t.getProperties(o);
|
|
8037
|
+
if (r) {
|
|
8038
|
+
e.includes(r.type) || this.setEntityIndex(t, o);
|
|
8039
|
+
for (const a of n)
|
|
8040
|
+
this.setEntityIndex(t, a).add(o);
|
|
8041
|
+
}
|
|
8042
|
+
}
|
|
8043
|
+
);
|
|
8044
|
+
}
|
|
8045
|
+
setEntityIndex(t, e) {
|
|
8046
|
+
return this.indexMap[t.uuid][e] || (this.indexMap[t.uuid][e] = /* @__PURE__ */ new Set()), this.indexMap[t.uuid][e];
|
|
8047
|
+
}
|
|
8048
|
+
cloneProperty(t, e = {}) {
|
|
8049
|
+
if (!t)
|
|
8050
|
+
return e;
|
|
8051
|
+
for (const i in t) {
|
|
8052
|
+
const o = t[i], n = Array.isArray(o), r = typeof o == "object" && !n && o !== null;
|
|
8053
|
+
if (n) {
|
|
8054
|
+
e[i] = [];
|
|
8055
|
+
const a = e[i];
|
|
8056
|
+
this.clonePropertyArray(o, a);
|
|
8057
|
+
} else if (r) {
|
|
8058
|
+
e[i] = {};
|
|
8059
|
+
const a = e[i];
|
|
8060
|
+
this.cloneProperty(o, a);
|
|
8061
|
+
} else
|
|
8062
|
+
e[i] = o;
|
|
8114
8063
|
}
|
|
8115
|
-
return
|
|
8064
|
+
return e;
|
|
8116
8065
|
}
|
|
8117
|
-
|
|
8118
|
-
|
|
8066
|
+
clonePropertyArray(t, e) {
|
|
8067
|
+
for (const i of t) {
|
|
8068
|
+
const o = Array.isArray(i), n = typeof i == "object" && !o && i !== null;
|
|
8069
|
+
if (o) {
|
|
8070
|
+
const r = [];
|
|
8071
|
+
e.push(r), this.clonePropertyArray(i, r);
|
|
8072
|
+
} else if (n) {
|
|
8073
|
+
const r = {};
|
|
8074
|
+
e.push(r), this.cloneProperty(i, r);
|
|
8075
|
+
} else
|
|
8076
|
+
e.push(i);
|
|
8077
|
+
}
|
|
8119
8078
|
}
|
|
8120
8079
|
};
|
|
8121
|
-
I(
|
|
8122
|
-
let pn =
|
|
8123
|
-
class
|
|
8080
|
+
I(Ve, "uuid", "23a889ab-83b3-44a4-8bee-ead83438370b");
|
|
8081
|
+
let pn = Ve;
|
|
8082
|
+
class Br {
|
|
8124
8083
|
constructor() {
|
|
8125
8084
|
I(this, "factor", 1);
|
|
8126
8085
|
I(this, "complement", 1);
|
|
@@ -8181,7 +8140,7 @@ class vr {
|
|
|
8181
8140
|
class wn {
|
|
8182
8141
|
constructor() {
|
|
8183
8142
|
I(this, "itemsByFloor", {});
|
|
8184
|
-
I(this, "_units", new
|
|
8143
|
+
I(this, "_units", new Br());
|
|
8185
8144
|
}
|
|
8186
8145
|
// TODO: Maybe make this more flexible so that it also support more exotic spatial structures?
|
|
8187
8146
|
setUp(s) {
|
|
@@ -8191,11 +8150,11 @@ class wn {
|
|
|
8191
8150
|
0,
|
|
8192
8151
|
b.IFCRELCONTAINEDINSPATIALSTRUCTURE
|
|
8193
8152
|
), e = /* @__PURE__ */ new Set(), i = s.GetLineIDsWithType(0, b.IFCSPACE);
|
|
8194
|
-
for (let
|
|
8195
|
-
e.add(i.get(
|
|
8153
|
+
for (let l = 0; l < i.size(); l++)
|
|
8154
|
+
e.add(i.get(l));
|
|
8196
8155
|
const o = s.GetLineIDsWithType(0, b.IFCRELAGGREGATES), n = o.size();
|
|
8197
|
-
for (let
|
|
8198
|
-
const E = o.get(
|
|
8156
|
+
for (let l = 0; l < n; l++) {
|
|
8157
|
+
const E = o.get(l), d = s.GetLine(0, E);
|
|
8199
8158
|
if (!d || !d.RelatingObject || !d.RelatedObjects)
|
|
8200
8159
|
continue;
|
|
8201
8160
|
const h = d.RelatingObject.value, u = d.RelatedObjects;
|
|
@@ -8205,8 +8164,8 @@ class wn {
|
|
|
8205
8164
|
}
|
|
8206
8165
|
}
|
|
8207
8166
|
const r = {}, a = t.size();
|
|
8208
|
-
for (let
|
|
8209
|
-
const E = t.get(
|
|
8167
|
+
for (let l = 0; l < a; l++) {
|
|
8168
|
+
const E = t.get(l), d = s.GetLine(0, E);
|
|
8210
8169
|
if (!d || !d.RelatingStructure || !d.RelatedElements)
|
|
8211
8170
|
continue;
|
|
8212
8171
|
const h = d.RelatingStructure.value, u = d.RelatedElements;
|
|
@@ -8222,16 +8181,16 @@ class wn {
|
|
|
8222
8181
|
this.itemsByFloor[R] = h;
|
|
8223
8182
|
}
|
|
8224
8183
|
}
|
|
8225
|
-
for (const
|
|
8226
|
-
const E = this.itemsByFloor[
|
|
8184
|
+
for (const l in r) {
|
|
8185
|
+
const E = this.itemsByFloor[l];
|
|
8227
8186
|
if (E !== void 0) {
|
|
8228
|
-
const d = r[
|
|
8187
|
+
const d = r[l];
|
|
8229
8188
|
for (const h of d)
|
|
8230
8189
|
this.itemsByFloor[h] = E;
|
|
8231
8190
|
}
|
|
8232
8191
|
}
|
|
8233
|
-
for (let
|
|
8234
|
-
const E = o.get(
|
|
8192
|
+
for (let l = 0; l < n; l++) {
|
|
8193
|
+
const E = o.get(l), d = s.GetLine(0, E);
|
|
8235
8194
|
if (!d || !d.RelatingObject || !d.RelatedObjects)
|
|
8236
8195
|
continue;
|
|
8237
8196
|
const h = d.RelatingObject.value, u = d.RelatedObjects;
|
|
@@ -8315,8 +8274,8 @@ class Dn {
|
|
|
8315
8274
|
const { x: u, y: p, z: R } = r[h];
|
|
8316
8275
|
a[h * 3] = u, a[h * 3 + 1] = p, a[h * 3 + 2] = R || 0;
|
|
8317
8276
|
}
|
|
8318
|
-
const
|
|
8319
|
-
E.setAttribute("position",
|
|
8277
|
+
const l = new O.BufferAttribute(a, 3), E = new O.EdgesGeometry();
|
|
8278
|
+
E.setAttribute("position", l);
|
|
8320
8279
|
const d = new $t.CurveMesh(
|
|
8321
8280
|
i,
|
|
8322
8281
|
n,
|
|
@@ -8345,7 +8304,7 @@ class Un {
|
|
|
8345
8304
|
return e;
|
|
8346
8305
|
}
|
|
8347
8306
|
}
|
|
8348
|
-
const
|
|
8307
|
+
const Ge = class Ge extends it {
|
|
8349
8308
|
constructor(t) {
|
|
8350
8309
|
super(t);
|
|
8351
8310
|
I(this, "onIfcStartedLoading", new D());
|
|
@@ -8360,16 +8319,16 @@ const Ve = class Ve extends it {
|
|
|
8360
8319
|
I(this, "_metaData", new Un());
|
|
8361
8320
|
I(this, "_fragmentInstances", /* @__PURE__ */ new Map());
|
|
8362
8321
|
I(this, "_civil", new Dn());
|
|
8363
|
-
I(this, "_propertyExporter", new
|
|
8322
|
+
I(this, "_propertyExporter", new br());
|
|
8364
8323
|
I(this, "_visitedFragments", /* @__PURE__ */ new Map());
|
|
8365
8324
|
I(this, "_materialT", new O.MeshLambertMaterial({
|
|
8366
8325
|
transparent: !0,
|
|
8367
8326
|
opacity: 0.5
|
|
8368
8327
|
}));
|
|
8369
|
-
this.components.add(
|
|
8328
|
+
this.components.add(Ge.uuid, this), this.settings.excludedCategories.add(b.IFCOPENINGELEMENT);
|
|
8370
8329
|
}
|
|
8371
8330
|
dispose() {
|
|
8372
|
-
this.webIfc = null, this.onDisposed.trigger(
|
|
8331
|
+
this.webIfc = null, this.onDisposed.trigger(Ge.uuid), this.onDisposed.reset();
|
|
8373
8332
|
}
|
|
8374
8333
|
async setup(t) {
|
|
8375
8334
|
this.settings = { ...this.settings, ...t }, this.settings.autoSetWasm && await this.autoSetWasm(), this.onSetup.trigger();
|
|
@@ -8402,9 +8361,9 @@ const Ve = class Ve extends it {
|
|
|
8402
8361
|
for (const a of t) {
|
|
8403
8362
|
if (!this.webIfc.IsIfcElement(a) && a !== b.IFCSPACE || this.settings.excludedCategories.has(a))
|
|
8404
8363
|
continue;
|
|
8405
|
-
const
|
|
8364
|
+
const l = this.webIfc.GetLineIDsWithType(0, a), E = l.size();
|
|
8406
8365
|
for (let d = 0; d < E; d++) {
|
|
8407
|
-
const h =
|
|
8366
|
+
const h = l.get(d);
|
|
8408
8367
|
n.push(h);
|
|
8409
8368
|
const u = this._spatialTree.itemsByFloor[h] || 0;
|
|
8410
8369
|
e.data.set(h, [[], [u, a]]);
|
|
@@ -8414,15 +8373,15 @@ const Ve = class Ve extends it {
|
|
|
8414
8373
|
this.getMesh(a, e);
|
|
8415
8374
|
});
|
|
8416
8375
|
for (const a of this._visitedFragments) {
|
|
8417
|
-
const { index:
|
|
8418
|
-
e.keyFragments.set(
|
|
8376
|
+
const { index: l, fragment: E } = a[1];
|
|
8377
|
+
e.keyFragments.set(l, E.id);
|
|
8419
8378
|
}
|
|
8420
8379
|
for (const a of e.items) {
|
|
8421
|
-
const
|
|
8422
|
-
if (!
|
|
8380
|
+
const l = this._fragmentInstances.get(a.id);
|
|
8381
|
+
if (!l)
|
|
8423
8382
|
throw new Error("Fragment not found!");
|
|
8424
8383
|
const E = [];
|
|
8425
|
-
for (const [d, h] of
|
|
8384
|
+
for (const [d, h] of l)
|
|
8426
8385
|
E.push(h);
|
|
8427
8386
|
a.add(E);
|
|
8428
8387
|
}
|
|
@@ -8435,14 +8394,14 @@ const Ve = class Ve extends it {
|
|
|
8435
8394
|
getMesh(t, e) {
|
|
8436
8395
|
const i = t.geometries.size(), o = t.expressID;
|
|
8437
8396
|
for (let n = 0; n < i; n++) {
|
|
8438
|
-
const r = t.geometries.get(n), { x: a, y:
|
|
8397
|
+
const r = t.geometries.get(n), { x: a, y: l, z: E, w: d } = r.color, h = d !== 1, { geometryExpressID: u } = r, p = `${u}-${h}`;
|
|
8439
8398
|
if (!this._visitedFragments.has(p)) {
|
|
8440
8399
|
const m = this.getGeometry(this.webIfc, u), g = h ? this._materialT : this._material, S = new $t.Fragment(m, g, 1);
|
|
8441
8400
|
e.add(S.mesh), e.items.push(S);
|
|
8442
8401
|
const _ = this._visitedFragments.size;
|
|
8443
8402
|
this._visitedFragments.set(p, { index: _, fragment: S });
|
|
8444
8403
|
}
|
|
8445
|
-
const R = new O.Color().setRGB(a,
|
|
8404
|
+
const R = new O.Color().setRGB(a, l, E, "srgb"), A = new O.Matrix4();
|
|
8446
8405
|
A.fromArray(r.flatTransformation);
|
|
8447
8406
|
const C = this._visitedFragments.get(p);
|
|
8448
8407
|
if (C === void 0)
|
|
@@ -8475,8 +8434,8 @@ const Ve = class Ve extends it {
|
|
|
8475
8434
|
), r = new Float32Array(n.length / 2), a = new Float32Array(n.length / 2);
|
|
8476
8435
|
for (let h = 0; h < n.length; h += 6)
|
|
8477
8436
|
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];
|
|
8478
|
-
const
|
|
8479
|
-
return
|
|
8437
|
+
const l = new O.BufferGeometry(), E = new O.BufferAttribute(r, 3), d = new O.BufferAttribute(a, 3);
|
|
8438
|
+
return l.setAttribute("position", E), l.setAttribute("normal", d), l.setIndex(Array.from(o)), i.delete(), l;
|
|
8480
8439
|
}
|
|
8481
8440
|
async autoSetWasm() {
|
|
8482
8441
|
const t = await fetch(
|
|
@@ -8499,8 +8458,8 @@ const Ve = class Ve extends it {
|
|
|
8499
8458
|
}
|
|
8500
8459
|
}
|
|
8501
8460
|
};
|
|
8502
|
-
I(
|
|
8503
|
-
let Ii =
|
|
8461
|
+
I(Ge, "uuid", "a659add7-1418-4771-a0d6-7d4d438e4624");
|
|
8462
|
+
let Ii = Ge;
|
|
8504
8463
|
const Yt = class Yt extends it {
|
|
8505
8464
|
constructor(t) {
|
|
8506
8465
|
super(t);
|
|
@@ -8562,11 +8521,11 @@ const Yt = class Yt extends it {
|
|
|
8562
8521
|
}
|
|
8563
8522
|
}
|
|
8564
8523
|
async newPset(t, e, i) {
|
|
8565
|
-
const o = Yt.getIFCSchema(t), { ownerHistoryHandle: n } = await this.getOwnerHistory(t), r = this.newGUID(t), a = new b[o].IfcLabel(e),
|
|
8524
|
+
const o = Yt.getIFCSchema(t), { ownerHistoryHandle: n } = await this.getOwnerHistory(t), r = this.newGUID(t), a = new b[o].IfcLabel(e), l = i ? new b[o].IfcText(i) : null, E = new b[o].IfcPropertySet(
|
|
8566
8525
|
r,
|
|
8567
8526
|
n,
|
|
8568
8527
|
a,
|
|
8569
|
-
|
|
8528
|
+
l,
|
|
8570
8529
|
[]
|
|
8571
8530
|
);
|
|
8572
8531
|
E.expressID = this.increaseMaxID(t);
|
|
@@ -8594,13 +8553,13 @@ const Yt = class Yt extends it {
|
|
|
8594
8553
|
}
|
|
8595
8554
|
}
|
|
8596
8555
|
async newSingleProperty(t, e, i, o) {
|
|
8597
|
-
const n = Yt.getIFCSchema(t), r = new b[n].IfcIdentifier(i), a = new b[n][e](o),
|
|
8556
|
+
const n = Yt.getIFCSchema(t), r = new b[n].IfcIdentifier(i), a = new b[n][e](o), l = new b[n].IfcPropertySingleValue(
|
|
8598
8557
|
r,
|
|
8599
8558
|
null,
|
|
8600
8559
|
a,
|
|
8601
8560
|
null
|
|
8602
8561
|
);
|
|
8603
|
-
return
|
|
8562
|
+
return l.expressID = this.increaseMaxID(t), await this.setData(t, l), l;
|
|
8604
8563
|
}
|
|
8605
8564
|
newSingleStringProperty(t, e, i, o) {
|
|
8606
8565
|
return this.newSingleProperty(t, e, i, o);
|
|
@@ -8646,8 +8605,8 @@ const Yt = class Yt extends it {
|
|
|
8646
8605
|
}
|
|
8647
8606
|
async saveToIfc(t, e) {
|
|
8648
8607
|
const i = this.components.get(Ii), o = i.webIfc, n = await i.readIfcFile(e), r = this._changeMap[t.uuid] ?? [];
|
|
8649
|
-
for (const
|
|
8650
|
-
const E = await t.getProperties(
|
|
8608
|
+
for (const l of r) {
|
|
8609
|
+
const E = await t.getProperties(l);
|
|
8651
8610
|
if (E)
|
|
8652
8611
|
try {
|
|
8653
8612
|
o.WriteLine(n, E);
|
|
@@ -8655,7 +8614,7 @@ const Yt = class Yt extends it {
|
|
|
8655
8614
|
}
|
|
8656
8615
|
else
|
|
8657
8616
|
try {
|
|
8658
|
-
o.DeleteLine(n,
|
|
8617
|
+
o.DeleteLine(n, l);
|
|
8659
8618
|
} catch {
|
|
8660
8619
|
}
|
|
8661
8620
|
}
|
|
@@ -8678,15 +8637,15 @@ const Yt = class Yt extends it {
|
|
|
8678
8637
|
const a = r.value;
|
|
8679
8638
|
if (a === void 0 || a == null)
|
|
8680
8639
|
throw new Error(`Attribute ${i} has a badly defined handle.`);
|
|
8681
|
-
const
|
|
8640
|
+
const l = new D();
|
|
8682
8641
|
return Object.defineProperty(n[i], "value", {
|
|
8683
8642
|
get() {
|
|
8684
8643
|
return this._value;
|
|
8685
8644
|
},
|
|
8686
8645
|
async set(E) {
|
|
8687
|
-
this._value = E,
|
|
8646
|
+
this._value = E, l.trigger(E);
|
|
8688
8647
|
}
|
|
8689
|
-
}), n[i].value = a, this.attributeListeners[t.uuid][e] || (this.attributeListeners[t.uuid][e] = {}), this.attributeListeners[t.uuid][e][i] =
|
|
8648
|
+
}), n[i].value = a, this.attributeListeners[t.uuid][e] || (this.attributeListeners[t.uuid][e] = {}), this.attributeListeners[t.uuid][e][i] = l, l;
|
|
8690
8649
|
}
|
|
8691
8650
|
};
|
|
8692
8651
|
I(Yt, "uuid", "58c2d9f0-183c-48d6-a402-dfcf5b9a34df");
|
|
@@ -8707,10 +8666,10 @@ const _s = class _s extends it {
|
|
|
8707
8666
|
delete n[e], Object.values(n).length === 0 && delete this._groupSystems[o];
|
|
8708
8667
|
else
|
|
8709
8668
|
for (const a of r) {
|
|
8710
|
-
const
|
|
8669
|
+
const l = n[a];
|
|
8711
8670
|
for (const E of i)
|
|
8712
|
-
delete
|
|
8713
|
-
Object.values(
|
|
8671
|
+
delete l[E];
|
|
8672
|
+
Object.values(l).length === 0 && delete n[a];
|
|
8714
8673
|
}
|
|
8715
8674
|
}
|
|
8716
8675
|
});
|
|
@@ -8736,8 +8695,8 @@ const _s = class _s extends it {
|
|
|
8736
8695
|
const e = this.components.get(dt);
|
|
8737
8696
|
if (!t) {
|
|
8738
8697
|
const r = {};
|
|
8739
|
-
for (const [a,
|
|
8740
|
-
r[a] = new Set(
|
|
8698
|
+
for (const [a, l] of e.list)
|
|
8699
|
+
r[a] = new Set(l.ids);
|
|
8741
8700
|
return r;
|
|
8742
8701
|
}
|
|
8743
8702
|
const i = Object.keys(t).length, o = {};
|
|
@@ -8747,8 +8706,8 @@ const _s = class _s extends it {
|
|
|
8747
8706
|
console.warn(`Classification ${r} does not exist.`);
|
|
8748
8707
|
continue;
|
|
8749
8708
|
}
|
|
8750
|
-
for (const
|
|
8751
|
-
const E = this._groupSystems[r][
|
|
8709
|
+
for (const l of a) {
|
|
8710
|
+
const E = this._groupSystems[r][l];
|
|
8752
8711
|
if (E)
|
|
8753
8712
|
for (const d in E) {
|
|
8754
8713
|
o[d] || (o[d] = /* @__PURE__ */ new Map());
|
|
@@ -8762,10 +8721,10 @@ const _s = class _s extends it {
|
|
|
8762
8721
|
const n = {};
|
|
8763
8722
|
for (const r in o) {
|
|
8764
8723
|
const a = o[r];
|
|
8765
|
-
for (const [
|
|
8724
|
+
for (const [l, E] of a) {
|
|
8766
8725
|
if (E === void 0)
|
|
8767
8726
|
throw new Error("Malformed fragments map!");
|
|
8768
|
-
E === i && (n[r] || (n[r] = /* @__PURE__ */ new Set()), n[r].add(
|
|
8727
|
+
E === i && (n[r] || (n[r] = /* @__PURE__ */ new Set()), n[r].add(l));
|
|
8769
8728
|
}
|
|
8770
8729
|
}
|
|
8771
8730
|
return n;
|
|
@@ -8777,8 +8736,8 @@ const _s = class _s extends it {
|
|
|
8777
8736
|
const o = i[t];
|
|
8778
8737
|
for (const [n, r] of e.data) {
|
|
8779
8738
|
const a = r[0];
|
|
8780
|
-
for (const
|
|
8781
|
-
const E = e.keyFragments.get(
|
|
8739
|
+
for (const l of a) {
|
|
8740
|
+
const E = e.keyFragments.get(l);
|
|
8782
8741
|
E && (o[E] || (o[E] = /* @__PURE__ */ new Set()), o[E].add(n));
|
|
8783
8742
|
}
|
|
8784
8743
|
}
|
|
@@ -8793,14 +8752,14 @@ const _s = class _s extends it {
|
|
|
8793
8752
|
continue;
|
|
8794
8753
|
const a = String((o = r.PredefinedType) == null ? void 0 : o.value).toUpperCase();
|
|
8795
8754
|
e[a] || (e[a] = {});
|
|
8796
|
-
const
|
|
8755
|
+
const l = e[a];
|
|
8797
8756
|
for (const [E, d] of t.data) {
|
|
8798
8757
|
const h = d[0];
|
|
8799
8758
|
for (const u of h) {
|
|
8800
8759
|
const p = t.keyFragments.get(u);
|
|
8801
8760
|
if (!p)
|
|
8802
8761
|
throw new Error("Fragment ID not found!");
|
|
8803
|
-
|
|
8762
|
+
l[p] || (l[p] = /* @__PURE__ */ new Set()), l[p].add(r.expressID);
|
|
8804
8763
|
}
|
|
8805
8764
|
}
|
|
8806
8765
|
}
|
|
@@ -8844,8 +8803,8 @@ const _s = class _s extends it {
|
|
|
8844
8803
|
for (const r of n[0]) {
|
|
8845
8804
|
const a = t.keyFragments.get(r);
|
|
8846
8805
|
if (a) {
|
|
8847
|
-
const
|
|
8848
|
-
|
|
8806
|
+
const l = this._groupSystems[e];
|
|
8807
|
+
l[i] || (l[i] = {}), l[i][a] || (l[i][a] = /* @__PURE__ */ new Set()), l[i][a].add(o);
|
|
8849
8808
|
}
|
|
8850
8809
|
}
|
|
8851
8810
|
}
|
|
@@ -8876,14 +8835,14 @@ const ze = class ze extends it {
|
|
|
8876
8835
|
const t = this.components.get(fi), e = this.components.get(dt), i = this.enabled ? 1 : -1;
|
|
8877
8836
|
let o = 0;
|
|
8878
8837
|
const r = t.get()[this.groupName], a = new O.Matrix4();
|
|
8879
|
-
for (const
|
|
8838
|
+
for (const l in r) {
|
|
8880
8839
|
a.elements[13] = o * i * this.height;
|
|
8881
|
-
for (const E in r[
|
|
8882
|
-
const d = e.list.get(E), h =
|
|
8840
|
+
for (const E in r[l]) {
|
|
8841
|
+
const d = e.list.get(E), h = l + E, u = this.list.has(h);
|
|
8883
8842
|
if (!d || this.enabled && u || !this.enabled && !u)
|
|
8884
8843
|
continue;
|
|
8885
8844
|
this.enabled ? this.list.add(h) : this.list.delete(h);
|
|
8886
|
-
const p = r[
|
|
8845
|
+
const p = r[l][E];
|
|
8887
8846
|
d.applyTransform(p, a);
|
|
8888
8847
|
}
|
|
8889
8848
|
o++;
|
|
@@ -8925,14 +8884,14 @@ const Ns = class Ns extends it {
|
|
|
8925
8884
|
};
|
|
8926
8885
|
I(Ns, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
|
|
8927
8886
|
let mn = Ns;
|
|
8928
|
-
class
|
|
8887
|
+
class Yr extends gi {
|
|
8929
8888
|
constructor() {
|
|
8930
8889
|
super(...arguments);
|
|
8931
8890
|
I(this, "minGeometrySize", 10);
|
|
8932
8891
|
I(this, "minAssetsSize", 1e3);
|
|
8933
8892
|
}
|
|
8934
8893
|
}
|
|
8935
|
-
class
|
|
8894
|
+
class Vr extends gi {
|
|
8936
8895
|
constructor() {
|
|
8937
8896
|
super(...arguments);
|
|
8938
8897
|
I(this, "propertiesSize", 100);
|
|
@@ -8947,7 +8906,7 @@ class Gr extends it {
|
|
|
8947
8906
|
/** {@link Disposable.onDisposed} */
|
|
8948
8907
|
I(this, "onDisposed", new D());
|
|
8949
8908
|
I(this, "enabled", !0);
|
|
8950
|
-
I(this, "settings", new
|
|
8909
|
+
I(this, "settings", new Vr());
|
|
8951
8910
|
I(this, "webIfc", new b.IfcAPI());
|
|
8952
8911
|
}
|
|
8953
8912
|
async dispose() {
|
|
@@ -8988,7 +8947,7 @@ class Gr extends it {
|
|
|
8988
8947
|
e.add(E);
|
|
8989
8948
|
let r = 0.01, a = 0;
|
|
8990
8949
|
for (const E of e) {
|
|
8991
|
-
if (a++,
|
|
8950
|
+
if (a++, Ln.has(E))
|
|
8992
8951
|
continue;
|
|
8993
8952
|
const d = n.has(E), h = this.webIfc.GetLineIDsWithType(0, E), u = h.size();
|
|
8994
8953
|
let p = 0;
|
|
@@ -9022,10 +8981,10 @@ class Gr extends it {
|
|
|
9022
8981
|
const R = a / e.size;
|
|
9023
8982
|
R > r && (r += 0.01, r = Math.max(r, R), await this.onProgress.trigger(Math.round(r * 100) / 100));
|
|
9024
8983
|
}
|
|
9025
|
-
const
|
|
8984
|
+
const l = [];
|
|
9026
8985
|
for (const [E, d] of o)
|
|
9027
|
-
|
|
9028
|
-
await this.onIndicesStreamed.trigger(
|
|
8986
|
+
l.push([E, ...d]);
|
|
8987
|
+
await this.onIndicesStreamed.trigger(l);
|
|
9029
8988
|
}
|
|
9030
8989
|
getIndices(t, e, i) {
|
|
9031
8990
|
const o = t.RelatedObjects || t.RelatedElements;
|
|
@@ -9044,8 +9003,8 @@ class Gr extends it {
|
|
|
9044
9003
|
for (const a of o) {
|
|
9045
9004
|
if (a.value === void 0 || a.value === null)
|
|
9046
9005
|
continue;
|
|
9047
|
-
const
|
|
9048
|
-
i.has(
|
|
9006
|
+
const l = a.value;
|
|
9007
|
+
i.has(l) || i.set(l, /* @__PURE__ */ new Set()), i.get(l).add(r);
|
|
9049
9008
|
}
|
|
9050
9009
|
}
|
|
9051
9010
|
cleanUp() {
|
|
@@ -9053,7 +9012,7 @@ class Gr extends it {
|
|
|
9053
9012
|
}
|
|
9054
9013
|
}
|
|
9055
9014
|
I(Gr, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
|
|
9056
|
-
const
|
|
9015
|
+
const Ps = class Ps extends it {
|
|
9057
9016
|
constructor(t) {
|
|
9058
9017
|
super(t);
|
|
9059
9018
|
I(this, "onGeometryStreamed", new D());
|
|
@@ -9062,7 +9021,7 @@ const ys = class ys extends it {
|
|
|
9062
9021
|
I(this, "onIfcLoaded", new D());
|
|
9063
9022
|
/** {@link Disposable.onDisposed} */
|
|
9064
9023
|
I(this, "onDisposed", new D());
|
|
9065
|
-
I(this, "settings", new
|
|
9024
|
+
I(this, "settings", new Yr());
|
|
9066
9025
|
I(this, "enabled", !0);
|
|
9067
9026
|
I(this, "webIfc", new b.IfcAPI());
|
|
9068
9027
|
I(this, "_spatialTree", new wn());
|
|
@@ -9075,7 +9034,7 @@ const ys = class ys extends it {
|
|
|
9075
9034
|
I(this, "_groupSerializer", new $t.Serializer());
|
|
9076
9035
|
I(this, "_assets", []);
|
|
9077
9036
|
I(this, "_meshesWithHoles", /* @__PURE__ */ new Set());
|
|
9078
|
-
this.components.add(
|
|
9037
|
+
this.components.add(Ps.uuid, this), this.settings.excludedCategories.add(b.IFCOPENINGELEMENT);
|
|
9079
9038
|
}
|
|
9080
9039
|
dispose() {
|
|
9081
9040
|
this.onIfcLoaded.reset(), this.onGeometryStreamed.reset(), this.onAssetStreamed.reset(), this.webIfc = null, this.onDisposed.trigger(), this.onDisposed.reset();
|
|
@@ -9106,17 +9065,19 @@ const ys = class ys extends it {
|
|
|
9106
9065
|
schema: this.webIfc.GetModelSchema(0) || "IFC2X3",
|
|
9107
9066
|
maxExpressID: this.webIfc.GetMaxExpressID(0)
|
|
9108
9067
|
};
|
|
9109
|
-
let
|
|
9068
|
+
let l = 0, E = 0;
|
|
9110
9069
|
for (const T of i) {
|
|
9111
9070
|
if (!this.webIfc.IsIfcElement(T) && T !== b.IFCSPACE || this.settings.excludedCategories.has(T))
|
|
9112
9071
|
continue;
|
|
9113
9072
|
const F = this.webIfc.GetLineIDsWithType(0, T), f = F.size();
|
|
9114
9073
|
for (let m = 0; m < f; m++) {
|
|
9115
|
-
|
|
9074
|
+
l > t && (l = 0, E++, o.push([]));
|
|
9116
9075
|
const g = F.get(m);
|
|
9076
|
+
if (g !== 9056429)
|
|
9077
|
+
continue;
|
|
9117
9078
|
o[E].push(g);
|
|
9118
9079
|
const S = this._spatialTree.itemsByFloor[g] || 0;
|
|
9119
|
-
n.data.set(g, [[], [S, T]]),
|
|
9080
|
+
n.data.set(g, [[], [S, T]]), l++;
|
|
9120
9081
|
}
|
|
9121
9082
|
}
|
|
9122
9083
|
this._spatialTree.cleanUp();
|
|
@@ -9148,7 +9109,7 @@ const ys = class ys extends it {
|
|
|
9148
9109
|
getMesh(t, e, i) {
|
|
9149
9110
|
const o = e.geometries.size(), n = e.expressID, r = { id: n, geometries: [] };
|
|
9150
9111
|
for (let a = 0; a < o; a++) {
|
|
9151
|
-
const
|
|
9112
|
+
const l = e.geometries.get(a), E = l.geometryExpressID, d = l.color.w === 1 ? 1 : -1, h = E * d;
|
|
9152
9113
|
if (!this._visitedGeometries.has(h)) {
|
|
9153
9114
|
this._visitedGeometries.has(E) || this.getGeometry(t, E);
|
|
9154
9115
|
const m = this._visitedGeometries.size, g = O.MathUtils.generateUUID();
|
|
@@ -9161,7 +9122,7 @@ const ys = class ys extends it {
|
|
|
9161
9122
|
if (!p)
|
|
9162
9123
|
throw new Error("Data not found!");
|
|
9163
9124
|
p[0].push(u.index);
|
|
9164
|
-
const { x: R, y: A, z: C, w: T } =
|
|
9125
|
+
const { x: R, y: A, z: C, w: T } = l.color, F = [R, A, C, T], f = l.flatTransformation;
|
|
9165
9126
|
r.geometries.push({ color: F, geometryID: E, transformation: f });
|
|
9166
9127
|
}
|
|
9167
9128
|
this._assets.push(r);
|
|
@@ -9176,11 +9137,11 @@ const ys = class ys extends it {
|
|
|
9176
9137
|
), r = new Float32Array(n.length / 2), a = new Float32Array(n.length / 2);
|
|
9177
9138
|
for (let u = 0; u < n.length; u += 6)
|
|
9178
9139
|
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];
|
|
9179
|
-
const
|
|
9140
|
+
const l = dr(r), E = new Float32Array(l.transformation.elements), d = [l.center.x, l.center.y, l.center.z];
|
|
9180
9141
|
let h = !1;
|
|
9181
9142
|
for (let u = 0; u < r.length - 2; u += 3) {
|
|
9182
9143
|
const p = r[u], R = r[u + 1], A = r[u + 2], C = a[u], T = a[u + 1], F = a[u + 2];
|
|
9183
|
-
if (
|
|
9144
|
+
if (ur(d, [p, R, A], [C, T, F])) {
|
|
9184
9145
|
h = !0;
|
|
9185
9146
|
break;
|
|
9186
9147
|
}
|
|
@@ -9203,9 +9164,9 @@ const ys = class ys extends it {
|
|
|
9203
9164
|
this.onGeometryStreamed.trigger({ data: e, buffer: t }), e = null, t = null, this._geometries.clear(), this._geometryCount = 0;
|
|
9204
9165
|
}
|
|
9205
9166
|
};
|
|
9206
|
-
I(
|
|
9207
|
-
let Rn =
|
|
9208
|
-
class
|
|
9167
|
+
I(Ps, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
|
|
9168
|
+
let Rn = Ps;
|
|
9169
|
+
class zr {
|
|
9209
9170
|
constructor(s) {
|
|
9210
9171
|
/** {@link NavigationMode.enabled} */
|
|
9211
9172
|
I(this, "enabled", !1);
|
|
@@ -9232,7 +9193,7 @@ class Vr {
|
|
|
9232
9193
|
), s.truckSpeed = 50, s.mouseButtons.wheel = ot.ACTION.DOLLY, s.touches.two = ot.ACTION.TOUCH_ZOOM_TRUCK;
|
|
9233
9194
|
}
|
|
9234
9195
|
}
|
|
9235
|
-
class
|
|
9196
|
+
class Hr {
|
|
9236
9197
|
constructor(s) {
|
|
9237
9198
|
/** {@link NavigationMode.enabled} */
|
|
9238
9199
|
I(this, "enabled", !0);
|
|
@@ -9255,7 +9216,7 @@ class zr {
|
|
|
9255
9216
|
s.moveTo(n.x, n.y, n.z);
|
|
9256
9217
|
}
|
|
9257
9218
|
}
|
|
9258
|
-
class
|
|
9219
|
+
class kr {
|
|
9259
9220
|
constructor(s) {
|
|
9260
9221
|
/** {@link NavigationMode.enabled} */
|
|
9261
9222
|
I(this, "enabled", !1);
|
|
@@ -9275,7 +9236,7 @@ class Hr {
|
|
|
9275
9236
|
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);
|
|
9276
9237
|
}
|
|
9277
9238
|
}
|
|
9278
|
-
class
|
|
9239
|
+
class Wr {
|
|
9279
9240
|
constructor(s) {
|
|
9280
9241
|
/**
|
|
9281
9242
|
* Event that fires when the {@link CameraProjection} changes.
|
|
@@ -9324,8 +9285,8 @@ class kr {
|
|
|
9324
9285
|
this._component.three.getWorldDirection(t);
|
|
9325
9286
|
const e = new O.Vector3();
|
|
9326
9287
|
this._component.controls.getTarget(e);
|
|
9327
|
-
const o = e.clone().sub(this._component.three.position).dot(t), n = s.renderer.getSize(), r = n.x / n.y, a = this._component.three,
|
|
9328
|
-
return { width:
|
|
9288
|
+
const o = e.clone().sub(this._component.three.position).dot(t), n = s.renderer.getSize(), r = n.x / n.y, a = this._component.three, l = o * 2 * Math.atan(a.fov * (Math.PI / 180) / 2);
|
|
9289
|
+
return { width: l * r, height: l };
|
|
9329
9290
|
}
|
|
9330
9291
|
setupOrthoCamera(s, t) {
|
|
9331
9292
|
this._component.controls.mouseButtons.wheel = ot.ACTION.ZOOM, this._component.controls.mouseButtons.middle = ot.ACTION.ZOOM;
|
|
@@ -9342,7 +9303,7 @@ class kr {
|
|
|
9342
9303
|
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";
|
|
9343
9304
|
}
|
|
9344
9305
|
}
|
|
9345
|
-
class
|
|
9306
|
+
class ta extends We {
|
|
9346
9307
|
constructor(t) {
|
|
9347
9308
|
super(t);
|
|
9348
9309
|
/**
|
|
@@ -9354,7 +9315,7 @@ class Jr extends We {
|
|
|
9354
9315
|
I(this, "_userInputButtons", {});
|
|
9355
9316
|
I(this, "_frustumSize", 50);
|
|
9356
9317
|
I(this, "_navigationModes", /* @__PURE__ */ new Map());
|
|
9357
|
-
this.threeOrtho = this.newOrthoCamera(), this._navigationModes.set("Orbit", new
|
|
9318
|
+
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());
|
|
9358
9319
|
}
|
|
9359
9320
|
get current() {
|
|
9360
9321
|
return this.projection.camera;
|
|
@@ -9390,11 +9351,11 @@ class Jr extends We {
|
|
|
9390
9351
|
const p = new O.Box3().setFromObject(u);
|
|
9391
9352
|
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);
|
|
9392
9353
|
}
|
|
9393
|
-
const a = new O.Box3(n, r),
|
|
9394
|
-
a.getSize(
|
|
9354
|
+
const a = new O.Box3(n, r), l = new O.Vector3();
|
|
9355
|
+
a.getSize(l);
|
|
9395
9356
|
const E = new O.Vector3();
|
|
9396
9357
|
a.getCenter(E);
|
|
9397
|
-
const d = Math.max(
|
|
9358
|
+
const d = Math.max(l.x, l.y, l.z) * e, h = new O.Sphere(E, d);
|
|
9398
9359
|
await this.controls.fitToSphere(h, !0);
|
|
9399
9360
|
}
|
|
9400
9361
|
/**
|
|
@@ -9429,7 +9390,7 @@ class Jr extends We {
|
|
|
9429
9390
|
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();
|
|
9430
9391
|
}
|
|
9431
9392
|
}
|
|
9432
|
-
class
|
|
9393
|
+
class ea {
|
|
9433
9394
|
static getFace(s, t, e) {
|
|
9434
9395
|
if (!s.geometry.index)
|
|
9435
9396
|
throw new Error("Geometry must be indexed!");
|
|
@@ -9447,19 +9408,19 @@ class ta {
|
|
|
9447
9408
|
}
|
|
9448
9409
|
}
|
|
9449
9410
|
let a = 0;
|
|
9450
|
-
const
|
|
9411
|
+
const l = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
|
|
9451
9412
|
for (const { index: d, edges: h } of r) {
|
|
9452
9413
|
const u = /* @__PURE__ */ new Map();
|
|
9453
9414
|
for (const { id: f } of h)
|
|
9454
|
-
if (
|
|
9455
|
-
const m =
|
|
9415
|
+
if (l.has(f)) {
|
|
9416
|
+
const m = l.get(f);
|
|
9456
9417
|
u.set(f, m);
|
|
9457
9418
|
}
|
|
9458
9419
|
const p = h.map((f) => f.id);
|
|
9459
9420
|
if (!u.size) {
|
|
9460
9421
|
const f = a++;
|
|
9461
9422
|
for (const { id: m } of h)
|
|
9462
|
-
|
|
9423
|
+
l.set(m, f);
|
|
9463
9424
|
E.set(f, {
|
|
9464
9425
|
edges: new Set(p),
|
|
9465
9426
|
indices: /* @__PURE__ */ new Set([d])
|
|
@@ -9469,7 +9430,7 @@ class ta {
|
|
|
9469
9430
|
let R = null;
|
|
9470
9431
|
const A = /* @__PURE__ */ new Set(), C = new Set(p);
|
|
9471
9432
|
for (const [f, m] of u) {
|
|
9472
|
-
R === null ? R = m : m !== R && A.add(m),
|
|
9433
|
+
R === null ? R = m : m !== R && A.add(m), l.delete(f);
|
|
9473
9434
|
const { edges: g } = E.get(m);
|
|
9474
9435
|
g.delete(f), C.delete(f);
|
|
9475
9436
|
}
|
|
@@ -9478,16 +9439,16 @@ class ta {
|
|
|
9478
9439
|
const T = E.get(R), { indices: F } = T;
|
|
9479
9440
|
F.add(d);
|
|
9480
9441
|
for (const f of C) {
|
|
9481
|
-
|
|
9442
|
+
l.set(f, R);
|
|
9482
9443
|
const { edges: m } = T;
|
|
9483
9444
|
m.add(f);
|
|
9484
9445
|
}
|
|
9485
9446
|
for (const f of A) {
|
|
9486
|
-
const m = E.get(f), { edges: g, indices: S } = m, _ = E.get(R), { edges: N, indices:
|
|
9447
|
+
const m = E.get(f), { edges: g, indices: S } = m, _ = E.get(R), { edges: N, indices: y } = _;
|
|
9487
9448
|
for (const w of g)
|
|
9488
|
-
N.add(w),
|
|
9449
|
+
N.add(w), l.set(w, R);
|
|
9489
9450
|
for (const w of S)
|
|
9490
|
-
|
|
9451
|
+
y.add(w);
|
|
9491
9452
|
E.delete(f);
|
|
9492
9453
|
}
|
|
9493
9454
|
}
|
|
@@ -9509,17 +9470,17 @@ class ta {
|
|
|
9509
9470
|
static getFaceData(s, t, e) {
|
|
9510
9471
|
const i = this.getVerticesAndNormal(e, s, t), { p1: o, p2: n, p3: r, faceNormal: a } = i;
|
|
9511
9472
|
this.round(o), this.round(n), this.round(r), this.round(a);
|
|
9512
|
-
const
|
|
9473
|
+
const l = [
|
|
9513
9474
|
{ id: `${o.x}|${o.y}|${o.z}`, value: o },
|
|
9514
9475
|
{ id: `${n.x}|${n.y}|${n.z}`, value: n },
|
|
9515
9476
|
{ id: `${r.x}|${r.y}|${r.z}`, value: r }
|
|
9516
9477
|
];
|
|
9517
|
-
|
|
9478
|
+
l.sort((T, F) => T.id < F.id ? -1 : T.id > F.id ? 1 : 0);
|
|
9518
9479
|
const [
|
|
9519
9480
|
{ id: E, value: d },
|
|
9520
9481
|
{ id: h, value: u },
|
|
9521
9482
|
{ id: p, value: R }
|
|
9522
|
-
] =
|
|
9483
|
+
] = l, A = [
|
|
9523
9484
|
{
|
|
9524
9485
|
id: `${E}|${h}`,
|
|
9525
9486
|
distance: d.distanceTo(u),
|
|
@@ -9541,7 +9502,7 @@ class ta {
|
|
|
9541
9502
|
static getVerticesAndNormal(s, t, e) {
|
|
9542
9503
|
if (!s.geometry.index)
|
|
9543
9504
|
throw new Error("Geometry must be indexed!");
|
|
9544
|
-
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,
|
|
9505
|
+
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, l = 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[l], o[l + 1], o[l + 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[l], n[l + 1], n[l + 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);
|
|
9545
9506
|
if (!F.x && !F.y && !F.z && console.log("hey"), e !== void 0 && s instanceof O.InstancedMesh) {
|
|
9546
9507
|
const f = new O.Matrix4();
|
|
9547
9508
|
s.getMatrixAt(e, f);
|
|
@@ -9555,19 +9516,20 @@ class ta {
|
|
|
9555
9516
|
}
|
|
9556
9517
|
}
|
|
9557
9518
|
export {
|
|
9519
|
+
tr as AsyncEvent,
|
|
9558
9520
|
Ri as Base,
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9521
|
+
er as BaseCamera,
|
|
9522
|
+
sr as BaseRenderer,
|
|
9523
|
+
ir as BaseScene,
|
|
9562
9524
|
Ai as BaseWorldItem,
|
|
9563
9525
|
un as Clipper,
|
|
9564
9526
|
it as Component,
|
|
9565
9527
|
Ei as Components,
|
|
9566
|
-
|
|
9528
|
+
Ur as CullerRenderer,
|
|
9567
9529
|
ui as Cullers,
|
|
9568
9530
|
zt as Disposer,
|
|
9569
9531
|
D as Event,
|
|
9570
|
-
|
|
9532
|
+
zr as FirstPersonMode,
|
|
9571
9533
|
fn as FragmentBoundingBox,
|
|
9572
9534
|
fi as FragmentClassifier,
|
|
9573
9535
|
Tn as FragmentExploder,
|
|
@@ -9576,35 +9538,35 @@ export {
|
|
|
9576
9538
|
Rn as FragmentIfcStreamConverter,
|
|
9577
9539
|
dt as FragmentManager,
|
|
9578
9540
|
Gr as FragmentPropsStreamConverter,
|
|
9579
|
-
|
|
9580
|
-
|
|
9541
|
+
Fr as Grids,
|
|
9542
|
+
Kr as IfcCategories,
|
|
9581
9543
|
Mn as IfcCategoryMap,
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9544
|
+
vr as IfcElements,
|
|
9545
|
+
br as IfcJsonExporter,
|
|
9546
|
+
Jr as IfcPropertiesFinder,
|
|
9585
9547
|
pn as IfcPropertiesIndexer,
|
|
9586
9548
|
Cn as IfcPropertiesManager,
|
|
9587
9549
|
Ft as IfcPropertiesUtils,
|
|
9588
|
-
|
|
9550
|
+
Yr as IfcStreamingSettings,
|
|
9589
9551
|
In as Materials,
|
|
9590
9552
|
qi as MaterialsUtils,
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
|
|
9594
|
-
|
|
9595
|
-
|
|
9596
|
-
|
|
9597
|
-
|
|
9553
|
+
ea as MeasurementUtils,
|
|
9554
|
+
xr as MeshCullerRenderer,
|
|
9555
|
+
Hr as OrbitMode,
|
|
9556
|
+
ta as OrthoPerspectiveCamera,
|
|
9557
|
+
kr as PlanMode,
|
|
9558
|
+
Wr as ProjectionManager,
|
|
9559
|
+
Vr as PropertiesStreamingSettings,
|
|
9598
9560
|
ke as Raycasters,
|
|
9599
9561
|
We as SimpleCamera,
|
|
9600
9562
|
Fi as SimplePlane,
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9563
|
+
$r as SimpleRenderer,
|
|
9564
|
+
qr as SimpleScene,
|
|
9565
|
+
pr as SimpleWorld,
|
|
9604
9566
|
He as UUID,
|
|
9605
|
-
|
|
9567
|
+
jr as VertexPicker,
|
|
9606
9568
|
di as Worlds,
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9569
|
+
ur as isPointInFrontOfPlane,
|
|
9570
|
+
dr as obbFromPoints,
|
|
9571
|
+
Dr as readPixelsAsync
|
|
9610
9572
|
};
|