Use standard Sin/Cos version (fixing "The Pit" tilting floor issue, and maybe other similar issues too)

This commit is contained in:
ptitSeb 2017-05-27 15:41:24 +02:00
parent a41642340c
commit dce391583c
2 changed files with 11 additions and 4 deletions

View File

@ -69,7 +69,7 @@ double adCosQuadrants[4][2] =
{1.0, -90.0},
{1.0, 0.0},
};
/*
FLOAT Sin(ANGLE a)
{
double aWrapped = WrapAngle(a);
@ -92,3 +92,4 @@ FLOAT Tan(ANGLE a)
{
return Sin(a)/Cos(a);
}
*/

View File

@ -495,9 +495,15 @@ inline FLOAT RadAngle(ANGLE aAngle) {
return FLOAT (WrapAngle(aAngle)*PI/ANGLE_180);
}
ENGINE_API FLOAT Sin(ANGLE a);
ENGINE_API FLOAT Cos(ANGLE a);
ENGINE_API FLOAT Tan(ANGLE a);
#ifdef __arm__
inline ENGINE_API FLOAT Sin(ANGLE a) { return sinf(a*(PI/ANGLE_180)); };
inline ENGINE_API FLOAT Cos(ANGLE a) { return cosf(a*(PI/ANGLE_180)); };
inline ENGINE_API FLOAT Tan(ANGLE a) { return tanf(a*(PI/ANGLE_180)); };
#else
inline ENGINE_API FLOAT Sin(ANGLE a) { return sin(a*(PI/ANGLE_180)); };
inline ENGINE_API FLOAT Cos(ANGLE a) { return cos(a*(PI/ANGLE_180)); };
inline ENGINE_API FLOAT Tan(ANGLE a) { return tan(a*(PI/ANGLE_180)); };
#endif
#ifdef __arm__
inline ENGINE_API FLOAT SinFast(ANGLE a) { return sinf(a*(PI/ANGLE_180)); };