From 4a36d64f15f898854bb8a76be86ac9a8c536b291 Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 10 Jul 2019 17:18:26 +0200 Subject: added wrappers around math functions --- src/math/Vector.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/math/Vector.h') diff --git a/src/math/Vector.h b/src/math/Vector.h index b49f00f2..9a1dde7a 100644 --- a/src/math/Vector.h +++ b/src/math/Vector.h @@ -22,10 +22,10 @@ public: return *((RwV3d*)this); } #endif - float Heading(void) const { return atan2(-x, y); } - float Magnitude(void) const { return sqrt(x*x + y*y + z*z); } + float Heading(void) const { return 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); } + float Magnitude2D(void) const { return Sqrt(x*x + y*y); } float MagnitudeSqr2D(void) const { return x*x + y*y; } void Normalise(void) { float sq = MagnitudeSqr(); -- cgit v1.2.3 From 90e093cd47fb2af10617b1d404fc65ca813782ec Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 10 Jul 2019 17:34:11 +0200 Subject: and of course the last commit didnt fix everything --- src/math/Vector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/math/Vector.h') diff --git a/src/math/Vector.h b/src/math/Vector.h index 9a1dde7a..de8092eb 100644 --- a/src/math/Vector.h +++ b/src/math/Vector.h @@ -30,7 +30,7 @@ public: void Normalise(void) { float sq = MagnitudeSqr(); if(sq > 0.0f){ - float invsqrt = 1.0f/sqrt(sq); // CMaths::RecipSqrt + float invsqrt = 1.0f/Sqrt(sq); // CMaths::RecipSqrt x *= invsqrt; y *= invsqrt; z *= invsqrt; -- cgit v1.2.3