@deck.gl/extensions 8.10.0-alpha.6 → 8.10.0-alpha.7
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 +491 -103
- package/dist/es5/path-style/path-style-extension.js +3 -3
- package/dist/es5/path-style/path-style-extension.js.map +1 -1
- package/dist/esm/path-style/path-style-extension.js +2 -2
- package/dist/esm/path-style/path-style-extension.js.map +1 -1
- package/dist.min.js +36 -36
- package/package.json +4 -5
- package/src/path-style/path-style-extension.ts +2 -2
package/dist/dist.dev.js
CHANGED
|
@@ -733,17 +733,24 @@ void main() {
|
|
|
733
733
|
fp64ifyMatrix4
|
|
734
734
|
};
|
|
735
735
|
|
|
736
|
-
// ../../node_modules/@math.gl/core/dist/
|
|
736
|
+
// ../../node_modules/@math.gl/core/dist/lib/common.js
|
|
737
737
|
var RADIANS_TO_DEGREES = 1 / Math.PI * 180;
|
|
738
738
|
var DEGREES_TO_RADIANS = 1 / 180 * Math.PI;
|
|
739
|
-
var
|
|
739
|
+
var DEFAULT_CONFIG = {
|
|
740
740
|
EPSILON: 1e-12,
|
|
741
741
|
debug: false,
|
|
742
742
|
precision: 4,
|
|
743
743
|
printTypes: false,
|
|
744
744
|
printDegrees: false,
|
|
745
|
-
printRowMajor: true
|
|
745
|
+
printRowMajor: true,
|
|
746
|
+
_cartographicRadians: false
|
|
746
747
|
};
|
|
748
|
+
globalThis.mathgl = globalThis.mathgl || {
|
|
749
|
+
config: {
|
|
750
|
+
...DEFAULT_CONFIG
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
var config = globalThis.mathgl.config;
|
|
747
754
|
function isArray(value) {
|
|
748
755
|
return Array.isArray(value) || ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
749
756
|
}
|
|
@@ -782,21 +789,72 @@ void main() {
|
|
|
782
789
|
}
|
|
783
790
|
}
|
|
784
791
|
|
|
785
|
-
// ../../node_modules/gl-matrix/
|
|
792
|
+
// ../../node_modules/@math.gl/core/dist/gl-matrix/common.js
|
|
793
|
+
var EPSILON = 1e-6;
|
|
786
794
|
var ARRAY_TYPE = typeof Float32Array !== "undefined" ? Float32Array : Array;
|
|
795
|
+
var RANDOM = Math.random;
|
|
796
|
+
function round(a) {
|
|
797
|
+
if (a >= 0)
|
|
798
|
+
return Math.round(a);
|
|
799
|
+
return a % 0.5 === 0 ? Math.floor(a) : Math.round(a);
|
|
800
|
+
}
|
|
787
801
|
var degree = Math.PI / 180;
|
|
788
|
-
if (!Math.hypot)
|
|
789
|
-
Math.hypot = function() {
|
|
790
|
-
var y = 0, i = arguments.length;
|
|
791
|
-
while (i--) {
|
|
792
|
-
y += arguments[i] * arguments[i];
|
|
793
|
-
}
|
|
794
|
-
return Math.sqrt(y);
|
|
795
|
-
};
|
|
796
802
|
|
|
797
|
-
// ../../node_modules/gl-matrix/
|
|
803
|
+
// ../../node_modules/@math.gl/core/dist/gl-matrix/vec3.js
|
|
804
|
+
var vec3_exports = {};
|
|
805
|
+
__export(vec3_exports, {
|
|
806
|
+
add: () => add,
|
|
807
|
+
angle: () => angle,
|
|
808
|
+
bezier: () => bezier,
|
|
809
|
+
ceil: () => ceil,
|
|
810
|
+
clone: () => clone,
|
|
811
|
+
copy: () => copy,
|
|
812
|
+
create: () => create,
|
|
813
|
+
cross: () => cross,
|
|
814
|
+
dist: () => dist,
|
|
815
|
+
distance: () => distance,
|
|
816
|
+
div: () => div,
|
|
817
|
+
divide: () => divide,
|
|
818
|
+
dot: () => dot,
|
|
819
|
+
equals: () => equals2,
|
|
820
|
+
exactEquals: () => exactEquals,
|
|
821
|
+
floor: () => floor,
|
|
822
|
+
forEach: () => forEach,
|
|
823
|
+
fromValues: () => fromValues,
|
|
824
|
+
hermite: () => hermite,
|
|
825
|
+
inverse: () => inverse,
|
|
826
|
+
len: () => len,
|
|
827
|
+
length: () => length,
|
|
828
|
+
lerp: () => lerp,
|
|
829
|
+
max: () => max,
|
|
830
|
+
min: () => min,
|
|
831
|
+
mul: () => mul,
|
|
832
|
+
multiply: () => multiply,
|
|
833
|
+
negate: () => negate,
|
|
834
|
+
normalize: () => normalize,
|
|
835
|
+
random: () => random,
|
|
836
|
+
rotateX: () => rotateX,
|
|
837
|
+
rotateY: () => rotateY,
|
|
838
|
+
rotateZ: () => rotateZ,
|
|
839
|
+
round: () => round2,
|
|
840
|
+
scale: () => scale,
|
|
841
|
+
scaleAndAdd: () => scaleAndAdd,
|
|
842
|
+
set: () => set,
|
|
843
|
+
slerp: () => slerp,
|
|
844
|
+
sqrDist: () => sqrDist,
|
|
845
|
+
sqrLen: () => sqrLen,
|
|
846
|
+
squaredDistance: () => squaredDistance,
|
|
847
|
+
squaredLength: () => squaredLength,
|
|
848
|
+
str: () => str,
|
|
849
|
+
sub: () => sub,
|
|
850
|
+
subtract: () => subtract,
|
|
851
|
+
transformMat3: () => transformMat3,
|
|
852
|
+
transformMat4: () => transformMat4,
|
|
853
|
+
transformQuat: () => transformQuat,
|
|
854
|
+
zero: () => zero
|
|
855
|
+
});
|
|
798
856
|
function create() {
|
|
799
|
-
|
|
857
|
+
const out = new ARRAY_TYPE(3);
|
|
800
858
|
if (ARRAY_TYPE != Float32Array) {
|
|
801
859
|
out[0] = 0;
|
|
802
860
|
out[1] = 0;
|
|
@@ -804,17 +862,347 @@ void main() {
|
|
|
804
862
|
}
|
|
805
863
|
return out;
|
|
806
864
|
}
|
|
865
|
+
function clone(a) {
|
|
866
|
+
const out = new ARRAY_TYPE(3);
|
|
867
|
+
out[0] = a[0];
|
|
868
|
+
out[1] = a[1];
|
|
869
|
+
out[2] = a[2];
|
|
870
|
+
return out;
|
|
871
|
+
}
|
|
872
|
+
function length(a) {
|
|
873
|
+
const x = a[0];
|
|
874
|
+
const y = a[1];
|
|
875
|
+
const z = a[2];
|
|
876
|
+
return Math.sqrt(x * x + y * y + z * z);
|
|
877
|
+
}
|
|
878
|
+
function fromValues(x, y, z) {
|
|
879
|
+
const out = new ARRAY_TYPE(3);
|
|
880
|
+
out[0] = x;
|
|
881
|
+
out[1] = y;
|
|
882
|
+
out[2] = z;
|
|
883
|
+
return out;
|
|
884
|
+
}
|
|
885
|
+
function copy(out, a) {
|
|
886
|
+
out[0] = a[0];
|
|
887
|
+
out[1] = a[1];
|
|
888
|
+
out[2] = a[2];
|
|
889
|
+
return out;
|
|
890
|
+
}
|
|
891
|
+
function set(out, x, y, z) {
|
|
892
|
+
out[0] = x;
|
|
893
|
+
out[1] = y;
|
|
894
|
+
out[2] = z;
|
|
895
|
+
return out;
|
|
896
|
+
}
|
|
897
|
+
function add(out, a, b) {
|
|
898
|
+
out[0] = a[0] + b[0];
|
|
899
|
+
out[1] = a[1] + b[1];
|
|
900
|
+
out[2] = a[2] + b[2];
|
|
901
|
+
return out;
|
|
902
|
+
}
|
|
903
|
+
function subtract(out, a, b) {
|
|
904
|
+
out[0] = a[0] - b[0];
|
|
905
|
+
out[1] = a[1] - b[1];
|
|
906
|
+
out[2] = a[2] - b[2];
|
|
907
|
+
return out;
|
|
908
|
+
}
|
|
909
|
+
function multiply(out, a, b) {
|
|
910
|
+
out[0] = a[0] * b[0];
|
|
911
|
+
out[1] = a[1] * b[1];
|
|
912
|
+
out[2] = a[2] * b[2];
|
|
913
|
+
return out;
|
|
914
|
+
}
|
|
915
|
+
function divide(out, a, b) {
|
|
916
|
+
out[0] = a[0] / b[0];
|
|
917
|
+
out[1] = a[1] / b[1];
|
|
918
|
+
out[2] = a[2] / b[2];
|
|
919
|
+
return out;
|
|
920
|
+
}
|
|
921
|
+
function ceil(out, a) {
|
|
922
|
+
out[0] = Math.ceil(a[0]);
|
|
923
|
+
out[1] = Math.ceil(a[1]);
|
|
924
|
+
out[2] = Math.ceil(a[2]);
|
|
925
|
+
return out;
|
|
926
|
+
}
|
|
927
|
+
function floor(out, a) {
|
|
928
|
+
out[0] = Math.floor(a[0]);
|
|
929
|
+
out[1] = Math.floor(a[1]);
|
|
930
|
+
out[2] = Math.floor(a[2]);
|
|
931
|
+
return out;
|
|
932
|
+
}
|
|
933
|
+
function min(out, a, b) {
|
|
934
|
+
out[0] = Math.min(a[0], b[0]);
|
|
935
|
+
out[1] = Math.min(a[1], b[1]);
|
|
936
|
+
out[2] = Math.min(a[2], b[2]);
|
|
937
|
+
return out;
|
|
938
|
+
}
|
|
939
|
+
function max(out, a, b) {
|
|
940
|
+
out[0] = Math.max(a[0], b[0]);
|
|
941
|
+
out[1] = Math.max(a[1], b[1]);
|
|
942
|
+
out[2] = Math.max(a[2], b[2]);
|
|
943
|
+
return out;
|
|
944
|
+
}
|
|
945
|
+
function round2(out, a) {
|
|
946
|
+
out[0] = round(a[0]);
|
|
947
|
+
out[1] = round(a[1]);
|
|
948
|
+
out[2] = round(a[2]);
|
|
949
|
+
return out;
|
|
950
|
+
}
|
|
951
|
+
function scale(out, a, b) {
|
|
952
|
+
out[0] = a[0] * b;
|
|
953
|
+
out[1] = a[1] * b;
|
|
954
|
+
out[2] = a[2] * b;
|
|
955
|
+
return out;
|
|
956
|
+
}
|
|
957
|
+
function scaleAndAdd(out, a, b, scale2) {
|
|
958
|
+
out[0] = a[0] + b[0] * scale2;
|
|
959
|
+
out[1] = a[1] + b[1] * scale2;
|
|
960
|
+
out[2] = a[2] + b[2] * scale2;
|
|
961
|
+
return out;
|
|
962
|
+
}
|
|
807
963
|
function distance(a, b) {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
return Math.
|
|
964
|
+
const x = b[0] - a[0];
|
|
965
|
+
const y = b[1] - a[1];
|
|
966
|
+
const z = b[2] - a[2];
|
|
967
|
+
return Math.sqrt(x * x + y * y + z * z);
|
|
968
|
+
}
|
|
969
|
+
function squaredDistance(a, b) {
|
|
970
|
+
const x = b[0] - a[0];
|
|
971
|
+
const y = b[1] - a[1];
|
|
972
|
+
const z = b[2] - a[2];
|
|
973
|
+
return x * x + y * y + z * z;
|
|
974
|
+
}
|
|
975
|
+
function squaredLength(a) {
|
|
976
|
+
const x = a[0];
|
|
977
|
+
const y = a[1];
|
|
978
|
+
const z = a[2];
|
|
979
|
+
return x * x + y * y + z * z;
|
|
980
|
+
}
|
|
981
|
+
function negate(out, a) {
|
|
982
|
+
out[0] = -a[0];
|
|
983
|
+
out[1] = -a[1];
|
|
984
|
+
out[2] = -a[2];
|
|
985
|
+
return out;
|
|
986
|
+
}
|
|
987
|
+
function inverse(out, a) {
|
|
988
|
+
out[0] = 1 / a[0];
|
|
989
|
+
out[1] = 1 / a[1];
|
|
990
|
+
out[2] = 1 / a[2];
|
|
991
|
+
return out;
|
|
992
|
+
}
|
|
993
|
+
function normalize(out, a) {
|
|
994
|
+
const x = a[0];
|
|
995
|
+
const y = a[1];
|
|
996
|
+
const z = a[2];
|
|
997
|
+
let len2 = x * x + y * y + z * z;
|
|
998
|
+
if (len2 > 0) {
|
|
999
|
+
len2 = 1 / Math.sqrt(len2);
|
|
1000
|
+
}
|
|
1001
|
+
out[0] = a[0] * len2;
|
|
1002
|
+
out[1] = a[1] * len2;
|
|
1003
|
+
out[2] = a[2] * len2;
|
|
1004
|
+
return out;
|
|
1005
|
+
}
|
|
1006
|
+
function dot(a, b) {
|
|
1007
|
+
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
1008
|
+
}
|
|
1009
|
+
function cross(out, a, b) {
|
|
1010
|
+
const ax = a[0];
|
|
1011
|
+
const ay = a[1];
|
|
1012
|
+
const az = a[2];
|
|
1013
|
+
const bx = b[0];
|
|
1014
|
+
const by = b[1];
|
|
1015
|
+
const bz = b[2];
|
|
1016
|
+
out[0] = ay * bz - az * by;
|
|
1017
|
+
out[1] = az * bx - ax * bz;
|
|
1018
|
+
out[2] = ax * by - ay * bx;
|
|
1019
|
+
return out;
|
|
1020
|
+
}
|
|
1021
|
+
function lerp(out, a, b, t) {
|
|
1022
|
+
const ax = a[0];
|
|
1023
|
+
const ay = a[1];
|
|
1024
|
+
const az = a[2];
|
|
1025
|
+
out[0] = ax + t * (b[0] - ax);
|
|
1026
|
+
out[1] = ay + t * (b[1] - ay);
|
|
1027
|
+
out[2] = az + t * (b[2] - az);
|
|
1028
|
+
return out;
|
|
1029
|
+
}
|
|
1030
|
+
function slerp(out, a, b, t) {
|
|
1031
|
+
const angle2 = Math.acos(Math.min(Math.max(dot(a, b), -1), 1));
|
|
1032
|
+
const sinTotal = Math.sin(angle2);
|
|
1033
|
+
const ratioA = Math.sin((1 - t) * angle2) / sinTotal;
|
|
1034
|
+
const ratioB = Math.sin(t * angle2) / sinTotal;
|
|
1035
|
+
out[0] = ratioA * a[0] + ratioB * b[0];
|
|
1036
|
+
out[1] = ratioA * a[1] + ratioB * b[1];
|
|
1037
|
+
out[2] = ratioA * a[2] + ratioB * b[2];
|
|
1038
|
+
return out;
|
|
1039
|
+
}
|
|
1040
|
+
function hermite(out, a, b, c, d, t) {
|
|
1041
|
+
const factorTimes2 = t * t;
|
|
1042
|
+
const factor1 = factorTimes2 * (2 * t - 3) + 1;
|
|
1043
|
+
const factor2 = factorTimes2 * (t - 2) + t;
|
|
1044
|
+
const factor3 = factorTimes2 * (t - 1);
|
|
1045
|
+
const factor4 = factorTimes2 * (3 - 2 * t);
|
|
1046
|
+
out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
|
|
1047
|
+
out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
|
|
1048
|
+
out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
|
|
1049
|
+
return out;
|
|
1050
|
+
}
|
|
1051
|
+
function bezier(out, a, b, c, d, t) {
|
|
1052
|
+
const inverseFactor = 1 - t;
|
|
1053
|
+
const inverseFactorTimesTwo = inverseFactor * inverseFactor;
|
|
1054
|
+
const factorTimes2 = t * t;
|
|
1055
|
+
const factor1 = inverseFactorTimesTwo * inverseFactor;
|
|
1056
|
+
const factor2 = 3 * t * inverseFactorTimesTwo;
|
|
1057
|
+
const factor3 = 3 * factorTimes2 * inverseFactor;
|
|
1058
|
+
const factor4 = factorTimes2 * t;
|
|
1059
|
+
out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
|
|
1060
|
+
out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
|
|
1061
|
+
out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
|
|
1062
|
+
return out;
|
|
1063
|
+
}
|
|
1064
|
+
function random(out, scale2) {
|
|
1065
|
+
scale2 = scale2 === void 0 ? 1 : scale2;
|
|
1066
|
+
const r = RANDOM() * 2 * Math.PI;
|
|
1067
|
+
const z = RANDOM() * 2 - 1;
|
|
1068
|
+
const zScale = Math.sqrt(1 - z * z) * scale2;
|
|
1069
|
+
out[0] = Math.cos(r) * zScale;
|
|
1070
|
+
out[1] = Math.sin(r) * zScale;
|
|
1071
|
+
out[2] = z * scale2;
|
|
1072
|
+
return out;
|
|
1073
|
+
}
|
|
1074
|
+
function transformMat4(out, a, m) {
|
|
1075
|
+
const x = a[0];
|
|
1076
|
+
const y = a[1];
|
|
1077
|
+
const z = a[2];
|
|
1078
|
+
let w = m[3] * x + m[7] * y + m[11] * z + m[15];
|
|
1079
|
+
w = w || 1;
|
|
1080
|
+
out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;
|
|
1081
|
+
out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;
|
|
1082
|
+
out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;
|
|
1083
|
+
return out;
|
|
1084
|
+
}
|
|
1085
|
+
function transformMat3(out, a, m) {
|
|
1086
|
+
const x = a[0];
|
|
1087
|
+
const y = a[1];
|
|
1088
|
+
const z = a[2];
|
|
1089
|
+
out[0] = x * m[0] + y * m[3] + z * m[6];
|
|
1090
|
+
out[1] = x * m[1] + y * m[4] + z * m[7];
|
|
1091
|
+
out[2] = x * m[2] + y * m[5] + z * m[8];
|
|
1092
|
+
return out;
|
|
1093
|
+
}
|
|
1094
|
+
function transformQuat(out, a, q) {
|
|
1095
|
+
const qx = q[0];
|
|
1096
|
+
const qy = q[1];
|
|
1097
|
+
const qz = q[2];
|
|
1098
|
+
const qw = q[3];
|
|
1099
|
+
const x = a[0];
|
|
1100
|
+
const y = a[1];
|
|
1101
|
+
const z = a[2];
|
|
1102
|
+
let uvx = qy * z - qz * y;
|
|
1103
|
+
let uvy = qz * x - qx * z;
|
|
1104
|
+
let uvz = qx * y - qy * x;
|
|
1105
|
+
let uuvx = qy * uvz - qz * uvy;
|
|
1106
|
+
let uuvy = qz * uvx - qx * uvz;
|
|
1107
|
+
let uuvz = qx * uvy - qy * uvx;
|
|
1108
|
+
const w2 = qw * 2;
|
|
1109
|
+
uvx *= w2;
|
|
1110
|
+
uvy *= w2;
|
|
1111
|
+
uvz *= w2;
|
|
1112
|
+
uuvx *= 2;
|
|
1113
|
+
uuvy *= 2;
|
|
1114
|
+
uuvz *= 2;
|
|
1115
|
+
out[0] = x + uvx + uuvx;
|
|
1116
|
+
out[1] = y + uvy + uuvy;
|
|
1117
|
+
out[2] = z + uvz + uuvz;
|
|
1118
|
+
return out;
|
|
812
1119
|
}
|
|
1120
|
+
function rotateX(out, a, b, rad) {
|
|
1121
|
+
const p = [];
|
|
1122
|
+
const r = [];
|
|
1123
|
+
p[0] = a[0] - b[0];
|
|
1124
|
+
p[1] = a[1] - b[1];
|
|
1125
|
+
p[2] = a[2] - b[2];
|
|
1126
|
+
r[0] = p[0];
|
|
1127
|
+
r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);
|
|
1128
|
+
r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);
|
|
1129
|
+
out[0] = r[0] + b[0];
|
|
1130
|
+
out[1] = r[1] + b[1];
|
|
1131
|
+
out[2] = r[2] + b[2];
|
|
1132
|
+
return out;
|
|
1133
|
+
}
|
|
1134
|
+
function rotateY(out, a, b, rad) {
|
|
1135
|
+
const p = [];
|
|
1136
|
+
const r = [];
|
|
1137
|
+
p[0] = a[0] - b[0];
|
|
1138
|
+
p[1] = a[1] - b[1];
|
|
1139
|
+
p[2] = a[2] - b[2];
|
|
1140
|
+
r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);
|
|
1141
|
+
r[1] = p[1];
|
|
1142
|
+
r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);
|
|
1143
|
+
out[0] = r[0] + b[0];
|
|
1144
|
+
out[1] = r[1] + b[1];
|
|
1145
|
+
out[2] = r[2] + b[2];
|
|
1146
|
+
return out;
|
|
1147
|
+
}
|
|
1148
|
+
function rotateZ(out, a, b, rad) {
|
|
1149
|
+
const p = [];
|
|
1150
|
+
const r = [];
|
|
1151
|
+
p[0] = a[0] - b[0];
|
|
1152
|
+
p[1] = a[1] - b[1];
|
|
1153
|
+
p[2] = a[2] - b[2];
|
|
1154
|
+
r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);
|
|
1155
|
+
r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);
|
|
1156
|
+
r[2] = p[2];
|
|
1157
|
+
out[0] = r[0] + b[0];
|
|
1158
|
+
out[1] = r[1] + b[1];
|
|
1159
|
+
out[2] = r[2] + b[2];
|
|
1160
|
+
return out;
|
|
1161
|
+
}
|
|
1162
|
+
function angle(a, b) {
|
|
1163
|
+
const ax = a[0];
|
|
1164
|
+
const ay = a[1];
|
|
1165
|
+
const az = a[2];
|
|
1166
|
+
const bx = b[0];
|
|
1167
|
+
const by = b[1];
|
|
1168
|
+
const bz = b[2];
|
|
1169
|
+
const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));
|
|
1170
|
+
const cosine = mag && dot(a, b) / mag;
|
|
1171
|
+
return Math.acos(Math.min(Math.max(cosine, -1), 1));
|
|
1172
|
+
}
|
|
1173
|
+
function zero(out) {
|
|
1174
|
+
out[0] = 0;
|
|
1175
|
+
out[1] = 0;
|
|
1176
|
+
out[2] = 0;
|
|
1177
|
+
return out;
|
|
1178
|
+
}
|
|
1179
|
+
function str(a) {
|
|
1180
|
+
return "vec3(".concat(a[0], ", ").concat(a[1], ", ").concat(a[2], ")");
|
|
1181
|
+
}
|
|
1182
|
+
function exactEquals(a, b) {
|
|
1183
|
+
return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
|
|
1184
|
+
}
|
|
1185
|
+
function equals2(a, b) {
|
|
1186
|
+
const a0 = a[0];
|
|
1187
|
+
const a1 = a[1];
|
|
1188
|
+
const a2 = a[2];
|
|
1189
|
+
const b0 = b[0];
|
|
1190
|
+
const b1 = b[1];
|
|
1191
|
+
const b2 = b[2];
|
|
1192
|
+
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));
|
|
1193
|
+
}
|
|
1194
|
+
var sub = subtract;
|
|
1195
|
+
var mul = multiply;
|
|
1196
|
+
var div = divide;
|
|
813
1197
|
var dist = distance;
|
|
1198
|
+
var sqrDist = squaredDistance;
|
|
1199
|
+
var len = length;
|
|
1200
|
+
var sqrLen = squaredLength;
|
|
814
1201
|
var forEach = function() {
|
|
815
|
-
|
|
1202
|
+
const vec = create();
|
|
816
1203
|
return function(a, stride, offset, count, fn, arg) {
|
|
817
|
-
|
|
1204
|
+
let i;
|
|
1205
|
+
let l;
|
|
818
1206
|
if (!stride) {
|
|
819
1207
|
stride = 3;
|
|
820
1208
|
}
|
|
@@ -940,21 +1328,21 @@ vec4 project_position_to_clipspace(
|
|
|
940
1328
|
if (opts && "viewport" in opts) {
|
|
941
1329
|
const {
|
|
942
1330
|
viewProjectionMatrix,
|
|
943
|
-
scale
|
|
1331
|
+
scale: scale2
|
|
944
1332
|
} = opts.viewport;
|
|
945
1333
|
return getMemoizedUniforms({
|
|
946
1334
|
viewProjectionMatrix,
|
|
947
|
-
scale
|
|
1335
|
+
scale: scale2
|
|
948
1336
|
});
|
|
949
1337
|
}
|
|
950
1338
|
return {};
|
|
951
1339
|
}
|
|
952
1340
|
function calculateUniforms({
|
|
953
1341
|
viewProjectionMatrix,
|
|
954
|
-
scale
|
|
1342
|
+
scale: scale2
|
|
955
1343
|
}) {
|
|
956
1344
|
const glViewProjectionMatrixFP64 = fp64ifyMatrix42(viewProjectionMatrix);
|
|
957
|
-
const scaleFP64 = fp64ify2(
|
|
1345
|
+
const scaleFP64 = fp64ify2(scale2);
|
|
958
1346
|
return {
|
|
959
1347
|
project_uViewProjectionMatrixFP64: glViewProjectionMatrixFP64,
|
|
960
1348
|
project64_uViewProjectionMatrix: glViewProjectionMatrixFP64,
|
|
@@ -1164,7 +1552,7 @@ attribute float instanceOffsets;
|
|
|
1164
1552
|
p = isNested ? path[i] : path.slice(i * positionSize, i * positionSize + positionSize);
|
|
1165
1553
|
p = this.projectPosition(p);
|
|
1166
1554
|
if (i > 0) {
|
|
1167
|
-
result[i] = result[i - 1] + dist(prevP, p);
|
|
1555
|
+
result[i] = result[i - 1] + vec3_exports.dist(prevP, p);
|
|
1168
1556
|
}
|
|
1169
1557
|
prevP = p;
|
|
1170
1558
|
}
|
|
@@ -1175,11 +1563,11 @@ attribute float instanceOffsets;
|
|
|
1175
1563
|
__publicField(PathStyleExtension, "extensionName", "PathStyleExtension");
|
|
1176
1564
|
|
|
1177
1565
|
// src/fill-style/fill-style-extension.ts
|
|
1178
|
-
var
|
|
1179
|
-
var
|
|
1566
|
+
var import_core12 = __toESM(require_core());
|
|
1567
|
+
var import_core13 = __toESM(require_core2());
|
|
1180
1568
|
|
|
1181
1569
|
// src/fill-style/shaders.glsl.ts
|
|
1182
|
-
var
|
|
1570
|
+
var import_core11 = __toESM(require_core());
|
|
1183
1571
|
var patternVs = `
|
|
1184
1572
|
#ifdef NON_INSTANCED_MODEL
|
|
1185
1573
|
#define FILL_PATTERN_FRAME_ATTRIB fillPatternFrames
|
|
@@ -1263,7 +1651,7 @@ const float FILL_UV_SCALE = 512.0 / 40000000.0;
|
|
|
1263
1651
|
const {
|
|
1264
1652
|
project_uCommonOrigin: coordinateOriginCommon
|
|
1265
1653
|
} = uniforms;
|
|
1266
|
-
const coordinateOriginCommon64Low = [(0,
|
|
1654
|
+
const coordinateOriginCommon64Low = [(0, import_core11.fp64LowPart)(coordinateOriginCommon[0]), (0, import_core11.fp64LowPart)(coordinateOriginCommon[1])];
|
|
1267
1655
|
return {
|
|
1268
1656
|
fill_uvCoordinateOrigin: coordinateOriginCommon.slice(0, 2),
|
|
1269
1657
|
fill_uvCoordinateOrigin64Low: coordinateOriginCommon64Low,
|
|
@@ -1278,7 +1666,7 @@ const float FILL_UV_SCALE = 512.0 / 40000000.0;
|
|
|
1278
1666
|
vs: patternVs,
|
|
1279
1667
|
fs: patternFs,
|
|
1280
1668
|
inject: inject3,
|
|
1281
|
-
dependencies: [
|
|
1669
|
+
dependencies: [import_core11.project],
|
|
1282
1670
|
getUniforms: getPatternUniforms
|
|
1283
1671
|
};
|
|
1284
1672
|
|
|
@@ -1312,7 +1700,7 @@ const float FILL_UV_SCALE = 512.0 / 40000000.0;
|
|
|
1312
1700
|
value: [0, 0]
|
|
1313
1701
|
}
|
|
1314
1702
|
};
|
|
1315
|
-
var FillStyleExtension = class extends
|
|
1703
|
+
var FillStyleExtension = class extends import_core12.LayerExtension {
|
|
1316
1704
|
constructor({
|
|
1317
1705
|
pattern = false
|
|
1318
1706
|
} = {}) {
|
|
@@ -1379,7 +1767,7 @@ const float FILL_UV_SCALE = 512.0 / 40000000.0;
|
|
|
1379
1767
|
});
|
|
1380
1768
|
}
|
|
1381
1769
|
this.setState({
|
|
1382
|
-
emptyTexture: new
|
|
1770
|
+
emptyTexture: new import_core13.Texture2D(this.context.gl, {
|
|
1383
1771
|
data: new Uint8Array(4),
|
|
1384
1772
|
width: 1,
|
|
1385
1773
|
height: 1
|
|
@@ -1426,7 +1814,7 @@ const float FILL_UV_SCALE = 512.0 / 40000000.0;
|
|
|
1426
1814
|
__publicField(FillStyleExtension, "extensionName", "FillStyleExtension");
|
|
1427
1815
|
|
|
1428
1816
|
// src/clip/clip-extension.ts
|
|
1429
|
-
var
|
|
1817
|
+
var import_core14 = __toESM(require_core());
|
|
1430
1818
|
var defaultProps5 = {
|
|
1431
1819
|
clipBounds: [0, 0, 1, 1],
|
|
1432
1820
|
clipByInstance: void 0
|
|
@@ -1474,7 +1862,7 @@ varying vec2 clip_commonPosition;
|
|
|
1474
1862
|
if (!clip_isInBounds(clip_commonPosition)) discard;
|
|
1475
1863
|
`
|
|
1476
1864
|
};
|
|
1477
|
-
var ClipExtension = class extends
|
|
1865
|
+
var ClipExtension = class extends import_core14.LayerExtension {
|
|
1478
1866
|
getShaders() {
|
|
1479
1867
|
let clipByInstance = "instancePositions" in this.getAttributeManager().attributes;
|
|
1480
1868
|
if (this.props.clipByInstance !== void 0) {
|
|
@@ -1508,10 +1896,10 @@ varying vec2 clip_commonPosition;
|
|
|
1508
1896
|
__publicField(ClipExtension, "extensionName", "ClipExtension");
|
|
1509
1897
|
|
|
1510
1898
|
// src/collision-filter/collision-filter-extension.ts
|
|
1511
|
-
var
|
|
1899
|
+
var import_core27 = __toESM(require_core());
|
|
1512
1900
|
|
|
1513
1901
|
// src/collision-filter/shader-module.ts
|
|
1514
|
-
var
|
|
1902
|
+
var import_core15 = __toESM(require_core());
|
|
1515
1903
|
var vs3 = `
|
|
1516
1904
|
#ifdef NON_INSTANCED_MODEL
|
|
1517
1905
|
attribute float collisionPriorities;
|
|
@@ -1606,24 +1994,24 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1606
1994
|
};
|
|
1607
1995
|
var shader_module_default2 = {
|
|
1608
1996
|
name: "collision",
|
|
1609
|
-
dependencies: [
|
|
1997
|
+
dependencies: [import_core15.project],
|
|
1610
1998
|
vs: vs3,
|
|
1611
1999
|
inject: inject4,
|
|
1612
2000
|
getUniforms: getCollisionUniforms
|
|
1613
2001
|
};
|
|
1614
2002
|
|
|
1615
2003
|
// src/collision-filter/collision-filter-effect.ts
|
|
1616
|
-
var
|
|
1617
|
-
var
|
|
2004
|
+
var import_core24 = __toESM(require_core2());
|
|
2005
|
+
var import_core26 = __toESM(require_core());
|
|
1618
2006
|
|
|
1619
2007
|
// src/collision-filter/collision-filter-pass.ts
|
|
1620
|
-
var
|
|
1621
|
-
var
|
|
1622
|
-
var CollisionFilterPass = class extends
|
|
2008
|
+
var import_core16 = __toESM(require_core2());
|
|
2009
|
+
var import_core17 = __toESM(require_core());
|
|
2010
|
+
var CollisionFilterPass = class extends import_core17._LayersPass {
|
|
1623
2011
|
renderCollisionMap(target, options) {
|
|
1624
2012
|
const gl = this.gl;
|
|
1625
2013
|
const padding = 1;
|
|
1626
|
-
return (0,
|
|
2014
|
+
return (0, import_core16.withParameters)(gl, {
|
|
1627
2015
|
scissorTest: true,
|
|
1628
2016
|
scissor: [padding, padding, target.width - 2 * padding, target.height - 2 * padding],
|
|
1629
2017
|
clearColor: [0, 0, 0, 0],
|
|
@@ -1647,19 +2035,19 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1647
2035
|
};
|
|
1648
2036
|
|
|
1649
2037
|
// src/mask/mask-effect.ts
|
|
1650
|
-
var
|
|
1651
|
-
var
|
|
2038
|
+
var import_core21 = __toESM(require_core());
|
|
2039
|
+
var import_core22 = __toESM(require_core2());
|
|
1652
2040
|
|
|
1653
2041
|
// src/mask/mask-pass.ts
|
|
1654
|
-
var
|
|
1655
|
-
var
|
|
1656
|
-
var MaskPass = class extends
|
|
2042
|
+
var import_core18 = __toESM(require_core2());
|
|
2043
|
+
var import_core19 = __toESM(require_core());
|
|
2044
|
+
var MaskPass = class extends import_core19._LayersPass {
|
|
1657
2045
|
constructor(gl, props) {
|
|
1658
2046
|
super(gl, props);
|
|
1659
2047
|
const {
|
|
1660
2048
|
mapSize = 2048
|
|
1661
2049
|
} = props;
|
|
1662
|
-
this.maskMap = new
|
|
2050
|
+
this.maskMap = new import_core18.Texture2D(gl, {
|
|
1663
2051
|
width: mapSize,
|
|
1664
2052
|
height: mapSize,
|
|
1665
2053
|
parameters: {
|
|
@@ -1669,7 +2057,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1669
2057
|
[10243]: 33071
|
|
1670
2058
|
}
|
|
1671
2059
|
});
|
|
1672
|
-
this.fbo = new
|
|
2060
|
+
this.fbo = new import_core18.Framebuffer(gl, {
|
|
1673
2061
|
id: "maskmap",
|
|
1674
2062
|
width: mapSize,
|
|
1675
2063
|
height: mapSize,
|
|
@@ -1682,7 +2070,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1682
2070
|
const gl = this.gl;
|
|
1683
2071
|
const colorMask = [false, false, false, false];
|
|
1684
2072
|
colorMask[options.channel] = true;
|
|
1685
|
-
return (0,
|
|
2073
|
+
return (0, import_core18.withParameters)(gl, {
|
|
1686
2074
|
clearColor: [255, 255, 255, 255],
|
|
1687
2075
|
blend: true,
|
|
1688
2076
|
blendFunc: [0, 1],
|
|
@@ -1705,7 +2093,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1705
2093
|
};
|
|
1706
2094
|
|
|
1707
2095
|
// src/utils/projection-utils.ts
|
|
1708
|
-
var
|
|
2096
|
+
var import_core20 = __toESM(require_core());
|
|
1709
2097
|
function joinLayerBounds(layers, viewport) {
|
|
1710
2098
|
const bounds = [Infinity, Infinity, -Infinity, -Infinity];
|
|
1711
2099
|
for (const layer of layers) {
|
|
@@ -1752,12 +2140,12 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1752
2140
|
if (zoom === void 0) {
|
|
1753
2141
|
width = width - border * 2;
|
|
1754
2142
|
height = height - border * 2;
|
|
1755
|
-
const
|
|
1756
|
-
zoom = Math.min(Math.log2(
|
|
2143
|
+
const scale2 = Math.min(width / (bounds[2] - bounds[0]), height / (bounds[3] - bounds[1]));
|
|
2144
|
+
zoom = Math.min(Math.log2(scale2), 20);
|
|
1757
2145
|
} else if (!width || !height) {
|
|
1758
|
-
const
|
|
1759
|
-
width = Math.round(Math.abs(bounds[2] - bounds[0]) *
|
|
1760
|
-
height = Math.round(Math.abs(bounds[3] - bounds[1]) *
|
|
2146
|
+
const scale2 = 2 ** zoom;
|
|
2147
|
+
width = Math.round(Math.abs(bounds[2] - bounds[0]) * scale2);
|
|
2148
|
+
height = Math.round(Math.abs(bounds[3] - bounds[1]) * scale2);
|
|
1761
2149
|
const maxSize = MAX_VIEWPORT_SIZE - border * 2;
|
|
1762
2150
|
if (width > maxSize || height > maxSize) {
|
|
1763
2151
|
const r = maxSize / Math.max(width, height);
|
|
@@ -1766,7 +2154,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1766
2154
|
zoom += Math.log2(r);
|
|
1767
2155
|
}
|
|
1768
2156
|
}
|
|
1769
|
-
return isGeospatial ? new
|
|
2157
|
+
return isGeospatial ? new import_core20.WebMercatorViewport({
|
|
1770
2158
|
id: viewport.id,
|
|
1771
2159
|
x: border,
|
|
1772
2160
|
y: border,
|
|
@@ -1776,7 +2164,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1776
2164
|
latitude: centerWorld[1],
|
|
1777
2165
|
zoom,
|
|
1778
2166
|
orthographic: true
|
|
1779
|
-
}) : new
|
|
2167
|
+
}) : new import_core20.OrthographicViewport({
|
|
1780
2168
|
id: viewport.id,
|
|
1781
2169
|
x: border,
|
|
1782
2170
|
y: border,
|
|
@@ -1842,7 +2230,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1842
2230
|
}) {
|
|
1843
2231
|
let didRender = false;
|
|
1844
2232
|
if (!this.dummyMaskMap) {
|
|
1845
|
-
this.dummyMaskMap = new
|
|
2233
|
+
this.dummyMaskMap = new import_core22.Texture2D(gl, {
|
|
1846
2234
|
width: 1,
|
|
1847
2235
|
height: 1
|
|
1848
2236
|
});
|
|
@@ -1871,7 +2259,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1871
2259
|
const viewport = viewports[0];
|
|
1872
2260
|
const viewportChanged = !this.lastViewport || !this.lastViewport.equals(viewport);
|
|
1873
2261
|
if (viewport.resolution !== void 0) {
|
|
1874
|
-
|
|
2262
|
+
import_core21.log.warn("MaskExtension is not supported in GlobeView")();
|
|
1875
2263
|
return {
|
|
1876
2264
|
didRender
|
|
1877
2265
|
};
|
|
@@ -1956,7 +2344,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1956
2344
|
let channelInfo = channelMap[id];
|
|
1957
2345
|
if (!channelInfo) {
|
|
1958
2346
|
if (++channelCount > 4) {
|
|
1959
|
-
|
|
2347
|
+
import_core21.log.warn("Too many mask layers. The max supported is 4")();
|
|
1960
2348
|
continue;
|
|
1961
2349
|
}
|
|
1962
2350
|
channelInfo = {
|
|
@@ -2029,7 +2417,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
2029
2417
|
preRenderStats = {}
|
|
2030
2418
|
}) {
|
|
2031
2419
|
if (!this.dummyCollisionMap) {
|
|
2032
|
-
this.dummyCollisionMap = new
|
|
2420
|
+
this.dummyCollisionMap = new import_core24.Texture2D(gl, {
|
|
2033
2421
|
width: 1,
|
|
2034
2422
|
height: 1
|
|
2035
2423
|
});
|
|
@@ -2089,7 +2477,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
2089
2477
|
if (!oldRenderInfo) {
|
|
2090
2478
|
return;
|
|
2091
2479
|
}
|
|
2092
|
-
const needsRender = viewportChanged || renderInfo === oldRenderInfo || !(0,
|
|
2480
|
+
const needsRender = viewportChanged || renderInfo === oldRenderInfo || !(0, import_core26._deepEqual)(oldRenderInfo.layers, renderInfo.layers, 1) || renderInfo.layerBounds.some((b, i) => !equals(b, oldRenderInfo.layerBounds[i])) || renderInfo.allLayersLoaded !== oldRenderInfo.allLayersLoaded || renderInfo.layers.some((layer) => layer.props.transitions);
|
|
2093
2481
|
this.channels[collisionGroup] = renderInfo;
|
|
2094
2482
|
if (needsRender) {
|
|
2095
2483
|
this.lastViewport = viewport;
|
|
@@ -2105,7 +2493,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
2105
2493
|
views,
|
|
2106
2494
|
moduleParameters: {
|
|
2107
2495
|
dummyCollisionMap: this.dummyCollisionMap,
|
|
2108
|
-
devicePixelRatio: (0,
|
|
2496
|
+
devicePixelRatio: (0, import_core24.cssToDeviceRatio)(collisionFBO.gl) / DOWNSCALE
|
|
2109
2497
|
}
|
|
2110
2498
|
});
|
|
2111
2499
|
}
|
|
@@ -2177,7 +2565,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
2177
2565
|
width,
|
|
2178
2566
|
height
|
|
2179
2567
|
} = gl.canvas;
|
|
2180
|
-
const collisionMap = new
|
|
2568
|
+
const collisionMap = new import_core24.Texture2D(gl, {
|
|
2181
2569
|
width,
|
|
2182
2570
|
height,
|
|
2183
2571
|
parameters: {
|
|
@@ -2187,12 +2575,12 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
2187
2575
|
[10243]: 33071
|
|
2188
2576
|
}
|
|
2189
2577
|
});
|
|
2190
|
-
const depthBuffer = new
|
|
2578
|
+
const depthBuffer = new import_core24.Renderbuffer(gl, {
|
|
2191
2579
|
format: 33189,
|
|
2192
2580
|
width,
|
|
2193
2581
|
height
|
|
2194
2582
|
});
|
|
2195
|
-
this.collisionFBOs[collisionGroup] = new
|
|
2583
|
+
this.collisionFBOs[collisionGroup] = new import_core24.Framebuffer(gl, {
|
|
2196
2584
|
id: `Collision-${collisionGroup}`,
|
|
2197
2585
|
width,
|
|
2198
2586
|
height,
|
|
@@ -2225,7 +2613,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
2225
2613
|
},
|
|
2226
2614
|
collisionTestProps: {}
|
|
2227
2615
|
};
|
|
2228
|
-
var CollisionFilterExtension = class extends
|
|
2616
|
+
var CollisionFilterExtension = class extends import_core27.LayerExtension {
|
|
2229
2617
|
getShaders() {
|
|
2230
2618
|
return {
|
|
2231
2619
|
modules: [shader_module_default2]
|
|
@@ -2278,10 +2666,10 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
2278
2666
|
__publicField(CollisionFilterExtension, "extensionName", "CollisionFilterExtension");
|
|
2279
2667
|
|
|
2280
2668
|
// src/mask/mask-extension.ts
|
|
2281
|
-
var
|
|
2669
|
+
var import_core29 = __toESM(require_core());
|
|
2282
2670
|
|
|
2283
2671
|
// src/mask/shader-module.ts
|
|
2284
|
-
var
|
|
2672
|
+
var import_core28 = __toESM(require_core());
|
|
2285
2673
|
var vs4 = `
|
|
2286
2674
|
uniform vec4 mask_bounds;
|
|
2287
2675
|
uniform bool mask_maskByInstance;
|
|
@@ -2355,7 +2743,7 @@ varying vec2 mask_texCoords;
|
|
|
2355
2743
|
};
|
|
2356
2744
|
var shader_module_default3 = {
|
|
2357
2745
|
name: "mask",
|
|
2358
|
-
dependencies: [
|
|
2746
|
+
dependencies: [import_core28.project],
|
|
2359
2747
|
vs: vs4,
|
|
2360
2748
|
fs: fs3,
|
|
2361
2749
|
inject: inject5,
|
|
@@ -2368,7 +2756,7 @@ varying vec2 mask_texCoords;
|
|
|
2368
2756
|
maskByInstance: void 0,
|
|
2369
2757
|
maskInverted: false
|
|
2370
2758
|
};
|
|
2371
|
-
var MaskExtension = class extends
|
|
2759
|
+
var MaskExtension = class extends import_core29.LayerExtension {
|
|
2372
2760
|
initializeState() {
|
|
2373
2761
|
this.context.deck?._addDefaultEffect(new MaskEffect());
|
|
2374
2762
|
}
|
|
@@ -2410,8 +2798,8 @@ varying vec2 mask_texCoords;
|
|
|
2410
2798
|
uniforms.mask_enabled = true;
|
|
2411
2799
|
uniforms.mask_channel = index;
|
|
2412
2800
|
uniforms.mask_inverted = maskInverted;
|
|
2413
|
-
if (fromCoordinateSystem ===
|
|
2414
|
-
fromCoordinateSystem = viewport.isGeospatial ?
|
|
2801
|
+
if (fromCoordinateSystem === import_core29.COORDINATE_SYSTEM.DEFAULT) {
|
|
2802
|
+
fromCoordinateSystem = viewport.isGeospatial ? import_core29.COORDINATE_SYSTEM.LNGLAT : import_core29.COORDINATE_SYSTEM.CARTESIAN;
|
|
2415
2803
|
}
|
|
2416
2804
|
const opts = {
|
|
2417
2805
|
modelMatrix: null,
|
|
@@ -2423,7 +2811,7 @@ varying vec2 mask_texCoords;
|
|
|
2423
2811
|
uniforms.mask_bounds = [bl[0], bl[1], tr[0], tr[1]];
|
|
2424
2812
|
} else {
|
|
2425
2813
|
if (maskId) {
|
|
2426
|
-
|
|
2814
|
+
import_core29.log.warn(`Could not find a mask layer with id: ${maskId}`)();
|
|
2427
2815
|
}
|
|
2428
2816
|
uniforms.mask_enabled = false;
|
|
2429
2817
|
}
|
|
@@ -2433,14 +2821,14 @@ varying vec2 mask_texCoords;
|
|
|
2433
2821
|
__publicField(MaskExtension, "extensionName", "MaskExtension");
|
|
2434
2822
|
|
|
2435
2823
|
// src/terrain/terrain-extension.ts
|
|
2436
|
-
var
|
|
2824
|
+
var import_core39 = __toESM(require_core());
|
|
2437
2825
|
|
|
2438
2826
|
// src/terrain/terrain-effect.ts
|
|
2439
|
-
var
|
|
2440
|
-
var
|
|
2827
|
+
var import_core37 = __toESM(require_core2());
|
|
2828
|
+
var import_core38 = __toESM(require_core());
|
|
2441
2829
|
|
|
2442
2830
|
// src/terrain/shader-module.ts
|
|
2443
|
-
var
|
|
2831
|
+
var import_core30 = __toESM(require_core());
|
|
2444
2832
|
var TERRAIN_MODE = {
|
|
2445
2833
|
NONE: 0,
|
|
2446
2834
|
WRITE_HEIGHT_MAP: 1,
|
|
@@ -2452,7 +2840,7 @@ varying vec2 mask_texCoords;
|
|
|
2452
2840
|
var TERRAIN_MODE_CONSTANTS = Object.keys(TERRAIN_MODE).map((key) => `const float TERRAIN_MODE_${key} = ${TERRAIN_MODE[key]}.0;`).join("\n");
|
|
2453
2841
|
var terrainModule = {
|
|
2454
2842
|
name: "terrain",
|
|
2455
|
-
dependencies: [
|
|
2843
|
+
dependencies: [import_core30.project],
|
|
2456
2844
|
inject: {
|
|
2457
2845
|
"vs:#decl": `
|
|
2458
2846
|
uniform float terrain_mode;
|
|
@@ -2561,14 +2949,14 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
2561
2949
|
};
|
|
2562
2950
|
|
|
2563
2951
|
// src/terrain/utils.ts
|
|
2564
|
-
var
|
|
2952
|
+
var import_core31 = __toESM(require_core2());
|
|
2565
2953
|
function createRenderTarget(gl, opts) {
|
|
2566
|
-
return new
|
|
2954
|
+
return new import_core31.Framebuffer(gl, {
|
|
2567
2955
|
id: opts.id,
|
|
2568
2956
|
attachments: {
|
|
2569
|
-
[36064]: new
|
|
2957
|
+
[36064]: new import_core31.Texture2D(gl, {
|
|
2570
2958
|
...opts.float && {
|
|
2571
|
-
format: (0,
|
|
2959
|
+
format: (0, import_core31.isWebGL2)(gl) ? 34836 : 6408,
|
|
2572
2960
|
type: 5126
|
|
2573
2961
|
},
|
|
2574
2962
|
mipmaps: false,
|
|
@@ -2751,9 +3139,9 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
2751
3139
|
}
|
|
2752
3140
|
|
|
2753
3141
|
// src/terrain/terrain-pass.ts
|
|
2754
|
-
var
|
|
2755
|
-
var
|
|
2756
|
-
var TerrainPass = class extends
|
|
3142
|
+
var import_core32 = __toESM(require_core2());
|
|
3143
|
+
var import_core33 = __toESM(require_core());
|
|
3144
|
+
var TerrainPass = class extends import_core33._LayersPass {
|
|
2757
3145
|
getRenderableLayers(viewport, opts) {
|
|
2758
3146
|
const {
|
|
2759
3147
|
layers
|
|
@@ -2775,7 +3163,7 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
2775
3163
|
return;
|
|
2776
3164
|
}
|
|
2777
3165
|
target.resize(viewport);
|
|
2778
|
-
(0,
|
|
3166
|
+
(0, import_core32.withParameters)(this.gl, {
|
|
2779
3167
|
clearColor: [0, 0, 0, 0],
|
|
2780
3168
|
blend: true,
|
|
2781
3169
|
blendFunc: [1, 1],
|
|
@@ -2798,7 +3186,7 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
2798
3186
|
}
|
|
2799
3187
|
const layers = terrainCover.filterLayers(opts.layers);
|
|
2800
3188
|
target.resize(viewport);
|
|
2801
|
-
(0,
|
|
3189
|
+
(0, import_core32.withParameters)(this.gl, {
|
|
2802
3190
|
clearColor: [0, 0, 0, 0],
|
|
2803
3191
|
depthTest: false
|
|
2804
3192
|
}, () => this.render({
|
|
@@ -2813,9 +3201,9 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
2813
3201
|
};
|
|
2814
3202
|
|
|
2815
3203
|
// src/terrain/terrain-picking-pass.ts
|
|
2816
|
-
var
|
|
2817
|
-
var
|
|
2818
|
-
var TerrainPickingPass = class extends
|
|
3204
|
+
var import_core34 = __toESM(require_core());
|
|
3205
|
+
var import_core35 = __toESM(require_core2());
|
|
3206
|
+
var TerrainPickingPass = class extends import_core34._PickLayersPass {
|
|
2819
3207
|
drawParameters = {};
|
|
2820
3208
|
getRenderableLayers(viewport, opts) {
|
|
2821
3209
|
const {
|
|
@@ -2846,7 +3234,7 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
2846
3234
|
layers.unshift(terrainLayer);
|
|
2847
3235
|
}
|
|
2848
3236
|
target.resize(viewport);
|
|
2849
|
-
(0,
|
|
3237
|
+
(0, import_core35.withParameters)(this.gl, {
|
|
2850
3238
|
depthTest: false
|
|
2851
3239
|
}, () => this.render({
|
|
2852
3240
|
...opts,
|
|
@@ -2871,7 +3259,7 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
2871
3259
|
};
|
|
2872
3260
|
|
|
2873
3261
|
// src/terrain/height-map-builder.ts
|
|
2874
|
-
var
|
|
3262
|
+
var import_core36 = __toESM(require_core2());
|
|
2875
3263
|
var MAP_MAX_SIZE = 2048;
|
|
2876
3264
|
var HeightMapBuilder = class {
|
|
2877
3265
|
renderViewport = null;
|
|
@@ -2881,7 +3269,7 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
2881
3269
|
layersBoundsCommon = null;
|
|
2882
3270
|
lastViewport = null;
|
|
2883
3271
|
static isSupported(gl) {
|
|
2884
|
-
return
|
|
3272
|
+
return import_core36.Framebuffer.isSupported(gl, {
|
|
2885
3273
|
colorBufferFloat: true
|
|
2886
3274
|
});
|
|
2887
3275
|
}
|
|
@@ -2921,9 +3309,9 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
2921
3309
|
}
|
|
2922
3310
|
this.bounds = bounds;
|
|
2923
3311
|
this.lastViewport = viewport;
|
|
2924
|
-
const
|
|
2925
|
-
const pixelWidth = (bounds[2] - bounds[0]) *
|
|
2926
|
-
const pixelHeight = (bounds[3] - bounds[1]) *
|
|
3312
|
+
const scale2 = viewport.scale;
|
|
3313
|
+
const pixelWidth = (bounds[2] - bounds[0]) * scale2;
|
|
3314
|
+
const pixelHeight = (bounds[3] - bounds[1]) * scale2;
|
|
2927
3315
|
this.renderViewport = pixelWidth > 0 || pixelHeight > 0 ? makeViewport({
|
|
2928
3316
|
bounds: [viewport.center[0] - 1, viewport.center[1] - 1, viewport.center[0] + 1, viewport.center[1] + 1],
|
|
2929
3317
|
zoom: viewport.zoom,
|
|
@@ -2952,7 +3340,7 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
2952
3340
|
isDrapingEnabled = false;
|
|
2953
3341
|
terrainCovers = /* @__PURE__ */ new Map();
|
|
2954
3342
|
initialize(gl) {
|
|
2955
|
-
this.dummyHeightMap = new
|
|
3343
|
+
this.dummyHeightMap = new import_core37.Texture2D(gl, {
|
|
2956
3344
|
width: 1,
|
|
2957
3345
|
height: 1,
|
|
2958
3346
|
data: new Uint8Array([0, 0, 0, 0])
|
|
@@ -2966,9 +3354,9 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
2966
3354
|
if (HeightMapBuilder.isSupported(gl)) {
|
|
2967
3355
|
this.heightMap = new HeightMapBuilder(gl);
|
|
2968
3356
|
} else {
|
|
2969
|
-
|
|
3357
|
+
import_core38.log.warn("Terrain offset mode is not supported by this browser")();
|
|
2970
3358
|
}
|
|
2971
|
-
|
|
3359
|
+
import_core37.ProgramManager.getDefaultProgramManager(gl).addDefaultModule(terrainModule);
|
|
2972
3360
|
}
|
|
2973
3361
|
preRender(gl, opts) {
|
|
2974
3362
|
if (!this.dummyHeightMap) {
|
|
@@ -3121,7 +3509,7 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
3121
3509
|
var defaultProps8 = {
|
|
3122
3510
|
terrainDrawMode: void 0
|
|
3123
3511
|
};
|
|
3124
|
-
var TerrainExtension = class extends
|
|
3512
|
+
var TerrainExtension = class extends import_core39.LayerExtension {
|
|
3125
3513
|
getShaders() {
|
|
3126
3514
|
return {
|
|
3127
3515
|
modules: [terrainModule]
|