From 2f92ccecb1b7200d5284986dd584f34493e005ec Mon Sep 17 00:00:00 2001 From: aap Date: Mon, 16 Aug 2021 00:19:09 +0200 Subject: work on CAutomobile --- src/math/Vector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/math') diff --git a/src/math/Vector.h b/src/math/Vector.h index 87895806..a86e4e72 100644 --- a/src/math/Vector.h +++ b/src/math/Vector.h @@ -22,7 +22,7 @@ public: z = v.z; } // (0,1,0) means no rotation. So get right vector and its atan - float Heading(void) const { return Atan2(-x, y); } + float Heading(void) const { return x == 0.0f && y == 0.0f ? 0.0f : Atan2(-x, y); } float Magnitude(void) const { return Sqrt(x*x + y*y + z*z); } float MagnitudeSqr(void) const { return x*x + y*y + z*z; } float Magnitude2D(void) const { return Sqrt(x*x + y*y); } -- cgit v1.2.3