func_8017FB1C

This commit is contained in:
angie
2022-04-03 21:06:21 -04:00
parent f62623a334
commit 1a99793ab1
+49 -1
View File
@@ -2270,7 +2270,55 @@ s32 Math3D_YZInSphere(Sphere16* sphere, f32 y, f32 z) {
return false;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017FB1C.s")
s32 func_8017FB1C(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32* arg7, f32* arg8, f32* arg9, f32* argA) {
f32 temp_fa0;
f32 temp_fa1;
f32 temp_fs0;
f32 temp_fv0;
f32 temp_ft5;
f32 temp_fv1;
f32 temp_ft2;
s32 phi_a1;
temp_fa1 = SQ(arg5) + SQ(arg6);
temp_fv1 = arg3 - arg0;
temp_fa0 = arg4 - arg1;
if ((IS_ZERO(arg5) && IS_ZERO(arg6)) || IS_ZERO(temp_fa1)) {
*arg7 = 0.0f;
*arg8 = 0.0f;
*arg9 = 0.0f;
*argA = 0.0f;
return 0;
}
temp_fs0 = 2.0f * ((arg5 * temp_fv1) + (arg6 * temp_fa0));
temp_ft5 = SQ(temp_fs0) - (4.0f * temp_fa1 * ((SQ(temp_fv1) + SQ(temp_fa0)) - SQ(arg2)));
phi_a1 = 0;
if (IS_ZERO(temp_ft5)) {
temp_fv0 = (-temp_fs0 / (2.0f * temp_fa1));
*arg7 = (arg5 * temp_fv0) + arg3;
*arg8 = (arg6 * temp_fv0) + arg4;
*arg9 = 0.0f;
*argA = 0.0f;
}
if (temp_ft5 > 0.0f) {
temp_fv0 = ((-temp_fs0 - sqrtf(temp_ft5)) / (2.0f * temp_fa1));
temp_ft2 = ((sqrtf(temp_ft5) + -temp_fs0) / (2.0f * temp_fa1));
*arg7 = (arg5 * temp_fv0) + arg3;
*arg8 = (arg6 * temp_fv0) + arg4;
*arg9 = (arg5 * temp_ft2) + arg3;
*argA = (arg6 * temp_ft2) + arg4;
phi_a1 = 2;
} else {
*arg7 = 0.0f;
*arg8 = 0.0f;
}
return phi_a1;
}
void func_8017FD44(Vec3f* arg0, Vec3f* arg1, Vec3f* dst, f32 arg3) {
Vec3f sp2C;