# OpenXR Key Concepts

[OpenXR ](https://www.khronos.org/openxr/)enables developers to build apps that are portable across headsets from almost all vendors. It defines an API that enable apps to communicate with the hardware and system software driving an XR device. This is done by making calls to a runtime which supports the OpenXR API.

The [OpenXR specification](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html) and supporting materials are maintained by the Khronos Group.

The OpenXR runtime for the Xcelerate (CVR-655) is [Snapdragon Spaces](https://spaces.qualcomm.com/), which is maintained by Qualcomm. It supports OpenXR version 1.0.34.

Unless you're writing a native application against the OpenXR API, you won't need to refer to the specification directly. This is because frameworks and middleware (such as game engines) abstract the details. However, there are a few concepts you may need to be familiar with.

## Runtimes

An OpenXR runtime is a software layer responsible for managing communication between applications and the XR hardware. While runtimes vary in implementation, all support the same API - OpenXR. Thus, an application built against the OpenXR API can - in theory - run on any runtime.

On standalone devices (such as the CVR-655) it is common for an OpenXR runtime to come pre-installed on the device.

## Loaders

An OpenXR loader is a library responsible for discovering OpenXR runtimes and API layers on a system.

On Android, `libopenxr_loader.so` is dynamically linked and bundled with an application within the APK.

### Khronos

The Khronos group provides a loader implementation which is compatible with the CVR-655 and most other headsets. If you're using a framework or middleware, the Khronos loader is usually the default.

### Snapdragon Spaces

{% hint style="info" %}
Use of the Snapdragon Spaces loader is not recommended
{% endhint %}

Qualcomm also provide a loader implementation specifically for the Snapdragon Spaces runtime. This is approaching end-of-life and so is not recommended.

## Extensions

OpenXR extensions add to the API to expose additional functionality. There are three categories:

* Khronos extensions - prefixed with `XR_KHR_`, these are widely available and supported by all runtimes
* Multi-vendor extensions - prefixed with `XR_EXT_`, these are supported by multiple runtimes
* Vendor-specific extensions - prefixed with the vendor name in some form, these are specific to certain runtimes

## Reference Spaces

An [OpenXR reference space](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#spaces-reference-spaces) is a coordinate system used for tracking position and orientation relative to a frame of reference.

The CVR-655 supports four reference spaces:

* `XR_REFERENCE_SPACE_TYPE_VIEW`
* `XR_REFERENCE_SPACE_TYPE_LOCAL`
* `XR_REFERENCE_SPACE_TYPE_STAGE`
* `XR_REFERENCE_SPACE_TYPE_UNBOUNDED_MSFT`

`XR_REFERENCE_SPACE_TYPE_STAGE` is recommended for most 6DoF apps, as this will place the origin at the floor height specified when the user sets a boundary.

### Unity

The XR Origin component controls the reference space, via the [`TrackingOriginMode`](https://docs.unity3d.com/Packages/com.unity.xr.core-utils@2.5/api/Unity.XR.CoreUtils.XROrigin.TrackingOriginMode.html) enum. The options available are:

* Not Specified
* Device
* Floor
* Unbounded (added in Unity 6.1)

"Not Specified" is the default value, and uses the default tracking origin mode of the headset which is `XR_REFERENCE_SPACE_TYPE_STAGE` (recommended). "Floor" will also use this reference space.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.classvr.com/openxr-information/openxr-key-concepts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
