@loaders.gl/tiles 5.0.0-alpha.4 → 5.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +476 -1643
- package/dist/dist.min.js +2 -2
- package/dist/index.cjs +223 -11
- package/dist/index.cjs.map +1 -1
- package/dist/tileset-2d/adapter.d.ts +2 -3
- package/dist/tileset-2d/adapter.d.ts.map +1 -1
- package/dist/tileset-2d/tileset-2d.d.ts +2 -3
- package/dist/tileset-2d/tileset-2d.d.ts.map +1 -1
- package/dist/tileset-2d/tileset-2d.js.map +1 -1
- package/dist/tileset-3d/common/indexed-archive-tileset-source.d.ts +3 -3
- package/dist/tileset-3d/common/indexed-archive-tileset-source.d.ts.map +1 -1
- package/dist/tileset-3d/common/indexed-archive-tileset-source.js.map +1 -1
- package/dist/tileset-3d/common/tile-3d.d.ts.map +1 -1
- package/dist/tileset-3d/common/tile-3d.js +4 -2
- package/dist/tileset-3d/common/tile-3d.js.map +1 -1
- package/dist/tileset-3d/common/tileset-3d.d.ts +30 -2
- package/dist/tileset-3d/common/tileset-3d.d.ts.map +1 -1
- package/dist/tileset-3d/common/tileset-3d.js +4 -0
- package/dist/tileset-3d/common/tileset-3d.js.map +1 -1
- package/dist/tileset-3d/common/tileset-source.d.ts +8 -8
- package/dist/tileset-3d/common/tileset-source.d.ts.map +1 -1
- package/dist/tileset-3d/common/tileset-source.js.map +1 -1
- package/dist/tileset-3d/common/tileset-traverser.d.ts +14 -0
- package/dist/tileset-3d/common/tileset-traverser.d.ts.map +1 -1
- package/dist/tileset-3d/common/tileset-traverser.js +17 -2
- package/dist/tileset-3d/common/tileset-traverser.js.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts +2 -2
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts +65 -0
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js +209 -0
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js.map +1 -1
- package/dist/tileset-3d/format-i3s/i3s-source.d.ts +5 -3
- package/dist/tileset-3d/format-i3s/i3s-source.d.ts.map +1 -1
- package/dist/tileset-3d/format-i3s/i3s-source.js +14 -7
- package/dist/tileset-3d/format-i3s/i3s-source.js.map +1 -1
- package/package.json +13 -13
- package/src/tileset-2d/adapter.ts +2 -3
- package/src/tileset-2d/tileset-2d.ts +2 -3
- package/src/tileset-3d/common/indexed-archive-tileset-source.ts +4 -9
- package/src/tileset-3d/common/tile-3d.ts +6 -2
- package/src/tileset-3d/common/tileset-3d.ts +34 -2
- package/src/tileset-3d/common/tileset-source.ts +8 -12
- package/src/tileset-3d/common/tileset-traverser.ts +28 -2
- package/src/tileset-3d/format-3d-tiles/tiles-3d-source.ts +4 -4
- package/src/tileset-3d/format-3d-tiles/tileset-3d-traverser.ts +236 -0
- package/src/tileset-3d/format-i3s/i3s-source.ts +25 -9
package/dist/dist.dev.js
CHANGED
|
@@ -217,8 +217,8 @@ var __exports__ = (() => {
|
|
|
217
217
|
}
|
|
218
218
|
return zeroToTwoPi(angle2 + PI) - PI;
|
|
219
219
|
}
|
|
220
|
-
function clamp(value,
|
|
221
|
-
return map(value, (value2) => Math.max(
|
|
220
|
+
function clamp(value, min, max) {
|
|
221
|
+
return map(value, (value2) => Math.max(min, Math.min(max, value2)));
|
|
222
222
|
}
|
|
223
223
|
function equals(a, b, epsilon) {
|
|
224
224
|
const oldEpsilon = config.EPSILON;
|
|
@@ -313,10 +313,6 @@ var __exports__ = (() => {
|
|
|
313
313
|
toTarget(target) {
|
|
314
314
|
return target ? this.to(target) : this;
|
|
315
315
|
}
|
|
316
|
-
/** @deprecated */
|
|
317
|
-
toFloat32Array() {
|
|
318
|
-
return new Float32Array(this);
|
|
319
|
-
}
|
|
320
316
|
toString() {
|
|
321
317
|
return this.formatString(config);
|
|
322
318
|
}
|
|
@@ -405,14 +401,14 @@ var __exports__ = (() => {
|
|
|
405
401
|
}
|
|
406
402
|
return this.check();
|
|
407
403
|
}
|
|
408
|
-
scale(
|
|
409
|
-
if (typeof
|
|
404
|
+
scale(scale5) {
|
|
405
|
+
if (typeof scale5 === "number") {
|
|
410
406
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
411
|
-
this[i] *=
|
|
407
|
+
this[i] *= scale5;
|
|
412
408
|
}
|
|
413
409
|
} else {
|
|
414
|
-
for (let i = 0; i < this.ELEMENTS && i <
|
|
415
|
-
this[i] *=
|
|
410
|
+
for (let i = 0; i < this.ELEMENTS && i < scale5.length; ++i) {
|
|
411
|
+
this[i] *= scale5[i];
|
|
416
412
|
}
|
|
417
413
|
}
|
|
418
414
|
return this.check();
|
|
@@ -443,51 +439,6 @@ var __exports__ = (() => {
|
|
|
443
439
|
}
|
|
444
440
|
return valid;
|
|
445
441
|
}
|
|
446
|
-
// three.js compatibility
|
|
447
|
-
/** @deprecated */
|
|
448
|
-
sub(a) {
|
|
449
|
-
return this.subtract(a);
|
|
450
|
-
}
|
|
451
|
-
/** @deprecated */
|
|
452
|
-
setScalar(a) {
|
|
453
|
-
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
454
|
-
this[i] = a;
|
|
455
|
-
}
|
|
456
|
-
return this.check();
|
|
457
|
-
}
|
|
458
|
-
/** @deprecated */
|
|
459
|
-
addScalar(a) {
|
|
460
|
-
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
461
|
-
this[i] += a;
|
|
462
|
-
}
|
|
463
|
-
return this.check();
|
|
464
|
-
}
|
|
465
|
-
/** @deprecated */
|
|
466
|
-
subScalar(a) {
|
|
467
|
-
return this.addScalar(-a);
|
|
468
|
-
}
|
|
469
|
-
/** @deprecated */
|
|
470
|
-
multiplyScalar(scalar) {
|
|
471
|
-
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
472
|
-
this[i] *= scalar;
|
|
473
|
-
}
|
|
474
|
-
return this.check();
|
|
475
|
-
}
|
|
476
|
-
/** @deprecated */
|
|
477
|
-
divideScalar(a) {
|
|
478
|
-
return this.multiplyByScalar(1 / a);
|
|
479
|
-
}
|
|
480
|
-
/** @deprecated */
|
|
481
|
-
clampScalar(min2, max2) {
|
|
482
|
-
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
483
|
-
this[i] = Math.min(Math.max(this[i], min2), max2);
|
|
484
|
-
}
|
|
485
|
-
return this.check();
|
|
486
|
-
}
|
|
487
|
-
/** @deprecated */
|
|
488
|
-
get elements() {
|
|
489
|
-
return this;
|
|
490
|
-
}
|
|
491
442
|
};
|
|
492
443
|
|
|
493
444
|
// ../../node_modules/@math.gl/core/dist/lib/validators.js
|
|
@@ -632,8 +583,8 @@ var __exports__ = (() => {
|
|
|
632
583
|
distanceSquared(mathArray) {
|
|
633
584
|
let length4 = 0;
|
|
634
585
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
635
|
-
const
|
|
636
|
-
length4 +=
|
|
586
|
+
const dist = this[i] - mathArray[i];
|
|
587
|
+
length4 += dist * dist;
|
|
637
588
|
}
|
|
638
589
|
return checkNumber(length4);
|
|
639
590
|
}
|
|
@@ -699,30 +650,19 @@ var __exports__ = (() => {
|
|
|
699
650
|
return this.copy(a).multiply(b);
|
|
700
651
|
}
|
|
701
652
|
addScaledVector(a, b) {
|
|
702
|
-
|
|
653
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
654
|
+
this[i] += a[i] * b;
|
|
655
|
+
}
|
|
656
|
+
return this.check();
|
|
703
657
|
}
|
|
704
658
|
};
|
|
705
659
|
|
|
706
660
|
// ../../node_modules/@math.gl/core/dist/gl-matrix/common.js
|
|
707
661
|
var EPSILON = 1e-6;
|
|
708
662
|
var ARRAY_TYPE = typeof Float32Array !== "undefined" ? Float32Array : Array;
|
|
709
|
-
var RANDOM = Math.random;
|
|
710
|
-
function round2(a) {
|
|
711
|
-
if (a >= 0)
|
|
712
|
-
return Math.round(a);
|
|
713
|
-
return a % 0.5 === 0 ? Math.floor(a) : Math.round(a);
|
|
714
|
-
}
|
|
715
663
|
var degree = Math.PI / 180;
|
|
716
664
|
|
|
717
665
|
// ../../node_modules/@math.gl/core/dist/gl-matrix/vec2.js
|
|
718
|
-
function create() {
|
|
719
|
-
const out = new ARRAY_TYPE(2);
|
|
720
|
-
if (ARRAY_TYPE !== Float32Array) {
|
|
721
|
-
out[0] = 0;
|
|
722
|
-
out[1] = 0;
|
|
723
|
-
}
|
|
724
|
-
return out;
|
|
725
|
-
}
|
|
726
666
|
function transformMat2(out, a, m) {
|
|
727
667
|
const x = a[0];
|
|
728
668
|
const y = a[1];
|
|
@@ -751,32 +691,6 @@ var __exports__ = (() => {
|
|
|
751
691
|
out[1] = m[1] * x + m[5] * y + m[13];
|
|
752
692
|
return out;
|
|
753
693
|
}
|
|
754
|
-
var forEach = (function() {
|
|
755
|
-
const vec = create();
|
|
756
|
-
return function(a, stride, offset, count, fn, arg) {
|
|
757
|
-
let i;
|
|
758
|
-
let l;
|
|
759
|
-
if (!stride) {
|
|
760
|
-
stride = 2;
|
|
761
|
-
}
|
|
762
|
-
if (!offset) {
|
|
763
|
-
offset = 0;
|
|
764
|
-
}
|
|
765
|
-
if (count) {
|
|
766
|
-
l = Math.min(count * stride + offset, a.length);
|
|
767
|
-
} else {
|
|
768
|
-
l = a.length;
|
|
769
|
-
}
|
|
770
|
-
for (i = offset; i < l; i += stride) {
|
|
771
|
-
vec[0] = a[i];
|
|
772
|
-
vec[1] = a[i + 1];
|
|
773
|
-
fn(vec, vec, arg);
|
|
774
|
-
a[i] = vec[0];
|
|
775
|
-
a[i + 1] = vec[1];
|
|
776
|
-
}
|
|
777
|
-
return a;
|
|
778
|
-
};
|
|
779
|
-
})();
|
|
780
694
|
|
|
781
695
|
// ../../node_modules/@math.gl/core/dist/lib/gl-matrix-extras.js
|
|
782
696
|
function vec2_transformMat4AsVector(out, a, m) {
|
|
@@ -805,15 +719,6 @@ var __exports__ = (() => {
|
|
|
805
719
|
out[2] = a[2];
|
|
806
720
|
return out;
|
|
807
721
|
}
|
|
808
|
-
function vec4_transformMat2(out, a, m) {
|
|
809
|
-
const x = a[0];
|
|
810
|
-
const y = a[1];
|
|
811
|
-
out[0] = m[0] * x + m[2] * y;
|
|
812
|
-
out[1] = m[1] * x + m[3] * y;
|
|
813
|
-
out[2] = a[2];
|
|
814
|
-
out[3] = a[3];
|
|
815
|
-
return out;
|
|
816
|
-
}
|
|
817
722
|
function vec4_transformMat3(out, a, m) {
|
|
818
723
|
const x = a[0];
|
|
819
724
|
const y = a[1];
|
|
@@ -925,59 +830,7 @@ var __exports__ = (() => {
|
|
|
925
830
|
};
|
|
926
831
|
|
|
927
832
|
// ../../node_modules/@math.gl/core/dist/gl-matrix/vec3.js
|
|
928
|
-
|
|
929
|
-
__export(vec3_exports, {
|
|
930
|
-
add: () => add,
|
|
931
|
-
angle: () => angle,
|
|
932
|
-
bezier: () => bezier,
|
|
933
|
-
ceil: () => ceil,
|
|
934
|
-
clone: () => clone,
|
|
935
|
-
copy: () => copy,
|
|
936
|
-
create: () => create2,
|
|
937
|
-
cross: () => cross,
|
|
938
|
-
dist: () => dist,
|
|
939
|
-
distance: () => distance,
|
|
940
|
-
div: () => div,
|
|
941
|
-
divide: () => divide,
|
|
942
|
-
dot: () => dot,
|
|
943
|
-
equals: () => equals2,
|
|
944
|
-
exactEquals: () => exactEquals,
|
|
945
|
-
floor: () => floor,
|
|
946
|
-
forEach: () => forEach2,
|
|
947
|
-
fromValues: () => fromValues,
|
|
948
|
-
hermite: () => hermite,
|
|
949
|
-
inverse: () => inverse,
|
|
950
|
-
len: () => len,
|
|
951
|
-
length: () => length,
|
|
952
|
-
lerp: () => lerp,
|
|
953
|
-
max: () => max,
|
|
954
|
-
min: () => min,
|
|
955
|
-
mul: () => mul,
|
|
956
|
-
multiply: () => multiply,
|
|
957
|
-
negate: () => negate,
|
|
958
|
-
normalize: () => normalize,
|
|
959
|
-
random: () => random,
|
|
960
|
-
rotateX: () => rotateX,
|
|
961
|
-
rotateY: () => rotateY,
|
|
962
|
-
rotateZ: () => rotateZ,
|
|
963
|
-
round: () => round3,
|
|
964
|
-
scale: () => scale,
|
|
965
|
-
scaleAndAdd: () => scaleAndAdd,
|
|
966
|
-
set: () => set,
|
|
967
|
-
slerp: () => slerp,
|
|
968
|
-
sqrDist: () => sqrDist,
|
|
969
|
-
sqrLen: () => sqrLen,
|
|
970
|
-
squaredDistance: () => squaredDistance,
|
|
971
|
-
squaredLength: () => squaredLength,
|
|
972
|
-
str: () => str,
|
|
973
|
-
sub: () => sub,
|
|
974
|
-
subtract: () => subtract,
|
|
975
|
-
transformMat3: () => transformMat32,
|
|
976
|
-
transformMat4: () => transformMat42,
|
|
977
|
-
transformQuat: () => transformQuat,
|
|
978
|
-
zero: () => zero
|
|
979
|
-
});
|
|
980
|
-
function create2() {
|
|
833
|
+
function create() {
|
|
981
834
|
const out = new ARRAY_TYPE(3);
|
|
982
835
|
if (ARRAY_TYPE !== Float32Array) {
|
|
983
836
|
out[0] = 0;
|
|
@@ -986,13 +839,6 @@ var __exports__ = (() => {
|
|
|
986
839
|
}
|
|
987
840
|
return out;
|
|
988
841
|
}
|
|
989
|
-
function clone(a) {
|
|
990
|
-
const out = new ARRAY_TYPE(3);
|
|
991
|
-
out[0] = a[0];
|
|
992
|
-
out[1] = a[1];
|
|
993
|
-
out[2] = a[2];
|
|
994
|
-
return out;
|
|
995
|
-
}
|
|
996
842
|
function length(a) {
|
|
997
843
|
const x = a[0];
|
|
998
844
|
const y = a[1];
|
|
@@ -1006,114 +852,6 @@ var __exports__ = (() => {
|
|
|
1006
852
|
out[2] = z;
|
|
1007
853
|
return out;
|
|
1008
854
|
}
|
|
1009
|
-
function copy(out, a) {
|
|
1010
|
-
out[0] = a[0];
|
|
1011
|
-
out[1] = a[1];
|
|
1012
|
-
out[2] = a[2];
|
|
1013
|
-
return out;
|
|
1014
|
-
}
|
|
1015
|
-
function set(out, x, y, z) {
|
|
1016
|
-
out[0] = x;
|
|
1017
|
-
out[1] = y;
|
|
1018
|
-
out[2] = z;
|
|
1019
|
-
return out;
|
|
1020
|
-
}
|
|
1021
|
-
function add(out, a, b) {
|
|
1022
|
-
out[0] = a[0] + b[0];
|
|
1023
|
-
out[1] = a[1] + b[1];
|
|
1024
|
-
out[2] = a[2] + b[2];
|
|
1025
|
-
return out;
|
|
1026
|
-
}
|
|
1027
|
-
function subtract(out, a, b) {
|
|
1028
|
-
out[0] = a[0] - b[0];
|
|
1029
|
-
out[1] = a[1] - b[1];
|
|
1030
|
-
out[2] = a[2] - b[2];
|
|
1031
|
-
return out;
|
|
1032
|
-
}
|
|
1033
|
-
function multiply(out, a, b) {
|
|
1034
|
-
out[0] = a[0] * b[0];
|
|
1035
|
-
out[1] = a[1] * b[1];
|
|
1036
|
-
out[2] = a[2] * b[2];
|
|
1037
|
-
return out;
|
|
1038
|
-
}
|
|
1039
|
-
function divide(out, a, b) {
|
|
1040
|
-
out[0] = a[0] / b[0];
|
|
1041
|
-
out[1] = a[1] / b[1];
|
|
1042
|
-
out[2] = a[2] / b[2];
|
|
1043
|
-
return out;
|
|
1044
|
-
}
|
|
1045
|
-
function ceil(out, a) {
|
|
1046
|
-
out[0] = Math.ceil(a[0]);
|
|
1047
|
-
out[1] = Math.ceil(a[1]);
|
|
1048
|
-
out[2] = Math.ceil(a[2]);
|
|
1049
|
-
return out;
|
|
1050
|
-
}
|
|
1051
|
-
function floor(out, a) {
|
|
1052
|
-
out[0] = Math.floor(a[0]);
|
|
1053
|
-
out[1] = Math.floor(a[1]);
|
|
1054
|
-
out[2] = Math.floor(a[2]);
|
|
1055
|
-
return out;
|
|
1056
|
-
}
|
|
1057
|
-
function min(out, a, b) {
|
|
1058
|
-
out[0] = Math.min(a[0], b[0]);
|
|
1059
|
-
out[1] = Math.min(a[1], b[1]);
|
|
1060
|
-
out[2] = Math.min(a[2], b[2]);
|
|
1061
|
-
return out;
|
|
1062
|
-
}
|
|
1063
|
-
function max(out, a, b) {
|
|
1064
|
-
out[0] = Math.max(a[0], b[0]);
|
|
1065
|
-
out[1] = Math.max(a[1], b[1]);
|
|
1066
|
-
out[2] = Math.max(a[2], b[2]);
|
|
1067
|
-
return out;
|
|
1068
|
-
}
|
|
1069
|
-
function round3(out, a) {
|
|
1070
|
-
out[0] = round2(a[0]);
|
|
1071
|
-
out[1] = round2(a[1]);
|
|
1072
|
-
out[2] = round2(a[2]);
|
|
1073
|
-
return out;
|
|
1074
|
-
}
|
|
1075
|
-
function scale(out, a, b) {
|
|
1076
|
-
out[0] = a[0] * b;
|
|
1077
|
-
out[1] = a[1] * b;
|
|
1078
|
-
out[2] = a[2] * b;
|
|
1079
|
-
return out;
|
|
1080
|
-
}
|
|
1081
|
-
function scaleAndAdd(out, a, b, scale6) {
|
|
1082
|
-
out[0] = a[0] + b[0] * scale6;
|
|
1083
|
-
out[1] = a[1] + b[1] * scale6;
|
|
1084
|
-
out[2] = a[2] + b[2] * scale6;
|
|
1085
|
-
return out;
|
|
1086
|
-
}
|
|
1087
|
-
function distance(a, b) {
|
|
1088
|
-
const x = b[0] - a[0];
|
|
1089
|
-
const y = b[1] - a[1];
|
|
1090
|
-
const z = b[2] - a[2];
|
|
1091
|
-
return Math.sqrt(x * x + y * y + z * z);
|
|
1092
|
-
}
|
|
1093
|
-
function squaredDistance(a, b) {
|
|
1094
|
-
const x = b[0] - a[0];
|
|
1095
|
-
const y = b[1] - a[1];
|
|
1096
|
-
const z = b[2] - a[2];
|
|
1097
|
-
return x * x + y * y + z * z;
|
|
1098
|
-
}
|
|
1099
|
-
function squaredLength(a) {
|
|
1100
|
-
const x = a[0];
|
|
1101
|
-
const y = a[1];
|
|
1102
|
-
const z = a[2];
|
|
1103
|
-
return x * x + y * y + z * z;
|
|
1104
|
-
}
|
|
1105
|
-
function negate(out, a) {
|
|
1106
|
-
out[0] = -a[0];
|
|
1107
|
-
out[1] = -a[1];
|
|
1108
|
-
out[2] = -a[2];
|
|
1109
|
-
return out;
|
|
1110
|
-
}
|
|
1111
|
-
function inverse(out, a) {
|
|
1112
|
-
out[0] = 1 / a[0];
|
|
1113
|
-
out[1] = 1 / a[1];
|
|
1114
|
-
out[2] = 1 / a[2];
|
|
1115
|
-
return out;
|
|
1116
|
-
}
|
|
1117
855
|
function normalize(out, a) {
|
|
1118
856
|
const x = a[0];
|
|
1119
857
|
const y = a[1];
|
|
@@ -1142,59 +880,6 @@ var __exports__ = (() => {
|
|
|
1142
880
|
out[2] = ax * by - ay * bx;
|
|
1143
881
|
return out;
|
|
1144
882
|
}
|
|
1145
|
-
function lerp(out, a, b, t) {
|
|
1146
|
-
const ax = a[0];
|
|
1147
|
-
const ay = a[1];
|
|
1148
|
-
const az = a[2];
|
|
1149
|
-
out[0] = ax + t * (b[0] - ax);
|
|
1150
|
-
out[1] = ay + t * (b[1] - ay);
|
|
1151
|
-
out[2] = az + t * (b[2] - az);
|
|
1152
|
-
return out;
|
|
1153
|
-
}
|
|
1154
|
-
function slerp(out, a, b, t) {
|
|
1155
|
-
const angle2 = Math.acos(Math.min(Math.max(dot(a, b), -1), 1));
|
|
1156
|
-
const sinTotal = Math.sin(angle2);
|
|
1157
|
-
const ratioA = Math.sin((1 - t) * angle2) / sinTotal;
|
|
1158
|
-
const ratioB = Math.sin(t * angle2) / sinTotal;
|
|
1159
|
-
out[0] = ratioA * a[0] + ratioB * b[0];
|
|
1160
|
-
out[1] = ratioA * a[1] + ratioB * b[1];
|
|
1161
|
-
out[2] = ratioA * a[2] + ratioB * b[2];
|
|
1162
|
-
return out;
|
|
1163
|
-
}
|
|
1164
|
-
function hermite(out, a, b, c, d, t) {
|
|
1165
|
-
const factorTimes2 = t * t;
|
|
1166
|
-
const factor1 = factorTimes2 * (2 * t - 3) + 1;
|
|
1167
|
-
const factor2 = factorTimes2 * (t - 2) + t;
|
|
1168
|
-
const factor3 = factorTimes2 * (t - 1);
|
|
1169
|
-
const factor4 = factorTimes2 * (3 - 2 * t);
|
|
1170
|
-
out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
|
|
1171
|
-
out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
|
|
1172
|
-
out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
|
|
1173
|
-
return out;
|
|
1174
|
-
}
|
|
1175
|
-
function bezier(out, a, b, c, d, t) {
|
|
1176
|
-
const inverseFactor = 1 - t;
|
|
1177
|
-
const inverseFactorTimesTwo = inverseFactor * inverseFactor;
|
|
1178
|
-
const factorTimes2 = t * t;
|
|
1179
|
-
const factor1 = inverseFactorTimesTwo * inverseFactor;
|
|
1180
|
-
const factor2 = 3 * t * inverseFactorTimesTwo;
|
|
1181
|
-
const factor3 = 3 * factorTimes2 * inverseFactor;
|
|
1182
|
-
const factor4 = factorTimes2 * t;
|
|
1183
|
-
out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
|
|
1184
|
-
out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
|
|
1185
|
-
out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
|
|
1186
|
-
return out;
|
|
1187
|
-
}
|
|
1188
|
-
function random(out, scale6) {
|
|
1189
|
-
scale6 = scale6 === void 0 ? 1 : scale6;
|
|
1190
|
-
const r = RANDOM() * 2 * Math.PI;
|
|
1191
|
-
const z = RANDOM() * 2 - 1;
|
|
1192
|
-
const zScale = Math.sqrt(1 - z * z) * scale6;
|
|
1193
|
-
out[0] = Math.cos(r) * zScale;
|
|
1194
|
-
out[1] = Math.sin(r) * zScale;
|
|
1195
|
-
out[2] = z * scale6;
|
|
1196
|
-
return out;
|
|
1197
|
-
}
|
|
1198
883
|
function transformMat42(out, a, m) {
|
|
1199
884
|
const x = a[0];
|
|
1200
885
|
const y = a[1];
|
|
@@ -1294,62 +979,7 @@ var __exports__ = (() => {
|
|
|
1294
979
|
const cosine = mag && dot(a, b) / mag;
|
|
1295
980
|
return Math.acos(Math.min(Math.max(cosine, -1), 1));
|
|
1296
981
|
}
|
|
1297
|
-
function zero(out) {
|
|
1298
|
-
out[0] = 0;
|
|
1299
|
-
out[1] = 0;
|
|
1300
|
-
out[2] = 0;
|
|
1301
|
-
return out;
|
|
1302
|
-
}
|
|
1303
|
-
function str(a) {
|
|
1304
|
-
return `vec3(${a[0]}, ${a[1]}, ${a[2]})`;
|
|
1305
|
-
}
|
|
1306
|
-
function exactEquals(a, b) {
|
|
1307
|
-
return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
|
|
1308
|
-
}
|
|
1309
|
-
function equals2(a, b) {
|
|
1310
|
-
const a0 = a[0];
|
|
1311
|
-
const a1 = a[1];
|
|
1312
|
-
const a2 = a[2];
|
|
1313
|
-
const b0 = b[0];
|
|
1314
|
-
const b1 = b[1];
|
|
1315
|
-
const b2 = b[2];
|
|
1316
|
-
return Math.abs(a0 - b0) <= EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));
|
|
1317
|
-
}
|
|
1318
|
-
var sub = subtract;
|
|
1319
|
-
var mul = multiply;
|
|
1320
|
-
var div = divide;
|
|
1321
|
-
var dist = distance;
|
|
1322
|
-
var sqrDist = squaredDistance;
|
|
1323
982
|
var len = length;
|
|
1324
|
-
var sqrLen = squaredLength;
|
|
1325
|
-
var forEach2 = (function() {
|
|
1326
|
-
const vec = create2();
|
|
1327
|
-
return function(a, stride, offset, count, fn, arg) {
|
|
1328
|
-
let i;
|
|
1329
|
-
let l;
|
|
1330
|
-
if (!stride) {
|
|
1331
|
-
stride = 3;
|
|
1332
|
-
}
|
|
1333
|
-
if (!offset) {
|
|
1334
|
-
offset = 0;
|
|
1335
|
-
}
|
|
1336
|
-
if (count) {
|
|
1337
|
-
l = Math.min(count * stride + offset, a.length);
|
|
1338
|
-
} else {
|
|
1339
|
-
l = a.length;
|
|
1340
|
-
}
|
|
1341
|
-
for (i = offset; i < l; i += stride) {
|
|
1342
|
-
vec[0] = a[i];
|
|
1343
|
-
vec[1] = a[i + 1];
|
|
1344
|
-
vec[2] = a[i + 2];
|
|
1345
|
-
fn(vec, vec, arg);
|
|
1346
|
-
a[i] = vec[0];
|
|
1347
|
-
a[i + 1] = vec[1];
|
|
1348
|
-
a[i + 2] = vec[2];
|
|
1349
|
-
}
|
|
1350
|
-
return a;
|
|
1351
|
-
};
|
|
1352
|
-
})();
|
|
1353
983
|
|
|
1354
984
|
// ../../node_modules/@math.gl/core/dist/classes/vector3.js
|
|
1355
985
|
var ORIGIN = [0, 0, 0];
|
|
@@ -1472,123 +1102,7 @@ var __exports__ = (() => {
|
|
|
1472
1102
|
}
|
|
1473
1103
|
};
|
|
1474
1104
|
|
|
1475
|
-
// ../../node_modules/@math.gl/core/dist/classes/vector4.js
|
|
1476
|
-
var ZERO2;
|
|
1477
|
-
var Vector4 = class _Vector4 extends Vector {
|
|
1478
|
-
static get ZERO() {
|
|
1479
|
-
if (!ZERO2) {
|
|
1480
|
-
ZERO2 = new _Vector4(0, 0, 0, 0);
|
|
1481
|
-
Object.freeze(ZERO2);
|
|
1482
|
-
}
|
|
1483
|
-
return ZERO2;
|
|
1484
|
-
}
|
|
1485
|
-
constructor(x = 0, y = 0, z = 0, w = 0) {
|
|
1486
|
-
super(-0, -0, -0, -0);
|
|
1487
|
-
if (isArray(x) && arguments.length === 1) {
|
|
1488
|
-
this.copy(x);
|
|
1489
|
-
} else {
|
|
1490
|
-
if (config.debug) {
|
|
1491
|
-
checkNumber(x);
|
|
1492
|
-
checkNumber(y);
|
|
1493
|
-
checkNumber(z);
|
|
1494
|
-
checkNumber(w);
|
|
1495
|
-
}
|
|
1496
|
-
this[0] = x;
|
|
1497
|
-
this[1] = y;
|
|
1498
|
-
this[2] = z;
|
|
1499
|
-
this[3] = w;
|
|
1500
|
-
}
|
|
1501
|
-
}
|
|
1502
|
-
set(x, y, z, w) {
|
|
1503
|
-
this[0] = x;
|
|
1504
|
-
this[1] = y;
|
|
1505
|
-
this[2] = z;
|
|
1506
|
-
this[3] = w;
|
|
1507
|
-
return this.check();
|
|
1508
|
-
}
|
|
1509
|
-
copy(array) {
|
|
1510
|
-
this[0] = array[0];
|
|
1511
|
-
this[1] = array[1];
|
|
1512
|
-
this[2] = array[2];
|
|
1513
|
-
this[3] = array[3];
|
|
1514
|
-
return this.check();
|
|
1515
|
-
}
|
|
1516
|
-
fromObject(object) {
|
|
1517
|
-
if (config.debug) {
|
|
1518
|
-
checkNumber(object.x);
|
|
1519
|
-
checkNumber(object.y);
|
|
1520
|
-
checkNumber(object.z);
|
|
1521
|
-
checkNumber(object.w);
|
|
1522
|
-
}
|
|
1523
|
-
this[0] = object.x;
|
|
1524
|
-
this[1] = object.y;
|
|
1525
|
-
this[2] = object.z;
|
|
1526
|
-
this[3] = object.w;
|
|
1527
|
-
return this;
|
|
1528
|
-
}
|
|
1529
|
-
toObject(object) {
|
|
1530
|
-
object.x = this[0];
|
|
1531
|
-
object.y = this[1];
|
|
1532
|
-
object.z = this[2];
|
|
1533
|
-
object.w = this[3];
|
|
1534
|
-
return object;
|
|
1535
|
-
}
|
|
1536
|
-
// Getters/setters
|
|
1537
|
-
/* eslint-disable no-multi-spaces, brace-style, no-return-assign */
|
|
1538
|
-
get ELEMENTS() {
|
|
1539
|
-
return 4;
|
|
1540
|
-
}
|
|
1541
|
-
get z() {
|
|
1542
|
-
return this[2];
|
|
1543
|
-
}
|
|
1544
|
-
set z(value) {
|
|
1545
|
-
this[2] = checkNumber(value);
|
|
1546
|
-
}
|
|
1547
|
-
get w() {
|
|
1548
|
-
return this[3];
|
|
1549
|
-
}
|
|
1550
|
-
set w(value) {
|
|
1551
|
-
this[3] = checkNumber(value);
|
|
1552
|
-
}
|
|
1553
|
-
transform(matrix4) {
|
|
1554
|
-
transformMat42(this, this, matrix4);
|
|
1555
|
-
return this.check();
|
|
1556
|
-
}
|
|
1557
|
-
transformByMatrix3(matrix3) {
|
|
1558
|
-
vec4_transformMat3(this, this, matrix3);
|
|
1559
|
-
return this.check();
|
|
1560
|
-
}
|
|
1561
|
-
transformByMatrix2(matrix2) {
|
|
1562
|
-
vec4_transformMat2(this, this, matrix2);
|
|
1563
|
-
return this.check();
|
|
1564
|
-
}
|
|
1565
|
-
transformByQuaternion(quaternion) {
|
|
1566
|
-
transformQuat(this, this, quaternion);
|
|
1567
|
-
return this.check();
|
|
1568
|
-
}
|
|
1569
|
-
// three.js compatibility
|
|
1570
|
-
applyMatrix4(m) {
|
|
1571
|
-
m.transform(this, this);
|
|
1572
|
-
return this;
|
|
1573
|
-
}
|
|
1574
|
-
};
|
|
1575
|
-
|
|
1576
1105
|
// ../../node_modules/@math.gl/core/dist/gl-matrix/mat3.js
|
|
1577
|
-
function create3() {
|
|
1578
|
-
const out = new ARRAY_TYPE(9);
|
|
1579
|
-
if (ARRAY_TYPE !== Float32Array) {
|
|
1580
|
-
out[1] = 0;
|
|
1581
|
-
out[2] = 0;
|
|
1582
|
-
out[3] = 0;
|
|
1583
|
-
out[5] = 0;
|
|
1584
|
-
out[6] = 0;
|
|
1585
|
-
out[7] = 0;
|
|
1586
|
-
}
|
|
1587
|
-
out[0] = 1;
|
|
1588
|
-
out[4] = 1;
|
|
1589
|
-
out[8] = 1;
|
|
1590
|
-
return out;
|
|
1591
|
-
}
|
|
1592
1106
|
function transpose(out, a) {
|
|
1593
1107
|
if (out === a) {
|
|
1594
1108
|
const a01 = a[1];
|
|
@@ -1654,7 +1168,7 @@ var __exports__ = (() => {
|
|
|
1654
1168
|
const a22 = a[8];
|
|
1655
1169
|
return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);
|
|
1656
1170
|
}
|
|
1657
|
-
function
|
|
1171
|
+
function multiply(out, a, b) {
|
|
1658
1172
|
const a00 = a[0];
|
|
1659
1173
|
const a01 = a[1];
|
|
1660
1174
|
const a02 = a[2];
|
|
@@ -1730,7 +1244,7 @@ var __exports__ = (() => {
|
|
|
1730
1244
|
out[8] = a22;
|
|
1731
1245
|
return out;
|
|
1732
1246
|
}
|
|
1733
|
-
function
|
|
1247
|
+
function scale(out, a, v) {
|
|
1734
1248
|
const x = v[0];
|
|
1735
1249
|
const y = v[1];
|
|
1736
1250
|
out[0] = x * a[0];
|
|
@@ -1803,12 +1317,10 @@ var __exports__ = (() => {
|
|
|
1803
1317
|
get INDICES() {
|
|
1804
1318
|
return INDICES;
|
|
1805
1319
|
}
|
|
1806
|
-
constructor(array
|
|
1320
|
+
constructor(array) {
|
|
1807
1321
|
super(-0, -0, -0, -0, -0, -0, -0, -0, -0);
|
|
1808
1322
|
if (arguments.length === 1 && Array.isArray(array)) {
|
|
1809
1323
|
this.copy(array);
|
|
1810
|
-
} else if (args.length > 0) {
|
|
1811
|
-
this.copy([array, ...args]);
|
|
1812
1324
|
} else {
|
|
1813
1325
|
this.identity();
|
|
1814
1326
|
}
|
|
@@ -1845,6 +1357,10 @@ var __exports__ = (() => {
|
|
|
1845
1357
|
fromQuat(this, q);
|
|
1846
1358
|
return this.check();
|
|
1847
1359
|
}
|
|
1360
|
+
/** Sets this matrix from the upper-left 3x3 elements of a 4x4 matrix. */
|
|
1361
|
+
fromMatrix4(matrix4) {
|
|
1362
|
+
return this.set(matrix4[0], matrix4[1], matrix4[2], matrix4[4], matrix4[5], matrix4[6], matrix4[8], matrix4[9], matrix4[10]);
|
|
1363
|
+
}
|
|
1848
1364
|
/**
|
|
1849
1365
|
* accepts column major order, stores in column major order
|
|
1850
1366
|
*/
|
|
@@ -1893,11 +1409,11 @@ var __exports__ = (() => {
|
|
|
1893
1409
|
}
|
|
1894
1410
|
// Operations
|
|
1895
1411
|
multiplyLeft(a) {
|
|
1896
|
-
|
|
1412
|
+
multiply(this, a, this);
|
|
1897
1413
|
return this.check();
|
|
1898
1414
|
}
|
|
1899
1415
|
multiplyRight(a) {
|
|
1900
|
-
|
|
1416
|
+
multiply(this, this, a);
|
|
1901
1417
|
return this.check();
|
|
1902
1418
|
}
|
|
1903
1419
|
rotate(radians2) {
|
|
@@ -1906,9 +1422,9 @@ var __exports__ = (() => {
|
|
|
1906
1422
|
}
|
|
1907
1423
|
scale(factor) {
|
|
1908
1424
|
if (Array.isArray(factor)) {
|
|
1909
|
-
|
|
1425
|
+
scale(this, this, factor);
|
|
1910
1426
|
} else {
|
|
1911
|
-
|
|
1427
|
+
scale(this, this, [factor, factor]);
|
|
1912
1428
|
}
|
|
1913
1429
|
return this.check();
|
|
1914
1430
|
}
|
|
@@ -1935,18 +1451,6 @@ var __exports__ = (() => {
|
|
|
1935
1451
|
checkVector(out, vector.length);
|
|
1936
1452
|
return out;
|
|
1937
1453
|
}
|
|
1938
|
-
/** @deprecated */
|
|
1939
|
-
transformVector(vector, result) {
|
|
1940
|
-
return this.transform(vector, result);
|
|
1941
|
-
}
|
|
1942
|
-
/** @deprecated */
|
|
1943
|
-
transformVector2(vector, result) {
|
|
1944
|
-
return this.transform(vector, result);
|
|
1945
|
-
}
|
|
1946
|
-
/** @deprecated */
|
|
1947
|
-
transformVector3(vector, result) {
|
|
1948
|
-
return this.transform(vector, result);
|
|
1949
|
-
}
|
|
1950
1454
|
};
|
|
1951
1455
|
var ZERO_MATRIX3;
|
|
1952
1456
|
var IDENTITY_MATRIX3 = null;
|
|
@@ -1966,167 +1470,12 @@ var __exports__ = (() => {
|
|
|
1966
1470
|
}
|
|
1967
1471
|
|
|
1968
1472
|
// ../../node_modules/@math.gl/core/dist/gl-matrix/mat4.js
|
|
1969
|
-
|
|
1970
|
-
__export(mat4_exports, {
|
|
1971
|
-
add: () => add2,
|
|
1972
|
-
adjoint: () => adjoint,
|
|
1973
|
-
clone: () => clone2,
|
|
1974
|
-
copy: () => copy2,
|
|
1975
|
-
create: () => create4,
|
|
1976
|
-
decompose: () => decompose,
|
|
1977
|
-
determinant: () => determinant2,
|
|
1978
|
-
equals: () => equals3,
|
|
1979
|
-
exactEquals: () => exactEquals2,
|
|
1980
|
-
frob: () => frob,
|
|
1981
|
-
fromQuat: () => fromQuat3,
|
|
1982
|
-
fromQuat2: () => fromQuat2,
|
|
1983
|
-
fromRotation: () => fromRotation,
|
|
1984
|
-
fromRotationTranslation: () => fromRotationTranslation,
|
|
1985
|
-
fromRotationTranslationScale: () => fromRotationTranslationScale,
|
|
1986
|
-
fromRotationTranslationScaleOrigin: () => fromRotationTranslationScaleOrigin,
|
|
1987
|
-
fromScaling: () => fromScaling,
|
|
1988
|
-
fromTranslation: () => fromTranslation,
|
|
1989
|
-
fromValues: () => fromValues2,
|
|
1990
|
-
fromXRotation: () => fromXRotation,
|
|
1991
|
-
fromYRotation: () => fromYRotation,
|
|
1992
|
-
fromZRotation: () => fromZRotation,
|
|
1993
|
-
frustum: () => frustum,
|
|
1994
|
-
getRotation: () => getRotation,
|
|
1995
|
-
getScaling: () => getScaling,
|
|
1996
|
-
getTranslation: () => getTranslation,
|
|
1997
|
-
identity: () => identity,
|
|
1998
|
-
invert: () => invert2,
|
|
1999
|
-
lookAt: () => lookAt,
|
|
2000
|
-
mul: () => mul2,
|
|
2001
|
-
multiply: () => multiply3,
|
|
2002
|
-
multiplyScalar: () => multiplyScalar,
|
|
2003
|
-
multiplyScalarAndAdd: () => multiplyScalarAndAdd,
|
|
2004
|
-
ortho: () => ortho,
|
|
2005
|
-
orthoNO: () => orthoNO,
|
|
2006
|
-
orthoZO: () => orthoZO,
|
|
2007
|
-
perspective: () => perspective,
|
|
2008
|
-
perspectiveFromFieldOfView: () => perspectiveFromFieldOfView,
|
|
2009
|
-
perspectiveNO: () => perspectiveNO,
|
|
2010
|
-
perspectiveZO: () => perspectiveZO,
|
|
2011
|
-
rotate: () => rotate2,
|
|
2012
|
-
rotateX: () => rotateX2,
|
|
2013
|
-
rotateY: () => rotateY2,
|
|
2014
|
-
rotateZ: () => rotateZ2,
|
|
2015
|
-
scale: () => scale3,
|
|
2016
|
-
set: () => set2,
|
|
2017
|
-
str: () => str2,
|
|
2018
|
-
sub: () => sub2,
|
|
2019
|
-
subtract: () => subtract2,
|
|
2020
|
-
targetTo: () => targetTo,
|
|
2021
|
-
translate: () => translate2,
|
|
2022
|
-
transpose: () => transpose2
|
|
2023
|
-
});
|
|
2024
|
-
function create4() {
|
|
2025
|
-
const out = new ARRAY_TYPE(16);
|
|
2026
|
-
if (ARRAY_TYPE !== Float32Array) {
|
|
2027
|
-
out[1] = 0;
|
|
2028
|
-
out[2] = 0;
|
|
2029
|
-
out[3] = 0;
|
|
2030
|
-
out[4] = 0;
|
|
2031
|
-
out[6] = 0;
|
|
2032
|
-
out[7] = 0;
|
|
2033
|
-
out[8] = 0;
|
|
2034
|
-
out[9] = 0;
|
|
2035
|
-
out[11] = 0;
|
|
2036
|
-
out[12] = 0;
|
|
2037
|
-
out[13] = 0;
|
|
2038
|
-
out[14] = 0;
|
|
2039
|
-
}
|
|
1473
|
+
function identity(out) {
|
|
2040
1474
|
out[0] = 1;
|
|
2041
|
-
out[
|
|
2042
|
-
out[
|
|
2043
|
-
out[
|
|
2044
|
-
|
|
2045
|
-
}
|
|
2046
|
-
function clone2(a) {
|
|
2047
|
-
const out = new ARRAY_TYPE(16);
|
|
2048
|
-
out[0] = a[0];
|
|
2049
|
-
out[1] = a[1];
|
|
2050
|
-
out[2] = a[2];
|
|
2051
|
-
out[3] = a[3];
|
|
2052
|
-
out[4] = a[4];
|
|
2053
|
-
out[5] = a[5];
|
|
2054
|
-
out[6] = a[6];
|
|
2055
|
-
out[7] = a[7];
|
|
2056
|
-
out[8] = a[8];
|
|
2057
|
-
out[9] = a[9];
|
|
2058
|
-
out[10] = a[10];
|
|
2059
|
-
out[11] = a[11];
|
|
2060
|
-
out[12] = a[12];
|
|
2061
|
-
out[13] = a[13];
|
|
2062
|
-
out[14] = a[14];
|
|
2063
|
-
out[15] = a[15];
|
|
2064
|
-
return out;
|
|
2065
|
-
}
|
|
2066
|
-
function copy2(out, a) {
|
|
2067
|
-
out[0] = a[0];
|
|
2068
|
-
out[1] = a[1];
|
|
2069
|
-
out[2] = a[2];
|
|
2070
|
-
out[3] = a[3];
|
|
2071
|
-
out[4] = a[4];
|
|
2072
|
-
out[5] = a[5];
|
|
2073
|
-
out[6] = a[6];
|
|
2074
|
-
out[7] = a[7];
|
|
2075
|
-
out[8] = a[8];
|
|
2076
|
-
out[9] = a[9];
|
|
2077
|
-
out[10] = a[10];
|
|
2078
|
-
out[11] = a[11];
|
|
2079
|
-
out[12] = a[12];
|
|
2080
|
-
out[13] = a[13];
|
|
2081
|
-
out[14] = a[14];
|
|
2082
|
-
out[15] = a[15];
|
|
2083
|
-
return out;
|
|
2084
|
-
}
|
|
2085
|
-
function fromValues2(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {
|
|
2086
|
-
const out = new ARRAY_TYPE(16);
|
|
2087
|
-
out[0] = m00;
|
|
2088
|
-
out[1] = m01;
|
|
2089
|
-
out[2] = m02;
|
|
2090
|
-
out[3] = m03;
|
|
2091
|
-
out[4] = m10;
|
|
2092
|
-
out[5] = m11;
|
|
2093
|
-
out[6] = m12;
|
|
2094
|
-
out[7] = m13;
|
|
2095
|
-
out[8] = m20;
|
|
2096
|
-
out[9] = m21;
|
|
2097
|
-
out[10] = m22;
|
|
2098
|
-
out[11] = m23;
|
|
2099
|
-
out[12] = m30;
|
|
2100
|
-
out[13] = m31;
|
|
2101
|
-
out[14] = m32;
|
|
2102
|
-
out[15] = m33;
|
|
2103
|
-
return out;
|
|
2104
|
-
}
|
|
2105
|
-
function set2(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {
|
|
2106
|
-
out[0] = m00;
|
|
2107
|
-
out[1] = m01;
|
|
2108
|
-
out[2] = m02;
|
|
2109
|
-
out[3] = m03;
|
|
2110
|
-
out[4] = m10;
|
|
2111
|
-
out[5] = m11;
|
|
2112
|
-
out[6] = m12;
|
|
2113
|
-
out[7] = m13;
|
|
2114
|
-
out[8] = m20;
|
|
2115
|
-
out[9] = m21;
|
|
2116
|
-
out[10] = m22;
|
|
2117
|
-
out[11] = m23;
|
|
2118
|
-
out[12] = m30;
|
|
2119
|
-
out[13] = m31;
|
|
2120
|
-
out[14] = m32;
|
|
2121
|
-
out[15] = m33;
|
|
2122
|
-
return out;
|
|
2123
|
-
}
|
|
2124
|
-
function identity(out) {
|
|
2125
|
-
out[0] = 1;
|
|
2126
|
-
out[1] = 0;
|
|
2127
|
-
out[2] = 0;
|
|
2128
|
-
out[3] = 0;
|
|
2129
|
-
out[4] = 0;
|
|
1475
|
+
out[1] = 0;
|
|
1476
|
+
out[2] = 0;
|
|
1477
|
+
out[3] = 0;
|
|
1478
|
+
out[4] = 0;
|
|
2130
1479
|
out[5] = 1;
|
|
2131
1480
|
out[6] = 0;
|
|
2132
1481
|
out[7] = 0;
|
|
@@ -2232,53 +1581,6 @@ var __exports__ = (() => {
|
|
|
2232
1581
|
out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;
|
|
2233
1582
|
return out;
|
|
2234
1583
|
}
|
|
2235
|
-
function adjoint(out, a) {
|
|
2236
|
-
const a00 = a[0];
|
|
2237
|
-
const a01 = a[1];
|
|
2238
|
-
const a02 = a[2];
|
|
2239
|
-
const a03 = a[3];
|
|
2240
|
-
const a10 = a[4];
|
|
2241
|
-
const a11 = a[5];
|
|
2242
|
-
const a12 = a[6];
|
|
2243
|
-
const a13 = a[7];
|
|
2244
|
-
const a20 = a[8];
|
|
2245
|
-
const a21 = a[9];
|
|
2246
|
-
const a22 = a[10];
|
|
2247
|
-
const a23 = a[11];
|
|
2248
|
-
const a30 = a[12];
|
|
2249
|
-
const a31 = a[13];
|
|
2250
|
-
const a32 = a[14];
|
|
2251
|
-
const a33 = a[15];
|
|
2252
|
-
const b00 = a00 * a11 - a01 * a10;
|
|
2253
|
-
const b01 = a00 * a12 - a02 * a10;
|
|
2254
|
-
const b02 = a00 * a13 - a03 * a10;
|
|
2255
|
-
const b03 = a01 * a12 - a02 * a11;
|
|
2256
|
-
const b04 = a01 * a13 - a03 * a11;
|
|
2257
|
-
const b05 = a02 * a13 - a03 * a12;
|
|
2258
|
-
const b06 = a20 * a31 - a21 * a30;
|
|
2259
|
-
const b07 = a20 * a32 - a22 * a30;
|
|
2260
|
-
const b08 = a20 * a33 - a23 * a30;
|
|
2261
|
-
const b09 = a21 * a32 - a22 * a31;
|
|
2262
|
-
const b10 = a21 * a33 - a23 * a31;
|
|
2263
|
-
const b11 = a22 * a33 - a23 * a32;
|
|
2264
|
-
out[0] = a11 * b11 - a12 * b10 + a13 * b09;
|
|
2265
|
-
out[1] = a02 * b10 - a01 * b11 - a03 * b09;
|
|
2266
|
-
out[2] = a31 * b05 - a32 * b04 + a33 * b03;
|
|
2267
|
-
out[3] = a22 * b04 - a21 * b05 - a23 * b03;
|
|
2268
|
-
out[4] = a12 * b08 - a10 * b11 - a13 * b07;
|
|
2269
|
-
out[5] = a00 * b11 - a02 * b08 + a03 * b07;
|
|
2270
|
-
out[6] = a32 * b02 - a30 * b05 - a33 * b01;
|
|
2271
|
-
out[7] = a20 * b05 - a22 * b02 + a23 * b01;
|
|
2272
|
-
out[8] = a10 * b10 - a11 * b08 + a13 * b06;
|
|
2273
|
-
out[9] = a01 * b08 - a00 * b10 - a03 * b06;
|
|
2274
|
-
out[10] = a30 * b04 - a31 * b02 + a33 * b00;
|
|
2275
|
-
out[11] = a21 * b02 - a20 * b04 - a23 * b00;
|
|
2276
|
-
out[12] = a11 * b07 - a10 * b09 - a12 * b06;
|
|
2277
|
-
out[13] = a00 * b09 - a01 * b07 + a02 * b06;
|
|
2278
|
-
out[14] = a31 * b01 - a30 * b03 - a32 * b00;
|
|
2279
|
-
out[15] = a20 * b03 - a21 * b01 + a22 * b00;
|
|
2280
|
-
return out;
|
|
2281
|
-
}
|
|
2282
1584
|
function determinant2(a) {
|
|
2283
1585
|
const a00 = a[0];
|
|
2284
1586
|
const a01 = a[1];
|
|
@@ -2308,7 +1610,7 @@ var __exports__ = (() => {
|
|
|
2308
1610
|
const b9 = a30 * b2 - a31 * b1 + a32 * b0;
|
|
2309
1611
|
return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;
|
|
2310
1612
|
}
|
|
2311
|
-
function
|
|
1613
|
+
function multiply2(out, a, b) {
|
|
2312
1614
|
const a00 = a[0];
|
|
2313
1615
|
const a01 = a[1];
|
|
2314
1616
|
const a02 = a[2];
|
|
@@ -2412,7 +1714,7 @@ var __exports__ = (() => {
|
|
|
2412
1714
|
}
|
|
2413
1715
|
return out;
|
|
2414
1716
|
}
|
|
2415
|
-
function
|
|
1717
|
+
function scale2(out, a, v) {
|
|
2416
1718
|
const x = v[0];
|
|
2417
1719
|
const y = v[1];
|
|
2418
1720
|
const z = v[2];
|
|
@@ -2607,207 +1909,6 @@ var __exports__ = (() => {
|
|
|
2607
1909
|
out[7] = a13 * c - a03 * s;
|
|
2608
1910
|
return out;
|
|
2609
1911
|
}
|
|
2610
|
-
function fromTranslation(out, v) {
|
|
2611
|
-
out[0] = 1;
|
|
2612
|
-
out[1] = 0;
|
|
2613
|
-
out[2] = 0;
|
|
2614
|
-
out[3] = 0;
|
|
2615
|
-
out[4] = 0;
|
|
2616
|
-
out[5] = 1;
|
|
2617
|
-
out[6] = 0;
|
|
2618
|
-
out[7] = 0;
|
|
2619
|
-
out[8] = 0;
|
|
2620
|
-
out[9] = 0;
|
|
2621
|
-
out[10] = 1;
|
|
2622
|
-
out[11] = 0;
|
|
2623
|
-
out[12] = v[0];
|
|
2624
|
-
out[13] = v[1];
|
|
2625
|
-
out[14] = v[2];
|
|
2626
|
-
out[15] = 1;
|
|
2627
|
-
return out;
|
|
2628
|
-
}
|
|
2629
|
-
function fromScaling(out, v) {
|
|
2630
|
-
out[0] = v[0];
|
|
2631
|
-
out[1] = 0;
|
|
2632
|
-
out[2] = 0;
|
|
2633
|
-
out[3] = 0;
|
|
2634
|
-
out[4] = 0;
|
|
2635
|
-
out[5] = v[1];
|
|
2636
|
-
out[6] = 0;
|
|
2637
|
-
out[7] = 0;
|
|
2638
|
-
out[8] = 0;
|
|
2639
|
-
out[9] = 0;
|
|
2640
|
-
out[10] = v[2];
|
|
2641
|
-
out[11] = 0;
|
|
2642
|
-
out[12] = 0;
|
|
2643
|
-
out[13] = 0;
|
|
2644
|
-
out[14] = 0;
|
|
2645
|
-
out[15] = 1;
|
|
2646
|
-
return out;
|
|
2647
|
-
}
|
|
2648
|
-
function fromRotation(out, rad, axis) {
|
|
2649
|
-
let x = axis[0];
|
|
2650
|
-
let y = axis[1];
|
|
2651
|
-
let z = axis[2];
|
|
2652
|
-
let len2 = Math.sqrt(x * x + y * y + z * z);
|
|
2653
|
-
let c;
|
|
2654
|
-
let s;
|
|
2655
|
-
let t;
|
|
2656
|
-
if (len2 < EPSILON) {
|
|
2657
|
-
return null;
|
|
2658
|
-
}
|
|
2659
|
-
len2 = 1 / len2;
|
|
2660
|
-
x *= len2;
|
|
2661
|
-
y *= len2;
|
|
2662
|
-
z *= len2;
|
|
2663
|
-
s = Math.sin(rad);
|
|
2664
|
-
c = Math.cos(rad);
|
|
2665
|
-
t = 1 - c;
|
|
2666
|
-
out[0] = x * x * t + c;
|
|
2667
|
-
out[1] = y * x * t + z * s;
|
|
2668
|
-
out[2] = z * x * t - y * s;
|
|
2669
|
-
out[3] = 0;
|
|
2670
|
-
out[4] = x * y * t - z * s;
|
|
2671
|
-
out[5] = y * y * t + c;
|
|
2672
|
-
out[6] = z * y * t + x * s;
|
|
2673
|
-
out[7] = 0;
|
|
2674
|
-
out[8] = x * z * t + y * s;
|
|
2675
|
-
out[9] = y * z * t - x * s;
|
|
2676
|
-
out[10] = z * z * t + c;
|
|
2677
|
-
out[11] = 0;
|
|
2678
|
-
out[12] = 0;
|
|
2679
|
-
out[13] = 0;
|
|
2680
|
-
out[14] = 0;
|
|
2681
|
-
out[15] = 1;
|
|
2682
|
-
return out;
|
|
2683
|
-
}
|
|
2684
|
-
function fromXRotation(out, rad) {
|
|
2685
|
-
const s = Math.sin(rad);
|
|
2686
|
-
const c = Math.cos(rad);
|
|
2687
|
-
out[0] = 1;
|
|
2688
|
-
out[1] = 0;
|
|
2689
|
-
out[2] = 0;
|
|
2690
|
-
out[3] = 0;
|
|
2691
|
-
out[4] = 0;
|
|
2692
|
-
out[5] = c;
|
|
2693
|
-
out[6] = s;
|
|
2694
|
-
out[7] = 0;
|
|
2695
|
-
out[8] = 0;
|
|
2696
|
-
out[9] = -s;
|
|
2697
|
-
out[10] = c;
|
|
2698
|
-
out[11] = 0;
|
|
2699
|
-
out[12] = 0;
|
|
2700
|
-
out[13] = 0;
|
|
2701
|
-
out[14] = 0;
|
|
2702
|
-
out[15] = 1;
|
|
2703
|
-
return out;
|
|
2704
|
-
}
|
|
2705
|
-
function fromYRotation(out, rad) {
|
|
2706
|
-
const s = Math.sin(rad);
|
|
2707
|
-
const c = Math.cos(rad);
|
|
2708
|
-
out[0] = c;
|
|
2709
|
-
out[1] = 0;
|
|
2710
|
-
out[2] = -s;
|
|
2711
|
-
out[3] = 0;
|
|
2712
|
-
out[4] = 0;
|
|
2713
|
-
out[5] = 1;
|
|
2714
|
-
out[6] = 0;
|
|
2715
|
-
out[7] = 0;
|
|
2716
|
-
out[8] = s;
|
|
2717
|
-
out[9] = 0;
|
|
2718
|
-
out[10] = c;
|
|
2719
|
-
out[11] = 0;
|
|
2720
|
-
out[12] = 0;
|
|
2721
|
-
out[13] = 0;
|
|
2722
|
-
out[14] = 0;
|
|
2723
|
-
out[15] = 1;
|
|
2724
|
-
return out;
|
|
2725
|
-
}
|
|
2726
|
-
function fromZRotation(out, rad) {
|
|
2727
|
-
const s = Math.sin(rad);
|
|
2728
|
-
const c = Math.cos(rad);
|
|
2729
|
-
out[0] = c;
|
|
2730
|
-
out[1] = s;
|
|
2731
|
-
out[2] = 0;
|
|
2732
|
-
out[3] = 0;
|
|
2733
|
-
out[4] = -s;
|
|
2734
|
-
out[5] = c;
|
|
2735
|
-
out[6] = 0;
|
|
2736
|
-
out[7] = 0;
|
|
2737
|
-
out[8] = 0;
|
|
2738
|
-
out[9] = 0;
|
|
2739
|
-
out[10] = 1;
|
|
2740
|
-
out[11] = 0;
|
|
2741
|
-
out[12] = 0;
|
|
2742
|
-
out[13] = 0;
|
|
2743
|
-
out[14] = 0;
|
|
2744
|
-
out[15] = 1;
|
|
2745
|
-
return out;
|
|
2746
|
-
}
|
|
2747
|
-
function fromRotationTranslation(out, q, v) {
|
|
2748
|
-
const x = q[0];
|
|
2749
|
-
const y = q[1];
|
|
2750
|
-
const z = q[2];
|
|
2751
|
-
const w = q[3];
|
|
2752
|
-
const x2 = x + x;
|
|
2753
|
-
const y2 = y + y;
|
|
2754
|
-
const z2 = z + z;
|
|
2755
|
-
const xx = x * x2;
|
|
2756
|
-
const xy = x * y2;
|
|
2757
|
-
const xz = x * z2;
|
|
2758
|
-
const yy = y * y2;
|
|
2759
|
-
const yz = y * z2;
|
|
2760
|
-
const zz = z * z2;
|
|
2761
|
-
const wx = w * x2;
|
|
2762
|
-
const wy = w * y2;
|
|
2763
|
-
const wz = w * z2;
|
|
2764
|
-
out[0] = 1 - (yy + zz);
|
|
2765
|
-
out[1] = xy + wz;
|
|
2766
|
-
out[2] = xz - wy;
|
|
2767
|
-
out[3] = 0;
|
|
2768
|
-
out[4] = xy - wz;
|
|
2769
|
-
out[5] = 1 - (xx + zz);
|
|
2770
|
-
out[6] = yz + wx;
|
|
2771
|
-
out[7] = 0;
|
|
2772
|
-
out[8] = xz + wy;
|
|
2773
|
-
out[9] = yz - wx;
|
|
2774
|
-
out[10] = 1 - (xx + yy);
|
|
2775
|
-
out[11] = 0;
|
|
2776
|
-
out[12] = v[0];
|
|
2777
|
-
out[13] = v[1];
|
|
2778
|
-
out[14] = v[2];
|
|
2779
|
-
out[15] = 1;
|
|
2780
|
-
return out;
|
|
2781
|
-
}
|
|
2782
|
-
function fromQuat2(out, a) {
|
|
2783
|
-
const translation = new ARRAY_TYPE(3);
|
|
2784
|
-
const bx = -a[0];
|
|
2785
|
-
const by = -a[1];
|
|
2786
|
-
const bz = -a[2];
|
|
2787
|
-
const bw = a[3];
|
|
2788
|
-
const ax = a[4];
|
|
2789
|
-
const ay = a[5];
|
|
2790
|
-
const az = a[6];
|
|
2791
|
-
const aw = a[7];
|
|
2792
|
-
const magnitude = bx * bx + by * by + bz * bz + bw * bw;
|
|
2793
|
-
if (magnitude > 0) {
|
|
2794
|
-
translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;
|
|
2795
|
-
translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;
|
|
2796
|
-
translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;
|
|
2797
|
-
} else {
|
|
2798
|
-
translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;
|
|
2799
|
-
translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;
|
|
2800
|
-
translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;
|
|
2801
|
-
}
|
|
2802
|
-
fromRotationTranslation(out, a, translation);
|
|
2803
|
-
return out;
|
|
2804
|
-
}
|
|
2805
|
-
function getTranslation(out, mat) {
|
|
2806
|
-
out[0] = mat[12];
|
|
2807
|
-
out[1] = mat[13];
|
|
2808
|
-
out[2] = mat[14];
|
|
2809
|
-
return out;
|
|
2810
|
-
}
|
|
2811
1912
|
function getScaling(out, mat) {
|
|
2812
1913
|
const m11 = mat[0];
|
|
2813
1914
|
const m12 = mat[1];
|
|
@@ -2823,196 +1924,7 @@ var __exports__ = (() => {
|
|
|
2823
1924
|
out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);
|
|
2824
1925
|
return out;
|
|
2825
1926
|
}
|
|
2826
|
-
function
|
|
2827
|
-
const scaling = new ARRAY_TYPE(3);
|
|
2828
|
-
getScaling(scaling, mat);
|
|
2829
|
-
const is1 = 1 / scaling[0];
|
|
2830
|
-
const is2 = 1 / scaling[1];
|
|
2831
|
-
const is3 = 1 / scaling[2];
|
|
2832
|
-
const sm11 = mat[0] * is1;
|
|
2833
|
-
const sm12 = mat[1] * is2;
|
|
2834
|
-
const sm13 = mat[2] * is3;
|
|
2835
|
-
const sm21 = mat[4] * is1;
|
|
2836
|
-
const sm22 = mat[5] * is2;
|
|
2837
|
-
const sm23 = mat[6] * is3;
|
|
2838
|
-
const sm31 = mat[8] * is1;
|
|
2839
|
-
const sm32 = mat[9] * is2;
|
|
2840
|
-
const sm33 = mat[10] * is3;
|
|
2841
|
-
const trace = sm11 + sm22 + sm33;
|
|
2842
|
-
let S = 0;
|
|
2843
|
-
if (trace > 0) {
|
|
2844
|
-
S = Math.sqrt(trace + 1) * 2;
|
|
2845
|
-
out[3] = 0.25 * S;
|
|
2846
|
-
out[0] = (sm23 - sm32) / S;
|
|
2847
|
-
out[1] = (sm31 - sm13) / S;
|
|
2848
|
-
out[2] = (sm12 - sm21) / S;
|
|
2849
|
-
} else if (sm11 > sm22 && sm11 > sm33) {
|
|
2850
|
-
S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;
|
|
2851
|
-
out[3] = (sm23 - sm32) / S;
|
|
2852
|
-
out[0] = 0.25 * S;
|
|
2853
|
-
out[1] = (sm12 + sm21) / S;
|
|
2854
|
-
out[2] = (sm31 + sm13) / S;
|
|
2855
|
-
} else if (sm22 > sm33) {
|
|
2856
|
-
S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;
|
|
2857
|
-
out[3] = (sm31 - sm13) / S;
|
|
2858
|
-
out[0] = (sm12 + sm21) / S;
|
|
2859
|
-
out[1] = 0.25 * S;
|
|
2860
|
-
out[2] = (sm23 + sm32) / S;
|
|
2861
|
-
} else {
|
|
2862
|
-
S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;
|
|
2863
|
-
out[3] = (sm12 - sm21) / S;
|
|
2864
|
-
out[0] = (sm31 + sm13) / S;
|
|
2865
|
-
out[1] = (sm23 + sm32) / S;
|
|
2866
|
-
out[2] = 0.25 * S;
|
|
2867
|
-
}
|
|
2868
|
-
return out;
|
|
2869
|
-
}
|
|
2870
|
-
function decompose(out_r, out_t, out_s, mat) {
|
|
2871
|
-
out_t[0] = mat[12];
|
|
2872
|
-
out_t[1] = mat[13];
|
|
2873
|
-
out_t[2] = mat[14];
|
|
2874
|
-
const m11 = mat[0];
|
|
2875
|
-
const m12 = mat[1];
|
|
2876
|
-
const m13 = mat[2];
|
|
2877
|
-
const m21 = mat[4];
|
|
2878
|
-
const m22 = mat[5];
|
|
2879
|
-
const m23 = mat[6];
|
|
2880
|
-
const m31 = mat[8];
|
|
2881
|
-
const m32 = mat[9];
|
|
2882
|
-
const m33 = mat[10];
|
|
2883
|
-
out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);
|
|
2884
|
-
out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);
|
|
2885
|
-
out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);
|
|
2886
|
-
const is1 = 1 / out_s[0];
|
|
2887
|
-
const is2 = 1 / out_s[1];
|
|
2888
|
-
const is3 = 1 / out_s[2];
|
|
2889
|
-
const sm11 = m11 * is1;
|
|
2890
|
-
const sm12 = m12 * is2;
|
|
2891
|
-
const sm13 = m13 * is3;
|
|
2892
|
-
const sm21 = m21 * is1;
|
|
2893
|
-
const sm22 = m22 * is2;
|
|
2894
|
-
const sm23 = m23 * is3;
|
|
2895
|
-
const sm31 = m31 * is1;
|
|
2896
|
-
const sm32 = m32 * is2;
|
|
2897
|
-
const sm33 = m33 * is3;
|
|
2898
|
-
const trace = sm11 + sm22 + sm33;
|
|
2899
|
-
let S = 0;
|
|
2900
|
-
if (trace > 0) {
|
|
2901
|
-
S = Math.sqrt(trace + 1) * 2;
|
|
2902
|
-
out_r[3] = 0.25 * S;
|
|
2903
|
-
out_r[0] = (sm23 - sm32) / S;
|
|
2904
|
-
out_r[1] = (sm31 - sm13) / S;
|
|
2905
|
-
out_r[2] = (sm12 - sm21) / S;
|
|
2906
|
-
} else if (sm11 > sm22 && sm11 > sm33) {
|
|
2907
|
-
S = Math.sqrt(1 + sm11 - sm22 - sm33) * 2;
|
|
2908
|
-
out_r[3] = (sm23 - sm32) / S;
|
|
2909
|
-
out_r[0] = 0.25 * S;
|
|
2910
|
-
out_r[1] = (sm12 + sm21) / S;
|
|
2911
|
-
out_r[2] = (sm31 + sm13) / S;
|
|
2912
|
-
} else if (sm22 > sm33) {
|
|
2913
|
-
S = Math.sqrt(1 + sm22 - sm11 - sm33) * 2;
|
|
2914
|
-
out_r[3] = (sm31 - sm13) / S;
|
|
2915
|
-
out_r[0] = (sm12 + sm21) / S;
|
|
2916
|
-
out_r[1] = 0.25 * S;
|
|
2917
|
-
out_r[2] = (sm23 + sm32) / S;
|
|
2918
|
-
} else {
|
|
2919
|
-
S = Math.sqrt(1 + sm33 - sm11 - sm22) * 2;
|
|
2920
|
-
out_r[3] = (sm12 - sm21) / S;
|
|
2921
|
-
out_r[0] = (sm31 + sm13) / S;
|
|
2922
|
-
out_r[1] = (sm23 + sm32) / S;
|
|
2923
|
-
out_r[2] = 0.25 * S;
|
|
2924
|
-
}
|
|
2925
|
-
return out_r;
|
|
2926
|
-
}
|
|
2927
|
-
function fromRotationTranslationScale(out, q, v, s) {
|
|
2928
|
-
const x = q[0];
|
|
2929
|
-
const y = q[1];
|
|
2930
|
-
const z = q[2];
|
|
2931
|
-
const w = q[3];
|
|
2932
|
-
const x2 = x + x;
|
|
2933
|
-
const y2 = y + y;
|
|
2934
|
-
const z2 = z + z;
|
|
2935
|
-
const xx = x * x2;
|
|
2936
|
-
const xy = x * y2;
|
|
2937
|
-
const xz = x * z2;
|
|
2938
|
-
const yy = y * y2;
|
|
2939
|
-
const yz = y * z2;
|
|
2940
|
-
const zz = z * z2;
|
|
2941
|
-
const wx = w * x2;
|
|
2942
|
-
const wy = w * y2;
|
|
2943
|
-
const wz = w * z2;
|
|
2944
|
-
const sx = s[0];
|
|
2945
|
-
const sy = s[1];
|
|
2946
|
-
const sz = s[2];
|
|
2947
|
-
out[0] = (1 - (yy + zz)) * sx;
|
|
2948
|
-
out[1] = (xy + wz) * sx;
|
|
2949
|
-
out[2] = (xz - wy) * sx;
|
|
2950
|
-
out[3] = 0;
|
|
2951
|
-
out[4] = (xy - wz) * sy;
|
|
2952
|
-
out[5] = (1 - (xx + zz)) * sy;
|
|
2953
|
-
out[6] = (yz + wx) * sy;
|
|
2954
|
-
out[7] = 0;
|
|
2955
|
-
out[8] = (xz + wy) * sz;
|
|
2956
|
-
out[9] = (yz - wx) * sz;
|
|
2957
|
-
out[10] = (1 - (xx + yy)) * sz;
|
|
2958
|
-
out[11] = 0;
|
|
2959
|
-
out[12] = v[0];
|
|
2960
|
-
out[13] = v[1];
|
|
2961
|
-
out[14] = v[2];
|
|
2962
|
-
out[15] = 1;
|
|
2963
|
-
return out;
|
|
2964
|
-
}
|
|
2965
|
-
function fromRotationTranslationScaleOrigin(out, q, v, s, o) {
|
|
2966
|
-
const x = q[0];
|
|
2967
|
-
const y = q[1];
|
|
2968
|
-
const z = q[2];
|
|
2969
|
-
const w = q[3];
|
|
2970
|
-
const x2 = x + x;
|
|
2971
|
-
const y2 = y + y;
|
|
2972
|
-
const z2 = z + z;
|
|
2973
|
-
const xx = x * x2;
|
|
2974
|
-
const xy = x * y2;
|
|
2975
|
-
const xz = x * z2;
|
|
2976
|
-
const yy = y * y2;
|
|
2977
|
-
const yz = y * z2;
|
|
2978
|
-
const zz = z * z2;
|
|
2979
|
-
const wx = w * x2;
|
|
2980
|
-
const wy = w * y2;
|
|
2981
|
-
const wz = w * z2;
|
|
2982
|
-
const sx = s[0];
|
|
2983
|
-
const sy = s[1];
|
|
2984
|
-
const sz = s[2];
|
|
2985
|
-
const ox = o[0];
|
|
2986
|
-
const oy = o[1];
|
|
2987
|
-
const oz = o[2];
|
|
2988
|
-
const out0 = (1 - (yy + zz)) * sx;
|
|
2989
|
-
const out1 = (xy + wz) * sx;
|
|
2990
|
-
const out2 = (xz - wy) * sx;
|
|
2991
|
-
const out4 = (xy - wz) * sy;
|
|
2992
|
-
const out5 = (1 - (xx + zz)) * sy;
|
|
2993
|
-
const out6 = (yz + wx) * sy;
|
|
2994
|
-
const out8 = (xz + wy) * sz;
|
|
2995
|
-
const out9 = (yz - wx) * sz;
|
|
2996
|
-
const out10 = (1 - (xx + yy)) * sz;
|
|
2997
|
-
out[0] = out0;
|
|
2998
|
-
out[1] = out1;
|
|
2999
|
-
out[2] = out2;
|
|
3000
|
-
out[3] = 0;
|
|
3001
|
-
out[4] = out4;
|
|
3002
|
-
out[5] = out5;
|
|
3003
|
-
out[6] = out6;
|
|
3004
|
-
out[7] = 0;
|
|
3005
|
-
out[8] = out8;
|
|
3006
|
-
out[9] = out9;
|
|
3007
|
-
out[10] = out10;
|
|
3008
|
-
out[11] = 0;
|
|
3009
|
-
out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);
|
|
3010
|
-
out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);
|
|
3011
|
-
out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);
|
|
3012
|
-
out[15] = 1;
|
|
3013
|
-
return out;
|
|
3014
|
-
}
|
|
3015
|
-
function fromQuat3(out, q) {
|
|
1927
|
+
function fromQuat2(out, q) {
|
|
3016
1928
|
const x = q[0];
|
|
3017
1929
|
const y = q[1];
|
|
3018
1930
|
const z = q[2];
|
|
@@ -3096,57 +2008,6 @@ var __exports__ = (() => {
|
|
|
3096
2008
|
return out;
|
|
3097
2009
|
}
|
|
3098
2010
|
var perspective = perspectiveNO;
|
|
3099
|
-
function perspectiveZO(out, fovy, aspect, near, far) {
|
|
3100
|
-
const f = 1 / Math.tan(fovy / 2);
|
|
3101
|
-
out[0] = f / aspect;
|
|
3102
|
-
out[1] = 0;
|
|
3103
|
-
out[2] = 0;
|
|
3104
|
-
out[3] = 0;
|
|
3105
|
-
out[4] = 0;
|
|
3106
|
-
out[5] = f;
|
|
3107
|
-
out[6] = 0;
|
|
3108
|
-
out[7] = 0;
|
|
3109
|
-
out[8] = 0;
|
|
3110
|
-
out[9] = 0;
|
|
3111
|
-
out[11] = -1;
|
|
3112
|
-
out[12] = 0;
|
|
3113
|
-
out[13] = 0;
|
|
3114
|
-
out[15] = 0;
|
|
3115
|
-
if (far != null && far !== Infinity) {
|
|
3116
|
-
const nf = 1 / (near - far);
|
|
3117
|
-
out[10] = far * nf;
|
|
3118
|
-
out[14] = far * near * nf;
|
|
3119
|
-
} else {
|
|
3120
|
-
out[10] = -1;
|
|
3121
|
-
out[14] = -near;
|
|
3122
|
-
}
|
|
3123
|
-
return out;
|
|
3124
|
-
}
|
|
3125
|
-
function perspectiveFromFieldOfView(out, fov, near, far) {
|
|
3126
|
-
const upTan = Math.tan(fov.upDegrees * Math.PI / 180);
|
|
3127
|
-
const downTan = Math.tan(fov.downDegrees * Math.PI / 180);
|
|
3128
|
-
const leftTan = Math.tan(fov.leftDegrees * Math.PI / 180);
|
|
3129
|
-
const rightTan = Math.tan(fov.rightDegrees * Math.PI / 180);
|
|
3130
|
-
const xScale = 2 / (leftTan + rightTan);
|
|
3131
|
-
const yScale = 2 / (upTan + downTan);
|
|
3132
|
-
out[0] = xScale;
|
|
3133
|
-
out[1] = 0;
|
|
3134
|
-
out[2] = 0;
|
|
3135
|
-
out[3] = 0;
|
|
3136
|
-
out[4] = 0;
|
|
3137
|
-
out[5] = yScale;
|
|
3138
|
-
out[6] = 0;
|
|
3139
|
-
out[7] = 0;
|
|
3140
|
-
out[8] = -((leftTan - rightTan) * xScale * 0.5);
|
|
3141
|
-
out[9] = (upTan - downTan) * yScale * 0.5;
|
|
3142
|
-
out[10] = far / (near - far);
|
|
3143
|
-
out[11] = -1;
|
|
3144
|
-
out[12] = 0;
|
|
3145
|
-
out[13] = 0;
|
|
3146
|
-
out[14] = far * near / (near - far);
|
|
3147
|
-
out[15] = 0;
|
|
3148
|
-
return out;
|
|
3149
|
-
}
|
|
3150
2011
|
function orthoNO(out, left, right, bottom, top, near, far) {
|
|
3151
2012
|
const lr = 1 / (left - right);
|
|
3152
2013
|
const bt = 1 / (bottom - top);
|
|
@@ -3170,28 +2031,6 @@ var __exports__ = (() => {
|
|
|
3170
2031
|
return out;
|
|
3171
2032
|
}
|
|
3172
2033
|
var ortho = orthoNO;
|
|
3173
|
-
function orthoZO(out, left, right, bottom, top, near, far) {
|
|
3174
|
-
const lr = 1 / (left - right);
|
|
3175
|
-
const bt = 1 / (bottom - top);
|
|
3176
|
-
const nf = 1 / (near - far);
|
|
3177
|
-
out[0] = -2 * lr;
|
|
3178
|
-
out[1] = 0;
|
|
3179
|
-
out[2] = 0;
|
|
3180
|
-
out[3] = 0;
|
|
3181
|
-
out[4] = 0;
|
|
3182
|
-
out[5] = -2 * bt;
|
|
3183
|
-
out[6] = 0;
|
|
3184
|
-
out[7] = 0;
|
|
3185
|
-
out[8] = 0;
|
|
3186
|
-
out[9] = 0;
|
|
3187
|
-
out[10] = nf;
|
|
3188
|
-
out[11] = 0;
|
|
3189
|
-
out[12] = (left + right) * lr;
|
|
3190
|
-
out[13] = (top + bottom) * bt;
|
|
3191
|
-
out[14] = near * nf;
|
|
3192
|
-
out[15] = 1;
|
|
3193
|
-
return out;
|
|
3194
|
-
}
|
|
3195
2034
|
function lookAt(out, eye, center, up) {
|
|
3196
2035
|
let len2;
|
|
3197
2036
|
let x0;
|
|
@@ -3268,193 +2107,16 @@ var __exports__ = (() => {
|
|
|
3268
2107
|
out[15] = 1;
|
|
3269
2108
|
return out;
|
|
3270
2109
|
}
|
|
3271
|
-
function targetTo(out, eye, target, up) {
|
|
3272
|
-
const eyex = eye[0];
|
|
3273
|
-
const eyey = eye[1];
|
|
3274
|
-
const eyez = eye[2];
|
|
3275
|
-
const upx = up[0];
|
|
3276
|
-
const upy = up[1];
|
|
3277
|
-
const upz = up[2];
|
|
3278
|
-
let z0 = eyex - target[0];
|
|
3279
|
-
let z1 = eyey - target[1];
|
|
3280
|
-
let z2 = eyez - target[2];
|
|
3281
|
-
let len2 = z0 * z0 + z1 * z1 + z2 * z2;
|
|
3282
|
-
if (len2 > 0) {
|
|
3283
|
-
len2 = 1 / Math.sqrt(len2);
|
|
3284
|
-
z0 *= len2;
|
|
3285
|
-
z1 *= len2;
|
|
3286
|
-
z2 *= len2;
|
|
3287
|
-
}
|
|
3288
|
-
let x0 = upy * z2 - upz * z1;
|
|
3289
|
-
let x1 = upz * z0 - upx * z2;
|
|
3290
|
-
let x2 = upx * z1 - upy * z0;
|
|
3291
|
-
len2 = x0 * x0 + x1 * x1 + x2 * x2;
|
|
3292
|
-
if (len2 > 0) {
|
|
3293
|
-
len2 = 1 / Math.sqrt(len2);
|
|
3294
|
-
x0 *= len2;
|
|
3295
|
-
x1 *= len2;
|
|
3296
|
-
x2 *= len2;
|
|
3297
|
-
}
|
|
3298
|
-
out[0] = x0;
|
|
3299
|
-
out[1] = x1;
|
|
3300
|
-
out[2] = x2;
|
|
3301
|
-
out[3] = 0;
|
|
3302
|
-
out[4] = z1 * x2 - z2 * x1;
|
|
3303
|
-
out[5] = z2 * x0 - z0 * x2;
|
|
3304
|
-
out[6] = z0 * x1 - z1 * x0;
|
|
3305
|
-
out[7] = 0;
|
|
3306
|
-
out[8] = z0;
|
|
3307
|
-
out[9] = z1;
|
|
3308
|
-
out[10] = z2;
|
|
3309
|
-
out[11] = 0;
|
|
3310
|
-
out[12] = eyex;
|
|
3311
|
-
out[13] = eyey;
|
|
3312
|
-
out[14] = eyez;
|
|
3313
|
-
out[15] = 1;
|
|
3314
|
-
return out;
|
|
3315
|
-
}
|
|
3316
|
-
function str2(a) {
|
|
3317
|
-
return `mat4(${a[0]}, ${a[1]}, ${a[2]}, ${a[3]}, ${a[4]}, ${a[5]}, ${a[6]}, ${a[7]}, ${a[8]}, ${a[9]}, ${a[10]}, ${a[11]}, ${a[12]}, ${a[13]}, ${a[14]}, ${a[15]})`;
|
|
3318
|
-
}
|
|
3319
|
-
function frob(a) {
|
|
3320
|
-
return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]);
|
|
3321
|
-
}
|
|
3322
|
-
function add2(out, a, b) {
|
|
3323
|
-
out[0] = a[0] + b[0];
|
|
3324
|
-
out[1] = a[1] + b[1];
|
|
3325
|
-
out[2] = a[2] + b[2];
|
|
3326
|
-
out[3] = a[3] + b[3];
|
|
3327
|
-
out[4] = a[4] + b[4];
|
|
3328
|
-
out[5] = a[5] + b[5];
|
|
3329
|
-
out[6] = a[6] + b[6];
|
|
3330
|
-
out[7] = a[7] + b[7];
|
|
3331
|
-
out[8] = a[8] + b[8];
|
|
3332
|
-
out[9] = a[9] + b[9];
|
|
3333
|
-
out[10] = a[10] + b[10];
|
|
3334
|
-
out[11] = a[11] + b[11];
|
|
3335
|
-
out[12] = a[12] + b[12];
|
|
3336
|
-
out[13] = a[13] + b[13];
|
|
3337
|
-
out[14] = a[14] + b[14];
|
|
3338
|
-
out[15] = a[15] + b[15];
|
|
3339
|
-
return out;
|
|
3340
|
-
}
|
|
3341
|
-
function subtract2(out, a, b) {
|
|
3342
|
-
out[0] = a[0] - b[0];
|
|
3343
|
-
out[1] = a[1] - b[1];
|
|
3344
|
-
out[2] = a[2] - b[2];
|
|
3345
|
-
out[3] = a[3] - b[3];
|
|
3346
|
-
out[4] = a[4] - b[4];
|
|
3347
|
-
out[5] = a[5] - b[5];
|
|
3348
|
-
out[6] = a[6] - b[6];
|
|
3349
|
-
out[7] = a[7] - b[7];
|
|
3350
|
-
out[8] = a[8] - b[8];
|
|
3351
|
-
out[9] = a[9] - b[9];
|
|
3352
|
-
out[10] = a[10] - b[10];
|
|
3353
|
-
out[11] = a[11] - b[11];
|
|
3354
|
-
out[12] = a[12] - b[12];
|
|
3355
|
-
out[13] = a[13] - b[13];
|
|
3356
|
-
out[14] = a[14] - b[14];
|
|
3357
|
-
out[15] = a[15] - b[15];
|
|
3358
|
-
return out;
|
|
3359
|
-
}
|
|
3360
|
-
function multiplyScalar(out, a, b) {
|
|
3361
|
-
out[0] = a[0] * b;
|
|
3362
|
-
out[1] = a[1] * b;
|
|
3363
|
-
out[2] = a[2] * b;
|
|
3364
|
-
out[3] = a[3] * b;
|
|
3365
|
-
out[4] = a[4] * b;
|
|
3366
|
-
out[5] = a[5] * b;
|
|
3367
|
-
out[6] = a[6] * b;
|
|
3368
|
-
out[7] = a[7] * b;
|
|
3369
|
-
out[8] = a[8] * b;
|
|
3370
|
-
out[9] = a[9] * b;
|
|
3371
|
-
out[10] = a[10] * b;
|
|
3372
|
-
out[11] = a[11] * b;
|
|
3373
|
-
out[12] = a[12] * b;
|
|
3374
|
-
out[13] = a[13] * b;
|
|
3375
|
-
out[14] = a[14] * b;
|
|
3376
|
-
out[15] = a[15] * b;
|
|
3377
|
-
return out;
|
|
3378
|
-
}
|
|
3379
|
-
function multiplyScalarAndAdd(out, a, b, scale6) {
|
|
3380
|
-
out[0] = a[0] + b[0] * scale6;
|
|
3381
|
-
out[1] = a[1] + b[1] * scale6;
|
|
3382
|
-
out[2] = a[2] + b[2] * scale6;
|
|
3383
|
-
out[3] = a[3] + b[3] * scale6;
|
|
3384
|
-
out[4] = a[4] + b[4] * scale6;
|
|
3385
|
-
out[5] = a[5] + b[5] * scale6;
|
|
3386
|
-
out[6] = a[6] + b[6] * scale6;
|
|
3387
|
-
out[7] = a[7] + b[7] * scale6;
|
|
3388
|
-
out[8] = a[8] + b[8] * scale6;
|
|
3389
|
-
out[9] = a[9] + b[9] * scale6;
|
|
3390
|
-
out[10] = a[10] + b[10] * scale6;
|
|
3391
|
-
out[11] = a[11] + b[11] * scale6;
|
|
3392
|
-
out[12] = a[12] + b[12] * scale6;
|
|
3393
|
-
out[13] = a[13] + b[13] * scale6;
|
|
3394
|
-
out[14] = a[14] + b[14] * scale6;
|
|
3395
|
-
out[15] = a[15] + b[15] * scale6;
|
|
3396
|
-
return out;
|
|
3397
|
-
}
|
|
3398
|
-
function exactEquals2(a, b) {
|
|
3399
|
-
return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];
|
|
3400
|
-
}
|
|
3401
|
-
function equals3(a, b) {
|
|
3402
|
-
const a0 = a[0];
|
|
3403
|
-
const a1 = a[1];
|
|
3404
|
-
const a2 = a[2];
|
|
3405
|
-
const a3 = a[3];
|
|
3406
|
-
const a4 = a[4];
|
|
3407
|
-
const a5 = a[5];
|
|
3408
|
-
const a6 = a[6];
|
|
3409
|
-
const a7 = a[7];
|
|
3410
|
-
const a8 = a[8];
|
|
3411
|
-
const a9 = a[9];
|
|
3412
|
-
const a10 = a[10];
|
|
3413
|
-
const a11 = a[11];
|
|
3414
|
-
const a12 = a[12];
|
|
3415
|
-
const a13 = a[13];
|
|
3416
|
-
const a14 = a[14];
|
|
3417
|
-
const a15 = a[15];
|
|
3418
|
-
const b0 = b[0];
|
|
3419
|
-
const b1 = b[1];
|
|
3420
|
-
const b2 = b[2];
|
|
3421
|
-
const b3 = b[3];
|
|
3422
|
-
const b4 = b[4];
|
|
3423
|
-
const b5 = b[5];
|
|
3424
|
-
const b6 = b[6];
|
|
3425
|
-
const b7 = b[7];
|
|
3426
|
-
const b8 = b[8];
|
|
3427
|
-
const b9 = b[9];
|
|
3428
|
-
const b10 = b[10];
|
|
3429
|
-
const b11 = b[11];
|
|
3430
|
-
const b12 = b[12];
|
|
3431
|
-
const b13 = b[13];
|
|
3432
|
-
const b14 = b[14];
|
|
3433
|
-
const b15 = b[15];
|
|
3434
|
-
return Math.abs(a0 - b0) <= EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= EPSILON * Math.max(1, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= EPSILON * Math.max(1, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= EPSILON * Math.max(1, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= EPSILON * Math.max(1, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= EPSILON * Math.max(1, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= EPSILON * Math.max(1, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= EPSILON * Math.max(1, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= EPSILON * Math.max(1, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= EPSILON * Math.max(1, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= EPSILON * Math.max(1, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= EPSILON * Math.max(1, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= EPSILON * Math.max(1, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= EPSILON * Math.max(1, Math.abs(a15), Math.abs(b15));
|
|
3435
|
-
}
|
|
3436
|
-
var mul2 = multiply3;
|
|
3437
|
-
var sub2 = subtract2;
|
|
3438
2110
|
|
|
3439
2111
|
// ../../node_modules/@math.gl/core/dist/gl-matrix/vec4.js
|
|
3440
|
-
function
|
|
3441
|
-
const out = new ARRAY_TYPE(4);
|
|
3442
|
-
if (ARRAY_TYPE !== Float32Array) {
|
|
3443
|
-
out[0] = 0;
|
|
3444
|
-
out[1] = 0;
|
|
3445
|
-
out[2] = 0;
|
|
3446
|
-
out[3] = 0;
|
|
3447
|
-
}
|
|
3448
|
-
return out;
|
|
3449
|
-
}
|
|
3450
|
-
function add3(out, a, b) {
|
|
2112
|
+
function add(out, a, b) {
|
|
3451
2113
|
out[0] = a[0] + b[0];
|
|
3452
2114
|
out[1] = a[1] + b[1];
|
|
3453
2115
|
out[2] = a[2] + b[2];
|
|
3454
2116
|
out[3] = a[3] + b[3];
|
|
3455
2117
|
return out;
|
|
3456
2118
|
}
|
|
3457
|
-
function
|
|
2119
|
+
function scale3(out, a, b) {
|
|
3458
2120
|
out[0] = a[0] * b;
|
|
3459
2121
|
out[1] = a[1] * b;
|
|
3460
2122
|
out[2] = a[2] * b;
|
|
@@ -3468,7 +2130,7 @@ var __exports__ = (() => {
|
|
|
3468
2130
|
const w = a[3];
|
|
3469
2131
|
return Math.sqrt(x * x + y * y + z * z + w * w);
|
|
3470
2132
|
}
|
|
3471
|
-
function
|
|
2133
|
+
function squaredLength(a) {
|
|
3472
2134
|
const x = a[0];
|
|
3473
2135
|
const y = a[1];
|
|
3474
2136
|
const z = a[2];
|
|
@@ -3493,7 +2155,7 @@ var __exports__ = (() => {
|
|
|
3493
2155
|
function dot2(a, b) {
|
|
3494
2156
|
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
|
|
3495
2157
|
}
|
|
3496
|
-
function
|
|
2158
|
+
function lerp(out, a, b, t) {
|
|
3497
2159
|
const ax = a[0];
|
|
3498
2160
|
const ay = a[1];
|
|
3499
2161
|
const az = a[2];
|
|
@@ -3515,54 +2177,6 @@ var __exports__ = (() => {
|
|
|
3515
2177
|
out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;
|
|
3516
2178
|
return out;
|
|
3517
2179
|
}
|
|
3518
|
-
function transformQuat2(out, a, q) {
|
|
3519
|
-
const x = a[0];
|
|
3520
|
-
const y = a[1];
|
|
3521
|
-
const z = a[2];
|
|
3522
|
-
const qx = q[0];
|
|
3523
|
-
const qy = q[1];
|
|
3524
|
-
const qz = q[2];
|
|
3525
|
-
const qw = q[3];
|
|
3526
|
-
const ix = qw * x + qy * z - qz * y;
|
|
3527
|
-
const iy = qw * y + qz * x - qx * z;
|
|
3528
|
-
const iz = qw * z + qx * y - qy * x;
|
|
3529
|
-
const iw = -qx * x - qy * y - qz * z;
|
|
3530
|
-
out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;
|
|
3531
|
-
out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;
|
|
3532
|
-
out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;
|
|
3533
|
-
out[3] = a[3];
|
|
3534
|
-
return out;
|
|
3535
|
-
}
|
|
3536
|
-
var forEach3 = (function() {
|
|
3537
|
-
const vec = create5();
|
|
3538
|
-
return function(a, stride, offset, count, fn, arg) {
|
|
3539
|
-
let i;
|
|
3540
|
-
let l;
|
|
3541
|
-
if (!stride) {
|
|
3542
|
-
stride = 4;
|
|
3543
|
-
}
|
|
3544
|
-
if (!offset) {
|
|
3545
|
-
offset = 0;
|
|
3546
|
-
}
|
|
3547
|
-
if (count) {
|
|
3548
|
-
l = Math.min(count * stride + offset, a.length);
|
|
3549
|
-
} else {
|
|
3550
|
-
l = a.length;
|
|
3551
|
-
}
|
|
3552
|
-
for (i = offset; i < l; i += stride) {
|
|
3553
|
-
vec[0] = a[i];
|
|
3554
|
-
vec[1] = a[i + 1];
|
|
3555
|
-
vec[2] = a[i + 2];
|
|
3556
|
-
vec[3] = a[i + 3];
|
|
3557
|
-
fn(vec, vec, arg);
|
|
3558
|
-
a[i] = vec[0];
|
|
3559
|
-
a[i + 1] = vec[1];
|
|
3560
|
-
a[i + 2] = vec[2];
|
|
3561
|
-
a[i + 3] = vec[3];
|
|
3562
|
-
}
|
|
3563
|
-
return a;
|
|
3564
|
-
};
|
|
3565
|
-
})();
|
|
3566
2180
|
|
|
3567
2181
|
// ../../node_modules/@math.gl/core/dist/classes/matrix4.js
|
|
3568
2182
|
var INDICES2;
|
|
@@ -3712,9 +2326,17 @@ var __exports__ = (() => {
|
|
|
3712
2326
|
* @returns self
|
|
3713
2327
|
*/
|
|
3714
2328
|
fromQuaternion(quaternion) {
|
|
3715
|
-
|
|
2329
|
+
fromQuat2(this, quaternion);
|
|
3716
2330
|
return this.check();
|
|
3717
2331
|
}
|
|
2332
|
+
/**
|
|
2333
|
+
* Sets this matrix from a 3x3 matrix, with zero translation.
|
|
2334
|
+
* @param matrix3 - 3x3 matrix in column-major order.
|
|
2335
|
+
* @returns This matrix.
|
|
2336
|
+
*/
|
|
2337
|
+
fromMatrix3(matrix3) {
|
|
2338
|
+
return this.set(matrix3[0], matrix3[1], matrix3[2], 0, matrix3[3], matrix3[4], matrix3[5], 0, matrix3[6], matrix3[7], matrix3[8], 0, 0, 0, 0, 1);
|
|
2339
|
+
}
|
|
3718
2340
|
/**
|
|
3719
2341
|
* Generates a frustum matrix with the given bounds
|
|
3720
2342
|
* @param view.left - Left bound of the frustum
|
|
@@ -3838,10 +2460,10 @@ var __exports__ = (() => {
|
|
|
3838
2460
|
getRotation(result, scaleResult) {
|
|
3839
2461
|
result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];
|
|
3840
2462
|
scaleResult = scaleResult || [-0, -0, -0];
|
|
3841
|
-
const
|
|
3842
|
-
const inverseScale0 = 1 /
|
|
3843
|
-
const inverseScale1 = 1 /
|
|
3844
|
-
const inverseScale2 = 1 /
|
|
2463
|
+
const scale5 = this.getScale(scaleResult);
|
|
2464
|
+
const inverseScale0 = 1 / scale5[0];
|
|
2465
|
+
const inverseScale1 = 1 / scale5[1];
|
|
2466
|
+
const inverseScale2 = 1 / scale5[2];
|
|
3845
2467
|
result[0] = this[0] * inverseScale0;
|
|
3846
2468
|
result[1] = this[1] * inverseScale1;
|
|
3847
2469
|
result[2] = this[2] * inverseScale2;
|
|
@@ -3869,10 +2491,10 @@ var __exports__ = (() => {
|
|
|
3869
2491
|
getRotationMatrix3(result, scaleResult) {
|
|
3870
2492
|
result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];
|
|
3871
2493
|
scaleResult = scaleResult || [-0, -0, -0];
|
|
3872
|
-
const
|
|
3873
|
-
const inverseScale0 = 1 /
|
|
3874
|
-
const inverseScale1 = 1 /
|
|
3875
|
-
const inverseScale2 = 1 /
|
|
2494
|
+
const scale5 = this.getScale(scaleResult);
|
|
2495
|
+
const inverseScale0 = 1 / scale5[0];
|
|
2496
|
+
const inverseScale1 = 1 / scale5[1];
|
|
2497
|
+
const inverseScale2 = 1 / scale5[2];
|
|
3876
2498
|
result[0] = this[0] * inverseScale0;
|
|
3877
2499
|
result[1] = this[1] * inverseScale1;
|
|
3878
2500
|
result[2] = this[2] * inverseScale2;
|
|
@@ -3895,11 +2517,11 @@ var __exports__ = (() => {
|
|
|
3895
2517
|
}
|
|
3896
2518
|
// Operations
|
|
3897
2519
|
multiplyLeft(a) {
|
|
3898
|
-
|
|
2520
|
+
multiply2(this, a, this);
|
|
3899
2521
|
return this.check();
|
|
3900
2522
|
}
|
|
3901
2523
|
multiplyRight(a) {
|
|
3902
|
-
|
|
2524
|
+
multiply2(this, this, a);
|
|
3903
2525
|
return this.check();
|
|
3904
2526
|
}
|
|
3905
2527
|
// Rotates a matrix by the given angle around the X axis
|
|
@@ -3945,7 +2567,7 @@ var __exports__ = (() => {
|
|
|
3945
2567
|
* @returns self
|
|
3946
2568
|
*/
|
|
3947
2569
|
scale(factor) {
|
|
3948
|
-
|
|
2570
|
+
scale2(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);
|
|
3949
2571
|
return this.check();
|
|
3950
2572
|
}
|
|
3951
2573
|
/**
|
|
@@ -4015,18 +2637,6 @@ var __exports__ = (() => {
|
|
|
4015
2637
|
checkVector(out, vector.length);
|
|
4016
2638
|
return out;
|
|
4017
2639
|
}
|
|
4018
|
-
/** @deprecated */
|
|
4019
|
-
transformPoint(vector, result) {
|
|
4020
|
-
return this.transformAsPoint(vector, result);
|
|
4021
|
-
}
|
|
4022
|
-
/** @deprecated */
|
|
4023
|
-
transformVector(vector, result) {
|
|
4024
|
-
return this.transformAsPoint(vector, result);
|
|
4025
|
-
}
|
|
4026
|
-
/** @deprecated */
|
|
4027
|
-
transformDirection(vector, result) {
|
|
4028
|
-
return this.transformAsVector(vector, result);
|
|
4029
|
-
}
|
|
4030
2640
|
// three.js math API compatibility
|
|
4031
2641
|
makeRotationX(radians2) {
|
|
4032
2642
|
return this.identity().rotateX(radians2);
|
|
@@ -4035,14 +2645,14 @@ var __exports__ = (() => {
|
|
|
4035
2645
|
return this.identity().translate([x, y, z]);
|
|
4036
2646
|
}
|
|
4037
2647
|
};
|
|
4038
|
-
var
|
|
2648
|
+
var ZERO2;
|
|
4039
2649
|
var IDENTITY;
|
|
4040
2650
|
function getZeroMatrix2() {
|
|
4041
|
-
if (!
|
|
4042
|
-
|
|
4043
|
-
Object.freeze(
|
|
2651
|
+
if (!ZERO2) {
|
|
2652
|
+
ZERO2 = new Matrix4([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
|
2653
|
+
Object.freeze(ZERO2);
|
|
4044
2654
|
}
|
|
4045
|
-
return
|
|
2655
|
+
return ZERO2;
|
|
4046
2656
|
}
|
|
4047
2657
|
function getIdentityMatrix2() {
|
|
4048
2658
|
if (!IDENTITY) {
|
|
@@ -4084,16 +2694,6 @@ var __exports__ = (() => {
|
|
|
4084
2694
|
}
|
|
4085
2695
|
|
|
4086
2696
|
// ../../node_modules/@math.gl/core/dist/gl-matrix/quat.js
|
|
4087
|
-
function create6() {
|
|
4088
|
-
const out = new ARRAY_TYPE(4);
|
|
4089
|
-
if (ARRAY_TYPE !== Float32Array) {
|
|
4090
|
-
out[0] = 0;
|
|
4091
|
-
out[1] = 0;
|
|
4092
|
-
out[2] = 0;
|
|
4093
|
-
}
|
|
4094
|
-
out[3] = 1;
|
|
4095
|
-
return out;
|
|
4096
|
-
}
|
|
4097
2697
|
function identity2(out) {
|
|
4098
2698
|
out[0] = 0;
|
|
4099
2699
|
out[1] = 0;
|
|
@@ -4110,7 +2710,7 @@ var __exports__ = (() => {
|
|
|
4110
2710
|
out[3] = Math.cos(rad);
|
|
4111
2711
|
return out;
|
|
4112
2712
|
}
|
|
4113
|
-
function
|
|
2713
|
+
function multiply3(out, a, b) {
|
|
4114
2714
|
const ax = a[0];
|
|
4115
2715
|
const ay = a[1];
|
|
4116
2716
|
const az = a[2];
|
|
@@ -4177,7 +2777,7 @@ var __exports__ = (() => {
|
|
|
4177
2777
|
out[3] = Math.sqrt(Math.abs(1 - x * x - y * y - z * z));
|
|
4178
2778
|
return out;
|
|
4179
2779
|
}
|
|
4180
|
-
function
|
|
2780
|
+
function slerp(out, a, b, t) {
|
|
4181
2781
|
const ax = a[0];
|
|
4182
2782
|
const ay = a[1];
|
|
4183
2783
|
const az = a[2];
|
|
@@ -4261,15 +2861,15 @@ var __exports__ = (() => {
|
|
|
4261
2861
|
}
|
|
4262
2862
|
return out;
|
|
4263
2863
|
}
|
|
4264
|
-
var
|
|
4265
|
-
var
|
|
2864
|
+
var add2 = add;
|
|
2865
|
+
var scale4 = scale3;
|
|
4266
2866
|
var dot3 = dot2;
|
|
4267
|
-
var
|
|
2867
|
+
var lerp2 = lerp;
|
|
4268
2868
|
var length3 = length2;
|
|
4269
|
-
var
|
|
2869
|
+
var squaredLength2 = squaredLength;
|
|
4270
2870
|
var normalize3 = normalize2;
|
|
4271
|
-
var rotationTo = (function() {
|
|
4272
|
-
const tmpvec3 =
|
|
2871
|
+
var rotationTo = /* @__PURE__ */ (function() {
|
|
2872
|
+
const tmpvec3 = create();
|
|
4273
2873
|
const xUnitVec3 = fromValues(1, 0, 0);
|
|
4274
2874
|
const yUnitVec3 = fromValues(0, 1, 0);
|
|
4275
2875
|
return function(out, a, b) {
|
|
@@ -4290,40 +2890,14 @@ var __exports__ = (() => {
|
|
|
4290
2890
|
}
|
|
4291
2891
|
cross(tmpvec3, a, b);
|
|
4292
2892
|
out[0] = tmpvec3[0];
|
|
4293
|
-
out[1] = tmpvec3[1];
|
|
4294
|
-
out[2] = tmpvec3[2];
|
|
4295
|
-
out[3] = 1 + dot4;
|
|
4296
|
-
return normalize3(out, out);
|
|
4297
|
-
};
|
|
4298
|
-
})();
|
|
4299
|
-
var sqlerp = (function() {
|
|
4300
|
-
const temp1 = create6();
|
|
4301
|
-
const temp2 = create6();
|
|
4302
|
-
return function(out, a, b, c, d, t) {
|
|
4303
|
-
slerp2(temp1, a, d, t);
|
|
4304
|
-
slerp2(temp2, b, c, t);
|
|
4305
|
-
slerp2(out, temp1, temp2, 2 * t * (1 - t));
|
|
4306
|
-
return out;
|
|
4307
|
-
};
|
|
4308
|
-
})();
|
|
4309
|
-
var setAxes = (function() {
|
|
4310
|
-
const matr = create3();
|
|
4311
|
-
return function(out, view, right, up) {
|
|
4312
|
-
matr[0] = right[0];
|
|
4313
|
-
matr[3] = right[1];
|
|
4314
|
-
matr[6] = right[2];
|
|
4315
|
-
matr[1] = up[0];
|
|
4316
|
-
matr[4] = up[1];
|
|
4317
|
-
matr[7] = up[2];
|
|
4318
|
-
matr[2] = -view[0];
|
|
4319
|
-
matr[5] = -view[1];
|
|
4320
|
-
matr[8] = -view[2];
|
|
4321
|
-
return normalize3(out, fromMat3(out, matr));
|
|
2893
|
+
out[1] = tmpvec3[1];
|
|
2894
|
+
out[2] = tmpvec3[2];
|
|
2895
|
+
out[3] = 1 + dot4;
|
|
2896
|
+
return normalize3(out, out);
|
|
4322
2897
|
};
|
|
4323
2898
|
})();
|
|
4324
2899
|
|
|
4325
2900
|
// ../../node_modules/@math.gl/core/dist/classes/quaternion.js
|
|
4326
|
-
var IDENTITY_QUATERNION = [0, 0, 0, 1];
|
|
4327
2901
|
var Quaternion = class extends MathArray {
|
|
4328
2902
|
constructor(x = 0, y = 0, z = 0, w = 1) {
|
|
4329
2903
|
super(-0, -0, -0, -0);
|
|
@@ -4365,6 +2939,30 @@ var __exports__ = (() => {
|
|
|
4365
2939
|
fromMat3(this, m);
|
|
4366
2940
|
return this.check();
|
|
4367
2941
|
}
|
|
2942
|
+
/**
|
|
2943
|
+
* Sets this quaternion from Euler angles.
|
|
2944
|
+
* @param euler - Euler angles and rotation order.
|
|
2945
|
+
* @returns This quaternion.
|
|
2946
|
+
*/
|
|
2947
|
+
fromEuler(euler) {
|
|
2948
|
+
this.identity();
|
|
2949
|
+
switch (euler.order) {
|
|
2950
|
+
case "xyz":
|
|
2951
|
+
return this.rotateX(euler.x).rotateY(euler.y).rotateZ(euler.z);
|
|
2952
|
+
case "yxz":
|
|
2953
|
+
return this.rotateY(euler.y).rotateX(euler.x).rotateZ(euler.z);
|
|
2954
|
+
case "zxy":
|
|
2955
|
+
return this.rotateZ(euler.z).rotateX(euler.x).rotateY(euler.y);
|
|
2956
|
+
case "zyx":
|
|
2957
|
+
return this.rotateZ(euler.z).rotateY(euler.y).rotateX(euler.x);
|
|
2958
|
+
case "yzx":
|
|
2959
|
+
return this.rotateY(euler.y).rotateZ(euler.z).rotateX(euler.x);
|
|
2960
|
+
case "xzy":
|
|
2961
|
+
return this.rotateX(euler.x).rotateZ(euler.z).rotateY(euler.y);
|
|
2962
|
+
default:
|
|
2963
|
+
throw new Error("Unknown Euler angle order");
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
4368
2966
|
fromAxisRotation(axis, rad) {
|
|
4369
2967
|
setAxisAngle(this, axis, rad);
|
|
4370
2968
|
return this.check();
|
|
@@ -4417,7 +3015,7 @@ var __exports__ = (() => {
|
|
|
4417
3015
|
}
|
|
4418
3016
|
// Calculates the squared length of a quat
|
|
4419
3017
|
lengthSquared() {
|
|
4420
|
-
return
|
|
3018
|
+
return squaredLength2(this);
|
|
4421
3019
|
}
|
|
4422
3020
|
// Calculates the dot product of two quat's
|
|
4423
3021
|
// @return {Number}
|
|
@@ -4456,7 +3054,7 @@ var __exports__ = (() => {
|
|
|
4456
3054
|
// }
|
|
4457
3055
|
// Adds two quat's
|
|
4458
3056
|
add(a) {
|
|
4459
|
-
|
|
3057
|
+
add2(this, this, a);
|
|
4460
3058
|
return this.check();
|
|
4461
3059
|
}
|
|
4462
3060
|
// Calculates the W component of a quat from the X, Y, and Z components.
|
|
@@ -4481,16 +3079,16 @@ var __exports__ = (() => {
|
|
|
4481
3079
|
if (t === void 0) {
|
|
4482
3080
|
return this.lerp(this, a, b);
|
|
4483
3081
|
}
|
|
4484
|
-
|
|
3082
|
+
lerp2(this, a, b, t);
|
|
4485
3083
|
return this.check();
|
|
4486
3084
|
}
|
|
4487
3085
|
// Multiplies two quat's
|
|
4488
3086
|
multiplyRight(a) {
|
|
4489
|
-
|
|
3087
|
+
multiply3(this, this, a);
|
|
4490
3088
|
return this.check();
|
|
4491
3089
|
}
|
|
4492
3090
|
multiplyLeft(a) {
|
|
4493
|
-
|
|
3091
|
+
multiply3(this, a, this);
|
|
4494
3092
|
return this.check();
|
|
4495
3093
|
}
|
|
4496
3094
|
// Normalize a quat
|
|
@@ -4523,7 +3121,7 @@ var __exports__ = (() => {
|
|
|
4523
3121
|
}
|
|
4524
3122
|
// Scales a quat by a scalar number
|
|
4525
3123
|
scale(b) {
|
|
4526
|
-
|
|
3124
|
+
scale4(this, this, b);
|
|
4527
3125
|
return this.check();
|
|
4528
3126
|
}
|
|
4529
3127
|
// Performs a spherical linear interpolation between two quat
|
|
@@ -4532,13 +3130,6 @@ var __exports__ = (() => {
|
|
|
4532
3130
|
let target;
|
|
4533
3131
|
let ratio;
|
|
4534
3132
|
switch (arguments.length) {
|
|
4535
|
-
case 1:
|
|
4536
|
-
({
|
|
4537
|
-
start: start2 = IDENTITY_QUATERNION,
|
|
4538
|
-
target,
|
|
4539
|
-
ratio
|
|
4540
|
-
} = arg0);
|
|
4541
|
-
break;
|
|
4542
3133
|
case 2:
|
|
4543
3134
|
start2 = this;
|
|
4544
3135
|
target = arg0;
|
|
@@ -4549,13 +3140,9 @@ var __exports__ = (() => {
|
|
|
4549
3140
|
target = arg1;
|
|
4550
3141
|
ratio = arg2;
|
|
4551
3142
|
}
|
|
4552
|
-
|
|
3143
|
+
slerp(this, start2, target, ratio);
|
|
4553
3144
|
return this.check();
|
|
4554
3145
|
}
|
|
4555
|
-
transformVector4(vector, result = new Vector4()) {
|
|
4556
|
-
transformQuat2(result, vector, this);
|
|
4557
|
-
return checkVector(result, 4);
|
|
4558
|
-
}
|
|
4559
3146
|
// THREE.js Math API compatibility
|
|
4560
3147
|
lengthSq() {
|
|
4561
3148
|
return this.lengthSquared();
|
|
@@ -4863,7 +3450,7 @@ var __exports__ = (() => {
|
|
|
4863
3450
|
h.copy(scratchCartesian).subtract(point);
|
|
4864
3451
|
const longitude = Math.atan2(normal.y, normal.x);
|
|
4865
3452
|
const latitude = Math.asin(normal.z);
|
|
4866
|
-
const height = Math.sign(
|
|
3453
|
+
const height = Math.sign(dot(h, scratchCartesian)) * length(h);
|
|
4867
3454
|
return toCartographicFromRadians([longitude, latitude, height], result);
|
|
4868
3455
|
}
|
|
4869
3456
|
eastNorthUpToFixedFrame(origin, result = new Matrix4()) {
|
|
@@ -4903,7 +3490,7 @@ var __exports__ = (() => {
|
|
|
4903
3490
|
const positionZ = scratchPosition.z;
|
|
4904
3491
|
const oneOverRadiiSquared = this.oneOverRadiiSquared;
|
|
4905
3492
|
const beta = 1 / Math.sqrt(positionX * positionX * oneOverRadiiSquared.x + positionY * positionY * oneOverRadiiSquared.y + positionZ * positionZ * oneOverRadiiSquared.z);
|
|
4906
|
-
return scratchPosition.
|
|
3493
|
+
return scratchPosition.multiplyByScalar(beta).to(result);
|
|
4907
3494
|
}
|
|
4908
3495
|
/** Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
|
|
4909
3496
|
* its components by the result of `Ellipsoid#oneOverRadii` */
|
|
@@ -5013,8 +3600,8 @@ var __exports__ = (() => {
|
|
|
5013
3600
|
*/
|
|
5014
3601
|
transform(transform2) {
|
|
5015
3602
|
this.center.transform(transform2);
|
|
5016
|
-
const
|
|
5017
|
-
this.radius = Math.max(
|
|
3603
|
+
const scale5 = getScaling(scratchVector7, transform2);
|
|
3604
|
+
this.radius = Math.max(scale5[0], Math.max(scale5[1], scale5[2])) * this.radius;
|
|
5018
3605
|
return this;
|
|
5019
3606
|
}
|
|
5020
3607
|
/** Computes the estimated distance squared from the closest point on a bounding sphere to a point. */
|
|
@@ -5269,24 +3856,24 @@ var __exports__ = (() => {
|
|
|
5269
3856
|
var scratchPosition2 = new Vector3();
|
|
5270
3857
|
var scratchNormal3 = new Vector3();
|
|
5271
3858
|
var Plane = class _Plane {
|
|
5272
|
-
constructor(normal = [0, 0, 1],
|
|
3859
|
+
constructor(normal = [0, 0, 1], distance = 0) {
|
|
5273
3860
|
this.normal = new Vector3();
|
|
5274
3861
|
this.distance = -0;
|
|
5275
|
-
this.fromNormalDistance(normal,
|
|
3862
|
+
this.fromNormalDistance(normal, distance);
|
|
5276
3863
|
}
|
|
5277
3864
|
/** Creates a plane from a normal and a distance from the origin. */
|
|
5278
|
-
fromNormalDistance(normal,
|
|
5279
|
-
assert(Number.isFinite(
|
|
3865
|
+
fromNormalDistance(normal, distance) {
|
|
3866
|
+
assert(Number.isFinite(distance));
|
|
5280
3867
|
this.normal.from(normal).normalize();
|
|
5281
|
-
this.distance =
|
|
3868
|
+
this.distance = distance;
|
|
5282
3869
|
return this;
|
|
5283
3870
|
}
|
|
5284
3871
|
/** Creates a plane from a normal and a point on the plane. */
|
|
5285
3872
|
fromPointNormal(point, normal) {
|
|
5286
3873
|
point = scratchPosition2.from(point);
|
|
5287
3874
|
this.normal.from(normal).normalize();
|
|
5288
|
-
const
|
|
5289
|
-
this.distance =
|
|
3875
|
+
const distance = -this.normal.dot(point);
|
|
3876
|
+
this.distance = distance;
|
|
5290
3877
|
return this;
|
|
5291
3878
|
}
|
|
5292
3879
|
/** Creates a plane from the general equation */
|
|
@@ -7910,8 +6497,8 @@ var __exports__ = (() => {
|
|
|
7910
6497
|
const [longitude, latitude] = tile.header.mbs;
|
|
7911
6498
|
const deltaLon = Math.abs(viewportLongitude - longitude);
|
|
7912
6499
|
const deltaLat = Math.abs(viewportLatitude - latitude);
|
|
7913
|
-
const
|
|
7914
|
-
tuples.push([index,
|
|
6500
|
+
const distance = Math.sqrt(deltaLat * deltaLat + deltaLon * deltaLon);
|
|
6501
|
+
tuples.push([index, distance]);
|
|
7915
6502
|
}
|
|
7916
6503
|
const tuplesSorted = tuples.sort((a, b) => a[1] - b[1]);
|
|
7917
6504
|
const selectedTiles = [];
|
|
@@ -8476,6 +7063,10 @@ var __exports__ = (() => {
|
|
|
8476
7063
|
foveatedTimeDelay: 0.2,
|
|
8477
7064
|
maximumScreenSpaceError: 8,
|
|
8478
7065
|
skipLevelOfDetail: false,
|
|
7066
|
+
baseScreenSpaceError: 1024,
|
|
7067
|
+
skipScreenSpaceErrorFactor: 16,
|
|
7068
|
+
skipLevels: 1,
|
|
7069
|
+
immediatelyLoadDesiredLevelOfDetail: false,
|
|
8479
7070
|
dynamicScreenSpaceError: true,
|
|
8480
7071
|
dynamicScreenSpaceErrorDensity: 2e-4,
|
|
8481
7072
|
dynamicScreenSpaceErrorFactor: 24,
|
|
@@ -9419,8 +8010,8 @@ var __exports__ = (() => {
|
|
|
9419
8010
|
function createSphere(sphere2, transform2, result) {
|
|
9420
8011
|
const center = new Vector3(sphere2[0], sphere2[1], sphere2[2]);
|
|
9421
8012
|
transform2.transform(center, center);
|
|
9422
|
-
const
|
|
9423
|
-
const uniformScale = Math.max(Math.max(
|
|
8013
|
+
const scale5 = transform2.getScale(scratchScale);
|
|
8014
|
+
const uniformScale = Math.max(Math.max(scale5[0], scale5[1]), scale5[2]);
|
|
9424
8015
|
const radius = sphere2[3] * uniformScale;
|
|
9425
8016
|
if (defined(result)) {
|
|
9426
8017
|
result.center = center;
|
|
@@ -9708,6 +8299,10 @@ var __exports__ = (() => {
|
|
|
9708
8299
|
var DEFAULT_PROPS4 = {
|
|
9709
8300
|
loadSiblings: false,
|
|
9710
8301
|
skipLevelOfDetail: false,
|
|
8302
|
+
baseScreenSpaceError: 1024,
|
|
8303
|
+
skipScreenSpaceErrorFactor: 16,
|
|
8304
|
+
skipLevels: 1,
|
|
8305
|
+
immediatelyLoadDesiredLevelOfDetail: false,
|
|
9711
8306
|
updateTransforms: true,
|
|
9712
8307
|
onTraversalEnd: () => {
|
|
9713
8308
|
},
|
|
@@ -9716,6 +8311,8 @@ var __exports__ = (() => {
|
|
|
9716
8311
|
};
|
|
9717
8312
|
var TilesetTraverser = class {
|
|
9718
8313
|
options;
|
|
8314
|
+
/** Whether loaded content has disabled skip-LOD traversal for this tileset. */
|
|
8315
|
+
disableSkipLevelOfDetail = false;
|
|
9719
8316
|
// fulfill in traverse call
|
|
9720
8317
|
root = null;
|
|
9721
8318
|
// tiles should be rendered
|
|
@@ -9741,6 +8338,10 @@ var __exports__ = (() => {
|
|
|
9741
8338
|
constructor(options) {
|
|
9742
8339
|
this.options = { ...DEFAULT_PROPS4, ...options };
|
|
9743
8340
|
}
|
|
8341
|
+
/** Returns whether skip-LOD traversal is enabled and supported by the loaded content. */
|
|
8342
|
+
isSkipLevelOfDetailEnabled() {
|
|
8343
|
+
return this.options.skipLevelOfDetail && !this.disableSkipLevelOfDetail;
|
|
8344
|
+
}
|
|
9744
8345
|
// tiles should be visible
|
|
9745
8346
|
traverse(root, frameState, options) {
|
|
9746
8347
|
this.root = root;
|
|
@@ -9798,13 +8399,17 @@ var __exports__ = (() => {
|
|
|
9798
8399
|
this.selectTile(tile, frameState);
|
|
9799
8400
|
} else if (tile.refine === 2 /* REPLACE */) {
|
|
9800
8401
|
this.loadTile(tile, frameState);
|
|
9801
|
-
if (stoppedRefining || this.
|
|
8402
|
+
if (stoppedRefining || this.isSkipLevelOfDetailEnabled()) {
|
|
9802
8403
|
this.selectTile(tile, frameState);
|
|
9803
8404
|
}
|
|
9804
8405
|
}
|
|
9805
8406
|
this.touchTile(tile, frameState);
|
|
9806
8407
|
tile._shouldRefine = shouldRefine && parentRefines;
|
|
9807
8408
|
}
|
|
8409
|
+
this.completeTraversal(frameState);
|
|
8410
|
+
}
|
|
8411
|
+
/** Notifies the owning tileset when traversal is complete or its debounce interval expires. */
|
|
8412
|
+
completeTraversal(frameState) {
|
|
9808
8413
|
const newTime = (/* @__PURE__ */ new Date()).getTime();
|
|
9809
8414
|
if (this.traversalFinished(frameState) || newTime - this.lastUpdate > this.updateDebounceTime) {
|
|
9810
8415
|
this.lastUpdate = newTime;
|
|
@@ -9819,7 +8424,8 @@ var __exports__ = (() => {
|
|
|
9819
8424
|
}
|
|
9820
8425
|
/* eslint-disable complexity, max-statements */
|
|
9821
8426
|
updateAndPushChildren(tile, frameState, stack, depth) {
|
|
9822
|
-
const { loadSiblings
|
|
8427
|
+
const { loadSiblings } = this.options;
|
|
8428
|
+
const skipLevelOfDetail = this.isSkipLevelOfDetailEnabled();
|
|
9823
8429
|
const children = tile.children;
|
|
9824
8430
|
children.sort(this.compareDistanceToCamera.bind(this));
|
|
9825
8431
|
const checkRefines = tile.refine === 2 /* REPLACE */ && tile.hasRenderContent && !skipLevelOfDetail;
|
|
@@ -10341,7 +8947,7 @@ var __exports__ = (() => {
|
|
|
10341
8947
|
// eslint-disable-next-line complexity
|
|
10342
8948
|
_calculateRequestPriority(allowUnloadedContent) {
|
|
10343
8949
|
const traverser = this.tileset._traverser;
|
|
10344
|
-
const
|
|
8950
|
+
const skipLevelOfDetail = traverser.options.skipLevelOfDetail && !traverser.disableSkipLevelOfDetail;
|
|
10345
8951
|
const maySkipTile = this.refine === 1 /* ADD */ || skipLevelOfDetail;
|
|
10346
8952
|
if (maySkipTile && !this.isVisible && this._visible !== void 0) {
|
|
10347
8953
|
return -1;
|
|
@@ -10571,9 +9177,11 @@ var __exports__ = (() => {
|
|
|
10571
9177
|
return;
|
|
10572
9178
|
}
|
|
10573
9179
|
this._foveatedFactor = calculateFoveatedFactor(this.boundingVolume, frameState.camera);
|
|
9180
|
+
const traverser = this.tileset._traverser;
|
|
9181
|
+
const skipLevelOfDetail = traverser.options.skipLevelOfDetail && !traverser.disableSkipLevelOfDetail;
|
|
10574
9182
|
const deferralEligible = isFoveatedRequestDeferred({
|
|
10575
9183
|
refinement: this.refine,
|
|
10576
|
-
skipLevelOfDetail
|
|
9184
|
+
skipLevelOfDetail,
|
|
10577
9185
|
foveatedScreenSpaceError: options.foveatedScreenSpaceError,
|
|
10578
9186
|
foveatedConeSize: options.foveatedConeSize,
|
|
10579
9187
|
minimumScreenSpaceErrorRelaxation: options.foveatedMinimumScreenSpaceErrorRelaxation,
|
|
@@ -10837,6 +9445,196 @@ var __exports__ = (() => {
|
|
|
10837
9445
|
}
|
|
10838
9446
|
return true;
|
|
10839
9447
|
}
|
|
9448
|
+
/**
|
|
9449
|
+
* Runs normal replacement traversal or the dedicated skip-LOD traversal selected by options.
|
|
9450
|
+
*
|
|
9451
|
+
* @param root - Root of the runtime subtree to traverse.
|
|
9452
|
+
* @param frameState - Current culling and LOD state.
|
|
9453
|
+
*/
|
|
9454
|
+
executeTraversal(root, frameState) {
|
|
9455
|
+
if (!this.isSkipLevelOfDetailEnabled()) {
|
|
9456
|
+
super.executeTraversal(root, frameState);
|
|
9457
|
+
return;
|
|
9458
|
+
}
|
|
9459
|
+
this.executeSkipTraversal(root, frameState);
|
|
9460
|
+
}
|
|
9461
|
+
/**
|
|
9462
|
+
* Traverses visible replacement branches without requesting skipped intermediate content.
|
|
9463
|
+
*
|
|
9464
|
+
* Base-traversal tiles establish coarse coverage. Below that base, only final desired tiles and
|
|
9465
|
+
* tiles that cross the configured depth/SSE thresholds are requested. Already available
|
|
9466
|
+
* ancestors remain selectable while those requests stream in.
|
|
9467
|
+
*
|
|
9468
|
+
* @param root - Root of the runtime subtree to traverse.
|
|
9469
|
+
* @param frameState - Current culling and LOD state.
|
|
9470
|
+
*/
|
|
9471
|
+
executeSkipTraversal(root, frameState) {
|
|
9472
|
+
const stack = [root];
|
|
9473
|
+
root._selectionDepth = root.parent ? root.parent._selectionDepth : 1;
|
|
9474
|
+
while (stack.length > 0) {
|
|
9475
|
+
const tile = stack.pop();
|
|
9476
|
+
const parentRefines = !tile.parent || tile.parent._shouldRefine;
|
|
9477
|
+
const shouldRefine = this.canTraverse(tile, frameState) && this.updateAndPushSkipChildren(tile, frameState, stack) && parentRefines;
|
|
9478
|
+
const stoppedRefining = !shouldRefine && parentRefines;
|
|
9479
|
+
if (!tile.hasRenderContent) {
|
|
9480
|
+
this.emptyTiles[tile.id] = tile;
|
|
9481
|
+
this.loadTile(tile, frameState);
|
|
9482
|
+
if (stoppedRefining) {
|
|
9483
|
+
this.selectDesiredTile(tile, frameState);
|
|
9484
|
+
}
|
|
9485
|
+
} else if (tile.refine === 1 /* ADD */) {
|
|
9486
|
+
this.loadTile(tile, frameState);
|
|
9487
|
+
this.selectDesiredTile(tile, frameState);
|
|
9488
|
+
} else if (tile.refine === 2 /* REPLACE */) {
|
|
9489
|
+
if (this.isInBaseTraversal(tile, frameState)) {
|
|
9490
|
+
this.loadTile(tile, frameState);
|
|
9491
|
+
if (stoppedRefining) {
|
|
9492
|
+
this.selectDesiredTile(tile, frameState);
|
|
9493
|
+
}
|
|
9494
|
+
} else if (stoppedRefining) {
|
|
9495
|
+
this.loadTile(tile, frameState);
|
|
9496
|
+
this.selectDesiredTile(tile, frameState);
|
|
9497
|
+
} else if (this.hasReachedSkippingThreshold(tile, frameState)) {
|
|
9498
|
+
this.loadTile(tile, frameState);
|
|
9499
|
+
}
|
|
9500
|
+
}
|
|
9501
|
+
this.touchTile(tile, frameState);
|
|
9502
|
+
tile._shouldRefine = shouldRefine;
|
|
9503
|
+
}
|
|
9504
|
+
this.completeTraversal(frameState);
|
|
9505
|
+
}
|
|
9506
|
+
/**
|
|
9507
|
+
* Updates and pushes visible children for skip traversal without requiring sibling readiness.
|
|
9508
|
+
*
|
|
9509
|
+
* @param tile - Parent whose children are considered.
|
|
9510
|
+
* @param frameState - Current culling and LOD state.
|
|
9511
|
+
* @param stack - Depth-first traversal stack.
|
|
9512
|
+
* @returns `true` when at least one visible child continues refinement.
|
|
9513
|
+
*/
|
|
9514
|
+
updateAndPushSkipChildren(tile, frameState, stack) {
|
|
9515
|
+
this.updateChildTiles(tile, frameState);
|
|
9516
|
+
tile.children.sort(this.compareDistanceToCamera.bind(this));
|
|
9517
|
+
let hasVisibleChild = false;
|
|
9518
|
+
for (const child of tile.children) {
|
|
9519
|
+
child._selectionDepth = tile.hasRenderContent ? tile._selectionDepth + 1 : tile._selectionDepth;
|
|
9520
|
+
if (child.isVisibleAndInRequestVolume) {
|
|
9521
|
+
stack.push(child);
|
|
9522
|
+
hasVisibleChild = true;
|
|
9523
|
+
} else if (this.options.loadSiblings) {
|
|
9524
|
+
this.loadTile(child, frameState);
|
|
9525
|
+
this.touchTile(child, frameState);
|
|
9526
|
+
}
|
|
9527
|
+
}
|
|
9528
|
+
return hasVisibleChild;
|
|
9529
|
+
}
|
|
9530
|
+
/**
|
|
9531
|
+
* Determines whether a tile belongs to the coarse non-skipping portion of the traversal.
|
|
9532
|
+
*
|
|
9533
|
+
* @param tile - Tile considered for loading.
|
|
9534
|
+
* @param frameState - Current traversal frame.
|
|
9535
|
+
* @returns `true` when the tile should always be requested for fallback coverage.
|
|
9536
|
+
*/
|
|
9537
|
+
isInBaseTraversal(tile, frameState) {
|
|
9538
|
+
if (this.options.immediatelyLoadDesiredLevelOfDetail) {
|
|
9539
|
+
return false;
|
|
9540
|
+
}
|
|
9541
|
+
if (!this.findNearestRequestedOrLoadedAncestor(tile, frameState)) {
|
|
9542
|
+
return true;
|
|
9543
|
+
}
|
|
9544
|
+
const configuredBaseScreenSpaceError = Number.isFinite(this.options.baseScreenSpaceError) ? Math.max(this.options.baseScreenSpaceError, 0) : 1024;
|
|
9545
|
+
const baseScreenSpaceError = Math.max(
|
|
9546
|
+
configuredBaseScreenSpaceError,
|
|
9547
|
+
tile.tileset.memoryAdjustedScreenSpaceError
|
|
9548
|
+
);
|
|
9549
|
+
if (tile._screenSpaceError === 0 && tile.parent) {
|
|
9550
|
+
return tile.parent._screenSpaceError > baseScreenSpaceError;
|
|
9551
|
+
}
|
|
9552
|
+
return tile._screenSpaceError > baseScreenSpaceError;
|
|
9553
|
+
}
|
|
9554
|
+
/**
|
|
9555
|
+
* Determines whether a skipped branch has crossed its configured request threshold.
|
|
9556
|
+
*
|
|
9557
|
+
* @param tile - Tile considered for loading.
|
|
9558
|
+
* @param frameState - Current traversal frame.
|
|
9559
|
+
* @returns `true` when the tile must be requested instead of skipped.
|
|
9560
|
+
*/
|
|
9561
|
+
hasReachedSkippingThreshold(tile, frameState) {
|
|
9562
|
+
if (this.options.immediatelyLoadDesiredLevelOfDetail) {
|
|
9563
|
+
return false;
|
|
9564
|
+
}
|
|
9565
|
+
const progressiveResolutionLeaf = tile._priorityProgressiveResolution && tile._screenSpaceErrorProgressiveResolution <= tile.tileset.memoryAdjustedScreenSpaceError && Boolean(
|
|
9566
|
+
tile.parent && tile.parent._screenSpaceErrorProgressiveResolution > tile.tileset.memoryAdjustedScreenSpaceError
|
|
9567
|
+
);
|
|
9568
|
+
if (progressiveResolutionLeaf) {
|
|
9569
|
+
return true;
|
|
9570
|
+
}
|
|
9571
|
+
const ancestor = this.findNearestRequestedOrLoadedAncestor(tile, frameState);
|
|
9572
|
+
if (!ancestor) {
|
|
9573
|
+
return false;
|
|
9574
|
+
}
|
|
9575
|
+
const skipScreenSpaceErrorFactor = Number.isFinite(this.options.skipScreenSpaceErrorFactor) && this.options.skipScreenSpaceErrorFactor > 0 ? this.options.skipScreenSpaceErrorFactor : 16;
|
|
9576
|
+
const skipLevels = Number.isFinite(this.options.skipLevels) ? Math.max(Math.floor(this.options.skipLevels), 0) : 1;
|
|
9577
|
+
return tile._screenSpaceError < ancestor._screenSpaceError / skipScreenSpaceErrorFactor && tile.depth > ancestor.depth + skipLevels;
|
|
9578
|
+
}
|
|
9579
|
+
/**
|
|
9580
|
+
* Finds the nearest ancestor whose render content is loaded, loading, or requested this frame.
|
|
9581
|
+
*
|
|
9582
|
+
* @param tile - Descendant whose request threshold needs an anchor.
|
|
9583
|
+
* @param frameState - Current traversal frame.
|
|
9584
|
+
* @returns The nearest request anchor, or `null` when none exists.
|
|
9585
|
+
*/
|
|
9586
|
+
findNearestRequestedOrLoadedAncestor(tile, frameState) {
|
|
9587
|
+
let ancestor = tile.parent;
|
|
9588
|
+
while (ancestor) {
|
|
9589
|
+
const contentIsUsableAnchor = ancestor.hasRenderContent && !ancestor.contentFailed && (!ancestor.hasUnloadedContent || ancestor._requestedFrame === frameState.frameNumber);
|
|
9590
|
+
if (contentIsUsableAnchor) {
|
|
9591
|
+
return ancestor;
|
|
9592
|
+
}
|
|
9593
|
+
ancestor = ancestor.parent;
|
|
9594
|
+
}
|
|
9595
|
+
return null;
|
|
9596
|
+
}
|
|
9597
|
+
/**
|
|
9598
|
+
* Selects the desired tile, its nearest ready ancestor, or nearby ready descendants.
|
|
9599
|
+
*
|
|
9600
|
+
* @param tile - Tile that ended the desired refinement branch.
|
|
9601
|
+
* @param frameState - Current culling state.
|
|
9602
|
+
*/
|
|
9603
|
+
selectDesiredTile(tile, frameState) {
|
|
9604
|
+
let fallbackTile = tile;
|
|
9605
|
+
while (fallbackTile) {
|
|
9606
|
+
if (this.shouldSelectTile(fallbackTile, frameState)) {
|
|
9607
|
+
this.selectTile(fallbackTile, frameState);
|
|
9608
|
+
return;
|
|
9609
|
+
}
|
|
9610
|
+
fallbackTile = fallbackTile.parent;
|
|
9611
|
+
}
|
|
9612
|
+
this.selectLoadedDescendants(tile, frameState);
|
|
9613
|
+
}
|
|
9614
|
+
/**
|
|
9615
|
+
* Selects ready descendants near an unavailable desired tile to reduce temporary empty regions.
|
|
9616
|
+
*
|
|
9617
|
+
* @param root - Unavailable tile whose descendants are searched.
|
|
9618
|
+
* @param frameState - Current culling state.
|
|
9619
|
+
*/
|
|
9620
|
+
selectLoadedDescendants(root, frameState) {
|
|
9621
|
+
const stack = [{ tile: root, depth: 0 }];
|
|
9622
|
+
while (stack.length > 0) {
|
|
9623
|
+
const { tile, depth } = stack.pop();
|
|
9624
|
+
for (const child of tile.children) {
|
|
9625
|
+
this.updateTile(child, frameState);
|
|
9626
|
+
if (!child.isVisibleAndInRequestVolume) {
|
|
9627
|
+
continue;
|
|
9628
|
+
}
|
|
9629
|
+
if (child.contentAvailable) {
|
|
9630
|
+
this.selectTile(child, frameState);
|
|
9631
|
+
this.touchTile(child, frameState);
|
|
9632
|
+
} else if (depth < 1) {
|
|
9633
|
+
stack.push({ tile: child, depth: depth + 1 });
|
|
9634
|
+
}
|
|
9635
|
+
}
|
|
9636
|
+
}
|
|
9637
|
+
}
|
|
10840
9638
|
compareDistanceToCamera(a, b) {
|
|
10841
9639
|
return b._distanceToCamera === 0 && a._distanceToCamera === 0 ? b._centerZDepth - a._centerZDepth : b._distanceToCamera - a._distanceToCamera;
|
|
10842
9640
|
}
|
|
@@ -12321,6 +11119,9 @@ var __exports__ = (() => {
|
|
|
12321
11119
|
lon_0: function(v) {
|
|
12322
11120
|
self.long0 = v * D2R;
|
|
12323
11121
|
},
|
|
11122
|
+
lon_wrap: function(v) {
|
|
11123
|
+
self.long_wrap = parseFloat(v) * D2R;
|
|
11124
|
+
},
|
|
12324
11125
|
lon_1: function(v) {
|
|
12325
11126
|
self.long1 = v * D2R;
|
|
12326
11127
|
},
|
|
@@ -13641,6 +12442,7 @@ var __exports__ = (() => {
|
|
|
13641
12442
|
if (!("y0" in this)) {
|
|
13642
12443
|
this.y0 = 0;
|
|
13643
12444
|
}
|
|
12445
|
+
this.long0 = this.long0 || 0;
|
|
13644
12446
|
this.e = Math.sqrt(this.es);
|
|
13645
12447
|
if (this.lat_ts) {
|
|
13646
12448
|
if (this.sphere) {
|
|
@@ -13682,7 +12484,7 @@ var __exports__ = (() => {
|
|
|
13682
12484
|
return p;
|
|
13683
12485
|
}
|
|
13684
12486
|
}
|
|
13685
|
-
function
|
|
12487
|
+
function inverse(p) {
|
|
13686
12488
|
var x = p.x - this.x0;
|
|
13687
12489
|
var y = p.y - this.y0;
|
|
13688
12490
|
var lon, lat;
|
|
@@ -13704,7 +12506,7 @@ var __exports__ = (() => {
|
|
|
13704
12506
|
var merc_default = {
|
|
13705
12507
|
init,
|
|
13706
12508
|
forward,
|
|
13707
|
-
inverse
|
|
12509
|
+
inverse,
|
|
13708
12510
|
names
|
|
13709
12511
|
};
|
|
13710
12512
|
|
|
@@ -13726,7 +12528,7 @@ var __exports__ = (() => {
|
|
|
13726
12528
|
var projs = [merc_default, longlat_default];
|
|
13727
12529
|
var names3 = {};
|
|
13728
12530
|
var projStore = [];
|
|
13729
|
-
function
|
|
12531
|
+
function add3(proj, i) {
|
|
13730
12532
|
var len2 = projStore.length;
|
|
13731
12533
|
if (!proj.names) {
|
|
13732
12534
|
console.log(i);
|
|
@@ -13755,11 +12557,11 @@ var __exports__ = (() => {
|
|
|
13755
12557
|
}
|
|
13756
12558
|
}
|
|
13757
12559
|
function start() {
|
|
13758
|
-
projs.forEach(
|
|
12560
|
+
projs.forEach(add3);
|
|
13759
12561
|
}
|
|
13760
12562
|
var projections_default = {
|
|
13761
12563
|
start,
|
|
13762
|
-
add:
|
|
12564
|
+
add: add3,
|
|
13763
12565
|
get
|
|
13764
12566
|
};
|
|
13765
12567
|
|
|
@@ -13943,7 +12745,7 @@ var __exports__ = (() => {
|
|
|
13943
12745
|
},
|
|
13944
12746
|
plessis: {
|
|
13945
12747
|
a: 6376523,
|
|
13946
|
-
|
|
12748
|
+
b: 6355863,
|
|
13947
12749
|
ellipseName: "Plessis 1817 (France)"
|
|
13948
12750
|
},
|
|
13949
12751
|
krass: {
|
|
@@ -14069,7 +12871,7 @@ var __exports__ = (() => {
|
|
|
14069
12871
|
},
|
|
14070
12872
|
carthage: {
|
|
14071
12873
|
towgs84: "-263.0,6.0,431.0",
|
|
14072
|
-
ellipse: "
|
|
12874
|
+
ellipse: "clrk80ign",
|
|
14073
12875
|
datumName: "Carthage 1934 Tunisia"
|
|
14074
12876
|
},
|
|
14075
12877
|
hermannskogel: {
|
|
@@ -15651,7 +14453,6 @@ var __exports__ = (() => {
|
|
|
15651
14453
|
json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode;
|
|
15652
14454
|
}
|
|
15653
14455
|
}
|
|
15654
|
-
json.k0 = json.k0 || 1;
|
|
15655
14456
|
json.axis = json.axis || "enu";
|
|
15656
14457
|
json.ellps = json.ellps || "wgs84";
|
|
15657
14458
|
json.lat1 = json.lat1 || json.lat0;
|
|
@@ -15680,6 +14481,9 @@ var __exports__ = (() => {
|
|
|
15680
14481
|
if ("init" in this && typeof this.init === "function") {
|
|
15681
14482
|
this.init();
|
|
15682
14483
|
}
|
|
14484
|
+
if (!this.k0) {
|
|
14485
|
+
this.k0 = 1;
|
|
14486
|
+
}
|
|
15683
14487
|
callback(null, this);
|
|
15684
14488
|
}
|
|
15685
14489
|
Projection.projections = projections_default;
|
|
@@ -15890,7 +14694,7 @@ var __exports__ = (() => {
|
|
|
15890
14694
|
}
|
|
15891
14695
|
return point;
|
|
15892
14696
|
}
|
|
15893
|
-
function applyGridShift(source,
|
|
14697
|
+
function applyGridShift(source, inverse35, point) {
|
|
15894
14698
|
if (source.grids === null || source.grids.length === 0) {
|
|
15895
14699
|
console.log("Grid shift grids not found");
|
|
15896
14700
|
return -1;
|
|
@@ -15924,7 +14728,7 @@ var __exports__ = (() => {
|
|
|
15924
14728
|
if (minY > input.y || minX > input.x || maxY < input.y || maxX < input.x) {
|
|
15925
14729
|
continue;
|
|
15926
14730
|
}
|
|
15927
|
-
output = applySubgridShift(input,
|
|
14731
|
+
output = applySubgridShift(input, inverse35, subgrid);
|
|
15928
14732
|
if (!isNaN(output.x)) {
|
|
15929
14733
|
break outer;
|
|
15930
14734
|
}
|
|
@@ -15938,7 +14742,7 @@ var __exports__ = (() => {
|
|
|
15938
14742
|
point.y = output.y;
|
|
15939
14743
|
return 0;
|
|
15940
14744
|
}
|
|
15941
|
-
function applySubgridShift(pin,
|
|
14745
|
+
function applySubgridShift(pin, inverse35, ct) {
|
|
15942
14746
|
var val = { x: Number.NaN, y: Number.NaN };
|
|
15943
14747
|
if (isNaN(pin.x)) {
|
|
15944
14748
|
return val;
|
|
@@ -15948,7 +14752,7 @@ var __exports__ = (() => {
|
|
|
15948
14752
|
tb.y -= ct.ll[1];
|
|
15949
14753
|
tb.x = adjust_lon_default(tb.x - Math.PI) + Math.PI;
|
|
15950
14754
|
var t = nadInterpolate(tb, ct);
|
|
15951
|
-
if (
|
|
14755
|
+
if (inverse35) {
|
|
15952
14756
|
if (isNaN(t.x)) {
|
|
15953
14757
|
return val;
|
|
15954
14758
|
}
|
|
@@ -16159,6 +14963,9 @@ var __exports__ = (() => {
|
|
|
16159
14963
|
};
|
|
16160
14964
|
}
|
|
16161
14965
|
if (dest.projName === "longlat") {
|
|
14966
|
+
if (dest.long_wrap !== void 0) {
|
|
14967
|
+
point.x = dest.long_wrap + adjust_lon_default(point.x - dest.long_wrap);
|
|
14968
|
+
}
|
|
16162
14969
|
point = {
|
|
16163
14970
|
x: point.x * R2D,
|
|
16164
14971
|
y: point.y * R2D,
|
|
@@ -16333,7 +15140,7 @@ var __exports__ = (() => {
|
|
|
16333
15140
|
var Z = 90;
|
|
16334
15141
|
var mgrs_default = {
|
|
16335
15142
|
forward: forward2,
|
|
16336
|
-
inverse:
|
|
15143
|
+
inverse: inverse2,
|
|
16337
15144
|
toPoint
|
|
16338
15145
|
};
|
|
16339
15146
|
function forward2(ll, accuracy) {
|
|
@@ -16343,7 +15150,7 @@ var __exports__ = (() => {
|
|
|
16343
15150
|
lon: ll[0]
|
|
16344
15151
|
}), accuracy);
|
|
16345
15152
|
}
|
|
16346
|
-
function
|
|
15153
|
+
function inverse2(mgrs) {
|
|
16347
15154
|
var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
|
|
16348
15155
|
if (bbox.lat && bbox.lon) {
|
|
16349
15156
|
return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];
|
|
@@ -16602,9 +15409,9 @@ var __exports__ = (() => {
|
|
|
16602
15409
|
throw "MGRSPoint zone letter " + zoneLetter + " not handled: " + mgrsString;
|
|
16603
15410
|
}
|
|
16604
15411
|
hunK = mgrsString.substring(i, i += 2);
|
|
16605
|
-
var
|
|
16606
|
-
var east100k = getEastingFromChar(hunK.charAt(0),
|
|
16607
|
-
var north100k = getNorthingFromChar(hunK.charAt(1),
|
|
15412
|
+
var set2 = get100kSetForZone(zoneNumber);
|
|
15413
|
+
var east100k = getEastingFromChar(hunK.charAt(0), set2);
|
|
15414
|
+
var north100k = getNorthingFromChar(hunK.charAt(1), set2);
|
|
16608
15415
|
while (north100k < getMinNorthing(zoneLetter)) {
|
|
16609
15416
|
north100k += 2e6;
|
|
16610
15417
|
}
|
|
@@ -16633,8 +15440,8 @@ var __exports__ = (() => {
|
|
|
16633
15440
|
accuracy: accuracyBonus
|
|
16634
15441
|
};
|
|
16635
15442
|
}
|
|
16636
|
-
function getEastingFromChar(e,
|
|
16637
|
-
var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(
|
|
15443
|
+
function getEastingFromChar(e, set2) {
|
|
15444
|
+
var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set2 - 1);
|
|
16638
15445
|
var eastingValue = 1e5;
|
|
16639
15446
|
var rewindMarker = false;
|
|
16640
15447
|
while (curCol !== e.charCodeAt(0)) {
|
|
@@ -16656,11 +15463,11 @@ var __exports__ = (() => {
|
|
|
16656
15463
|
}
|
|
16657
15464
|
return eastingValue;
|
|
16658
15465
|
}
|
|
16659
|
-
function getNorthingFromChar(n,
|
|
15466
|
+
function getNorthingFromChar(n, set2) {
|
|
16660
15467
|
if (n > "V") {
|
|
16661
15468
|
throw "MGRSPoint given invalid Northing " + n;
|
|
16662
15469
|
}
|
|
16663
|
-
var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(
|
|
15470
|
+
var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(set2 - 1);
|
|
16664
15471
|
var northingValue = 0;
|
|
16665
15472
|
var rewindMarker = false;
|
|
16666
15473
|
while (curRow !== n.charCodeAt(0)) {
|
|
@@ -16896,7 +15703,7 @@ var __exports__ = (() => {
|
|
|
16896
15703
|
p.y = y;
|
|
16897
15704
|
return p;
|
|
16898
15705
|
}
|
|
16899
|
-
function
|
|
15706
|
+
function inverse3(p) {
|
|
16900
15707
|
var con, phi;
|
|
16901
15708
|
var lat, lon;
|
|
16902
15709
|
var x = (p.x - this.x0) * (1 / this.a);
|
|
@@ -16946,7 +15753,7 @@ var __exports__ = (() => {
|
|
|
16946
15753
|
var tmerc_default = {
|
|
16947
15754
|
init: init3,
|
|
16948
15755
|
forward: forward3,
|
|
16949
|
-
inverse:
|
|
15756
|
+
inverse: inverse3,
|
|
16950
15757
|
names: names4
|
|
16951
15758
|
};
|
|
16952
15759
|
|
|
@@ -17059,6 +15866,7 @@ var __exports__ = (() => {
|
|
|
17059
15866
|
this.y0 = this.y0 !== void 0 ? this.y0 : 0;
|
|
17060
15867
|
this.long0 = this.long0 !== void 0 ? this.long0 : 0;
|
|
17061
15868
|
this.lat0 = this.lat0 !== void 0 ? this.lat0 : 0;
|
|
15869
|
+
this.k0 = this.k0 !== void 0 ? this.k0 : 1;
|
|
17062
15870
|
this.cgb = [];
|
|
17063
15871
|
this.cbg = [];
|
|
17064
15872
|
this.utg = [];
|
|
@@ -17131,7 +15939,7 @@ var __exports__ = (() => {
|
|
|
17131
15939
|
p.y = y;
|
|
17132
15940
|
return p;
|
|
17133
15941
|
}
|
|
17134
|
-
function
|
|
15942
|
+
function inverse4(p) {
|
|
17135
15943
|
var Ce = (p.x - this.x0) * (1 / this.a);
|
|
17136
15944
|
var Cn = (p.y - this.y0) * (1 / this.a);
|
|
17137
15945
|
Cn = (Cn - this.Zb) / this.Qn;
|
|
@@ -17163,7 +15971,7 @@ var __exports__ = (() => {
|
|
|
17163
15971
|
var etmerc_default = {
|
|
17164
15972
|
init: init4,
|
|
17165
15973
|
forward: forward4,
|
|
17166
|
-
inverse:
|
|
15974
|
+
inverse: inverse4,
|
|
17167
15975
|
names: names5
|
|
17168
15976
|
};
|
|
17169
15977
|
|
|
@@ -17227,7 +16035,7 @@ var __exports__ = (() => {
|
|
|
17227
16035
|
p.x = this.C * lon;
|
|
17228
16036
|
return p;
|
|
17229
16037
|
}
|
|
17230
|
-
function
|
|
16038
|
+
function inverse5(p) {
|
|
17231
16039
|
var DEL_TOL = 1e-14;
|
|
17232
16040
|
var lon = p.x / this.C;
|
|
17233
16041
|
var lat = p.y;
|
|
@@ -17250,7 +16058,7 @@ var __exports__ = (() => {
|
|
|
17250
16058
|
var gauss_default = {
|
|
17251
16059
|
init: init6,
|
|
17252
16060
|
forward: forward5,
|
|
17253
|
-
inverse:
|
|
16061
|
+
inverse: inverse5,
|
|
17254
16062
|
names: names7
|
|
17255
16063
|
};
|
|
17256
16064
|
|
|
@@ -17281,7 +16089,7 @@ var __exports__ = (() => {
|
|
|
17281
16089
|
p.y = this.a * p.y + this.y0;
|
|
17282
16090
|
return p;
|
|
17283
16091
|
}
|
|
17284
|
-
function
|
|
16092
|
+
function inverse6(p) {
|
|
17285
16093
|
var sinc, cosc, lon, lat, rho;
|
|
17286
16094
|
p.x = (p.x - this.x0) / this.a;
|
|
17287
16095
|
p.y = (p.y - this.y0) / this.a;
|
|
@@ -17307,7 +16115,7 @@ var __exports__ = (() => {
|
|
|
17307
16115
|
var sterea_default = {
|
|
17308
16116
|
init: init7,
|
|
17309
16117
|
forward: forward6,
|
|
17310
|
-
inverse:
|
|
16118
|
+
inverse: inverse6,
|
|
17311
16119
|
names: names8
|
|
17312
16120
|
};
|
|
17313
16121
|
|
|
@@ -17324,7 +16132,7 @@ var __exports__ = (() => {
|
|
|
17324
16132
|
this.coslat0 = Math.cos(this.lat0);
|
|
17325
16133
|
this.sinlat0 = Math.sin(this.lat0);
|
|
17326
16134
|
if (this.sphere) {
|
|
17327
|
-
if (
|
|
16135
|
+
if (!isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {
|
|
17328
16136
|
this.k0 = 0.5 * (1 + sign_default(this.lat0) * Math.sin(this.lat_ts));
|
|
17329
16137
|
}
|
|
17330
16138
|
} else {
|
|
@@ -17336,7 +16144,7 @@ var __exports__ = (() => {
|
|
|
17336
16144
|
}
|
|
17337
16145
|
}
|
|
17338
16146
|
this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e));
|
|
17339
|
-
if (
|
|
16147
|
+
if (!isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN && Math.abs(Math.cos(this.lat_ts)) > EPSLN) {
|
|
17340
16148
|
this.k0 = 0.5 * this.cons * msfnz_default(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / tsfnz_default(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts));
|
|
17341
16149
|
}
|
|
17342
16150
|
this.ms1 = msfnz_default(this.e, this.sinlat0, this.coslat0);
|
|
@@ -17383,7 +16191,7 @@ var __exports__ = (() => {
|
|
|
17383
16191
|
}
|
|
17384
16192
|
return p;
|
|
17385
16193
|
}
|
|
17386
|
-
function
|
|
16194
|
+
function inverse7(p) {
|
|
17387
16195
|
p.x -= this.x0;
|
|
17388
16196
|
p.y -= this.y0;
|
|
17389
16197
|
var lon, lat, ts, ce, Chi;
|
|
@@ -17444,13 +16252,16 @@ var __exports__ = (() => {
|
|
|
17444
16252
|
var stere_default = {
|
|
17445
16253
|
init: init8,
|
|
17446
16254
|
forward: forward7,
|
|
17447
|
-
inverse:
|
|
16255
|
+
inverse: inverse7,
|
|
17448
16256
|
names: names9,
|
|
17449
16257
|
ssfn_
|
|
17450
16258
|
};
|
|
17451
16259
|
|
|
17452
16260
|
// ../../node_modules/proj4/lib/projections/somerc.js
|
|
17453
16261
|
function init9() {
|
|
16262
|
+
if (!this.k0) {
|
|
16263
|
+
this.k0 = 1;
|
|
16264
|
+
}
|
|
17454
16265
|
var phy0 = this.lat0;
|
|
17455
16266
|
this.lambda0 = this.long0;
|
|
17456
16267
|
var sinPhy0 = Math.sin(phy0);
|
|
@@ -17479,7 +16290,7 @@ var __exports__ = (() => {
|
|
|
17479
16290
|
p.x = this.R * rotI + this.x0;
|
|
17480
16291
|
return p;
|
|
17481
16292
|
}
|
|
17482
|
-
function
|
|
16293
|
+
function inverse8(p) {
|
|
17483
16294
|
var Y = p.x - this.x0;
|
|
17484
16295
|
var X = p.y - this.y0;
|
|
17485
16296
|
var rotI = Y / this.R;
|
|
@@ -17507,7 +16318,7 @@ var __exports__ = (() => {
|
|
|
17507
16318
|
var somerc_default = {
|
|
17508
16319
|
init: init9,
|
|
17509
16320
|
forward: forward8,
|
|
17510
|
-
inverse:
|
|
16321
|
+
inverse: inverse8,
|
|
17511
16322
|
names: names10
|
|
17512
16323
|
};
|
|
17513
16324
|
|
|
@@ -17520,6 +16331,9 @@ var __exports__ = (() => {
|
|
|
17520
16331
|
}
|
|
17521
16332
|
function init10() {
|
|
17522
16333
|
var con, com, cosph0, D, F, H, L, sinph0, p, J, gamma = 0, gamma0, lamc = 0, lam1 = 0, lam2 = 0, phi1 = 0, phi2 = 0, alpha_c = 0;
|
|
16334
|
+
if (!this.k0) {
|
|
16335
|
+
this.k0 = 1;
|
|
16336
|
+
}
|
|
17523
16337
|
this.no_off = isTypeA(this);
|
|
17524
16338
|
this.no_rot = "no_rot" in this;
|
|
17525
16339
|
var alp = false;
|
|
@@ -17661,7 +16475,7 @@ var __exports__ = (() => {
|
|
|
17661
16475
|
coords.y = this.a * coords.y + this.y0;
|
|
17662
16476
|
return coords;
|
|
17663
16477
|
}
|
|
17664
|
-
function
|
|
16478
|
+
function inverse9(p) {
|
|
17665
16479
|
var u, v, Qp, Sp, Tp, Vp, Up;
|
|
17666
16480
|
var coords = {};
|
|
17667
16481
|
p.x = (p.x - this.x0) * (1 / this.a);
|
|
@@ -17696,7 +16510,7 @@ var __exports__ = (() => {
|
|
|
17696
16510
|
var omerc_default = {
|
|
17697
16511
|
init: init10,
|
|
17698
16512
|
forward: forward9,
|
|
17699
|
-
inverse:
|
|
16513
|
+
inverse: inverse9,
|
|
17700
16514
|
names: names11
|
|
17701
16515
|
};
|
|
17702
16516
|
|
|
@@ -17710,6 +16524,7 @@ var __exports__ = (() => {
|
|
|
17710
16524
|
}
|
|
17711
16525
|
this.x0 = this.x0 || 0;
|
|
17712
16526
|
this.y0 = this.y0 || 0;
|
|
16527
|
+
this.long0 = this.long0 || 0;
|
|
17713
16528
|
if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
|
|
17714
16529
|
return;
|
|
17715
16530
|
}
|
|
@@ -17723,7 +16538,7 @@ var __exports__ = (() => {
|
|
|
17723
16538
|
var cos2 = Math.cos(this.lat2);
|
|
17724
16539
|
var ms2 = msfnz_default(this.e, sin2, cos2);
|
|
17725
16540
|
var ts2 = tsfnz_default(this.e, this.lat2, sin2);
|
|
17726
|
-
var ts0 =
|
|
16541
|
+
var ts0 = tsfnz_default(this.e, this.lat0, Math.sin(this.lat0));
|
|
17727
16542
|
if (Math.abs(this.lat1 - this.lat2) > EPSLN) {
|
|
17728
16543
|
this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);
|
|
17729
16544
|
} else {
|
|
@@ -17733,7 +16548,7 @@ var __exports__ = (() => {
|
|
|
17733
16548
|
this.ns = sin1;
|
|
17734
16549
|
}
|
|
17735
16550
|
this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));
|
|
17736
|
-
this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);
|
|
16551
|
+
this.rh = Math.abs(Math.abs(this.lat0) - HALF_PI) < EPSLN ? 0 : this.a * this.f0 * Math.pow(ts0, this.ns);
|
|
17737
16552
|
if (!this.title) {
|
|
17738
16553
|
this.title = "Lambert Conformal Conic";
|
|
17739
16554
|
}
|
|
@@ -17761,7 +16576,7 @@ var __exports__ = (() => {
|
|
|
17761
16576
|
p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;
|
|
17762
16577
|
return p;
|
|
17763
16578
|
}
|
|
17764
|
-
function
|
|
16579
|
+
function inverse10(p) {
|
|
17765
16580
|
var rh1, con, ts;
|
|
17766
16581
|
var lat, lon;
|
|
17767
16582
|
var x = (p.x - this.x0) / this.k0;
|
|
@@ -17804,7 +16619,7 @@ var __exports__ = (() => {
|
|
|
17804
16619
|
var lcc_default = {
|
|
17805
16620
|
init: init11,
|
|
17806
16621
|
forward: forward10,
|
|
17807
|
-
inverse:
|
|
16622
|
+
inverse: inverse10,
|
|
17808
16623
|
names: names12
|
|
17809
16624
|
};
|
|
17810
16625
|
|
|
@@ -17859,7 +16674,7 @@ var __exports__ = (() => {
|
|
|
17859
16674
|
}
|
|
17860
16675
|
return p;
|
|
17861
16676
|
}
|
|
17862
|
-
function
|
|
16677
|
+
function inverse11(p) {
|
|
17863
16678
|
var u, deltav, s, d, eps, ro, fi1;
|
|
17864
16679
|
var ok;
|
|
17865
16680
|
var tmp = p.x;
|
|
@@ -17896,7 +16711,7 @@ var __exports__ = (() => {
|
|
|
17896
16711
|
var krovak_default = {
|
|
17897
16712
|
init: init12,
|
|
17898
16713
|
forward: forward11,
|
|
17899
|
-
inverse:
|
|
16714
|
+
inverse: inverse11,
|
|
17900
16715
|
names: names13
|
|
17901
16716
|
};
|
|
17902
16717
|
|
|
@@ -17985,7 +16800,7 @@ var __exports__ = (() => {
|
|
|
17985
16800
|
p.y = y + this.y0;
|
|
17986
16801
|
return p;
|
|
17987
16802
|
}
|
|
17988
|
-
function
|
|
16803
|
+
function inverse12(p) {
|
|
17989
16804
|
p.x -= this.x0;
|
|
17990
16805
|
p.y -= this.y0;
|
|
17991
16806
|
var x = p.x / this.a;
|
|
@@ -18022,7 +16837,7 @@ var __exports__ = (() => {
|
|
|
18022
16837
|
var cass_default = {
|
|
18023
16838
|
init: init13,
|
|
18024
16839
|
forward: forward12,
|
|
18025
|
-
inverse:
|
|
16840
|
+
inverse: inverse12,
|
|
18026
16841
|
names: names14
|
|
18027
16842
|
};
|
|
18028
16843
|
|
|
@@ -18199,7 +17014,7 @@ var __exports__ = (() => {
|
|
|
18199
17014
|
p.y = this.a * y + this.y0;
|
|
18200
17015
|
return p;
|
|
18201
17016
|
}
|
|
18202
|
-
function
|
|
17017
|
+
function inverse13(p) {
|
|
18203
17018
|
p.x -= this.x0;
|
|
18204
17019
|
p.y -= this.y0;
|
|
18205
17020
|
var x = p.x / this.a;
|
|
@@ -18286,7 +17101,7 @@ var __exports__ = (() => {
|
|
|
18286
17101
|
var laea_default = {
|
|
18287
17102
|
init: init14,
|
|
18288
17103
|
forward: forward13,
|
|
18289
|
-
inverse:
|
|
17104
|
+
inverse: inverse13,
|
|
18290
17105
|
names: names15,
|
|
18291
17106
|
S_POLE,
|
|
18292
17107
|
N_POLE,
|
|
@@ -18347,7 +17162,7 @@ var __exports__ = (() => {
|
|
|
18347
17162
|
p.y = y;
|
|
18348
17163
|
return p;
|
|
18349
17164
|
}
|
|
18350
|
-
function
|
|
17165
|
+
function inverse14(p) {
|
|
18351
17166
|
var rh1, qs, con, theta, lon, lat;
|
|
18352
17167
|
p.x -= this.x0;
|
|
18353
17168
|
p.y = this.rh - p.y + this.y0;
|
|
@@ -18398,7 +17213,7 @@ var __exports__ = (() => {
|
|
|
18398
17213
|
var aea_default = {
|
|
18399
17214
|
init: init15,
|
|
18400
17215
|
forward: forward14,
|
|
18401
|
-
inverse:
|
|
17216
|
+
inverse: inverse14,
|
|
18402
17217
|
names: names16,
|
|
18403
17218
|
phi1z
|
|
18404
17219
|
};
|
|
@@ -18436,7 +17251,7 @@ var __exports__ = (() => {
|
|
|
18436
17251
|
p.y = y;
|
|
18437
17252
|
return p;
|
|
18438
17253
|
}
|
|
18439
|
-
function
|
|
17254
|
+
function inverse15(p) {
|
|
18440
17255
|
var rh;
|
|
18441
17256
|
var sinc, cosc;
|
|
18442
17257
|
var c;
|
|
@@ -18464,7 +17279,7 @@ var __exports__ = (() => {
|
|
|
18464
17279
|
var gnom_default = {
|
|
18465
17280
|
init: init16,
|
|
18466
17281
|
forward: forward15,
|
|
18467
|
-
inverse:
|
|
17282
|
+
inverse: inverse15,
|
|
18468
17283
|
names: names17
|
|
18469
17284
|
};
|
|
18470
17285
|
|
|
@@ -18519,7 +17334,7 @@ var __exports__ = (() => {
|
|
|
18519
17334
|
p.y = y;
|
|
18520
17335
|
return p;
|
|
18521
17336
|
}
|
|
18522
|
-
function
|
|
17337
|
+
function inverse16(p) {
|
|
18523
17338
|
p.x -= this.x0;
|
|
18524
17339
|
p.y -= this.y0;
|
|
18525
17340
|
var lon, lat;
|
|
@@ -18538,7 +17353,7 @@ var __exports__ = (() => {
|
|
|
18538
17353
|
var cea_default = {
|
|
18539
17354
|
init: init17,
|
|
18540
17355
|
forward: forward16,
|
|
18541
|
-
inverse:
|
|
17356
|
+
inverse: inverse16,
|
|
18542
17357
|
names: names18
|
|
18543
17358
|
};
|
|
18544
17359
|
|
|
@@ -18561,7 +17376,7 @@ var __exports__ = (() => {
|
|
|
18561
17376
|
p.y = this.y0 + this.a * dlat;
|
|
18562
17377
|
return p;
|
|
18563
17378
|
}
|
|
18564
|
-
function
|
|
17379
|
+
function inverse17(p) {
|
|
18565
17380
|
var x = p.x;
|
|
18566
17381
|
var y = p.y;
|
|
18567
17382
|
p.x = adjust_lon_default(this.long0 + (x - this.x0) / (this.a * this.rc), this.over);
|
|
@@ -18572,7 +17387,7 @@ var __exports__ = (() => {
|
|
|
18572
17387
|
var eqc_default = {
|
|
18573
17388
|
init: init18,
|
|
18574
17389
|
forward: forward17,
|
|
18575
|
-
inverse:
|
|
17390
|
+
inverse: inverse17,
|
|
18576
17391
|
names: names19
|
|
18577
17392
|
};
|
|
18578
17393
|
|
|
@@ -18616,7 +17431,7 @@ var __exports__ = (() => {
|
|
|
18616
17431
|
p.y = y + this.y0;
|
|
18617
17432
|
return p;
|
|
18618
17433
|
}
|
|
18619
|
-
function
|
|
17434
|
+
function inverse18(p) {
|
|
18620
17435
|
var lon, lat, x, y, i;
|
|
18621
17436
|
var al, bl;
|
|
18622
17437
|
var phi, dphi;
|
|
@@ -18677,11 +17492,12 @@ var __exports__ = (() => {
|
|
|
18677
17492
|
var poly_default = {
|
|
18678
17493
|
init: init19,
|
|
18679
17494
|
forward: forward18,
|
|
18680
|
-
inverse:
|
|
17495
|
+
inverse: inverse18,
|
|
18681
17496
|
names: names20
|
|
18682
17497
|
};
|
|
18683
17498
|
|
|
18684
17499
|
// ../../node_modules/proj4/lib/projections/nzmg.js
|
|
17500
|
+
var iterations = 1;
|
|
18685
17501
|
function init20() {
|
|
18686
17502
|
this.A = [];
|
|
18687
17503
|
this.A[1] = 0.6399175073;
|
|
@@ -18767,7 +17583,7 @@ var __exports__ = (() => {
|
|
|
18767
17583
|
p.y = z_re * this.a + this.y0;
|
|
18768
17584
|
return p;
|
|
18769
17585
|
}
|
|
18770
|
-
function
|
|
17586
|
+
function inverse19(p) {
|
|
18771
17587
|
var n;
|
|
18772
17588
|
var x = p.x;
|
|
18773
17589
|
var y = p.y;
|
|
@@ -18838,8 +17654,9 @@ var __exports__ = (() => {
|
|
|
18838
17654
|
var nzmg_default = {
|
|
18839
17655
|
init: init20,
|
|
18840
17656
|
forward: forward19,
|
|
18841
|
-
inverse:
|
|
18842
|
-
names: names21
|
|
17657
|
+
inverse: inverse19,
|
|
17658
|
+
names: names21,
|
|
17659
|
+
iterations
|
|
18843
17660
|
};
|
|
18844
17661
|
|
|
18845
17662
|
// ../../node_modules/proj4/lib/projections/mill.js
|
|
@@ -18855,7 +17672,7 @@ var __exports__ = (() => {
|
|
|
18855
17672
|
p.y = y;
|
|
18856
17673
|
return p;
|
|
18857
17674
|
}
|
|
18858
|
-
function
|
|
17675
|
+
function inverse20(p) {
|
|
18859
17676
|
p.x -= this.x0;
|
|
18860
17677
|
p.y -= this.y0;
|
|
18861
17678
|
var lon = adjust_lon_default(this.long0 + p.x / this.a, this.over);
|
|
@@ -18868,7 +17685,7 @@ var __exports__ = (() => {
|
|
|
18868
17685
|
var mill_default = {
|
|
18869
17686
|
init: init21,
|
|
18870
17687
|
forward: forward20,
|
|
18871
|
-
inverse:
|
|
17688
|
+
inverse: inverse20,
|
|
18872
17689
|
names: names22
|
|
18873
17690
|
};
|
|
18874
17691
|
|
|
@@ -18916,7 +17733,7 @@ var __exports__ = (() => {
|
|
|
18916
17733
|
p.y = y;
|
|
18917
17734
|
return p;
|
|
18918
17735
|
}
|
|
18919
|
-
function
|
|
17736
|
+
function inverse21(p) {
|
|
18920
17737
|
var lat, temp, lon, s;
|
|
18921
17738
|
p.x -= this.x0;
|
|
18922
17739
|
lon = p.x / this.a;
|
|
@@ -18951,7 +17768,7 @@ var __exports__ = (() => {
|
|
|
18951
17768
|
var sinu_default = {
|
|
18952
17769
|
init: init22,
|
|
18953
17770
|
forward: forward21,
|
|
18954
|
-
inverse:
|
|
17771
|
+
inverse: inverse21,
|
|
18955
17772
|
names: names23
|
|
18956
17773
|
};
|
|
18957
17774
|
|
|
@@ -18966,12 +17783,12 @@ var __exports__ = (() => {
|
|
|
18966
17783
|
this.C_x = this.C_y / (this.m + 1);
|
|
18967
17784
|
}
|
|
18968
17785
|
var forward22 = forward21;
|
|
18969
|
-
var
|
|
17786
|
+
var inverse22 = inverse21;
|
|
18970
17787
|
var names24 = ["Eckert_VI", "eck6"];
|
|
18971
17788
|
var eck6_default = {
|
|
18972
17789
|
init: init23,
|
|
18973
17790
|
forward: forward22,
|
|
18974
|
-
inverse:
|
|
17791
|
+
inverse: inverse22,
|
|
18975
17792
|
names: names24
|
|
18976
17793
|
};
|
|
18977
17794
|
|
|
@@ -19004,7 +17821,7 @@ var __exports__ = (() => {
|
|
|
19004
17821
|
p.y = y;
|
|
19005
17822
|
return p;
|
|
19006
17823
|
}
|
|
19007
|
-
function
|
|
17824
|
+
function inverse23(p) {
|
|
19008
17825
|
var theta;
|
|
19009
17826
|
var arg;
|
|
19010
17827
|
p.x -= this.x0;
|
|
@@ -19034,7 +17851,7 @@ var __exports__ = (() => {
|
|
|
19034
17851
|
var moll_default = {
|
|
19035
17852
|
init: init24,
|
|
19036
17853
|
forward: forward23,
|
|
19037
|
-
inverse:
|
|
17854
|
+
inverse: inverse23,
|
|
19038
17855
|
names: names25
|
|
19039
17856
|
};
|
|
19040
17857
|
|
|
@@ -19085,7 +17902,7 @@ var __exports__ = (() => {
|
|
|
19085
17902
|
p.y = y;
|
|
19086
17903
|
return p;
|
|
19087
17904
|
}
|
|
19088
|
-
function
|
|
17905
|
+
function inverse24(p) {
|
|
19089
17906
|
p.x -= this.x0;
|
|
19090
17907
|
p.y = this.rh - p.y + this.y0;
|
|
19091
17908
|
var con, rh1, lat, lon;
|
|
@@ -19119,7 +17936,7 @@ var __exports__ = (() => {
|
|
|
19119
17936
|
var eqdc_default = {
|
|
19120
17937
|
init: init25,
|
|
19121
17938
|
forward: forward24,
|
|
19122
|
-
inverse:
|
|
17939
|
+
inverse: inverse24,
|
|
19123
17940
|
names: names26
|
|
19124
17941
|
};
|
|
19125
17942
|
|
|
@@ -19135,6 +17952,9 @@ var __exports__ = (() => {
|
|
|
19135
17952
|
if (Math.abs(lat) <= EPSLN) {
|
|
19136
17953
|
x = this.x0 + this.R * dlon;
|
|
19137
17954
|
y = this.y0;
|
|
17955
|
+
p.x = x;
|
|
17956
|
+
p.y = y;
|
|
17957
|
+
return p;
|
|
19138
17958
|
}
|
|
19139
17959
|
var theta = asinz_default(2 * Math.abs(lat / Math.PI));
|
|
19140
17960
|
if (Math.abs(dlon) <= EPSLN || Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
|
|
@@ -19144,6 +17964,9 @@ var __exports__ = (() => {
|
|
|
19144
17964
|
} else {
|
|
19145
17965
|
y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta);
|
|
19146
17966
|
}
|
|
17967
|
+
p.x = x;
|
|
17968
|
+
p.y = y;
|
|
17969
|
+
return p;
|
|
19147
17970
|
}
|
|
19148
17971
|
var al = 0.5 * Math.abs(Math.PI / dlon - dlon / Math.PI);
|
|
19149
17972
|
var asq = al * al;
|
|
@@ -19169,7 +17992,7 @@ var __exports__ = (() => {
|
|
|
19169
17992
|
p.y = y;
|
|
19170
17993
|
return p;
|
|
19171
17994
|
}
|
|
19172
|
-
function
|
|
17995
|
+
function inverse25(p) {
|
|
19173
17996
|
var lon, lat;
|
|
19174
17997
|
var xx, yy, xys, c1, c2, c3;
|
|
19175
17998
|
var a1;
|
|
@@ -19216,7 +18039,7 @@ var __exports__ = (() => {
|
|
|
19216
18039
|
var vandg_default = {
|
|
19217
18040
|
init: init26,
|
|
19218
18041
|
forward: forward25,
|
|
19219
|
-
inverse:
|
|
18042
|
+
inverse: inverse25,
|
|
19220
18043
|
names: names27
|
|
19221
18044
|
};
|
|
19222
18045
|
|
|
@@ -19301,6 +18124,9 @@ var __exports__ = (() => {
|
|
|
19301
18124
|
function init27() {
|
|
19302
18125
|
this.sin_p12 = Math.sin(this.lat0);
|
|
19303
18126
|
this.cos_p12 = Math.cos(this.lat0);
|
|
18127
|
+
this.x0 = this.x0 || 0;
|
|
18128
|
+
this.y0 = this.y0 || 0;
|
|
18129
|
+
this.long0 = this.long0 || 0;
|
|
19304
18130
|
this.f = this.es / (1 + Math.sqrt(1 - this.es));
|
|
19305
18131
|
}
|
|
19306
18132
|
function forward26(p) {
|
|
@@ -19346,18 +18172,19 @@ var __exports__ = (() => {
|
|
|
19346
18172
|
return p;
|
|
19347
18173
|
} else {
|
|
19348
18174
|
if (Math.abs(lon) < EPSLN && Math.abs(lat - this.lat0) < EPSLN) {
|
|
19349
|
-
p.x =
|
|
18175
|
+
p.x = this.x0;
|
|
18176
|
+
p.y = this.y0;
|
|
19350
18177
|
return p;
|
|
19351
18178
|
}
|
|
19352
18179
|
vars = vincentyInverse(this.lat0, this.long0, lat, lon, this.a, this.f);
|
|
19353
18180
|
azi1 = vars.azi1;
|
|
19354
|
-
p.x = vars.s12 * Math.sin(azi1);
|
|
19355
|
-
p.y = vars.s12 * Math.cos(azi1);
|
|
18181
|
+
p.x = this.x0 + vars.s12 * Math.sin(azi1);
|
|
18182
|
+
p.y = this.y0 + vars.s12 * Math.cos(azi1);
|
|
19356
18183
|
return p;
|
|
19357
18184
|
}
|
|
19358
18185
|
}
|
|
19359
18186
|
}
|
|
19360
|
-
function
|
|
18187
|
+
function inverse26(p) {
|
|
19361
18188
|
p.x -= this.x0;
|
|
19362
18189
|
p.y -= this.y0;
|
|
19363
18190
|
var rh, z, sinz, cosz, lon, lat, con, e0, e1, e2, e3, Mlp, M2, azi1, s12, vars;
|
|
@@ -19425,7 +18252,7 @@ var __exports__ = (() => {
|
|
|
19425
18252
|
var aeqd_default = {
|
|
19426
18253
|
init: init27,
|
|
19427
18254
|
forward: forward26,
|
|
19428
|
-
inverse:
|
|
18255
|
+
inverse: inverse26,
|
|
19429
18256
|
names: names28
|
|
19430
18257
|
};
|
|
19431
18258
|
|
|
@@ -19456,7 +18283,7 @@ var __exports__ = (() => {
|
|
|
19456
18283
|
p.y = y;
|
|
19457
18284
|
return p;
|
|
19458
18285
|
}
|
|
19459
|
-
function
|
|
18286
|
+
function inverse27(p) {
|
|
19460
18287
|
var rh;
|
|
19461
18288
|
var z;
|
|
19462
18289
|
var sinz, cosz;
|
|
@@ -19499,7 +18326,7 @@ var __exports__ = (() => {
|
|
|
19499
18326
|
var ortho_default = {
|
|
19500
18327
|
init: init28,
|
|
19501
18328
|
forward: forward27,
|
|
19502
|
-
inverse:
|
|
18329
|
+
inverse: inverse27,
|
|
19503
18330
|
names: names29
|
|
19504
18331
|
};
|
|
19505
18332
|
|
|
@@ -19636,7 +18463,7 @@ var __exports__ = (() => {
|
|
|
19636
18463
|
p.y = xy.y;
|
|
19637
18464
|
return p;
|
|
19638
18465
|
}
|
|
19639
|
-
function
|
|
18466
|
+
function inverse28(p) {
|
|
19640
18467
|
var lp = { lam: 0, phi: 0 };
|
|
19641
18468
|
var mu, nu, cosmu, tannu;
|
|
19642
18469
|
var tantheta, theta, cosphi, phi;
|
|
@@ -19793,7 +18620,7 @@ var __exports__ = (() => {
|
|
|
19793
18620
|
var qsc_default = {
|
|
19794
18621
|
init: init29,
|
|
19795
18622
|
forward: forward28,
|
|
19796
|
-
inverse:
|
|
18623
|
+
inverse: inverse28,
|
|
19797
18624
|
names: names30
|
|
19798
18625
|
};
|
|
19799
18626
|
|
|
@@ -19890,7 +18717,7 @@ var __exports__ = (() => {
|
|
|
19890
18717
|
xy.y = xy.y * this.a * FYC + this.y0;
|
|
19891
18718
|
return xy;
|
|
19892
18719
|
}
|
|
19893
|
-
function
|
|
18720
|
+
function inverse29(xy) {
|
|
19894
18721
|
var ll = {
|
|
19895
18722
|
x: (xy.x - this.x0) / (this.a * FXC),
|
|
19896
18723
|
y: Math.abs(xy.y - this.y0) / (this.a * FYC)
|
|
@@ -19932,7 +18759,7 @@ var __exports__ = (() => {
|
|
|
19932
18759
|
var robin_default = {
|
|
19933
18760
|
init: init30,
|
|
19934
18761
|
forward: forward29,
|
|
19935
|
-
inverse:
|
|
18762
|
+
inverse: inverse29,
|
|
19936
18763
|
names: names31
|
|
19937
18764
|
};
|
|
19938
18765
|
|
|
@@ -19944,7 +18771,7 @@ var __exports__ = (() => {
|
|
|
19944
18771
|
var point = geodeticToGeocentric(p, this.es, this.a);
|
|
19945
18772
|
return point;
|
|
19946
18773
|
}
|
|
19947
|
-
function
|
|
18774
|
+
function inverse30(p) {
|
|
19948
18775
|
var point = geocentricToGeodetic(p, this.es, this.a, this.b);
|
|
19949
18776
|
return point;
|
|
19950
18777
|
}
|
|
@@ -19952,7 +18779,7 @@ var __exports__ = (() => {
|
|
|
19952
18779
|
var geocent_default = {
|
|
19953
18780
|
init: init31,
|
|
19954
18781
|
forward: forward30,
|
|
19955
|
-
inverse:
|
|
18782
|
+
inverse: inverse30,
|
|
19956
18783
|
names: names32
|
|
19957
18784
|
};
|
|
19958
18785
|
|
|
@@ -20058,7 +18885,7 @@ var __exports__ = (() => {
|
|
|
20058
18885
|
p.y = y * this.a;
|
|
20059
18886
|
return p;
|
|
20060
18887
|
}
|
|
20061
|
-
function
|
|
18888
|
+
function inverse31(p) {
|
|
20062
18889
|
p.x /= this.a;
|
|
20063
18890
|
p.y /= this.a;
|
|
20064
18891
|
var r = { x: p.x, y: p.y };
|
|
@@ -20106,7 +18933,7 @@ var __exports__ = (() => {
|
|
|
20106
18933
|
var tpers_default = {
|
|
20107
18934
|
init: init32,
|
|
20108
18935
|
forward: forward31,
|
|
20109
|
-
inverse:
|
|
18936
|
+
inverse: inverse31,
|
|
20110
18937
|
names: names33
|
|
20111
18938
|
};
|
|
20112
18939
|
|
|
@@ -20179,7 +19006,7 @@ var __exports__ = (() => {
|
|
|
20179
19006
|
p.y = p.y * this.a;
|
|
20180
19007
|
return p;
|
|
20181
19008
|
}
|
|
20182
|
-
function
|
|
19009
|
+
function inverse32(p) {
|
|
20183
19010
|
var v_x = -1;
|
|
20184
19011
|
var v_y = 0;
|
|
20185
19012
|
var v_z = 0;
|
|
@@ -20240,7 +19067,7 @@ var __exports__ = (() => {
|
|
|
20240
19067
|
var geos_default = {
|
|
20241
19068
|
init: init33,
|
|
20242
19069
|
forward: forward32,
|
|
20243
|
-
inverse:
|
|
19070
|
+
inverse: inverse32,
|
|
20244
19071
|
names: names34
|
|
20245
19072
|
};
|
|
20246
19073
|
|
|
@@ -20278,7 +19105,7 @@ var __exports__ = (() => {
|
|
|
20278
19105
|
p.y = this.a * p.y + this.y0;
|
|
20279
19106
|
return p;
|
|
20280
19107
|
}
|
|
20281
|
-
function
|
|
19108
|
+
function inverse33(p) {
|
|
20282
19109
|
p.x = (p.x - this.x0) / this.a;
|
|
20283
19110
|
p.y = (p.y - this.y0) / this.a;
|
|
20284
19111
|
if (this.es !== 0) {
|
|
@@ -20310,7 +19137,7 @@ var __exports__ = (() => {
|
|
|
20310
19137
|
var eqearth_default = {
|
|
20311
19138
|
init: init34,
|
|
20312
19139
|
forward: forward33,
|
|
20313
|
-
inverse:
|
|
19140
|
+
inverse: inverse33,
|
|
20314
19141
|
names: names35
|
|
20315
19142
|
};
|
|
20316
19143
|
|
|
@@ -20473,15 +19300,15 @@ var __exports__ = (() => {
|
|
|
20473
19300
|
};
|
|
20474
19301
|
for (let i = 0; i < paramSetsKeys.length; i++) {
|
|
20475
19302
|
const setKey = paramSetsKeys[i];
|
|
20476
|
-
const
|
|
20477
|
-
const params2 = Object.entries(
|
|
19303
|
+
const set2 = paramSets[setKey];
|
|
19304
|
+
const params2 = Object.entries(set2);
|
|
20478
19305
|
const setHasParams = params2.some(
|
|
20479
19306
|
([p]) => typeof this[p] !== "undefined"
|
|
20480
19307
|
);
|
|
20481
19308
|
if (!setHasParams) {
|
|
20482
19309
|
continue;
|
|
20483
19310
|
}
|
|
20484
|
-
matchedSet =
|
|
19311
|
+
matchedSet = set2;
|
|
20485
19312
|
for (let ii = 0; ii < params2.length; ii++) {
|
|
20486
19313
|
const [inputParam, param] = params2[ii];
|
|
20487
19314
|
const val = parseParam(inputParam);
|
|
@@ -20508,7 +19335,7 @@ var __exports__ = (() => {
|
|
|
20508
19335
|
function forward34(p) {
|
|
20509
19336
|
return this.projectionType.forward(this, p);
|
|
20510
19337
|
}
|
|
20511
|
-
function
|
|
19338
|
+
function inverse34(p) {
|
|
20512
19339
|
return this.projectionType.inverse(this, p);
|
|
20513
19340
|
}
|
|
20514
19341
|
function createRotation(params2, how) {
|
|
@@ -20640,7 +19467,7 @@ var __exports__ = (() => {
|
|
|
20640
19467
|
var ob_tran_default = {
|
|
20641
19468
|
init: init36,
|
|
20642
19469
|
forward: forward34,
|
|
20643
|
-
inverse:
|
|
19470
|
+
inverse: inverse34,
|
|
20644
19471
|
names: names37
|
|
20645
19472
|
};
|
|
20646
19473
|
|
|
@@ -22399,8 +21226,10 @@ var __exports__ = (() => {
|
|
|
22399
21226
|
var I3SSource = class {
|
|
22400
21227
|
/** I3S format discriminator. */
|
|
22401
21228
|
type = "I3S" /* I3S */;
|
|
22402
|
-
/**
|
|
21229
|
+
/** Primary I3S loader used for root and child metadata requests. */
|
|
22403
21230
|
loader;
|
|
21231
|
+
/** Worker-capable loader used for binary tile content when supplied by the format loader. */
|
|
21232
|
+
contentLoader;
|
|
22404
21233
|
/** Root I3S layer URL. */
|
|
22405
21234
|
url;
|
|
22406
21235
|
/** Base path used for relative tile resource resolution. */
|
|
@@ -22435,6 +21264,7 @@ var __exports__ = (() => {
|
|
|
22435
21264
|
this.rootTileset = isTilesetRequest2(input) ? null : input;
|
|
22436
21265
|
this.tileset = this.rootTileset;
|
|
22437
21266
|
this.loader = request.loader;
|
|
21267
|
+
this.contentLoader = getI3SContentLoader(request.loader);
|
|
22438
21268
|
this.url = request.url;
|
|
22439
21269
|
this.basePath = request.basePath || path_exports.dirname(request.url);
|
|
22440
21270
|
this.resolver = request.resolver;
|
|
@@ -22555,7 +21385,7 @@ var __exports__ = (() => {
|
|
|
22555
21385
|
isTileHeader: false
|
|
22556
21386
|
}
|
|
22557
21387
|
};
|
|
22558
|
-
tile.content = await this.loadResourceData(contentUrl, options);
|
|
21388
|
+
tile.content = await this.loadResourceData(contentUrl, options, this.contentLoader);
|
|
22559
21389
|
return { loaded: true };
|
|
22560
21390
|
}
|
|
22561
21391
|
/**
|
|
@@ -22690,11 +21520,11 @@ var __exports__ = (() => {
|
|
|
22690
21520
|
/**
|
|
22691
21521
|
* Loads data through injected core APIs so this module stays independent from `@loaders.gl/core`.
|
|
22692
21522
|
*/
|
|
22693
|
-
async loadWithCoreApi(url, options) {
|
|
21523
|
+
async loadWithCoreApi(url, options, loader = this.loader) {
|
|
22694
21524
|
if (!this.coreApi) {
|
|
22695
21525
|
throw new Error("I3SSource requires an injected coreApi to load tileset data");
|
|
22696
21526
|
}
|
|
22697
|
-
return await this.coreApi.load(url,
|
|
21527
|
+
return await this.coreApi.load(url, loader, options);
|
|
22698
21528
|
}
|
|
22699
21529
|
/**
|
|
22700
21530
|
* Loads data through an injected resolver when present, otherwise through the injected core API.
|
|
@@ -22721,11 +21551,11 @@ var __exports__ = (() => {
|
|
|
22721
21551
|
/**
|
|
22722
21552
|
* Loads tile metadata or content through an injected resolver when present, otherwise through the injected core API.
|
|
22723
21553
|
*/
|
|
22724
|
-
async loadResourceData(url, options) {
|
|
21554
|
+
async loadResourceData(url, options, loader = this.loader) {
|
|
22725
21555
|
if (this.resolver) {
|
|
22726
|
-
return await this.resolver.loadResource(url,
|
|
21556
|
+
return await this.resolver.loadResource(url, loader, options);
|
|
22727
21557
|
}
|
|
22728
|
-
return await this.loadWithCoreApi(url, options);
|
|
21558
|
+
return await this.loadWithCoreApi(url, options, loader);
|
|
22729
21559
|
}
|
|
22730
21560
|
/** Transform one I3S header bound after target options and elevation providers are available. */
|
|
22731
21561
|
async transformTileHeader(header) {
|
|
@@ -22748,6 +21578,9 @@ var __exports__ = (() => {
|
|
|
22748
21578
|
};
|
|
22749
21579
|
}
|
|
22750
21580
|
};
|
|
21581
|
+
function getI3SContentLoader(loader) {
|
|
21582
|
+
return loader.contentLoader || loader;
|
|
21583
|
+
}
|
|
22751
21584
|
function isTilesetRequest2(input) {
|
|
22752
21585
|
return Boolean(
|
|
22753
21586
|
input && typeof input === "object" && "url" in input && "loader" in input && !("type" in input)
|
|
@@ -23210,11 +22043,11 @@ var __exports__ = (() => {
|
|
|
23210
22043
|
getParentIndex(index) {
|
|
23211
22044
|
return { x: Math.floor(index.x / 2), y: Math.floor(index.y / 2), z: index.z - 1 };
|
|
23212
22045
|
}
|
|
23213
|
-
getTile(index,
|
|
22046
|
+
getTile(index, create2) {
|
|
23214
22047
|
const id = this.getTileId(index);
|
|
23215
22048
|
let tile = this._cache.get(id);
|
|
23216
22049
|
let needsReload = false;
|
|
23217
|
-
if (!tile &&
|
|
22050
|
+
if (!tile && create2) {
|
|
23218
22051
|
tile = new SharedTile2DHeader(index);
|
|
23219
22052
|
Object.assign(tile, this.getTileMetadata(tile.index));
|
|
23220
22053
|
Object.assign(tile, { id, zoom: this.getTileZoom(tile.index) });
|
|
@@ -23228,7 +22061,7 @@ var __exports__ = (() => {
|
|
|
23228
22061
|
if (tile) {
|
|
23229
22062
|
this._touchTile(id, tile);
|
|
23230
22063
|
}
|
|
23231
|
-
if (tile && needsReload &&
|
|
22064
|
+
if (tile && needsReload && create2) {
|
|
23232
22065
|
tile.loadData({
|
|
23233
22066
|
getData: this.opts.getTileData,
|
|
23234
22067
|
requestScheduler: this._requestScheduler,
|