Skip to content

Remember camera direction between views#563

Open
frostdev-ops wants to merge 1 commit into
LemADEC:MC1.12from
frostdev-ops:improvement/persist-camera-orientation
Open

Remember camera direction between views#563
frostdev-ops wants to merge 1 commit into
LemADEC:MC1.12from
frostdev-ops:improvement/persist-camera-orientation

Conversation

@frostdev-ops

Copy link
Copy Markdown

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:

  • reproduced the orientation reset on the original jar
  • confirmed mouse movement remains responsive
  • confirmed the direction persists after leaving and reopening the view
  • covered normal and laser cameras through the same ICamera and NBT path
  • built and tested together with the Camera w/ monitor #337 fix
  • checked packet handling for unloaded chunks, distance, tile type, video-channel matching, and invalid angles
  • built successfully offline with Java 8 (test NO-SOURCE)

@frostdev-ops
frostdev-ops marked this pull request as ready for review July 11, 2026 18:59
@frostdev-ops
frostdev-ops force-pushed the improvement/persist-camera-orientation branch from e504903 to 54419e0 Compare July 15, 2026 09:38
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.

Save camera orientation

1 participant