bruh
authorTheSaminator <TheSaminator@users.noreply.github.com>
Sat, 4 Jun 2022 16:24:39 +0000 (12:24 -0400)
committerTheSaminator <TheSaminator@users.noreply.github.com>
Sat, 4 Jun 2022 16:24:39 +0000 (12:24 -0400)
src/commonMain/kotlin/starshipfights/game/math.kt

index f7878fcd2ed0845521a2ee561815231a6728f72d..ea91db871c7a459e2f6f5ec789acea0453624630 100644 (file)
@@ -41,7 +41,7 @@ inline val Vec2.angle: Double
 inline val Vec2.normal: Vec2
        get() {
                val thisMagnitude = this.magnitude
-               return if (thisMagnitude == 0.0)
+               return if (thisMagnitude < EPSILON)
                        Vec2(0.0, 0.0)
                else this / thisMagnitude
        }