@loaders.gl/i3s 4.3.0-alpha.3 → 4.3.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arcgis-webscene-loader.js +1 -1
- package/dist/dist.dev.js +2336 -2181
- package/dist/dist.min.js +1 -1
- package/dist/i3s-attribute-loader.js +1 -1
- package/dist/i3s-building-scene-layer-loader.js +1 -1
- package/dist/i3s-content-loader.js +1 -1
- package/dist/i3s-content-worker-node.js +45 -46
- package/dist/i3s-content-worker-node.js.map +4 -4
- package/dist/i3s-content-worker.js +903 -748
- package/dist/i3s-loader.js +1 -1
- package/dist/i3s-node-page-loader.js +1 -1
- package/dist/i3s-slpk-loader.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/package.json +12 -12
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
var navigator_ = globalThis.navigator || {};
|
|
119
119
|
|
|
120
120
|
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
|
|
121
|
-
var VERSION = true ? "4.3.0-alpha.
|
|
121
|
+
var VERSION = true ? "4.3.0-alpha.3" : "untranspiled source";
|
|
122
122
|
var isBrowser3 = isBrowser2();
|
|
123
123
|
|
|
124
124
|
// ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
storage.setItem(x, x);
|
|
130
130
|
storage.removeItem(x);
|
|
131
131
|
return storage;
|
|
132
|
-
} catch (
|
|
132
|
+
} catch (e) {
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -616,7 +616,7 @@
|
|
|
616
616
|
});
|
|
617
617
|
|
|
618
618
|
// ../loader-utils/src/lib/log-utils/log.ts
|
|
619
|
-
var VERSION2 = true ? "4.3.0-alpha.
|
|
619
|
+
var VERSION2 = true ? "4.3.0-alpha.3" : "latest";
|
|
620
620
|
var version = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
|
|
621
621
|
function createLog() {
|
|
622
622
|
const log2 = new Log({ id: "loaders.gl" });
|
|
@@ -674,7 +674,7 @@
|
|
|
674
674
|
);
|
|
675
675
|
globalThis._loadersgl_.version = NPM_TAG;
|
|
676
676
|
} else {
|
|
677
|
-
globalThis._loadersgl_.version = "4.3.0-alpha.
|
|
677
|
+
globalThis._loadersgl_.version = "4.3.0-alpha.3";
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
680
|
return globalThis._loadersgl_.version;
|
|
@@ -1354,7 +1354,7 @@
|
|
|
1354
1354
|
script.id = id;
|
|
1355
1355
|
try {
|
|
1356
1356
|
script.appendChild(document.createTextNode(scriptSource));
|
|
1357
|
-
} catch (
|
|
1357
|
+
} catch (e) {
|
|
1358
1358
|
script.text = scriptSource;
|
|
1359
1359
|
}
|
|
1360
1360
|
document.body.appendChild(script);
|
|
@@ -1521,8 +1521,8 @@
|
|
|
1521
1521
|
}
|
|
1522
1522
|
const array1 = new Uint8Array(arrayBuffer1);
|
|
1523
1523
|
const array2 = new Uint8Array(arrayBuffer2);
|
|
1524
|
-
for (let
|
|
1525
|
-
if (array1[
|
|
1524
|
+
for (let i = 0; i < array1.length; ++i) {
|
|
1525
|
+
if (array1[i] !== array2[i]) {
|
|
1526
1526
|
return false;
|
|
1527
1527
|
}
|
|
1528
1528
|
}
|
|
@@ -1651,10 +1651,10 @@
|
|
|
1651
1651
|
let resolvedPath = "";
|
|
1652
1652
|
let resolvedAbsolute = false;
|
|
1653
1653
|
let cwd;
|
|
1654
|
-
for (let
|
|
1654
|
+
for (let i = paths.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
1655
1655
|
let path;
|
|
1656
|
-
if (
|
|
1657
|
-
path = paths[
|
|
1656
|
+
if (i >= 0) {
|
|
1657
|
+
path = paths[i];
|
|
1658
1658
|
} else {
|
|
1659
1659
|
if (cwd === void 0) {
|
|
1660
1660
|
cwd = getCWD();
|
|
@@ -1683,17 +1683,17 @@
|
|
|
1683
1683
|
let dots = 0;
|
|
1684
1684
|
let code;
|
|
1685
1685
|
let isAboveRoot = false;
|
|
1686
|
-
for (let
|
|
1687
|
-
if (
|
|
1688
|
-
code = path.charCodeAt(
|
|
1686
|
+
for (let i = 0; i <= path.length; ++i) {
|
|
1687
|
+
if (i < path.length) {
|
|
1688
|
+
code = path.charCodeAt(i);
|
|
1689
1689
|
} else if (code === SLASH) {
|
|
1690
1690
|
break;
|
|
1691
1691
|
} else {
|
|
1692
1692
|
code = SLASH;
|
|
1693
1693
|
}
|
|
1694
1694
|
if (code === SLASH) {
|
|
1695
|
-
if (lastSlash ===
|
|
1696
|
-
} else if (lastSlash !==
|
|
1695
|
+
if (lastSlash === i - 1 || dots === 1) {
|
|
1696
|
+
} else if (lastSlash !== i - 1 && dots === 2) {
|
|
1697
1697
|
if (res.length < 2 || !isAboveRoot || res.charCodeAt(res.length - 1) !== DOT || res.charCodeAt(res.length - 2) !== DOT) {
|
|
1698
1698
|
if (res.length > 2) {
|
|
1699
1699
|
const start = res.length - 1;
|
|
@@ -1705,14 +1705,14 @@
|
|
|
1705
1705
|
}
|
|
1706
1706
|
if (j !== start) {
|
|
1707
1707
|
res = j === -1 ? "" : res.slice(0, j);
|
|
1708
|
-
lastSlash =
|
|
1708
|
+
lastSlash = i;
|
|
1709
1709
|
dots = 0;
|
|
1710
1710
|
isAboveRoot = false;
|
|
1711
1711
|
continue;
|
|
1712
1712
|
}
|
|
1713
1713
|
} else if (res.length === 2 || res.length === 1) {
|
|
1714
1714
|
res = "";
|
|
1715
|
-
lastSlash =
|
|
1715
|
+
lastSlash = i;
|
|
1716
1716
|
dots = 0;
|
|
1717
1717
|
isAboveRoot = false;
|
|
1718
1718
|
continue;
|
|
@@ -1727,7 +1727,7 @@
|
|
|
1727
1727
|
isAboveRoot = true;
|
|
1728
1728
|
}
|
|
1729
1729
|
} else {
|
|
1730
|
-
const slice = path.slice(lastSlash + 1,
|
|
1730
|
+
const slice = path.slice(lastSlash + 1, i);
|
|
1731
1731
|
if (res.length > 0) {
|
|
1732
1732
|
res += `/${slice}`;
|
|
1733
1733
|
} else {
|
|
@@ -1735,7 +1735,7 @@
|
|
|
1735
1735
|
}
|
|
1736
1736
|
isAboveRoot = false;
|
|
1737
1737
|
}
|
|
1738
|
-
lastSlash =
|
|
1738
|
+
lastSlash = i;
|
|
1739
1739
|
dots = 0;
|
|
1740
1740
|
} else if (code === DOT && dots !== -1) {
|
|
1741
1741
|
++dots;
|
|
@@ -1913,7 +1913,7 @@
|
|
|
1913
1913
|
};
|
|
1914
1914
|
try {
|
|
1915
1915
|
const contentType = response.headers.get("Content-Type");
|
|
1916
|
-
info.reason = contentType?.includes("application/json") ? await response.json() : response.text();
|
|
1916
|
+
info.reason = !response.bodyUsed && contentType?.includes("application/json") ? await response.json() : await response.text();
|
|
1917
1917
|
} catch (error) {
|
|
1918
1918
|
}
|
|
1919
1919
|
return new FetchError(message, info);
|
|
@@ -1941,8 +1941,8 @@
|
|
|
1941
1941
|
function arrayBufferToBase64(buffer) {
|
|
1942
1942
|
let binary = "";
|
|
1943
1943
|
const bytes = new Uint8Array(buffer);
|
|
1944
|
-
for (let
|
|
1945
|
-
binary += String.fromCharCode(bytes[
|
|
1944
|
+
for (let i = 0; i < bytes.byteLength; i++) {
|
|
1945
|
+
binary += String.fromCharCode(bytes[i]);
|
|
1946
1946
|
}
|
|
1947
1947
|
return btoa(binary);
|
|
1948
1948
|
}
|
|
@@ -2379,8 +2379,8 @@
|
|
|
2379
2379
|
}
|
|
2380
2380
|
const dataView = new DataView(arrayBuffer);
|
|
2381
2381
|
let magic = "";
|
|
2382
|
-
for (let
|
|
2383
|
-
magic += String.fromCharCode(dataView.getUint8(byteOffset +
|
|
2382
|
+
for (let i = 0; i < length2; i++) {
|
|
2383
|
+
magic += String.fromCharCode(dataView.getUint8(byteOffset + i));
|
|
2384
2384
|
}
|
|
2385
2385
|
return magic;
|
|
2386
2386
|
}
|
|
@@ -2670,10 +2670,10 @@
|
|
|
2670
2670
|
let maxZ = -Infinity;
|
|
2671
2671
|
const positions = attributes.POSITION ? attributes.POSITION.value : [];
|
|
2672
2672
|
const len2 = positions && positions.length;
|
|
2673
|
-
for (let
|
|
2674
|
-
const x = positions[
|
|
2675
|
-
const y = positions[
|
|
2676
|
-
const z = positions[
|
|
2673
|
+
for (let i = 0; i < len2; i += 3) {
|
|
2674
|
+
const x = positions[i];
|
|
2675
|
+
const y = positions[i + 1];
|
|
2676
|
+
const z = positions[i + 2];
|
|
2677
2677
|
minX = x < minX ? x : minX;
|
|
2678
2678
|
minY = y < minY ? y : minY;
|
|
2679
2679
|
minZ = z < minZ ? z : minZ;
|
|
@@ -2774,34 +2774,34 @@
|
|
|
2774
2774
|
function degrees(radians2, result) {
|
|
2775
2775
|
return map(radians2, (radians3) => radians3 * RADIANS_TO_DEGREES, result);
|
|
2776
2776
|
}
|
|
2777
|
-
function equals(
|
|
2777
|
+
function equals(a, b, epsilon) {
|
|
2778
2778
|
const oldEpsilon = config.EPSILON;
|
|
2779
2779
|
if (epsilon) {
|
|
2780
2780
|
config.EPSILON = epsilon;
|
|
2781
2781
|
}
|
|
2782
2782
|
try {
|
|
2783
|
-
if (
|
|
2783
|
+
if (a === b) {
|
|
2784
2784
|
return true;
|
|
2785
2785
|
}
|
|
2786
|
-
if (isArray(
|
|
2787
|
-
if (
|
|
2786
|
+
if (isArray(a) && isArray(b)) {
|
|
2787
|
+
if (a.length !== b.length) {
|
|
2788
2788
|
return false;
|
|
2789
2789
|
}
|
|
2790
|
-
for (let
|
|
2791
|
-
if (!equals(
|
|
2790
|
+
for (let i = 0; i < a.length; ++i) {
|
|
2791
|
+
if (!equals(a[i], b[i])) {
|
|
2792
2792
|
return false;
|
|
2793
2793
|
}
|
|
2794
2794
|
}
|
|
2795
2795
|
return true;
|
|
2796
2796
|
}
|
|
2797
|
-
if (
|
|
2798
|
-
return
|
|
2797
|
+
if (a && a.equals) {
|
|
2798
|
+
return a.equals(b);
|
|
2799
2799
|
}
|
|
2800
2800
|
if (b && b.equals) {
|
|
2801
|
-
return b.equals(
|
|
2801
|
+
return b.equals(a);
|
|
2802
2802
|
}
|
|
2803
|
-
if (typeof
|
|
2804
|
-
return Math.abs(
|
|
2803
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
2804
|
+
return Math.abs(a - b) <= config.EPSILON * Math.max(1, Math.abs(a), Math.abs(b));
|
|
2805
2805
|
}
|
|
2806
2806
|
return false;
|
|
2807
2807
|
} finally {
|
|
@@ -2818,9 +2818,9 @@
|
|
|
2818
2818
|
if (isArray(value)) {
|
|
2819
2819
|
const array = value;
|
|
2820
2820
|
result = result || duplicateArray(array);
|
|
2821
|
-
for (let
|
|
2822
|
-
const val = typeof value === "number" ? value : value[
|
|
2823
|
-
result[
|
|
2821
|
+
for (let i = 0; i < result.length && i < array.length; ++i) {
|
|
2822
|
+
const val = typeof value === "number" ? value : value[i];
|
|
2823
|
+
result[i] = func(val, i, result);
|
|
2824
2824
|
}
|
|
2825
2825
|
return result;
|
|
2826
2826
|
}
|
|
@@ -2854,14 +2854,14 @@
|
|
|
2854
2854
|
return new this.constructor().copy(this);
|
|
2855
2855
|
}
|
|
2856
2856
|
fromArray(array, offset = 0) {
|
|
2857
|
-
for (let
|
|
2858
|
-
this[
|
|
2857
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2858
|
+
this[i] = array[i + offset];
|
|
2859
2859
|
}
|
|
2860
2860
|
return this.check();
|
|
2861
2861
|
}
|
|
2862
2862
|
toArray(targetArray = [], offset = 0) {
|
|
2863
|
-
for (let
|
|
2864
|
-
targetArray[offset +
|
|
2863
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2864
|
+
targetArray[offset + i] = this[i];
|
|
2865
2865
|
}
|
|
2866
2866
|
return targetArray;
|
|
2867
2867
|
}
|
|
@@ -2888,8 +2888,8 @@
|
|
|
2888
2888
|
}
|
|
2889
2889
|
formatString(opts) {
|
|
2890
2890
|
let string = "";
|
|
2891
|
-
for (let
|
|
2892
|
-
string += (
|
|
2891
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2892
|
+
string += (i > 0 ? ", " : "") + formatValue(this[i], opts);
|
|
2893
2893
|
}
|
|
2894
2894
|
return "".concat(opts.printTypes ? this.constructor.name : "", "[").concat(string, "]");
|
|
2895
2895
|
}
|
|
@@ -2897,8 +2897,8 @@
|
|
|
2897
2897
|
if (!array || this.length !== array.length) {
|
|
2898
2898
|
return false;
|
|
2899
2899
|
}
|
|
2900
|
-
for (let
|
|
2901
|
-
if (!equals(this[
|
|
2900
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2901
|
+
if (!equals(this[i], array[i])) {
|
|
2902
2902
|
return false;
|
|
2903
2903
|
}
|
|
2904
2904
|
}
|
|
@@ -2908,79 +2908,79 @@
|
|
|
2908
2908
|
if (!array || this.length !== array.length) {
|
|
2909
2909
|
return false;
|
|
2910
2910
|
}
|
|
2911
|
-
for (let
|
|
2912
|
-
if (this[
|
|
2911
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2912
|
+
if (this[i] !== array[i]) {
|
|
2913
2913
|
return false;
|
|
2914
2914
|
}
|
|
2915
2915
|
}
|
|
2916
2916
|
return true;
|
|
2917
2917
|
}
|
|
2918
2918
|
negate() {
|
|
2919
|
-
for (let
|
|
2920
|
-
this[
|
|
2919
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2920
|
+
this[i] = -this[i];
|
|
2921
2921
|
}
|
|
2922
2922
|
return this.check();
|
|
2923
2923
|
}
|
|
2924
|
-
lerp(
|
|
2925
|
-
if (
|
|
2926
|
-
return this.lerp(this,
|
|
2924
|
+
lerp(a, b, t) {
|
|
2925
|
+
if (t === void 0) {
|
|
2926
|
+
return this.lerp(this, a, b);
|
|
2927
2927
|
}
|
|
2928
|
-
for (let
|
|
2929
|
-
const ai =
|
|
2930
|
-
const endValue = typeof b === "number" ? b : b[
|
|
2931
|
-
this[
|
|
2928
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2929
|
+
const ai = a[i];
|
|
2930
|
+
const endValue = typeof b === "number" ? b : b[i];
|
|
2931
|
+
this[i] = ai + t * (endValue - ai);
|
|
2932
2932
|
}
|
|
2933
2933
|
return this.check();
|
|
2934
2934
|
}
|
|
2935
2935
|
min(vector) {
|
|
2936
|
-
for (let
|
|
2937
|
-
this[
|
|
2936
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2937
|
+
this[i] = Math.min(vector[i], this[i]);
|
|
2938
2938
|
}
|
|
2939
2939
|
return this.check();
|
|
2940
2940
|
}
|
|
2941
2941
|
max(vector) {
|
|
2942
|
-
for (let
|
|
2943
|
-
this[
|
|
2942
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2943
|
+
this[i] = Math.max(vector[i], this[i]);
|
|
2944
2944
|
}
|
|
2945
2945
|
return this.check();
|
|
2946
2946
|
}
|
|
2947
2947
|
clamp(minVector, maxVector) {
|
|
2948
|
-
for (let
|
|
2949
|
-
this[
|
|
2948
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2949
|
+
this[i] = Math.min(Math.max(this[i], minVector[i]), maxVector[i]);
|
|
2950
2950
|
}
|
|
2951
2951
|
return this.check();
|
|
2952
2952
|
}
|
|
2953
2953
|
add(...vectors) {
|
|
2954
2954
|
for (const vector of vectors) {
|
|
2955
|
-
for (let
|
|
2956
|
-
this[
|
|
2955
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2956
|
+
this[i] += vector[i];
|
|
2957
2957
|
}
|
|
2958
2958
|
}
|
|
2959
2959
|
return this.check();
|
|
2960
2960
|
}
|
|
2961
2961
|
subtract(...vectors) {
|
|
2962
2962
|
for (const vector of vectors) {
|
|
2963
|
-
for (let
|
|
2964
|
-
this[
|
|
2963
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2964
|
+
this[i] -= vector[i];
|
|
2965
2965
|
}
|
|
2966
2966
|
}
|
|
2967
2967
|
return this.check();
|
|
2968
2968
|
}
|
|
2969
2969
|
scale(scale3) {
|
|
2970
2970
|
if (typeof scale3 === "number") {
|
|
2971
|
-
for (let
|
|
2972
|
-
this[
|
|
2971
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2972
|
+
this[i] *= scale3;
|
|
2973
2973
|
}
|
|
2974
2974
|
} else {
|
|
2975
|
-
for (let
|
|
2976
|
-
this[
|
|
2975
|
+
for (let i = 0; i < this.ELEMENTS && i < scale3.length; ++i) {
|
|
2976
|
+
this[i] *= scale3[i];
|
|
2977
2977
|
}
|
|
2978
2978
|
}
|
|
2979
2979
|
return this.check();
|
|
2980
2980
|
}
|
|
2981
2981
|
multiplyByScalar(scalar) {
|
|
2982
|
-
for (let
|
|
2983
|
-
this[
|
|
2982
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2983
|
+
this[i] *= scalar;
|
|
2984
2984
|
}
|
|
2985
2985
|
return this.check();
|
|
2986
2986
|
}
|
|
@@ -2992,41 +2992,41 @@
|
|
|
2992
2992
|
}
|
|
2993
2993
|
validate() {
|
|
2994
2994
|
let valid = this.length === this.ELEMENTS;
|
|
2995
|
-
for (let
|
|
2996
|
-
valid = valid && Number.isFinite(this[
|
|
2995
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2996
|
+
valid = valid && Number.isFinite(this[i]);
|
|
2997
2997
|
}
|
|
2998
2998
|
return valid;
|
|
2999
2999
|
}
|
|
3000
|
-
sub(
|
|
3001
|
-
return this.subtract(
|
|
3000
|
+
sub(a) {
|
|
3001
|
+
return this.subtract(a);
|
|
3002
3002
|
}
|
|
3003
|
-
setScalar(
|
|
3004
|
-
for (let
|
|
3005
|
-
this[
|
|
3003
|
+
setScalar(a) {
|
|
3004
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3005
|
+
this[i] = a;
|
|
3006
3006
|
}
|
|
3007
3007
|
return this.check();
|
|
3008
3008
|
}
|
|
3009
|
-
addScalar(
|
|
3010
|
-
for (let
|
|
3011
|
-
this[
|
|
3009
|
+
addScalar(a) {
|
|
3010
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3011
|
+
this[i] += a;
|
|
3012
3012
|
}
|
|
3013
3013
|
return this.check();
|
|
3014
3014
|
}
|
|
3015
|
-
subScalar(
|
|
3016
|
-
return this.addScalar(-
|
|
3015
|
+
subScalar(a) {
|
|
3016
|
+
return this.addScalar(-a);
|
|
3017
3017
|
}
|
|
3018
3018
|
multiplyScalar(scalar) {
|
|
3019
|
-
for (let
|
|
3020
|
-
this[
|
|
3019
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3020
|
+
this[i] *= scalar;
|
|
3021
3021
|
}
|
|
3022
3022
|
return this.check();
|
|
3023
3023
|
}
|
|
3024
|
-
divideScalar(
|
|
3025
|
-
return this.multiplyByScalar(1 /
|
|
3024
|
+
divideScalar(a) {
|
|
3025
|
+
return this.multiplyByScalar(1 / a);
|
|
3026
3026
|
}
|
|
3027
3027
|
clampScalar(min2, max2) {
|
|
3028
|
-
for (let
|
|
3029
|
-
this[
|
|
3028
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3029
|
+
this[i] = Math.min(Math.max(this[i], min2), max2);
|
|
3030
3030
|
}
|
|
3031
3031
|
return this.check();
|
|
3032
3032
|
}
|
|
@@ -3040,8 +3040,8 @@
|
|
|
3040
3040
|
if (v.length !== length2) {
|
|
3041
3041
|
return false;
|
|
3042
3042
|
}
|
|
3043
|
-
for (let
|
|
3044
|
-
if (!Number.isFinite(v[
|
|
3043
|
+
for (let i = 0; i < v.length; ++i) {
|
|
3044
|
+
if (!Number.isFinite(v[i])) {
|
|
3045
3045
|
return false;
|
|
3046
3046
|
}
|
|
3047
3047
|
}
|
|
@@ -3089,8 +3089,8 @@
|
|
|
3089
3089
|
}
|
|
3090
3090
|
lengthSquared() {
|
|
3091
3091
|
let length2 = 0;
|
|
3092
|
-
for (let
|
|
3093
|
-
length2 += this[
|
|
3092
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3093
|
+
length2 += this[i] * this[i];
|
|
3094
3094
|
}
|
|
3095
3095
|
return length2;
|
|
3096
3096
|
}
|
|
@@ -3102,40 +3102,40 @@
|
|
|
3102
3102
|
}
|
|
3103
3103
|
distanceSquared(mathArray) {
|
|
3104
3104
|
let length2 = 0;
|
|
3105
|
-
for (let
|
|
3106
|
-
const dist2 = this[
|
|
3105
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3106
|
+
const dist2 = this[i] - mathArray[i];
|
|
3107
3107
|
length2 += dist2 * dist2;
|
|
3108
3108
|
}
|
|
3109
3109
|
return checkNumber(length2);
|
|
3110
3110
|
}
|
|
3111
3111
|
dot(mathArray) {
|
|
3112
3112
|
let product = 0;
|
|
3113
|
-
for (let
|
|
3114
|
-
product += this[
|
|
3113
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3114
|
+
product += this[i] * mathArray[i];
|
|
3115
3115
|
}
|
|
3116
3116
|
return checkNumber(product);
|
|
3117
3117
|
}
|
|
3118
3118
|
normalize() {
|
|
3119
3119
|
const length2 = this.magnitude();
|
|
3120
3120
|
if (length2 !== 0) {
|
|
3121
|
-
for (let
|
|
3122
|
-
this[
|
|
3121
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3122
|
+
this[i] /= length2;
|
|
3123
3123
|
}
|
|
3124
3124
|
}
|
|
3125
3125
|
return this.check();
|
|
3126
3126
|
}
|
|
3127
3127
|
multiply(...vectors) {
|
|
3128
3128
|
for (const vector of vectors) {
|
|
3129
|
-
for (let
|
|
3130
|
-
this[
|
|
3129
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3130
|
+
this[i] *= vector[i];
|
|
3131
3131
|
}
|
|
3132
3132
|
}
|
|
3133
3133
|
return this.check();
|
|
3134
3134
|
}
|
|
3135
3135
|
divide(...vectors) {
|
|
3136
3136
|
for (const vector of vectors) {
|
|
3137
|
-
for (let
|
|
3138
|
-
this[
|
|
3137
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3138
|
+
this[i] /= vector[i];
|
|
3139
3139
|
}
|
|
3140
3140
|
}
|
|
3141
3141
|
return this.check();
|
|
@@ -3149,26 +3149,26 @@
|
|
|
3149
3149
|
distanceToSquared(vector) {
|
|
3150
3150
|
return this.distanceSquared(vector);
|
|
3151
3151
|
}
|
|
3152
|
-
getComponent(
|
|
3153
|
-
assert4(
|
|
3154
|
-
return checkNumber(this[
|
|
3152
|
+
getComponent(i) {
|
|
3153
|
+
assert4(i >= 0 && i < this.ELEMENTS, "index is out of range");
|
|
3154
|
+
return checkNumber(this[i]);
|
|
3155
3155
|
}
|
|
3156
|
-
setComponent(
|
|
3157
|
-
assert4(
|
|
3158
|
-
this[
|
|
3156
|
+
setComponent(i, value) {
|
|
3157
|
+
assert4(i >= 0 && i < this.ELEMENTS, "index is out of range");
|
|
3158
|
+
this[i] = value;
|
|
3159
3159
|
return this.check();
|
|
3160
3160
|
}
|
|
3161
|
-
addVectors(
|
|
3162
|
-
return this.copy(
|
|
3161
|
+
addVectors(a, b) {
|
|
3162
|
+
return this.copy(a).add(b);
|
|
3163
3163
|
}
|
|
3164
|
-
subVectors(
|
|
3165
|
-
return this.copy(
|
|
3164
|
+
subVectors(a, b) {
|
|
3165
|
+
return this.copy(a).subtract(b);
|
|
3166
3166
|
}
|
|
3167
|
-
multiplyVectors(
|
|
3168
|
-
return this.copy(
|
|
3167
|
+
multiplyVectors(a, b) {
|
|
3168
|
+
return this.copy(a).multiply(b);
|
|
3169
3169
|
}
|
|
3170
|
-
addScaledVector(
|
|
3171
|
-
return this.add(new this.constructor(
|
|
3170
|
+
addScaledVector(a, b) {
|
|
3171
|
+
return this.add(new this.constructor(a).multiplyScalar(b));
|
|
3172
3172
|
}
|
|
3173
3173
|
};
|
|
3174
3174
|
|
|
@@ -3176,10 +3176,10 @@
|
|
|
3176
3176
|
var EPSILON = 1e-6;
|
|
3177
3177
|
var ARRAY_TYPE = typeof Float32Array !== "undefined" ? Float32Array : Array;
|
|
3178
3178
|
var RANDOM = Math.random;
|
|
3179
|
-
function round2(
|
|
3180
|
-
if (
|
|
3181
|
-
return Math.round(
|
|
3182
|
-
return
|
|
3179
|
+
function round2(a) {
|
|
3180
|
+
if (a >= 0)
|
|
3181
|
+
return Math.round(a);
|
|
3182
|
+
return a % 0.5 === 0 ? Math.floor(a) : Math.round(a);
|
|
3183
3183
|
}
|
|
3184
3184
|
var degree = Math.PI / 180;
|
|
3185
3185
|
|
|
@@ -3192,18 +3192,18 @@
|
|
|
3192
3192
|
}
|
|
3193
3193
|
return out;
|
|
3194
3194
|
}
|
|
3195
|
-
function transformMat4(out,
|
|
3196
|
-
const x =
|
|
3197
|
-
const y =
|
|
3195
|
+
function transformMat4(out, a, m) {
|
|
3196
|
+
const x = a[0];
|
|
3197
|
+
const y = a[1];
|
|
3198
3198
|
out[0] = m[0] * x + m[4] * y + m[12];
|
|
3199
3199
|
out[1] = m[1] * x + m[5] * y + m[13];
|
|
3200
3200
|
return out;
|
|
3201
3201
|
}
|
|
3202
3202
|
var forEach2 = function() {
|
|
3203
3203
|
const vec = create();
|
|
3204
|
-
return function(
|
|
3205
|
-
let
|
|
3206
|
-
let
|
|
3204
|
+
return function(a, stride, offset, count, fn, arg) {
|
|
3205
|
+
let i;
|
|
3206
|
+
let l;
|
|
3207
3207
|
if (!stride) {
|
|
3208
3208
|
stride = 2;
|
|
3209
3209
|
}
|
|
@@ -3211,46 +3211,46 @@
|
|
|
3211
3211
|
offset = 0;
|
|
3212
3212
|
}
|
|
3213
3213
|
if (count) {
|
|
3214
|
-
|
|
3214
|
+
l = Math.min(count * stride + offset, a.length);
|
|
3215
3215
|
} else {
|
|
3216
|
-
|
|
3216
|
+
l = a.length;
|
|
3217
3217
|
}
|
|
3218
|
-
for (
|
|
3219
|
-
vec[0] =
|
|
3220
|
-
vec[1] =
|
|
3218
|
+
for (i = offset; i < l; i += stride) {
|
|
3219
|
+
vec[0] = a[i];
|
|
3220
|
+
vec[1] = a[i + 1];
|
|
3221
3221
|
fn(vec, vec, arg);
|
|
3222
|
-
|
|
3223
|
-
|
|
3222
|
+
a[i] = vec[0];
|
|
3223
|
+
a[i + 1] = vec[1];
|
|
3224
3224
|
}
|
|
3225
|
-
return
|
|
3225
|
+
return a;
|
|
3226
3226
|
};
|
|
3227
3227
|
}();
|
|
3228
3228
|
|
|
3229
3229
|
// ../../node_modules/@math.gl/core/dist/lib/gl-matrix-extras.js
|
|
3230
|
-
function vec2_transformMat4AsVector(out,
|
|
3231
|
-
const x =
|
|
3232
|
-
const y =
|
|
3230
|
+
function vec2_transformMat4AsVector(out, a, m) {
|
|
3231
|
+
const x = a[0];
|
|
3232
|
+
const y = a[1];
|
|
3233
3233
|
const w = m[3] * x + m[7] * y || 1;
|
|
3234
3234
|
out[0] = (m[0] * x + m[4] * y) / w;
|
|
3235
3235
|
out[1] = (m[1] * x + m[5] * y) / w;
|
|
3236
3236
|
return out;
|
|
3237
3237
|
}
|
|
3238
|
-
function vec3_transformMat4AsVector(out,
|
|
3239
|
-
const x =
|
|
3240
|
-
const y =
|
|
3241
|
-
const z =
|
|
3238
|
+
function vec3_transformMat4AsVector(out, a, m) {
|
|
3239
|
+
const x = a[0];
|
|
3240
|
+
const y = a[1];
|
|
3241
|
+
const z = a[2];
|
|
3242
3242
|
const w = m[3] * x + m[7] * y + m[11] * z || 1;
|
|
3243
3243
|
out[0] = (m[0] * x + m[4] * y + m[8] * z) / w;
|
|
3244
3244
|
out[1] = (m[1] * x + m[5] * y + m[9] * z) / w;
|
|
3245
3245
|
out[2] = (m[2] * x + m[6] * y + m[10] * z) / w;
|
|
3246
3246
|
return out;
|
|
3247
3247
|
}
|
|
3248
|
-
function vec3_transformMat2(out,
|
|
3249
|
-
const x =
|
|
3250
|
-
const y =
|
|
3248
|
+
function vec3_transformMat2(out, a, m) {
|
|
3249
|
+
const x = a[0];
|
|
3250
|
+
const y = a[1];
|
|
3251
3251
|
out[0] = m[0] * x + m[2] * y;
|
|
3252
3252
|
out[1] = m[1] * x + m[3] * y;
|
|
3253
|
-
out[2] =
|
|
3253
|
+
out[2] = a[2];
|
|
3254
3254
|
return out;
|
|
3255
3255
|
}
|
|
3256
3256
|
|
|
@@ -3316,17 +3316,17 @@
|
|
|
3316
3316
|
}
|
|
3317
3317
|
return out;
|
|
3318
3318
|
}
|
|
3319
|
-
function clone(
|
|
3319
|
+
function clone(a) {
|
|
3320
3320
|
const out = new ARRAY_TYPE(3);
|
|
3321
|
-
out[0] =
|
|
3322
|
-
out[1] =
|
|
3323
|
-
out[2] =
|
|
3321
|
+
out[0] = a[0];
|
|
3322
|
+
out[1] = a[1];
|
|
3323
|
+
out[2] = a[2];
|
|
3324
3324
|
return out;
|
|
3325
3325
|
}
|
|
3326
|
-
function length(
|
|
3327
|
-
const x =
|
|
3328
|
-
const y =
|
|
3329
|
-
const z =
|
|
3326
|
+
function length(a) {
|
|
3327
|
+
const x = a[0];
|
|
3328
|
+
const y = a[1];
|
|
3329
|
+
const z = a[2];
|
|
3330
3330
|
return Math.sqrt(x * x + y * y + z * z);
|
|
3331
3331
|
}
|
|
3332
3332
|
function fromValues(x, y, z) {
|
|
@@ -3336,10 +3336,10 @@
|
|
|
3336
3336
|
out[2] = z;
|
|
3337
3337
|
return out;
|
|
3338
3338
|
}
|
|
3339
|
-
function copy(out,
|
|
3340
|
-
out[0] =
|
|
3341
|
-
out[1] =
|
|
3342
|
-
out[2] =
|
|
3339
|
+
function copy(out, a) {
|
|
3340
|
+
out[0] = a[0];
|
|
3341
|
+
out[1] = a[1];
|
|
3342
|
+
out[2] = a[2];
|
|
3343
3343
|
return out;
|
|
3344
3344
|
}
|
|
3345
3345
|
function set(out, x, y, z) {
|
|
@@ -3348,122 +3348,122 @@
|
|
|
3348
3348
|
out[2] = z;
|
|
3349
3349
|
return out;
|
|
3350
3350
|
}
|
|
3351
|
-
function add(out,
|
|
3352
|
-
out[0] =
|
|
3353
|
-
out[1] =
|
|
3354
|
-
out[2] =
|
|
3351
|
+
function add(out, a, b) {
|
|
3352
|
+
out[0] = a[0] + b[0];
|
|
3353
|
+
out[1] = a[1] + b[1];
|
|
3354
|
+
out[2] = a[2] + b[2];
|
|
3355
3355
|
return out;
|
|
3356
3356
|
}
|
|
3357
|
-
function subtract(out,
|
|
3358
|
-
out[0] =
|
|
3359
|
-
out[1] =
|
|
3360
|
-
out[2] =
|
|
3357
|
+
function subtract(out, a, b) {
|
|
3358
|
+
out[0] = a[0] - b[0];
|
|
3359
|
+
out[1] = a[1] - b[1];
|
|
3360
|
+
out[2] = a[2] - b[2];
|
|
3361
3361
|
return out;
|
|
3362
3362
|
}
|
|
3363
|
-
function multiply(out,
|
|
3364
|
-
out[0] =
|
|
3365
|
-
out[1] =
|
|
3366
|
-
out[2] =
|
|
3363
|
+
function multiply(out, a, b) {
|
|
3364
|
+
out[0] = a[0] * b[0];
|
|
3365
|
+
out[1] = a[1] * b[1];
|
|
3366
|
+
out[2] = a[2] * b[2];
|
|
3367
3367
|
return out;
|
|
3368
3368
|
}
|
|
3369
|
-
function divide(out,
|
|
3370
|
-
out[0] =
|
|
3371
|
-
out[1] =
|
|
3372
|
-
out[2] =
|
|
3369
|
+
function divide(out, a, b) {
|
|
3370
|
+
out[0] = a[0] / b[0];
|
|
3371
|
+
out[1] = a[1] / b[1];
|
|
3372
|
+
out[2] = a[2] / b[2];
|
|
3373
3373
|
return out;
|
|
3374
3374
|
}
|
|
3375
|
-
function ceil(out,
|
|
3376
|
-
out[0] = Math.ceil(
|
|
3377
|
-
out[1] = Math.ceil(
|
|
3378
|
-
out[2] = Math.ceil(
|
|
3375
|
+
function ceil(out, a) {
|
|
3376
|
+
out[0] = Math.ceil(a[0]);
|
|
3377
|
+
out[1] = Math.ceil(a[1]);
|
|
3378
|
+
out[2] = Math.ceil(a[2]);
|
|
3379
3379
|
return out;
|
|
3380
3380
|
}
|
|
3381
|
-
function floor(out,
|
|
3382
|
-
out[0] = Math.floor(
|
|
3383
|
-
out[1] = Math.floor(
|
|
3384
|
-
out[2] = Math.floor(
|
|
3381
|
+
function floor(out, a) {
|
|
3382
|
+
out[0] = Math.floor(a[0]);
|
|
3383
|
+
out[1] = Math.floor(a[1]);
|
|
3384
|
+
out[2] = Math.floor(a[2]);
|
|
3385
3385
|
return out;
|
|
3386
3386
|
}
|
|
3387
|
-
function min(out,
|
|
3388
|
-
out[0] = Math.min(
|
|
3389
|
-
out[1] = Math.min(
|
|
3390
|
-
out[2] = Math.min(
|
|
3387
|
+
function min(out, a, b) {
|
|
3388
|
+
out[0] = Math.min(a[0], b[0]);
|
|
3389
|
+
out[1] = Math.min(a[1], b[1]);
|
|
3390
|
+
out[2] = Math.min(a[2], b[2]);
|
|
3391
3391
|
return out;
|
|
3392
3392
|
}
|
|
3393
|
-
function max(out,
|
|
3394
|
-
out[0] = Math.max(
|
|
3395
|
-
out[1] = Math.max(
|
|
3396
|
-
out[2] = Math.max(
|
|
3393
|
+
function max(out, a, b) {
|
|
3394
|
+
out[0] = Math.max(a[0], b[0]);
|
|
3395
|
+
out[1] = Math.max(a[1], b[1]);
|
|
3396
|
+
out[2] = Math.max(a[2], b[2]);
|
|
3397
3397
|
return out;
|
|
3398
3398
|
}
|
|
3399
|
-
function round3(out,
|
|
3400
|
-
out[0] = round2(
|
|
3401
|
-
out[1] = round2(
|
|
3402
|
-
out[2] = round2(
|
|
3399
|
+
function round3(out, a) {
|
|
3400
|
+
out[0] = round2(a[0]);
|
|
3401
|
+
out[1] = round2(a[1]);
|
|
3402
|
+
out[2] = round2(a[2]);
|
|
3403
3403
|
return out;
|
|
3404
3404
|
}
|
|
3405
|
-
function scale(out,
|
|
3406
|
-
out[0] =
|
|
3407
|
-
out[1] =
|
|
3408
|
-
out[2] =
|
|
3405
|
+
function scale(out, a, b) {
|
|
3406
|
+
out[0] = a[0] * b;
|
|
3407
|
+
out[1] = a[1] * b;
|
|
3408
|
+
out[2] = a[2] * b;
|
|
3409
3409
|
return out;
|
|
3410
3410
|
}
|
|
3411
|
-
function scaleAndAdd(out,
|
|
3412
|
-
out[0] =
|
|
3413
|
-
out[1] =
|
|
3414
|
-
out[2] =
|
|
3411
|
+
function scaleAndAdd(out, a, b, scale3) {
|
|
3412
|
+
out[0] = a[0] + b[0] * scale3;
|
|
3413
|
+
out[1] = a[1] + b[1] * scale3;
|
|
3414
|
+
out[2] = a[2] + b[2] * scale3;
|
|
3415
3415
|
return out;
|
|
3416
3416
|
}
|
|
3417
|
-
function distance(
|
|
3418
|
-
const x = b[0] -
|
|
3419
|
-
const y = b[1] -
|
|
3420
|
-
const z = b[2] -
|
|
3417
|
+
function distance(a, b) {
|
|
3418
|
+
const x = b[0] - a[0];
|
|
3419
|
+
const y = b[1] - a[1];
|
|
3420
|
+
const z = b[2] - a[2];
|
|
3421
3421
|
return Math.sqrt(x * x + y * y + z * z);
|
|
3422
3422
|
}
|
|
3423
|
-
function squaredDistance(
|
|
3424
|
-
const x = b[0] -
|
|
3425
|
-
const y = b[1] -
|
|
3426
|
-
const z = b[2] -
|
|
3423
|
+
function squaredDistance(a, b) {
|
|
3424
|
+
const x = b[0] - a[0];
|
|
3425
|
+
const y = b[1] - a[1];
|
|
3426
|
+
const z = b[2] - a[2];
|
|
3427
3427
|
return x * x + y * y + z * z;
|
|
3428
3428
|
}
|
|
3429
|
-
function squaredLength(
|
|
3430
|
-
const x =
|
|
3431
|
-
const y =
|
|
3432
|
-
const z =
|
|
3429
|
+
function squaredLength(a) {
|
|
3430
|
+
const x = a[0];
|
|
3431
|
+
const y = a[1];
|
|
3432
|
+
const z = a[2];
|
|
3433
3433
|
return x * x + y * y + z * z;
|
|
3434
3434
|
}
|
|
3435
|
-
function negate(out,
|
|
3436
|
-
out[0] = -
|
|
3437
|
-
out[1] = -
|
|
3438
|
-
out[2] = -
|
|
3435
|
+
function negate(out, a) {
|
|
3436
|
+
out[0] = -a[0];
|
|
3437
|
+
out[1] = -a[1];
|
|
3438
|
+
out[2] = -a[2];
|
|
3439
3439
|
return out;
|
|
3440
3440
|
}
|
|
3441
|
-
function inverse(out,
|
|
3442
|
-
out[0] = 1 /
|
|
3443
|
-
out[1] = 1 /
|
|
3444
|
-
out[2] = 1 /
|
|
3441
|
+
function inverse(out, a) {
|
|
3442
|
+
out[0] = 1 / a[0];
|
|
3443
|
+
out[1] = 1 / a[1];
|
|
3444
|
+
out[2] = 1 / a[2];
|
|
3445
3445
|
return out;
|
|
3446
3446
|
}
|
|
3447
|
-
function normalize(out,
|
|
3448
|
-
const x =
|
|
3449
|
-
const y =
|
|
3450
|
-
const z =
|
|
3447
|
+
function normalize(out, a) {
|
|
3448
|
+
const x = a[0];
|
|
3449
|
+
const y = a[1];
|
|
3450
|
+
const z = a[2];
|
|
3451
3451
|
let len2 = x * x + y * y + z * z;
|
|
3452
3452
|
if (len2 > 0) {
|
|
3453
3453
|
len2 = 1 / Math.sqrt(len2);
|
|
3454
3454
|
}
|
|
3455
|
-
out[0] =
|
|
3456
|
-
out[1] =
|
|
3457
|
-
out[2] =
|
|
3455
|
+
out[0] = a[0] * len2;
|
|
3456
|
+
out[1] = a[1] * len2;
|
|
3457
|
+
out[2] = a[2] * len2;
|
|
3458
3458
|
return out;
|
|
3459
3459
|
}
|
|
3460
|
-
function dot(
|
|
3461
|
-
return
|
|
3460
|
+
function dot(a, b) {
|
|
3461
|
+
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
3462
3462
|
}
|
|
3463
|
-
function cross(out,
|
|
3464
|
-
const ax =
|
|
3465
|
-
const ay =
|
|
3466
|
-
const az =
|
|
3463
|
+
function cross(out, a, b) {
|
|
3464
|
+
const ax = a[0];
|
|
3465
|
+
const ay = a[1];
|
|
3466
|
+
const az = a[2];
|
|
3467
3467
|
const bx = b[0];
|
|
3468
3468
|
const by = b[1];
|
|
3469
3469
|
const bz = b[2];
|
|
@@ -3472,63 +3472,63 @@
|
|
|
3472
3472
|
out[2] = ax * by - ay * bx;
|
|
3473
3473
|
return out;
|
|
3474
3474
|
}
|
|
3475
|
-
function lerp(out,
|
|
3476
|
-
const ax =
|
|
3477
|
-
const ay =
|
|
3478
|
-
const az =
|
|
3479
|
-
out[0] = ax +
|
|
3480
|
-
out[1] = ay +
|
|
3481
|
-
out[2] = az +
|
|
3475
|
+
function lerp(out, a, b, t) {
|
|
3476
|
+
const ax = a[0];
|
|
3477
|
+
const ay = a[1];
|
|
3478
|
+
const az = a[2];
|
|
3479
|
+
out[0] = ax + t * (b[0] - ax);
|
|
3480
|
+
out[1] = ay + t * (b[1] - ay);
|
|
3481
|
+
out[2] = az + t * (b[2] - az);
|
|
3482
3482
|
return out;
|
|
3483
3483
|
}
|
|
3484
|
-
function slerp(out,
|
|
3485
|
-
const angle2 = Math.acos(Math.min(Math.max(dot(
|
|
3484
|
+
function slerp(out, a, b, t) {
|
|
3485
|
+
const angle2 = Math.acos(Math.min(Math.max(dot(a, b), -1), 1));
|
|
3486
3486
|
const sinTotal = Math.sin(angle2);
|
|
3487
|
-
const ratioA = Math.sin((1 -
|
|
3488
|
-
const ratioB = Math.sin(
|
|
3489
|
-
out[0] = ratioA *
|
|
3490
|
-
out[1] = ratioA *
|
|
3491
|
-
out[2] = ratioA *
|
|
3487
|
+
const ratioA = Math.sin((1 - t) * angle2) / sinTotal;
|
|
3488
|
+
const ratioB = Math.sin(t * angle2) / sinTotal;
|
|
3489
|
+
out[0] = ratioA * a[0] + ratioB * b[0];
|
|
3490
|
+
out[1] = ratioA * a[1] + ratioB * b[1];
|
|
3491
|
+
out[2] = ratioA * a[2] + ratioB * b[2];
|
|
3492
3492
|
return out;
|
|
3493
3493
|
}
|
|
3494
|
-
function hermite(out,
|
|
3495
|
-
const factorTimes2 =
|
|
3496
|
-
const factor1 = factorTimes2 * (2 *
|
|
3497
|
-
const factor2 = factorTimes2 * (
|
|
3498
|
-
const factor3 = factorTimes2 * (
|
|
3499
|
-
const factor4 = factorTimes2 * (3 - 2 *
|
|
3500
|
-
out[0] =
|
|
3501
|
-
out[1] =
|
|
3502
|
-
out[2] =
|
|
3494
|
+
function hermite(out, a, b, c, d, t) {
|
|
3495
|
+
const factorTimes2 = t * t;
|
|
3496
|
+
const factor1 = factorTimes2 * (2 * t - 3) + 1;
|
|
3497
|
+
const factor2 = factorTimes2 * (t - 2) + t;
|
|
3498
|
+
const factor3 = factorTimes2 * (t - 1);
|
|
3499
|
+
const factor4 = factorTimes2 * (3 - 2 * t);
|
|
3500
|
+
out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
|
|
3501
|
+
out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
|
|
3502
|
+
out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
|
|
3503
3503
|
return out;
|
|
3504
3504
|
}
|
|
3505
|
-
function bezier(out,
|
|
3506
|
-
const inverseFactor = 1 -
|
|
3505
|
+
function bezier(out, a, b, c, d, t) {
|
|
3506
|
+
const inverseFactor = 1 - t;
|
|
3507
3507
|
const inverseFactorTimesTwo = inverseFactor * inverseFactor;
|
|
3508
|
-
const factorTimes2 =
|
|
3508
|
+
const factorTimes2 = t * t;
|
|
3509
3509
|
const factor1 = inverseFactorTimesTwo * inverseFactor;
|
|
3510
|
-
const factor2 = 3 *
|
|
3510
|
+
const factor2 = 3 * t * inverseFactorTimesTwo;
|
|
3511
3511
|
const factor3 = 3 * factorTimes2 * inverseFactor;
|
|
3512
|
-
const factor4 = factorTimes2 *
|
|
3513
|
-
out[0] =
|
|
3514
|
-
out[1] =
|
|
3515
|
-
out[2] =
|
|
3512
|
+
const factor4 = factorTimes2 * t;
|
|
3513
|
+
out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
|
|
3514
|
+
out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
|
|
3515
|
+
out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
|
|
3516
3516
|
return out;
|
|
3517
3517
|
}
|
|
3518
3518
|
function random(out, scale3) {
|
|
3519
3519
|
scale3 = scale3 === void 0 ? 1 : scale3;
|
|
3520
|
-
const
|
|
3520
|
+
const r = RANDOM() * 2 * Math.PI;
|
|
3521
3521
|
const z = RANDOM() * 2 - 1;
|
|
3522
3522
|
const zScale = Math.sqrt(1 - z * z) * scale3;
|
|
3523
|
-
out[0] = Math.cos(
|
|
3524
|
-
out[1] = Math.sin(
|
|
3523
|
+
out[0] = Math.cos(r) * zScale;
|
|
3524
|
+
out[1] = Math.sin(r) * zScale;
|
|
3525
3525
|
out[2] = z * scale3;
|
|
3526
3526
|
return out;
|
|
3527
3527
|
}
|
|
3528
|
-
function transformMat42(out,
|
|
3529
|
-
const x =
|
|
3530
|
-
const y =
|
|
3531
|
-
const z =
|
|
3528
|
+
function transformMat42(out, a, m) {
|
|
3529
|
+
const x = a[0];
|
|
3530
|
+
const y = a[1];
|
|
3531
|
+
const z = a[2];
|
|
3532
3532
|
let w = m[3] * x + m[7] * y + m[11] * z + m[15];
|
|
3533
3533
|
w = w || 1;
|
|
3534
3534
|
out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;
|
|
@@ -3536,23 +3536,23 @@
|
|
|
3536
3536
|
out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;
|
|
3537
3537
|
return out;
|
|
3538
3538
|
}
|
|
3539
|
-
function transformMat3(out,
|
|
3540
|
-
const x =
|
|
3541
|
-
const y =
|
|
3542
|
-
const z =
|
|
3539
|
+
function transformMat3(out, a, m) {
|
|
3540
|
+
const x = a[0];
|
|
3541
|
+
const y = a[1];
|
|
3542
|
+
const z = a[2];
|
|
3543
3543
|
out[0] = x * m[0] + y * m[3] + z * m[6];
|
|
3544
3544
|
out[1] = x * m[1] + y * m[4] + z * m[7];
|
|
3545
3545
|
out[2] = x * m[2] + y * m[5] + z * m[8];
|
|
3546
3546
|
return out;
|
|
3547
3547
|
}
|
|
3548
|
-
function transformQuat(out,
|
|
3548
|
+
function transformQuat(out, a, q) {
|
|
3549
3549
|
const qx = q[0];
|
|
3550
3550
|
const qy = q[1];
|
|
3551
3551
|
const qz = q[2];
|
|
3552
3552
|
const qw = q[3];
|
|
3553
|
-
const x =
|
|
3554
|
-
const y =
|
|
3555
|
-
const z =
|
|
3553
|
+
const x = a[0];
|
|
3554
|
+
const y = a[1];
|
|
3555
|
+
const z = a[2];
|
|
3556
3556
|
let uvx = qy * z - qz * y;
|
|
3557
3557
|
let uvy = qz * x - qx * z;
|
|
3558
3558
|
let uvz = qx * y - qy * x;
|
|
@@ -3571,57 +3571,57 @@
|
|
|
3571
3571
|
out[2] = z + uvz + uuvz;
|
|
3572
3572
|
return out;
|
|
3573
3573
|
}
|
|
3574
|
-
function rotateX(out,
|
|
3575
|
-
const
|
|
3576
|
-
const
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
out[0] =
|
|
3584
|
-
out[1] =
|
|
3585
|
-
out[2] =
|
|
3574
|
+
function rotateX(out, a, b, rad) {
|
|
3575
|
+
const p = [];
|
|
3576
|
+
const r = [];
|
|
3577
|
+
p[0] = a[0] - b[0];
|
|
3578
|
+
p[1] = a[1] - b[1];
|
|
3579
|
+
p[2] = a[2] - b[2];
|
|
3580
|
+
r[0] = p[0];
|
|
3581
|
+
r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);
|
|
3582
|
+
r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);
|
|
3583
|
+
out[0] = r[0] + b[0];
|
|
3584
|
+
out[1] = r[1] + b[1];
|
|
3585
|
+
out[2] = r[2] + b[2];
|
|
3586
3586
|
return out;
|
|
3587
3587
|
}
|
|
3588
|
-
function rotateY(out,
|
|
3589
|
-
const
|
|
3590
|
-
const
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
out[0] =
|
|
3598
|
-
out[1] =
|
|
3599
|
-
out[2] =
|
|
3588
|
+
function rotateY(out, a, b, rad) {
|
|
3589
|
+
const p = [];
|
|
3590
|
+
const r = [];
|
|
3591
|
+
p[0] = a[0] - b[0];
|
|
3592
|
+
p[1] = a[1] - b[1];
|
|
3593
|
+
p[2] = a[2] - b[2];
|
|
3594
|
+
r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);
|
|
3595
|
+
r[1] = p[1];
|
|
3596
|
+
r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);
|
|
3597
|
+
out[0] = r[0] + b[0];
|
|
3598
|
+
out[1] = r[1] + b[1];
|
|
3599
|
+
out[2] = r[2] + b[2];
|
|
3600
3600
|
return out;
|
|
3601
3601
|
}
|
|
3602
|
-
function rotateZ(out,
|
|
3603
|
-
const
|
|
3604
|
-
const
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
out[0] =
|
|
3612
|
-
out[1] =
|
|
3613
|
-
out[2] =
|
|
3602
|
+
function rotateZ(out, a, b, rad) {
|
|
3603
|
+
const p = [];
|
|
3604
|
+
const r = [];
|
|
3605
|
+
p[0] = a[0] - b[0];
|
|
3606
|
+
p[1] = a[1] - b[1];
|
|
3607
|
+
p[2] = a[2] - b[2];
|
|
3608
|
+
r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);
|
|
3609
|
+
r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);
|
|
3610
|
+
r[2] = p[2];
|
|
3611
|
+
out[0] = r[0] + b[0];
|
|
3612
|
+
out[1] = r[1] + b[1];
|
|
3613
|
+
out[2] = r[2] + b[2];
|
|
3614
3614
|
return out;
|
|
3615
3615
|
}
|
|
3616
|
-
function angle(
|
|
3617
|
-
const ax =
|
|
3618
|
-
const ay =
|
|
3619
|
-
const az =
|
|
3616
|
+
function angle(a, b) {
|
|
3617
|
+
const ax = a[0];
|
|
3618
|
+
const ay = a[1];
|
|
3619
|
+
const az = a[2];
|
|
3620
3620
|
const bx = b[0];
|
|
3621
3621
|
const by = b[1];
|
|
3622
3622
|
const bz = b[2];
|
|
3623
3623
|
const mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz));
|
|
3624
|
-
const cosine = mag && dot(
|
|
3624
|
+
const cosine = mag && dot(a, b) / mag;
|
|
3625
3625
|
return Math.acos(Math.min(Math.max(cosine, -1), 1));
|
|
3626
3626
|
}
|
|
3627
3627
|
function zero(out) {
|
|
@@ -3630,20 +3630,20 @@
|
|
|
3630
3630
|
out[2] = 0;
|
|
3631
3631
|
return out;
|
|
3632
3632
|
}
|
|
3633
|
-
function str(
|
|
3634
|
-
return "vec3(".concat(
|
|
3633
|
+
function str(a) {
|
|
3634
|
+
return "vec3(".concat(a[0], ", ").concat(a[1], ", ").concat(a[2], ")");
|
|
3635
3635
|
}
|
|
3636
|
-
function exactEquals(
|
|
3637
|
-
return
|
|
3636
|
+
function exactEquals(a, b) {
|
|
3637
|
+
return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
|
|
3638
3638
|
}
|
|
3639
|
-
function equals2(
|
|
3640
|
-
const a0 =
|
|
3641
|
-
const a1 =
|
|
3642
|
-
const
|
|
3639
|
+
function equals2(a, b) {
|
|
3640
|
+
const a0 = a[0];
|
|
3641
|
+
const a1 = a[1];
|
|
3642
|
+
const a2 = a[2];
|
|
3643
3643
|
const b0 = b[0];
|
|
3644
3644
|
const b1 = b[1];
|
|
3645
3645
|
const b2 = b[2];
|
|
3646
|
-
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(
|
|
3646
|
+
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));
|
|
3647
3647
|
}
|
|
3648
3648
|
var sub = subtract;
|
|
3649
3649
|
var mul = multiply;
|
|
@@ -3654,9 +3654,9 @@
|
|
|
3654
3654
|
var sqrLen = squaredLength;
|
|
3655
3655
|
var forEach3 = function() {
|
|
3656
3656
|
const vec = create2();
|
|
3657
|
-
return function(
|
|
3658
|
-
let
|
|
3659
|
-
let
|
|
3657
|
+
return function(a, stride, offset, count, fn, arg) {
|
|
3658
|
+
let i;
|
|
3659
|
+
let l;
|
|
3660
3660
|
if (!stride) {
|
|
3661
3661
|
stride = 3;
|
|
3662
3662
|
}
|
|
@@ -3664,20 +3664,20 @@
|
|
|
3664
3664
|
offset = 0;
|
|
3665
3665
|
}
|
|
3666
3666
|
if (count) {
|
|
3667
|
-
|
|
3667
|
+
l = Math.min(count * stride + offset, a.length);
|
|
3668
3668
|
} else {
|
|
3669
|
-
|
|
3669
|
+
l = a.length;
|
|
3670
3670
|
}
|
|
3671
|
-
for (
|
|
3672
|
-
vec[0] =
|
|
3673
|
-
vec[1] =
|
|
3674
|
-
vec[2] =
|
|
3671
|
+
for (i = offset; i < l; i += stride) {
|
|
3672
|
+
vec[0] = a[i];
|
|
3673
|
+
vec[1] = a[i + 1];
|
|
3674
|
+
vec[2] = a[i + 2];
|
|
3675
3675
|
fn(vec, vec, arg);
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3676
|
+
a[i] = vec[0];
|
|
3677
|
+
a[i + 1] = vec[1];
|
|
3678
|
+
a[i + 2] = vec[2];
|
|
3679
3679
|
}
|
|
3680
|
-
return
|
|
3680
|
+
return a;
|
|
3681
3681
|
};
|
|
3682
3682
|
}();
|
|
3683
3683
|
|
|
@@ -3811,8 +3811,8 @@
|
|
|
3811
3811
|
}
|
|
3812
3812
|
} else {
|
|
3813
3813
|
string += "column-major:";
|
|
3814
|
-
for (let
|
|
3815
|
-
string += " ".concat(this[
|
|
3814
|
+
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3815
|
+
string += " ".concat(this[i]);
|
|
3816
3816
|
}
|
|
3817
3817
|
}
|
|
3818
3818
|
string += "]";
|
|
@@ -3830,15 +3830,15 @@
|
|
|
3830
3830
|
}
|
|
3831
3831
|
getColumn(columnIndex, result = new Array(this.RANK).fill(-0)) {
|
|
3832
3832
|
const firstIndex = columnIndex * this.RANK;
|
|
3833
|
-
for (let
|
|
3834
|
-
result[
|
|
3833
|
+
for (let i = 0; i < this.RANK; ++i) {
|
|
3834
|
+
result[i] = this[firstIndex + i];
|
|
3835
3835
|
}
|
|
3836
3836
|
return result;
|
|
3837
3837
|
}
|
|
3838
3838
|
setColumn(columnIndex, columnVector) {
|
|
3839
3839
|
const firstIndex = columnIndex * this.RANK;
|
|
3840
|
-
for (let
|
|
3841
|
-
this[firstIndex +
|
|
3840
|
+
for (let i = 0; i < this.RANK; ++i) {
|
|
3841
|
+
this[firstIndex + i] = columnVector[i];
|
|
3842
3842
|
}
|
|
3843
3843
|
return this;
|
|
3844
3844
|
}
|
|
@@ -3864,63 +3864,63 @@
|
|
|
3864
3864
|
out[15] = 1;
|
|
3865
3865
|
return out;
|
|
3866
3866
|
}
|
|
3867
|
-
function transpose(out,
|
|
3868
|
-
if (out ===
|
|
3869
|
-
const a01 =
|
|
3870
|
-
const a02 =
|
|
3871
|
-
const a03 =
|
|
3872
|
-
const a12 =
|
|
3873
|
-
const a13 =
|
|
3874
|
-
const a23 =
|
|
3875
|
-
out[1] =
|
|
3876
|
-
out[2] =
|
|
3877
|
-
out[3] =
|
|
3867
|
+
function transpose(out, a) {
|
|
3868
|
+
if (out === a) {
|
|
3869
|
+
const a01 = a[1];
|
|
3870
|
+
const a02 = a[2];
|
|
3871
|
+
const a03 = a[3];
|
|
3872
|
+
const a12 = a[6];
|
|
3873
|
+
const a13 = a[7];
|
|
3874
|
+
const a23 = a[11];
|
|
3875
|
+
out[1] = a[4];
|
|
3876
|
+
out[2] = a[8];
|
|
3877
|
+
out[3] = a[12];
|
|
3878
3878
|
out[4] = a01;
|
|
3879
|
-
out[6] =
|
|
3880
|
-
out[7] =
|
|
3879
|
+
out[6] = a[9];
|
|
3880
|
+
out[7] = a[13];
|
|
3881
3881
|
out[8] = a02;
|
|
3882
3882
|
out[9] = a12;
|
|
3883
|
-
out[11] =
|
|
3883
|
+
out[11] = a[14];
|
|
3884
3884
|
out[12] = a03;
|
|
3885
3885
|
out[13] = a13;
|
|
3886
3886
|
out[14] = a23;
|
|
3887
3887
|
} else {
|
|
3888
|
-
out[0] =
|
|
3889
|
-
out[1] =
|
|
3890
|
-
out[2] =
|
|
3891
|
-
out[3] =
|
|
3892
|
-
out[4] =
|
|
3893
|
-
out[5] =
|
|
3894
|
-
out[6] =
|
|
3895
|
-
out[7] =
|
|
3896
|
-
out[8] =
|
|
3897
|
-
out[9] =
|
|
3898
|
-
out[10] =
|
|
3899
|
-
out[11] =
|
|
3900
|
-
out[12] =
|
|
3901
|
-
out[13] =
|
|
3902
|
-
out[14] =
|
|
3903
|
-
out[15] =
|
|
3888
|
+
out[0] = a[0];
|
|
3889
|
+
out[1] = a[4];
|
|
3890
|
+
out[2] = a[8];
|
|
3891
|
+
out[3] = a[12];
|
|
3892
|
+
out[4] = a[1];
|
|
3893
|
+
out[5] = a[5];
|
|
3894
|
+
out[6] = a[9];
|
|
3895
|
+
out[7] = a[13];
|
|
3896
|
+
out[8] = a[2];
|
|
3897
|
+
out[9] = a[6];
|
|
3898
|
+
out[10] = a[10];
|
|
3899
|
+
out[11] = a[14];
|
|
3900
|
+
out[12] = a[3];
|
|
3901
|
+
out[13] = a[7];
|
|
3902
|
+
out[14] = a[11];
|
|
3903
|
+
out[15] = a[15];
|
|
3904
3904
|
}
|
|
3905
3905
|
return out;
|
|
3906
3906
|
}
|
|
3907
|
-
function invert(out,
|
|
3908
|
-
const a00 =
|
|
3909
|
-
const a01 =
|
|
3910
|
-
const a02 =
|
|
3911
|
-
const a03 =
|
|
3912
|
-
const a10 =
|
|
3913
|
-
const a11 =
|
|
3914
|
-
const a12 =
|
|
3915
|
-
const a13 =
|
|
3916
|
-
const a20 =
|
|
3917
|
-
const a21 =
|
|
3918
|
-
const a22 =
|
|
3919
|
-
const a23 =
|
|
3920
|
-
const a30 =
|
|
3921
|
-
const a31 =
|
|
3922
|
-
const a32 =
|
|
3923
|
-
const a33 =
|
|
3907
|
+
function invert(out, a) {
|
|
3908
|
+
const a00 = a[0];
|
|
3909
|
+
const a01 = a[1];
|
|
3910
|
+
const a02 = a[2];
|
|
3911
|
+
const a03 = a[3];
|
|
3912
|
+
const a10 = a[4];
|
|
3913
|
+
const a11 = a[5];
|
|
3914
|
+
const a12 = a[6];
|
|
3915
|
+
const a13 = a[7];
|
|
3916
|
+
const a20 = a[8];
|
|
3917
|
+
const a21 = a[9];
|
|
3918
|
+
const a22 = a[10];
|
|
3919
|
+
const a23 = a[11];
|
|
3920
|
+
const a30 = a[12];
|
|
3921
|
+
const a31 = a[13];
|
|
3922
|
+
const a32 = a[14];
|
|
3923
|
+
const a33 = a[15];
|
|
3924
3924
|
const b00 = a00 * a11 - a01 * a10;
|
|
3925
3925
|
const b01 = a00 * a12 - a02 * a10;
|
|
3926
3926
|
const b02 = a00 * a13 - a03 * a10;
|
|
@@ -3956,23 +3956,23 @@
|
|
|
3956
3956
|
out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;
|
|
3957
3957
|
return out;
|
|
3958
3958
|
}
|
|
3959
|
-
function determinant(
|
|
3960
|
-
const a00 =
|
|
3961
|
-
const a01 =
|
|
3962
|
-
const a02 =
|
|
3963
|
-
const a03 =
|
|
3964
|
-
const a10 =
|
|
3965
|
-
const a11 =
|
|
3966
|
-
const a12 =
|
|
3967
|
-
const a13 =
|
|
3968
|
-
const a20 =
|
|
3969
|
-
const a21 =
|
|
3970
|
-
const a22 =
|
|
3971
|
-
const a23 =
|
|
3972
|
-
const a30 =
|
|
3973
|
-
const a31 =
|
|
3974
|
-
const a32 =
|
|
3975
|
-
const a33 =
|
|
3959
|
+
function determinant(a) {
|
|
3960
|
+
const a00 = a[0];
|
|
3961
|
+
const a01 = a[1];
|
|
3962
|
+
const a02 = a[2];
|
|
3963
|
+
const a03 = a[3];
|
|
3964
|
+
const a10 = a[4];
|
|
3965
|
+
const a11 = a[5];
|
|
3966
|
+
const a12 = a[6];
|
|
3967
|
+
const a13 = a[7];
|
|
3968
|
+
const a20 = a[8];
|
|
3969
|
+
const a21 = a[9];
|
|
3970
|
+
const a22 = a[10];
|
|
3971
|
+
const a23 = a[11];
|
|
3972
|
+
const a30 = a[12];
|
|
3973
|
+
const a31 = a[13];
|
|
3974
|
+
const a32 = a[14];
|
|
3975
|
+
const a33 = a[15];
|
|
3976
3976
|
const b0 = a00 * a11 - a01 * a10;
|
|
3977
3977
|
const b1 = a00 * a12 - a02 * a10;
|
|
3978
3978
|
const b2 = a01 * a12 - a02 * a11;
|
|
@@ -3985,23 +3985,23 @@
|
|
|
3985
3985
|
const b9 = a30 * b2 - a31 * b1 + a32 * b0;
|
|
3986
3986
|
return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;
|
|
3987
3987
|
}
|
|
3988
|
-
function multiply2(out,
|
|
3989
|
-
const a00 =
|
|
3990
|
-
const a01 =
|
|
3991
|
-
const a02 =
|
|
3992
|
-
const a03 =
|
|
3993
|
-
const a10 =
|
|
3994
|
-
const a11 =
|
|
3995
|
-
const a12 =
|
|
3996
|
-
const a13 =
|
|
3997
|
-
const a20 =
|
|
3998
|
-
const a21 =
|
|
3999
|
-
const a22 =
|
|
4000
|
-
const a23 =
|
|
4001
|
-
const a30 =
|
|
4002
|
-
const a31 =
|
|
4003
|
-
const a32 =
|
|
4004
|
-
const a33 =
|
|
3988
|
+
function multiply2(out, a, b) {
|
|
3989
|
+
const a00 = a[0];
|
|
3990
|
+
const a01 = a[1];
|
|
3991
|
+
const a02 = a[2];
|
|
3992
|
+
const a03 = a[3];
|
|
3993
|
+
const a10 = a[4];
|
|
3994
|
+
const a11 = a[5];
|
|
3995
|
+
const a12 = a[6];
|
|
3996
|
+
const a13 = a[7];
|
|
3997
|
+
const a20 = a[8];
|
|
3998
|
+
const a21 = a[9];
|
|
3999
|
+
const a22 = a[10];
|
|
4000
|
+
const a23 = a[11];
|
|
4001
|
+
const a30 = a[12];
|
|
4002
|
+
const a31 = a[13];
|
|
4003
|
+
const a32 = a[14];
|
|
4004
|
+
const a33 = a[15];
|
|
4005
4005
|
let b0 = b[0];
|
|
4006
4006
|
let b1 = b[1];
|
|
4007
4007
|
let b2 = b[2];
|
|
@@ -4036,7 +4036,7 @@
|
|
|
4036
4036
|
out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
|
|
4037
4037
|
return out;
|
|
4038
4038
|
}
|
|
4039
|
-
function translate(out,
|
|
4039
|
+
function translate(out, a, v) {
|
|
4040
4040
|
const x = v[0];
|
|
4041
4041
|
const y = v[1];
|
|
4042
4042
|
const z = v[2];
|
|
@@ -4052,24 +4052,24 @@
|
|
|
4052
4052
|
let a21;
|
|
4053
4053
|
let a22;
|
|
4054
4054
|
let a23;
|
|
4055
|
-
if (
|
|
4056
|
-
out[12] =
|
|
4057
|
-
out[13] =
|
|
4058
|
-
out[14] =
|
|
4059
|
-
out[15] =
|
|
4055
|
+
if (a === out) {
|
|
4056
|
+
out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];
|
|
4057
|
+
out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];
|
|
4058
|
+
out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];
|
|
4059
|
+
out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];
|
|
4060
4060
|
} else {
|
|
4061
|
-
a00 =
|
|
4062
|
-
a01 =
|
|
4063
|
-
a02 =
|
|
4064
|
-
a03 =
|
|
4065
|
-
a10 =
|
|
4066
|
-
a11 =
|
|
4067
|
-
a12 =
|
|
4068
|
-
a13 =
|
|
4069
|
-
a20 =
|
|
4070
|
-
a21 =
|
|
4071
|
-
a22 =
|
|
4072
|
-
a23 =
|
|
4061
|
+
a00 = a[0];
|
|
4062
|
+
a01 = a[1];
|
|
4063
|
+
a02 = a[2];
|
|
4064
|
+
a03 = a[3];
|
|
4065
|
+
a10 = a[4];
|
|
4066
|
+
a11 = a[5];
|
|
4067
|
+
a12 = a[6];
|
|
4068
|
+
a13 = a[7];
|
|
4069
|
+
a20 = a[8];
|
|
4070
|
+
a21 = a[9];
|
|
4071
|
+
a22 = a[10];
|
|
4072
|
+
a23 = a[11];
|
|
4073
4073
|
out[0] = a00;
|
|
4074
4074
|
out[1] = a01;
|
|
4075
4075
|
out[2] = a02;
|
|
@@ -4082,43 +4082,43 @@
|
|
|
4082
4082
|
out[9] = a21;
|
|
4083
4083
|
out[10] = a22;
|
|
4084
4084
|
out[11] = a23;
|
|
4085
|
-
out[12] = a00 * x + a10 * y + a20 * z +
|
|
4086
|
-
out[13] = a01 * x + a11 * y + a21 * z +
|
|
4087
|
-
out[14] = a02 * x + a12 * y + a22 * z +
|
|
4088
|
-
out[15] = a03 * x + a13 * y + a23 * z +
|
|
4085
|
+
out[12] = a00 * x + a10 * y + a20 * z + a[12];
|
|
4086
|
+
out[13] = a01 * x + a11 * y + a21 * z + a[13];
|
|
4087
|
+
out[14] = a02 * x + a12 * y + a22 * z + a[14];
|
|
4088
|
+
out[15] = a03 * x + a13 * y + a23 * z + a[15];
|
|
4089
4089
|
}
|
|
4090
4090
|
return out;
|
|
4091
4091
|
}
|
|
4092
|
-
function scale2(out,
|
|
4092
|
+
function scale2(out, a, v) {
|
|
4093
4093
|
const x = v[0];
|
|
4094
4094
|
const y = v[1];
|
|
4095
4095
|
const z = v[2];
|
|
4096
|
-
out[0] =
|
|
4097
|
-
out[1] =
|
|
4098
|
-
out[2] =
|
|
4099
|
-
out[3] =
|
|
4100
|
-
out[4] =
|
|
4101
|
-
out[5] =
|
|
4102
|
-
out[6] =
|
|
4103
|
-
out[7] =
|
|
4104
|
-
out[8] =
|
|
4105
|
-
out[9] =
|
|
4106
|
-
out[10] =
|
|
4107
|
-
out[11] =
|
|
4108
|
-
out[12] =
|
|
4109
|
-
out[13] =
|
|
4110
|
-
out[14] =
|
|
4111
|
-
out[15] =
|
|
4096
|
+
out[0] = a[0] * x;
|
|
4097
|
+
out[1] = a[1] * x;
|
|
4098
|
+
out[2] = a[2] * x;
|
|
4099
|
+
out[3] = a[3] * x;
|
|
4100
|
+
out[4] = a[4] * y;
|
|
4101
|
+
out[5] = a[5] * y;
|
|
4102
|
+
out[6] = a[6] * y;
|
|
4103
|
+
out[7] = a[7] * y;
|
|
4104
|
+
out[8] = a[8] * z;
|
|
4105
|
+
out[9] = a[9] * z;
|
|
4106
|
+
out[10] = a[10] * z;
|
|
4107
|
+
out[11] = a[11] * z;
|
|
4108
|
+
out[12] = a[12];
|
|
4109
|
+
out[13] = a[13];
|
|
4110
|
+
out[14] = a[14];
|
|
4111
|
+
out[15] = a[15];
|
|
4112
4112
|
return out;
|
|
4113
4113
|
}
|
|
4114
|
-
function rotate(out,
|
|
4114
|
+
function rotate(out, a, rad, axis) {
|
|
4115
4115
|
let x = axis[0];
|
|
4116
4116
|
let y = axis[1];
|
|
4117
4117
|
let z = axis[2];
|
|
4118
4118
|
let len2 = Math.sqrt(x * x + y * y + z * z);
|
|
4119
|
-
let
|
|
4120
|
-
let
|
|
4121
|
-
let
|
|
4119
|
+
let c;
|
|
4120
|
+
let s;
|
|
4121
|
+
let t;
|
|
4122
4122
|
let a00;
|
|
4123
4123
|
let a01;
|
|
4124
4124
|
let a02;
|
|
@@ -4147,30 +4147,30 @@
|
|
|
4147
4147
|
x *= len2;
|
|
4148
4148
|
y *= len2;
|
|
4149
4149
|
z *= len2;
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
a00 =
|
|
4154
|
-
a01 =
|
|
4155
|
-
a02 =
|
|
4156
|
-
a03 =
|
|
4157
|
-
a10 =
|
|
4158
|
-
a11 =
|
|
4159
|
-
a12 =
|
|
4160
|
-
a13 =
|
|
4161
|
-
a20 =
|
|
4162
|
-
a21 =
|
|
4163
|
-
a22 =
|
|
4164
|
-
a23 =
|
|
4165
|
-
b00 = x * x *
|
|
4166
|
-
b01 = y * x *
|
|
4167
|
-
b02 = z * x *
|
|
4168
|
-
b10 = x * y *
|
|
4169
|
-
b11 = y * y *
|
|
4170
|
-
b12 = z * y *
|
|
4171
|
-
b20 = x * z *
|
|
4172
|
-
b21 = y * z *
|
|
4173
|
-
b22 = z * z *
|
|
4150
|
+
s = Math.sin(rad);
|
|
4151
|
+
c = Math.cos(rad);
|
|
4152
|
+
t = 1 - c;
|
|
4153
|
+
a00 = a[0];
|
|
4154
|
+
a01 = a[1];
|
|
4155
|
+
a02 = a[2];
|
|
4156
|
+
a03 = a[3];
|
|
4157
|
+
a10 = a[4];
|
|
4158
|
+
a11 = a[5];
|
|
4159
|
+
a12 = a[6];
|
|
4160
|
+
a13 = a[7];
|
|
4161
|
+
a20 = a[8];
|
|
4162
|
+
a21 = a[9];
|
|
4163
|
+
a22 = a[10];
|
|
4164
|
+
a23 = a[11];
|
|
4165
|
+
b00 = x * x * t + c;
|
|
4166
|
+
b01 = y * x * t + z * s;
|
|
4167
|
+
b02 = z * x * t - y * s;
|
|
4168
|
+
b10 = x * y * t - z * s;
|
|
4169
|
+
b11 = y * y * t + c;
|
|
4170
|
+
b12 = z * y * t + x * s;
|
|
4171
|
+
b20 = x * z * t + y * s;
|
|
4172
|
+
b21 = y * z * t - x * s;
|
|
4173
|
+
b22 = z * z * t + c;
|
|
4174
4174
|
out[0] = a00 * b00 + a10 * b01 + a20 * b02;
|
|
4175
4175
|
out[1] = a01 * b00 + a11 * b01 + a21 * b02;
|
|
4176
4176
|
out[2] = a02 * b00 + a12 * b01 + a22 * b02;
|
|
@@ -4183,105 +4183,105 @@
|
|
|
4183
4183
|
out[9] = a01 * b20 + a11 * b21 + a21 * b22;
|
|
4184
4184
|
out[10] = a02 * b20 + a12 * b21 + a22 * b22;
|
|
4185
4185
|
out[11] = a03 * b20 + a13 * b21 + a23 * b22;
|
|
4186
|
-
if (
|
|
4187
|
-
out[12] =
|
|
4188
|
-
out[13] =
|
|
4189
|
-
out[14] =
|
|
4190
|
-
out[15] =
|
|
4186
|
+
if (a !== out) {
|
|
4187
|
+
out[12] = a[12];
|
|
4188
|
+
out[13] = a[13];
|
|
4189
|
+
out[14] = a[14];
|
|
4190
|
+
out[15] = a[15];
|
|
4191
4191
|
}
|
|
4192
4192
|
return out;
|
|
4193
4193
|
}
|
|
4194
|
-
function rotateX2(out,
|
|
4195
|
-
const
|
|
4196
|
-
const
|
|
4197
|
-
const a10 =
|
|
4198
|
-
const a11 =
|
|
4199
|
-
const a12 =
|
|
4200
|
-
const a13 =
|
|
4201
|
-
const a20 =
|
|
4202
|
-
const a21 =
|
|
4203
|
-
const a22 =
|
|
4204
|
-
const a23 =
|
|
4205
|
-
if (
|
|
4206
|
-
out[0] =
|
|
4207
|
-
out[1] =
|
|
4208
|
-
out[2] =
|
|
4209
|
-
out[3] =
|
|
4210
|
-
out[12] =
|
|
4211
|
-
out[13] =
|
|
4212
|
-
out[14] =
|
|
4213
|
-
out[15] =
|
|
4214
|
-
}
|
|
4215
|
-
out[4] = a10 *
|
|
4216
|
-
out[5] = a11 *
|
|
4217
|
-
out[6] = a12 *
|
|
4218
|
-
out[7] = a13 *
|
|
4219
|
-
out[8] = a20 *
|
|
4220
|
-
out[9] = a21 *
|
|
4221
|
-
out[10] = a22 *
|
|
4222
|
-
out[11] = a23 *
|
|
4194
|
+
function rotateX2(out, a, rad) {
|
|
4195
|
+
const s = Math.sin(rad);
|
|
4196
|
+
const c = Math.cos(rad);
|
|
4197
|
+
const a10 = a[4];
|
|
4198
|
+
const a11 = a[5];
|
|
4199
|
+
const a12 = a[6];
|
|
4200
|
+
const a13 = a[7];
|
|
4201
|
+
const a20 = a[8];
|
|
4202
|
+
const a21 = a[9];
|
|
4203
|
+
const a22 = a[10];
|
|
4204
|
+
const a23 = a[11];
|
|
4205
|
+
if (a !== out) {
|
|
4206
|
+
out[0] = a[0];
|
|
4207
|
+
out[1] = a[1];
|
|
4208
|
+
out[2] = a[2];
|
|
4209
|
+
out[3] = a[3];
|
|
4210
|
+
out[12] = a[12];
|
|
4211
|
+
out[13] = a[13];
|
|
4212
|
+
out[14] = a[14];
|
|
4213
|
+
out[15] = a[15];
|
|
4214
|
+
}
|
|
4215
|
+
out[4] = a10 * c + a20 * s;
|
|
4216
|
+
out[5] = a11 * c + a21 * s;
|
|
4217
|
+
out[6] = a12 * c + a22 * s;
|
|
4218
|
+
out[7] = a13 * c + a23 * s;
|
|
4219
|
+
out[8] = a20 * c - a10 * s;
|
|
4220
|
+
out[9] = a21 * c - a11 * s;
|
|
4221
|
+
out[10] = a22 * c - a12 * s;
|
|
4222
|
+
out[11] = a23 * c - a13 * s;
|
|
4223
4223
|
return out;
|
|
4224
4224
|
}
|
|
4225
|
-
function rotateY2(out,
|
|
4226
|
-
const
|
|
4227
|
-
const
|
|
4228
|
-
const a00 =
|
|
4229
|
-
const a01 =
|
|
4230
|
-
const a02 =
|
|
4231
|
-
const a03 =
|
|
4232
|
-
const a20 =
|
|
4233
|
-
const a21 =
|
|
4234
|
-
const a22 =
|
|
4235
|
-
const a23 =
|
|
4236
|
-
if (
|
|
4237
|
-
out[4] =
|
|
4238
|
-
out[5] =
|
|
4239
|
-
out[6] =
|
|
4240
|
-
out[7] =
|
|
4241
|
-
out[12] =
|
|
4242
|
-
out[13] =
|
|
4243
|
-
out[14] =
|
|
4244
|
-
out[15] =
|
|
4245
|
-
}
|
|
4246
|
-
out[0] = a00 *
|
|
4247
|
-
out[1] = a01 *
|
|
4248
|
-
out[2] = a02 *
|
|
4249
|
-
out[3] = a03 *
|
|
4250
|
-
out[8] = a00 *
|
|
4251
|
-
out[9] = a01 *
|
|
4252
|
-
out[10] = a02 *
|
|
4253
|
-
out[11] = a03 *
|
|
4225
|
+
function rotateY2(out, a, rad) {
|
|
4226
|
+
const s = Math.sin(rad);
|
|
4227
|
+
const c = Math.cos(rad);
|
|
4228
|
+
const a00 = a[0];
|
|
4229
|
+
const a01 = a[1];
|
|
4230
|
+
const a02 = a[2];
|
|
4231
|
+
const a03 = a[3];
|
|
4232
|
+
const a20 = a[8];
|
|
4233
|
+
const a21 = a[9];
|
|
4234
|
+
const a22 = a[10];
|
|
4235
|
+
const a23 = a[11];
|
|
4236
|
+
if (a !== out) {
|
|
4237
|
+
out[4] = a[4];
|
|
4238
|
+
out[5] = a[5];
|
|
4239
|
+
out[6] = a[6];
|
|
4240
|
+
out[7] = a[7];
|
|
4241
|
+
out[12] = a[12];
|
|
4242
|
+
out[13] = a[13];
|
|
4243
|
+
out[14] = a[14];
|
|
4244
|
+
out[15] = a[15];
|
|
4245
|
+
}
|
|
4246
|
+
out[0] = a00 * c - a20 * s;
|
|
4247
|
+
out[1] = a01 * c - a21 * s;
|
|
4248
|
+
out[2] = a02 * c - a22 * s;
|
|
4249
|
+
out[3] = a03 * c - a23 * s;
|
|
4250
|
+
out[8] = a00 * s + a20 * c;
|
|
4251
|
+
out[9] = a01 * s + a21 * c;
|
|
4252
|
+
out[10] = a02 * s + a22 * c;
|
|
4253
|
+
out[11] = a03 * s + a23 * c;
|
|
4254
4254
|
return out;
|
|
4255
4255
|
}
|
|
4256
|
-
function rotateZ2(out,
|
|
4257
|
-
const
|
|
4258
|
-
const
|
|
4259
|
-
const a00 =
|
|
4260
|
-
const a01 =
|
|
4261
|
-
const a02 =
|
|
4262
|
-
const a03 =
|
|
4263
|
-
const a10 =
|
|
4264
|
-
const a11 =
|
|
4265
|
-
const a12 =
|
|
4266
|
-
const a13 =
|
|
4267
|
-
if (
|
|
4268
|
-
out[8] =
|
|
4269
|
-
out[9] =
|
|
4270
|
-
out[10] =
|
|
4271
|
-
out[11] =
|
|
4272
|
-
out[12] =
|
|
4273
|
-
out[13] =
|
|
4274
|
-
out[14] =
|
|
4275
|
-
out[15] =
|
|
4276
|
-
}
|
|
4277
|
-
out[0] = a00 *
|
|
4278
|
-
out[1] = a01 *
|
|
4279
|
-
out[2] = a02 *
|
|
4280
|
-
out[3] = a03 *
|
|
4281
|
-
out[4] = a10 *
|
|
4282
|
-
out[5] = a11 *
|
|
4283
|
-
out[6] = a12 *
|
|
4284
|
-
out[7] = a13 *
|
|
4256
|
+
function rotateZ2(out, a, rad) {
|
|
4257
|
+
const s = Math.sin(rad);
|
|
4258
|
+
const c = Math.cos(rad);
|
|
4259
|
+
const a00 = a[0];
|
|
4260
|
+
const a01 = a[1];
|
|
4261
|
+
const a02 = a[2];
|
|
4262
|
+
const a03 = a[3];
|
|
4263
|
+
const a10 = a[4];
|
|
4264
|
+
const a11 = a[5];
|
|
4265
|
+
const a12 = a[6];
|
|
4266
|
+
const a13 = a[7];
|
|
4267
|
+
if (a !== out) {
|
|
4268
|
+
out[8] = a[8];
|
|
4269
|
+
out[9] = a[9];
|
|
4270
|
+
out[10] = a[10];
|
|
4271
|
+
out[11] = a[11];
|
|
4272
|
+
out[12] = a[12];
|
|
4273
|
+
out[13] = a[13];
|
|
4274
|
+
out[14] = a[14];
|
|
4275
|
+
out[15] = a[15];
|
|
4276
|
+
}
|
|
4277
|
+
out[0] = a00 * c + a10 * s;
|
|
4278
|
+
out[1] = a01 * c + a11 * s;
|
|
4279
|
+
out[2] = a02 * c + a12 * s;
|
|
4280
|
+
out[3] = a03 * c + a13 * s;
|
|
4281
|
+
out[4] = a10 * c - a00 * s;
|
|
4282
|
+
out[5] = a11 * c - a01 * s;
|
|
4283
|
+
out[6] = a12 * c - a02 * s;
|
|
4284
|
+
out[7] = a13 * c - a03 * s;
|
|
4285
4285
|
return out;
|
|
4286
4286
|
}
|
|
4287
4287
|
function fromQuat(out, q) {
|
|
@@ -4342,13 +4342,13 @@
|
|
|
4342
4342
|
return out;
|
|
4343
4343
|
}
|
|
4344
4344
|
function perspectiveNO(out, fovy, aspect, near, far) {
|
|
4345
|
-
const
|
|
4346
|
-
out[0] =
|
|
4345
|
+
const f = 1 / Math.tan(fovy / 2);
|
|
4346
|
+
out[0] = f / aspect;
|
|
4347
4347
|
out[1] = 0;
|
|
4348
4348
|
out[2] = 0;
|
|
4349
4349
|
out[3] = 0;
|
|
4350
4350
|
out[4] = 0;
|
|
4351
|
-
out[5] =
|
|
4351
|
+
out[5] = f;
|
|
4352
4352
|
out[6] = 0;
|
|
4353
4353
|
out[7] = 0;
|
|
4354
4354
|
out[8] = 0;
|
|
@@ -4479,11 +4479,11 @@
|
|
|
4479
4479
|
}
|
|
4480
4480
|
return out;
|
|
4481
4481
|
}
|
|
4482
|
-
function transformMat43(out,
|
|
4483
|
-
const x =
|
|
4484
|
-
const y =
|
|
4485
|
-
const z =
|
|
4486
|
-
const w =
|
|
4482
|
+
function transformMat43(out, a, m) {
|
|
4483
|
+
const x = a[0];
|
|
4484
|
+
const y = a[1];
|
|
4485
|
+
const z = a[2];
|
|
4486
|
+
const w = a[3];
|
|
4487
4487
|
out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;
|
|
4488
4488
|
out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;
|
|
4489
4489
|
out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;
|
|
@@ -4492,9 +4492,9 @@
|
|
|
4492
4492
|
}
|
|
4493
4493
|
var forEach4 = function() {
|
|
4494
4494
|
const vec = create3();
|
|
4495
|
-
return function(
|
|
4496
|
-
let
|
|
4497
|
-
let
|
|
4495
|
+
return function(a, stride, offset, count, fn, arg) {
|
|
4496
|
+
let i;
|
|
4497
|
+
let l;
|
|
4498
4498
|
if (!stride) {
|
|
4499
4499
|
stride = 4;
|
|
4500
4500
|
}
|
|
@@ -4502,22 +4502,22 @@
|
|
|
4502
4502
|
offset = 0;
|
|
4503
4503
|
}
|
|
4504
4504
|
if (count) {
|
|
4505
|
-
|
|
4505
|
+
l = Math.min(count * stride + offset, a.length);
|
|
4506
4506
|
} else {
|
|
4507
|
-
|
|
4507
|
+
l = a.length;
|
|
4508
4508
|
}
|
|
4509
|
-
for (
|
|
4510
|
-
vec[0] =
|
|
4511
|
-
vec[1] =
|
|
4512
|
-
vec[2] =
|
|
4513
|
-
vec[3] =
|
|
4509
|
+
for (i = offset; i < l; i += stride) {
|
|
4510
|
+
vec[0] = a[i];
|
|
4511
|
+
vec[1] = a[i + 1];
|
|
4512
|
+
vec[2] = a[i + 2];
|
|
4513
|
+
vec[3] = a[i + 3];
|
|
4514
4514
|
fn(vec, vec, arg);
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4515
|
+
a[i] = vec[0];
|
|
4516
|
+
a[i + 1] = vec[1];
|
|
4517
|
+
a[i + 2] = vec[2];
|
|
4518
|
+
a[i + 3] = vec[3];
|
|
4519
4519
|
}
|
|
4520
|
-
return
|
|
4520
|
+
return a;
|
|
4521
4521
|
};
|
|
4522
4522
|
}();
|
|
4523
4523
|
|
|
@@ -4791,12 +4791,12 @@
|
|
|
4791
4791
|
invert(this, this);
|
|
4792
4792
|
return this.check();
|
|
4793
4793
|
}
|
|
4794
|
-
multiplyLeft(
|
|
4795
|
-
multiply2(this,
|
|
4794
|
+
multiplyLeft(a) {
|
|
4795
|
+
multiply2(this, a, this);
|
|
4796
4796
|
return this.check();
|
|
4797
4797
|
}
|
|
4798
|
-
multiplyRight(
|
|
4799
|
-
multiply2(this, this,
|
|
4798
|
+
multiplyRight(a) {
|
|
4799
|
+
multiply2(this, this, a);
|
|
4800
4800
|
return this.check();
|
|
4801
4801
|
}
|
|
4802
4802
|
rotateX(radians2) {
|
|
@@ -5340,7 +5340,7 @@
|
|
|
5340
5340
|
_defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
|
|
5341
5341
|
|
|
5342
5342
|
// ../images/src/lib/utils/version.ts
|
|
5343
|
-
var VERSION4 = true ? "4.3.0-alpha.
|
|
5343
|
+
var VERSION4 = true ? "4.3.0-alpha.3" : "latest";
|
|
5344
5344
|
|
|
5345
5345
|
// ../images/src/lib/category-api/image-type.ts
|
|
5346
5346
|
var parseImageNode = globalThis.loaders?.parseImageNode;
|
|
@@ -5540,8 +5540,8 @@
|
|
|
5540
5540
|
}
|
|
5541
5541
|
function checkString(buffer, header, offset = 0) {
|
|
5542
5542
|
const headerBytes = stringToBytes(header);
|
|
5543
|
-
for (let
|
|
5544
|
-
if (headerBytes[
|
|
5543
|
+
for (let i = 0; i < headerBytes.length; ++i) {
|
|
5544
|
+
if (headerBytes[i] !== buffer[i + offset]) {
|
|
5545
5545
|
return false;
|
|
5546
5546
|
}
|
|
5547
5547
|
}
|
|
@@ -5611,30 +5611,30 @@
|
|
|
5611
5611
|
return null;
|
|
5612
5612
|
}
|
|
5613
5613
|
const { tableMarkers, sofMarkers } = getJpegMarkers();
|
|
5614
|
-
let
|
|
5615
|
-
while (
|
|
5616
|
-
const marker = dataView.getUint16(
|
|
5614
|
+
let i = 2;
|
|
5615
|
+
while (i + 9 < dataView.byteLength) {
|
|
5616
|
+
const marker = dataView.getUint16(i, BIG_ENDIAN);
|
|
5617
5617
|
if (sofMarkers.has(marker)) {
|
|
5618
5618
|
return {
|
|
5619
5619
|
mimeType: "image/jpeg",
|
|
5620
|
-
height: dataView.getUint16(
|
|
5620
|
+
height: dataView.getUint16(i + 5, BIG_ENDIAN),
|
|
5621
5621
|
// Number of lines
|
|
5622
|
-
width: dataView.getUint16(
|
|
5622
|
+
width: dataView.getUint16(i + 7, BIG_ENDIAN)
|
|
5623
5623
|
// Number of pixels per line
|
|
5624
5624
|
};
|
|
5625
5625
|
}
|
|
5626
5626
|
if (!tableMarkers.has(marker)) {
|
|
5627
5627
|
return null;
|
|
5628
5628
|
}
|
|
5629
|
-
|
|
5630
|
-
|
|
5629
|
+
i += 2;
|
|
5630
|
+
i += dataView.getUint16(i, BIG_ENDIAN);
|
|
5631
5631
|
}
|
|
5632
5632
|
return null;
|
|
5633
5633
|
}
|
|
5634
5634
|
function getJpegMarkers() {
|
|
5635
5635
|
const tableMarkers = /* @__PURE__ */ new Set([65499, 65476, 65484, 65501, 65534]);
|
|
5636
|
-
for (let
|
|
5637
|
-
tableMarkers.add(
|
|
5636
|
+
for (let i = 65504; i < 65520; ++i) {
|
|
5637
|
+
tableMarkers.add(i);
|
|
5638
5638
|
}
|
|
5639
5639
|
const sofMarkers = /* @__PURE__ */ new Set([
|
|
5640
5640
|
65472,
|
|
@@ -5748,7 +5748,7 @@
|
|
|
5748
5748
|
};
|
|
5749
5749
|
|
|
5750
5750
|
// ../draco/src/lib/utils/version.ts
|
|
5751
|
-
var VERSION5 = true ? "4.3.0-alpha.
|
|
5751
|
+
var VERSION5 = true ? "4.3.0-alpha.3" : "latest";
|
|
5752
5752
|
|
|
5753
5753
|
// ../draco/src/draco-loader.ts
|
|
5754
5754
|
var DracoLoader = {
|
|
@@ -6204,7 +6204,7 @@
|
|
|
6204
6204
|
return {
|
|
6205
6205
|
quantization_bits: transform.quantization_bits(),
|
|
6206
6206
|
range: transform.range(),
|
|
6207
|
-
min_values: new Float32Array([1, 2, 3]).map((
|
|
6207
|
+
min_values: new Float32Array([1, 2, 3]).map((i) => transform.min_value(i))
|
|
6208
6208
|
};
|
|
6209
6209
|
}
|
|
6210
6210
|
} finally {
|
|
@@ -6256,16 +6256,16 @@
|
|
|
6256
6256
|
function getInt32Array(dracoArray) {
|
|
6257
6257
|
const numValues = dracoArray.size();
|
|
6258
6258
|
const intArray = new Int32Array(numValues);
|
|
6259
|
-
for (let
|
|
6260
|
-
intArray[
|
|
6259
|
+
for (let i = 0; i < numValues; i++) {
|
|
6260
|
+
intArray[i] = dracoArray.GetValue(i);
|
|
6261
6261
|
}
|
|
6262
6262
|
return intArray;
|
|
6263
6263
|
}
|
|
6264
6264
|
function getUint32Array(dracoArray) {
|
|
6265
6265
|
const numValues = dracoArray.size();
|
|
6266
6266
|
const intArray = new Int32Array(numValues);
|
|
6267
|
-
for (let
|
|
6268
|
-
intArray[
|
|
6267
|
+
for (let i = 0; i < numValues; i++) {
|
|
6268
|
+
intArray[i] = dracoArray.GetValue(i);
|
|
6269
6269
|
}
|
|
6270
6270
|
return intArray;
|
|
6271
6271
|
}
|
|
@@ -6364,7 +6364,7 @@
|
|
|
6364
6364
|
}
|
|
6365
6365
|
|
|
6366
6366
|
// ../textures/src/lib/utils/version.ts
|
|
6367
|
-
var VERSION6 = true ? "4.3.0-alpha.
|
|
6367
|
+
var VERSION6 = true ? "4.3.0-alpha.3" : "latest";
|
|
6368
6368
|
|
|
6369
6369
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
6370
6370
|
var BASIS_EXTERNAL_LIBRARIES = {
|
|
@@ -6553,99 +6553,255 @@
|
|
|
6553
6553
|
}
|
|
6554
6554
|
|
|
6555
6555
|
// ../../node_modules/ktx-parse/dist/ktx-parse.modern.js
|
|
6556
|
-
var
|
|
6557
|
-
var
|
|
6558
|
-
var
|
|
6559
|
-
var
|
|
6560
|
-
var
|
|
6561
|
-
var
|
|
6562
|
-
var
|
|
6563
|
-
var
|
|
6564
|
-
var
|
|
6565
|
-
var
|
|
6566
|
-
|
|
6567
|
-
t2[t2.NONE = 0] = "NONE", t2[t2.BASISLZ = 1] = "BASISLZ", t2[t2.ZSTD = 2] = "ZSTD", t2[t2.ZLIB = 3] = "ZLIB";
|
|
6568
|
-
}(n || (n = {})), function(t2) {
|
|
6569
|
-
t2[t2.BASICFORMAT = 0] = "BASICFORMAT";
|
|
6570
|
-
}(i || (i = {})), function(t2) {
|
|
6571
|
-
t2[t2.UNSPECIFIED = 0] = "UNSPECIFIED", t2[t2.ETC1S = 163] = "ETC1S", t2[t2.UASTC = 166] = "UASTC";
|
|
6572
|
-
}(s || (s = {})), function(t2) {
|
|
6573
|
-
t2[t2.UNSPECIFIED = 0] = "UNSPECIFIED", t2[t2.SRGB = 1] = "SRGB";
|
|
6574
|
-
}(a || (a = {})), function(t2) {
|
|
6575
|
-
t2[t2.UNSPECIFIED = 0] = "UNSPECIFIED", t2[t2.LINEAR = 1] = "LINEAR", t2[t2.SRGB = 2] = "SRGB", t2[t2.ITU = 3] = "ITU", t2[t2.NTSC = 4] = "NTSC", t2[t2.SLOG = 5] = "SLOG", t2[t2.SLOG2 = 6] = "SLOG2";
|
|
6576
|
-
}(r || (r = {})), function(t2) {
|
|
6577
|
-
t2[t2.ALPHA_STRAIGHT = 0] = "ALPHA_STRAIGHT", t2[t2.ALPHA_PREMULTIPLIED = 1] = "ALPHA_PREMULTIPLIED";
|
|
6578
|
-
}(o || (o = {})), function(t2) {
|
|
6579
|
-
t2[t2.RGB = 0] = "RGB", t2[t2.RRR = 3] = "RRR", t2[t2.GGG = 4] = "GGG", t2[t2.AAA = 15] = "AAA";
|
|
6580
|
-
}(l || (l = {})), function(t2) {
|
|
6581
|
-
t2[t2.RGB = 0] = "RGB", t2[t2.RGBA = 3] = "RGBA", t2[t2.RRR = 4] = "RRR", t2[t2.RRRG = 5] = "RRRG";
|
|
6582
|
-
}(f || (f = {}));
|
|
6583
|
-
var U = class {
|
|
6556
|
+
var KHR_SUPERCOMPRESSION_NONE = 0;
|
|
6557
|
+
var KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT = 0;
|
|
6558
|
+
var KHR_DF_VENDORID_KHRONOS = 0;
|
|
6559
|
+
var KHR_DF_VERSION = 2;
|
|
6560
|
+
var KHR_DF_MODEL_UNSPECIFIED = 0;
|
|
6561
|
+
var KHR_DF_FLAG_ALPHA_STRAIGHT = 0;
|
|
6562
|
+
var KHR_DF_TRANSFER_SRGB = 2;
|
|
6563
|
+
var KHR_DF_PRIMARIES_BT709 = 1;
|
|
6564
|
+
var KHR_DF_SAMPLE_DATATYPE_SIGNED = 64;
|
|
6565
|
+
var VK_FORMAT_UNDEFINED = 0;
|
|
6566
|
+
var KTX2Container = class {
|
|
6584
6567
|
constructor() {
|
|
6585
|
-
this.vkFormat =
|
|
6568
|
+
this.vkFormat = VK_FORMAT_UNDEFINED;
|
|
6569
|
+
this.typeSize = 1;
|
|
6570
|
+
this.pixelWidth = 0;
|
|
6571
|
+
this.pixelHeight = 0;
|
|
6572
|
+
this.pixelDepth = 0;
|
|
6573
|
+
this.layerCount = 0;
|
|
6574
|
+
this.faceCount = 1;
|
|
6575
|
+
this.supercompressionScheme = KHR_SUPERCOMPRESSION_NONE;
|
|
6576
|
+
this.levels = [];
|
|
6577
|
+
this.dataFormatDescriptor = [{
|
|
6578
|
+
vendorId: KHR_DF_VENDORID_KHRONOS,
|
|
6579
|
+
descriptorType: KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT,
|
|
6580
|
+
descriptorBlockSize: 0,
|
|
6581
|
+
versionNumber: KHR_DF_VERSION,
|
|
6582
|
+
colorModel: KHR_DF_MODEL_UNSPECIFIED,
|
|
6583
|
+
colorPrimaries: KHR_DF_PRIMARIES_BT709,
|
|
6584
|
+
transferFunction: KHR_DF_TRANSFER_SRGB,
|
|
6585
|
+
flags: KHR_DF_FLAG_ALPHA_STRAIGHT,
|
|
6586
|
+
texelBlockDimension: [0, 0, 0, 0],
|
|
6587
|
+
bytesPlane: [0, 0, 0, 0, 0, 0, 0, 0],
|
|
6588
|
+
samples: []
|
|
6589
|
+
}];
|
|
6590
|
+
this.keyValue = {};
|
|
6591
|
+
this.globalData = null;
|
|
6586
6592
|
}
|
|
6587
6593
|
};
|
|
6588
|
-
var
|
|
6589
|
-
constructor(
|
|
6590
|
-
this._dataView =
|
|
6594
|
+
var BufferReader = class {
|
|
6595
|
+
constructor(data, byteOffset, byteLength, littleEndian) {
|
|
6596
|
+
this._dataView = void 0;
|
|
6597
|
+
this._littleEndian = void 0;
|
|
6598
|
+
this._offset = void 0;
|
|
6599
|
+
this._dataView = new DataView(data.buffer, data.byteOffset + byteOffset, byteLength);
|
|
6600
|
+
this._littleEndian = littleEndian;
|
|
6601
|
+
this._offset = 0;
|
|
6591
6602
|
}
|
|
6592
6603
|
_nextUint8() {
|
|
6593
|
-
const
|
|
6594
|
-
|
|
6604
|
+
const value = this._dataView.getUint8(this._offset);
|
|
6605
|
+
this._offset += 1;
|
|
6606
|
+
return value;
|
|
6595
6607
|
}
|
|
6596
6608
|
_nextUint16() {
|
|
6597
|
-
const
|
|
6598
|
-
|
|
6609
|
+
const value = this._dataView.getUint16(this._offset, this._littleEndian);
|
|
6610
|
+
this._offset += 2;
|
|
6611
|
+
return value;
|
|
6599
6612
|
}
|
|
6600
6613
|
_nextUint32() {
|
|
6601
|
-
const
|
|
6602
|
-
|
|
6614
|
+
const value = this._dataView.getUint32(this._offset, this._littleEndian);
|
|
6615
|
+
this._offset += 4;
|
|
6616
|
+
return value;
|
|
6603
6617
|
}
|
|
6604
6618
|
_nextUint64() {
|
|
6605
|
-
const
|
|
6606
|
-
|
|
6619
|
+
const left = this._dataView.getUint32(this._offset, this._littleEndian);
|
|
6620
|
+
const right = this._dataView.getUint32(this._offset + 4, this._littleEndian);
|
|
6621
|
+
const value = left + 2 ** 32 * right;
|
|
6622
|
+
this._offset += 8;
|
|
6623
|
+
return value;
|
|
6624
|
+
}
|
|
6625
|
+
_nextInt32() {
|
|
6626
|
+
const value = this._dataView.getInt32(this._offset, this._littleEndian);
|
|
6627
|
+
this._offset += 4;
|
|
6628
|
+
return value;
|
|
6607
6629
|
}
|
|
6608
|
-
|
|
6609
|
-
|
|
6630
|
+
_nextUint8Array(len2) {
|
|
6631
|
+
const value = new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + this._offset, len2);
|
|
6632
|
+
this._offset += len2;
|
|
6633
|
+
return value;
|
|
6610
6634
|
}
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6635
|
+
_skip(bytes) {
|
|
6636
|
+
this._offset += bytes;
|
|
6637
|
+
return this;
|
|
6638
|
+
}
|
|
6639
|
+
_scan(maxByteLength, term = 0) {
|
|
6640
|
+
const byteOffset = this._offset;
|
|
6641
|
+
let byteLength = 0;
|
|
6642
|
+
while (this._dataView.getUint8(this._offset) !== term && byteLength < maxByteLength) {
|
|
6643
|
+
byteLength++;
|
|
6644
|
+
this._offset++;
|
|
6645
|
+
}
|
|
6646
|
+
if (byteLength < maxByteLength)
|
|
6647
|
+
this._offset++;
|
|
6648
|
+
return new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + byteOffset, byteLength);
|
|
6617
6649
|
}
|
|
6618
6650
|
};
|
|
6619
|
-
|
|
6620
|
-
|
|
6651
|
+
var NUL = new Uint8Array([0]);
|
|
6652
|
+
var KTX2_ID = [
|
|
6653
|
+
// '´', 'K', 'T', 'X', '2', '0', 'ª', '\r', '\n', '\x1A', '\n'
|
|
6654
|
+
171,
|
|
6655
|
+
75,
|
|
6656
|
+
84,
|
|
6657
|
+
88,
|
|
6658
|
+
32,
|
|
6659
|
+
50,
|
|
6660
|
+
48,
|
|
6661
|
+
187,
|
|
6662
|
+
13,
|
|
6663
|
+
10,
|
|
6664
|
+
26,
|
|
6665
|
+
10
|
|
6666
|
+
];
|
|
6667
|
+
function decodeText(buffer) {
|
|
6668
|
+
if (typeof TextDecoder !== "undefined") {
|
|
6669
|
+
return new TextDecoder().decode(buffer);
|
|
6670
|
+
}
|
|
6671
|
+
return Buffer.from(buffer).toString("utf8");
|
|
6621
6672
|
}
|
|
6622
|
-
function
|
|
6623
|
-
const
|
|
6624
|
-
if (
|
|
6673
|
+
function read(data) {
|
|
6674
|
+
const id = new Uint8Array(data.buffer, data.byteOffset, KTX2_ID.length);
|
|
6675
|
+
if (id[0] !== KTX2_ID[0] || // '´'
|
|
6676
|
+
id[1] !== KTX2_ID[1] || // 'K'
|
|
6677
|
+
id[2] !== KTX2_ID[2] || // 'T'
|
|
6678
|
+
id[3] !== KTX2_ID[3] || // 'X'
|
|
6679
|
+
id[4] !== KTX2_ID[4] || // ' '
|
|
6680
|
+
id[5] !== KTX2_ID[5] || // '2'
|
|
6681
|
+
id[6] !== KTX2_ID[6] || // '0'
|
|
6682
|
+
id[7] !== KTX2_ID[7] || // 'ª'
|
|
6683
|
+
id[8] !== KTX2_ID[8] || // '\r'
|
|
6684
|
+
id[9] !== KTX2_ID[9] || // '\n'
|
|
6685
|
+
id[10] !== KTX2_ID[10] || // '\x1A'
|
|
6686
|
+
id[11] !== KTX2_ID[11]) {
|
|
6625
6687
|
throw new Error("Missing KTX 2.0 identifier.");
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
const
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
const
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
const
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6688
|
+
}
|
|
6689
|
+
const container = new KTX2Container();
|
|
6690
|
+
const headerByteLength = 17 * Uint32Array.BYTES_PER_ELEMENT;
|
|
6691
|
+
const headerReader = new BufferReader(data, KTX2_ID.length, headerByteLength, true);
|
|
6692
|
+
container.vkFormat = headerReader._nextUint32();
|
|
6693
|
+
container.typeSize = headerReader._nextUint32();
|
|
6694
|
+
container.pixelWidth = headerReader._nextUint32();
|
|
6695
|
+
container.pixelHeight = headerReader._nextUint32();
|
|
6696
|
+
container.pixelDepth = headerReader._nextUint32();
|
|
6697
|
+
container.layerCount = headerReader._nextUint32();
|
|
6698
|
+
container.faceCount = headerReader._nextUint32();
|
|
6699
|
+
const levelCount = headerReader._nextUint32();
|
|
6700
|
+
container.supercompressionScheme = headerReader._nextUint32();
|
|
6701
|
+
const dfdByteOffset = headerReader._nextUint32();
|
|
6702
|
+
const dfdByteLength = headerReader._nextUint32();
|
|
6703
|
+
const kvdByteOffset = headerReader._nextUint32();
|
|
6704
|
+
const kvdByteLength = headerReader._nextUint32();
|
|
6705
|
+
const sgdByteOffset = headerReader._nextUint64();
|
|
6706
|
+
const sgdByteLength = headerReader._nextUint64();
|
|
6707
|
+
const levelByteLength = levelCount * 3 * 8;
|
|
6708
|
+
const levelReader = new BufferReader(data, KTX2_ID.length + headerByteLength, levelByteLength, true);
|
|
6709
|
+
for (let i = 0; i < levelCount; i++) {
|
|
6710
|
+
container.levels.push({
|
|
6711
|
+
levelData: new Uint8Array(data.buffer, data.byteOffset + levelReader._nextUint64(), levelReader._nextUint64()),
|
|
6712
|
+
uncompressedByteLength: levelReader._nextUint64()
|
|
6713
|
+
});
|
|
6714
|
+
}
|
|
6715
|
+
const dfdReader = new BufferReader(data, dfdByteOffset, dfdByteLength, true);
|
|
6716
|
+
const dfd = {
|
|
6717
|
+
vendorId: dfdReader._skip(
|
|
6718
|
+
4
|
|
6719
|
+
/* totalSize */
|
|
6720
|
+
)._nextUint16(),
|
|
6721
|
+
descriptorType: dfdReader._nextUint16(),
|
|
6722
|
+
versionNumber: dfdReader._nextUint16(),
|
|
6723
|
+
descriptorBlockSize: dfdReader._nextUint16(),
|
|
6724
|
+
colorModel: dfdReader._nextUint8(),
|
|
6725
|
+
colorPrimaries: dfdReader._nextUint8(),
|
|
6726
|
+
transferFunction: dfdReader._nextUint8(),
|
|
6727
|
+
flags: dfdReader._nextUint8(),
|
|
6728
|
+
texelBlockDimension: [dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8()],
|
|
6729
|
+
bytesPlane: [dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8()],
|
|
6730
|
+
samples: []
|
|
6731
|
+
};
|
|
6732
|
+
const sampleStart = 6;
|
|
6733
|
+
const sampleWords = 4;
|
|
6734
|
+
const numSamples = (dfd.descriptorBlockSize / 4 - sampleStart) / sampleWords;
|
|
6735
|
+
for (let i = 0; i < numSamples; i++) {
|
|
6736
|
+
const sample = {
|
|
6737
|
+
bitOffset: dfdReader._nextUint16(),
|
|
6738
|
+
bitLength: dfdReader._nextUint8(),
|
|
6739
|
+
channelType: dfdReader._nextUint8(),
|
|
6740
|
+
samplePosition: [dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8()],
|
|
6741
|
+
sampleLower: -Infinity,
|
|
6742
|
+
sampleUpper: Infinity
|
|
6743
|
+
};
|
|
6744
|
+
if (sample.channelType & KHR_DF_SAMPLE_DATATYPE_SIGNED) {
|
|
6745
|
+
sample.sampleLower = dfdReader._nextInt32();
|
|
6746
|
+
sample.sampleUpper = dfdReader._nextInt32();
|
|
6747
|
+
} else {
|
|
6748
|
+
sample.sampleLower = dfdReader._nextUint32();
|
|
6749
|
+
sample.sampleUpper = dfdReader._nextUint32();
|
|
6750
|
+
}
|
|
6751
|
+
dfd.samples[i] = sample;
|
|
6752
|
+
}
|
|
6753
|
+
container.dataFormatDescriptor.length = 0;
|
|
6754
|
+
container.dataFormatDescriptor.push(dfd);
|
|
6755
|
+
const kvdReader = new BufferReader(data, kvdByteOffset, kvdByteLength, true);
|
|
6756
|
+
while (kvdReader._offset < kvdByteLength) {
|
|
6757
|
+
const keyValueByteLength = kvdReader._nextUint32();
|
|
6758
|
+
const keyData = kvdReader._scan(keyValueByteLength);
|
|
6759
|
+
const key = decodeText(keyData);
|
|
6760
|
+
container.keyValue[key] = kvdReader._nextUint8Array(keyValueByteLength - keyData.byteLength - 1);
|
|
6761
|
+
if (key.match(/^ktx/i)) {
|
|
6762
|
+
const text = decodeText(container.keyValue[key]);
|
|
6763
|
+
container.keyValue[key] = text.substring(0, text.lastIndexOf("\0"));
|
|
6764
|
+
}
|
|
6765
|
+
const kvPadding = keyValueByteLength % 4 ? 4 - keyValueByteLength % 4 : 0;
|
|
6766
|
+
kvdReader._skip(kvPadding);
|
|
6767
|
+
}
|
|
6768
|
+
if (sgdByteLength <= 0)
|
|
6769
|
+
return container;
|
|
6770
|
+
const sgdReader = new BufferReader(data, sgdByteOffset, sgdByteLength, true);
|
|
6771
|
+
const endpointCount = sgdReader._nextUint16();
|
|
6772
|
+
const selectorCount = sgdReader._nextUint16();
|
|
6773
|
+
const endpointsByteLength = sgdReader._nextUint32();
|
|
6774
|
+
const selectorsByteLength = sgdReader._nextUint32();
|
|
6775
|
+
const tablesByteLength = sgdReader._nextUint32();
|
|
6776
|
+
const extendedByteLength = sgdReader._nextUint32();
|
|
6777
|
+
const imageDescs = [];
|
|
6778
|
+
for (let i = 0; i < levelCount; i++) {
|
|
6779
|
+
imageDescs.push({
|
|
6780
|
+
imageFlags: sgdReader._nextUint32(),
|
|
6781
|
+
rgbSliceByteOffset: sgdReader._nextUint32(),
|
|
6782
|
+
rgbSliceByteLength: sgdReader._nextUint32(),
|
|
6783
|
+
alphaSliceByteOffset: sgdReader._nextUint32(),
|
|
6784
|
+
alphaSliceByteLength: sgdReader._nextUint32()
|
|
6785
|
+
});
|
|
6786
|
+
}
|
|
6787
|
+
const endpointsByteOffset = sgdByteOffset + sgdReader._offset;
|
|
6788
|
+
const selectorsByteOffset = endpointsByteOffset + endpointsByteLength;
|
|
6789
|
+
const tablesByteOffset = selectorsByteOffset + selectorsByteLength;
|
|
6790
|
+
const extendedByteOffset = tablesByteOffset + tablesByteLength;
|
|
6791
|
+
const endpointsData = new Uint8Array(data.buffer, data.byteOffset + endpointsByteOffset, endpointsByteLength);
|
|
6792
|
+
const selectorsData = new Uint8Array(data.buffer, data.byteOffset + selectorsByteOffset, selectorsByteLength);
|
|
6793
|
+
const tablesData = new Uint8Array(data.buffer, data.byteOffset + tablesByteOffset, tablesByteLength);
|
|
6794
|
+
const extendedData = new Uint8Array(data.buffer, data.byteOffset + extendedByteOffset, extendedByteLength);
|
|
6795
|
+
container.globalData = {
|
|
6796
|
+
endpointCount,
|
|
6797
|
+
selectorCount,
|
|
6798
|
+
imageDescs,
|
|
6799
|
+
endpointsData,
|
|
6800
|
+
selectorsData,
|
|
6801
|
+
tablesData,
|
|
6802
|
+
extendedData
|
|
6803
|
+
};
|
|
6804
|
+
return container;
|
|
6649
6805
|
}
|
|
6650
6806
|
|
|
6651
6807
|
// ../textures/src/lib/utils/extract-mipmap-images.ts
|
|
@@ -6654,10 +6810,10 @@
|
|
|
6654
6810
|
let levelWidth = options.width;
|
|
6655
6811
|
let levelHeight = options.height;
|
|
6656
6812
|
let offset = 0;
|
|
6657
|
-
for (let
|
|
6658
|
-
const levelSize = getLevelSize(options, levelWidth, levelHeight, data,
|
|
6659
|
-
const levelData = getLevelData(data,
|
|
6660
|
-
images[
|
|
6813
|
+
for (let i = 0; i < options.mipMapLevels; ++i) {
|
|
6814
|
+
const levelSize = getLevelSize(options, levelWidth, levelHeight, data, i);
|
|
6815
|
+
const levelData = getLevelData(data, i, offset, levelSize);
|
|
6816
|
+
images[i] = {
|
|
6661
6817
|
compressed: true,
|
|
6662
6818
|
format: options.internalFormat,
|
|
6663
6819
|
data: levelData,
|
|
@@ -6800,7 +6956,7 @@
|
|
|
6800
6956
|
}
|
|
6801
6957
|
|
|
6802
6958
|
// ../textures/src/lib/parsers/parse-ktx.ts
|
|
6803
|
-
var
|
|
6959
|
+
var KTX2_ID2 = [
|
|
6804
6960
|
// '´', 'K', 'T', 'X', '2', '0', 'ª', '\r', '\n', '\x1A', '\n'
|
|
6805
6961
|
171,
|
|
6806
6962
|
75,
|
|
@@ -6817,23 +6973,23 @@
|
|
|
6817
6973
|
];
|
|
6818
6974
|
function isKTX(data) {
|
|
6819
6975
|
const id = new Uint8Array(data);
|
|
6820
|
-
const notKTX = id.byteLength <
|
|
6821
|
-
id[1] !==
|
|
6822
|
-
id[2] !==
|
|
6823
|
-
id[3] !==
|
|
6824
|
-
id[4] !==
|
|
6825
|
-
id[5] !==
|
|
6826
|
-
id[6] !==
|
|
6827
|
-
id[7] !==
|
|
6828
|
-
id[8] !==
|
|
6829
|
-
id[9] !==
|
|
6830
|
-
id[10] !==
|
|
6831
|
-
id[11] !==
|
|
6976
|
+
const notKTX = id.byteLength < KTX2_ID2.length || id[0] !== KTX2_ID2[0] || // '´'
|
|
6977
|
+
id[1] !== KTX2_ID2[1] || // 'K'
|
|
6978
|
+
id[2] !== KTX2_ID2[2] || // 'T'
|
|
6979
|
+
id[3] !== KTX2_ID2[3] || // 'X'
|
|
6980
|
+
id[4] !== KTX2_ID2[4] || // ' '
|
|
6981
|
+
id[5] !== KTX2_ID2[5] || // '2'
|
|
6982
|
+
id[6] !== KTX2_ID2[6] || // '0'
|
|
6983
|
+
id[7] !== KTX2_ID2[7] || // 'ª'
|
|
6984
|
+
id[8] !== KTX2_ID2[8] || // '\r'
|
|
6985
|
+
id[9] !== KTX2_ID2[9] || // '\n'
|
|
6986
|
+
id[10] !== KTX2_ID2[10] || // '\x1A'
|
|
6987
|
+
id[11] !== KTX2_ID2[11];
|
|
6832
6988
|
return !notKTX;
|
|
6833
6989
|
}
|
|
6834
6990
|
function parseKTX(arrayBuffer) {
|
|
6835
6991
|
const uint8Array = new Uint8Array(arrayBuffer);
|
|
6836
|
-
const ktx =
|
|
6992
|
+
const ktx = read(uint8Array);
|
|
6837
6993
|
const mipMapLevels = Math.max(1, ktx.levels.length);
|
|
6838
6994
|
const width = ktx.pixelWidth;
|
|
6839
6995
|
const height = ktx.pixelHeight;
|
|
@@ -6972,7 +7128,6 @@
|
|
|
6972
7128
|
const levels = [];
|
|
6973
7129
|
for (let levelIndex = 0; levelIndex < levelsCount; levelIndex++) {
|
|
6974
7130
|
levels.push(transcodeKTX2Image(ktx2File, levelIndex, options));
|
|
6975
|
-
break;
|
|
6976
7131
|
}
|
|
6977
7132
|
return [levels];
|
|
6978
7133
|
} finally {
|
|
@@ -7539,7 +7694,7 @@
|
|
|
7539
7694
|
try {
|
|
7540
7695
|
const texture = await parseFromContext(arrayBuffer2, [], options2, context);
|
|
7541
7696
|
content.texture = texture;
|
|
7542
|
-
} catch (
|
|
7697
|
+
} catch (e) {
|
|
7543
7698
|
const texture = await parse(arrayBuffer2, loader, options2, context);
|
|
7544
7699
|
content.texture = texture;
|
|
7545
7700
|
}
|
|
@@ -7776,16 +7931,16 @@
|
|
|
7776
7931
|
const positions = new Float64Array(vertices.length);
|
|
7777
7932
|
const scaleX = metadata["i3s-scale_x"] && metadata["i3s-scale_x"].double || 1;
|
|
7778
7933
|
const scaleY = metadata["i3s-scale_y"] && metadata["i3s-scale_y"].double || 1;
|
|
7779
|
-
for (let
|
|
7780
|
-
positions[
|
|
7781
|
-
positions[
|
|
7782
|
-
positions[
|
|
7934
|
+
for (let i = 0; i < positions.length; i += 3) {
|
|
7935
|
+
positions[i] = vertices[i] * scaleX + cartographicOrigin.x;
|
|
7936
|
+
positions[i + 1] = vertices[i + 1] * scaleY + cartographicOrigin.y;
|
|
7937
|
+
positions[i + 2] = vertices[i + 2] + cartographicOrigin.z;
|
|
7783
7938
|
}
|
|
7784
|
-
for (let
|
|
7785
|
-
Ellipsoid.WGS84.cartographicToCartesian(positions.subarray(
|
|
7786
|
-
positions[
|
|
7787
|
-
positions[
|
|
7788
|
-
positions[
|
|
7939
|
+
for (let i = 0; i < positions.length; i += 3) {
|
|
7940
|
+
Ellipsoid.WGS84.cartographicToCartesian(positions.subarray(i, i + 3), scratchVector6);
|
|
7941
|
+
positions[i] = scratchVector6.x;
|
|
7942
|
+
positions[i + 1] = scratchVector6.y;
|
|
7943
|
+
positions[i + 2] = scratchVector6.z;
|
|
7789
7944
|
}
|
|
7790
7945
|
return positions;
|
|
7791
7946
|
}
|
|
@@ -7895,7 +8050,7 @@
|
|
|
7895
8050
|
}
|
|
7896
8051
|
|
|
7897
8052
|
// src/i3s-content-loader.ts
|
|
7898
|
-
var VERSION7 = true ? "4.3.0-alpha.
|
|
8053
|
+
var VERSION7 = true ? "4.3.0-alpha.3" : "latest";
|
|
7899
8054
|
var I3SContentLoader = {
|
|
7900
8055
|
dataType: null,
|
|
7901
8056
|
batchType: null,
|