Skip to main content

Spatial Tap

Summary​

Represents a completed one-handed "select and activate" action on a target in space, whether the interaction is performed through indirect "gaze + pinch" or direct touch.

Trigger Conditions​

TargetTriggered when
Spatialized 2D HTML elementAfter the 3D spatial position occupied by its own content is tapped.
3D container elementAfter the 3D spatial position occupied by its own interactive content is tapped.

Mental Model​

Spatial Tap can be understood as a click event in 3D space.

Event Type Signature​

StageDOM event
Completed tapspatialtap

React Usage​

StageJSX prop
Completed taponSpatialTap

Native DOM Usage​

Current limitation

At the current stage, the WebSpatial SDK does not allow listening to spatial events directly on DOM elements, including those obtained from refs.

Event Lifecycle​

No event is triggered during the "selection" phase. Pinch and release immediately, and spatialtap is triggered.

SpatialTapEvent Payload​

FieldsUnitMeaningCoordinate system
offsetX, offsetY, offsetZpxThe X, Y, and Z coordinates of the tapped position.The local coordinate system of the spatialized 2D HTML element that triggered the event, including 3D container elements. It uses a left-handed coordinate system with the origin at the top-left corner of the element's 2D plane, Y pointing downward, and Z pointing toward the user.
clientX, clientY, clientZpxThe X, Y, and Z coordinates of the tapped position.The global coordinate system of the current Spatial Scene container. It uses a left-handed coordinate system with the origin at the top-left corner of the Spatial Scene's backplate, Y pointing downward, and Z pointing toward the user.