mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-14 11:54:39 +00:00
Consistent naming for Math_ functions (#542)
* Darkmeiro decompilation Bg_Gnd_Darkmeiro decompiled, matched, and documented. * give this a shot * fix conflict * one more try * could be useful * whoops * ZAP2 stuff * ZAP why * ZAP again * maths * Factoriali -> Factorial * soon, soon * renames * rand * docs * merged * formatting * little more cleanup * asm crept back in * changes to MathF * smooth criminal * functions.h
This commit is contained in:
parent
81c269b417
commit
8fa6cb6ff9
1329 changed files with 8413 additions and 8374 deletions
|
@ -28,7 +28,7 @@ void func_8002B200(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gfx*
|
|||
COMBINED);
|
||||
|
||||
temp1 = (temp1 < 0.0f) ? 0.0f : ((temp1 > 150.0f) ? 150.0f : temp1);
|
||||
temp2 = 1.0f - (temp1 * (1.f / 350));
|
||||
temp2 = 1.0f - (temp1 * (1.0f / 350));
|
||||
|
||||
if (color != NULL) {
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, color->r, color->g, color->b,
|
||||
|
@ -44,7 +44,7 @@ void func_8002B200(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gfx*
|
|||
Matrix_RotateY(actor->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
temp2 = (1.0f - (temp1 * (1.f / 350))) * actor->shape.unk_10;
|
||||
temp2 = (1.0f - (temp1 * (1.0f / 350))) * actor->shape.unk_10;
|
||||
Matrix_Scale(actor->scale.x * temp2, 1.0f, actor->scale.z * temp2, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 1588),
|
||||
|
@ -80,7 +80,7 @@ void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3,
|
|||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0,
|
||||
(u32)(((arg3 * 0.00005f) > 1.0f ? 1.0f : (arg3 * 0.00005f)) * arg4) & 0xFF);
|
||||
|
||||
sp58 = Math_atan2f(light->l.dir[0], light->l.dir[2]);
|
||||
sp58 = Math_FAtan2F(light->l.dir[0], light->l.dir[2]);
|
||||
arg6 *= (4.5f - (light->l.dir[1] * 0.035f));
|
||||
arg6 = (arg6 < 1.0f) ? 1.0f : arg6;
|
||||
Matrix_Put(arg2);
|
||||
|
@ -463,7 +463,7 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl
|
|||
unkActor = &player->actor;
|
||||
}
|
||||
|
||||
if (Math_ApproxF(&targetCtx->unk_40, 0.0f, 0.25f) == 0) {
|
||||
if (Math_StepToF(&targetCtx->unk_40, 0.0f, 0.25f) == 0) {
|
||||
temp1 = 0.25f / targetCtx->unk_40;
|
||||
temp2 = unkActor->posRot.pos.x - targetCtx->naviRefPos.x;
|
||||
temp3 = (unkActor->posRot.pos.y + (unkActor->unk_4C * unkActor->scale.y)) - targetCtx->naviRefPos.y;
|
||||
|
@ -502,7 +502,7 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl
|
|||
if (targetCtx->unk_4B == 0) {
|
||||
temp5 = (500.0f - targetCtx->unk_44) * 3.0f;
|
||||
temp6 = (temp5 < 30.0f) ? 30.0f : ((100.0f < temp5) ? 100.0f : temp5);
|
||||
if (Math_ApproxF(&targetCtx->unk_44, 80.0f, temp6) != 0) {
|
||||
if (Math_StepToF(&targetCtx->unk_44, 80.0f, temp6) != 0) {
|
||||
targetCtx->unk_4B++;
|
||||
}
|
||||
} else {
|
||||
|
@ -511,7 +511,7 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl
|
|||
}
|
||||
} else {
|
||||
targetCtx->targetedActor = NULL;
|
||||
Math_ApproxF(&targetCtx->unk_44, 500.0f, 80.0f);
|
||||
Math_StepToF(&targetCtx->unk_44, 500.0f, 80.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -697,11 +697,11 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt
|
|||
void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
|
||||
if (DECR(titleCtx->delayB) == 0) {
|
||||
if (DECR(titleCtx->delayA) == 0) {
|
||||
Math_ApproxS(&titleCtx->unk_C, 0, 30);
|
||||
Math_ApproxS(&titleCtx->unk_E, 0, 70);
|
||||
Math_StepToS(&titleCtx->unk_C, 0, 30);
|
||||
Math_StepToS(&titleCtx->unk_E, 0, 70);
|
||||
} else {
|
||||
Math_ApproxS(&titleCtx->unk_C, 255, 10);
|
||||
Math_ApproxS(&titleCtx->unk_E, 255, 20);
|
||||
Math_StepToS(&titleCtx->unk_C, 255, 10);
|
||||
Math_StepToS(&titleCtx->unk_E, 255, 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -853,8 +853,8 @@ void func_8002D7EC(Actor* actor) {
|
|||
}
|
||||
|
||||
void func_8002D868(Actor* actor) {
|
||||
actor->velocity.x = Math_Sins(actor->posRot.rot.y) * actor->speedXZ;
|
||||
actor->velocity.z = Math_Coss(actor->posRot.rot.y) * actor->speedXZ;
|
||||
actor->velocity.x = Math_SinS(actor->posRot.rot.y) * actor->speedXZ;
|
||||
actor->velocity.z = Math_CosS(actor->posRot.rot.y) * actor->speedXZ;
|
||||
|
||||
actor->velocity.y += actor->gravity;
|
||||
if (actor->velocity.y < actor->minVelocityY) {
|
||||
|
@ -868,10 +868,10 @@ void Actor_MoveForward(Actor* actor) {
|
|||
}
|
||||
|
||||
void func_8002D908(Actor* actor) {
|
||||
f32 sp24 = Math_Coss(actor->posRot.rot.x) * actor->speedXZ;
|
||||
actor->velocity.x = Math_Sins(actor->posRot.rot.y) * sp24;
|
||||
actor->velocity.y = Math_Sins(actor->posRot.rot.x) * actor->speedXZ;
|
||||
actor->velocity.z = Math_Coss(actor->posRot.rot.y) * sp24;
|
||||
f32 sp24 = Math_CosS(actor->posRot.rot.x) * actor->speedXZ;
|
||||
actor->velocity.x = Math_SinS(actor->posRot.rot.y) * sp24;
|
||||
actor->velocity.y = Math_SinS(actor->posRot.rot.x) * actor->speedXZ;
|
||||
actor->velocity.z = Math_CosS(actor->posRot.rot.y) * sp24;
|
||||
}
|
||||
|
||||
void func_8002D97C(Actor* actor) {
|
||||
|
@ -880,8 +880,8 @@ void func_8002D97C(Actor* actor) {
|
|||
}
|
||||
|
||||
void func_8002D9A4(Actor* actor, f32 arg1) {
|
||||
actor->speedXZ = Math_Coss(actor->posRot.rot.x) * arg1;
|
||||
actor->velocity.y = -Math_Sins(actor->posRot.rot.x) * arg1;
|
||||
actor->speedXZ = Math_CosS(actor->posRot.rot.x) * arg1;
|
||||
actor->velocity.y = -Math_SinS(actor->posRot.rot.x) * arg1;
|
||||
}
|
||||
|
||||
void func_8002D9F8(Actor* actor, SkelAnime* skelAnime) {
|
||||
|
@ -938,8 +938,8 @@ void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2) {
|
|||
f32 deltaX;
|
||||
f32 deltaZ;
|
||||
|
||||
cosRot2Y = Math_Coss(actor->shape.rot.y);
|
||||
sinRot2Y = Math_Sins(actor->shape.rot.y);
|
||||
cosRot2Y = Math_CosS(actor->shape.rot.y);
|
||||
sinRot2Y = Math_SinS(actor->shape.rot.y);
|
||||
deltaX = arg2->x - actor->posRot.pos.x;
|
||||
deltaZ = arg2->z - actor->posRot.pos.z;
|
||||
|
||||
|
@ -1223,7 +1223,7 @@ void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f
|
|||
&actor->wallPoly, &sp60, actor, arg2))) {
|
||||
sp5C = actor->wallPoly;
|
||||
Math_Vec3f_Copy(&actor->posRot.pos, &sp64);
|
||||
actor->wallPolyRot = atan2s(sp5C->norm.z, sp5C->norm.x);
|
||||
actor->wallPolyRot = Math_Atan2S(sp5C->norm.z, sp5C->norm.x);
|
||||
actor->bgCheckFlags |= 8;
|
||||
actor->wallPolySource = sp60;
|
||||
} else {
|
||||
|
@ -1829,7 +1829,7 @@ void func_8002FBAC(GlobalContext* globalCtx) {
|
|||
sp9C = (1.0f / D_8015BC18) * temp_ret;
|
||||
phi_f14 = 20.0f / sp9C;
|
||||
phi_f14 = (phi_f14 < 0.05f) ? 0.05f : phi_f14;
|
||||
Math_ApproxF(&D_8015BC18, 0.0f, phi_f14);
|
||||
Math_StepToF(&D_8015BC18, 0.0f, phi_f14);
|
||||
temp_f2 = ((D_8015BC18 / spC0) * temp_ret) / temp_ret;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x =
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.x + (spB4.x * temp_f2);
|
||||
|
@ -1843,9 +1843,9 @@ void func_8002FBAC(GlobalContext* globalCtx) {
|
|||
osSyncPrintf("-------- DISPLAY Y=%f\n", spD8);
|
||||
}
|
||||
|
||||
spA4.x = Math_Rand_CenteredFloat(6.0f) + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x;
|
||||
spA4.y = Math_Rand_ZeroOne() * 6.0f + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y + 80.0f;
|
||||
spA4.z = Math_Rand_CenteredFloat(6.0f) + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z;
|
||||
spA4.x = Rand_CenteredFloat(6.0f) + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x;
|
||||
spA4.y = Rand_ZeroOne() * 6.0f + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y + 80.0f;
|
||||
spA4.z = Rand_CenteredFloat(6.0f) + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z;
|
||||
|
||||
EffectSsKiraKira_SpawnDispersed(globalCtx, &spA4, &D_80116048, &D_80116054, &D_80116060, &D_80116064, 1000,
|
||||
16);
|
||||
|
@ -3011,7 +3011,7 @@ void func_80032C7C(GlobalContext* globalCtx, Actor* actor) {
|
|||
|
||||
s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3) {
|
||||
if (DECR(arg0[1]) == 0) {
|
||||
arg0[1] = Math_Rand_S16Offset(arg1, arg2);
|
||||
arg0[1] = Rand_S16Offset(arg1, arg2);
|
||||
}
|
||||
|
||||
if ((arg0[1] - arg3) > 0) {
|
||||
|
@ -3027,11 +3027,11 @@ s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3) {
|
|||
|
||||
s16 func_80032D60(s16* arg0, s16 arg1, s16 arg2, s16 arg3) {
|
||||
if (DECR(arg0[1]) == 0) {
|
||||
arg0[1] = Math_Rand_S16Offset(arg1, arg2);
|
||||
arg0[1] = Rand_S16Offset(arg1, arg2);
|
||||
arg0[0]++;
|
||||
|
||||
if ((arg0[0] % 3) == 0) {
|
||||
arg0[0] = (s32)(Math_Rand_ZeroOne() * arg3) * 3;
|
||||
arg0[0] = (s32)(Rand_ZeroOne() * arg3) * 3;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3148,15 +3148,15 @@ void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3
|
|||
f32 var;
|
||||
s32 i;
|
||||
|
||||
var = (Math_Rand_ZeroOne() - 0.5f) * 6.28f;
|
||||
var = (Rand_ZeroOne() - 0.5f) * 6.28f;
|
||||
pos.y = actor->groundY;
|
||||
accel.y += (Math_Rand_ZeroOne() - 0.5f) * 0.2f;
|
||||
accel.y += (Rand_ZeroOne() - 0.5f) * 0.2f;
|
||||
|
||||
for (i = arg4; i >= 0; i--) {
|
||||
pos.x = (func_800CA720(var) * arg3) + arg2->x;
|
||||
pos.z = (func_800CA774(var) * arg3) + arg2->z;
|
||||
accel.x = (Math_Rand_ZeroOne() - 0.5f) * arg5;
|
||||
accel.z = (Math_Rand_ZeroOne() - 0.5f) * arg5;
|
||||
pos.x = (Math_SinF(var) * arg3) + arg2->x;
|
||||
pos.z = (Math_CosF(var) * arg3) + arg2->z;
|
||||
accel.x = (Rand_ZeroOne() - 0.5f) * arg5;
|
||||
accel.z = (Rand_ZeroOne() - 0.5f) * arg5;
|
||||
|
||||
if (scale == 0) {
|
||||
func_8002857C(globalCtx, &pos, &velocity, &accel);
|
||||
|
@ -3179,11 +3179,11 @@ void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s1
|
|||
s32 i;
|
||||
|
||||
for (i = arg3; i >= 0; i--) {
|
||||
pos.x = arg1->x + ((Math_Rand_ZeroOne() - 0.5f) * arg2);
|
||||
pos.y = arg1->y + ((Math_Rand_ZeroOne() - 0.5f) * arg2);
|
||||
pos.z = arg1->z + ((Math_Rand_ZeroOne() - 0.5f) * arg2);
|
||||
pos.x = arg1->x + ((Rand_ZeroOne() - 0.5f) * arg2);
|
||||
pos.y = arg1->y + ((Rand_ZeroOne() - 0.5f) * arg2);
|
||||
pos.z = arg1->z + ((Rand_ZeroOne() - 0.5f) * arg2);
|
||||
|
||||
scale = (s16)((Math_Rand_ZeroOne() * arg4) * 0.2f) + arg4;
|
||||
scale = (s16)((Rand_ZeroOne() * arg4) * 0.2f) + arg4;
|
||||
var2 = arg6;
|
||||
|
||||
if (var2 != 0) {
|
||||
|
@ -3256,9 +3256,9 @@ Actor* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg2) {
|
|||
(itemActor->unk_210 == 0)) {
|
||||
actor = actor->next;
|
||||
} else {
|
||||
deltaX = Math_Sins(itemActor->actor.posRot.rot.y) * (itemActor->actor.speedXZ * 10.0f);
|
||||
deltaX = Math_SinS(itemActor->actor.posRot.rot.y) * (itemActor->actor.speedXZ * 10.0f);
|
||||
deltaY = itemActor->actor.velocity.y + (itemActor->actor.gravity * 10.0f);
|
||||
deltaZ = Math_Coss(itemActor->actor.posRot.rot.y) * (itemActor->actor.speedXZ * 10.0f);
|
||||
deltaZ = Math_CosS(itemActor->actor.posRot.rot.y) * (itemActor->actor.speedXZ * 10.0f);
|
||||
|
||||
spA8.x = itemActor->actor.posRot.pos.x + deltaX;
|
||||
spA8.y = itemActor->actor.posRot.pos.y + deltaY;
|
||||
|
@ -3366,8 +3366,8 @@ s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3) {
|
|||
|
||||
Math_Vec3f_Copy(&sp30, &actor->posRot.pos);
|
||||
sp44 = actor->bgCheckFlags;
|
||||
sp40 = Math_Sins(arg3) * arg2;
|
||||
sp3C = Math_Coss(arg3) * arg2;
|
||||
sp40 = Math_SinS(arg3) * arg2;
|
||||
sp3C = Math_CosS(arg3) * arg2;
|
||||
actor->posRot.pos.x += sp40;
|
||||
actor->posRot.pos.z += sp3C;
|
||||
func_8002E4B4(globalCtx, actor, 0.0f, 0.0f, 0.0f, 4);
|
||||
|
@ -3403,13 +3403,13 @@ f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 ar
|
|||
f32 ret = 0.0f;
|
||||
|
||||
if (arg4 <= Math_Vec3f_DistXYZ(arg0, arg1)) {
|
||||
ret = Math_SmoothScaleMaxMinF(&arg1->x, arg0->x, arg2, arg3, 0.0f);
|
||||
ret += Math_SmoothScaleMaxMinF(&arg1->y, arg0->y, arg2, arg3, 0.0f);
|
||||
ret += Math_SmoothScaleMaxMinF(&arg1->z, arg0->z, arg2, arg3, 0.0f);
|
||||
ret = Math_SmoothStepToF(&arg1->x, arg0->x, arg2, arg3, 0.0f);
|
||||
ret += Math_SmoothStepToF(&arg1->y, arg0->y, arg2, arg3, 0.0f);
|
||||
ret += Math_SmoothStepToF(&arg1->z, arg0->z, arg2, arg3, 0.0f);
|
||||
} else if (arg5 < Math_Vec3f_DistXYZ(arg0, arg1)) {
|
||||
ret = Math_SmoothScaleMaxMinF(&arg1->x, arg0->x, arg2, arg3, 0.0f);
|
||||
ret += Math_SmoothScaleMaxMinF(&arg1->y, arg0->y, arg2, arg3, 0.0f);
|
||||
ret += Math_SmoothScaleMaxMinF(&arg1->z, arg0->z, arg2, arg3, 0.0f);
|
||||
ret = Math_SmoothStepToF(&arg1->x, arg0->x, arg2, arg3, 0.0f);
|
||||
ret += Math_SmoothStepToF(&arg1->y, arg0->y, arg2, arg3, 0.0f);
|
||||
ret += Math_SmoothStepToF(&arg1->z, arg0->z, arg2, arg3, 0.0f);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -3475,12 +3475,12 @@ void func_80033E88(Actor* actor, GlobalContext* globalCtx, s16 arg2, s16 arg3) {
|
|||
func_80033DB8(globalCtx, arg2, arg3);
|
||||
}
|
||||
|
||||
f32 Math_Rand_ZeroFloat(f32 f) {
|
||||
return Math_Rand_ZeroOne() * f;
|
||||
f32 Rand_ZeroFloat(f32 f) {
|
||||
return Rand_ZeroOne() * f;
|
||||
}
|
||||
|
||||
f32 Math_Rand_CenteredFloat(f32 f) {
|
||||
return (Math_Rand_ZeroOne() - 0.5f) * f;
|
||||
f32 Rand_CenteredFloat(f32 f) {
|
||||
return (Rand_ZeroOne() - 0.5f) * f;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
@ -3666,7 +3666,7 @@ void func_800344BC(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3,
|
|||
sp40 = Math_Vec3f_Yaw(&actor->posRot.pos, &arg1->unk_18) - actor->shape.rot.y;
|
||||
|
||||
temp1 = CLAMP(sp40, -arg2, arg2);
|
||||
Math_SmoothScaleMaxMinS(&arg1->unk_08.y, temp1, 6, 2000, 1);
|
||||
Math_SmoothStepToS(&arg1->unk_08.y, temp1, 6, 2000, 1);
|
||||
|
||||
sp40 = (ABS(sp40) >= 0x8000) ? 0 : ABS(sp40);
|
||||
arg1->unk_08.y = CLAMP(arg1->unk_08.y, -sp40, sp40);
|
||||
|
@ -3674,23 +3674,23 @@ void func_800344BC(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3,
|
|||
sp40 = sp40 - arg1->unk_08.y;
|
||||
|
||||
temp1 = CLAMP(sp40, -arg5, arg5);
|
||||
Math_SmoothScaleMaxMinS(&arg1->unk_0E.y, temp1, 6, 2000, 1);
|
||||
Math_SmoothStepToS(&arg1->unk_0E.y, temp1, 6, 2000, 1);
|
||||
|
||||
sp40 = (ABS(sp40) >= 0x8000) ? 0 : ABS(sp40);
|
||||
arg1->unk_0E.y = CLAMP(arg1->unk_0E.y, -sp40, sp40);
|
||||
|
||||
if (arg8 != 0) {
|
||||
if (arg3) {} // Seems necessary to match
|
||||
Math_SmoothScaleMaxMinS(&actor->shape.rot.y, sp44, 6, 2000, 1);
|
||||
Math_SmoothStepToS(&actor->shape.rot.y, sp44, 6, 2000, 1);
|
||||
}
|
||||
|
||||
temp1 = CLAMP(sp46, arg4, arg3);
|
||||
Math_SmoothScaleMaxMinS(&arg1->unk_08.x, temp1, 6, 2000, 1);
|
||||
Math_SmoothStepToS(&arg1->unk_08.x, temp1, 6, 2000, 1);
|
||||
|
||||
temp2 = sp46 - arg1->unk_08.x;
|
||||
|
||||
temp1 = CLAMP(temp2, arg7, arg6);
|
||||
Math_SmoothScaleMaxMinS(&arg1->unk_0E.x, temp1, 6, 2000, 1);
|
||||
Math_SmoothStepToS(&arg1->unk_0E.x, temp1, 6, 2000, 1);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800344BC.s")
|
||||
|
@ -3734,11 +3734,11 @@ s16 func_80034810(Actor* actor, struct_80034A14_arg1* arg1, f32 arg2, s16 arg3,
|
|||
switch (arg1->unk_06) {
|
||||
case 0:
|
||||
case 2:
|
||||
arg1->unk_04 = Math_Rand_S16Offset(30, 30);
|
||||
arg1->unk_04 = Rand_S16Offset(30, 30);
|
||||
arg1->unk_06++;
|
||||
return 1;
|
||||
case 1:
|
||||
arg1->unk_04 = Math_Rand_S16Offset(10, 10);
|
||||
arg1->unk_04 = Rand_S16Offset(10, 10);
|
||||
arg1->unk_06++;
|
||||
return 3;
|
||||
}
|
||||
|
@ -3839,10 +3839,10 @@ s16 func_80034DD4(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3) {
|
|||
|
||||
if (arg3 < var) {
|
||||
actor->flags &= ~1;
|
||||
Math_SmoothScaleMaxMinS(&arg2, 0, 6, 0x14, 1);
|
||||
Math_SmoothStepToS(&arg2, 0, 6, 0x14, 1);
|
||||
} else {
|
||||
actor->flags |= 1;
|
||||
Math_SmoothScaleMaxMinS(&arg2, 0xFF, 6, 0x14, 1);
|
||||
Math_SmoothStepToS(&arg2, 0xFF, 6, 0x14, 1);
|
||||
}
|
||||
|
||||
return arg2;
|
||||
|
@ -3885,7 +3885,7 @@ s32 func_80035124(Actor* actor, GlobalContext* globalCtx) {
|
|||
actor->params = 1;
|
||||
} else if (!(actor->bgCheckFlags & 1)) {
|
||||
Actor_MoveForward(actor);
|
||||
Math_SmoothScaleMaxMinF(&actor->speedXZ, 0.0f, 1.0f, 0.1f, 0.0f);
|
||||
Math_SmoothStepToF(&actor->speedXZ, 0.0f, 1.0f, 0.1f, 0.0f);
|
||||
} else if ((actor->bgCheckFlags & 2) && (actor->velocity.y < -4.0f)) {
|
||||
ret = 1;
|
||||
} else {
|
||||
|
@ -4070,8 +4070,8 @@ void func_80035844(Vec3f* arg0, Vec3f* arg1, s16* arg2, s32 arg3) {
|
|||
f32 dz = arg1->z - arg0->z;
|
||||
f32 dy = arg3 ? (arg1->y - arg0->y) : (arg0->y - arg1->y);
|
||||
|
||||
arg2[1] = atan2s(dz, dx);
|
||||
arg2[0] = atan2s(sqrtf(SQ(dx) + SQ(dz)), dy);
|
||||
arg2[1] = Math_Atan2S(dz, dx);
|
||||
arg2[0] = Math_Atan2S(sqrtf(SQ(dx) + SQ(dz)), dy);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4117,15 +4117,15 @@ void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2) {
|
|||
sp40 = floorPoly->norm.y * (1.0f / 32767);
|
||||
sp3C = floorPoly->norm.z * (1.0f / 32767);
|
||||
|
||||
sp38 = Math_Sins(arg1);
|
||||
sp34 = Math_Coss(arg1);
|
||||
sp38 = Math_SinS(arg1);
|
||||
sp34 = Math_CosS(arg1);
|
||||
sp28 = (-(sp44 * sp38) - (sp3C * sp34));
|
||||
arg2->x = -(s16)(Math_atan2f(sp28 * sp40, 1.0f) * (32768 / M_PI));
|
||||
arg2->x = -(s16)(Math_FAtan2F(sp28 * sp40, 1.0f) * (32768 / M_PI));
|
||||
|
||||
sp2C = Math_Sins(arg1 - 16375);
|
||||
sp30 = Math_Coss(arg1 - 16375);
|
||||
sp2C = Math_SinS(arg1 - 16375);
|
||||
sp30 = Math_CosS(arg1 - 16375);
|
||||
sp24 = (-(sp44 * sp2C) - (sp3C * sp30));
|
||||
arg2->z = -(s16)(Math_atan2f(sp24 * sp40, 1.0f) * (32768 / M_PI));
|
||||
arg2->z = -(s16)(Math_FAtan2F(sp24 * sp40, 1.0f) * (32768 / M_PI));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5433,10 +5433,10 @@ s32 func_80037D98(GlobalContext* globalCtx, Actor* actor, s16 arg2, s32* arg3) {
|
|||
}
|
||||
|
||||
s32 func_80037F30(Vec3s* arg0, Vec3s* arg1) {
|
||||
Math_SmoothScaleMaxMinS(&arg0->y, 0, 6, 6200, 100);
|
||||
Math_SmoothScaleMaxMinS(&arg0->x, 0, 6, 6200, 100);
|
||||
Math_SmoothScaleMaxMinS(&arg1->y, 0, 6, 6200, 100);
|
||||
Math_SmoothScaleMaxMinS(&arg1->x, 0, 6, 6200, 100);
|
||||
Math_SmoothStepToS(&arg0->y, 0, 6, 6200, 100);
|
||||
Math_SmoothStepToS(&arg0->x, 0, 6, 6200, 100);
|
||||
Math_SmoothStepToS(&arg1->y, 0, 6, 6200, 100);
|
||||
Math_SmoothStepToS(&arg1->x, 0, 6, 6200, 100);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -5448,17 +5448,17 @@ s32 func_80037FC8(Actor* actor, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3) {
|
|||
sp36 = Math_Vec3f_Pitch(&actor->posRot2.pos, arg1);
|
||||
sp34 = Math_Vec3f_Yaw(&actor->posRot2.pos, arg1) - actor->posRot.rot.y;
|
||||
|
||||
Math_SmoothScaleMaxMinS(&arg2->x, sp36, 6, 2000, 1);
|
||||
Math_SmoothStepToS(&arg2->x, sp36, 6, 2000, 1);
|
||||
arg2->x = (arg2->x < -6000) ? -6000 : ((arg2->x > 6000) ? 6000 : arg2->x);
|
||||
|
||||
var = Math_SmoothScaleMaxMinS(&arg2->y, sp34, 6, 2000, 1);
|
||||
var = Math_SmoothStepToS(&arg2->y, sp34, 6, 2000, 1);
|
||||
arg2->y = (arg2->y < -8000) ? -8000 : ((arg2->y > 8000) ? 8000 : arg2->y);
|
||||
|
||||
if (var && (ABS(arg2->y) < 8000)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Math_SmoothScaleMaxMinS(&arg3->y, sp34 - arg2->y, 4, 2000, 1);
|
||||
Math_SmoothStepToS(&arg3->y, sp34 - arg2->y, 4, 2000, 1);
|
||||
arg3->y = (arg3->y < -12000) ? -12000 : ((arg3->y > 12000) ? 12000 : arg3->y);
|
||||
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue