Introducing z64camera.h (#797)

* Introduce z64camera.h

* format

* Oops

* Change paramData to u8

* BINANG_TO_DEGF and DEGF_TO_BINANG to z64camera.h

* Fix bss, thanks Anon

* Update with docs from OoT

* Cleanup

* Fix activeCamId

* underwater

* remove interface alpha stuff

* Oops

* To Hex

* Cleanup cam settings comments

* PR Suggestions

* More PR Suggestions

* trackActor -> focalActor

* Fix merge

* Fix bss, thanks Anon
This commit is contained in:
engineer124
2022-07-12 00:25:40 -04:00
committed by GitHub
parent 628482f3c4
commit fda5da2500
45 changed files with 492 additions and 175 deletions
+4 -4
View File
@@ -1343,7 +1343,7 @@ void Actor_SetCameraHorseSetting(PlayState* play, Player* player) {
EnHorse* rideActor = (EnHorse*)player->rideActor;
if ((rideActor != NULL) && !(rideActor->unk_1EC & 0x10)) {
func_800DFAC8(Play_GetCamera(play, CAM_ID_MAIN), 4);
Camera_ChangeSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_HORSE);
}
}
}
@@ -2508,10 +2508,10 @@ void Actor_Draw(PlayState* play, Actor* actor) {
Lights_Draw(light, play->state.gfxCtx);
if (actor->flags & ACTOR_FLAG_1000) {
Matrix_SetTranslateRotateYXZ(actor->world.pos.x + play->mainCamera.skyboxOffset.x,
Matrix_SetTranslateRotateYXZ(actor->world.pos.x + play->mainCamera.quakeOffset.x,
actor->world.pos.y +
((actor->shape.yOffset * actor->scale.y) + play->mainCamera.skyboxOffset.y),
actor->world.pos.z + play->mainCamera.skyboxOffset.z, &actor->shape.rot);
((actor->shape.yOffset * actor->scale.y) + play->mainCamera.quakeOffset.y),
actor->world.pos.z + play->mainCamera.quakeOffset.z, &actor->shape.rot);
} else {
Matrix_SetTranslateRotateYXZ(actor->world.pos.x, actor->world.pos.y + (actor->shape.yOffset * actor->scale.y),
actor->world.pos.z, &actor->shape.rot);
+4 -4
View File
@@ -318,7 +318,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DF8EC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFAC8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ChangeSetting.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ChangeDataIdx.s")
@@ -328,13 +328,13 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetInputDirYaw.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFC90.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetCamDir.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetCamDirPitch.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetCamDirYaw.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFD04.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_AddQuake.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFD78.s")
@@ -350,7 +350,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ClearFlags.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFFAC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ChangeDoorCam.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E007C.s")
+4 -4
View File
@@ -123,14 +123,14 @@ VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec) {
if ((dist == 0.0f) && (vec->y == 0.0f)) {
sph.pitch = 0;
} else {
sph.pitch = DEGF_TO_BINANG(RADF_TO_DEGF(func_80086B30(dist, vec->y)));
sph.pitch = CAM_DEG_TO_BINANG(RADF_TO_DEGF(func_80086B30(dist, vec->y)));
}
sph.r = sqrtf(SQ(vec->y) + distSquared);
if ((vec->x == 0.0f) && (vec->z == 0.0f)) {
sph.yaw = 0;
} else {
sph.yaw = DEGF_TO_BINANG(RADF_TO_DEGF(func_80086B30(vec->x, vec->z)));
sph.yaw = CAM_DEG_TO_BINANG(RADF_TO_DEGF(func_80086B30(vec->x, vec->z)));
}
*dest = sph;
@@ -238,8 +238,8 @@ Vec3s* OLib_Vec3fDiffBinAng(Vec3s* dest, Vec3f* a, Vec3f* b) {
OLib_Vec3fDiffRad(&anglesRad, a, b);
anglesBinAng.x = DEGF_TO_BINANG(RADF_TO_DEGF(anglesRad.x));
anglesBinAng.y = DEGF_TO_BINANG(RADF_TO_DEGF(anglesRad.y));
anglesBinAng.x = CAM_DEG_TO_BINANG(RADF_TO_DEGF(anglesRad.x));
anglesBinAng.y = CAM_DEG_TO_BINANG(RADF_TO_DEGF(anglesRad.y));
anglesBinAng.z = 0.0f;
*dest = anglesBinAng;
+2 -2
View File
@@ -756,8 +756,8 @@ void Distortion_Update(void) {
return;
}
depthPhase += DEGF_TO_BINANG(depthPhaseStep);
screenPlanePhase += DEGF_TO_BINANG(screenPlanePhaseStep);
depthPhase += CAM_DEG_TO_BINANG(depthPhaseStep);
screenPlanePhase += CAM_DEG_TO_BINANG(screenPlanePhaseStep);
View_SetDistortionDirRot(&sDistortionContext.play->view,
Math_CosS(depthPhase) * (DEGF_TO_RADF(rotX) * xyScaleFactor),