forked from 1b-agent/opencadstudio-upstream
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:
1 parent
c303900bd2
commit
98aa051a74
6 files changed
+106
-82
No files matched your search
@@ -32,6 +32,10 @@ pub struct SelectionState {
|
||||
pub right_press_time: Option<Instant>,
|
||||
pub right_dragging: bool,
|
||||
pub right_last_pos: Option<Point>,
|
||||
/// World point the current orbit drag revolves around (selection or model
|
||||
/// centre), captured when the drag starts so it stays fixed for the whole
|
||||
/// gesture. `None` when no orbit is in progress. (#229)
|
||||
pub orbit_pivot: Option<glam::DVec3>,
|
||||
/// While a command is active, a right-click acts as Enter; the *next*
|
||||
/// consecutive right-click opens the context menu instead. This tracks
|
||||
/// whether the previous right-click already fired Enter. Reset by any
|
||||
|
||||
Reference in new issue
Block a user