From: TheSaminator Date: Sat, 4 Jun 2022 16:24:39 +0000 (-0400) Subject: bruh X-Git-Url: https://gitweb.starshipfights.net/?a=commitdiff_plain;h=ca4eb9107b87708f6ead8f0abcecfbcd4941d504;p=starship-fights bruh --- diff --git a/src/commonMain/kotlin/starshipfights/game/math.kt b/src/commonMain/kotlin/starshipfights/game/math.kt index f7878fc..ea91db8 100644 --- a/src/commonMain/kotlin/starshipfights/game/math.kt +++ b/src/commonMain/kotlin/starshipfights/game/math.kt @@ -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 }