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 <[email protected]>
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

+4
View File
@@ -1215,6 +1215,7 @@ impl OpenCADStudio {
sel.right_press_time = None;
sel.right_last_pos = None;
sel.right_dragging = false;
sel.orbit_pivot = None;
if !was_click {
return Task::none();
}
@@ -1257,6 +1258,9 @@ impl OpenCADStudio {
let mut sel = self.tabs[i].scene.selection.borrow_mut();
sel.middle_down = false;
sel.middle_last_pos = None;
// End of a Shift+MMB orbit — drop the captured pivot so the next
// gesture recomputes it against the current selection. (#229)
sel.orbit_pivot = None;
Task::none()
}