Spatial handles touch gesture recognition automatically when you pass aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/danielitoCode/Spatial/llms.txt
Use this file to discover all available pages before exploring further.
SceneGestures configuration to the Scene composable. You never need to intercept raw MotionEvents or write gesture detectors manually — just choose a mode and, optionally, tune the sensitivity. Three modes are available in Core #1.
Gesture Modes
Gestures.none()
Disables all gesture input. The camera is static unless you move it programmatically.
Gestures.orbit()
One-finger drag to orbit the camera horizontally and vertically. This is the default mode passed to
Scene.Gestures.orbitAndZoom()
One-finger drag to orbit and two-finger pinch to zoom. Best for interactive exploration.
Signatures
Passing Gestures to Scene
Gestures.orbitAndZoom() for Gestures.none() or Gestures.orbit() at any time — Scene recomposes reactively when the gestures argument changes.
GestureSensitivity
GestureSensitivity controls how many degrees of camera rotation each pixel of drag input produces.
GestureSensitivity.Adaptive (default)
Scales drag sensitivity dynamically based on the current camera zoom, scene bounds, and viewport size. As the user zooms in, small drags still produce comfortable arcs rather than overshooting. This is the recommended policy for most apps.
GestureSensitivity.Fixed
A direct, constant mapping — each pixel of drag always produces exactly degreesPerPixel of rotation, regardless of zoom or viewport size. Use this when you want exact, predictable control over the angular response.
SceneGestures Properties
TheSceneGestures data class exposes the following read-only properties:
| Property | Type | Description |
|---|---|---|
orbitEnabled | Boolean | true for Orbit and OrbitAndZoom modes. |
zoomEnabled | Boolean | true only for OrbitAndZoom mode. |
orbitSensitivity | GestureSensitivity | The sensitivity policy in effect for orbit drag input. |
Disabling Gestures Conditionally
BecauseSceneGestures is an immutable value passed to Scene, you can switch modes reactively with standard Compose state:
Gesture input is wired through the
Modifier.sceneGestureInput internal modifier applied by Scene to its AndroidView. You do not need to handle MotionEvents manually or attach your own gesture detectors.Related
- Camera — control the orbit camera programmatically and animate it