From e439e43aaf6b9d94bd992155124e7f6da76e3d44 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Sun, 14 Aug 2022 23:41:31 -0700 Subject: [PATCH] fix condition for being a unit vector --- modules/math/vector.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/math/vector.ts b/modules/math/vector.ts index 0dfed654..7e111578 100644 --- a/modules/math/vector.ts +++ b/modules/math/vector.ts @@ -185,7 +185,7 @@ export default class Vector implements XYZ { } asUnitVector(): UnitVector { - if (areEqual(this.lengthSquared(), 1, TOLERANCE_SQ)) { + if (!areEqual(this.lengthSquared(), 1, TOLERANCE_SQ)) { console.error("not unit vector is treated as unit"); } return this as any as UnitVector;