mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 22:44:30 +00:00
Split remaining z_camera files (#98)
* split func_800473A0.s * split func_80051B3C.s * split func_80054478 * split func_8004B5A0, match a few functions * rename Matrix_TranslateThenRotateZYX to Matrix_RotateRPYf (#96) * rename Matrix_TranslateThenRotateZYX to Matrix_RotateRPYf * rename Matrix_RotateRPYf to Matrix_JointPosition * rename Matrix_RotateZYX to Matrix_RotateRPY * extract camera floats, and jump tables * decompile baby functions priv_wip wip * rename struct_80045714 to VecSph
This commit is contained in:
parent
58e38276c6
commit
16b304d548
61 changed files with 16903 additions and 16217 deletions
|
@ -1,7 +1,7 @@
|
|||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1);
|
||||
Vec3f* func_8007C1AC(Vec3f* dest, VecSph* arg1);
|
||||
|
||||
f32 func_8007BF90(Vec3f* a, Vec3f* b) {
|
||||
f32 dx = a->x - b->x;
|
||||
|
@ -51,39 +51,39 @@ Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b) {
|
|||
return dest;
|
||||
}
|
||||
|
||||
Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1) {
|
||||
Vec3f* func_8007C1AC(Vec3f* dest, VecSph* arg1) {
|
||||
Vec3f v;
|
||||
f32 sin4;
|
||||
f32 cos4;
|
||||
f32 sin6;
|
||||
f32 cos6;
|
||||
|
||||
cos4 = Math_Coss(arg1->unk_04);
|
||||
cos6 = Math_Coss(arg1->unk_06);
|
||||
sin4 = Math_Sins(arg1->unk_04);
|
||||
sin6 = Math_Sins(arg1->unk_06);
|
||||
cos4 = Math_Coss(arg1->phi);
|
||||
cos6 = Math_Coss(arg1->theta);
|
||||
sin4 = Math_Sins(arg1->phi);
|
||||
sin6 = Math_Sins(arg1->theta);
|
||||
|
||||
v.x = arg1->unk_00 * sin4 * sin6;
|
||||
v.y = arg1->unk_00 * cos4;
|
||||
v.z = arg1->unk_00 * sin4 * cos6;
|
||||
v.x = arg1->r * sin4 * sin6;
|
||||
v.y = arg1->r * cos4;
|
||||
v.z = arg1->r * sin4 * cos6;
|
||||
|
||||
*dest = v;
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
void func_8007C25C(Vec3f* dest, struct_80045714* arg1) {
|
||||
struct_80045714 var;
|
||||
void func_8007C25C(Vec3f* dest, VecSph* arg1) {
|
||||
VecSph var;
|
||||
|
||||
var.unk_00 = arg1->unk_00;
|
||||
var.unk_04 = 0x3FFF - arg1->unk_04;
|
||||
var.unk_06 = arg1->unk_06;
|
||||
var.r = arg1->r;
|
||||
var.phi = 0x3FFF - arg1->phi;
|
||||
var.theta = arg1->theta;
|
||||
|
||||
func_8007C1AC(dest, &var);
|
||||
}
|
||||
|
||||
struct_80045714* func_8007C29C(struct_80045714* arg0, Vec3f* arg1) {
|
||||
struct_80045714 sp28;
|
||||
VecSph* func_8007C29C(VecSph* arg0, Vec3f* arg1) {
|
||||
VecSph sp28;
|
||||
|
||||
f32 distSquared;
|
||||
f32 dist;
|
||||
|
@ -92,16 +92,16 @@ struct_80045714* func_8007C29C(struct_80045714* arg0, Vec3f* arg1) {
|
|||
dist = sqrtf(distSquared);
|
||||
|
||||
if ((dist == 0.0f) && (arg1->y == 0.0f)) {
|
||||
sp28.unk_04 = 0;
|
||||
sp28.phi = 0;
|
||||
} else {
|
||||
sp28.unk_04 = Math_atan2f(dist, arg1->y) * 57.295776f * 182.04167f + 0.5f;
|
||||
sp28.phi = Math_atan2f(dist, arg1->y) * 57.295776f * 182.04167f + 0.5f;
|
||||
}
|
||||
|
||||
sp28.unk_00 = sqrtf(SQ(arg1->y) + distSquared);
|
||||
sp28.r = sqrtf(SQ(arg1->y) + distSquared);
|
||||
if ((arg1->x == 0.0f) && (arg1->z == 0.0f)) {
|
||||
sp28.unk_06 = 0;
|
||||
sp28.theta = 0;
|
||||
} else {
|
||||
sp28.unk_06 = Math_atan2f(arg1->x, arg1->z) * 57.295776f * 182.04167f + 0.5f;
|
||||
sp28.theta = Math_atan2f(arg1->x, arg1->z) * 57.295776f * 182.04167f + 0.5f;
|
||||
}
|
||||
|
||||
*arg0 = sp28;
|
||||
|
@ -109,18 +109,18 @@ struct_80045714* func_8007C29C(struct_80045714* arg0, Vec3f* arg1) {
|
|||
return arg0;
|
||||
}
|
||||
|
||||
struct_80045714* func_8007C3F4(struct_80045714* arg0, Vec3f* arg1) {
|
||||
struct_80045714 sp18;
|
||||
VecSph* func_8007C3F4(VecSph* arg0, Vec3f* arg1) {
|
||||
VecSph sp18;
|
||||
|
||||
func_8007C29C(&sp18, arg1);
|
||||
sp18.unk_04 = 0x3FFF - sp18.unk_04;
|
||||
sp18.phi = 0x3FFF - sp18.phi;
|
||||
|
||||
*arg0 = sp18;
|
||||
|
||||
return arg0;
|
||||
}
|
||||
|
||||
void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b) {
|
||||
void func_8007C440(VecSph* arg0, Vec3f* a, Vec3f* b) {
|
||||
Vec3f var;
|
||||
|
||||
var.x = b->x - a->x;
|
||||
|
@ -130,7 +130,7 @@ void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b) {
|
|||
func_8007C29C(arg0, &var);
|
||||
}
|
||||
|
||||
void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b) {
|
||||
void func_8007C490(VecSph* arg0, Vec3f* a, Vec3f* b) {
|
||||
Vec3f var;
|
||||
|
||||
var.x = b->x - a->x;
|
||||
|
|
|
@ -975,7 +975,7 @@ f32 Actor_HeightDiff(Actor* actorA, Actor* actorB) {
|
|||
return actorB->posRot.pos.y - actorA->posRot.pos.y;
|
||||
}
|
||||
|
||||
f32 func_8002DC84(Player* player) {
|
||||
f32 Player_GetCameraYOffset(Player* player) {
|
||||
f32 offset = (player->stateFlags1 & 0x800000) ? 32.0f : 0.0f;
|
||||
|
||||
if (LINK_IS_ADULT) {
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -232,7 +232,7 @@ void Gameplay_Init(GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
globalCtx->cameraPtrs[0] = &globalCtx->cameras[0];
|
||||
globalCtx->cameraPtrs[0]->unk_130 = 0;
|
||||
globalCtx->cameraPtrs[0]->uid = 0;
|
||||
globalCtx->activeCamera = 0;
|
||||
func_8005AC48(&globalCtx->cameras[0], 0xFF);
|
||||
func_800A9D28(globalCtx, &globalCtx->sub_1F74);
|
||||
|
@ -1719,7 +1719,7 @@ s16 func_800C09A4(GlobalContext* globalCtx, s16 camId) {
|
|||
Camera* camera = globalCtx->cameraPtrs[camId];
|
||||
|
||||
if (camera != NULL) {
|
||||
return camera->unk_130;
|
||||
return camera->uid;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
@ -1730,9 +1730,9 @@ s16 func_800C09D8(GlobalContext* globalCtx, s16 camId, s16 arg2) {
|
|||
|
||||
if (camera != NULL) {
|
||||
return 0;
|
||||
} else if (camera->unk_130 != arg2) {
|
||||
} else if (camera->uid != arg2) {
|
||||
return 0;
|
||||
} else if (camera->unk_140 != 7) {
|
||||
} else if (camera->status != 7) {
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
|
|
|
@ -9,7 +9,7 @@ s16 (*sQuakeCallbacks[])(QuakeRequest*, ShakeInfo*) = {
|
|||
NULL, Quake_Callback1, Quake_Callback2, Quake_Callback3, Quake_Callback4, Quake_Callback5, Quake_Callback6,
|
||||
};
|
||||
|
||||
Vec3f* Quake_AddVec(Vec3f* dst, Vec3f* arg1, struct_80045714* arg2) {
|
||||
Vec3f* Quake_AddVec(Vec3f* dst, Vec3f* arg1, VecSph* arg2) {
|
||||
Vec3f vec1;
|
||||
Vec3f vec2;
|
||||
|
||||
|
@ -22,12 +22,12 @@ Vec3f* Quake_AddVec(Vec3f* dst, Vec3f* arg1, struct_80045714* arg2) {
|
|||
}
|
||||
|
||||
void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
|
||||
Vec3f* unk50 = &req->cam->unk_50;
|
||||
Vec3f* unk5C = &req->cam->unk_5C;
|
||||
Vec3f* unk50 = &req->cam->at;
|
||||
Vec3f* unk5C = &req->cam->eye;
|
||||
|
||||
Vec3f vec;
|
||||
struct_80045714 struc2;
|
||||
struct_80045714 struc1;
|
||||
VecSph struc2;
|
||||
VecSph struc1;
|
||||
Vec3f vec2;
|
||||
|
||||
if (req->unk_1C) {
|
||||
|
@ -35,21 +35,21 @@ void Quake_UpdateShakeInfo(QuakeRequest* req, ShakeInfo* shake, f32 y, f32 x) {
|
|||
vec.y = 0;
|
||||
vec.z = 0;
|
||||
func_8007C490(&struc1, unk5C, unk50);
|
||||
struc2.unk_00 = req->y * y;
|
||||
struc2.unk_04 = struc1.unk_04 + req->unk_14.unk_00 + 0x4000;
|
||||
struc2.unk_06 = struc1.unk_06 + req->unk_14.unk_02;
|
||||
struc2.r = req->y * y;
|
||||
struc2.phi = struc1.phi + req->unk_14.unk_00 + 0x4000;
|
||||
struc2.theta = struc1.theta + req->unk_14.unk_02;
|
||||
Quake_AddVec(&vec, &vec, &struc2);
|
||||
struc2.unk_00 = req->x * x;
|
||||
struc2.unk_04 = struc1.unk_04 + req->unk_14.unk_00;
|
||||
struc2.unk_06 = struc1.unk_06 + req->unk_14.unk_02 + 0x4000;
|
||||
struc2.r = req->x * x;
|
||||
struc2.phi = struc1.phi + req->unk_14.unk_00;
|
||||
struc2.theta = struc1.theta + req->unk_14.unk_02 + 0x4000;
|
||||
Quake_AddVec(&vec, &vec, &struc2);
|
||||
} else {
|
||||
vec.x = 0;
|
||||
vec.y = req->y * y;
|
||||
vec.z = 0;
|
||||
struc2.unk_00 = req->x * x;
|
||||
struc2.unk_04 = req->unk_14.unk_00;
|
||||
struc2.unk_06 = req->unk_14.unk_02;
|
||||
struc2.r = req->x * x;
|
||||
struc2.phi = req->unk_14.unk_00;
|
||||
struc2.theta = req->unk_14.unk_02;
|
||||
Quake_AddVec(&vec, &vec, &struc2);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue