C Specification

The XrRaycastHitResultANDROID structure is defined as:

// Provided by XR_ANDROID_raycast
typedef struct XrRaycastHitResultANDROID {
    XrTrackableTypeANDROID    type;
    XrTrackableANDROID        trackable;
    XrPosef                   pose;
} XrRaycastHitResultANDROID;

Members

Member Descriptions

Description

The XrRaycastHitResultANDROID contains the details of a raycast hit.

The XrRaycastHitResultANDROID::pose for a plane hit must be such that X+ is perpendicular to the cast ray and parallel to the physical surface centered around the hit, Y+ points along the estimated surface normal, and Z+ points roughly toward the ray origin.

The XrRaycastHitResultANDROID::pose for a depth hit is analogous to a plane hit, using an estimated surface normal. X+ is perpendicular to the cast ray and parallel to the physical surface centered around the hit, Y+ points along the estimated surface normal, and Z+ points roughly toward the ray origin.

XR ANDROID raycast orientation
Figure 1. Example raycast hit orientation.
Type of trackable hit Description

XR_TRACKABLE_TYPE_PLANE_ANDROID

Hits horizontal and/or vertical surfaces to determine a point’s correct depth and orientation.

XR_TRACKABLE_TYPE_DEPTH_ANDROID

Uses depth information from the entire scene to determine a point’s correct depth and orientation.

Other extensions may implement raycasting for other types of trackables.

Valid Usage (Implicit)

See Also

Document Notes

For more information, see the OpenXR Specification

This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2025 The Khronos Group Inc.