Touch camera gestures #24

Open
opened 2026-09-13 17:06:07 +00:00 by icub3d · 0 comments
Owner

MissionCamera binds right-drag to orbit and middle-drag to pan, because left was left
free for selection. A touchscreen has one button, so the camera is currently
uncontrollable on a tablet.

Add a gesture model: one finger to orbit, two to pan, pinch to zoom.

MissionCamera being four numbers (focus, yaw, pitch, distance) with a Transform
derived from them each frame keeps this a change to how the numbers are driven rather
than a rewrite of the camera.

The hard part

A drag that starts on a unit and a drag that starts on empty ground have to mean
different things, or selection and camera control fight each other. Decide that
explicitly rather than discovering it — a tap-versus-drag threshold, or a rule about
what the gesture started over.

Depends on the input model in
ADR 0003.

Done when

The camera can be orbited, panned, and zoomed on the tablet without interfering with
selecting a unit, and the mouse bindings still work on desktop.

`MissionCamera` binds right-drag to orbit and middle-drag to pan, because left was left free for selection. A touchscreen has one button, so the camera is currently uncontrollable on a tablet. Add a gesture model: one finger to orbit, two to pan, pinch to zoom. `MissionCamera` being four numbers (focus, yaw, pitch, distance) with a `Transform` derived from them each frame keeps this a change to how the numbers are driven rather than a rewrite of the camera. ## The hard part A drag that starts on a unit and a drag that starts on empty ground have to mean different things, or selection and camera control fight each other. Decide that explicitly rather than discovering it — a tap-versus-drag threshold, or a rule about what the gesture started over. Depends on the input model in [ADR 0003](../src/branch/main/docs/adr/0003-touch-first-input.md). ## Done when The camera can be orbited, panned, and zoomed on the tablet without interfering with selecting a unit, and the mouse bindings still work on desktop.
Sign in to join this conversation.
No description provided.