@maptalks/3dtiles 0.11.3 → 0.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/maptalks.3dtiles.js +678 -676
- package/package.json +1 -1
package/dist/maptalks.3dtiles.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @maptalks/3dtiles v0.11.
|
|
2
|
+
* @maptalks/3dtiles v0.11.4
|
|
3
3
|
* LICENSE : UNLICENSED
|
|
4
4
|
* (c) 2016-2022 maptalks.com
|
|
5
5
|
*/
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
t;
|
|
44
44
|
}
|
|
45
45
|
function r(t, e, n) {
|
|
46
|
-
var r = e[0], s = e[1], i = e[2], o = e[3], a = e[4], c = e[5], h = e[6], u = e[7], f = e[8], l = e[9], d = e[10], m = e[11], y = e[12], b = e[13], p = e[14], w = e[15],
|
|
47
|
-
return t[0] =
|
|
48
|
-
t[2] =
|
|
49
|
-
|
|
50
|
-
t[6] =
|
|
51
|
-
|
|
52
|
-
t[10] =
|
|
53
|
-
|
|
54
|
-
t[14] =
|
|
46
|
+
var r = e[0], s = e[1], i = e[2], o = e[3], a = e[4], c = e[5], h = e[6], u = e[7], f = e[8], l = e[9], d = e[10], m = e[11], y = e[12], b = e[13], p = e[14], w = e[15], _ = n[0], g = n[1], T = n[2], A = n[3];
|
|
47
|
+
return t[0] = _ * r + g * a + T * f + A * y, t[1] = _ * s + g * c + T * l + A * b,
|
|
48
|
+
t[2] = _ * i + g * h + T * d + A * p, t[3] = _ * o + g * u + T * m + A * w, _ = n[4],
|
|
49
|
+
g = n[5], T = n[6], A = n[7], t[4] = _ * r + g * a + T * f + A * y, t[5] = _ * s + g * c + T * l + A * b,
|
|
50
|
+
t[6] = _ * i + g * h + T * d + A * p, t[7] = _ * o + g * u + T * m + A * w, _ = n[8],
|
|
51
|
+
g = n[9], T = n[10], A = n[11], t[8] = _ * r + g * a + T * f + A * y, t[9] = _ * s + g * c + T * l + A * b,
|
|
52
|
+
t[10] = _ * i + g * h + T * d + A * p, t[11] = _ * o + g * u + T * m + A * w, _ = n[12],
|
|
53
|
+
g = n[13], T = n[14], A = n[15], t[12] = _ * r + g * a + T * f + A * y, t[13] = _ * s + g * c + T * l + A * b,
|
|
54
|
+
t[14] = _ * i + g * h + T * d + A * p, t[15] = _ * o + g * u + T * m + A * w, t;
|
|
55
55
|
}
|
|
56
56
|
function s() {
|
|
57
57
|
var t = new e(3);
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
var b = function(t, e, n) {
|
|
101
101
|
return t[0] = e[0] - n[0], t[1] = e[1] - n[1], t[2] = e[2] - n[2], t;
|
|
102
102
|
}, p = u, w = i;
|
|
103
|
-
function
|
|
103
|
+
function _(t, e, n, r, s) {
|
|
104
104
|
return t[0] = e, t[1] = n, t[2] = r, t[3] = s, t;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function g() {
|
|
107
107
|
var t = new e(4);
|
|
108
108
|
return e != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0), t[3] = 1, t;
|
|
109
109
|
}
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
var A, v = function(t, e) {
|
|
122
122
|
return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t;
|
|
123
123
|
};
|
|
124
|
-
s(), o(1, 0, 0), o(0, 1, 0),
|
|
124
|
+
s(), o(1, 0, 0), o(0, 1, 0), g(), g(), A = new e(9), e != Float32Array && (A[1] = 0,
|
|
125
125
|
A[2] = 0, A[3] = 0, A[5] = 0, A[6] = 0, A[7] = 0), A[0] = 1, A[4] = 1, A[8] = 1;
|
|
126
126
|
/*!
|
|
127
127
|
* @maptalks/gltf-loader v0.23.1
|
|
@@ -170,14 +170,14 @@
|
|
|
170
170
|
function N(t) {
|
|
171
171
|
return 0 === t.indexOf("data:") && t.indexOf("base64,") > 0;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function E(t) {
|
|
174
174
|
const e = function(t) {
|
|
175
175
|
return "undefined" != typeof self ? self.atob(t) : window.atob(t);
|
|
176
176
|
}(t.substring(t.indexOf(",") + 1)), n = e.length, r = new Uint8Array(n);
|
|
177
177
|
for (let t = 0; t < n; t++) r[t] = e.charCodeAt(t);
|
|
178
178
|
return r.buffer;
|
|
179
179
|
}
|
|
180
|
-
const
|
|
180
|
+
const P = [], C = [], U = [], B = [ 0, 0, 0 ], L = function(t) {
|
|
181
181
|
return t[0] = 0, t[1] = 0, t[2] = 0, t[3] = 1, t;
|
|
182
182
|
}([]), R = [ 1, 1, 1 ];
|
|
183
183
|
function F(t, e, n, r, s, i, o) {
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
const r = new Uint8Array(t, e, n);
|
|
201
201
|
return D.decode(r);
|
|
202
202
|
}
|
|
203
|
-
const
|
|
203
|
+
const z = {
|
|
204
204
|
get: function(t, e = {}) {
|
|
205
205
|
e || (e = {});
|
|
206
206
|
const n = new AbortController, r = {
|
|
@@ -230,22 +230,23 @@
|
|
|
230
230
|
statusText: t.statusText,
|
|
231
231
|
message: `incorrect http request with status code(${t.status}): ${t.statusText}`
|
|
232
232
|
} : "arraybuffer" === e ? t.arrayBuffer() : "json" === e ? t.json() : t.text(),
|
|
233
|
-
getArrayBuffer: (t, e = {}) => (e || (e = {}), e.responseType = "arraybuffer",
|
|
233
|
+
getArrayBuffer: (t, e = {}) => (e || (e = {}), e.responseType = "arraybuffer", z.get(t, e)),
|
|
234
234
|
getJSON: function(t, e = {}) {
|
|
235
|
-
return e && e.jsonp ?
|
|
236
|
-
},
|
|
237
|
-
jsonp: function(t) {
|
|
238
|
-
const e = "_maptalks_jsonp_" + O++;
|
|
239
|
-
t.match(/\?/) ? t += "&callback=" + e : t += "?callback=" + e;
|
|
240
|
-
let n = document.createElement("script");
|
|
241
|
-
return n.type = "text/javascript", n.src = t, new Promise(t => {
|
|
242
|
-
window[e] = function(r) {
|
|
243
|
-
document.getElementsByTagName("head")[0].removeChild(n), n = null, delete window[e],
|
|
244
|
-
t(r);
|
|
245
|
-
}, document.getElementsByTagName("head")[0].appendChild(n);
|
|
246
|
-
});
|
|
235
|
+
return e && e.jsonp ? z.jsonp(t) : ((e = e || {}).responseType = "json", z.get(t, e));
|
|
247
236
|
}
|
|
248
|
-
}
|
|
237
|
+
};
|
|
238
|
+
z.jsonp = function(t) {
|
|
239
|
+
const e = "_maptalks_jsonp_" + O++;
|
|
240
|
+
t.match(/\?/) ? t += "&callback=" + e : t += "?callback=" + e;
|
|
241
|
+
let n = document.createElement("script");
|
|
242
|
+
return n.type = "text/javascript", n.src = t, new Promise(t => {
|
|
243
|
+
window[e] = function(r) {
|
|
244
|
+
document.getElementsByTagName("head")[0].removeChild(n), n = null, delete window[e],
|
|
245
|
+
t(r);
|
|
246
|
+
}, document.getElementsByTagName("head")[0].appendChild(n);
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
const j = [ "SCALAR", 1, "VEC2", 2, "VEC3", 3, "VEC4", 4, "MAT2", 4, "MAT3", 9, "MAT4", 16 ];
|
|
249
250
|
class V {
|
|
250
251
|
constructor(t, e, n) {
|
|
251
252
|
this.rootPath = t, this.gltf = e, this.i = !1, this.glbBuffer = n, this.buffers = {},
|
|
@@ -280,14 +281,14 @@
|
|
|
280
281
|
});
|
|
281
282
|
if ("binary_glTF" !== t.buffer && "KHR_binary_glTF" !== t.buffer && e.uri) {
|
|
282
283
|
if (N(e.uri)) {
|
|
283
|
-
const t = this.buffers[e.id] =
|
|
284
|
+
const t = this.buffers[e.id] = E(e.uri);
|
|
284
285
|
return Promise.resolve({
|
|
285
286
|
buffer: t,
|
|
286
287
|
byteOffset: 0
|
|
287
288
|
});
|
|
288
289
|
}
|
|
289
290
|
const t = this.rootPath + "/" + e.uri;
|
|
290
|
-
return this.requests[e.id] =
|
|
291
|
+
return this.requests[e.id] = z.getArrayBuffer(t, null).then(t => ({
|
|
291
292
|
buffer: this.buffers[e.id] = t.data,
|
|
292
293
|
byteOffset: 0
|
|
293
294
|
}));
|
|
@@ -298,7 +299,8 @@
|
|
|
298
299
|
});
|
|
299
300
|
}
|
|
300
301
|
u(t, e, n, r = 0) {
|
|
301
|
-
const s = this.gltf, i = s.accessors[e], o = void 0 !== i.bufferView ? s.bufferViews[i.bufferView] : {}, a = (o.byteOffset || 0) + r, c = this.m(i.type), h = I(i.componentType), u = o.byteStride || 0
|
|
302
|
+
const s = this.gltf, i = s.accessors[e], o = void 0 !== i.bufferView ? s.bufferViews[i.bufferView] : {}, a = (o.byteOffset || 0) + r, c = this.m(i.type), h = I(i.componentType), u = o.byteStride || 0;
|
|
303
|
+
const f = {
|
|
302
304
|
array: void 0,
|
|
303
305
|
name: t,
|
|
304
306
|
accessorName: e,
|
|
@@ -331,8 +333,8 @@
|
|
|
331
333
|
r = 0), new s(t, r, n * e);
|
|
332
334
|
}
|
|
333
335
|
m(t) {
|
|
334
|
-
const e =
|
|
335
|
-
return
|
|
336
|
+
const e = j.indexOf(t);
|
|
337
|
+
return j[e + 1];
|
|
336
338
|
}
|
|
337
339
|
requestKHRTechniquesWebgl(t) {
|
|
338
340
|
const {shaders: e} = t, n = e.map(t => {
|
|
@@ -345,12 +347,12 @@
|
|
|
345
347
|
}
|
|
346
348
|
if (t.uri) {
|
|
347
349
|
if (N(t.uri)) {
|
|
348
|
-
const e =
|
|
350
|
+
const e = E(t.uri), n = k(e, 0, e.byteLength);
|
|
349
351
|
return t.content = n, Promise.resolve(t);
|
|
350
352
|
}
|
|
351
353
|
{
|
|
352
354
|
const e = this.rootPath + "/" + t.uri;
|
|
353
|
-
return
|
|
355
|
+
return z.get(e).then(e => (t.content = e, t));
|
|
354
356
|
}
|
|
355
357
|
}
|
|
356
358
|
return Promise.resolve(t);
|
|
@@ -382,7 +384,7 @@
|
|
|
382
384
|
return t[0] = 1, t[1] = 0, t[2] = 0, t[3] = 0, t[4] = 0, t[5] = 1, t[6] = 0, t[7] = 0,
|
|
383
385
|
t[8] = 0, t[9] = 0, t[10] = 1, t[11] = 0, t[12] = e[0], t[13] = e[1], t[14] = e[2],
|
|
384
386
|
t[15] = 1, t;
|
|
385
|
-
}(
|
|
387
|
+
}(P, e.translation || B), s = function(t, e) {
|
|
386
388
|
var n = e[0], r = e[1], s = e[2], i = e[3], o = n + n, a = r + r, c = s + s, h = n * o, u = r * o, f = r * a, l = s * o, d = s * a, m = s * c, y = i * o, b = i * a, p = i * c;
|
|
387
389
|
return t[0] = 1 - f - m, t[1] = u + p, t[2] = l - b, t[3] = 0, t[4] = u - p, t[5] = 1 - h - m,
|
|
388
390
|
t[6] = d + y, t[7] = 0, t[8] = l + b, t[9] = d - y, t[10] = 1 - h - f, t[11] = 0,
|
|
@@ -400,7 +402,7 @@
|
|
|
400
402
|
}
|
|
401
403
|
return e;
|
|
402
404
|
}
|
|
403
|
-
|
|
405
|
+
_(t) {
|
|
404
406
|
const e = {};
|
|
405
407
|
for (const n in t) {
|
|
406
408
|
const r = t[n];
|
|
@@ -408,7 +410,7 @@
|
|
|
408
410
|
r.instanceTechnique && r.instanceTechnique.values ? (s = r.instanceTechnique, i = s.values.diffuse) : (s = r,
|
|
409
411
|
i = s.values.tex || s.values.diffuseTex || s.values.diffuse);
|
|
410
412
|
const o = {
|
|
411
|
-
baseColorTexture: {
|
|
413
|
+
"baseColorTexture": {
|
|
412
414
|
index: i
|
|
413
415
|
}
|
|
414
416
|
};
|
|
@@ -417,7 +419,7 @@
|
|
|
417
419
|
}
|
|
418
420
|
return e;
|
|
419
421
|
}
|
|
420
|
-
|
|
422
|
+
g(t) {
|
|
421
423
|
if (t.bufferView || t.extensions && (t.extensions.KHR_binary_glTF || t.extensions.binary_glTF)) {
|
|
422
424
|
const e = t.bufferView ? t : t.extensions.KHR_binary_glTF || t.extensions.binary_glTF;
|
|
423
425
|
if (t.extensions && (t.mimeType = e.mimeType, t.width = e.width, t.height = e.height),
|
|
@@ -427,7 +429,8 @@
|
|
|
427
429
|
}
|
|
428
430
|
{
|
|
429
431
|
const e = t.uri, n = this.rootPath + "/" + e;
|
|
430
|
-
|
|
432
|
+
if (this.requests[n]) return this.requests[n].then(() => this.buffers[n]);
|
|
433
|
+
return this.requests[n] = z.getArrayBuffer(n, null).then(t => {
|
|
431
434
|
const e = t.data;
|
|
432
435
|
return this.buffers[n] = e, new Uint8Array(e);
|
|
433
436
|
});
|
|
@@ -437,7 +440,7 @@
|
|
|
437
440
|
const e = this.gltf.textures[t];
|
|
438
441
|
if (!e) return null;
|
|
439
442
|
const n = this.gltf.images[e.source];
|
|
440
|
-
return this.
|
|
443
|
+
return this.g(n).then(t => {
|
|
441
444
|
const r = this.gltf.samplers[e.sampler];
|
|
442
445
|
return {
|
|
443
446
|
image: {
|
|
@@ -498,7 +501,7 @@
|
|
|
498
501
|
const e = this.gltf.textures[t];
|
|
499
502
|
if (!e) return null;
|
|
500
503
|
const n = this.gltf.images[e.source];
|
|
501
|
-
return this.
|
|
504
|
+
return this.g(n).then(t => {
|
|
502
505
|
if (!t) return null;
|
|
503
506
|
const r = {
|
|
504
507
|
image: {
|
|
@@ -517,7 +520,7 @@
|
|
|
517
520
|
return s && (r.sampler = s), t.format && (r.format = t.format), r;
|
|
518
521
|
});
|
|
519
522
|
}
|
|
520
|
-
|
|
523
|
+
g(t) {
|
|
521
524
|
if (!S(t.bufferView)) return this.v(t);
|
|
522
525
|
{
|
|
523
526
|
const e = this.gltf.bufferViews[t.bufferView];
|
|
@@ -530,7 +533,8 @@
|
|
|
530
533
|
}
|
|
531
534
|
v(t) {
|
|
532
535
|
const e = 0 === t.uri.indexOf("data:image/") ? t.uri : this.rootPath + "/" + t.uri;
|
|
533
|
-
|
|
536
|
+
if (this.requests[t.id]) return this.requests[t.id].then(() => this.images[t.id]);
|
|
537
|
+
return this.requests[t.id] = this.S(t.id, e);
|
|
534
538
|
}
|
|
535
539
|
I(t, e) {
|
|
536
540
|
const n = this.decoders;
|
|
@@ -554,10 +558,10 @@
|
|
|
554
558
|
return this.I(s, n);
|
|
555
559
|
});
|
|
556
560
|
if (N(t.uri)) {
|
|
557
|
-
const r = this.buffers[t.id] =
|
|
561
|
+
const r = this.buffers[t.id] = E(t.uri), s = this.N(e, r);
|
|
558
562
|
return this.I(s, n);
|
|
559
563
|
}
|
|
560
|
-
return this.requests[t.id] =
|
|
564
|
+
return this.requests[t.id] = z.getArrayBuffer(t.uri, null).then(r => {
|
|
561
565
|
const s = this.buffers[t.id] = r.data, i = this.N(e, s);
|
|
562
566
|
return this.I(i, n);
|
|
563
567
|
});
|
|
@@ -581,7 +585,8 @@
|
|
|
581
585
|
P(t, e) {
|
|
582
586
|
const n = new Array(t.byteLength);
|
|
583
587
|
for (let e = 0; e < t.byteLength; e++) n[e] = String.fromCharCode(t[e]);
|
|
584
|
-
|
|
588
|
+
n.join("");
|
|
589
|
+
return "data:" + (e = e || "image/png") + ";base64," + function(t) {
|
|
585
590
|
return "undefined" != typeof self ? self.btoa(t) : window.btoa(t);
|
|
586
591
|
}(unescape(encodeURIComponent(n)));
|
|
587
592
|
}
|
|
@@ -605,19 +610,19 @@
|
|
|
605
610
|
});
|
|
606
611
|
}
|
|
607
612
|
}
|
|
608
|
-
const q = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
|
|
609
|
-
class
|
|
613
|
+
const q = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null, $ = 1313821514, J = 5130562;
|
|
614
|
+
class K {
|
|
610
615
|
static read(t, e = 0, n = 0) {
|
|
611
616
|
n || (n = t.byteLength);
|
|
612
617
|
const r = new DataView(t, e, n), s = r.getUint32(4, !0);
|
|
613
|
-
if (1 === s) return
|
|
614
|
-
if (2 === s) return
|
|
618
|
+
if (1 === s) return K.readV1(r, e);
|
|
619
|
+
if (2 === s) return K.readV2(t, e);
|
|
615
620
|
throw new Error("Unsupported glb version : " + s);
|
|
616
621
|
}
|
|
617
622
|
static readV1(t, e) {
|
|
618
623
|
const n = t.getUint32(8, !0), r = t.getUint32(12, !0);
|
|
619
624
|
if (n !== t.byteLength) throw new Error("Length in GLB header is inconsistent with glb's byte length.");
|
|
620
|
-
const s =
|
|
625
|
+
const s = X(t.buffer, 20 + e, r);
|
|
621
626
|
return {
|
|
622
627
|
json: JSON.parse(s),
|
|
623
628
|
glbBuffer: {
|
|
@@ -635,7 +640,7 @@
|
|
|
635
640
|
const a = i.getUint32(o, !0);
|
|
636
641
|
o += 4;
|
|
637
642
|
const c = i.getUint32(o, !0);
|
|
638
|
-
if (o += 4,
|
|
643
|
+
if (o += 4, c === $) n = X(t, e + 12 + o, a); else if (c === J) {
|
|
639
644
|
s = e + 12 + o, r = a;
|
|
640
645
|
break;
|
|
641
646
|
}
|
|
@@ -651,7 +656,7 @@
|
|
|
651
656
|
};
|
|
652
657
|
}
|
|
653
658
|
}
|
|
654
|
-
function
|
|
659
|
+
function X(t, e, n) {
|
|
655
660
|
if (q) {
|
|
656
661
|
const r = new Uint8Array(t, e, n);
|
|
657
662
|
return q.decode(r);
|
|
@@ -662,7 +667,7 @@
|
|
|
662
667
|
for (let r = 0; r < e; ) {
|
|
663
668
|
let s = t[r++];
|
|
664
669
|
if (128 & s) {
|
|
665
|
-
let n =
|
|
670
|
+
let n = Z[s >> 3 & 7];
|
|
666
671
|
if (!(64 & s) || !n || r + n > e) return null;
|
|
667
672
|
for (s &= 63 >> n; n > 0; n -= 1) {
|
|
668
673
|
const e = t[r++];
|
|
@@ -675,17 +680,18 @@
|
|
|
675
680
|
return n;
|
|
676
681
|
}(new Uint8Array(t, e, n));
|
|
677
682
|
}
|
|
678
|
-
const
|
|
683
|
+
const Z = [ 1, 1, 1, 1, 2, 2, 3, 0 ];
|
|
684
|
+
const W = [ 0, 0, 0 ], Y = [ 0, 0, 0, 1 ], Q = [ 1, 1, 1 ], tt = {
|
|
679
685
|
TRANSLATION: [ 0, 0, 0 ],
|
|
680
686
|
ROTATION: [ 0, 0, 0, 1 ],
|
|
681
687
|
SCALE: [ 1, 1, 1 ]
|
|
682
|
-
},
|
|
688
|
+
}, et = {
|
|
683
689
|
PREVIOUS: null,
|
|
684
690
|
NEXT: null,
|
|
685
691
|
PREINDEX: null,
|
|
686
692
|
NEXTINDEX: null,
|
|
687
693
|
INTERPOLATION: null
|
|
688
|
-
},
|
|
694
|
+
}, nt = {
|
|
689
695
|
C(t, e, n, r, s, i, o, c) {
|
|
690
696
|
const h = S(t) ? e.animations : [ e.animations[0] ], u = {};
|
|
691
697
|
for (let e = 0; e < h.length; e++) {
|
|
@@ -694,9 +700,9 @@
|
|
|
694
700
|
const l = f.channelsMap[n];
|
|
695
701
|
if (l) for (let t = 0; t < l.length; t++) {
|
|
696
702
|
const e = l[t];
|
|
697
|
-
"translation" === e.target.path ? (this.U(s, f.samplers[e.sampler], r, 1), u.translation = a(
|
|
698
|
-
u.rotation = v(
|
|
699
|
-
u.scale = a(
|
|
703
|
+
"translation" === e.target.path ? (this.U(s, f.samplers[e.sampler], r, 1), u.translation = a(W, s)) : "rotation" === e.target.path ? (this.B(i, f.samplers[e.sampler], r, 1),
|
|
704
|
+
u.rotation = v(Y, i)) : "scale" === e.target.path ? (this.U(o, f.samplers[e.sampler], r, 1),
|
|
705
|
+
u.scale = a(Q, o)) : "weights" === e.target.path && c && (this.U(c, f.samplers[e.sampler], r, c.length),
|
|
700
706
|
u.weights = c);
|
|
701
707
|
}
|
|
702
708
|
}
|
|
@@ -706,7 +712,7 @@
|
|
|
706
712
|
switch (e.interpolation) {
|
|
707
713
|
case "LINEAR":
|
|
708
714
|
{
|
|
709
|
-
const s = this.L(
|
|
715
|
+
const s = this.L(et, e, n, 1 * r);
|
|
710
716
|
s && (t = function(t, e, n, r) {
|
|
711
717
|
for (let s = 0; s < t.length; s++) t[s] = e[s] + r * (n[s] - e[s]);
|
|
712
718
|
return t;
|
|
@@ -716,7 +722,7 @@
|
|
|
716
722
|
|
|
717
723
|
case "STEP":
|
|
718
724
|
{
|
|
719
|
-
const s = this.L(
|
|
725
|
+
const s = this.L(et, e, n, 1 * r);
|
|
720
726
|
s && (t = function(t, e) {
|
|
721
727
|
for (let n = 0; n < t.length; n++) t[n] = e[n];
|
|
722
728
|
return t;
|
|
@@ -726,7 +732,7 @@
|
|
|
726
732
|
|
|
727
733
|
case "CUBICSPLINE":
|
|
728
734
|
{
|
|
729
|
-
const s = this.L(
|
|
735
|
+
const s = this.L(et, e, n, 3 * r);
|
|
730
736
|
s && (t = this.R(t, s, e.input.array, 3 * r));
|
|
731
737
|
break;
|
|
732
738
|
}
|
|
@@ -737,21 +743,21 @@
|
|
|
737
743
|
switch (e.interpolation) {
|
|
738
744
|
case "LINEAR":
|
|
739
745
|
{
|
|
740
|
-
const r = this.L(
|
|
746
|
+
const r = this.L(et, e, n, 1);
|
|
741
747
|
r && T(t, r.PREVIOUS, r.NEXT, r.INTERPOLATION);
|
|
742
748
|
break;
|
|
743
749
|
}
|
|
744
750
|
|
|
745
751
|
case "STEP":
|
|
746
752
|
{
|
|
747
|
-
const r = this.L(
|
|
748
|
-
r && (t =
|
|
753
|
+
const r = this.L(et, e, n, 1);
|
|
754
|
+
r && (t = _(t, ...r.PREVIOUS));
|
|
749
755
|
break;
|
|
750
756
|
}
|
|
751
757
|
|
|
752
758
|
case "CUBICSPLINE":
|
|
753
759
|
{
|
|
754
|
-
const r = this.L(
|
|
760
|
+
const r = this.L(et, e, n, 3);
|
|
755
761
|
if (r) {
|
|
756
762
|
for (let t = 0; t < r.PREVIOUS.length; t++) r.PREVIOUS[t] = Math.acos(r.PREVIOUS[t]),
|
|
757
763
|
r.NEXT[t] = Math.acos(r.NEXT[t]);
|
|
@@ -802,7 +808,8 @@
|
|
|
802
808
|
},
|
|
803
809
|
getAnimationClip(t, e, n, r) {
|
|
804
810
|
const s = t.nodes[e] && t.nodes[e].weights;
|
|
805
|
-
|
|
811
|
+
c(W, ...tt.TRANSLATION), _(Y, ...tt.ROTATION), c(Q, ...tt.SCALE);
|
|
812
|
+
return this.C(r, t, e, n, W, Y, Q, s);
|
|
806
813
|
},
|
|
807
814
|
getTimeSpan(t) {
|
|
808
815
|
if (!t.animations) return null;
|
|
@@ -827,20 +834,20 @@
|
|
|
827
834
|
return n ? S(e) ? n[e] : n[Object.keys(n)[0]] : null;
|
|
828
835
|
}
|
|
829
836
|
};
|
|
830
|
-
let
|
|
837
|
+
let rt = !1;
|
|
831
838
|
if ("undefined" != typeof OffscreenCanvas) {
|
|
832
839
|
let t;
|
|
833
840
|
try {
|
|
834
841
|
t = new OffscreenCanvas(2, 2).getContext("2d");
|
|
835
|
-
} catch (
|
|
836
|
-
t && "undefined" != typeof createImageBitmap && (
|
|
842
|
+
} catch (t) {}
|
|
843
|
+
t && "undefined" != typeof createImageBitmap && (rt = !0);
|
|
837
844
|
}
|
|
838
|
-
const
|
|
839
|
-
class
|
|
845
|
+
const st = "undefined" == typeof document ? null : document.createElement("canvas");
|
|
846
|
+
class it {
|
|
840
847
|
constructor(t, e, n) {
|
|
841
848
|
if (this.options = n || {}, this.options.decoders || (this.options.decoders = {}),
|
|
842
849
|
e.buffer instanceof ArrayBuffer) {
|
|
843
|
-
const {json: n, glbBuffer: r} =
|
|
850
|
+
const {json: n, glbBuffer: r} = K.read(e.buffer, e.byteOffset, e.byteLength);
|
|
844
851
|
this.D(t, n, r);
|
|
845
852
|
} else this.D(t, e);
|
|
846
853
|
this.k = new V(this.rootPath, this.gltf, this.glbBuffer), this.j();
|
|
@@ -891,10 +898,10 @@
|
|
|
891
898
|
return t;
|
|
892
899
|
}
|
|
893
900
|
static getAnimationClip(t, e, n, r) {
|
|
894
|
-
return
|
|
901
|
+
return nt.getAnimationClip(t, e, n, r);
|
|
895
902
|
}
|
|
896
903
|
static getAnimationTimeSpan(t, e) {
|
|
897
|
-
return
|
|
904
|
+
return nt.getTimeSpanByName(t, e);
|
|
898
905
|
}
|
|
899
906
|
static getTypedArrayCtor(t) {
|
|
900
907
|
return I(t);
|
|
@@ -904,7 +911,7 @@
|
|
|
904
911
|
}
|
|
905
912
|
D(t, e, n) {
|
|
906
913
|
this.gltf = e, this.glbBuffer = n, this.version = e.asset ? +e.asset.version : 1,
|
|
907
|
-
this.rootPath = t, this.buffers = {}, this.requests = {}, this.options.requestImage =
|
|
914
|
+
this.rootPath = t, this.buffers = {}, this.requests = {}, this.options.requestImage = rt ? ht : this.options.requestImage || ot,
|
|
908
915
|
this.options.transferable && (this.transferables = []), 2 === this.version ? (this.adapter = new H(t, e, n, this.options.requestImage, this.options.decoders || {}),
|
|
909
916
|
this.adapter.iterate((t, e, n) => {
|
|
910
917
|
e.id = "buffer_" + n;
|
|
@@ -918,7 +925,7 @@
|
|
|
918
925
|
}
|
|
919
926
|
$(t, e) {
|
|
920
927
|
if (t.children && t.children.length > 0) {
|
|
921
|
-
if (!(
|
|
928
|
+
if (!(n = t.children[0], "number" == typeof n && isFinite(n) || function(t) {
|
|
922
929
|
return !M(t) && ("string" == typeof t || null !== t.constructor && t.constructor === String);
|
|
923
930
|
}(t.children[0]))) return t;
|
|
924
931
|
const r = t.children.map(t => {
|
|
@@ -950,7 +957,7 @@
|
|
|
950
957
|
skins: this.skins
|
|
951
958
|
};
|
|
952
959
|
if (this.gltf.extensions && (r.extensions = this.gltf.extensions), 1 === this.version) {
|
|
953
|
-
const t = this.adapter.
|
|
960
|
+
const t = this.adapter._(this.gltf.materials);
|
|
954
961
|
r.materials = t;
|
|
955
962
|
}
|
|
956
963
|
return r;
|
|
@@ -1070,12 +1077,12 @@
|
|
|
1070
1077
|
});
|
|
1071
1078
|
}
|
|
1072
1079
|
}
|
|
1073
|
-
function
|
|
1080
|
+
function ot(t, e) {
|
|
1074
1081
|
const n = new Image;
|
|
1075
1082
|
n.crossOrigin = "", n.onload = () => {
|
|
1076
|
-
if (!
|
|
1077
|
-
|
|
1078
|
-
const t =
|
|
1083
|
+
if (!st) return void e(new Error("There is no canvas to draw image!"));
|
|
1084
|
+
st.width = n.width, st.height = n.height;
|
|
1085
|
+
const t = st.getContext("2d");
|
|
1079
1086
|
t.drawImage(n, 0, 0, n.width, n.height);
|
|
1080
1087
|
const r = t.getImageData(0, 0, n.width, n.height), s = {
|
|
1081
1088
|
width: n.width,
|
|
@@ -1087,11 +1094,11 @@
|
|
|
1087
1094
|
e(t);
|
|
1088
1095
|
}, n.src = t;
|
|
1089
1096
|
}
|
|
1090
|
-
let
|
|
1091
|
-
function
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
const n =
|
|
1097
|
+
let at, ct;
|
|
1098
|
+
function ht(t, e) {
|
|
1099
|
+
at || (at = new OffscreenCanvas(2, 2), ct = at.getContext("2d")), fetch(t).then(t => t.blob()).then(t => createImageBitmap(t)).then(t => {
|
|
1100
|
+
at.width = t.width, at.height = t.height, ct.drawImage(t, 0, 0);
|
|
1101
|
+
const n = ct.getImageData(0, 0, at.width, at.height);
|
|
1095
1102
|
e(null, {
|
|
1096
1103
|
width: t.width,
|
|
1097
1104
|
height: t.height,
|
|
@@ -1099,20 +1106,20 @@
|
|
|
1099
1106
|
});
|
|
1100
1107
|
});
|
|
1101
1108
|
}
|
|
1102
|
-
function
|
|
1109
|
+
function ut(t) {
|
|
1103
1110
|
return t / Math.PI * 180;
|
|
1104
1111
|
}
|
|
1105
|
-
function
|
|
1112
|
+
function ft(t) {
|
|
1106
1113
|
return Math.sign ? Math.sign(t) : 0 === (t = +t) || isNaN(t) ? Number(t) : t > 0 ? 1 : -1;
|
|
1107
1114
|
}
|
|
1108
|
-
const
|
|
1109
|
-
function
|
|
1115
|
+
const lt = [ 1, 1, 1, 1, 2, 2, 3, 0 ];
|
|
1116
|
+
function dt(t) {
|
|
1110
1117
|
const e = t.length;
|
|
1111
1118
|
let n = "";
|
|
1112
1119
|
for (let r = 0; r < e; ) {
|
|
1113
1120
|
let s = t[r++];
|
|
1114
1121
|
if (128 & s) {
|
|
1115
|
-
let n =
|
|
1122
|
+
let n = lt[s >> 3 & 7];
|
|
1116
1123
|
if (!(64 & s) || !n || r + n > e) return null;
|
|
1117
1124
|
for (s &= 63 >> n; n > 0; n -= 1) {
|
|
1118
1125
|
const e = t[r++];
|
|
@@ -1125,37 +1132,37 @@
|
|
|
1125
1132
|
return n;
|
|
1126
1133
|
}
|
|
1127
1134
|
new Array(3), new Array(3);
|
|
1128
|
-
const
|
|
1129
|
-
function
|
|
1130
|
-
const n =
|
|
1131
|
-
const i = e[0], o = e[1], a = e[2], c = n[0], h = n[1], u = n[2], l = i * i * c * c, d = o * o * h * h, m = a * a * u * u, y = l + d + m, b = Math.sqrt(1 / y), p = f(
|
|
1135
|
+
const mt = [ 1 / 6378137, 1 / 6378137, 1 / 6356752.314245179 ], yt = [ 1 / 40680631590769, 1 / 40680631590769, 1 / 40408299984661.445 ], bt = new Array(3), pt = new Array(3), wt = new Array(3);
|
|
1136
|
+
function _t(t, e) {
|
|
1137
|
+
const n = yt, r = function(t, e, n, r, s) {
|
|
1138
|
+
const i = e[0], o = e[1], a = e[2], c = n[0], h = n[1], u = n[2], l = i * i * c * c, d = o * o * h * h, m = a * a * u * u, y = l + d + m, b = Math.sqrt(1 / y), p = f(gt, e, b);
|
|
1132
1139
|
if (y < s) return isFinite(b) ? p : void 0;
|
|
1133
|
-
const w = r[0],
|
|
1134
|
-
T[0] = p[0] * w * 2, T[1] = p[1] *
|
|
1135
|
-
let A, v, O, M, S, x, I, N,
|
|
1140
|
+
const w = r[0], _ = r[1], g = r[2], T = Tt;
|
|
1141
|
+
T[0] = p[0] * w * 2, T[1] = p[1] * _ * 2, T[2] = p[2] * g * 2;
|
|
1142
|
+
let A, v, O, M, S, x, I, N, E, P, C, U = (1 - b) * At(e) / (.5 * At(T)), B = 0;
|
|
1136
1143
|
do {
|
|
1137
|
-
U -= B, O = 1 / (1 + U * w), M = 1 / (1 + U *
|
|
1138
|
-
I = M * M, N = S * S,
|
|
1139
|
-
v = l *
|
|
1144
|
+
U -= B, O = 1 / (1 + U * w), M = 1 / (1 + U * _), S = 1 / (1 + U * g), x = O * O,
|
|
1145
|
+
I = M * M, N = S * S, E = x * O, P = I * M, C = N * S, A = l * x + d * I + m * N - 1,
|
|
1146
|
+
v = l * E * w + d * P * _ + m * C * g;
|
|
1140
1147
|
B = A / (-2 * v);
|
|
1141
1148
|
} while (Math.abs(A) > 1e-12);
|
|
1142
1149
|
return t[0] = i * O, t[1] = o * M, t[2] = a * S, t;
|
|
1143
|
-
}(
|
|
1144
|
-
let s = p(
|
|
1150
|
+
}(bt, e, mt, n, .1);
|
|
1151
|
+
let s = p(pt, r, n);
|
|
1145
1152
|
s = function(t, e) {
|
|
1146
1153
|
const n = e[0], r = e[1], s = e[2];
|
|
1147
1154
|
let i = n * n + r * r + s * s;
|
|
1148
1155
|
i > 0 && (i = Math.sqrt(i), t[0] = e[0] / i, t[1] = e[1] / i, t[2] = e[2] / i);
|
|
1149
1156
|
return t;
|
|
1150
1157
|
}(s, s);
|
|
1151
|
-
const i = b(
|
|
1152
|
-
return t[0] =
|
|
1158
|
+
const i = b(wt, e, r), o = Math.atan2(s[1], s[0]), a = Math.asin(s[2]), c = ft(d(i, e)) * At(i);
|
|
1159
|
+
return t[0] = ut(o), t[1] = ut(a), t[2] = c, t;
|
|
1153
1160
|
}
|
|
1154
|
-
const
|
|
1155
|
-
function
|
|
1161
|
+
const gt = new Array(3), Tt = new Array(3);
|
|
1162
|
+
function At(t) {
|
|
1156
1163
|
return i(t);
|
|
1157
1164
|
}
|
|
1158
|
-
function
|
|
1165
|
+
function vt(t, e) {
|
|
1159
1166
|
let n = "";
|
|
1160
1167
|
for (let r = 0; r < 4; r++) {
|
|
1161
1168
|
const s = t.getUint8(e + r);
|
|
@@ -1163,27 +1170,27 @@
|
|
|
1163
1170
|
}
|
|
1164
1171
|
return n;
|
|
1165
1172
|
}
|
|
1166
|
-
const
|
|
1167
|
-
function
|
|
1173
|
+
const Ot = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
|
|
1174
|
+
function Mt(t, e, n) {
|
|
1168
1175
|
const r = new Uint8Array(t, e, n);
|
|
1169
|
-
return
|
|
1176
|
+
return Ot ? JSON.parse(Ot.decode(r)) : JSON.parse(dt(r));
|
|
1170
1177
|
}
|
|
1171
|
-
function
|
|
1178
|
+
function St(t, e, n) {
|
|
1172
1179
|
const r = new Uint8Array(t, e, n);
|
|
1173
|
-
return
|
|
1180
|
+
return Ot ? JSON.parse(Ot.decode(r)) : JSON.parse(dt(r));
|
|
1174
1181
|
}
|
|
1175
|
-
function
|
|
1182
|
+
function xt(t, e, n) {
|
|
1176
1183
|
return {
|
|
1177
1184
|
offset: e,
|
|
1178
1185
|
byteLength: n
|
|
1179
1186
|
};
|
|
1180
1187
|
}
|
|
1181
|
-
function
|
|
1188
|
+
function It(t, e, n, r) {
|
|
1182
1189
|
const {byteOffset: s, componentType: i, type: o} = t, {ctor: a, type: c} = function(t) {
|
|
1183
|
-
return
|
|
1190
|
+
return Pt[t];
|
|
1184
1191
|
}(i), h = function(t) {
|
|
1185
1192
|
if (!t) return 1;
|
|
1186
|
-
return
|
|
1193
|
+
return Et[t];
|
|
1187
1194
|
}(o);
|
|
1188
1195
|
return {
|
|
1189
1196
|
byteStride: 0,
|
|
@@ -1194,18 +1201,19 @@
|
|
|
1194
1201
|
array: new a(e, n + s, r * h)
|
|
1195
1202
|
};
|
|
1196
1203
|
}
|
|
1197
|
-
function
|
|
1198
|
-
|
|
1204
|
+
function Nt(t, e, n, r) {
|
|
1205
|
+
t.componentType || (t.componentType = "UNSIGNED_SHORT");
|
|
1206
|
+
const s = It(t, e, n, r);
|
|
1199
1207
|
return s.array.buffer.byteLength !== e.byteLength && (s.array = s.array.slice()),
|
|
1200
1208
|
s;
|
|
1201
1209
|
}
|
|
1202
|
-
const
|
|
1210
|
+
const Et = {
|
|
1203
1211
|
"SCALAR": 1,
|
|
1204
1212
|
"VEC2": 2,
|
|
1205
1213
|
"VEC3": 3,
|
|
1206
1214
|
"VEC4": 4
|
|
1207
1215
|
};
|
|
1208
|
-
const
|
|
1216
|
+
const Pt = {
|
|
1209
1217
|
"BYTE": {
|
|
1210
1218
|
ctor: Int8Array,
|
|
1211
1219
|
type: 5120,
|
|
@@ -1247,27 +1255,27 @@
|
|
|
1247
1255
|
name: "Float64Array"
|
|
1248
1256
|
}
|
|
1249
1257
|
};
|
|
1250
|
-
function
|
|
1251
|
-
for (let e in
|
|
1258
|
+
function Ct(t) {
|
|
1259
|
+
for (let e in Pt) if (t === Pt[e].ctor) return Pt[e].type;
|
|
1252
1260
|
throw new Error("unrecognized ctor:" + t);
|
|
1253
1261
|
}
|
|
1254
|
-
function
|
|
1262
|
+
function Ut(t, e, n, r) {
|
|
1255
1263
|
const s = t, i = e.length / 3;
|
|
1256
1264
|
for (let t = 0; t < i; t++) s[3 * t] = e[3 * t] / 65535 * r[0] + n[0], s[3 * t + 1] = e[3 * t + 1] / 65535 * r[1] + n[1],
|
|
1257
1265
|
s[3 * t + 2] = e[3 * t + 2] / 65535 * r[2] + n[2];
|
|
1258
1266
|
return s;
|
|
1259
1267
|
}
|
|
1260
|
-
function
|
|
1268
|
+
function Bt(t, e, n) {
|
|
1261
1269
|
let r = t.getUint32(12, !0), s = t.getUint32(16, !0), i = t.getUint32(20, !0), o = t.getUint32(24, !0);
|
|
1262
1270
|
const a = t.buffer;
|
|
1263
1271
|
let c, h, u = {}, f = {};
|
|
1264
|
-
r > 0 && (u =
|
|
1272
|
+
r > 0 && (u = Mt(a, e, r), e += r), s > 0 && (c = function(t, e, n) {
|
|
1265
1273
|
return {
|
|
1266
1274
|
offset: e,
|
|
1267
1275
|
byteLength: n
|
|
1268
1276
|
};
|
|
1269
|
-
}(0, e, s), e += s), i > 0 && (f =
|
|
1270
|
-
const l =
|
|
1277
|
+
}(0, e, s), e += s), i > 0 && (f = St(a, e, i), e += i);
|
|
1278
|
+
const l = xt(0, e, o);
|
|
1271
1279
|
return h = a.slice(l.offset, l.offset + l.byteLength), n.push(h), {
|
|
1272
1280
|
featureTable: u,
|
|
1273
1281
|
featureTableBin: c,
|
|
@@ -1275,28 +1283,28 @@
|
|
|
1275
1283
|
batchTableBin: h
|
|
1276
1284
|
};
|
|
1277
1285
|
}
|
|
1278
|
-
var
|
|
1286
|
+
var Lt = {
|
|
1279
1287
|
north: [ -1, 0, 0 ],
|
|
1280
1288
|
east: [ 0, 1, 0 ],
|
|
1281
1289
|
up: [ 0, 0, 1 ],
|
|
1282
1290
|
south: [ 1, 0, 0 ],
|
|
1283
1291
|
west: [ 0, -1, 0 ],
|
|
1284
1292
|
down: [ 0, 0, -1 ]
|
|
1285
|
-
},
|
|
1293
|
+
}, Rt = {}, Ft = {
|
|
1286
1294
|
east: [],
|
|
1287
1295
|
north: [],
|
|
1288
1296
|
up: [],
|
|
1289
1297
|
west: [],
|
|
1290
1298
|
south: [],
|
|
1291
1299
|
down: []
|
|
1292
|
-
},
|
|
1293
|
-
const
|
|
1294
|
-
function
|
|
1300
|
+
}, Dt = [], kt = [], zt = [];
|
|
1301
|
+
const jt = [ 0, 0, 0 ];
|
|
1302
|
+
function Vt(t, e, n, r) {
|
|
1295
1303
|
n = n || 0, r = r || n;
|
|
1296
1304
|
var s = Math.abs(t - e);
|
|
1297
1305
|
return s <= r || s <= n * Math.max(Math.abs(t), Math.abs(e));
|
|
1298
1306
|
}
|
|
1299
|
-
const
|
|
1307
|
+
const Gt = (Jt = {
|
|
1300
1308
|
up: {
|
|
1301
1309
|
south: "east",
|
|
1302
1310
|
north: "west",
|
|
@@ -1333,54 +1341,53 @@
|
|
|
1333
1341
|
north: "up",
|
|
1334
1342
|
south: "down"
|
|
1335
1343
|
}
|
|
1336
|
-
}[
|
|
1337
|
-
if (
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
a(Rt, Ut[Vt]), "east" !== Vt && "west" !== Vt && f(Rt, Rt, r), a(Ft, Ut[Gt]), "east" !== Gt && "west" !== Gt && f(Ft, Ft, r),
|
|
1343
|
-
a(Dt, Ut[qt]), "east" !== qt && "west" !== qt && f(Dt, Dt, r);
|
|
1344
|
+
}[Ht = "east"][qt = "north"], Rt[Kt = Ht + qt] ? $t = Rt[Kt] : ($t = function(t, e, n) {
|
|
1345
|
+
if (c = jt, h = (o = t)[0], d = o[1], y = o[2], b = c[0], p = c[1], w = c[2], Math.abs(h - b) <= 1e-6 * Math.max(1, Math.abs(h), Math.abs(b)) && Math.abs(d - p) <= 1e-6 * Math.max(1, Math.abs(d), Math.abs(p)) && Math.abs(y - w) <= 1e-6 * Math.max(1, Math.abs(y), Math.abs(w))) a(Dt, Lt[Ht]),
|
|
1346
|
+
a(kt, Lt[qt]), a(zt, Lt[Jt]); else if (Vt(t[0], 0, 1e-14) && Vt(t[1], 0, 1e-14)) {
|
|
1347
|
+
var r = ft(t[2]);
|
|
1348
|
+
a(Dt, Lt[Ht]), "east" !== Ht && "west" !== Ht && f(Dt, Dt, r), a(kt, Lt[qt]), "east" !== qt && "west" !== qt && f(kt, kt, r),
|
|
1349
|
+
a(zt, Lt[Jt]), "east" !== Jt && "west" !== Jt && f(zt, zt, r);
|
|
1344
1350
|
} else {
|
|
1345
1351
|
!function(t, e) {
|
|
1346
|
-
u(e, t,
|
|
1347
|
-
}(t,
|
|
1348
|
-
var s =
|
|
1349
|
-
i[0] = -t[1], i[1] = t[0], i[2] = 0, l(
|
|
1350
|
-
f(
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
n[
|
|
1352
|
+
u(e, t, yt), l(e, e);
|
|
1353
|
+
}(t, Ft.up);
|
|
1354
|
+
var s = Ft.up, i = Ft.east;
|
|
1355
|
+
i[0] = -t[1], i[1] = t[0], i[2] = 0, l(Ft.east, i), m(Ft.north, s, i), f(Ft.down, Ft.up, -1),
|
|
1356
|
+
f(Ft.west, Ft.east, -1), f(Ft.south, Ft.north, -1), Dt = Ft[Ht], kt = Ft[qt], zt = Ft[Jt];
|
|
1357
|
+
}
|
|
1358
|
+
var o, c, h, d, y, b, p, w;
|
|
1359
|
+
return n[0] = Dt[0], n[1] = Dt[1], n[2] = Dt[2], n[3] = 0, n[4] = kt[0], n[5] = kt[1],
|
|
1360
|
+
n[6] = kt[2], n[7] = 0, n[8] = zt[0], n[9] = zt[1], n[10] = zt[2], n[11] = 0, n[12] = t[0],
|
|
1354
1361
|
n[13] = t[1], n[14] = t[2], n[15] = 1, n;
|
|
1355
|
-
},
|
|
1362
|
+
}, Rt[Kt] = $t), $t);
|
|
1356
1363
|
/*!
|
|
1357
1364
|
* @maptalks/gl v0.64.0
|
|
1358
1365
|
* LICENSE : UNLICENSED
|
|
1359
1366
|
* (c) 2016-2022 maptalks.com
|
|
1360
|
-
*/ var
|
|
1361
|
-
const
|
|
1367
|
+
*/ var Ht, qt, $t, Jt, Kt;
|
|
1368
|
+
const Xt = function() {
|
|
1362
1369
|
if ("undefined" != typeof self) return self;
|
|
1363
1370
|
if ("undefined" != typeof window) return window;
|
|
1364
1371
|
if ("undefined" != typeof global) return global;
|
|
1365
1372
|
throw new Error("unable to locate global object");
|
|
1366
|
-
},
|
|
1367
|
-
|
|
1368
|
-
const e = t.toString(), n = e.indexOf("{") + 1, r = e.substring(0, n), s =
|
|
1369
|
-
let i = `${r}\n const _____getGlobal = ${
|
|
1373
|
+
}, Zt = Xt(), Wt = Zt.gl_trans__coders = Zt.gl_trans__coders || {};
|
|
1374
|
+
Wt.inject = function(t) {
|
|
1375
|
+
const e = t.toString(), n = e.indexOf("{") + 1, r = e.substring(0, n), s = Zt.gl_trans__coders = Zt.gl_trans__coders || {};
|
|
1376
|
+
let i = `${r}\n const _____getGlobal = ${Xt.toString()};\n const g___lobals = _____getGlobal()\n const tran_____scoders = g___lobals['gl_trans__coders'] = g___lobals['gl_trans__coders'] || {};`;
|
|
1370
1377
|
for (const t in s) "inject" !== t && "getTranscoder" !== t && "registerTranscoder" !== t && (i += 'tran_____scoders["' + t + '"] =' + s[t].toString() + "\n;");
|
|
1371
1378
|
return i += "\n" + e.substring(r.length), i;
|
|
1372
|
-
},
|
|
1373
|
-
|
|
1374
|
-
},
|
|
1375
|
-
return
|
|
1379
|
+
}, Wt.registerTranscoder = function(t, e) {
|
|
1380
|
+
Wt[t] = e;
|
|
1381
|
+
}, Wt.getTranscoder = function(t) {
|
|
1382
|
+
return Wt[t];
|
|
1376
1383
|
};
|
|
1377
|
-
class
|
|
1384
|
+
class Yt {
|
|
1378
1385
|
constructor(t, e) {
|
|
1379
|
-
this.A = t, this.tt = e ||
|
|
1380
|
-
"image/crn":
|
|
1381
|
-
"image/ktx2":
|
|
1382
|
-
"image/cttf":
|
|
1383
|
-
"draco":
|
|
1386
|
+
this.A = t, this.tt = e || it, this.et = {
|
|
1387
|
+
"image/crn": Wt.crn && Wt.crn(),
|
|
1388
|
+
"image/ktx2": Wt.ktx2 && Wt.ktx2(),
|
|
1389
|
+
"image/cttf": Wt.ktx2 && Wt.ktx2(),
|
|
1390
|
+
"draco": Wt.draco && Wt.draco()
|
|
1384
1391
|
};
|
|
1385
1392
|
}
|
|
1386
1393
|
static createEmptyB3DM() {
|
|
@@ -1391,7 +1398,7 @@
|
|
|
1391
1398
|
};
|
|
1392
1399
|
}
|
|
1393
1400
|
load(t, e, n = 0, r = 0) {
|
|
1394
|
-
return e ? (r || (r = e.byteLength), this.nt(t, e, n, r)) :
|
|
1401
|
+
return e ? (r || (r = e.byteLength), this.nt(t, e, n, r)) : z.getArrayBuffer(t, {}).then(e => {
|
|
1395
1402
|
const s = e.data;
|
|
1396
1403
|
return r || (r = s.byteLength), this.nt(t, s, n, r);
|
|
1397
1404
|
});
|
|
@@ -1438,15 +1445,15 @@
|
|
|
1438
1445
|
o = h, h = a, u = c, a = 0, c = 0);
|
|
1439
1446
|
const l = [ t ];
|
|
1440
1447
|
let d, m, y;
|
|
1441
|
-
if (a > 0 ? (d =
|
|
1448
|
+
if (a > 0 ? (d = Mt(t, f, a), f += a, o = d.BATCH_LENGTH) : d = {
|
|
1442
1449
|
"BATCH_LENGTH": o
|
|
1443
|
-
}, c > 0 && (f += c), h > 0 && (m =
|
|
1444
|
-
const e =
|
|
1450
|
+
}, c > 0 && (f += c), h > 0 && (m = St(t, f, h), f += h, u > 0)) {
|
|
1451
|
+
const e = xt(0, f, u);
|
|
1445
1452
|
y = t.slice(e.offset, e.offset + e.byteLength), f += u, l.push(y);
|
|
1446
1453
|
}
|
|
1447
1454
|
const b = d.BATCH_LENGTH, p = {};
|
|
1448
1455
|
if (d && d.BATCH_ID) {
|
|
1449
|
-
p.BATCH_ID =
|
|
1456
|
+
p.BATCH_ID = Nt(d.BATCH_ID, t, (void 0).offset, b);
|
|
1450
1457
|
const e = p.BATCH_ID.array && p.BATCH_ID.array.buffer;
|
|
1451
1458
|
e && l.indexOf(e) < 0 && l.push(e);
|
|
1452
1459
|
}
|
|
@@ -1460,7 +1467,7 @@
|
|
|
1460
1467
|
glb: {
|
|
1461
1468
|
buffer: t,
|
|
1462
1469
|
byteOffset: f,
|
|
1463
|
-
byteLength: s.byteLength - f
|
|
1470
|
+
byteLength: s.byteLength + s.byteOffset - f
|
|
1464
1471
|
}
|
|
1465
1472
|
};
|
|
1466
1473
|
}
|
|
@@ -1468,17 +1475,17 @@
|
|
|
1468
1475
|
return null;
|
|
1469
1476
|
}
|
|
1470
1477
|
}
|
|
1471
|
-
class
|
|
1478
|
+
class Qt {
|
|
1472
1479
|
constructor(t, e) {
|
|
1473
|
-
this.A = t, this.tt = e ||
|
|
1474
|
-
"image/crn":
|
|
1475
|
-
"image/ktx2":
|
|
1476
|
-
"image/cttf":
|
|
1477
|
-
"draco":
|
|
1480
|
+
this.A = t, this.tt = e || it, this.et = {
|
|
1481
|
+
"image/crn": Wt.crn && Wt.crn(),
|
|
1482
|
+
"image/ktx2": Wt.ktx2 && Wt.ktx2(),
|
|
1483
|
+
"image/cttf": Wt.ktx2 && Wt.ktx2(),
|
|
1484
|
+
"draco": Wt.draco && Wt.draco()
|
|
1478
1485
|
};
|
|
1479
1486
|
}
|
|
1480
1487
|
load(t, e, n = 0, r = 0) {
|
|
1481
|
-
return e ? (r || (r = e.byteLength), this.nt(t, e, n, r)) :
|
|
1488
|
+
return e ? (r || (r = e.byteLength), this.nt(t, e, n, r)) : z.getArrayBuffer(t, {}).then(e => {
|
|
1482
1489
|
const s = e.data;
|
|
1483
1490
|
return r || (r = s.byteLength), this.nt(t, s, n, r);
|
|
1484
1491
|
});
|
|
@@ -1507,12 +1514,12 @@
|
|
|
1507
1514
|
decoders: this.et
|
|
1508
1515
|
}, i = new DataView(e, n, r), o = 32 + i.getUint32(12, !0) + i.getUint32(16, !0) + i.getUint32(20, !0) + i.getUint32(24, !0);
|
|
1509
1516
|
if (0 === i.getUint32(28, !0)) {
|
|
1510
|
-
let r =
|
|
1517
|
+
let r = dt(new Uint8Array(e, o + n, i.byteLength - o));
|
|
1511
1518
|
-1 == r.indexOf("://") && (r = t.substring(0, t.lastIndexOf("/")) + "/" + r);
|
|
1512
|
-
return r.indexOf(".glb") > 0 ?
|
|
1519
|
+
return r.indexOf(".glb") > 0 ? z.getArrayBuffer(r, {}).then(t => this.at(r, {
|
|
1513
1520
|
buffer: t.data,
|
|
1514
1521
|
byteOffset: 0
|
|
1515
|
-
}, s)) :
|
|
1522
|
+
}, s)) : z.getJSON(r, {}).then(t => this.at(r, t, s));
|
|
1516
1523
|
}
|
|
1517
1524
|
{
|
|
1518
1525
|
const r = {
|
|
@@ -1550,7 +1557,7 @@
|
|
|
1550
1557
|
error: t
|
|
1551
1558
|
};
|
|
1552
1559
|
}
|
|
1553
|
-
const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} =
|
|
1560
|
+
const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} = Bt(s, 32 + e, o), f = {}, l = a.INSTANCES_LENGTH;
|
|
1554
1561
|
if (a.POSITION) {
|
|
1555
1562
|
const {byteOffset: e} = a.POSITION;
|
|
1556
1563
|
f.POSITION = {
|
|
@@ -1573,7 +1580,7 @@
|
|
|
1573
1580
|
}, o.push(f.POSITION.array.buffer);
|
|
1574
1581
|
}
|
|
1575
1582
|
if (a.BATCH_ID) {
|
|
1576
|
-
f.BATCH_ID =
|
|
1583
|
+
f.BATCH_ID = Nt(a.BATCH_ID, t, c.offset, l);
|
|
1577
1584
|
const e = f.BATCH_ID.array && f.BATCH_ID.array.buffer;
|
|
1578
1585
|
e && o.indexOf(e) < 0 && o.push(e);
|
|
1579
1586
|
}
|
|
@@ -1644,26 +1651,26 @@
|
|
|
1644
1651
|
}
|
|
1645
1652
|
ht(t) {
|
|
1646
1653
|
const e = t.length / 2, n = new Float32Array(3 * e), r = [];
|
|
1647
|
-
for (let s = 0; s < e; s++)
|
|
1654
|
+
for (let s = 0; s < e; s++) te(r, t[2 * s], t[2 * s + 1], 65535), n[3 * s] = r[0],
|
|
1648
1655
|
n[3 * s + 1] = r[1], n[3 * s + 2] = r[2];
|
|
1649
1656
|
return n;
|
|
1650
1657
|
}
|
|
1651
1658
|
ct(t, e, n) {
|
|
1652
|
-
return
|
|
1659
|
+
return Ut(new Float32Array(t.length), t, e, n);
|
|
1653
1660
|
}
|
|
1654
1661
|
st() {
|
|
1655
1662
|
return null;
|
|
1656
1663
|
}
|
|
1657
1664
|
}
|
|
1658
|
-
function
|
|
1659
|
-
if (t[0] =
|
|
1665
|
+
function te(t, e, n, r) {
|
|
1666
|
+
if (t[0] = ee(e, r), t[1] = ee(n, r), t[2] = 1 - (Math.abs(t[0]) + Math.abs(t[1])),
|
|
1660
1667
|
t[2] < 0) {
|
|
1661
1668
|
const e = t[0];
|
|
1662
|
-
t[0] = (1 - Math.abs(t[1])) *
|
|
1669
|
+
t[0] = (1 - Math.abs(t[1])) * ne(e), t[1] = (1 - Math.abs(e)) * ne(t[1]);
|
|
1663
1670
|
}
|
|
1664
1671
|
return l(t, t);
|
|
1665
1672
|
}
|
|
1666
|
-
function
|
|
1673
|
+
function ee(t, e) {
|
|
1667
1674
|
return function(t, e, n) {
|
|
1668
1675
|
return t < e ? e : t > n ? n : t;
|
|
1669
1676
|
}(t, 0, e = function(t, e) {
|
|
@@ -1671,13 +1678,13 @@
|
|
|
1671
1678
|
return e;
|
|
1672
1679
|
}(e, 255)) / e * 2 - 1;
|
|
1673
1680
|
}
|
|
1674
|
-
function
|
|
1681
|
+
function ne(t) {
|
|
1675
1682
|
return t < 0 ? -1 : 1;
|
|
1676
1683
|
}
|
|
1677
|
-
class
|
|
1684
|
+
class re {
|
|
1678
1685
|
constructor() {}
|
|
1679
1686
|
load(t, e, n = 0, r = 0) {
|
|
1680
|
-
return e ? (r || (r = e.byteLength), this.nt(t, e, n, r)) :
|
|
1687
|
+
return e ? (r || (r = e.byteLength), this.nt(t, e, n, r)) : z.getArrayBuffer(t, {}).then(e => {
|
|
1681
1688
|
const s = e.data;
|
|
1682
1689
|
return r || (r = s.byteLength), this.nt(t, s, n, r);
|
|
1683
1690
|
});
|
|
@@ -1707,7 +1714,7 @@
|
|
|
1707
1714
|
error: t
|
|
1708
1715
|
};
|
|
1709
1716
|
}
|
|
1710
|
-
const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} =
|
|
1717
|
+
const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} = Bt(s, e + 28, o), f = a.QUANTIZED_VOLUME_OFFSET, l = a.QUANTIZED_VOLUME_SCALE, d = a.POINTS_LENGTH;
|
|
1711
1718
|
let m, y = {};
|
|
1712
1719
|
if (a.extensions && a.extensions["3DTILES_draco_point_compression"]) {
|
|
1713
1720
|
y = a.extensions["3DTILES_draco_point_compression"], m = new DataView(t, y.byteOffset + c.offset, y.byteLength);
|
|
@@ -1715,7 +1722,7 @@
|
|
|
1715
1722
|
attributes: y.properties,
|
|
1716
1723
|
useUniqueIDs: !1
|
|
1717
1724
|
};
|
|
1718
|
-
return this.ft || (this.ft =
|
|
1725
|
+
return this.ft || (this.ft = Wt.draco()), this.ft(m, e).then(e => {
|
|
1719
1726
|
const n = e.attributes;
|
|
1720
1727
|
!a.POSITION && !a.POSITION_QUANTIZED || n.POSITION || n.POSITION_QUANTIZED || (n.POSITION = a.POSITION,
|
|
1721
1728
|
n.POSITION_QUANTIZED = a.POSITION_QUANTIZED), !(a.RGB || a.RGBA || a.RGB565) || n.RGB || n.RGBA || n.RGB565 || (n.RGB = a.RGB,
|
|
@@ -1729,11 +1736,11 @@
|
|
|
1729
1736
|
byteOffset: 0,
|
|
1730
1737
|
itemSize: 1,
|
|
1731
1738
|
count: t.length,
|
|
1732
|
-
componentType:
|
|
1739
|
+
componentType: Ct(t.constructor),
|
|
1733
1740
|
array: t
|
|
1734
1741
|
}, o.push(t.buffer);
|
|
1735
1742
|
} else if (a.BATCH_ID || Object.keys(h).length) {
|
|
1736
|
-
a.BATCH_ID ? r.BATCH_ID =
|
|
1743
|
+
a.BATCH_ID ? r.BATCH_ID = Nt(a.BATCH_ID, t, c.offset, d) : r.BATCH_ID = se(d);
|
|
1737
1744
|
const e = r.BATCH_ID.array && r.BATCH_ID.array.buffer;
|
|
1738
1745
|
e && o.indexOf(e) < 0 && o.push(e);
|
|
1739
1746
|
}
|
|
@@ -1749,7 +1756,7 @@
|
|
|
1749
1756
|
}
|
|
1750
1757
|
const b = this.lt(t, a, c.offset, d, o, f, l);
|
|
1751
1758
|
if (a.BATCH_ID || Object.keys(h).length) {
|
|
1752
|
-
a.BATCH_ID ? b.BATCH_ID =
|
|
1759
|
+
a.BATCH_ID ? b.BATCH_ID = Nt(a.BATCH_ID, t, c.offset, d) : b.BATCH_ID = se(d);
|
|
1753
1760
|
const e = b.BATCH_ID.array && b.BATCH_ID.array.buffer;
|
|
1754
1761
|
e && o.indexOf(e) < 0 && o.push(e);
|
|
1755
1762
|
}
|
|
@@ -1878,13 +1885,13 @@
|
|
|
1878
1885
|
return a;
|
|
1879
1886
|
}
|
|
1880
1887
|
ct(t, e, n) {
|
|
1881
|
-
return
|
|
1888
|
+
return Ut(new Float32Array(t.length), t, e, n);
|
|
1882
1889
|
}
|
|
1883
1890
|
st() {
|
|
1884
1891
|
return null;
|
|
1885
1892
|
}
|
|
1886
1893
|
}
|
|
1887
|
-
function
|
|
1894
|
+
function se(t) {
|
|
1888
1895
|
const e = (n = t) < 256 ? Uint8Array : n < 65536 ? Uint16Array : Uint32Array;
|
|
1889
1896
|
var n;
|
|
1890
1897
|
const r = new e(t);
|
|
@@ -1894,16 +1901,16 @@
|
|
|
1894
1901
|
byteOffset: 0,
|
|
1895
1902
|
itemSize: 1,
|
|
1896
1903
|
count: t,
|
|
1897
|
-
componentType:
|
|
1904
|
+
componentType: Ct(e),
|
|
1898
1905
|
array: r
|
|
1899
1906
|
};
|
|
1900
1907
|
}
|
|
1901
|
-
class
|
|
1908
|
+
class ie {
|
|
1902
1909
|
constructor(t, e) {
|
|
1903
|
-
this.A = t, this.tt = e ||
|
|
1910
|
+
this.A = t, this.tt = e || it;
|
|
1904
1911
|
}
|
|
1905
1912
|
load(t, e, n = 0, r = 0) {
|
|
1906
|
-
return e ? this.nt(t, e, n, r) :
|
|
1913
|
+
return e ? this.nt(t, e, n, r) : z.getArrayBuffer(t, {}).then(e => {
|
|
1907
1914
|
const s = e.data;
|
|
1908
1915
|
return this.nt(t, s, n, r);
|
|
1909
1916
|
});
|
|
@@ -1913,12 +1920,12 @@
|
|
|
1913
1920
|
const s = this.dt(e, t, n, r), i = [];
|
|
1914
1921
|
for (let n = 0; n < s.length; n++) {
|
|
1915
1922
|
let r;
|
|
1916
|
-
if ("b3dm" === s[n].magic) r = new
|
|
1923
|
+
if ("b3dm" === s[n].magic) r = new Yt(this.A, this.tt); else if ("i3dm" === s[n].magic) r = new Qt(this.A, this.tt); else if ("pnts" === s[n].magic) r = new re; else {
|
|
1917
1924
|
if ("cmpt" !== s[n].magic) {
|
|
1918
1925
|
console.warn("Unsupported magic in CMPT tile:", s[n].magic);
|
|
1919
1926
|
continue;
|
|
1920
1927
|
}
|
|
1921
|
-
r = new
|
|
1928
|
+
r = new ie(this.A, this.tt);
|
|
1922
1929
|
}
|
|
1923
1930
|
i.push(r.load(t, e, s[n].offset, s[n].byteLength).then(t => t));
|
|
1924
1931
|
}
|
|
@@ -1935,17 +1942,11 @@
|
|
|
1935
1942
|
error: t
|
|
1936
1943
|
};
|
|
1937
1944
|
}
|
|
1938
|
-
if (s.getUint32(8, !0) !== s.byteLength) {
|
|
1939
|
-
const t = "Length in cmpt header is inconsistent with cmpt's byte length, url: " + e;
|
|
1940
|
-
return console.warn(t), {
|
|
1941
|
-
error: t
|
|
1942
|
-
};
|
|
1943
|
-
}
|
|
1944
1945
|
if (16 === s.byteLength) return [];
|
|
1945
1946
|
const o = [], a = s.getUint32(12, !0);
|
|
1946
1947
|
let c = 16;
|
|
1947
1948
|
for (let e = 0; e < a; e++) {
|
|
1948
|
-
const e =
|
|
1949
|
+
const e = vt(s, c), r = s.getUint32(c + 8, !0);
|
|
1949
1950
|
o.push({
|
|
1950
1951
|
magic: e,
|
|
1951
1952
|
buffer: t,
|
|
@@ -1956,17 +1957,17 @@
|
|
|
1956
1957
|
return o;
|
|
1957
1958
|
}
|
|
1958
1959
|
}
|
|
1959
|
-
function
|
|
1960
|
+
function oe(t, e) {
|
|
1960
1961
|
if (t.scenes && t.scenes.length) for (let n = 0, r = t.scenes.length; n < r; n++) {
|
|
1961
1962
|
const r = t.scenes[n].nodes;
|
|
1962
1963
|
for (let n = 0, s = r.length; n < s; n++) {
|
|
1963
1964
|
const s = [];
|
|
1964
|
-
|
|
1965
|
+
ae(r[n], s, t, e);
|
|
1965
1966
|
}
|
|
1966
1967
|
}
|
|
1967
1968
|
}
|
|
1968
|
-
function
|
|
1969
|
-
if (t.matrix && e.push(t.matrix), t.children && t.children.length) for (let s = 0, i = t.children.length; s < i; s++)
|
|
1969
|
+
function ae(t, e, n, r) {
|
|
1970
|
+
if (t.matrix && e.push(t.matrix), t.children && t.children.length) for (let s = 0, i = t.children.length; s < i; s++) ae(t.children[s], e, n, r);
|
|
1970
1971
|
if (void 0 !== t.mesh) {
|
|
1971
1972
|
const s = t.mesh, i = n.meshes[s];
|
|
1972
1973
|
if (i) {
|
|
@@ -1978,9 +1979,9 @@
|
|
|
1978
1979
|
}
|
|
1979
1980
|
}
|
|
1980
1981
|
}
|
|
1981
|
-
function
|
|
1982
|
+
function ce(t, e) {
|
|
1982
1983
|
let {componentType: n, byteOffset: r, byteStride: s, count: i, itemSize: o} = t;
|
|
1983
|
-
const a = t.array.buffer, c = n ?
|
|
1984
|
+
const a = t.array.buffer, c = n ? it.getTypedArrayCtor(n) : t.array.constructor;
|
|
1984
1985
|
if (r = void 0 === r ? t.array.byteOffset : r, s = s || 0, i = i || t.array.length / o,
|
|
1985
1986
|
(!s || s === o * c.BYTES_PER_ELEMENT) && r % c.BYTES_PER_ELEMENT == 0) {
|
|
1986
1987
|
const t = new c(a, r, i * o);
|
|
@@ -1997,46 +1998,46 @@
|
|
|
1997
1998
|
e(new c(h.buffer), t), n.set(h);
|
|
1998
1999
|
}
|
|
1999
2000
|
}
|
|
2000
|
-
const
|
|
2001
|
-
let
|
|
2001
|
+
const he = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], ue = [ 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1 ], fe = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
|
|
2002
|
+
let le, de = !1;
|
|
2002
2003
|
if ("undefined" != typeof OffscreenCanvas) {
|
|
2003
2004
|
try {
|
|
2004
|
-
|
|
2005
|
+
le = new OffscreenCanvas(2, 2).getContext("2d");
|
|
2005
2006
|
} catch (t) {}
|
|
2006
|
-
|
|
2007
|
+
le && "undefined" != typeof createImageBitmap && (de = !0);
|
|
2007
2008
|
}
|
|
2008
|
-
const
|
|
2009
|
-
class
|
|
2009
|
+
const me = n([]), ye = [ 0, 0, 0 ], be = [], pe = [];
|
|
2010
|
+
class we {
|
|
2010
2011
|
constructor(t, e, n, r) {
|
|
2011
|
-
this.id = t, this.options = e, this.yt = this.requestImage.bind(this), this.bt = new
|
|
2012
|
-
this.pt = new
|
|
2012
|
+
this.id = t, this.options = e, this.yt = this.requestImage.bind(this), this.bt = new re,
|
|
2013
|
+
this.pt = new Yt(this.yt, it), this.wt = new Qt(this.yt, it), this._t = n, this.gt = {},
|
|
2013
2014
|
r(null, {}, []);
|
|
2014
2015
|
}
|
|
2015
2016
|
requestImage(t, e) {
|
|
2016
|
-
|
|
2017
|
-
(void 0).width = t.width, (void 0).height = t.height,
|
|
2018
|
-
const n =
|
|
2017
|
+
de ? fetch(t).then(t => t.blob()).then(t => createImageBitmap(t)).then(t => {
|
|
2018
|
+
(void 0).width = t.width, (void 0).height = t.height, le.drawImage(t, 0, 0);
|
|
2019
|
+
const n = le.getImageData(0, 0, (void 0).width, (void 0).height);
|
|
2019
2020
|
e(null, {
|
|
2020
2021
|
width: t.width,
|
|
2021
2022
|
height: t.height,
|
|
2022
2023
|
data: new Uint8Array(n.data)
|
|
2023
2024
|
});
|
|
2024
|
-
}) : this.
|
|
2025
|
+
}) : this._t("requestImage", {
|
|
2025
2026
|
url: t
|
|
2026
2027
|
}, null, e);
|
|
2027
2028
|
}
|
|
2028
2029
|
loadTile(t, e) {
|
|
2029
2030
|
const n = t.url, r = t.arraybuffer;
|
|
2030
2031
|
if (r) {
|
|
2031
|
-
delete this.
|
|
2032
|
-
const s =
|
|
2032
|
+
delete this.gt[n];
|
|
2033
|
+
const s = vt(new DataView(r), 0);
|
|
2033
2034
|
if ("{" === s[0] || " " === s[0]) {
|
|
2034
2035
|
const t = function(t, e, n) {
|
|
2035
|
-
if (
|
|
2036
|
+
if (fe) {
|
|
2036
2037
|
const r = new Uint8Array(t, e, n);
|
|
2037
|
-
return
|
|
2038
|
+
return fe.decode(r);
|
|
2038
2039
|
}
|
|
2039
|
-
return
|
|
2040
|
+
return dt(new Uint8Array(t, e, n));
|
|
2040
2041
|
}(r, 0, r.byteLength), n = JSON.parse(t);
|
|
2041
2042
|
e(null, n);
|
|
2042
2043
|
} else if ("b3dm" === s) {
|
|
@@ -2060,7 +2061,7 @@
|
|
|
2060
2061
|
e(null, r, i);
|
|
2061
2062
|
});
|
|
2062
2063
|
} else if ("cmpt" === s) {
|
|
2063
|
-
new
|
|
2064
|
+
new ie(this.yt, it).load(n, r).then(n => {
|
|
2064
2065
|
const {content: r, transferables: s} = this.vt(n, t);
|
|
2065
2066
|
e(null, r, s);
|
|
2066
2067
|
}).catch(t => {
|
|
@@ -2071,13 +2072,13 @@
|
|
|
2071
2072
|
const r = this.options.services[t.rootIdx];
|
|
2072
2073
|
let s = r.urlParams;
|
|
2073
2074
|
s && (s = (n.indexOf("?") > 0 ? "&" : "?") + s);
|
|
2074
|
-
let i =
|
|
2075
|
+
let i = z.getArrayBuffer(n + (s || ""), r.ajaxOptions);
|
|
2075
2076
|
const o = i.xhr;
|
|
2076
2077
|
i = i.then(r => {
|
|
2077
|
-
delete this.
|
|
2078
|
+
delete this.gt[n], t.arraybuffer = r && r.data, this.loadTile(t, e);
|
|
2078
2079
|
}).catch(t => {
|
|
2079
|
-
delete this.
|
|
2080
|
-
}), this.
|
|
2080
|
+
delete this.gt[n], e(t);
|
|
2081
|
+
}), this.gt[n] = o;
|
|
2081
2082
|
}
|
|
2082
2083
|
}
|
|
2083
2084
|
vt(t, e) {
|
|
@@ -2089,13 +2090,13 @@
|
|
|
2089
2090
|
const {magic: i} = n[t];
|
|
2090
2091
|
if ("b3dm" === i) {
|
|
2091
2092
|
const {content: i, transferables: o} = this.Tt(n[t], e);
|
|
2092
|
-
|
|
2093
|
+
Te(s, o), r.content.push(i);
|
|
2093
2094
|
} else if ("i3dm" === i || "pnts" === i) {
|
|
2094
2095
|
const {transform: i, rootIdx: o} = e, {content: a, transferables: c} = this.At(n[t], i, o);
|
|
2095
|
-
|
|
2096
|
+
Te(s, c), r.content.push(a);
|
|
2096
2097
|
} else if ("cmpt" === i) {
|
|
2097
2098
|
const {content: i, transferables: o} = this.vt(n[t], e);
|
|
2098
|
-
|
|
2099
|
+
Te(s, o), r.content.push(i);
|
|
2099
2100
|
}
|
|
2100
2101
|
}
|
|
2101
2102
|
return {
|
|
@@ -2116,8 +2117,8 @@
|
|
|
2116
2117
|
let i = r && r.RTC_CENTER || [ 0, 0, 0 ];
|
|
2117
2118
|
if (r.EAST_NORTH_UP && !s.NORMAL_UP && !s.NORMAL_UP_OCT32P) {
|
|
2118
2119
|
const e = new Float32Array(3 * s.POSITION.array.length), n = [], r = [], o = [];
|
|
2119
|
-
|
|
2120
|
-
h(o, t, i),
|
|
2120
|
+
ce(s.POSITION, (t, s) => {
|
|
2121
|
+
h(o, t, i), Gt(o, null, n), function(t, e) {
|
|
2121
2122
|
t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[4], t[4] = e[5], t[5] = e[6], t[6] = e[8],
|
|
2122
2123
|
t[7] = e[9], t[8] = e[10];
|
|
2123
2124
|
}(r, n);
|
|
@@ -2141,9 +2142,9 @@
|
|
|
2141
2142
|
hmin: 1 / 0,
|
|
2142
2143
|
hmax: -1 / 0
|
|
2143
2144
|
};
|
|
2144
|
-
|
|
2145
|
-
const c =
|
|
2146
|
-
|
|
2145
|
+
_e(s.POSITION.array, 3, i, me, o);
|
|
2146
|
+
const c = ge(o), u = a([], c);
|
|
2147
|
+
ce(s.POSITION, t => {
|
|
2147
2148
|
t[0] = t[0] + i[0] - u[0], t[1] = t[1] + i[1] - u[1], t[2] = t[2] + i[2] - u[2];
|
|
2148
2149
|
}), e && y(c, c, e);
|
|
2149
2150
|
const f = this.Mt(c);
|
|
@@ -2171,12 +2172,12 @@
|
|
|
2171
2172
|
}
|
|
2172
2173
|
}
|
|
2173
2174
|
abortTileLoading(t, e) {
|
|
2174
|
-
const n = this.
|
|
2175
|
-
n && n.abort(), delete this.
|
|
2175
|
+
const n = this.gt[t.url];
|
|
2176
|
+
n && n.abort(), delete this.gt[t.url], e(null);
|
|
2176
2177
|
}
|
|
2177
2178
|
convertCoordinates(t, e, s, i) {
|
|
2178
|
-
let o = e && e.RTC_CENTER || t.extensions && t.extensions.CESIUM_RTC && t.extensions.CESIUM_RTC.center, c =
|
|
2179
|
-
"X" === (s = s && s.toUpperCase()) ? c =
|
|
2179
|
+
let o = e && e.RTC_CENTER || t.extensions && t.extensions.CESIUM_RTC && t.extensions.CESIUM_RTC.center, c = he;
|
|
2180
|
+
"X" === (s = s && s.toUpperCase()) ? c = ue : "Z" === s && (c = me), t.extensions = t.extensions || {},
|
|
2180
2181
|
t.extensions.CESIUM_RTC || (t.extensions.CESIUM_RTC = {}), o && (t.extensions.CESIUM_RTC.center = o);
|
|
2181
2182
|
const h = {
|
|
2182
2183
|
xmin: 1 / 0,
|
|
@@ -2186,42 +2187,42 @@
|
|
|
2186
2187
|
hmin: 1 / 0,
|
|
2187
2188
|
hmax: -1 / 0
|
|
2188
2189
|
};
|
|
2189
|
-
|
|
2190
|
+
oe(t, t => {
|
|
2190
2191
|
if (!(t.attributes && t.attributes.POSITION)) return;
|
|
2191
|
-
const e = n(
|
|
2192
|
+
const e = n(be);
|
|
2192
2193
|
if (t.matrices) for (let n = t.matrices.length - 1; n >= 0; n--) r(e, e, t.matrices[n]);
|
|
2193
2194
|
const s = t.attributes.POSITION.array, i = t.attributes.POSITION.itemSize;
|
|
2194
|
-
r(e, c, e),
|
|
2195
|
+
r(e, c, e), _e(s, i, o || ye, e, h);
|
|
2195
2196
|
});
|
|
2196
|
-
const u =
|
|
2197
|
-
i && y(u, u, i), t.extensions.CESIUM_RTC.coord = this.Mt(u), o || (
|
|
2197
|
+
const u = ge(h), f = a([], u);
|
|
2198
|
+
i && y(u, u, i), t.extensions.CESIUM_RTC.coord = this.Mt(u), o || (oe(t, t => {
|
|
2198
2199
|
if (t.attributes && t.attributes.POSITION) {
|
|
2199
2200
|
const e = t.attributes.POSITION;
|
|
2200
2201
|
if (e.array.buffer.projected && e.array.buffer.projected[e.byteOffset]) return;
|
|
2201
|
-
const s = n(
|
|
2202
|
+
const s = n(be);
|
|
2202
2203
|
if (t.matrices) for (let e = t.matrices.length - 1; e >= 0; e--) r(s, s, t.matrices[e]);
|
|
2203
2204
|
r(s, c, s);
|
|
2204
2205
|
const i = function(t, e) {
|
|
2205
|
-
var n = e[0], r = e[1], s = e[2], i = e[3], o = e[4], a = e[5], c = e[6], h = e[7], u = e[8], f = e[9], l = e[10], d = e[11], m = e[12], y = e[13], b = e[14], p = e[15], w = n * a - r * o,
|
|
2206
|
-
return
|
|
2207
|
-
t[2] = (y * v - b * A + p * T) *
|
|
2208
|
-
t[5] = (n * N - s * S + i * M) *
|
|
2209
|
-
t[8] = (o * I - a * S + h * O) *
|
|
2210
|
-
t[11] = (f *
|
|
2211
|
-
t[14] = (y *
|
|
2212
|
-
}(
|
|
2213
|
-
|
|
2206
|
+
var n = e[0], r = e[1], s = e[2], i = e[3], o = e[4], a = e[5], c = e[6], h = e[7], u = e[8], f = e[9], l = e[10], d = e[11], m = e[12], y = e[13], b = e[14], p = e[15], w = n * a - r * o, _ = n * c - s * o, g = n * h - i * o, T = r * c - s * a, A = r * h - i * a, v = s * h - i * c, O = u * y - f * m, M = u * b - l * m, S = u * p - d * m, x = f * b - l * y, I = f * p - d * y, N = l * p - d * b, E = w * N - _ * I + g * x + T * S - A * M + v * O;
|
|
2207
|
+
return E ? (E = 1 / E, t[0] = (a * N - c * I + h * x) * E, t[1] = (s * I - r * N - i * x) * E,
|
|
2208
|
+
t[2] = (y * v - b * A + p * T) * E, t[3] = (l * A - f * v - d * T) * E, t[4] = (c * S - o * N - h * M) * E,
|
|
2209
|
+
t[5] = (n * N - s * S + i * M) * E, t[6] = (b * g - m * v - p * _) * E, t[7] = (u * v - l * g + d * _) * E,
|
|
2210
|
+
t[8] = (o * I - a * S + h * O) * E, t[9] = (r * S - n * I - i * O) * E, t[10] = (m * A - y * g + p * w) * E,
|
|
2211
|
+
t[11] = (f * g - u * A - d * w) * E, t[12] = (a * M - o * x - c * O) * E, t[13] = (n * x - r * M + s * O) * E,
|
|
2212
|
+
t[14] = (y * _ - m * T - b * w) * E, t[15] = (u * T - f * _ + l * w) * E, t) : null;
|
|
2213
|
+
}(pe, s);
|
|
2214
|
+
ce(e, t => {
|
|
2214
2215
|
y(t, t, s), t[0] = t[0] - f[0], t[1] = t[1] - f[1], t[2] = t[2] - f[2], y(t, t, i);
|
|
2215
2216
|
}), e.array.buffer.projected || (e.array.buffer.projected = {}), e.array.buffer.projected[e.byteOffset] = 1;
|
|
2216
2217
|
}
|
|
2217
2218
|
}), t.extensions.CESIUM_RTC.center = f);
|
|
2218
2219
|
}
|
|
2219
2220
|
Mt(t) {
|
|
2220
|
-
return 0 === w(t) ? c([], 0, 0, -6378137) :
|
|
2221
|
+
return 0 === w(t) ? c([], 0, 0, -6378137) : _t([], t);
|
|
2221
2222
|
}
|
|
2222
2223
|
onRemove() {}
|
|
2223
2224
|
}
|
|
2224
|
-
function
|
|
2225
|
+
function _e(t, e, n, r, s) {
|
|
2225
2226
|
const i = [];
|
|
2226
2227
|
for (let o = 0, a = t.length; o < a; o += e) {
|
|
2227
2228
|
const {xmin: a, ymin: u, xmax: f, ymax: l, hmin: d, hmax: m} = s;
|
|
@@ -2231,23 +2232,23 @@
|
|
|
2231
2232
|
b[1] > l && (s.ymax = b[1]), e > 2 && (b[2] < d && (s.hmin = b[2]), b[2] > m && (s.hmax = b[2]));
|
|
2232
2233
|
}
|
|
2233
2234
|
}
|
|
2234
|
-
function
|
|
2235
|
+
function ge(t) {
|
|
2235
2236
|
const {xmax: e, ymax: n, xmin: r, ymin: s, hmin: i, hmax: o} = t, a = [ (r + e) / 2, (s + n) / 2, (i + o) / 2 ];
|
|
2236
2237
|
return e === -1 / 0 && (a[0] = 0), n === -1 / 0 && (a[1] = 0), o === -1 / 0 && (a[2] = 0),
|
|
2237
2238
|
isNaN(a[2]) && (a[2] = 0), a;
|
|
2238
2239
|
}
|
|
2239
|
-
function
|
|
2240
|
+
function Te(t, e) {
|
|
2240
2241
|
for (let n = 0; n < e.length; n++) t.indexOf(e[n]) < 0 && t.push(e[n]);
|
|
2241
2242
|
}
|
|
2242
|
-
let
|
|
2243
|
-
class
|
|
2243
|
+
let Ae = 0;
|
|
2244
|
+
class ve {
|
|
2244
2245
|
constructor(t) {
|
|
2245
2246
|
this.workerId = t, this.workers = {}, this.St = {};
|
|
2246
2247
|
}
|
|
2247
2248
|
addLayer({actorId: t, mapId: e, layerId: n, params: r}, s) {
|
|
2248
2249
|
if (this.xt(e, n)) return;
|
|
2249
2250
|
const i = this.It(e, n), o = r.options, a = this.send.bind(this, t);
|
|
2250
|
-
this.workers[i] = new
|
|
2251
|
+
this.workers[i] = new we(n, o, a, s);
|
|
2251
2252
|
}
|
|
2252
2253
|
removeLayer({mapId: t, layerId: e}, n) {
|
|
2253
2254
|
const r = this.xt(t, e), s = this.It(t, e);
|
|
@@ -2266,7 +2267,7 @@
|
|
|
2266
2267
|
delete this.St[e], n && t.error ? n(new Error(t.error)) : n && n(null, t.data);
|
|
2267
2268
|
}
|
|
2268
2269
|
send(t, e, n, r, s) {
|
|
2269
|
-
const i = s ? `${t}-${
|
|
2270
|
+
const i = s ? `${t}-${Ae++}` : null;
|
|
2270
2271
|
s && (this.St[i] = s), postMessage({
|
|
2271
2272
|
type: "<request>",
|
|
2272
2273
|
workerId: this.workerId,
|
|
@@ -2286,7 +2287,7 @@
|
|
|
2286
2287
|
}
|
|
2287
2288
|
t.initialize = function() {}, t.onmessage = function(t, e) {
|
|
2288
2289
|
const n = t.data;
|
|
2289
|
-
this.dispatcher || (this.dispatcher = new
|
|
2290
|
+
this.dispatcher || (this.dispatcher = new ve(t.workerId)), "<response>" === t.type ? this.dispatcher.workerId === t.workerId && this.dispatcher.receive(t) : this.dispatcher[n.command]({
|
|
2290
2291
|
actorId: n.actorId,
|
|
2291
2292
|
mapId: n.mapId,
|
|
2292
2293
|
layerId: n.layerId,
|
|
@@ -2334,9 +2335,9 @@
|
|
|
2334
2335
|
return !(h <= -c);
|
|
2335
2336
|
}
|
|
2336
2337
|
function u(t) {
|
|
2337
|
-
var e = t, n = e[0], r = e[1], s = e[2], o = e[3], a = e[4], c = e[5], h = e[6], u = e[7], l = e[8], d = e[9], m = e[10], y = e[11], b = e[12], p = e[13], w = e[14],
|
|
2338
|
-
f(i[0], o - n, u - a, y - l,
|
|
2339
|
-
f(i[3], o - r, u - c, y - d,
|
|
2338
|
+
var e = t, n = e[0], r = e[1], s = e[2], o = e[3], a = e[4], c = e[5], h = e[6], u = e[7], l = e[8], d = e[9], m = e[10], y = e[11], b = e[12], p = e[13], w = e[14], _ = e[15];
|
|
2339
|
+
f(i[0], o - n, u - a, y - l, _ - b), f(i[1], o + n, u + a, y + l, _ + b), f(i[2], o + r, u + c, y + d, _ + p),
|
|
2340
|
+
f(i[3], o - r, u - c, y - d, _ - p), f(i[4], o - s, u - h, y - m, _ - w), f(i[5], o + s, u + h, y + m, _ + w);
|
|
2340
2341
|
}
|
|
2341
2342
|
function f(t, e, n, r, s) {
|
|
2342
2343
|
return t[0] = e * (1 / 6), t[1] = n * (1 / 6), t[2] = r * (1 / 6), t[3] = s * (1 / 6),
|
|
@@ -2368,17 +2369,17 @@
|
|
|
2368
2369
|
let e = document.createElement("a");
|
|
2369
2370
|
return e.href = t, t = e.href, e = null, t;
|
|
2370
2371
|
}
|
|
2371
|
-
function
|
|
2372
|
+
function _(t) {
|
|
2372
2373
|
return Math.sign ? Math.sign(t) : 0 === (t = +t) || isNaN(t) ? Number(t) : t > 0 ? 1 : -1;
|
|
2373
2374
|
}
|
|
2374
|
-
const
|
|
2375
|
+
const g = [ 1, 1, 1, 1, 2, 2, 3, 0 ];
|
|
2375
2376
|
function T(t) {
|
|
2376
2377
|
const e = t.length;
|
|
2377
2378
|
let n = "";
|
|
2378
2379
|
for (let r = 0; r < e; ) {
|
|
2379
2380
|
let s = t[r++];
|
|
2380
2381
|
if (128 & s) {
|
|
2381
|
-
let n =
|
|
2382
|
+
let n = g[s >> 3 & 7];
|
|
2382
2383
|
if (!(64 & s) || !n || r + n > e) return null;
|
|
2383
2384
|
for (s &= 63 >> n; n > 0; n -= 1) {
|
|
2384
2385
|
const e = t[r++];
|
|
@@ -2415,7 +2416,7 @@
|
|
|
2415
2416
|
toRadian: b,
|
|
2416
2417
|
toDegree: p,
|
|
2417
2418
|
getAbsoluteURL: w,
|
|
2418
|
-
sign:
|
|
2419
|
+
sign: _,
|
|
2419
2420
|
stringFromUTF8Array: T,
|
|
2420
2421
|
setColumn3: A,
|
|
2421
2422
|
flatArr: v,
|
|
@@ -2424,21 +2425,21 @@
|
|
|
2424
2425
|
base64URLToArrayBuffer: S
|
|
2425
2426
|
}), I = "undefined" != typeof Float32Array ? Float32Array : Array;
|
|
2426
2427
|
function N(t, e, n) {
|
|
2427
|
-
var r = e[0], s = e[1], i = e[2], o = e[3], a = e[4], c = e[5], h = e[6], u = e[7], f = e[8], l = e[9], d = e[10], m = e[11], y = e[12], b = e[13], p = e[14], w = e[15],
|
|
2428
|
-
return t[0] =
|
|
2429
|
-
t[2] =
|
|
2430
|
-
|
|
2431
|
-
t[6] =
|
|
2432
|
-
|
|
2433
|
-
t[10] =
|
|
2434
|
-
|
|
2435
|
-
t[14] =
|
|
2436
|
-
}
|
|
2437
|
-
function
|
|
2428
|
+
var r = e[0], s = e[1], i = e[2], o = e[3], a = e[4], c = e[5], h = e[6], u = e[7], f = e[8], l = e[9], d = e[10], m = e[11], y = e[12], b = e[13], p = e[14], w = e[15], _ = n[0], g = n[1], T = n[2], A = n[3];
|
|
2429
|
+
return t[0] = _ * r + g * a + T * f + A * y, t[1] = _ * s + g * c + T * l + A * b,
|
|
2430
|
+
t[2] = _ * i + g * h + T * d + A * p, t[3] = _ * o + g * u + T * m + A * w, _ = n[4],
|
|
2431
|
+
g = n[5], T = n[6], A = n[7], t[4] = _ * r + g * a + T * f + A * y, t[5] = _ * s + g * c + T * l + A * b,
|
|
2432
|
+
t[6] = _ * i + g * h + T * d + A * p, t[7] = _ * o + g * u + T * m + A * w, _ = n[8],
|
|
2433
|
+
g = n[9], T = n[10], A = n[11], t[8] = _ * r + g * a + T * f + A * y, t[9] = _ * s + g * c + T * l + A * b,
|
|
2434
|
+
t[10] = _ * i + g * h + T * d + A * p, t[11] = _ * o + g * u + T * m + A * w, _ = n[12],
|
|
2435
|
+
g = n[13], T = n[14], A = n[15], t[12] = _ * r + g * a + T * f + A * y, t[13] = _ * s + g * c + T * l + A * b,
|
|
2436
|
+
t[14] = _ * i + g * h + T * d + A * p, t[15] = _ * o + g * u + T * m + A * w, t;
|
|
2437
|
+
}
|
|
2438
|
+
function E() {
|
|
2438
2439
|
var t = new I(3);
|
|
2439
2440
|
return I != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0), t;
|
|
2440
2441
|
}
|
|
2441
|
-
function
|
|
2442
|
+
function P(t) {
|
|
2442
2443
|
var e = t[0], n = t[1], r = t[2];
|
|
2443
2444
|
return Math.sqrt(e * e + n * n + r * r);
|
|
2444
2445
|
}
|
|
@@ -2469,11 +2470,11 @@
|
|
|
2469
2470
|
function k(t, e) {
|
|
2470
2471
|
return t[0] * e[0] + t[1] * e[1] + t[2] * e[2];
|
|
2471
2472
|
}
|
|
2472
|
-
function
|
|
2473
|
+
function z(t, e, n) {
|
|
2473
2474
|
var r = e[0], s = e[1], i = e[2], o = n[0], a = n[1], c = n[2];
|
|
2474
2475
|
return t[0] = s * c - i * a, t[1] = i * o - r * c, t[2] = r * a - s * o, t;
|
|
2475
2476
|
}
|
|
2476
|
-
var
|
|
2477
|
+
var j = L, V = R, G = P;
|
|
2477
2478
|
function H(t, e, n, r, s) {
|
|
2478
2479
|
return t[0] = e, t[1] = n, t[2] = r, t[3] = s, t;
|
|
2479
2480
|
}
|
|
@@ -2488,14 +2489,14 @@
|
|
|
2488
2489
|
b = Math.sin(r * l) / m) : (y = 1 - r, b = r), t[0] = y * s + b * c, t[1] = y * i + b * h,
|
|
2489
2490
|
t[2] = y * o + b * u, t[3] = y * a + b * f, t;
|
|
2490
2491
|
}
|
|
2491
|
-
|
|
2492
|
+
E(), function() {
|
|
2492
2493
|
var t, e = (t = new I(4), I != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0, t[3] = 0),
|
|
2493
2494
|
t);
|
|
2494
2495
|
}();
|
|
2495
2496
|
var J, K = function(t, e) {
|
|
2496
2497
|
return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t;
|
|
2497
2498
|
};
|
|
2498
|
-
|
|
2499
|
+
E(), C(1, 0, 0), C(0, 1, 0), q(), q(), J = new I(9), I != Float32Array && (J[1] = 0,
|
|
2499
2500
|
J[2] = 0, J[3] = 0, J[5] = 0, J[6] = 0, J[7] = 0), J[0] = 1, J[4] = 1, J[8] = 1;
|
|
2500
2501
|
/*!
|
|
2501
2502
|
* @maptalks/gltf-loader v0.23.1
|
|
@@ -2607,19 +2608,20 @@
|
|
|
2607
2608
|
getArrayBuffer: (t, e = {}) => (e || (e = {}), e.responseType = "arraybuffer", ft.get(t, e)),
|
|
2608
2609
|
getJSON: function(t, e = {}) {
|
|
2609
2610
|
return e && e.jsonp ? ft.jsonp(t) : ((e = e || {}).responseType = "json", ft.get(t, e));
|
|
2610
|
-
},
|
|
2611
|
-
jsonp: function(t) {
|
|
2612
|
-
const e = "_maptalks_jsonp_" + X++;
|
|
2613
|
-
t.match(/\?/) ? t += "&callback=" + e : t += "?callback=" + e;
|
|
2614
|
-
let n = document.createElement("script");
|
|
2615
|
-
return n.type = "text/javascript", n.src = t, new Promise(t => {
|
|
2616
|
-
window[e] = function(r) {
|
|
2617
|
-
document.getElementsByTagName("head")[0].removeChild(n), n = null, delete window[e],
|
|
2618
|
-
t(r);
|
|
2619
|
-
}, document.getElementsByTagName("head")[0].appendChild(n);
|
|
2620
|
-
});
|
|
2621
2611
|
}
|
|
2622
|
-
}
|
|
2612
|
+
};
|
|
2613
|
+
ft.jsonp = function(t) {
|
|
2614
|
+
const e = "_maptalks_jsonp_" + X++;
|
|
2615
|
+
t.match(/\?/) ? t += "&callback=" + e : t += "?callback=" + e;
|
|
2616
|
+
let n = document.createElement("script");
|
|
2617
|
+
return n.type = "text/javascript", n.src = t, new Promise(t => {
|
|
2618
|
+
window[e] = function(r) {
|
|
2619
|
+
document.getElementsByTagName("head")[0].removeChild(n), n = null, delete window[e],
|
|
2620
|
+
t(r);
|
|
2621
|
+
}, document.getElementsByTagName("head")[0].appendChild(n);
|
|
2622
|
+
});
|
|
2623
|
+
};
|
|
2624
|
+
const lt = [ "SCALAR", 1, "VEC2", 2, "VEC3", 3, "VEC4", 4, "MAT2", 4, "MAT3", 9, "MAT4", 16 ];
|
|
2623
2625
|
class dt {
|
|
2624
2626
|
constructor(t, e, n) {
|
|
2625
2627
|
this.rootPath = t, this.gltf = e, this.i = !1, this.glbBuffer = n, this.buffers = {},
|
|
@@ -2672,7 +2674,8 @@
|
|
|
2672
2674
|
});
|
|
2673
2675
|
}
|
|
2674
2676
|
u(t, e, n, r = 0) {
|
|
2675
|
-
const s = this.gltf, i = s.accessors[e], o = void 0 !== i.bufferView ? s.bufferViews[i.bufferView] : {}, a = (o.byteOffset || 0) + r, c = this.m(i.type), h = Q(i.componentType), u = o.byteStride || 0
|
|
2677
|
+
const s = this.gltf, i = s.accessors[e], o = void 0 !== i.bufferView ? s.bufferViews[i.bufferView] : {}, a = (o.byteOffset || 0) + r, c = this.m(i.type), h = Q(i.componentType), u = o.byteStride || 0;
|
|
2678
|
+
const f = {
|
|
2676
2679
|
array: void 0,
|
|
2677
2680
|
name: t,
|
|
2678
2681
|
accessorName: e,
|
|
@@ -2778,7 +2781,7 @@
|
|
|
2778
2781
|
}
|
|
2779
2782
|
return e;
|
|
2780
2783
|
}
|
|
2781
|
-
|
|
2784
|
+
_(t) {
|
|
2782
2785
|
const e = {};
|
|
2783
2786
|
for (const n in t) {
|
|
2784
2787
|
const r = t[n];
|
|
@@ -2786,7 +2789,7 @@
|
|
|
2786
2789
|
r.instanceTechnique && r.instanceTechnique.values ? (s = r.instanceTechnique, i = s.values.diffuse) : (s = r,
|
|
2787
2790
|
i = s.values.tex || s.values.diffuseTex || s.values.diffuse);
|
|
2788
2791
|
const o = {
|
|
2789
|
-
baseColorTexture: {
|
|
2792
|
+
"baseColorTexture": {
|
|
2790
2793
|
index: i
|
|
2791
2794
|
}
|
|
2792
2795
|
};
|
|
@@ -2795,7 +2798,7 @@
|
|
|
2795
2798
|
}
|
|
2796
2799
|
return e;
|
|
2797
2800
|
}
|
|
2798
|
-
|
|
2801
|
+
g(t) {
|
|
2799
2802
|
if (t.bufferView || t.extensions && (t.extensions.KHR_binary_glTF || t.extensions.binary_glTF)) {
|
|
2800
2803
|
const e = t.bufferView ? t : t.extensions.KHR_binary_glTF || t.extensions.binary_glTF;
|
|
2801
2804
|
if (t.extensions && (t.mimeType = e.mimeType, t.width = e.width, t.height = e.height),
|
|
@@ -2805,7 +2808,8 @@
|
|
|
2805
2808
|
}
|
|
2806
2809
|
{
|
|
2807
2810
|
const e = t.uri, n = this.rootPath + "/" + e;
|
|
2808
|
-
|
|
2811
|
+
if (this.requests[n]) return this.requests[n].then(() => this.buffers[n]);
|
|
2812
|
+
return this.requests[n] = ft.getArrayBuffer(n, null).then(t => {
|
|
2809
2813
|
const e = t.data;
|
|
2810
2814
|
return this.buffers[n] = e, new Uint8Array(e);
|
|
2811
2815
|
});
|
|
@@ -2815,7 +2819,7 @@
|
|
|
2815
2819
|
const e = this.gltf.textures[t];
|
|
2816
2820
|
if (!e) return null;
|
|
2817
2821
|
const n = this.gltf.images[e.source];
|
|
2818
|
-
return this.
|
|
2822
|
+
return this.g(n).then(t => {
|
|
2819
2823
|
const r = this.gltf.samplers[e.sampler];
|
|
2820
2824
|
return {
|
|
2821
2825
|
image: {
|
|
@@ -2876,7 +2880,7 @@
|
|
|
2876
2880
|
const e = this.gltf.textures[t];
|
|
2877
2881
|
if (!e) return null;
|
|
2878
2882
|
const n = this.gltf.images[e.source];
|
|
2879
|
-
return this.
|
|
2883
|
+
return this.g(n).then(t => {
|
|
2880
2884
|
if (!t) return null;
|
|
2881
2885
|
const r = {
|
|
2882
2886
|
image: {
|
|
@@ -2895,7 +2899,7 @@
|
|
|
2895
2899
|
return s && (r.sampler = s), t.format && (r.format = t.format), r;
|
|
2896
2900
|
});
|
|
2897
2901
|
}
|
|
2898
|
-
|
|
2902
|
+
g(t) {
|
|
2899
2903
|
if (!W(t.bufferView)) return this.v(t);
|
|
2900
2904
|
{
|
|
2901
2905
|
const e = this.gltf.bufferViews[t.bufferView];
|
|
@@ -2908,7 +2912,8 @@
|
|
|
2908
2912
|
}
|
|
2909
2913
|
v(t) {
|
|
2910
2914
|
const e = 0 === t.uri.indexOf("data:image/") ? t.uri : this.rootPath + "/" + t.uri;
|
|
2911
|
-
|
|
2915
|
+
if (this.requests[t.id]) return this.requests[t.id].then(() => this.images[t.id]);
|
|
2916
|
+
return this.requests[t.id] = this.S(t.id, e);
|
|
2912
2917
|
}
|
|
2913
2918
|
I(t, e) {
|
|
2914
2919
|
const n = this.decoders;
|
|
@@ -2959,7 +2964,8 @@
|
|
|
2959
2964
|
P(t, e) {
|
|
2960
2965
|
const n = new Array(t.byteLength);
|
|
2961
2966
|
for (let e = 0; e < t.byteLength; e++) n[e] = String.fromCharCode(t[e]);
|
|
2962
|
-
|
|
2967
|
+
n.join("");
|
|
2968
|
+
return "data:" + (e = e || "image/png") + ";base64," + function(t) {
|
|
2963
2969
|
return "undefined" != typeof self ? self.btoa(t) : window.btoa(t);
|
|
2964
2970
|
}(unescape(encodeURIComponent(n)));
|
|
2965
2971
|
}
|
|
@@ -2983,19 +2989,19 @@
|
|
|
2983
2989
|
});
|
|
2984
2990
|
}
|
|
2985
2991
|
}
|
|
2986
|
-
const bt = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
|
|
2987
|
-
class
|
|
2992
|
+
const bt = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null, pt = 1313821514, wt = 5130562;
|
|
2993
|
+
class _t {
|
|
2988
2994
|
static read(t, e = 0, n = 0) {
|
|
2989
2995
|
n || (n = t.byteLength);
|
|
2990
2996
|
const r = new DataView(t, e, n), s = r.getUint32(4, !0);
|
|
2991
|
-
if (1 === s) return
|
|
2992
|
-
if (2 === s) return
|
|
2997
|
+
if (1 === s) return _t.readV1(r, e);
|
|
2998
|
+
if (2 === s) return _t.readV2(t, e);
|
|
2993
2999
|
throw new Error("Unsupported glb version : " + s);
|
|
2994
3000
|
}
|
|
2995
3001
|
static readV1(t, e) {
|
|
2996
3002
|
const n = t.getUint32(8, !0), r = t.getUint32(12, !0);
|
|
2997
3003
|
if (n !== t.byteLength) throw new Error("Length in GLB header is inconsistent with glb's byte length.");
|
|
2998
|
-
const s =
|
|
3004
|
+
const s = gt(t.buffer, 20 + e, r);
|
|
2999
3005
|
return {
|
|
3000
3006
|
json: JSON.parse(s),
|
|
3001
3007
|
glbBuffer: {
|
|
@@ -3013,7 +3019,7 @@
|
|
|
3013
3019
|
const a = i.getUint32(o, !0);
|
|
3014
3020
|
o += 4;
|
|
3015
3021
|
const c = i.getUint32(o, !0);
|
|
3016
|
-
if (o += 4,
|
|
3022
|
+
if (o += 4, c === pt) n = gt(t, e + 12 + o, a); else if (c === wt) {
|
|
3017
3023
|
s = e + 12 + o, r = a;
|
|
3018
3024
|
break;
|
|
3019
3025
|
}
|
|
@@ -3029,7 +3035,7 @@
|
|
|
3029
3035
|
};
|
|
3030
3036
|
}
|
|
3031
3037
|
}
|
|
3032
|
-
function
|
|
3038
|
+
function gt(t, e, n) {
|
|
3033
3039
|
if (bt) {
|
|
3034
3040
|
const r = new Uint8Array(t, e, n);
|
|
3035
3041
|
return bt.decode(r);
|
|
@@ -3040,7 +3046,7 @@
|
|
|
3040
3046
|
for (let r = 0; r < e; ) {
|
|
3041
3047
|
let s = t[r++];
|
|
3042
3048
|
if (128 & s) {
|
|
3043
|
-
let n =
|
|
3049
|
+
let n = Tt[s >> 3 & 7];
|
|
3044
3050
|
if (!(64 & s) || !n || r + n > e) return null;
|
|
3045
3051
|
for (s &= 63 >> n; n > 0; n -= 1) {
|
|
3046
3052
|
const e = t[r++];
|
|
@@ -3053,17 +3059,18 @@
|
|
|
3053
3059
|
return n;
|
|
3054
3060
|
}(new Uint8Array(t, e, n));
|
|
3055
3061
|
}
|
|
3056
|
-
const
|
|
3062
|
+
const Tt = [ 1, 1, 1, 1, 2, 2, 3, 0 ];
|
|
3063
|
+
const At = [ 0, 0, 0 ], vt = [ 0, 0, 0, 1 ], Ot = [ 1, 1, 1 ], Mt = {
|
|
3057
3064
|
TRANSLATION: [ 0, 0, 0 ],
|
|
3058
3065
|
ROTATION: [ 0, 0, 0, 1 ],
|
|
3059
3066
|
SCALE: [ 1, 1, 1 ]
|
|
3060
|
-
},
|
|
3067
|
+
}, St = {
|
|
3061
3068
|
PREVIOUS: null,
|
|
3062
3069
|
NEXT: null,
|
|
3063
3070
|
PREINDEX: null,
|
|
3064
3071
|
NEXTINDEX: null,
|
|
3065
3072
|
INTERPOLATION: null
|
|
3066
|
-
},
|
|
3073
|
+
}, xt = {
|
|
3067
3074
|
C(t, e, n, r, s, i, o, a) {
|
|
3068
3075
|
const c = W(t) ? e.animations : [ e.animations[0] ], h = {};
|
|
3069
3076
|
for (let e = 0; e < c.length; e++) {
|
|
@@ -3072,9 +3079,9 @@
|
|
|
3072
3079
|
const f = u.channelsMap[n];
|
|
3073
3080
|
if (f) for (let t = 0; t < f.length; t++) {
|
|
3074
3081
|
const e = f[t];
|
|
3075
|
-
"translation" === e.target.path ? (this.U(s, u.samplers[e.sampler], r, 1), h.translation = U(
|
|
3076
|
-
h.rotation = K(
|
|
3077
|
-
h.scale = U(
|
|
3082
|
+
"translation" === e.target.path ? (this.U(s, u.samplers[e.sampler], r, 1), h.translation = U(At, s)) : "rotation" === e.target.path ? (this.B(i, u.samplers[e.sampler], r, 1),
|
|
3083
|
+
h.rotation = K(vt, i)) : "scale" === e.target.path ? (this.U(o, u.samplers[e.sampler], r, 1),
|
|
3084
|
+
h.scale = U(Ot, o)) : "weights" === e.target.path && a && (this.U(a, u.samplers[e.sampler], r, a.length),
|
|
3078
3085
|
h.weights = a);
|
|
3079
3086
|
}
|
|
3080
3087
|
}
|
|
@@ -3084,7 +3091,7 @@
|
|
|
3084
3091
|
switch (e.interpolation) {
|
|
3085
3092
|
case "LINEAR":
|
|
3086
3093
|
{
|
|
3087
|
-
const s = this.L(
|
|
3094
|
+
const s = this.L(St, e, n, 1 * r);
|
|
3088
3095
|
s && (t = function(t, e, n, r) {
|
|
3089
3096
|
for (let s = 0; s < t.length; s++) t[s] = e[s] + r * (n[s] - e[s]);
|
|
3090
3097
|
return t;
|
|
@@ -3094,7 +3101,7 @@
|
|
|
3094
3101
|
|
|
3095
3102
|
case "STEP":
|
|
3096
3103
|
{
|
|
3097
|
-
const s = this.L(
|
|
3104
|
+
const s = this.L(St, e, n, 1 * r);
|
|
3098
3105
|
s && (t = function(t, e) {
|
|
3099
3106
|
for (let n = 0; n < t.length; n++) t[n] = e[n];
|
|
3100
3107
|
return t;
|
|
@@ -3104,7 +3111,7 @@
|
|
|
3104
3111
|
|
|
3105
3112
|
case "CUBICSPLINE":
|
|
3106
3113
|
{
|
|
3107
|
-
const s = this.L(
|
|
3114
|
+
const s = this.L(St, e, n, 3 * r);
|
|
3108
3115
|
s && (t = this.R(t, s, e.input.array, 3 * r));
|
|
3109
3116
|
break;
|
|
3110
3117
|
}
|
|
@@ -3115,21 +3122,21 @@
|
|
|
3115
3122
|
switch (e.interpolation) {
|
|
3116
3123
|
case "LINEAR":
|
|
3117
3124
|
{
|
|
3118
|
-
const r = this.L(
|
|
3125
|
+
const r = this.L(St, e, n, 1);
|
|
3119
3126
|
r && $(t, r.PREVIOUS, r.NEXT, r.INTERPOLATION);
|
|
3120
3127
|
break;
|
|
3121
3128
|
}
|
|
3122
3129
|
|
|
3123
3130
|
case "STEP":
|
|
3124
3131
|
{
|
|
3125
|
-
const r = this.L(
|
|
3132
|
+
const r = this.L(St, e, n, 1);
|
|
3126
3133
|
r && (t = H(t, ...r.PREVIOUS));
|
|
3127
3134
|
break;
|
|
3128
3135
|
}
|
|
3129
3136
|
|
|
3130
3137
|
case "CUBICSPLINE":
|
|
3131
3138
|
{
|
|
3132
|
-
const r = this.L(
|
|
3139
|
+
const r = this.L(St, e, n, 3);
|
|
3133
3140
|
if (r) {
|
|
3134
3141
|
for (let t = 0; t < r.PREVIOUS.length; t++) r.PREVIOUS[t] = Math.acos(r.PREVIOUS[t]),
|
|
3135
3142
|
r.NEXT[t] = Math.acos(r.NEXT[t]);
|
|
@@ -3180,7 +3187,8 @@
|
|
|
3180
3187
|
},
|
|
3181
3188
|
getAnimationClip(t, e, n, r) {
|
|
3182
3189
|
const s = t.nodes[e] && t.nodes[e].weights;
|
|
3183
|
-
|
|
3190
|
+
B(At, ...Mt.TRANSLATION), H(vt, ...Mt.ROTATION), B(Ot, ...Mt.SCALE);
|
|
3191
|
+
return this.C(r, t, e, n, At, vt, Ot, s);
|
|
3184
3192
|
},
|
|
3185
3193
|
getTimeSpan(t) {
|
|
3186
3194
|
if (!t.animations) return null;
|
|
@@ -3205,20 +3213,20 @@
|
|
|
3205
3213
|
return n ? W(e) ? n[e] : n[Object.keys(n)[0]] : null;
|
|
3206
3214
|
}
|
|
3207
3215
|
};
|
|
3208
|
-
let
|
|
3216
|
+
let It = !1;
|
|
3209
3217
|
if ("undefined" != typeof OffscreenCanvas) {
|
|
3210
3218
|
let t;
|
|
3211
3219
|
try {
|
|
3212
3220
|
t = new OffscreenCanvas(2, 2).getContext("2d");
|
|
3213
|
-
} catch (
|
|
3214
|
-
t && "undefined" != typeof createImageBitmap && (
|
|
3221
|
+
} catch (t) {}
|
|
3222
|
+
t && "undefined" != typeof createImageBitmap && (It = !0);
|
|
3215
3223
|
}
|
|
3216
|
-
const
|
|
3217
|
-
class
|
|
3224
|
+
const Nt = "undefined" == typeof document ? null : document.createElement("canvas");
|
|
3225
|
+
class Et {
|
|
3218
3226
|
constructor(t, e, n) {
|
|
3219
3227
|
if (this.options = n || {}, this.options.decoders || (this.options.decoders = {}),
|
|
3220
3228
|
e.buffer instanceof ArrayBuffer) {
|
|
3221
|
-
const {json: n, glbBuffer: r} =
|
|
3229
|
+
const {json: n, glbBuffer: r} = _t.read(e.buffer, e.byteOffset, e.byteLength);
|
|
3222
3230
|
this.D(t, n, r);
|
|
3223
3231
|
} else this.D(t, e);
|
|
3224
3232
|
this.k = new dt(this.rootPath, this.gltf, this.glbBuffer), this.j();
|
|
@@ -3269,10 +3277,10 @@
|
|
|
3269
3277
|
return t;
|
|
3270
3278
|
}
|
|
3271
3279
|
static getAnimationClip(t, e, n, r) {
|
|
3272
|
-
return
|
|
3280
|
+
return xt.getAnimationClip(t, e, n, r);
|
|
3273
3281
|
}
|
|
3274
3282
|
static getAnimationTimeSpan(t, e) {
|
|
3275
|
-
return
|
|
3283
|
+
return xt.getTimeSpanByName(t, e);
|
|
3276
3284
|
}
|
|
3277
3285
|
static getTypedArrayCtor(t) {
|
|
3278
3286
|
return Q(t);
|
|
@@ -3282,7 +3290,7 @@
|
|
|
3282
3290
|
}
|
|
3283
3291
|
D(t, e, n) {
|
|
3284
3292
|
this.gltf = e, this.glbBuffer = n, this.version = e.asset ? +e.asset.version : 1,
|
|
3285
|
-
this.rootPath = t, this.buffers = {}, this.requests = {}, this.options.requestImage =
|
|
3293
|
+
this.rootPath = t, this.buffers = {}, this.requests = {}, this.options.requestImage = It ? Bt : this.options.requestImage || Pt,
|
|
3286
3294
|
this.options.transferable && (this.transferables = []), 2 === this.version ? (this.adapter = new yt(t, e, n, this.options.requestImage, this.options.decoders || {}),
|
|
3287
3295
|
this.adapter.iterate((t, e, n) => {
|
|
3288
3296
|
e.id = "buffer_" + n;
|
|
@@ -3296,7 +3304,7 @@
|
|
|
3296
3304
|
}
|
|
3297
3305
|
$(t, e) {
|
|
3298
3306
|
if (t.children && t.children.length > 0) {
|
|
3299
|
-
if (!(
|
|
3307
|
+
if (!(n = t.children[0], "number" == typeof n && isFinite(n) || function(t) {
|
|
3300
3308
|
return !Z(t) && ("string" == typeof t || null !== t.constructor && t.constructor === String);
|
|
3301
3309
|
}(t.children[0]))) return t;
|
|
3302
3310
|
const r = t.children.map(t => {
|
|
@@ -3328,7 +3336,7 @@
|
|
|
3328
3336
|
skins: this.skins
|
|
3329
3337
|
};
|
|
3330
3338
|
if (this.gltf.extensions && (r.extensions = this.gltf.extensions), 1 === this.version) {
|
|
3331
|
-
const t = this.adapter.
|
|
3339
|
+
const t = this.adapter._(this.gltf.materials);
|
|
3332
3340
|
r.materials = t;
|
|
3333
3341
|
}
|
|
3334
3342
|
return r;
|
|
@@ -3448,12 +3456,12 @@
|
|
|
3448
3456
|
});
|
|
3449
3457
|
}
|
|
3450
3458
|
}
|
|
3451
|
-
function
|
|
3459
|
+
function Pt(t, e) {
|
|
3452
3460
|
const n = new Image;
|
|
3453
3461
|
n.crossOrigin = "", n.onload = () => {
|
|
3454
|
-
if (!
|
|
3455
|
-
|
|
3456
|
-
const t =
|
|
3462
|
+
if (!Nt) return void e(new Error("There is no canvas to draw image!"));
|
|
3463
|
+
Nt.width = n.width, Nt.height = n.height;
|
|
3464
|
+
const t = Nt.getContext("2d");
|
|
3457
3465
|
t.drawImage(n, 0, 0, n.width, n.height);
|
|
3458
3466
|
const r = t.getImageData(0, 0, n.width, n.height), s = {
|
|
3459
3467
|
width: n.width,
|
|
@@ -3465,11 +3473,11 @@
|
|
|
3465
3473
|
e(t);
|
|
3466
3474
|
}, n.src = t;
|
|
3467
3475
|
}
|
|
3468
|
-
let
|
|
3469
|
-
function
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
const n =
|
|
3476
|
+
let Ct, Ut;
|
|
3477
|
+
function Bt(t, e) {
|
|
3478
|
+
Ct || (Ct = new OffscreenCanvas(2, 2), Ut = Ct.getContext("2d")), fetch(t).then(t => t.blob()).then(t => createImageBitmap(t)).then(t => {
|
|
3479
|
+
Ct.width = t.width, Ct.height = t.height, Ut.drawImage(t, 0, 0);
|
|
3480
|
+
const n = Ut.getImageData(0, 0, Ct.width, Ct.height);
|
|
3473
3481
|
e(null, {
|
|
3474
3482
|
width: t.width,
|
|
3475
3483
|
height: t.height,
|
|
@@ -3477,8 +3485,8 @@
|
|
|
3477
3485
|
});
|
|
3478
3486
|
});
|
|
3479
3487
|
}
|
|
3480
|
-
const
|
|
3481
|
-
class
|
|
3488
|
+
const Lt = "undefined" == typeof document ? null : document.createElement("canvas");
|
|
3489
|
+
class Rt extends s.worker.Actor {
|
|
3482
3490
|
constructor(t, e) {
|
|
3483
3491
|
super(t), this.mapId = e;
|
|
3484
3492
|
}
|
|
@@ -3530,20 +3538,20 @@
|
|
|
3530
3538
|
requestImage({url: t}, e) {
|
|
3531
3539
|
const n = new Image;
|
|
3532
3540
|
n.onload = () => {
|
|
3533
|
-
if (!
|
|
3541
|
+
if (!Lt) return void e(new Error("There is no canvas to draw image!"));
|
|
3534
3542
|
const t = function(t) {
|
|
3535
|
-
if (
|
|
3543
|
+
if (Ft(t.width) && Ft(t.height)) return t;
|
|
3536
3544
|
let e = t.width, n = t.height;
|
|
3537
|
-
|
|
3538
|
-
|
|
3545
|
+
Ft(e) || (e = Dt(e));
|
|
3546
|
+
Ft(n) || (n = Dt(n));
|
|
3539
3547
|
const r = document.createElement("canvas");
|
|
3540
3548
|
r.width = e, r.height = n, r.getContext("2d").drawImage(t, 0, 0, e, n);
|
|
3541
3549
|
const s = t.src, i = s.lastIndexOf("/") + 1, o = s.substring(i);
|
|
3542
3550
|
return console.warn(`Texture(${o})'s size is not power of two, resize from (${t.width}, ${t.height}) to (${e}, ${n})`),
|
|
3543
3551
|
r;
|
|
3544
3552
|
}(n);
|
|
3545
|
-
|
|
3546
|
-
const r =
|
|
3553
|
+
Lt.width = t.width, Lt.height = t.height;
|
|
3554
|
+
const r = Lt.getContext("2d");
|
|
3547
3555
|
r.drawImage(t, 0, 0, t.width, t.height);
|
|
3548
3556
|
const s = r.getImageData(0, 0, t.width, t.height), i = {
|
|
3549
3557
|
width: t.width,
|
|
@@ -3556,13 +3564,13 @@
|
|
|
3556
3564
|
}, n.src = t;
|
|
3557
3565
|
}
|
|
3558
3566
|
}
|
|
3559
|
-
function
|
|
3567
|
+
function Ft(t) {
|
|
3560
3568
|
return 0 == (t & t - 1) && 0 !== t;
|
|
3561
3569
|
}
|
|
3562
|
-
function
|
|
3570
|
+
function Dt(t) {
|
|
3563
3571
|
return Math.pow(2, Math.floor(Math.log(t) / Math.LN2));
|
|
3564
3572
|
}
|
|
3565
|
-
class
|
|
3573
|
+
class kt {
|
|
3566
3574
|
constructor(t, e) {
|
|
3567
3575
|
this.max = t, this.currentSize = 0, this.onRemove = e, this.reset();
|
|
3568
3576
|
}
|
|
@@ -3642,17 +3650,17 @@
|
|
|
3642
3650
|
for (const n of e) n.current = t;
|
|
3643
3651
|
}
|
|
3644
3652
|
}
|
|
3645
|
-
function
|
|
3653
|
+
function zt(t, e) {
|
|
3646
3654
|
if (t.scenes && t.scenes.length) for (let n = 0, r = t.scenes.length; n < r; n++) {
|
|
3647
3655
|
const r = t.scenes[n].nodes;
|
|
3648
3656
|
for (let n = 0, s = r.length; n < s; n++) {
|
|
3649
3657
|
const s = [];
|
|
3650
|
-
|
|
3658
|
+
jt(r[n], s, t, e);
|
|
3651
3659
|
}
|
|
3652
3660
|
}
|
|
3653
3661
|
}
|
|
3654
|
-
function
|
|
3655
|
-
if (t.matrix && e.push(t.matrix), t.children && t.children.length) for (let s = 0, i = t.children.length; s < i; s++)
|
|
3662
|
+
function jt(t, e, n, r) {
|
|
3663
|
+
if (t.matrix && e.push(t.matrix), t.children && t.children.length) for (let s = 0, i = t.children.length; s < i; s++) jt(t.children[s], e, n, r);
|
|
3656
3664
|
if (void 0 !== t.mesh) {
|
|
3657
3665
|
const s = t.mesh, i = n.meshes[s];
|
|
3658
3666
|
if (i) {
|
|
@@ -3664,9 +3672,9 @@
|
|
|
3664
3672
|
}
|
|
3665
3673
|
}
|
|
3666
3674
|
}
|
|
3667
|
-
function
|
|
3675
|
+
function Vt(t, e, n) {
|
|
3668
3676
|
let {componentType: r, byteOffset: s, byteStride: i, itemSize: o} = e;
|
|
3669
|
-
const a = e.array.buffer, c = r ?
|
|
3677
|
+
const a = e.array.buffer, c = r ? Et.getTypedArrayCtor(r) : e.array.constructor;
|
|
3670
3678
|
if (s = void 0 === s ? e.array.byteOffset : s, i = i || 0, !i || i === o * c.BYTES_PER_ELEMENT && s % c.BYTES_PER_ELEMENT == 0) {
|
|
3671
3679
|
const e = new c(a, s + n * o * c.BYTES_PER_ELEMENT, o);
|
|
3672
3680
|
return t.set(e), t;
|
|
@@ -3675,63 +3683,63 @@
|
|
|
3675
3683
|
const h = new Uint8Array(a, i * n + s, o * c.BYTES_PER_ELEMENT);
|
|
3676
3684
|
return new Uint8Array(t.buffer).set(h), t;
|
|
3677
3685
|
}
|
|
3678
|
-
function
|
|
3686
|
+
function Gt(t, e, n, r) {
|
|
3679
3687
|
t[4 * e] = n[r], t[4 * e + 1] = n[r + 4], t[4 * e + 2] = n[r + 8], t[4 * e + 3] = n[r + 12];
|
|
3680
3688
|
}
|
|
3681
|
-
const
|
|
3682
|
-
function
|
|
3683
|
-
const s =
|
|
3684
|
-
|
|
3685
|
-
R(
|
|
3686
|
-
const o = Math.sqrt(k(
|
|
3689
|
+
const Ht = new Array(3), qt = new Array(3), $t = [ 40680631590769, 40680631590769, 40408299984661.445 ];
|
|
3690
|
+
function Jt(t, e, n, r) {
|
|
3691
|
+
const s = $t, i = Math.cos(n);
|
|
3692
|
+
Ht[0] = i * Math.cos(e), Ht[1] = i * Math.sin(e), Ht[2] = Math.sin(n), re(Ht, Ht),
|
|
3693
|
+
R(qt, s, Ht);
|
|
3694
|
+
const o = Math.sqrt(k(Ht, qt));
|
|
3687
3695
|
var a, c, h;
|
|
3688
|
-
return c =
|
|
3689
|
-
F(
|
|
3696
|
+
return c = qt, h = o, (a = qt)[0] = c[0] / h, a[1] = c[1] / h, a[2] = c[2] / h,
|
|
3697
|
+
F(Ht, Ht, r), function(t, e, n) {
|
|
3690
3698
|
return t[0] = e[0] + n[0], t[1] = e[1] + n[1], t[2] = e[2] + n[2], t;
|
|
3691
|
-
}(t,
|
|
3699
|
+
}(t, qt, Ht);
|
|
3692
3700
|
}
|
|
3693
|
-
const
|
|
3694
|
-
function
|
|
3695
|
-
const n =
|
|
3696
|
-
const i = e[0], o = e[1], a = e[2], c = n[0], h = n[1], u = n[2], f = i * i * c * c, l = o * o * h * h, d = a * a * u * u, m = f + l + d, y = Math.sqrt(1 / m), b = F(
|
|
3701
|
+
const Kt = [ 1 / 6378137, 1 / 6378137, 1 / 6356752.314245179 ], Xt = [ 1 / 40680631590769, 1 / 40680631590769, 1 / 40408299984661.445 ], Zt = new Array(3), Wt = new Array(3), Yt = new Array(3);
|
|
3702
|
+
function Qt(t, e) {
|
|
3703
|
+
const n = Xt, r = function(t, e, n, r, s) {
|
|
3704
|
+
const i = e[0], o = e[1], a = e[2], c = n[0], h = n[1], u = n[2], f = i * i * c * c, l = o * o * h * h, d = a * a * u * u, m = f + l + d, y = Math.sqrt(1 / m), b = F(te, e, y);
|
|
3697
3705
|
if (m < s) return isFinite(y) ? b : void 0;
|
|
3698
|
-
const p = r[0], w = r[1],
|
|
3699
|
-
|
|
3700
|
-
let T, A, v, O, M, S, x, I, N,
|
|
3706
|
+
const p = r[0], w = r[1], _ = r[2], g = ee;
|
|
3707
|
+
g[0] = b[0] * p * 2, g[1] = b[1] * w * 2, g[2] = b[2] * _ * 2;
|
|
3708
|
+
let T, A, v, O, M, S, x, I, N, E, P, C = (1 - y) * ne(e) / (.5 * ne(g)), U = 0;
|
|
3701
3709
|
do {
|
|
3702
|
-
C -= U, v = 1 / (1 + C * p), O = 1 / (1 + C * w), M = 1 / (1 + C *
|
|
3703
|
-
x = O * O, I = M * M, N = S * v,
|
|
3704
|
-
A = f * N * p + l *
|
|
3710
|
+
C -= U, v = 1 / (1 + C * p), O = 1 / (1 + C * w), M = 1 / (1 + C * _), S = v * v,
|
|
3711
|
+
x = O * O, I = M * M, N = S * v, E = x * O, P = I * M, T = f * S + l * x + d * I - 1,
|
|
3712
|
+
A = f * N * p + l * E * w + d * P * _;
|
|
3705
3713
|
U = T / (-2 * A);
|
|
3706
3714
|
} while (Math.abs(T) > 1e-12);
|
|
3707
3715
|
return t[0] = i * v, t[1] = o * O, t[2] = a * M, t;
|
|
3708
|
-
}(
|
|
3709
|
-
let s = V(
|
|
3710
|
-
s =
|
|
3711
|
-
const i =
|
|
3716
|
+
}(Zt, e, Kt, n, .1);
|
|
3717
|
+
let s = V(Wt, r, n);
|
|
3718
|
+
s = re(s, s);
|
|
3719
|
+
const i = j(Yt, e, r), o = Math.atan2(s[1], s[0]), a = Math.asin(s[2]), c = _(k(i, e)) * ne(i);
|
|
3712
3720
|
return t[0] = p(o), t[1] = p(a), t[2] = c, t;
|
|
3713
3721
|
}
|
|
3714
|
-
const
|
|
3715
|
-
function
|
|
3716
|
-
return
|
|
3722
|
+
const te = new Array(3), ee = new Array(3);
|
|
3723
|
+
function ne(t) {
|
|
3724
|
+
return P(t);
|
|
3717
3725
|
}
|
|
3718
|
-
function
|
|
3726
|
+
function re(t, e) {
|
|
3719
3727
|
const n = e[0], r = e[1], s = e[2];
|
|
3720
3728
|
let i = n * n + r * r + s * s;
|
|
3721
3729
|
return i > 0 && (i = Math.sqrt(i), t[0] = e[0] / i, t[1] = e[1] / i, t[2] = e[2] / i),
|
|
3722
3730
|
t;
|
|
3723
3731
|
}
|
|
3724
|
-
function
|
|
3725
|
-
return R(e, t,
|
|
3732
|
+
function se(t, e) {
|
|
3733
|
+
return R(e, t, Xt), D(e, e);
|
|
3726
3734
|
}
|
|
3727
|
-
var
|
|
3735
|
+
var ie = Object.freeze({
|
|
3728
3736
|
__proto__: null,
|
|
3729
|
-
radianToCartesian3:
|
|
3730
|
-
cartesian3ToDegree:
|
|
3731
|
-
normalizeCartesian:
|
|
3732
|
-
geodeticSurfaceNormal:
|
|
3737
|
+
radianToCartesian3: Jt,
|
|
3738
|
+
cartesian3ToDegree: Qt,
|
|
3739
|
+
normalizeCartesian: re,
|
|
3740
|
+
geodeticSurfaceNormal: se
|
|
3733
3741
|
});
|
|
3734
|
-
function
|
|
3742
|
+
function oe(t, e) {
|
|
3735
3743
|
let n = "";
|
|
3736
3744
|
for (let r = 0; r < 4; r++) {
|
|
3737
3745
|
const s = t.getUint8(e + r);
|
|
@@ -3739,27 +3747,27 @@
|
|
|
3739
3747
|
}
|
|
3740
3748
|
return n;
|
|
3741
3749
|
}
|
|
3742
|
-
const
|
|
3743
|
-
function
|
|
3750
|
+
const ae = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : null;
|
|
3751
|
+
function ce(t, e, n) {
|
|
3744
3752
|
const r = new Uint8Array(t, e, n);
|
|
3745
|
-
return
|
|
3753
|
+
return ae ? JSON.parse(ae.decode(r)) : JSON.parse(T(r));
|
|
3746
3754
|
}
|
|
3747
|
-
function
|
|
3755
|
+
function he(t, e, n) {
|
|
3748
3756
|
const r = new Uint8Array(t, e, n);
|
|
3749
|
-
return
|
|
3757
|
+
return ae ? JSON.parse(ae.decode(r)) : JSON.parse(T(r));
|
|
3750
3758
|
}
|
|
3751
|
-
function
|
|
3759
|
+
function ue(t, e, n) {
|
|
3752
3760
|
return {
|
|
3753
3761
|
offset: e,
|
|
3754
3762
|
byteLength: n
|
|
3755
3763
|
};
|
|
3756
3764
|
}
|
|
3757
|
-
function
|
|
3765
|
+
function fe(t, e, n, r) {
|
|
3758
3766
|
const {byteOffset: s, componentType: i, type: o} = t, {ctor: a, type: c} = function(t) {
|
|
3759
|
-
return
|
|
3767
|
+
return me[t];
|
|
3760
3768
|
}(i), h = function(t) {
|
|
3761
3769
|
if (!t) return 1;
|
|
3762
|
-
return
|
|
3770
|
+
return de[t];
|
|
3763
3771
|
}(o);
|
|
3764
3772
|
return {
|
|
3765
3773
|
byteStride: 0,
|
|
@@ -3770,18 +3778,19 @@
|
|
|
3770
3778
|
array: new a(e, n + s, r * h)
|
|
3771
3779
|
};
|
|
3772
3780
|
}
|
|
3773
|
-
function
|
|
3774
|
-
|
|
3781
|
+
function le(t, e, n, r) {
|
|
3782
|
+
t.componentType || (t.componentType = "UNSIGNED_SHORT");
|
|
3783
|
+
const s = fe(t, e, n, r);
|
|
3775
3784
|
return s.array.buffer.byteLength !== e.byteLength && (s.array = s.array.slice()),
|
|
3776
3785
|
s;
|
|
3777
3786
|
}
|
|
3778
|
-
const
|
|
3787
|
+
const de = {
|
|
3779
3788
|
"SCALAR": 1,
|
|
3780
3789
|
"VEC2": 2,
|
|
3781
3790
|
"VEC3": 3,
|
|
3782
3791
|
"VEC4": 4
|
|
3783
3792
|
};
|
|
3784
|
-
const
|
|
3793
|
+
const me = {
|
|
3785
3794
|
"BYTE": {
|
|
3786
3795
|
ctor: Int8Array,
|
|
3787
3796
|
type: 5120,
|
|
@@ -3823,27 +3832,27 @@
|
|
|
3823
3832
|
name: "Float64Array"
|
|
3824
3833
|
}
|
|
3825
3834
|
};
|
|
3826
|
-
function
|
|
3827
|
-
for (let e in
|
|
3835
|
+
function ye(t) {
|
|
3836
|
+
for (let e in me) if (t === me[e].ctor) return me[e].type;
|
|
3828
3837
|
throw new Error("unrecognized ctor:" + t);
|
|
3829
3838
|
}
|
|
3830
|
-
function
|
|
3839
|
+
function be(t, e, n, r) {
|
|
3831
3840
|
const s = t, i = e.length / 3;
|
|
3832
3841
|
for (let t = 0; t < i; t++) s[3 * t] = e[3 * t] / 65535 * r[0] + n[0], s[3 * t + 1] = e[3 * t + 1] / 65535 * r[1] + n[1],
|
|
3833
3842
|
s[3 * t + 2] = e[3 * t + 2] / 65535 * r[2] + n[2];
|
|
3834
3843
|
return s;
|
|
3835
3844
|
}
|
|
3836
|
-
function
|
|
3845
|
+
function pe(t, e, n) {
|
|
3837
3846
|
let r = t.getUint32(12, !0), s = t.getUint32(16, !0), i = t.getUint32(20, !0), o = t.getUint32(24, !0);
|
|
3838
3847
|
const a = t.buffer;
|
|
3839
3848
|
let c, h, u = {}, f = {};
|
|
3840
|
-
r > 0 && (u =
|
|
3849
|
+
r > 0 && (u = ce(a, e, r), e += r), s > 0 && (c = function(t, e, n) {
|
|
3841
3850
|
return {
|
|
3842
3851
|
offset: e,
|
|
3843
3852
|
byteLength: n
|
|
3844
3853
|
};
|
|
3845
|
-
}(0, e, s), e += s), i > 0 && (f =
|
|
3846
|
-
const l =
|
|
3854
|
+
}(0, e, s), e += s), i > 0 && (f = he(a, e, i), e += i);
|
|
3855
|
+
const l = ue(0, e, o);
|
|
3847
3856
|
return h = a.slice(l.offset, l.offset + l.byteLength), n.push(h), {
|
|
3848
3857
|
featureTable: u,
|
|
3849
3858
|
featureTableBin: c,
|
|
@@ -3851,33 +3860,33 @@
|
|
|
3851
3860
|
batchTableBin: h
|
|
3852
3861
|
};
|
|
3853
3862
|
}
|
|
3854
|
-
var
|
|
3863
|
+
var we = {
|
|
3855
3864
|
north: [ -1, 0, 0 ],
|
|
3856
3865
|
east: [ 0, 1, 0 ],
|
|
3857
3866
|
up: [ 0, 0, 1 ],
|
|
3858
3867
|
south: [ 1, 0, 0 ],
|
|
3859
3868
|
west: [ 0, -1, 0 ],
|
|
3860
3869
|
down: [ 0, 0, -1 ]
|
|
3861
|
-
},
|
|
3870
|
+
}, _e = {}, ge = {
|
|
3862
3871
|
east: [],
|
|
3863
3872
|
north: [],
|
|
3864
3873
|
up: [],
|
|
3865
3874
|
west: [],
|
|
3866
3875
|
south: [],
|
|
3867
3876
|
down: []
|
|
3868
|
-
},
|
|
3869
|
-
const
|
|
3870
|
-
function
|
|
3877
|
+
}, Te = [], Ae = [], ve = [];
|
|
3878
|
+
const Oe = [ 0, 0, 0 ];
|
|
3879
|
+
function Me(t, e, n, r) {
|
|
3871
3880
|
n = n || 0, r = r || n;
|
|
3872
3881
|
var s = Math.abs(t - e);
|
|
3873
3882
|
return s <= r || s <= n * Math.max(Math.abs(t), Math.abs(e));
|
|
3874
3883
|
}
|
|
3875
|
-
function
|
|
3884
|
+
function Se(t, e, n) {
|
|
3876
3885
|
return n[0] = t[0], n[1] = t[1], n[2] = t[2], n[3] = t[3], n[4] = t[4], n[5] = t[5],
|
|
3877
3886
|
n[6] = t[6], n[7] = t[7], n[8] = t[8], n[9] = t[9], n[10] = t[10], n[11] = t[11],
|
|
3878
3887
|
n[12] = e[0], n[13] = e[1], n[14] = e[2], n[15] = t[15], n;
|
|
3879
3888
|
}
|
|
3880
|
-
const
|
|
3889
|
+
const xe = (Pe = {
|
|
3881
3890
|
up: {
|
|
3882
3891
|
south: "east",
|
|
3883
3892
|
north: "west",
|
|
@@ -3914,36 +3923,35 @@
|
|
|
3914
3923
|
north: "up",
|
|
3915
3924
|
south: "down"
|
|
3916
3925
|
}
|
|
3917
|
-
}[
|
|
3918
|
-
if (
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
U(ge, be[Se]), "east" !== Se && "west" !== Se && F(ge, ge, r), U(_e, be[xe]), "east" !== xe && "west" !== xe && F(_e, _e, r),
|
|
3924
|
-
U(Te, be[Ne]), "east" !== Ne && "west" !== Ne && F(Te, Te, r);
|
|
3926
|
+
}[Ie = "east"][Ne = "north"], _e[Ce = Ie + Ne] ? Ee = _e[Ce] : (Ee = function(t, e, n) {
|
|
3927
|
+
if (a = Oe, c = (o = t)[0], h = o[1], u = o[2], f = a[0], l = a[1], d = a[2], Math.abs(c - f) <= 1e-6 * Math.max(1, Math.abs(c), Math.abs(f)) && Math.abs(h - l) <= 1e-6 * Math.max(1, Math.abs(h), Math.abs(l)) && Math.abs(u - d) <= 1e-6 * Math.max(1, Math.abs(u), Math.abs(d))) U(Te, we[Ie]),
|
|
3928
|
+
U(Ae, we[Ne]), U(ve, we[Pe]); else if (Me(t[0], 0, 1e-14) && Me(t[1], 0, 1e-14)) {
|
|
3929
|
+
var r = _(t[2]);
|
|
3930
|
+
U(Te, we[Ie]), "east" !== Ie && "west" !== Ie && F(Te, Te, r), U(Ae, we[Ne]), "east" !== Ne && "west" !== Ne && F(Ae, Ae, r),
|
|
3931
|
+
U(ve, we[Pe]), "east" !== Pe && "west" !== Pe && F(ve, ve, r);
|
|
3925
3932
|
} else {
|
|
3926
|
-
|
|
3927
|
-
var s =
|
|
3928
|
-
i[0] = -t[1], i[1] = t[0], i[2] = 0, D(
|
|
3929
|
-
F(
|
|
3930
|
-
}
|
|
3931
|
-
|
|
3932
|
-
n[
|
|
3933
|
+
se(t, ge.up);
|
|
3934
|
+
var s = ge.up, i = ge.east;
|
|
3935
|
+
i[0] = -t[1], i[1] = t[0], i[2] = 0, D(ge.east, i), z(ge.north, s, i), F(ge.down, ge.up, -1),
|
|
3936
|
+
F(ge.west, ge.east, -1), F(ge.south, ge.north, -1), Te = ge[Ie], Ae = ge[Ne], ve = ge[Pe];
|
|
3937
|
+
}
|
|
3938
|
+
var o, a, c, h, u, f, l, d;
|
|
3939
|
+
return n[0] = Te[0], n[1] = Te[1], n[2] = Te[2], n[3] = 0, n[4] = Ae[0], n[5] = Ae[1],
|
|
3940
|
+
n[6] = Ae[2], n[7] = 0, n[8] = ve[0], n[9] = ve[1], n[10] = ve[2], n[11] = 0, n[12] = t[0],
|
|
3933
3941
|
n[13] = t[1], n[14] = t[2], n[15] = 1, n;
|
|
3934
|
-
},
|
|
3935
|
-
var
|
|
3936
|
-
const
|
|
3942
|
+
}, _e[Ce] = Ee), Ee);
|
|
3943
|
+
var Ie, Ne, Ee, Pe, Ce;
|
|
3944
|
+
const Ue = [], Be = [], Le = [], Re = [], Fe = [], De = [], ke = [], ze = {
|
|
3937
3945
|
x: 0,
|
|
3938
3946
|
y: 0
|
|
3939
|
-
},
|
|
3947
|
+
}, je = {
|
|
3940
3948
|
x: 0,
|
|
3941
3949
|
y: 0
|
|
3942
|
-
},
|
|
3943
|
-
const {getTextureMagFilter:
|
|
3950
|
+
}, Ve = Math.PI / 180;
|
|
3951
|
+
const {getTextureMagFilter: Ge, getTextureMinFilter: He, getTextureWrap: qe, getMaterialType: $e, getMaterialFormat: Je, getPrimitive: Ke, getUniqueREGLBuffer: Xe} = n.reshader.REGLHelper, Ze = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], We = [ 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1 ], {loginIBLResOnCanvas: Ye, logoutIBLResOnCanvas: Qe, getIBLResOnCanvas: tn, getPBRUniforms: en} = n.reshader.pbr.PBRUtils, nn = {
|
|
3944
3952
|
factor: 0,
|
|
3945
3953
|
units: 0
|
|
3946
|
-
},
|
|
3954
|
+
}, rn = [ 1, 1, 1 ], sn = n.mat4.identity([]), on = t => t.material instanceof n.reshader.PhongMaterial, an = t => t.material instanceof n.reshader.pbr.StandardMaterial, cn = [ !1, !1, !1, !1 ], hn = [ !0, !0, !0, !0 ], un = [], fn = new s.Coordinate(0, 0), ln = [], dn = [], mn = {
|
|
3947
3955
|
"POSITION": "POSITION",
|
|
3948
3956
|
"NORMAL": "NORMAL",
|
|
3949
3957
|
"TEXCOORD_0": "TEXCOORD_0",
|
|
@@ -3951,11 +3959,11 @@
|
|
|
3951
3959
|
"COLOR_0": "COLOR_0",
|
|
3952
3960
|
"TANGENT": "TANGENT"
|
|
3953
3961
|
};
|
|
3954
|
-
class
|
|
3962
|
+
class yn {
|
|
3955
3963
|
constructor(t, e) {
|
|
3956
|
-
this.Nt = e, this.
|
|
3964
|
+
this.Nt = e, this.Et = e.getRenderer().canvas, this.Pt = new s.SpatialReference,
|
|
3957
3965
|
this.Ct = t, this.Ut = new n.reshader.Renderer(t), this.Bt = {}, this.Lt = {}, this.Rt = {},
|
|
3958
|
-
this.Ft = {}, this.Dt = {}, this.kt = {}, this.
|
|
3966
|
+
this.Ft = {}, this.Dt = {}, this.kt = {}, this.zt = {}, this.jt = new n.reshader.Scene,
|
|
3959
3967
|
this.Vt = new n.reshader.Scene, this.Gt = new n.reshader.Scene, this.Ht = new n.reshader.Scene,
|
|
3960
3968
|
this.qt = new n.reshader.ResourceLoader(t.texture(2)), this.$t = this.Jt.bind(this),
|
|
3961
3969
|
this.Kt = new n.reshader.PhongMaterial({
|
|
@@ -3986,7 +3994,7 @@
|
|
|
3986
3994
|
r = v(r);
|
|
3987
3995
|
}
|
|
3988
3996
|
const s = t[n].node;
|
|
3989
|
-
let f = a[s.te].polygonOffset ||
|
|
3997
|
+
let f = a[s.te].polygonOffset || nn;
|
|
3990
3998
|
y(f) && (f = f());
|
|
3991
3999
|
const l = a[s.te].ambientLight;
|
|
3992
4000
|
for (let a = 0, d = r.length; a < d; a++) "b3dm" === r[a].properties.magic && (r[a].getBoundingBox && !c(o, r[a].getBoundingBox()) || (r[a].properties.level = t[n].selectionDepth,
|
|
@@ -3999,7 +4007,7 @@
|
|
|
3999
4007
|
}
|
|
4000
4008
|
let f = 0;
|
|
4001
4009
|
const l = this.Zt.getExcludeFilter();
|
|
4002
|
-
f += this.ne(this.re, i, [ n,
|
|
4010
|
+
f += this.ne(this.re, i, [ n, on, l ], r, h, u), f += this.ne(this.se, i, [ n, an, l ], r, h, u),
|
|
4003
4011
|
this.Zt.forEachShader((t, e, s) => {
|
|
4004
4012
|
const i = this.Yt(s);
|
|
4005
4013
|
f += this.ne(t, i, [ n, e ], r, h, u);
|
|
@@ -4011,11 +4019,11 @@
|
|
|
4011
4019
|
return f += this.Ut.render(this.oe, m, this.Vt, r && r.fbo), f;
|
|
4012
4020
|
}
|
|
4013
4021
|
ne(t, e, n, r, s, i) {
|
|
4014
|
-
t.filter = n.filter(t => !!t), e.debug = !1, this.
|
|
4015
|
-
e.cullFace = "front", e.colorMask =
|
|
4016
|
-
e.stencilEnable = !0, e.debug = !1, e.cullFace = "back", e.colorMask =
|
|
4022
|
+
t.filter = n.filter(t => !!t), e.debug = !1, this.jt.setMeshes(s), e.stencilEnable = !1,
|
|
4023
|
+
e.cullFace = "front", e.colorMask = cn, this.Ut.render(t, e, this.jt, r && r.fbo),
|
|
4024
|
+
e.stencilEnable = !0, e.debug = !1, e.cullFace = "back", e.colorMask = hn;
|
|
4017
4025
|
let o = 0;
|
|
4018
|
-
this.
|
|
4026
|
+
this.jt.setMeshes(i), o += this.Ut.render(t, e, this.jt, r && r.fbo), e.stencilEnable = !0;
|
|
4019
4027
|
const a = [];
|
|
4020
4028
|
for (const t in this.Dt) a.push(...this.Dt[t]);
|
|
4021
4029
|
return this.Gt.setMeshes(a), o += this.Ut.render(t, e, this.Gt, r && r.fbo), o;
|
|
@@ -4059,16 +4067,16 @@
|
|
|
4059
4067
|
if (Array.isArray(t)) for (let e = 0, n = t.length; e < n; e++) this.me(t[e]); else {
|
|
4060
4068
|
const e = t.geometry.properties.url;
|
|
4061
4069
|
if (e) {
|
|
4062
|
-
const t = this.
|
|
4070
|
+
const t = this.zt[e];
|
|
4063
4071
|
t && (t.refCount--, t.refCount <= 0 && (t.geometry.dispose(), t.material.dispose(),
|
|
4064
|
-
delete this.
|
|
4072
|
+
delete this.zt[e]));
|
|
4065
4073
|
} else t.geometry.dispose(), t.material && t.material.dispose();
|
|
4066
4074
|
t.dispose();
|
|
4067
4075
|
}
|
|
4068
4076
|
}
|
|
4069
4077
|
remove() {
|
|
4070
4078
|
const t = this.Nt;
|
|
4071
|
-
|
|
4079
|
+
Qe(t.getRenderer().canvas, t.getMap());
|
|
4072
4080
|
for (const t in this.kt) this.de(t);
|
|
4073
4081
|
this.kt = {};
|
|
4074
4082
|
for (const t in this.Rt) this.le(t);
|
|
@@ -4126,7 +4134,7 @@
|
|
|
4126
4134
|
i.RGB ? u.HAS_RGB = 1 : i.RGBA ? u.HAS_RGBA = 1 : i.RGB565 && (u.HAS_RGB565 = 1),
|
|
4127
4135
|
(i.NORMAL || i.NORMAL_OCT16P) && (u.HAS_NORMAL = 1, i.NORMAL_OCT16P && (u.HAS_NORMAL_OCT16P = 1)),
|
|
4128
4136
|
t.featureTable.CONSTANT_RGBA && (t.featureTable.CONSTANT_RGBA = t.featureTable.CONSTANT_RGBA.map(t => t / 255));
|
|
4129
|
-
const {rtcCenter: f, rtcCoord: l} = t, d = this.we(l), m = this.
|
|
4137
|
+
const {rtcCenter: f, rtcCoord: l} = t, d = this.we(l), m = this._e(r, f, l);
|
|
4130
4138
|
n.mat4.multiply(m, m, d);
|
|
4131
4139
|
const y = this.Nt.options.services[a], b = new n.reshader.Mesh(h);
|
|
4132
4140
|
return b.properties.magic = "pnts", b.properties.id = e, b.properties.count = c,
|
|
@@ -4159,14 +4167,14 @@
|
|
|
4159
4167
|
mesh: t
|
|
4160
4168
|
}), t;
|
|
4161
4169
|
}
|
|
4162
|
-
const i = this.
|
|
4170
|
+
const i = this.ge(r.Te), {i3dm: o, featureTable: a, gltf: c, batchTable: h, batchTableBin: u, count: f} = t, l = a.INSTANCES_LENGTH, {rtcCenter: d, rtcCoord: m} = t, y = this.we(m), b = this._e(r, d, m), {POSITION: p, NORMAL_UP: w, NORMAL_RIGHT: _, SCALE: g, SCALE_NON_UNIFORM: T, INSTANCE_ROTATION: v} = o, O = {
|
|
4163
4171
|
"instance_vectorA": new Float32Array(4 * l),
|
|
4164
4172
|
"instance_vectorB": new Float32Array(4 * l),
|
|
4165
4173
|
"instance_vectorC": new Float32Array(4 * l)
|
|
4166
|
-
}, M = new Float32Array(3), S = new Float32Array(3), x = [], I = new Float32Array(1), N = new Float32Array(3),
|
|
4174
|
+
}, M = new Float32Array(3), S = new Float32Array(3), x = [], I = new Float32Array(1), N = new Float32Array(3), E = [], P = [], C = [], U = [], B = new Float32Array(9);
|
|
4167
4175
|
!function(t, e) {
|
|
4168
4176
|
let {componentType: n, byteOffset: r, byteStride: s, count: i, itemSize: o} = t;
|
|
4169
|
-
const a = t.array.buffer, c = n ?
|
|
4177
|
+
const a = t.array.buffer, c = n ? Et.getTypedArrayCtor(n) : t.array.constructor;
|
|
4170
4178
|
if (r = void 0 === r ? t.array.byteOffset : r, s = s || 0, i = i || t.array.length / o,
|
|
4171
4179
|
(!s || s === o * c.BYTES_PER_ELEMENT) && r % c.BYTES_PER_ELEMENT == 0) {
|
|
4172
4180
|
const t = new c(a, r, i * o);
|
|
@@ -4183,11 +4191,11 @@
|
|
|
4183
4191
|
e(new c(h.buffer), t), n.set(h);
|
|
4184
4192
|
}
|
|
4185
4193
|
}(p, (t, e) => {
|
|
4186
|
-
w ? (
|
|
4187
|
-
A(
|
|
4188
|
-
|
|
4189
|
-
n.mat4.fromRotationTranslationScale(U,
|
|
4190
|
-
|
|
4194
|
+
w ? (Vt(S, _, e), Vt(M, w, e), n.vec3.cross(x, S, M), n.vec3.normalize(x, x), A(E, S, 0),
|
|
4195
|
+
A(E, M, 1), A(E, x, 2), n.quat.fromMat3(P, E)) : v ? (Vt(B, v, e), n.quat.fromMat3(P, B)) : n.quat.identity(P),
|
|
4196
|
+
g ? (Vt(I, g, e), n.vec3.set(C, I[0], I[0], I[0])) : T ? (Vt(N, T, e), n.vec3.set(C, ...N)) : n.vec3.set(C, 1, 1, 1),
|
|
4197
|
+
n.mat4.fromRotationTranslationScale(U, P, t, C), Gt(O.instance_vectorA, e, U, 0),
|
|
4198
|
+
Gt(O.instance_vectorB, e, U, 1), Gt(O.instance_vectorC, e, U, 2);
|
|
4191
4199
|
});
|
|
4192
4200
|
const L = {};
|
|
4193
4201
|
for (const t in O) L[t] = {
|
|
@@ -4200,7 +4208,7 @@
|
|
|
4200
4208
|
const R = this.Nt.options.services[r.te].shader || "phong";
|
|
4201
4209
|
let F = 0, D = !0;
|
|
4202
4210
|
const k = [];
|
|
4203
|
-
return
|
|
4211
|
+
return zt(c, (t, s, o, a) => {
|
|
4204
4212
|
let {geometry: c, material: d} = this.Ae(t, s, o, a, r, !0, R);
|
|
4205
4213
|
d && !d.isReady() && (D = !1, F++);
|
|
4206
4214
|
const m = new n.reshader.InstancedMesh(L, l, c, d);
|
|
@@ -4234,23 +4242,23 @@
|
|
|
4234
4242
|
const t = new s.Extent(r.maxExtent).convertTo(t => this._pointToPrj(t));
|
|
4235
4243
|
o = [ t.xmin, t.ymin, t.xmax, t.ymax ];
|
|
4236
4244
|
}
|
|
4237
|
-
const a = this.
|
|
4245
|
+
const a = this.ge(r.Te), c = t.gltf, {center: h, coord: u} = c.extensions.CESIUM_RTC, f = this.Nt.options.services[r.te].heightOffset || 0;
|
|
4238
4246
|
f && (u[2] += f);
|
|
4239
4247
|
const l = this.we(u, r.te), d = this.Nt.options.services[r.te].shader || "phong", m = [];
|
|
4240
4248
|
let y = 0, b = !0;
|
|
4241
|
-
return
|
|
4249
|
+
return zt(c, (s, i, c, f) => {
|
|
4242
4250
|
let {geometry: p, material: w} = this.Ae(s, i, c, f, r, !1, d);
|
|
4243
4251
|
w && !w.isReady() && (b = !1, y++);
|
|
4244
|
-
const
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
const
|
|
4248
|
-
|
|
4252
|
+
const _ = new n.reshader.Mesh(p, w);
|
|
4253
|
+
_.properties.magic = "b3dm", _.properties.id = e, _.properties.batchTable = t.batchTable,
|
|
4254
|
+
_.properties.batchTableBin = t.batchTableBin, _.properties.count = t.featureTable.BATCH_LENGTH;
|
|
4255
|
+
const g = this.ve(s, p, w, r.te);
|
|
4256
|
+
_.setDefines(g), o && (g.USE_MAX_EXTENT = 1, _.setUniform("maxPrjExtent", o));
|
|
4249
4257
|
let T = n.mat4.identity([]);
|
|
4250
4258
|
if (s.matrices && s.matrices.length) for (let t = 0; t < s.matrices.length; t++) n.mat4.multiply(T, T, s.matrices[t]);
|
|
4251
|
-
const A = this.
|
|
4252
|
-
n.mat4.multiply(T, a, T), n.mat4.multiply(T, l, T), n.mat4.multiply(T, A, T),
|
|
4253
|
-
m.push(
|
|
4259
|
+
const A = this._e(r, h, u);
|
|
4260
|
+
n.mat4.multiply(T, a, T), n.mat4.multiply(T, l, T), n.mat4.multiply(T, A, T), _.setLocalTransform(T),
|
|
4261
|
+
m.push(_);
|
|
4254
4262
|
}), b ? (this.Rt[e] = m, i(null, {
|
|
4255
4263
|
id: e,
|
|
4256
4264
|
mesh: m
|
|
@@ -4259,47 +4267,47 @@
|
|
|
4259
4267
|
count: y
|
|
4260
4268
|
}, m.Oe = i), m;
|
|
4261
4269
|
}
|
|
4262
|
-
|
|
4270
|
+
_e(t, e, r) {
|
|
4263
4271
|
const i = this.getMap(), o = this.Nt.options.services[t.te].heightOffset || 0, a = new s.Coordinate(r), c = i.distanceToPointAtRes(100, 0, i.getGLRes(), a).x / 100;
|
|
4264
4272
|
let h = t.matrix ? n.mat4.copy([], t.matrix) : n.mat4.identity([]);
|
|
4265
4273
|
if (e) {
|
|
4266
|
-
|
|
4274
|
+
Se(h, n.vec3.transformMat4(un, e, h), h);
|
|
4267
4275
|
}
|
|
4268
4276
|
const u = function(t, e, n, r, s, i, o) {
|
|
4269
|
-
e = U(
|
|
4270
|
-
const a =
|
|
4277
|
+
e = U(Ue, e);
|
|
4278
|
+
const a = Jt(Ue, e[0] * Ve, e[1] * Ve, e[2]), c = function(t, e) {
|
|
4271
4279
|
return t[0] = e[12], t[1] = e[13], t[2] = e[14], t;
|
|
4272
|
-
}(
|
|
4280
|
+
}(Be, n), h = r.ellipsoid;
|
|
4273
4281
|
var u;
|
|
4274
|
-
u = 0 === G(c) ? B(
|
|
4275
|
-
const f = r.project(
|
|
4276
|
-
|
|
4277
|
-
const l =
|
|
4278
|
-
var r = t[0], s = t[1], i = t[2], o = t[4], a = t[5], c = t[6], h = t[8], u = t[9], f = t[10], l = e[0], d = e[1], m = e[2], y = e[3], b = e[4], p = e[5], w = e[6],
|
|
4282
|
+
u = 0 === G(c) ? B(Le, 0, 0, -6378137) : Qt(Le, c), ze.x = u[0], ze.y = u[1];
|
|
4283
|
+
const f = r.project(ze, je);
|
|
4284
|
+
Re[0] = f.x / s, Re[1] = f.y / s, Re[2] = (u[2] + o) * i;
|
|
4285
|
+
const l = xe(a, h, Fe), d = function(t, e, n) {
|
|
4286
|
+
var r = t[0], s = t[1], i = t[2], o = t[4], a = t[5], c = t[6], h = t[8], u = t[9], f = t[10], l = e[0], d = e[1], m = e[2], y = e[3], b = e[4], p = e[5], w = e[6], _ = e[7], g = e[8], T = r * l + o * d + h * m, A = s * l + a * d + u * m, v = i * l + c * d + f * m, O = r * y + o * b + h * p, M = s * y + a * b + u * p, S = i * y + c * b + f * p, x = r * w + o * _ + h * g, I = s * w + a * _ + u * g, N = i * w + c * _ + f * g;
|
|
4279
4287
|
return n[0] = T, n[1] = A, n[2] = v, n[3] = 0, n[4] = O, n[5] = M, n[6] = S, n[7] = 0,
|
|
4280
4288
|
n[8] = x, n[9] = I, n[10] = N, n[11] = 0, n[12] = t[12], n[13] = t[13], n[14] = t[14],
|
|
4281
4289
|
n[15] = t[15], n;
|
|
4282
4290
|
}(function(t, e) {
|
|
4283
|
-
var n = e[0], r = e[1], s = e[2], i = e[3], o = e[4], a = e[5], c = e[6], h = e[7], u = e[8], f = e[9], l = e[10], d = e[11], m = e[12], y = e[13], b = e[14], p = e[15], w = n * a - r * o,
|
|
4284
|
-
return
|
|
4285
|
-
t[2] = (y * v - b * A + p * T) *
|
|
4286
|
-
t[5] = (n * N - s * S + i * M) *
|
|
4287
|
-
t[8] = (o * I - a * S + h * O) *
|
|
4288
|
-
t[11] = (f *
|
|
4289
|
-
t[14] = (y *
|
|
4290
|
-
}(
|
|
4291
|
+
var n = e[0], r = e[1], s = e[2], i = e[3], o = e[4], a = e[5], c = e[6], h = e[7], u = e[8], f = e[9], l = e[10], d = e[11], m = e[12], y = e[13], b = e[14], p = e[15], w = n * a - r * o, _ = n * c - s * o, g = n * h - i * o, T = r * c - s * a, A = r * h - i * a, v = s * h - i * c, O = u * y - f * m, M = u * b - l * m, S = u * p - d * m, x = f * b - l * y, I = f * p - d * y, N = l * p - d * b, E = w * N - _ * I + g * x + T * S - A * M + v * O;
|
|
4292
|
+
return E ? (E = 1 / E, t[0] = (a * N - c * I + h * x) * E, t[1] = (s * I - r * N - i * x) * E,
|
|
4293
|
+
t[2] = (y * v - b * A + p * T) * E, t[3] = (l * A - f * v - d * T) * E, t[4] = (c * S - o * N - h * M) * E,
|
|
4294
|
+
t[5] = (n * N - s * S + i * M) * E, t[6] = (b * g - m * v - p * _) * E, t[7] = (u * v - l * g + d * _) * E,
|
|
4295
|
+
t[8] = (o * I - a * S + h * O) * E, t[9] = (r * S - n * I - i * O) * E, t[10] = (m * A - y * g + p * w) * E,
|
|
4296
|
+
t[11] = (f * g - u * A - d * w) * E, t[12] = (a * M - o * x - c * O) * E, t[13] = (n * x - r * M + s * O) * E,
|
|
4297
|
+
t[14] = (y * _ - m * T - b * w) * E, t[15] = (u * T - f * _ + l * w) * E, t) : null;
|
|
4298
|
+
}(De, l), function(t, e) {
|
|
4291
4299
|
return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[4], t[4] = e[5], t[5] = e[6],
|
|
4292
4300
|
t[6] = e[8], t[7] = e[9], t[8] = e[10], t;
|
|
4293
|
-
}(
|
|
4294
|
-
return
|
|
4301
|
+
}(ke, n), t);
|
|
4302
|
+
return Se(t, Re, d), t;
|
|
4295
4303
|
}(h, r, h, i.getProjection(), i.getGLRes(), c, o), f = function(t, e) {
|
|
4296
4304
|
return B(t, e[12], e[13], e[14]), t;
|
|
4297
|
-
}(
|
|
4305
|
+
}(dn, u);
|
|
4298
4306
|
let l = this.Nt.options.offset;
|
|
4299
4307
|
if (y(l)) {
|
|
4300
4308
|
l = l(this.Nt.Me(t.id).center);
|
|
4301
4309
|
}
|
|
4302
|
-
return n.vec3.set(
|
|
4310
|
+
return n.vec3.set(ln, l[0], l[1], 0), n.vec3.sub(f, f, ln), Se(u, f, u), u;
|
|
4303
4311
|
}
|
|
4304
4312
|
createCMPTMesh(t, e, r, s) {
|
|
4305
4313
|
if (this.kt[e]) {
|
|
@@ -4337,20 +4345,20 @@
|
|
|
4337
4345
|
}
|
|
4338
4346
|
Ae(t, e, n, r, s, i, o) {
|
|
4339
4347
|
const a = r.url + "-" + e + "-" + n;
|
|
4340
|
-
if (this.
|
|
4348
|
+
if (this.zt[a]) return this.zt[a].refCount++, this.zt[a];
|
|
4341
4349
|
let c, h;
|
|
4342
4350
|
const u = r.materials[t.material];
|
|
4343
4351
|
if (r.extensions && r.extensions.KHR_techniques_webgl && u.extensions && u.extensions.KHR_techniques_webgl) {
|
|
4344
4352
|
const e = this.xe(t, r, i);
|
|
4345
4353
|
c = e.material, h = e.geometry;
|
|
4346
|
-
} else h = this.Ie(t, i,
|
|
4347
|
-
c && !c.isReady() ? c.
|
|
4354
|
+
} else h = this.Ie(t, i, mn), c = this.Ne(t.material, r, o);
|
|
4355
|
+
c && !c.isReady() ? c.Ee = s.id : c || (c = this.Kt);
|
|
4348
4356
|
const f = {
|
|
4349
4357
|
refCount: 1,
|
|
4350
4358
|
geometry: h,
|
|
4351
4359
|
material: c
|
|
4352
4360
|
};
|
|
4353
|
-
return h.properties.url = a, this.
|
|
4361
|
+
return h.properties.url = a, this.zt[a] = f, f;
|
|
4354
4362
|
}
|
|
4355
4363
|
xe(t, e, n) {
|
|
4356
4364
|
const {geometry: r, material: s} = this.Zt.createMesh(t, e, n);
|
|
@@ -4368,7 +4376,7 @@
|
|
|
4368
4376
|
}
|
|
4369
4377
|
const o = {};
|
|
4370
4378
|
for (const t in s) {
|
|
4371
|
-
const e =
|
|
4379
|
+
const e = Xe(this.Ct, s[t], {
|
|
4372
4380
|
dimension: s[t].itemSize
|
|
4373
4381
|
}), n = r[t] || t;
|
|
4374
4382
|
o[n] = {
|
|
@@ -4383,16 +4391,16 @@
|
|
|
4383
4391
|
uv1Attribute: r.TEXCOORD_1,
|
|
4384
4392
|
color0Attribute: r.COLOR_0,
|
|
4385
4393
|
tangentAttribute: r.TANGENT,
|
|
4386
|
-
primitive: void 0 === t.mode ? "triangles" :
|
|
4394
|
+
primitive: void 0 === t.mode ? "triangles" : Ke(t.mode)
|
|
4387
4395
|
});
|
|
4388
4396
|
return a.generateBuffers(this.Ct, {
|
|
4389
4397
|
excludeElementsInVAO: e
|
|
4390
4398
|
}), a;
|
|
4391
4399
|
}
|
|
4392
4400
|
we(t) {
|
|
4393
|
-
const e = n.mat4.identity([]), r = this.getMap(), s = this.
|
|
4394
|
-
|
|
4395
|
-
const i = r.distanceToPointAtRes(100, 100, r.getGLRes(),
|
|
4401
|
+
const e = n.mat4.identity([]), r = this.getMap(), s = this.Pe();
|
|
4402
|
+
fn.x = t[0], fn.y = t[1];
|
|
4403
|
+
const i = r.distanceToPointAtRes(100, 100, r.getGLRes(), fn);
|
|
4396
4404
|
return n.vec3.set(s, i.x / 100 * 1.01, i.y / 100 * 1.01, i.y / 100), n.mat4.scale(e, e, s),
|
|
4397
4405
|
e;
|
|
4398
4406
|
}
|
|
@@ -4400,8 +4408,8 @@
|
|
|
4400
4408
|
const t = {
|
|
4401
4409
|
x: 0,
|
|
4402
4410
|
y: 0,
|
|
4403
|
-
width: () => this.
|
|
4404
|
-
height: () => this.
|
|
4411
|
+
width: () => this.Et ? this.Et.width : 1,
|
|
4412
|
+
height: () => this.Et ? this.Et.height : 1
|
|
4405
4413
|
};
|
|
4406
4414
|
this.ue = new n.reshader.MeshShader({
|
|
4407
4415
|
vert: "attribute vec3 aPosition;\n\nuniform mat4 projViewModelMatrix;\n\nvoid main() {\n gl_Position = projViewModelMatrix * vec4(aPosition, 1.0);\n}\n",
|
|
@@ -4452,17 +4460,17 @@
|
|
|
4452
4460
|
extraCommandProps: s
|
|
4453
4461
|
});
|
|
4454
4462
|
const i = this.Nt;
|
|
4455
|
-
|
|
4463
|
+
Ye(i.getRenderer().canvas, this.Ct, i.getMap());
|
|
4456
4464
|
}
|
|
4457
4465
|
Wt() {
|
|
4458
4466
|
return {
|
|
4459
4467
|
viewport: {
|
|
4460
4468
|
x: 0,
|
|
4461
4469
|
y: 0,
|
|
4462
|
-
width: () => this.
|
|
4463
|
-
height: () => this.
|
|
4470
|
+
width: () => this.Et ? this.Et.width : 1,
|
|
4471
|
+
height: () => this.Et ? this.Et.height : 1
|
|
4464
4472
|
},
|
|
4465
|
-
colorMask: (t, e) => e.colorMask ||
|
|
4473
|
+
colorMask: (t, e) => e.colorMask || hn,
|
|
4466
4474
|
cull: {
|
|
4467
4475
|
enable: !0,
|
|
4468
4476
|
face: (t, e) => e.cullFace
|
|
@@ -4513,7 +4521,7 @@
|
|
|
4513
4521
|
};
|
|
4514
4522
|
}
|
|
4515
4523
|
Yt() {
|
|
4516
|
-
const t = this.getMap(), e = this.Nt.getRenderer().canvas, {iblTexes: n, dfgLUT: r} =
|
|
4524
|
+
const t = this.getMap(), e = this.Nt.getRenderer().canvas, {iblTexes: n, dfgLUT: r} = tn(e), s = en(t, n, r);
|
|
4517
4525
|
return m(s, {
|
|
4518
4526
|
lightSpecular: [ 1, 1, 1 ],
|
|
4519
4527
|
viewMatrix: t.viewMatrix,
|
|
@@ -4567,8 +4575,8 @@
|
|
|
4567
4575
|
}
|
|
4568
4576
|
T(t, e) {
|
|
4569
4577
|
const r = {
|
|
4570
|
-
type: t.type ?
|
|
4571
|
-
format: t.format ?
|
|
4578
|
+
type: t.type ? $e(t.type) : "uint8",
|
|
4579
|
+
format: t.format ? Je(t.format) : "rgba",
|
|
4572
4580
|
flipY: !1
|
|
4573
4581
|
};
|
|
4574
4582
|
if (e && e.baseColorTexture) r.url = this.Ce(t); else {
|
|
@@ -4576,8 +4584,8 @@
|
|
|
4576
4584
|
r.data = e.array, r.width = e.width, r.height = e.height;
|
|
4577
4585
|
}
|
|
4578
4586
|
const s = t.sampler || t.texture.sampler;
|
|
4579
|
-
return s && (s.magFilter && (r.mag =
|
|
4580
|
-
s.wrapS && (r.wrapS =
|
|
4587
|
+
return s && (s.magFilter && (r.mag = Ge(s.magFilter)), s.minFilter && (r.min = He(s.minFilter)),
|
|
4588
|
+
s.wrapS && (r.wrapS = qe(s.wrapS)), s.wrapT && (r.wrapT = qe(s.wrapT))), new n.reshader.Texture2D(r, this.qt);
|
|
4581
4589
|
}
|
|
4582
4590
|
Ce(t) {
|
|
4583
4591
|
const e = t.image, n = window.URL || window.webkitURL, r = new Blob([ e.array ], {
|
|
@@ -4586,7 +4594,7 @@
|
|
|
4586
4594
|
return n.createObjectURL(r);
|
|
4587
4595
|
}
|
|
4588
4596
|
Jt({target: t}) {
|
|
4589
|
-
const e = t.
|
|
4597
|
+
const e = t.Ee, n = this.Bt[e];
|
|
4590
4598
|
if (n.count--, !n.count) {
|
|
4591
4599
|
const t = n.meshes;
|
|
4592
4600
|
this.Rt[e] = t, delete this.Bt[e];
|
|
@@ -4597,8 +4605,8 @@
|
|
|
4597
4605
|
});
|
|
4598
4606
|
}
|
|
4599
4607
|
}
|
|
4600
|
-
|
|
4601
|
-
return
|
|
4608
|
+
Pe() {
|
|
4609
|
+
return rn;
|
|
4602
4610
|
}
|
|
4603
4611
|
ye(t) {
|
|
4604
4612
|
return this.Nt.ye(t);
|
|
@@ -4615,14 +4623,14 @@
|
|
|
4615
4623
|
const e = this.getMap();
|
|
4616
4624
|
return e.getGLZoom ? e._prjToPoint(t, e.getGLZoom()) : e._prjToPointAtRes(t, e.getGLRes());
|
|
4617
4625
|
}
|
|
4618
|
-
|
|
4619
|
-
return "Y" === t ?
|
|
4626
|
+
ge(t) {
|
|
4627
|
+
return "Y" === t ? Ze : "X" === t ? We : sn;
|
|
4620
4628
|
}
|
|
4621
4629
|
}
|
|
4622
|
-
class
|
|
4630
|
+
class bn extends s.renderer.CanvasRenderer {
|
|
4623
4631
|
constructor(t) {
|
|
4624
|
-
super(t), this.prepareWorker(), this.tilesLoading = {}, this.tileCache = new
|
|
4625
|
-
this.
|
|
4632
|
+
super(t), this.prepareWorker(), this.tilesLoading = {}, this.tileCache = new kt(1024 * t.options.maxGPUMemory * 1024, this.deleteTile.bind(this)),
|
|
4633
|
+
this.gt = {};
|
|
4626
4634
|
}
|
|
4627
4635
|
needToRedraw() {
|
|
4628
4636
|
return !!this.getMap().isInteracting() || super.needToRedraw();
|
|
@@ -4653,12 +4661,12 @@
|
|
|
4653
4661
|
if (this.ke(c.id) ? (r++, h = a = !0, this.tilesLoading[c.id].current = !0) : u ? (this.getTileOpacity(u) < 1 && (h = a = !0),
|
|
4654
4662
|
o = !0, s.selected = !0, s.data = u) : this.painter.has(c) || (h = a = !0, n.push(c)),
|
|
4655
4663
|
!h) continue;
|
|
4656
|
-
if (this.
|
|
4657
|
-
this.
|
|
4664
|
+
if (this.ze(s)) o = !0; else {
|
|
4665
|
+
this.je(s).length && (o = !0);
|
|
4658
4666
|
}
|
|
4659
4667
|
}
|
|
4660
4668
|
let c = [], h = {};
|
|
4661
|
-
if (o && ({selectedTiles: c, leaves: h} = this.Ve(t)), n.length > 1 && (n.sort(
|
|
4669
|
+
if (o && ({selectedTiles: c, leaves: h} = this.Ve(t)), n.length > 1 && (n.sort(wn),
|
|
4662
4670
|
s)) {
|
|
4663
4671
|
const t = s - r;
|
|
4664
4672
|
n = t > 0 ? n.slice(0, t) : [];
|
|
@@ -4691,7 +4699,7 @@
|
|
|
4691
4699
|
}
|
|
4692
4700
|
i.push(t), t.Ge = s.length;
|
|
4693
4701
|
}
|
|
4694
|
-
o.length > 1 && o.sort(
|
|
4702
|
+
o.length > 1 && o.sort(pn);
|
|
4695
4703
|
for (let t = 0; t < o.length; t++) s.push(o[t]);
|
|
4696
4704
|
}
|
|
4697
4705
|
return {
|
|
@@ -4699,7 +4707,7 @@
|
|
|
4699
4707
|
leaves: n
|
|
4700
4708
|
};
|
|
4701
4709
|
}
|
|
4702
|
-
|
|
4710
|
+
ze(t) {
|
|
4703
4711
|
if (!t.parent) return null;
|
|
4704
4712
|
let e = t.parent;
|
|
4705
4713
|
for (;e && e.level >= 0; ) {
|
|
@@ -4710,7 +4718,7 @@
|
|
|
4710
4718
|
}
|
|
4711
4719
|
return null;
|
|
4712
4720
|
}
|
|
4713
|
-
|
|
4721
|
+
je(t) {
|
|
4714
4722
|
const e = [];
|
|
4715
4723
|
if (!t.node.children || !t.node.children.length) return e;
|
|
4716
4724
|
const n = t.He + 1, r = [ t.node ];
|
|
@@ -4774,10 +4782,10 @@
|
|
|
4774
4782
|
let s = ft.getArrayBuffer(e + (r || ""), n.ajaxOptions);
|
|
4775
4783
|
const i = s.xhr;
|
|
4776
4784
|
s = s.then(n => {
|
|
4777
|
-
delete this.
|
|
4785
|
+
delete this.gt[e], n ? this.Je(e, n.data, t) : this.onTileError(null, t);
|
|
4778
4786
|
}).catch(n => {
|
|
4779
|
-
delete this.
|
|
4780
|
-
}), this.
|
|
4787
|
+
delete this.gt[e], this.onTileError(n, t);
|
|
4788
|
+
}), this.gt[e] = i;
|
|
4781
4789
|
} else this.Je(e, null, t);
|
|
4782
4790
|
}
|
|
4783
4791
|
Je(t, e, n) {
|
|
@@ -4851,10 +4859,10 @@
|
|
|
4851
4859
|
if (!t || !this.workerConn) return;
|
|
4852
4860
|
const e = t.node.content.url;
|
|
4853
4861
|
if (this.layer.options.services[t.node.te].ajaxInMainThread) {
|
|
4854
|
-
const t = this.
|
|
4862
|
+
const t = this.gt[e];
|
|
4855
4863
|
t && t.abort();
|
|
4856
4864
|
} else this.workerConn.abortTileLoading(this.layer.getId(), e);
|
|
4857
|
-
delete this.
|
|
4865
|
+
delete this.gt[e];
|
|
4858
4866
|
}
|
|
4859
4867
|
Re() {
|
|
4860
4868
|
if (this.tilesLoading) for (const t in this.tilesLoading) this.tilesLoading[t].current = !1;
|
|
@@ -4876,11 +4884,11 @@
|
|
|
4876
4884
|
attributes: e,
|
|
4877
4885
|
extensions: [ "OES_element_index_uint", "WEBGL_compressed_texture_s3tc" ],
|
|
4878
4886
|
optionalExtensions: t.options.optionalExtensions || []
|
|
4879
|
-
}), this.painter = new
|
|
4887
|
+
}), this.painter = new yn(this.regl, t);
|
|
4880
4888
|
}
|
|
4881
4889
|
prepareWorker() {
|
|
4882
4890
|
const t = this.getMap();
|
|
4883
|
-
this.workerConn || (this.workerConn = new
|
|
4891
|
+
this.workerConn || (this.workerConn = new Rt("@maptalks/3dtiles", t.id));
|
|
4884
4892
|
const e = this.workerConn;
|
|
4885
4893
|
if (!e.isActive()) return;
|
|
4886
4894
|
let n = this.layer.options || {};
|
|
@@ -4952,23 +4960,23 @@
|
|
|
4952
4960
|
return this.painter.getB3DMMeshes();
|
|
4953
4961
|
}
|
|
4954
4962
|
readBatchData(t, e, n) {
|
|
4955
|
-
return
|
|
4963
|
+
return fe(t, e, 0, n);
|
|
4956
4964
|
}
|
|
4957
4965
|
}
|
|
4958
|
-
function
|
|
4966
|
+
function pn(t, e) {
|
|
4959
4967
|
return 0 === t.node.ce && 0 === e.node.ce ? e.node.en - t.node.en : e.node.ce - t.node.ce;
|
|
4960
4968
|
}
|
|
4961
|
-
function
|
|
4969
|
+
function wn(t, e) {
|
|
4962
4970
|
return 0 === t.ce && 0 === e.ce ? t.en - e.en : t.ce - e.ce;
|
|
4963
4971
|
}
|
|
4964
|
-
function
|
|
4972
|
+
function _n(t, e, n) {
|
|
4965
4973
|
return t[0] = e[n], t[1] = e[n + 3], t[2] = e[n + 6], t;
|
|
4966
4974
|
}
|
|
4967
|
-
function
|
|
4975
|
+
function gn(t, e, n) {
|
|
4968
4976
|
return Math.sqrt(function(t, e, n) {
|
|
4969
|
-
var r = L(
|
|
4977
|
+
var r = L(Tn, n, t), s = _n(An, e, 0), i = _n(vn, e, 1), o = _n(On, e, 2), a = G(s), c = G(i), h = G(o);
|
|
4970
4978
|
D(s, s), D(i, i), D(o, o);
|
|
4971
|
-
var u =
|
|
4979
|
+
var u = Mn;
|
|
4972
4980
|
u.x = k(r, s), u.y = k(r, i), u.z = k(r, o);
|
|
4973
4981
|
var f, l = 0;
|
|
4974
4982
|
u.x < -a ? (f = u.x + a, l += f * f) : u.x > a && (f = u.x - a, l += f * f);
|
|
@@ -4977,11 +4985,11 @@
|
|
|
4977
4985
|
return l;
|
|
4978
4986
|
}(t, e, n));
|
|
4979
4987
|
}
|
|
4980
|
-
const
|
|
4981
|
-
const
|
|
4982
|
-
class
|
|
4988
|
+
const Tn = [], An = [], vn = [], On = [], Mn = [];
|
|
4989
|
+
const Sn = s.projection.EPSG3857, xn = new s.Extent(0, 0, 0, 0), In = [], Nn = [], En = new s.Coordinate(0, 0), Pn = n.mat4.identity([]);
|
|
4990
|
+
class Cn extends s.Layer {
|
|
4983
4991
|
constructor(t, e) {
|
|
4984
|
-
super(t, e), this.nn(), this.
|
|
4992
|
+
super(t, e), this.nn(), this.gt = {}, this.rn = {};
|
|
4985
4993
|
}
|
|
4986
4994
|
nn() {
|
|
4987
4995
|
let t = this.options.services.map(t => t.url);
|
|
@@ -5013,17 +5021,17 @@
|
|
|
5013
5021
|
return this.sn[t] && this.sn[t].boundingVolume ? this.boundingVolumeToExtent(this.sn[t]) : null;
|
|
5014
5022
|
}
|
|
5015
5023
|
boundingVolumeToExtent(t) {
|
|
5016
|
-
const e = t.boundingVolume.in ?
|
|
5024
|
+
const e = t.boundingVolume.in ? Pn : t.matrix, r = this.getMap();
|
|
5017
5025
|
if (t.boundingVolume.region) {
|
|
5018
5026
|
const e = t.boundingVolume.region;
|
|
5019
5027
|
return new s.Extent(p(e[0]), p(e[1]), p(e[2]), p(e[3]));
|
|
5020
5028
|
}
|
|
5021
5029
|
if (t.boundingVolume.sphere) {
|
|
5022
|
-
const i = t.boundingVolume.sphere, o =
|
|
5030
|
+
const i = t.boundingVolume.sphere, o = Qt([], n.vec3.transformMat4([], i, e)), a = i[3], c = r.locate(o, -a, a), h = r.locate(o, a, -a);
|
|
5023
5031
|
return new s.Extent(c, h);
|
|
5024
5032
|
}
|
|
5025
5033
|
if (t.boundingVolume.box) {
|
|
5026
|
-
const i = t.boundingVolume.box, o = n.vec3.transformMat4([], i, e), a = new s.Coordinate(
|
|
5034
|
+
const i = t.boundingVolume.box, o = n.vec3.transformMat4([], i, e), a = new s.Coordinate(Qt([], o)), c = i.slice(3);
|
|
5027
5035
|
n.mat3.multiply(c, n.mat3.fromMat4([], t.matrix), c);
|
|
5028
5036
|
const h = n.vec3.length(c.slice(0, 3)), u = n.vec3.length(c.slice(3, 6)), f = n.vec3.length(c.slice(6, 9)), l = Math.max(h, u, f), d = r.locate(a, -l, l), m = r.locate(a, l, -l);
|
|
5029
5037
|
return new s.Extent(d, m);
|
|
@@ -5041,13 +5049,13 @@
|
|
|
5041
5049
|
an() {
|
|
5042
5050
|
const t = this.getMap(), e = t.cameraPosition;
|
|
5043
5051
|
let r, s;
|
|
5044
|
-
if (t.getGLZoom) s = t.pointToDistance(e[2], 0, t.getGLZoom()),
|
|
5045
|
-
r = t.pointToCoord(
|
|
5052
|
+
if (t.getGLZoom) s = t.pointToDistance(e[2], 0, t.getGLZoom()), En.set(e[0], e[1]),
|
|
5053
|
+
r = t.pointToCoord(En, t.getGLZoom()); else {
|
|
5046
5054
|
const n = t.getGLRes();
|
|
5047
|
-
s = t.pointAtResToDistance(e[2], 0, n),
|
|
5055
|
+
s = t.pointAtResToDistance(e[2], 0, n), En.set(e[0], e[1]), r = t.pointAtResToCoord(En, n);
|
|
5048
5056
|
}
|
|
5049
|
-
this.hn = this.hn || [], n.vec3.set(this.hn, b(r.x), b(r.y), s), this.un =
|
|
5050
|
-
this.ln = 2 * Math.tan(.5 * b(t.getFov())), this.dn =
|
|
5057
|
+
this.hn = this.hn || [], n.vec3.set(this.hn, b(r.x), b(r.y), s), this.un = Jt(this.un || [], this.hn[0], this.hn[1], this.hn[2]),
|
|
5058
|
+
this.ln = 2 * Math.tan(.5 * b(t.getFov())), this.dn = Sn.project(r).toArray();
|
|
5051
5059
|
const i = t.projViewMatrix, o = {
|
|
5052
5060
|
children: [],
|
|
5053
5061
|
level: -1
|
|
@@ -5069,7 +5077,7 @@
|
|
|
5069
5077
|
if (!(0 === s && t.He <= e)) continue;
|
|
5070
5078
|
t.content && (e = t.He);
|
|
5071
5079
|
}
|
|
5072
|
-
t.ce < 1 / 0 && this.
|
|
5080
|
+
t.ce < 1 / 0 && this._n(t);
|
|
5073
5081
|
const o = this.$e(t, a);
|
|
5074
5082
|
a.children.push(o);
|
|
5075
5083
|
const h = t.children, u = h && h.length, f = o.content;
|
|
@@ -5097,8 +5105,8 @@
|
|
|
5097
5105
|
const e = n.region;
|
|
5098
5106
|
if (t[0] >= e[0] && t[0] <= e[2] && t[1] >= e[1] && t[1] <= e[3]) return !0;
|
|
5099
5107
|
} else {
|
|
5100
|
-
if (n.sphere) return
|
|
5101
|
-
if (n.box) return 0 ===
|
|
5108
|
+
if (n.sphere) return Un(n, e);
|
|
5109
|
+
if (n.box) return 0 === Bn(n, e);
|
|
5102
5110
|
}
|
|
5103
5111
|
return !1;
|
|
5104
5112
|
}
|
|
@@ -5120,7 +5128,7 @@
|
|
|
5120
5128
|
}
|
|
5121
5129
|
yn(t) {
|
|
5122
5130
|
void 0 === t.id && (t.id = s.Util.GUID(), t.matrix = t.transform || n.mat4.identity([]),
|
|
5123
|
-
t.
|
|
5131
|
+
t.gn = this.Tn(t), t.parent && (t.matrix = n.mat4.multiply(t.matrix, t.parent.matrix, t.matrix),
|
|
5124
5132
|
t.te = t.parent.te, void 0 === t.He && (t.He = t.parent.He + 1), t.maxExtent = t.parent.maxExtent),
|
|
5125
5133
|
t.refine = t.refine && t.refine.toLowerCase() || "replace", t.content && !t.content.url && t.content.uri && (t.content.url = t.content.uri),
|
|
5126
5134
|
this.An(t));
|
|
@@ -5129,7 +5137,7 @@
|
|
|
5129
5137
|
const e = t.boundingVolume;
|
|
5130
5138
|
if (!e || e.in) return;
|
|
5131
5139
|
const r = this.options.services[t.te].heightOffset || 0, s = this.options.offset, i = y(s) || s[0] || s[1];
|
|
5132
|
-
if (!t.boundingVolume || !r && n.mat4.exactEquals(t.matrix,
|
|
5140
|
+
if (!t.boundingVolume || !r && n.mat4.exactEquals(t.matrix, Pn) && !i) return;
|
|
5133
5141
|
const {region: o, box: a, sphere: c} = e;
|
|
5134
5142
|
if (o) {
|
|
5135
5143
|
const t = this.vn([ p(o[0]), p(o[1]) ]);
|
|
@@ -5137,8 +5145,8 @@
|
|
|
5137
5145
|
const e = this.vn([ p(o[2]), p(o[3]) ]);
|
|
5138
5146
|
o[2] = b(e.x), o[3] = b(e.y), o[4] += r, o[5] += r;
|
|
5139
5147
|
} else if (a || c) {
|
|
5140
|
-
const e = a || c, s = n.vec3.transformMat4(
|
|
5141
|
-
i[0] = o.x, i[1] = o.y, i[2] += r,
|
|
5148
|
+
const e = a || c, s = n.vec3.transformMat4(In, e, t.matrix), i = Qt(Nn, s), o = this.vn([ i[0], i[1] ]);
|
|
5149
|
+
i[0] = o.x, i[1] = o.y, i[2] += r, Jt(e, b(i[0]), b(i[1]), i[2]);
|
|
5142
5150
|
}
|
|
5143
5151
|
e.in = !0;
|
|
5144
5152
|
}
|
|
@@ -5148,9 +5156,9 @@
|
|
|
5148
5156
|
qe(t) {
|
|
5149
5157
|
return t.content && t.content.url;
|
|
5150
5158
|
}
|
|
5151
|
-
|
|
5159
|
+
_n(t) {
|
|
5152
5160
|
let e = t.parent;
|
|
5153
|
-
for (;e && e.
|
|
5161
|
+
for (;e && e.gn && !(e.ce <= t.ce && e.en <= t.en); ) e.ce = t.ce, e.en = t.en,
|
|
5154
5162
|
e = t.parent;
|
|
5155
5163
|
}
|
|
5156
5164
|
onTilesetLoad(t, e, r) {
|
|
@@ -5162,7 +5170,7 @@
|
|
|
5162
5170
|
const s = t.root.transform;
|
|
5163
5171
|
s && (e.parent ? e.matrix = n.mat4.multiply([], e.parent.matrix, s) : e.matrix = s),
|
|
5164
5172
|
this.An(e), e.children && e.children.length && (e.On = e.content, delete e.content,
|
|
5165
|
-
t.root.content && (e.content = t.root.content)), e.
|
|
5173
|
+
t.root.content && (e.content = t.root.content)), e.gn = this.Tn(e);
|
|
5166
5174
|
const i = e.content && (e.content.url || e.content.uri);
|
|
5167
5175
|
i && e.content.uri && (e.content.url = e.content.uri, delete e.content.uri), i && !M(i) && -1 === i.indexOf("http://") && -1 === i.indexOf("https://") && (e.content.url = e.baseUrl + i);
|
|
5168
5176
|
}
|
|
@@ -5173,7 +5181,7 @@
|
|
|
5173
5181
|
});
|
|
5174
5182
|
}
|
|
5175
5183
|
bn(t, e, n) {
|
|
5176
|
-
if (t.ce = 1 / 0, 0 === t.He || t.
|
|
5184
|
+
if (t.ce = 1 / 0, 0 === t.He || t.gn) return 1;
|
|
5177
5185
|
if (t.Mn = 1 / 0, !this.Sn(t, e, n)) return -1;
|
|
5178
5186
|
if (0 === t.geometricError) return 1;
|
|
5179
5187
|
let r = this.options.services[t.te].maximumScreenSpaceError;
|
|
@@ -5202,27 +5210,27 @@
|
|
|
5202
5210
|
e = e.convertTo(t => this.ye(t)), i = n[4], r = n[5], f = this.rn[a] = [ [ e.xmin, e.ymin, i * c ], [ e.xmax, e.ymax, r * c ] ],
|
|
5203
5211
|
f.center = o;
|
|
5204
5212
|
} else if (t.boundingVolume.sphere) {
|
|
5205
|
-
const e = t.boundingVolume.sphere, n =
|
|
5213
|
+
const e = t.boundingVolume.sphere, n = Qt([], e), r = this.ye(new s.Coordinate(n)).toArray();
|
|
5206
5214
|
r.push(n[2] * c), f = this.rn[a] = [ r, e[3] * c ], f.center = new s.Coordinate(n);
|
|
5207
5215
|
} else if (t.boundingVolume.box) {
|
|
5208
|
-
const e = t.boundingVolume.box, r =
|
|
5216
|
+
const e = t.boundingVolume.box, r = Qt([], e), i = this.ye(new s.Coordinate(r)).toArray();
|
|
5209
5217
|
i.push(r[2] * c);
|
|
5210
5218
|
const o = e.slice(3);
|
|
5211
|
-
n.mat4.exactEquals(t.matrix,
|
|
5219
|
+
n.mat4.exactEquals(t.matrix, Pn) || n.mat3.multiply(o, n.mat3.fromMat4([], t.matrix), o);
|
|
5212
5220
|
for (let t = 0; t < o.length; t++) o[t] *= c, e[3 + t] = o[t];
|
|
5213
5221
|
f = this.rn[a] = [ ...i, ...o ], f.center = new s.Coordinate(r);
|
|
5214
5222
|
}
|
|
5215
5223
|
}
|
|
5216
5224
|
if (e) {
|
|
5217
|
-
if (t.boundingVolume.region)
|
|
5218
|
-
|
|
5225
|
+
if (t.boundingVolume.region) xn.xmin = f[0][0], xn.ymin = f[0][1], xn.xmax = f[1][0],
|
|
5226
|
+
xn.ymax = f[1][1]; else if (t.boundingVolume.sphere) {
|
|
5219
5227
|
const t = f[2];
|
|
5220
|
-
|
|
5228
|
+
xn.xmin = f[0][0] - t, xn.ymin = f[0][1] - t, xn.xmax = f[0][0] + t, xn.ymax = f[0][1] + t;
|
|
5221
5229
|
} else if (t.boundingVolume.box) {
|
|
5222
5230
|
const t = f[1], e = f[2];
|
|
5223
|
-
|
|
5231
|
+
xn.xmin = f[0][0] - t, xn.ymin = f[0][1] - e, xn.xmax = f[0][0] + t, xn.ymax = f[0][1] + e;
|
|
5224
5232
|
}
|
|
5225
|
-
if (!e.intersects(
|
|
5233
|
+
if (!e.intersects(xn)) return !1;
|
|
5226
5234
|
}
|
|
5227
5235
|
return t.boundingVolume.region ? c(r, f) : t.boundingVolume.sphere ? function(t, e, n) {
|
|
5228
5236
|
u(t);
|
|
@@ -5264,24 +5272,24 @@
|
|
|
5264
5272
|
i = function(t, e, n, r) {
|
|
5265
5273
|
const s = t.boundingVolume.region;
|
|
5266
5274
|
let i = t.In;
|
|
5267
|
-
i || (i = t.In = [
|
|
5275
|
+
i || (i = t.In = [ Fn(s[0], s[1]), Fn(s[0], s[3]), Fn(s[2], s[1]), Fn(s[2], s[3]), Fn(s[0], s[1]), Fn(s[0], s[3]), Fn(s[2], s[1]), Fn(s[2], s[3]) ],
|
|
5268
5276
|
t.Nn = [ Math.min.apply(Math, i.map(t => t[0])), Math.min.apply(Math, i.map(t => t[1])) ],
|
|
5269
|
-
t.
|
|
5277
|
+
t.En = [ Math.max.apply(Math, i.map(t => t[0])), Math.max.apply(Math, i.map(t => t[1])) ]);
|
|
5270
5278
|
if (n[0] >= s[0] && n[0] <= s[2] && n[1] >= s[1] && n[1] <= s[3]) return n[2] <= s[5] ? 0 : n[2] - s[5];
|
|
5271
|
-
const o = (a = t.Nn, c = t.
|
|
5279
|
+
const o = (a = t.Nn, c = t.En, h = e, u = Math.max(a[0] - h[0], 0, h[0] - c[0]),
|
|
5272
5280
|
f = Math.max(a[1] - h[1], 0, h[1] - c[1]), Math.sqrt(u * u + f * f) / r);
|
|
5273
5281
|
var a, c, h, u, f;
|
|
5274
5282
|
let l = 0;
|
|
5275
5283
|
n[2] > s[5] && (l = n[2] - s[5]);
|
|
5276
5284
|
return Math.sqrt(o * o + l * l);
|
|
5277
5285
|
}(t, this.dn, this.hn, r), o = function(t, e) {
|
|
5278
|
-
const r = t.boundingVolume.region, s =
|
|
5286
|
+
const r = t.boundingVolume.region, s = Jt(Ln, r[0], r[1], r[4]), i = Jt(Rn, r[2], r[3], r[5]), o = n.vec3.scale(s, n.vec3.add(s, s, i), .5);
|
|
5279
5287
|
return n.vec3.dist(o, e);
|
|
5280
5288
|
}(t, this.un);
|
|
5281
|
-
} else t.boundingVolume.sphere ? (i =
|
|
5289
|
+
} else t.boundingVolume.sphere ? (i = Un(t.boundingVolume, this.un), o = function(t, e) {
|
|
5282
5290
|
const r = t.boundingVolume.sphere;
|
|
5283
5291
|
return n.vec3.dist(r, e);
|
|
5284
|
-
}(t, this.un)) : t.boundingVolume.box && (i =
|
|
5292
|
+
}(t, this.un)) : t.boundingVolume.box && (i = Bn(t.boundingVolume, this.un), o = function(t, e) {
|
|
5285
5293
|
const r = t.boundingVolume.box;
|
|
5286
5294
|
return n.vec3.dist(r, e);
|
|
5287
5295
|
}(t, this.un));
|
|
@@ -5296,15 +5304,15 @@
|
|
|
5296
5304
|
return this.rn[t];
|
|
5297
5305
|
}
|
|
5298
5306
|
}
|
|
5299
|
-
function
|
|
5307
|
+
function Un(t, e) {
|
|
5300
5308
|
const r = t.sphere, s = n.vec3.dist(r, e), i = t.sphere[3];
|
|
5301
5309
|
return s < i ? 0 : s - i;
|
|
5302
5310
|
}
|
|
5303
|
-
function
|
|
5311
|
+
function Bn(t, e) {
|
|
5304
5312
|
const n = t.box;
|
|
5305
|
-
return
|
|
5313
|
+
return gn(n.slice(0, 3), n.slice(3), e);
|
|
5306
5314
|
}
|
|
5307
|
-
|
|
5315
|
+
Cn.mergeOptions({
|
|
5308
5316
|
"maxGPUMemory": 512,
|
|
5309
5317
|
"retireInterval": 2e3,
|
|
5310
5318
|
"loadingLimitOnInteracting": 5,
|
|
@@ -5319,35 +5327,35 @@
|
|
|
5319
5327
|
"sRGBTolinear": !1,
|
|
5320
5328
|
"optionalExtensions": [ "ANGLE_instanced_arrays", "OES_element_index_uint", "OES_standard_derivatives", "OES_vertex_array_object", "OES_texture_half_float", "OES_texture_half_float_linear", "OES_texture_float", "OES_texture_float_linear", "WEBGL_depth_texture", "EXT_shader_texture_lod", "WEBGL_compressed_texture_s3tc" ],
|
|
5321
5329
|
"offset": [ 0, 0 ]
|
|
5322
|
-
}),
|
|
5323
|
-
const
|
|
5324
|
-
function
|
|
5330
|
+
}), Cn.registerRenderer("gl", bn);
|
|
5331
|
+
const Ln = [], Rn = [];
|
|
5332
|
+
function Fn(t, e) {
|
|
5325
5333
|
const n = new s.Coordinate(p(t), p(e));
|
|
5326
|
-
return
|
|
5334
|
+
return Sn.project(n).toArray();
|
|
5327
5335
|
}
|
|
5328
|
-
const
|
|
5336
|
+
const Dn = function() {
|
|
5329
5337
|
if ("undefined" != typeof self) return self;
|
|
5330
5338
|
if ("undefined" != typeof window) return window;
|
|
5331
5339
|
if ("undefined" != typeof global) return global;
|
|
5332
5340
|
throw new Error("unable to locate global object");
|
|
5333
|
-
},
|
|
5334
|
-
|
|
5335
|
-
const e = t.toString(), n = e.indexOf("{") + 1, r = e.substring(0, n), s =
|
|
5336
|
-
let i = `${r}\n const _____getGlobal = ${
|
|
5341
|
+
}, kn = Dn(), zn = kn.gl_trans__coders = kn.gl_trans__coders || {};
|
|
5342
|
+
zn.inject = function(t) {
|
|
5343
|
+
const e = t.toString(), n = e.indexOf("{") + 1, r = e.substring(0, n), s = kn.gl_trans__coders = kn.gl_trans__coders || {};
|
|
5344
|
+
let i = `${r}\n const _____getGlobal = ${Dn.toString()};\n const g___lobals = _____getGlobal()\n const tran_____scoders = g___lobals['gl_trans__coders'] = g___lobals['gl_trans__coders'] || {};`;
|
|
5337
5345
|
for (const t in s) "inject" !== t && "getTranscoder" !== t && "registerTranscoder" !== t && (i += 'tran_____scoders["' + t + '"] =' + s[t].toString() + "\n;");
|
|
5338
5346
|
return i += "\n" + e.substring(r.length), i;
|
|
5339
|
-
},
|
|
5340
|
-
|
|
5341
|
-
},
|
|
5342
|
-
return
|
|
5347
|
+
}, zn.registerTranscoder = function(t, e) {
|
|
5348
|
+
zn[t] = e;
|
|
5349
|
+
}, zn.getTranscoder = function(t) {
|
|
5350
|
+
return zn[t];
|
|
5343
5351
|
};
|
|
5344
|
-
class
|
|
5352
|
+
class jn {
|
|
5345
5353
|
constructor(t, e) {
|
|
5346
|
-
this.A = t, this.tt = e ||
|
|
5347
|
-
"image/crn":
|
|
5348
|
-
"image/ktx2":
|
|
5349
|
-
"image/cttf":
|
|
5350
|
-
"draco":
|
|
5354
|
+
this.A = t, this.tt = e || Et, this.et = {
|
|
5355
|
+
"image/crn": zn.crn && zn.crn(),
|
|
5356
|
+
"image/ktx2": zn.ktx2 && zn.ktx2(),
|
|
5357
|
+
"image/cttf": zn.ktx2 && zn.ktx2(),
|
|
5358
|
+
"draco": zn.draco && zn.draco()
|
|
5351
5359
|
};
|
|
5352
5360
|
}
|
|
5353
5361
|
static createEmptyB3DM() {
|
|
@@ -5405,15 +5413,15 @@
|
|
|
5405
5413
|
o = h, h = a, u = c, a = 0, c = 0);
|
|
5406
5414
|
const l = [ t ];
|
|
5407
5415
|
let d, m, y;
|
|
5408
|
-
if (a > 0 ? (d =
|
|
5416
|
+
if (a > 0 ? (d = ce(t, f, a), f += a, o = d.BATCH_LENGTH) : d = {
|
|
5409
5417
|
"BATCH_LENGTH": o
|
|
5410
|
-
}, c > 0 && (f += c), h > 0 && (m =
|
|
5411
|
-
const e =
|
|
5418
|
+
}, c > 0 && (f += c), h > 0 && (m = he(t, f, h), f += h, u > 0)) {
|
|
5419
|
+
const e = ue(0, f, u);
|
|
5412
5420
|
y = t.slice(e.offset, e.offset + e.byteLength), f += u, l.push(y);
|
|
5413
5421
|
}
|
|
5414
5422
|
const b = d.BATCH_LENGTH, p = {};
|
|
5415
5423
|
if (d && d.BATCH_ID) {
|
|
5416
|
-
p.BATCH_ID =
|
|
5424
|
+
p.BATCH_ID = le(d.BATCH_ID, t, (void 0).offset, b);
|
|
5417
5425
|
const e = p.BATCH_ID.array && p.BATCH_ID.array.buffer;
|
|
5418
5426
|
e && l.indexOf(e) < 0 && l.push(e);
|
|
5419
5427
|
}
|
|
@@ -5427,7 +5435,7 @@
|
|
|
5427
5435
|
glb: {
|
|
5428
5436
|
buffer: t,
|
|
5429
5437
|
byteOffset: f,
|
|
5430
|
-
byteLength: s.byteLength - f
|
|
5438
|
+
byteLength: s.byteLength + s.byteOffset - f
|
|
5431
5439
|
}
|
|
5432
5440
|
};
|
|
5433
5441
|
}
|
|
@@ -5435,13 +5443,13 @@
|
|
|
5435
5443
|
return null;
|
|
5436
5444
|
}
|
|
5437
5445
|
}
|
|
5438
|
-
class
|
|
5446
|
+
class Vn {
|
|
5439
5447
|
constructor(t, e) {
|
|
5440
|
-
this.A = t, this.tt = e ||
|
|
5441
|
-
"image/crn":
|
|
5442
|
-
"image/ktx2":
|
|
5443
|
-
"image/cttf":
|
|
5444
|
-
"draco":
|
|
5448
|
+
this.A = t, this.tt = e || Et, this.et = {
|
|
5449
|
+
"image/crn": zn.crn && zn.crn(),
|
|
5450
|
+
"image/ktx2": zn.ktx2 && zn.ktx2(),
|
|
5451
|
+
"image/cttf": zn.ktx2 && zn.ktx2(),
|
|
5452
|
+
"draco": zn.draco && zn.draco()
|
|
5445
5453
|
};
|
|
5446
5454
|
}
|
|
5447
5455
|
load(t, e, n = 0, r = 0) {
|
|
@@ -5517,7 +5525,7 @@
|
|
|
5517
5525
|
error: t
|
|
5518
5526
|
};
|
|
5519
5527
|
}
|
|
5520
|
-
const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} =
|
|
5528
|
+
const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} = pe(s, 32 + e, o), f = {}, l = a.INSTANCES_LENGTH;
|
|
5521
5529
|
if (a.POSITION) {
|
|
5522
5530
|
const {byteOffset: e} = a.POSITION;
|
|
5523
5531
|
f.POSITION = {
|
|
@@ -5540,7 +5548,7 @@
|
|
|
5540
5548
|
}, o.push(f.POSITION.array.buffer);
|
|
5541
5549
|
}
|
|
5542
5550
|
if (a.BATCH_ID) {
|
|
5543
|
-
f.BATCH_ID =
|
|
5551
|
+
f.BATCH_ID = le(a.BATCH_ID, t, c.offset, l);
|
|
5544
5552
|
const e = f.BATCH_ID.array && f.BATCH_ID.array.buffer;
|
|
5545
5553
|
e && o.indexOf(e) < 0 && o.push(e);
|
|
5546
5554
|
}
|
|
@@ -5611,26 +5619,26 @@
|
|
|
5611
5619
|
}
|
|
5612
5620
|
ht(t) {
|
|
5613
5621
|
const e = t.length / 2, n = new Float32Array(3 * e), r = [];
|
|
5614
|
-
for (let s = 0; s < e; s++)
|
|
5622
|
+
for (let s = 0; s < e; s++) Gn(r, t[2 * s], t[2 * s + 1], 65535), n[3 * s] = r[0],
|
|
5615
5623
|
n[3 * s + 1] = r[1], n[3 * s + 2] = r[2];
|
|
5616
5624
|
return n;
|
|
5617
5625
|
}
|
|
5618
5626
|
ct(t, e, n) {
|
|
5619
|
-
return
|
|
5627
|
+
return be(new Float32Array(t.length), t, e, n);
|
|
5620
5628
|
}
|
|
5621
5629
|
st() {
|
|
5622
5630
|
return null;
|
|
5623
5631
|
}
|
|
5624
5632
|
}
|
|
5625
|
-
function
|
|
5626
|
-
if (t[0] =
|
|
5633
|
+
function Gn(t, e, n, r) {
|
|
5634
|
+
if (t[0] = Hn(e, r), t[1] = Hn(n, r), t[2] = 1 - (Math.abs(t[0]) + Math.abs(t[1])),
|
|
5627
5635
|
t[2] < 0) {
|
|
5628
5636
|
const e = t[0];
|
|
5629
|
-
t[0] = (1 - Math.abs(t[1])) *
|
|
5637
|
+
t[0] = (1 - Math.abs(t[1])) * qn(e), t[1] = (1 - Math.abs(e)) * qn(t[1]);
|
|
5630
5638
|
}
|
|
5631
5639
|
return D(t, t);
|
|
5632
5640
|
}
|
|
5633
|
-
function
|
|
5641
|
+
function Hn(t, e) {
|
|
5634
5642
|
return function(t, e, n) {
|
|
5635
5643
|
return t < e ? e : t > n ? n : t;
|
|
5636
5644
|
}(t, 0, e = function(t, e) {
|
|
@@ -5638,10 +5646,10 @@
|
|
|
5638
5646
|
return e;
|
|
5639
5647
|
}(e, 255)) / e * 2 - 1;
|
|
5640
5648
|
}
|
|
5641
|
-
function
|
|
5649
|
+
function qn(t) {
|
|
5642
5650
|
return t < 0 ? -1 : 1;
|
|
5643
5651
|
}
|
|
5644
|
-
class
|
|
5652
|
+
class $n {
|
|
5645
5653
|
constructor() {}
|
|
5646
5654
|
load(t, e, n = 0, r = 0) {
|
|
5647
5655
|
return e ? (r || (r = e.byteLength), this.nt(t, e, n, r)) : ft.getArrayBuffer(t, {}).then(e => {
|
|
@@ -5674,7 +5682,7 @@
|
|
|
5674
5682
|
error: t
|
|
5675
5683
|
};
|
|
5676
5684
|
}
|
|
5677
|
-
const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} =
|
|
5685
|
+
const o = [ t ], {featureTable: a, featureTableBin: c, batchTable: h, batchTableBin: u} = pe(s, e + 28, o), f = a.QUANTIZED_VOLUME_OFFSET, l = a.QUANTIZED_VOLUME_SCALE, d = a.POINTS_LENGTH;
|
|
5678
5686
|
let m, y = {};
|
|
5679
5687
|
if (a.extensions && a.extensions["3DTILES_draco_point_compression"]) {
|
|
5680
5688
|
y = a.extensions["3DTILES_draco_point_compression"], m = new DataView(t, y.byteOffset + c.offset, y.byteLength);
|
|
@@ -5682,7 +5690,7 @@
|
|
|
5682
5690
|
attributes: y.properties,
|
|
5683
5691
|
useUniqueIDs: !1
|
|
5684
5692
|
};
|
|
5685
|
-
return this.ft || (this.ft =
|
|
5693
|
+
return this.ft || (this.ft = zn.draco()), this.ft(m, e).then(e => {
|
|
5686
5694
|
const n = e.attributes;
|
|
5687
5695
|
!a.POSITION && !a.POSITION_QUANTIZED || n.POSITION || n.POSITION_QUANTIZED || (n.POSITION = a.POSITION,
|
|
5688
5696
|
n.POSITION_QUANTIZED = a.POSITION_QUANTIZED), !(a.RGB || a.RGBA || a.RGB565) || n.RGB || n.RGBA || n.RGB565 || (n.RGB = a.RGB,
|
|
@@ -5696,11 +5704,11 @@
|
|
|
5696
5704
|
byteOffset: 0,
|
|
5697
5705
|
itemSize: 1,
|
|
5698
5706
|
count: t.length,
|
|
5699
|
-
componentType:
|
|
5707
|
+
componentType: ye(t.constructor),
|
|
5700
5708
|
array: t
|
|
5701
5709
|
}, o.push(t.buffer);
|
|
5702
5710
|
} else if (a.BATCH_ID || Object.keys(h).length) {
|
|
5703
|
-
a.BATCH_ID ? r.BATCH_ID =
|
|
5711
|
+
a.BATCH_ID ? r.BATCH_ID = le(a.BATCH_ID, t, c.offset, d) : r.BATCH_ID = Jn(d);
|
|
5704
5712
|
const e = r.BATCH_ID.array && r.BATCH_ID.array.buffer;
|
|
5705
5713
|
e && o.indexOf(e) < 0 && o.push(e);
|
|
5706
5714
|
}
|
|
@@ -5716,7 +5724,7 @@
|
|
|
5716
5724
|
}
|
|
5717
5725
|
const b = this.lt(t, a, c.offset, d, o, f, l);
|
|
5718
5726
|
if (a.BATCH_ID || Object.keys(h).length) {
|
|
5719
|
-
a.BATCH_ID ? b.BATCH_ID =
|
|
5727
|
+
a.BATCH_ID ? b.BATCH_ID = le(a.BATCH_ID, t, c.offset, d) : b.BATCH_ID = Jn(d);
|
|
5720
5728
|
const e = b.BATCH_ID.array && b.BATCH_ID.array.buffer;
|
|
5721
5729
|
e && o.indexOf(e) < 0 && o.push(e);
|
|
5722
5730
|
}
|
|
@@ -5845,13 +5853,13 @@
|
|
|
5845
5853
|
return a;
|
|
5846
5854
|
}
|
|
5847
5855
|
ct(t, e, n) {
|
|
5848
|
-
return
|
|
5856
|
+
return be(new Float32Array(t.length), t, e, n);
|
|
5849
5857
|
}
|
|
5850
5858
|
st() {
|
|
5851
5859
|
return null;
|
|
5852
5860
|
}
|
|
5853
5861
|
}
|
|
5854
|
-
function
|
|
5862
|
+
function Jn(t) {
|
|
5855
5863
|
const e = O(t), n = new e(t);
|
|
5856
5864
|
for (let e = 0; e < t; e++) n[e] = e;
|
|
5857
5865
|
return {
|
|
@@ -5859,13 +5867,13 @@
|
|
|
5859
5867
|
byteOffset: 0,
|
|
5860
5868
|
itemSize: 1,
|
|
5861
5869
|
count: t,
|
|
5862
|
-
componentType:
|
|
5870
|
+
componentType: ye(e),
|
|
5863
5871
|
array: n
|
|
5864
5872
|
};
|
|
5865
5873
|
}
|
|
5866
|
-
class
|
|
5874
|
+
class Kn {
|
|
5867
5875
|
constructor(t, e) {
|
|
5868
|
-
this.A = t, this.tt = e ||
|
|
5876
|
+
this.A = t, this.tt = e || Et;
|
|
5869
5877
|
}
|
|
5870
5878
|
load(t, e, n = 0, r = 0) {
|
|
5871
5879
|
return e ? this.nt(t, e, n, r) : ft.getArrayBuffer(t, {}).then(e => {
|
|
@@ -5878,12 +5886,12 @@
|
|
|
5878
5886
|
const s = this.dt(e, t, n, r), i = [];
|
|
5879
5887
|
for (let n = 0; n < s.length; n++) {
|
|
5880
5888
|
let r;
|
|
5881
|
-
if ("b3dm" === s[n].magic) r = new
|
|
5889
|
+
if ("b3dm" === s[n].magic) r = new jn(this.A, this.tt); else if ("i3dm" === s[n].magic) r = new Vn(this.A, this.tt); else if ("pnts" === s[n].magic) r = new $n; else {
|
|
5882
5890
|
if ("cmpt" !== s[n].magic) {
|
|
5883
5891
|
console.warn("Unsupported magic in CMPT tile:", s[n].magic);
|
|
5884
5892
|
continue;
|
|
5885
5893
|
}
|
|
5886
|
-
r = new
|
|
5894
|
+
r = new Kn(this.A, this.tt);
|
|
5887
5895
|
}
|
|
5888
5896
|
i.push(r.load(t, e, s[n].offset, s[n].byteLength).then(t => t));
|
|
5889
5897
|
}
|
|
@@ -5900,17 +5908,11 @@
|
|
|
5900
5908
|
error: t
|
|
5901
5909
|
};
|
|
5902
5910
|
}
|
|
5903
|
-
if (s.getUint32(8, !0) !== s.byteLength) {
|
|
5904
|
-
const t = "Length in cmpt header is inconsistent with cmpt's byte length, url: " + e;
|
|
5905
|
-
return console.warn(t), {
|
|
5906
|
-
error: t
|
|
5907
|
-
};
|
|
5908
|
-
}
|
|
5909
5911
|
if (16 === s.byteLength) return [];
|
|
5910
5912
|
const o = [], a = s.getUint32(12, !0);
|
|
5911
5913
|
let c = 16;
|
|
5912
5914
|
for (let e = 0; e < a; e++) {
|
|
5913
|
-
const e =
|
|
5915
|
+
const e = oe(s, c), r = s.getUint32(c + 8, !0);
|
|
5914
5916
|
o.push({
|
|
5915
5917
|
magic: e,
|
|
5916
5918
|
buffer: t,
|
|
@@ -5921,9 +5923,9 @@
|
|
|
5921
5923
|
return o;
|
|
5922
5924
|
}
|
|
5923
5925
|
}
|
|
5924
|
-
t.B3DMLoader =
|
|
5925
|
-
t.Geo3DTransform =
|
|
5926
|
+
t.B3DMLoader = jn, t.CMPTLoader = Kn, t.Geo3DTilesLayer = Cn, t.Geo3DTilesUtil = x,
|
|
5927
|
+
t.Geo3DTransform = ie, Object.defineProperty(t, "t", {
|
|
5926
5928
|
value: !0
|
|
5927
5929
|
});
|
|
5928
|
-
})), i.Map.VERSION, o.GroupGLLayer.VERSION, "undefined" != typeof console && console.log("@maptalks/3dtiles v0.11.
|
|
5930
|
+
})), i.Map.VERSION, o.GroupGLLayer.VERSION, "undefined" != typeof console && console.log("@maptalks/3dtiles v0.11.4");
|
|
5929
5931
|
}));
|