diff --git a/src/game/bondgrab.c b/src/game/bondgrab.c index 45f716d34..e6fa193df 100644 --- a/src/game/bondgrab.c +++ b/src/game/bondgrab.c @@ -153,9 +153,9 @@ void currentPlayerUpdateGrabbedPropForRelease(void) rotateamount = -(g_Vars.currentplayer->vv_theta - g_Vars.currentplayer->bondprevtheta) * M_TAU / 360; - if (rotateamount < -M_CORRECT_PI) { + if (rotateamount < -M_PI) { rotateamount += M_TAU; - } else if (rotateamount >= M_CORRECT_PI) { + } else if (rotateamount >= M_PI) { rotateamount -= M_TAU; } diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index d78e71fab..248ec9543 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -27387,7 +27387,7 @@ void chrTickSkJump(struct chrdata *chr) if (chr->act_skjump.unk04c > 0) { fVar6 = 1.0f - chr->act_skjump.unk03c / (f32)chr->act_skjump.unk04c; - fVar7 = fsin(M_CORRECT_PI * fVar6); + fVar7 = fsin(M_PI * fVar6); fVar7 = fVar7 * 160.0f + chr->act_skjump.y; } else { fVar6 = 1; @@ -28562,8 +28562,8 @@ bool func0f04911c(struct chrdata *chr, struct coord *pos, u8 arg2) { f32 angle = chrGetAngleToPos(chr, pos); - if ((angle < arg2 * 0.024539785459638f && angle < M_CORRECT_PI) || - (M_TAU - arg2 * 0.024539785459638f < angle && M_CORRECT_PI < angle)) { + if ((angle < arg2 * 0.024539785459638f && angle < M_PI) || + (M_TAU - arg2 * 0.024539785459638f < angle && M_PI < angle)) { return true; } diff --git a/src/game/game_0b3350.c b/src/game/game_0b3350.c index 1b5cca252..1b68249ce 100644 --- a/src/game/game_0b3350.c +++ b/src/game/game_0b3350.c @@ -1620,7 +1620,7 @@ void currentPlayerSetCameraScale(void) f32 fVar5; f32 fVar2; - player->c_scaley = fsin(player->c_perspfovy * (M_CORRECT_PI / 360.0f)) / (fcos(player->c_perspfovy * (M_CORRECT_PI / 360.0f)) * player->c_halfheight); + player->c_scaley = fsin(player->c_perspfovy * (M_PI / 360.0f)) / (fcos(player->c_perspfovy * (M_PI / 360.0f)) * player->c_halfheight); player->c_scalelod = player->c_scaley; player->c_scalex = (player->c_scaley * player->c_perspaspect * player->c_halfheight) / player->c_halfwidth; diff --git a/src/include/math.h b/src/include/math.h index 3e2e5fb30..866f3b9fe 100644 --- a/src/include/math.h +++ b/src/include/math.h @@ -1,10 +1,10 @@ #ifndef IN_MATH_H #define IN_MATH_H -// @bug: Should be 3.1415926f -#define M_PI 3.1410926f -#define M_CORRECT_PI 3.141592741f +// @bug? +#define M_BADPI 3.141092641f +#define M_PI 3.141592741f -#define M_TAU (M_PI * 2) +#define M_TAU (M_BADPI * 2) #endif