feat(nav): turntable orbit, selection/cursor pivot, Shift+MMB rotate (#229)

Rework 3D view navigation:

- Turntable / lock-horizon orbit: horizontal drag yaws about world +Z,
  vertical drag pitches about the horizontal camera-right axis, so the
  view never banks. Pitch is pole-clamped but the straight-down default
  view can still be tilted out of.
- Orbit centre: the selection's centre when something is selected,
  otherwise the point under the cursor — no longer only the file centre.
  The camera revolves rigidly about the pivot, so it stays put on screen
  and the view doesn't jump.
- Mouse scheme: Zoom = wheel, Pan = MMB, Rotate = Shift+MMB. Right-drag
  no longer orbits (right-click stays context menu / Enter). Floating
  viewports orbit with Shift+MMB too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-01 21:58:04 +03:00
1 parent c303900bd2
commit 98aa051a74
6 files changed
+106 -82

No files matched your search

+2 -1
View File
@@ -220,7 +220,8 @@ impl Scene {
Some(c) => c,
None => return,
};
cam.orbit(delta_x, delta_y);
// Floating viewport orbits about its own target (no selection pivot).
cam.orbit(delta_x, delta_y, None);
// yaw_pitch_to_quat(y,p)*Z = (cos(p)*sin(y), -cos(p)*cos(y), sin(p))
// `camera_for_viewport` reconstructs the rotation so that
// `rotation * Z == view_direction` exactly (its `yaw = atan2(x, -y)`