Remember camera direction between views#563
Open
frostdev-ops wants to merge 1 commit into
Open
Conversation
frostdev-ops
marked this pull request as ready for review
July 11, 2026 18:59
frostdev-ops
force-pushed
the
improvement/persist-camera-orientation
branch
from
July 15, 2026 09:38
e504903 to
54419e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #60
Cameras currently start from whichever direction the viewer is facing. After aiming a camera, leaving the monitor, turning around, and reopening it, the camera loses its previous direction.
This stores yaw and pitch on the camera tile entity for both normal and laser cameras. Older worlds have no saved values, so the first use still starts from the viewer's direction. When the view closes, the client sends the final direction to the server; the server only accepts finite angles from a nearby, loaded monitor whose video channel matches the target camera, then normalizes the yaw, clamps the pitch, and syncs the update.
One detail came out of testing: Minecraft still applies mouse movement to the real player while rendering through the camera entity. Copying the player's absolute rotation would erase the saved direction, while removing that copy entirely made the camera impossible to move. Applying the player's yaw and pitch deltas to the camera's independent orientation preserves both the saved direction and Minecraft's normal mouse sensitivity and invert-mouse behavior.
Tested with Forge 1.12.2:
ICameraand NBT pathtest NO-SOURCE)