C Specification

The XrSpatialComponentRaycastResultListANDROID structure is defined as:

// Provided by XR_ANDROID_spatial_discovery_raycast
typedef struct XrSpatialComponentRaycastResultListANDROID {
    XrStructureType                       type;
    void*                                 next;
    uint32_t                              raycastResultCount;
    XrSpatialRaycastResultDataANDROID*    raycastResults;
} XrSpatialComponentRaycastResultListANDROID;

Members

Member Descriptions
  • type is the XrStructureType of this structure.

  • next is NULL or a pointer to the next structure in a structure chain.

  • raycastResultCount is a uint32_t describing the count of elements in the raycastResults array.

  • raycastResults is an array of XrSpatialRaycastResultDataANDROID.

Description

To query the raycast result component of the spatial entities in an XrSpatialSnapshotEXT, include XR_TYPE_SPATIAL_COMPONENT_RAYCAST_RESULT_LIST_ANDROID in XrSpatialComponentDataQueryConditionEXT::componentTypes and add XrSpatialComponentRaycastResultListANDROID to the XrSpatialComponentDataQueryResultEXT::next chain.

The runtime must return XR_ERROR_VALIDATION_FAILURE from xrQuerySpatialComponentDataEXT if XrSpatialComponentRaycastResultListANDROID is in the XrSpatialComponentDataQueryResultEXT::next chain but XR_SPATIAL_COMPONENT_TYPE_RAYCAST_RESULT_ANDROID is not included in XrSpatialComponentDataQueryConditionEXT::componentTypes.

The runtime must return XR_ERROR_SIZE_INSUFFICIENT from xrQuerySpatialComponentDataEXT if raycastResultCount is less than XrSpatialComponentDataQueryResultEXT::entityIdCountOutput.

The returned raycastResults are unordered. An application can use XrSpatialRaycastResultDataANDROID::distanceSquared to sort the results by distance.

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-2026 The Khronos Group Inc.