@realsee/five 6.6.0-alpha.3 → 6.6.0-alpha.5
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/docs/classes/five.Tile3DModel.html +26 -26
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/interfaces/five.Intersection.html +5 -3
- package/docs/interfaces/five.Tile3DModelLoaderOptions.html +2 -2
- package/docs/interfaces/five.ViewLayer.html +25 -25
- package/five/index.d.ts +6 -1
- package/five/index.js +41 -41
- package/five/index.mjs +1225 -1126
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/index.js +2 -2
- package/plugins/index.mjs +2 -2
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +2 -2
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +2 -2
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +41 -41
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/work-downloader/index.js +2 -2
- package/work-downloader/index.mjs +2 -2
package/five/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated:
|
|
5
|
-
* Version: 6.6.0-alpha.
|
|
4
|
+
* Generated: 8/26/2025
|
|
5
|
+
* Version: 6.6.0-alpha.5
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -758,9 +758,9 @@ CryptoJS.lib.Cipher || (function(n) {
|
|
|
758
758
|
w[C + 1] = w[C + 3], w[C + 3] = I, this._doCryptBlock(w, C, this._invKeySchedule, c, d, f, h, r), I = w[C + 1], w[C + 1] = w[C + 3], w[C + 3] = I;
|
|
759
759
|
},
|
|
760
760
|
_doCryptBlock: function(w, C, I, H, M, B, F, L) {
|
|
761
|
-
for (var O = this._nRounds, q = w[C] ^ I[0],
|
|
762
|
-
var
|
|
763
|
-
|
|
761
|
+
for (var O = this._nRounds, q = w[C] ^ I[0], j = w[C + 1] ^ I[1], K = w[C + 2] ^ I[2], z = w[C + 3] ^ I[3], k = 4, D = 1; D < O; D++)
|
|
762
|
+
var J = H[q >>> 24] ^ M[j >>> 16 & 255] ^ B[K >>> 8 & 255] ^ F[z & 255] ^ I[k++], G = H[j >>> 24] ^ M[K >>> 16 & 255] ^ B[z >>> 8 & 255] ^ F[q & 255] ^ I[k++], U = H[K >>> 24] ^ M[z >>> 16 & 255] ^ B[q >>> 8 & 255] ^ F[j & 255] ^ I[k++], z = H[z >>> 24] ^ M[q >>> 16 & 255] ^ B[j >>> 8 & 255] ^ F[K & 255] ^ I[k++], q = J, j = G, K = U;
|
|
763
|
+
J = (L[q >>> 24] << 24 | L[j >>> 16 & 255] << 16 | L[K >>> 8 & 255] << 8 | L[z & 255]) ^ I[k++], G = (L[j >>> 24] << 24 | L[K >>> 16 & 255] << 16 | L[z >>> 8 & 255] << 8 | L[q & 255]) ^ I[k++], U = (L[K >>> 24] << 24 | L[z >>> 16 & 255] << 16 | L[q >>> 8 & 255] << 8 | L[j & 255]) ^ I[k++], z = (L[z >>> 24] << 24 | L[q >>> 16 & 255] << 16 | L[j >>> 8 & 255] << 8 | L[K & 255]) ^ I[k++], w[C] = J, w[C + 1] = G, w[C + 2] = U, w[C + 3] = z;
|
|
764
764
|
},
|
|
765
765
|
keySize: 8
|
|
766
766
|
});
|
|
@@ -3187,44 +3187,44 @@ function X509(n) {
|
|
|
3187
3187
|
return y(T).replace(/\//, "\\/");
|
|
3188
3188
|
}).join("/");
|
|
3189
3189
|
}, this.getInfo = function() {
|
|
3190
|
-
var v = function(
|
|
3191
|
-
var
|
|
3192
|
-
return
|
|
3193
|
-
}, y = function(
|
|
3194
|
-
for (var
|
|
3190
|
+
var v = function(J) {
|
|
3191
|
+
var G = JSON.stringify(J.array).replace(/[\[\]\{\}\"]/g, "");
|
|
3192
|
+
return G;
|
|
3193
|
+
}, y = function(J) {
|
|
3194
|
+
for (var G = "", U = J.array, z = 0; z < U.length; z++) {
|
|
3195
3195
|
var q = U[z];
|
|
3196
|
-
if (
|
|
3196
|
+
if (G += " policy oid: " + q.policyoid + `
|
|
3197
3197
|
`, q.array !== void 0)
|
|
3198
|
-
for (var
|
|
3199
|
-
var
|
|
3200
|
-
|
|
3198
|
+
for (var j = 0; j < q.array.length; j++) {
|
|
3199
|
+
var K = q.array[j];
|
|
3200
|
+
K.cps !== void 0 && (G += " cps: " + K.cps + `
|
|
3201
3201
|
`);
|
|
3202
3202
|
}
|
|
3203
3203
|
}
|
|
3204
|
-
return
|
|
3205
|
-
}, b = function(
|
|
3206
|
-
for (var
|
|
3204
|
+
return G;
|
|
3205
|
+
}, b = function(J) {
|
|
3206
|
+
for (var G = "", U = J.array, z = 0; z < U.length; z++) {
|
|
3207
3207
|
var q = U[z];
|
|
3208
3208
|
try {
|
|
3209
|
-
q.dpname.full[0].uri !== void 0 && (
|
|
3209
|
+
q.dpname.full[0].uri !== void 0 && (G += " " + q.dpname.full[0].uri + `
|
|
3210
3210
|
`);
|
|
3211
|
-
} catch (
|
|
3211
|
+
} catch (j) {
|
|
3212
3212
|
}
|
|
3213
3213
|
try {
|
|
3214
|
-
q.dname.full[0].dn.hex !== void 0 && (
|
|
3214
|
+
q.dname.full[0].dn.hex !== void 0 && (G += " " + X509.hex2dn(q.dpname.full[0].dn.hex) + `
|
|
3215
3215
|
`);
|
|
3216
|
-
} catch (
|
|
3216
|
+
} catch (j) {
|
|
3217
3217
|
}
|
|
3218
3218
|
}
|
|
3219
|
-
return
|
|
3220
|
-
}, T = function(
|
|
3221
|
-
for (var
|
|
3219
|
+
return G;
|
|
3220
|
+
}, T = function(J) {
|
|
3221
|
+
for (var G = "", U = J.array, z = 0; z < U.length; z++) {
|
|
3222
3222
|
var q = U[z];
|
|
3223
|
-
q.caissuer !== void 0 && (
|
|
3224
|
-
`), q.ocsp !== void 0 && (
|
|
3223
|
+
q.caissuer !== void 0 && (G += " caissuer: " + q.caissuer + `
|
|
3224
|
+
`), q.ocsp !== void 0 && (G += " ocsp: " + q.ocsp + `
|
|
3225
3225
|
`);
|
|
3226
3226
|
}
|
|
3227
|
-
return
|
|
3227
|
+
return G;
|
|
3228
3228
|
}, S, R, w;
|
|
3229
3229
|
if (S = `Basic Fields
|
|
3230
3230
|
`, S += " serial number: " + this.getSerialNumberHex() + `
|
|
@@ -3935,10 +3935,10 @@ var PBMCustomShader = (
|
|
|
3935
3935
|
return !!q;
|
|
3936
3936
|
}).join(`
|
|
3937
3937
|
`));
|
|
3938
|
-
var
|
|
3939
|
-
v.vertexShader = v.vertexShader.replace(/NUM_CLIPPERS/g,
|
|
3940
|
-
for (var
|
|
3941
|
-
var z = U[
|
|
3938
|
+
var J = String(r.clippers.length);
|
|
3939
|
+
v.vertexShader = v.vertexShader.replace(/NUM_CLIPPERS/g, J), v.fragmentShader = v.fragmentShader.replace(/NUM_CLIPPERS/g, J);
|
|
3940
|
+
for (var G = 0, U = B; G < U.length; G++) {
|
|
3941
|
+
var z = U[G];
|
|
3942
3942
|
z.onBeforeCompile && z.onBeforeCompile(v, y);
|
|
3943
3943
|
}
|
|
3944
3944
|
};
|
|
@@ -5140,9 +5140,9 @@ function ajax(n, t, e, r, o) {
|
|
|
5140
5140
|
}
|
|
5141
5141
|
var L = C.split(","), O = (L[0].match(/:(.*?);/) || [])[1], k = L[1];
|
|
5142
5142
|
if (t.responseType === "arraybuffer" || t.responseType === "blob") {
|
|
5143
|
-
for (var D = atob(L[1]),
|
|
5144
|
-
|
|
5145
|
-
t.responseType === "arraybuffer" ? k =
|
|
5143
|
+
for (var D = atob(L[1]), J = D.length, G = new Uint8Array(J), U = 0; U < J; U++)
|
|
5144
|
+
G[U] = D.charCodeAt(U);
|
|
5145
|
+
t.responseType === "arraybuffer" ? k = G.buffer : k = new Blob([G], { type: O });
|
|
5146
5146
|
}
|
|
5147
5147
|
var z = {}, q = {
|
|
5148
5148
|
body: k,
|
|
@@ -6021,7 +6021,7 @@ function dequeue(n) {
|
|
|
6021
6021
|
dequeuing = !1;
|
|
6022
6022
|
}
|
|
6023
6023
|
}
|
|
6024
|
-
function delay(n) {
|
|
6024
|
+
function delay$1(n) {
|
|
6025
6025
|
return new Promise(function(t, e) {
|
|
6026
6026
|
var r = function() {
|
|
6027
6027
|
try {
|
|
@@ -7303,12 +7303,12 @@ function loadPbm(n, t) {
|
|
|
7303
7303
|
responseType: "arraybuffer"
|
|
7304
7304
|
});
|
|
7305
7305
|
}).then(function(b) {
|
|
7306
|
-
return y.byteLength = b.body.byteLength, delay(function() {
|
|
7306
|
+
return y.byteLength = b.body.byteLength, delay$1(function() {
|
|
7307
7307
|
var T = new Uint8Array(b.body);
|
|
7308
7308
|
return Model$2.decode(T);
|
|
7309
7309
|
});
|
|
7310
7310
|
}).then(function(b) {
|
|
7311
|
-
return delay(function() {
|
|
7311
|
+
return delay$1(function() {
|
|
7312
7312
|
return parse$4(b, d, h, p, A, g, f);
|
|
7313
7313
|
});
|
|
7314
7314
|
}).then(function(b) {
|
|
@@ -7365,8 +7365,8 @@ function parsePBMModel(n) {
|
|
|
7365
7365
|
break;
|
|
7366
7366
|
}
|
|
7367
7367
|
}
|
|
7368
|
-
for (var g = n.chunks.sort(function(
|
|
7369
|
-
return chunkOrder(
|
|
7368
|
+
for (var g = n.chunks.sort(function(fe, oe) {
|
|
7369
|
+
return chunkOrder(fe) - chunkOrder(oe);
|
|
7370
7370
|
}), m = [], E = 0, v = g; E < v.length; E++) {
|
|
7371
7371
|
var h = v[E], y = parseFloorName(h.name);
|
|
7372
7372
|
m[y] || (m[y] = []), m[y].push(h);
|
|
@@ -7380,11 +7380,11 @@ function parsePBMModel(n) {
|
|
|
7380
7380
|
S += h.faces.indices.length;
|
|
7381
7381
|
}
|
|
7382
7382
|
for (var w = new Float32Array(S * 3), C = new Float32Array(S * 2), I = new Float32Array(S * 3), H = c ? new Float32Array(S) : void 0, M = [], B = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], F = 0, L = 0; L < T.length; L++) {
|
|
7383
|
-
for (var O = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], h = T[L], k = h.vertices.xyz, D = h.vertices.uvs,
|
|
7384
|
-
var q =
|
|
7383
|
+
for (var O = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], h = T[L], k = h.vertices.xyz, D = h.vertices.uvs, J = h.faces.indices, G = h.faces.normals, U = h.vertices.marks, z = J.length, R = 0; R < z; R++) {
|
|
7384
|
+
var q = J[R], j = w[F * 3 + R * 3] = k[q * 3], K = w[F * 3 + R * 3 + 1] = k[q * 3 + 1], Y = w[F * 3 + R * 3 + 2] = k[q * 3 + 2];
|
|
7385
7385
|
H && (H[F + R] = U[q]), C[F * 2 + R * 2] = D[q * 2], C[F * 2 + R * 2 + 1] = D[q * 2 + 1];
|
|
7386
|
-
var
|
|
7387
|
-
I[F * 3 + R * 3] =
|
|
7386
|
+
var X = Math.floor(R / 3) * 3;
|
|
7387
|
+
I[F * 3 + R * 3] = G[X], I[F * 3 + R * 3 + 1] = G[X + 1], I[F * 3 + R * 3 + 2] = G[X + 2], j < O[0] && (O[0] = j), K < O[1] && (O[1] = K), Y < O[2] && (O[2] = Y), j > O[3] && (O[3] = j), K > O[4] && (O[4] = K), Y > O[5] && (O[5] = Y);
|
|
7388
7388
|
}
|
|
7389
7389
|
O[0] < B[0] && (B[0] = O[0]), O[1] < B[1] && (B[1] = O[1]), O[2] < B[2] && (B[2] = O[2]), O[3] > B[3] && (B[3] = O[3]), O[4] > B[4] && (B[4] = O[4]), O[5] > B[5] && (B[5] = O[5]), M.push({
|
|
7390
7390
|
materialIndex: L,
|
|
@@ -7395,7 +7395,7 @@ function parsePBMModel(n) {
|
|
|
7395
7395
|
texture: (e = h.texture) !== null && e !== void 0 ? e : void 0
|
|
7396
7396
|
}), F += z;
|
|
7397
7397
|
}
|
|
7398
|
-
var
|
|
7398
|
+
var Q = {
|
|
7399
7399
|
createAt: o,
|
|
7400
7400
|
description: s,
|
|
7401
7401
|
vertices: w,
|
|
@@ -7407,20 +7407,20 @@ function parsePBMModel(n) {
|
|
|
7407
7407
|
groups: M,
|
|
7408
7408
|
extents: B
|
|
7409
7409
|
};
|
|
7410
|
-
u.push(
|
|
7410
|
+
u.push(Q);
|
|
7411
7411
|
} else {
|
|
7412
7412
|
for (var S = 0, W = 0, R = 0; R < T.length; R++) {
|
|
7413
7413
|
var h = T[R];
|
|
7414
7414
|
W += h.vertices.xyz.length / 3, S += h.faces.indices.length;
|
|
7415
7415
|
}
|
|
7416
|
-
for (var w = new Float32Array(W * 3), C = new Float32Array(W * 2), I = void 0, $ = new Float32Array(W),
|
|
7417
|
-
for (var O = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], h = T[L], k = h.vertices.xyz, ne = h.vertices.marks, D = h.vertices.uvs,
|
|
7418
|
-
var
|
|
7419
|
-
H && (H[F + R] = ne[R]), C[F * 2 + R * 2] = D[R * 2], C[F * 2 + R * 2 + 1] = D[R * 2 + 1], $[F + R] = b,
|
|
7416
|
+
for (var w = new Float32Array(W * 3), C = new Float32Array(W * 2), I = void 0, $ = new Float32Array(W), ae = new Uint32Array(S), H = c ? new Float32Array(S) : void 0, M = [], B = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], ee = 0, F = 0, L = 0; L < T.length; L++) {
|
|
7417
|
+
for (var O = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], h = T[L], k = h.vertices.xyz, ne = h.vertices.marks, D = h.vertices.uvs, J = h.faces.indices, te = k.length / 3, z = J.length, R = 0; R < te; R++) {
|
|
7418
|
+
var j = w[F * 3 + R * 3] = k[R * 3], K = w[F * 3 + R * 3 + 1] = k[R * 3 + 1], Y = w[F * 3 + R * 3 + 2] = k[R * 3 + 2];
|
|
7419
|
+
H && (H[F + R] = ne[R]), C[F * 2 + R * 2] = D[R * 2], C[F * 2 + R * 2 + 1] = D[R * 2 + 1], $[F + R] = b, j < O[0] && (O[0] = j), K < O[1] && (O[1] = K), Y < O[2] && (O[2] = Y), j > O[3] && (O[3] = j), K > O[4] && (O[4] = K), Y > O[5] && (O[5] = Y);
|
|
7420
7420
|
}
|
|
7421
7421
|
O[0] < B[0] && (B[0] = O[0]), O[1] < B[1] && (B[1] = O[1]), O[2] < B[2] && (B[2] = O[2]), O[3] > B[3] && (B[3] = O[3]), O[4] > B[4] && (B[4] = O[4]), O[5] > B[5] && (B[5] = O[5]);
|
|
7422
7422
|
for (var R = 0; R < z; R++)
|
|
7423
|
-
|
|
7423
|
+
ae[ee + R] = F + J[R];
|
|
7424
7424
|
M.push({
|
|
7425
7425
|
materialIndex: L,
|
|
7426
7426
|
name: h.name,
|
|
@@ -7430,19 +7430,19 @@ function parsePBMModel(n) {
|
|
|
7430
7430
|
texture: (r = h.texture) !== null && r !== void 0 ? r : void 0
|
|
7431
7431
|
}), F += te, ee += z;
|
|
7432
7432
|
}
|
|
7433
|
-
var
|
|
7433
|
+
var Q = {
|
|
7434
7434
|
createAt: o,
|
|
7435
7435
|
description: s,
|
|
7436
7436
|
vertices: w,
|
|
7437
7437
|
uvs: C,
|
|
7438
7438
|
normals: I,
|
|
7439
7439
|
masks: H,
|
|
7440
|
-
indices:
|
|
7440
|
+
indices: ae,
|
|
7441
7441
|
floorIndex: b,
|
|
7442
7442
|
groups: M,
|
|
7443
7443
|
extents: B
|
|
7444
7444
|
};
|
|
7445
|
-
u.push(
|
|
7445
|
+
u.push(Q);
|
|
7446
7446
|
}
|
|
7447
7447
|
}
|
|
7448
7448
|
return u;
|
|
@@ -7477,21 +7477,21 @@ function parse$4(n, t, e, r, o, s, u) {
|
|
|
7477
7477
|
B.addGroup(O.start, O.count, O.materialIndex);
|
|
7478
7478
|
}
|
|
7479
7479
|
p.add(B);
|
|
7480
|
-
for (var k = [], D = 0,
|
|
7481
|
-
var O =
|
|
7482
|
-
U.floorIndex = C, B.attributes.normal === void 0 && (U.flatShading = !0), B.attributes._feature_id_rsmask && (U.defines.USE_VERTEX_MARK = !0), k.push(U),
|
|
7480
|
+
for (var k = [], D = 0, J = I; D < J.length; D++) {
|
|
7481
|
+
var O = J[D], G = r[O.chunkName] || (O.texture ? pathJoin(e || "", O.texture) : void 0), U = new PBMMeshMaterial(t ? "phong" : "basic");
|
|
7482
|
+
U.floorIndex = C, B.attributes.normal === void 0 && (U.flatShading = !0), B.attributes._feature_id_rsmask && (U.defines.USE_VERTEX_MARK = !0), k.push(U), G ? (A++, h[G] ? h[G].push(U) : h[G] = [U]) : U.color = new THREE.Color(16777215), p.add(U);
|
|
7483
7483
|
}
|
|
7484
7484
|
var z = new PBMMesh(B, k);
|
|
7485
7485
|
z.name = "model_floor_" + C, z.userData.createAt = v, z.userData.description = y, z.matrix.compose(z.position, z.quaternion, z.scale), z.matrixAutoUpdate = !1, z.frustumCulled = !1, c = v, d = y, f.push(z);
|
|
7486
7486
|
}
|
|
7487
|
-
var q = function(
|
|
7488
|
-
|
|
7489
|
-
for (var
|
|
7490
|
-
var
|
|
7491
|
-
$ in s && (
|
|
7487
|
+
var q = function(j) {
|
|
7488
|
+
j = autoRestImageOptionsByTextureLength(j, A);
|
|
7489
|
+
for (var K = [], Y = function($) {
|
|
7490
|
+
var ae = null;
|
|
7491
|
+
$ in s && (ae = s[$]), ae || (ae = loadTexture$1($, e, j, u)), K.push(ae.then(function(ee) {
|
|
7492
7492
|
for (var ne = 0, te = h[$]; ne < te.length; ne++) {
|
|
7493
|
-
var
|
|
7494
|
-
|
|
7493
|
+
var fe = te[ne];
|
|
7494
|
+
fe.map && (p.delete(fe.map), fe.map.dispose()), fe.map = ee, p.add(ee);
|
|
7495
7495
|
}
|
|
7496
7496
|
return ee;
|
|
7497
7497
|
}).catch(function() {
|
|
@@ -7501,27 +7501,27 @@ function parse$4(n, t, e, r, o, s, u) {
|
|
|
7501
7501
|
}
|
|
7502
7502
|
return null;
|
|
7503
7503
|
}));
|
|
7504
|
-
},
|
|
7505
|
-
var W =
|
|
7506
|
-
|
|
7504
|
+
}, X = 0, Q = Object.keys(h); X < Q.length; X++) {
|
|
7505
|
+
var W = Q[X];
|
|
7506
|
+
Y(W);
|
|
7507
7507
|
}
|
|
7508
7508
|
for (var W in s)
|
|
7509
7509
|
delete s[W];
|
|
7510
|
-
return Promise.all(
|
|
7511
|
-
return $.filter(function(
|
|
7512
|
-
return
|
|
7510
|
+
return Promise.all(K).then(function($) {
|
|
7511
|
+
return $.filter(function(ae) {
|
|
7512
|
+
return ae;
|
|
7513
7513
|
});
|
|
7514
7514
|
});
|
|
7515
7515
|
};
|
|
7516
|
-
return q(o).then(function(
|
|
7516
|
+
return q(o).then(function(j) {
|
|
7517
7517
|
return {
|
|
7518
7518
|
createAt: c,
|
|
7519
7519
|
description: d,
|
|
7520
7520
|
objects: f,
|
|
7521
|
-
textures:
|
|
7521
|
+
textures: j,
|
|
7522
7522
|
dispose: function() {
|
|
7523
|
-
p.forEach(function(
|
|
7524
|
-
|
|
7523
|
+
p.forEach(function(K) {
|
|
7524
|
+
K.dispose();
|
|
7525
7525
|
}), p.clear();
|
|
7526
7526
|
}
|
|
7527
7527
|
};
|
|
@@ -7893,7 +7893,7 @@ function loadAt3d(n, t) {
|
|
|
7893
7893
|
}).then(function(b) {
|
|
7894
7894
|
return lzma(b.body);
|
|
7895
7895
|
}).then(function(b) {
|
|
7896
|
-
return delay(function() {
|
|
7896
|
+
return delay$1(function() {
|
|
7897
7897
|
for (var T, S = {
|
|
7898
7898
|
chunks: [],
|
|
7899
7899
|
createAt: void 0,
|
|
@@ -7905,7 +7905,7 @@ function loadAt3d(n, t) {
|
|
|
7905
7905
|
return S;
|
|
7906
7906
|
});
|
|
7907
7907
|
}).then(function(b) {
|
|
7908
|
-
return delay(function() {
|
|
7908
|
+
return delay$1(function() {
|
|
7909
7909
|
return parse$4(b, d, h, p, A, g, f);
|
|
7910
7910
|
});
|
|
7911
7911
|
}).then(function(b) {
|
|
@@ -8485,11 +8485,11 @@ function parse$3(n, t, e, r, o) {
|
|
|
8485
8485
|
var M = parseGeometry(T[H].geometry);
|
|
8486
8486
|
M.applyMatrix4(f), f.decompose(h, p, A), A.x * A.y * A.z < 0 && M.attributes.normal && M.attributes.position && M.attributes.uv && flipBufferGeometryNormals(M), l.add(M);
|
|
8487
8487
|
for (var B = [], F = 0, L = T[H].material; F < L.length; F++) {
|
|
8488
|
-
var O = L[F], k = parseMaterial(O, t, e || "", r, d, o, g, l, m), D = k.material,
|
|
8489
|
-
u.push(
|
|
8488
|
+
var O = L[F], k = parseMaterial(O, t, e || "", r, d, o, g, l, m), D = k.material, J = k.textureReady;
|
|
8489
|
+
u.push(J), B.push(D);
|
|
8490
8490
|
}
|
|
8491
|
-
var
|
|
8492
|
-
|
|
8491
|
+
var G = new PBMMesh(M, B);
|
|
8492
|
+
G.name = "chunk_" + H, G.matrix.compose(G.position, G.quaternion, G.scale), G.matrixAutoUpdate = !1, G.frustumCulled = !1, I.add(G);
|
|
8493
8493
|
}
|
|
8494
8494
|
I.name = b, s.push(I);
|
|
8495
8495
|
}
|
|
@@ -8914,38 +8914,38 @@ var Parser = (
|
|
|
8914
8914
|
Promise.all(A),
|
|
8915
8915
|
Promise.all(g)
|
|
8916
8916
|
]).then(function(w) {
|
|
8917
|
-
for (var C = w[0], I = w[1], H = w[2], M = w[3], B = w[4], F = [], L = function(
|
|
8918
|
-
var U = C[
|
|
8917
|
+
for (var C = w[0], I = w[1], H = w[2], M = w[3], B = w[4], F = [], L = function(J, G) {
|
|
8918
|
+
var U = C[J], z = I[J], q = H[J], j = M[J], K = B[J];
|
|
8919
8919
|
if (U === void 0)
|
|
8920
8920
|
return "continue";
|
|
8921
8921
|
U.updateMatrix(), U.matrixAutoUpdate = !0;
|
|
8922
|
-
var
|
|
8923
|
-
switch (PATH_PROPERTIES[
|
|
8922
|
+
var Y = void 0;
|
|
8923
|
+
switch (PATH_PROPERTIES[K.path]) {
|
|
8924
8924
|
case PATH_PROPERTIES.weights:
|
|
8925
|
-
|
|
8925
|
+
Y = THREE.NumberKeyframeTrack;
|
|
8926
8926
|
break;
|
|
8927
8927
|
case PATH_PROPERTIES.rotation:
|
|
8928
|
-
|
|
8928
|
+
Y = THREE.QuaternionKeyframeTrack;
|
|
8929
8929
|
break;
|
|
8930
8930
|
case PATH_PROPERTIES.position:
|
|
8931
8931
|
case PATH_PROPERTIES.scale:
|
|
8932
8932
|
default:
|
|
8933
|
-
|
|
8933
|
+
Y = THREE.VectorKeyframeTrack;
|
|
8934
8934
|
break;
|
|
8935
8935
|
}
|
|
8936
|
-
var
|
|
8937
|
-
PATH_PROPERTIES[
|
|
8938
|
-
|
|
8939
|
-
}) : W.push(
|
|
8936
|
+
var X = U.name ? U.name : U.uuid, Q = j.interpolation !== void 0 ? INTERPOLATION[j.interpolation] : THREE.InterpolateLinear, W = [];
|
|
8937
|
+
PATH_PROPERTIES[K.path] === PATH_PROPERTIES.weights ? U.traverse(function(oe) {
|
|
8938
|
+
oe.morphTargetInfluences && W.push(oe.name ? oe.name : oe.uuid);
|
|
8939
|
+
}) : W.push(X);
|
|
8940
8940
|
var $ = q.array;
|
|
8941
8941
|
if (q.normalized) {
|
|
8942
|
-
for (var
|
|
8943
|
-
ee[ne] = $[ne] *
|
|
8942
|
+
for (var ae = getNormalizedComponentScale($.constructor), ee = new Float32Array($.length), ne = 0, te = $.length; ne < te; ne++)
|
|
8943
|
+
ee[ne] = $[ne] * ae;
|
|
8944
8944
|
$ = ee;
|
|
8945
8945
|
}
|
|
8946
8946
|
for (var ne = 0, te = W.length; ne < te; ne++) {
|
|
8947
|
-
var
|
|
8948
|
-
F.push(
|
|
8947
|
+
var fe = new Y(W[ne] + "." + PATH_PROPERTIES[K.path], z.array, $, Q);
|
|
8948
|
+
F.push(fe);
|
|
8949
8949
|
}
|
|
8950
8950
|
}, O = 0, k = C.length; O < k; O++)
|
|
8951
8951
|
L(O);
|
|
@@ -11632,8 +11632,8 @@ var flrm = /* @__PURE__ */ hMap(flt, 9, 1), fdrm = /* @__PURE__ */ hMap(fdt, 5,
|
|
|
11632
11632
|
I[M++] = k;
|
|
11633
11633
|
}
|
|
11634
11634
|
}
|
|
11635
|
-
var
|
|
11636
|
-
m = max(
|
|
11635
|
+
var J = I.subarray(0, R), G = I.subarray(R);
|
|
11636
|
+
m = max(J), E = max(G), A = hMap(J, m, 1), g = hMap(G, E, 1);
|
|
11637
11637
|
} else
|
|
11638
11638
|
err(1);
|
|
11639
11639
|
else {
|
|
@@ -11652,42 +11652,42 @@ var flrm = /* @__PURE__ */ hMap(flt, 9, 1), fdrm = /* @__PURE__ */ hMap(fdt, 5,
|
|
|
11652
11652
|
}
|
|
11653
11653
|
l && d(p + 131072);
|
|
11654
11654
|
for (var U = (1 << m) - 1, z = (1 << E) - 1, q = h; ; q = h) {
|
|
11655
|
-
var k = A[bits16(n, h) & U],
|
|
11655
|
+
var k = A[bits16(n, h) & U], j = k >> 4;
|
|
11656
11656
|
if (h += k & 15, h > v) {
|
|
11657
11657
|
c && err(0);
|
|
11658
11658
|
break;
|
|
11659
11659
|
}
|
|
11660
|
-
if (k || err(2),
|
|
11661
|
-
e[p++] =
|
|
11662
|
-
else if (
|
|
11660
|
+
if (k || err(2), j < 256)
|
|
11661
|
+
e[p++] = j;
|
|
11662
|
+
else if (j == 256) {
|
|
11663
11663
|
q = h, A = null;
|
|
11664
11664
|
break;
|
|
11665
11665
|
} else {
|
|
11666
|
-
var
|
|
11667
|
-
if (
|
|
11668
|
-
var M =
|
|
11669
|
-
|
|
11670
|
-
}
|
|
11671
|
-
var
|
|
11672
|
-
|
|
11673
|
-
var
|
|
11674
|
-
if (
|
|
11675
|
-
var
|
|
11676
|
-
|
|
11666
|
+
var K = j - 254;
|
|
11667
|
+
if (j > 264) {
|
|
11668
|
+
var M = j - 257, Y = fleb[M];
|
|
11669
|
+
K = bits(n, h, (1 << Y) - 1) + fl[M], h += Y;
|
|
11670
|
+
}
|
|
11671
|
+
var X = g[bits16(n, h) & z], Q = X >> 4;
|
|
11672
|
+
X || err(3), h += X & 15;
|
|
11673
|
+
var G = fd[Q];
|
|
11674
|
+
if (Q > 3) {
|
|
11675
|
+
var Y = fdeb[Q];
|
|
11676
|
+
G += bits16(n, h) & (1 << Y) - 1, h += Y;
|
|
11677
11677
|
}
|
|
11678
11678
|
if (h > v) {
|
|
11679
11679
|
c && err(0);
|
|
11680
11680
|
break;
|
|
11681
11681
|
}
|
|
11682
11682
|
l && d(p + 131072);
|
|
11683
|
-
var W = p +
|
|
11684
|
-
if (p <
|
|
11685
|
-
var $ = s -
|
|
11686
|
-
for ($ + p < 0 && err(3); p <
|
|
11683
|
+
var W = p + K;
|
|
11684
|
+
if (p < G) {
|
|
11685
|
+
var $ = s - G, ae = Math.min(G, W);
|
|
11686
|
+
for ($ + p < 0 && err(3); p < ae; ++p)
|
|
11687
11687
|
e[p] = r[$ + p];
|
|
11688
11688
|
}
|
|
11689
11689
|
for (; p < W; ++p)
|
|
11690
|
-
e[p] = e[p -
|
|
11690
|
+
e[p] = e[p - G];
|
|
11691
11691
|
}
|
|
11692
11692
|
}
|
|
11693
11693
|
t.l = A, t.p = q, t.b = p, t.f = f, A && (f = 1, t.m = m, t.d = g, t.n = E);
|
|
@@ -13377,61 +13377,61 @@ function loadX3p(n, t) {
|
|
|
13377
13377
|
});
|
|
13378
13378
|
}
|
|
13379
13379
|
function parse$1(n, t) {
|
|
13380
|
-
for (var e, r, o, s, u, l, c, d, f, h, p, A, g, m, E, v, y, b, T, S, R, w, C, I, H, M, B, F, L, O, k, D,
|
|
13381
|
-
var
|
|
13382
|
-
/(^|\/)main\.xml$/i.test(
|
|
13380
|
+
for (var e, r, o, s, u, l, c, d, f, h, p, A, g, m, E, v, y, b, T, S, R, w, C, I, H, M, B, F, L, O, k, D, J, G, U, z, q, j, K, Y, X, Q, W, $, ae, ee, ne, te, fe, oe, he, me, be, Te, le = unzipSync(n), de = "", re = null, ue = 0, ve = Object.keys(le); ue < ve.length; ue++) {
|
|
13381
|
+
var ye = ve[ue];
|
|
13382
|
+
/(^|\/)main\.xml$/i.test(ye) && (re = le[ye], de = ye.slice(0, ye.lastIndexOf("/") + 1));
|
|
13383
13383
|
}
|
|
13384
|
-
if (!
|
|
13384
|
+
if (!re)
|
|
13385
13385
|
throw new Error("X3p: main.xml not found.");
|
|
13386
13386
|
if (typeof DOMParser == "undefined")
|
|
13387
13387
|
throw new Error("X3p: DOMParser not found.");
|
|
13388
|
-
var
|
|
13388
|
+
var De = (e = t.color) !== null && e !== void 0 ? e : new THREE.Color(10066329), Je = new DOMParser(), $e = decodeText(re), Ue = Je.parseFromString($e, "text/xml"), pe = Ue.querySelector("Record1 Axes"), Ye = {
|
|
13389
13389
|
x: {
|
|
13390
|
-
type: (s = (o = (r =
|
|
13391
|
-
dataType: (c = (l = (u =
|
|
13392
|
-
increment: Number((f = (d =
|
|
13393
|
-
offset: Number((p = (h =
|
|
13390
|
+
type: (s = (o = (r = pe == null ? void 0 : pe.querySelector("CX AxisType")) === null || r === void 0 ? void 0 : r.textContent) === null || o === void 0 ? void 0 : o.toUpperCase()) !== null && s !== void 0 ? s : "I",
|
|
13391
|
+
dataType: (c = (l = (u = pe == null ? void 0 : pe.querySelector("CX DataType")) === null || u === void 0 ? void 0 : u.textContent) === null || l === void 0 ? void 0 : l.toUpperCase()) !== null && c !== void 0 ? c : "D",
|
|
13392
|
+
increment: Number((f = (d = pe == null ? void 0 : pe.querySelector("CX Increment")) === null || d === void 0 ? void 0 : d.textContent) !== null && f !== void 0 ? f : "1"),
|
|
13393
|
+
offset: Number((p = (h = pe == null ? void 0 : pe.querySelector("CX Offset")) === null || h === void 0 ? void 0 : h.textContent) !== null && p !== void 0 ? p : "0")
|
|
13394
13394
|
},
|
|
13395
13395
|
y: {
|
|
13396
|
-
type: (m = (g = (A =
|
|
13397
|
-
dataType: (y = (v = (E =
|
|
13398
|
-
increment: Number((T = (b =
|
|
13399
|
-
offset: Number((R = (S =
|
|
13396
|
+
type: (m = (g = (A = pe == null ? void 0 : pe.querySelector("CY AxisType")) === null || A === void 0 ? void 0 : A.textContent) === null || g === void 0 ? void 0 : g.toUpperCase()) !== null && m !== void 0 ? m : "I",
|
|
13397
|
+
dataType: (y = (v = (E = pe == null ? void 0 : pe.querySelector("CY DataType")) === null || E === void 0 ? void 0 : E.textContent) === null || v === void 0 ? void 0 : v.toUpperCase()) !== null && y !== void 0 ? y : "D",
|
|
13398
|
+
increment: Number((T = (b = pe == null ? void 0 : pe.querySelector("CY Increment")) === null || b === void 0 ? void 0 : b.textContent) !== null && T !== void 0 ? T : "1"),
|
|
13399
|
+
offset: Number((R = (S = pe == null ? void 0 : pe.querySelector("CY Offset")) === null || S === void 0 ? void 0 : S.textContent) !== null && R !== void 0 ? R : "0")
|
|
13400
13400
|
},
|
|
13401
13401
|
z: {
|
|
13402
|
-
type: (I = (C = (w =
|
|
13403
|
-
dataType: (B = (M = (H =
|
|
13404
|
-
increment: Number((L = (F =
|
|
13405
|
-
offset: Number((k = (O =
|
|
13406
|
-
}
|
|
13407
|
-
}, Ee = null, Oe =
|
|
13408
|
-
Oe && (Ee = new THREE.Matrix3(), Ee.set(Number((
|
|
13409
|
-
var Fe = (
|
|
13402
|
+
type: (I = (C = (w = pe == null ? void 0 : pe.querySelector("CZ AxisType")) === null || w === void 0 ? void 0 : w.textContent) === null || C === void 0 ? void 0 : C.toUpperCase()) !== null && I !== void 0 ? I : "A",
|
|
13403
|
+
dataType: (B = (M = (H = pe == null ? void 0 : pe.querySelector("CZ DataType")) === null || H === void 0 ? void 0 : H.textContent) === null || M === void 0 ? void 0 : M.toUpperCase()) !== null && B !== void 0 ? B : "D",
|
|
13404
|
+
increment: Number((L = (F = pe == null ? void 0 : pe.querySelector("CZ Increment")) === null || F === void 0 ? void 0 : F.textContent) !== null && L !== void 0 ? L : "1"),
|
|
13405
|
+
offset: Number((k = (O = pe == null ? void 0 : pe.querySelector("CZ Offset")) === null || O === void 0 ? void 0 : O.textContent) !== null && k !== void 0 ? k : "0")
|
|
13406
|
+
}
|
|
13407
|
+
}, Ee = null, Oe = Ue.querySelector("Record1 Axes Rotation");
|
|
13408
|
+
Oe && (Ee = new THREE.Matrix3(), Ee.set(Number((J = (D = Oe.querySelector("r11")) === null || D === void 0 ? void 0 : D.textContent) !== null && J !== void 0 ? J : 0), Number((U = (G = Oe.querySelector("r12")) === null || G === void 0 ? void 0 : G.textContent) !== null && U !== void 0 ? U : 0), Number((q = (z = Oe.querySelector("r13")) === null || z === void 0 ? void 0 : z.textContent) !== null && q !== void 0 ? q : 0), Number((K = (j = Oe.querySelector("r21")) === null || j === void 0 ? void 0 : j.textContent) !== null && K !== void 0 ? K : 0), Number((X = (Y = Oe.querySelector("r22")) === null || Y === void 0 ? void 0 : Y.textContent) !== null && X !== void 0 ? X : 0), Number((W = (Q = Oe.querySelector("r23")) === null || Q === void 0 ? void 0 : Q.textContent) !== null && W !== void 0 ? W : 0), Number((ae = ($ = Oe.querySelector("r31")) === null || $ === void 0 ? void 0 : $.textContent) !== null && ae !== void 0 ? ae : 0), Number((ne = (ee = Oe.querySelector("r32")) === null || ee === void 0 ? void 0 : ee.textContent) !== null && ne !== void 0 ? ne : 0), Number((fe = (te = Oe.querySelector("r33")) === null || te === void 0 ? void 0 : te.textContent) !== null && fe !== void 0 ? fe : 0)));
|
|
13409
|
+
var Fe = (oe = Ue.querySelector("Record3 DataLink PointDataLink")) === null || oe === void 0 ? void 0 : oe.textContent;
|
|
13410
13410
|
if (typeof Fe != "string")
|
|
13411
13411
|
throw new Error("X3p: PointDataLink not found.");
|
|
13412
|
-
Fe = pathJoin(
|
|
13413
|
-
var tt =
|
|
13412
|
+
Fe = pathJoin(de, Fe);
|
|
13413
|
+
var tt = le[Fe];
|
|
13414
13414
|
if (!tt)
|
|
13415
13415
|
throw new Error("X3p: ".concat(tt, " not found."));
|
|
13416
|
-
for (var rt = getPointArray(tt.buffer,
|
|
13417
|
-
for (var gt = Qe *
|
|
13418
|
-
var
|
|
13419
|
-
_vector.set(dt, -gt, nt), Ee && _vector.applyMatrix3(Ee), Ge && At.expandByPoint(_vector), je[
|
|
13416
|
+
for (var rt = getPointArray(tt.buffer, Ye.z.dataType), Le = Number((me = (he = Ue.querySelector("Record3 MatrixDimension SizeX")) === null || he === void 0 ? void 0 : he.textContent) !== null && me !== void 0 ? me : "0"), Pe = Number((Te = (be = Ue.querySelector("Record3 MatrixDimension SizeY")) === null || be === void 0 ? void 0 : be.textContent) !== null && Te !== void 0 ? Te : "0"), _e = Math.floor(Le - 1), Ae = Math.floor(Pe - 1), Ce = _e + 1, Be = Ae + 1, je = new Float32Array(Ce * Be * 3), Ve = new Float32Array(Ce * Be * 2), Ze = new Uint32Array(_e * Ae * 6), At = new THREE.Box3(), Qe = 0; Qe < Be; Qe++)
|
|
13417
|
+
for (var gt = Qe * Ye.y.increment + Ye.y.offset, we = 0; we < Ce; we++) {
|
|
13418
|
+
var qe = Qe * Ce + we, dt = we * Ye.x.increment + Ye.x.offset, ht = rt[qe], Ge = !isNaN(ht), nt = Ge ? ht : NaN;
|
|
13419
|
+
_vector.set(dt, -gt, nt), Ee && _vector.applyMatrix3(Ee), Ge && At.expandByPoint(_vector), je[qe * 3 + 0] = _vector.x, je[qe * 3 + 1] = _vector.y, je[qe * 3 + 2] = _vector.z, Ve[qe * 2 + 0] = we / _e, Ve[qe * 2 + 1] = 1 - Qe / Ae;
|
|
13420
13420
|
}
|
|
13421
13421
|
for (var Qe = 0; Qe < Ae; Qe++)
|
|
13422
13422
|
for (var we = 0; we < _e; we++) {
|
|
13423
|
-
var ct = we + Ce * Qe,
|
|
13424
|
-
|
|
13423
|
+
var ct = we + Ce * Qe, se = we + Ce * (Qe + 1), xe = we + 1 + Ce * (Qe + 1), Ie = we + 1 + Ce * Qe, Se = (Qe * _e + we) * 6;
|
|
13424
|
+
Ze[Se + 0] = ct, Ze[Se + 1] = se, Ze[Se + 2] = Ie, Ze[Se + 3] = se, Ze[Se + 4] = xe, Ze[Se + 5] = Ie;
|
|
13425
13425
|
}
|
|
13426
|
-
var
|
|
13427
|
-
|
|
13426
|
+
var ze = new THREE.BufferGeometry();
|
|
13427
|
+
ze.setAttribute("position", new THREE.BufferAttribute(je, 3)), ze.setAttribute("uv", new THREE.BufferAttribute(Ve, 2)), ze.setIndex(new THREE.BufferAttribute(Ze, 1)), (!ze.groups || ze.groups.length === 0) && ze.addGroup(0, ze.index ? ze.index.count : ze.attributes.position.count, 0), ze.boundingBox = At;
|
|
13428
13428
|
var it = new PBMMeshMaterial(t.light ? "phong" : "basic");
|
|
13429
|
-
it.flatShading = !0, it.color.copy(
|
|
13430
|
-
var yt = new PBMMesh(
|
|
13429
|
+
it.flatShading = !0, it.color.copy(De);
|
|
13430
|
+
var yt = new PBMMesh(ze, [it]);
|
|
13431
13431
|
return {
|
|
13432
13432
|
object: yt,
|
|
13433
13433
|
dispose: function() {
|
|
13434
|
-
|
|
13434
|
+
ze.dispose(), it.dispose();
|
|
13435
13435
|
}
|
|
13436
13436
|
};
|
|
13437
13437
|
}
|
|
@@ -13951,10 +13951,10 @@ function packBVHNode(n, t) {
|
|
|
13951
13951
|
c = l.id * BYTES_PER_NODE / 4, r[c] = l.extents[0], r[c + 1] = l.extents[1], r[c + 2] = l.extents[2], r[c + 3] = l.extents[3], r[c + 4] = l.extents[4], r[c + 5] = l.extents[5], o[c + 6] = l.startIndex, o[c + 7] = l.endIndex, c = l.id * BYTES_PER_NODE / 2, l.node0 && (s[c + 16] = l.node0.id, u.push(l.node0)), l.node1 && (s[c + 17] = l.node1.id, u.push(l.node1));
|
|
13952
13952
|
return e;
|
|
13953
13953
|
}
|
|
13954
|
-
function intersectNodeBox(n, t, e, r
|
|
13955
|
-
|
|
13956
|
-
var d =
|
|
13957
|
-
return t.x >= 0 ? (
|
|
13954
|
+
function intersectNodeBox(n, t, e, r) {
|
|
13955
|
+
r === void 0 && (r = 0);
|
|
13956
|
+
var o = e.min.x - r, s = e.min.y - r, u = e.min.z - r, l = e.max.x + r, c = e.max.y + r, d = e.max.z + r, f = 0, h = 0, p = 0, A = 0, g = 0, m = 0;
|
|
13957
|
+
return t.x >= 0 ? (f = (o - n.x) * t.x, h = (l - n.x) * t.x) : (f = (l - n.x) * t.x, h = (o - n.x) * t.x), t.y >= 0 ? (p = (s - n.y) * t.y, A = (c - n.y) * t.y) : (p = (c - n.y) * t.y, A = (s - n.y) * t.y), f > A || p > h || ((p > f || f !== f) && (f = p), (A < h || h !== h) && (h = A), t.z >= 0 ? (g = (u - n.z) * t.z, m = (d - n.z) * t.z) : (g = (d - n.z) * t.z, m = (u - n.z) * t.z), f > m || g > h) || ((g > f || f !== f) && (f = g), (m < h || h !== h) && (h = m), h < 0) ? null : f >= 0 ? f : h;
|
|
13958
13958
|
}
|
|
13959
13959
|
var BVHVector3 = (
|
|
13960
13960
|
/** @class */
|
|
@@ -13998,8 +13998,16 @@ var BVHVector3 = (
|
|
|
13998
13998
|
), BVHIntersect = (
|
|
13999
13999
|
/** @class */
|
|
14000
14000
|
/* @__PURE__ */ (function() {
|
|
14001
|
-
function n(t, e, r) {
|
|
14002
|
-
this.
|
|
14001
|
+
function n(t, e, r, o, s) {
|
|
14002
|
+
this.pointA = t, this.pointB = e, this.pointC = r, this.index = o, this.intersectionPoint = s;
|
|
14003
|
+
}
|
|
14004
|
+
return n;
|
|
14005
|
+
})()
|
|
14006
|
+
), BVHBox3 = (
|
|
14007
|
+
/** @class */
|
|
14008
|
+
/* @__PURE__ */ (function() {
|
|
14009
|
+
function n(t, e) {
|
|
14010
|
+
this.min = t, this.max = e;
|
|
14003
14011
|
}
|
|
14004
14012
|
return n;
|
|
14005
14013
|
})()
|
|
@@ -14014,11 +14022,15 @@ var BVHVector3 = (
|
|
|
14014
14022
|
r = Math.min(r, 16);
|
|
14015
14023
|
var s = this.getPositionCount() / 3, u = s > 65535 ? new Uint32Array(s) : new Uint16Array(s), l = new Float32Array(s * 6), c = [], d = 0, f = -1;
|
|
14016
14024
|
if (o)
|
|
14017
|
-
for (var h = 0
|
|
14025
|
+
for (var h = 0; h < s; h += 1) {
|
|
14026
|
+
var p = h * 3, A = h * 6, g = void 0, m = void 0, E = void 0, v = void 0, y = void 0, b = void 0, T = void 0;
|
|
14018
14027
|
u[h] = h, this.getPositionByIndex(p, scratchVector3A), this.getPositionByIndex(p + 1, scratchVector3B), this.getPositionByIndex(p + 2, scratchVector3C), g = v = scratchVector3A.x, T = scratchVector3B.x, T < g && (g = T), T > v && (v = T), T = scratchVector3C.x, T < g && (g = T), T > v && (v = T), m = y = scratchVector3A.y, T = scratchVector3B.y, T < m && (m = T), T > y && (y = T), T = scratchVector3C.y, T < m && (m = T), T > y && (y = T), E = b = scratchVector3A.z, T = scratchVector3B.z, T < E && (E = T), T > b && (b = T), T = scratchVector3C.z, T < E && (E = T), T > b && (b = T), l[A] = g, l[A + 1] = m, l[A + 2] = E, l[A + 3] = v, l[A + 4] = y, l[A + 5] = b;
|
|
14028
|
+
}
|
|
14019
14029
|
else {
|
|
14020
|
-
for (var S = 1 / 0, R = 1 / 0, w = 1 / 0, C = -1 / 0, I = -1 / 0, H = -1 / 0, h = 0
|
|
14030
|
+
for (var S = 1 / 0, R = 1 / 0, w = 1 / 0, C = -1 / 0, I = -1 / 0, H = -1 / 0, h = 0; h < s; h += 1) {
|
|
14031
|
+
var p = h * 3, A = h * 6, g = void 0, m = void 0, E = void 0, v = void 0, y = void 0, b = void 0, T = void 0;
|
|
14021
14032
|
u[h] = h, this.getPositionByIndex(p, scratchVector3A), this.getPositionByIndex(p + 1, scratchVector3B), this.getPositionByIndex(p + 2, scratchVector3C), g = v = scratchVector3A.x, T = scratchVector3B.x, T < g && (g = T), T > v && (v = T), T = scratchVector3C.x, T < g && (g = T), T > v && (v = T), m = y = scratchVector3A.y, T = scratchVector3B.y, T < m && (m = T), T > y && (y = T), T = scratchVector3C.y, T < m && (m = T), T > y && (y = T), E = b = scratchVector3A.z, T = scratchVector3B.z, T < E && (E = T), T > b && (b = T), T = scratchVector3C.z, T < E && (E = T), T > b && (b = T), l[A] = g, l[A + 1] = m, l[A + 2] = E, l[A + 3] = v, l[A + 4] = y, l[A + 5] = b, g < S && (S = g), v > C && (C = v), m < R && (R = m), y > I && (I = y), E < w && (w = E), b > H && (H = b);
|
|
14033
|
+
}
|
|
14022
14034
|
o = [S, R, w, C, I, H];
|
|
14023
14035
|
}
|
|
14024
14036
|
var M = new BVHNode(++f, o, 0, s, 0);
|
|
@@ -14027,16 +14039,16 @@ var BVHVector3 = (
|
|
|
14027
14039
|
return B[D] - B[k];
|
|
14028
14040
|
};
|
|
14029
14041
|
function O(k) {
|
|
14030
|
-
var D = k.startIndex,
|
|
14031
|
-
B[0] =
|
|
14042
|
+
var D = k.startIndex, J = k.endIndex, G = k.extents;
|
|
14043
|
+
B[0] = G[3] - G[0], B[1] = G[4] - G[1], B[2] = G[5] - G[2], F.sort(L);
|
|
14032
14044
|
for (var U = 0; U < 3; U++) {
|
|
14033
|
-
for (var z = F[U], q =
|
|
14034
|
-
|
|
14035
|
-
if (
|
|
14036
|
-
var
|
|
14037
|
-
|
|
14038
|
-
var W = new BVHNode(++f, calcExtents(u, l,
|
|
14039
|
-
W.deepth < r && W.endIndex - W.startIndex > e && (c[d++] = W), k.node0 =
|
|
14045
|
+
for (var z = F[U], q = G[z] + G[z + 3], j = D, K = J - 1, Y = -1, X = void 0; j <= K; )
|
|
14046
|
+
Y === -1 ? (X = u[j], l[X * 6 + z] + l[X * 6 + z + 3] < q ? j++ : Y = X) : (X = u[K], l[X * 6 + z] + l[X * 6 + z + 3] >= q || (u[j] = X, u[K] = Y, Y = -1, j++), K--);
|
|
14047
|
+
if (j > D && j < J) {
|
|
14048
|
+
var Q = new BVHNode(++f, calcExtents(u, l, D, j, EPSILON$1), D, j, k.deepth + 1);
|
|
14049
|
+
Q.deepth < r && Q.endIndex - Q.startIndex > e && (c[d++] = Q);
|
|
14050
|
+
var W = new BVHNode(++f, calcExtents(u, l, j, J, EPSILON$1), j, J, k.deepth + 1);
|
|
14051
|
+
W.deepth < r && W.endIndex - W.startIndex > e && (c[d++] = W), k.node0 = Q, k.node1 = W, k.startIndex = 0, k.endIndex = 0;
|
|
14040
14052
|
break;
|
|
14041
14053
|
}
|
|
14042
14054
|
}
|
|
@@ -14045,35 +14057,59 @@ var BVHVector3 = (
|
|
|
14045
14057
|
O(c[--d]);
|
|
14046
14058
|
return this.offsetArray = u, this.rootNodePacked = packBVHNode(M, f + 1), c.length = 0, this;
|
|
14047
14059
|
}, t.prototype.trianglesInSphere = function(e, r) {
|
|
14048
|
-
for (var o = this.offsetArray, s = this.rootNodePacked, u = new Float32Array(s), l = new Uint32Array(s), c = new Uint16Array(s), d = [0], f = [], h
|
|
14049
|
-
|
|
14050
|
-
|
|
14051
|
-
|
|
14052
|
-
|
|
14053
|
-
f.push(
|
|
14054
|
-
|
|
14060
|
+
for (var o = this.offsetArray, s = this.rootNodePacked, u = new Float32Array(s), l = new Uint32Array(s), c = new Uint16Array(s), d = [0], f = [], h; (h = d.pop()) !== void 0; ) {
|
|
14061
|
+
var p = h * BYTES_PER_NODE / 4, A = clamp(e.x, u[p], u[p + 3]) - e.x, g = clamp(e.y, u[p + 1], u[p + 4]) - e.y, m = clamp(e.z, u[p + 2], u[p + 5]) - e.z;
|
|
14062
|
+
if (A * A + g * g + m * m <= r * r) {
|
|
14063
|
+
for (var E = l[p + 6], v = l[p + 7], y = E; y < v; y++) {
|
|
14064
|
+
var b = o[y];
|
|
14065
|
+
f.push(b);
|
|
14066
|
+
}
|
|
14067
|
+
var T = h * BYTES_PER_NODE / 2, S = c[T + 16], R = c[T + 17];
|
|
14068
|
+
S && d.push(S), R && d.push(R);
|
|
14055
14069
|
}
|
|
14056
14070
|
}
|
|
14057
|
-
for (var
|
|
14058
|
-
var
|
|
14059
|
-
this.getPositionByIndex(
|
|
14071
|
+
for (var w = f.length, C = new Float32Array(w * 9), y = 0; y < w; y++) {
|
|
14072
|
+
var b = f[y], I = b * 3;
|
|
14073
|
+
this.getPositionByIndex(I, scratchVector3$9), C[y * 9] = scratchVector3$9.x, C[y * 9 + 1] = scratchVector3$9.y, C[y * 9 + 2] = scratchVector3$9.z, this.getPositionByIndex(I + 1, scratchVector3$9), C[y * 9 + 3] = scratchVector3$9.x, C[y * 9 + 4] = scratchVector3$9.y, C[y * 9 + 5] = scratchVector3$9.z, this.getPositionByIndex(I + 2, scratchVector3$9), C[y * 9 + 6] = scratchVector3$9.x, C[y * 9 + 7] = scratchVector3$9.y, C[y * 9 + 8] = scratchVector3$9.z;
|
|
14060
14074
|
}
|
|
14061
|
-
return
|
|
14075
|
+
return C;
|
|
14062
14076
|
}, t.prototype.intersectRay = function(e, r, o, s, u) {
|
|
14063
14077
|
o === void 0 && (o = 0), s === void 0 && (s = !1);
|
|
14064
|
-
for (var l = [], c = this.offsetArray, d = this.rootNodePacked, f = new Float32Array(d), h = new Uint32Array(d), p = new Uint16Array(d), A = new BVHVector3(1 / r.x, 1 / r.y, 1 / r.z), g = [0], m, E
|
|
14065
|
-
|
|
14066
|
-
|
|
14067
|
-
|
|
14068
|
-
|
|
14069
|
-
|
|
14070
|
-
|
|
14078
|
+
for (var l = [], c = this.offsetArray, d = this.rootNodePacked, f = new Float32Array(d), h = new Uint32Array(d), p = new Uint16Array(d), A = new BVHVector3(1 / r.x, 1 / r.y, 1 / r.z), g = [0], m, E = new BVHBox3(new BVHVector3(0, 0, 0), new BVHVector3(0, 0, 0)), v = 1 / 0; (m = g.pop()) !== void 0; ) {
|
|
14079
|
+
var y = m * BYTES_PER_NODE / 4;
|
|
14080
|
+
E.min.x = f[y], E.min.y = f[y + 1], E.min.z = f[y + 2], E.max.x = f[y + 3], E.max.y = f[y + 4], E.max.z = f[y + 5];
|
|
14081
|
+
var b = intersectNodeBox(e, A, E, o);
|
|
14082
|
+
if (b !== null && !(s && b > v)) {
|
|
14083
|
+
for (var T = e.x, S = e.y, R = e.z, w = r.x, C = r.y, I = r.z, H = h[y + 6], M = h[y + 7], B = H; B < M; B++) {
|
|
14084
|
+
var F = c[B], L = F * 3, O = new BVHVector3(0, 0, 0);
|
|
14085
|
+
this.getPositionByIndex(L, O);
|
|
14086
|
+
var k = O.x, D = O.y, J = O.z, G = new BVHVector3(0, 0, 0);
|
|
14087
|
+
this.getPositionByIndex(L + 1, G);
|
|
14088
|
+
var U = G.x, z = G.y, q = G.z, j = new BVHVector3(0, 0, 0);
|
|
14089
|
+
this.getPositionByIndex(L + 2, j);
|
|
14090
|
+
var K = j.x, Y = j.y, X = j.z, Q = U - k, W = z - D, $ = q - J, ae = K - k, ee = Y - D, ne = X - J, te = W * ne - $ * ee, fe = $ * ae - Q * ne, oe = Q * ee - W * ae, he = w * te + C * fe + I * oe, me = void 0;
|
|
14091
|
+
if (he > 0)
|
|
14092
|
+
me = 1;
|
|
14093
|
+
else if (he < 0)
|
|
14094
|
+
me = -1, he = -he;
|
|
14071
14095
|
else
|
|
14072
14096
|
continue;
|
|
14073
|
-
|
|
14097
|
+
var be = T - k, Te = S - D, le = R - J, de = me * (w * (Te * ne - le * ee) + C * (le * ae - be * ne) + I * (be * ee - Te * ae));
|
|
14098
|
+
if (!(de < 0)) {
|
|
14099
|
+
var re = me * (w * (W * le - $ * Te) + C * ($ * be - Q * le) + I * (Q * Te - W * be));
|
|
14100
|
+
if (!(re < 0) && !(de + re > he)) {
|
|
14101
|
+
var ue = -me * (be * te + Te * fe + le * oe);
|
|
14102
|
+
if (!(ue < 0)) {
|
|
14103
|
+
var ve = ue / he, ye = new BVHVector3(T + w * ve, S + C * ve, R + I * ve), De = new BVHIntersect(O, G, j, F, ye);
|
|
14104
|
+
(!u || u(De)) && (s ? ve < v && (v = ve, l.length > 0 && (l.length = 0), l.push(De)) : l.push(De));
|
|
14105
|
+
}
|
|
14106
|
+
}
|
|
14107
|
+
}
|
|
14074
14108
|
}
|
|
14075
|
-
|
|
14109
|
+
var Je = m * BYTES_PER_NODE / 2, $e = p[Je + 16], Ue = p[Je + 17];
|
|
14110
|
+
$e && g.push($e), Ue && g.push(Ue);
|
|
14076
14111
|
}
|
|
14112
|
+
}
|
|
14077
14113
|
return l;
|
|
14078
14114
|
}, t;
|
|
14079
14115
|
})(BVHObject)
|
|
@@ -14084,8 +14120,10 @@ function clamp(n, t, e) {
|
|
|
14084
14120
|
function calcExtents(n, t, e, r, o) {
|
|
14085
14121
|
if (e >= r)
|
|
14086
14122
|
return [0, 0, 0, 0, 0, 0];
|
|
14087
|
-
for (var s = 1 / 0, u = 1 / 0, l = 1 / 0, c = -1 / 0, d = -1 / 0, f = -1 / 0, h = e
|
|
14088
|
-
p = n[h] * 6, A = t[p]
|
|
14123
|
+
for (var s = 1 / 0, u = 1 / 0, l = 1 / 0, c = -1 / 0, d = -1 / 0, f = -1 / 0, h = e; h < r; h++) {
|
|
14124
|
+
var p = n[h] * 6, A = t[p];
|
|
14125
|
+
A < s && (s = A), A = t[p + 1], A < u && (u = A), A = t[p + 2], A < l && (l = A), A = t[p + 3], A > c && (c = A), A = t[p + 4], A > d && (d = A), A = t[p + 5], A > f && (f = A);
|
|
14126
|
+
}
|
|
14089
14127
|
return [
|
|
14090
14128
|
s - o,
|
|
14091
14129
|
u - o,
|
|
@@ -14110,8 +14148,11 @@ var EPSILON = 1e-6, ORDER_AXISES = ["x", "y", "z"], scratchVector3$8 = new BVHVe
|
|
|
14110
14148
|
l[h] = h;
|
|
14111
14149
|
else {
|
|
14112
14150
|
s(0, scratchVector3$8);
|
|
14113
|
-
for (var p = scratchVector3$8.x, A = scratchVector3$8.y, g = scratchVector3$8.z, m = p, E = A, v = g, h = 0
|
|
14114
|
-
l[h] = h, s(h, scratchVector3$8)
|
|
14151
|
+
for (var p = scratchVector3$8.x, A = scratchVector3$8.y, g = scratchVector3$8.z, m = p, E = A, v = g, h = 0; h < u; h += 1) {
|
|
14152
|
+
l[h] = h, s(h, scratchVector3$8);
|
|
14153
|
+
var y = scratchVector3$8.x, b = scratchVector3$8.y, T = scratchVector3$8.z;
|
|
14154
|
+
y < p ? p = y : y > m && (m = y), b < A ? A = b : b > E && (E = b), T < g ? g = T : T > v && (v = T);
|
|
14155
|
+
}
|
|
14115
14156
|
o = [p, A, g, m, E, v];
|
|
14116
14157
|
}
|
|
14117
14158
|
var S = new BVHNode(++f, o, 0, u, 0);
|
|
@@ -14122,8 +14163,8 @@ var EPSILON = 1e-6, ORDER_AXISES = ["x", "y", "z"], scratchVector3$8 = new BVHVe
|
|
|
14122
14163
|
function I(H) {
|
|
14123
14164
|
var M = H.startIndex, B = H.endIndex, F = H.extents;
|
|
14124
14165
|
R[0] = F[3] - F[0], R[1] = F[4] - F[1], R[2] = F[5] - F[2];
|
|
14125
|
-
for (var L = w.sort(C)[0], O = ORDER_AXISES[L], k = (F[L] + F[L + 3]) / 2, D = M,
|
|
14126
|
-
|
|
14166
|
+
for (var L = w.sort(C)[0], O = ORDER_AXISES[L], k = (F[L] + F[L + 3]) / 2, D = M, J = B - 1, G = -1, U; D <= J; )
|
|
14167
|
+
G === -1 ? (U = l[D], s(U, scratchVector3$8), scratchVector3$8[O] < k ? D++ : G = U) : (U = l[J], s(U, scratchVector3$8), scratchVector3$8[O] >= k || (l[D] = U, l[J] = G, G = -1, D++), J--);
|
|
14127
14168
|
if (D > M) {
|
|
14128
14169
|
var z = F.slice();
|
|
14129
14170
|
z[L + 3] = k + EPSILON;
|
|
@@ -14131,10 +14172,10 @@ var EPSILON = 1e-6, ORDER_AXISES = ["x", "y", "z"], scratchVector3$8 = new BVHVe
|
|
|
14131
14172
|
q.deepth < r && q.endIndex - q.startIndex > e && (c[d++] = q), H.node0 = q;
|
|
14132
14173
|
}
|
|
14133
14174
|
if (B > D) {
|
|
14134
|
-
var
|
|
14135
|
-
|
|
14136
|
-
var
|
|
14137
|
-
|
|
14175
|
+
var j = F.slice();
|
|
14176
|
+
j[L] = k - EPSILON;
|
|
14177
|
+
var K = new BVHNode(++f, j, D, B, H.deepth + 1);
|
|
14178
|
+
K.deepth < r && K.endIndex - K.startIndex > e && (c[d++] = K), H.node1 = K;
|
|
14138
14179
|
}
|
|
14139
14180
|
H.startIndex = 0, H.endIndex = 0;
|
|
14140
14181
|
}
|
|
@@ -14143,17 +14184,29 @@ var EPSILON = 1e-6, ORDER_AXISES = ["x", "y", "z"], scratchVector3$8 = new BVHVe
|
|
|
14143
14184
|
return this.offsetArray = l, this.rootNodePacked = packBVHNode(S, f + 1), c.length = 0, this;
|
|
14144
14185
|
}, t.prototype.intersectRay = function(e, r, o, s, u) {
|
|
14145
14186
|
o === void 0 && (o = 0), s === void 0 && (s = !1);
|
|
14146
|
-
for (var l = [], c = this.offsetArray, d = this.rootNodePacked, f = new Float32Array(d), h = new Uint32Array(d), p = new Uint16Array(d), A = o * o, g = new BVHVector3(1 / r.x, 1 / r.y, 1 / r.z), m = [0], E, v
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14187
|
+
for (var l = [], c = this.offsetArray, d = this.rootNodePacked, f = new Float32Array(d), h = new Uint32Array(d), p = new Uint16Array(d), A = o * o, g = new BVHVector3(1 / r.x, 1 / r.y, 1 / r.z), m = [0], E, v = new BVHBox3(new BVHVector3(0, 0, 0), new BVHVector3(0, 0, 0)), y = 1 / 0; (E = m.pop()) !== void 0; ) {
|
|
14188
|
+
var b = E * BYTES_PER_NODE / 4;
|
|
14189
|
+
v.min.x = f[b], v.min.y = f[b + 1], v.min.z = f[b + 2], v.max.x = f[b + 3], v.max.y = f[b + 4], v.max.z = f[b + 5];
|
|
14190
|
+
var T = intersectNodeBox(e, g, v, o);
|
|
14191
|
+
if (T !== null && !(s && T > y)) {
|
|
14192
|
+
for (var S = h[b + 6], R = h[b + 7], w = S; w < R; w++) {
|
|
14193
|
+
var C = c[w], I = new BVHVector3(0, 0, 0);
|
|
14194
|
+
this.getPositionByIndex(C, I);
|
|
14195
|
+
var H = I.x, M = I.y, B = I.z, F = e.x, L = e.y, O = e.z, k = r.x, D = r.y, J = r.z, G = k * (H - F) + D * (M - L) + J * (B - O);
|
|
14196
|
+
if (G > 0 ? (F += k * G, L += D * G, O += J * G) : G < 0 && (G = 0), k = H - F, D = M - L, J = B - O, k * k + D * D + J * J <= A) {
|
|
14197
|
+
var U = new BVHVector3(F, L, O), z = new BVHIntersect(I, I, I, C, U);
|
|
14198
|
+
(!u || u(z)) && (s ? G < y && (y = G, l.length > 0 && (l.length = 0), l.push(z)) : l.push(z));
|
|
14199
|
+
}
|
|
14200
|
+
}
|
|
14201
|
+
var q = E * BYTES_PER_NODE / 2, j = p[q + 16], K = p[q + 17];
|
|
14202
|
+
j && m.push(j), K && m.push(K);
|
|
14151
14203
|
}
|
|
14204
|
+
}
|
|
14152
14205
|
return l;
|
|
14153
14206
|
}, t;
|
|
14154
14207
|
})(BVHObject)
|
|
14155
14208
|
);
|
|
14156
|
-
const jsContent = `(function(){"use strict";var hr=function(e,r){return hr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])},hr(e,r)};function Br(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");hr(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}typeof SuppressedError=="function"&&SuppressedError;var Pr=(function(){function e(r,t){this.position=r,this.indices=t}return e.prototype.getPositionCount=function(){var r,t,o=this.indices,s=this.position;return o?o.array.length/((r=o.stride)!==null&&r!==void 0?r:1):s.array.length/((t=s.stride)!==null&&t!==void 0?t:3)},e.prototype.getPositionByIndex=function(r,t){var o,s,h,a,n=this.indices,v=this.position,f=r;if(n){var c=n.array,l=(o=n.stride)!==null&&o!==void 0?o:1,p=(s=n.offset)!==null&&s!==void 0?s:0;f=c[r*l+p]}var u=v.array,y=(h=v.stride)!==null&&h!==void 0?h:3,w=(a=v.offset)!==null&&a!==void 0?a:0;return f=f*y+w,t.x=u[f],t.y=u[f+1],t.z=u[f+2],t},e.prototype.createTree=function(r,t,o){throw new Error("not implemented")},e.prototype.trianglesInSphere=function(r,t){throw new Error("not implemented")},e.prototype.intersectRay=function(r,t,o,s,h){throw new Error("not implemented")},e})(),m=(function(){function e(r,t,o,s,h){this.id=r,this.extents=t,this.startIndex=o,this.endIndex=s,this.deepth=h}return e})(),R=36;function Sr(e,r){for(var t=new ArrayBuffer(r*R),o=new Float32Array(t),s=new Uint32Array(t),h=new Uint16Array(t),a=[e],n,v;n=a.pop();)v=n.id*R/4,o[v]=n.extents[0],o[v+1]=n.extents[1],o[v+2]=n.extents[2],o[v+3]=n.extents[3],o[v+4]=n.extents[4],o[v+5]=n.extents[5],s[v+6]=n.startIndex,s[v+7]=n.endIndex,v=n.id*R/2,n.node0&&(h[v+16]=n.node0.id,a.push(n.node0)),n.node1&&(h[v+17]=n.node1.id,a.push(n.node1));return t}function xr(e,r,t,o,s,h,a,n,v){v===void 0&&(v=0),t=t-v,o=o-v,s=s-v,h=h+v,a=a+v,n=n+v;var f=0,c=0,l=0,p=0,u=0,y=0;return r.x>=0?(f=(t-e.x)*r.x,c=(h-e.x)*r.x):(f=(h-e.x)*r.x,c=(t-e.x)*r.x),r.y>=0?(l=(o-e.y)*r.y,p=(a-e.y)*r.y):(l=(a-e.y)*r.y,p=(o-e.y)*r.y),f>p||l>c||((l>f||f!==f)&&(f=l),(p<c||c!==c)&&(c=p),r.z>=0?(u=(s-e.z)*r.z,y=(n-e.z)*r.z):(u=(n-e.z)*r.z,y=(s-e.z)*r.z),f>y||u>c)||((u>f||f!==f)&&(f=u),(y<c||c!==c)&&(c=y),c<0)?null:f>=0?f:c}var Y=(function(){function e(r,t,o){this.x=r,this.y=t,this.z=o}return e.prototype.copy=function(r){return this.x=r.x,this.y=r.y,this.z=r.z,this},e.prototype.set=function(r,t,o){return this.x=r,this.y=t,this.z=o,this},e.prototype.fromArray=function(r,t){return t===void 0&&(t=0),this.x=r[t],this.y=r[t+1],this.z=r[t+2],this},e.prototype.toArray=function(r,t){return r===void 0&&(r=[]),t===void 0&&(t=0),r[t]=this.x,r[t+1]=this.y,r[t+2]=this.z,r},e.prototype.add=function(r){return this.x+=r.x,this.y+=r.y,this.z+=r.z,this},e.prototype.multiplyScalar=function(r){return this.x*=r,this.y*=r,this.z*=r,this},e.prototype.subVectors=function(r,t){return this.x=r.x-t.x,this.y=r.y-t.y,this.z=r.z-t.z,this},e.prototype.addScaledVector=function(r,t){return this.x+=r.x*t,this.y+=r.y*t,this.z+=r.z*t,this},e.prototype.dot=function(r){return this.x*r.x+this.y*r.y+this.z*r.z},e.prototype.cross=function(r){var t=this.x,o=this.y,s=this.z;return this.x=o*r.z-s*r.y,this.y=s*r.x-t*r.z,this.z=t*r.y-o*r.x,this},e.prototype.crossVectors=function(r,t){var o=r.x,s=r.y,h=r.z,a=t.x,n=t.y,v=t.z;return this.x=s*v-h*n,this.y=h*a-o*v,this.z=o*n-s*a,this},e.prototype.distanceTo=function(r){return Math.sqrt(this.distanceToSquared(r))},e.prototype.distanceToSquared=function(r){var t=this.x-r.x,o=this.y-r.y,s=this.z-r.z;return t*t+o*o+s*s},e.prototype.clone=function(){return new e(this.x,this.y,this.z)},e})(),Nr=(function(){function e(r,t,o){this.triangle=r,this.intersectionPoint=t,this.index=o}return e})(),Vr=1e-6,N=new Y(0,0,0),g=new Y(0,0,0),O=new Y(0,0,0),X=new Y(0,0,0),_r=(function(e){Br(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.createTree=function(t,o,s){o=Math.min(o,16);var h=this.getPositionCount()/3,a=h>65535?new Uint32Array(h):new Uint16Array(h),n=new Float32Array(h*6),v=[],f=0,c=-1;if(s)for(var l=0,p=0,u=0,y=void 0,w=void 0,A=void 0,z=void 0,d=void 0,I=void 0,i=void 0;l<h;l+=1,p+=3,u+=6)a[l]=l,this.getPositionByIndex(p,g),this.getPositionByIndex(p+1,O),this.getPositionByIndex(p+2,X),y=z=g.x,i=O.x,i<y&&(y=i),i>z&&(z=i),i=X.x,i<y&&(y=i),i>z&&(z=i),w=d=g.y,i=O.y,i<w&&(w=i),i>d&&(d=i),i=X.y,i<w&&(w=i),i>d&&(d=i),A=I=g.z,i=O.z,i<A&&(A=i),i>I&&(I=i),i=X.z,i<A&&(A=i),i>I&&(I=i),n[u]=y,n[u+1]=w,n[u+2]=A,n[u+3]=z,n[u+4]=d,n[u+5]=I;else{for(var M=1/0,q=1/0,K=1/0,Q=-1/0,G=-1/0,T=-1/0,l=0,p=0,u=0,y=void 0,w=void 0,A=void 0,z=void 0,d=void 0,I=void 0,i=void 0;l<h;l+=1,p+=3,u+=6)a[l]=l,this.getPositionByIndex(p,g),this.getPositionByIndex(p+1,O),this.getPositionByIndex(p+2,X),y=z=g.x,i=O.x,i<y&&(y=i),i>z&&(z=i),i=X.x,i<y&&(y=i),i>z&&(z=i),w=d=g.y,i=O.y,i<w&&(w=i),i>d&&(d=i),i=X.y,i<w&&(w=i),i>d&&(d=i),A=I=g.z,i=O.z,i<A&&(A=i),i>I&&(I=i),i=X.z,i<A&&(A=i),i>I&&(I=i),n[u]=y,n[u+1]=w,n[u+2]=A,n[u+3]=z,n[u+4]=d,n[u+5]=I,y<M&&(M=y),z>Q&&(Q=z),w<q&&(q=w),d>G&&(G=d),A<K&&(K=A),I>T&&(T=I);s=[M,q,K,Q,G,T]}var j=new m(++c,s,0,h,0);v[f++]=j;var F=[],C=[0,1,2],L=function(P,S){return F[S]-F[P]};function $(P){var S=P.startIndex,_=P.endIndex,V=P.extents;F[0]=V[3]-V[0],F[1]=V[4]-V[1],F[2]=V[5]-V[2],C.sort(L);for(var H=0;H<3;H++){for(var U=C[H],k=V[U]+V[U+3],B=S,x=_-1,W=-1,J=void 0;B<=x;)W===-1?(J=a[B],n[J*6+U]+n[J*6+U+3]<k?B++:W=J):(J=a[x],n[J*6+U]+n[J*6+U+3]>=k||(a[B]=J,a[x]=W,W=-1,B++),x--);if(B>S&&B<_){var b=new m(++c,Tr(a,n,S,B,Vr),S,B,P.deepth+1);b.deepth<o&&b.endIndex-b.startIndex>t&&(v[f++]=b);var D=new m(++c,Tr(a,n,B,_,Vr),B,_,P.deepth+1);D.deepth<o&&D.endIndex-D.startIndex>t&&(v[f++]=D),P.node0=b,P.node1=D,P.startIndex=0,P.endIndex=0;break}}}for(;f;)$(v[--f]);return this.offsetArray=a,this.rootNodePacked=Sr(j,c+1),v.length=0,this},r.prototype.trianglesInSphere=function(t,o){for(var s=this.offsetArray,h=this.rootNodePacked,a=new Float32Array(h),n=new Uint32Array(h),v=new Uint16Array(h),f=[0],c=[],l,p,u,y;(l=f.pop())!==void 0;){y=l*R/4;var w=cr(t.x,a[y],a[y+3])-t.x,A=cr(t.y,a[y+1],a[y+4])-t.y,z=cr(t.z,a[y+2],a[y+5])-t.z;if(w*w+A*A+z*z<=o*o){for(var d=n[y+6];d<n[y+7];d++)c.push(s[d]);y=l*R/2,p=v[y+16],u=v[y+17],p&&f.push(p),u&&f.push(u)}}for(var I=c.length,i=new Float32Array(I*9),d=0;d<I;d++){var M=c[d];this.getPositionByIndex(M,N),i[d*9]=N.x,i[d*9+1]=N.y,i[d*9+2]=N.z,this.getPositionByIndex(M+1,N),i[d*9+3]=N.x,i[d*9+4]=N.y,i[d*9+5]=N.z,this.getPositionByIndex(M+2,N),i[d*9+6]=N.x,i[d*9+7]=N.y,i[d*9+8]=N.z}return i},r.prototype.intersectRay=function(t,o,s,h,a){s===void 0&&(s=0),h===void 0&&(h=!1);for(var n=[],v=this.offsetArray,f=this.rootNodePacked,c=new Float32Array(f),l=new Uint32Array(f),p=new Uint16Array(f),u=new Y(1/o.x,1/o.y,1/o.z),y=[0],w,A,z,d,I,i,M,q,K,Q,G,T=1/0;(w=y.pop())!==void 0;)if(d=w*R/4,I=c[d],i=c[d+1],M=c[d+2],q=c[d+3],K=c[d+4],Q=c[d+5],G=xr(t,u,I,i,M,q,K,Q,s),G!==null&&!(h&&G>T)){for(var j=l[d+6],F=l[d+7],C=void 0,L=void 0,$=t.x,P=t.y,S=t.z,_=o.x,V=o.y,H=o.z,U=void 0,k=void 0,B=void 0,x=void 0,W=void 0,J=void 0,b=void 0,D=void 0,yr=void 0,nr=void 0,er=void 0,sr=void 0,ar=void 0,vr=void 0,fr=void 0,lr=void 0,pr=void 0,Ir=void 0,rr=void 0,tr=void 0,or=void 0,ur=void 0,Z=void 0,wr=void 0,Ar=void 0,zr=void 0,ir=void 0,dr=void 0;j<F;j++){if(C=v[j],L=C*3,this.getPositionByIndex(L,N),U=N.x,k=N.y,B=N.z,this.getPositionByIndex(L+1,N),x=N.x,W=N.y,J=N.z,this.getPositionByIndex(L+2,N),b=N.x,D=N.y,yr=N.z,nr=x-U,er=W-k,sr=J-B,ar=b-U,vr=D-k,fr=yr-B,lr=er*fr-sr*vr,pr=sr*ar-nr*fr,Ir=nr*vr-er*ar,Z=_*lr+V*pr+H*Ir,Z>0)ur=1;else if(Z<0)ur=-1,Z=-Z;else continue;rr=$-U,tr=P-k,or=S-B,wr=ur*(_*(tr*fr-or*vr)+V*(or*ar-rr*fr)+H*(rr*vr-tr*ar)),!(wr<0)&&(Ar=ur*(_*(er*or-sr*tr)+V*(sr*rr-nr*or)+H*(nr*tr-er*rr)),!(Ar<0)&&(wr+Ar>Z||(zr=-ur*(rr*lr+tr*pr+or*Ir),!(zr<0)&&(ir=zr/Z,dr=new Nr([U,k,B,x,W,J,b,D,yr],[$+_*ir,P+V*ir,S+H*ir],C),(!a||a(dr))&&(h?ir<T&&(T=ir,n.length>0&&(n.length=0),n.push(dr)):n.push(dr))))))}d=w*R/2,A=p[d+16],z=p[d+17],A&&y.push(A),z&&y.push(z)}return n},r})(Pr);function cr(e,r,t){return e<r?r:e>t?t:e}function Tr(e,r,t,o,s){if(t>=o)return[0,0,0,0,0,0];for(var h=1/0,a=1/0,n=1/0,v=-1/0,f=-1/0,c=-1/0,l=t,p=void 0,u=void 0;l<o;l++)p=e[l]*6,u=r[p],u<h&&(h=u),u=r[p+1],u<a&&(a=u),u=r[p+2],u<n&&(n=u),u=r[p+3],u>v&&(v=u),u=r[p+4],u>f&&(f=u),u=r[p+5],u>c&&(c=u);return[h-s,a-s,n-s,v+s,f+s,c+s]}var Ur=1e-6,Hr=["x","y","z"],E=new Y(0,0,0),kr=(function(e){Br(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.createTree=function(t,o,s){o=Math.min(o,16);var h=this.getPositionByIndex.bind(this),a=this.getPositionCount(),n=a>65535?new Uint32Array(a):new Uint16Array(a),v=[],f=0,c=-1;if(s)for(var l=0;l<a;l+=1)n[l]=l;else{h(0,E);for(var p=E.x,u=E.y,y=E.z,w=p,A=u,z=y,l=0,d=void 0,I=void 0,i=void 0;l<a;l+=1)n[l]=l,h(l,E),d=E.x,I=E.y,i=E.z,d<p?p=d:d>w&&(w=d),I<u?u=I:I>A&&(A=I),i<y?y=i:i>z&&(z=i);s=[p,u,y,w,A,z]}var M=new m(++c,s,0,a,0);v[f++]=M;var q=[],K=[0,1,2],Q=function(T,j){return q[j]-q[T]};function G(T){var j=T.startIndex,F=T.endIndex,C=T.extents;q[0]=C[3]-C[0],q[1]=C[4]-C[1],q[2]=C[5]-C[2];for(var L=K.sort(Q)[0],$=Hr[L],P=(C[L]+C[L+3])/2,S=j,_=F-1,V=-1,H;S<=_;)V===-1?(H=n[S],h(H,E),E[$]<P?S++:V=H):(H=n[_],h(H,E),E[$]>=P||(n[S]=H,n[_]=V,V=-1,S++),_--);if(S>j){var U=C.slice();U[L+3]=P+Ur;var k=new m(++c,U,j,S,T.deepth+1);k.deepth<o&&k.endIndex-k.startIndex>t&&(v[f++]=k),T.node0=k}if(F>S){var B=C.slice();B[L]=P-Ur;var x=new m(++c,B,S,F,T.deepth+1);x.deepth<o&&x.endIndex-x.startIndex>t&&(v[f++]=x),T.node1=x}T.startIndex=0,T.endIndex=0}for(;f;)G(v[--f]);return this.offsetArray=n,this.rootNodePacked=Sr(M,c+1),v.length=0,this},r.prototype.intersectRay=function(t,o,s,h,a){s===void 0&&(s=0),h===void 0&&(h=!1);for(var n=[],v=this.offsetArray,f=this.rootNodePacked,c=new Float32Array(f),l=new Uint32Array(f),p=new Uint16Array(f),u=s*s,y=new Y(1/o.x,1/o.y,1/o.z),w=[0],A,z,d,I,i,M,q,K,Q,G,T,j=1/0;(A=w.pop())!==void 0;)if(I=A*R/4,i=c[I],M=c[I+1],q=c[I+2],K=c[I+3],Q=c[I+4],G=c[I+5],T=xr(t,y,i,M,q,K,Q,G,s),T!==null&&!(h&&T>j)){for(var F=l[I+6],C=l[I+7],L=void 0,$=void 0,P=void 0,S=void 0,_=void 0,V=void 0,H=void 0,U=void 0,k=void 0,B=void 0,x=void 0,W=void 0;F<C;F++)L=v[F],this.getPositionByIndex(L,E),$=E.x,P=E.y,S=E.z,_=t.x,V=t.y,H=t.z,U=o.x,k=o.y,B=o.z,x=U*($-_)+k*(P-V)+B*(S-H),x>0?(_+=U*x,V+=k*x,H+=B*x):x<0&&(x=0),U=$-_,k=P-V,B=S-H,U*U+k*k+B*B<=u&&(W=new Nr([$,P,S,$,P,S,$,P,S],[_,V,H],L),(!a||a(W))&&(h?x<j&&(j=x,n.length>0&&(n.length=0),n.push(W)):n.push(W)));I=A*R/2,z=p[I+16],d=p[I+17],z&&w.push(z),d&&w.push(d)}return n},r})(Pr);function Cr(e){onmessage=function(r){Promise.resolve(r.data).then(function(t){return e(t)}).then(function(t){var o=t.output,s=t.transfer;return postMessage(o,s)}).catch(function(t){return postMessage({$$error:t})})}}Cr(function(e){return Promise.resolve(e).then(function(r){for(var t=[],o=new Set,s=0,h=r;s<h.length;s++){var a=h[s],n=void 0;if(a.type==="mesh")n=new _r(a.attributes.position,a.indices);else if(a.type==="points")n=new kr(a.attributes.position,a.indices);else throw new Error("Invalid Type");n.createTree(a.maxItemPerNode,a.maxTreeDepth,a.extents);var v={type:a.type,attributes:a.attributes,indices:a.indices,offsetArray:n.offsetArray,rootNodePacked:n.rootNodePacked};t.push(v);var f=void 0;for(var c in v.attributes){var l=v.attributes[c];l&&l.buffer instanceof ArrayBuffer&&o.add(l.buffer)}f=v.indices,f&&f.buffer instanceof ArrayBuffer&&o.add(f.buffer),f=v.offsetArray,f&&f.buffer instanceof ArrayBuffer&&o.add(f.buffer),o.add(v.rootNodePacked)}return{output:t,transfer:Array.from(o)}})})})();
|
|
14209
|
+
const jsContent = `(function(){"use strict";var ur=function(o,r){return ur=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},ur(o,r)};function yr(o,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");ur(o,r);function t(){this.constructor=o}o.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}typeof SuppressedError=="function"&&SuppressedError;var cr=(function(){function o(r,t){this.position=r,this.indices=t}return o.prototype.getPositionCount=function(){var r,t,n=this.indices,e=this.position;return n?n.array.length/((r=n.stride)!==null&&r!==void 0?r:1):e.array.length/((t=e.stride)!==null&&t!==void 0?t:3)},o.prototype.getPositionByIndex=function(r,t){var n,e,h,v,i=this.indices,f=this.position,l=r;if(i){var y=i.array,s=(n=i.stride)!==null&&n!==void 0?n:1,d=(e=i.offset)!==null&&e!==void 0?e:0;l=y[r*s+d]}var u=f.array,x=(h=f.stride)!==null&&h!==void 0?h:3,w=(v=f.offset)!==null&&v!==void 0?v:0;return l=l*x+w,t.x=u[l],t.y=u[l+1],t.z=u[l+2],t},o.prototype.createTree=function(r,t,n){throw new Error("not implemented")},o.prototype.trianglesInSphere=function(r,t){throw new Error("not implemented")},o.prototype.intersectRay=function(r,t,n,e,h){throw new Error("not implemented")},o})(),D=(function(){function o(r,t,n,e,h){this.id=r,this.extents=t,this.startIndex=n,this.endIndex=e,this.deepth=h}return o})(),X=36;function lr(o,r){for(var t=new ArrayBuffer(r*X),n=new Float32Array(t),e=new Uint32Array(t),h=new Uint16Array(t),v=[o],i,f;i=v.pop();)f=i.id*X/4,n[f]=i.extents[0],n[f+1]=i.extents[1],n[f+2]=i.extents[2],n[f+3]=i.extents[3],n[f+4]=i.extents[4],n[f+5]=i.extents[5],e[f+6]=i.startIndex,e[f+7]=i.endIndex,f=i.id*X/2,i.node0&&(h[f+16]=i.node0.id,v.push(i.node0)),i.node1&&(h[f+17]=i.node1.id,v.push(i.node1));return t}function dr(o,r,t,n){n===void 0&&(n=0);var e=t.min.x-n,h=t.min.y-n,v=t.min.z-n,i=t.max.x+n,f=t.max.y+n,l=t.max.z+n,y=0,s=0,d=0,u=0,x=0,w=0;return r.x>=0?(y=(e-o.x)*r.x,s=(i-o.x)*r.x):(y=(i-o.x)*r.x,s=(e-o.x)*r.x),r.y>=0?(d=(h-o.y)*r.y,u=(f-o.y)*r.y):(d=(f-o.y)*r.y,u=(h-o.y)*r.y),y>u||d>s||((d>y||y!==y)&&(y=d),(u<s||s!==s)&&(s=u),r.z>=0?(x=(v-o.z)*r.z,w=(l-o.z)*r.z):(x=(l-o.z)*r.z,w=(v-o.z)*r.z),y>w||x>s)||((x>y||y!==y)&&(y=x),(w<s||s!==s)&&(s=w),s<0)?null:y>=0?y:s}var H=(function(){function o(r,t,n){this.x=r,this.y=t,this.z=n}return o.prototype.copy=function(r){return this.x=r.x,this.y=r.y,this.z=r.z,this},o.prototype.set=function(r,t,n){return this.x=r,this.y=t,this.z=n,this},o.prototype.fromArray=function(r,t){return t===void 0&&(t=0),this.x=r[t],this.y=r[t+1],this.z=r[t+2],this},o.prototype.toArray=function(r,t){return r===void 0&&(r=[]),t===void 0&&(t=0),r[t]=this.x,r[t+1]=this.y,r[t+2]=this.z,r},o.prototype.add=function(r){return this.x+=r.x,this.y+=r.y,this.z+=r.z,this},o.prototype.multiplyScalar=function(r){return this.x*=r,this.y*=r,this.z*=r,this},o.prototype.subVectors=function(r,t){return this.x=r.x-t.x,this.y=r.y-t.y,this.z=r.z-t.z,this},o.prototype.addScaledVector=function(r,t){return this.x+=r.x*t,this.y+=r.y*t,this.z+=r.z*t,this},o.prototype.dot=function(r){return this.x*r.x+this.y*r.y+this.z*r.z},o.prototype.cross=function(r){var t=this.x,n=this.y,e=this.z;return this.x=n*r.z-e*r.y,this.y=e*r.x-t*r.z,this.z=t*r.y-n*r.x,this},o.prototype.crossVectors=function(r,t){var n=r.x,e=r.y,h=r.z,v=t.x,i=t.y,f=t.z;return this.x=e*f-h*i,this.y=h*v-n*f,this.z=n*i-e*v,this},o.prototype.distanceTo=function(r){return Math.sqrt(this.distanceToSquared(r))},o.prototype.distanceToSquared=function(r){var t=this.x-r.x,n=this.y-r.y,e=this.z-r.z;return t*t+n*n+e*e},o.prototype.clone=function(){return new o(this.x,this.y,this.z)},o})(),wr=(function(){function o(r,t,n,e,h){this.pointA=r,this.pointB=t,this.pointC=n,this.index=e,this.intersectionPoint=h}return o})(),xr=(function(){function o(r,t){this.min=r,this.max=t}return o})(),pr=1e-6,J=new H(0,0,0),Y=new H(0,0,0),g=new H(0,0,0),Z=new H(0,0,0),Hr=(function(o){yr(r,o);function r(){return o!==null&&o.apply(this,arguments)||this}return r.prototype.createTree=function(t,n,e){n=Math.min(n,16);var h=this.getPositionCount()/3,v=h>65535?new Uint32Array(h):new Uint16Array(h),i=new Float32Array(h*6),f=[],l=0,y=-1;if(e)for(var s=0;s<h;s+=1){var d=s*3,u=s*6,x=void 0,w=void 0,z=void 0,I=void 0,c=void 0,p=void 0,a=void 0;v[s]=s,this.getPositionByIndex(d,Y),this.getPositionByIndex(d+1,g),this.getPositionByIndex(d+2,Z),x=I=Y.x,a=g.x,a<x&&(x=a),a>I&&(I=a),a=Z.x,a<x&&(x=a),a>I&&(I=a),w=c=Y.y,a=g.y,a<w&&(w=a),a>c&&(c=a),a=Z.y,a<w&&(w=a),a>c&&(c=a),z=p=Y.z,a=g.z,a<z&&(z=a),a>p&&(p=a),a=Z.z,a<z&&(z=a),a>p&&(p=a),i[u]=x,i[u+1]=w,i[u+2]=z,i[u+3]=I,i[u+4]=c,i[u+5]=p}else{for(var F=1/0,k=1/0,E=1/0,S=-1/0,V=-1/0,U=-1/0,s=0;s<h;s+=1){var d=s*3,u=s*6,x=void 0,w=void 0,z=void 0,I=void 0,c=void 0,p=void 0,a=void 0;v[s]=s,this.getPositionByIndex(d,Y),this.getPositionByIndex(d+1,g),this.getPositionByIndex(d+2,Z),x=I=Y.x,a=g.x,a<x&&(x=a),a>I&&(I=a),a=Z.x,a<x&&(x=a),a>I&&(I=a),w=c=Y.y,a=g.y,a<w&&(w=a),a>c&&(c=a),a=Z.y,a<w&&(w=a),a>c&&(c=a),z=p=Y.z,a=g.z,a<z&&(z=a),a>p&&(p=a),a=Z.z,a<z&&(z=a),a>p&&(p=a),i[u]=x,i[u+1]=w,i[u+2]=z,i[u+3]=I,i[u+4]=c,i[u+5]=p,x<F&&(F=x),I>S&&(S=I),w<k&&(k=w),c>V&&(V=c),z<E&&(E=z),p>U&&(U=p)}e=[F,k,E,S,V,U]}var W=new D(++y,e,0,h,0);f[l++]=W;var M=[],T=[0,1,2],j=function(P,B){return M[B]-M[P]};function q(P){var B=P.startIndex,_=P.endIndex,A=P.extents;M[0]=A[3]-A[0],M[1]=A[4]-A[1],M[2]=A[5]-A[2],T.sort(j);for(var $=0;$<3;$++){for(var C=T[$],G=A[C]+A[C+3],N=B,L=_-1,O=-1,Q=void 0;N<=L;)O===-1?(Q=v[N],i[Q*6+C]+i[Q*6+C+3]<G?N++:O=Q):(Q=v[L],i[Q*6+C]+i[Q*6+C+3]>=G||(v[N]=Q,v[L]=O,O=-1,N++),L--);if(N>B&&N<_){var R=new D(++y,zr(v,i,B,N,pr),B,N,P.deepth+1);R.deepth<n&&R.endIndex-R.startIndex>t&&(f[l++]=R);var b=new D(++y,zr(v,i,N,_,pr),N,_,P.deepth+1);b.deepth<n&&b.endIndex-b.startIndex>t&&(f[l++]=b),P.node0=R,P.node1=b,P.startIndex=0,P.endIndex=0;break}}}for(;l;)q(f[--l]);return this.offsetArray=v,this.rootNodePacked=lr(W,y+1),f.length=0,this},r.prototype.trianglesInSphere=function(t,n){for(var e=this.offsetArray,h=this.rootNodePacked,v=new Float32Array(h),i=new Uint32Array(h),f=new Uint16Array(h),l=[0],y=[],s;(s=l.pop())!==void 0;){var d=s*X/4,u=fr(t.x,v[d],v[d+3])-t.x,x=fr(t.y,v[d+1],v[d+4])-t.y,w=fr(t.z,v[d+2],v[d+5])-t.z;if(u*u+x*x+w*w<=n*n){for(var z=i[d+6],I=i[d+7],c=z;c<I;c++){var p=e[c];y.push(p)}var a=s*X/2,F=f[a+16],k=f[a+17];F&&l.push(F),k&&l.push(k)}}for(var E=y.length,S=new Float32Array(E*9),c=0;c<E;c++){var p=y[c],V=p*3;this.getPositionByIndex(V,J),S[c*9]=J.x,S[c*9+1]=J.y,S[c*9+2]=J.z,this.getPositionByIndex(V+1,J),S[c*9+3]=J.x,S[c*9+4]=J.y,S[c*9+5]=J.z,this.getPositionByIndex(V+2,J),S[c*9+6]=J.x,S[c*9+7]=J.y,S[c*9+8]=J.z}return S},r.prototype.intersectRay=function(t,n,e,h,v){e===void 0&&(e=0),h===void 0&&(h=!1);for(var i=[],f=this.offsetArray,l=this.rootNodePacked,y=new Float32Array(l),s=new Uint32Array(l),d=new Uint16Array(l),u=new H(1/n.x,1/n.y,1/n.z),x=[0],w,z=new xr(new H(0,0,0),new H(0,0,0)),I=1/0;(w=x.pop())!==void 0;){var c=w*X/4;z.min.x=y[c],z.min.y=y[c+1],z.min.z=y[c+2],z.max.x=y[c+3],z.max.y=y[c+4],z.max.z=y[c+5];var p=dr(t,u,z,e);if(p!==null&&!(h&&p>I)){for(var a=t.x,F=t.y,k=t.z,E=n.x,S=n.y,V=n.z,U=s[c+6],W=s[c+7],M=U;M<W;M++){var T=f[M],j=T*3,q=new H(0,0,0);this.getPositionByIndex(j,q);var P=q.x,B=q.y,_=q.z,A=new H(0,0,0);this.getPositionByIndex(j+1,A);var $=A.x,C=A.y,G=A.z,N=new H(0,0,0);this.getPositionByIndex(j+2,N);var L=N.x,O=N.y,Q=N.z,R=$-P,b=C-B,or=G-_,er=L-P,vr=O-B,sr=Q-_,Ar=b*sr-or*vr,Pr=or*er-R*sr,Br=R*vr-b*er,m=E*Ar+S*Pr+V*Br,rr=void 0;if(m>0)rr=1;else if(m<0)rr=-1,m=-m;else continue;var tr=a-P,nr=F-B,ir=k-_,Sr=rr*(E*(nr*sr-ir*vr)+S*(ir*er-tr*sr)+V*(tr*vr-nr*er));if(!(Sr<0)){var Nr=rr*(E*(b*ir-or*nr)+S*(or*tr-R*ir)+V*(R*nr-b*tr));if(!(Nr<0)&&!(Sr+Nr>m)){var Vr=-rr*(tr*Ar+nr*Pr+ir*Br);if(!(Vr<0)){var ar=Vr/m,jr=new H(a+E*ar,F+S*ar,k+V*ar),hr=new wr(q,A,N,T,jr);(!v||v(hr))&&(h?ar<I&&(I=ar,i.length>0&&(i.length=0),i.push(hr)):i.push(hr))}}}}var Tr=w*X/2,Ur=d[Tr+16],_r=d[Tr+17];Ur&&x.push(Ur),_r&&x.push(_r)}}return i},r})(cr);function fr(o,r,t){return o<r?r:o>t?t:o}function zr(o,r,t,n,e){if(t>=n)return[0,0,0,0,0,0];for(var h=1/0,v=1/0,i=1/0,f=-1/0,l=-1/0,y=-1/0,s=t;s<n;s++){var d=o[s]*6,u=r[d];u<h&&(h=u),u=r[d+1],u<v&&(v=u),u=r[d+2],u<i&&(i=u),u=r[d+3],u>f&&(f=u),u=r[d+4],u>l&&(l=u),u=r[d+5],u>y&&(y=u)}return[h-e,v-e,i-e,f+e,l+e,y+e]}var Ir=1e-6,kr=["x","y","z"],K=new H(0,0,0),Er=(function(o){yr(r,o);function r(){return o!==null&&o.apply(this,arguments)||this}return r.prototype.createTree=function(t,n,e){n=Math.min(n,16);var h=this.getPositionByIndex.bind(this),v=this.getPositionCount(),i=v>65535?new Uint32Array(v):new Uint16Array(v),f=[],l=0,y=-1;if(e)for(var s=0;s<v;s+=1)i[s]=s;else{h(0,K);for(var d=K.x,u=K.y,x=K.z,w=d,z=u,I=x,s=0;s<v;s+=1){i[s]=s,h(s,K);var c=K.x,p=K.y,a=K.z;c<d?d=c:c>w&&(w=c),p<u?u=p:p>z&&(z=p),a<x?x=a:a>I&&(I=a)}e=[d,u,x,w,z,I]}var F=new D(++y,e,0,v,0);f[l++]=F;var k=[],E=[0,1,2],S=function(U,W){return k[W]-k[U]};function V(U){var W=U.startIndex,M=U.endIndex,T=U.extents;k[0]=T[3]-T[0],k[1]=T[4]-T[1],k[2]=T[5]-T[2];for(var j=E.sort(S)[0],q=kr[j],P=(T[j]+T[j+3])/2,B=W,_=M-1,A=-1,$;B<=_;)A===-1?($=i[B],h($,K),K[q]<P?B++:A=$):($=i[_],h($,K),K[q]>=P||(i[B]=$,i[_]=A,A=-1,B++),_--);if(B>W){var C=T.slice();C[j+3]=P+Ir;var G=new D(++y,C,W,B,U.deepth+1);G.deepth<n&&G.endIndex-G.startIndex>t&&(f[l++]=G),U.node0=G}if(M>B){var N=T.slice();N[j]=P-Ir;var L=new D(++y,N,B,M,U.deepth+1);L.deepth<n&&L.endIndex-L.startIndex>t&&(f[l++]=L),U.node1=L}U.startIndex=0,U.endIndex=0}for(;l;)V(f[--l]);return this.offsetArray=i,this.rootNodePacked=lr(F,y+1),f.length=0,this},r.prototype.intersectRay=function(t,n,e,h,v){e===void 0&&(e=0),h===void 0&&(h=!1);for(var i=[],f=this.offsetArray,l=this.rootNodePacked,y=new Float32Array(l),s=new Uint32Array(l),d=new Uint16Array(l),u=e*e,x=new H(1/n.x,1/n.y,1/n.z),w=[0],z,I=new xr(new H(0,0,0),new H(0,0,0)),c=1/0;(z=w.pop())!==void 0;){var p=z*X/4;I.min.x=y[p],I.min.y=y[p+1],I.min.z=y[p+2],I.max.x=y[p+3],I.max.y=y[p+4],I.max.z=y[p+5];var a=dr(t,x,I,e);if(a!==null&&!(h&&a>c)){for(var F=s[p+6],k=s[p+7],E=F;E<k;E++){var S=f[E],V=new H(0,0,0);this.getPositionByIndex(S,V);var U=V.x,W=V.y,M=V.z,T=t.x,j=t.y,q=t.z,P=n.x,B=n.y,_=n.z,A=P*(U-T)+B*(W-j)+_*(M-q);if(A>0?(T+=P*A,j+=B*A,q+=_*A):A<0&&(A=0),P=U-T,B=W-j,_=M-q,P*P+B*B+_*_<=u){var $=new H(T,j,q),C=new wr(V,V,V,S,$);(!v||v(C))&&(h?A<c&&(c=A,i.length>0&&(i.length=0),i.push(C)):i.push(C))}}var G=z*X/2,N=d[G+16],L=d[G+17];N&&w.push(N),L&&w.push(L)}}return i},r})(cr);function Mr(o){onmessage=function(r){Promise.resolve(r.data).then(function(t){return o(t)}).then(function(t){var n=t.output,e=t.transfer;return postMessage(n,e)}).catch(function(t){return postMessage({$$error:t})})}}Mr(function(o){return Promise.resolve(o).then(function(r){for(var t=[],n=new Set,e=0,h=r;e<h.length;e++){var v=h[e],i=void 0;if(v.type==="mesh")i=new Hr(v.attributes.position,v.indices);else if(v.type==="points")i=new Er(v.attributes.position,v.indices);else throw new Error("Invalid Type");i.createTree(v.maxItemPerNode,v.maxTreeDepth,v.extents);var f={type:v.type,attributes:v.attributes,indices:v.indices,offsetArray:i.offsetArray,rootNodePacked:i.rootNodePacked};t.push(f);var l=void 0;for(var y in f.attributes){var s=f.attributes[y];s&&s.buffer instanceof ArrayBuffer&&n.add(s.buffer)}l=f.indices,l&&l.buffer instanceof ArrayBuffer&&n.add(l.buffer),l=f.offsetArray,l&&l.buffer instanceof ArrayBuffer&&n.add(l.buffer),n.add(f.rootNodePacked)}return{output:t,transfer:Array.from(n)}})})})();
|
|
14157
14210
|
`, blob = typeof self != "undefined" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", jsContent], { type: "text/javascript;charset=utf-8" });
|
|
14158
14211
|
function WorkerWrapper(n) {
|
|
14159
14212
|
let t;
|
|
@@ -14178,72 +14231,76 @@ var bvhWorkerPool = new WorkerPool(function() {
|
|
|
14178
14231
|
return new WorkerWrapper();
|
|
14179
14232
|
}, 4), defaultHitFilter = function() {
|
|
14180
14233
|
return !0;
|
|
14181
|
-
},
|
|
14234
|
+
}, scratchRay = new THREE.Ray(), scratchNormalMatrix = new THREE.Matrix3(), scratchInverseMatrix = new THREE.Matrix4(), scratchIntersectionFaceA = new THREE.Vector3(), scratchIntersectionFaceB = new THREE.Vector3(), scratchIntersectionFaceC = new THREE.Vector3(), intersectsMap = /* @__PURE__ */ new Map();
|
|
14182
14235
|
function raycastMesh(n, t, e, r) {
|
|
14183
14236
|
var o, s, u = n.matrixWorld;
|
|
14184
14237
|
scratchInverseMatrix.getInverse(u), scratchRay.copy(e.ray).applyMatrix4(scratchInverseMatrix);
|
|
14185
|
-
|
|
14186
|
-
|
|
14238
|
+
var l = (o = e.hitFilter) !== null && o !== void 0 ? o : defaultHitFilter, c = (s = e.firstHitOnly) !== null && s !== void 0 ? s : !1, d = n.geometry, f = n.material, h = d.groups, p = d.index;
|
|
14239
|
+
intersectsMap.clear();
|
|
14240
|
+
for (var A = t.intersectRay(scratchRay.origin, scratchRay.direction, 0, c, function(v) {
|
|
14241
|
+
var y, b = v.index, T = b * 3, S;
|
|
14187
14242
|
if (Array.isArray(f)) {
|
|
14188
14243
|
if (h)
|
|
14189
|
-
for (var
|
|
14190
|
-
var
|
|
14191
|
-
if (
|
|
14192
|
-
|
|
14244
|
+
for (var R = 0, w = h; R < w.length; R++) {
|
|
14245
|
+
var C = w[R];
|
|
14246
|
+
if (T >= C.start && T - C.start < C.count) {
|
|
14247
|
+
S = f[(y = C.materialIndex) !== null && y !== void 0 ? y : 0];
|
|
14193
14248
|
break;
|
|
14194
14249
|
}
|
|
14195
14250
|
}
|
|
14196
14251
|
} else
|
|
14197
|
-
|
|
14198
|
-
if (!
|
|
14252
|
+
S = f;
|
|
14253
|
+
if (!S)
|
|
14199
14254
|
return !1;
|
|
14200
|
-
var
|
|
14201
|
-
if (
|
|
14255
|
+
var I = v.intersectionPoint, H = new THREE.Vector3(I.x, I.y, I.z).applyMatrix4(u), M = e.ray.origin.distanceTo(H);
|
|
14256
|
+
if (M < e.near || M > e.far)
|
|
14202
14257
|
return !1;
|
|
14203
|
-
var L =
|
|
14204
|
-
if (
|
|
14258
|
+
var B = v.pointA, F = v.pointB, L = v.pointC, O = THREE.Triangle.getNormal(scratchIntersectionFaceA.set(B.x, B.y, B.z).applyMatrix4(u), scratchIntersectionFaceB.set(F.x, F.y, F.z).applyMatrix4(u), scratchIntersectionFaceC.set(L.x, L.y, L.z).applyMatrix4(u), new THREE.Vector3()), k = e.ray.direction.dot(O);
|
|
14259
|
+
if (S.side === THREE.FrontSide && k >= 0 || S.side === THREE.BackSide && k <= 0)
|
|
14205
14260
|
return !1;
|
|
14206
|
-
var D = new THREE.Face3(p ? p.array[
|
|
14207
|
-
distance:
|
|
14261
|
+
var D = new THREE.Face3(p ? p.array[T] : T, p ? p.array[T + 1] : T + 1, p ? p.array[T + 2] : T + 2, O), J = {
|
|
14262
|
+
distance: M,
|
|
14208
14263
|
object: n,
|
|
14209
14264
|
face: D,
|
|
14210
|
-
point:
|
|
14265
|
+
point: H,
|
|
14211
14266
|
distanceToRay: 0,
|
|
14212
|
-
faceIndex:
|
|
14267
|
+
faceIndex: b
|
|
14213
14268
|
};
|
|
14214
|
-
return
|
|
14215
|
-
}),
|
|
14216
|
-
var
|
|
14217
|
-
|
|
14269
|
+
return intersectsMap.set(v, J), l(J);
|
|
14270
|
+
}), g = A.length, m = 0; m < g; m++) {
|
|
14271
|
+
var E = intersectsMap.get(A[m]);
|
|
14272
|
+
E && r.push(E);
|
|
14218
14273
|
}
|
|
14219
|
-
|
|
14274
|
+
intersectsMap.clear();
|
|
14220
14275
|
}
|
|
14221
14276
|
function raycastPoints(n, t, e, r) {
|
|
14222
14277
|
var o, s, u, l, c = n.matrixWorld;
|
|
14223
14278
|
scratchNormalMatrix.getNormalMatrix(c), scratchInverseMatrix.getInverse(c), scratchRay.copy(e.ray).applyMatrix4(scratchInverseMatrix);
|
|
14224
|
-
|
|
14225
|
-
|
|
14226
|
-
|
|
14279
|
+
var d = ((s = (o = e.params.Points) === null || o === void 0 ? void 0 : o.threshold) !== null && s !== void 0 ? s : 1) * scratchInverseMatrix.getMaxScaleOnAxis(), f = (u = e.hitFilter) !== null && u !== void 0 ? u : defaultHitFilter, h = (l = e.firstHitOnly) !== null && l !== void 0 ? l : !1, p = n.geometry, A = p.index, g = p.getAttribute("normal"), m = g instanceof THREE.BufferAttribute;
|
|
14280
|
+
intersectsMap.clear();
|
|
14281
|
+
for (var E = t.intersectRay(scratchRay.origin, scratchRay.direction, d, h, function(T) {
|
|
14282
|
+
var S = T.intersectionPoint, R = new THREE.Vector3(S.x, S.y, S.z).applyMatrix4(c), w = e.ray.origin.distanceTo(R);
|
|
14283
|
+
if (w < e.near || w > e.far)
|
|
14227
14284
|
return !1;
|
|
14228
|
-
var
|
|
14285
|
+
var C = T.pointA, I = scratchIntersectionFaceA.set(C.x, C.y, C.z).applyMatrix4(c), H = T.index, M = A ? A.array[H] : H, B;
|
|
14229
14286
|
if (m) {
|
|
14230
|
-
var
|
|
14231
|
-
|
|
14287
|
+
var F = new THREE.Vector3().fromBufferAttribute(g, M).applyNormalMatrix(scratchNormalMatrix);
|
|
14288
|
+
B = new THREE.Face3(M, M, M, F);
|
|
14232
14289
|
}
|
|
14233
|
-
var
|
|
14234
|
-
distance:
|
|
14290
|
+
var L = {
|
|
14291
|
+
distance: w,
|
|
14235
14292
|
object: n,
|
|
14236
|
-
face:
|
|
14237
|
-
point:
|
|
14238
|
-
distanceToRay:
|
|
14239
|
-
index:
|
|
14293
|
+
face: B,
|
|
14294
|
+
point: R,
|
|
14295
|
+
distanceToRay: R.distanceTo(I),
|
|
14296
|
+
index: H
|
|
14240
14297
|
};
|
|
14241
|
-
return
|
|
14242
|
-
}),
|
|
14243
|
-
var
|
|
14244
|
-
|
|
14298
|
+
return intersectsMap.set(T, L), f(L);
|
|
14299
|
+
}), v = E.length, y = 0; y < v; y++) {
|
|
14300
|
+
var b = intersectsMap.get(E[y]);
|
|
14301
|
+
b && r.push(b);
|
|
14245
14302
|
}
|
|
14246
|
-
|
|
14303
|
+
intersectsMap.clear();
|
|
14247
14304
|
}
|
|
14248
14305
|
var BVH_MESH_PROP = "__bvh_mesh__", originMeshRaycast = THREE.Mesh.prototype.raycast;
|
|
14249
14306
|
function overrideMeshRaycast(n, t) {
|
|
@@ -14451,16 +14508,15 @@ var Motion = (
|
|
|
14451
14508
|
}, t.prototype.intersectRaycaster = function(e, r) {
|
|
14452
14509
|
var o = r != null ? r : [], s = e.hitFilter;
|
|
14453
14510
|
e.hitFilter = function(f) {
|
|
14454
|
-
var h;
|
|
14455
14511
|
if (f.object instanceof PBMPointCloud && f.object.material.pointBack === "HIDDEN" && f.face && f.face.normal.angleTo(e.ray.direction) < Math.PI / 2)
|
|
14456
14512
|
return !1;
|
|
14457
|
-
var
|
|
14513
|
+
var h = 0, p = -1;
|
|
14458
14514
|
if ((f.object instanceof PBMMesh || f.object instanceof PBMSkinnedMesh || f.object instanceof PBMPointCloud) && f.face) {
|
|
14459
|
-
var
|
|
14460
|
-
|
|
14515
|
+
var A = Array.isArray(f.object.material) ? f.object.material[f.face.materialIndex] : f.object.material;
|
|
14516
|
+
A && (h = A.floorIndex, p = A.shownFloorIndex);
|
|
14461
14517
|
}
|
|
14462
|
-
var
|
|
14463
|
-
return
|
|
14518
|
+
var g = p;
|
|
14519
|
+
return e.floorIndex !== void 0 ? g = e.floorIndex : e.floor !== void 0 && (g = e.floor === null ? -1 : e.floor), g >= 0 && h !== g ? !1 : (Object.assign(f, { floorIndex: h, floor: h }), s ? s.call(e, f) : !0);
|
|
14464
14520
|
};
|
|
14465
14521
|
for (var u = this.children.slice(), l; l = u.pop(); )
|
|
14466
14522
|
if (l.visible) {
|
|
@@ -15153,29 +15209,61 @@ function normalizeTilesetHeader(n, t) {
|
|
|
15153
15209
|
}
|
|
15154
15210
|
return normalizeTileHeader(n.root, e), n;
|
|
15155
15211
|
}
|
|
15156
|
-
function
|
|
15157
|
-
|
|
15158
|
-
|
|
15159
|
-
|
|
15160
|
-
|
|
15161
|
-
|
|
15162
|
-
|
|
15212
|
+
function delay(n) {
|
|
15213
|
+
return new Promise(function(t) {
|
|
15214
|
+
return setTimeout(t, n);
|
|
15215
|
+
});
|
|
15216
|
+
}
|
|
15217
|
+
var AsyncTaskQueue = (
|
|
15218
|
+
/** @class */
|
|
15219
|
+
(function() {
|
|
15220
|
+
function n(t) {
|
|
15221
|
+
this.queue = [], this.concurrency = t, this.dequeuing = 0;
|
|
15163
15222
|
}
|
|
15164
|
-
|
|
15165
|
-
|
|
15166
|
-
|
|
15167
|
-
|
|
15168
|
-
|
|
15169
|
-
|
|
15170
|
-
|
|
15171
|
-
|
|
15172
|
-
|
|
15173
|
-
}
|
|
15174
|
-
|
|
15223
|
+
return n.prototype.add = function(t, e) {
|
|
15224
|
+
e === void 0 && (e = 1e3);
|
|
15225
|
+
var r, o, s = new Promise(function(l, c) {
|
|
15226
|
+
r = l, o = c;
|
|
15227
|
+
}), u = function() {
|
|
15228
|
+
var l = Promise.resolve().then(t);
|
|
15229
|
+
l.then(r, o);
|
|
15230
|
+
var c = delay(e);
|
|
15231
|
+
return Promise.race([l, c]).then(noop, noop);
|
|
15232
|
+
};
|
|
15233
|
+
return this.queue.unshift(u), this.dequeue(), s;
|
|
15234
|
+
}, n.prototype.dequeue = function() {
|
|
15235
|
+
for (var t = this; this.dequeuing < this.concurrency && this.queue.length > 0; ) {
|
|
15236
|
+
var e = this.queue.pop();
|
|
15237
|
+
this.dequeuing++, e().catch(noop).then(function() {
|
|
15238
|
+
t.dequeuing--, t.dequeue();
|
|
15239
|
+
});
|
|
15240
|
+
}
|
|
15241
|
+
}, n;
|
|
15242
|
+
})()
|
|
15243
|
+
), initTextureQueue = new AsyncTaskQueue(1), skipImageSize = 256;
|
|
15244
|
+
function canInit(n) {
|
|
15245
|
+
return !!n.image && n.image.width > 0 && n.image.height > 0;
|
|
15246
|
+
}
|
|
15247
|
+
function initTexture(n, t) {
|
|
15248
|
+
if (!canInit(n))
|
|
15249
|
+
return Promise.resolve(n);
|
|
15250
|
+
if (n.image.width < skipImageSize && n.image.width < skipImageSize)
|
|
15251
|
+
return t.initTexture(n), Promise.resolve(n);
|
|
15252
|
+
var e = !1, r = function() {
|
|
15253
|
+
return e = !0;
|
|
15254
|
+
};
|
|
15255
|
+
return n.addEventListener("dispose", r), initTextureQueue.add(function() {
|
|
15256
|
+
return new Promise(function(o) {
|
|
15257
|
+
AnimationFrameLoop.shared.add(function() {
|
|
15258
|
+
canInit(n) && e === !1 && t.initTexture(n), n.removeEventListener("dispose", r), o(n);
|
|
15259
|
+
}, !0);
|
|
15175
15260
|
});
|
|
15176
|
-
};
|
|
15177
|
-
|
|
15178
|
-
|
|
15261
|
+
});
|
|
15262
|
+
}
|
|
15263
|
+
function initTextures(n, t) {
|
|
15264
|
+
return Promise.all(n.map(function(e) {
|
|
15265
|
+
return initTexture(e, t);
|
|
15266
|
+
}));
|
|
15179
15267
|
}
|
|
15180
15268
|
var _object_pattern = /^[og]\s*(.+)?/, _material_library_pattern = /^mtllib /, _material_use_pattern = /^usemtl /, _map_use_pattern = /^usemap /, _face_vertex_data_separator_pattern = /\s+/, _color = new THREE.Color(), ObjState = (
|
|
15181
15269
|
/** @class */
|
|
@@ -15425,8 +15513,8 @@ function build(n, t) {
|
|
|
15425
15513
|
M = [D, Promise.resolve([])];
|
|
15426
15514
|
}
|
|
15427
15515
|
H = M[0], H.name = C.name, H.flatShading = !(C.smooth || m.attributes.normal), H.vertexColors = g, n.materials[I] = H;
|
|
15428
|
-
var
|
|
15429
|
-
r.push(
|
|
15516
|
+
var J = M[1];
|
|
15517
|
+
r.push(J), o.push(function() {
|
|
15430
15518
|
return H.dispose();
|
|
15431
15519
|
});
|
|
15432
15520
|
}
|
|
@@ -15706,7 +15794,7 @@ function loadTileContent(n, t) {
|
|
|
15706
15794
|
}).then(function() {
|
|
15707
15795
|
return Promise.all([
|
|
15708
15796
|
u.object.generateBvhTree(),
|
|
15709
|
-
t.renderer
|
|
15797
|
+
t.renderer ? initTextures(s.textures, t.renderer) : null
|
|
15710
15798
|
]);
|
|
15711
15799
|
}).then(function() {
|
|
15712
15800
|
return e.loadState = "READY", e.loadStateUpdateTime = now(), e.loadfailRetryDelay = 0, e.byteLength = u.byteLength, e.memoryUsage = u.memoryUsage, e.data = u, n;
|
|
@@ -16244,10 +16332,8 @@ var Tile3D = (
|
|
|
16244
16332
|
(b === "Panorama" || b === "VRPanorama" || b === "XRPanorama") && m.modelAlpha < 0.1 && (y = m.panoramaMinGeometricError);
|
|
16245
16333
|
var T = m.maxGeometricError;
|
|
16246
16334
|
T = Math.max(y, T);
|
|
16247
|
-
var S =
|
|
16248
|
-
|
|
16249
|
-
var R = {
|
|
16250
|
-
time: now(),
|
|
16335
|
+
var S = {
|
|
16336
|
+
time: r.time,
|
|
16251
16337
|
camera: {
|
|
16252
16338
|
type: r.type,
|
|
16253
16339
|
position: new THREE.Vector3().copy(r.position),
|
|
@@ -16271,26 +16357,37 @@ var Tile3D = (
|
|
|
16271
16357
|
loadSiblings: m.loadSiblings,
|
|
16272
16358
|
cameraCulling: m.cameraCulling,
|
|
16273
16359
|
maxMemoryUsage: m.maxMemoryUsage,
|
|
16274
|
-
maxRequests:
|
|
16360
|
+
maxRequests: m.maxRequests,
|
|
16275
16361
|
requestOrder: m.requestOrder,
|
|
16276
16362
|
maxScreenSpaceError: m.maxScreenSpaceError,
|
|
16277
16363
|
memoryAdjustedOverflow: m.memoryAdjustedOverflow,
|
|
16278
16364
|
memoryAdjustedScreenSpaceError: m.memoryAdjustedScreenSpaceError
|
|
16279
|
-
},
|
|
16280
|
-
return
|
|
16365
|
+
}, R = m.cacheCameras.map(function(re) {
|
|
16366
|
+
return re.updateProjectionMatrix(), __assign(__assign({}, S), { camera: {
|
|
16281
16367
|
type: r.type,
|
|
16282
|
-
position: new THREE.Vector3().copy(
|
|
16283
|
-
direction:
|
|
16284
|
-
up: new THREE.Vector3().copy(
|
|
16285
|
-
projectionMatrix:
|
|
16286
|
-
visible:
|
|
16368
|
+
position: new THREE.Vector3().copy(re.position),
|
|
16369
|
+
direction: re.getWorldDirection(new THREE.Vector3()),
|
|
16370
|
+
up: new THREE.Vector3().copy(re.up),
|
|
16371
|
+
projectionMatrix: re.projectionMatrix.clone(),
|
|
16372
|
+
visible: re.visible,
|
|
16287
16373
|
refine: !0
|
|
16288
|
-
}, cullingVolume: new CullingVolume().setFromCamera(
|
|
16374
|
+
}, cullingVolume: new CullingVolume().setFromCamera(re) });
|
|
16289
16375
|
});
|
|
16290
|
-
|
|
16291
|
-
|
|
16292
|
-
|
|
16293
|
-
|
|
16376
|
+
this.updateWorldMatrix(!0, !1), this.tileset.transform.equals(this.matrixWorld) || (this.tileset.transform.copy(this.matrixWorld), g = !0);
|
|
16377
|
+
var w = !this.autoRefine;
|
|
16378
|
+
if (w === !1) {
|
|
16379
|
+
var C = m.progress > 0.01 && m.progress < 0.99;
|
|
16380
|
+
if (C) {
|
|
16381
|
+
var I = new THREE.Vector3();
|
|
16382
|
+
m.pano0 && I.setFromMatrixPosition(m.pano0.matrix);
|
|
16383
|
+
var H = I.clone();
|
|
16384
|
+
m.pano1 && H.setFromMatrixPosition(m.pano1.matrix), I.distanceTo(H) < 10 && (w = !0);
|
|
16385
|
+
}
|
|
16386
|
+
}
|
|
16387
|
+
if (w || this.tileset.update(S, R), this.refined = !0, this.refineProgress[0] = 0, this.refineProgress[1] = 0, this.tileset.needsRefinedTiles.forEach(function(re) {
|
|
16388
|
+
if (c.refineProgress[1]++, re.content) {
|
|
16389
|
+
var ue = re.content.loadState;
|
|
16390
|
+
if (ue === "UNLOADED" || ue === "LOADING") {
|
|
16294
16391
|
c.refined = !1;
|
|
16295
16392
|
return;
|
|
16296
16393
|
}
|
|
@@ -16298,63 +16395,63 @@ var Tile3D = (
|
|
|
16298
16395
|
c.refineProgress[0]++;
|
|
16299
16396
|
}), this.loaded === !1 && this.autoRefine) {
|
|
16300
16397
|
this.loaded = !0;
|
|
16301
|
-
var
|
|
16302
|
-
this.tileset.needsRefinedTiles.forEach(function(
|
|
16303
|
-
if (c.loaded !== !1 &&
|
|
16304
|
-
if (
|
|
16305
|
-
if (
|
|
16306
|
-
var
|
|
16307
|
-
(
|
|
16398
|
+
var M = !1;
|
|
16399
|
+
this.tileset.needsRefinedTiles.forEach(function(re) {
|
|
16400
|
+
if (c.loaded !== !1 && re.content) {
|
|
16401
|
+
if (re.state.visible && (M = !0), S.skipLevelOfDetail) {
|
|
16402
|
+
if (re.state.finalResolution) {
|
|
16403
|
+
var ue = re.state.ancestorWithContentAvailable, ve = ue && ue.content ? ue.content : re.content, ye = ve.loadState;
|
|
16404
|
+
(ye === "UNLOADED" || ye === "LOADING") && (c.loaded = !1);
|
|
16308
16405
|
}
|
|
16309
|
-
} else if (
|
|
16310
|
-
var
|
|
16311
|
-
(
|
|
16406
|
+
} else if (re.state.visible && re.levelOfContent <= 0) {
|
|
16407
|
+
var ye = re.content.loadState;
|
|
16408
|
+
(ye === "UNLOADED" || ye === "LOADING") && (c.loaded = !1);
|
|
16312
16409
|
}
|
|
16313
16410
|
}
|
|
16314
|
-
}),
|
|
16411
|
+
}), M && this.tileset.selectedTiles.length === 0 && this.tileset.frameNumber < 500 && (this.loaded = !1), this.loaded === !0 && (this.refined = !1, this.refineProgress[1]++);
|
|
16315
16412
|
}
|
|
16316
|
-
this.renderObjects.length = 0, this.backfaceObjects.length = 0, this.tileObjects.length = 0, this.remove.apply(this, this.children),
|
|
16317
|
-
return
|
|
16413
|
+
this.renderObjects.length = 0, this.backfaceObjects.length = 0, this.tileObjects.length = 0, this.remove.apply(this, this.children), S.skipLevelOfDetail || this.tileset.selectedTiles.sort(function(re, ue) {
|
|
16414
|
+
return re.floor !== ue.floor ? re.floor - ue.floor : re.levelOfContent !== ue.levelOfContent ? ue.levelOfContent - re.levelOfContent : re.state.distanceToCamera !== ue.state.distanceToCamera ? re.state.distanceToCamera - ue.state.distanceToCamera : re.state.centerZDepth - ue.state.centerZDepth;
|
|
16318
16415
|
});
|
|
16319
|
-
for (var
|
|
16320
|
-
var
|
|
16321
|
-
if (
|
|
16322
|
-
var
|
|
16323
|
-
if (
|
|
16324
|
-
if (!
|
|
16325
|
-
var
|
|
16326
|
-
|
|
16416
|
+
for (var B = [], F = 0, L = this.tileset.selectedTiles; F < L.length; F++) {
|
|
16417
|
+
var O = L[F], k = (f = (d = O.content) === null || d === void 0 ? void 0 : d.data) === null || f === void 0 ? void 0 : f.object;
|
|
16418
|
+
if (k) {
|
|
16419
|
+
var D = k.update(e, r, o, this, O, m);
|
|
16420
|
+
if (B.push(O.id), D && (g = !0), this.tileset.hasMixedContent && S.skipLevelOfDetail) {
|
|
16421
|
+
if (!O.state.finalResolution) {
|
|
16422
|
+
var J = cloneSkipBackfaceObject(k);
|
|
16423
|
+
J.name = "skipBackface:" + k.name, this.backfaceObjects.push(J);
|
|
16327
16424
|
}
|
|
16328
|
-
for (var
|
|
16329
|
-
var
|
|
16330
|
-
|
|
16425
|
+
for (var G = O.state.selectionDepth, U = STENCIL_CONSTANT.TILE_MASK | G << STENCIL_CONSTANT.SKIP_LOD_BIT_SHIFT, z = THREE.GreaterEqualStencilFunc, q = STENCIL_CONSTANT.SKIP_LOD_MASK, j = THREE.ReplaceStencilOp, K = STENCIL_CONSTANT.TILE_MASK | STENCIL_CONSTANT.SKIP_LOD_MASK, Y = 0, X = k.materials; Y < X.length; Y++) {
|
|
16426
|
+
var Q = X[Y];
|
|
16427
|
+
Q.stencilWrite = !0, Q.stencilRef = U, Q.stencilFunc = z, Q.stencilFuncMask = q, Q.stencilZPass = j, Q.stencilWriteMask = K;
|
|
16331
16428
|
}
|
|
16332
16429
|
} else
|
|
16333
|
-
for (var
|
|
16334
|
-
var
|
|
16335
|
-
|
|
16430
|
+
for (var W = 0, $ = k.materials; W < $.length; W++) {
|
|
16431
|
+
var Q = $[W];
|
|
16432
|
+
Q.stencilWrite = !1, Q.stencilRef = STENCIL_CONSTANT.TILE_MASK, Q.stencilFunc = THREE.AlwaysStencilFunc, Q.stencilFuncMask = STENCIL_CONSTANT.TILE_MASK, Q.stencilZPass = THREE.ReplaceStencilOp, Q.stencilWriteMask = STENCIL_CONSTANT.TILE_MASK;
|
|
16336
16433
|
}
|
|
16337
|
-
this.tileObjects.push(
|
|
16338
|
-
}
|
|
16339
|
-
}
|
|
16340
|
-
var
|
|
16341
|
-
tileVersionMap.get(this) !==
|
|
16342
|
-
for (var
|
|
16343
|
-
var
|
|
16344
|
-
if (
|
|
16345
|
-
var
|
|
16346
|
-
|
|
16347
|
-
}
|
|
16348
|
-
}
|
|
16349
|
-
var
|
|
16350
|
-
trajectoryVersionMap.get(this) !==
|
|
16351
|
-
for (var
|
|
16352
|
-
var
|
|
16353
|
-
|
|
16354
|
-
(
|
|
16355
|
-
}),
|
|
16356
|
-
},
|
|
16357
|
-
|
|
16434
|
+
this.tileObjects.push(k);
|
|
16435
|
+
}
|
|
16436
|
+
}
|
|
16437
|
+
var ae = B.toString();
|
|
16438
|
+
tileVersionMap.get(this) !== ae && (tileVersionMap.set(this, ae), g = !0), S.skipLevelOfDetail && this.backfaceObjects.length && (u = this.renderObjects).push.apply(u, this.backfaceObjects), this.tileObjects.length && (l = this.renderObjects).push.apply(l, this.tileObjects), S.skipLevelOfDetail && this.renderObjects.push(this.clearStencilObject);
|
|
16439
|
+
for (var ee = [], ne = 0, te = this.tileset.selectedTrajectories; ne < te.length; ne++) {
|
|
16440
|
+
var fe = te[ne], oe = (h = fe.content.data) === null || h === void 0 ? void 0 : h.object;
|
|
16441
|
+
if (oe) {
|
|
16442
|
+
var D = oe.update(e, r, o, this, fe, m);
|
|
16443
|
+
ee.push(fe.id), D && (g = !0), this.renderObjects.push(oe);
|
|
16444
|
+
}
|
|
16445
|
+
}
|
|
16446
|
+
var he = ee.toString();
|
|
16447
|
+
trajectoryVersionMap.get(this) !== he && (trajectoryVersionMap.set(this, he), g = !0);
|
|
16448
|
+
for (var me = Math.min(0, ((A = (p = this.parent) === null || p === void 0 ? void 0 : p.children) !== null && A !== void 0 ? A : []).indexOf(this)), be = me * 1e4, Te = function(re) {
|
|
16449
|
+
var ue = le.renderObjects[re], ve = re + be;
|
|
16450
|
+
ue.traverse(function(ye) {
|
|
16451
|
+
(ye instanceof THREE.Mesh || ye instanceof THREE.Line || ye instanceof THREE.Points) && (ye.renderOrder = ve);
|
|
16452
|
+
}), le.add(ue);
|
|
16453
|
+
}, le = this, de = 0; de < this.renderObjects.length; de++)
|
|
16454
|
+
Te(de);
|
|
16358
16455
|
return g;
|
|
16359
16456
|
}, t.prototype.dispose = function() {
|
|
16360
16457
|
this.disposed = !0, this.tileset.reset(), /^blob\:/.test(this.tileset.id) && URL.revokeObjectURL(this.tileset.id), this.remove.apply(this, this.children), this.refined = !1, this.loaded = !1, this.refineProgress[0] = this.refineProgress[1] = 0;
|
|
@@ -16812,8 +16909,8 @@ var BufferGeometryUtils = {
|
|
|
16812
16909
|
var p = new THREE.Vector3(), A = new THREE.Vector3(), g = new THREE.Vector3(), m = new THREE.Vector2(), E = new THREE.Vector2(), v = new THREE.Vector2(), y = new THREE.Vector3(), b = new THREE.Vector3();
|
|
16813
16910
|
function T(U, z, q) {
|
|
16814
16911
|
p.fromArray(o, U * 3), A.fromArray(o, z * 3), g.fromArray(o, q * 3), m.fromArray(u, U * 2), E.fromArray(u, z * 2), v.fromArray(u, q * 2);
|
|
16815
|
-
var
|
|
16816
|
-
y.set((ne *
|
|
16912
|
+
var j = A.x - p.x, K = g.x - p.x, Y = A.y - p.y, X = g.y - p.y, Q = A.z - p.z, W = g.z - p.z, $ = E.x - m.x, ae = v.x - m.x, ee = E.y - m.y, ne = v.y - m.y, te = 1 / ($ * ne - ae * ee);
|
|
16913
|
+
y.set((ne * j - ee * K) * te, (ne * Y - ee * X) * te, (ne * Q - ee * W) * te), b.set(($ * K - ae * j) * te, ($ * X - ae * Y) * te, ($ * W - ae * Q) * te), d[U].add(y), d[z].add(y), d[q].add(y), f[U].add(b), f[z].add(b), f[q].add(b);
|
|
16817
16914
|
}
|
|
16818
16915
|
var S = n.groups;
|
|
16819
16916
|
S.length === 0 && (S = [{
|
|
@@ -16823,13 +16920,13 @@ var BufferGeometryUtils = {
|
|
|
16823
16920
|
for (var h = 0, R = S.length; h < R; ++h)
|
|
16824
16921
|
for (var w = S[h], C = w.start, I = w.count, H = C, M = C + I; H < M; H += 3)
|
|
16825
16922
|
T(r[H + 0], r[H + 1], r[H + 2]);
|
|
16826
|
-
var B = new THREE.Vector3(), F = new THREE.Vector3(), L = new THREE.Vector3(), O = new THREE.Vector3(), k, D,
|
|
16827
|
-
function
|
|
16828
|
-
L.fromArray(s, U * 3), O.copy(L), D = d[U], B.copy(D), B.sub(L.multiplyScalar(L.dot(D))).normalize(), F.crossVectors(O, D),
|
|
16923
|
+
var B = new THREE.Vector3(), F = new THREE.Vector3(), L = new THREE.Vector3(), O = new THREE.Vector3(), k, D, J;
|
|
16924
|
+
function G(U) {
|
|
16925
|
+
L.fromArray(s, U * 3), O.copy(L), D = d[U], B.copy(D), B.sub(L.multiplyScalar(L.dot(D))).normalize(), F.crossVectors(O, D), J = F.dot(f[U]), k = J < 0 ? -1 : 1, c[U * 4] = B.x, c[U * 4 + 1] = B.y, c[U * 4 + 2] = B.z, c[U * 4 + 3] = k;
|
|
16829
16926
|
}
|
|
16830
16927
|
for (var h = 0, R = S.length; h < R; ++h)
|
|
16831
16928
|
for (var w = S[h], C = w.start, I = w.count, H = C, M = C + I; H < M; H += 3)
|
|
16832
|
-
|
|
16929
|
+
G(r[H + 0]), G(r[H + 1]), G(r[H + 2]);
|
|
16833
16930
|
},
|
|
16834
16931
|
/**
|
|
16835
16932
|
* @param {Array<THREE.BufferGeometry>} geometries
|
|
@@ -16988,44 +17085,41 @@ function getEdgesBySphere(n, t, e) {
|
|
|
16988
17085
|
for (var r = Math.cos(e), o = [], s = 0, u = n.children; s < u.length; s++) {
|
|
16989
17086
|
var l = u[s];
|
|
16990
17087
|
l instanceof Tile3D && l.tileset.selectedTiles.forEach(function(c) {
|
|
16991
|
-
var d, f, h;
|
|
16992
|
-
if (
|
|
16993
|
-
var
|
|
16994
|
-
if (p
|
|
16995
|
-
|
|
16996
|
-
|
|
16997
|
-
if (
|
|
16998
|
-
|
|
16999
|
-
|
|
17000
|
-
|
|
17001
|
-
var J = q.trianglesInSphere(scratchSphere$1.center, scratchSphere$1.radius), V = new THREE.BufferGeometry();
|
|
17002
|
-
V.setAttribute("position", new THREE.BufferAttribute(J, 3)), V.applyMatrix4(z.matrixWorld), V = BufferGeometryUtils.mergeVertices(V, 0.01), A.push(V);
|
|
17003
|
-
}
|
|
17088
|
+
var d, f, h, p = (f = (d = c.content) === null || d === void 0 ? void 0 : d.data) === null || f === void 0 ? void 0 : f.object;
|
|
17089
|
+
if (p && p.visible) {
|
|
17090
|
+
var A = [];
|
|
17091
|
+
if (p.traverseVisible(function(z) {
|
|
17092
|
+
if (z instanceof THREE.Mesh) {
|
|
17093
|
+
var q = getBvhTreeForMesh(z);
|
|
17094
|
+
if (q) {
|
|
17095
|
+
scratchMatrix4$1.copy(z.matrixWorld), scratchMatrix4Inverse.getInverse(scratchMatrix4$1), scratchSphere$1.copy(t).applyMatrix4(scratchMatrix4Inverse);
|
|
17096
|
+
var j = q.trianglesInSphere(scratchSphere$1.center, scratchSphere$1.radius), K = new THREE.BufferGeometry();
|
|
17097
|
+
K.setAttribute("position", new THREE.BufferAttribute(j, 3)), K.applyMatrix4(z.matrixWorld), K = BufferGeometryUtils.mergeVertices(K, 0.01), A.push(K);
|
|
17004
17098
|
}
|
|
17005
|
-
}), A.length === 0)
|
|
17006
|
-
return;
|
|
17007
|
-
for (var g = ["a", "b", "c"], m = BufferGeometryUtils.mergeBufferGeometries(A, !1), E = m.getAttribute("position").array, v = ((h = m.getIndex()) === null || h === void 0 ? void 0 : h.array) || [], y = [], b = [], T = 0, S = E.length; T < S; T += 3) {
|
|
17008
|
-
var R = new THREE.Vector3(E[T], E[T + 1], E[T + 2]);
|
|
17009
|
-
y.push(R);
|
|
17010
17099
|
}
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17100
|
+
}), A.length === 0)
|
|
17101
|
+
return;
|
|
17102
|
+
for (var g = ["a", "b", "c"], m = BufferGeometryUtils.mergeBufferGeometries(A, !1), E = m.getAttribute("position").array, v = ((h = m.getIndex()) === null || h === void 0 ? void 0 : h.array) || [], y = [], b = [], T = 0, S = E.length; T < S; T += 3) {
|
|
17103
|
+
var R = new THREE.Vector3(E[T], E[T + 1], E[T + 2]);
|
|
17104
|
+
y.push(R);
|
|
17105
|
+
}
|
|
17106
|
+
for (var T = 0, S = v.length; T < S; T += 3) {
|
|
17107
|
+
var w = v[T], C = v[T + 1], I = v[T + 2], H = new THREE.Vector3().crossVectors(y[C].clone().sub(y[w]), y[I].clone().sub(y[w])).normalize();
|
|
17108
|
+
b.push({ a: w, b: C, c: I, normal: H });
|
|
17109
|
+
}
|
|
17110
|
+
for (var M = {}, T = 0, S = b.length; T < S; T++)
|
|
17111
|
+
for (var B = b[T], F = 0; F < 3; F++) {
|
|
17112
|
+
var L = B[g[F]], O = B[g[(F + 1) % 3]], k = [Math.min(L, O), Math.max(L, O)], D = k[0] + "-" + k[1];
|
|
17113
|
+
M[D] === void 0 ? M[D] = { index1: k[0], index2: k[1], face1: T } : M[D].face2 = T;
|
|
17014
17114
|
}
|
|
17015
|
-
|
|
17016
|
-
|
|
17017
|
-
|
|
17018
|
-
|
|
17019
|
-
|
|
17020
|
-
for (var D in M) {
|
|
17021
|
-
var j = M[D];
|
|
17022
|
-
if (j.face2 === void 0 || b[j.face1].normal.dot(b[j.face2].normal) <= r) {
|
|
17023
|
-
var K = y[j.index1], U = y[j.index2];
|
|
17024
|
-
o.push(new THREE.Line3(K, U));
|
|
17025
|
-
}
|
|
17115
|
+
for (var D in M) {
|
|
17116
|
+
var J = M[D];
|
|
17117
|
+
if (J.face2 === void 0 || b[J.face1].normal.dot(b[J.face2].normal) <= r) {
|
|
17118
|
+
var G = y[J.index1], U = y[J.index2];
|
|
17119
|
+
o.push(new THREE.Line3(G, U));
|
|
17026
17120
|
}
|
|
17027
|
-
y.length = 0, b.length = 0;
|
|
17028
17121
|
}
|
|
17122
|
+
y.length = 0, b.length = 0;
|
|
17029
17123
|
}
|
|
17030
17124
|
});
|
|
17031
17125
|
}
|
|
@@ -17784,65 +17878,65 @@ function parse(n, t) {
|
|
|
17784
17878
|
configurable: !1,
|
|
17785
17879
|
writable: !1,
|
|
17786
17880
|
value: (function() {
|
|
17787
|
-
var U, z, q,
|
|
17881
|
+
var U, z, q, j = [];
|
|
17788
17882
|
if (Array.isArray(w.model.layers))
|
|
17789
|
-
for (var
|
|
17790
|
-
var
|
|
17791
|
-
if (
|
|
17792
|
-
var
|
|
17793
|
-
defineProperty(
|
|
17883
|
+
for (var K = 0, Y = w.model.layers; K < Y.length; K++) {
|
|
17884
|
+
var X = Y[K];
|
|
17885
|
+
if (X && X.tileset_url) {
|
|
17886
|
+
var Q = {};
|
|
17887
|
+
defineProperty(Q, "work", {
|
|
17794
17888
|
enumerable: !1,
|
|
17795
17889
|
configurable: !1,
|
|
17796
17890
|
writable: !1,
|
|
17797
17891
|
value: t
|
|
17798
|
-
}), defineProperty(
|
|
17892
|
+
}), defineProperty(Q, "name", {
|
|
17799
17893
|
configurable: !1,
|
|
17800
17894
|
writable: !1,
|
|
17801
|
-
value: (U =
|
|
17802
|
-
}), defineProperty(
|
|
17895
|
+
value: (U = X.name) !== null && U !== void 0 ? U : ""
|
|
17896
|
+
}), defineProperty(Q, "type", {
|
|
17803
17897
|
configurable: !1,
|
|
17804
17898
|
writable: !1,
|
|
17805
|
-
value: (z =
|
|
17806
|
-
}), defineProperty(
|
|
17899
|
+
value: (z = X.type) !== null && z !== void 0 ? z : "mesh"
|
|
17900
|
+
}), defineProperty(Q, "upAxis", {
|
|
17807
17901
|
configurable: !1,
|
|
17808
17902
|
writable: !1,
|
|
17809
|
-
value: (q =
|
|
17810
|
-
}), defineProperty(
|
|
17903
|
+
value: (q = X.up_axis) !== null && q !== void 0 ? q : "Z"
|
|
17904
|
+
}), defineProperty(Q, "tileset", {
|
|
17811
17905
|
configurable: !1,
|
|
17812
17906
|
writable: !1,
|
|
17813
|
-
value: relativeURL(
|
|
17814
|
-
}),
|
|
17907
|
+
value: relativeURL(X.tileset_url, t.baseURL)
|
|
17908
|
+
}), j.push(Q);
|
|
17815
17909
|
}
|
|
17816
17910
|
}
|
|
17817
17911
|
if (typeof w.model.tiles == "object") {
|
|
17818
|
-
var
|
|
17819
|
-
if (
|
|
17820
|
-
var
|
|
17821
|
-
defineProperty(
|
|
17912
|
+
var X = w.model.tiles;
|
|
17913
|
+
if (X && X.tileset_url) {
|
|
17914
|
+
var Q = {};
|
|
17915
|
+
defineProperty(Q, "work", {
|
|
17822
17916
|
enumerable: !1,
|
|
17823
17917
|
configurable: !1,
|
|
17824
17918
|
writable: !1,
|
|
17825
17919
|
value: t
|
|
17826
|
-
}), defineProperty(
|
|
17920
|
+
}), defineProperty(Q, "name", {
|
|
17827
17921
|
configurable: !1,
|
|
17828
17922
|
writable: !1,
|
|
17829
17923
|
value: "lod"
|
|
17830
|
-
}), defineProperty(
|
|
17924
|
+
}), defineProperty(Q, "type", {
|
|
17831
17925
|
configurable: !1,
|
|
17832
17926
|
writable: !1,
|
|
17833
17927
|
value: "mesh"
|
|
17834
|
-
}), defineProperty(
|
|
17928
|
+
}), defineProperty(Q, "upAxis", {
|
|
17835
17929
|
configurable: !1,
|
|
17836
17930
|
writable: !1,
|
|
17837
17931
|
value: "-Y"
|
|
17838
|
-
}), defineProperty(
|
|
17932
|
+
}), defineProperty(Q, "tileset", {
|
|
17839
17933
|
configurable: !1,
|
|
17840
17934
|
writable: !1,
|
|
17841
|
-
value: relativeURL(
|
|
17842
|
-
}),
|
|
17935
|
+
value: relativeURL(X.tileset_url, t.baseURL)
|
|
17936
|
+
}), j.push(Q);
|
|
17843
17937
|
}
|
|
17844
17938
|
}
|
|
17845
|
-
return Object.freeze(
|
|
17939
|
+
return Object.freeze(j);
|
|
17846
17940
|
})()
|
|
17847
17941
|
}))), defineProperty(t, "model", {
|
|
17848
17942
|
configurable: !1,
|
|
@@ -17852,141 +17946,141 @@ function parse(n, t) {
|
|
|
17852
17946
|
var I = [];
|
|
17853
17947
|
if (Array.isArray(w.observers) && w.panorama && Array.isArray(w.panorama.list || w.panorama.info))
|
|
17854
17948
|
for (var H = w.observers, M = (r = w.panorama.list || w.panorama.info) !== null && r !== void 0 ? r : [], B = (d = (l = (s = (o = w.panorama) === null || o === void 0 ? void 0 : o.pano_high_cube_base_url) !== null && s !== void 0 ? s : (u = w.panorama) === null || u === void 0 ? void 0 : u.pano_cube_base_url) !== null && l !== void 0 ? l : (c = w.panorama) === null || c === void 0 ? void 0 : c.base_url) !== null && d !== void 0 ? d : "", F = Math.min(H.length, M.length), L = function(U) {
|
|
17855
|
-
var z = H[U], q = M[U],
|
|
17856
|
-
defineProperty(
|
|
17949
|
+
var z = H[U], q = M[U], j = {};
|
|
17950
|
+
defineProperty(j, "work", {
|
|
17857
17951
|
enumerable: !1,
|
|
17858
17952
|
configurable: !1,
|
|
17859
17953
|
writable: !1,
|
|
17860
17954
|
value: t
|
|
17861
|
-
}), defineProperty(
|
|
17955
|
+
}), defineProperty(j, "index", {
|
|
17862
17956
|
configurable: !1,
|
|
17863
17957
|
writable: !1,
|
|
17864
17958
|
value: U
|
|
17865
|
-
}), defineProperty(
|
|
17959
|
+
}), defineProperty(j, "panoIndex", {
|
|
17866
17960
|
configurable: !1,
|
|
17867
17961
|
writable: !1,
|
|
17868
17962
|
value: U
|
|
17869
|
-
}), defineProperty(
|
|
17963
|
+
}), defineProperty(j, "floorIndex", {
|
|
17870
17964
|
configurable: !1,
|
|
17871
17965
|
writable: !1,
|
|
17872
17966
|
value: (f = z.floor_index) !== null && f !== void 0 ? f : z.floor
|
|
17873
|
-
}), defineProperty(
|
|
17967
|
+
}), defineProperty(j, "derivedId", {
|
|
17874
17968
|
configurable: !1,
|
|
17875
17969
|
writable: !1,
|
|
17876
17970
|
value: z.derived_id
|
|
17877
|
-
}), defineProperty(
|
|
17971
|
+
}), defineProperty(j, "derivedIdStr", {
|
|
17878
17972
|
configurable: !1,
|
|
17879
17973
|
writable: !1,
|
|
17880
17974
|
value: z.derived_id_str
|
|
17881
|
-
}), defineProperty(
|
|
17975
|
+
}), defineProperty(j, "active", {
|
|
17882
17976
|
configurable: !1,
|
|
17883
17977
|
writable: !1,
|
|
17884
17978
|
value: z.active !== !1 && q.active !== !1
|
|
17885
|
-
}), defineProperty(
|
|
17979
|
+
}), defineProperty(j, "loadable", {
|
|
17886
17980
|
configurable: !1,
|
|
17887
17981
|
writable: !1,
|
|
17888
17982
|
value: (p = (h = z.active) !== null && h !== void 0 ? h : q.active) !== null && p !== void 0 ? p : !1
|
|
17889
|
-
}), defineProperty(
|
|
17983
|
+
}), defineProperty(j, "position", {
|
|
17890
17984
|
configurable: !1,
|
|
17891
17985
|
writable: !1,
|
|
17892
17986
|
value: Object.freeze(new THREE.Vector3().fromArray((A = z.position) !== null && A !== void 0 ? A : [0, 0, 0]))
|
|
17893
|
-
}), defineProperty(
|
|
17987
|
+
}), defineProperty(j, "standingPosition", {
|
|
17894
17988
|
configurable: !1,
|
|
17895
17989
|
writable: !1,
|
|
17896
17990
|
value: Object.freeze(new THREE.Vector3().fromArray((m = (g = z.standing_position) !== null && g !== void 0 ? g : z.standingPosition) !== null && m !== void 0 ? m : [0, 0, 0]))
|
|
17897
|
-
}), defineProperty(
|
|
17991
|
+
}), defineProperty(j, "quaternion", {
|
|
17898
17992
|
configurable: !1,
|
|
17899
17993
|
writable: !1,
|
|
17900
17994
|
value: Object.freeze(new THREE.Quaternion().fromArray(z.quaternion ? [z.quaternion.x, z.quaternion.y, z.quaternion.z, z.quaternion.w] : [0, 0, 0, 1]))
|
|
17901
|
-
}), defineProperty(
|
|
17995
|
+
}), defineProperty(j, "matrix", {
|
|
17902
17996
|
configurable: !1,
|
|
17903
17997
|
writable: !1,
|
|
17904
|
-
value: Object.freeze(new THREE.Matrix4().compose(
|
|
17905
|
-
}), defineProperty(
|
|
17998
|
+
value: Object.freeze(new THREE.Matrix4().compose(j.position, j.quaternion, PANO_TEXTURE_SCALE))
|
|
17999
|
+
}), defineProperty(j, "accessibleNodes", {
|
|
17906
18000
|
configurable: !1,
|
|
17907
18001
|
writable: !1,
|
|
17908
18002
|
value: (function() {
|
|
17909
|
-
var
|
|
18003
|
+
var K, Y, X = ((Y = (K = z.accessible_nodes) !== null && K !== void 0 ? K : z.accessibleNodes) !== null && Y !== void 0 ? Y : []).filter(function(W) {
|
|
17910
18004
|
return W < F;
|
|
17911
18005
|
});
|
|
17912
|
-
if (
|
|
17913
|
-
for (var
|
|
17914
|
-
|
|
17915
|
-
return Object.freeze(
|
|
18006
|
+
if (X.length === 0)
|
|
18007
|
+
for (var Q = 0; Q < F; Q++)
|
|
18008
|
+
Q !== U && X.push(Q);
|
|
18009
|
+
return Object.freeze(X);
|
|
17916
18010
|
})()
|
|
17917
|
-
}), defineProperty(
|
|
18011
|
+
}), defineProperty(j, "visibleNodes", {
|
|
17918
18012
|
configurable: !1,
|
|
17919
18013
|
writable: !1,
|
|
17920
18014
|
value: (function() {
|
|
17921
|
-
var
|
|
18015
|
+
var K, Y, X = ((Y = (K = z.visible_nodes) !== null && K !== void 0 ? K : z.visibleNodes) !== null && Y !== void 0 ? Y : []).filter(function(W) {
|
|
17922
18016
|
return W < F;
|
|
17923
18017
|
});
|
|
17924
|
-
if (
|
|
17925
|
-
for (var
|
|
17926
|
-
|
|
17927
|
-
return Object.freeze(
|
|
18018
|
+
if (X.length === 0)
|
|
18019
|
+
for (var Q = 0; Q < F; Q++)
|
|
18020
|
+
Q !== U && X.push(Q);
|
|
18021
|
+
return Object.freeze(X);
|
|
17928
18022
|
})()
|
|
17929
|
-
}), defineProperty(
|
|
18023
|
+
}), defineProperty(j, "images", {
|
|
17930
18024
|
configurable: !1,
|
|
17931
18025
|
writable: !1,
|
|
17932
18026
|
value: (function() {
|
|
17933
|
-
var
|
|
17934
|
-
defineProperty(
|
|
18027
|
+
var K = {};
|
|
18028
|
+
defineProperty(K, "work", {
|
|
17935
18029
|
enumerable: !1,
|
|
17936
18030
|
configurable: !1,
|
|
17937
18031
|
writable: !1,
|
|
17938
18032
|
value: t
|
|
17939
18033
|
});
|
|
17940
|
-
for (var
|
|
17941
|
-
var
|
|
17942
|
-
defineProperty(
|
|
18034
|
+
for (var Y = 0, X = FACE_ORDER$1; Y < X.length; Y++) {
|
|
18035
|
+
var Q = X[Y];
|
|
18036
|
+
defineProperty(K, Q, {
|
|
17943
18037
|
configurable: !1,
|
|
17944
18038
|
writable: !1,
|
|
17945
|
-
value: relativeURL(panoURL(q[
|
|
18039
|
+
value: relativeURL(panoURL(q[Q], B, U), t.baseURL)
|
|
17946
18040
|
});
|
|
17947
18041
|
}
|
|
17948
|
-
return defineProperty(
|
|
18042
|
+
return defineProperty(K, "sizeList", {
|
|
17949
18043
|
configurable: !1,
|
|
17950
18044
|
writable: !1,
|
|
17951
18045
|
value: (function() {
|
|
17952
|
-
var W = getImageSizeFromURL(
|
|
18046
|
+
var W = getImageSizeFromURL(K[FACE_ORDER$1[0]]);
|
|
17953
18047
|
if (W) {
|
|
17954
18048
|
if (q.size_list) {
|
|
17955
|
-
var $ = q.size_list.slice().sort(function(
|
|
17956
|
-
return
|
|
18049
|
+
var $ = q.size_list.slice().sort(function(oe, he) {
|
|
18050
|
+
return oe - he;
|
|
17957
18051
|
});
|
|
17958
18052
|
return Object.freeze($);
|
|
17959
18053
|
} else if (q.tiles) {
|
|
17960
18054
|
for (var $ = [
|
|
17961
18055
|
W
|
|
17962
|
-
],
|
|
17963
|
-
return
|
|
17964
|
-
}), ee = 0, ne =
|
|
17965
|
-
var te = ne[ee],
|
|
17966
|
-
|
|
18056
|
+
], ae = q.tiles.slice().sort(function(he, me) {
|
|
18057
|
+
return he - me;
|
|
18058
|
+
}), ee = 0, ne = ae; ee < ne.length; ee++) {
|
|
18059
|
+
var te = ne[ee], fe = 512 * Math.pow(2, te);
|
|
18060
|
+
fe > W && $.push(fe);
|
|
17967
18061
|
}
|
|
17968
18062
|
return Object.freeze($);
|
|
17969
18063
|
}
|
|
17970
18064
|
}
|
|
17971
18065
|
return Object.freeze([]);
|
|
17972
18066
|
})()
|
|
17973
|
-
}), defineProperty(
|
|
18067
|
+
}), defineProperty(K, "tiles", {
|
|
17974
18068
|
configurable: !1,
|
|
17975
18069
|
writable: !1,
|
|
17976
18070
|
value: (function() {
|
|
17977
|
-
var W = getImageSizeFromURL(
|
|
18071
|
+
var W = getImageSizeFromURL(K.front);
|
|
17978
18072
|
if (W) {
|
|
17979
|
-
var $ =
|
|
18073
|
+
var $ = K.sizeList.slice();
|
|
17980
18074
|
if ($[0]) {
|
|
17981
|
-
var
|
|
17982
|
-
if (
|
|
17983
|
-
for (var ee =
|
|
18075
|
+
var ae = getTileLevel($[0]);
|
|
18076
|
+
if (ae)
|
|
18077
|
+
for (var ee = ae - 1; ee >= 0; ee--)
|
|
17984
18078
|
$.unshift(512 * Math.pow(2, ee));
|
|
17985
18079
|
}
|
|
17986
18080
|
if (!($.length <= 0)) {
|
|
17987
|
-
for (var ne = [], te = 0,
|
|
17988
|
-
var
|
|
17989
|
-
if (typeof
|
|
18081
|
+
for (var ne = [], te = 0, fe = $; te < fe.length; te++) {
|
|
18082
|
+
var oe = fe[te], he = getTileLevel(oe);
|
|
18083
|
+
if (typeof he == "number") {
|
|
17990
18084
|
var me = {};
|
|
17991
18085
|
if (defineProperty(me, "work", {
|
|
17992
18086
|
enumerable: !1,
|
|
@@ -17996,23 +18090,23 @@ function parse(n, t) {
|
|
|
17996
18090
|
}), defineProperty(me, "level", {
|
|
17997
18091
|
configurable: !1,
|
|
17998
18092
|
writable: !1,
|
|
17999
|
-
value:
|
|
18000
|
-
}),
|
|
18093
|
+
value: he
|
|
18094
|
+
}), oe > W) {
|
|
18001
18095
|
defineProperty(me, "size", {
|
|
18002
18096
|
configurable: !1,
|
|
18003
18097
|
writable: !1,
|
|
18004
|
-
value:
|
|
18098
|
+
value: oe
|
|
18005
18099
|
}), defineProperty(me, "scale", {
|
|
18006
18100
|
configurable: !1,
|
|
18007
18101
|
writable: !1,
|
|
18008
18102
|
value: 1
|
|
18009
18103
|
});
|
|
18010
|
-
for (var be = 0,
|
|
18011
|
-
var
|
|
18012
|
-
defineProperty(me,
|
|
18104
|
+
for (var be = 0, Te = FACE_ORDER$1; be < Te.length; be++) {
|
|
18105
|
+
var le = Te[be];
|
|
18106
|
+
defineProperty(me, le, {
|
|
18013
18107
|
configurable: !1,
|
|
18014
18108
|
writable: !1,
|
|
18015
|
-
value: replaceImageSize(
|
|
18109
|
+
value: replaceImageSize(K[le], oe)
|
|
18016
18110
|
});
|
|
18017
18111
|
}
|
|
18018
18112
|
} else {
|
|
@@ -18023,14 +18117,14 @@ function parse(n, t) {
|
|
|
18023
18117
|
}), defineProperty(me, "scale", {
|
|
18024
18118
|
configurable: !1,
|
|
18025
18119
|
writable: !1,
|
|
18026
|
-
value:
|
|
18120
|
+
value: oe / W
|
|
18027
18121
|
});
|
|
18028
|
-
for (var
|
|
18029
|
-
var
|
|
18030
|
-
defineProperty(me,
|
|
18122
|
+
for (var de = 0, re = FACE_ORDER$1; de < re.length; de++) {
|
|
18123
|
+
var le = re[de];
|
|
18124
|
+
defineProperty(me, le, {
|
|
18031
18125
|
configurable: !1,
|
|
18032
18126
|
writable: !1,
|
|
18033
|
-
value:
|
|
18127
|
+
value: K[le]
|
|
18034
18128
|
});
|
|
18035
18129
|
}
|
|
18036
18130
|
}
|
|
@@ -18041,33 +18135,33 @@ function parse(n, t) {
|
|
|
18041
18135
|
}
|
|
18042
18136
|
}
|
|
18043
18137
|
})()
|
|
18044
|
-
}),
|
|
18138
|
+
}), K;
|
|
18045
18139
|
})()
|
|
18046
|
-
}), defineProperty(
|
|
18140
|
+
}), defineProperty(j, "video", {
|
|
18047
18141
|
configurable: !1,
|
|
18048
18142
|
writable: !1,
|
|
18049
18143
|
value: (function() {
|
|
18050
|
-
var
|
|
18051
|
-
return q.video && (
|
|
18144
|
+
var K = void 0;
|
|
18145
|
+
return q.video && (K = {}, defineProperty(K, "work", {
|
|
18052
18146
|
enumerable: !1,
|
|
18053
18147
|
configurable: !1,
|
|
18054
18148
|
writable: !1,
|
|
18055
18149
|
value: t
|
|
18056
|
-
}), defineProperty(
|
|
18150
|
+
}), defineProperty(K, "source", {
|
|
18057
18151
|
configurable: !1,
|
|
18058
18152
|
writable: !1,
|
|
18059
18153
|
value: q.video.source
|
|
18060
|
-
}), defineProperty(
|
|
18154
|
+
}), defineProperty(K, "matrix", {
|
|
18061
18155
|
configurable: !1,
|
|
18062
18156
|
writable: !1,
|
|
18063
18157
|
value: new THREE.Matrix4().fromArray(q.video.matrix)
|
|
18064
|
-
}), defineProperty(
|
|
18158
|
+
}), defineProperty(K, "size", {
|
|
18065
18159
|
configurable: !1,
|
|
18066
18160
|
writable: !1,
|
|
18067
18161
|
value: new THREE.Vector2().fromArray(q.video.size)
|
|
18068
|
-
})),
|
|
18162
|
+
})), K;
|
|
18069
18163
|
})()
|
|
18070
|
-
}), I.push(
|
|
18164
|
+
}), I.push(j);
|
|
18071
18165
|
}, O = 0; O < F; O++)
|
|
18072
18166
|
L(O);
|
|
18073
18167
|
defineProperty(t, "observers", {
|
|
@@ -18114,13 +18208,13 @@ function parse(n, t) {
|
|
|
18114
18208
|
writable: !0,
|
|
18115
18209
|
value: w.initial.distance
|
|
18116
18210
|
}), Array.isArray(w.initial.offset)) {
|
|
18117
|
-
var
|
|
18118
|
-
var q = Number(
|
|
18211
|
+
var J = w.initial.offset, G = [0, 0, 0].map(function(U, z) {
|
|
18212
|
+
var q = Number(J[z]);
|
|
18119
18213
|
return isNaN(q) || !isFinite(q) ? 0 : q;
|
|
18120
18214
|
});
|
|
18121
18215
|
defineProperty(k, "offset", {
|
|
18122
18216
|
writable: !0,
|
|
18123
|
-
value: new THREE.Vector3().fromArray(
|
|
18217
|
+
value: new THREE.Vector3().fromArray(G)
|
|
18124
18218
|
});
|
|
18125
18219
|
} else typeof w.initial.offset == "object" && typeof w.initial.offset.x == "number" && typeof w.initial.offset.y == "number" && typeof w.initial.offset.z == "number" && defineProperty(k, "offset", {
|
|
18126
18220
|
writable: !0,
|
|
@@ -19774,48 +19868,48 @@ var Hammer = (function(n, t, e, r) {
|
|
|
19774
19868
|
return Array.isArray(P) ? (p(P, N[_], N), !0) : !1;
|
|
19775
19869
|
}
|
|
19776
19870
|
function p(P, _, N) {
|
|
19777
|
-
var
|
|
19871
|
+
var V;
|
|
19778
19872
|
if (P)
|
|
19779
19873
|
if (P.forEach)
|
|
19780
19874
|
P.forEach(_, N);
|
|
19781
19875
|
else if (P.length !== r)
|
|
19782
|
-
for (
|
|
19783
|
-
_.call(N, P[
|
|
19876
|
+
for (V = 0; V < P.length; )
|
|
19877
|
+
_.call(N, P[V], V, P), V++;
|
|
19784
19878
|
else
|
|
19785
|
-
for (
|
|
19786
|
-
P.hasOwnProperty(
|
|
19879
|
+
for (V in P)
|
|
19880
|
+
P.hasOwnProperty(V) && _.call(N, P[V], V, P);
|
|
19787
19881
|
}
|
|
19788
19882
|
function A(P, _, N) {
|
|
19789
|
-
var
|
|
19883
|
+
var V = "DEPRECATED METHOD: " + _ + `
|
|
19790
19884
|
` + N + ` AT
|
|
19791
19885
|
`;
|
|
19792
19886
|
return function() {
|
|
19793
|
-
var Z = new Error("get-stack-trace"),
|
|
19794
|
-
return ge && ge.call(n.console,
|
|
19887
|
+
var Z = new Error("get-stack-trace"), ie = Z && Z.stack ? Z.stack.replace(/^[^\(]+?[\n$]/gm, "").replace(/^\s+at\s+/gm, "").replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace", ge = n.console && (n.console.warn || n.console.log);
|
|
19888
|
+
return ge && ge.call(n.console, V, ie), P.apply(this, arguments);
|
|
19795
19889
|
};
|
|
19796
19890
|
}
|
|
19797
19891
|
var g;
|
|
19798
19892
|
typeof Object.assign != "function" ? g = function(_) {
|
|
19799
19893
|
if (_ === r || _ === null)
|
|
19800
19894
|
throw new TypeError("Cannot convert undefined or null to object");
|
|
19801
|
-
for (var N = Object(_),
|
|
19802
|
-
var Z = arguments[
|
|
19895
|
+
for (var N = Object(_), V = 1; V < arguments.length; V++) {
|
|
19896
|
+
var Z = arguments[V];
|
|
19803
19897
|
if (Z !== r && Z !== null)
|
|
19804
|
-
for (var
|
|
19805
|
-
Z.hasOwnProperty(
|
|
19898
|
+
for (var ie in Z)
|
|
19899
|
+
Z.hasOwnProperty(ie) && (N[ie] = Z[ie]);
|
|
19806
19900
|
}
|
|
19807
19901
|
return N;
|
|
19808
19902
|
} : g = Object.assign;
|
|
19809
|
-
var m = A(function(_, N,
|
|
19810
|
-
for (var Z = Object.keys(N),
|
|
19811
|
-
(!
|
|
19903
|
+
var m = A(function(_, N, V) {
|
|
19904
|
+
for (var Z = Object.keys(N), ie = 0; ie < Z.length; )
|
|
19905
|
+
(!V || V && _[Z[ie]] === r) && (_[Z[ie]] = N[Z[ie]]), ie++;
|
|
19812
19906
|
return _;
|
|
19813
19907
|
}, "extend", "Use `assign`."), E = A(function(_, N) {
|
|
19814
19908
|
return m(_, N, !0);
|
|
19815
19909
|
}, "merge", "Use `assign`.");
|
|
19816
19910
|
function v(P, _, N) {
|
|
19817
|
-
var
|
|
19818
|
-
Z = P.prototype = Object.create(
|
|
19911
|
+
var V = _.prototype, Z;
|
|
19912
|
+
Z = P.prototype = Object.create(V), Z.constructor = P, Z._super = V, N && g(Z, N);
|
|
19819
19913
|
}
|
|
19820
19914
|
function y(P, _) {
|
|
19821
19915
|
return function() {
|
|
@@ -19829,13 +19923,13 @@ var Hammer = (function(n, t, e, r) {
|
|
|
19829
19923
|
return P === r ? _ : P;
|
|
19830
19924
|
}
|
|
19831
19925
|
function S(P, _, N) {
|
|
19832
|
-
p(I(_), function(
|
|
19833
|
-
P.addEventListener(
|
|
19926
|
+
p(I(_), function(V) {
|
|
19927
|
+
P.addEventListener(V, N, !1);
|
|
19834
19928
|
});
|
|
19835
19929
|
}
|
|
19836
19930
|
function R(P, _, N) {
|
|
19837
|
-
p(I(_), function(
|
|
19838
|
-
P.removeEventListener(
|
|
19931
|
+
p(I(_), function(V) {
|
|
19932
|
+
P.removeEventListener(V, N, !1);
|
|
19839
19933
|
});
|
|
19840
19934
|
}
|
|
19841
19935
|
function w(P, _) {
|
|
@@ -19855,10 +19949,10 @@ var Hammer = (function(n, t, e, r) {
|
|
|
19855
19949
|
function H(P, _, N) {
|
|
19856
19950
|
if (P.indexOf && !N)
|
|
19857
19951
|
return P.indexOf(_);
|
|
19858
|
-
for (var
|
|
19859
|
-
if (N && P[
|
|
19860
|
-
return
|
|
19861
|
-
|
|
19952
|
+
for (var V = 0; V < P.length; ) {
|
|
19953
|
+
if (N && P[V][N] == _ || !N && P[V] === _)
|
|
19954
|
+
return V;
|
|
19955
|
+
V++;
|
|
19862
19956
|
}
|
|
19863
19957
|
return -1;
|
|
19864
19958
|
}
|
|
@@ -19866,19 +19960,19 @@ var Hammer = (function(n, t, e, r) {
|
|
|
19866
19960
|
return Array.prototype.slice.call(P, 0);
|
|
19867
19961
|
}
|
|
19868
19962
|
function B(P, _, N) {
|
|
19869
|
-
for (var
|
|
19870
|
-
var ge = P[
|
|
19871
|
-
H(Z, ge) < 0 &&
|
|
19963
|
+
for (var V = [], Z = [], ie = 0; ie < P.length; ) {
|
|
19964
|
+
var ge = P[ie][_];
|
|
19965
|
+
H(Z, ge) < 0 && V.push(P[ie]), Z[ie] = ge, ie++;
|
|
19872
19966
|
}
|
|
19873
|
-
return
|
|
19874
|
-
return ut[_] >
|
|
19875
|
-
}),
|
|
19967
|
+
return V = V.sort(function(ut, ke) {
|
|
19968
|
+
return ut[_] > ke[_];
|
|
19969
|
+
}), V;
|
|
19876
19970
|
}
|
|
19877
19971
|
function F(P, _) {
|
|
19878
|
-
for (var N,
|
|
19879
|
-
if (N = o[
|
|
19880
|
-
return
|
|
19881
|
-
|
|
19972
|
+
for (var N, V, Z = _[0].toUpperCase() + _.slice(1), ie = 0; ie < o.length; ) {
|
|
19973
|
+
if (N = o[ie], V = N ? N + Z : _, V in P)
|
|
19974
|
+
return V;
|
|
19975
|
+
ie++;
|
|
19882
19976
|
}
|
|
19883
19977
|
return r;
|
|
19884
19978
|
}
|
|
@@ -19890,14 +19984,14 @@ var Hammer = (function(n, t, e, r) {
|
|
|
19890
19984
|
var _ = P.ownerDocument || P;
|
|
19891
19985
|
return _.defaultView || _.parentWindow || n;
|
|
19892
19986
|
}
|
|
19893
|
-
var D = /mobile|tablet|ip(ad|hone|od)|android/i,
|
|
19894
|
-
function
|
|
19987
|
+
var D = /mobile|tablet|ip(ad|hone|od)|android/i, J = "ontouchstart" in n, G = F(n, "PointerEvent") !== r, U = J && D.test(navigator.userAgent), z = "touch", q = "pen", j = "mouse", K = "kinect", Y = 25, X = 1, Q = 2, W = 4, $ = 8, ae = 1, ee = 2, ne = 4, te = 8, fe = 16, oe = ee | ne, he = te | fe, me = oe | he, be = ["x", "y"], Te = ["clientX", "clientY"];
|
|
19988
|
+
function le(P, _) {
|
|
19895
19989
|
var N = this;
|
|
19896
|
-
this.manager = P, this.callback = _, this.element = P.element, this.target = P.options.inputTarget, this.domHandler = function(
|
|
19897
|
-
b(P.options.enable, [P]) && N.handler(
|
|
19990
|
+
this.manager = P, this.callback = _, this.element = P.element, this.target = P.options.inputTarget, this.domHandler = function(V) {
|
|
19991
|
+
b(P.options.enable, [P]) && N.handler(V);
|
|
19898
19992
|
}, this.init();
|
|
19899
19993
|
}
|
|
19900
|
-
|
|
19994
|
+
le.prototype = {
|
|
19901
19995
|
/**
|
|
19902
19996
|
* should handle the inputEvent data and trigger the callback
|
|
19903
19997
|
* @virtual
|
|
@@ -19917,44 +20011,44 @@ var Hammer = (function(n, t, e, r) {
|
|
|
19917
20011
|
this.evEl && R(this.element, this.evEl, this.domHandler), this.evTarget && R(this.target, this.evTarget, this.domHandler), this.evWin && R(k(this.element), this.evWin, this.domHandler);
|
|
19918
20012
|
}
|
|
19919
20013
|
};
|
|
19920
|
-
function
|
|
20014
|
+
function de(P) {
|
|
19921
20015
|
var _, N = P.options.inputClass;
|
|
19922
|
-
return N ? _ = N :
|
|
19923
|
-
}
|
|
19924
|
-
function
|
|
19925
|
-
var
|
|
19926
|
-
N.isFirst = !!
|
|
19927
|
-
}
|
|
19928
|
-
function
|
|
19929
|
-
var N = P.session,
|
|
19930
|
-
N.firstInput || (N.firstInput =
|
|
19931
|
-
var
|
|
19932
|
-
_.timeStamp = d(), _.deltaTime = _.timeStamp -
|
|
19933
|
-
var
|
|
19934
|
-
_.overallVelocityX =
|
|
20016
|
+
return N ? _ = N : G ? _ = Be : U ? _ = qe : J ? _ = nt : _ = Le, new _(P, re);
|
|
20017
|
+
}
|
|
20018
|
+
function re(P, _, N) {
|
|
20019
|
+
var V = N.pointers.length, Z = N.changedPointers.length, ie = _ & X && V - Z === 0, ge = _ & (W | $) && V - Z === 0;
|
|
20020
|
+
N.isFirst = !!ie, N.isFinal = !!ge, ie && (P.session = {}), N.eventType = _, ue(P, N), P.emit("hammer.input", N), P.recognize(N), P.session.prevInput = N;
|
|
20021
|
+
}
|
|
20022
|
+
function ue(P, _) {
|
|
20023
|
+
var N = P.session, V = _.pointers, Z = V.length;
|
|
20024
|
+
N.firstInput || (N.firstInput = De(_)), Z > 1 && !N.firstMultiple ? N.firstMultiple = De(_) : Z === 1 && (N.firstMultiple = !1);
|
|
20025
|
+
var ie = N.firstInput, ge = N.firstMultiple, Ne = ge ? ge.center : ie.center, ut = _.center = Je(V);
|
|
20026
|
+
_.timeStamp = d(), _.deltaTime = _.timeStamp - ie.timeStamp, _.angle = Ye(Ne, ut), _.distance = pe(Ne, ut), ve(N, _), _.offsetDirection = Ue(_.deltaX, _.deltaY);
|
|
20027
|
+
var ke = $e(_.deltaTime, _.deltaX, _.deltaY);
|
|
20028
|
+
_.overallVelocityX = ke.x, _.overallVelocityY = ke.y, _.overallVelocity = c(ke.x) > c(ke.y) ? ke.x : ke.y, _.scale = ge ? Oe(ge.pointers, V) : 1, _.rotation = ge ? Ee(ge.pointers, V) : 0, _.maxPointers = N.prevInput ? _.pointers.length > N.prevInput.maxPointers ? _.pointers.length : N.prevInput.maxPointers : _.pointers.length, ye(N, _);
|
|
19935
20029
|
var St = P.element;
|
|
19936
20030
|
w(_.srcEvent.target, St) && (St = _.srcEvent.target), _.target = St;
|
|
19937
20031
|
}
|
|
19938
|
-
function
|
|
19939
|
-
var N = _.center,
|
|
19940
|
-
(_.eventType ===
|
|
19941
|
-
x:
|
|
19942
|
-
y:
|
|
19943
|
-
},
|
|
20032
|
+
function ve(P, _) {
|
|
20033
|
+
var N = _.center, V = P.offsetDelta || {}, Z = P.prevDelta || {}, ie = P.prevInput || {};
|
|
20034
|
+
(_.eventType === X || ie.eventType === W) && (Z = P.prevDelta = {
|
|
20035
|
+
x: ie.deltaX || 0,
|
|
20036
|
+
y: ie.deltaY || 0
|
|
20037
|
+
}, V = P.offsetDelta = {
|
|
19944
20038
|
x: N.x,
|
|
19945
20039
|
y: N.y
|
|
19946
|
-
}), _.deltaX = Z.x + (N.x -
|
|
20040
|
+
}), _.deltaX = Z.x + (N.x - V.x), _.deltaY = Z.y + (N.y - V.y);
|
|
19947
20041
|
}
|
|
19948
|
-
function
|
|
19949
|
-
var N = P.lastInterval || _,
|
|
19950
|
-
if (_.eventType != $ && (
|
|
19951
|
-
var ut = _.deltaX - N.deltaX,
|
|
19952
|
-
|
|
20042
|
+
function ye(P, _) {
|
|
20043
|
+
var N = P.lastInterval || _, V = _.timeStamp - N.timeStamp, Z, ie, ge, Ne;
|
|
20044
|
+
if (_.eventType != $ && (V > Y || N.velocity === r)) {
|
|
20045
|
+
var ut = _.deltaX - N.deltaX, ke = _.deltaY - N.deltaY, St = $e(V, ut, ke);
|
|
20046
|
+
ie = St.x, ge = St.y, Z = c(St.x) > c(St.y) ? St.x : St.y, Ne = Ue(ut, ke), P.lastInterval = _;
|
|
19953
20047
|
} else
|
|
19954
|
-
Z = N.velocity,
|
|
19955
|
-
_.velocity = Z, _.velocityX =
|
|
20048
|
+
Z = N.velocity, ie = N.velocityX, ge = N.velocityY, Ne = N.direction;
|
|
20049
|
+
_.velocity = Z, _.velocityX = ie, _.velocityY = ge, _.direction = Ne;
|
|
19956
20050
|
}
|
|
19957
|
-
function
|
|
20051
|
+
function De(P) {
|
|
19958
20052
|
for (var _ = [], N = 0; N < P.pointers.length; )
|
|
19959
20053
|
_[N] = {
|
|
19960
20054
|
clientX: l(P.pointers[N].clientX),
|
|
@@ -19963,122 +20057,122 @@ var Hammer = (function(n, t, e, r) {
|
|
|
19963
20057
|
return {
|
|
19964
20058
|
timeStamp: d(),
|
|
19965
20059
|
pointers: _,
|
|
19966
|
-
center:
|
|
20060
|
+
center: Je(_),
|
|
19967
20061
|
deltaX: P.deltaX,
|
|
19968
20062
|
deltaY: P.deltaY
|
|
19969
20063
|
};
|
|
19970
20064
|
}
|
|
19971
|
-
function
|
|
20065
|
+
function Je(P) {
|
|
19972
20066
|
var _ = P.length;
|
|
19973
20067
|
if (_ === 1)
|
|
19974
20068
|
return {
|
|
19975
20069
|
x: l(P[0].clientX),
|
|
19976
20070
|
y: l(P[0].clientY)
|
|
19977
20071
|
};
|
|
19978
|
-
for (var N = 0,
|
|
19979
|
-
N += P[Z].clientX,
|
|
20072
|
+
for (var N = 0, V = 0, Z = 0; Z < _; )
|
|
20073
|
+
N += P[Z].clientX, V += P[Z].clientY, Z++;
|
|
19980
20074
|
return {
|
|
19981
20075
|
x: l(N / _),
|
|
19982
|
-
y: l(
|
|
20076
|
+
y: l(V / _)
|
|
19983
20077
|
};
|
|
19984
20078
|
}
|
|
19985
|
-
function
|
|
20079
|
+
function $e(P, _, N) {
|
|
19986
20080
|
return {
|
|
19987
20081
|
x: _ / P || 0,
|
|
19988
20082
|
y: N / P || 0
|
|
19989
20083
|
};
|
|
19990
20084
|
}
|
|
19991
|
-
function
|
|
19992
|
-
return P === _ ?
|
|
20085
|
+
function Ue(P, _) {
|
|
20086
|
+
return P === _ ? ae : c(P) >= c(_) ? P < 0 ? ee : ne : _ < 0 ? te : fe;
|
|
19993
20087
|
}
|
|
19994
|
-
function
|
|
20088
|
+
function pe(P, _, N) {
|
|
19995
20089
|
N || (N = be);
|
|
19996
|
-
var
|
|
19997
|
-
return Math.sqrt(
|
|
20090
|
+
var V = _[N[0]] - P[N[0]], Z = _[N[1]] - P[N[1]];
|
|
20091
|
+
return Math.sqrt(V * V + Z * Z);
|
|
19998
20092
|
}
|
|
19999
|
-
function
|
|
20093
|
+
function Ye(P, _, N) {
|
|
20000
20094
|
N || (N = be);
|
|
20001
|
-
var
|
|
20002
|
-
return Math.atan2(Z,
|
|
20095
|
+
var V = _[N[0]] - P[N[0]], Z = _[N[1]] - P[N[1]];
|
|
20096
|
+
return Math.atan2(Z, V) * 180 / Math.PI;
|
|
20003
20097
|
}
|
|
20004
20098
|
function Ee(P, _) {
|
|
20005
|
-
return
|
|
20099
|
+
return Ye(_[1], _[0], Te) + Ye(P[1], P[0], Te);
|
|
20006
20100
|
}
|
|
20007
20101
|
function Oe(P, _) {
|
|
20008
|
-
return
|
|
20102
|
+
return pe(_[0], _[1], Te) / pe(P[0], P[1], Te);
|
|
20009
20103
|
}
|
|
20010
20104
|
var Fe = {
|
|
20011
|
-
mousedown:
|
|
20012
|
-
mousemove:
|
|
20105
|
+
mousedown: X,
|
|
20106
|
+
mousemove: Q,
|
|
20013
20107
|
mouseup: W
|
|
20014
20108
|
}, tt = "mousedown", rt = "mousemove mouseup";
|
|
20015
|
-
function
|
|
20016
|
-
this.evEl = tt, this.evWin = rt, this.pressed = !1,
|
|
20109
|
+
function Le() {
|
|
20110
|
+
this.evEl = tt, this.evWin = rt, this.pressed = !1, le.apply(this, arguments);
|
|
20017
20111
|
}
|
|
20018
|
-
v(
|
|
20112
|
+
v(Le, le, {
|
|
20019
20113
|
/**
|
|
20020
20114
|
* handle mouse events
|
|
20021
20115
|
* @param {Object} ev
|
|
20022
20116
|
*/
|
|
20023
20117
|
handler: function(_) {
|
|
20024
20118
|
var N = Fe[_.type];
|
|
20025
|
-
N &
|
|
20119
|
+
N & X && (_.button === 0 || _.button === 2) && (this.pressed = !0), N & Q && _.which !== 1 && (N = W), this.pressed && (N & W && (this.pressed = !1), this.callback(this.manager, N, {
|
|
20026
20120
|
pointers: [_],
|
|
20027
20121
|
changedPointers: [_],
|
|
20028
|
-
pointerType:
|
|
20122
|
+
pointerType: j,
|
|
20029
20123
|
srcEvent: _
|
|
20030
20124
|
}));
|
|
20031
20125
|
}
|
|
20032
20126
|
});
|
|
20033
20127
|
var Pe = {
|
|
20034
|
-
pointerdown:
|
|
20035
|
-
pointermove:
|
|
20128
|
+
pointerdown: X,
|
|
20129
|
+
pointermove: Q,
|
|
20036
20130
|
pointerup: W,
|
|
20037
20131
|
pointercancel: $,
|
|
20038
20132
|
pointerout: $
|
|
20039
20133
|
}, _e = {
|
|
20040
20134
|
2: z,
|
|
20041
20135
|
3: q,
|
|
20042
|
-
4:
|
|
20043
|
-
5:
|
|
20136
|
+
4: j,
|
|
20137
|
+
5: K
|
|
20044
20138
|
// see https://twitter.com/jacobrossi/status/480596438489890816
|
|
20045
20139
|
}, Ae = "pointerdown", Ce = "pointermove pointerup pointercancel";
|
|
20046
20140
|
n.MSPointerEvent && !n.PointerEvent && (Ae = "MSPointerDown", Ce = "MSPointerMove MSPointerUp MSPointerCancel");
|
|
20047
20141
|
function Be() {
|
|
20048
|
-
this.evEl = Ae, this.evWin = Ce,
|
|
20142
|
+
this.evEl = Ae, this.evWin = Ce, le.apply(this, arguments), this.store = this.manager.session.pointerEvents = [];
|
|
20049
20143
|
}
|
|
20050
|
-
v(Be,
|
|
20144
|
+
v(Be, le, {
|
|
20051
20145
|
/**
|
|
20052
20146
|
* handle mouse events
|
|
20053
20147
|
* @param {Object} ev
|
|
20054
20148
|
*/
|
|
20055
20149
|
handler: function(_) {
|
|
20056
|
-
var N = this.store,
|
|
20057
|
-
ge &
|
|
20150
|
+
var N = this.store, V = !1, Z = !1, ie = _.type.toLowerCase().replace("ms", ""), ge = Pe[ie], Ne = _e[_.pointerType] || _.pointerType, ut = Ne == z, ke = H(N, _.pointerId, "pointerId");
|
|
20151
|
+
ge & X && (_.button === 0 || _.button === 2 || ut) ? ke < 0 && (N.push(_), ke = N.length - 1) : ge & (W | $) ? V = !0 : !ut && _.buttons === 0 && (V = !0, Z = !0, ge = Pe.pointerup), !(ke < 0) && (Z || (N[ke] = _), this.callback(this.manager, ge, {
|
|
20058
20152
|
pointers: N,
|
|
20059
20153
|
changedPointers: [_],
|
|
20060
|
-
pointerType:
|
|
20061
|
-
srcEvent: N[
|
|
20062
|
-
}),
|
|
20154
|
+
pointerType: Ne,
|
|
20155
|
+
srcEvent: N[ke]
|
|
20156
|
+
}), V && N.splice(ke, 1));
|
|
20063
20157
|
}
|
|
20064
20158
|
});
|
|
20065
20159
|
var je = {
|
|
20066
|
-
touchstart:
|
|
20067
|
-
touchmove:
|
|
20160
|
+
touchstart: X,
|
|
20161
|
+
touchmove: Q,
|
|
20068
20162
|
touchend: W,
|
|
20069
20163
|
touchcancel: $
|
|
20070
|
-
}, Ve = "touchstart",
|
|
20164
|
+
}, Ve = "touchstart", Ze = "touchstart touchmove touchend touchcancel";
|
|
20071
20165
|
function At() {
|
|
20072
|
-
this.evTarget = Ve, this.evWin =
|
|
20166
|
+
this.evTarget = Ve, this.evWin = Ze, this.started = !1, le.apply(this, arguments);
|
|
20073
20167
|
}
|
|
20074
|
-
v(At,
|
|
20168
|
+
v(At, le, {
|
|
20075
20169
|
handler: function(_) {
|
|
20076
20170
|
var N = je[_.type];
|
|
20077
|
-
if (N ===
|
|
20078
|
-
var
|
|
20079
|
-
N & (W | $) &&
|
|
20080
|
-
pointers:
|
|
20081
|
-
changedPointers:
|
|
20171
|
+
if (N === X && (this.started = !0), !!this.started) {
|
|
20172
|
+
var V = Qe.call(this, _, N);
|
|
20173
|
+
N & (W | $) && V[0].length - V[1].length === 0 && (this.started = !1), this.callback(this.manager, N, {
|
|
20174
|
+
pointers: V[0],
|
|
20175
|
+
changedPointers: V[1],
|
|
20082
20176
|
pointerType: z,
|
|
20083
20177
|
srcEvent: _
|
|
20084
20178
|
});
|
|
@@ -20086,69 +20180,69 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20086
20180
|
}
|
|
20087
20181
|
});
|
|
20088
20182
|
function Qe(P, _) {
|
|
20089
|
-
var N = M(P.touches),
|
|
20090
|
-
return _ & (W | $) && (N = B(N.concat(
|
|
20183
|
+
var N = M(P.touches), V = M(P.changedTouches);
|
|
20184
|
+
return _ & (W | $) && (N = B(N.concat(V), "identifier")), [N, V];
|
|
20091
20185
|
}
|
|
20092
20186
|
var gt = {
|
|
20093
|
-
touchstart:
|
|
20094
|
-
touchmove:
|
|
20187
|
+
touchstart: X,
|
|
20188
|
+
touchmove: Q,
|
|
20095
20189
|
touchend: W,
|
|
20096
20190
|
touchcancel: $
|
|
20097
20191
|
}, we = "touchstart touchmove touchend touchcancel";
|
|
20098
|
-
function
|
|
20099
|
-
this.evTarget = we, this.targetIds = {},
|
|
20192
|
+
function qe() {
|
|
20193
|
+
this.evTarget = we, this.targetIds = {}, le.apply(this, arguments);
|
|
20100
20194
|
}
|
|
20101
|
-
v(
|
|
20195
|
+
v(qe, le, {
|
|
20102
20196
|
handler: function(_) {
|
|
20103
|
-
var N = gt[_.type],
|
|
20104
|
-
|
|
20105
|
-
pointers:
|
|
20106
|
-
changedPointers:
|
|
20197
|
+
var N = gt[_.type], V = dt.call(this, _, N);
|
|
20198
|
+
V && this.callback(this.manager, N, {
|
|
20199
|
+
pointers: V[0],
|
|
20200
|
+
changedPointers: V[1],
|
|
20107
20201
|
pointerType: z,
|
|
20108
20202
|
srcEvent: _
|
|
20109
20203
|
});
|
|
20110
20204
|
}
|
|
20111
20205
|
});
|
|
20112
20206
|
function dt(P, _) {
|
|
20113
|
-
var N = M(P.touches),
|
|
20114
|
-
if (_ & (
|
|
20115
|
-
return
|
|
20116
|
-
var Z,
|
|
20117
|
-
if (
|
|
20118
|
-
return w(
|
|
20119
|
-
}), _ ===
|
|
20120
|
-
for (Z = 0; Z <
|
|
20121
|
-
|
|
20207
|
+
var N = M(P.touches), V = this.targetIds;
|
|
20208
|
+
if (_ & (X | Q) && N.length === 1)
|
|
20209
|
+
return V[N[0].identifier] = !0, [N, N];
|
|
20210
|
+
var Z, ie, ge = M(P.changedTouches), Ne = [], ut = this.target;
|
|
20211
|
+
if (ie = N.filter(function(ke) {
|
|
20212
|
+
return w(ke.target, ut);
|
|
20213
|
+
}), _ === X)
|
|
20214
|
+
for (Z = 0; Z < ie.length; )
|
|
20215
|
+
V[ie[Z].identifier] = !0, Z++;
|
|
20122
20216
|
for (Z = 0; Z < ge.length; )
|
|
20123
|
-
|
|
20124
|
-
if (
|
|
20217
|
+
V[ge[Z].identifier] && Ne.push(ge[Z]), _ & (W | $) && delete V[ge[Z].identifier], Z++;
|
|
20218
|
+
if (Ne.length)
|
|
20125
20219
|
return [
|
|
20126
20220
|
// merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
|
|
20127
|
-
B(
|
|
20128
|
-
|
|
20221
|
+
B(ie.concat(Ne), "identifier"),
|
|
20222
|
+
Ne
|
|
20129
20223
|
];
|
|
20130
20224
|
}
|
|
20131
20225
|
var ht = 2500, Ge = 25;
|
|
20132
20226
|
function nt() {
|
|
20133
|
-
|
|
20227
|
+
le.apply(this, arguments);
|
|
20134
20228
|
var P = y(this.handler, this);
|
|
20135
|
-
this.touch = new
|
|
20229
|
+
this.touch = new qe(this.manager, P), this.mouse = new Le(this.manager, P), this.primaryTouch = null, this.lastTouches = [];
|
|
20136
20230
|
}
|
|
20137
|
-
v(nt,
|
|
20231
|
+
v(nt, le, {
|
|
20138
20232
|
/**
|
|
20139
20233
|
* handle mouse and touch events
|
|
20140
20234
|
* @param {Hammer} manager
|
|
20141
20235
|
* @param {String} inputEvent
|
|
20142
20236
|
* @param {Object} inputData
|
|
20143
20237
|
*/
|
|
20144
|
-
handler: function(_, N,
|
|
20145
|
-
var Z =
|
|
20146
|
-
if (!(
|
|
20238
|
+
handler: function(_, N, V) {
|
|
20239
|
+
var Z = V.pointerType == z, ie = V.pointerType == j;
|
|
20240
|
+
if (!(ie && V.sourceCapabilities && V.sourceCapabilities.firesTouchEvents)) {
|
|
20147
20241
|
if (Z)
|
|
20148
|
-
ct.call(this, N,
|
|
20149
|
-
else if (
|
|
20242
|
+
ct.call(this, N, V);
|
|
20243
|
+
else if (ie && xe.call(this, V))
|
|
20150
20244
|
return;
|
|
20151
|
-
this.callback(_, N,
|
|
20245
|
+
this.callback(_, N, V);
|
|
20152
20246
|
}
|
|
20153
20247
|
},
|
|
20154
20248
|
/**
|
|
@@ -20159,29 +20253,29 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20159
20253
|
}
|
|
20160
20254
|
});
|
|
20161
20255
|
function ct(P, _) {
|
|
20162
|
-
P &
|
|
20256
|
+
P & X ? (this.primaryTouch = _.changedPointers[0].identifier, se.call(this, _)) : P & (W | $) && se.call(this, _);
|
|
20163
20257
|
}
|
|
20164
|
-
function
|
|
20258
|
+
function se(P) {
|
|
20165
20259
|
var _ = P.changedPointers[0];
|
|
20166
20260
|
if (_.identifier === this.primaryTouch) {
|
|
20167
20261
|
var N = { x: _.clientX, y: _.clientY };
|
|
20168
20262
|
this.lastTouches.push(N);
|
|
20169
|
-
var
|
|
20170
|
-
var
|
|
20171
|
-
|
|
20263
|
+
var V = this.lastTouches, Z = function() {
|
|
20264
|
+
var ie = V.indexOf(N);
|
|
20265
|
+
ie > -1 && V.splice(ie, 1);
|
|
20172
20266
|
};
|
|
20173
20267
|
setTimeout(Z, ht);
|
|
20174
20268
|
}
|
|
20175
20269
|
}
|
|
20176
|
-
function
|
|
20177
|
-
for (var _ = P.srcEvent.clientX, N = P.srcEvent.clientY,
|
|
20178
|
-
var Z = this.lastTouches[
|
|
20179
|
-
if (
|
|
20270
|
+
function xe(P) {
|
|
20271
|
+
for (var _ = P.srcEvent.clientX, N = P.srcEvent.clientY, V = 0; V < this.lastTouches.length; V++) {
|
|
20272
|
+
var Z = this.lastTouches[V], ie = Math.abs(_ - Z.x), ge = Math.abs(N - Z.y);
|
|
20273
|
+
if (ie <= Ge && ge <= Ge)
|
|
20180
20274
|
return !0;
|
|
20181
20275
|
}
|
|
20182
20276
|
return !1;
|
|
20183
20277
|
}
|
|
20184
|
-
var Ie = s ? F(s.style, "touchAction") : r, Se = Ie !== r,
|
|
20278
|
+
var Ie = s ? F(s.style, "touchAction") : r, Se = Ie !== r, ze = "compute", it = "auto", yt = "manipulation", pt = "none", Mt = "pan-x", It = "pan-y", Pt = Et();
|
|
20185
20279
|
function at(P, _) {
|
|
20186
20280
|
this.manager = P, this.set(_);
|
|
20187
20281
|
}
|
|
@@ -20191,7 +20285,7 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20191
20285
|
* @param {String} value
|
|
20192
20286
|
*/
|
|
20193
20287
|
set: function(P) {
|
|
20194
|
-
P ==
|
|
20288
|
+
P == ze && (P = this.compute()), Se && this.manager.element.style && Pt[P] && (this.manager.element.style[Ie] = P), this.actions = P.toLowerCase().trim();
|
|
20195
20289
|
},
|
|
20196
20290
|
/**
|
|
20197
20291
|
* just re-set the touchAction value
|
|
@@ -20219,13 +20313,13 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20219
20313
|
_.preventDefault();
|
|
20220
20314
|
return;
|
|
20221
20315
|
}
|
|
20222
|
-
var
|
|
20316
|
+
var V = this.actions, Z = C(V, pt) && !Pt[pt], ie = C(V, It) && !Pt[It], ge = C(V, Mt) && !Pt[Mt];
|
|
20223
20317
|
if (Z) {
|
|
20224
|
-
var
|
|
20225
|
-
if (
|
|
20318
|
+
var Ne = P.pointers.length === 1, ut = P.distance < 2, ke = P.deltaTime < 250;
|
|
20319
|
+
if (Ne && ut && ke)
|
|
20226
20320
|
return;
|
|
20227
20321
|
}
|
|
20228
|
-
if (!(ge &&
|
|
20322
|
+
if (!(ge && ie) && (Z || ie && N & oe || ge && N & he))
|
|
20229
20323
|
return this.preventSrc(_);
|
|
20230
20324
|
},
|
|
20231
20325
|
/**
|
|
@@ -20332,10 +20426,10 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20332
20426
|
*/
|
|
20333
20427
|
emit: function(P) {
|
|
20334
20428
|
var _ = this, N = this.state;
|
|
20335
|
-
function
|
|
20429
|
+
function V(Z) {
|
|
20336
20430
|
_.manager.emit(Z, P);
|
|
20337
20431
|
}
|
|
20338
|
-
N < bt &&
|
|
20432
|
+
N < bt && V(_.options.event + Ft(N)), V(_.options.event), P.additionalEvent && V(P.additionalEvent), N >= bt && V(_.options.event + Ft(N));
|
|
20339
20433
|
},
|
|
20340
20434
|
/**
|
|
20341
20435
|
* Check that all the require failure recognizers has failed,
|
|
@@ -20401,7 +20495,7 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20401
20495
|
return P & Rt ? "cancel" : P & bt ? "end" : P & Ct ? "move" : P & ot ? "start" : "";
|
|
20402
20496
|
}
|
|
20403
20497
|
function Bt(P) {
|
|
20404
|
-
return P ==
|
|
20498
|
+
return P == fe ? "down" : P == te ? "up" : P == ee ? "left" : P == ne ? "right" : "";
|
|
20405
20499
|
}
|
|
20406
20500
|
function lt(P, _) {
|
|
20407
20501
|
var N = _.manager;
|
|
@@ -20439,8 +20533,8 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20439
20533
|
* @returns {*} State
|
|
20440
20534
|
*/
|
|
20441
20535
|
process: function(P) {
|
|
20442
|
-
var _ = this.state, N = P.eventType,
|
|
20443
|
-
return
|
|
20536
|
+
var _ = this.state, N = P.eventType, V = _ & (ot | Ct), Z = this.attrTest(P);
|
|
20537
|
+
return V && (N & $ || !Z) ? _ | Rt : V || Z ? N & W ? _ | bt : _ & ot ? _ | Ct : ot : Ke;
|
|
20444
20538
|
}
|
|
20445
20539
|
});
|
|
20446
20540
|
function Tt() {
|
|
@@ -20459,11 +20553,11 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20459
20553
|
},
|
|
20460
20554
|
getTouchAction: function() {
|
|
20461
20555
|
var P = this.options.direction, _ = [];
|
|
20462
|
-
return P &
|
|
20556
|
+
return P & oe && _.push(It), P & he && _.push(Mt), _;
|
|
20463
20557
|
},
|
|
20464
20558
|
directionTest: function(P) {
|
|
20465
|
-
var _ = this.options, N = !0,
|
|
20466
|
-
return Z & _.direction || (_.direction &
|
|
20559
|
+
var _ = this.options, N = !0, V = P.distance, Z = P.direction, ie = P.deltaX, ge = P.deltaY;
|
|
20560
|
+
return Z & _.direction || (_.direction & oe ? (Z = ie === 0 ? ae : ie < 0 ? ee : ne, N = ie != this.pX, V = Math.abs(P.deltaX)) : (Z = ge === 0 ? ae : ge < 0 ? te : fe, N = ge != this.pY, V = Math.abs(P.deltaY))), P.direction = Z, N && V > _.threshold && Z & _.direction;
|
|
20467
20561
|
},
|
|
20468
20562
|
attrTest: function(P) {
|
|
20469
20563
|
return We.prototype.attrTest.call(this, P) && (this.state & ot || !(this.state & ot) && this.directionTest(P));
|
|
@@ -20474,10 +20568,10 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20474
20568
|
_ && (P.additionalEvent = this.options.event + _), this._super.emit.call(this, P);
|
|
20475
20569
|
}
|
|
20476
20570
|
});
|
|
20477
|
-
function
|
|
20571
|
+
function ce() {
|
|
20478
20572
|
We.apply(this, arguments);
|
|
20479
20573
|
}
|
|
20480
|
-
v(
|
|
20574
|
+
v(ce, We, {
|
|
20481
20575
|
/**
|
|
20482
20576
|
* @namespace
|
|
20483
20577
|
* @memberof PinchRecognizer
|
|
@@ -20521,10 +20615,10 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20521
20615
|
return [it];
|
|
20522
20616
|
},
|
|
20523
20617
|
process: function(P) {
|
|
20524
|
-
var _ = this.options, N = P.pointers.length === _.pointers,
|
|
20525
|
-
if (this._input = P, !
|
|
20618
|
+
var _ = this.options, N = P.pointers.length === _.pointers, V = P.distance < _.threshold, Z = P.deltaTime > _.time;
|
|
20619
|
+
if (this._input = P, !V || !N || P.eventType & (W | $) && !Z)
|
|
20526
20620
|
this.reset();
|
|
20527
|
-
else if (P.eventType &
|
|
20621
|
+
else if (P.eventType & X)
|
|
20528
20622
|
this.reset(), this._timer = f(function() {
|
|
20529
20623
|
this.state = vt, this.tryEmit();
|
|
20530
20624
|
}, _.time, this);
|
|
@@ -20571,7 +20665,7 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20571
20665
|
event: "swipe",
|
|
20572
20666
|
threshold: 10,
|
|
20573
20667
|
velocity: 0.3,
|
|
20574
|
-
direction:
|
|
20668
|
+
direction: oe | he,
|
|
20575
20669
|
pointers: 1
|
|
20576
20670
|
},
|
|
20577
20671
|
getTouchAction: function() {
|
|
@@ -20579,7 +20673,7 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20579
20673
|
},
|
|
20580
20674
|
attrTest: function(P) {
|
|
20581
20675
|
var _ = this.options.direction, N;
|
|
20582
|
-
return _ & (
|
|
20676
|
+
return _ & (oe | he) ? N = P.overallVelocity : _ & oe ? N = P.overallVelocityX : _ & he && (N = P.overallVelocityY), this._super.attrTest.call(this, P) && _ & P.offsetDirection && P.distance > this.options.threshold && P.maxPointers == this.options.pointers && c(N) > this.options.velocity && P.eventType & W;
|
|
20583
20677
|
},
|
|
20584
20678
|
emit: function(P) {
|
|
20585
20679
|
var _ = Bt(P.offsetDirection);
|
|
@@ -20611,16 +20705,16 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20611
20705
|
return [yt];
|
|
20612
20706
|
},
|
|
20613
20707
|
process: function(P) {
|
|
20614
|
-
var _ = this.options, N = P.pointers.length === _.pointers,
|
|
20615
|
-
if (this.reset(), P.eventType &
|
|
20708
|
+
var _ = this.options, N = P.pointers.length === _.pointers, V = P.distance < _.threshold, Z = P.deltaTime < _.time;
|
|
20709
|
+
if (this.reset(), P.eventType & X && this.count === 0)
|
|
20616
20710
|
return this.failTimeout();
|
|
20617
|
-
if (
|
|
20711
|
+
if (V && Z && N) {
|
|
20618
20712
|
if (P.eventType != W)
|
|
20619
20713
|
return this.failTimeout();
|
|
20620
|
-
var
|
|
20621
|
-
this.pTime = P.timeStamp, this.pCenter = P.center, !ge || !
|
|
20622
|
-
var
|
|
20623
|
-
if (
|
|
20714
|
+
var ie = this.pTime ? P.timeStamp - this.pTime < _.interval : !0, ge = !this.pCenter || pe(this.pCenter, P.center) < _.posThreshold;
|
|
20715
|
+
this.pTime = P.timeStamp, this.pCenter = P.center, !ge || !ie ? this.count = 1 : this.count += 1, this._input = P;
|
|
20716
|
+
var Ne = this.count % _.taps;
|
|
20717
|
+
if (Ne === 0)
|
|
20624
20718
|
return this.hasRequireFailures() ? (this._timer = f(function() {
|
|
20625
20719
|
this.state = vt, this.tryEmit();
|
|
20626
20720
|
}, _.interval, this), ot) : vt;
|
|
@@ -20656,7 +20750,7 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20656
20750
|
* @type {String}
|
|
20657
20751
|
* @default compute
|
|
20658
20752
|
*/
|
|
20659
|
-
touchAction:
|
|
20753
|
+
touchAction: ze,
|
|
20660
20754
|
/**
|
|
20661
20755
|
* @type {Boolean}
|
|
20662
20756
|
* @default true
|
|
@@ -20684,9 +20778,9 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20684
20778
|
preset: [
|
|
20685
20779
|
// RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
|
|
20686
20780
|
[Me, { enable: !1 }],
|
|
20687
|
-
[
|
|
20688
|
-
[He, { direction:
|
|
20689
|
-
[Tt, { direction:
|
|
20781
|
+
[ce, { enable: !1 }, ["rotate"]],
|
|
20782
|
+
[He, { direction: oe }],
|
|
20783
|
+
[Tt, { direction: oe }, ["swipe"]],
|
|
20690
20784
|
[xt],
|
|
20691
20785
|
[xt, { event: "doubletap", taps: 2 }, ["tap"]],
|
|
20692
20786
|
[Re]
|
|
@@ -20740,9 +20834,9 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20740
20834
|
};
|
|
20741
20835
|
var st = 1, Ht = 2;
|
|
20742
20836
|
function _t(P, _) {
|
|
20743
|
-
this.options = g({}, Xe.defaults, _ || {}), this.options.inputTarget = this.options.inputTarget || P, this.handlers = {}, this.session = {}, this.recognizers = [], this.oldCssProps = {}, this.element = P, this.input =
|
|
20744
|
-
var
|
|
20745
|
-
N[2] &&
|
|
20837
|
+
this.options = g({}, Xe.defaults, _ || {}), this.options.inputTarget = this.options.inputTarget || P, this.handlers = {}, this.session = {}, this.recognizers = [], this.oldCssProps = {}, this.element = P, this.input = de(this), this.touchAction = new at(this, this.options.touchAction), Ot(this, !0), p(this.options.recognizers, function(N) {
|
|
20838
|
+
var V = this.add(new N[0](N[1]));
|
|
20839
|
+
N[2] && V.recognizeWith(N[2]), N[3] && V.requireFailure(N[3]);
|
|
20746
20840
|
}, this);
|
|
20747
20841
|
}
|
|
20748
20842
|
_t.prototype = {
|
|
@@ -20773,12 +20867,12 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20773
20867
|
var _ = this.session;
|
|
20774
20868
|
if (!_.stopped) {
|
|
20775
20869
|
this.touchAction.preventDefaults(P);
|
|
20776
|
-
var N,
|
|
20870
|
+
var N, V = this.recognizers, Z = _.curRecognizer;
|
|
20777
20871
|
(!Z || Z && Z.state & vt) && (Z = _.curRecognizer = null);
|
|
20778
|
-
for (var
|
|
20779
|
-
N =
|
|
20872
|
+
for (var ie = 0; ie < V.length; )
|
|
20873
|
+
N = V[ie], _.stopped !== Ht && // 1
|
|
20780
20874
|
(!Z || N == Z || // 2
|
|
20781
|
-
N.canRecognizeWith(Z)) ? N.recognize(P) : N.reset(), !Z && N.state & (ot | Ct | bt) && (Z = _.curRecognizer = N),
|
|
20875
|
+
N.canRecognizeWith(Z)) ? N.recognize(P) : N.reset(), !Z && N.state & (ot | Ct | bt) && (Z = _.curRecognizer = N), ie++;
|
|
20782
20876
|
}
|
|
20783
20877
|
},
|
|
20784
20878
|
/**
|
|
@@ -20829,8 +20923,8 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20829
20923
|
on: function(P, _) {
|
|
20830
20924
|
if (P !== r && _ !== r) {
|
|
20831
20925
|
var N = this.handlers;
|
|
20832
|
-
return p(I(P), function(
|
|
20833
|
-
N[
|
|
20926
|
+
return p(I(P), function(V) {
|
|
20927
|
+
N[V] = N[V] || [], N[V].push(_);
|
|
20834
20928
|
}), this;
|
|
20835
20929
|
}
|
|
20836
20930
|
},
|
|
@@ -20843,8 +20937,8 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20843
20937
|
off: function(P, _) {
|
|
20844
20938
|
if (P !== r) {
|
|
20845
20939
|
var N = this.handlers;
|
|
20846
|
-
return p(I(P), function(
|
|
20847
|
-
_ ? N[
|
|
20940
|
+
return p(I(P), function(V) {
|
|
20941
|
+
_ ? N[V] && N[V].splice(H(N[V], _), 1) : delete N[V];
|
|
20848
20942
|
}), this;
|
|
20849
20943
|
}
|
|
20850
20944
|
},
|
|
@@ -20860,8 +20954,8 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20860
20954
|
_.type = P, _.preventDefault = function() {
|
|
20861
20955
|
_.srcEvent.preventDefault();
|
|
20862
20956
|
};
|
|
20863
|
-
for (var
|
|
20864
|
-
N[
|
|
20957
|
+
for (var V = 0; V < N.length; )
|
|
20958
|
+
N[V](_), V++;
|
|
20865
20959
|
}
|
|
20866
20960
|
},
|
|
20867
20961
|
/**
|
|
@@ -20875,9 +20969,9 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20875
20969
|
function Ot(P, _) {
|
|
20876
20970
|
var N = P.element;
|
|
20877
20971
|
if (N.style) {
|
|
20878
|
-
var
|
|
20879
|
-
p(P.options.cssProps, function(Z,
|
|
20880
|
-
|
|
20972
|
+
var V;
|
|
20973
|
+
p(P.options.cssProps, function(Z, ie) {
|
|
20974
|
+
V = F(N.style, ie), _ ? (P.oldCssProps[V] = N.style[V], N.style[V] = Z) : N.style[V] = P.oldCssProps[V] || "";
|
|
20881
20975
|
}), _ || (P.oldCssProps = {});
|
|
20882
20976
|
}
|
|
20883
20977
|
}
|
|
@@ -20886,8 +20980,8 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20886
20980
|
N.initEvent(P, !0, !0), N.gesture = _, _.target.dispatchEvent(N);
|
|
20887
20981
|
}
|
|
20888
20982
|
return g(Xe, {
|
|
20889
|
-
INPUT_START:
|
|
20890
|
-
INPUT_MOVE:
|
|
20983
|
+
INPUT_START: X,
|
|
20984
|
+
INPUT_MOVE: Q,
|
|
20891
20985
|
INPUT_END: W,
|
|
20892
20986
|
INPUT_CANCEL: $,
|
|
20893
20987
|
STATE_POSSIBLE: wt,
|
|
@@ -20897,19 +20991,19 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20897
20991
|
STATE_RECOGNIZED: vt,
|
|
20898
20992
|
STATE_CANCELLED: Rt,
|
|
20899
20993
|
STATE_FAILED: Ke,
|
|
20900
|
-
DIRECTION_NONE:
|
|
20994
|
+
DIRECTION_NONE: ae,
|
|
20901
20995
|
DIRECTION_LEFT: ee,
|
|
20902
20996
|
DIRECTION_RIGHT: ne,
|
|
20903
20997
|
DIRECTION_UP: te,
|
|
20904
|
-
DIRECTION_DOWN:
|
|
20905
|
-
DIRECTION_HORIZONTAL:
|
|
20906
|
-
DIRECTION_VERTICAL:
|
|
20998
|
+
DIRECTION_DOWN: fe,
|
|
20999
|
+
DIRECTION_HORIZONTAL: oe,
|
|
21000
|
+
DIRECTION_VERTICAL: he,
|
|
20907
21001
|
DIRECTION_ALL: me,
|
|
20908
21002
|
Manager: _t,
|
|
20909
|
-
Input:
|
|
21003
|
+
Input: le,
|
|
20910
21004
|
TouchAction: at,
|
|
20911
|
-
TouchInput:
|
|
20912
|
-
MouseInput:
|
|
21005
|
+
TouchInput: qe,
|
|
21006
|
+
MouseInput: Le,
|
|
20913
21007
|
PointerEventInput: Be,
|
|
20914
21008
|
TouchMouseInput: nt,
|
|
20915
21009
|
SingleTouchInput: At,
|
|
@@ -20918,7 +21012,7 @@ var Hammer = (function(n, t, e, r) {
|
|
|
20918
21012
|
Tap: xt,
|
|
20919
21013
|
Pan: Tt,
|
|
20920
21014
|
Swipe: He,
|
|
20921
|
-
Pinch:
|
|
21015
|
+
Pinch: ce,
|
|
20922
21016
|
Rotate: Me,
|
|
20923
21017
|
Press: Re,
|
|
20924
21018
|
on: S,
|
|
@@ -21272,14 +21366,14 @@ var BaseController = (
|
|
|
21272
21366
|
var L = {
|
|
21273
21367
|
x: F.clientX,
|
|
21274
21368
|
y: F.clientY
|
|
21275
|
-
}, O = r.relativeClientPosition(L), k = r.createRaycasterFromCamera(O, r.camera), D = __assign(__assign({}, L), { coords: O, raycaster: k, buttons: F.buttons, delta: 0 }),
|
|
21369
|
+
}, O = r.relativeClientPosition(L), k = r.createRaycasterFromCamera(O, r.camera), D = __assign(__assign({}, L), { coords: O, raycaster: k, buttons: F.buttons, delta: 0 }), J = M === "pinchend" ? B : B - F.deltaY / 280, G = createEvent("gesture.pinch", {
|
|
21276
21370
|
target: F.target,
|
|
21277
21371
|
pointerType: "mouse",
|
|
21278
21372
|
srcEvent: F,
|
|
21279
21373
|
pointers: [__assign({}, D)],
|
|
21280
21374
|
isFirst: M === "pinchstart",
|
|
21281
21375
|
isFinal: M === "pinchend",
|
|
21282
|
-
scale: clamp$1(
|
|
21376
|
+
scale: clamp$1(J, 0.1, 10),
|
|
21283
21377
|
center: __assign({}, D),
|
|
21284
21378
|
velocityX: 0,
|
|
21285
21379
|
velocityY: 0,
|
|
@@ -21288,7 +21382,7 @@ var BaseController = (
|
|
|
21288
21382
|
userAction: !0,
|
|
21289
21383
|
state: __assign(__assign({ mode: r.mode }, r.currentPano), clonePose(r.camera.pose))
|
|
21290
21384
|
});
|
|
21291
|
-
return
|
|
21385
|
+
return G;
|
|
21292
21386
|
}, A = function(M) {
|
|
21293
21387
|
var B, F = { x: M.clientX, y: M.clientY };
|
|
21294
21388
|
if (o(F)) {
|
|
@@ -21300,14 +21394,14 @@ var BaseController = (
|
|
|
21300
21394
|
} : f.prevEvent = O, r.onPinchGesture(O), h !== null && window.clearTimeout(h), h = window.setTimeout(function() {
|
|
21301
21395
|
var q;
|
|
21302
21396
|
h = null;
|
|
21303
|
-
var
|
|
21304
|
-
f = null, r.onPinchGesture(
|
|
21397
|
+
var j = (q = f == null ? void 0 : f.prevEvent.scale) !== null && q !== void 0 ? q : 1, K = p("pinchend", j, M);
|
|
21398
|
+
f = null, r.onPinchGesture(K);
|
|
21305
21399
|
}, 200);
|
|
21306
21400
|
} else {
|
|
21307
|
-
var k = (Math.abs(M.deltaY) > Math.abs(M.deltaX) ? M.deltaY : M.deltaX) / -60, D = r.mouseWheelState !== void 0,
|
|
21401
|
+
var k = (Math.abs(M.deltaY) > Math.abs(M.deltaX) ? M.deltaY : M.deltaX) / -60, D = r.mouseWheelState !== void 0, J = {
|
|
21308
21402
|
x: M.clientX,
|
|
21309
21403
|
y: M.clientY
|
|
21310
|
-
},
|
|
21404
|
+
}, G = r.relativeClientPosition(J), U = r.createRaycasterFromCamera(G, r.camera), z = __assign(__assign({}, J), { coords: G, raycaster: U, buttons: M.buttons, delta: k }), O = createEvent("gesture.mousewheel", {
|
|
21311
21405
|
target: M.target,
|
|
21312
21406
|
pointerType: "mouse",
|
|
21313
21407
|
srcEvent: M,
|
|
@@ -21326,7 +21420,7 @@ var BaseController = (
|
|
|
21326
21420
|
r.onMouseWheel(O), r.mouseWheelState && clearTimeout(r.mouseWheelState.timer), r.mouseWheelState = {
|
|
21327
21421
|
timer: setTimeout(function() {
|
|
21328
21422
|
delete r.mouseWheelState;
|
|
21329
|
-
var
|
|
21423
|
+
var j = createEvent("gesture.mousewheel", {
|
|
21330
21424
|
target: M.target,
|
|
21331
21425
|
pointerType: "mouse",
|
|
21332
21426
|
srcEvent: M,
|
|
@@ -21342,7 +21436,7 @@ var BaseController = (
|
|
|
21342
21436
|
userAction: !0,
|
|
21343
21437
|
state: __assign(__assign({ mode: r.mode }, r.currentPano), clonePose(r.camera.pose))
|
|
21344
21438
|
});
|
|
21345
|
-
r.onMouseWheel(
|
|
21439
|
+
r.onMouseWheel(j);
|
|
21346
21440
|
}, 100)
|
|
21347
21441
|
};
|
|
21348
21442
|
}
|
|
@@ -21469,15 +21563,15 @@ var BaseController = (
|
|
|
21469
21563
|
var O = {
|
|
21470
21564
|
x: M.clientX,
|
|
21471
21565
|
y: M.clientY
|
|
21472
|
-
}, k = r.relativeClientPosition(O), D = r.createRaycasterFromCamera(k, r.camera),
|
|
21566
|
+
}, k = r.relativeClientPosition(O), D = r.createRaycasterFromCamera(k, r.camera), J = __assign(__assign({}, O), { coords: k, raycaster: D, buttons: 0, delta: 0 }), G = createEvent("gesture.pinch", {
|
|
21473
21567
|
target: M.target,
|
|
21474
21568
|
pointerType: "mouse",
|
|
21475
21569
|
srcEvent: M,
|
|
21476
|
-
pointers: [__assign({},
|
|
21570
|
+
pointers: [__assign({}, J)],
|
|
21477
21571
|
isFirst: F,
|
|
21478
21572
|
isFinal: L,
|
|
21479
21573
|
scale: (B = M.scale) !== null && B !== void 0 ? B : 1,
|
|
21480
|
-
center: __assign({},
|
|
21574
|
+
center: __assign({}, J),
|
|
21481
21575
|
velocityX: 0,
|
|
21482
21576
|
velocityY: 0,
|
|
21483
21577
|
overallVelocityX: 0,
|
|
@@ -21485,7 +21579,7 @@ var BaseController = (
|
|
|
21485
21579
|
userAction: !0,
|
|
21486
21580
|
state: __assign(__assign({ mode: r.mode }, r.currentPano), clonePose(r.camera.pose))
|
|
21487
21581
|
});
|
|
21488
|
-
return
|
|
21582
|
+
return G;
|
|
21489
21583
|
}, R = function(M) {
|
|
21490
21584
|
if (M.preventDefault(), !isMobile) {
|
|
21491
21585
|
var B = S(M);
|
|
@@ -22075,7 +22169,7 @@ void main() {
|
|
|
22075
22169
|
minLatitude: function(n) {
|
|
22076
22170
|
return -Math.PI / 2 + n / 2 / 180 * Math.PI;
|
|
22077
22171
|
},
|
|
22078
|
-
moveSpeed: 3.
|
|
22172
|
+
moveSpeed: 3.6,
|
|
22079
22173
|
intersectMeshCreator: function() {
|
|
22080
22174
|
return new IntersectMesh();
|
|
22081
22175
|
}
|
|
@@ -22222,6 +22316,7 @@ void main() {
|
|
|
22222
22316
|
this.hideIntersectMesh();
|
|
22223
22317
|
return;
|
|
22224
22318
|
}
|
|
22319
|
+
s.floorIndex = -1;
|
|
22225
22320
|
var u = this.modelScene.intersectRaycaster(s)[0], l = createEvent("intersect.update", {
|
|
22226
22321
|
raycaster: s,
|
|
22227
22322
|
intersection: u != null ? u : null,
|
|
@@ -22649,50 +22744,50 @@ void main() {
|
|
|
22649
22744
|
var b = scratchCameraProjectMatrix.copy(d);
|
|
22650
22745
|
b.elements[0] *= p, b.elements[5] *= p, this.camera.projectionMatrix.equals(b) || (this.camera.projectionMatrix.copy(b), this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix), r = !0), scratchSceneQuaternionInverse.copy(this.scene.quaternion).inverse(), scratchSceneMatrixInverse.makeRotationFromQuaternion(scratchSceneQuaternionInverse), scratchFrustumMatrix.copy(this.camera.matrix), scratchFrustumMatrix.setPosition(0, 0, 0), scratchFrustumMatrix.premultiply(scratchSceneMatrixInverse), scratchFrustumMatrixInverse.getInverse(scratchFrustumMatrix), scratchFrustumProjectMatrix.multiplyMatrices(this.camera.projectionMatrix, scratchFrustumMatrixInverse), this.frustum.setFromProjectionMatrix(scratchFrustumProjectMatrix);
|
|
22651
22746
|
var T = this.frustum.planes[5].normal, S = [];
|
|
22652
|
-
g >= A && traverseTileCubeNode(this.tileTree, function(
|
|
22653
|
-
if (!(
|
|
22654
|
-
if (
|
|
22747
|
+
g >= A && traverseTileCubeNode(this.tileTree, function(Q) {
|
|
22748
|
+
if (!(Q.level < A)) {
|
|
22749
|
+
if (Q.level > g || !e.frustum.intersectsBox(Q.box))
|
|
22655
22750
|
return !1;
|
|
22656
|
-
S.push(
|
|
22751
|
+
S.push(Q);
|
|
22657
22752
|
}
|
|
22658
22753
|
});
|
|
22659
22754
|
var R = /* @__PURE__ */ new WeakMap();
|
|
22660
|
-
S.sort(function(
|
|
22661
|
-
if (
|
|
22662
|
-
return
|
|
22663
|
-
var $ = R.get(
|
|
22664
|
-
$ === void 0 && ($ =
|
|
22665
|
-
var
|
|
22666
|
-
return
|
|
22755
|
+
S.sort(function(Q, W) {
|
|
22756
|
+
if (Q.level !== W.level)
|
|
22757
|
+
return Q.level - W.level;
|
|
22758
|
+
var $ = R.get(Q);
|
|
22759
|
+
$ === void 0 && ($ = Q.box.getCenter(scratchSortVector3).angleTo(T), R.set(Q, $));
|
|
22760
|
+
var ae = R.get(W);
|
|
22761
|
+
return ae === void 0 && (ae = W.box.getCenter(scratchSortVector3).angleTo(T), R.set(W, ae)), $ - ae;
|
|
22667
22762
|
});
|
|
22668
22763
|
var w = /* @__PURE__ */ new WeakSet(), C = this.observer.images.tiles;
|
|
22669
22764
|
if (C)
|
|
22670
|
-
for (var I = function(
|
|
22671
|
-
var W = C.find(function(
|
|
22672
|
-
return
|
|
22765
|
+
for (var I = function(Q) {
|
|
22766
|
+
var W = C.find(function(le) {
|
|
22767
|
+
return le.level === Q.level;
|
|
22673
22768
|
});
|
|
22674
22769
|
if (!W)
|
|
22675
22770
|
return "continue";
|
|
22676
|
-
w.add(
|
|
22677
|
-
var $ = H.tileMeshes.get(
|
|
22771
|
+
w.add(Q);
|
|
22772
|
+
var $ = H.tileMeshes.get(Q);
|
|
22678
22773
|
if ($) {
|
|
22679
22774
|
$.appearDuration = H.appearDuration;
|
|
22680
|
-
var
|
|
22681
|
-
return
|
|
22775
|
+
var ae = $.updateTime(o);
|
|
22776
|
+
return ae && (r = !0), "continue";
|
|
22682
22777
|
}
|
|
22683
22778
|
if (H.pedding >= H.maxRequest)
|
|
22684
22779
|
return "continue";
|
|
22685
|
-
var ee = Math.pow(2,
|
|
22780
|
+
var ee = Math.pow(2, Q.level) * Q.position.y, ne = Math.pow(2, Q.level) * Q.position.x, te = panoStringify({
|
|
22686
22781
|
panoIndex: H.observer.panoIndex,
|
|
22687
22782
|
workCode: H.observer.work.workCode
|
|
22688
|
-
}),
|
|
22689
|
-
|
|
22690
|
-
|
|
22691
|
-
|
|
22692
|
-
|
|
22783
|
+
}), fe = "".concat(te, ".").concat(Q.face, ".").concat(Q.level, ".").concat(ee, ".").concat(ne), oe = W.work.getURL(W[Q.face]), he = W.size, me = H.imageOptions.transform, be = __assign(__assign({}, pick(H.imageOptions, ["format", "sharpen", "mappings"])), { key: "pano_tile.".concat(fe), size: W.scale >= 1 ? void 0 : he * Q.size * W.scale, cut: Q.size === 1 ? void 0 : [
|
|
22784
|
+
he * Q.position.x,
|
|
22785
|
+
he * Q.position.y,
|
|
22786
|
+
he * Q.size,
|
|
22787
|
+
he * Q.size
|
|
22693
22788
|
] });
|
|
22694
|
-
|
|
22695
|
-
var
|
|
22789
|
+
Q.level === 1 && W.scale >= 0.5 && (be.format === "jpg" || /\.jpg$/.test(oe)) && (be.size = void 0, be.quality || (be.quality = 70)), Q.size === 1 && console.warn("tile: ".concat(be.key, " should not appear.")), H.pedding++;
|
|
22790
|
+
var Te = H.textureLoader.loadTexture(oe, {
|
|
22696
22791
|
imageURL: {
|
|
22697
22792
|
transform: me,
|
|
22698
22793
|
options: be
|
|
@@ -22701,35 +22796,37 @@ void main() {
|
|
|
22701
22796
|
magFilter: THREE.LinearFilter,
|
|
22702
22797
|
generateMipmaps: !1,
|
|
22703
22798
|
fetcher: getFetcher(H.observer.work)
|
|
22704
|
-
}).then(function(
|
|
22705
|
-
return
|
|
22799
|
+
}).then(function(le) {
|
|
22800
|
+
return le.body;
|
|
22706
22801
|
});
|
|
22707
|
-
|
|
22708
|
-
return
|
|
22709
|
-
}
|
|
22710
|
-
return e.pedding--,
|
|
22711
|
-
}
|
|
22802
|
+
Te.then(function(le) {
|
|
22803
|
+
return initTexture(le, l);
|
|
22804
|
+
}).then(function(le) {
|
|
22805
|
+
return e.pedding--, le;
|
|
22806
|
+
}, function(le) {
|
|
22807
|
+
return e.pedding--, Promise.reject(le);
|
|
22808
|
+
}), $ = new TileMesh(Q, Te), $.name = "tiling:tile-".concat(fe), $.visible = !1, $.appearDuration = H.appearDuration, H.tileMeshes.set(Q, $), H.scene.add($), $.updateTime(o), r = !0;
|
|
22712
22809
|
}, H = this, M = 0, B = S; M < B.length; M++) {
|
|
22713
22810
|
var F = B[M];
|
|
22714
22811
|
I(F);
|
|
22715
22812
|
}
|
|
22716
22813
|
var L = [], O = [];
|
|
22717
|
-
this.tileMeshes.forEach(function(
|
|
22718
|
-
w.has(W) ? L.push(
|
|
22814
|
+
this.tileMeshes.forEach(function(Q, W) {
|
|
22815
|
+
w.has(W) ? L.push(Q) : O.push(Q);
|
|
22719
22816
|
var $ = W.level >= A && W.level <= g;
|
|
22720
|
-
|
|
22817
|
+
Q.visible !== $ && (Q.visible = $, r = !0);
|
|
22721
22818
|
});
|
|
22722
|
-
for (var k = O.sort(function(
|
|
22723
|
-
return W.activeTime -
|
|
22724
|
-
}).slice(Math.max(0, this.maxCacheTile - L.length)), D = 0,
|
|
22725
|
-
var
|
|
22726
|
-
this.tileMeshes.delete(
|
|
22819
|
+
for (var k = O.sort(function(Q, W) {
|
|
22820
|
+
return W.activeTime - Q.activeTime;
|
|
22821
|
+
}).slice(Math.max(0, this.maxCacheTile - L.length)), D = 0, J = k; D < J.length; D++) {
|
|
22822
|
+
var G = J[D];
|
|
22823
|
+
this.tileMeshes.delete(G.node), this.scene.remove(G), G.dispose(), r = !0;
|
|
22727
22824
|
}
|
|
22728
22825
|
if (r) {
|
|
22729
22826
|
var U = l.getRenderTarget();
|
|
22730
22827
|
scratchPrevClearColor$1.copy(l.getClearColor());
|
|
22731
|
-
var z = l.getClearAlpha(), q = l.autoClear,
|
|
22732
|
-
l.autoClear = !0, l.autoClearColor = !0, l.autoClearDepth = !0, l.autoClearStencil = !0, l.clippingPlanes = clippingPlanes, l.setRenderTarget(this.renderTarget), l.setClearColor(clearColor$1, clearAlpha), l.render(this.scene, this.camera), l.setRenderTarget(U), l.setClearColor(scratchPrevClearColor$1, z), l.autoClear = q, l.autoClearColor =
|
|
22828
|
+
var z = l.getClearAlpha(), q = l.autoClear, j = l.autoClearColor, K = l.autoClearDepth, Y = l.autoClearStencil, X = l.clippingPlanes;
|
|
22829
|
+
l.autoClear = !0, l.autoClearColor = !0, l.autoClearDepth = !0, l.autoClearStencil = !0, l.clippingPlanes = clippingPlanes, l.setRenderTarget(this.renderTarget), l.setClearColor(clearColor$1, clearAlpha), l.render(this.scene, this.camera), l.setRenderTarget(U), l.setClearColor(scratchPrevClearColor$1, z), l.autoClear = q, l.autoClearColor = j, l.autoClearDepth = K, l.autoClearStencil = Y, l.clippingPlanes = X;
|
|
22733
22830
|
}
|
|
22734
22831
|
return this.forceRenderWhenNextUpdate = !1, r;
|
|
22735
22832
|
}, n;
|
|
@@ -23099,26 +23196,26 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
|
|
|
23099
23196
|
}
|
|
23100
23197
|
p.distance = this.locationMotion.value.distance, p.offset = new THREE.Vector3(w.x + (C.x - w.x) * I, w.y + (C.y - w.y) * I, w.z + (C.z - w.z) * I);
|
|
23101
23198
|
for (var B = [], F = [], L = 0, O = this.locationMotion.keyframes; L < O.length; L++) {
|
|
23102
|
-
var k = O[L], D = k.key,
|
|
23103
|
-
D !== void 0 && (B.push(D),
|
|
23199
|
+
var k = O[L], D = k.key, J = k.progress;
|
|
23200
|
+
D !== void 0 && (B.push(D), J > this.locationMotion.progress && F.push(D));
|
|
23104
23201
|
}
|
|
23105
|
-
for (var
|
|
23106
|
-
var z = U[
|
|
23202
|
+
for (var G = 0, U = Object.keys(this.panoResources); G < U.length; G++) {
|
|
23203
|
+
var z = U[G];
|
|
23107
23204
|
if (!(F.indexOf(z) >= 0)) {
|
|
23108
23205
|
var q = this.panoResources[z];
|
|
23109
23206
|
if (q.panoPicture) {
|
|
23110
|
-
var
|
|
23111
|
-
if (
|
|
23112
|
-
if (
|
|
23207
|
+
var j = q.panoPicture.map;
|
|
23208
|
+
if (j) {
|
|
23209
|
+
if (j === ((s = h.pano0) === null || s === void 0 ? void 0 : s.map) || j === ((u = h.pano1) === null || u === void 0 ? void 0 : u.map))
|
|
23113
23210
|
continue;
|
|
23114
|
-
|
|
23211
|
+
j.dispose(), q.panoPicture = null;
|
|
23115
23212
|
}
|
|
23116
23213
|
}
|
|
23117
23214
|
B.indexOf(z) >= 0 || delete this.panoResources[z];
|
|
23118
23215
|
}
|
|
23119
23216
|
}
|
|
23120
|
-
var
|
|
23121
|
-
|
|
23217
|
+
var K = panoParse(b.panoId);
|
|
23218
|
+
K !== this.currentPano && (this.currentPano = K, this.accessibleObserverFloorCheckCount = 0), this.emit("pano.moving", createEvent("pano.moving", {
|
|
23122
23219
|
userAction: this.userAction,
|
|
23123
23220
|
prevPano: panoParse(T.panoId),
|
|
23124
23221
|
state: __assign(__assign(__assign(__assign({}, panoParse(S.panoId)), { mode: this.mode }), clonePose(this.camera.pose)), p),
|
|
@@ -23128,119 +23225,119 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
|
|
|
23128
23225
|
}));
|
|
23129
23226
|
}
|
|
23130
23227
|
isEmptyObject(h) === !1 && this.modelScene.parameter.set(h), isEmptyObject(p) === !1 && this.setCamera(p);
|
|
23131
|
-
var
|
|
23132
|
-
if (this.adjustPanoCircleMeshPositionBasedOnModel && this.helper.visible &&
|
|
23133
|
-
for (var $ = [],
|
|
23134
|
-
var te = ne[ee], M =
|
|
23228
|
+
var Y = this.works.getObserver(this.currentPano), X = this.locationMotion.ended ? this.getForwardObserverOrNot(this.camera) : null, Q = this.works.getObserver(y.panoId), W = this.works.getObserver(b.panoId);
|
|
23229
|
+
if (this.adjustPanoCircleMeshPositionBasedOnModel && this.helper.visible && Y) {
|
|
23230
|
+
for (var $ = [], ae = Y.work.observers, ee = 0, ne = Y.accessibleNodes; ee < ne.length; ee++) {
|
|
23231
|
+
var te = ne[ee], M = ae[te];
|
|
23135
23232
|
M && $.push(M);
|
|
23136
23233
|
}
|
|
23137
|
-
var
|
|
23138
|
-
if ($.sort(function(
|
|
23139
|
-
var Ie =
|
|
23140
|
-
typeof Ie == "undefined" && (Ie =
|
|
23141
|
-
var Se =
|
|
23142
|
-
return typeof Se == "undefined" && (Se =
|
|
23234
|
+
var fe = /* @__PURE__ */ new Map();
|
|
23235
|
+
if ($.sort(function(se, xe) {
|
|
23236
|
+
var Ie = fe.get(se);
|
|
23237
|
+
typeof Ie == "undefined" && (Ie = se.standingPosition.distanceTo(Y.standingPosition), fe.set(se, Ie));
|
|
23238
|
+
var Se = fe.get(se);
|
|
23239
|
+
return typeof Se == "undefined" && (Se = xe.standingPosition.distanceTo(Y.standingPosition), fe.set(xe, Se)), Ie - Se;
|
|
23143
23240
|
}), $.length) {
|
|
23144
23241
|
this.accessibleObserverFloorCheckCount = this.accessibleObserverFloorCheckCount % $.length;
|
|
23145
|
-
var
|
|
23146
|
-
return
|
|
23242
|
+
var oe = $[this.accessibleObserverFloorCheckCount], he = this.modelScene.models.find(function(se) {
|
|
23243
|
+
return se.work === (oe == null ? void 0 : oe.work);
|
|
23147
23244
|
});
|
|
23148
|
-
if (
|
|
23149
|
-
var me = 0.3, be = 0.05,
|
|
23150
|
-
panoIndex:
|
|
23151
|
-
workCode:
|
|
23152
|
-
}),
|
|
23153
|
-
scratchRaycaster$1.ray.origin.copy(
|
|
23154
|
-
var
|
|
23155
|
-
return
|
|
23245
|
+
if (oe && he && he.visible) {
|
|
23246
|
+
var me = 0.3, be = 0.05, Te = 5e-3, le = oe.standingPosition.clone().applyMatrix4(oe.work.transform), de = panoStringify({
|
|
23247
|
+
panoIndex: oe.panoIndex,
|
|
23248
|
+
workCode: oe.work.workCode
|
|
23249
|
+
}), re = adjustPanoCircleMeshVectors.map(function(se) {
|
|
23250
|
+
scratchRaycaster$1.ray.origin.copy(le), scratchRaycaster$1.ray.origin.add(scratchVector3$3.copy(se).setY(me)), scratchRaycaster$1.ray.direction.set(0, -1, 0), scratchRaycaster$1.firstHitOnly = !0, scratchRaycaster$1.floorIndex = -1;
|
|
23251
|
+
var xe = he.intersectRaycaster(scratchRaycaster$1)[0];
|
|
23252
|
+
return xe && xe.distance - Te <= me ? new THREE.Vector3().copy(le).setY(xe.point.y + Te) : le;
|
|
23156
23253
|
});
|
|
23157
|
-
|
|
23158
|
-
return
|
|
23254
|
+
re.sort(function(se, xe) {
|
|
23255
|
+
return xe.y - se.y;
|
|
23159
23256
|
});
|
|
23160
|
-
var
|
|
23161
|
-
return
|
|
23257
|
+
var ue = re[Math.floor(re.length / 2)], ve = re.filter(function(se) {
|
|
23258
|
+
return se.distanceTo(ue) <= be;
|
|
23162
23259
|
})[0];
|
|
23163
|
-
if (
|
|
23164
|
-
var
|
|
23165
|
-
|
|
23260
|
+
if (ve) {
|
|
23261
|
+
var ye = new THREE.Vector4(le.x, le.y, le.z, ve.y - le.y), De = this.adjustPanoCircleMeshPositionFix.get(de);
|
|
23262
|
+
De && !ye.equals(De) && (this.needsRender = !0), this.adjustPanoCircleMeshPositionFix.set(de, ye);
|
|
23166
23263
|
}
|
|
23167
23264
|
}
|
|
23168
23265
|
this.accessibleObserverFloorCheckCount++;
|
|
23169
23266
|
}
|
|
23170
23267
|
}
|
|
23171
|
-
var
|
|
23172
|
-
if (
|
|
23173
|
-
for (var
|
|
23174
|
-
var te =
|
|
23268
|
+
var Je = /* @__PURE__ */ new Map();
|
|
23269
|
+
if (Q)
|
|
23270
|
+
for (var $e = 0, Ue = Q.accessibleNodes; $e < Ue.length; $e++) {
|
|
23271
|
+
var te = Ue[$e], M = Q.work.observers[te];
|
|
23175
23272
|
if (M) {
|
|
23176
|
-
var
|
|
23273
|
+
var de = panoStringify({
|
|
23177
23274
|
panoIndex: M.panoIndex,
|
|
23178
23275
|
workCode: M.work.workCode
|
|
23179
23276
|
});
|
|
23180
|
-
|
|
23277
|
+
Je.set(de, M);
|
|
23181
23278
|
}
|
|
23182
23279
|
}
|
|
23183
23280
|
if (W)
|
|
23184
|
-
for (var
|
|
23185
|
-
var te =
|
|
23281
|
+
for (var pe = 0, Ye = W.accessibleNodes; pe < Ye.length; pe++) {
|
|
23282
|
+
var te = Ye[pe], M = W.work.observers[te];
|
|
23186
23283
|
if (M) {
|
|
23187
|
-
var
|
|
23284
|
+
var de = panoStringify({
|
|
23188
23285
|
panoIndex: M.panoIndex,
|
|
23189
23286
|
workCode: M.work.workCode
|
|
23190
23287
|
});
|
|
23191
|
-
|
|
23288
|
+
Je.set(de, M);
|
|
23192
23289
|
}
|
|
23193
23290
|
}
|
|
23194
|
-
if (this.panoMeshes.forEach(function(
|
|
23195
|
-
var Ie =
|
|
23291
|
+
if (this.panoMeshes.forEach(function(se, xe) {
|
|
23292
|
+
var Ie = Je.get(xe);
|
|
23196
23293
|
if (Ie) {
|
|
23197
|
-
|
|
23198
|
-
var Se = o.adjustPanoCircleMeshPositionFix.get(
|
|
23199
|
-
Se && (scratchVector3$3.set(Se.x, Se.y, Se.z), scratchVector3$3.equals(
|
|
23294
|
+
se.position.copy(Ie.standingPosition).applyMatrix4(Ie.work.transform);
|
|
23295
|
+
var Se = o.adjustPanoCircleMeshPositionFix.get(xe);
|
|
23296
|
+
Se && (scratchVector3$3.set(Se.x, Se.y, Se.z), scratchVector3$3.equals(se.position) && (se.position.y += Se.w)), se.scale.setScalar(1.2), Je.delete(xe);
|
|
23200
23297
|
} else
|
|
23201
|
-
o.helper.remove(
|
|
23202
|
-
}),
|
|
23203
|
-
var Ie = o.panoCircleMeshCreator(panoParse(
|
|
23204
|
-
Ie.position.copy(
|
|
23205
|
-
var Se = o.adjustPanoCircleMeshPositionFix.get(
|
|
23206
|
-
Se && (scratchVector3$3.set(Se.x, Se.y, Se.z), scratchVector3$3.equals(Ie.position) && (Ie.position.y += Se.w)), Ie.scale.setScalar(1.2), o.panoMeshes.set(
|
|
23298
|
+
o.helper.remove(se), se.dispose(), o.panoMeshes.delete(xe);
|
|
23299
|
+
}), Je.forEach(function(se, xe) {
|
|
23300
|
+
var Ie = o.panoCircleMeshCreator(panoParse(xe));
|
|
23301
|
+
Ie.position.copy(se.standingPosition).applyMatrix4(se.work.transform);
|
|
23302
|
+
var Se = o.adjustPanoCircleMeshPositionFix.get(xe);
|
|
23303
|
+
Se && (scratchVector3$3.set(Se.x, Se.y, Se.z), scratchVector3$3.equals(Ie.position) && (Ie.position.y += Se.w)), Ie.scale.setScalar(1.2), o.panoMeshes.set(xe, Ie), o.helper.add(Ie), Je.delete(xe);
|
|
23207
23304
|
}), this.camera.pose.distance > 0.1 || R)
|
|
23208
|
-
this.panoMeshes.forEach(function(
|
|
23209
|
-
|
|
23305
|
+
this.panoMeshes.forEach(function(se) {
|
|
23306
|
+
se.setOpacity(0), se.setCurrent(!1), se.updateTime && se.updateTime(e, r), se.visible = !1;
|
|
23210
23307
|
});
|
|
23211
|
-
else if (
|
|
23212
|
-
var Ee =
|
|
23213
|
-
var
|
|
23214
|
-
return
|
|
23308
|
+
else if (Y) {
|
|
23309
|
+
var Ee = Y.work.observers, Oe = arrayMin(Y.accessibleNodes, function(se) {
|
|
23310
|
+
var xe = Ee[se];
|
|
23311
|
+
return xe ? Y.standingPosition.distanceTo(xe.standingPosition) : 1 / 0;
|
|
23215
23312
|
}, !0), Fe = Oe[1];
|
|
23216
23313
|
Fe = clamp$1(Fe, 2.5, 1 / 0);
|
|
23217
|
-
var tt =
|
|
23218
|
-
return panoStringify({ panoIndex:
|
|
23314
|
+
var tt = Y.visibleNodes.concat(Y.panoIndex).map(function(se) {
|
|
23315
|
+
return panoStringify({ panoIndex: se, workCode: Y.work.workCode });
|
|
23219
23316
|
}), rt = this.camera.getDirection(new THREE.Vector3());
|
|
23220
|
-
this.panoMeshes.forEach(function(
|
|
23221
|
-
var Ie = o.works.getObserver(
|
|
23222
|
-
if (tt.indexOf(
|
|
23223
|
-
|
|
23317
|
+
this.panoMeshes.forEach(function(se, xe) {
|
|
23318
|
+
var Ie = o.works.getObserver(xe);
|
|
23319
|
+
if (tt.indexOf(xe) === -1)
|
|
23320
|
+
se.setCurrent(!1), se.setOpacity(0);
|
|
23224
23321
|
else if (!Ie)
|
|
23225
|
-
|
|
23322
|
+
se.setCurrent(!1), se.setOpacity(0);
|
|
23226
23323
|
else if (!Ie.loadable && !Ie.active)
|
|
23227
|
-
|
|
23324
|
+
se.setCurrent(!1), se.setOpacity(0);
|
|
23228
23325
|
else {
|
|
23229
|
-
var Se =
|
|
23230
|
-
|
|
23231
|
-
var
|
|
23232
|
-
if (
|
|
23233
|
-
var yt = clamp$1((0.5 -
|
|
23326
|
+
var Se = se.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);
|
|
23327
|
+
se.setCurrent(!se.loading && se.progress === 0 && X !== null && panoStringify({ panoIndex: X.panoIndex, workCode: X.work.workCode }) === xe), se.setOpacity(Se < 0.01 ? 0 : clamp$1(Fe / Se * 1.2, 0.4, 0.85));
|
|
23328
|
+
var ze = o.camera.position.clone().setY(se.position.y), it = new THREE.Vector3().copy(se.position).sub(ze).normalize();
|
|
23329
|
+
if (xe === panoStringify(o.currentPano)) {
|
|
23330
|
+
var yt = clamp$1((0.5 - ze.distanceTo(se.position)) / 0.5, 0, 1);
|
|
23234
23331
|
it.multiplyScalar(1 - yt).add(rt.clone().multiplyScalar(yt));
|
|
23235
23332
|
}
|
|
23236
|
-
it.length() > 0 &&
|
|
23333
|
+
it.length() > 0 && se.quaternion.setFromEuler(new THREE.Euler(0, Math.atan2(it.x, it.z), 0));
|
|
23237
23334
|
}
|
|
23238
|
-
|
|
23335
|
+
se.updateTime && se.updateTime(e, r);
|
|
23239
23336
|
});
|
|
23240
23337
|
}
|
|
23241
23338
|
{
|
|
23242
|
-
var I = (l = this.modelScene.parameter.progress) !== null && l !== void 0 ? l : 1,
|
|
23243
|
-
if (Ae && (M = this.works.getObserver(Ae.panoId), M || (M = this.panoPictureObserverMap.get(Ae))), this.tiling.appearDuration = this.tileAppearDuration, this.tiling.maxRequest = I <= 0.6 ? 0 :
|
|
23339
|
+
var I = (l = this.modelScene.parameter.progress) !== null && l !== void 0 ? l : 1, Le = Math.round(I), Pe = this.modelScene.parameter.pano0, _e = this.modelScene.parameter.pano1, Ae = Le === 0 ? Pe : _e, M = void 0;
|
|
23340
|
+
if (Ae && (M = this.works.getObserver(Ae.panoId), M || (M = this.panoPictureObserverMap.get(Ae))), this.tiling.appearDuration = this.tileAppearDuration, this.tiling.maxRequest = I <= 0.6 ? 0 : this.tileMaxRequest, this.tiling.imageOptions = this.imageOptions, !M || !Ae || this.tileLevelForFov === !1) {
|
|
23244
23341
|
this.tiling.setObserver(null);
|
|
23245
23342
|
var Ce = {
|
|
23246
23343
|
renderer: this.renderer,
|
|
@@ -23257,7 +23354,7 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
|
|
|
23257
23354
|
};
|
|
23258
23355
|
this.tiling.update(Ce), this.modelScene.parameter.set("refinedScreen", null);
|
|
23259
23356
|
} else {
|
|
23260
|
-
var Be = getImageSizeLevel(Ae.mapSize), je = Be + 1, Ve = new THREE.Vector2().copy(this.camera.resolution).multiplyScalar(this.camera.pixelRatio),
|
|
23357
|
+
var Be = getImageSizeLevel(Ae.mapSize), je = Be + 1, Ve = new THREE.Vector2().copy(this.camera.resolution).multiplyScalar(this.camera.pixelRatio), Ze = Math.floor(this.tileLevelForFov(this.camera.fov, Ve)), At = Ze > Be ? Ze : 0;
|
|
23261
23358
|
this.tiling.setObserver(M);
|
|
23262
23359
|
var Ce = {
|
|
23263
23360
|
renderer: this.renderer,
|
|
@@ -23275,16 +23372,16 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
|
|
|
23275
23372
|
map: this.tiling.renderTarget.texture,
|
|
23276
23373
|
matrixInverse: this.tiling.camera.matrixWorldInverse,
|
|
23277
23374
|
projectionMatrix: this.tiling.camera.projectionMatrix,
|
|
23278
|
-
pano:
|
|
23375
|
+
pano: Le,
|
|
23279
23376
|
opacity: (Pe == null ? void 0 : Pe.panoId) === (_e == null ? void 0 : _e.panoId) ? 1 : easeInQuart(Math.abs(((c = this.modelScene.parameter.progress) !== null && c !== void 0 ? c : 0) - 0.5) * 2)
|
|
23280
23377
|
}, we = this.modelScene.parameter.refinedScreen;
|
|
23281
23378
|
(Qe || gt.pano !== (we == null ? void 0 : we.pano) || gt.opacity !== (we == null ? void 0 : we.opacity)) && this.modelScene.parameter.set("refinedScreen", gt);
|
|
23282
23379
|
}
|
|
23283
23380
|
}
|
|
23284
|
-
this.panoVideo.object.position.copy(this.camera.position), this.panoVideo.updateTime(e),
|
|
23381
|
+
this.panoVideo.object.position.copy(this.camera.position), this.panoVideo.updateTime(e), Y && Y.video && (this.needsRender = !0), this.intersectMesh.scale.setScalar(clamp$1(this.cameraMotion.value.fov / 45, 0, 1));
|
|
23285
23382
|
{
|
|
23286
|
-
var
|
|
23287
|
-
if (Pe && _e && Pe !== _e &&
|
|
23383
|
+
var qe = b.effect, dt = this.modelScene.parameter, Pe = dt.pano0, _e = dt.pano1;
|
|
23384
|
+
if (Pe && _e && Pe !== _e && qe === "fly" && this.flyEffectUseDepthBuffer) {
|
|
23288
23385
|
if (((d = this.modelScene.parameter.pano0Depth) === null || d === void 0 ? void 0 : d.panoId) !== Pe.panoId || ((f = this.modelScene.parameter.pano1Depth) === null || f === void 0 ? void 0 : f.panoId) !== _e.panoId) {
|
|
23289
23386
|
var ht = 500, Ge = 512;
|
|
23290
23387
|
this.pano0DepthCubeRenderTarget ? this.pano0DepthCubeRenderTarget.width !== Ge && this.pano0DepthCubeRenderTarget.setSize(Ge, Ge) : this.pano0DepthCubeRenderTarget = new THREE.WebGLCubeRenderTarget(Ge, {
|
|
@@ -23550,17 +23647,17 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
|
|
|
23550
23647
|
{ key: C.key, progress: k / T, value: C.value },
|
|
23551
23648
|
{ key: y, progress: 1, value: { count: C.value.count + 1, distance: 0 } }
|
|
23552
23649
|
];
|
|
23553
|
-
var
|
|
23554
|
-
|
|
23650
|
+
var J = this.locationMotionKeyframesLength(this.locationMotion.keyframes), G = this.locationMotionKeyframesLength(S);
|
|
23651
|
+
J === 0 || J === 0 ? R = 0 : R = this.locationMotion.getProgressVelocity(v) * J / G;
|
|
23555
23652
|
}
|
|
23556
23653
|
var U = r.effect === "instant" ? 0 : this.calculateMovingDuration(o.duration, r.effect === "fly" ? T : 0), z = {
|
|
23557
23654
|
longitude: o.longitude,
|
|
23558
23655
|
latitude: o.latitude,
|
|
23559
23656
|
fov: o.fov
|
|
23560
|
-
}, q = __assign(__assign({}, e), { mode: this.mode, longitude: (l = z.longitude) !== null && l !== void 0 ? l : this.camera.pose.longitude, latitude: (c = z.latitude) !== null && c !== void 0 ? c : this.camera.pose.latitude, fov: (d = z.fov) !== null && d !== void 0 ? d : this.camera.pose.fov, offset: r.position.clone(), distance: this.camera.pose.distance }),
|
|
23657
|
+
}, q = __assign(__assign({}, e), { mode: this.mode, longitude: (l = z.longitude) !== null && l !== void 0 ? l : this.camera.pose.longitude, latitude: (c = z.latitude) !== null && c !== void 0 ? c : this.camera.pose.latitude, fov: (d = z.fov) !== null && d !== void 0 ? d : this.camera.pose.fov, offset: r.position.clone(), distance: this.camera.pose.distance }), j = this.currentPano;
|
|
23561
23658
|
if (this.emit("pano.moveTo", createEvent("pano.moveTo", {
|
|
23562
23659
|
options: o,
|
|
23563
|
-
prevPano:
|
|
23660
|
+
prevPano: j,
|
|
23564
23661
|
progress: 0,
|
|
23565
23662
|
state: q,
|
|
23566
23663
|
userAction: this.userAction,
|
|
@@ -23568,23 +23665,23 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
|
|
|
23568
23665
|
})), o.moveStartCallback && o.moveStartCallback(q), this.videoTexture && this.videoTexture.image instanceof HTMLVideoElement && this.videoTexture.image.getAttribute("src") && (this.videoTexture.image.pause(), this.videoTexture.image.removeAttribute("uuid"), this.videoTexture.image.removeAttribute("src"), this.videoTexture.image.oncanplay = noop, this.videoTexture.needsUpdate = !0), this.panoVideo.setMaterial(null), r.effect === "fly")
|
|
23569
23666
|
this.cameraMotion.set(z, U).catch(noop);
|
|
23570
23667
|
else {
|
|
23571
|
-
var
|
|
23668
|
+
var K = coordinatesToVector({
|
|
23572
23669
|
longitude: this.cameraMotion.value.longitude,
|
|
23573
23670
|
latitude: this.cameraMotion.value.latitude
|
|
23574
|
-
}),
|
|
23671
|
+
}), Y = coordinatesToVector({
|
|
23575
23672
|
longitude: (f = z.longitude) !== null && f !== void 0 ? f : this.cameraMotion.value.longitude,
|
|
23576
23673
|
latitude: (h = z.latitude) !== null && h !== void 0 ? h : this.cameraMotion.value.latitude
|
|
23577
|
-
}),
|
|
23578
|
-
|
|
23579
|
-
var
|
|
23580
|
-
|
|
23581
|
-
var W = new THREE.Matrix4().makeRotationFromQuaternion(
|
|
23674
|
+
}), X = new THREE.Object3D();
|
|
23675
|
+
X.lookAt(K);
|
|
23676
|
+
var Q = new THREE.Matrix4().makeRotationFromQuaternion(X.quaternion);
|
|
23677
|
+
X.lookAt(Y);
|
|
23678
|
+
var W = new THREE.Matrix4().makeRotationFromQuaternion(X.quaternion), $ = new THREE.Matrix4().getInverse(Q).premultiply(W), ae = this.cameraMotion.value.fov, ee = (p = z.fov) !== null && p !== void 0 ? p : this.cameraMotion.value.fov, ne = 1;
|
|
23582
23679
|
r.effect === "zoomin" ? ne = 1.5 : r.effect === "zoomout" && (ne = 0.4);
|
|
23583
|
-
for (var te = clamp$1(ee * ne, 1, 170),
|
|
23584
|
-
var
|
|
23585
|
-
if (
|
|
23586
|
-
var
|
|
23587
|
-
|
|
23680
|
+
for (var te = clamp$1(ee * ne, 1, 170), fe = 0; fe < S.length - 1; fe++) {
|
|
23681
|
+
var oe = S[fe].key;
|
|
23682
|
+
if (oe) {
|
|
23683
|
+
var he = this.panoResources[oe];
|
|
23684
|
+
he && (he.fixCameraTransform.copy($), he.panoPicture && (he.panoPicture.zoom = Math.tan(te / 2 / 180 * Math.PI) / Math.tan(ae / 2 / 180 * Math.PI)));
|
|
23588
23685
|
}
|
|
23589
23686
|
}
|
|
23590
23687
|
this.cameraMotion.setKeyframes([
|
|
@@ -23619,36 +23716,36 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
|
|
|
23619
23716
|
// resolve
|
|
23620
23717
|
// 动画结束
|
|
23621
23718
|
function() {
|
|
23622
|
-
for (var be = 0,
|
|
23623
|
-
var
|
|
23624
|
-
|
|
23719
|
+
for (var be = 0, Te = s.modelScene.children; be < Te.length; be++) {
|
|
23720
|
+
var le = Te[be];
|
|
23721
|
+
le instanceof Model && le.show();
|
|
23625
23722
|
}
|
|
23626
|
-
var
|
|
23723
|
+
var de = __assign(__assign({}, e), { mode: s.mode, longitude: s.camera.pose.longitude, latitude: s.camera.pose.latitude, fov: s.camera.pose.fov, offset: s.camera.pose.offset.clone(), distance: s.camera.pose.distance });
|
|
23627
23724
|
s.emit("pano.arrived", createEvent("pano.arrived", {
|
|
23628
23725
|
options: o,
|
|
23629
|
-
prevPano:
|
|
23726
|
+
prevPano: j,
|
|
23630
23727
|
progress: 1,
|
|
23631
|
-
state:
|
|
23728
|
+
state: de,
|
|
23632
23729
|
userAction: s.userAction,
|
|
23633
23730
|
error: null
|
|
23634
|
-
})), o.moveEndCallback && o.moveEndCallback(
|
|
23635
|
-
var
|
|
23636
|
-
if (
|
|
23637
|
-
var
|
|
23731
|
+
})), o.moveEndCallback && o.moveEndCallback(de);
|
|
23732
|
+
var re = s.works.getObserver(e);
|
|
23733
|
+
if (re && re.video && s.videoTexture && s.videoTexture.image instanceof HTMLVideoElement) {
|
|
23734
|
+
var ue = {
|
|
23638
23735
|
map: s.videoTexture,
|
|
23639
|
-
size:
|
|
23640
|
-
matrix:
|
|
23641
|
-
panoMatrix:
|
|
23736
|
+
size: re.video.size.clone(),
|
|
23737
|
+
matrix: re.video.matrix.clone(),
|
|
23738
|
+
panoMatrix: re.matrix.clone().premultiply(re.work.transform),
|
|
23642
23739
|
alpha: 1
|
|
23643
|
-
},
|
|
23644
|
-
|
|
23645
|
-
|
|
23646
|
-
|
|
23647
|
-
},
|
|
23648
|
-
|
|
23649
|
-
},
|
|
23740
|
+
}, ve = createUuid(), ye = s.videoTexture.image;
|
|
23741
|
+
ye.setAttribute("uuid", ve), canplayVideo().then(function(De) {
|
|
23742
|
+
De && re.video && ye.getAttribute("uuid") === ve && (ye.oncanplay = function() {
|
|
23743
|
+
ye.oncanplay = noop, ye.play();
|
|
23744
|
+
}, ye.ontimeupdate = function() {
|
|
23745
|
+
ye.currentTime > 0.5 && (ye.ontimeupdate = noop, s.panoVideo.setMaterial(ue));
|
|
23746
|
+
}, ye.src = re.video.source);
|
|
23650
23747
|
}).catch((function() {
|
|
23651
|
-
|
|
23748
|
+
ye.removeAttribute("uuid");
|
|
23652
23749
|
}));
|
|
23653
23750
|
}
|
|
23654
23751
|
},
|
|
@@ -23657,7 +23754,7 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
|
|
|
23657
23754
|
function() {
|
|
23658
23755
|
s.emit("pano.cancel", createEvent("pano.cancel", {
|
|
23659
23756
|
options: o,
|
|
23660
|
-
prevPano:
|
|
23757
|
+
prevPano: j,
|
|
23661
23758
|
progress: 0,
|
|
23662
23759
|
state: q,
|
|
23663
23760
|
userAction: s.userAction,
|
|
@@ -23670,11 +23767,11 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
|
|
|
23670
23767
|
if (!s)
|
|
23671
23768
|
return null;
|
|
23672
23769
|
var u = r != null ? r : new THREE.Raycaster(e.position.clone(), e.getWorldDirection(new THREE.Vector3()));
|
|
23673
|
-
u.params.Points = { threshold: 0.1 }, u.firstHitOnly = !0;
|
|
23770
|
+
u.params.Points = { threshold: 0.1 }, u.firstHitOnly = !0, u.floorIndex = -1;
|
|
23674
23771
|
var l = s.standingPosition.clone().applyMatrix4(s.work.transform), c = s.position.clone().applyMatrix4(s.work.transform);
|
|
23675
23772
|
if (c.distanceTo(u.ray.origin) > 1) {
|
|
23676
23773
|
var d = new THREE.Raycaster(u.ray.origin, new THREE.Vector3(0, -1, 0));
|
|
23677
|
-
d.firstHitOnly =
|
|
23774
|
+
d.firstHitOnly = u.firstHitOnly, d.floorIndex = u.floorIndex;
|
|
23678
23775
|
var f = this.modelScene.intersectRaycaster(d)[0];
|
|
23679
23776
|
f && f.distance <= 2 ? l.copy(f.point) : l.copy(u.ray.origin).add(new THREE.Vector3(0, -1.5, 0));
|
|
23680
23777
|
}
|
|
@@ -23712,24 +23809,26 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
|
|
|
23712
23809
|
if (s.panoId !== panoStringify(this.currentPano))
|
|
23713
23810
|
return;
|
|
23714
23811
|
}
|
|
23715
|
-
var u = e.center.raycaster
|
|
23812
|
+
var u = e.center.raycaster;
|
|
23813
|
+
u.floorIndex = -1;
|
|
23814
|
+
var l = this.camera.getDirection(new THREE.Vector3()).setY(0), c = null, d = this.works.getObserver(this.currentPano);
|
|
23716
23815
|
if (d) {
|
|
23717
|
-
var f = d.work.observers, h = d.accessibleNodes.filter(function(
|
|
23718
|
-
if (
|
|
23816
|
+
var f = d.work.observers, h = d.accessibleNodes.filter(function(K) {
|
|
23817
|
+
if (K === r.currentPano.panoIndex && d.work.workCode === r.currentPano.workCode)
|
|
23719
23818
|
return !1;
|
|
23720
|
-
var
|
|
23721
|
-
if (!
|
|
23819
|
+
var Y = f[K];
|
|
23820
|
+
if (!Y)
|
|
23722
23821
|
return !1;
|
|
23723
|
-
var
|
|
23724
|
-
return
|
|
23822
|
+
var X = scratchVector3$3.copy(Y.position).applyMatrix4(Y.work.transform);
|
|
23823
|
+
return X.distanceTo(r.camera.position) > r.maxAccessibleDistance ? !1 : Y.loadable || Y.active;
|
|
23725
23824
|
}), p = this.modelScene.intersectRaycaster(u)[0];
|
|
23726
23825
|
if (p) {
|
|
23727
|
-
var A = arrayMin(h, function(
|
|
23728
|
-
var
|
|
23729
|
-
if (!
|
|
23826
|
+
var A = arrayMin(h, function(K) {
|
|
23827
|
+
var Y = f[K];
|
|
23828
|
+
if (!Y)
|
|
23730
23829
|
return 1 / 0;
|
|
23731
|
-
var
|
|
23732
|
-
return
|
|
23830
|
+
var X = scratchVector3$3.copy(Y.standingPosition).applyMatrix4(Y.work.transform);
|
|
23831
|
+
return X.distanceTo(p.point);
|
|
23733
23832
|
}, !0), g = A[0], m = A[1];
|
|
23734
23833
|
typeof g == "number" && m < this.panoTapTriggerRadius && (c = (o = f[g]) !== null && o !== void 0 ? o : null);
|
|
23735
23834
|
}
|
|
@@ -23760,11 +23859,11 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
|
|
|
23760
23859
|
}
|
|
23761
23860
|
}
|
|
23762
23861
|
}
|
|
23763
|
-
var D = M.length > 0 ? M : __spreadArray(__spreadArray([], I, !0), H, !0),
|
|
23764
|
-
return
|
|
23862
|
+
var D = M.length > 0 ? M : __spreadArray(__spreadArray([], I, !0), H, !0), J = D.slice().sort(function(K, Y) {
|
|
23863
|
+
return K.angleTo(C) - Y.angleTo(C);
|
|
23765
23864
|
})[0];
|
|
23766
|
-
if (
|
|
23767
|
-
var
|
|
23865
|
+
if (J && J.angleTo(l) > w && (S.longitude = Math.atan2(-J.x, -J.z)), this.cameraMotion.value.latitude < -Math.PI / 4) {
|
|
23866
|
+
var G = e.state.fov, U = clamp$1(typeof this.minLatitude == "function" ? this.minLatitude(G) : this.minLatitude, -Math.PI / 2, Math.PI / 2), z = clamp$1(typeof this.maxLatitude == "function" ? this.maxLatitude(G) : this.maxLatitude, -Math.PI / 2, Math.PI / 2);
|
|
23768
23867
|
S.latitude = clamp$1(0, U, z);
|
|
23769
23868
|
}
|
|
23770
23869
|
var q = __assign({}, e.state);
|
|
@@ -23780,8 +23879,8 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
|
|
|
23780
23879
|
var T = panoStringify({
|
|
23781
23880
|
panoIndex: c.panoIndex,
|
|
23782
23881
|
workCode: c.work.workCode
|
|
23783
|
-
}),
|
|
23784
|
-
|
|
23882
|
+
}), j = this.panoMeshes.get(T);
|
|
23883
|
+
j && (j.setDisabled(!1), j.setLoading(!0));
|
|
23785
23884
|
}
|
|
23786
23885
|
c && c.active && this.emit("pano.request", createEvent("pano.request", {
|
|
23787
23886
|
userAction: e.userAction,
|
|
@@ -24710,23 +24809,23 @@ void main() {
|
|
|
24710
24809
|
B.copy(F), R = !0;
|
|
24711
24810
|
}
|
|
24712
24811
|
p.distance = this.locationMotion.value.distance, p.offset = new THREE.Vector3(B.x + (F.x - B.x) * L, B.y + (F.y - B.y) * L, B.z + (F.z - B.z) * L);
|
|
24713
|
-
for (var D = [],
|
|
24714
|
-
var z = U[
|
|
24715
|
-
q !== void 0 && (D.push(q),
|
|
24812
|
+
for (var D = [], J = [], G = 0, U = this.locationMotion.keyframes; G < U.length; G++) {
|
|
24813
|
+
var z = U[G], q = z.key, j = z.progress;
|
|
24814
|
+
q !== void 0 && (D.push(q), j > this.locationMotion.progress && J.push(q));
|
|
24716
24815
|
}
|
|
24717
|
-
for (var
|
|
24718
|
-
var
|
|
24719
|
-
if (!(
|
|
24720
|
-
var
|
|
24721
|
-
if (
|
|
24722
|
-
var W =
|
|
24816
|
+
for (var K = 0, Y = Object.keys(this.panoResources); K < Y.length; K++) {
|
|
24817
|
+
var X = Y[K];
|
|
24818
|
+
if (!(J.indexOf(X) >= 0)) {
|
|
24819
|
+
var Q = this.panoResources[X];
|
|
24820
|
+
if (Q.panoPicture) {
|
|
24821
|
+
var W = Q.panoPicture.map;
|
|
24723
24822
|
if (W) {
|
|
24724
24823
|
if (W === ((s = h.pano0) === null || s === void 0 ? void 0 : s.map) || W === ((u = h.pano1) === null || u === void 0 ? void 0 : u.map))
|
|
24725
24824
|
continue;
|
|
24726
|
-
W.dispose(),
|
|
24825
|
+
W.dispose(), Q.panoPicture = null;
|
|
24727
24826
|
}
|
|
24728
24827
|
}
|
|
24729
|
-
D.indexOf(
|
|
24828
|
+
D.indexOf(X) >= 0 || delete this.panoResources[X];
|
|
24730
24829
|
}
|
|
24731
24830
|
}
|
|
24732
24831
|
this.currentPano = panoParse(M.panoId), this.emit("pano.moving", createEvent("pano.moving", {
|
|
@@ -24739,15 +24838,15 @@ void main() {
|
|
|
24739
24838
|
}));
|
|
24740
24839
|
}
|
|
24741
24840
|
isEmptyObject(h) === !1 && this.modelScene.parameter.set(h), p.offset && this.camera.position.copy(p.offset);
|
|
24742
|
-
var $ = this.camera.pose.longitude,
|
|
24743
|
-
this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()), this.camera.computePose(), ($ !== this.camera.pose.longitude ||
|
|
24841
|
+
var $ = this.camera.pose.longitude, ae = this.camera.pose.latitude;
|
|
24842
|
+
this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()), this.camera.computePose(), ($ !== this.camera.pose.longitude || ae !== this.camera.pose.latitude) && (this.cameraMotion.set(pick(this.camera.pose, ["longitude", "latitude"]), 0).catch(noop), this.emit("camera.update", createEvent("camera.update", {
|
|
24744
24843
|
userAction: !0,
|
|
24745
24844
|
state: __assign(__assign(__assign({}, this.currentPano), { mode: this.mode }), clonePose(this.camera.pose))
|
|
24746
24845
|
}))), this.works.getObserver(this.currentPano);
|
|
24747
24846
|
var ee = this.works.getObserver(y.panoId), ne = this.works.getObserver(b.panoId), te = /* @__PURE__ */ new Map();
|
|
24748
24847
|
if (ee)
|
|
24749
|
-
for (var
|
|
24750
|
-
var
|
|
24848
|
+
for (var fe = 0, oe = ee.accessibleNodes; fe < oe.length; fe++) {
|
|
24849
|
+
var he = oe[fe], k = ee.work.observers[he];
|
|
24751
24850
|
if (k) {
|
|
24752
24851
|
var me = panoStringify({
|
|
24753
24852
|
panoIndex: k.panoIndex,
|
|
@@ -24757,8 +24856,8 @@ void main() {
|
|
|
24757
24856
|
}
|
|
24758
24857
|
}
|
|
24759
24858
|
if (ne)
|
|
24760
|
-
for (var be = 0,
|
|
24761
|
-
var
|
|
24859
|
+
for (var be = 0, Te = ne.accessibleNodes; be < Te.length; be++) {
|
|
24860
|
+
var he = Te[be], k = ne.work.observers[he];
|
|
24762
24861
|
if (k) {
|
|
24763
24862
|
var me = panoStringify({
|
|
24764
24863
|
panoIndex: k.panoIndex,
|
|
@@ -24786,16 +24885,16 @@ void main() {
|
|
|
24786
24885
|
Ve < 0.05 ? Ae.setOpacity(0) : Ae.setOpacity(clamp$1(1.5 / Ve, 0, 1)), panoEqual(o.currentPano, Be) && Ae.setOpacity(0), Ae.lookAt(o.camera.position);
|
|
24787
24886
|
}
|
|
24788
24887
|
}), this.locationMotion.ended) {
|
|
24789
|
-
var
|
|
24888
|
+
var le = this.intersect(e);
|
|
24790
24889
|
this.panoMeshes.forEach(function(Ae, Ce) {
|
|
24791
|
-
Ae.setCurrent(Ae ===
|
|
24890
|
+
Ae.setCurrent(Ae === le), Ae.updateTime && Ae.updateTime(e, r);
|
|
24792
24891
|
});
|
|
24793
24892
|
}
|
|
24794
24893
|
{
|
|
24795
|
-
var L = (l = this.modelScene.parameter.progress) !== null && l !== void 0 ? l : 1,
|
|
24796
|
-
if (
|
|
24894
|
+
var L = (l = this.modelScene.parameter.progress) !== null && l !== void 0 ? l : 1, de = Math.round(L), re = this.modelScene.parameter.pano0, ue = this.modelScene.parameter.pano1, ve = de === 0 ? re : ue, k = void 0;
|
|
24895
|
+
if (ve && (k = this.works.getObserver(ve.panoId), k || (k = this.panoPictureObserverMap.get(ve))), this.tiling.appearDuration = this.tileAppearDuration, this.tiling.maxRequest = L <= 0.6 ? 0 : this.tileMaxRequest, this.tiling.imageOptions = this.imageOptions, !k || !ve || this.tileLevelForFov === !1) {
|
|
24797
24896
|
this.tiling.setObserver(null);
|
|
24798
|
-
var
|
|
24897
|
+
var ye = {
|
|
24799
24898
|
renderer: this.renderer,
|
|
24800
24899
|
resolution: this.camera.resolution,
|
|
24801
24900
|
pixelRatio: this.camera.pixelRatio,
|
|
@@ -24808,59 +24907,59 @@ void main() {
|
|
|
24808
24907
|
minLevel: 0,
|
|
24809
24908
|
level: 0
|
|
24810
24909
|
};
|
|
24811
|
-
this.tiling.update(
|
|
24910
|
+
this.tiling.update(ye), this.modelScene.parameter.set("refinedScreen", null);
|
|
24812
24911
|
} else {
|
|
24813
|
-
var
|
|
24912
|
+
var De = getImageSizeLevel(ve.mapSize), Je = De + 1, $e = new THREE.Vector2().copy(this.camera.resolution).multiplyScalar(this.camera.pixelRatio), Ue = Math.floor(this.tileLevelForFov(this.camera.fov, $e)), pe = Ue > De ? Ue : 0;
|
|
24814
24913
|
this.tiling.setObserver(k);
|
|
24815
|
-
var
|
|
24914
|
+
var ye = {
|
|
24816
24915
|
renderer: this.renderer,
|
|
24817
24916
|
resolution: this.camera.resolution,
|
|
24818
24917
|
pixelRatio: this.camera.pixelRatio,
|
|
24819
24918
|
time: this.camera.time,
|
|
24820
24919
|
cameraMatrix: this.camera.matrixWorld,
|
|
24821
24920
|
cameraProjectionMatrix: this.camera.projectionMatrix,
|
|
24822
|
-
panoMap:
|
|
24823
|
-
panoMatrix:
|
|
24824
|
-
panoZoom:
|
|
24825
|
-
minLevel:
|
|
24826
|
-
level:
|
|
24827
|
-
},
|
|
24921
|
+
panoMap: ve.map,
|
|
24922
|
+
panoMatrix: ve.matrix,
|
|
24923
|
+
panoZoom: ve.zoom,
|
|
24924
|
+
minLevel: Je,
|
|
24925
|
+
level: pe
|
|
24926
|
+
}, Ye = this.tiling.update(ye), Ee = {
|
|
24828
24927
|
map: this.tiling.renderTarget.texture,
|
|
24829
24928
|
matrixInverse: this.tiling.camera.matrixWorldInverse,
|
|
24830
24929
|
projectionMatrix: this.tiling.camera.projectionMatrix,
|
|
24831
|
-
pano:
|
|
24832
|
-
opacity: (
|
|
24930
|
+
pano: de,
|
|
24931
|
+
opacity: (re == null ? void 0 : re.panoId) === (ue == null ? void 0 : ue.panoId) ? 1 : easeInQuart(Math.abs(((c = this.modelScene.parameter.progress) !== null && c !== void 0 ? c : 0) - 0.5) * 2)
|
|
24833
24932
|
}, Oe = this.modelScene.parameter.refinedScreen;
|
|
24834
|
-
(
|
|
24933
|
+
(Ye || Ee.pano !== (Oe == null ? void 0 : Oe.pano) || Ee.opacity !== (Oe == null ? void 0 : Oe.opacity)) && this.modelScene.parameter.set("refinedScreen", Ee);
|
|
24835
24934
|
}
|
|
24836
24935
|
}
|
|
24837
24936
|
this.panoVideo.object.position.copy(this.camera.position), this.panoVideo.updateTime(e);
|
|
24838
24937
|
{
|
|
24839
|
-
var Fe = b.effect, tt = this.modelScene.parameter,
|
|
24840
|
-
if (
|
|
24841
|
-
if (((d = this.modelScene.parameter.pano0Depth) === null || d === void 0 ? void 0 : d.panoId) !==
|
|
24842
|
-
var rt = 500,
|
|
24843
|
-
this.pano0DepthCubeRenderTarget ? this.pano0DepthCubeRenderTarget.width !==
|
|
24938
|
+
var Fe = b.effect, tt = this.modelScene.parameter, re = tt.pano0, ue = tt.pano1;
|
|
24939
|
+
if (re && ue && re !== ue && Fe === "fly" && this.flyEffectUseDepthBuffer) {
|
|
24940
|
+
if (((d = this.modelScene.parameter.pano0Depth) === null || d === void 0 ? void 0 : d.panoId) !== re.panoId || ((f = this.modelScene.parameter.pano1Depth) === null || f === void 0 ? void 0 : f.panoId) !== ue.panoId) {
|
|
24941
|
+
var rt = 500, Le = 512;
|
|
24942
|
+
this.pano0DepthCubeRenderTarget ? this.pano0DepthCubeRenderTarget.width !== Le && this.pano0DepthCubeRenderTarget.setSize(Le, Le) : this.pano0DepthCubeRenderTarget = new THREE.WebGLCubeRenderTarget(Le, {
|
|
24844
24943
|
minFilter: THREE.NearestFilter,
|
|
24845
24944
|
magFilter: THREE.NearestFilter,
|
|
24846
24945
|
generateMipmaps: !1
|
|
24847
|
-
}), this.pano1DepthCubeRenderTarget ? this.pano1DepthCubeRenderTarget.width !==
|
|
24946
|
+
}), this.pano1DepthCubeRenderTarget ? this.pano1DepthCubeRenderTarget.width !== Le && this.pano1DepthCubeRenderTarget.setSize(Le, Le) : this.pano1DepthCubeRenderTarget = new THREE.WebGLCubeRenderTarget(Le, {
|
|
24848
24947
|
minFilter: THREE.NearestFilter,
|
|
24849
24948
|
magFilter: THREE.NearestFilter,
|
|
24850
24949
|
generateMipmaps: !1
|
|
24851
24950
|
});
|
|
24852
24951
|
var Pe = new THREE.CubeCamera(this.camera.near, this.camera.far, this.pano0DepthCubeRenderTarget);
|
|
24853
|
-
Pe.matrix.copy(
|
|
24952
|
+
Pe.matrix.copy(re.matrix), Pe.matrixWorld.copy(Pe.matrix), Pe.matrixAutoUpdate = !1, renderDepthCube(this.renderer, this.modelScene, Pe, rt);
|
|
24854
24953
|
var _e = new THREE.CubeCamera(this.camera.near, this.camera.far, this.pano1DepthCubeRenderTarget);
|
|
24855
|
-
_e.matrix.copy(
|
|
24954
|
+
_e.matrix.copy(ue.matrix), _e.matrixWorld.copy(_e.matrix), _e.matrixAutoUpdate = !1, renderDepthCube(this.renderer, this.modelScene, _e, rt), this.modelScene.parameter.set({
|
|
24856
24955
|
pano0Depth: {
|
|
24857
|
-
panoId:
|
|
24956
|
+
panoId: re.panoId,
|
|
24858
24957
|
map: this.pano0DepthCubeRenderTarget.texture,
|
|
24859
24958
|
mapSize: this.pano0DepthCubeRenderTarget.width,
|
|
24860
24959
|
maxDepth: rt
|
|
24861
24960
|
},
|
|
24862
24961
|
pano1Depth: {
|
|
24863
|
-
panoId:
|
|
24962
|
+
panoId: ue.panoId,
|
|
24864
24963
|
map: this.pano1DepthCubeRenderTarget.texture,
|
|
24865
24964
|
mapSize: this.pano1DepthCubeRenderTarget.width,
|
|
24866
24965
|
maxDepth: rt
|
|
@@ -24896,7 +24995,7 @@ void main() {
|
|
|
24896
24995
|
}), u !== null && this.moveToPano(panoParse(u), {}, !0), delete this.activePanoMesh, delete this.activeTime, s;
|
|
24897
24996
|
}
|
|
24898
24997
|
var l = this.camera.getDirection(new THREE.Vector3()), c = new THREE.Raycaster(this.camera.position, l);
|
|
24899
|
-
c.params.Points = { threshold: 0.1 }, c.firstHitOnly = !0;
|
|
24998
|
+
c.params.Points = { threshold: 0.1 }, c.firstHitOnly = !0, c.floorIndex = -1;
|
|
24900
24999
|
for (var d = void 0, f = [], h = this.works.getObserver(this.currentPano), p = h ? h.accessibleNodes.map(function(C) {
|
|
24901
25000
|
return panoStringify({ panoIndex: C, workCode: h.work.workCode });
|
|
24902
25001
|
}) : [], A = 0, g = p; A < g.length; A++) {
|
|
@@ -25135,15 +25234,15 @@ void main() {
|
|
|
25135
25234
|
latitude: r.latitude,
|
|
25136
25235
|
fov: r.fov
|
|
25137
25236
|
}, M = [], B = function(z) {
|
|
25138
|
-
var q = F.modelScene.models.find(function(
|
|
25139
|
-
return
|
|
25237
|
+
var q = F.modelScene.models.find(function(X) {
|
|
25238
|
+
return X.work === z;
|
|
25140
25239
|
});
|
|
25141
25240
|
if (!q || q.visible === !1 || z.observers.length <= 0)
|
|
25142
25241
|
return "continue";
|
|
25143
25242
|
if (scratchObserverBox$1.copy(z.observerBox).expandByScalar(10).applyMatrix4(z.transform), scratchObserverBox$1.containsPoint(f))
|
|
25144
|
-
for (var
|
|
25145
|
-
var
|
|
25146
|
-
M.push(
|
|
25243
|
+
for (var j = 0, K = z.observers; j < K.length; j++) {
|
|
25244
|
+
var Y = K[j];
|
|
25245
|
+
M.push(Y);
|
|
25147
25246
|
}
|
|
25148
25247
|
}, F = this, L = 0, O = this.works; L < O.length; L++) {
|
|
25149
25248
|
var k = O[L];
|
|
@@ -25151,37 +25250,37 @@ void main() {
|
|
|
25151
25250
|
}
|
|
25152
25251
|
var D = arrayMin(M, function(z) {
|
|
25153
25252
|
return scratchVector3$2.copy(z.position).applyMatrix4(z.work.transform).distanceTo(f);
|
|
25154
|
-
}),
|
|
25253
|
+
}), J = D ? {
|
|
25155
25254
|
workCode: D.work.workCode,
|
|
25156
25255
|
panoIndex: D.panoIndex
|
|
25157
25256
|
} : {
|
|
25158
25257
|
workCode: "",
|
|
25159
25258
|
panoIndex: 0
|
|
25160
|
-
},
|
|
25259
|
+
}, G = __assign(__assign({}, J), { mode: this.mode, longitude: (u = H.longitude) !== null && u !== void 0 ? u : this.camera.pose.longitude, latitude: (l = H.latitude) !== null && l !== void 0 ? l : this.camera.pose.latitude, fov: (c = H.fov) !== null && c !== void 0 ? c : this.camera.pose.fov, offset: e.clone(), distance: 0 }), U = this.currentPano;
|
|
25161
25260
|
this.emit("pano.moveTo", createEvent("pano.moveTo", {
|
|
25162
25261
|
options: r,
|
|
25163
25262
|
prevPano: U,
|
|
25164
25263
|
progress: 0,
|
|
25165
|
-
state:
|
|
25264
|
+
state: G,
|
|
25166
25265
|
userAction: this.userAction,
|
|
25167
25266
|
error: null
|
|
25168
|
-
})), r.moveStartCallback && r.moveStartCallback(
|
|
25267
|
+
})), r.moveStartCallback && r.moveStartCallback(G), this.cameraMotion.set(H, C).catch(noop), this.locationMotion.set(I, C, w).then(
|
|
25169
25268
|
// resolve
|
|
25170
25269
|
// 动画结束
|
|
25171
25270
|
function() {
|
|
25172
25271
|
for (var z = 0, q = s.modelScene.children; z < q.length; z++) {
|
|
25173
|
-
var
|
|
25174
|
-
|
|
25272
|
+
var j = q[z];
|
|
25273
|
+
j instanceof Model && j.show();
|
|
25175
25274
|
}
|
|
25176
|
-
var
|
|
25275
|
+
var K = __assign(__assign(__assign({}, J), { mode: s.mode }), clonePose(s.camera.pose));
|
|
25177
25276
|
s.emit("pano.arrived", createEvent("pano.arrived", {
|
|
25178
25277
|
options: r,
|
|
25179
25278
|
prevPano: U,
|
|
25180
25279
|
progress: 0,
|
|
25181
|
-
state:
|
|
25280
|
+
state: K,
|
|
25182
25281
|
userAction: s.userAction,
|
|
25183
25282
|
error: null
|
|
25184
|
-
})), r.moveEndCallback && r.moveEndCallback(
|
|
25283
|
+
})), r.moveEndCallback && r.moveEndCallback(K);
|
|
25185
25284
|
},
|
|
25186
25285
|
// reject
|
|
25187
25286
|
// 动画被取消
|
|
@@ -25190,7 +25289,7 @@ void main() {
|
|
|
25190
25289
|
options: r,
|
|
25191
25290
|
prevPano: U,
|
|
25192
25291
|
progress: 0,
|
|
25193
|
-
state:
|
|
25292
|
+
state: G,
|
|
25194
25293
|
userAction: s.userAction,
|
|
25195
25294
|
error: null
|
|
25196
25295
|
}));
|
|
@@ -25587,9 +25686,9 @@ void main() {
|
|
|
25587
25686
|
var E = {
|
|
25588
25687
|
x: e.center.x - o.x,
|
|
25589
25688
|
y: e.center.y - o.y
|
|
25590
|
-
}, L = this.coordinatesForOffset(E), O = formatRad$1(this.cameraMotion.value.longitude + L.longitude), k = this.camera.pose.fov, D = clamp$1(typeof this.minLatitude == "function" ? this.minLatitude(k) : this.minLatitude, -Math.PI / 2, Math.PI / 2),
|
|
25591
|
-
this.camera.aspect < 1 && Math.abs(e.overallVelocityX) > 0.2 && Math.atan2(Math.abs(e.overallVelocityY), Math.abs(e.overallVelocityX)) < Math.PI / 6.923 && (
|
|
25592
|
-
var C = __assign(__assign({}, this.currentPano), { mode: this.mode, longitude: O, latitude:
|
|
25689
|
+
}, L = this.coordinatesForOffset(E), O = formatRad$1(this.cameraMotion.value.longitude + L.longitude), k = this.camera.pose.fov, D = clamp$1(typeof this.minLatitude == "function" ? this.minLatitude(k) : this.minLatitude, -Math.PI / 2, Math.PI / 2), J = clamp$1(typeof this.maxLatitude == "function" ? this.maxLatitude(k) : this.maxLatitude, -Math.PI / 2, Math.PI / 2), G = clamp$1(this.cameraMotion.value.latitude + L.latitude, D, J);
|
|
25690
|
+
this.camera.aspect < 1 && Math.abs(e.overallVelocityX) > 0.2 && Math.atan2(Math.abs(e.overallVelocityY), Math.abs(e.overallVelocityX)) < Math.PI / 6.923 && (G = this.cameraMotion.value.latitude);
|
|
25691
|
+
var C = __assign(__assign({}, this.currentPano), { mode: this.mode, longitude: O, latitude: G, fov: k, offset: this.camera.pose.offset, distance: this.camera.pose.distance });
|
|
25593
25692
|
if (e.isFinal && Object.assign(e, { __fixFinalState: !0 }), e.state = C, this.emit("gesture.pan", e), e.defaultPrevented)
|
|
25594
25693
|
return;
|
|
25595
25694
|
if (e.isFinal ? this.locationMotion.set({
|
|
@@ -26411,7 +26510,7 @@ var circleImageURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYA
|
|
|
26411
26510
|
}
|
|
26412
26511
|
return Object.defineProperty(t, "version", {
|
|
26413
26512
|
get: function() {
|
|
26414
|
-
return "6.6.0-alpha.
|
|
26513
|
+
return "6.6.0-alpha.5";
|
|
26415
26514
|
},
|
|
26416
26515
|
enumerable: !1,
|
|
26417
26516
|
configurable: !0
|
|
@@ -26772,7 +26871,7 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
|
|
|
26772
26871
|
}), r.xrControllerRay = {
|
|
26773
26872
|
left: new THREE.Raycaster(),
|
|
26774
26873
|
right: new THREE.Raycaster()
|
|
26775
|
-
}, r.xrControllerRay.left.params.Points = { threshold: 0.1 }, r.xrControllerRay.left.firstHitOnly = !0, r.xrControllerRay.right.params.Points = { threshold: 0.1 }, r.xrControllerRay.right.firstHitOnly = !0, r.gazeRay = null, r.pointerLines = {
|
|
26874
|
+
}, r.xrControllerRay.left.params.Points = { threshold: 0.1 }, r.xrControllerRay.left.firstHitOnly = !0, r.xrControllerRay.left.floorIndex = -1, r.xrControllerRay.right.params.Points = { threshold: 0.1 }, r.xrControllerRay.right.firstHitOnly = !0, r.xrControllerRay.right.floorIndex = -1, r.gazeRay = null, r.pointerLines = {
|
|
26776
26875
|
left: new FiveLine(),
|
|
26777
26876
|
right: new FiveLine()
|
|
26778
26877
|
}, r.pointerLines.left.visible = !1, r.pointerLines.right.visible = !0, r.pointerLines.left.setMaterial({
|
|
@@ -27041,10 +27140,10 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
|
|
|
27041
27140
|
{ key: w.key, progress: O / b, value: w.value },
|
|
27042
27141
|
{ key: v, progress: 1, value: { count: w.value.count + 1, distance: 0 } }
|
|
27043
27142
|
];
|
|
27044
|
-
var D = this.locationMotionKeyframesLength(this.locationMotion.keyframes),
|
|
27045
|
-
S = this.locationMotion.getProgressVelocity(E) * D /
|
|
27143
|
+
var D = this.locationMotionKeyframesLength(this.locationMotion.keyframes), J = this.locationMotionKeyframesLength(T);
|
|
27144
|
+
S = this.locationMotion.getProgressVelocity(E) * D / J;
|
|
27046
27145
|
}
|
|
27047
|
-
var
|
|
27146
|
+
var G = r.effect === "instant" ? 0 : this.calculateMovingDuration(o.duration, r.effect === "fly" ? b : 0), U = {
|
|
27048
27147
|
longitude: o.longitude,
|
|
27049
27148
|
latitude: o.latitude,
|
|
27050
27149
|
fov: o.fov
|
|
@@ -27057,25 +27156,25 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
|
|
|
27057
27156
|
userAction: this.userAction,
|
|
27058
27157
|
error: null
|
|
27059
27158
|
})), o.moveStartCallback && o.moveStartCallback(z), this.videoTexture && this.videoTexture.image instanceof HTMLVideoElement && this.videoTexture.image.getAttribute("src") && (this.videoTexture.image.pause(), this.videoTexture.image.removeAttribute("uuid"), this.videoTexture.image.removeAttribute("src"), this.videoTexture.image.oncanplay = noop, this.videoTexture.needsUpdate = !0), this.panoVideo.setMaterial(null), r.effect === "fly")
|
|
27060
|
-
this.cameraMotion.set(U,
|
|
27159
|
+
this.cameraMotion.set(U, G).catch(noop);
|
|
27061
27160
|
else {
|
|
27062
|
-
var
|
|
27161
|
+
var j = coordinatesToVector({
|
|
27063
27162
|
longitude: this.cameraMotion.value.longitude,
|
|
27064
27163
|
latitude: this.cameraMotion.value.latitude
|
|
27065
|
-
}),
|
|
27164
|
+
}), K = coordinatesToVector({
|
|
27066
27165
|
longitude: (d = U.longitude) !== null && d !== void 0 ? d : this.cameraMotion.value.longitude,
|
|
27067
27166
|
latitude: (f = U.latitude) !== null && f !== void 0 ? f : this.cameraMotion.value.latitude
|
|
27068
|
-
}),
|
|
27069
|
-
|
|
27070
|
-
var
|
|
27071
|
-
|
|
27072
|
-
var
|
|
27167
|
+
}), Y = new THREE.Object3D();
|
|
27168
|
+
Y.lookAt(j);
|
|
27169
|
+
var X = new THREE.Matrix4().makeRotationFromQuaternion(Y.quaternion);
|
|
27170
|
+
Y.lookAt(K);
|
|
27171
|
+
var Q = new THREE.Matrix4().makeRotationFromQuaternion(Y.quaternion), W = new THREE.Matrix4().getInverse(X).premultiply(Q), $ = this.cameraMotion.value.fov, ae = (h = U.fov) !== null && h !== void 0 ? h : this.cameraMotion.value.fov, ee = 1;
|
|
27073
27172
|
r.effect === "zoomin" ? ee = 1.5 : r.effect === "zoomout" && (ee = 0.4);
|
|
27074
|
-
for (var ne =
|
|
27075
|
-
var
|
|
27076
|
-
if (
|
|
27077
|
-
var
|
|
27078
|
-
|
|
27173
|
+
for (var ne = ae * ee, te = 0; te < T.length - 1; te++) {
|
|
27174
|
+
var fe = T[te].key;
|
|
27175
|
+
if (fe) {
|
|
27176
|
+
var oe = this.panoResources[fe];
|
|
27177
|
+
oe && (oe.fixCameraTransform.copy(W), oe.leftPanoPicture && (oe.leftPanoPicture.zoom = Math.tan(ne / 2 / 180 * Math.PI) / Math.tan($ / 2 / 180 * Math.PI)));
|
|
27079
27178
|
}
|
|
27080
27179
|
}
|
|
27081
27180
|
this.cameraMotion.setKeyframes([
|
|
@@ -27100,46 +27199,46 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
|
|
|
27100
27199
|
value: {
|
|
27101
27200
|
longitude: (g = U.longitude) !== null && g !== void 0 ? g : this.cameraMotion.value.longitude,
|
|
27102
27201
|
latitude: (m = U.latitude) !== null && m !== void 0 ? m : this.cameraMotion.value.latitude,
|
|
27103
|
-
fov:
|
|
27202
|
+
fov: ae
|
|
27104
27203
|
}
|
|
27105
27204
|
}
|
|
27106
|
-
],
|
|
27205
|
+
], G).catch(noop);
|
|
27107
27206
|
}
|
|
27108
|
-
var
|
|
27109
|
-
|
|
27207
|
+
var he = this.locationMotion.setKeyframes(T, G, S);
|
|
27208
|
+
he.then(
|
|
27110
27209
|
// resolve
|
|
27111
27210
|
// 动画结束
|
|
27112
27211
|
function() {
|
|
27113
27212
|
for (var me = 0, be = s.modelScene.children; me < be.length; me++) {
|
|
27114
|
-
var
|
|
27115
|
-
|
|
27213
|
+
var Te = be[me];
|
|
27214
|
+
Te instanceof Model && Te.show();
|
|
27116
27215
|
}
|
|
27117
|
-
var
|
|
27216
|
+
var le = __assign(__assign({}, e), { mode: s.mode, longitude: s.camera.pose.longitude, latitude: s.camera.pose.latitude, fov: s.camera.pose.fov, offset: s.camera.pose.offset.clone(), distance: 0 });
|
|
27118
27217
|
s.emit("pano.arrived", createEvent("pano.arrived", {
|
|
27119
27218
|
options: o,
|
|
27120
27219
|
prevPano: q,
|
|
27121
27220
|
progress: 1,
|
|
27122
|
-
state:
|
|
27221
|
+
state: le,
|
|
27123
27222
|
userAction: s.userAction,
|
|
27124
27223
|
error: null
|
|
27125
|
-
})), o.moveEndCallback && o.moveEndCallback(
|
|
27126
|
-
var
|
|
27127
|
-
if (
|
|
27128
|
-
var
|
|
27224
|
+
})), o.moveEndCallback && o.moveEndCallback(le);
|
|
27225
|
+
var de = s.works.getObserver(s.currentPano);
|
|
27226
|
+
if (de && de.video && s.videoTexture && s.videoTexture.image instanceof HTMLVideoElement) {
|
|
27227
|
+
var re = {
|
|
27129
27228
|
map: s.videoTexture,
|
|
27130
|
-
size:
|
|
27131
|
-
matrix:
|
|
27132
|
-
panoMatrix:
|
|
27229
|
+
size: de.video.size.clone(),
|
|
27230
|
+
matrix: de.video.matrix.clone(),
|
|
27231
|
+
panoMatrix: de.matrix.clone().premultiply(de.work.transform),
|
|
27133
27232
|
alpha: 1
|
|
27134
|
-
},
|
|
27135
|
-
|
|
27136
|
-
|
|
27137
|
-
|
|
27138
|
-
},
|
|
27139
|
-
|
|
27140
|
-
},
|
|
27233
|
+
}, ue = createUuid(), ve = s.videoTexture.image;
|
|
27234
|
+
ve.setAttribute("uuid", ue), canplayVideo().then(function(ye) {
|
|
27235
|
+
ye && de.video && ve.getAttribute("uuid") === ue && (ve.oncanplay = function() {
|
|
27236
|
+
ve.oncanplay = noop, ve.play();
|
|
27237
|
+
}, ve.ontimeupdate = function() {
|
|
27238
|
+
ve.currentTime > 0.5 && (ve.ontimeupdate = noop, s.panoVideo.setMaterial(re));
|
|
27239
|
+
}, ve.src = de.video.source);
|
|
27141
27240
|
}).catch((function() {
|
|
27142
|
-
|
|
27241
|
+
ve.removeAttribute("uuid");
|
|
27143
27242
|
}));
|
|
27144
27243
|
}
|
|
27145
27244
|
},
|
|
@@ -27261,29 +27360,29 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
|
|
|
27261
27360
|
mapSize: E.pano0.mapSize,
|
|
27262
27361
|
zoom: E.pano0.zoom,
|
|
27263
27362
|
matrix: w.leftPanoPicture.matrix.clone().setPosition(C.position)
|
|
27264
|
-
},
|
|
27265
|
-
|
|
27363
|
+
}, J = this.panoPictureObserverMap.get(E.pano0);
|
|
27364
|
+
J && this.panoPictureObserverMap.set(D, J), E.pano0 = D;
|
|
27266
27365
|
}
|
|
27267
27366
|
L.copy(O), M = !0;
|
|
27268
27367
|
}
|
|
27269
27368
|
v.distance = this.locationMotion.value.distance, v.offset = new THREE.Vector3(L.x + (O.x - L.x) * k, L.y + (O.y - L.y) * k, L.z + (O.z - L.z) * k);
|
|
27270
|
-
for (var
|
|
27271
|
-
var
|
|
27272
|
-
|
|
27369
|
+
for (var G = [], U = [], z = 0, q = this.locationMotion.keyframes; z < q.length; z++) {
|
|
27370
|
+
var j = q[z], K = j.key, Y = j.progress;
|
|
27371
|
+
K !== void 0 && (G.push(K), Y > this.locationMotion.progress && U.push(K));
|
|
27273
27372
|
}
|
|
27274
|
-
for (var
|
|
27275
|
-
var W =
|
|
27373
|
+
for (var X = 0, Q = Object.keys(this.panoResources); X < Q.length; X++) {
|
|
27374
|
+
var W = Q[X];
|
|
27276
27375
|
if (!(U.indexOf(W) >= 0)) {
|
|
27277
27376
|
var $ = this.panoResources[W];
|
|
27278
27377
|
if ($.leftPanoPicture) {
|
|
27279
|
-
var
|
|
27280
|
-
if (
|
|
27281
|
-
if (
|
|
27378
|
+
var ae = $.leftPanoPicture.map;
|
|
27379
|
+
if (ae) {
|
|
27380
|
+
if (ae === ((s = E.pano0) === null || s === void 0 ? void 0 : s.map) || ae === ((u = E.pano1) === null || u === void 0 ? void 0 : u.map))
|
|
27282
27381
|
continue;
|
|
27283
|
-
|
|
27382
|
+
ae.dispose(), $.leftPanoPicture = null;
|
|
27284
27383
|
}
|
|
27285
27384
|
}
|
|
27286
|
-
|
|
27385
|
+
G.indexOf(W) >= 0 || delete this.panoResources[W];
|
|
27287
27386
|
}
|
|
27288
27387
|
}
|
|
27289
27388
|
var ee = panoParse(C.panoId);
|
|
@@ -27297,38 +27396,38 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
|
|
|
27297
27396
|
}));
|
|
27298
27397
|
}
|
|
27299
27398
|
this.camera.setFromPose(v), this.xrManager.cameraVR.projectionMatrix.copy(this.camera.projectionMatrix), this.xrManager.cameraVR.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse), this.xrManager.cameraVR.matrix.copy(this.camera.matrix), this.xrManager.cameraVR.position.copy(this.camera.position), this.xrManager.cameraVR.quaternion.copy(this.camera.quaternion), this.xrManager.cameraVR.scale.copy(this.camera.scale), this.xrManager.cameraVR.matrixAutoUpdate = !1, this.xrManager.cameraVR.matrixWorld.copy(this.camera.matrixWorld);
|
|
27300
|
-
var ne = g, te = ne[1],
|
|
27399
|
+
var ne = g, te = ne[1], fe = new THREE.Vector3(0, 0, 0), oe = new THREE.Vector2().copy(this.camera.resolution);
|
|
27301
27400
|
if (te && this.xrManager.session && this.xrManager.referenceSpace && this.xrManager.session.renderState.baseLayer) {
|
|
27302
|
-
var
|
|
27401
|
+
var he = this.xrManager.cameraVR, me = this.xrManager.referenceSpace, be = this.xrManager.session.renderState.baseLayer, Te = te.getViewerPose(me), le = (l = Te == null ? void 0 : Te.views) !== null && l !== void 0 ? l : [];
|
|
27303
27402
|
this.renderer.setFramebuffer(be.framebuffer);
|
|
27304
|
-
for (var
|
|
27305
|
-
var
|
|
27306
|
-
|
|
27403
|
+
for (var de = 0; de < le.length; de++) {
|
|
27404
|
+
var re = le[de], ue = he.cameras[de], ve = be.getViewport(re);
|
|
27405
|
+
ve && (ue.projectionMatrix.fromArray(re.projectionMatrix), ue.projectionMatrixInverse.getInverse(ue.projectionMatrix), ue.matrix.fromArray(re.transform.matrix), ue.matrix.setPosition(this.camera.position), ue.matrix.decompose(ue.position, ue.quaternion, ue.scale), ue.matrixWorld.copy(ue.matrix), ue.matrixWorldInverse.getInverse(ue.matrixWorld), ue.matrixAutoUpdate = !1, fe.copy(ue.position), ue.viewport.set(ve.x, ve.y, ve.width, ve.height), oe.set(ve.width, ve.height));
|
|
27307
27406
|
}
|
|
27308
27407
|
if (this.xrManager.setProjectionFromUnion(this.xrManager.cameraVR, this.xrManager.cameraL, this.xrManager.cameraR), this.camera.quaternion.copy(this.xrManager.cameraVR.quaternion), this.camera.scale.copy(this.xrManager.cameraVR.scale), this.camera.matrix.compose(this.camera.position, this.camera.quaternion, this.camera.scale), this.camera.computePose((c = v.distance) !== null && c !== void 0 ? c : this.camera.pose.distance), this.xrManager.session && this.xrManager.session.inputSources) {
|
|
27309
|
-
for (var
|
|
27310
|
-
if (this.xrManager.session.inputSources[
|
|
27311
|
-
var
|
|
27312
|
-
if (
|
|
27313
|
-
var
|
|
27314
|
-
this.gazeRay =
|
|
27408
|
+
for (var de = 0; de < this.xrManager.session.inputSources.length; de++)
|
|
27409
|
+
if (this.xrManager.session.inputSources[de] && this.xrManager.session.inputSources[de].targetRayMode === "transient-pointer") {
|
|
27410
|
+
var ye = te.getPose(this.xrManager.session.inputSources[de].targetRaySpace, me);
|
|
27411
|
+
if (ye) {
|
|
27412
|
+
var De = ye.transform.orientation, Je = new THREE.Quaternion(De.x, De.y, De.z, De.w), $e = new THREE.Vector3(0, 0, -1).applyQuaternion(Je), Ue = new THREE.Raycaster(this.camera.position, $e);
|
|
27413
|
+
this.gazeRay = Ue;
|
|
27315
27414
|
}
|
|
27316
27415
|
}
|
|
27317
27416
|
}
|
|
27318
27417
|
if (this.xrManager.machineType === "Oculus" || this.xrManager.machineType === "Pico") {
|
|
27319
|
-
for (var
|
|
27320
|
-
var Re = Ee.xrManager.controllers[
|
|
27418
|
+
for (var pe = this.xrManager.session.inputSources, Ye = function(ce) {
|
|
27419
|
+
var Re = Ee.xrManager.controllers[ce], Me = pe[ce];
|
|
27321
27420
|
if (!Me)
|
|
27322
27421
|
return "continue";
|
|
27323
27422
|
Re && Re.update(Me, te, me);
|
|
27324
|
-
var He = Ee.xrManager.getController(
|
|
27325
|
-
Me.handedness === "left" ? Ee.xrControllerRay.left.set(Xe, new THREE.Vector3(0, 0, -1).applyEuler(He.rotation)) : Me.handedness === "right" && Ee.xrControllerRay.right.set(Xe, new THREE.Vector3(0, 0, -1).applyEuler(He.rotation)), Ee.controllerWrappers[
|
|
27423
|
+
var He = Ee.xrManager.getController(ce), xt = new THREE.Vector3(0, 1.2, 0), Xe = He.position.clone().add(fe).sub(xt);
|
|
27424
|
+
Me.handedness === "left" ? Ee.xrControllerRay.left.set(Xe, new THREE.Vector3(0, 0, -1).applyEuler(He.rotation)) : Me.handedness === "right" && Ee.xrControllerRay.right.set(Xe, new THREE.Vector3(0, 0, -1).applyEuler(He.rotation)), Ee.controllerWrappers[ce].position.copy(new THREE.Vector3(0, 0, 0).add(fe).sub(xt));
|
|
27326
27425
|
var st = Ee.modelScene.intersectRaycaster(Ee.xrControllerRay.right);
|
|
27327
27426
|
if (st.length === 0) {
|
|
27328
27427
|
var Ht = Ee.works.getResolvedObserver(Ee.currentPano);
|
|
27329
|
-
st = Ee.xrControllerRay.right.intersectObject(Ee.boundingMesh, !0).map(function(
|
|
27330
|
-
var ge,
|
|
27331
|
-
return __assign({ floorIndex:
|
|
27428
|
+
st = Ee.xrControllerRay.right.intersectObject(Ee.boundingMesh, !0).map(function(ie) {
|
|
27429
|
+
var ge, Ne = (ge = Ht == null ? void 0 : Ht.floorIndex) !== null && ge !== void 0 ? ge : 0;
|
|
27430
|
+
return __assign({ floorIndex: Ne, floor: Ne }, ie);
|
|
27332
27431
|
});
|
|
27333
27432
|
}
|
|
27334
27433
|
if (st.length >= 1 && st[0].face)
|
|
@@ -27341,21 +27440,21 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
|
|
|
27341
27440
|
Ee.intersectMesh.rotation.z = -Math.atan2(N.z, N.x);
|
|
27342
27441
|
}
|
|
27343
27442
|
Ee.intersectMesh.visible = !0, Ee.needsRender = !0, _t.length > 0 ? (Ee.pointerLines.right.setPoints(Xe, _t[0].point), Ee.pointerLines.right.points.visible = !0, Ee.intersectMesh.visible = !1) : (Ee.pointerLines.right.points.visible = !1, Ee.pointerLines.right.setPoints(Xe, st[0].point));
|
|
27344
|
-
var
|
|
27443
|
+
var V = st[0], Z = createEvent("intersect.update", {
|
|
27345
27444
|
raycaster: (d = Ee.xrControllerRay.right) !== null && d !== void 0 ? d : null,
|
|
27346
|
-
intersection:
|
|
27445
|
+
intersection: V != null ? V : null,
|
|
27347
27446
|
object: Ee.intersectMesh
|
|
27348
27447
|
});
|
|
27349
27448
|
if (Ee.emit("intersect.update", Z), Z.defaultPrevented)
|
|
27350
27449
|
return Ee.hideIntersectMesh(), { value: void 0 };
|
|
27351
27450
|
} else
|
|
27352
27451
|
Ee.pointerLines.left.setPoints(Xe, st[0].point);
|
|
27353
|
-
}, Ee = this,
|
|
27354
|
-
var Oe =
|
|
27452
|
+
}, Ee = this, de = 0; de < pe.length; de++) {
|
|
27453
|
+
var Oe = Ye(de);
|
|
27355
27454
|
if (typeof Oe == "object")
|
|
27356
27455
|
return Oe.value;
|
|
27357
27456
|
}
|
|
27358
|
-
this.updateControllerHelper(
|
|
27457
|
+
this.updateControllerHelper(pe, e, r);
|
|
27359
27458
|
}
|
|
27360
27459
|
} else
|
|
27361
27460
|
te || console.error("xrFrame丢失,请重试"), this.xrManager.session || console.error("session丢失,请重试"), this.xrManager.session && !this.xrManager.session.renderState.baseLayer && console.error("no layer found");
|
|
@@ -27363,123 +27462,123 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
|
|
|
27363
27462
|
userAction: this.userAction,
|
|
27364
27463
|
state: __assign(__assign(__assign({}, this.currentPano), { mode: this.mode }), clonePose(this.camera.pose))
|
|
27365
27464
|
}));
|
|
27366
|
-
var Fe = this.works.getResolvedObserver(this.currentPano), tt = this.locationMotion.ended ? this.getForwardObserverOrNot(this.xrManager.cameraVR) : null, rt = this.works.getObserver(w.panoId),
|
|
27465
|
+
var Fe = this.works.getResolvedObserver(this.currentPano), tt = this.locationMotion.ended ? this.getForwardObserverOrNot(this.xrManager.cameraVR) : null, rt = this.works.getObserver(w.panoId), Le = this.works.getObserver(C.panoId);
|
|
27367
27466
|
if (this.adjustPanoCircleMeshPositionBasedOnModel && this.helper.visible && Fe) {
|
|
27368
27467
|
for (var Pe = [], _e = Fe.work.observers, Ae = 0, Ce = Fe.accessibleNodes; Ae < Ce.length; Ae++) {
|
|
27369
|
-
var Be = Ce[Ae],
|
|
27370
|
-
|
|
27468
|
+
var Be = Ce[Ae], J = _e[Be];
|
|
27469
|
+
J && Pe.push(J);
|
|
27371
27470
|
}
|
|
27372
27471
|
var je = /* @__PURE__ */ new Map();
|
|
27373
|
-
if (Pe.sort(function(
|
|
27374
|
-
var Me = je.get(
|
|
27375
|
-
typeof Me == "undefined" && (Me =
|
|
27376
|
-
var He = je.get(
|
|
27472
|
+
if (Pe.sort(function(ce, Re) {
|
|
27473
|
+
var Me = je.get(ce);
|
|
27474
|
+
typeof Me == "undefined" && (Me = ce.standingPosition.distanceTo(Fe.standingPosition), je.set(ce, Me));
|
|
27475
|
+
var He = je.get(ce);
|
|
27377
27476
|
return typeof He == "undefined" && (He = Re.standingPosition.distanceTo(Fe.standingPosition), je.set(Re, He)), Me - He;
|
|
27378
27477
|
}), Pe.length) {
|
|
27379
27478
|
this.accessibleObserverFloorCheckCount = this.accessibleObserverFloorCheckCount % Pe.length;
|
|
27380
|
-
var Ve = Pe[this.accessibleObserverFloorCheckCount],
|
|
27381
|
-
return
|
|
27479
|
+
var Ve = Pe[this.accessibleObserverFloorCheckCount], Ze = this.modelScene.models.find(function(ce) {
|
|
27480
|
+
return ce.work === (Ve == null ? void 0 : Ve.work);
|
|
27382
27481
|
});
|
|
27383
|
-
if (Ve &&
|
|
27384
|
-
var At = 0.3, Qe = 0.05, gt = 5e-3, we = Ve.standingPosition.clone().applyMatrix4(Ve.work.transform),
|
|
27482
|
+
if (Ve && Ze && Ze.visible) {
|
|
27483
|
+
var At = 0.3, Qe = 0.05, gt = 5e-3, we = Ve.standingPosition.clone().applyMatrix4(Ve.work.transform), qe = panoStringify({
|
|
27385
27484
|
panoIndex: Ve.panoIndex,
|
|
27386
27485
|
workCode: Ve.work.workCode
|
|
27387
|
-
}), dt = adjustPanoCircleMeshVectors.map(function(
|
|
27388
|
-
scratchRaycaster.ray.origin.copy(we), scratchRaycaster.ray.origin.add(scratchVector3.copy(
|
|
27389
|
-
var Re =
|
|
27486
|
+
}), dt = adjustPanoCircleMeshVectors.map(function(ce) {
|
|
27487
|
+
scratchRaycaster.ray.origin.copy(we), scratchRaycaster.ray.origin.add(scratchVector3.copy(ce).setY(At)), scratchRaycaster.ray.direction.set(0, -1, 0), scratchRaycaster.firstHitOnly = !0, scratchRaycaster.floorIndex = -1;
|
|
27488
|
+
var Re = Ze.intersectRaycaster(scratchRaycaster)[0];
|
|
27390
27489
|
return Re && Re.distance - gt <= At ? new THREE.Vector3().copy(we).setY(Re.point.y + gt) : we;
|
|
27391
27490
|
});
|
|
27392
|
-
dt.sort(function(
|
|
27393
|
-
return Re.y -
|
|
27491
|
+
dt.sort(function(ce, Re) {
|
|
27492
|
+
return Re.y - ce.y;
|
|
27394
27493
|
});
|
|
27395
|
-
var ht = dt[Math.floor(dt.length / 2)], Ge = dt.filter(function(
|
|
27396
|
-
return
|
|
27494
|
+
var ht = dt[Math.floor(dt.length / 2)], Ge = dt.filter(function(ce) {
|
|
27495
|
+
return ce.distanceTo(ht) <= Qe;
|
|
27397
27496
|
})[0];
|
|
27398
27497
|
if (Ge) {
|
|
27399
|
-
var nt = new THREE.Vector4(we.x, we.y, we.z, Ge.y - we.y), ct = this.adjustPanoCircleMeshPositionFix.get(
|
|
27400
|
-
ct && !nt.equals(ct) && (this.needsRender = !0), this.adjustPanoCircleMeshPositionFix.set(
|
|
27498
|
+
var nt = new THREE.Vector4(we.x, we.y, we.z, Ge.y - we.y), ct = this.adjustPanoCircleMeshPositionFix.get(qe);
|
|
27499
|
+
ct && !nt.equals(ct) && (this.needsRender = !0), this.adjustPanoCircleMeshPositionFix.set(qe, nt);
|
|
27401
27500
|
}
|
|
27402
27501
|
}
|
|
27403
27502
|
this.accessibleObserverFloorCheckCount++;
|
|
27404
27503
|
}
|
|
27405
27504
|
}
|
|
27406
|
-
var
|
|
27505
|
+
var se = /* @__PURE__ */ new Map();
|
|
27407
27506
|
if (rt)
|
|
27408
|
-
for (var
|
|
27409
|
-
var Be = Ie[
|
|
27410
|
-
if (
|
|
27411
|
-
var
|
|
27412
|
-
panoIndex:
|
|
27413
|
-
workCode:
|
|
27507
|
+
for (var xe = 0, Ie = rt.accessibleNodes; xe < Ie.length; xe++) {
|
|
27508
|
+
var Be = Ie[xe], J = rt.work.observers[Be];
|
|
27509
|
+
if (J) {
|
|
27510
|
+
var qe = panoStringify({
|
|
27511
|
+
panoIndex: J.panoIndex,
|
|
27512
|
+
workCode: J.work.workCode
|
|
27414
27513
|
});
|
|
27415
|
-
|
|
27514
|
+
se.set(qe, J);
|
|
27416
27515
|
}
|
|
27417
27516
|
}
|
|
27418
|
-
if (
|
|
27419
|
-
for (var Se = 0,
|
|
27420
|
-
var Be =
|
|
27421
|
-
if (
|
|
27422
|
-
var
|
|
27423
|
-
panoIndex:
|
|
27424
|
-
workCode:
|
|
27517
|
+
if (Le)
|
|
27518
|
+
for (var Se = 0, ze = Le.accessibleNodes; Se < ze.length; Se++) {
|
|
27519
|
+
var Be = ze[Se], J = Le.work.observers[Be];
|
|
27520
|
+
if (J) {
|
|
27521
|
+
var qe = panoStringify({
|
|
27522
|
+
panoIndex: J.panoIndex,
|
|
27523
|
+
workCode: J.work.workCode
|
|
27425
27524
|
});
|
|
27426
|
-
|
|
27525
|
+
se.set(qe, J);
|
|
27427
27526
|
}
|
|
27428
27527
|
}
|
|
27429
|
-
if (this.panoMeshes.forEach(function(
|
|
27430
|
-
var Me =
|
|
27528
|
+
if (this.panoMeshes.forEach(function(ce, Re) {
|
|
27529
|
+
var Me = se.get(Re);
|
|
27431
27530
|
if (Me) {
|
|
27432
|
-
|
|
27531
|
+
ce.position.copy(Me.standingPosition).applyMatrix4(Me.work.transform);
|
|
27433
27532
|
var He = o.adjustPanoCircleMeshPositionFix.get(Re);
|
|
27434
|
-
He && (scratchVector3.set(He.x, He.y, He.z), scratchVector3.equals(
|
|
27533
|
+
He && (scratchVector3.set(He.x, He.y, He.z), scratchVector3.equals(ce.position) && (ce.position.y += He.w)), ce.scale.setScalar(1.2), se.delete(Re);
|
|
27435
27534
|
} else
|
|
27436
|
-
o.helper.remove(
|
|
27437
|
-
}),
|
|
27535
|
+
o.helper.remove(ce), ce.dispose(), o.panoMeshes.delete(Re);
|
|
27536
|
+
}), se.forEach(function(ce, Re) {
|
|
27438
27537
|
var Me = o.panoCircleMeshCreator(panoParse(Re));
|
|
27439
|
-
Me.position.copy(
|
|
27538
|
+
Me.position.copy(ce.standingPosition).applyMatrix4(ce.work.transform);
|
|
27440
27539
|
var He = o.adjustPanoCircleMeshPositionFix.get(Re);
|
|
27441
|
-
He && (scratchVector3.set(He.x, He.y, He.z), scratchVector3.equals(Me.position) && (Me.position.y += He.w)), Me.scale.setScalar(1.2), o.panoMeshes.set(Re, Me), o.helper.add(Me),
|
|
27540
|
+
He && (scratchVector3.set(He.x, He.y, He.z), scratchVector3.equals(Me.position) && (Me.position.y += He.w)), Me.scale.setScalar(1.2), o.panoMeshes.set(Re, Me), o.helper.add(Me), se.delete(Re);
|
|
27442
27541
|
}), this.camera.pose.distance > 0.1 || M)
|
|
27443
|
-
this.panoMeshes.forEach(function(
|
|
27444
|
-
|
|
27542
|
+
this.panoMeshes.forEach(function(ce) {
|
|
27543
|
+
ce.setOpacity(0), ce.setCurrent(!1), ce.updateTime && ce.updateTime(e, r), ce.visible = !1;
|
|
27445
27544
|
});
|
|
27446
27545
|
else if (Fe) {
|
|
27447
|
-
var it = Fe.work.observers, yt = arrayMin(Fe.accessibleNodes, function(
|
|
27448
|
-
var Re = it[
|
|
27546
|
+
var it = Fe.work.observers, yt = arrayMin(Fe.accessibleNodes, function(ce) {
|
|
27547
|
+
var Re = it[ce];
|
|
27449
27548
|
return Re ? Fe.standingPosition.distanceTo(Re.standingPosition) : 1 / 0;
|
|
27450
27549
|
}, !0), pt = yt[1];
|
|
27451
27550
|
pt = clamp$1(pt, 2.5, 1 / 0);
|
|
27452
|
-
var Mt = Fe.visibleNodes.concat(Fe.panoIndex).map(function(
|
|
27453
|
-
return panoStringify({ panoIndex:
|
|
27551
|
+
var Mt = Fe.visibleNodes.concat(Fe.panoIndex).map(function(ce) {
|
|
27552
|
+
return panoStringify({ panoIndex: ce, workCode: Fe.work.workCode });
|
|
27454
27553
|
}), It = this.camera.getDirection(new THREE.Vector3());
|
|
27455
|
-
this.panoMeshes.forEach(function(
|
|
27554
|
+
this.panoMeshes.forEach(function(ce, Re) {
|
|
27456
27555
|
var Me = o.works.getObserver(Re);
|
|
27457
27556
|
if (Mt.indexOf(Re) === -1)
|
|
27458
|
-
|
|
27557
|
+
ce.setCurrent(!1), ce.setOpacity(0);
|
|
27459
27558
|
else if (!Me)
|
|
27460
|
-
|
|
27559
|
+
ce.setCurrent(!1), ce.setOpacity(0);
|
|
27461
27560
|
else if (!Me.loadable && !Me.active)
|
|
27462
|
-
|
|
27561
|
+
ce.setCurrent(!1), ce.setOpacity(0);
|
|
27463
27562
|
else {
|
|
27464
|
-
var He =
|
|
27465
|
-
|
|
27466
|
-
var xt = o.camera.position.clone().setY(
|
|
27563
|
+
var He = ce.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);
|
|
27564
|
+
ce.setCurrent(!ce.loading && ce.progress === 0 && tt !== null && panoStringify({ panoIndex: tt.panoIndex, workCode: tt.work.workCode }) === Re), ce.setOpacity(He < 0.01 ? 0 : clamp$1(pt / He * 1.2, 0.65, 0.98));
|
|
27565
|
+
var xt = o.camera.position.clone().setY(ce.position.y), Xe = new THREE.Vector3().copy(ce.position).sub(xt).normalize();
|
|
27467
27566
|
if (Re === panoStringify(o.currentPano)) {
|
|
27468
|
-
var st = clamp$1((0.5 - xt.distanceTo(
|
|
27567
|
+
var st = clamp$1((0.5 - xt.distanceTo(ce.position)) / 0.5, 0, 1);
|
|
27469
27568
|
Xe.multiplyScalar(1 - st).add(It.clone().multiplyScalar(st));
|
|
27470
27569
|
}
|
|
27471
|
-
Xe.length() > 0 &&
|
|
27570
|
+
Xe.length() > 0 && ce.quaternion.setFromEuler(new THREE.Euler(0, Math.atan2(Xe.x, Xe.z), 0));
|
|
27472
27571
|
}
|
|
27473
|
-
|
|
27572
|
+
ce.updateTime && ce.updateTime(e, r);
|
|
27474
27573
|
});
|
|
27475
27574
|
}
|
|
27476
27575
|
{
|
|
27477
|
-
var k = (f = this.modelScene.parameter.progress) !== null && f !== void 0 ? f : 1, Pt = Math.round(k), at = this.modelScene.parameter.pano0, ft = this.modelScene.parameter.pano1, Et = Pt === 0 ? at : ft,
|
|
27478
|
-
if (Et && (
|
|
27576
|
+
var k = (f = this.modelScene.parameter.progress) !== null && f !== void 0 ? f : 1, Pt = Math.round(k), at = this.modelScene.parameter.pano0, ft = this.modelScene.parameter.pano1, Et = Pt === 0 ? at : ft, J = void 0;
|
|
27577
|
+
if (Et && (J = this.works.getObserver(Et.panoId), J || (J = this.panoPictureObserverMap.get(Et))), this.tiling.appearDuration = this.tileAppearDuration, this.tiling.maxRequest = k <= 0.6 ? 0 : this.tileMaxRequest, this.tiling.imageOptions = this.imageOptions, !J || !Et || this.tileLevelForFov === !1) {
|
|
27479
27578
|
this.tiling.setObserver(null);
|
|
27480
27579
|
var wt = {
|
|
27481
27580
|
renderer: this.renderer,
|
|
27482
|
-
resolution:
|
|
27581
|
+
resolution: oe,
|
|
27483
27582
|
pixelRatio: 1,
|
|
27484
27583
|
time: this.camera.time,
|
|
27485
27584
|
cameraMatrix: this.xrManager.cameraVR.matrixWorld,
|
|
@@ -27493,10 +27592,10 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
|
|
|
27493
27592
|
this.tiling.update(wt), this.modelScene.parameter.set("refinedScreen", null);
|
|
27494
27593
|
} else {
|
|
27495
27594
|
var ot = getImageSizeLevel(Et.mapSize), Ct = ot + 1, bt = 4;
|
|
27496
|
-
this.tiling.setObserver(
|
|
27595
|
+
this.tiling.setObserver(J);
|
|
27497
27596
|
var wt = {
|
|
27498
27597
|
renderer: this.renderer,
|
|
27499
|
-
resolution:
|
|
27598
|
+
resolution: oe,
|
|
27500
27599
|
pixelRatio: 1,
|
|
27501
27600
|
time: this.camera.time,
|
|
27502
27601
|
cameraMatrix: this.xrManager.cameraVR.matrixWorld,
|
|
@@ -28777,7 +28876,7 @@ void main() {
|
|
|
28777
28876
|
}
|
|
28778
28877
|
return Object.defineProperty(t, "version", {
|
|
28779
28878
|
get: function() {
|
|
28780
|
-
return "6.6.0-alpha.
|
|
28879
|
+
return "6.6.0-alpha.5";
|
|
28781
28880
|
},
|
|
28782
28881
|
enumerable: !1,
|
|
28783
28882
|
configurable: !0
|
|
@@ -29006,16 +29105,16 @@ void main() {
|
|
|
29006
29105
|
}
|
|
29007
29106
|
else
|
|
29008
29107
|
e instanceof Work ? y.push(e) : y.push(parseWork(e));
|
|
29009
|
-
for (var R = createWorks(y), w = function(
|
|
29108
|
+
for (var R = createWorks(y), w = function(Q) {
|
|
29010
29109
|
var W = C, $ = new Fetcher({
|
|
29011
29110
|
get networkSubscribe() {
|
|
29012
29111
|
return W.networkSubscribe;
|
|
29013
29112
|
},
|
|
29014
|
-
requestProxy: function(
|
|
29015
|
-
return Promise.resolve(
|
|
29113
|
+
requestProxy: function(ae) {
|
|
29114
|
+
return Promise.resolve(ae).then(function(ee) {
|
|
29016
29115
|
return W.requestProxy(ee);
|
|
29017
29116
|
}).then(function(ee) {
|
|
29018
|
-
return verifyURL(ee,
|
|
29117
|
+
return verifyURL(ee, Q.allowHosts);
|
|
29019
29118
|
}).then(function(ee) {
|
|
29020
29119
|
if (ee instanceof Error)
|
|
29021
29120
|
throw ee;
|
|
@@ -29023,7 +29122,7 @@ void main() {
|
|
|
29023
29122
|
});
|
|
29024
29123
|
}
|
|
29025
29124
|
});
|
|
29026
|
-
registerFetcher(
|
|
29125
|
+
registerFetcher(Q, $);
|
|
29027
29126
|
}, C = this, I = 0, H = R; I < H.length; I++) {
|
|
29028
29127
|
var M = H[I];
|
|
29029
29128
|
w(M);
|
|
@@ -29082,38 +29181,38 @@ void main() {
|
|
|
29082
29181
|
offset: r.offset
|
|
29083
29182
|
};
|
|
29084
29183
|
}
|
|
29085
|
-
var
|
|
29184
|
+
var J = __assign(__assign(__assign({}, L), { mode: O }), k), G = this.getCurrentState(), U = (g = v.duration) !== null && g !== void 0 ? g : this.modeChangeDuration;
|
|
29086
29185
|
(O === "Floorplan" || O === "Topview" || O === "Mapview") && this.currentMode === O && (U = 0);
|
|
29087
29186
|
var z = "fly";
|
|
29088
29187
|
(O === "Panorama" || O === "VRPanorama" || O === "XRPanorama") && this.currentMode === O && (z = (m = v.effect) !== null && m !== void 0 ? m : "fade"), this.emit("works.request", createEvent("works.request", {
|
|
29089
29188
|
input: e,
|
|
29090
29189
|
works: R,
|
|
29091
|
-
state:
|
|
29190
|
+
state: J,
|
|
29092
29191
|
userAction: s
|
|
29093
29192
|
}));
|
|
29094
29193
|
var q = function() {
|
|
29095
29194
|
u.pano = L;
|
|
29096
|
-
var
|
|
29097
|
-
state:
|
|
29098
|
-
currentState:
|
|
29195
|
+
var Q = __assign(__assign({ initial: {
|
|
29196
|
+
state: J,
|
|
29197
|
+
currentState: G,
|
|
29099
29198
|
duration: U,
|
|
29100
29199
|
effect: z,
|
|
29101
29200
|
userAction: s
|
|
29102
|
-
} }, u.commonParams()), u.controllerInits[O]), W = Controllers[O].initAnimationEndState(
|
|
29201
|
+
} }, u.commonParams()), u.controllerInits[O]), W = Controllers[O].initAnimationEndState(Q);
|
|
29103
29202
|
if (u.controller && u.currentMode === O)
|
|
29104
|
-
u.controller.updateWork(R, W, { effect: z, duration: U }, s) === !1 && (u.controller.destroy(), u.controller = u.applyController(O,
|
|
29203
|
+
u.controller.updateWork(R, W, { effect: z, duration: U }, s) === !1 && (u.controller.destroy(), u.controller = u.applyController(O, Q));
|
|
29105
29204
|
else {
|
|
29106
29205
|
var $ = u.currentMode;
|
|
29107
29206
|
if (u.controller)
|
|
29108
29207
|
u.controller.destroy();
|
|
29109
29208
|
else {
|
|
29110
|
-
var
|
|
29111
|
-
u.camera.setFromPose(
|
|
29209
|
+
var ae = Controllers[O].initAnimationEndState(Q);
|
|
29210
|
+
u.camera.setFromPose(ae), u.emit("camera.update", createEvent("camera.update", {
|
|
29112
29211
|
state: u.getCurrentState(),
|
|
29113
29212
|
userAction: s
|
|
29114
29213
|
}));
|
|
29115
29214
|
}
|
|
29116
|
-
u.controller = u.applyController(O,
|
|
29215
|
+
u.controller = u.applyController(O, Q);
|
|
29117
29216
|
var ee = createEvent("mode.change", {
|
|
29118
29217
|
prevMode: $,
|
|
29119
29218
|
mode: O,
|
|
@@ -29129,12 +29228,12 @@ void main() {
|
|
|
29129
29228
|
u.updateTime(u.currentUpdateArgs.time, 0, u.currentUpdateArgs.args);
|
|
29130
29229
|
};
|
|
29131
29230
|
worksMap.set(this, R);
|
|
29132
|
-
var
|
|
29231
|
+
var j = Promise.resolve();
|
|
29133
29232
|
if (O === t.Mode.Floorplan || O === t.Mode.Topview || O === t.Mode.Mapview || O === t.Mode.Model) {
|
|
29134
|
-
this.modelScene.loaded === !1 && (this.camera.setFromPose(
|
|
29135
|
-
var
|
|
29136
|
-
|
|
29137
|
-
return
|
|
29233
|
+
this.modelScene.loaded === !1 && (this.camera.setFromPose(J), assignPose(this.state, this.camera.pose)), this.controller || (this.currentMode = O);
|
|
29234
|
+
var K = this.loadModels(R, v);
|
|
29235
|
+
j = Promise.all(K.map(function(Q) {
|
|
29236
|
+
return Q.loadedReady;
|
|
29138
29237
|
})).then(function() {
|
|
29139
29238
|
u.needsRender = !0, u.modelSceneNeedsRender = !0, q(), u.emit("camera.update", createEvent("camera.update", {
|
|
29140
29239
|
state: u.getCurrentState(),
|
|
@@ -29143,33 +29242,33 @@ void main() {
|
|
|
29143
29242
|
});
|
|
29144
29243
|
} else {
|
|
29145
29244
|
q();
|
|
29146
|
-
var
|
|
29245
|
+
var Y = !1;
|
|
29147
29246
|
this.modelScene.autoRefine = !1;
|
|
29148
|
-
var
|
|
29149
|
-
u.works === R &&
|
|
29247
|
+
var X = function() {
|
|
29248
|
+
u.works === R && Y === !1 && (u.needsRender = !0, u.modelSceneNeedsRender = !0, u.emit("camera.update", createEvent("camera.update", {
|
|
29150
29249
|
state: u.getCurrentState(),
|
|
29151
29250
|
userAction: s
|
|
29152
|
-
})),
|
|
29153
|
-
},
|
|
29154
|
-
|
|
29251
|
+
})), Y = !0, u.modelScene.autoRefine = !0);
|
|
29252
|
+
}, K = this.loadModels(R, v);
|
|
29253
|
+
j = Promise.all(K.map(function(W) {
|
|
29155
29254
|
return W.initReady;
|
|
29156
|
-
})).then(noop), this.controller.once("pano.arrived",
|
|
29255
|
+
})).then(noop), this.controller.once("pano.arrived", X), this.controller.once("pano.cancel", X), setTimeout(X, ((E = v.duration) !== null && E !== void 0 ? E : this.modeChangeDuration) + 1e3);
|
|
29157
29256
|
}
|
|
29158
29257
|
return this.emit("works.load", createEvent("works.load", {
|
|
29159
29258
|
input: e,
|
|
29160
29259
|
state: this.getCurrentState(),
|
|
29161
29260
|
userAction: s,
|
|
29162
29261
|
works: R
|
|
29163
|
-
})),
|
|
29262
|
+
})), j.then(function() {
|
|
29164
29263
|
return u.ready();
|
|
29165
29264
|
}).then(function() {
|
|
29166
|
-
var
|
|
29265
|
+
var Q;
|
|
29167
29266
|
u.emit("works.ready", createEvent("works.ready", {
|
|
29168
29267
|
input: e,
|
|
29169
29268
|
state: u.getCurrentState(),
|
|
29170
29269
|
userAction: s,
|
|
29171
29270
|
works: R
|
|
29172
|
-
})), (
|
|
29271
|
+
})), (Q = u.analysis) === null || Q === void 0 || Q.work(R);
|
|
29173
29272
|
});
|
|
29174
29273
|
}, t.prototype.reset = function() {
|
|
29175
29274
|
var e = this, r = this.loadWorkTask.then(function() {
|