@math.gl/core 3.6.0-alpha.2 → 3.6.0-alpha.5
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/matrix3.d.ts.map +1 -1
- package/dist/classes/matrix3.js +6 -5
- package/dist/classes/matrix4.d.ts +2 -2
- package/dist/classes/matrix4.d.ts.map +1 -1
- package/dist/classes/matrix4.js +10 -8
- package/dist/es5/classes/matrix3.js +7 -5
- package/dist/es5/classes/matrix3.js.map +1 -1
- package/dist/es5/classes/matrix4.js +11 -8
- package/dist/es5/classes/matrix4.js.map +1 -1
- package/dist/es5/lib/common.js +10 -11
- package/dist/es5/lib/common.js.map +1 -1
- package/dist/esm/classes/matrix3.js +7 -5
- package/dist/esm/classes/matrix3.js.map +1 -1
- package/dist/esm/classes/matrix4.js +11 -8
- package/dist/esm/classes/matrix4.js.map +1 -1
- package/dist/esm/lib/common.js +10 -9
- package/dist/esm/lib/common.js.map +1 -1
- package/dist/lib/common.d.ts +6 -4
- package/dist/lib/common.d.ts.map +1 -1
- package/dist/lib/common.js +10 -10
- package/package.json +4 -4
- package/src/classes/matrix3.ts +6 -5
- package/src/classes/matrix4.ts +13 -11
- package/src/lib/common.ts +12 -13
package/src/lib/common.ts
CHANGED
|
@@ -6,9 +6,9 @@ import assert from './assert';
|
|
|
6
6
|
import type MathArray from '../classes/base/math-array';
|
|
7
7
|
|
|
8
8
|
export type ConfigurationOptions = {
|
|
9
|
-
EPSILON
|
|
9
|
+
EPSILON: number;
|
|
10
10
|
debug?: boolean;
|
|
11
|
-
precision
|
|
11
|
+
precision: number;
|
|
12
12
|
printTypes?: boolean;
|
|
13
13
|
printDegrees?: boolean;
|
|
14
14
|
printRowMajor?: boolean;
|
|
@@ -19,17 +19,16 @@ const RADIANS_TO_DEGREES = (1 / Math.PI) * 180;
|
|
|
19
19
|
const DEGREES_TO_RADIANS = (1 / 180) * Math.PI;
|
|
20
20
|
|
|
21
21
|
// TODO - remove
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
config.printRowMajor = true;
|
|
22
|
+
export const config: ConfigurationOptions = {
|
|
23
|
+
EPSILON: 1e-12,
|
|
24
|
+
debug: false,
|
|
25
|
+
precision: 4,
|
|
26
|
+
printTypes: false,
|
|
27
|
+
printDegrees: false,
|
|
28
|
+
printRowMajor: true
|
|
29
|
+
};
|
|
31
30
|
|
|
32
|
-
export function configure(options
|
|
31
|
+
export function configure(options?: Partial<ConfigurationOptions>): ConfigurationOptions {
|
|
33
32
|
// Only copy existing keys
|
|
34
33
|
for (const key in options) {
|
|
35
34
|
assert(key in config);
|
|
@@ -46,7 +45,7 @@ export function configure(options: ConfigurationOptions = {}): ConfigurationOpti
|
|
|
46
45
|
*/
|
|
47
46
|
export function formatValue(
|
|
48
47
|
value: number,
|
|
49
|
-
{precision = config.precision
|
|
48
|
+
{precision = config.precision}: {precision?: number} = {}
|
|
50
49
|
): string {
|
|
51
50
|
value = round(value);
|
|
52
51
|
// get rid of trailing zeros
|