summaryrefslogtreecommitdiff
path: root/soh
diff options
context:
space:
mode:
authorPhilip Dubé <159546+serprex@users.noreply.github.com>2026-07-13 04:56:00 +0000
committerGitHub <noreply@github.com>2026-07-13 04:56:00 +0000
commitff7eb482d4c8b2cab93b2123e231bcb64f285160 (patch)
treee0d6c93c901723c5374653eb9f12b1816229820f /soh
parentde8edbf1363061eaf79c7f4ac34a4336bdc113d7 (diff)
Don't point free cam at sky coming out of crawlspace (#6920)
Diffstat (limited to 'soh')
-rw-r--r--soh/src/code/z_camera.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c
index 68bc909e2..e2886629e 100644
--- a/soh/src/code/z_camera.c
+++ b/soh/src/code/z_camera.c
@@ -1451,15 +1451,16 @@ s32 Camera_Free(Camera* camera) {
Parallel1* para1 = (Parallel1*)camera->paramData;
f32 playerHeight;
- // SOH [Enhancement] If free-look is resuming after a scene-forced/fixed camera drove the view
- // (Camera_Free didn't run last frame while manualCamera stayed set, e.g. exiting a Spirit Temple
- // alcove), re-seed the free-look angles from the camera's current orientation so the view continues
- // from where it was left instead of snapping back to the pre-interruption angle.
+ // SOH [Enhancement] If free-look resuming after another camera drove view (e.g. Spirit Temple alcove,
+ // or crawling), re-seed free-look angles so view continues from where it was left instead of snapping
+ // back to the pre-interruption angle. Seed from play->view (what was actually on screen last frame),
+ // not camera->at/eye: for a subcamera-driven OnePoint cutscene like crawlspace exit, main camera's own
+ // eye is left stale and aims re-seed at sky, while play->view still holds cutscene's final framing of Link.
static s32 sFreeLastFrame = 0;
s32 curFrame = camera->play->state.frames;
if (curFrame - sFreeLastFrame > 1) {
VecSph eyeAdjustment;
- OLib_Vec3fDiffToVecSphGeo(&eyeAdjustment, &camera->at, &camera->eye);
+ OLib_Vec3fDiffToVecSphGeo(&eyeAdjustment, &camera->play->view.lookAt, &camera->play->view.eye);
camera->play->camX = eyeAdjustment.yaw;
camera->play->camY = eyeAdjustment.pitch;
}