@loaders.gl/i3s 4.3.0-alpha.6 → 4.3.0-alpha.8
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 +442 -173
- 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 +44 -44
- package/dist/i3s-content-worker-node.js.map +3 -3
- package/dist/i3s-content-worker.js +272 -123
- 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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/index.ts +1 -0
|
@@ -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.7" : "untranspiled source";
|
|
122
122
|
var isBrowser3 = isBrowser2();
|
|
123
123
|
|
|
124
124
|
// ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
@@ -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.7" : "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.7";
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
680
|
return globalThis._loadersgl_.version;
|
|
@@ -2747,17 +2747,11 @@
|
|
|
2747
2747
|
printRowMajor: true,
|
|
2748
2748
|
_cartographicRadians: false
|
|
2749
2749
|
};
|
|
2750
|
-
globalThis.mathgl = globalThis.mathgl || {
|
|
2751
|
-
config: {
|
|
2752
|
-
...DEFAULT_CONFIG
|
|
2753
|
-
}
|
|
2754
|
-
};
|
|
2750
|
+
globalThis.mathgl = globalThis.mathgl || { config: { ...DEFAULT_CONFIG } };
|
|
2755
2751
|
var config = globalThis.mathgl.config;
|
|
2756
|
-
function formatValue(value, {
|
|
2757
|
-
precision = config.precision
|
|
2758
|
-
} = {}) {
|
|
2752
|
+
function formatValue(value, { precision = config.precision } = {}) {
|
|
2759
2753
|
value = round(value);
|
|
2760
|
-
return
|
|
2754
|
+
return `${parseFloat(value.toPrecision(precision))}`;
|
|
2761
2755
|
}
|
|
2762
2756
|
function isArray(value) {
|
|
2763
2757
|
return Array.isArray(value) || ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
@@ -2828,28 +2822,12 @@
|
|
|
2828
2822
|
}
|
|
2829
2823
|
|
|
2830
2824
|
// ../../node_modules/@math.gl/core/dist/classes/base/math-array.js
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
ExtendableBuiltin.prototype = Object.create(cls.prototype, {
|
|
2838
|
-
constructor: {
|
|
2839
|
-
value: cls,
|
|
2840
|
-
enumerable: false,
|
|
2841
|
-
writable: true,
|
|
2842
|
-
configurable: true
|
|
2843
|
-
}
|
|
2844
|
-
});
|
|
2845
|
-
if (Object.setPrototypeOf) {
|
|
2846
|
-
Object.setPrototypeOf(ExtendableBuiltin, cls);
|
|
2847
|
-
} else {
|
|
2848
|
-
ExtendableBuiltin.__proto__ = cls;
|
|
2849
|
-
}
|
|
2850
|
-
return ExtendableBuiltin;
|
|
2851
|
-
}
|
|
2852
|
-
var MathArray = class extends _extendableBuiltin(Array) {
|
|
2825
|
+
var MathArray = class extends Array {
|
|
2826
|
+
// Common methods
|
|
2827
|
+
/**
|
|
2828
|
+
* Clone the current object
|
|
2829
|
+
* @returns a new copy of this object
|
|
2830
|
+
*/
|
|
2853
2831
|
clone() {
|
|
2854
2832
|
return new this.constructor().copy(this);
|
|
2855
2833
|
}
|
|
@@ -2869,7 +2847,10 @@
|
|
|
2869
2847
|
return targetObject;
|
|
2870
2848
|
}
|
|
2871
2849
|
from(arrayOrObject) {
|
|
2872
|
-
return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) :
|
|
2850
|
+
return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : (
|
|
2851
|
+
// @ts-ignore
|
|
2852
|
+
this.fromObject(arrayOrObject)
|
|
2853
|
+
);
|
|
2873
2854
|
}
|
|
2874
2855
|
to(arrayOrObject) {
|
|
2875
2856
|
if (arrayOrObject === this) {
|
|
@@ -2880,18 +2861,20 @@
|
|
|
2880
2861
|
toTarget(target) {
|
|
2881
2862
|
return target ? this.to(target) : this;
|
|
2882
2863
|
}
|
|
2864
|
+
/** @deprecated */
|
|
2883
2865
|
toFloat32Array() {
|
|
2884
2866
|
return new Float32Array(this);
|
|
2885
2867
|
}
|
|
2886
2868
|
toString() {
|
|
2887
2869
|
return this.formatString(config);
|
|
2888
2870
|
}
|
|
2871
|
+
/** Formats string according to options */
|
|
2889
2872
|
formatString(opts) {
|
|
2890
2873
|
let string = "";
|
|
2891
2874
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2892
2875
|
string += (i > 0 ? ", " : "") + formatValue(this[i], opts);
|
|
2893
2876
|
}
|
|
2894
|
-
return
|
|
2877
|
+
return `${opts.printTypes ? this.constructor.name : ""}[${string}]`;
|
|
2895
2878
|
}
|
|
2896
2879
|
equals(array) {
|
|
2897
2880
|
if (!array || this.length !== array.length) {
|
|
@@ -2915,6 +2898,8 @@
|
|
|
2915
2898
|
}
|
|
2916
2899
|
return true;
|
|
2917
2900
|
}
|
|
2901
|
+
// Modifiers
|
|
2902
|
+
/** Negates all values in this object */
|
|
2918
2903
|
negate() {
|
|
2919
2904
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2920
2905
|
this[i] = -this[i];
|
|
@@ -2932,12 +2917,14 @@
|
|
|
2932
2917
|
}
|
|
2933
2918
|
return this.check();
|
|
2934
2919
|
}
|
|
2920
|
+
/** Minimal */
|
|
2935
2921
|
min(vector) {
|
|
2936
2922
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2937
2923
|
this[i] = Math.min(vector[i], this[i]);
|
|
2938
2924
|
}
|
|
2939
2925
|
return this.check();
|
|
2940
2926
|
}
|
|
2927
|
+
/** Maximal */
|
|
2941
2928
|
max(vector) {
|
|
2942
2929
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2943
2930
|
this[i] = Math.max(vector[i], this[i]);
|
|
@@ -2978,18 +2965,25 @@
|
|
|
2978
2965
|
}
|
|
2979
2966
|
return this.check();
|
|
2980
2967
|
}
|
|
2968
|
+
/**
|
|
2969
|
+
* Multiplies all elements by `scale`
|
|
2970
|
+
* Note: `Matrix4.multiplyByScalar` only scales its 3x3 "minor"
|
|
2971
|
+
*/
|
|
2981
2972
|
multiplyByScalar(scalar) {
|
|
2982
2973
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
2983
2974
|
this[i] *= scalar;
|
|
2984
2975
|
}
|
|
2985
2976
|
return this.check();
|
|
2986
2977
|
}
|
|
2978
|
+
// Debug checks
|
|
2979
|
+
/** Throws an error if array length is incorrect or contains illegal values */
|
|
2987
2980
|
check() {
|
|
2988
2981
|
if (config.debug && !this.validate()) {
|
|
2989
|
-
throw new Error(
|
|
2982
|
+
throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);
|
|
2990
2983
|
}
|
|
2991
2984
|
return this;
|
|
2992
2985
|
}
|
|
2986
|
+
/** Returns false if the array length is incorrect or contains illegal values */
|
|
2993
2987
|
validate() {
|
|
2994
2988
|
let valid = this.length === this.ELEMENTS;
|
|
2995
2989
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
@@ -2997,39 +2991,48 @@
|
|
|
2997
2991
|
}
|
|
2998
2992
|
return valid;
|
|
2999
2993
|
}
|
|
2994
|
+
// three.js compatibility
|
|
2995
|
+
/** @deprecated */
|
|
3000
2996
|
sub(a) {
|
|
3001
2997
|
return this.subtract(a);
|
|
3002
2998
|
}
|
|
2999
|
+
/** @deprecated */
|
|
3003
3000
|
setScalar(a) {
|
|
3004
3001
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3005
3002
|
this[i] = a;
|
|
3006
3003
|
}
|
|
3007
3004
|
return this.check();
|
|
3008
3005
|
}
|
|
3006
|
+
/** @deprecated */
|
|
3009
3007
|
addScalar(a) {
|
|
3010
3008
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3011
3009
|
this[i] += a;
|
|
3012
3010
|
}
|
|
3013
3011
|
return this.check();
|
|
3014
3012
|
}
|
|
3013
|
+
/** @deprecated */
|
|
3015
3014
|
subScalar(a) {
|
|
3016
3015
|
return this.addScalar(-a);
|
|
3017
3016
|
}
|
|
3017
|
+
/** @deprecated */
|
|
3018
3018
|
multiplyScalar(scalar) {
|
|
3019
3019
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3020
3020
|
this[i] *= scalar;
|
|
3021
3021
|
}
|
|
3022
3022
|
return this.check();
|
|
3023
3023
|
}
|
|
3024
|
+
/** @deprecated */
|
|
3024
3025
|
divideScalar(a) {
|
|
3025
3026
|
return this.multiplyByScalar(1 / a);
|
|
3026
3027
|
}
|
|
3028
|
+
/** @deprecated */
|
|
3027
3029
|
clampScalar(min2, max2) {
|
|
3028
3030
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3029
3031
|
this[i] = Math.min(Math.max(this[i], min2), max2);
|
|
3030
3032
|
}
|
|
3031
3033
|
return this.check();
|
|
3032
3034
|
}
|
|
3035
|
+
/** @deprecated */
|
|
3033
3036
|
get elements() {
|
|
3034
3037
|
return this;
|
|
3035
3038
|
}
|
|
@@ -3049,13 +3052,13 @@
|
|
|
3049
3052
|
}
|
|
3050
3053
|
function checkNumber(value) {
|
|
3051
3054
|
if (!Number.isFinite(value)) {
|
|
3052
|
-
throw new Error(
|
|
3055
|
+
throw new Error(`Invalid number ${JSON.stringify(value)}`);
|
|
3053
3056
|
}
|
|
3054
3057
|
return value;
|
|
3055
3058
|
}
|
|
3056
3059
|
function checkVector(v, length2, callerName = "") {
|
|
3057
3060
|
if (config.debug && !validateVector(v, length2)) {
|
|
3058
|
-
throw new Error(
|
|
3061
|
+
throw new Error(`math.gl: ${callerName} some fields set to invalid numbers'`);
|
|
3059
3062
|
}
|
|
3060
3063
|
return v;
|
|
3061
3064
|
}
|
|
@@ -3063,12 +3066,13 @@
|
|
|
3063
3066
|
// ../../node_modules/@math.gl/core/dist/lib/assert.js
|
|
3064
3067
|
function assert4(condition, message) {
|
|
3065
3068
|
if (!condition) {
|
|
3066
|
-
throw new Error(
|
|
3069
|
+
throw new Error(`math.gl assertion ${message}`);
|
|
3067
3070
|
}
|
|
3068
3071
|
}
|
|
3069
3072
|
|
|
3070
3073
|
// ../../node_modules/@math.gl/core/dist/classes/base/vector.js
|
|
3071
3074
|
var Vector = class extends MathArray {
|
|
3075
|
+
// ACCESSORS
|
|
3072
3076
|
get x() {
|
|
3073
3077
|
return this[0];
|
|
3074
3078
|
}
|
|
@@ -3081,12 +3085,24 @@
|
|
|
3081
3085
|
set y(value) {
|
|
3082
3086
|
this[1] = checkNumber(value);
|
|
3083
3087
|
}
|
|
3088
|
+
/**
|
|
3089
|
+
* Returns the length of the vector from the origin to the point described by this vector
|
|
3090
|
+
*
|
|
3091
|
+
* @note `length` is a reserved word for Arrays, so `v.length()` will return number of elements
|
|
3092
|
+
* Instead we provide `len` and `magnitude`
|
|
3093
|
+
*/
|
|
3084
3094
|
len() {
|
|
3085
3095
|
return Math.sqrt(this.lengthSquared());
|
|
3086
3096
|
}
|
|
3097
|
+
/**
|
|
3098
|
+
* Returns the length of the vector from the origin to the point described by this vector
|
|
3099
|
+
*/
|
|
3087
3100
|
magnitude() {
|
|
3088
3101
|
return this.len();
|
|
3089
3102
|
}
|
|
3103
|
+
/**
|
|
3104
|
+
* Returns the squared length of the vector from the origin to the point described by this vector
|
|
3105
|
+
*/
|
|
3090
3106
|
lengthSquared() {
|
|
3091
3107
|
let length2 = 0;
|
|
3092
3108
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
@@ -3094,6 +3110,9 @@
|
|
|
3094
3110
|
}
|
|
3095
3111
|
return length2;
|
|
3096
3112
|
}
|
|
3113
|
+
/**
|
|
3114
|
+
* Returns the squared length of the vector from the origin to the point described by this vector
|
|
3115
|
+
*/
|
|
3097
3116
|
magnitudeSquared() {
|
|
3098
3117
|
return this.lengthSquared();
|
|
3099
3118
|
}
|
|
@@ -3115,6 +3134,7 @@
|
|
|
3115
3134
|
}
|
|
3116
3135
|
return checkNumber(product);
|
|
3117
3136
|
}
|
|
3137
|
+
// MODIFIERS
|
|
3118
3138
|
normalize() {
|
|
3119
3139
|
const length2 = this.magnitude();
|
|
3120
3140
|
if (length2 !== 0) {
|
|
@@ -3140,6 +3160,7 @@
|
|
|
3140
3160
|
}
|
|
3141
3161
|
return this.check();
|
|
3142
3162
|
}
|
|
3163
|
+
// THREE.js compatibility
|
|
3143
3164
|
lengthSq() {
|
|
3144
3165
|
return this.lengthSquared();
|
|
3145
3166
|
}
|
|
@@ -3631,7 +3652,7 @@
|
|
|
3631
3652
|
return out;
|
|
3632
3653
|
}
|
|
3633
3654
|
function str(a) {
|
|
3634
|
-
return
|
|
3655
|
+
return `vec3(${a[0]}, ${a[1]}, ${a[2]})`;
|
|
3635
3656
|
}
|
|
3636
3657
|
function exactEquals(a, b) {
|
|
3637
3658
|
return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
|
|
@@ -3692,6 +3713,12 @@
|
|
|
3692
3713
|
}
|
|
3693
3714
|
return ZERO;
|
|
3694
3715
|
}
|
|
3716
|
+
/**
|
|
3717
|
+
* @class
|
|
3718
|
+
* @param x
|
|
3719
|
+
* @param y
|
|
3720
|
+
* @param z
|
|
3721
|
+
*/
|
|
3695
3722
|
constructor(x = 0, y = 0, z = 0) {
|
|
3696
3723
|
super(-0, -0, -0);
|
|
3697
3724
|
if (arguments.length === 1 && isArray(x)) {
|
|
@@ -3736,6 +3763,7 @@
|
|
|
3736
3763
|
object.z = this[2];
|
|
3737
3764
|
return object;
|
|
3738
3765
|
}
|
|
3766
|
+
// Getters/setters
|
|
3739
3767
|
get ELEMENTS() {
|
|
3740
3768
|
return 3;
|
|
3741
3769
|
}
|
|
@@ -3745,41 +3773,38 @@
|
|
|
3745
3773
|
set z(value) {
|
|
3746
3774
|
this[2] = checkNumber(value);
|
|
3747
3775
|
}
|
|
3776
|
+
// ACCESSORS
|
|
3748
3777
|
angle(vector) {
|
|
3749
3778
|
return angle(this, vector);
|
|
3750
3779
|
}
|
|
3780
|
+
// MODIFIERS
|
|
3751
3781
|
cross(vector) {
|
|
3752
3782
|
cross(this, this, vector);
|
|
3753
3783
|
return this.check();
|
|
3754
3784
|
}
|
|
3755
|
-
rotateX({
|
|
3756
|
-
radians: radians2,
|
|
3757
|
-
origin = ORIGIN
|
|
3758
|
-
}) {
|
|
3785
|
+
rotateX({ radians: radians2, origin = ORIGIN }) {
|
|
3759
3786
|
rotateX(this, this, origin, radians2);
|
|
3760
3787
|
return this.check();
|
|
3761
3788
|
}
|
|
3762
|
-
rotateY({
|
|
3763
|
-
radians: radians2,
|
|
3764
|
-
origin = ORIGIN
|
|
3765
|
-
}) {
|
|
3789
|
+
rotateY({ radians: radians2, origin = ORIGIN }) {
|
|
3766
3790
|
rotateY(this, this, origin, radians2);
|
|
3767
3791
|
return this.check();
|
|
3768
3792
|
}
|
|
3769
|
-
rotateZ({
|
|
3770
|
-
radians: radians2,
|
|
3771
|
-
origin = ORIGIN
|
|
3772
|
-
}) {
|
|
3793
|
+
rotateZ({ radians: radians2, origin = ORIGIN }) {
|
|
3773
3794
|
rotateZ(this, this, origin, radians2);
|
|
3774
3795
|
return this.check();
|
|
3775
3796
|
}
|
|
3797
|
+
// Transforms
|
|
3798
|
+
// transforms as point (4th component is implicitly 1)
|
|
3776
3799
|
transform(matrix4) {
|
|
3777
3800
|
return this.transformAsPoint(matrix4);
|
|
3778
3801
|
}
|
|
3802
|
+
// transforms as point (4th component is implicitly 1)
|
|
3779
3803
|
transformAsPoint(matrix4) {
|
|
3780
3804
|
transformMat42(this, this, matrix4);
|
|
3781
3805
|
return this.check();
|
|
3782
3806
|
}
|
|
3807
|
+
// transforms as vector (4th component is implicitly 0, ignores translation. slightly faster)
|
|
3783
3808
|
transformAsVector(matrix4) {
|
|
3784
3809
|
vec3_transformMat4AsVector(this, this, matrix4);
|
|
3785
3810
|
return this.check();
|
|
@@ -3800,19 +3825,29 @@
|
|
|
3800
3825
|
|
|
3801
3826
|
// ../../node_modules/@math.gl/core/dist/classes/base/matrix.js
|
|
3802
3827
|
var Matrix = class extends MathArray {
|
|
3828
|
+
// fromObject(object) {
|
|
3829
|
+
// const array = object.elements;
|
|
3830
|
+
// return this.fromRowMajor(array);
|
|
3831
|
+
// }
|
|
3832
|
+
// toObject(object) {
|
|
3833
|
+
// const array = object.elements;
|
|
3834
|
+
// this.toRowMajor(array);
|
|
3835
|
+
// return object;
|
|
3836
|
+
// }
|
|
3837
|
+
// TODO better override formatString?
|
|
3803
3838
|
toString() {
|
|
3804
3839
|
let string = "[";
|
|
3805
3840
|
if (config.printRowMajor) {
|
|
3806
3841
|
string += "row-major:";
|
|
3807
3842
|
for (let row = 0; row < this.RANK; ++row) {
|
|
3808
3843
|
for (let col = 0; col < this.RANK; ++col) {
|
|
3809
|
-
string +=
|
|
3844
|
+
string += ` ${this[col * this.RANK + row]}`;
|
|
3810
3845
|
}
|
|
3811
3846
|
}
|
|
3812
3847
|
} else {
|
|
3813
3848
|
string += "column-major:";
|
|
3814
3849
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
3815
|
-
string +=
|
|
3850
|
+
string += ` ${this[i]}`;
|
|
3816
3851
|
}
|
|
3817
3852
|
}
|
|
3818
3853
|
string += "]";
|
|
@@ -3821,9 +3856,11 @@
|
|
|
3821
3856
|
getElementIndex(row, col) {
|
|
3822
3857
|
return col * this.RANK + row;
|
|
3823
3858
|
}
|
|
3859
|
+
// By default assumes row major indices
|
|
3824
3860
|
getElement(row, col) {
|
|
3825
3861
|
return this[col * this.RANK + row];
|
|
3826
3862
|
}
|
|
3863
|
+
// By default assumes row major indices
|
|
3827
3864
|
setElement(row, col, value) {
|
|
3828
3865
|
this[col * this.RANK + row] = checkNumber(value);
|
|
3829
3866
|
return this;
|
|
@@ -4589,6 +4626,7 @@
|
|
|
4589
4626
|
this[15] = array[15];
|
|
4590
4627
|
return this.check();
|
|
4591
4628
|
}
|
|
4629
|
+
// eslint-disable-next-line max-params
|
|
4592
4630
|
set(m00, m10, m20, m30, m01, m11, m21, m31, m02, m12, m22, m32, m03, m13, m23, m33) {
|
|
4593
4631
|
this[0] = m00;
|
|
4594
4632
|
this[1] = m10;
|
|
@@ -4608,6 +4646,8 @@
|
|
|
4608
4646
|
this[15] = m33;
|
|
4609
4647
|
return this.check();
|
|
4610
4648
|
}
|
|
4649
|
+
// accepts row major order, stores as column major
|
|
4650
|
+
// eslint-disable-next-line max-params
|
|
4611
4651
|
setRowMajor(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {
|
|
4612
4652
|
this[0] = m00;
|
|
4613
4653
|
this[1] = m10;
|
|
@@ -4646,25 +4686,41 @@
|
|
|
4646
4686
|
result[15] = this[15];
|
|
4647
4687
|
return result;
|
|
4648
4688
|
}
|
|
4689
|
+
// Constructors
|
|
4690
|
+
/** Set to identity matrix */
|
|
4649
4691
|
identity() {
|
|
4650
4692
|
return this.copy(IDENTITY_MATRIX);
|
|
4651
4693
|
}
|
|
4694
|
+
/**
|
|
4695
|
+
*
|
|
4696
|
+
* @param object
|
|
4697
|
+
* @returns self
|
|
4698
|
+
*/
|
|
4699
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4652
4700
|
fromObject(object) {
|
|
4653
4701
|
return this.check();
|
|
4654
4702
|
}
|
|
4703
|
+
/**
|
|
4704
|
+
* Calculates a 4x4 matrix from the given quaternion
|
|
4705
|
+
* @param quaternion Quaternion to create matrix from
|
|
4706
|
+
* @returns self
|
|
4707
|
+
*/
|
|
4655
4708
|
fromQuaternion(quaternion) {
|
|
4656
4709
|
fromQuat(this, quaternion);
|
|
4657
4710
|
return this.check();
|
|
4658
4711
|
}
|
|
4712
|
+
/**
|
|
4713
|
+
* Generates a frustum matrix with the given bounds
|
|
4714
|
+
* @param view.left - Left bound of the frustum
|
|
4715
|
+
* @param view.right - Right bound of the frustum
|
|
4716
|
+
* @param view.bottom - Bottom bound of the frustum
|
|
4717
|
+
* @param view.top - Top bound of the frustum
|
|
4718
|
+
* @param view.near - Near bound of the frustum
|
|
4719
|
+
* @param view.far - Far bound of the frustum. Can be set to Infinity.
|
|
4720
|
+
* @returns self
|
|
4721
|
+
*/
|
|
4659
4722
|
frustum(view) {
|
|
4660
|
-
const {
|
|
4661
|
-
left,
|
|
4662
|
-
right,
|
|
4663
|
-
bottom,
|
|
4664
|
-
top,
|
|
4665
|
-
near = DEFAULT_NEAR,
|
|
4666
|
-
far = DEFAULT_FAR
|
|
4667
|
-
} = view;
|
|
4723
|
+
const { left, right, bottom, top, near = DEFAULT_NEAR, far = DEFAULT_FAR } = view;
|
|
4668
4724
|
if (far === Infinity) {
|
|
4669
4725
|
computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);
|
|
4670
4726
|
} else {
|
|
@@ -4672,35 +4728,47 @@
|
|
|
4672
4728
|
}
|
|
4673
4729
|
return this.check();
|
|
4674
4730
|
}
|
|
4731
|
+
/**
|
|
4732
|
+
* Generates a look-at matrix with the given eye position, focal point,
|
|
4733
|
+
* and up axis
|
|
4734
|
+
* @param view.eye - (vector) Position of the viewer
|
|
4735
|
+
* @param view.center - (vector) Point the viewer is looking at
|
|
4736
|
+
* @param view.up - (vector) Up axis
|
|
4737
|
+
* @returns self
|
|
4738
|
+
*/
|
|
4675
4739
|
lookAt(view) {
|
|
4676
|
-
const {
|
|
4677
|
-
eye,
|
|
4678
|
-
center = [0, 0, 0],
|
|
4679
|
-
up = [0, 1, 0]
|
|
4680
|
-
} = view;
|
|
4740
|
+
const { eye, center = [0, 0, 0], up = [0, 1, 0] } = view;
|
|
4681
4741
|
lookAt(this, eye, center, up);
|
|
4682
4742
|
return this.check();
|
|
4683
4743
|
}
|
|
4744
|
+
/**
|
|
4745
|
+
* Generates a orthogonal projection matrix with the given bounds
|
|
4746
|
+
* from "traditional" view space parameters
|
|
4747
|
+
* @param view.left - Left bound of the frustum
|
|
4748
|
+
* @param view.right number Right bound of the frustum
|
|
4749
|
+
* @param view.bottom - Bottom bound of the frustum
|
|
4750
|
+
* @param view.top number Top bound of the frustum
|
|
4751
|
+
* @param view.near - Near bound of the frustum
|
|
4752
|
+
* @param view.far number Far bound of the frustum
|
|
4753
|
+
* @returns self
|
|
4754
|
+
*/
|
|
4684
4755
|
ortho(view) {
|
|
4685
|
-
const {
|
|
4686
|
-
left,
|
|
4687
|
-
right,
|
|
4688
|
-
bottom,
|
|
4689
|
-
top,
|
|
4690
|
-
near = DEFAULT_NEAR,
|
|
4691
|
-
far = DEFAULT_FAR
|
|
4692
|
-
} = view;
|
|
4756
|
+
const { left, right, bottom, top, near = DEFAULT_NEAR, far = DEFAULT_FAR } = view;
|
|
4693
4757
|
ortho(this, left, right, bottom, top, near, far);
|
|
4694
4758
|
return this.check();
|
|
4695
4759
|
}
|
|
4760
|
+
/**
|
|
4761
|
+
* Generates an orthogonal projection matrix with the same parameters
|
|
4762
|
+
* as a perspective matrix (plus focalDistance)
|
|
4763
|
+
* @param view.fovy Vertical field of view in radians
|
|
4764
|
+
* @param view.aspect Aspect ratio. Typically viewport width / viewport height
|
|
4765
|
+
* @param view.focalDistance Distance in the view frustum used for extent calculations
|
|
4766
|
+
* @param view.near Near bound of the frustum
|
|
4767
|
+
* @param view.far Far bound of the frustum
|
|
4768
|
+
* @returns self
|
|
4769
|
+
*/
|
|
4696
4770
|
orthographic(view) {
|
|
4697
|
-
const {
|
|
4698
|
-
fovy = DEFAULT_FOVY,
|
|
4699
|
-
aspect = DEFAULT_ASPECT,
|
|
4700
|
-
focalDistance = 1,
|
|
4701
|
-
near = DEFAULT_NEAR,
|
|
4702
|
-
far = DEFAULT_FAR
|
|
4703
|
-
} = view;
|
|
4771
|
+
const { fovy = DEFAULT_FOVY, aspect = DEFAULT_ASPECT, focalDistance = 1, near = DEFAULT_NEAR, far = DEFAULT_FAR } = view;
|
|
4704
4772
|
checkRadians(fovy);
|
|
4705
4773
|
const halfY = fovy / 2;
|
|
4706
4774
|
const top = focalDistance * Math.tan(halfY);
|
|
@@ -4714,32 +4782,53 @@
|
|
|
4714
4782
|
far
|
|
4715
4783
|
});
|
|
4716
4784
|
}
|
|
4785
|
+
/**
|
|
4786
|
+
* Generates a perspective projection matrix with the given bounds
|
|
4787
|
+
* @param view.fovy Vertical field of view in radians
|
|
4788
|
+
* @param view.aspect Aspect ratio. typically viewport width/height
|
|
4789
|
+
* @param view.near Near bound of the frustum
|
|
4790
|
+
* @param view.far Far bound of the frustum
|
|
4791
|
+
* @returns self
|
|
4792
|
+
*/
|
|
4717
4793
|
perspective(view) {
|
|
4718
|
-
const {
|
|
4719
|
-
fovy = 45 * Math.PI / 180,
|
|
4720
|
-
aspect = 1,
|
|
4721
|
-
near = 0.1,
|
|
4722
|
-
far = 500
|
|
4723
|
-
} = view;
|
|
4794
|
+
const { fovy = 45 * Math.PI / 180, aspect = 1, near = 0.1, far = 500 } = view;
|
|
4724
4795
|
checkRadians(fovy);
|
|
4725
4796
|
perspective(this, fovy, aspect, near, far);
|
|
4726
4797
|
return this.check();
|
|
4727
4798
|
}
|
|
4799
|
+
// Accessors
|
|
4728
4800
|
determinant() {
|
|
4729
4801
|
return determinant(this);
|
|
4730
4802
|
}
|
|
4803
|
+
/**
|
|
4804
|
+
* Extracts the non-uniform scale assuming the matrix is an affine transformation.
|
|
4805
|
+
* The scales are the "lengths" of the column vectors in the upper-left 3x3 matrix.
|
|
4806
|
+
* @param result
|
|
4807
|
+
* @returns self
|
|
4808
|
+
*/
|
|
4731
4809
|
getScale(result = [-0, -0, -0]) {
|
|
4732
4810
|
result[0] = Math.sqrt(this[0] * this[0] + this[1] * this[1] + this[2] * this[2]);
|
|
4733
4811
|
result[1] = Math.sqrt(this[4] * this[4] + this[5] * this[5] + this[6] * this[6]);
|
|
4734
4812
|
result[2] = Math.sqrt(this[8] * this[8] + this[9] * this[9] + this[10] * this[10]);
|
|
4735
4813
|
return result;
|
|
4736
4814
|
}
|
|
4815
|
+
/**
|
|
4816
|
+
* Gets the translation portion, assuming the matrix is a affine transformation matrix.
|
|
4817
|
+
* @param result
|
|
4818
|
+
* @returns self
|
|
4819
|
+
*/
|
|
4737
4820
|
getTranslation(result = [-0, -0, -0]) {
|
|
4738
4821
|
result[0] = this[12];
|
|
4739
4822
|
result[1] = this[13];
|
|
4740
4823
|
result[2] = this[14];
|
|
4741
4824
|
return result;
|
|
4742
4825
|
}
|
|
4826
|
+
/**
|
|
4827
|
+
* Gets upper left 3x3 pure rotation matrix (non-scaling), assume affine transformation matrix
|
|
4828
|
+
* @param result
|
|
4829
|
+
* @param scaleResult
|
|
4830
|
+
* @returns self
|
|
4831
|
+
*/
|
|
4743
4832
|
getRotation(result, scaleResult) {
|
|
4744
4833
|
result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];
|
|
4745
4834
|
scaleResult = scaleResult || [-0, -0, -0];
|
|
@@ -4765,6 +4854,12 @@
|
|
|
4765
4854
|
result[15] = 1;
|
|
4766
4855
|
return result;
|
|
4767
4856
|
}
|
|
4857
|
+
/**
|
|
4858
|
+
*
|
|
4859
|
+
* @param result
|
|
4860
|
+
* @param scaleResult
|
|
4861
|
+
* @returns self
|
|
4862
|
+
*/
|
|
4768
4863
|
getRotationMatrix3(result, scaleResult) {
|
|
4769
4864
|
result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];
|
|
4770
4865
|
scaleResult = scaleResult || [-0, -0, -0];
|
|
@@ -4783,6 +4878,7 @@
|
|
|
4783
4878
|
result[8] = this[10] * inverseScale2;
|
|
4784
4879
|
return result;
|
|
4785
4880
|
}
|
|
4881
|
+
// Modifiers
|
|
4786
4882
|
transpose() {
|
|
4787
4883
|
transpose(this, this);
|
|
4788
4884
|
return this.check();
|
|
@@ -4791,6 +4887,7 @@
|
|
|
4791
4887
|
invert(this, this);
|
|
4792
4888
|
return this.check();
|
|
4793
4889
|
}
|
|
4890
|
+
// Operations
|
|
4794
4891
|
multiplyLeft(a) {
|
|
4795
4892
|
multiply2(this, a, this);
|
|
4796
4893
|
return this.check();
|
|
@@ -4799,33 +4896,68 @@
|
|
|
4799
4896
|
multiply2(this, this, a);
|
|
4800
4897
|
return this.check();
|
|
4801
4898
|
}
|
|
4899
|
+
// Rotates a matrix by the given angle around the X axis
|
|
4802
4900
|
rotateX(radians2) {
|
|
4803
4901
|
rotateX2(this, this, radians2);
|
|
4804
4902
|
return this.check();
|
|
4805
4903
|
}
|
|
4904
|
+
// Rotates a matrix by the given angle around the Y axis.
|
|
4806
4905
|
rotateY(radians2) {
|
|
4807
4906
|
rotateY2(this, this, radians2);
|
|
4808
4907
|
return this.check();
|
|
4809
4908
|
}
|
|
4909
|
+
/**
|
|
4910
|
+
* Rotates a matrix by the given angle around the Z axis.
|
|
4911
|
+
* @param radians
|
|
4912
|
+
* @returns self
|
|
4913
|
+
*/
|
|
4810
4914
|
rotateZ(radians2) {
|
|
4811
4915
|
rotateZ2(this, this, radians2);
|
|
4812
4916
|
return this.check();
|
|
4813
4917
|
}
|
|
4918
|
+
/**
|
|
4919
|
+
*
|
|
4920
|
+
* @param param0
|
|
4921
|
+
* @returns self
|
|
4922
|
+
*/
|
|
4814
4923
|
rotateXYZ(angleXYZ) {
|
|
4815
4924
|
return this.rotateX(angleXYZ[0]).rotateY(angleXYZ[1]).rotateZ(angleXYZ[2]);
|
|
4816
4925
|
}
|
|
4926
|
+
/**
|
|
4927
|
+
*
|
|
4928
|
+
* @param radians
|
|
4929
|
+
* @param axis
|
|
4930
|
+
* @returns self
|
|
4931
|
+
*/
|
|
4817
4932
|
rotateAxis(radians2, axis) {
|
|
4818
4933
|
rotate(this, this, radians2, axis);
|
|
4819
4934
|
return this.check();
|
|
4820
4935
|
}
|
|
4936
|
+
/**
|
|
4937
|
+
*
|
|
4938
|
+
* @param factor
|
|
4939
|
+
* @returns self
|
|
4940
|
+
*/
|
|
4821
4941
|
scale(factor) {
|
|
4822
4942
|
scale2(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);
|
|
4823
4943
|
return this.check();
|
|
4824
4944
|
}
|
|
4945
|
+
/**
|
|
4946
|
+
*
|
|
4947
|
+
* @param vec
|
|
4948
|
+
* @returns self
|
|
4949
|
+
*/
|
|
4825
4950
|
translate(vector) {
|
|
4826
4951
|
translate(this, this, vector);
|
|
4827
4952
|
return this.check();
|
|
4828
4953
|
}
|
|
4954
|
+
// Transforms
|
|
4955
|
+
/**
|
|
4956
|
+
* Transforms any 2, 3 or 4 element vector. 2 and 3 elements are treated as points
|
|
4957
|
+
* @param vector
|
|
4958
|
+
* @param result
|
|
4959
|
+
* @returns self
|
|
4960
|
+
*/
|
|
4829
4961
|
transform(vector, result) {
|
|
4830
4962
|
if (vector.length === 4) {
|
|
4831
4963
|
result = transformMat43(result || [-0, -0, -0, -0], vector, this);
|
|
@@ -4834,10 +4966,14 @@
|
|
|
4834
4966
|
}
|
|
4835
4967
|
return this.transformAsPoint(vector, result);
|
|
4836
4968
|
}
|
|
4969
|
+
/**
|
|
4970
|
+
* Transforms any 2 or 3 element array as point (w implicitly 1)
|
|
4971
|
+
* @param vector
|
|
4972
|
+
* @param result
|
|
4973
|
+
* @returns self
|
|
4974
|
+
*/
|
|
4837
4975
|
transformAsPoint(vector, result) {
|
|
4838
|
-
const {
|
|
4839
|
-
length: length2
|
|
4840
|
-
} = vector;
|
|
4976
|
+
const { length: length2 } = vector;
|
|
4841
4977
|
let out;
|
|
4842
4978
|
switch (length2) {
|
|
4843
4979
|
case 2:
|
|
@@ -4852,6 +4988,12 @@
|
|
|
4852
4988
|
checkVector(out, vector.length);
|
|
4853
4989
|
return out;
|
|
4854
4990
|
}
|
|
4991
|
+
/**
|
|
4992
|
+
* Transforms any 2 or 3 element array as vector (w implicitly 0)
|
|
4993
|
+
* @param vector
|
|
4994
|
+
* @param result
|
|
4995
|
+
* @returns self
|
|
4996
|
+
*/
|
|
4855
4997
|
transformAsVector(vector, result) {
|
|
4856
4998
|
let out;
|
|
4857
4999
|
switch (vector.length) {
|
|
@@ -4867,15 +5009,19 @@
|
|
|
4867
5009
|
checkVector(out, vector.length);
|
|
4868
5010
|
return out;
|
|
4869
5011
|
}
|
|
5012
|
+
/** @deprecated */
|
|
4870
5013
|
transformPoint(vector, result) {
|
|
4871
5014
|
return this.transformAsPoint(vector, result);
|
|
4872
5015
|
}
|
|
5016
|
+
/** @deprecated */
|
|
4873
5017
|
transformVector(vector, result) {
|
|
4874
5018
|
return this.transformAsPoint(vector, result);
|
|
4875
5019
|
}
|
|
5020
|
+
/** @deprecated */
|
|
4876
5021
|
transformDirection(vector, result) {
|
|
4877
5022
|
return this.transformAsVector(vector, result);
|
|
4878
5023
|
}
|
|
5024
|
+
// three.js math API compatibility
|
|
4879
5025
|
makeRotationX(radians2) {
|
|
4880
5026
|
return this.identity().rotateX(radians2);
|
|
4881
5027
|
}
|
|
@@ -4990,11 +5136,20 @@
|
|
|
4990
5136
|
var WGS84_RADIUS_Z = 6356752314245179e-9;
|
|
4991
5137
|
var WGS84_CONSTANTS = {
|
|
4992
5138
|
radii: [WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z],
|
|
4993
|
-
radiiSquared: [
|
|
5139
|
+
radiiSquared: [
|
|
5140
|
+
WGS84_RADIUS_X * WGS84_RADIUS_X,
|
|
5141
|
+
WGS84_RADIUS_Y * WGS84_RADIUS_Y,
|
|
5142
|
+
WGS84_RADIUS_Z * WGS84_RADIUS_Z
|
|
5143
|
+
],
|
|
4994
5144
|
oneOverRadii: [1 / WGS84_RADIUS_X, 1 / WGS84_RADIUS_Y, 1 / WGS84_RADIUS_Z],
|
|
4995
|
-
oneOverRadiiSquared: [
|
|
5145
|
+
oneOverRadiiSquared: [
|
|
5146
|
+
1 / (WGS84_RADIUS_X * WGS84_RADIUS_X),
|
|
5147
|
+
1 / (WGS84_RADIUS_Y * WGS84_RADIUS_Y),
|
|
5148
|
+
1 / (WGS84_RADIUS_Z * WGS84_RADIUS_Z)
|
|
5149
|
+
],
|
|
4996
5150
|
maximumRadius: Math.max(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z),
|
|
4997
5151
|
centerToleranceSquared: 0.1
|
|
5152
|
+
// EPSILON1;
|
|
4998
5153
|
};
|
|
4999
5154
|
|
|
5000
5155
|
// ../../node_modules/@math.gl/geospatial/dist/type-utils.js
|
|
@@ -5124,19 +5279,11 @@
|
|
|
5124
5279
|
thirdAxisVector.scale(sign);
|
|
5125
5280
|
}
|
|
5126
5281
|
} else {
|
|
5127
|
-
const {
|
|
5128
|
-
up,
|
|
5129
|
-
east,
|
|
5130
|
-
north
|
|
5131
|
-
} = scratchAxisVectors;
|
|
5282
|
+
const { up, east, north } = scratchAxisVectors;
|
|
5132
5283
|
east.set(-origin.y, origin.x, 0).normalize();
|
|
5133
5284
|
ellipsoid.geodeticSurfaceNormal(origin, up);
|
|
5134
5285
|
north.copy(up).cross(east);
|
|
5135
|
-
const {
|
|
5136
|
-
down,
|
|
5137
|
-
west,
|
|
5138
|
-
south
|
|
5139
|
-
} = scratchAxisVectors;
|
|
5286
|
+
const { down, west, south } = scratchAxisVectors;
|
|
5140
5287
|
down.copy(up).scale(-1);
|
|
5141
5288
|
west.copy(east).scale(-1);
|
|
5142
5289
|
south.copy(north).scale(-1);
|
|
@@ -5168,11 +5315,7 @@
|
|
|
5168
5315
|
var scaleToGeodeticSurfaceIntersection = new Vector3();
|
|
5169
5316
|
var scaleToGeodeticSurfaceGradient = new Vector3();
|
|
5170
5317
|
function scaleToGeodeticSurface(cartesian, ellipsoid, result = []) {
|
|
5171
|
-
const {
|
|
5172
|
-
oneOverRadii,
|
|
5173
|
-
oneOverRadiiSquared,
|
|
5174
|
-
centerToleranceSquared
|
|
5175
|
-
} = ellipsoid;
|
|
5318
|
+
const { oneOverRadii, oneOverRadiiSquared, centerToleranceSquared } = ellipsoid;
|
|
5176
5319
|
scratchVector4.from(cartesian);
|
|
5177
5320
|
const positionX = scratchVector4.x;
|
|
5178
5321
|
const positionY = scratchVector4.y;
|
|
@@ -5232,15 +5375,7 @@
|
|
|
5232
5375
|
var scratchCartesian = new Vector3();
|
|
5233
5376
|
var Ellipsoid = class {
|
|
5234
5377
|
constructor(x = 0, y = 0, z = 0) {
|
|
5235
|
-
|
|
5236
|
-
_defineProperty(this, "radiiSquared", void 0);
|
|
5237
|
-
_defineProperty(this, "radiiToTheFourth", void 0);
|
|
5238
|
-
_defineProperty(this, "oneOverRadii", void 0);
|
|
5239
|
-
_defineProperty(this, "oneOverRadiiSquared", void 0);
|
|
5240
|
-
_defineProperty(this, "minimumRadius", void 0);
|
|
5241
|
-
_defineProperty(this, "maximumRadius", void 0);
|
|
5242
|
-
_defineProperty(this, "centerToleranceSquared", math_utils_exports.EPSILON1);
|
|
5243
|
-
_defineProperty(this, "squaredXOverSquaredZ", void 0);
|
|
5378
|
+
this.centerToleranceSquared = math_utils_exports.EPSILON1;
|
|
5244
5379
|
assert4(x >= 0);
|
|
5245
5380
|
assert4(y >= 0);
|
|
5246
5381
|
assert4(z >= 0);
|
|
@@ -5256,9 +5391,11 @@
|
|
|
5256
5391
|
}
|
|
5257
5392
|
Object.freeze(this);
|
|
5258
5393
|
}
|
|
5394
|
+
/** Compares this Ellipsoid against the provided Ellipsoid componentwise */
|
|
5259
5395
|
equals(right) {
|
|
5260
5396
|
return this === right || Boolean(right && this.radii.equals(right.radii));
|
|
5261
5397
|
}
|
|
5398
|
+
/** Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'. */
|
|
5262
5399
|
toString() {
|
|
5263
5400
|
return this.radii.toString();
|
|
5264
5401
|
}
|
|
@@ -5291,6 +5428,8 @@
|
|
|
5291
5428
|
eastNorthUpToFixedFrame(origin, result = new Matrix4()) {
|
|
5292
5429
|
return localFrameToFixedFrame(this, "east", "north", "up", origin, result);
|
|
5293
5430
|
}
|
|
5431
|
+
// Computes a 4x4 transformation matrix from a reference frame centered at
|
|
5432
|
+
// the provided origin to the ellipsoid's fixed reference frame.
|
|
5294
5433
|
localFrameToFixedFrame(firstAxis, secondAxis, thirdAxis, origin, result = new Matrix4()) {
|
|
5295
5434
|
return localFrameToFixedFrame(this, firstAxis, secondAxis, thirdAxis, origin, result);
|
|
5296
5435
|
}
|
|
@@ -5308,9 +5447,14 @@
|
|
|
5308
5447
|
geodeticSurfaceNormal(cartesian, result = [0, 0, 0]) {
|
|
5309
5448
|
return scratchVector5.from(cartesian).scale(this.oneOverRadiiSquared).normalize().to(result);
|
|
5310
5449
|
}
|
|
5450
|
+
/** Scales the provided Cartesian position along the geodetic surface normal
|
|
5451
|
+
* so that it is on the surface of this ellipsoid. If the position is
|
|
5452
|
+
* at the center of the ellipsoid, this function returns undefined. */
|
|
5311
5453
|
scaleToGeodeticSurface(cartesian, result) {
|
|
5312
5454
|
return scaleToGeodeticSurface(cartesian, this, result);
|
|
5313
5455
|
}
|
|
5456
|
+
/** Scales the provided Cartesian position along the geocentric surface normal
|
|
5457
|
+
* so that it is on the surface of this ellipsoid. */
|
|
5314
5458
|
scaleToGeocentricSurface(cartesian, result = [0, 0, 0]) {
|
|
5315
5459
|
scratchPosition.from(cartesian);
|
|
5316
5460
|
const positionX = scratchPosition.x;
|
|
@@ -5320,12 +5464,17 @@
|
|
|
5320
5464
|
const beta = 1 / Math.sqrt(positionX * positionX * oneOverRadiiSquared.x + positionY * positionY * oneOverRadiiSquared.y + positionZ * positionZ * oneOverRadiiSquared.z);
|
|
5321
5465
|
return scratchPosition.multiplyScalar(beta).to(result);
|
|
5322
5466
|
}
|
|
5467
|
+
/** Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
|
|
5468
|
+
* its components by the result of `Ellipsoid#oneOverRadii` */
|
|
5323
5469
|
transformPositionToScaledSpace(position, result = [0, 0, 0]) {
|
|
5324
5470
|
return scratchPosition.from(position).scale(this.oneOverRadii).to(result);
|
|
5325
5471
|
}
|
|
5472
|
+
/** Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying
|
|
5473
|
+
* its components by the result of `Ellipsoid#radii`. */
|
|
5326
5474
|
transformPositionFromScaledSpace(position, result = [0, 0, 0]) {
|
|
5327
5475
|
return scratchPosition.from(position).scale(this.radii).to(result);
|
|
5328
5476
|
}
|
|
5477
|
+
/** Computes a point which is the intersection of the surface normal with the z-axis. */
|
|
5329
5478
|
getSurfaceNormalIntersectionWithZAxis(position, buffer = 0, result = [0, 0, 0]) {
|
|
5330
5479
|
assert4(equals(this.radii.x, this.radii.y, math_utils_exports.EPSILON15));
|
|
5331
5480
|
assert4(this.radii.z > 0);
|
|
@@ -5337,10 +5486,10 @@
|
|
|
5337
5486
|
return scratchPosition.set(0, 0, z).to(result);
|
|
5338
5487
|
}
|
|
5339
5488
|
};
|
|
5340
|
-
|
|
5489
|
+
Ellipsoid.WGS84 = new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z);
|
|
5341
5490
|
|
|
5342
5491
|
// ../images/src/lib/utils/version.ts
|
|
5343
|
-
var VERSION4 = true ? "4.3.0-alpha.
|
|
5492
|
+
var VERSION4 = true ? "4.3.0-alpha.7" : "latest";
|
|
5344
5493
|
|
|
5345
5494
|
// ../images/src/lib/category-api/image-type.ts
|
|
5346
5495
|
var parseImageNode = globalThis.loaders?.parseImageNode;
|
|
@@ -5748,7 +5897,7 @@
|
|
|
5748
5897
|
};
|
|
5749
5898
|
|
|
5750
5899
|
// ../draco/src/lib/utils/version.ts
|
|
5751
|
-
var VERSION5 = true ? "4.3.0-alpha.
|
|
5900
|
+
var VERSION5 = true ? "4.3.0-alpha.7" : "latest";
|
|
5752
5901
|
|
|
5753
5902
|
// ../draco/src/draco-loader.ts
|
|
5754
5903
|
var DracoLoader = {
|
|
@@ -6364,7 +6513,7 @@
|
|
|
6364
6513
|
}
|
|
6365
6514
|
|
|
6366
6515
|
// ../textures/src/lib/utils/version.ts
|
|
6367
|
-
var VERSION6 = true ? "4.3.0-alpha.
|
|
6516
|
+
var VERSION6 = true ? "4.3.0-alpha.7" : "latest";
|
|
6368
6517
|
|
|
6369
6518
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
6370
6519
|
var BASIS_EXTERNAL_LIBRARIES = {
|
|
@@ -8050,7 +8199,7 @@
|
|
|
8050
8199
|
}
|
|
8051
8200
|
|
|
8052
8201
|
// src/i3s-content-loader.ts
|
|
8053
|
-
var VERSION7 = true ? "4.3.0-alpha.
|
|
8202
|
+
var VERSION7 = true ? "4.3.0-alpha.7" : "latest";
|
|
8054
8203
|
var I3SContentLoader = {
|
|
8055
8204
|
dataType: null,
|
|
8056
8205
|
batchType: null,
|