Академический Документы
Профессиональный Документы
Культура Документы
OpenXR separates application actions such as Interaction profiles identify a collection of buttons and Syncing actions selects the active action
Move, Jump, and Teleport from the input Trigger, other input sources in a physical arrangement to allow set(s) to receive input, and updates the action
Thumbstick, Button, etc. Actions are grouped into applications and runtimes to coordinate action-to-input states. Most input data is accessible with
application-defined action sets that correspond mapping. Runtimes bind actions to input devices based on xrGetActionState* functions. Pose actions
to usage context (menu, gameplay, etc.). This application-supplied suggested bindings and other runtime- for tracked objects use "action spaces" and
simplifies support for different or future input specific sources. This permits developers to customize to xrLocateSpace instead, for use like reference
devices and maximizes user accessibility. hardware they have tested, while making it possible to run spaces.
on other hardware as supported by runtimes.
Macros for version and header control Graphics API header control [Appendix] ACTION_TYPE_MISMATCH
Compile Time Symbol API ACTIONSET_NOT_ATTACHED
Version numbers [2.1, Appendix] XR_USE_GRAPHICS_API_OPENGL OpenGL ACTIONSETS_ALREADY_ATTACHED
typedef uint64_t XrVersion; XR_USE_GRAPHICS_API_OPENGL_ES OpenGL ES ANDROID_THREAD_SETTINGS_FAILURE_KHR
Version numbers are encoded in 64 bits as follows: ANDROID_THREAD_SETTINGS_ID_INVALID_KHR
XR_USE_GRAPHICS_API_VULKAN Vulkan
bits 63-48: bits 47-32: bits 31-0: API_LAYER_NOT_PRESENT
Major version Minor version Patch version XR_USE_GRAPHICS_API_D3D11 Direct3D 11
API_VERSION_UNSUPPORTED
XR_USE_GRAPHICS_API_D3D12 Direct3D 12 CALL_ORDER_INVALID
Version macros
#define XR_CURRENT_API_VERSION ENVIRONMENT_BLEND_MODE_UNSUPPORTED
XR_MAKE_VERSION(1, 0, 0) Window system header control [Appendix]
EXTENSION_NOT_PRESENT
Compile Time Symbol Window System
#define XR_MAKE_VERSION(major, minor, patch) FEATURE_UNSUPPORTED
((((major) & 0xffffULL) << 48) | XR_USE_PLATFORM_WIN32 Microsoft Windows FILE_ACCESS_ERROR
(((minor) & 0xffffULL) << 32) | ((patch) & 0xffffffffULL)) XR_USE_PLATFORM_XLIB X Window System Xlib FILE_CONTENTS_INVALID
#define XR_VERSION_MAJOR(version) XR_USE_PLATFORM_XCB X Window System Xcb FORM_FACTOR_UNAVAILABLE
(uint16_t) (((uint64_t)(version) >> 48) & 0xffffULL) XR_USE_PLATFORM_WAYLAND Wayland FORM_FACTOR_UNSUPPORTED
#define XR_VERSION_MINOR(version) XR_USE_PLATFORM_ANDROID Android Native FUNCTION_UNSUPPORTED
(uint16_t) (((uint64_t)(version) >> 32) & 0xffffULL) GRAPHICS_DEVICE_INVALID
#define XR_VERSION_PATCH(version) HANDLE_INVALID
(uint32_t) ((uint64_t)(version) & 0xffffffffULL) Data types INDEX_OUT_OF_RANGE
Color [2.14] INITIALIZATION_FAILED
Color components are linear (e.g., not sRGB), not alpha- INSTANCE_LOST
premultiplied, in the range 0.0..1.0.
Threading behavior [2.3] typedef struct XrColor4f {
LAYER_INVALID
OpenXR functions generally support being called from multiple float r; float g; float b; float a; LAYER_LIMIT_EXCEEDED
threads with a few exceptions: } XrColor4f; LIMIT_REACHED
• The handle parameter and any child handles that will LOCALIZED_NAME_DUPLICATED
be destroyed by a destroy function must be externally Coordinate system [2.15]
synchronized. LOCALIZED_NAME_INVALID
OpenXR uses a Cartesian right-
• The instance parameter and any child handles in handed coordinate system with an NAME_DUPLICATED
xrDestroyInstance x, y, and z axis. NAME_INVALID
• The session parameter and any child handles in
xrDestroySession Points and directions can be OUT_OF_MEMORY
• The space parameter and any child handles in represented using the following PATH_COUNT_EXCEEDED
xrDestroySpace struct types with the following PATH_FORMAT_INVALID
• The swapchain parameter and any child handles in members:
PATH_INVALID
xrDestroySwapchain Members x, y for distance in meters or
• The actionSet parameter and any child handles in XrVector2f 2D direction
PATH_UNSUPPORTED
xrDestroyActionSet Members x, y, z for distance in meters, POSE_INVALID
• The action parameter and any child handles in XrVector3f REFERENCE_SPACE_UNSUPPORTED
or velocity or angular velocity
xrDestroyAction
Members x, y, z, w for a 4D vector RUNTIME_FAILURE
• Calls to xrWaitFrame for a given XrSession must be XrVector4f
externally synchronized. construct SESSION_LOST
Members x, y, z, w representing 3D SESSION_NOT_READY
XrQuaternionf
XR_KHR_android_thread_settings [12.3] orientation as a unit quaternion
SESSION_NOT_RUNNING
£ If enabled, this extension allows the application to specify Members orientation as a unit
XrPosef SESSION_NOT_STOPPING
the Android thread type. quaternion and position in meters
SESSION_RUNNING
XrResult xrSetAndroidApplicationThreadKHR( typedef struct XrVector2f { SIZE_INSUFFICIENT
XrSession session, float x;
XrAndroidThreadTypeKHR threadType, float y; SWAPCHAIN_FORMAT_UNSUPPORTED
uint32_t threadId); } XrVector2f; SWAPCHAIN_RECT_INVALID
threadType: XR_ANDROID_THREAD_TYPE_X_KHR typedef struct XrVector3f { SYSTEM_INVALID
where X may be: float x; TIME_INVALID
APPLICATION_MAIN, APPLICATION_WORKER, float y; VALIDATION_FAILURE
RENDERER_MAIN, RENDERER_WORKER float z;
} XrVector3f; VIEW_CONFIGURATION_TYPE_UNSUPPORTED
typedef struct XrVector4f { £ XR_KHR_android_thread_settings
Time float x; This extension enables the following additional error codes:
float y; XR_ERROR_ANDROID_THREAD_SETTINGS_ID_INVALID_KHR
XrTime [2.12.1] float z;
float w; XR_ERROR_ANDROID_THREAD_SETTINGS_FAILURE_KHR
A 64-bit integer representing a time relative to a runtime-
dependent epoch. All simultaneous applications use the same } XrVector4f;
epoch. typedef struct XrPosef { Convenience macros [2.8.3]
XrQuaternionf orientation;;
XrDuration [2.13] XrVector3f position; #define XR_SUCCEEDED(result) ((result) >= 0)
A 64-bit signed integer representing a duration; the difference } XrPosef; XR_SUCCEEDED is true for non-negative codes.
between two XrTime values.
typedef struct XrQuaternionf { #define XR_FAILED(result) ((result) < 0)
Special values: float x; XR_FAILED is true for negative codes.
#define XR_NO_DURATION 0 float y;
float z; #define XR_UNQUALIFIED_SUCCESS(result) ((result) == 0)
#define XR_INFINITE_DURATION 0x7fffffffffffffffLL float w; XR_UNQUALIFIED_SUCCESS is true for 0 (XR_SUCCESS) only.
} XrQuaternionf;
Notes
@thekhronosgroup khronos.org
OpenXR is a trademark of the Khronos Group. The Khronos Group is an industry consortium
creating open standards for the authoring and acceleration of parallel computing, graphics,
and dynamic media on a wide variety of platforms and devices.
See www.khronos.org to learn more about the Khronos Group.
See www.khronos.org/openxr to learn more about OpenXR.
©2019 Khronos Group - Rev. 0719 Reference guide production by Miller & Mattson www.millermattson.com www.khronos.org/openxr