|
@@ -17,7 +17,7 @@
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
*/
|
|
|
|
|
|
-import { Mat4, Vec3 } from '../3d'
|
|
|
+import { Mat4, Vec3, EPSILON } from '../3d'
|
|
|
import { NumberArray } from '../../../mol-util/type-helpers';
|
|
|
|
|
|
interface Mat3 extends Array<number> { [d: number]: number, '@type': 'mat3', length: 9 }
|
|
@@ -118,6 +118,11 @@ namespace Mat3 {
|
|
|
return out;
|
|
|
}
|
|
|
|
|
|
+ const _id = identity();
|
|
|
+ export function isIdentity(m: Mat3, eps?: number) {
|
|
|
+ return areEqual(m, _id, typeof eps === 'undefined' ? EPSILON : eps);
|
|
|
+ }
|
|
|
+
|
|
|
export function hasNaN(m: Mat3) {
|
|
|
for (let i = 0; i < 9; i++) if (isNaN(m[i])) return true
|
|
|
return false
|