Rename PI constants

This commit is contained in:
Ryan Dwyer 2020-03-16 21:25:09 +10:00
parent 9a5a4139ac
commit c38a868aee
4 changed files with 10 additions and 10 deletions

View File

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

View File

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

View File

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

View File

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