and of course the last commit didnt fix everything

This commit is contained in:
aap 2019-07-10 17:34:11 +02:00
parent 4a36d64f15
commit 90e093cd47
19 changed files with 40 additions and 36 deletions

View file

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

View file

@ -13,7 +13,7 @@ public:
void Normalise(void){
float sq = MagnitudeSqr();
if(sq > 0.0f){
float invsqrt = 1.0f/sqrt(sq);
float invsqrt = 1.0f/Sqrt(sq);
x *= invsqrt;
y *= invsqrt;
}else

View file

@ -14,7 +14,7 @@ CQuaternion::Slerp(const CQuaternion &q1, const CQuaternion &q2, float theta, fl
if(theta > PI/2){
theta = PI - theta;
w1 = Sin((1.0f - t) * theta) * invSin;
w2 = -sin(t * theta) * invSin;
w2 = -Sin(t * theta) * invSin;
}else{
w1 = Sin((1.0f - t) * theta) * invSin;
w2 = Sin(t * theta) * invSin;

View file

@ -4,9 +4,13 @@
// in gta they are in CMaths but that makes the code rather noisy
inline float Sin(float x) { return sinf(x); }
inline float Asin(float x) { return asinf(x); }
inline float Cos(float x) { return cosf(x); }
inline float Acos(float x) { return acosf(x); }
inline float Tan(float x) { return tanf(x); }
inline float Atan(float x) { return atanf(x); }
inline float Atan2(float y, float x) { return atan2f(y, x); }
inline float Abs(float x) { return fabs(x); }
inline float Sqrt(float x) { return sqrtf(x); }
inline float Atan2(float y, float x) { return atan2f(y, x); }
inline float RecipSqrt(float x) { return 1.0f/sqrtf(x); }
inline float RecipSqrt(float x) { return 1.0f/Sqrt(x); }
inline float Pow(float x, float y) { return powf(x, y); }