Applying sind/cosd/atan2d macros across the board (#518)
This commit is contained in:
parent
40da624fe7
commit
2455408432
47 changed files with 3431 additions and 3414 deletions
|
|
@ -281,14 +281,14 @@ lbl_1_data_21C = .data:0x0000021C; // type:object size:0xC0
|
|||
lbl_1_data_2DC = .data:0x000002DC; // type:object size:0xC
|
||||
lbl_1_data_2E8 = .data:0x000002E8; // type:object size:0x24
|
||||
lbl_1_data_30C = .data:0x0000030C; // type:object size:0xC data:4byte
|
||||
lbl_1_data_318 = .data:0x00000318; // type:object size:0x6 data:string
|
||||
lbl_1_data_31E = .data:0x0000031E; // type:object size:0x6 data:string
|
||||
lbl_1_data_324 = .data:0x00000324; // type:object size:0x6 data:string
|
||||
lbl_1_data_318 = .data:0x00000318; // type:object size:0x6 scope:local data:string
|
||||
lbl_1_data_31E = .data:0x0000031E; // type:object size:0x6 scope:local data:string
|
||||
lbl_1_data_324 = .data:0x00000324; // type:object size:0x6 scope:local data:string
|
||||
jumptable_1_data_32C = .data:0x0000032C; // type:object size:0x40 scope:local
|
||||
lbl_1_data_36C = .data:0x0000036C; // type:object size:0x20
|
||||
lbl_1_data_38C = .data:0x0000038C; // type:object size:0x20
|
||||
lbl_1_data_3AC = .data:0x000003AC; // type:object size:0x19 data:string
|
||||
lbl_1_data_3C5 = .data:0x000003C5; // type:object size:0x5 data:string
|
||||
lbl_1_data_3AC = .data:0x000003AC; // type:object size:0x19 scope:local data:string
|
||||
lbl_1_data_3C5 = .data:0x000003C5; // type:object size:0x5 scope:local data:string
|
||||
lbl_1_bss_0 = .bss:0x00000000; // type:object size:0x4 data:4byte
|
||||
lbl_1_bss_4 = .bss:0x00000004; // type:object size:0x8 scope:local data:float
|
||||
lbl_1_bss_C = .bss:0x0000000C; // type:object size:0x4 data:4byte
|
||||
|
|
|
|||
|
|
@ -5,12 +5,13 @@
|
|||
#include "game/objsub.h"
|
||||
#include "game/object.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
#define US_PER_60TH_SEC (1000000.0f / 60.0f)
|
||||
#define US_TO_60TH_SEC(us) ((us) / US_PER_60TH_SEC)
|
||||
#define FB_SIZE(width, height) width * height * 2
|
||||
#define ABS(x) ((x) < 0 ? -(x) : (x))
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
|
|
@ -44,4 +45,4 @@ omObjFunc2 fn_1_F9C;
|
|||
|
||||
#endif
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ static void fn_1_17E4(void)
|
|||
CharModelMotionShiftSet(char_tbl[j], mot_tbl[j][0], 0, 10, HU3D_MOTATTR_LOOP);
|
||||
}
|
||||
if (time <= 20) {
|
||||
Hu3DModelPosSet(player_mdl[j], player_pos[j].x, player_pos[j].y + (1000.0 * cos(M_PI * (time * 4.5f) / 180.0)), player_pos[j].z);
|
||||
Hu3DModelPosSet(player_mdl[j], player_pos[j].x, player_pos[j].y + 1000.0 * cosd(time * 4.5f), player_pos[j].z);
|
||||
time -= 10;
|
||||
if (time >= 0) {
|
||||
tplvl = 0.1 * time;
|
||||
|
|
@ -1081,7 +1081,7 @@ static void fn_1_50B0(ModelData *model, Mtx mtx)
|
|||
target.y = 415.0f;
|
||||
pos.x = (sind(lbl_1_bss_40[0].y) * cosd(lbl_1_bss_40[0].x) * lbl_1_bss_20[0]) + lbl_1_bss_28[0].x;
|
||||
pos.y = (-sind(lbl_1_bss_40[0].x) * lbl_1_bss_20[0]) + lbl_1_bss_28[0].y;
|
||||
pos.z = (cos(M_PI * lbl_1_bss_40[0].y / 180.0) * cosd(lbl_1_bss_40[0].x) * lbl_1_bss_20[0]) + lbl_1_bss_28[0].z;
|
||||
pos.z = (cosd(lbl_1_bss_40[0].y) * cosd(lbl_1_bss_40[0].x) * lbl_1_bss_20[0]) + lbl_1_bss_28[0].z;
|
||||
up.x = -sind(lbl_1_bss_40[0].y);
|
||||
up.z = -cosd(lbl_1_bss_40[0].y);
|
||||
up.y = 0;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "game/process.h"
|
||||
#include "game/object.h"
|
||||
#include "game/hsfdraw.h"
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
typedef struct unkDominationData2 {
|
||||
/* 0x00 */ s32 unk_00;
|
||||
|
|
@ -128,16 +128,16 @@ void fn_1_2024(omObjData* arg0) {
|
|||
}
|
||||
break;
|
||||
case 2:
|
||||
var_f31 = sin((M_PI * (90.0f * temp_r31->unk_44)) / 180.0);
|
||||
var_f31 = sind(90.0f * temp_r31->unk_44);
|
||||
break;
|
||||
case 3:
|
||||
var_f31 = sin((M_PI * (90.0f * temp_r31->unk_44)) / 180.0);
|
||||
var_f31 = sind(90.0f * temp_r31->unk_44);
|
||||
if (temp_r31->unk_48 > 0.5) {
|
||||
temp_r31->unk_00 = 4;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
var_f31 = sin((M_PI * (90.0f * temp_r31->unk_44)) / 180.0);
|
||||
var_f31 = sind(90.0f * temp_r31->unk_44);
|
||||
var_f31 *= var_f31;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -467,8 +467,8 @@ void fn_1_DB4(omObjData *arg0)
|
|||
temp_r31->unk_20++;
|
||||
}
|
||||
|
||||
temp_f31 = (32.0f * sin(1.0471975511965976)) - (9.8f * temp_r31->unk_24);
|
||||
temp_f30 = 22.0f * cos(1.0471975511965976);
|
||||
temp_f31 = 32.0f * sin(M_PI / 3) - 9.8f * temp_r31->unk_24;
|
||||
temp_f30 = 22.0f * cos(M_PI / 3);
|
||||
temp_r31->unk_18 = temp_r31->unk_18 + temp_f30;
|
||||
temp_r31->unk_14 = temp_r31->unk_14 + temp_f31;
|
||||
temp_r31->unk_24 += 0.3f;
|
||||
|
|
@ -514,7 +514,7 @@ void fn_1_1074(omObjData *arg0)
|
|||
temp_r31->unk_20 = 1;
|
||||
}
|
||||
|
||||
temp_r31->unk_14 = (temp_r31->unk_14 + ((80.0 * sin(1.5707963267948966)) - (9.8 * temp_r31->unk_24)));
|
||||
temp_r31->unk_14 += 80.0 * sin(M_PI / 2) - 9.8 * temp_r31->unk_24;
|
||||
temp_r31->unk_24 += 0.3f;
|
||||
|
||||
if (!(temp_r31->unk_14 < 1000.0f)) {
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ s8 fn_1_524(void)
|
|||
var_r30 = 1;
|
||||
}
|
||||
var_f30 = lbl_1_bss_2 / 300.0f;
|
||||
temp_f31 = (sin((M_PI * (90.0f * var_f30)) / 180.0) * sin((M_PI * (90.0f * var_f30)) / 180.0));
|
||||
temp_f31 = sind(90.0f * var_f30) * sind(90.0f * var_f30);
|
||||
CZoom = fn_1_4120(var_r31[0].zoom, var_r31[1].zoom, var_r31[2].zoom, temp_f31);
|
||||
Center.x = fn_1_4120(var_r31[0].center.x, var_r31[1].center.x, var_r31[2].center.x, temp_f31);
|
||||
Center.y = fn_1_4120(var_r31[0].center.y, var_r31[1].center.y, var_r31[2].center.y, temp_f31);
|
||||
|
|
@ -157,8 +157,8 @@ s8 fn_1_524(void)
|
|||
Hu3DTexScrollPosMoveSet(lbl_1_bss_24.unkC, -0.0001f - (0.005f * temp_f31), 0.0f, 0.0f);
|
||||
Hu3DTexScrollPosMoveSet(lbl_1_bss_24.unkE, -0.0002f - (0.005f * temp_f31), 0.0f, 0.0f);
|
||||
Hu3DTexScrollPosMoveSet(lbl_1_bss_24.unk10, -0.0003f - (0.005f * temp_f31), 0.0f, 0.0f);
|
||||
sp8.x = -(sin((M_PI * CRot.y) / 180.0) * cosd(CRot.x));
|
||||
sp8.y = sin((M_PI * CRot.x) / 180.0);
|
||||
sp8.x = -(sind(CRot.y) * cosd(CRot.x));
|
||||
sp8.y = sind(CRot.x);
|
||||
sp8.z = -(cosd(CRot.y) * cosd(CRot.x));
|
||||
HuAudFXListnerUpdate(&Hu3DCamera->pos, &sp8);
|
||||
return var_r30;
|
||||
|
|
@ -178,7 +178,7 @@ s8 fn_1_B80(void)
|
|||
var_r30 = 1;
|
||||
}
|
||||
temp_f30 = lbl_1_bss_4 / 60.0f;
|
||||
temp_f31 = (sin((M_PI * (90.0f * temp_f30)) / 180.0) * sin((M_PI * (90.0f * temp_f30)) / 180.0));
|
||||
temp_f31 = sind(90.0f * temp_f30) * sind(90.0f * temp_f30);
|
||||
CZoom = var_r31[0].zoom + (temp_f31 * (var_r31[1].zoom - var_r31[0].zoom));
|
||||
Center.x = var_r31[0].center.x + (temp_f31 * (var_r31[1].center.x - var_r31[0].center.x));
|
||||
Center.y = var_r31[0].center.y + (temp_f31 * (var_r31[1].center.y - var_r31[0].center.y));
|
||||
|
|
@ -300,20 +300,20 @@ s8 fn_1_10E8(omObjData *object)
|
|||
else if (lbl_1_bss_C > 0.2f) {
|
||||
lbl_1_bss_A = 1;
|
||||
}
|
||||
var_f31 = sin((M_PI * (90.0f * lbl_1_bss_C)) / 180.0);
|
||||
var_f31 = sind(90.0f * lbl_1_bss_C);
|
||||
var_f27 = 1520.0f;
|
||||
var_f26 = -1030.0f;
|
||||
temp_f30 = var_f27 + (var_f31 * (var_f26 - var_f27));
|
||||
Hu3DModelPosSet(lbl_1_bss_DC->model[4], temp_f30, 0.0f, -1200.0f);
|
||||
Hu3DModelPosSet(lbl_1_bss_DC->model[1], temp_f30, 0.0f, -1200.0f);
|
||||
if ((lbl_1_data_BC + 0x10000) != 0xFFFF) {
|
||||
if (lbl_1_data_BC != ~0) {
|
||||
sp8.x = temp_f30;
|
||||
sp8.y = 0.0f;
|
||||
sp8.z = -1200.0f;
|
||||
HuAudFXEmiterUpDate(lbl_1_data_BC, &sp8);
|
||||
}
|
||||
var_f31 = 1.2f * lbl_1_bss_C;
|
||||
if ((var_f31 >= 1.0f) && ((lbl_1_data_BC + 0x10000) != 0xFFFF)) {
|
||||
if ((var_f31 >= 1.0f) && lbl_1_data_BC != ~0) {
|
||||
HuAudFXEmiterPlay(0x555, &sp8);
|
||||
sp8.x += 200.0f;
|
||||
HuAudFXEmiterPlay(0x55E, &sp8);
|
||||
|
|
@ -324,7 +324,7 @@ s8 fn_1_10E8(omObjData *object)
|
|||
var_f31 = 0.0f;
|
||||
}
|
||||
else {
|
||||
var_f31 = sin((M_PI * (90.0f + (90.0f * var_f31))) / 180.0);
|
||||
var_f31 = sind(90.0f + 90.0f * var_f31);
|
||||
}
|
||||
Hu3DMotionSpeedSet(lbl_1_bss_DC->model[4], 2.0f * var_f31);
|
||||
if (lbl_1_bss_C > 0.5f) {
|
||||
|
|
@ -455,7 +455,7 @@ void fn_1_2098(omObjData *object)
|
|||
Hu3DModelAttrSet(lbl_1_bss_DC->model[4], HU3D_ATTR_DISPOFF);
|
||||
lbl_1_bss_18 = 1.0f;
|
||||
}
|
||||
var_f31 = sin((M_PI * (90.0f * lbl_1_bss_18)) / 180.0);
|
||||
var_f31 = sind(90.0f * lbl_1_bss_18);
|
||||
var_f29 = -1030.0f;
|
||||
var_f28 = -1880.0f;
|
||||
var_f30 = var_f29 + (var_f31 * (var_f28 - var_f29));
|
||||
|
|
@ -684,7 +684,7 @@ void fn_1_2DCC(omObjData *object)
|
|||
Hu3DModelAttrReset(var_r31->unk6, HU3D_ATTR_DISPOFF);
|
||||
}
|
||||
var_r31->unk10 += var_f30;
|
||||
var_f31 = sin((M_PI * (90.0f * var_r31->unk10)) / 180.0);
|
||||
var_f31 = sind(90.0f * var_r31->unk10);
|
||||
if (var_r31->unk10 >= 1.0f) {
|
||||
var_f31 = 1.0f;
|
||||
var_r31->unk10 = var_f31;
|
||||
|
|
@ -728,7 +728,7 @@ void fn_1_2DCC(omObjData *object)
|
|||
}
|
||||
Hu3DModelPosSet(var_r31->unk6, 70.0f + temp_r30->pos.x, 290.0f, -1200.0f);
|
||||
Hu3DData[var_r31->unk4].pos.x = temp_r30->pos.x;
|
||||
var_f31 = (0.800000011920929 * sin((M_PI * (180.0f * var_r31->unk10)) / 180.0));
|
||||
var_f31 = 0.8f * sind(180.0f * var_r31->unk10);
|
||||
Hu3DMotionSpeedSet(var_r31->unk2, var_f31);
|
||||
}
|
||||
}
|
||||
|
|
@ -948,7 +948,7 @@ void fn_1_44F0(s16 arg0, f32 arg8, f32 arg9, f32 argA, s8 arg1, s16 arg2)
|
|||
return;
|
||||
|
||||
temp_f31 = (((rand8() << 8) | rand8()) % 361);
|
||||
var_r31->unk0.x = (2.0 + (3.0 * sin((M_PI * temp_f31) / 180.0)));
|
||||
var_r31->unk0.x = 2.0 + (3.0 * sind(temp_f31));
|
||||
var_r31->unk0.y = (0.1f * ((((rand8() << 8) | rand8()) % 31) + 40));
|
||||
var_r31->unk0.z = (3.5 * cosd(temp_f31));
|
||||
var_r31->unk28 = 0;
|
||||
|
|
@ -1012,7 +1012,7 @@ void fn_1_4FFC(s16 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4)
|
|||
temp_f31 = ((((rand8() << 8) | rand8()) % 81) - 40);
|
||||
temp_r31->unk0.x = (13.0 * cosd(temp_f31));
|
||||
temp_r31->unk0.y = 0.1f * ((((rand8() << 8) | rand8()) % 21) + 20);
|
||||
temp_r31->unk0.z = (9.0 * sin((M_PI * temp_f31) / 180.0));
|
||||
temp_r31->unk0.z = (9.0 * sind(temp_f31));
|
||||
temp_r31->unkC.x = (0.05f * temp_r31->unk0.x);
|
||||
temp_r31->unkC.z = (0.05f * temp_r31->unk0.z);
|
||||
temp_r31->unk18 = 500.0f;
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ void ObjectSetup(void)
|
|||
temp_f29 = lbl_1_bss_268.y;
|
||||
temp_f31 = lbl_1_bss_268.z;
|
||||
lbl_1_bss_774 = sqrtf((temp_f31 * temp_f31) + ((temp_f30 * temp_f30) + (temp_f29 * temp_f29)));
|
||||
lbl_1_bss_778 = fn_1_1D08((180.0 * (atan2(temp_f30, temp_f31) / M_PI)));
|
||||
lbl_1_bss_77C = fn_1_1D08((180.0 * (atan2(temp_f29, temp_f31) / M_PI)));
|
||||
lbl_1_bss_778 = fn_1_1D08(atan2d(temp_f30, temp_f31));
|
||||
lbl_1_bss_77C = fn_1_1D08(atan2d(temp_f29, temp_f31));
|
||||
lbl_1_bss_77C = 50.0f;
|
||||
Hu3DLighInit();
|
||||
lbl_1_bss_7A0 = Hu3DGLightCreate(10000.0f, 0.0f, 10000.0f, -1.0f, 0.0f, -1.0f, 0xFFU, 0xFFU, 0xFFU);
|
||||
|
|
|
|||
|
|
@ -1156,9 +1156,9 @@ void fn_1_42AC(void)
|
|||
var_f23 = -200.0 * (cos(0.0) * cosd(lbl_1_bss_920[var_r27]));
|
||||
}
|
||||
else {
|
||||
var_f24 = -200.0 * (sind(lbl_1_bss_920[var_r27]) * cos(0.3490658503988659));
|
||||
var_f26 = 150.0 + (-200.0 * sin(-0.3490658503988659));
|
||||
var_f23 = -200.0 * (cos(-0.3490658503988659) * cosd(lbl_1_bss_920[var_r27]));
|
||||
var_f24 = -200.0 * (sind(lbl_1_bss_920[var_r27]) * cosd(20));
|
||||
var_f26 = 150.0 + -200.0 * sind(-20);
|
||||
var_f23 = -200.0 * (cosd(-20) * cosd(lbl_1_bss_920[var_r27]));
|
||||
}
|
||||
if (!lbl_1_bss_938[var_r30->unk_04]) {
|
||||
var_f26 += 70.0f;
|
||||
|
|
|
|||
|
|
@ -856,7 +856,7 @@ void fn_1_9C14(omObjData *object)
|
|||
return;
|
||||
}
|
||||
PSQUATNormalize(&var_r31->unk_194, &sp28);
|
||||
if (sp28.w < cos(0.4363323129985824)) {
|
||||
if (sp28.w < cosd(25)) {
|
||||
var_r31->unk_3C = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ void fn_1_3D58(omObjData *object)
|
|||
var_r28->y = 0.0f;
|
||||
var_r28->z = var_f29;
|
||||
}
|
||||
var_f29 += (var_f28 * sin(1.0471975511965976));
|
||||
var_f29 += var_f28 * sind(60);
|
||||
}
|
||||
var_r28 = lbl_1_bss_178.unk_2C;
|
||||
var_r30 = 0;
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ void fn_1_94D0(omObjData* arg0) {
|
|||
var_r31->unk170 = -1;
|
||||
var_r31->unk174 = lbl_1_data_30C;
|
||||
// @todo how did this happen
|
||||
var_r31->unk180 = (180.0 * (atan2(-102.864990234375, 424.559997558593750) / M_PI));
|
||||
var_r31->unk180 = atan2d(-102.864990234375, 424.559997558593750);
|
||||
if (var_r31->unk180 < 0.0f) {
|
||||
var_r31->unk180 += 360.0f;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1477,7 +1477,7 @@ s32 fn_1_6EC4(float var_f24, float sp8, s16 var_r22, s16 var_r24)
|
|||
var_r31->unk_18C[var_r30].x = -(sp24 * var_r31->unk_17C[var_r30].x);
|
||||
var_r31->unk_18C[var_r30].z = -(sp24 * var_r31->unk_17C[var_r30].z);
|
||||
var_r31->unk_18C[var_r30].y = 0.0;
|
||||
var_f27 = 180.0 + (180.0 * (atan2(var_r31->unk_17C[var_r30].x, var_r31->unk_17C[var_r30].z) / 3.141592653589793));
|
||||
var_f27 = 180.0 + atan2d(var_r31->unk_17C[var_r30].x, var_r31->unk_17C[var_r30].z);
|
||||
if (var_f27 > 360.0f) {
|
||||
var_f27 = fmod(var_f27, 360.0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ s32 fn_1_4A4(void)
|
|||
var_r30 = 1;
|
||||
}
|
||||
|
||||
var_f31 = (sin((M_PI * (90.0f * var_f31)) / 180.0) * sin((M_PI * (90.0f * var_f31)) / 180.0));
|
||||
var_f31 = sind(90.0f * var_f31) * sind(90.0f * var_f31);
|
||||
CZoom = fn_1_93C0(var_r31[0].zoom, var_r31[1].zoom, var_f31);
|
||||
Center.x = fn_1_93C0(var_r31[0].center.x, var_r31[1].center.x, var_f31);
|
||||
Center.y = fn_1_93C0(var_r31[0].center.y, var_r31[1].center.y, var_f31);
|
||||
|
|
@ -152,7 +152,7 @@ s32 fn_1_6C8(void)
|
|||
var_r30 = 1;
|
||||
}
|
||||
|
||||
var_f31 = (sin((M_PI * (90.0f * var_f31)) / 180.0) * sin((M_PI * (90.0f * var_f31)) / 180.0));
|
||||
var_f31 = (sind(90.0f * var_f31) * sind(90.0f * var_f31));
|
||||
CZoom = fn_1_93C0(var_r31[0].zoom, var_r31[1].zoom, var_f31);
|
||||
Center.x = fn_1_93C0(var_r31[0].center.x, var_r31[1].center.x, var_f31);
|
||||
Center.y = fn_1_93C0(var_r31[0].center.y, var_r31[1].center.y, var_f31);
|
||||
|
|
@ -282,7 +282,7 @@ u8 fn_1_E14(omObjData *arg0)
|
|||
var_f31 = 1.0f;
|
||||
var_r30 = 1;
|
||||
}
|
||||
var_f31 = (sin((M_PI * (90.0f * var_f31)) / 180.0) * sin((M_PI * (90.0f * var_f31)) / 180.0));
|
||||
var_f31 = (sind(90.0f * var_f31) * sind(90.0f * var_f31));
|
||||
CZoom = fn_1_93C0(var_r31[0].zoom, var_r31[1].zoom, var_f31);
|
||||
Center.x = fn_1_93C0(var_r31[0].center.x, var_r31[1].center.x, var_f31);
|
||||
Center.y = fn_1_93C0(var_r31[0].center.y, var_r31[1].center.y, var_f31);
|
||||
|
|
@ -338,7 +338,7 @@ u8 fn_1_1138(omObjData *object)
|
|||
var_f31 = 1.0f;
|
||||
var_r28 = 1;
|
||||
}
|
||||
var_f31 = (sin((M_PI * (90.0f * var_f31)) / 180.0) * sin((M_PI * (90.0f * var_f31)) / 180.0));
|
||||
var_f31 = (sind(90.0f * var_f31) * sind(90.0f * var_f31));
|
||||
CZoom = fn_1_93C0(var_r31[0].zoom, var_r31[1].zoom, var_f31);
|
||||
Center.x = fn_1_93C0(var_r31[0].center.x, var_r31[1].center.x, var_f31);
|
||||
Center.y = fn_1_93C0(var_r31[0].center.y, var_r31[1].center.y, var_f31);
|
||||
|
|
@ -628,8 +628,8 @@ void fn_1_2470(omObjData *arg0)
|
|||
Hu3DModelShadowMapSet(arg0->model[0]);
|
||||
|
||||
for (var_r30 = 0; var_r30 < 5; var_r30++) {
|
||||
temp_f31 = (450.0 * cos(M_PI * lbl_1_data_0[var_r30] / 180.0));
|
||||
var_f29 = (450.0 * sin(M_PI * lbl_1_data_0[var_r30] / 180.0));
|
||||
temp_f31 = 450.0 * cosd(lbl_1_data_0[var_r30]);
|
||||
var_f29 = 450.0 * sind(lbl_1_data_0[var_r30]);
|
||||
Hu3DModelPosSet(arg0->model[var_r30 + 4], temp_f31, 0.0f, var_f29);
|
||||
var_f30 = 90.0f - lbl_1_data_0[var_r30];
|
||||
Hu3DModelRotSet(arg0->model[var_r30 + 4], 0.0f, var_f30, 0.0f);
|
||||
|
|
@ -705,7 +705,7 @@ void fn_1_2B04(omObjData *object)
|
|||
fn_1_4EEC(0x20, 0);
|
||||
return;
|
||||
}
|
||||
temp_f31 = sin((M_PI * (90.0f * temp_f31)) / 180.0);
|
||||
temp_f31 = sind(90.0f * temp_f31);
|
||||
temp_r31->center.y = (250.0f + (1750.0f * temp_f31));
|
||||
}
|
||||
Hu3DModelPosSet(object->model[3], temp_r31->center.x, temp_r31->center.y, temp_r31->center.z);
|
||||
|
|
@ -764,7 +764,7 @@ void fn_1_2D28(omObjData *object)
|
|||
if ((11 * REFRESH_RATE_F / 6) == lbl_1_data_F0[0]) {
|
||||
HuAudFXPlay(0x70A);
|
||||
}
|
||||
var_f31 = sin((M_PI * (90.0f * var_f31)) / 180.0);
|
||||
var_f31 = sind(90.0f * var_f31);
|
||||
temp_r31->center.y = (2000.0f + (-1750.0f * var_f31));
|
||||
break;
|
||||
case 0x2:
|
||||
|
|
@ -811,7 +811,7 @@ void fn_1_2D28(omObjData *object)
|
|||
fn_1_4EEC(7, 2);
|
||||
return;
|
||||
}
|
||||
var_f31 = sin((M_PI * (90.0f * var_f31)) / 180.0);
|
||||
var_f31 = sind(90.0f * var_f31);
|
||||
temp_r31->center.y = (250.0f + (1750.0f * var_f31));
|
||||
break;
|
||||
case 0x63:
|
||||
|
|
@ -1030,7 +1030,7 @@ void fn_1_46E0(omObjData *object)
|
|||
fn_1_4EEC(0x18, 0x10);
|
||||
HuAudFXPlay(0x70F);
|
||||
}
|
||||
var_f31 = sin((M_PI * (90.0f * var_f31)) / 180.0);
|
||||
var_f31 = sind(90.0f * var_f31);
|
||||
temp_r31->unk24 = (150.0f * var_f31);
|
||||
break;
|
||||
case 0x63:
|
||||
|
|
@ -1090,7 +1090,7 @@ void fn_1_4B44(omObjData *object)
|
|||
lbl_1_data_108[0] = 0;
|
||||
lbl_1_data_104[0]++;
|
||||
}
|
||||
var_f31 = sin((M_PI * (90.0f * var_f31)) / 180.0);
|
||||
var_f31 = sind(90.0f * var_f31);
|
||||
temp_r31->unk24 = (150.0f + (-150.0f * var_f31));
|
||||
break;
|
||||
case 1:
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ void fn_1_B884(omObjData *arg0, unkObjStruct *arg1)
|
|||
arg1->unk18.z = (700.0 * sind(lbl_1_data_250));
|
||||
var_f29 = (arg1->unk18.x - arg1->unk24.x);
|
||||
var_f28 = (arg1->unk18.z - arg1->unk24.z);
|
||||
var_f30 = (180.0 * (atan2(var_f29, var_f28) / M_PI));
|
||||
var_f30 = atan2d(var_f29, var_f28);
|
||||
if (var_f30 < 0.0f) {
|
||||
var_f30 += 360.0f;
|
||||
}
|
||||
|
|
@ -310,7 +310,7 @@ void fn_1_B884(omObjData *arg0, unkObjStruct *arg1)
|
|||
arg1->unk18.z = (arg1->unk5C * sind(lbl_1_data_250));
|
||||
var_f29 = (arg1->unk18.x - arg1->unk24.x);
|
||||
var_f28 = (arg1->unk18.z - arg1->unk24.z);
|
||||
var_f30 = (180.0 * (atan2(var_f29, var_f28) / M_PI));
|
||||
var_f30 = atan2d(var_f29, var_f28);
|
||||
if (var_f30 < 0.0f) {
|
||||
var_f30 += 360.0f;
|
||||
}
|
||||
|
|
@ -551,7 +551,7 @@ void fn_1_C944(omObjData *arg0, unkObjStruct *arg1)
|
|||
arg1->unk48 = arg1->unk48 & ~4;
|
||||
var_f26 = (arg1->unk18.x - arg1->unk24.x);
|
||||
var_f25 = (arg1->unk18.z - arg1->unk24.z);
|
||||
var_f29 = (180.0 * (atan2(var_f26, var_f25) / M_PI));
|
||||
var_f29 = atan2d(var_f26, var_f25);
|
||||
if (var_f29 < 0.0f) {
|
||||
var_f29 += 360.0f;
|
||||
}
|
||||
|
|
@ -920,7 +920,7 @@ void fn_1_E034(omObjData *arg0, unkObjStruct *arg1)
|
|||
arg1->unk18.z = (arg1->unk5C * sind(lbl_1_bss_84));
|
||||
var_f29 = (arg1->unk18.x - arg1->unk24.x);
|
||||
var_f28 = (arg1->unk18.z - arg1->unk24.z);
|
||||
var_f30 = (180.0 * (atan2(var_f29, var_f28) / M_PI));
|
||||
var_f30 = atan2d(var_f29, var_f28);
|
||||
if (var_f30 < 0.0f) {
|
||||
var_f30 += 360.0f;
|
||||
}
|
||||
|
|
@ -949,8 +949,8 @@ void fn_1_E034(omObjData *arg0, unkObjStruct *arg1)
|
|||
arg1->unk60++;
|
||||
}
|
||||
var_f29 = arg1->unk5C + ((700.0f - arg1->unk5C) * var_f31);
|
||||
arg1->unk18.x = (var_f29 * cos(2.356194490192345)); // atan2(1.0, -1.0)
|
||||
arg1->unk18.z = (var_f29 * sin(2.356194490192345));
|
||||
arg1->unk18.x = var_f29 * cosd(135);
|
||||
arg1->unk18.z = var_f29 * sind(135);
|
||||
var_f29 = 0.3f;
|
||||
var_f28 = 0.6f;
|
||||
if (var_f31 >= var_f29) {
|
||||
|
|
@ -978,7 +978,7 @@ void fn_1_E034(omObjData *arg0, unkObjStruct *arg1)
|
|||
arg1->unk18.z = (700.0 * sind(lbl_1_bss_84));
|
||||
var_f29 = (arg1->unk18.x - arg1->unk24.x);
|
||||
var_f28 = (arg1->unk18.z - arg1->unk24.z);
|
||||
var_f30 = (180.0 * (atan2(var_f29, var_f28) / M_PI));
|
||||
var_f30 = atan2d(var_f29, var_f28);
|
||||
if (var_f30 < 0.0f) {
|
||||
var_f30 += 360.0f;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -355,8 +355,8 @@ void fn_1_5BD4(omObjData *object)
|
|||
var_f30 = 0.0f;
|
||||
}
|
||||
var_f30 = var_f30 * var_f30;
|
||||
sp8.x = 320.0 + (160.0 * (var_f31 * cos(M_PI * ((450.0f * var_f31) + (90.0f * object->work[0])) / 180.0)));
|
||||
sp8.y = 240.0 + (120.0 * (var_f31 * sin(M_PI * ((450.0f * var_f31) + (90.0f * object->work[0])) / 180.0)));
|
||||
sp8.x = 320.0 + 160.0 * (var_f31 * cosd(450.0f * var_f31 + 90.0f * object->work[0]));
|
||||
sp8.y = 240.0 + 120.0 * (var_f31 * sind(450.0f * var_f31 + 90.0f * object->work[0]));
|
||||
temp_r31->unk100->unk_44 = sp8.x + (var_f30 * (temp_r31->unk100->unk_78 - sp8.x));
|
||||
temp_r31->unk100->unk_48 = sp8.y + (var_f30 * (temp_r31->unk100->unk_7C - sp8.y));
|
||||
temp_r31->unk100->unk_40 = 0.01f + ((temp_r31->unk100->unk_80 - 0.01f) * var_f31);
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ void fn_1_D9F4(s16 arg0)
|
|||
sp10.y = 1.0f;
|
||||
C_MTXLookAt(sp34, &sp28, &sp10, &sp1C);
|
||||
GXLoadPosMtxImm(sp34, 0);
|
||||
sp28.x = 1.2000000476837158 * (10000.0 * -sin(var_r31->fov / 2));
|
||||
sp28.y = 0.8333333134651184 * (10000.0 * -sin(var_r31->fov / 2));
|
||||
sp28.x = 1.2f * (10000.0 * -sin(var_r31->fov / 2));
|
||||
sp28.y = (2.5f / 3) * (10000.0 * -sin(var_r31->fov / 2));
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
GXPosition3f32(-sp28.x, -sp28.y, -10000.0f);
|
||||
GXPosition3f32(sp28.x, -sp28.y, -10000.0f);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ void fn_1_68DC(void) {
|
|||
f32 temp_f31;
|
||||
|
||||
if (lbl_1_bss_38 != 0) {
|
||||
temp_f31 = sin((M_PI * (90.0f * lbl_1_bss_40)) / 180.0);
|
||||
temp_f31 = sind(90.0f * lbl_1_bss_40);
|
||||
temp_f31 *= temp_f31;
|
||||
lbl_1_bss_8C.x = lbl_1_bss_54.x + (temp_f31 * (lbl_1_bss_70.x - lbl_1_bss_54.x));
|
||||
lbl_1_bss_8C.y = lbl_1_bss_54.y + (temp_f31 * (lbl_1_bss_70.y - lbl_1_bss_54.y));
|
||||
|
|
@ -138,4 +138,4 @@ void fn_1_709C(void) {
|
|||
print8(0x20, 0x84, 1.5f, "LOOKAT : x=%.2f y=%.2f z=%.2f", lbl_1_bss_8C.x, lbl_1_bss_8C.y, lbl_1_bss_8C.z);
|
||||
print8(0x20, 0x94, 1.5f, "ANGLE : x=%.2f y=%.2f z=%.2f", lbl_1_bss_80.x, lbl_1_bss_80.y, lbl_1_bss_80.z);
|
||||
print8(0x20, 0xA4, 1.5f, "ZOOM : %.2f", lbl_1_bss_7C);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "REL/m446Dll.h"
|
||||
|
||||
#include "game/hsfman.h"
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
// data
|
||||
m446Func4 lbl_1_data_150[3] = { NULL, fn_1_2AA8, fn_1_2DA8 };
|
||||
|
|
@ -229,7 +229,7 @@ void fn_1_20D4(void)
|
|||
temp_r31->unk7C--;
|
||||
}
|
||||
else {
|
||||
temp_f31 = sin((M_PI * (90.0f * temp_r31->unk80)) / 180.0);
|
||||
temp_f31 = sind(90.0f * temp_r31->unk80);
|
||||
temp_r31->unk10.x = temp_r31->unk1C.x + (temp_f31 * (temp_r31->unk28.x - temp_r31->unk1C.x));
|
||||
temp_r31->unk10.y = temp_r31->unk1C.y + (temp_f31 * (temp_r31->unk28.y - temp_r31->unk1C.y));
|
||||
temp_r31->unk10.z = temp_r31->unk1C.z + (temp_f31 * (temp_r31->unk28.z - temp_r31->unk1C.z));
|
||||
|
|
@ -243,7 +243,7 @@ void fn_1_20D4(void)
|
|||
}
|
||||
}
|
||||
if (temp_r31->unk74 != 0) {
|
||||
temp_f31 = sin((M_PI * (90.0f * temp_r31->unk88)) / 180.0);
|
||||
temp_f31 = sind(90.0f * temp_r31->unk88);
|
||||
temp_r31->unk34.x = (temp_r31->unk40.x + (temp_f31 * (temp_r31->unk4C.x - temp_r31->unk40.x)));
|
||||
temp_r31->unk34.y = (temp_r31->unk40.y + (temp_f31 * (temp_r31->unk4C.y - temp_r31->unk40.y)));
|
||||
temp_r31->unk34.z = (temp_r31->unk40.z + (temp_f31 * (temp_r31->unk4C.z - temp_r31->unk40.z)));
|
||||
|
|
@ -256,7 +256,7 @@ void fn_1_20D4(void)
|
|||
}
|
||||
}
|
||||
if (temp_r31->unk78 != 0) {
|
||||
temp_f31 = sin((M_PI * (90.0f * temp_r31->unk90)) / 180.0);
|
||||
temp_f31 = sind(90.0f * temp_r31->unk90);
|
||||
temp_r31->unk58 = (temp_r31->unk5C + (temp_f31 * (temp_r31->unk60 - temp_r31->unk5C)));
|
||||
temp_r31->unk90 = (temp_r31->unk90 + temp_r31->unk94);
|
||||
if (temp_r31->unk90 >= 1.0f) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "game/hsfman.h"
|
||||
#include "game/hsfmotion.h"
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
// bss
|
||||
unkStruct3 *lbl_1_bss_98;
|
||||
|
|
@ -42,7 +42,7 @@ void fn_1_7350(void)
|
|||
do {
|
||||
temp_r31 = var_r30->unk0;
|
||||
if (temp_r31->field00_bit1 != 0) {
|
||||
temp_f31 = sin((M_PI * (90.0f * temp_r31->unk4C)) / 180.0);
|
||||
temp_f31 = sind(90.0f * temp_r31->unk4C);
|
||||
temp_f31 *= temp_f31;
|
||||
temp_r31->unk20.x = (temp_r31->unk2C.x + (temp_f31 * (temp_r31->unk38.x - temp_r31->unk2C.x)));
|
||||
temp_r31->unk20.y = (temp_r31->unk2C.y + (temp_f31 * (temp_r31->unk38.y - temp_r31->unk2C.y)));
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "game/hsfmotion.h"
|
||||
#include "game/objsub.h"
|
||||
#include "game/pad.h"
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
// cursor.c
|
||||
extern unkStruct7 *m446CursorCreate(s32);
|
||||
|
|
@ -122,7 +122,7 @@ void fn_1_487C(void)
|
|||
lbl_1_data_2DC[temp_r31->unk18](temp_r31);
|
||||
}
|
||||
if (temp_r31->unkB4 != 0) {
|
||||
temp_f31 = sin((M_PI * (90.0f * temp_r31->unkC0)) / 180.0);
|
||||
temp_f31 = sind(90.0f * temp_r31->unkC0);
|
||||
temp_f31 *= temp_f31;
|
||||
temp_r31->unk48.x = (temp_r31->unk9C.x + (temp_f31 * (temp_r31->unkA8.x - temp_r31->unk9C.x)));
|
||||
temp_r31->unk48.y = (temp_r31->unk9C.y + (temp_f31 * (temp_r31->unkA8.y - temp_r31->unk9C.y)));
|
||||
|
|
@ -136,7 +136,7 @@ void fn_1_487C(void)
|
|||
}
|
||||
}
|
||||
if (temp_r31->unk98 != 0) {
|
||||
temp_f31 = sin((M_PI * (90.0f * temp_r31->unkB8)) / 180.0);
|
||||
temp_f31 = sind(90.0f * temp_r31->unkB8);
|
||||
temp_f31 *= temp_f31;
|
||||
temp_r31->unk54.x = (temp_r31->unk80.x + (temp_f31 * (temp_r31->unk8C.x - temp_r31->unk80.x)));
|
||||
temp_r31->unk54.y = (temp_r31->unk80.y + (temp_f31 * (temp_r31->unk8C.y - temp_r31->unk80.y)));
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ f32 fn_1_254(f32 arg8, f32 arg9, f32 argA, f32 argB)
|
|||
if (argA >= argB) {
|
||||
return arg9;
|
||||
}
|
||||
return (arg8 + ((arg9 - arg8) * (1.0 - cos((M_PI * ((90.0f / argB) * argA)) / 180.0))));
|
||||
return (arg8 + ((arg9 - arg8) * (1.0 - cosd((90.0f / argB) * argA))));
|
||||
}
|
||||
|
||||
// fn_1_32C
|
||||
|
|
@ -118,7 +118,7 @@ f32 fn_1_32C(f32 arg8, f32 arg9, f32 argA, f32 argB)
|
|||
if (argA >= argB) {
|
||||
return arg9;
|
||||
}
|
||||
return (arg8 + ((arg9 - arg8) * sin((M_PI * ((90.0f / argB) * argA)) / 180.0)));
|
||||
return arg8 + (arg9 - arg8) * sind((90.0f / argB) * argA);
|
||||
}
|
||||
|
||||
f32 fn_1_3F4(f32 arg8, f32 arg9, f32 argA, f32 argB)
|
||||
|
|
@ -126,7 +126,7 @@ f32 fn_1_3F4(f32 arg8, f32 arg9, f32 argA, f32 argB)
|
|||
if (argA >= argB) {
|
||||
return arg8;
|
||||
}
|
||||
return (arg8 + ((arg9 - arg8) * sin((M_PI * ((360.0f / argB) * argA)) / 180.0)));
|
||||
return (arg8 + ((arg9 - arg8) * sind((360.0f / argB) * argA)));
|
||||
}
|
||||
|
||||
void fn_1_4B0(s32 arg0)
|
||||
|
|
|
|||
|
|
@ -11,10 +11,8 @@
|
|||
#include "game/sprite.h"
|
||||
#include "game/window.h"
|
||||
#include "game/wipe.h"
|
||||
#include "math.h"
|
||||
|
||||
#include "REL/modeltestDll.h"
|
||||
#include "math.h"
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
|
|
@ -311,7 +309,7 @@ void fn_1_29C(omObjData *arg0)
|
|||
Hu3DParManAttrSet(lbl_1_bss_864[var_r31], 0x864);
|
||||
Hu3DParticleBlendModeSet(Hu3DParManModelIDGet(lbl_1_bss_864[var_r31]), 1U);
|
||||
Hu3DParManPosSet(
|
||||
lbl_1_bss_864[var_r31], (100.0 * sin((M_PI * (36.0f * var_r31)) / 180.0)), 0.0f, 100.0 * cos((M_PI * (36.0f * var_r31)) / 180.0));
|
||||
lbl_1_bss_864[var_r31], (100.0 * sind(36.0f * var_r31)), 0.0f, 100.0 * cosd(36.0f * var_r31));
|
||||
Hu3DParManRotSet(lbl_1_bss_864[var_r31], -90.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
|
|
@ -465,28 +463,28 @@ void fn_1_F9C(struct om_obj_data *omData)
|
|||
}
|
||||
}
|
||||
|
||||
sp3C.x = Center.x + (CZoom * (sin((M_PI * CRot.y) / 180.0) * cos((M_PI * CRot.x) / 180.0)));
|
||||
sp3C.y = (Center.y + (CZoom * -sin((M_PI * CRot.x) / 180.0)));
|
||||
sp3C.z = (Center.z + (CZoom * (cos((M_PI * CRot.y) / 180.0) * cos((M_PI * CRot.x) / 180.0))));
|
||||
sp3C.x = Center.x + CZoom * (sind(CRot.y) * cosd(CRot.x));
|
||||
sp3C.y = Center.y + CZoom * -sind(CRot.x);
|
||||
sp3C.z = Center.z + CZoom * (cosd(CRot.y) * cosd(CRot.x));
|
||||
sp30.x = Center.x - sp3C.x;
|
||||
sp30.y = Center.y - sp3C.y;
|
||||
sp30.z = Center.z - sp3C.z;
|
||||
sp24.x = (sin((M_PI * CRot.y) / 180.0) * sin((M_PI * CRot.x) / 180.0));
|
||||
sp24.y = cos((M_PI * CRot.x) / 180.0);
|
||||
sp24.z = (cos((M_PI * CRot.y) / 180.0) * sin((M_PI * CRot.x) / 180.0));
|
||||
sp24.x = sind(CRot.y) * sind(CRot.x);
|
||||
sp24.y = cosd(CRot.x);
|
||||
sp24.z = cosd(CRot.y) * sind(CRot.x);
|
||||
temp_f31 = CRot.z;
|
||||
|
||||
sp18.x = sp24.x * (sp30.x * sp30.x + (1.0f - sp30.x * sp30.x) * cos((M_PI * temp_f31) / 180.0))
|
||||
+ sp24.y * (sp30.x * sp30.y * (1.0f - cos((M_PI * temp_f31) / 180.0)) - sp30.z * sin((M_PI * temp_f31) / 180.0))
|
||||
+ sp24.z * (sp30.x * sp30.z * (1.0f - cos((M_PI * temp_f31) / 180.0)) + sp30.y * sin((M_PI * temp_f31) / 180.0));
|
||||
sp18.x = sp24.x * (sp30.x * sp30.x + (1.0f - sp30.x * sp30.x) * cosd(temp_f31))
|
||||
+ sp24.y * (sp30.x * sp30.y * (1.0f - cosd(temp_f31)) - sp30.z * sind(temp_f31))
|
||||
+ sp24.z * (sp30.x * sp30.z * (1.0f - cosd(temp_f31)) + sp30.y * sind(temp_f31));
|
||||
|
||||
sp18.y = sp24.y * (sp30.y * sp30.y + (1.0f - sp30.y * sp30.y) * cos((M_PI * temp_f31) / 180.0))
|
||||
+ sp24.x * (sp30.x * sp30.y * (1.0f - cos((M_PI * temp_f31) / 180.0)) + sp30.z * sin((M_PI * temp_f31) / 180.0))
|
||||
+ sp24.z * (sp30.y * sp30.z * (1.0f - cos((M_PI * temp_f31) / 180.0)) - sp30.x * sin((M_PI * temp_f31) / 180.0));
|
||||
sp18.y = sp24.y * (sp30.y * sp30.y + (1.0f - sp30.y * sp30.y) * cosd(temp_f31))
|
||||
+ sp24.x * (sp30.x * sp30.y * (1.0f - cosd(temp_f31)) + sp30.z * sind(temp_f31))
|
||||
+ sp24.z * (sp30.y * sp30.z * (1.0f - cosd(temp_f31)) - sp30.x * sind(temp_f31));
|
||||
|
||||
sp18.z = sp24.z * (sp30.z * sp30.z + (1.0f - sp30.z * sp30.z) * cos((M_PI * temp_f31) / 180.0))
|
||||
+ (sp24.x * (sp30.x * sp30.z * (1.0 - cos((M_PI * temp_f31) / 180.0)) - sp30.y * sin((M_PI * temp_f31) / 180.0))
|
||||
+ sp24.y * (sp30.y * sp30.z * (1.0 - cos((M_PI * temp_f31) / 180.0)) + sp30.x * sin((M_PI * temp_f31) / 180.0)));
|
||||
sp18.z = sp24.z * (sp30.z * sp30.z + (1.0f - sp30.z * sp30.z) * cosd(temp_f31))
|
||||
+ (sp24.x * (sp30.x * sp30.z * (1.0 - cosd(temp_f31)) - sp30.y * sind(temp_f31))
|
||||
+ sp24.y * (sp30.y * sp30.z * (1.0 - cosd(temp_f31)) + sp30.x * sind(temp_f31)));
|
||||
|
||||
VECCrossProduct(&sp24, &sp30, &sp30);
|
||||
VECNormalize(&sp30, &sp30);
|
||||
|
|
@ -603,11 +601,11 @@ void fn_1_20F4(void)
|
|||
Hu3DMtxTransGet(spC0, &sp18);
|
||||
PSMTXMultVec(sp60, &sp18, &sp18);
|
||||
|
||||
temp_f27 = 180.0 * (atan2(sp18.z, sp18.x) / M_PI);
|
||||
temp_f27 = atan2d(sp18.z, sp18.x);
|
||||
temp_r31 = &lbl_1_bss_40[var_r29 * 2];
|
||||
temp_r31->obj->data.curr.rot.x = temp_r31->rot.x + (var_f29 * (2.0 * (sin((M_PI * temp_f27) / 180.0) * sin((M_PI * var_r27) / 180.0))));
|
||||
temp_r31->obj->data.curr.rot.x = temp_r31->rot.x + (var_f29 * (2.0 * (sind(temp_f27) * sind(var_r27))));
|
||||
temp_r31->obj->data.curr.rot.y = temp_r31->rot.y;
|
||||
temp_r31->obj->data.curr.rot.z = temp_r31->rot.z + (var_f29 * cos((M_PI * var_r27) / 180.0));
|
||||
temp_r31->obj->data.curr.rot.z = temp_r31->rot.z + (var_f29 * cosd(var_r27));
|
||||
|
||||
Hu3DModelObjMtxGet(temp_r3, lbl_1_data_D8[(var_r29 * 2) + 1], spC0);
|
||||
Hu3DMtxTransGet(spC0, &sp24);
|
||||
|
|
@ -632,7 +630,7 @@ void fn_1_20F4(void)
|
|||
var_f29 = 0.0f;
|
||||
}
|
||||
else {
|
||||
var_r27 = 180.0 * (atan2(HuPadSubStkX[1], HuPadSubStkY[1]) / M_PI);
|
||||
var_r27 = atan2d(HuPadSubStkX[1], HuPadSubStkY[1]);
|
||||
temp_f30 = (HuPadSubStkX[1] * HuPadSubStkX[1]) + (HuPadSubStkY[1] * HuPadSubStkY[1]);
|
||||
var_f29 = sqrtf(temp_f30);
|
||||
if (var_f29 > 80.0f) {
|
||||
|
|
@ -658,8 +656,8 @@ void fn_1_28F8(Point3d *arg0, Point3d *arg1)
|
|||
C_MTXLookAt(sp18, &cam->pos, &cam->up, &cam->target);
|
||||
PSMTXMultVec(sp18, arg0, &spC);
|
||||
|
||||
temp_f31 = (1.2f * (spC.z * (sin((M_PI * (cam->fov / 2)) / 180.0) / (cos((M_PI * (cam->fov / 2)) / 180.0)))));
|
||||
temp_f30 = (spC.z * (sin((M_PI * (cam->fov / 2)) / 180.0) / (cos((M_PI * (cam->fov / 2)) / 180.0))));
|
||||
temp_f31 = (1.2f * (spC.z * (sind(cam->fov / 2) / (cosd(cam->fov / 2)))));
|
||||
temp_f30 = (spC.z * (sind(cam->fov / 2) / (cosd(cam->fov / 2))));
|
||||
arg1->x = 288.0f + (spC.x * (288.0f / -temp_f31));
|
||||
arg1->y = 240.0f + (spC.y * (240.0f / temp_f30));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,28 +103,28 @@ void fn_1_37DC(omObjData *)
|
|||
CZoom += HuPadTrigL[0] / 2;
|
||||
CZoom -= HuPadTrigR[0] / 2;
|
||||
|
||||
sp3C.x = Center.x + (CZoom * (sin((M_PI * CRot.y) / 180.0) * cos((M_PI * CRot.x) / 180.0)));
|
||||
sp3C.y = (Center.y + (CZoom * -sin((M_PI * CRot.x) / 180.0)));
|
||||
sp3C.z = (Center.z + (CZoom * (cos((M_PI * CRot.y) / 180.0) * cos((M_PI * CRot.x) / 180.0))));
|
||||
sp3C.x = Center.x + CZoom * (sind(CRot.y) * cosd(CRot.x));
|
||||
sp3C.y = Center.y + CZoom * -sind(CRot.x);
|
||||
sp3C.z = Center.z + CZoom * (cosd(CRot.y) * cosd(CRot.x));
|
||||
sp30.x = Center.x - sp3C.x;
|
||||
sp30.y = Center.y - sp3C.y;
|
||||
sp30.z = Center.z - sp3C.z;
|
||||
sp24.x = (sin((M_PI * CRot.y) / 180.0) * sin((M_PI * CRot.x) / 180.0));
|
||||
sp24.y = cos((M_PI * CRot.x) / 180.0);
|
||||
sp24.z = (cos((M_PI * CRot.y) / 180.0) * sin((M_PI * CRot.x) / 180.0));
|
||||
sp24.x = sind(CRot.y) * sind(CRot.x);
|
||||
sp24.y = cosd(CRot.x);
|
||||
sp24.z = cosd(CRot.y) * sind(CRot.x);
|
||||
temp_f31 = CRot.z;
|
||||
|
||||
sp18.x = sp24.x * (sp30.x * sp30.x + (1.0f - sp30.x * sp30.x) * cos((M_PI * temp_f31) / 180.0))
|
||||
+ sp24.y * (sp30.x * sp30.y * (1.0f - cos((M_PI * temp_f31) / 180.0)) - sp30.z * sin((M_PI * temp_f31) / 180.0))
|
||||
+ sp24.z * (sp30.x * sp30.z * (1.0f - cos((M_PI * temp_f31) / 180.0)) + sp30.y * sin((M_PI * temp_f31) / 180.0));
|
||||
sp18.x = sp24.x * (sp30.x * sp30.x + (1.0f - sp30.x * sp30.x) * cosd(temp_f31))
|
||||
+ sp24.y * (sp30.x * sp30.y * (1.0f - cosd(temp_f31)) - sp30.z * sind(temp_f31))
|
||||
+ sp24.z * (sp30.x * sp30.z * (1.0f - cosd(temp_f31)) + sp30.y * sind(temp_f31));
|
||||
|
||||
sp18.y = sp24.y * (sp30.y * sp30.y + (1.0f - sp30.y * sp30.y) * cos((M_PI * temp_f31) / 180.0))
|
||||
+ sp24.x * (sp30.x * sp30.y * (1.0f - cos((M_PI * temp_f31) / 180.0)) + sp30.z * sin((M_PI * temp_f31) / 180.0))
|
||||
+ sp24.z * (sp30.y * sp30.z * (1.0f - cos((M_PI * temp_f31) / 180.0)) - sp30.x * sin((M_PI * temp_f31) / 180.0));
|
||||
sp18.y = sp24.y * (sp30.y * sp30.y + (1.0f - sp30.y * sp30.y) * cosd(temp_f31))
|
||||
+ sp24.x * (sp30.x * sp30.y * (1.0f - cosd(temp_f31)) + sp30.z * sind(temp_f31))
|
||||
+ sp24.z * (sp30.y * sp30.z * (1.0f - cosd(temp_f31)) - sp30.x * sind(temp_f31));
|
||||
|
||||
sp18.z = sp24.z * (sp30.z * sp30.z + (1.0f - sp30.z * sp30.z) * cos((M_PI * temp_f31) / 180.0))
|
||||
+ (sp24.x * (sp30.x * sp30.z * (1.0 - cos((M_PI * temp_f31) / 180.0)) - sp30.y * sin((M_PI * temp_f31) / 180.0))
|
||||
+ sp24.y * (sp30.y * sp30.z * (1.0 - cos((M_PI * temp_f31) / 180.0)) + sp30.x * sin((M_PI * temp_f31) / 180.0)));
|
||||
sp18.z = sp24.z * (sp30.z * sp30.z + (1.0f - sp30.z * sp30.z) * cosd(temp_f31))
|
||||
+ (sp24.x * (sp30.x * sp30.z * (1.0 - cosd(temp_f31)) - sp30.y * sind(temp_f31))
|
||||
+ sp24.y * (sp30.y * sp30.z * (1.0 - cosd(temp_f31)) + sp30.x * sind(temp_f31)));
|
||||
|
||||
VECCrossProduct(&sp24, &sp30, &sp30);
|
||||
VECNormalize(&sp30, &sp30);
|
||||
|
|
@ -148,17 +148,17 @@ void fn_1_439C(omObjData * )
|
|||
temp_f31 = CRot.x;
|
||||
temp_f30 = CRot.y + (var_r31 * 90);
|
||||
sp10 = CRot.z;
|
||||
sp2C.x = Center.x + (CZoom * (sin((M_PI * temp_f30) / 180.0) * (cos((M_PI * temp_f31) / 180.0))));
|
||||
sp2C.y = Center.y + (CZoom * -sin((M_PI * temp_f31) / 180.0));
|
||||
sp2C.z = Center.z + (CZoom * (cos((M_PI * temp_f30) / 180.0) * (cos((M_PI * temp_f31) / 180.0))));
|
||||
sp2C.x = Center.x + CZoom * (sind(temp_f30) * (cosd(temp_f31)));
|
||||
sp2C.y = Center.y + CZoom * -sind(temp_f31);
|
||||
sp2C.z = Center.z + CZoom * (cosd(temp_f30) * (cosd(temp_f31)));
|
||||
|
||||
sp20.x = Center.x;
|
||||
sp20.y = Center.y;
|
||||
sp20.z = Center.z;
|
||||
|
||||
sp14.x = sin((M_PI * temp_f30) / 180.0) * (sin((M_PI * temp_f31) / 180.0));
|
||||
sp14.y = cos((M_PI * temp_f31) / 180.0);
|
||||
sp14.z = cos((M_PI * temp_f30) / 180.0) * (sin((M_PI * temp_f31) / 180.0));
|
||||
sp14.x = sind(temp_f30) * (sind(temp_f31));
|
||||
sp14.y = cosd(temp_f31);
|
||||
sp14.z = cosd(temp_f30) * (sind(temp_f31));
|
||||
|
||||
Hu3DCameraPosSet(lbl_1_data_358[var_r31], sp2C.x, sp2C.y, sp2C.z, sp14.x, sp14.y, sp14.z, sp20.x, sp20.y, sp20.z);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "game/window.h"
|
||||
#include "game/wipe.h"
|
||||
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
#include "REL/modeseldll.h"
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ repeat:
|
|||
fn_1_5C38();
|
||||
for (temp_r30 = 0; temp_r30 <= 20; temp_r30++) {
|
||||
temp_f31 = temp_r30 / 20.0;
|
||||
temp_f31 = sin(M_PI * (90.0f * temp_f31) / 180.0);
|
||||
temp_f31 = sind(90.0f * temp_f31);
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[0], temp_f31, temp_f31, temp_f31);
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[1], temp_f31, temp_f31, temp_f31);
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[2], temp_f31, temp_f31, temp_f31);
|
||||
|
|
@ -377,8 +377,8 @@ loop_exit:
|
|||
for (temp_r30 = 0; temp_r30 <= 40; temp_r30++) {
|
||||
if (temp_r30 <= 30) {
|
||||
temp_f31 = temp_r30 / 30.0f;
|
||||
sp28.x = 288.0 + (GET_ZEROSIGN(temp_r26) * (100.0 + (250.0 * sin(M_PI * (90.0f * temp_f31) / 180.0))));
|
||||
sp28.y = 250.0 - (100.0 * sin(M_PI * (180.0f * temp_f31) / 180.0));
|
||||
sp28.x = 288.0 + (GET_ZEROSIGN(temp_r26) * (100.0 + (250.0 * sind(90.0f * temp_f31))));
|
||||
sp28.y = 250.0 - (100.0 * sind(180.0f * temp_f31));
|
||||
sp28.z = (temp_r30 * 100) + 600;
|
||||
Hu3D2Dto3D(&sp28, 1, &sp1C);
|
||||
Hu3DModelPosSetV(lbl_1_bss_19A[temp_r26 + 2], &sp1C);
|
||||
|
|
@ -390,11 +390,11 @@ loop_exit:
|
|||
temp_f31 = (temp_r30 - 20) / 20.0f;
|
||||
if (temp_r29) {
|
||||
sp28.x = 288.0f + ((1.0 - temp_f31) * (100 * GET_ZEROSIGN(temp_r31)));
|
||||
sp28.y = 250.0 - (100.0 * sin(M_PI * (180.0f * temp_f31) / 180.0));
|
||||
sp28.y = 250.0 - (100.0 * sind(180.0f * temp_f31));
|
||||
sp28.z = 600.0f;
|
||||
Hu3D2Dto3D(&sp28, 1, &sp1C);
|
||||
Hu3DModelPosSetV(lbl_1_bss_19A[temp_r31], &sp1C);
|
||||
temp_f31 = (0.5 * sin(M_PI * (90.0f * temp_f31) / 180.0)) + 1.0;
|
||||
temp_f31 = (0.5 * sind(90.0f * temp_f31)) + 1.0;
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[temp_r31], temp_f31, temp_f31, temp_f31);
|
||||
}
|
||||
else {
|
||||
|
|
@ -407,14 +407,14 @@ loop_exit:
|
|||
sp28.z = 600;
|
||||
Hu3D2Dto3D(&sp28, 1, &sp10);
|
||||
VECSubtract(&sp10, &sp1C, &sp28);
|
||||
sp28.x *= sin(M_PI * (90.0f * temp_f31) / 180.0);
|
||||
sp28.y *= 1.0 - cos(M_PI * (90.0f * temp_f31) / 180.0);
|
||||
sp28.x *= sind(90.0f * temp_f31);
|
||||
sp28.y *= 1.0 - cosd(90.0f * temp_f31);
|
||||
sp28.z = 0;
|
||||
VECAdd(&sp28, &sp1C, &sp1C);
|
||||
Hu3DModelPosSetV(lbl_1_bss_19A[temp_r31], &sp1C);
|
||||
lbl_1_bss_108[temp_r31] *= cos(M_PI * (90.0f * temp_f31) / 180.0);
|
||||
lbl_1_bss_108[temp_r31] *= cosd(90.0f * temp_f31);
|
||||
lbl_1_bss_100[temp_r31] = 1.0 - temp_f31;
|
||||
temp_f31 = 1.0 + (0.3 * cos(M_PI * (90.0f * temp_f31) / 180.0));
|
||||
temp_f31 = 1.0 + (0.3 * cosd(90.0f * temp_f31));
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[temp_r31], temp_f31, temp_f31, temp_f31);
|
||||
}
|
||||
}
|
||||
|
|
@ -525,7 +525,7 @@ cleanup:
|
|||
for (temp_r30 = 0; temp_r30 <= 20; temp_r30++) {
|
||||
temp_f31 = temp_r30 / 20.0f;
|
||||
if (temp_r29) {
|
||||
temp_f31 = 1.5 * cos(M_PI * (90.0f * temp_f31) / 180.0);
|
||||
temp_f31 = 1.5 * cosd(90.0f * temp_f31);
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[0], temp_f31, temp_f31, temp_f31);
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[1], temp_f31, temp_f31, temp_f31);
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[2], 0.7 * temp_f31, 0.7 * temp_f31, 0.7 * temp_f31);
|
||||
|
|
@ -544,14 +544,14 @@ cleanup:
|
|||
sp28.z = 600;
|
||||
Hu3D2Dto3D(&sp28, 1, &sp10);
|
||||
VECSubtract(&sp10, &sp1C, &sp28);
|
||||
sp28.x *= sin(M_PI * (90.0f * temp_f31) / 180.0);
|
||||
sp28.y *= 1.0 - cos(M_PI * (90.0f * temp_f31) / 180.0);
|
||||
sp28.x *= sind(90.0f * temp_f31);
|
||||
sp28.y *= 1.0 - cosd(90.0f * temp_f31);
|
||||
sp28.z = 0.0f;
|
||||
VECAdd(&sp28, &sp1C, &sp1C);
|
||||
Hu3DModelPosSetV(lbl_1_bss_19A[temp_r31], &sp1C);
|
||||
lbl_1_bss_108[temp_r31] *= cos(M_PI * (90.0f * temp_f31) / 180.0);
|
||||
lbl_1_bss_108[temp_r31] *= cosd(90.0f * temp_f31);
|
||||
lbl_1_bss_100[temp_r31] = 1.0 - temp_f31;
|
||||
temp_f31 = 1.0 + (0.5 * cos(M_PI * (90.0f * temp_f31) / 180.0));
|
||||
temp_f31 = 1.0 + (0.5 * cosd(90.0f * temp_f31));
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[temp_r31], temp_f31, temp_f31, temp_f31);
|
||||
}
|
||||
HuPrcVSleep();
|
||||
|
|
@ -636,10 +636,10 @@ void fn_1_5850(void)
|
|||
float scale;
|
||||
float time = i / 10.0;
|
||||
if (param) {
|
||||
scale = 1.0 + (0.3 * sin(M_PI * (90.0f * time) / 180.0));
|
||||
scale = 1.0 + (0.3 * sind(90.0f * time));
|
||||
}
|
||||
else {
|
||||
scale = 1.0 + (0.3 * cos(M_PI * (90.0f * time) / 180.0));
|
||||
scale = 1.0 + (0.3 * cosd(90.0f * time));
|
||||
}
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[index + 2], scale, scale, scale);
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[index + 4], scale, scale, scale);
|
||||
|
|
@ -800,7 +800,7 @@ s32 fn_1_61B4(void)
|
|||
lbl_1_bss_120[0] = lbl_1_bss_120[1] = lbl_1_bss_120[2] = 1;
|
||||
UnMountCnt = 0;
|
||||
for (temp_r29 = 0; temp_r29 <= 20; temp_r29++) {
|
||||
temp_f31 = sin(M_PI * (90.0f * (temp_r29 / 20.0f)) / 180.0);
|
||||
temp_f31 = sind(90.0f * (temp_r29 / 20.0f));
|
||||
for (temp_r28 = 0; temp_r28 < 3; temp_r28++) {
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[temp_r28 + 8], temp_f31, temp_f31, temp_f31);
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[temp_r28 + 11], temp_f31, temp_f31, temp_f31);
|
||||
|
|
@ -1076,7 +1076,7 @@ s32 fn_1_61B4(void)
|
|||
}
|
||||
HuWinDispOff(lbl_1_bss_146);
|
||||
for (temp_r29 = 0; temp_r29 <= 20; temp_r29++) {
|
||||
temp_f31 = cos(M_PI * (90.0 * (temp_r29 / 20.0)) / 180.0);
|
||||
temp_f31 = cosd(90.0 * (temp_r29 / 20.0));
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[curSlotNo], temp_f31, temp_f31, temp_f31);
|
||||
for (temp_r28 = 0; temp_r28 < 3; temp_r28++) {
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[temp_r28 + 8], temp_f31, temp_f31, temp_f31);
|
||||
|
|
@ -1115,10 +1115,10 @@ void fn_1_72DC(void)
|
|||
Vec pos_2d;
|
||||
Vec pos_3d;
|
||||
if (param) {
|
||||
scale = sin(M_PI * (90.0f * (i / 10.0f)) / 180.0);
|
||||
scale = sind(90.0f * (i / 10.0f));
|
||||
}
|
||||
else {
|
||||
scale = cos(M_PI * (90.0f * (i / 10.0f)) / 180.0);
|
||||
scale = cosd(90.0f * (i / 10.0f));
|
||||
}
|
||||
pos_2d.x = 158.0f + (index * 130);
|
||||
pos_2d.y = 230;
|
||||
|
|
@ -1476,7 +1476,7 @@ s32 fn_1_8540(s16 boxno)
|
|||
return 0;
|
||||
}
|
||||
for (time = 0; time <= 10; time++) {
|
||||
scale = cos(M_PI * (90.0 * (time / 10.0)) / 180.0);
|
||||
scale = cosd(90.0 * (time / 10.0));
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[boxno + 8], scale, scale, scale);
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
@ -1490,7 +1490,7 @@ s32 fn_1_8540(s16 boxno)
|
|||
Hu3DModelTPLvlSet(lbl_1_bss_19A[boxno + 8], 0.6f);
|
||||
Hu3DModelTPLvlSet(lbl_1_bss_19A[boxno + 11], 0.3f);
|
||||
for (time = 0; time <= 20; time++) {
|
||||
scale = sin(M_PI * (90.0 * (time / 20.0)) / 180.0);
|
||||
scale = sind(90.0 * (time / 20.0));
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[boxno + 8], scale, scale, scale);
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
@ -1661,7 +1661,7 @@ s32 fn_1_8C30(s16 boxno)
|
|||
else {
|
||||
fn_1_9E14();
|
||||
for (temp_r30 = 0; temp_r30 <= 10; temp_r30++) {
|
||||
temp_f31 = cos(M_PI * (90.0 * (temp_r30 / 10.0)) / 180.0);
|
||||
temp_f31 = cosd(90.0 * (temp_r30 / 10.0));
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[temp_r31 + 8], temp_f31, temp_f31, temp_f31);
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
@ -1709,7 +1709,7 @@ s32 fn_1_8C30(s16 boxno)
|
|||
temp_f31 = temp_r30 / 30.0;
|
||||
sp60.x = sp3C.x * temp_f31;
|
||||
sp60.y = sp3C.y * temp_f31;
|
||||
sp60.z = (sp3C.z * temp_f31) + (-300 * sin(M_PI * (180.0f * temp_f31) / 180.0));
|
||||
sp60.z = (sp3C.z * temp_f31) + (-300 * sind(180.0f * temp_f31));
|
||||
VECAdd(&sp60, &sp54, &sp60);
|
||||
Hu3DModelPosSetV(lbl_1_bss_19A[temp_r31 + 11], &sp60);
|
||||
HuPrcVSleep();
|
||||
|
|
@ -1730,7 +1730,7 @@ s32 fn_1_8C30(s16 boxno)
|
|||
Hu3DModelAttrSet(lbl_1_bss_19A[23], HU3D_ATTR_DISPOFF);
|
||||
Hu3DModelAttrReset(lbl_1_bss_19A[boxno + 8], HU3D_ATTR_DISPOFF);
|
||||
for (temp_r30 = 0; temp_r30 <= 10; temp_r30++) {
|
||||
temp_f31 = sin(M_PI * (90.0 * (temp_r30 / 10.0)) / 180.0);
|
||||
temp_f31 = sind(90.0 * (temp_r30 / 10.0));
|
||||
Hu3DModelScaleSet(lbl_1_bss_19A[temp_r31 + 8], temp_f31, temp_f31, temp_f31);
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include "game/process.h"
|
||||
#include "game/window.h"
|
||||
#include "game/wipe.h"
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
typedef struct camera_view_params {
|
||||
Vec rot;
|
||||
|
|
@ -233,15 +233,15 @@ void fn_1_B8C(omObjData *object)
|
|||
y = lbl_1_bss_24[i].y;
|
||||
z = lbl_1_bss_24[i].z;
|
||||
|
||||
pos.x = (((sin((M_PI * y) / 180.0) * cos((M_PI * x) / 180.0)) * lbl_1_bss_4[i]) + lbl_1_bss_C[i].x);
|
||||
pos.y = (-sin((M_PI * x) / 180.0) * lbl_1_bss_4[i]) + lbl_1_bss_C[i].y;
|
||||
pos.z = ((cos((M_PI * y) / 180.0) * cos((M_PI * x) / 180.0)) * lbl_1_bss_4[i]) + lbl_1_bss_C[i].z;
|
||||
pos.x = (((sind(y) * cosd(x)) * lbl_1_bss_4[i]) + lbl_1_bss_C[i].x);
|
||||
pos.y = (-sind(x) * lbl_1_bss_4[i]) + lbl_1_bss_C[i].y;
|
||||
pos.z = ((cosd(y) * cosd(x)) * lbl_1_bss_4[i]) + lbl_1_bss_C[i].z;
|
||||
target.x = lbl_1_bss_C[i].x;
|
||||
target.y = lbl_1_bss_C[i].y;
|
||||
target.z = lbl_1_bss_C[i].z;
|
||||
up.x = sin((M_PI * y) / 180.0) * sin((M_PI * x) / 180.0);
|
||||
up.y = cos((M_PI * x) / 180.0);
|
||||
up.z = cos((M_PI * y) / 180.0) * sin((M_PI * x) / 180.0);
|
||||
up.x = sind(y) * sind(x);
|
||||
up.y = cosd(x);
|
||||
up.z = cosd(y) * sind(x);
|
||||
Hu3DCameraPosSet(lbl_1_data_6E[i], pos.x, pos.y, pos.z, up.x, up.y, up.z, target.x, target.y, target.z);
|
||||
}
|
||||
}
|
||||
|
|
@ -272,27 +272,27 @@ void fn_1_F40(omObjData *object)
|
|||
if (lbl_1_bss_4[0] < 100.0f) {
|
||||
lbl_1_bss_4[0] = 100.0f;
|
||||
}
|
||||
pos.x = lbl_1_bss_C[0].x + (lbl_1_bss_4[0] * (sin((M_PI * lbl_1_bss_24[0].y) / 180.0) * cos((M_PI * lbl_1_bss_24[0].x) / 180.0)));
|
||||
pos.y = (lbl_1_bss_C[0].y + (lbl_1_bss_4[0] * -sin((M_PI * lbl_1_bss_24[0].x) / 180.0)));
|
||||
pos.z = (lbl_1_bss_C[0].z + (lbl_1_bss_4[0] * (cos((M_PI * lbl_1_bss_24[0].y) / 180.0) * cos((M_PI * lbl_1_bss_24[0].x) / 180.0))));
|
||||
pos.x = lbl_1_bss_C[0].x + (lbl_1_bss_4[0] * (sind(lbl_1_bss_24[0].y) * cosd(lbl_1_bss_24[0].x)));
|
||||
pos.y = (lbl_1_bss_C[0].y + (lbl_1_bss_4[0] * -sind(lbl_1_bss_24[0].x)));
|
||||
pos.z = (lbl_1_bss_C[0].z + (lbl_1_bss_4[0] * (cosd(lbl_1_bss_24[0].y) * cosd(lbl_1_bss_24[0].x))));
|
||||
offset.x = lbl_1_bss_C[0].x - pos.x;
|
||||
offset.y = lbl_1_bss_C[0].y - pos.y;
|
||||
offset.z = lbl_1_bss_C[0].z - pos.z;
|
||||
dir.x = (sin((M_PI * lbl_1_bss_24[0].y) / 180.0) * sin((M_PI * lbl_1_bss_24[0].x) / 180.0));
|
||||
dir.y = cos((M_PI * lbl_1_bss_24[0].x) / 180.0);
|
||||
dir.z = (cos((M_PI * lbl_1_bss_24[0].y) / 180.0) * sin((M_PI * lbl_1_bss_24[0].x) / 180.0));
|
||||
dir.x = (sind(lbl_1_bss_24[0].y) * sind(lbl_1_bss_24[0].x));
|
||||
dir.y = cosd(lbl_1_bss_24[0].x);
|
||||
dir.z = (cosd(lbl_1_bss_24[0].y) * sind(lbl_1_bss_24[0].x));
|
||||
z_rot = lbl_1_bss_24[0].z;
|
||||
y_offset.x = dir.x * (offset.x * offset.x + (1.0f - offset.x * offset.x) * cos((M_PI * z_rot) / 180.0))
|
||||
+ dir.y * (offset.x * offset.y * (1.0f - cos((M_PI * z_rot) / 180.0)) - offset.z * sin((M_PI * z_rot) / 180.0))
|
||||
+ dir.z * (offset.x * offset.z * (1.0f - cos((M_PI * z_rot) / 180.0)) + offset.y * sin((M_PI * z_rot) / 180.0));
|
||||
y_offset.x = dir.x * (offset.x * offset.x + (1.0f - offset.x * offset.x) * cosd(z_rot))
|
||||
+ dir.y * (offset.x * offset.y * (1.0f - cosd(z_rot)) - offset.z * sind(z_rot))
|
||||
+ dir.z * (offset.x * offset.z * (1.0f - cosd(z_rot)) + offset.y * sind(z_rot));
|
||||
|
||||
y_offset.y = dir.y * (offset.y * offset.y + (1.0f - offset.y * offset.y) * cos((M_PI * z_rot) / 180.0))
|
||||
+ dir.x * (offset.x * offset.y * (1.0f - cos((M_PI * z_rot) / 180.0)) + offset.z * sin((M_PI * z_rot) / 180.0))
|
||||
+ dir.z * (offset.y * offset.z * (1.0f - cos((M_PI * z_rot) / 180.0)) - offset.x * sin((M_PI * z_rot) / 180.0));
|
||||
y_offset.y = dir.y * (offset.y * offset.y + (1.0f - offset.y * offset.y) * cosd(z_rot))
|
||||
+ dir.x * (offset.x * offset.y * (1.0f - cosd(z_rot)) + offset.z * sind(z_rot))
|
||||
+ dir.z * (offset.y * offset.z * (1.0f - cosd(z_rot)) - offset.x * sind(z_rot));
|
||||
|
||||
y_offset.z = dir.z * (offset.z * offset.z + (1.0f - offset.z * offset.z) * cos((M_PI * z_rot) / 180.0))
|
||||
+ (dir.x * (offset.x * offset.z * (1.0 - cos((M_PI * z_rot) / 180.0)) - offset.y * sin((M_PI * z_rot) / 180.0))
|
||||
+ dir.y * (offset.y * offset.z * (1.0 - cos((M_PI * z_rot) / 180.0)) + offset.x * sin((M_PI * z_rot) / 180.0)));
|
||||
y_offset.z = dir.z * (offset.z * offset.z + (1.0f - offset.z * offset.z) * cosd(z_rot))
|
||||
+ (dir.x * (offset.x * offset.z * (1.0 - cosd(z_rot)) - offset.y * sind(z_rot))
|
||||
+ dir.y * (offset.y * offset.z * (1.0 - cosd(z_rot)) + offset.x * sind(z_rot)));
|
||||
|
||||
VECCrossProduct(&dir, &offset, &offset);
|
||||
VECNormalize(&offset, &offset);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "game/window.h"
|
||||
|
||||
#include "dolphin.h"
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
#include "version.h"
|
||||
|
||||
#ifndef __MWERKS__
|
||||
|
|
@ -208,8 +208,8 @@ static void ExecRecord(omObjData *object)
|
|||
Hu3DModelAttrReset(work->hand->model[0], HU3D_ATTR_DISPOFF);
|
||||
work->cameraDoneF = TRUE;
|
||||
}
|
||||
pos.x = 505.0 * -sin(305 * M_PI / 180.0);
|
||||
pos.z = 505.0 * cos(305 * M_PI / 180.0);
|
||||
pos.x = 505.0 * -sind(305);
|
||||
pos.z = 505.0 * cosd(305);
|
||||
pos.y = 144.0f - 14.0f * work->recordType;
|
||||
omSetTra(work->hand, pos.x, pos.y, pos.z);
|
||||
object->unk10 = 3;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#include "dolphin.h"
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
#include "game/armem.h"
|
||||
#include "game/audio.h"
|
||||
|
|
@ -503,7 +503,7 @@ void fn_1_7F98(void)
|
|||
}
|
||||
delay = (lbl_1_bss_174) ? 3 : 10;
|
||||
for (time = 0; time <= delay; time++) {
|
||||
float scale = sin(M_PI * ((90.0 / delay) * time) / 180.0);
|
||||
float scale = sind((90.0 / delay) * time);
|
||||
for (i = 0; i < 4; i++) {
|
||||
HuSprGrpScaleSet(lbl_1_bss_19E0[i], scale, scale);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include "game/window.h"
|
||||
#include "game/wipe.h"
|
||||
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
#include "REL/resultdll.h"
|
||||
|
||||
|
|
@ -498,7 +498,7 @@ void fn_1_1F4C(void)
|
|||
}
|
||||
temp_r29 = (lbl_1_bss_174) ? 3 : 10;
|
||||
for (temp_r30 = 0; temp_r30 <= temp_r29; temp_r30++) {
|
||||
temp_f31 = sin(M_PI * ((90.0 / temp_r29) * temp_r30) / 180.0);
|
||||
temp_f31 = sind((90.0 / temp_r29) * temp_r30);
|
||||
for (i = 0; i < 4; i++) {
|
||||
HuSprGrpScaleSet(lbl_1_bss_3A[i], temp_f31, temp_f31);
|
||||
}
|
||||
|
|
@ -512,8 +512,8 @@ void fn_1_1F4C(void)
|
|||
if (GWPlayerCoinWinGet(lbl_1_bss_4A[i]) >= 10) {
|
||||
HuSprAttrReset(lbl_1_bss_9C, i, 4);
|
||||
}
|
||||
HuSprScaleSet(lbl_1_bss_9C, i, sin(M_PI * ((120.0f / 14.0f) * temp_r28) / 180.0) * (0.8 * (1.0 / sin((M_PI * 2) / 3))),
|
||||
0.8 * (sin(M_PI * ((120.0f / 14.0f) * temp_r28) / 180.0) * (1.0 / sin((M_PI * 2) / 3))));
|
||||
HuSprScaleSet(lbl_1_bss_9C, i, sind((120.0f / 14.0f) * temp_r28) * (0.8 * (1.0 / sin((M_PI * 2) / 3))),
|
||||
0.8 * (sind((120.0f / 14.0f) * temp_r28) * (1.0 / sin((M_PI * 2) / 3))));
|
||||
}
|
||||
temp_r28 += (lbl_1_bss_174) ? 2 : 1;
|
||||
HuPrcVSleep();
|
||||
|
|
@ -603,7 +603,7 @@ void fn_1_1F4C(void)
|
|||
}
|
||||
temp_r29 = (lbl_1_bss_174) ? 3 : 10;
|
||||
for (temp_r30 = 0; temp_r30 <= temp_r29; temp_r30++) {
|
||||
temp_f31 = cos(M_PI * ((90.0 / temp_r29) * temp_r30) / 180.0);
|
||||
temp_f31 = cosd((90.0 / temp_r29) * temp_r30);
|
||||
for (i = 0; i < 4; i++) {
|
||||
HuSprGrpScaleSet(lbl_1_bss_3A[i], temp_f31, temp_f31);
|
||||
}
|
||||
|
|
@ -686,12 +686,12 @@ void fn_1_2ADC(void)
|
|||
temp_r27 = temp_r28 - (i * 20);
|
||||
if (temp_r27 <= 20) {
|
||||
if (temp_r27 <= 10) {
|
||||
HuSprScaleSet(lbl_1_bss_52, i, 1.0f, cos(M_PI * (9.0f * temp_r27) / 180.0));
|
||||
HuSprScaleSet(lbl_1_bss_52, i, 1.0f, cosd(9.0f * temp_r27));
|
||||
}
|
||||
else {
|
||||
HuSprAttrSet(lbl_1_bss_52, i, 4);
|
||||
HuSprAttrReset(lbl_1_data_380, i, 4);
|
||||
HuSprScaleSet(lbl_1_data_380, i, 1.0f, sin(M_PI * (9.0f * (temp_r27 - 10)) / 180.0));
|
||||
HuSprScaleSet(lbl_1_data_380, i, 1.0f, sind(9.0f * (temp_r27 - 10)));
|
||||
}
|
||||
temp_f31 = temp_r27 / 20.0f;
|
||||
temp_r29 = GWStarsGet(sp28[i]) + (temp_f31 * (GWStarsGet(lbl_1_bss_4A[i]) - GWStarsGet(sp28[i])));
|
||||
|
|
@ -741,7 +741,7 @@ void fn_1_2ADC(void)
|
|||
}
|
||||
if (temp_r28 <= 10) {
|
||||
for (i = 0; i < 4; i++) {
|
||||
HuSprScaleSet(lbl_1_bss_9C, i, cos(M_PI * (9.0f * temp_r28) / 180.0), cos(M_PI * (9.0f * temp_r28) / 180.0));
|
||||
HuSprScaleSet(lbl_1_bss_9C, i, cosd(9.0f * temp_r28), cosd(9.0f * temp_r28));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -1264,27 +1264,27 @@ void fn_1_5880(omObjData *object)
|
|||
CZoom += HuPadTrigL[0] / 2;
|
||||
CZoom -= HuPadTrigR[0] / 2;
|
||||
|
||||
pos.x = Center.x + (CZoom * (sin((M_PI * CRot.y) / 180.0) * cos((M_PI * CRot.x) / 180.0)));
|
||||
pos.y = (Center.y + (CZoom * -sin((M_PI * CRot.x) / 180.0)));
|
||||
pos.z = (Center.z + (CZoom * (cos((M_PI * CRot.y) / 180.0) * cos((M_PI * CRot.x) / 180.0))));
|
||||
pos.x = Center.x + CZoom * (sind(CRot.y) * cosd(CRot.x));
|
||||
pos.y = Center.y + CZoom * -sind(CRot.x);
|
||||
pos.z = Center.z + CZoom * (cosd(CRot.y) * cosd(CRot.x));
|
||||
offset.x = Center.x - pos.x;
|
||||
offset.y = Center.y - pos.y;
|
||||
offset.z = Center.z - pos.z;
|
||||
dir.x = (sin((M_PI * CRot.y) / 180.0) * sin((M_PI * CRot.x) / 180.0));
|
||||
dir.y = cos((M_PI * CRot.x) / 180.0);
|
||||
dir.z = (cos((M_PI * CRot.y) / 180.0) * sin((M_PI * CRot.x) / 180.0));
|
||||
dir.x = (sind(CRot.y) * sind(CRot.x));
|
||||
dir.y = cosd(CRot.x);
|
||||
dir.z = (cosd(CRot.y) * sind(CRot.x));
|
||||
z_rot = CRot.z;
|
||||
y_offset.x = dir.x * (offset.x * offset.x + (1.0f - offset.x * offset.x) * cos((M_PI * z_rot) / 180.0))
|
||||
+ dir.y * (offset.x * offset.y * (1.0f - cos((M_PI * z_rot) / 180.0)) - offset.z * sin((M_PI * z_rot) / 180.0))
|
||||
+ dir.z * (offset.x * offset.z * (1.0f - cos((M_PI * z_rot) / 180.0)) + offset.y * sin((M_PI * z_rot) / 180.0));
|
||||
y_offset.x = dir.x * (offset.x * offset.x + (1.0f - offset.x * offset.x) * cosd(z_rot))
|
||||
+ dir.y * (offset.x * offset.y * (1.0f - cosd(z_rot)) - offset.z * sind(z_rot))
|
||||
+ dir.z * (offset.x * offset.z * (1.0f - cosd(z_rot)) + offset.y * sind(z_rot));
|
||||
|
||||
y_offset.y = dir.y * (offset.y * offset.y + (1.0f - offset.y * offset.y) * cos((M_PI * z_rot) / 180.0))
|
||||
+ dir.x * (offset.x * offset.y * (1.0f - cos((M_PI * z_rot) / 180.0)) + offset.z * sin((M_PI * z_rot) / 180.0))
|
||||
+ dir.z * (offset.y * offset.z * (1.0f - cos((M_PI * z_rot) / 180.0)) - offset.x * sin((M_PI * z_rot) / 180.0));
|
||||
y_offset.y = dir.y * (offset.y * offset.y + (1.0f - offset.y * offset.y) * cosd(z_rot))
|
||||
+ dir.x * (offset.x * offset.y * (1.0f - cosd(z_rot)) + offset.z * sind(z_rot))
|
||||
+ dir.z * (offset.y * offset.z * (1.0f - cosd(z_rot)) - offset.x * sind(z_rot));
|
||||
|
||||
y_offset.z = dir.z * (offset.z * offset.z + (1.0f - offset.z * offset.z) * cos((M_PI * z_rot) / 180.0))
|
||||
+ (dir.x * (offset.x * offset.z * (1.0 - cos((M_PI * z_rot) / 180.0)) - offset.y * sin((M_PI * z_rot) / 180.0))
|
||||
+ dir.y * (offset.y * offset.z * (1.0 - cos((M_PI * z_rot) / 180.0)) + offset.x * sin((M_PI * z_rot) / 180.0)));
|
||||
y_offset.z = dir.z * (offset.z * offset.z + (1.0f - offset.z * offset.z) * cosd(z_rot))
|
||||
+ (dir.x * (offset.x * offset.z * (1.0 - cosd(z_rot)) - offset.y * sind(z_rot))
|
||||
+ dir.y * (offset.y * offset.z * (1.0 - cosd(z_rot)) + offset.x * sind(z_rot)));
|
||||
|
||||
VECCrossProduct(&dir, &offset, &offset);
|
||||
VECNormalize(&offset, &offset);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
#include "game/pad.h"
|
||||
#include "game/wipe.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
// structs
|
||||
|
||||
typedef struct w03UnkStruct5 {
|
||||
|
|
@ -172,8 +174,8 @@ void fn_1_3304(void)
|
|||
var_r31 = BoardSpaceLinkFlagSearch(0, var_r31, 0x02000000);
|
||||
BoardSpacePosGet(0, var_r31, &sp8);
|
||||
temp_f31 = 0.0f;
|
||||
sp8.x = sp8.x + (-300.0 * sin((M_PI * temp_f31) / 180.0));
|
||||
sp8.z = sp8.z + (-300.0 * cos((M_PI * temp_f31) / 180.0));
|
||||
sp8.x += -300.0 * sind(temp_f31);
|
||||
sp8.z += -300.0 * cosd(temp_f31);
|
||||
sp8.y = 45.0f + sp8.y;
|
||||
BoardModelPosSetV(lbl_1_data_310, &sp8);
|
||||
BoardModelMotionStart(lbl_1_data_310, 2, 0x40000001);
|
||||
|
|
@ -211,7 +213,7 @@ s32 fn_1_3478(s32 arg0)
|
|||
temp = BoardSpaceLinkFlagSearch(0, temp_r28, 0x02000000);
|
||||
BoardSpacePosGet(0, temp, &sp38);
|
||||
VECSubtract(&sp38, &sp2C, &sp20);
|
||||
float_temp = atan2(sp20.x, sp20.z) / M_PI * 180.0f;
|
||||
float_temp = atan2d(sp20.x, sp20.z);
|
||||
BoardPlayerMotBlendSet(arg0, (float_temp), 0xF);
|
||||
|
||||
while (BoardPlayerMotBlendCheck(arg0) == 0) {
|
||||
|
|
@ -473,8 +475,8 @@ void fn_1_3F5C(s32 arg0)
|
|||
var_r31 = BoardSpaceLinkFlagSearch(0, var_r31, 0x02000000);
|
||||
BoardSpacePosGet(0, var_r31, &sp8);
|
||||
temp_f31 = 0.0f;
|
||||
sp8.x = (sp8.x + (-300.0 * sin((M_PI * temp_f31) / 180.0f)));
|
||||
sp8.z = (sp8.z + (-300.0 * cos((M_PI * temp_f31) / 180.0f)));
|
||||
sp8.x += -300.0 * sind(temp_f31);
|
||||
sp8.z += -300.0 * cosd(temp_f31);
|
||||
sp8.y = 45.0f + sp8.y;
|
||||
BoardModelPosSetV(lbl_1_data_310, &sp8);
|
||||
BoardModelMotionStart(lbl_1_data_310, 2, 0x40000001);
|
||||
|
|
@ -589,7 +591,7 @@ void fn_1_4424(w03StructUnk2 *arg0)
|
|||
VECSubtract(&sp60, &sp6C, &sp3C);
|
||||
}
|
||||
|
||||
sp10_2 = 180.0f * (atan2(-sp3C.x, -sp3C.z) / M_PI);
|
||||
sp10_2 = atan2d(-sp3C.x, -sp3C.z);
|
||||
BoardModelMotionStart(lbl_1_data_314, 0, 0U);
|
||||
BoardModelMotionSpeedSet(lbl_1_data_314, 8.0f);
|
||||
HuPrcSleep(1);
|
||||
|
|
@ -604,7 +606,7 @@ void fn_1_4424(w03StructUnk2 *arg0)
|
|||
for (i = var_r25 = 0; i < 20;) {
|
||||
Hu3DMotionExec(temp_r23, temp_r28->unk_08, temp_r28->unk_64, 0);
|
||||
Hu3DModelObjPosGet(BoardModelIDGet(lbl_1_data_314), temp_r22, &sp54);
|
||||
temp_r28->unk_64 = (f32)(temp_r28->unk_64 + temp_r28->unk_68);
|
||||
temp_r28->unk_64 += temp_r28->unk_68;
|
||||
|
||||
if (temp_r28->unk_64 > 400.0f) {
|
||||
break;
|
||||
|
|
@ -770,9 +772,9 @@ void fn_1_4D60(w03StructUnk2 *arg0)
|
|||
temp_r31->unk_00 = 1;
|
||||
temp_f31 = 360.0f * BoardRandFloat();
|
||||
temp_f30 = 5.0f * BoardRandFloat();
|
||||
temp_r31->unk_14.x = temp_f30 * sin((M_PI * temp_f31) / 180.0);
|
||||
temp_r31->unk_14.x = temp_f30 * sind(temp_f31);
|
||||
temp_r31->unk_14.y = 50.0f + (20.0f * BoardRandFloat());
|
||||
temp_r31->unk_14.z = temp_f30 * cos((M_PI * temp_f31) / 180.0);
|
||||
temp_r31->unk_14.z = temp_f30 * cosd(temp_f31);
|
||||
temp_r31->unk_08.x = sp8.x;
|
||||
temp_r31->unk_08.y = sp8.y;
|
||||
temp_r31->unk_08.z = sp8.z;
|
||||
|
|
@ -1084,11 +1086,11 @@ void fn_1_5C5C(omObjData *arg0, w03UnkStruct5 *arg1)
|
|||
PSMTXTrans(sp80, sp44.x, sp44.y, sp44.z);
|
||||
PSMTXConcat(sp80, sp50, sp80);
|
||||
Hu3DMtxTransGet(sp80, &sp44);
|
||||
MTXRotDeg(spB0, 'y', (180.0 * (atan2(-sp2C.x, -sp2C.z) / M_PI)));
|
||||
MTXRotDeg(spB0, 'y', atan2d(-sp2C.x, -sp2C.z));
|
||||
PSMTXConcat(spB0, spE0, sp110);
|
||||
BoardModelMtxSet(lbl_1_data_310, &sp110);
|
||||
BoardModelPosSetV(lbl_1_data_310, &sp44);
|
||||
BoardCameraRotSet(-20.0f, (180.0 * (atan2(sp2C.x, sp2C.z) / M_PI)));
|
||||
BoardCameraRotSet(-20.0f, atan2d(sp2C.x, sp2C.z));
|
||||
}
|
||||
|
||||
void fn_1_602C(omObjData *arg0, w03UnkStruct5 *arg1)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
#include "game/object.h"
|
||||
#include "game/pad.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
// structs
|
||||
typedef struct someBits3 { // make sure this is defined correctly
|
||||
/* 0x00 */ struct {
|
||||
|
|
@ -175,7 +177,7 @@ s32 fn_1_7D18(s32 arg0)
|
|||
BoardSpacePosGet(0, temp_r28, &sp38);
|
||||
VECSubtract(&sp38, &sp2C, &sp20);
|
||||
VECNormalize(&sp20, &sp20);
|
||||
BoardPlayerRotYSet(arg0, 180.0 * (atan2(-sp20.x, -sp20.z) / M_PI));
|
||||
BoardPlayerRotYSet(arg0, atan2d(-sp20.x, -sp20.z));
|
||||
HuPrcSleep(0x1E);
|
||||
model = BoardModelIDGet(lbl_1_bss_C[7]);
|
||||
Hu3DModelObjPosGet(model, "phei", &sp38);
|
||||
|
|
@ -187,8 +189,8 @@ s32 fn_1_7D18(s32 arg0)
|
|||
var_f31 = 39.0f;
|
||||
}
|
||||
|
||||
sp38.x = sp38.x + (var_f31 * sin((M_PI * (180.0f + BoardModelRotYGet(lbl_1_data_456))) / 180.0));
|
||||
sp38.z = sp38.z + (var_f31 * cos((M_PI * (180.0f + BoardModelRotYGet(lbl_1_data_456))) / 180.0));
|
||||
sp38.x += var_f31 * sind(180.0f + BoardModelRotYGet(lbl_1_data_456));
|
||||
sp38.z += var_f31 * cosd(180.0f + BoardModelRotYGet(lbl_1_data_456));
|
||||
|
||||
BoardPlayerPosGet(arg0, &sp2C);
|
||||
BoardPlayerPosLerpStart(arg0, &sp2C, &sp38, 0x14);
|
||||
|
|
@ -197,7 +199,7 @@ s32 fn_1_7D18(s32 arg0)
|
|||
BoardModelPosGet(lbl_1_bss_C[10], &sp2C);
|
||||
BoardPlayerPosGet(arg0, &sp38);
|
||||
VECSubtract(&sp38, &sp2C, &sp20);
|
||||
arctan = atan2(sp20.x, sp20.z) / M_PI * 180.0;
|
||||
arctan = atan2d(sp20.x, sp20.z);
|
||||
BoardModelRotYSet(lbl_1_bss_C[10], arctan);
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
@ -589,7 +591,7 @@ void fn_1_9044(omObjData *arg0, someBits3 *arg1)
|
|||
}
|
||||
}
|
||||
|
||||
sp8.z = arg0->trans.x * sin((M_PI * arg0->trans.y) / 180.0);
|
||||
sp8.z = arg0->trans.x * sind(arg0->trans.y);
|
||||
BoardModelRotSetV(lbl_1_data_456, &sp8);
|
||||
}
|
||||
|
||||
|
|
@ -626,7 +628,7 @@ void fn_1_9230(s32 arg0)
|
|||
BoardModelPosGet(lbl_1_bss_C[10], &sp20);
|
||||
BoardPlayerPosGet(arg0, &sp14);
|
||||
VECSubtract(&sp14, &sp20, &sp8);
|
||||
rotY = atan2(sp8.x, sp8.z) / M_PI * 180.0;
|
||||
rotY = atan2d(sp8.x, sp8.z);
|
||||
BoardModelRotYSet(lbl_1_bss_C[10], rotY);
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
@ -773,8 +775,8 @@ void fn_1_97F8(s32 arg0)
|
|||
}
|
||||
temp_r31 = &temp_r30->unk_0C[i];
|
||||
temp_r31->unk0 = 1;
|
||||
temp_r31->unk8.x = sp8.x + (50.0f * sin((M_PI * var_f31) / 180.0));
|
||||
temp_r31->unk8.z = sp8.z + (50.0f * cos((M_PI * var_f31) / 180.0));
|
||||
temp_r31->unk8.x = sp8.x + (50.0f * sind(var_f31));
|
||||
temp_r31->unk8.z = sp8.z + (50.0f * cosd(var_f31));
|
||||
temp_r31->unk8.y = 600.0f + sp8.y + (500.0f * BoardRandFloat());
|
||||
temp_r31->unk1 = 0;
|
||||
temp_r31->unk4 = BoardRandFloat() * 360.0f;
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ s32 fn_1_9CF4(s32 arg0)
|
|||
BoardSpacePosGet(0, temp_r29, &sp38);
|
||||
VECSubtract(&sp38, &sp2C, &sp20);
|
||||
VECNormalize(&sp20, &sp20);
|
||||
BoardPlayerRotYSet(arg0, (f32)(180.0 * (atan2(-sp20.x, -sp20.z) / M_PI)));
|
||||
BoardPlayerRotYSet(arg0, atan2d(-sp20.x, -sp20.z));
|
||||
BoardPlayerPosLerpStart(arg0, &sp2C, &sp38, 0x14);
|
||||
|
||||
while (GWPlayer[arg0].moving != 0) {
|
||||
|
|
@ -288,11 +288,11 @@ void fn_1_9FE4(void)
|
|||
f32 var_f31;
|
||||
|
||||
BoardModelPosGet(lbl_1_bss_C[11], &sp24);
|
||||
sp18.x = (-3179.800048828125 + (200.0 * sin(0.0)));
|
||||
sp18.z = (-907.7000122070313 + 200.0 * cos(0.0));
|
||||
sp18.x = -3179.8f + 200.0 * sin(0.0);
|
||||
sp18.z = -907.7f + 200.0 * cos(0.0);
|
||||
sp18.y = sp24.y;
|
||||
VECSubtract(&sp18, &sp24, &spC);
|
||||
temp_f30 = (atan2(spC.z, spC.x) / M_PI * 180.0);
|
||||
temp_f30 = atan2d(spC.z, spC.x);
|
||||
sp8 = BoardModelRotYGet(lbl_1_bss_C[11]);
|
||||
BoardModelMotionShiftSet(lbl_1_bss_C[11], lbl_1_data_4DA, 0.0f, 10.0, HU3D_MOTATTR_LOOP);
|
||||
|
||||
|
|
@ -861,7 +861,7 @@ void fn_1_B748(omObjData *arg0, someBits2 *arg1)
|
|||
BoardModelPosSetV(temp_r29, &sp8);
|
||||
BoardModelRotYSet(temp_r29, 8.0f + BoardModelRotYGet(temp_r29));
|
||||
BoardModelScaleGet(temp_r29, &sp14);
|
||||
sp14.x = sp14.y = sp14.z = cos(M_PI * temp_f0 / 180.0);
|
||||
sp14.x = sp14.y = sp14.z = cosd(temp_f0);
|
||||
BoardModelScaleSetV(temp_r29, &sp14);
|
||||
arg1->unk1 += 4;
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
#include "game/board/player.h"
|
||||
#include "game/hsfdraw.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
//BSS
|
||||
char lbl_1_bss_130[8];
|
||||
omObjData* lbl_1_bss_12C;
|
||||
|
|
@ -167,7 +169,7 @@ s32 fn_1_6898(s32 arg0) {
|
|||
Hu3DModelObjPosGet(BoardModelIDGet(lbl_1_data_388), "hei01", &sp20);
|
||||
BoardPlayerPosGet(arg0, &sp14);
|
||||
VECSubtract(&sp20, &sp14, &sp8);
|
||||
temp_f31 = 180.0 * (atan2(sp8.x, sp8.z) / M_PI);
|
||||
temp_f31 = atan2d(sp8.x, sp8.z);
|
||||
BoardCameraTargetModelSet(lbl_1_data_388);
|
||||
BoardPlayerMotBlendSet(arg0, temp_f31, 15);
|
||||
|
||||
|
|
@ -456,10 +458,10 @@ void fn_1_767C(omObjData* arg0) {
|
|||
if ((lbl_1_data_388 != -1) && (lbl_1_bss_124 == 0)) {
|
||||
temp_r31->unk_04 += 3.0f;
|
||||
if (temp_r31->unk_04 >= 360.0f) {
|
||||
temp_r31->unk_04 = (f32) (temp_r31->unk_04 - 360.0f);
|
||||
temp_r31->unk_04 -= 360.0f;
|
||||
}
|
||||
BoardModelPosGet(lbl_1_data_388, &sp8);
|
||||
sp8.y = (f32) ((f64) sp8.y + (0.25 * (2.0 * sin((M_PI * (f64) temp_r31->unk_04) / 180.0))));
|
||||
sp8.y += 0.25 * (2.0 * sind(temp_r31->unk_04));
|
||||
BoardModelPosSetV(lbl_1_data_388, &sp8);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
#include "game/board/main.h"
|
||||
#include "game/objsub.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
void fn_1_1358(void);
|
||||
void fn_1_152C(void);
|
||||
s32 fn_1_15E8(void);
|
||||
|
|
@ -26,7 +28,6 @@ void fn_1_2AC0(void);
|
|||
void fn_1_2818(void);
|
||||
void fn_1_2A40(void);
|
||||
void fn_1_2B44(void);
|
||||
double atan2(double y, double x);
|
||||
|
||||
//data
|
||||
s16 lbl_1_data_280 = -1;
|
||||
|
|
@ -155,7 +156,7 @@ s32 fn_1_1650(s32 arg0) {
|
|||
BoardSpacePosGet(0, temp2, &sp38);
|
||||
BoardPlayerPosGet(arg0, &sp2C);
|
||||
VECSubtract(&sp38, &sp2C, &sp20);
|
||||
temp = (atan2(-sp20.x, -sp20.z) / M_PI) * 180.0f;
|
||||
temp = atan2d(-sp20.x, -sp20.z);
|
||||
BoardPlayerRotYSet(arg0, temp);
|
||||
sp14.x = 0.0f;
|
||||
sp14.y = 100.0f;
|
||||
|
|
@ -539,7 +540,7 @@ void fn_1_26E0(s32 arg0) {
|
|||
BoardPlayerPosGet(arg0, &sp14);
|
||||
VECSubtract(&sp20, &sp14, &sp8);
|
||||
VECNormalize(&sp8, &sp8);
|
||||
temp = (180.0f * (atan2(-sp8.x, -sp8.z) / M_PI));
|
||||
temp = atan2d(-sp8.x, -sp8.z);
|
||||
BoardPlayerRotYSet(arg0, temp);
|
||||
BoardCameraViewSet(1);
|
||||
BoardCameraTargetPlayerSet(arg0);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
#include "game/board/player.h"
|
||||
#include "game/board/window.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
// bss
|
||||
s16 lbl_1_bss_72[2];
|
||||
s16 lbl_1_bss_6C[3];
|
||||
|
|
@ -179,7 +181,7 @@ void fn_1_4034(s32 arg0)
|
|||
var_r27 = arg0 + 1;
|
||||
}
|
||||
Hu3DModelObjPosGet(BoardModelIDGet(lbl_1_data_118), lbl_1_data_22C[var_r27], &sp34);
|
||||
temp_f25 = (180.0 * (atan2((sp34.x - sp40.x), (sp34.z - sp40.z)) / M_PI));
|
||||
temp_f25 = atan2d(sp34.x - sp40.x, sp34.z - sp40.z);
|
||||
BoardModelMotionShiftSet(lbl_1_bss_64, 2, 0.0f, 10.0f, HU3D_MOTATTR_LOOP);
|
||||
|
||||
while (fn_1_1208(lbl_1_bss_64, temp_f25, 10.0f) == 0) {
|
||||
|
|
@ -236,7 +238,7 @@ loop_37:
|
|||
}
|
||||
BoardModelPosGet(lbl_1_bss_64, &sp40);
|
||||
BoardPlayerPosGet(lbl_1_bss_68, &sp28);
|
||||
var_f27 = 180.0 * (atan2((sp40.x - sp28.x), (sp40.z - sp28.z)) / M_PI);
|
||||
var_f27 = atan2d(sp40.x - sp28.x, sp40.z - sp28.z);
|
||||
BoardPlayerMotBlendSet(lbl_1_bss_68, var_f27, 0xF);
|
||||
|
||||
while (BoardPlayerMotBlendCheck(lbl_1_bss_68) == 0) {
|
||||
|
|
@ -352,7 +354,7 @@ void fn_1_4EB4(s32 arg1, s32 arg2, Vec *arg3)
|
|||
BoardPlayerIdleSet(lbl_1_bss_68);
|
||||
HuPrcSleep(8);
|
||||
BoardSpacePosGet(0, arg2, &sp3C);
|
||||
var_f28 = 180.0 * (atan2((sp3C.x - sp30.x), (sp3C.z - sp30.z)) / M_PI);
|
||||
var_f28 = atan2d(sp3C.x - sp30.x, sp3C.z - sp30.z);
|
||||
BoardPlayerMotBlendSet(lbl_1_bss_68, var_f28, 0xF);
|
||||
|
||||
while (BoardPlayerMotBlendCheck(lbl_1_bss_68) == 0) {
|
||||
|
|
@ -486,7 +488,7 @@ void fn_1_5794(s32 arg0, s32 arg1, Vec *arg2)
|
|||
VECAdd(&sp58, &sp40, &sp58);
|
||||
sp64 = sp58;
|
||||
if (var_r29 == 0) {
|
||||
sp58.y += 250.0 * sin((M_PI * var_f28) / 180.0);
|
||||
sp58.y += 250.0 * sind(var_f28);
|
||||
var_f28 -= 2.5f;
|
||||
if (var_f28 < -540.0f) {
|
||||
var_f28 = -540.0f;
|
||||
|
|
@ -521,7 +523,7 @@ void fn_1_5794(s32 arg0, s32 arg1, Vec *arg2)
|
|||
var_r29--;
|
||||
}
|
||||
BoardModelPosSetV(lbl_1_bss_64, &sp58);
|
||||
sp28.x = sp34.x = (45.0 * -sin((M_PI * var_f28) / 180.0));
|
||||
sp28.x = sp34.x = 45.0 * -sind(var_f28);
|
||||
BoardModelRotSetV(lbl_1_bss_64, &sp34);
|
||||
BoardPlayerRotSetV(lbl_1_bss_68, &sp28);
|
||||
sp4C = sp58;
|
||||
|
|
@ -540,7 +542,7 @@ void fn_1_5794(s32 arg0, s32 arg1, Vec *arg2)
|
|||
BoardPlayerIdleSet(lbl_1_bss_68);
|
||||
HuPrcSleep(8);
|
||||
BoardSpacePosGet(0, arg1, &sp58);
|
||||
var_f27 = (180.0 * (atan2((sp58.x - sp4C.x), (sp58.z - sp4C.z)) / M_PI));
|
||||
var_f27 = atan2d(sp58.x - sp4C.x, sp58.z - sp4C.z);
|
||||
BoardPlayerMotBlendSet(lbl_1_bss_68, var_f27, 0xF);
|
||||
|
||||
while (BoardPlayerMotBlendCheck(lbl_1_bss_68) == 0) {
|
||||
|
|
@ -599,8 +601,8 @@ void fn_1_62AC(s32 arg0, Vec *arg1)
|
|||
sp1C = sp28;
|
||||
sp10 = sp28;
|
||||
VECScale(&sp1C, &sp1C, sp8[arg0]);
|
||||
sp1C.y += (250.0 * sin((M_PI * var_f31) / 180.0));
|
||||
var_f30 = (250.0 * -cos((M_PI * var_f31) / 180.0));
|
||||
sp1C.y += 250.0 * sind(var_f31);
|
||||
var_f30 = 250.0 * -cosd(var_f31);
|
||||
VECScale(&sp10, &sp10, var_f30);
|
||||
VECAdd(&sp10, &sp1C, &sp1C);
|
||||
VECAdd(&sp1C, &sp34, &sp1C);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
#include "game/board/player.h"
|
||||
#include "game/board/window.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
// data
|
||||
s32 lbl_1_data_150[5] = {
|
||||
DATA_MAKE_NUM(DATADIR_W05, 0x21), DATA_MAKE_NUM(DATADIR_W05, 0x22), DATA_MAKE_NUM(DATADIR_W05, 0x23),
|
||||
|
|
@ -75,7 +77,7 @@ void fn_1_155C(void) {
|
|||
temp_f30 = BoardPlayerRotYGet(lbl_1_bss_28);
|
||||
BoardPlayerPosGet(lbl_1_bss_28, &sp58);
|
||||
Hu3DModelObjPosGet(BoardModelIDGet(lbl_1_data_118), "hotel1", &sp64);
|
||||
temp_f31 = 180.0 * (atan2((sp64.x - sp58.x), (sp64.z - sp58.z)) / M_PI);
|
||||
temp_f31 = atan2d(sp64.x - sp58.x, sp64.z - sp58.z);
|
||||
BoardPlayerMotBlendSet(lbl_1_bss_28, temp_f31, 0xF);
|
||||
BoardCameraViewSet(2);
|
||||
|
||||
|
|
@ -103,7 +105,7 @@ void fn_1_155C(void) {
|
|||
HuPrcVSleep();
|
||||
}
|
||||
BoardModelPosSetV(lbl_1_bss_14[4], &sp28);
|
||||
temp_f31 = (180.0 * (atan2((sp58.x - sp28.x), (sp58.z - sp28.z)) / M_PI));
|
||||
temp_f31 = atan2d(sp58.x - sp28.x, sp58.z - sp28.z);
|
||||
|
||||
while (fn_1_1208(lbl_1_bss_14[4], temp_f31, 10.0f) == 0) {
|
||||
HuPrcVSleep();
|
||||
|
|
@ -266,13 +268,13 @@ void fn_1_1E44(void) {
|
|||
HuPrcVSleep();
|
||||
}
|
||||
BoardModelPosSetV(lbl_1_bss_14[4], &sp2C);
|
||||
temp_f31 = (180.0 * (atan2((sp50.x - sp2C.x), (sp50.z - sp2C.z)) / M_PI));
|
||||
temp_f31 = atan2d(sp50.x - sp2C.x, sp50.z - sp2C.z);
|
||||
|
||||
while (fn_1_1208(lbl_1_bss_14[4], temp_f31, 10.0f) == 0) {
|
||||
HuPrcVSleep();
|
||||
}
|
||||
BoardModelMotionShiftSet(lbl_1_bss_14[4], 0, 0.0f, 5.0f, HU3D_MOTATTR_LOOP);
|
||||
temp_f31 = 180.0 * (atan2((sp2C.x - sp50.x), (sp2C.z - sp50.z)) / M_PI);
|
||||
temp_f31 = atan2d(sp2C.x - sp50.x, sp2C.z - sp50.z);
|
||||
BoardPlayerMotBlendSet(lbl_1_bss_28, temp_f31, 0xF);
|
||||
|
||||
while (BoardPlayerMotBlendCheck(lbl_1_bss_28) == 0) {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@
|
|||
#include "game/board/window.h"
|
||||
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
|
||||
s16 lbl_1_bss_102[3];
|
||||
s16 lbl_1_bss_100;
|
||||
s16 lbl_1_bss_FE;
|
||||
|
|
@ -226,7 +229,7 @@ void fn_1_9F24(omObjData *arg0)
|
|||
temp_r31->unk_08++;
|
||||
}
|
||||
sp18 = temp_r31->unk_0C[temp_r31->unk_08];
|
||||
var_f31 = (180.0 * (atan2((sp18.x - sp24.x), (sp18.z - sp24.z)) / M_PI));
|
||||
var_f31 = atan2d(sp18.x - sp24.x, sp18.z - sp24.z);
|
||||
BoardPlayerRotYSet(lbl_1_bss_C0, var_f31);
|
||||
spC = temp_r31->unk_0C[temp_r31->unk_08];
|
||||
spC.y += 50.0f;
|
||||
|
|
@ -387,7 +390,7 @@ void fn_1_AB24(void)
|
|||
spC = temp_r30->data;
|
||||
BoardPlayerPosGet(lbl_1_bss_C0, &sp28);
|
||||
BoardModelPosGet(lbl_1_bss_14[5], &sp1C);
|
||||
var_f30 = (180.0 * (atan2((sp1C.z - sp28.z), (sp1C.x - sp28.x)) / M_PI));
|
||||
var_f30 = atan2d(sp1C.z - sp28.z, sp1C.x - sp28.x);
|
||||
BoardPlayerMotBlendSet(lbl_1_bss_C0, var_f30, 0xF);
|
||||
|
||||
while (BoardPlayerMotBlendCheck(lbl_1_bss_C0) == 0) {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
#include "game/board/model.h"
|
||||
#include "game/board/window.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
// data
|
||||
s32 lbl_1_data_310[2] = { 0x79, 0x7A };
|
||||
char *lbl_1_data_330[3] = { "suika1", "suika2", "suika3" };
|
||||
|
|
@ -459,7 +461,7 @@ void fn_1_80D8(omObjData *arg0)
|
|||
}
|
||||
if ((spC != 0) || (sp10 != 0)) {
|
||||
var_r29 = -1;
|
||||
var_f31 = (180.0 * (atan2(spC, sp10) / M_PI));
|
||||
var_f31 = atan2d(spC, sp10);
|
||||
if (var_f31 < 0.0f) {
|
||||
var_f31 += 360.0f;
|
||||
}
|
||||
|
|
@ -695,7 +697,7 @@ void fn_1_896C(void)
|
|||
var_r29 = (1 << var_r31);
|
||||
if ((temp_r30 & var_r29) != 0) {
|
||||
BoardModelPosGet(lbl_1_bss_A4[var_r31], &sp18);
|
||||
sp18.y = (sp18.y + (0.25 * sin((M_PI * var_f30) / 180.0)));
|
||||
sp18.y += 0.25 * sind(var_f30);
|
||||
BoardModelPosSetV(lbl_1_bss_A4[var_r31], &sp18);
|
||||
}
|
||||
}
|
||||
|
|
@ -810,8 +812,8 @@ void fn_1_9268(ModelData *model, ParticleData *particle, f32 (*matrix)[4])
|
|||
if (var_r28 != particle->unk_30) {
|
||||
temp_f30 = 360.0f * (0.003921569f * (s32)(frand() & 0xFF));
|
||||
temp_f29 = temp_f31 * (20.0f + (60.0f * (0.003921569f * (s32)(frand() & 0xFF))));
|
||||
var_r31->unk34.x = sp8.x + (temp_f29 * sin((M_PI * temp_f30) / 180.0));
|
||||
var_r31->unk34.z = sp8.z + (temp_f29 * cos((M_PI * temp_f30) / 180.0));
|
||||
var_r31->unk34.x = sp8.x + temp_f29 * sind(temp_f30);
|
||||
var_r31->unk34.z = sp8.z + temp_f29 * cosd(temp_f30);
|
||||
var_r31->unk34.y = sp8.y + (temp_f31 * (-30.0f + (40.0f * (0.003921569f * (s32)(frand() & 0xFF)))));
|
||||
var_r31->unk08.x = 0.5f + (3.0f * (0.003921569f * (s32)(frand() & 0xFF)));
|
||||
var_r31->unk08.y = 0.3f + (2.0f * (0.003921569f * (s32)(frand() & 0xFF)));
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ static void CoinChgAppear(omObjData *object, coinChg *coin_chg) {
|
|||
f32 angle;
|
||||
|
||||
OSu16tof32(&coin_chg->angle, &angle);
|
||||
angle = sin(M_PI * angle / 180.0);
|
||||
angle = sind(angle);
|
||||
scale = angle;
|
||||
object->rot.x = 405.0f * angle;
|
||||
BoardModelScaleSet(coin_chg->coin_model, scale, scale, scale);
|
||||
|
|
@ -342,8 +342,8 @@ static void CoinChgSeparate(omObjData *object, coinChg *coin_chg) {
|
|||
} else {
|
||||
spacing = 105.0f;
|
||||
}
|
||||
y_offset = (200.0 * sin((M_PI * (2.0f * x_scale)) / 180.0));
|
||||
x_scale = sin((M_PI * x_scale) / 180.0);
|
||||
y_offset = 200.0 * sind(2.0f * x_scale);
|
||||
x_scale = sind(x_scale);
|
||||
object->rot.x = 45.0f + (315.0f * x_scale);
|
||||
if (coin_chg->tens != 0) {
|
||||
coin_x = object->trans.x + (x_scale * -spacing);
|
||||
|
|
@ -379,7 +379,7 @@ static void CoinChgShow(omObjData* object, coinChg* coin_chg) {
|
|||
f32 y_pos;
|
||||
|
||||
OSu16tof32(&coin_chg->angle, &angle);
|
||||
angle = (f32) sin((M_PI * angle) / 180.0);
|
||||
angle = sind(angle);
|
||||
if (coin_chg->minus != 0) {
|
||||
y_pos = (-50.0f * angle) + object->trans.y;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "game/flag.h"
|
||||
#include "game/objsub.h"
|
||||
#include "game/process.h"
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
#define BLOCK_SPAWN 0
|
||||
#define BLOCK_HIT 2
|
||||
|
|
@ -312,7 +312,7 @@ static void SpawnBlock(BlockWork *arg0, omObjData *arg1)
|
|||
}
|
||||
|
||||
arg1->rot.y = rotY;
|
||||
arg1->scale.x = arg1->scale.y = arg1->scale.z = sin(M_PI * scaleAngle / 180.0);
|
||||
arg1->scale.x = arg1->scale.y = arg1->scale.z = sind(scaleAngle);
|
||||
}
|
||||
|
||||
static void HitBlock(BlockWork *arg0, omObjData *arg1)
|
||||
|
|
@ -325,7 +325,7 @@ static void HitBlock(BlockWork *arg0, omObjData *arg1)
|
|||
}
|
||||
|
||||
OSs16tof32(&arg0->hit_y_velocity, &var_f30);
|
||||
arg1->trans.y += 0.2f * sin((M_PI * var_f30) / 180.0);
|
||||
arg1->trans.y += 0.2f * sind(var_f30);
|
||||
}
|
||||
|
||||
static void OpenBlock(BlockWork *arg0, omObjData *arg1)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -12,6 +12,8 @@
|
|||
#include "game/board/tutorial.h"
|
||||
#include "game/board/window.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
// structs
|
||||
typedef struct structActiveMG {
|
||||
s16 unk_00;
|
||||
|
|
@ -767,7 +769,7 @@ static void SeparateStatus(bitcopy* arg0, omObjData* arg1) {
|
|||
return;
|
||||
}
|
||||
OSu8tof32((u8*)&arg0->unk_03, &temp_f29);
|
||||
temp_f30 = sin((temp_f29 * M_PI) / 180.0) * 4.0 + 1.0;
|
||||
temp_f30 = sind(temp_f29) * 4.0 + 1.0;
|
||||
arg0->unk_03 += 6;
|
||||
if (arg0->unk_03 > 0x5A) {
|
||||
arg0->unk_03 = 0x5A;
|
||||
|
|
@ -797,9 +799,9 @@ static void PopupVS(bitcopy* arg0, omObjData* arg1) {
|
|||
}
|
||||
OSs16tof32(&arg0->unk_04, &temp_f31);
|
||||
if (arg0->unk_04 < 0x5A) {
|
||||
var_f30 = 2.0 * sin((M_PI * temp_f31) / 180.0);
|
||||
var_f30 = 2.0 * sind(temp_f31);
|
||||
} else {
|
||||
var_f30 = 1.0 + sin((M_PI * temp_f31) / 180.0);
|
||||
var_f30 = 1.0 + sind(temp_f31);
|
||||
if (arg0->unk_04 >= 0xB4) {
|
||||
var_f30 = 1.0f;
|
||||
temp_r28 = (bitcopy*) mgSetupObj->work;
|
||||
|
|
@ -958,7 +960,7 @@ static void UpdateLuckyValue(bitcopy* arg0, omObjData* arg1) {
|
|||
case 1:
|
||||
if (arg0->unk_03 < 0x5A) {
|
||||
OSu8tof32((u8*) &arg0->unk_03, &temp_f28);
|
||||
temp_f29 = sin((M_PI * temp_f28) / 180.0);
|
||||
temp_f29 = sind(temp_f28);
|
||||
HuSprScaleSet(temp_r27->unk_00[0], 8, temp_f29, temp_f29);
|
||||
HuSprScaleSet(temp_r27->unk_00[0], 9, temp_f29, temp_f29);
|
||||
arg0->unk_03 += 2;
|
||||
|
|
@ -1006,7 +1008,7 @@ static void UpdateLuckyValue(bitcopy* arg0, omObjData* arg1) {
|
|||
return;
|
||||
}
|
||||
temp_f28 = (arg0->unk_04 % 360);
|
||||
temp_f29 = (1.0 + (0.5 * sin((M_PI * temp_f28) / 180.0)));
|
||||
temp_f29 = (1.0 + (0.5 * sind(temp_f28)));
|
||||
HuSprScaleSet(temp_r27->unk_00[0], 8, temp_f29, temp_f29);
|
||||
HuSprScaleSet(temp_r27->unk_00[0], 9, temp_f29, temp_f29);
|
||||
break;
|
||||
|
|
@ -1075,7 +1077,7 @@ static void UpdateMGList(bitcopy* arg0, omObjData* arg1) {
|
|||
case 1:
|
||||
if (arg0->unk_03 < 0x5A) {
|
||||
OSu8tof32((u8*) &arg0->unk_03, &var_f26);
|
||||
temp_f27 = sin((M_PI * var_f26) / 180.0);
|
||||
temp_f27 = sind(var_f26);
|
||||
arg0->unk_03 += 3;
|
||||
HuSprScaleSet(temp_r24->unk_00[0], temp_r22, temp_f27, temp_f27);
|
||||
return;
|
||||
|
|
@ -1166,7 +1168,7 @@ static void UpdateMGList(bitcopy* arg0, omObjData* arg1) {
|
|||
case 5:
|
||||
if (arg0->unk_03 < 0x5A) {
|
||||
OSu8tof32((u8*) &arg0->unk_03, &var_f26);
|
||||
temp_f27 = (1.0 + (2.0 * sin((M_PI * var_f26) / 180.0)));
|
||||
temp_f27 = (1.0 + (2.0 * sind(var_f26)));
|
||||
arg0->unk_03 += 4;
|
||||
if (arg0->unk_03 > 0x5A) {
|
||||
arg0->unk_03 = 0x5A;
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ static void ExitBox(ItemGiveWork2* arg0, omObjData* arg1) {
|
|||
}
|
||||
|
||||
arg1->trans.y = spC.y + (700.0f * cosd(arg0->unk_08));
|
||||
arg1->rot.y = sin((M_PI * temp) / 180.0);
|
||||
arg1->rot.y = sind(temp);
|
||||
arg0->unk_08 -= 1.5f;
|
||||
arg0->unk_06 -= 30;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include "game/board/window.h"
|
||||
|
||||
#include "dolphin.h"
|
||||
#include "ext_math.h"
|
||||
#include "string.h"
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -238,7 +239,7 @@ static void ShowLogo(void) {
|
|||
HuSprGrpPosSet(logoSprGrp, 288.0f, 240.0f);
|
||||
for (spA = 0; spA < 90; spA += 4) {
|
||||
OSs16tof32(&spA, &var_f27);
|
||||
temp_f28 = sin(var_f27 * M_PI / 180.0);
|
||||
temp_f28 = sind(var_f27);
|
||||
HuSprScaleSet(logoSprGrp, 0, temp_f28, temp_f28);
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
@ -246,7 +247,7 @@ static void ShowLogo(void) {
|
|||
for (spA = 0; spA < 540; spA += 4) {
|
||||
sp8 = spA % 180;
|
||||
OSs16tof32(&sp8, &var_f27);
|
||||
temp_f28 = 1.0 + 0.699999988079071 * sin(var_f27 * M_PI / 180.0);
|
||||
temp_f28 = 1.0 + 0.7f * sind(var_f27);
|
||||
HuSprScaleSet(logoSprGrp, 0, temp_f28, temp_f28);
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
@ -254,7 +255,7 @@ static void ShowLogo(void) {
|
|||
HuPrcSleep(0x78);
|
||||
for (spA = 0; spA < 90; spA += 4) {
|
||||
OSs16tof32(&spA, &var_f27);
|
||||
temp_f28 = cos(var_f27 * M_PI / 180.0);
|
||||
temp_f28 = cosd(var_f27);
|
||||
HuSprScaleSet(logoSprGrp, 0, temp_f28, temp_f28);
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
@ -586,7 +587,7 @@ static void PlayerDiceNumHide(omObjData *arg0, PlayerStartWork *arg1) {
|
|||
arg1->unk02 = 2;
|
||||
}
|
||||
OSs16tof32(&arg1->unk06, &var_f28);
|
||||
arg0->rot.x = 1.0 + 1.2999999523162842 * sin(var_f28 * M_PI / 180.0);
|
||||
arg0->rot.x = 1.0 + 1.3f * sind(var_f28);
|
||||
break;
|
||||
case 2:
|
||||
arg1->unk06 += 9;
|
||||
|
|
@ -595,8 +596,8 @@ static void PlayerDiceNumHide(omObjData *arg0, PlayerStartWork *arg1) {
|
|||
arg1->unk02 = 3;
|
||||
}
|
||||
OSs16tof32(&arg1->unk06, &var_f28);
|
||||
arg0->rot.x = cos(0.5f * var_f28 * M_PI / 180.0);
|
||||
arg0->rot.y = 1.0 + 1.2999999523162842 * sin(var_f28 * M_PI / 180.0);
|
||||
arg0->rot.x = cosd(0.5f * var_f28);
|
||||
arg0->rot.y = 1.0 + 1.3f * sind(var_f28);
|
||||
break;
|
||||
case 3:
|
||||
BoardModelVisibilitySet(arg1->unk0A, 0);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "game/objsub.h"
|
||||
#include "game/disp.h"
|
||||
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
static void WarpInit(s32);
|
||||
static void WarpLaunch(s32);
|
||||
|
|
@ -234,7 +234,7 @@ static void WarpImpact(s32 player) {
|
|||
speed = 4.0f;
|
||||
|
||||
for (angle = 0.0f, temp = angle; angle < 180.0f; angle += speed) {
|
||||
temp_f30 = sin((M_PI * angle) / 180.0);
|
||||
temp_f30 = sind(angle);
|
||||
BoardModelScaleSet(warpImpactMdl, 0.5f + temp_f30, 0.5f + temp_f30, 0.5f + temp_f30);
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
@ -245,4 +245,4 @@ static void WarpImpact(s32 player) {
|
|||
BoardPlayerIdleSet(warpImpactPlayer[i]);
|
||||
}
|
||||
warpState = 6;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "game/hsfmotion.h"
|
||||
#include "game/disp.h"
|
||||
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
#define DISP_HALF_W (HU_DISP_WIDTH/2.0f)
|
||||
#define DISP_HALF_H (HU_DISP_HEIGHT/2.0f)
|
||||
|
|
@ -129,10 +129,10 @@ void CamMotionEx(s16 arg0, s16 arg1, Vec *arg2, Vec *arg3, Vec *arg4, float arg5
|
|||
var_f30 = var_f31;
|
||||
break;
|
||||
case 1:
|
||||
var_f30 = arg5 * sin(90.0f * (var_f31 / arg5) * M_PI / 180.0);
|
||||
var_f30 = arg5 * sind(90.0f * (var_f31 / arg5));
|
||||
break;
|
||||
case 2:
|
||||
var_f30 = arg5 * (1.0 - cos(90.0f * (var_f31 / arg5) * M_PI / 180.0));
|
||||
var_f30 = arg5 * (1.0 - cosd(90.0f * (var_f31 / arg5)));
|
||||
break;
|
||||
}
|
||||
var_r31 = temp_r21;
|
||||
|
|
@ -346,9 +346,9 @@ static void SetObjCamMotion(s16 arg0, HsfTrack *arg1, float arg2, HsfexStruct02
|
|||
case 14:
|
||||
VECSubtract(&arg3->unk08, &arg3->unk20, &spC);
|
||||
VECNormalize(&spC, &spC);
|
||||
sp18.x = spC.x * spC.y * (1.0 - cos(M_PI * arg2 / 180.0)) - spC.z * sin(M_PI * arg2 / 180.0);
|
||||
sp18.y = spC.y * spC.y + (1.0f - spC.y * spC.y) * cos(M_PI * arg2 / 180.0);
|
||||
sp18.z = spC.y * spC.z * (1.0 - cos(M_PI * arg2 / 180.0)) + spC.x * sin(M_PI * arg2 / 180.0);
|
||||
sp18.x = spC.x * spC.y * (1.0 - cosd(arg2)) - spC.z * sind(arg2);
|
||||
sp18.y = spC.y * spC.y + (1.0f - spC.y * spC.y) * cosd(arg2);
|
||||
sp18.z = spC.y * spC.z * (1.0 - cosd(arg2)) + spC.x * sind(arg2);
|
||||
VECNormalize(&sp18, &arg3->unk14);
|
||||
break;
|
||||
}
|
||||
|
|
@ -432,7 +432,7 @@ void Hu3D2Dto3D(Vec *arg0, s16 arg1, Vec *arg2) {
|
|||
}
|
||||
}
|
||||
temp_r31 = &Hu3DCamera[i];
|
||||
temp_f30 = sin((temp_r31->fov / 2) * M_PI / 180.0) / cos((temp_r31->fov / 2) * M_PI / 180.0);
|
||||
temp_f30 = sind(temp_r31->fov / 2) / cosd(temp_r31->fov / 2);
|
||||
temp_f31 = temp_f30 * arg0->z * 2.0f;
|
||||
temp_f29 = temp_f31 * HU_DISP_ASPECT;
|
||||
temp_f28 = arg0->x / HU_DISP_WIDTH;
|
||||
|
|
@ -461,8 +461,8 @@ void Hu3D3Dto2D(Vec *arg0, s16 arg1, Vec *arg2) {
|
|||
temp_r31 = &Hu3DCamera[i];
|
||||
C_MTXLookAt(sp1C, &temp_r31->pos, &temp_r31->up, &temp_r31->target);
|
||||
PSMTXMultVec(sp1C, arg0, &sp10);
|
||||
temp_f31 = (sin((temp_r31->fov / 2) * M_PI / 180.0) / cos((temp_r31->fov / 2) * M_PI / 180.0)) * sp10.z * HU_DISP_ASPECT;
|
||||
temp_f30 = (sin((temp_r31->fov / 2) * M_PI / 180.0) / cos((temp_r31->fov / 2) * M_PI / 180.0)) * sp10.z;
|
||||
temp_f31 = (sind(temp_r31->fov / 2) / cosd(temp_r31->fov / 2)) * sp10.z * HU_DISP_ASPECT;
|
||||
temp_f30 = (sind(temp_r31->fov / 2) / cosd(temp_r31->fov / 2)) * sp10.z;
|
||||
arg2->x = DISP_HALF_W + sp10.x * (DISP_HALF_W / -temp_f31);
|
||||
arg2->y = DISP_HALF_H + sp10.y * (DISP_HALF_H / temp_f30);
|
||||
arg2->z = 0.0f;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "game/sprite.h"
|
||||
#include "game/hsfman.h"
|
||||
#include "game/audio.h"
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
Vec CRot;
|
||||
Vec Center;
|
||||
|
|
@ -23,15 +23,15 @@ void omOutView(omObjData *object)
|
|||
float rot_x = CRot.x;
|
||||
float rot_y = CRot.y;
|
||||
float rot_z = CRot.z;
|
||||
pos.x = (sin(M_PI*rot_y/180.0)*cos(M_PI*rot_x/180.0)*CZoom)+Center.x;
|
||||
pos.y = (-sin(M_PI*rot_x/180.0)*CZoom)+Center.y;
|
||||
pos.z = (cos(M_PI*rot_y/180.0)*cos(M_PI*rot_x/180.0)*CZoom)+Center.z;
|
||||
pos.x = (sind(rot_y)*cosd(rot_x)*CZoom)+Center.x;
|
||||
pos.y = (-sind(rot_x)*CZoom)+Center.y;
|
||||
pos.z = (cosd(rot_y)*cosd(rot_x)*CZoom)+Center.z;
|
||||
target.x = Center.x;
|
||||
target.y = Center.y;
|
||||
target.z = Center.z;
|
||||
up.x = sin(M_PI*rot_y/180.0)*sin(M_PI*rot_x/180.0);
|
||||
up.y = cos(M_PI*rot_x/180.0);
|
||||
up.z = cos(M_PI*rot_y/180.0)*sin(M_PI*rot_x/180.0);
|
||||
up.x = sind(rot_y)*sind(rot_x);
|
||||
up.y = cosd(rot_x);
|
||||
up.z = cosd(rot_y)*sind(rot_x);
|
||||
Hu3DCameraPosSet(1, pos.x, pos.y, pos.z, up.x, up.y, up.z, target.x, target.y, target.z);
|
||||
}
|
||||
|
||||
|
|
@ -43,15 +43,15 @@ void omOutViewMulti(omObjData *object)
|
|||
float rot_x = CRotM[i].x;
|
||||
float rot_y = CRotM[i].y;
|
||||
float rot_z = CRotM[i].z;
|
||||
pos.x = (sin(M_PI*rot_y/180.0)*cos(M_PI*rot_x/180.0)*CZoomM[i])+CenterM[i].x;
|
||||
pos.y = (-sin(M_PI*rot_x/180.0)*CZoomM[i])+CenterM[i].y;
|
||||
pos.z = (cos(M_PI*rot_y/180.0)*cos(M_PI*rot_x/180.0)*CZoomM[i])+CenterM[i].z;
|
||||
pos.x = (sind(rot_y)*cosd(rot_x)*CZoomM[i])+CenterM[i].x;
|
||||
pos.y = (-sind(rot_x)*CZoomM[i])+CenterM[i].y;
|
||||
pos.z = (cosd(rot_y)*cosd(rot_x)*CZoomM[i])+CenterM[i].z;
|
||||
target.x = CenterM[i].x;
|
||||
target.y = CenterM[i].y;
|
||||
target.z = CenterM[i].z;
|
||||
up.x = sin(M_PI*rot_y/180.0)*sin(M_PI*rot_x/180.0);
|
||||
up.y = cos(M_PI*rot_x/180.0);
|
||||
up.z = cos(M_PI*rot_y/180.0)*sin(M_PI*rot_x/180.0);
|
||||
up.x = sind(rot_y)*sind(rot_x);
|
||||
up.y = cosd(rot_x);
|
||||
up.z = cosd(rot_y)*sind(rot_x);
|
||||
Hu3DCameraPosSetV((1 << i), &pos, &up, &target);
|
||||
}
|
||||
}
|
||||
|
|
@ -145,4 +145,4 @@ void omSysPauseCtrl(s16 flag)
|
|||
} else {
|
||||
omDBGSysKeyObj->work[0] |= 0x100;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue