Skip to content

fix: FPV camera points wrong way when loading a Parthenon URL until you move the mouse#30

Merged
apresmoi merged 1 commit into
mainfrom
fix/parthenon-fpv-url-restore
Jul 21, 2026
Merged

fix: FPV camera points wrong way when loading a Parthenon URL until you move the mouse#30
apresmoi merged 1 commit into
mainfrom
fix/parthenon-fpv-url-restore

Conversation

@apresmoi

Copy link
Copy Markdown
Owner

Loading the Parthenon example with an FPV state baked into the URL hash (e.g. #0IBnSyixT9S_t5EGyOput2M) rendered the camera looking in the wrong direction until you moved the mouse. Happened in both matrix and marble styles — FPV only.

Cause: applyState restored the FPV origin before the look angles. fpv.setOrigin() calls syncTarget(), which derives camera.target from the current rotX/rotY — so it baked the default look into the target, and the restored rotX/rotY set afterwards never re-synced the target. A mouse-move fired the mouselook handler, which re-ran syncTarget() and corrected it.

Fix: set the restored rotX/rotY first, then call setOrigin(), so the target is derived from the restored look.

Verified: loading the URL with no mouse-move, the camera target azimuth matches the restored yaw.

@apresmoi
apresmoi merged commit fb9a7dd into main Jul 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant