Skip to main content
Version: 1.0

Hit Testing

The Snapdragon Spaces Hit Testing feature hit tests against points found in the real world. The terms ray casting and hit testing are used interchangeably throughout the documentation.

For basic information about hit testing via raycasts and what AR Foundation's AR Raycast Subsystem component does, please refer to the Unity documentation.

How to Enable the Feature

In order to use Hit Testing, it has to be enabled in the OpenXR plugin settings located under Project Settings > XR Plug-in Management > OpenXR (> Android Tab) > OpenXR Feature Groups > Snapdragon Spaces > Hit Testing. Hit Testing is a standalone feaure that does not require other perception features (e.g. Plane Detection or Spatial Meshing) in order to be enabled.

Hit Testing Feature Group

Supported Raycast Types

Snapdragon Spaces supports single use raycasts and persistent raycasts via RaycastManager.AddRaycast to hit test against the environment.

Hit Testing Against the Environment

The Hit Testing feature does not acknowledge the TrackableType mask parameter trackableTypeMask specified in the ARRaycastManager.Raycast method, and thus does not support TrackableTypes.

The feature raycasts against an internal feature point cloud provided by the Snapdragon Spaces Runtime; this internal point cloud isnot related to an AR Foundation Trackable, and so the ARRaycastHit.trackableId field will always return the trackableId of 0-0 as the session-unique identifier for the trackable that was hit.