Skip to content
Snippets Groups Projects
Commit 6edd54ee authored by Alexander Rose's avatar Alexander Rose
Browse files

use Vec3.isFinite as name

parent a17a0c45
Branches
No related tags found
No related merge requests found
/** /**
* Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info. * Copyright (c) 2017-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
* *
* @author David Sehnal <david.sehnal@gmail.com> * @author David Sehnal <david.sehnal@gmail.com>
* @author Alexander Rose <alexander.rose@weirdbyte.de> * @author Alexander Rose <alexander.rose@weirdbyte.de>
...@@ -24,6 +24,8 @@ import { Mat3 } from './mat3'; ...@@ -24,6 +24,8 @@ import { Mat3 } from './mat3';
import { Quat } from './quat'; import { Quat } from './quat';
import { EPSILON } from './common'; import { EPSILON } from './common';
const _isFinite = isFinite;
export { ReadonlyVec3 }; export { ReadonlyVec3 };
interface Vec3 extends Array<number> { [d: number]: number, '@type': 'vec3', length: 3 } interface Vec3 extends Array<number> { [d: number]: number, '@type': 'vec3', length: 3 }
...@@ -48,8 +50,8 @@ namespace Vec3 { ...@@ -48,8 +50,8 @@ namespace Vec3 {
return out; return out;
} }
export function hasUndetermined(a: Vec3): boolean { export function isFinite(a: Vec3): boolean {
return isFinite(a[0]) && isFinite(a[1]) && isFinite(a[2]); return _isFinite(a[0]) && _isFinite(a[1]) && _isFinite(a[2]);
} }
export function hasNaN(a: Vec3) { export function hasNaN(a: Vec3) {
......
/** /**
* Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info. * Copyright (c) 2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
* *
* @author Gianluca Tomasello <giagitom@gmail.com> * @author Gianluca Tomasello <giagitom@gmail.com>
*/ */
......
/** /**
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info. * Copyright (c) 2018-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
* *
* @author Alexander Rose <alexander.rose@weirdbyte.de> * @author Alexander Rose <alexander.rose@weirdbyte.de>
* @author Gianluca Tomasello <giagitom@gmail.com> * @author Gianluca Tomasello <giagitom@gmail.com>
...@@ -124,9 +124,9 @@ namespace PrincipalAxes { ...@@ -124,9 +124,9 @@ namespace PrincipalAxes {
const dirB = Vec3.setMagnitude(Vec3(), a.dirB, (d2a + d2b) / 2); const dirB = Vec3.setMagnitude(Vec3(), a.dirB, (d2a + d2b) / 2);
const dirC = Vec3.setMagnitude(Vec3(), a.dirC, (d3a + d3b) / 2); const dirC = Vec3.setMagnitude(Vec3(), a.dirC, (d3a + d3b) / 2);
const okDirA = Vec3.hasUndetermined(dirA); const okDirA = Vec3.isFinite(dirA);
const okDirB = Vec3.hasUndetermined(dirB); const okDirB = Vec3.isFinite(dirB);
const okDirC = Vec3.hasUndetermined(dirC); const okDirC = Vec3.isFinite(dirC);
const origin = Vec3(); const origin = Vec3();
const addCornerHelper = function (d1: number, d2: number, d3: number) { const addCornerHelper = function (d1: number, d2: number, d3: number) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment