C Specification

The xrCreateAnchorSpaceANDROID function is defined as:

// Provided by XR_ANDROID_trackables
XrResult xrCreateAnchorSpaceANDROID(
    XrSession                                   session,
    const XrAnchorSpaceCreateInfoANDROID*       createInfo,
    XrSpace*                                    anchorOutput);

Parameters

Parameter Descriptions
  • session is the XrSession that creates the anchor space.

  • createInfo is a pointer to an XrAnchorSpaceCreateInfoANDROID structure containing parameters to be used to create the anchor space.

  • anchorOutput is a pointer to a handle in which the created XrSpace is returned.

Description

At any point in time both the position and direction of the anchor is tracked or untracked together. This means that the runtime must either set both XR_SPACE_LOCATION_POSITION_TRACKED_BIT and XR_SPACE_LOCATION_ORIENTATION_TRACKED_BIT or clear both XR_SPACE_LOCATION_POSITION_TRACKED_BIT and XR_SPACE_LOCATION_ORIENTATION_TRACKED_BIT when the application calls xrLocateSpace or xrLocateSpaces for anchorOutput.

The application must eventually free the returned XrSpace via xrDestroySpace.

Valid Usage (Implicit)
Return Codes
On success, this command returns
  • XR_SUCCESS

  • XR_SESSION_LOSS_PENDING

On failure, this command returns
  • XR_ERROR_FUNCTION_UNSUPPORTED

  • XR_ERROR_VALIDATION_FAILURE

  • XR_ERROR_RUNTIME_FAILURE

  • XR_ERROR_HANDLE_INVALID

  • XR_ERROR_INSTANCE_LOST

  • XR_ERROR_SESSION_LOST

  • XR_ERROR_OUT_OF_MEMORY

  • XR_ERROR_LIMIT_REACHED

  • XR_ERROR_TRACKABLE_TYPE_NOT_SUPPORTED_ANDROID

  • XR_ERROR_TIME_INVALID

  • XR_ERROR_POSE_INVALID

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.