work on CAutomobile

This commit is contained in:
aap
2021-08-16 00:19:09 +02:00
parent 39d2c427e5
commit 2f92ccecb1
11 changed files with 218 additions and 127 deletions

View File

@ -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); }