@math.gl/core 3.5.6 → 3.6.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classes/base/math-array.d.ts +36 -0
- package/dist/classes/base/math-array.d.ts.map +1 -0
- package/dist/classes/base/math-array.js +214 -0
- package/dist/classes/base/matrix.d.ts +12 -0
- package/dist/classes/base/matrix.d.ts.map +1 -0
- package/dist/classes/base/matrix.js +69 -0
- package/dist/classes/base/vector.d.ts +32 -0
- package/dist/classes/base/vector.d.ts.map +1 -0
- package/dist/classes/base/vector.js +133 -0
- package/dist/classes/euler.d.ts +73 -0
- package/dist/classes/euler.d.ts.map +1 -0
- package/dist/classes/euler.js +505 -0
- package/dist/classes/matrix3.d.ts +43 -0
- package/dist/classes/matrix3.d.ts.map +1 -0
- package/dist/classes/matrix3.js +192 -0
- package/dist/classes/matrix4.d.ts +102 -0
- package/dist/classes/matrix4.d.ts.map +1 -0
- package/dist/classes/matrix4.js +457 -0
- package/dist/classes/pose.d.ts +37 -0
- package/dist/classes/pose.d.ts.map +1 -0
- package/dist/classes/pose.js +126 -0
- package/dist/classes/quaternion.d.ts +42 -0
- package/dist/classes/quaternion.d.ts.map +1 -0
- package/dist/classes/quaternion.js +266 -0
- package/dist/classes/spherical-coordinates.d.ts +40 -0
- package/dist/classes/spherical-coordinates.d.ts.map +1 -0
- package/dist/classes/spherical-coordinates.js +142 -0
- package/dist/classes/vector2.d.ts +19 -0
- package/dist/classes/vector2.d.ts.map +1 -0
- package/dist/classes/vector2.js +105 -0
- package/dist/classes/vector3.d.ts +41 -0
- package/dist/classes/vector3.d.ts.map +1 -0
- package/dist/classes/vector3.js +147 -0
- package/dist/classes/vector4.d.ts +23 -0
- package/dist/classes/vector4.d.ts.map +1 -0
- package/dist/classes/vector4.js +126 -0
- package/dist/es5/classes/base/math-array.d.js +46 -0
- package/dist/es5/classes/base/math-array.d.js.map +1 -0
- package/dist/es5/classes/base/math-array.js +178 -251
- package/dist/es5/classes/base/math-array.js.map +1 -1
- package/dist/es5/classes/base/matrix.d.js +15 -0
- package/dist/es5/classes/base/matrix.d.js.map +1 -0
- package/dist/es5/classes/base/matrix.js +54 -88
- package/dist/es5/classes/base/matrix.js.map +1 -1
- package/dist/es5/classes/base/vector.d.js +24 -0
- package/dist/es5/classes/base/vector.d.js.map +1 -0
- package/dist/es5/classes/base/vector.js +121 -179
- package/dist/es5/classes/base/vector.js.map +1 -1
- package/dist/es5/classes/euler.d.js +45 -0
- package/dist/es5/classes/euler.d.js.map +1 -0
- package/dist/es5/classes/euler.js +468 -549
- package/dist/es5/classes/euler.js.map +1 -1
- package/dist/es5/classes/matrix3.d.js +25 -0
- package/dist/es5/classes/matrix3.d.js.map +1 -0
- package/dist/es5/classes/matrix3.js +157 -206
- package/dist/es5/classes/matrix3.js.map +1 -1
- package/dist/es5/classes/matrix4.d.js +25 -0
- package/dist/es5/classes/matrix4.d.js.map +1 -0
- package/dist/es5/classes/matrix4.js +410 -500
- package/dist/es5/classes/matrix4.js.map +1 -1
- package/dist/es5/classes/pose.d.js +25 -0
- package/dist/es5/classes/pose.d.js.map +1 -0
- package/dist/es5/classes/pose.js +101 -125
- package/dist/es5/classes/pose.js.map +1 -1
- package/dist/es5/classes/quaternion.d.js +27 -0
- package/dist/es5/classes/quaternion.d.js.map +1 -0
- package/dist/es5/classes/quaternion.js +213 -277
- package/dist/es5/classes/quaternion.js.map +1 -1
- package/dist/es5/classes/spherical-coordinates.d.js +27 -0
- package/dist/es5/classes/spherical-coordinates.d.js.map +1 -0
- package/dist/es5/classes/spherical-coordinates.js +125 -166
- package/dist/es5/classes/spherical-coordinates.js.map +1 -1
- package/dist/es5/classes/vector2.d.js +18 -0
- package/dist/es5/classes/vector2.d.js.map +1 -0
- package/dist/es5/classes/vector2.js +76 -118
- package/dist/es5/classes/vector2.js.map +1 -1
- package/dist/es5/classes/vector3.d.js +24 -0
- package/dist/es5/classes/vector3.d.js.map +1 -0
- package/dist/es5/classes/vector3.js +120 -167
- package/dist/es5/classes/vector3.js.map +1 -1
- package/dist/es5/classes/vector4.d.js +25 -0
- package/dist/es5/classes/vector4.d.js.map +1 -0
- package/dist/es5/classes/vector4.js +95 -137
- package/dist/es5/classes/vector4.js.map +1 -1
- package/dist/es5/docs/README.md +0 -0
- package/dist/es5/index.js +105 -123
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/assert.js.map +1 -1
- package/dist/es5/lib/common.js +55 -84
- package/dist/es5/lib/common.js.map +1 -1
- package/dist/es5/lib/gl-matrix-extras.js +14 -14
- package/dist/es5/lib/gl-matrix-extras.js.map +1 -1
- package/dist/es5/lib/math-utils.js.map +1 -1
- package/dist/es5/lib/validators.js +3 -5
- package/dist/es5/lib/validators.js.map +1 -1
- package/dist/esm/classes/base/math-array.d.js +36 -0
- package/dist/esm/classes/base/math-array.d.js.map +1 -0
- package/dist/esm/classes/base/matrix.d.js +3 -0
- package/dist/esm/classes/base/matrix.d.js.map +1 -0
- package/dist/esm/classes/base/vector.d.js +13 -0
- package/dist/esm/classes/base/vector.d.js.map +1 -0
- package/dist/esm/classes/euler.d.js +55 -0
- package/dist/esm/classes/euler.d.js.map +1 -0
- package/dist/esm/classes/matrix3.d.js +15 -0
- package/dist/esm/classes/matrix3.d.js.map +1 -0
- package/dist/esm/classes/matrix4.d.js +15 -0
- package/dist/esm/classes/matrix4.d.js.map +1 -0
- package/dist/esm/classes/pose.d.js +18 -0
- package/dist/esm/classes/pose.d.js.map +1 -0
- package/dist/esm/classes/quaternion.d.js +19 -0
- package/dist/esm/classes/quaternion.d.js.map +1 -0
- package/dist/esm/classes/spherical-coordinates.d.js +22 -0
- package/dist/esm/classes/spherical-coordinates.d.js.map +1 -0
- package/dist/esm/classes/vector2.d.js +6 -0
- package/dist/esm/classes/vector2.d.js.map +1 -0
- package/dist/esm/classes/vector3.d.js +13 -0
- package/dist/esm/classes/vector3.d.js.map +1 -0
- package/dist/esm/classes/vector4.d.js +15 -0
- package/dist/esm/classes/vector4.d.js.map +1 -0
- package/dist/esm/docs/README.md +0 -0
- package/dist/esm/index.js +2 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/assert.js.map +1 -1
- package/dist/esm/lib/common.js +34 -37
- package/dist/esm/lib/common.js.map +1 -1
- package/dist/esm/lib/gl-matrix-extras.js.map +1 -1
- package/dist/esm/lib/math-utils.js.map +1 -1
- package/dist/esm/lib/validators.js.map +1 -1
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/lib/assert.d.ts +2 -0
- package/dist/lib/assert.d.ts.map +1 -0
- package/dist/lib/assert.js +5 -0
- package/dist/lib/common.d.ts +90 -0
- package/dist/lib/common.d.ts.map +1 -0
- package/dist/lib/common.js +223 -0
- package/dist/lib/gl-matrix-extras.d.ts +6 -0
- package/dist/lib/gl-matrix-extras.d.ts.map +1 -0
- package/dist/lib/gl-matrix-extras.js +50 -0
- package/dist/lib/math-utils.d.ts +28 -0
- package/dist/lib/math-utils.d.ts.map +1 -0
- package/dist/lib/math-utils.js +28 -0
- package/dist/lib/validators.d.ts +5 -0
- package/dist/lib/validators.d.ts.map +1 -0
- package/dist/lib/validators.js +52 -0
- package/package.json +4 -3
- package/src/classes/base/math-array.d.ts +0 -1
- package/src/docs/README.md +0 -0
- package/{dist/esm/index.d.ts → src/index.ts} +32 -34
- package/src/lib/{assert.js → assert.ts} +1 -1
- package/src/lib/common.ts +283 -0
- package/src/lib/{gl-matrix-extras.js → gl-matrix-extras.ts} +0 -0
- package/src/lib/{math-utils.js → math-utils.ts} +0 -0
- package/src/lib/{validators.js → validators.ts} +0 -0
- package/dist/es5/addons/polygon.d.ts +0 -17
- package/dist/es5/classes/base/math-array.d.ts +0 -56
- package/dist/es5/classes/base/matrix.d.ts +0 -15
- package/dist/es5/classes/base/vector.d.ts +0 -45
- package/dist/es5/classes/euler.d.ts +0 -92
- package/dist/es5/classes/matrix3.d.ts +0 -91
- package/dist/es5/classes/matrix4.d.ts +0 -161
- package/dist/es5/classes/pose.d.ts +0 -92
- package/dist/es5/classes/quaternion.d.ts +0 -107
- package/dist/es5/classes/spherical-coordinates.d.ts +0 -87
- package/dist/es5/classes/vector2.d.ts +0 -65
- package/dist/es5/classes/vector3.d.ts +0 -65
- package/dist/es5/classes/vector4.d.ts +0 -34
- package/dist/es5/index.d.ts +0 -54
- package/dist/es5/lib/common.d.ts +0 -80
- package/dist/esm/addons/polygon.d.ts +0 -17
- package/dist/esm/classes/base/math-array.d.ts +0 -56
- package/dist/esm/classes/base/matrix.d.ts +0 -15
- package/dist/esm/classes/base/vector.d.ts +0 -45
- package/dist/esm/classes/euler.d.ts +0 -92
- package/dist/esm/classes/matrix3.d.ts +0 -91
- package/dist/esm/classes/matrix4.d.ts +0 -161
- package/dist/esm/classes/pose.d.ts +0 -92
- package/dist/esm/classes/quaternion.d.ts +0 -107
- package/dist/esm/classes/spherical-coordinates.d.ts +0 -87
- package/dist/esm/classes/vector2.d.ts +0 -65
- package/dist/esm/classes/vector3.d.ts +0 -65
- package/dist/esm/classes/vector4.d.ts +0 -34
- package/dist/esm/lib/common.d.ts +0 -80
- package/src/addons/polygon.d.ts +0 -17
- package/src/index.d.ts +0 -54
- package/src/index.js +0 -86
- package/src/lib/common.d.ts +0 -80
- package/src/lib/common.js +0 -222
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { NumericArray } from '@math.gl/types';
|
|
2
|
+
export declare type ConfigurationOptions = {
|
|
3
|
+
EPSILON?: number;
|
|
4
|
+
debug?: boolean;
|
|
5
|
+
precision?: number;
|
|
6
|
+
printTypes?: boolean;
|
|
7
|
+
printDegrees?: boolean;
|
|
8
|
+
printRowMajor?: boolean;
|
|
9
|
+
_cartographicRadians?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const config: ConfigurationOptions;
|
|
12
|
+
export declare function configure(options?: ConfigurationOptions): ConfigurationOptions;
|
|
13
|
+
/**
|
|
14
|
+
* Formats a value into a string
|
|
15
|
+
* @param value
|
|
16
|
+
* @param param1
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatValue(value: number, { precision }?: ConfigurationOptions): string;
|
|
20
|
+
/**
|
|
21
|
+
* Check if value is an "array"
|
|
22
|
+
* Returns `true` if value is either an array or a typed array
|
|
23
|
+
*
|
|
24
|
+
* Note: returns `false` for `ArrayBuffer` and `DataView` instances
|
|
25
|
+
*/
|
|
26
|
+
export declare function isArray(value: unknown): boolean;
|
|
27
|
+
export declare function clone(array: NumericArray): NumericArray;
|
|
28
|
+
export declare function toRadians(degrees: number): number;
|
|
29
|
+
export declare function toRadians(degrees: NumericArray): NumericArray;
|
|
30
|
+
export declare function toDegrees(degrees: number): number;
|
|
31
|
+
export declare function toDegrees(degrees: NumericArray): NumericArray;
|
|
32
|
+
/**
|
|
33
|
+
* "GLSL equivalent" radians: Works on single values and vectors
|
|
34
|
+
*/
|
|
35
|
+
export declare function radians(degrees: number): number;
|
|
36
|
+
export declare function radians(degrees: NumericArray, result?: NumericArray): NumericArray;
|
|
37
|
+
/**
|
|
38
|
+
* "GLSL equivalent" degrees: Works on single values and vectors
|
|
39
|
+
*/
|
|
40
|
+
export declare function degrees(radians: number): number;
|
|
41
|
+
export declare function degrees(radians: NumericArray, result?: NumericArray): NumericArray;
|
|
42
|
+
/**
|
|
43
|
+
* "GLSL equivalent" of `Math.sin`: Works on single values and vectors
|
|
44
|
+
* @deprecated
|
|
45
|
+
*/
|
|
46
|
+
export declare function sin(radians: any, result?: any): any;
|
|
47
|
+
/**
|
|
48
|
+
* "GLSL equivalent" of `Math.cos`: Works on single values and vectors
|
|
49
|
+
* @deprecated
|
|
50
|
+
*/
|
|
51
|
+
export declare function cos(radians: number | NumericArray, result?: any): any;
|
|
52
|
+
/**
|
|
53
|
+
* "GLSL equivalent" of `Math.tan`: Works on single values and vectors
|
|
54
|
+
* @deprecated
|
|
55
|
+
*/
|
|
56
|
+
export declare function tan(radians: number | NumericArray, result?: any): any;
|
|
57
|
+
/**
|
|
58
|
+
* "GLSL equivalent" of `Math.asin`: Works on single values and vectors
|
|
59
|
+
* @deprecated
|
|
60
|
+
*/
|
|
61
|
+
export declare function asin(radians: number | NumericArray): any;
|
|
62
|
+
/**
|
|
63
|
+
* "GLSL equivalent" of `Math.acos`: Works on single values and vectors
|
|
64
|
+
* @deprecated
|
|
65
|
+
*/
|
|
66
|
+
export declare function acos(radians: number | NumericArray): any;
|
|
67
|
+
/**
|
|
68
|
+
* "GLSL equivalent" of `Math.atan`: Works on single values and vectors
|
|
69
|
+
* @deprecated
|
|
70
|
+
*/
|
|
71
|
+
export declare function atan(radians: number | NumericArray): any;
|
|
72
|
+
/**
|
|
73
|
+
* GLSL style value clamping: Works on single values and vectors
|
|
74
|
+
*/
|
|
75
|
+
export declare function clamp(value: number | NumericArray, min: number, max: number): any;
|
|
76
|
+
/**
|
|
77
|
+
* Interpolate between two numbers or two arrays
|
|
78
|
+
*/
|
|
79
|
+
export declare function lerp(a: any, b: any, t: number): any;
|
|
80
|
+
/**
|
|
81
|
+
* Compares any two math objects, using `equals` method if available.
|
|
82
|
+
* @param a
|
|
83
|
+
* @param b
|
|
84
|
+
* @param epsilon
|
|
85
|
+
* @returns
|
|
86
|
+
*/
|
|
87
|
+
export declare function equals(a: unknown, b: unknown, epsilon?: number): boolean;
|
|
88
|
+
export declare function exactEquals(a: any, b: any): boolean;
|
|
89
|
+
export declare function withEpsilon(epsilon: number, func: Function): any;
|
|
90
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/lib/common.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import assert from './assert';
|
|
2
|
+
const RADIANS_TO_DEGREES = (1 / Math.PI) * 180;
|
|
3
|
+
const DEGREES_TO_RADIANS = (1 / 180) * Math.PI;
|
|
4
|
+
// TODO - remove
|
|
5
|
+
/* eslint-disable no-shadow */
|
|
6
|
+
export const config = {};
|
|
7
|
+
config.EPSILON = 1e-12;
|
|
8
|
+
config.debug = false;
|
|
9
|
+
config.precision = 4;
|
|
10
|
+
config.printTypes = false;
|
|
11
|
+
config.printDegrees = false;
|
|
12
|
+
config.printRowMajor = true;
|
|
13
|
+
export function configure(options = {}) {
|
|
14
|
+
// Only copy existing keys
|
|
15
|
+
for (const key in options) {
|
|
16
|
+
assert(key in config);
|
|
17
|
+
config[key] = options[key];
|
|
18
|
+
}
|
|
19
|
+
return config;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Formats a value into a string
|
|
23
|
+
* @param value
|
|
24
|
+
* @param param1
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export function formatValue(value, { precision = config.precision || 4 } = {}) {
|
|
28
|
+
value = round(value);
|
|
29
|
+
// get rid of trailing zeros
|
|
30
|
+
return `${parseFloat(value.toPrecision(precision))}`;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check if value is an "array"
|
|
34
|
+
* Returns `true` if value is either an array or a typed array
|
|
35
|
+
*
|
|
36
|
+
* Note: returns `false` for `ArrayBuffer` and `DataView` instances
|
|
37
|
+
*/
|
|
38
|
+
export function isArray(value) {
|
|
39
|
+
return Array.isArray(value) || (ArrayBuffer.isView(value) && !(value instanceof DataView));
|
|
40
|
+
}
|
|
41
|
+
export function clone(array) {
|
|
42
|
+
// @ts-expect-error We are speculatively calling clone
|
|
43
|
+
return 'clone' in array ? array.clone() : new Array(...array);
|
|
44
|
+
}
|
|
45
|
+
export function toRadians(degrees) {
|
|
46
|
+
return radians(degrees);
|
|
47
|
+
}
|
|
48
|
+
export function toDegrees(radians) {
|
|
49
|
+
return degrees(radians);
|
|
50
|
+
}
|
|
51
|
+
export function radians(degrees, result) {
|
|
52
|
+
return map(degrees, (degrees) => degrees * DEGREES_TO_RADIANS, result);
|
|
53
|
+
}
|
|
54
|
+
export function degrees(radians, result) {
|
|
55
|
+
return map(radians, (radians) => radians * RADIANS_TO_DEGREES, result);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* "GLSL equivalent" of `Math.sin`: Works on single values and vectors
|
|
59
|
+
* @deprecated
|
|
60
|
+
*/
|
|
61
|
+
export function sin(radians, result) {
|
|
62
|
+
return map(radians, (angle) => Math.sin(angle), result);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* "GLSL equivalent" of `Math.cos`: Works on single values and vectors
|
|
66
|
+
* @deprecated
|
|
67
|
+
*/
|
|
68
|
+
export function cos(radians, result) {
|
|
69
|
+
return map(radians, (angle) => Math.cos(angle), result);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* "GLSL equivalent" of `Math.tan`: Works on single values and vectors
|
|
73
|
+
* @deprecated
|
|
74
|
+
*/
|
|
75
|
+
export function tan(radians, result) {
|
|
76
|
+
return map(radians, (angle) => Math.tan(angle));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* "GLSL equivalent" of `Math.asin`: Works on single values and vectors
|
|
80
|
+
* @deprecated
|
|
81
|
+
*/
|
|
82
|
+
export function asin(radians) {
|
|
83
|
+
return map(radians, (angle) => Math.asin(angle));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* "GLSL equivalent" of `Math.acos`: Works on single values and vectors
|
|
87
|
+
* @deprecated
|
|
88
|
+
*/
|
|
89
|
+
export function acos(radians) {
|
|
90
|
+
return map(radians, (angle) => Math.acos(angle));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* "GLSL equivalent" of `Math.atan`: Works on single values and vectors
|
|
94
|
+
* @deprecated
|
|
95
|
+
*/
|
|
96
|
+
export function atan(radians) {
|
|
97
|
+
return map(radians, (angle) => Math.atan(angle));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* GLSL style value clamping: Works on single values and vectors
|
|
101
|
+
*/
|
|
102
|
+
export function clamp(value, min, max) {
|
|
103
|
+
return map(value, (value) => Math.max(min, Math.min(max, value)));
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Interpolate between two numbers or two arrays
|
|
107
|
+
*/
|
|
108
|
+
export function lerp(a, b, t) {
|
|
109
|
+
if (isArray(a)) {
|
|
110
|
+
return a.map((ai, i) => lerp(ai, b[i], t));
|
|
111
|
+
}
|
|
112
|
+
return t * b + (1 - t) * a;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Compares any two math objects, using `equals` method if available.
|
|
116
|
+
* @param a
|
|
117
|
+
* @param b
|
|
118
|
+
* @param epsilon
|
|
119
|
+
* @returns
|
|
120
|
+
*/
|
|
121
|
+
// eslint-disable-next-line complexity
|
|
122
|
+
export function equals(a, b, epsilon) {
|
|
123
|
+
const oldEpsilon = config.EPSILON;
|
|
124
|
+
if (epsilon) {
|
|
125
|
+
config.EPSILON = epsilon;
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
if (a === b) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
if (isArray(a) && isArray(b)) {
|
|
132
|
+
// @ts-expect-error isArray has checked
|
|
133
|
+
if (a.length !== b.length) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
// @ts-expect-error isArray has checked
|
|
137
|
+
for (let i = 0; i < a.length; ++i) {
|
|
138
|
+
// eslint-disable-next-line max-depth
|
|
139
|
+
if (!equals(a[i], b[i])) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
// @ts-expect-error Dynamic testing
|
|
146
|
+
if (a && a.equals) {
|
|
147
|
+
// @ts-expect-error Dynamic testing
|
|
148
|
+
return a.equals(b);
|
|
149
|
+
}
|
|
150
|
+
// @ts-expect-error Dynamic testing
|
|
151
|
+
if (b && b.equals) {
|
|
152
|
+
// @ts-expect-error Dynamic testing
|
|
153
|
+
return b.equals(a);
|
|
154
|
+
}
|
|
155
|
+
if (typeof a === 'number' && typeof b === 'number') {
|
|
156
|
+
return Math.abs(a - b) <= config.EPSILON * Math.max(1, Math.abs(a), Math.abs(b));
|
|
157
|
+
}
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
finally {
|
|
161
|
+
config.EPSILON = oldEpsilon;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// eslint-disable-next-line complexity
|
|
165
|
+
export function exactEquals(a, b) {
|
|
166
|
+
if (a === b) {
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
if (a && typeof a === 'object' && b && typeof b === 'object') {
|
|
170
|
+
if (a.constructor !== b.constructor) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
if (a.exactEquals) {
|
|
174
|
+
return a.exactEquals(b);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (isArray(a) && isArray(b)) {
|
|
178
|
+
if (a.length !== b.length) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
for (let i = 0; i < a.length; ++i) {
|
|
182
|
+
if (!exactEquals(a[i], b[i])) {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
export function withEpsilon(epsilon, func) {
|
|
191
|
+
const oldPrecision = config.EPSILON;
|
|
192
|
+
config.EPSILON = epsilon;
|
|
193
|
+
let value;
|
|
194
|
+
try {
|
|
195
|
+
value = func();
|
|
196
|
+
}
|
|
197
|
+
finally {
|
|
198
|
+
config.EPSILON = oldPrecision;
|
|
199
|
+
}
|
|
200
|
+
return value;
|
|
201
|
+
}
|
|
202
|
+
// HELPERS
|
|
203
|
+
function round(value) {
|
|
204
|
+
return Math.round(value / config.EPSILON) * config.EPSILON;
|
|
205
|
+
}
|
|
206
|
+
// If the array has a clone function, calls it, otherwise returns a copy
|
|
207
|
+
function duplicateArray(array) {
|
|
208
|
+
// @ts-expect-error We check for math.gl class methods
|
|
209
|
+
return array.clone ? array.clone() : new Array(array.length);
|
|
210
|
+
}
|
|
211
|
+
// If the argument value is an array, applies the func element wise,
|
|
212
|
+
// otherwise applies func to the argument value
|
|
213
|
+
function map(value, func, result) {
|
|
214
|
+
if (isArray(value)) {
|
|
215
|
+
const array = value;
|
|
216
|
+
result = result || duplicateArray(array);
|
|
217
|
+
for (let i = 0; i < result.length && i < array.length; ++i) {
|
|
218
|
+
result[i] = func(value[i], i, result);
|
|
219
|
+
}
|
|
220
|
+
return result;
|
|
221
|
+
}
|
|
222
|
+
return func(value);
|
|
223
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function vec2_transformMat4AsVector(out: any, a: any, m: any): any;
|
|
2
|
+
export declare function vec3_transformMat4AsVector(out: any, a: any, m: any): any;
|
|
3
|
+
export declare function vec3_transformMat2(out: any, a: any, m: any): any;
|
|
4
|
+
export declare function vec4_transformMat2(out: any, a: any, m: any): any;
|
|
5
|
+
export declare function vec4_transformMat3(out: any, a: any, m: any): any;
|
|
6
|
+
//# sourceMappingURL=gl-matrix-extras.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gl-matrix-extras.d.ts","sourceRoot":"","sources":["../../src/lib/gl-matrix-extras.ts"],"names":[],"mappings":"AAGA,wBAAgB,0BAA0B,CAAC,GAAG,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,OAOnD;AAKD,wBAAgB,0BAA0B,CAAC,GAAG,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,OASnD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,OAO3C;AAID,wBAAgB,kBAAkB,CAAC,GAAG,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,OAQ3C;AAED,wBAAgB,kBAAkB,CAAC,GAAG,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA,OAS3C"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
// vec2 additions
|
|
3
|
+
export function vec2_transformMat4AsVector(out, a, m) {
|
|
4
|
+
const x = a[0];
|
|
5
|
+
const y = a[1];
|
|
6
|
+
const w = m[3] * x + m[7] * y || 1.0;
|
|
7
|
+
out[0] = (m[0] * x + m[4] * y) / w;
|
|
8
|
+
out[1] = (m[1] * x + m[5] * y) / w;
|
|
9
|
+
return out;
|
|
10
|
+
}
|
|
11
|
+
// vec3 additions
|
|
12
|
+
// Transform as vector, only uses 3x3 minor matrix
|
|
13
|
+
export function vec3_transformMat4AsVector(out, a, m) {
|
|
14
|
+
const x = a[0];
|
|
15
|
+
const y = a[1];
|
|
16
|
+
const z = a[2];
|
|
17
|
+
const w = m[3] * x + m[7] * y + m[11] * z || 1.0;
|
|
18
|
+
out[0] = (m[0] * x + m[4] * y + m[8] * z) / w;
|
|
19
|
+
out[1] = (m[1] * x + m[5] * y + m[9] * z) / w;
|
|
20
|
+
out[2] = (m[2] * x + m[6] * y + m[10] * z) / w;
|
|
21
|
+
return out;
|
|
22
|
+
}
|
|
23
|
+
export function vec3_transformMat2(out, a, m) {
|
|
24
|
+
const x = a[0];
|
|
25
|
+
const y = a[1];
|
|
26
|
+
out[0] = m[0] * x + m[2] * y;
|
|
27
|
+
out[1] = m[1] * x + m[3] * y;
|
|
28
|
+
out[2] = a[2];
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
// vec4 additions
|
|
32
|
+
export function vec4_transformMat2(out, a, m) {
|
|
33
|
+
const x = a[0];
|
|
34
|
+
const y = a[1];
|
|
35
|
+
out[0] = m[0] * x + m[2] * y;
|
|
36
|
+
out[1] = m[1] * x + m[3] * y;
|
|
37
|
+
out[2] = a[2];
|
|
38
|
+
out[3] = a[3];
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
export function vec4_transformMat3(out, a, m) {
|
|
42
|
+
const x = a[0];
|
|
43
|
+
const y = a[1];
|
|
44
|
+
const z = a[2];
|
|
45
|
+
out[0] = m[0] * x + m[3] * y + m[6] * z;
|
|
46
|
+
out[1] = m[1] * x + m[4] * y + m[7] * z;
|
|
47
|
+
out[2] = m[2] * x + m[5] * y + m[8] * z;
|
|
48
|
+
out[3] = a[3];
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
EPSILON1: number;
|
|
3
|
+
EPSILON2: number;
|
|
4
|
+
EPSILON3: number;
|
|
5
|
+
EPSILON4: number;
|
|
6
|
+
EPSILON5: number;
|
|
7
|
+
EPSILON6: number;
|
|
8
|
+
EPSILON7: number;
|
|
9
|
+
EPSILON8: number;
|
|
10
|
+
EPSILON9: number;
|
|
11
|
+
EPSILON10: number;
|
|
12
|
+
EPSILON11: number;
|
|
13
|
+
EPSILON12: number;
|
|
14
|
+
EPSILON13: number;
|
|
15
|
+
EPSILON14: number;
|
|
16
|
+
EPSILON15: number;
|
|
17
|
+
EPSILON16: number;
|
|
18
|
+
EPSILON17: number;
|
|
19
|
+
EPSILON18: number;
|
|
20
|
+
EPSILON19: number;
|
|
21
|
+
EPSILON20: number;
|
|
22
|
+
PI_OVER_TWO: number;
|
|
23
|
+
PI_OVER_FOUR: number;
|
|
24
|
+
PI_OVER_SIX: number;
|
|
25
|
+
TWO_PI: number;
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
28
|
+
//# sourceMappingURL=math-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math-utils.d.ts","sourceRoot":"","sources":["../../src/lib/math-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBA2BE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// NOTE: Added to make Cesium-derived test cases work
|
|
2
|
+
// TODO: Determine if/how to keep
|
|
3
|
+
export default {
|
|
4
|
+
EPSILON1: 1e-1,
|
|
5
|
+
EPSILON2: 1e-2,
|
|
6
|
+
EPSILON3: 1e-3,
|
|
7
|
+
EPSILON4: 1e-4,
|
|
8
|
+
EPSILON5: 1e-5,
|
|
9
|
+
EPSILON6: 1e-6,
|
|
10
|
+
EPSILON7: 1e-7,
|
|
11
|
+
EPSILON8: 1e-8,
|
|
12
|
+
EPSILON9: 1e-9,
|
|
13
|
+
EPSILON10: 1e-10,
|
|
14
|
+
EPSILON11: 1e-11,
|
|
15
|
+
EPSILON12: 1e-12,
|
|
16
|
+
EPSILON13: 1e-13,
|
|
17
|
+
EPSILON14: 1e-14,
|
|
18
|
+
EPSILON15: 1e-15,
|
|
19
|
+
EPSILON16: 1e-16,
|
|
20
|
+
EPSILON17: 1e-17,
|
|
21
|
+
EPSILON18: 1e-18,
|
|
22
|
+
EPSILON19: 1e-19,
|
|
23
|
+
EPSILON20: 1e-20,
|
|
24
|
+
PI_OVER_TWO: Math.PI / 2,
|
|
25
|
+
PI_OVER_FOUR: Math.PI / 4,
|
|
26
|
+
PI_OVER_SIX: Math.PI / 6,
|
|
27
|
+
TWO_PI: Math.PI * 2
|
|
28
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function validateVector(v: any, length: any): boolean;
|
|
2
|
+
export declare function checkNumber(value: any): any;
|
|
3
|
+
export declare function checkVector(v: any, length: any, callerName?: string): any;
|
|
4
|
+
export declare function deprecated(method: any, version: any): void;
|
|
5
|
+
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/lib/validators.ts"],"names":[],"mappings":"AAsBA,wBAAgB,cAAc,CAAC,CAAC,KAAA,EAAE,MAAM,KAAA,WAWvC;AAED,wBAAgB,WAAW,CAAC,KAAK,KAAA,OAKhC;AAED,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,MAAM,KAAA,EAAE,UAAU,SAAK,OAKrD;AAID,wBAAgB,UAAU,CAAC,MAAM,KAAA,EAAE,OAAO,KAAA,QAQzC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Copyright (c) 2017 Uber Technologies, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
// in the Software without restriction, including without limitation the rights
|
|
6
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
// furnished to do so, subject to the following conditions:
|
|
9
|
+
//
|
|
10
|
+
// The above copyright notice and this permission notice shall be included in
|
|
11
|
+
// all copies or substantial portions of the Software.
|
|
12
|
+
//
|
|
13
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
// THE SOFTWARE.
|
|
20
|
+
import { config } from './common';
|
|
21
|
+
export function validateVector(v, length) {
|
|
22
|
+
if (v.length !== length) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
// Could be arguments "array" (v.every not availasble)
|
|
26
|
+
for (let i = 0; i < v.length; ++i) {
|
|
27
|
+
if (!Number.isFinite(v[i])) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
export function checkNumber(value) {
|
|
34
|
+
if (!Number.isFinite(value)) {
|
|
35
|
+
throw new Error(`Invalid number ${value}`);
|
|
36
|
+
}
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
export function checkVector(v, length, callerName = '') {
|
|
40
|
+
if (config.debug && !validateVector(v, length)) {
|
|
41
|
+
throw new Error(`math.gl: ${callerName} some fields set to invalid numbers'`);
|
|
42
|
+
}
|
|
43
|
+
return v;
|
|
44
|
+
}
|
|
45
|
+
const map = {};
|
|
46
|
+
export function deprecated(method, version) {
|
|
47
|
+
if (!map[method]) {
|
|
48
|
+
map[method] = true;
|
|
49
|
+
// eslint-disable-next-line
|
|
50
|
+
console.warn(`${method} has been removed in version ${version}, see upgrade guide for more information`);
|
|
51
|
+
}
|
|
52
|
+
}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "3.
|
|
8
|
+
"version": "3.6.0-alpha.1",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"webgl",
|
|
11
11
|
"javascript",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"type": "git",
|
|
27
27
|
"url": "https://github.com/uber-web/math.gl.git"
|
|
28
28
|
},
|
|
29
|
-
"types": "src/index.
|
|
29
|
+
"types": "src/index.ts",
|
|
30
30
|
"main": "dist/es5/index.js",
|
|
31
31
|
"module": "dist/esm/index.js",
|
|
32
32
|
"files": [
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@babel/runtime": "^7.12.0",
|
|
41
|
+
"@math.gl/types": "3.6.0-alpha.1",
|
|
41
42
|
"gl-matrix": "~3.3.0"
|
|
42
43
|
},
|
|
43
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "45386981340895bf201c2ebb76257c9bbffd8ff6"
|
|
44
45
|
}
|
|
File without changes
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
|
|
3
|
+
// types
|
|
4
|
+
export type {TypedArray, NumericArray} from '@math.gl/types';
|
|
3
5
|
|
|
4
6
|
// classes
|
|
5
7
|
export {default as Vector2} from './classes/vector2';
|
|
@@ -9,44 +11,40 @@ export {default as Matrix3} from './classes/matrix3';
|
|
|
9
11
|
export {default as Matrix4} from './classes/matrix4';
|
|
10
12
|
export {default as Quaternion} from './classes/quaternion';
|
|
11
13
|
|
|
12
|
-
// extras
|
|
13
|
-
|
|
14
|
-
// export {checkNumber} from './lib/validators';
|
|
15
|
-
export function assert(condition: boolean, message?: string): void;
|
|
16
|
-
|
|
17
14
|
// experimental
|
|
18
15
|
export {default as SphericalCoordinates} from './classes/spherical-coordinates';
|
|
19
16
|
export {default as Pose} from './classes/pose';
|
|
20
17
|
export {default as Euler} from './classes/euler';
|
|
21
18
|
|
|
22
|
-
export
|
|
23
|
-
EPSILON1: number;
|
|
24
|
-
EPSILON2: number;
|
|
25
|
-
EPSILON3: number;
|
|
26
|
-
EPSILON4: number;
|
|
27
|
-
EPSILON5: number;
|
|
28
|
-
EPSILON6: number;
|
|
29
|
-
EPSILON7: number;
|
|
30
|
-
EPSILON8: number;
|
|
31
|
-
EPSILON9: number;
|
|
32
|
-
EPSILON10: number;
|
|
33
|
-
EPSILON11: number;
|
|
34
|
-
EPSILON12: number;
|
|
35
|
-
EPSILON13: number;
|
|
36
|
-
EPSILON14: number;
|
|
37
|
-
EPSILON15: number;
|
|
38
|
-
EPSILON16: number;
|
|
39
|
-
EPSILON17: number;
|
|
40
|
-
EPSILON18: number;
|
|
41
|
-
EPSILON19: number;
|
|
42
|
-
EPSILON20: number;
|
|
43
|
-
|
|
44
|
-
PI_OVER_TWO: number;
|
|
45
|
-
PI_OVER_FOUR: number;
|
|
46
|
-
PI_OVER_SIX: number;
|
|
19
|
+
export {default as _MathUtils} from './lib/math-utils';
|
|
47
20
|
|
|
48
|
-
|
|
49
|
-
};
|
|
21
|
+
// lib
|
|
22
|
+
export {default as assert} from './lib/assert';
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
// math.gl global utility methods
|
|
26
|
+
config,
|
|
27
|
+
configure,
|
|
28
|
+
formatValue,
|
|
29
|
+
isArray,
|
|
30
|
+
clone,
|
|
31
|
+
equals,
|
|
32
|
+
exactEquals,
|
|
33
|
+
toRadians,
|
|
34
|
+
toDegrees,
|
|
35
|
+
// math.gl "GLSL"-style functions
|
|
36
|
+
radians,
|
|
37
|
+
degrees,
|
|
38
|
+
sin,
|
|
39
|
+
cos,
|
|
40
|
+
tan,
|
|
41
|
+
asin,
|
|
42
|
+
acos,
|
|
43
|
+
atan,
|
|
44
|
+
clamp,
|
|
45
|
+
lerp,
|
|
46
|
+
withEpsilon
|
|
47
|
+
} from './lib/common';
|
|
50
48
|
|
|
51
49
|
// DEPRECATED
|
|
52
50
|
export {default as _SphericalCoordinates} from './classes/spherical-coordinates';
|