@maptalks/3dtiles 0.10.0 → 0.10.1
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 +192 -191
- package/package.json +1 -1
package/dist/maptalks.3dtiles.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @maptalks/3dtiles v0.10.
|
|
2
|
+
* @maptalks/3dtiles v0.10.1
|
|
3
3
|
* LICENSE : UNLICENSED
|
|
4
4
|
* (c) 2016-2021 maptalks.com
|
|
5
5
|
*/
|
|
@@ -127,10 +127,10 @@
|
|
|
127
127
|
function v(t) {
|
|
128
128
|
return null == t;
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function O(t) {
|
|
131
131
|
return !v(t);
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function M(t) {
|
|
134
134
|
for (let e = 1; e < arguments.length; e++) {
|
|
135
135
|
const n = arguments[e];
|
|
136
136
|
for (const e in n) t[e] = n[e];
|
|
@@ -172,10 +172,10 @@
|
|
|
172
172
|
for (let t = 0; t < n; t++) r[t] = e.charCodeAt(t);
|
|
173
173
|
return r.buffer;
|
|
174
174
|
}
|
|
175
|
-
const N = [],
|
|
175
|
+
const N = [], E = [], P = [], U = [ 0, 0, 0 ], L = function(t) {
|
|
176
176
|
return t[0] = 0, t[1] = 0, t[2] = 0, t[3] = 1, t;
|
|
177
177
|
}([]), B = [ 1, 1, 1 ];
|
|
178
|
-
function
|
|
178
|
+
function C(t, e, n, r, s, i, o) {
|
|
179
179
|
const a = S(o);
|
|
180
180
|
if ((0 === s || s === r * a.BYTES_PER_ELEMENT) && i % a.BYTES_PER_ELEMENT == 0) {
|
|
181
181
|
const s = new a(e, i, n * r);
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
l.byteOffset = a + (i.byteOffset || 0), i.interleaved && "indices" !== t && "input" !== t && "output" !== t && t.indexOf("morph") < 0 ? l.array = new Uint8Array(n, a, o.byteLength) : l.array = this.p(n, i.count, c, a + (i.byteOffset || 0), u); else if (l.byteStride = 0,
|
|
303
303
|
l.byteOffset = 0, i.interleaved) {
|
|
304
304
|
const t = new u(i.count * c);
|
|
305
|
-
l.array =
|
|
305
|
+
l.array = C(t, n, i.count, c, h, a + (i.byteOffset || 0), i.componentType);
|
|
306
306
|
} else l.array = this.p(n, i.count, c, a + (i.byteOffset || 0), u); else {
|
|
307
307
|
l.array = new u(i.count);
|
|
308
308
|
const t = l.min || l.max;
|
|
@@ -340,10 +340,10 @@
|
|
|
340
340
|
}
|
|
341
341
|
createNode(t) {
|
|
342
342
|
const e = {};
|
|
343
|
-
if (
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
343
|
+
if (O(t.name) && (e.name = t.name), O(t.children) && (e.children = t.children),
|
|
344
|
+
O(t.jointName) && (e.jointName = t.jointName), O(t.matrix) && (e.matrix = t.matrix),
|
|
345
|
+
O(t.rotation) && (e.rotation = t.rotation), O(t.scale) && (e.scale = t.scale), O(t.translation) && (e.translation = t.translation),
|
|
346
|
+
O(t.extras) && (e.extras = t.extras), O(t.meshes) && (e.mesh = t.meshes[0]), e.translation || e.rotation || e.scale) {
|
|
347
347
|
const t = function(t, e) {
|
|
348
348
|
if (e.matrix) return e.matrix;
|
|
349
349
|
if (e.translation || e.scale || e.rotation) {
|
|
@@ -351,16 +351,16 @@
|
|
|
351
351
|
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,
|
|
352
352
|
t[8] = 0, t[9] = 0, t[10] = 1, t[11] = 0, t[12] = e[0], t[13] = e[1], t[14] = e[2],
|
|
353
353
|
t[15] = 1, t;
|
|
354
|
-
}(N, e.translation ||
|
|
354
|
+
}(N, e.translation || U), s = function(t, e) {
|
|
355
355
|
var n = e[0], r = e[1], s = e[2], i = e[3], o = n + n, a = r + r, c = s + s, u = n * o, h = r * o, l = r * a, f = s * o, d = s * a, m = s * c, y = i * o, b = i * a, p = i * c;
|
|
356
356
|
return t[0] = 1 - l - m, t[1] = h + p, t[2] = f - b, t[3] = 0, t[4] = h - p, t[5] = 1 - u - m,
|
|
357
357
|
t[6] = d + y, t[7] = 0, t[8] = f + b, t[9] = d - y, t[10] = 1 - u - l, t[11] = 0,
|
|
358
358
|
t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, t;
|
|
359
|
-
}(
|
|
359
|
+
}(E, e.rotation || L), i = function(t, e) {
|
|
360
360
|
return t[0] = e[0], t[1] = 0, t[2] = 0, t[3] = 0, t[4] = 0, t[5] = e[1], t[6] = 0,
|
|
361
361
|
t[7] = 0, t[8] = 0, t[9] = 0, t[10] = e[2], t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0,
|
|
362
362
|
t[15] = 1, t;
|
|
363
|
-
}(
|
|
363
|
+
}(P, e.scale || B);
|
|
364
364
|
return r(i, s, i), r(t, n, i);
|
|
365
365
|
}
|
|
366
366
|
return n(t);
|
|
@@ -460,7 +460,7 @@
|
|
|
460
460
|
}
|
|
461
461
|
createNode(t) {
|
|
462
462
|
const e = {};
|
|
463
|
-
return
|
|
463
|
+
return M(e, t), !O(t.weights) && this.gltf.meshes && O(e.mesh) ? e.weights = this.gltf.meshes[e.mesh].weights : t.weights && (e.weights = t.weights),
|
|
464
464
|
e;
|
|
465
465
|
}
|
|
466
466
|
T(t) {
|
|
@@ -481,19 +481,19 @@
|
|
|
481
481
|
extras: n.extras
|
|
482
482
|
}
|
|
483
483
|
};
|
|
484
|
-
|
|
485
|
-
const s =
|
|
484
|
+
M(r, e);
|
|
485
|
+
const s = O(e.sampler) ? this.gltf.samplers[e.sampler] : void 0;
|
|
486
486
|
return s && (r.sampler = s), t.format && (r.format = t.format), r;
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
489
|
_(t) {
|
|
490
|
-
if (!
|
|
490
|
+
if (!O(t.bufferView)) return this.v(t);
|
|
491
491
|
{
|
|
492
492
|
const e = this.gltf.bufferViews[t.bufferView];
|
|
493
493
|
if (this.images[t.id]) return Promise.resolve(this.images[t.id]);
|
|
494
494
|
const n = this.gltf.buffers[e.buffer];
|
|
495
|
-
if (n.uri) return this.
|
|
496
|
-
if (this.glbBuffer) return this.
|
|
495
|
+
if (n.uri) return this.O(n, e, t);
|
|
496
|
+
if (this.glbBuffer) return this.M(e, t);
|
|
497
497
|
}
|
|
498
498
|
return null;
|
|
499
499
|
}
|
|
@@ -513,7 +513,7 @@
|
|
|
513
513
|
return this.S(e.id, r);
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
|
|
516
|
+
O(t, e, n) {
|
|
517
517
|
if (this.buffers[t.id]) {
|
|
518
518
|
const r = this.buffers[t.id], s = this.N(e, r);
|
|
519
519
|
return this.I(s, n);
|
|
@@ -531,7 +531,7 @@
|
|
|
531
531
|
return this.I(i, n);
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
|
-
|
|
534
|
+
M(t, e) {
|
|
535
535
|
const n = this.N(t, this.glbBuffer.buffer, this.glbBuffer.byteOffset);
|
|
536
536
|
return this.I(n, e);
|
|
537
537
|
}
|
|
@@ -565,7 +565,7 @@
|
|
|
565
565
|
}
|
|
566
566
|
getSamplers(t) {
|
|
567
567
|
const e = [];
|
|
568
|
-
for (let n = 0; n < t.length; n++) (
|
|
568
|
+
for (let n = 0; n < t.length; n++) (O(t[n].input) || O(t[n].output)) && (e.push(this.accessor.u("input", t[n].input)),
|
|
569
569
|
e.push(this.accessor.u("output", t[n].output)));
|
|
570
570
|
return Promise.all(e).then(e => {
|
|
571
571
|
for (let n = 0; n < e.length / 2; n++) t[n].input = e[2 * n], t[n].output = e[2 * n + 1],
|
|
@@ -656,26 +656,26 @@
|
|
|
656
656
|
INTERPOLATION: null
|
|
657
657
|
}, X = {
|
|
658
658
|
U(t, e, n, r, s, i, o, a) {
|
|
659
|
-
const u =
|
|
659
|
+
const u = O(t) ? e.animations : [ e.animations[0] ], h = {};
|
|
660
660
|
for (let e = 0; e < u.length; e++) {
|
|
661
661
|
const l = u[e];
|
|
662
|
-
if (
|
|
662
|
+
if (O(t) && l.name !== t) continue;
|
|
663
663
|
const f = l.channelsMap[n];
|
|
664
664
|
if (f) for (let t = 0; t < f.length; t++) {
|
|
665
665
|
const e = f[t];
|
|
666
|
-
"translation" === e.target.path ? (this.
|
|
667
|
-
h.rotation = T(q, i)) : "scale" === e.target.path ? (this.
|
|
668
|
-
h.scale = c(J, o)) : "weights" === e.target.path && a && (this.
|
|
666
|
+
"translation" === e.target.path ? (this.L(s, l.samplers[e.sampler], r, 1), h.translation = c($, s)) : "rotation" === e.target.path ? (this.B(i, l.samplers[e.sampler], r, 1),
|
|
667
|
+
h.rotation = T(q, i)) : "scale" === e.target.path ? (this.L(o, l.samplers[e.sampler], r, 1),
|
|
668
|
+
h.scale = c(J, o)) : "weights" === e.target.path && a && (this.L(a, l.samplers[e.sampler], r, a.length),
|
|
669
669
|
h.weights = a);
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
return h;
|
|
673
673
|
},
|
|
674
|
-
|
|
674
|
+
L(t, e, n, r) {
|
|
675
675
|
switch (e.interpolation) {
|
|
676
676
|
case "LINEAR":
|
|
677
677
|
{
|
|
678
|
-
const s = this.
|
|
678
|
+
const s = this.C(Z, e, n, 1 * r);
|
|
679
679
|
s && (t = function(t, e, n, r) {
|
|
680
680
|
for (let s = 0; s < t.length; s++) t[s] = e[s] + r * (n[s] - e[s]);
|
|
681
681
|
return t;
|
|
@@ -685,7 +685,7 @@
|
|
|
685
685
|
|
|
686
686
|
case "STEP":
|
|
687
687
|
{
|
|
688
|
-
const s = this.
|
|
688
|
+
const s = this.C(Z, e, n, 1 * r);
|
|
689
689
|
s && (t = function(t, e) {
|
|
690
690
|
for (let n = 0; n < t.length; n++) t[n] = e[n];
|
|
691
691
|
return t;
|
|
@@ -695,32 +695,32 @@
|
|
|
695
695
|
|
|
696
696
|
case "CUBICSPLINE":
|
|
697
697
|
{
|
|
698
|
-
const s = this.
|
|
698
|
+
const s = this.C(Z, e, n, 3 * r);
|
|
699
699
|
s && (t = this.R(t, s, e.input.array, 3 * r));
|
|
700
700
|
break;
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
703
|
return t;
|
|
704
704
|
},
|
|
705
|
-
|
|
705
|
+
B(t, e, n) {
|
|
706
706
|
switch (e.interpolation) {
|
|
707
707
|
case "LINEAR":
|
|
708
708
|
{
|
|
709
|
-
const r = this.
|
|
709
|
+
const r = this.C(Z, e, n, 1);
|
|
710
710
|
r && g(t, r.PREVIOUS, r.NEXT, r.INTERPOLATION);
|
|
711
711
|
break;
|
|
712
712
|
}
|
|
713
713
|
|
|
714
714
|
case "STEP":
|
|
715
715
|
{
|
|
716
|
-
const r = this.
|
|
716
|
+
const r = this.C(Z, e, n, 1);
|
|
717
717
|
r && (t = p(t, ...r.PREVIOUS));
|
|
718
718
|
break;
|
|
719
719
|
}
|
|
720
720
|
|
|
721
721
|
case "CUBICSPLINE":
|
|
722
722
|
{
|
|
723
|
-
const r = this.
|
|
723
|
+
const r = this.C(Z, e, n, 3);
|
|
724
724
|
if (r) {
|
|
725
725
|
for (let t = 0; t < r.PREVIOUS.length; t++) r.PREVIOUS[t] = Math.acos(r.PREVIOUS[t]),
|
|
726
726
|
r.NEXT[t] = Math.acos(r.NEXT[t]);
|
|
@@ -749,7 +749,7 @@
|
|
|
749
749
|
}
|
|
750
750
|
return null;
|
|
751
751
|
},
|
|
752
|
-
|
|
752
|
+
C(t, e, n, r) {
|
|
753
753
|
const s = e.input.array, i = e.output.array, o = e.output.itemSize;
|
|
754
754
|
(n < s[0] || n > s[s.length - 1]) && (n = Math.max(s[0], Math.min(s[s.length - 1], n))),
|
|
755
755
|
n === s[s.length - 1] && (n = s[0]);
|
|
@@ -793,7 +793,7 @@
|
|
|
793
793
|
},
|
|
794
794
|
getTimeSpanByName(t, e) {
|
|
795
795
|
const n = this.getTimeSpan(t);
|
|
796
|
-
return n ?
|
|
796
|
+
return n ? O(e) ? n[e] : n[Object.keys(n)[0]] : null;
|
|
797
797
|
}
|
|
798
798
|
}, Y = "undefined" == typeof document ? null : document.createElement("canvas");
|
|
799
799
|
class Q {
|
|
@@ -854,7 +854,7 @@
|
|
|
854
854
|
return S(t);
|
|
855
855
|
}
|
|
856
856
|
static readInterleavedArray(t, e, n, r, s, i, o) {
|
|
857
|
-
return
|
|
857
|
+
return C(t, e, n, r, s, i, o);
|
|
858
858
|
}
|
|
859
859
|
D(t, e, n) {
|
|
860
860
|
this.gltf = e, this.glbBuffer = n, this.version = e.asset ? +e.asset.version : 1,
|
|
@@ -936,7 +936,7 @@
|
|
|
936
936
|
}
|
|
937
937
|
V() {
|
|
938
938
|
const t = this.gltf.animations;
|
|
939
|
-
return
|
|
939
|
+
return O(t) ? this.adapter.getAnimations(t) : null;
|
|
940
940
|
}
|
|
941
941
|
q(t) {
|
|
942
942
|
this.meshes = {};
|
|
@@ -951,7 +951,7 @@
|
|
|
951
951
|
const n = t.primitives.map(t => this.X(t, e)).filter(t => !!t);
|
|
952
952
|
return Promise.all(n).then(e => {
|
|
953
953
|
const n = {};
|
|
954
|
-
return
|
|
954
|
+
return M(n, t), n.primitives = e, n;
|
|
955
955
|
});
|
|
956
956
|
}
|
|
957
957
|
G() {
|
|
@@ -998,11 +998,11 @@
|
|
|
998
998
|
const n = this.adapter.accessor.u(t, r[t]);
|
|
999
999
|
n && e.push(n);
|
|
1000
1000
|
}
|
|
1001
|
-
if (
|
|
1001
|
+
if (O(t.indices)) {
|
|
1002
1002
|
const n = this.adapter.accessor.u("indices", t.indices);
|
|
1003
1003
|
n && e.push(n);
|
|
1004
1004
|
}
|
|
1005
|
-
if (
|
|
1005
|
+
if (O(t.targets)) for (let n = 0; n < t.targets.length; n++) {
|
|
1006
1006
|
const r = t.targets[n];
|
|
1007
1007
|
for (const t in r) {
|
|
1008
1008
|
const s = this.adapter.accessor.u(`morphTargets_${t}_${n}`, r[t]);
|
|
@@ -1019,8 +1019,8 @@
|
|
|
1019
1019
|
t), {}),
|
|
1020
1020
|
material: t.material
|
|
1021
1021
|
};
|
|
1022
|
-
return n && (s.indices = n), r && (s.morphTargets = r), s.mode =
|
|
1023
|
-
|
|
1022
|
+
return n && (s.indices = n), r && (s.morphTargets = r), s.mode = O(t.mode) ? t.mode : 4,
|
|
1023
|
+
O(t.extras) && (s.extras = t.extras), s;
|
|
1024
1024
|
});
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
@@ -1184,7 +1184,7 @@
|
|
|
1184
1184
|
};
|
|
1185
1185
|
}
|
|
1186
1186
|
/*!
|
|
1187
|
-
* @maptalks/gl v0.
|
|
1187
|
+
* @maptalks/gl v0.62.1
|
|
1188
1188
|
* LICENSE : UNLICENSED
|
|
1189
1189
|
* (c) 2016-2021 maptalks.com
|
|
1190
1190
|
*/ const yt = function() {
|
|
@@ -1562,7 +1562,7 @@
|
|
|
1562
1562
|
array: t
|
|
1563
1563
|
}, o.push(t.buffer);
|
|
1564
1564
|
} else if (a.BATCH_ID || Object.keys(u).length) {
|
|
1565
|
-
a.BATCH_ID ? r.BATCH_ID = ut(a.BATCH_ID, t, c.offset, d) : r.BATCH_ID =
|
|
1565
|
+
a.BATCH_ID ? r.BATCH_ID = ut(a.BATCH_ID, t, c.offset, d) : r.BATCH_ID = Ot(d);
|
|
1566
1566
|
const e = r.BATCH_ID.array && r.BATCH_ID.array.buffer;
|
|
1567
1567
|
e && o.indexOf(e) < 0 && o.push(e);
|
|
1568
1568
|
}
|
|
@@ -1578,7 +1578,7 @@
|
|
|
1578
1578
|
}
|
|
1579
1579
|
const b = this.lt(t, a, c.offset, d, o, l, f);
|
|
1580
1580
|
if (a.BATCH_ID || Object.keys(u).length) {
|
|
1581
|
-
a.BATCH_ID ? b.BATCH_ID = ut(a.BATCH_ID, t, c.offset, d) : b.BATCH_ID =
|
|
1581
|
+
a.BATCH_ID ? b.BATCH_ID = ut(a.BATCH_ID, t, c.offset, d) : b.BATCH_ID = Ot(d);
|
|
1582
1582
|
const e = b.BATCH_ID.array && b.BATCH_ID.array.buffer;
|
|
1583
1583
|
e && o.indexOf(e) < 0 && o.push(e);
|
|
1584
1584
|
}
|
|
@@ -1713,7 +1713,7 @@
|
|
|
1713
1713
|
return null;
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
|
-
function
|
|
1716
|
+
function Ot(t) {
|
|
1717
1717
|
const e = (n = t) < 256 ? Uint8Array : n < 65536 ? Uint16Array : Uint32Array;
|
|
1718
1718
|
var n;
|
|
1719
1719
|
const r = new e(t);
|
|
@@ -1727,7 +1727,7 @@
|
|
|
1727
1727
|
array: r
|
|
1728
1728
|
};
|
|
1729
1729
|
}
|
|
1730
|
-
class
|
|
1730
|
+
class Mt {
|
|
1731
1731
|
constructor(t, e) {
|
|
1732
1732
|
this.A = t, this.W = e || Q;
|
|
1733
1733
|
}
|
|
@@ -1747,7 +1747,7 @@
|
|
|
1747
1747
|
console.warn("Unsupported magic in CMPT tile:", s[n].magic);
|
|
1748
1748
|
continue;
|
|
1749
1749
|
}
|
|
1750
|
-
r = new
|
|
1750
|
+
r = new Mt(this.A, this.W);
|
|
1751
1751
|
}
|
|
1752
1752
|
i.push(r.load(t, e, s[n].offset, s[n].byteLength).then(t => t));
|
|
1753
1753
|
}
|
|
@@ -1786,23 +1786,23 @@
|
|
|
1786
1786
|
}
|
|
1787
1787
|
}
|
|
1788
1788
|
new Array(3), new Array(3);
|
|
1789
|
-
const St = [ 1 / 6378137, 1 / 6378137, 1 / 6356752.314245179 ], xt = [ 1 / 40680631590769, 1 / 40680631590769, 1 / 40408299984661.445 ], It = new Array(3), Nt = new Array(3),
|
|
1790
|
-
function
|
|
1789
|
+
const St = [ 1 / 6378137, 1 / 6378137, 1 / 6356752.314245179 ], xt = [ 1 / 40680631590769, 1 / 40680631590769, 1 / 40408299984661.445 ], It = new Array(3), Nt = new Array(3), Et = new Array(3);
|
|
1790
|
+
function Pt(t, e) {
|
|
1791
1791
|
const n = xt, r = function(t, e, n, r, s) {
|
|
1792
1792
|
const i = e[0], o = e[1], a = e[2], c = n[0], u = n[1], h = n[2], l = i * i * c * c, f = o * o * u * u, d = a * a * h * h, m = l + f + d, y = Math.sqrt(1 / m), b = function(t, e, n) {
|
|
1793
1793
|
return t[0] = e[0] * n, t[1] = e[1] * n, t[2] = e[2] * n, t;
|
|
1794
|
-
}(
|
|
1794
|
+
}(Ut, e, y);
|
|
1795
1795
|
if (m < s) return isFinite(y) ? b : void 0;
|
|
1796
1796
|
const p = r[0], w = r[1], g = r[2], _ = Lt;
|
|
1797
1797
|
_[0] = b[0] * p * 2, _[1] = b[1] * w * 2, _[2] = b[2] * g * 2;
|
|
1798
|
-
let T, A, v,
|
|
1798
|
+
let T, A, v, O, M, S, x, I, N, E, P, U = (1 - y) * Bt(e) / (.5 * Bt(_)), L = 0;
|
|
1799
1799
|
do {
|
|
1800
|
-
|
|
1801
|
-
x =
|
|
1802
|
-
A = l * N * p + f *
|
|
1800
|
+
U -= L, v = 1 / (1 + U * p), O = 1 / (1 + U * w), M = 1 / (1 + U * g), S = v * v,
|
|
1801
|
+
x = O * O, I = M * M, N = S * v, E = x * O, P = I * M, T = l * S + f * x + d * I - 1,
|
|
1802
|
+
A = l * N * p + f * E * w + d * P * g;
|
|
1803
1803
|
L = T / (-2 * A);
|
|
1804
1804
|
} while (Math.abs(T) > 1e-12);
|
|
1805
|
-
return t[0] = i * v, t[1] = o *
|
|
1805
|
+
return t[0] = i * v, t[1] = o * O, t[2] = a * M, t;
|
|
1806
1806
|
}(It, e, St, n, .1);
|
|
1807
1807
|
let s = y(Nt, r, n);
|
|
1808
1808
|
s = function(t, e) {
|
|
@@ -1811,21 +1811,21 @@
|
|
|
1811
1811
|
i > 0 && (i = Math.sqrt(i), t[0] = e[0] / i, t[1] = e[1] / i, t[2] = e[2] / i);
|
|
1812
1812
|
return t;
|
|
1813
1813
|
}(s, s);
|
|
1814
|
-
const i = m(
|
|
1814
|
+
const i = m(Et, e, r), o = Math.atan2(s[1], s[0]), a = Math.asin(s[2]), c = function(t) {
|
|
1815
1815
|
return Math.sign ? Math.sign(t) : 0 === (t = +t) || isNaN(t) ? Number(t) : t > 0 ? 1 : -1;
|
|
1816
1816
|
}(f(i, e)) * Bt(i);
|
|
1817
1817
|
return t[0] = tt(o), t[1] = tt(a), t[2] = c, t;
|
|
1818
1818
|
}
|
|
1819
|
-
const
|
|
1819
|
+
const Ut = new Array(3), Lt = new Array(3);
|
|
1820
1820
|
function Bt(t) {
|
|
1821
1821
|
return o(t);
|
|
1822
1822
|
}
|
|
1823
|
-
const
|
|
1823
|
+
const Ct = Math.PI / 180, Rt = 6378137 * Math.PI / 180;
|
|
1824
1824
|
function Ft(t, e, n) {
|
|
1825
1825
|
if ("EPSG:3857" === n) return function(t, e) {
|
|
1826
1826
|
const n = 85.0511287798, r = e[0], s = Math.max(Math.min(n, e[1]), -n);
|
|
1827
1827
|
let i;
|
|
1828
|
-
i = 0 === s ? 0 : Math.log(Math.tan((90 + s) *
|
|
1828
|
+
i = 0 === s ? 0 : Math.log(Math.tan((90 + s) * Ct / 2)) / Ct;
|
|
1829
1829
|
return t[0] = r * Rt, t[1] = i * Rt, t;
|
|
1830
1830
|
}(t, e);
|
|
1831
1831
|
if ("EPSG:4326" === n || "EPSG:4490" === n || "identity" === n) return Dt(t, e);
|
|
@@ -1971,7 +1971,7 @@
|
|
|
1971
1971
|
e(null, r, i);
|
|
1972
1972
|
});
|
|
1973
1973
|
} else if ("cmpt" === s) {
|
|
1974
|
-
new
|
|
1974
|
+
new Mt(this.dt, Q).load(n, r).then(n => {
|
|
1975
1975
|
const {content: r, transferables: s} = this.At(n, t);
|
|
1976
1976
|
e(null, r, s);
|
|
1977
1977
|
}).catch(t => {
|
|
@@ -2038,7 +2038,7 @@
|
|
|
2038
2038
|
e && d(u, u, e);
|
|
2039
2039
|
a = {
|
|
2040
2040
|
center: u,
|
|
2041
|
-
projCenter: this.
|
|
2041
|
+
projCenter: this.Ot(u)
|
|
2042
2042
|
}, this.projVertices({
|
|
2043
2043
|
array: i.POSITION.array,
|
|
2044
2044
|
itemSize: 3
|
|
@@ -2093,23 +2093,23 @@
|
|
|
2093
2093
|
});
|
|
2094
2094
|
const c = ie(a);
|
|
2095
2095
|
i && d(c, c, i);
|
|
2096
|
-
const u = this.
|
|
2096
|
+
const u = this.Ot(c);
|
|
2097
2097
|
t.extensions.MAPTALKS_RTC = {
|
|
2098
2098
|
center: c,
|
|
2099
2099
|
projCenter: u
|
|
2100
2100
|
}, $t(t, e => {
|
|
2101
|
-
e.attributes && e.attributes.POSITION && (e.attributes.NORMAL && this.
|
|
2102
|
-
e.attributes.TANGENT && this.
|
|
2101
|
+
e.attributes && e.attributes.POSITION && (e.attributes.NORMAL && this.Mt(e.attributes.NORMAL, e.matrices, s),
|
|
2102
|
+
e.attributes.TANGENT && this.Mt(e.attributes.TANGENT, e.matrices, s), this.projVertices(e.attributes.POSITION, e.matrices, o, t.extensions.MAPTALKS_RTC, s, i));
|
|
2103
2103
|
});
|
|
2104
2104
|
}
|
|
2105
|
-
|
|
2106
|
-
0 === b(t) ? u(ee, 0, 0, -6378137) :
|
|
2105
|
+
Ot(t) {
|
|
2106
|
+
0 === b(t) ? u(ee, 0, 0, -6378137) : Pt(ee, t);
|
|
2107
2107
|
const e = this.options.projection;
|
|
2108
2108
|
Ft(ne, ee, e);
|
|
2109
2109
|
const n = t.length > 2 ? jt(ee, ne, ee[2], e) : 0, r = [];
|
|
2110
2110
|
return r[0] = ne[0], r[1] = ne[1], r[2] = n, r;
|
|
2111
2111
|
}
|
|
2112
|
-
|
|
2112
|
+
Mt(t, e, n) {
|
|
2113
2113
|
let i;
|
|
2114
2114
|
i = "Y" === n ? Zt : "X" === n ? Xt : Yt;
|
|
2115
2115
|
const o = function(t, e) {
|
|
@@ -2140,7 +2140,7 @@
|
|
|
2140
2140
|
let w, g = [ 0, 0, 0, 1 ], _ = [ 0, 0, 0 ], T = [ 0, 0 ];
|
|
2141
2141
|
const A = o.projCenter, v = c && s(Yt, c);
|
|
2142
2142
|
return Jt(t, t => (g[0] = t[0], g[1] = t[1], g[2] = m > 2 ? t[2] : 0, g = d(g, g, l),
|
|
2143
|
-
p && (g = d(g, g, p)), y && h(g, g, y), c && !v && (g = d(g, g, c)), 0 === b(g) ? u(_, 0, 0, -6378137) :
|
|
2143
|
+
p && (g = d(g, g, p)), y && h(g, g, y), c && !v && (g = d(g, g, c)), 0 === b(g) ? u(_, 0, 0, -6378137) : Pt(_, g),
|
|
2144
2144
|
Ft(T, _, f), w = g[2] ? jt(_, T, _[2], f) : 0, t[0] = T[0] - A[0], t[1] = T[1] - A[1],
|
|
2145
2145
|
m > 2 && (t[2] = w - A[2]), t)), t.projected = !0, {
|
|
2146
2146
|
projCenter: A
|
|
@@ -2324,10 +2324,10 @@
|
|
|
2324
2324
|
function v(t) {
|
|
2325
2325
|
return t.flat ? t.flat(1 / 0) : t.reduce((t, e) => t.concat(e), []);
|
|
2326
2326
|
}
|
|
2327
|
-
function
|
|
2327
|
+
function O(t) {
|
|
2328
2328
|
return t < 256 ? Uint8Array : t < 65536 ? Uint16Array : Uint32Array;
|
|
2329
2329
|
}
|
|
2330
|
-
function
|
|
2330
|
+
function M(t) {
|
|
2331
2331
|
return 0 === t.indexOf("data:");
|
|
2332
2332
|
}
|
|
2333
2333
|
function S(t) {
|
|
@@ -2347,8 +2347,8 @@
|
|
|
2347
2347
|
stringFromUTF8Array: T,
|
|
2348
2348
|
setColumn3: A,
|
|
2349
2349
|
flatArr: v,
|
|
2350
|
-
getBatchIdArrayType:
|
|
2351
|
-
isBase64:
|
|
2350
|
+
getBatchIdArrayType: O,
|
|
2351
|
+
isBase64: M,
|
|
2352
2352
|
base64URLToArrayBuffer: S
|
|
2353
2353
|
}), I = "undefined" != typeof Float32Array ? Float32Array : Array;
|
|
2354
2354
|
function N(t, e, n) {
|
|
@@ -2362,15 +2362,15 @@
|
|
|
2362
2362
|
_ = n[13], T = n[14], A = n[15], t[12] = g * r + _ * a + T * l + A * y, t[13] = g * s + _ * c + T * f + A * b,
|
|
2363
2363
|
t[14] = g * i + _ * u + T * d + A * p, t[15] = g * o + _ * h + T * m + A * w, t;
|
|
2364
2364
|
}
|
|
2365
|
-
function
|
|
2365
|
+
function E() {
|
|
2366
2366
|
var t = new I(3);
|
|
2367
2367
|
return I != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0), t;
|
|
2368
2368
|
}
|
|
2369
|
-
function
|
|
2369
|
+
function P(t) {
|
|
2370
2370
|
var e = t[0], n = t[1], r = t[2];
|
|
2371
2371
|
return Math.sqrt(e * e + n * n + r * r);
|
|
2372
2372
|
}
|
|
2373
|
-
function
|
|
2373
|
+
function U(t, e, n) {
|
|
2374
2374
|
var r = new I(3);
|
|
2375
2375
|
return r[0] = t, r[1] = e, r[2] = n, r;
|
|
2376
2376
|
}
|
|
@@ -2380,7 +2380,7 @@
|
|
|
2380
2380
|
function B(t, e, n, r) {
|
|
2381
2381
|
return t[0] = e, t[1] = n, t[2] = r, t;
|
|
2382
2382
|
}
|
|
2383
|
-
function
|
|
2383
|
+
function C(t, e, n) {
|
|
2384
2384
|
return t[0] = e[0] - n[0], t[1] = e[1] - n[1], t[2] = e[2] - n[2], t;
|
|
2385
2385
|
}
|
|
2386
2386
|
function R(t, e, n) {
|
|
@@ -2397,7 +2397,7 @@
|
|
|
2397
2397
|
function j(t, e) {
|
|
2398
2398
|
return t[0] * e[0] + t[1] * e[1] + t[2] * e[2];
|
|
2399
2399
|
}
|
|
2400
|
-
var k =
|
|
2400
|
+
var k = C, z = R, V = P;
|
|
2401
2401
|
function G(t, e, n, r, s) {
|
|
2402
2402
|
return t[0] = e, t[1] = n, t[2] = r, t[3] = s, t;
|
|
2403
2403
|
}
|
|
@@ -2412,14 +2412,14 @@
|
|
|
2412
2412
|
b = Math.sin(r * f) / m) : (y = 1 - r, b = r), t[0] = y * s + b * c, t[1] = y * i + b * u,
|
|
2413
2413
|
t[2] = y * o + b * h, t[3] = y * a + b * l, t;
|
|
2414
2414
|
}
|
|
2415
|
-
|
|
2415
|
+
E(), function() {
|
|
2416
2416
|
var t, e = (t = new I(4), I != Float32Array && (t[0] = 0, t[1] = 0, t[2] = 0, t[3] = 0),
|
|
2417
2417
|
t);
|
|
2418
2418
|
}();
|
|
2419
2419
|
var q, J = function(t, e) {
|
|
2420
2420
|
return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t;
|
|
2421
2421
|
};
|
|
2422
|
-
|
|
2422
|
+
E(), U(1, 0, 0), U(0, 1, 0), H(), H(), q = new I(9), I != Float32Array && (q[1] = 0,
|
|
2423
2423
|
q[2] = 0, q[3] = 0, q[5] = 0, q[6] = 0, q[7] = 0), q[0] = 1, q[4] = 1, q[8] = 1;
|
|
2424
2424
|
/*!
|
|
2425
2425
|
* @maptalks/gltf-loader v0.21.0
|
|
@@ -2799,8 +2799,8 @@
|
|
|
2799
2799
|
const e = this.gltf.bufferViews[t.bufferView];
|
|
2800
2800
|
if (this.images[t.id]) return Promise.resolve(this.images[t.id]);
|
|
2801
2801
|
const n = this.gltf.buffers[e.buffer];
|
|
2802
|
-
if (n.uri) return this.
|
|
2803
|
-
if (this.glbBuffer) return this.
|
|
2802
|
+
if (n.uri) return this.O(n, e, t);
|
|
2803
|
+
if (this.glbBuffer) return this.M(e, t);
|
|
2804
2804
|
}
|
|
2805
2805
|
return null;
|
|
2806
2806
|
}
|
|
@@ -2820,7 +2820,7 @@
|
|
|
2820
2820
|
return this.S(e.id, r);
|
|
2821
2821
|
}
|
|
2822
2822
|
}
|
|
2823
|
-
|
|
2823
|
+
O(t, e, n) {
|
|
2824
2824
|
if (this.buffers[t.id]) {
|
|
2825
2825
|
const r = this.buffers[t.id], s = this.N(e, r);
|
|
2826
2826
|
return this.I(s, n);
|
|
@@ -2838,7 +2838,7 @@
|
|
|
2838
2838
|
return this.I(i, n);
|
|
2839
2839
|
});
|
|
2840
2840
|
}
|
|
2841
|
-
|
|
2841
|
+
M(t, e) {
|
|
2842
2842
|
const n = this.N(t, this.glbBuffer.buffer, this.glbBuffer.byteOffset);
|
|
2843
2843
|
return this.I(n, e);
|
|
2844
2844
|
}
|
|
@@ -2970,19 +2970,19 @@
|
|
|
2970
2970
|
const l = h.channelsMap[n];
|
|
2971
2971
|
if (l) for (let t = 0; t < l.length; t++) {
|
|
2972
2972
|
const e = l[t];
|
|
2973
|
-
"translation" === e.target.path ? (this.
|
|
2974
|
-
u.rotation = J(wt, i)) : "scale" === e.target.path ? (this.
|
|
2975
|
-
u.scale = L(gt, o)) : "weights" === e.target.path && a && (this.
|
|
2973
|
+
"translation" === e.target.path ? (this.L(s, h.samplers[e.sampler], r, 1), u.translation = L(pt, s)) : "rotation" === e.target.path ? (this.B(i, h.samplers[e.sampler], r, 1),
|
|
2974
|
+
u.rotation = J(wt, i)) : "scale" === e.target.path ? (this.L(o, h.samplers[e.sampler], r, 1),
|
|
2975
|
+
u.scale = L(gt, o)) : "weights" === e.target.path && a && (this.L(a, h.samplers[e.sampler], r, a.length),
|
|
2976
2976
|
u.weights = a);
|
|
2977
2977
|
}
|
|
2978
2978
|
}
|
|
2979
2979
|
return u;
|
|
2980
2980
|
},
|
|
2981
|
-
|
|
2981
|
+
L(t, e, n, r) {
|
|
2982
2982
|
switch (e.interpolation) {
|
|
2983
2983
|
case "LINEAR":
|
|
2984
2984
|
{
|
|
2985
|
-
const s = this.
|
|
2985
|
+
const s = this.C(Tt, e, n, 1 * r);
|
|
2986
2986
|
s && (t = function(t, e, n, r) {
|
|
2987
2987
|
for (let s = 0; s < t.length; s++) t[s] = e[s] + r * (n[s] - e[s]);
|
|
2988
2988
|
return t;
|
|
@@ -2992,7 +2992,7 @@
|
|
|
2992
2992
|
|
|
2993
2993
|
case "STEP":
|
|
2994
2994
|
{
|
|
2995
|
-
const s = this.
|
|
2995
|
+
const s = this.C(Tt, e, n, 1 * r);
|
|
2996
2996
|
s && (t = function(t, e) {
|
|
2997
2997
|
for (let n = 0; n < t.length; n++) t[n] = e[n];
|
|
2998
2998
|
return t;
|
|
@@ -3002,32 +3002,32 @@
|
|
|
3002
3002
|
|
|
3003
3003
|
case "CUBICSPLINE":
|
|
3004
3004
|
{
|
|
3005
|
-
const s = this.
|
|
3005
|
+
const s = this.C(Tt, e, n, 3 * r);
|
|
3006
3006
|
s && (t = this.R(t, s, e.input.array, 3 * r));
|
|
3007
3007
|
break;
|
|
3008
3008
|
}
|
|
3009
3009
|
}
|
|
3010
3010
|
return t;
|
|
3011
3011
|
},
|
|
3012
|
-
|
|
3012
|
+
B(t, e, n) {
|
|
3013
3013
|
switch (e.interpolation) {
|
|
3014
3014
|
case "LINEAR":
|
|
3015
3015
|
{
|
|
3016
|
-
const r = this.
|
|
3016
|
+
const r = this.C(Tt, e, n, 1);
|
|
3017
3017
|
r && $(t, r.PREVIOUS, r.NEXT, r.INTERPOLATION);
|
|
3018
3018
|
break;
|
|
3019
3019
|
}
|
|
3020
3020
|
|
|
3021
3021
|
case "STEP":
|
|
3022
3022
|
{
|
|
3023
|
-
const r = this.
|
|
3023
|
+
const r = this.C(Tt, e, n, 1);
|
|
3024
3024
|
r && (t = G(t, ...r.PREVIOUS));
|
|
3025
3025
|
break;
|
|
3026
3026
|
}
|
|
3027
3027
|
|
|
3028
3028
|
case "CUBICSPLINE":
|
|
3029
3029
|
{
|
|
3030
|
-
const r = this.
|
|
3030
|
+
const r = this.C(Tt, e, n, 3);
|
|
3031
3031
|
if (r) {
|
|
3032
3032
|
for (let t = 0; t < r.PREVIOUS.length; t++) r.PREVIOUS[t] = Math.acos(r.PREVIOUS[t]),
|
|
3033
3033
|
r.NEXT[t] = Math.acos(r.NEXT[t]);
|
|
@@ -3056,7 +3056,7 @@
|
|
|
3056
3056
|
}
|
|
3057
3057
|
return null;
|
|
3058
3058
|
},
|
|
3059
|
-
|
|
3059
|
+
C(t, e, n, r) {
|
|
3060
3060
|
const s = e.input.array, i = e.output.array, o = e.output.itemSize;
|
|
3061
3061
|
(n < s[0] || n > s[s.length - 1]) && (n = Math.max(s[0], Math.min(s[s.length - 1], n))),
|
|
3062
3062
|
n === s[s.length - 1] && (n = s[0]);
|
|
@@ -3103,7 +3103,7 @@
|
|
|
3103
3103
|
return n ? X(e) ? n[e] : n[Object.keys(n)[0]] : null;
|
|
3104
3104
|
}
|
|
3105
3105
|
}, vt = "undefined" == typeof document ? null : document.createElement("canvas");
|
|
3106
|
-
class
|
|
3106
|
+
class Ot {
|
|
3107
3107
|
constructor(t, e, n) {
|
|
3108
3108
|
if (this.options = n || {}, this.options.decoders || (this.options.decoders = {}),
|
|
3109
3109
|
e.buffer instanceof ArrayBuffer) {
|
|
@@ -3165,7 +3165,7 @@
|
|
|
3165
3165
|
}
|
|
3166
3166
|
D(t, e, n) {
|
|
3167
3167
|
this.gltf = e, this.glbBuffer = n, this.version = e.asset ? +e.asset.version : 1,
|
|
3168
|
-
this.rootPath = t, this.buffers = {}, this.requests = {}, this.options.requestImage = this.options.requestImage ||
|
|
3168
|
+
this.rootPath = t, this.buffers = {}, this.requests = {}, this.options.requestImage = this.options.requestImage || Mt,
|
|
3169
3169
|
this.options.transferable && (this.transferables = []), 2 === this.version ? (this.adapter = new ft(t, e, n, this.options.requestImage, this.options.decoders || {}),
|
|
3170
3170
|
this.adapter.iterate((t, e, n) => {
|
|
3171
3171
|
e.id = "buffer_" + n;
|
|
@@ -3331,7 +3331,7 @@
|
|
|
3331
3331
|
});
|
|
3332
3332
|
}
|
|
3333
3333
|
}
|
|
3334
|
-
function
|
|
3334
|
+
function Mt(t, e) {
|
|
3335
3335
|
const n = new Image;
|
|
3336
3336
|
n.crossOrigin = "", n.onload = () => {
|
|
3337
3337
|
if (!vt) return void e(new Error("There is no canvas to draw image!"));
|
|
@@ -3433,7 +3433,7 @@
|
|
|
3433
3433
|
function Nt(t) {
|
|
3434
3434
|
return Math.pow(2, Math.floor(Math.log(t) / Math.LN2));
|
|
3435
3435
|
}
|
|
3436
|
-
class
|
|
3436
|
+
class Et {
|
|
3437
3437
|
constructor(t, e) {
|
|
3438
3438
|
this.max = t, this.currentSize = 0, this.onRemove = e, this.reset();
|
|
3439
3439
|
}
|
|
@@ -3502,17 +3502,17 @@
|
|
|
3502
3502
|
return t;
|
|
3503
3503
|
}
|
|
3504
3504
|
}
|
|
3505
|
-
function
|
|
3505
|
+
function Pt(t, e) {
|
|
3506
3506
|
if (t.scenes && t.scenes.length) for (let n = 0, r = t.scenes.length; n < r; n++) {
|
|
3507
3507
|
const r = t.scenes[n].nodes;
|
|
3508
3508
|
for (let n = 0, s = r.length; n < s; n++) {
|
|
3509
3509
|
const s = [];
|
|
3510
|
-
|
|
3510
|
+
Ut(r[n], s, t, e);
|
|
3511
3511
|
}
|
|
3512
3512
|
}
|
|
3513
3513
|
}
|
|
3514
|
-
function
|
|
3515
|
-
if (t.matrix && e.push(t.matrix), t.children && t.children.length) for (let s = 0, i = t.children.length; s < i; s++)
|
|
3514
|
+
function Ut(t, e, n, r) {
|
|
3515
|
+
if (t.matrix && e.push(t.matrix), t.children && t.children.length) for (let s = 0, i = t.children.length; s < i; s++) Ut(t.children[s], e, n, r);
|
|
3516
3516
|
if (void 0 !== t.mesh) {
|
|
3517
3517
|
const s = t.mesh, i = n.meshes[s];
|
|
3518
3518
|
if (i) {
|
|
@@ -3526,7 +3526,7 @@
|
|
|
3526
3526
|
}
|
|
3527
3527
|
function Lt(t, e, n) {
|
|
3528
3528
|
let {componentType: r, byteOffset: s, byteStride: i, itemSize: o} = e;
|
|
3529
|
-
const a = e.array.buffer, c = r ?
|
|
3529
|
+
const a = e.array.buffer, c = r ? Ot.getTypedArrayCtor(r) : e.array.constructor;
|
|
3530
3530
|
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) {
|
|
3531
3531
|
const e = new c(a, s + n * o * c.BYTES_PER_ELEMENT, o);
|
|
3532
3532
|
return t.set(e), t;
|
|
@@ -3538,14 +3538,14 @@
|
|
|
3538
3538
|
function Bt(t, e, n, r) {
|
|
3539
3539
|
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];
|
|
3540
3540
|
}
|
|
3541
|
-
const
|
|
3541
|
+
const Ct = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], {loginIBLResOnCanvas: Rt, logoutIBLResOnCanvas: Ft, getIBLResOnCanvas: Dt, getPBRUniforms: jt} = n.reshader.pbr.PBRUtils, kt = {
|
|
3542
3542
|
factor: 0,
|
|
3543
3543
|
units: 0
|
|
3544
3544
|
}, zt = [ 1, 1, 1 ], Vt = t => t.material instanceof n.reshader.PhongMaterial, Gt = t => t.material instanceof n.reshader.pbr.StandardMaterial;
|
|
3545
3545
|
class Ht {
|
|
3546
3546
|
constructor(t, e) {
|
|
3547
|
-
this.
|
|
3548
|
-
this.Lt = t, this.Bt = new n.reshader.Renderer(t), this.
|
|
3547
|
+
this.Et = e, this.Pt = e.getRenderer().canvas, this.Ut = new s.SpatialReference,
|
|
3548
|
+
this.Lt = t, this.Bt = new n.reshader.Renderer(t), this.Ct = {}, this.Rt = {}, this.Ft = {},
|
|
3549
3549
|
this.Dt = {}, this.jt = {}, this.kt = {}, this.zt = {}, this.Vt = new n.reshader.Scene,
|
|
3550
3550
|
this.Gt = new n.reshader.Scene, this.Ht = new n.reshader.Scene, this.$t = new n.reshader.Scene,
|
|
3551
3551
|
this.qt = new n.reshader.ResourceLoader(t.texture(2)), this.Jt = this.Kt.bind(this),
|
|
@@ -3563,12 +3563,12 @@
|
|
|
3563
3563
|
return this.Ft;
|
|
3564
3564
|
}
|
|
3565
3565
|
getMap() {
|
|
3566
|
-
return this.
|
|
3566
|
+
return this.Et.getMap();
|
|
3567
3567
|
}
|
|
3568
3568
|
paint(t, e, n, r) {
|
|
3569
3569
|
const s = this.getMap();
|
|
3570
3570
|
if (!t.length || !s) return;
|
|
3571
|
-
const i = this.Yt(), o = s.projViewMatrix, a = this.
|
|
3571
|
+
const i = this.Yt(), o = s.projViewMatrix, a = this.Et.options.services, u = [];
|
|
3572
3572
|
let h = [];
|
|
3573
3573
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
3574
3574
|
let r = this.Qt(t[n].data.node);
|
|
@@ -3628,9 +3628,9 @@
|
|
|
3628
3628
|
le(t) {
|
|
3629
3629
|
const e = this.Rt[t];
|
|
3630
3630
|
e && (e.geometry.dispose(), e.dispose(), delete this.Rt[t]);
|
|
3631
|
-
let n = this.Ft[t] || this.Dt[t] || this.jt[t] || this.kt[t] || this.
|
|
3631
|
+
let n = this.Ft[t] || this.Dt[t] || this.jt[t] || this.kt[t] || this.Ct[t];
|
|
3632
3632
|
this.kt[t] ? this.fe(t) : n && (this.de(n), delete this.Ft[t], delete this.Dt[t],
|
|
3633
|
-
delete this.jt[t], delete this.
|
|
3633
|
+
delete this.jt[t], delete this.Ct[t]);
|
|
3634
3634
|
}
|
|
3635
3635
|
fe(t) {
|
|
3636
3636
|
let e = this.kt[t];
|
|
@@ -3653,7 +3653,7 @@
|
|
|
3653
3653
|
}
|
|
3654
3654
|
}
|
|
3655
3655
|
remove() {
|
|
3656
|
-
const t = this.
|
|
3656
|
+
const t = this.Et;
|
|
3657
3657
|
Ft(t.getRenderer().canvas, t.getMap());
|
|
3658
3658
|
for (const t in this.kt) this.fe(t);
|
|
3659
3659
|
this.kt = {};
|
|
@@ -3663,8 +3663,8 @@
|
|
|
3663
3663
|
this.Dt = {};
|
|
3664
3664
|
for (const t in this.jt) this.le(t);
|
|
3665
3665
|
this.jt = {};
|
|
3666
|
-
for (const t in this.
|
|
3667
|
-
this.
|
|
3666
|
+
for (const t in this.Ct) this.le(t);
|
|
3667
|
+
this.Ct = {};
|
|
3668
3668
|
for (const t in this.Rt) this.le(t);
|
|
3669
3669
|
this.Rt = {}, this.ne && (this.ne.dispose(), delete this.ne), this.re && (this.re.dispose(),
|
|
3670
3670
|
delete this.re), this.ie && (this.ie.dispose(), delete this.ie), this.ue && (this.ue.dispose(),
|
|
@@ -3692,7 +3692,7 @@
|
|
|
3692
3692
|
return this.Ft[t.id];
|
|
3693
3693
|
}
|
|
3694
3694
|
has(t) {
|
|
3695
|
-
return this.Qt(t) || this.Dt[t.id] || this.jt[t.id] || this.kt[t.id] || this.
|
|
3695
|
+
return this.Qt(t) || this.Dt[t.id] || this.jt[t.id] || this.kt[t.id] || this.Ct[t.id];
|
|
3696
3696
|
}
|
|
3697
3697
|
createPntsMesh(t, e, r, s) {
|
|
3698
3698
|
if (this.Dt[e]) {
|
|
@@ -3712,7 +3712,7 @@
|
|
|
3712
3712
|
i.RGB ? h.HAS_RGB = 1 : i.RGBA ? h.HAS_RGBA = 1 : i.RGB565 && (h.HAS_RGB565 = 1),
|
|
3713
3713
|
(i.NORMAL || i.NORMAL_OCT16P) && (h.HAS_NORMAL = 1, i.NORMAL_OCT16P && (h.HAS_NORMAL_OCT16P = 1)),
|
|
3714
3714
|
t.featureTable.CONSTANT_RGBA && (t.featureTable.CONSTANT_RGBA = t.featureTable.CONSTANT_RGBA.map(t => t / 255));
|
|
3715
|
-
const l = this.we(t.rtcCenter.projCenter, a), f = this.
|
|
3715
|
+
const l = this.we(t.rtcCenter.projCenter, a), f = this.Et.options.services[a], d = new n.reshader.Mesh(u);
|
|
3716
3716
|
return d.properties.magic = "pnts", d.properties.id = e, d.properties.count = c,
|
|
3717
3717
|
d.properties.batchTable = t.batchTable, d.properties.batchTableBin = t.batchTableBin,
|
|
3718
3718
|
d.setDefines(h), Object.defineProperty(d.uniforms, "pointColor", {
|
|
@@ -3738,7 +3738,7 @@
|
|
|
3738
3738
|
createI3DMMesh(t, e, r, s) {
|
|
3739
3739
|
if (this.jt[e]) {
|
|
3740
3740
|
const t = this.jt[e];
|
|
3741
|
-
return console.warn(`i3dm mesh with id(${e}) was already created.`), this.
|
|
3741
|
+
return console.warn(`i3dm mesh with id(${e}) was already created.`), this.Ct[e] || s(null, {
|
|
3742
3742
|
id: e,
|
|
3743
3743
|
mesh: t
|
|
3744
3744
|
}), t;
|
|
@@ -3747,10 +3747,10 @@
|
|
|
3747
3747
|
"instance_vectorA": new Float32Array(4 * l),
|
|
3748
3748
|
"instance_vectorB": new Float32Array(4 * l),
|
|
3749
3749
|
"instance_vectorC": new Float32Array(4 * l)
|
|
3750
|
-
}, _ = new Float32Array(3), T = new Float32Array(3), v = [],
|
|
3750
|
+
}, _ = new Float32Array(3), T = new Float32Array(3), v = [], O = new Float32Array(1), M = new Float32Array(3), S = [], x = [], I = [], N = [];
|
|
3751
3751
|
!function(t, e) {
|
|
3752
3752
|
let {componentType: n, byteOffset: r, byteStride: s, count: i, itemSize: o} = t;
|
|
3753
|
-
const a = t.array.buffer, c = n ?
|
|
3753
|
+
const a = t.array.buffer, c = n ? Ot.getTypedArrayCtor(n) : t.array.constructor;
|
|
3754
3754
|
if (r = void 0 === r ? t.array.byteOffset : r, s = s || 0, i = i || t.array.length / o,
|
|
3755
3755
|
!s || s === o * c.BYTES_PER_ELEMENT && r % c.BYTES_PER_ELEMENT == 0) {
|
|
3756
3756
|
const t = new c(a, r, i * o);
|
|
@@ -3768,45 +3768,45 @@
|
|
|
3768
3768
|
}
|
|
3769
3769
|
}(m, (t, e) => {
|
|
3770
3770
|
y ? (Lt(T, b, e), Lt(_, y, e), n.vec3.cross(v, T, _), n.vec3.normalize(v, v), A(S, T, 0),
|
|
3771
|
-
A(S, _, 1), A(S, v, 2), n.quat.fromMat3(x, S)) : n.quat.identity(x), p ? (Lt(
|
|
3772
|
-
n.vec3.set(I,
|
|
3771
|
+
A(S, _, 1), A(S, v, 2), n.quat.fromMat3(x, S)) : n.quat.identity(x), p ? (Lt(O, p, e),
|
|
3772
|
+
n.vec3.set(I, O[0], O[0], O[0])) : w ? (Lt(M, w, e), n.vec3.set(I, ...M)) : n.vec3.set(I, 1, 1, 1),
|
|
3773
3773
|
n.mat4.fromRotationTranslationScale(N, x, t, I), Bt(g.instance_vectorA, e, N, 0),
|
|
3774
3774
|
Bt(g.instance_vectorB, e, N, 1), Bt(g.instance_vectorC, e, N, 2);
|
|
3775
3775
|
});
|
|
3776
|
-
const
|
|
3777
|
-
for (const t in g)
|
|
3776
|
+
const E = {};
|
|
3777
|
+
for (const t in g) E[t] = {
|
|
3778
3778
|
buffer: this.Lt.buffer({
|
|
3779
3779
|
dimension: g[t].length / l,
|
|
3780
3780
|
data: g[t]
|
|
3781
3781
|
}),
|
|
3782
3782
|
divisor: 1
|
|
3783
3783
|
};
|
|
3784
|
-
const
|
|
3785
|
-
let
|
|
3784
|
+
const P = this.Et.options.services[r.Wt].shader || "phong";
|
|
3785
|
+
let U = 0, L = !0;
|
|
3786
3786
|
const B = [];
|
|
3787
|
-
return
|
|
3788
|
-
let {geometry: a, material: f, attributes: m} = this.ge(t, s, i, o, r, !0,
|
|
3789
|
-
f && !f.isReady() && (L = !1,
|
|
3790
|
-
const y = new n.reshader.InstancedMesh(
|
|
3787
|
+
return Pt(a, (t, s, i, o) => {
|
|
3788
|
+
let {geometry: a, material: f, attributes: m} = this.ge(t, s, i, o, r, !0, P);
|
|
3789
|
+
f && !f.isReady() && (L = !1, U++);
|
|
3790
|
+
const y = new n.reshader.InstancedMesh(E, l, a, f);
|
|
3791
3791
|
y.properties.magic = "i3dm", y.properties.id = e, y.properties.count = h, y.properties.batchTable = c,
|
|
3792
3792
|
y.properties.batchTableBin = u;
|
|
3793
|
-
const b = this._e(t, m, f);
|
|
3794
|
-
y.setPositionMatrix(
|
|
3793
|
+
const b = this._e(t, m, a, f, r.Wt);
|
|
3794
|
+
y.setPositionMatrix(Ct), y.setLocalTransform(d), y.setDefines(b), y.setUniform("polygonOffset", {
|
|
3795
3795
|
offset: 0,
|
|
3796
3796
|
factor: 0
|
|
3797
3797
|
}), B.push(y);
|
|
3798
3798
|
}), L ? (this.jt[e] = B, s(null, {
|
|
3799
3799
|
id: e,
|
|
3800
3800
|
mesh: B
|
|
3801
|
-
})) : (this.
|
|
3801
|
+
})) : (this.Ct[e] = {
|
|
3802
3802
|
meshes: B,
|
|
3803
|
-
count:
|
|
3803
|
+
count: U
|
|
3804
3804
|
}, B.Te = s), B;
|
|
3805
3805
|
}
|
|
3806
3806
|
createB3DMMesh(t, e, r, i) {
|
|
3807
|
-
if (this.Ft[e] || this.
|
|
3807
|
+
if (this.Ft[e] || this.Ct[e]) {
|
|
3808
3808
|
const t = this.Ft[e];
|
|
3809
|
-
return console.warn(`mesh with id(${e}) was already created.`), this.
|
|
3809
|
+
return console.warn(`mesh with id(${e}) was already created.`), this.Ct[e] || i(null, {
|
|
3810
3810
|
id: e,
|
|
3811
3811
|
mesh: t
|
|
3812
3812
|
}), t;
|
|
@@ -3816,21 +3816,21 @@
|
|
|
3816
3816
|
const t = new s.Extent(r.maxExtent).convertTo(t => this._pointToPrj(t));
|
|
3817
3817
|
o = [ t.xmin, t.ymin, t.xmax, t.ymax ];
|
|
3818
3818
|
}
|
|
3819
|
-
const a = t.gltf, c = a.extensions.MAPTALKS_RTC.projCenter, u = this.we(c, r.Wt), h = this.
|
|
3819
|
+
const a = t.gltf, c = a.extensions.MAPTALKS_RTC.projCenter, u = this.we(c, r.Wt), h = this.Et.options.services[r.Wt].shader || "phong", l = [];
|
|
3820
3820
|
let f = 0, d = !0;
|
|
3821
|
-
return
|
|
3821
|
+
return Pt(a, (s, i, a, m) => {
|
|
3822
3822
|
let {geometry: y, material: b, attributes: p} = this.ge(s, i, a, m, r, !1, h);
|
|
3823
3823
|
b && !b.isReady() && (d = !1, f++);
|
|
3824
3824
|
const w = new n.reshader.Mesh(y, b);
|
|
3825
3825
|
w.properties.magic = "b3dm", w.properties.id = e, w.properties.batchTable = t.batchTable,
|
|
3826
3826
|
w.properties.batchTableBin = t.batchTableBin, w.properties.count = t.featureTable.BATCH_LENGTH;
|
|
3827
|
-
const g = this._e(s, p, b);
|
|
3827
|
+
const g = this._e(s, p, y, b, r.Wt);
|
|
3828
3828
|
w.setDefines(g), o && (g.USE_MAX_EXTENT = 1, w.setUniform("maxPrjExtent", o), w.setUniform("prjCenter", c)),
|
|
3829
3829
|
w.setLocalTransform(u), l.push(w);
|
|
3830
3830
|
}), d ? (this.Ft[e] = l, i(null, {
|
|
3831
3831
|
id: e,
|
|
3832
3832
|
mesh: l
|
|
3833
|
-
})) : (this.
|
|
3833
|
+
})) : (this.Ct[e] = {
|
|
3834
3834
|
meshes: l,
|
|
3835
3835
|
count: f
|
|
3836
3836
|
}, l.Te = i), l;
|
|
@@ -3866,10 +3866,10 @@
|
|
|
3866
3866
|
if (!t) return null;
|
|
3867
3867
|
if (e.boundingBox) t.combine(e.boundingBox); else for (let n = 0; n < e.length; n++) e[n] && t.combine(e[n].getBoundingBox());
|
|
3868
3868
|
}
|
|
3869
|
-
_e(t, e, n) {
|
|
3870
|
-
const
|
|
3871
|
-
return t.attributes.NORMAL && (
|
|
3872
|
-
e.aTexCoord && (
|
|
3869
|
+
_e(t, e, n, r, s) {
|
|
3870
|
+
const i = ("phong" === (this.Et.options.services[s].shader || "phong") ? this.ne : this.re).getGeometryDefines(n);
|
|
3871
|
+
return t.attributes.NORMAL && (i.USE_NORMAL = 1), Array.isArray(r.get("baseColor")) || (i.USE_BASECOLOR_TEXTURE = 1),
|
|
3872
|
+
e.aTexCoord && (i.HAS_TEX = 1), i;
|
|
3873
3873
|
}
|
|
3874
3874
|
ge(t, e, r, s, i, o, a) {
|
|
3875
3875
|
const c = s.url + "-" + e + "-" + r;
|
|
@@ -3892,7 +3892,7 @@
|
|
|
3892
3892
|
excludeElementsInVAO: o
|
|
3893
3893
|
});
|
|
3894
3894
|
let f = this.ve(t.material, s, a);
|
|
3895
|
-
f && !f.isReady() ? f.
|
|
3895
|
+
f && !f.isReady() ? f.Oe = i.id : f || (f = this.Zt);
|
|
3896
3896
|
const d = {
|
|
3897
3897
|
refCount: 1,
|
|
3898
3898
|
geometry: h,
|
|
@@ -3902,9 +3902,9 @@
|
|
|
3902
3902
|
return this.zt[c] = d, d;
|
|
3903
3903
|
}
|
|
3904
3904
|
we(t, e) {
|
|
3905
|
-
const r = n.mat4.identity([]), i = this.getMap(), o = this._prjToPoint(new s.Coordinate(t)), a = this.
|
|
3905
|
+
const r = n.mat4.identity([]), i = this.getMap(), o = this._prjToPoint(new s.Coordinate(t)), a = this.Me(), c = 1 / (i.getGLZoom ? i.getResolution(i.getGLZoom()) : i.getGLRes());
|
|
3906
3906
|
n.mat4.translate(r, r, [ o.x, o.y, c * t[2] ]);
|
|
3907
|
-
const u = this.
|
|
3907
|
+
const u = this.Et.options.services[e].heightOffset;
|
|
3908
3908
|
return u && n.mat4.translate(r, r, [ 0, 0, c * u ]), n.mat4.scale(r, r, n.vec3.scale([], a, c)),
|
|
3909
3909
|
r;
|
|
3910
3910
|
}
|
|
@@ -3912,8 +3912,8 @@
|
|
|
3912
3912
|
const t = {
|
|
3913
3913
|
x: 0,
|
|
3914
3914
|
y: 0,
|
|
3915
|
-
width: () => this.
|
|
3916
|
-
height: () => this.
|
|
3915
|
+
width: () => this.Pt ? this.Pt.width : 1,
|
|
3916
|
+
height: () => this.Pt ? this.Pt.height : 1
|
|
3917
3917
|
};
|
|
3918
3918
|
this.ue = new n.reshader.MeshShader({
|
|
3919
3919
|
vert: "attribute vec3 aPosition;\n\nuniform mat4 projViewModelMatrix;\n\nvoid main() {\n gl_Position = projViewModelMatrix * vec4(aPosition, 1.0);\n}\n",
|
|
@@ -3998,7 +3998,7 @@
|
|
|
3998
3998
|
}), this.re = new n.reshader.pbr.StandardShader({
|
|
3999
3999
|
extraCommandProps: s
|
|
4000
4000
|
});
|
|
4001
|
-
const i = this.
|
|
4001
|
+
const i = this.Et;
|
|
4002
4002
|
Rt(i.getRenderer().canvas, this.Lt, i.getMap());
|
|
4003
4003
|
}
|
|
4004
4004
|
he(t) {
|
|
@@ -4016,7 +4016,7 @@
|
|
|
4016
4016
|
};
|
|
4017
4017
|
}
|
|
4018
4018
|
Yt() {
|
|
4019
|
-
const t = this.getMap(), e = this.
|
|
4019
|
+
const t = this.getMap(), e = this.Et.getRenderer().canvas, {iblTexes: n, dfgLUT: r} = Dt(e), s = jt(t, n, r);
|
|
4020
4020
|
return m(s, {
|
|
4021
4021
|
lightSpecular: [ 1, 1, 1 ],
|
|
4022
4022
|
viewMatrix: t.viewMatrix,
|
|
@@ -4093,10 +4093,10 @@
|
|
|
4093
4093
|
return n.createObjectURL(r);
|
|
4094
4094
|
}
|
|
4095
4095
|
Kt({target: t}) {
|
|
4096
|
-
const e = t.
|
|
4096
|
+
const e = t.Oe, n = this.Ct[e];
|
|
4097
4097
|
if (n.count--, !n.count) {
|
|
4098
4098
|
const t = n.meshes;
|
|
4099
|
-
this.Ft[e] = t, delete this.
|
|
4099
|
+
this.Ft[e] = t, delete this.Ct[e];
|
|
4100
4100
|
const r = t.Te;
|
|
4101
4101
|
delete t.Te, r(null, {
|
|
4102
4102
|
mesh: n.meshes,
|
|
@@ -4104,11 +4104,11 @@
|
|
|
4104
4104
|
});
|
|
4105
4105
|
}
|
|
4106
4106
|
}
|
|
4107
|
-
|
|
4107
|
+
Me() {
|
|
4108
4108
|
return zt;
|
|
4109
4109
|
}
|
|
4110
4110
|
me(t) {
|
|
4111
|
-
return this.
|
|
4111
|
+
return this.Et.me(t);
|
|
4112
4112
|
}
|
|
4113
4113
|
pe(t, e) {
|
|
4114
4114
|
const n = this.getMap();
|
|
@@ -4283,7 +4283,7 @@
|
|
|
4283
4283
|
}
|
|
4284
4284
|
class he extends s.renderer.CanvasRenderer {
|
|
4285
4285
|
constructor(t) {
|
|
4286
|
-
super(t), this.prepareWorker(), this.tilesLoading = {}, this.tileCache = new
|
|
4286
|
+
super(t), this.prepareWorker(), this.tilesLoading = {}, this.tileCache = new Et(1024 * t.options.maxGPUMemory * 1024, this.deleteTile.bind(this)),
|
|
4287
4287
|
this.gt = {};
|
|
4288
4288
|
}
|
|
4289
4289
|
needToRedraw() {
|
|
@@ -4302,19 +4302,19 @@
|
|
|
4302
4302
|
}
|
|
4303
4303
|
xe(t, e) {
|
|
4304
4304
|
let n = [];
|
|
4305
|
-
const r = this.
|
|
4305
|
+
const r = this.Ee(), s = this.Pe(), i = {};
|
|
4306
4306
|
let o = !1, a = !1;
|
|
4307
4307
|
for (const t in e) {
|
|
4308
4308
|
const r = e[t], s = r.node;
|
|
4309
4309
|
if (i[s.id]) continue;
|
|
4310
4310
|
i[s.id] = 1;
|
|
4311
4311
|
let c = !1;
|
|
4312
|
-
const u = this.
|
|
4312
|
+
const u = this.Ue(s.id);
|
|
4313
4313
|
if (this.Le(s.id) ? (c = a = !0, this.tilesLoading[s.id].current = !0) : u ? (this.getTileOpacity(u) < 1 && (c = a = !0),
|
|
4314
4314
|
o = !0, r.selected = !0, r.data = u) : this.painter.has(s) || (c = a = !0, n.push(s)),
|
|
4315
4315
|
!c) continue;
|
|
4316
4316
|
if (this.Be(r)) o = !0; else {
|
|
4317
|
-
this.
|
|
4317
|
+
this.Ce(r).length && (o = !0);
|
|
4318
4318
|
}
|
|
4319
4319
|
}
|
|
4320
4320
|
let c = [], u = {};
|
|
@@ -4369,7 +4369,7 @@
|
|
|
4369
4369
|
}
|
|
4370
4370
|
return null;
|
|
4371
4371
|
}
|
|
4372
|
-
|
|
4372
|
+
Ce(t) {
|
|
4373
4373
|
const e = [];
|
|
4374
4374
|
if (!t.node.children || !t.node.children.length) return e;
|
|
4375
4375
|
const n = t.De + 1, r = [ t.node ];
|
|
@@ -4419,7 +4419,7 @@
|
|
|
4419
4419
|
}
|
|
4420
4420
|
loadTile(t) {
|
|
4421
4421
|
let e = t.content.url;
|
|
4422
|
-
if (
|
|
4422
|
+
if (M(e)) {
|
|
4423
4423
|
const n = S(e);
|
|
4424
4424
|
return void this.ze(e, n, t);
|
|
4425
4425
|
}
|
|
@@ -4493,7 +4493,7 @@
|
|
|
4493
4493
|
error: t
|
|
4494
4494
|
});
|
|
4495
4495
|
}
|
|
4496
|
-
|
|
4496
|
+
Ue(t) {
|
|
4497
4497
|
return this.tileCache.get(t);
|
|
4498
4498
|
}
|
|
4499
4499
|
Je(t) {
|
|
@@ -4513,7 +4513,7 @@
|
|
|
4513
4513
|
} else this.workerConn.abortTileLoading(this.layer.getId(), e);
|
|
4514
4514
|
delete this.gt[e];
|
|
4515
4515
|
}
|
|
4516
|
-
|
|
4516
|
+
Ee() {
|
|
4517
4517
|
let t = 0;
|
|
4518
4518
|
if (this.tilesLoading) for (const e in this.tilesLoading) this.tilesLoading[e].current = !1,
|
|
4519
4519
|
t++;
|
|
@@ -4535,7 +4535,7 @@
|
|
|
4535
4535
|
gl: this.gl,
|
|
4536
4536
|
attributes: e,
|
|
4537
4537
|
extensions: [ "OES_element_index_uint", "WEBGL_compressed_texture_s3tc" ],
|
|
4538
|
-
optionalExtensions: t.options.
|
|
4538
|
+
optionalExtensions: t.options.optionalExtensions || []
|
|
4539
4539
|
}), this.painter = new Ht(this.regl, t);
|
|
4540
4540
|
}
|
|
4541
4541
|
prepareWorker() {
|
|
@@ -4585,7 +4585,7 @@
|
|
|
4585
4585
|
}
|
|
4586
4586
|
}
|
|
4587
4587
|
}
|
|
4588
|
-
|
|
4588
|
+
Pe() {
|
|
4589
4589
|
return this.getMap().isInteracting() ? this.layer.options.loadingLimitOnInteracting : this.layer.options.loadingLimit;
|
|
4590
4590
|
}
|
|
4591
4591
|
Ke(t, e) {
|
|
@@ -4638,25 +4638,25 @@
|
|
|
4638
4638
|
const n = we, r = function(t, e, n, r, s) {
|
|
4639
4639
|
const i = e[0], o = e[1], a = e[2], c = n[0], u = n[1], h = n[2], l = i * i * c * c, f = o * o * u * u, d = a * a * h * h, m = l + f + d, y = Math.sqrt(1 / m), b = F(ve, e, y);
|
|
4640
4640
|
if (m < s) return isFinite(y) ? b : void 0;
|
|
4641
|
-
const p = r[0], w = r[1], g = r[2], _ =
|
|
4641
|
+
const p = r[0], w = r[1], g = r[2], _ = Oe;
|
|
4642
4642
|
_[0] = b[0] * p * 2, _[1] = b[1] * w * 2, _[2] = b[2] * g * 2;
|
|
4643
|
-
let T, A, v,
|
|
4643
|
+
let T, A, v, O, M, S, x, I, N, E, P, U = (1 - y) * Me(e) / (.5 * Me(_)), L = 0;
|
|
4644
4644
|
do {
|
|
4645
|
-
|
|
4646
|
-
x =
|
|
4647
|
-
A = l * N * p + f *
|
|
4645
|
+
U -= L, v = 1 / (1 + U * p), O = 1 / (1 + U * w), M = 1 / (1 + U * g), S = v * v,
|
|
4646
|
+
x = O * O, I = M * M, N = S * v, E = x * O, P = I * M, T = l * S + f * x + d * I - 1,
|
|
4647
|
+
A = l * N * p + f * E * w + d * P * g;
|
|
4648
4648
|
L = T / (-2 * A);
|
|
4649
4649
|
} while (Math.abs(T) > 1e-12);
|
|
4650
|
-
return t[0] = i * v, t[1] = o *
|
|
4650
|
+
return t[0] = i * v, t[1] = o * O, t[2] = a * M, t;
|
|
4651
4651
|
}(ge, e, pe, n, .1);
|
|
4652
4652
|
let s = z(_e, r, n);
|
|
4653
4653
|
s = Se(s, s);
|
|
4654
|
-
const i = k(Te, e, r), o = Math.atan2(s[1], s[0]), a = Math.asin(s[2]), c = g(j(i, e)) *
|
|
4654
|
+
const i = k(Te, e, r), o = Math.atan2(s[1], s[0]), a = Math.asin(s[2]), c = g(j(i, e)) * Me(i);
|
|
4655
4655
|
return t[0] = p(o), t[1] = p(a), t[2] = c, t;
|
|
4656
4656
|
}
|
|
4657
|
-
const ve = new Array(3),
|
|
4658
|
-
function
|
|
4659
|
-
return
|
|
4657
|
+
const ve = new Array(3), Oe = new Array(3);
|
|
4658
|
+
function Me(t) {
|
|
4659
|
+
return P(t);
|
|
4660
4660
|
}
|
|
4661
4661
|
function Se(t, e) {
|
|
4662
4662
|
const n = e[0], r = e[1], s = e[2];
|
|
@@ -4675,7 +4675,7 @@
|
|
|
4675
4675
|
}
|
|
4676
4676
|
function Ne(t, e, n) {
|
|
4677
4677
|
return Math.sqrt(function(t, e, n) {
|
|
4678
|
-
var r =
|
|
4678
|
+
var r = C(Ee, n, t), s = Ie(Pe, e, 0), i = Ie(Ue, e, 1), o = Ie(Le, e, 2), a = V(s), c = V(i), u = V(o);
|
|
4679
4679
|
D(s, s), D(i, i), D(o, o);
|
|
4680
4680
|
var h = Be;
|
|
4681
4681
|
h.x = j(r, s), h.y = j(r, i), h.z = j(r, o);
|
|
@@ -4686,8 +4686,8 @@
|
|
|
4686
4686
|
return f;
|
|
4687
4687
|
}(t, e, n));
|
|
4688
4688
|
}
|
|
4689
|
-
const
|
|
4690
|
-
const
|
|
4689
|
+
const Ee = [], Pe = [], Ue = [], Le = [], Be = [];
|
|
4690
|
+
const Ce = s.projection.EPSG3857, Re = new s.Extent(0, 0, 0, 0), Fe = [], De = [], je = new s.Coordinate(0, 0), ke = n.mat4.identity([]);
|
|
4691
4691
|
class ze extends s.Layer {
|
|
4692
4692
|
constructor(t, e) {
|
|
4693
4693
|
super(t, e), this.Ye(), this.gt = {}, this.Qe = {};
|
|
@@ -4756,7 +4756,7 @@
|
|
|
4756
4756
|
s = t.pointAtResToDistance(e[2], 0, n), je.set(e[0], e[1]), r = t.pointAtResToCoord(je, n);
|
|
4757
4757
|
}
|
|
4758
4758
|
this.nn = this.nn || [], n.vec3.set(this.nn, b(r.x), b(r.y), s), this.rn = be(this.rn || [], this.nn[0], this.nn[1], this.nn[2]),
|
|
4759
|
-
this.sn = 2 * Math.tan(.5 * b(t.getFov())), this.in =
|
|
4759
|
+
this.sn = 2 * Math.tan(.5 * b(t.getFov())), this.in = Ce.project(r).toArray();
|
|
4760
4760
|
const i = t.projViewMatrix, o = {
|
|
4761
4761
|
children: [],
|
|
4762
4762
|
level: -1
|
|
@@ -4788,7 +4788,7 @@
|
|
|
4788
4788
|
if (!u[e].parent) {
|
|
4789
4789
|
u[e].parent = t, u[e].Ve = t.Ve, u[e].baseUrl = t.baseUrl;
|
|
4790
4790
|
const n = u[e].content && (u[e].content.url || u[e].content.uri);
|
|
4791
|
-
n && (
|
|
4791
|
+
n && (M(n) ? u[e].baseUrl = t.baseUrl : -1 === n.indexOf("http://") && -1 === n.indexOf("https://") ? u[e].content.url = t.baseUrl + n : u[e].baseUrl = n.substring(0, n.lastIndexOf("/") + 1));
|
|
4792
4792
|
}
|
|
4793
4793
|
n.push(u[e]);
|
|
4794
4794
|
}
|
|
@@ -4812,7 +4812,7 @@
|
|
|
4812
4812
|
return !1;
|
|
4813
4813
|
}
|
|
4814
4814
|
/*!
|
|
4815
|
-
* @maptalks/gl v0.
|
|
4815
|
+
* @maptalks/gl v0.62.1
|
|
4816
4816
|
* LICENSE : UNLICENSED
|
|
4817
4817
|
* (c) 2016-2021 maptalks.com
|
|
4818
4818
|
*/ (this.nn, this.rn, e.node.viewerRequestVolume) || (t[e.node.id] = e);
|
|
@@ -4864,7 +4864,7 @@
|
|
|
4864
4864
|
e.children && e.children.length && (e.bn = e.content, delete e.content, t.root.content && (e.content = t.root.content)),
|
|
4865
4865
|
e.mn = this.yn(e);
|
|
4866
4866
|
const i = e.content && (e.content.url || e.content.uri);
|
|
4867
|
-
i && e.content.uri && (e.content.url = e.content.uri, delete e.content.uri), i && !
|
|
4867
|
+
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);
|
|
4868
4868
|
}
|
|
4869
4869
|
this.en(), this.fire("loadtileset", {
|
|
4870
4870
|
tileset: t,
|
|
@@ -5004,12 +5004,13 @@
|
|
|
5004
5004
|
"debug": !1,
|
|
5005
5005
|
"debugOutline": [ 0, 1, 0 ],
|
|
5006
5006
|
"antialias": !1,
|
|
5007
|
-
"sRGBTolinear": !1
|
|
5007
|
+
"sRGBTolinear": !1,
|
|
5008
|
+
"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" ]
|
|
5008
5009
|
}), ze.registerRenderer("gl", he);
|
|
5009
5010
|
const He = [], $e = [];
|
|
5010
5011
|
function qe(t, e) {
|
|
5011
5012
|
const n = new s.Coordinate(p(t), p(e));
|
|
5012
|
-
return
|
|
5013
|
+
return Ce.project(n).toArray();
|
|
5013
5014
|
}
|
|
5014
5015
|
const Je = function() {
|
|
5015
5016
|
if ("undefined" != typeof self) return self;
|
|
@@ -5029,7 +5030,7 @@
|
|
|
5029
5030
|
};
|
|
5030
5031
|
class Xe {
|
|
5031
5032
|
constructor(t, e) {
|
|
5032
|
-
this.A = t, this.W = e ||
|
|
5033
|
+
this.A = t, this.W = e || Ot, this.tt = {
|
|
5033
5034
|
"image/crn": Ze.crn && Ze.crn(),
|
|
5034
5035
|
"image/ktx2": Ze.ktx2 && Ze.ktx2(),
|
|
5035
5036
|
"image/cttf": Ze.ktx2 && Ze.ktx2(),
|
|
@@ -5123,7 +5124,7 @@
|
|
|
5123
5124
|
}
|
|
5124
5125
|
class Ye {
|
|
5125
5126
|
constructor(t, e) {
|
|
5126
|
-
this.A = t, this.W = e ||
|
|
5127
|
+
this.A = t, this.W = e || Ot, this.tt = {
|
|
5127
5128
|
"image/crn": Ze.crn && Ze.crn(),
|
|
5128
5129
|
"image/ktx2": Ze.ktx2 && Ze.ktx2(),
|
|
5129
5130
|
"image/cttf": Ze.ktx2 && Ze.ktx2(),
|
|
@@ -5538,7 +5539,7 @@
|
|
|
5538
5539
|
}
|
|
5539
5540
|
}
|
|
5540
5541
|
function nn(t) {
|
|
5541
|
-
const e =
|
|
5542
|
+
const e = O(t), n = new e(t);
|
|
5542
5543
|
for (let e = 0; e < t; e++) n[e] = e;
|
|
5543
5544
|
return {
|
|
5544
5545
|
byteStride: 0,
|
|
@@ -5551,7 +5552,7 @@
|
|
|
5551
5552
|
}
|
|
5552
5553
|
class rn {
|
|
5553
5554
|
constructor(t, e) {
|
|
5554
|
-
this.A = t, this.W = e ||
|
|
5555
|
+
this.A = t, this.W = e || Ot;
|
|
5555
5556
|
}
|
|
5556
5557
|
load(t, e, n = 0, r = 0) {
|
|
5557
5558
|
return e ? this.et(t, e, n, r) : ct.getArrayBuffer(t, {}).then(e => {
|
|
@@ -5611,5 +5612,5 @@
|
|
|
5611
5612
|
t.Geo3DTransform = xe, Object.defineProperty(t, "t", {
|
|
5612
5613
|
value: !0
|
|
5613
5614
|
});
|
|
5614
|
-
})), i.Map.VERSION, o.GroupGLLayer.VERSION, "undefined" != typeof console && console.log("@maptalks/3dtiles v0.10.
|
|
5615
|
+
})), i.Map.VERSION, o.GroupGLLayer.VERSION, "undefined" != typeof console && console.log("@maptalks/3dtiles v0.10.1");
|
|
5615
5616
|
}));
|