diff options
author | aap <aap@papnet.eu> | 2021-08-16 00:19:09 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2021-08-16 00:19:09 +0200 |
commit | 2f92ccecb1b7200d5284986dd584f34493e005ec (patch) | |
tree | 459f650376818da5a24f7913dc50ac2be26cc049 /src/math | |
parent | merge miami (diff) | |
download | re3-2f92ccecb1b7200d5284986dd584f34493e005ec.tar re3-2f92ccecb1b7200d5284986dd584f34493e005ec.tar.gz re3-2f92ccecb1b7200d5284986dd584f34493e005ec.tar.bz2 re3-2f92ccecb1b7200d5284986dd584f34493e005ec.tar.lz re3-2f92ccecb1b7200d5284986dd584f34493e005ec.tar.xz re3-2f92ccecb1b7200d5284986dd584f34493e005ec.tar.zst re3-2f92ccecb1b7200d5284986dd584f34493e005ec.zip |
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/Vector.h | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |