C Specification

The XrEnvironmentRaycastHitStatusMETA enumerates the possible status of an attempted environment raycast. XR_ENVIRONMENT_RAYCAST_HIT_STATUS_HIT_META indicates a successful environment raycast with a valid hit point found given the criteria specified in XrEnvironmentRaycastHitGetInfoMETA.

// Provided by XR_META_environment_raycast
typedef enum XrEnvironmentRaycastHitStatusMETA {
    XR_ENVIRONMENT_RAYCAST_HIT_STATUS_HIT_META = 1,
    XR_ENVIRONMENT_RAYCAST_HIT_STATUS_NO_HIT_META = 2,
    XR_ENVIRONMENT_RAYCAST_HIT_STATUS_HIT_POINT_OCCLUDED_META = 3,
    XR_ENVIRONMENT_RAYCAST_HIT_STATUS_HIT_POINT_OUTSIDE_OF_FOV_META = 4,
    XR_ENVIRONMENT_RAYCAST_HIT_STATUS_RAY_OCCLUDED_META = 5,
    XR_ENVIRONMENT_RAYCAST_HIT_STATUS_HIT_INVALID_ORIENTATION_META = 6,
    XR_ENVIRONMENT_RAYCAST_HIT_STATUS_MAX_ENUM_META = 0x7FFFFFFF
} XrEnvironmentRaycastHitStatusMETA;

Description

XR_ENVIRONMENT_RAYCAST_HIT_STATUS_NO_HIT_META indicates a failed environment raycast, and none of the pose fields are valid. XR_ENVIRONMENT_RAYCAST_HIT_STATUS_HIT_POINT_OCCLUDED_META indicates the hit point is occluded. For example, if you are looking at a screen, the hit point may be on the wall behind it. The pose is still valid and represents the best estimate of the hit point, but it may not be accurate. XR_ENVIRONMENT_RAYCAST_HIT_STATUS_HIT_POINT_OUTSIDE_OF_FOV_META indicates the hit point is outside camera’s field of view. The pose is not valid, the application should not use it. XR_ENVIRONMENT_RAYCAST_HIT_STATUS_RAY_OCCLUDED_META indicates the input ray is occluded. The pose is not valid, the application should not use it. XR_ENVIRONMENT_RAYCAST_HIT_STATUS_HIT_INVALID_ORIENTATION_META indicates a partially successful environment raycast that only the XrPosef::position was determined, but the XrPosef::orientation was unable to be determined, it contains undefined values and the application should not use it.

When necessary, the application can instruct users to move to a different viewing point to achieve more accurate raycast results.

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.