Skip to content

Commit accefb6

Browse files
committed
Update version to 3.4.4
Also updated multiple NPM dependencies (most notably Typescript to v5) and rebased on main branch.
1 parent 21bf5ee commit accefb6

38 files changed

+5169
-2896
lines changed

.size-snapshot.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"gzipped": 12913
1111
},
1212
"gl-matrix-min.js": {
13-
"bundled": 206642,
14-
"minified": 52459,
15-
"gzipped": 13414
13+
"bundled": 207220,
14+
"minified": 52740,
15+
"gzipped": 13405
1616
}
1717
}

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015-2024, Brandon Jones, Colin MacKenzie IV.
1+
Copyright (c) 2015-2025, Brandon Jones, Colin MacKenzie IV.
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.4.3
1+
3.4.4

dist/esm/common.js

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,64 @@
22
* Common utilities
33
* @module glMatrix
44
*/
5+
56
// Configuration Constants
67
export var EPSILON = 0.000001;
78
export var ARRAY_TYPE = typeof Float32Array !== "undefined" ? Float32Array : Array;
89
export var RANDOM = Math.random;
910
export var ANGLE_ORDER = "zyx";
11+
12+
/**
13+
* Symmetric round
14+
* see https://www.npmjs.com/package/round-half-up-symmetric#user-content-detailed-background
15+
*
16+
* @param {Number} a value to round
17+
*/
18+
export function round(a) {
19+
if (a >= 0) return Math.round(a);
20+
return a % 0.5 === 0 ? Math.floor(a) : Math.round(a);
21+
}
22+
1023
/**
1124
* Sets the type of array used when creating new vectors and matrices
1225
*
1326
* @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array
1427
*/
15-
1628
export function setMatrixArrayType(type) {
1729
ARRAY_TYPE = type;
1830
}
1931
var degree = Math.PI / 180;
32+
var radian = 180 / Math.PI;
33+
2034
/**
2135
* Convert Degree To Radian
2236
*
2337
* @param {Number} a Angle in Degrees
2438
*/
25-
2639
export function toRadian(a) {
2740
return a * degree;
2841
}
42+
43+
/**
44+
* Convert Radian To Degree
45+
*
46+
* @param {Number} a Angle in Radians
47+
*/
48+
export function toDegree(a) {
49+
return a * radian;
50+
}
51+
2952
/**
3053
* Tests whether or not the arguments have approximately the same value, within an absolute
3154
* or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less
3255
* than or equal to 1.0, and a relative tolerance is used for larger values)
3356
*
34-
* @param {Number} a The first number to test.
35-
* @param {Number} b The second number to test.
57+
* @param {Number} a The first number to test.
58+
* @param {Number} b The second number to test.
59+
* @param {Number} tolerance Absolute or relative tolerance (default glMatrix.EPSILON)
3660
* @returns {Boolean} True if the numbers are approximately equal, false otherwise.
3761
*/
38-
3962
export function equals(a, b) {
40-
return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));
41-
}
42-
if (!Math.hypot) Math.hypot = function () {
43-
var y = 0,
44-
i = arguments.length;
45-
46-
while (i--) {
47-
y += arguments[i] * arguments[i];
48-
}
49-
50-
return Math.sqrt(y);
51-
};
63+
var tolerance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EPSILON;
64+
return Math.abs(a - b) <= tolerance * Math.max(1, Math.abs(a), Math.abs(b));
65+
}

0 commit comments

Comments
 (0)