match m409dll, implement some cosd/sind
This commit is contained in:
parent
13012f05ca
commit
9dfae92fe2
14 changed files with 1501 additions and 203 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include "game/objsub.h"
|
||||
#include "game/gamework_data.h"
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
typedef struct bit_copy {
|
||||
|
|
@ -409,11 +410,11 @@ static void CoinChgDisappear(omObjData* object, coinChg* coin_chg) {
|
|||
|
||||
OSu16tof32(&angle, &rot);
|
||||
if (angle <= 90.0f) {
|
||||
object->scale.x = 0.5 * cos((M_PI * rot) / 180.0);
|
||||
object->scale.y = 2.5 * sin((M_PI * rot) / 180.0);
|
||||
object->scale.x = 0.5 * cosd(rot);
|
||||
object->scale.y = 2.5 * sind(rot);
|
||||
} else {
|
||||
object->scale.x = 2.5 * sin((M_PI * rot) / 180.0);
|
||||
object->scale.y = 0.5 * cos((M_PI * rot) / 180.0);
|
||||
object->scale.x = 2.5 * sind(rot);
|
||||
object->scale.y = 0.5 * cosd(rot);
|
||||
}
|
||||
if (0.0f == object->scale.x) {
|
||||
object->scale.x = 0.0001f;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include "game/objsub.h"
|
||||
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
extern s32 boardTutorialData[4];
|
||||
|
||||
|
|
@ -277,7 +278,7 @@ static void ShowBox(ItemGiveWork2* arg0, omObjData* arg1) {
|
|||
}
|
||||
|
||||
OSs16tof32(&arg0->unk_06, &arg1->rot.y);
|
||||
arg1->trans.y = (sp8.y + (700.0f * cos((M_PI * (f64) arg0->unk_08) / 180.0)));
|
||||
arg1->trans.y = (sp8.y + (700.0f * cosd(arg0->unk_08)));
|
||||
arg0->unk_08 += 1.5f;
|
||||
arg0->unk_06 += 30;
|
||||
}
|
||||
|
|
@ -298,7 +299,7 @@ static void ExitBox(ItemGiveWork2* arg0, omObjData* arg1) {
|
|||
arg0->unk00_field2 = 1;
|
||||
}
|
||||
|
||||
arg1->trans.y = spC.y + (700.0f * cos((M_PI * arg0->unk_08) / 180.0));
|
||||
arg1->trans.y = spC.y + (700.0f * cosd(arg0->unk_08));
|
||||
arg1->rot.y = sin((M_PI * temp) / 180.0);
|
||||
arg0->unk_08 -= 1.5f;
|
||||
arg0->unk_06 -= 30;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include "game/pad.h"
|
||||
#include "stdlib.h"
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
static void InitJunction(s32, s32, f32);
|
||||
static void UpdateJunctionGfx(omObjData*);
|
||||
|
|
@ -1042,7 +1043,7 @@ static void InitJunction(s32 arg0, s32 arg1, f32 arg8) {
|
|||
BoardModelLayerSet(temp_r29->unk_06[var_r27], 6);
|
||||
sp5C.x = sp68.x + (100.0 * sin((M_PI * angle) / 180.0));
|
||||
sp5C.y = 300.0f + sp68.y;
|
||||
sp5C.z = (var_f29 + (sp68.z + (100.0 * cos((M_PI * angle) / 180.0))));
|
||||
sp5C.z = (var_f29 + (sp68.z + (100.0 * cosd(angle))));
|
||||
BoardModelPosSetV(temp_r29->unk_06[var_r27], &sp5C);
|
||||
BoardModelScaleSet(temp_r29->unk_06[var_r27], var_r28->scale.x, var_r28->scale.y, var_r28->scale.z);
|
||||
var_r27++;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#include "dolphin/gx/GXVert.h"
|
||||
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
ModelData Hu3DData[0x200];
|
||||
CameraData Hu3DCamera[0x10];
|
||||
|
|
@ -1277,9 +1278,9 @@ BOOL Hu3DModelCameraInfoSet(s16 arg0, u16 arg1) {
|
|||
|
||||
PSVECSubtract((Point3d* ) &obj_copy->camera.target, (Point3d* ) &obj_copy->camera.pos, &sp8);
|
||||
|
||||
sp14.x = ((sp8.x * sp8.y * (1.0 - cos((M_PI * temp_f31) / 180.0))) - (sp8.z * sin((M_PI * temp_f31) / 180.0)));
|
||||
sp14.y = ((sp8.y * sp8.y) + (1.0f - (sp8.y * sp8.y)) * cos((M_PI * temp_f31) / 180.0));
|
||||
sp14.z = (((sp8.y * sp8.z) * (1.0 - cos((M_PI * (f64) temp_f31) / 180.0))) + (sp8.x * sin((M_PI * temp_f31) / 180.0)));
|
||||
sp14.x = ((sp8.x * sp8.y * (1.0 - cosd(temp_f31))) - (sp8.z * sind(temp_f31)));
|
||||
sp14.y = ((sp8.y * sp8.y) + (1.0f - (sp8.y * sp8.y)) * cosd(temp_f31));
|
||||
sp14.z = (((sp8.y * sp8.z) * (1.0 - cosd(temp_f31))) + (sp8.x * sind(temp_f31)));
|
||||
PSVECNormalize(&sp14, &sp8);
|
||||
|
||||
Hu3DCameraPosSet(arg1, obj_copy->camera.target.x, obj_copy->camera.target.y, obj_copy->camera.target.z,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue