mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-15 06:10:58 -04:00
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:
+4
-4
@@ -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
@@ -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
@@ -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
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user