# xr

> openxr, hands, anchors, passthrough, moving without making people sick, and the headsets.

source: https://learning.anthnydas.com/games/xr/

## tl;dr

openxr is one api between your app and the headset runtime: a session, a frame loop, spaces and actions. hands, anchors and passthrough are extensions on top.

- **checked against:** openxr 1.1.65 (with meta's openxr sdk v85 and the visionos 27 sdk)
- **hand joints:** 26 (in openxr. arkit on visionos has 27)
- **snap turn:** 30, 45, 90° (the angles to offer. the comfortable default)
- **smooth turn:** opt in (a turn the inner ear can't feel. vignette it)
- **reach for it:** a native quest app, or your own engine, hands as input, content that stays put in a room, mixed reality over passthrough, moving people without making them sick

xr covers vr, where a headset replaces the world, and ar and mixed reality, where it adds to it.[^intro] this sheet is the native side: openxr, the khronos api a quest runs, then hand tracking, anchors and passthrough, how to move people without making them sick, and how to start on a quest or an apple vision pro. webxr, the same ideas in a browser, comes last.

it was checked against openxr 1.1.65, released 16 october 2026,[^version] meta's openxr sdk v85,[^sdk] the visionos 27 sdk in xcode 27,[^xcode27] and the webxr draft of 9 june 2026.[^webxr] the openxr code is c, the visionos code swift. api names and menus move between versions, so check yours against these.

## openxr

openxr is the interface between an app and an xr runtime: the vendor's software that tracks the headset, runs the devices and composites your frames onto the displays.[^intro] a machine can have several runtimes installed, with one active at a time.[^runtime] the core api is the same everywhere. extensions add the rest, like hands and passthrough.

you make the objects in this order: an instance, which connects you to the runtime and turns on extensions; a system, the device, picked by form factor; a session, your app running on that system with one graphics api; then spaces to measure poses in, swapchains to render into, and actions for input.[^intro][^system]

```c
// first, ask what the runtime has: xrEnumerateInstanceExtensionProperties lists its extensions
// every call returns an XrResult: check each one with XR_FAILED(). left out to keep this short
const char *exts[] = {XR_KHR_VULKAN_ENABLE2_EXTENSION_NAME, XR_EXT_HAND_TRACKING_EXTENSION_NAME};
XrInstanceCreateInfo ici = {
  .type = XR_TYPE_INSTANCE_CREATE_INFO,
  .applicationInfo = {.applicationName = "hello", .apiVersion = XR_API_VERSION_1_1},
  .enabledExtensionCount = 2,
  .enabledExtensionNames = exts,
};
XrInstance instance;
xrCreateInstance(&ici, &instance);

XrSystemGetInfo sgi = {.type = XR_TYPE_SYSTEM_GET_INFO, .formFactor = XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY};
XrSystemId system;
xrGetSystem(instance, &sgi, &system);

// call xrGetVulkanGraphicsRequirements2KHR first, then fill in your vulkan instance, device and queue
XrGraphicsBindingVulkan2KHR gpu = {.type = XR_TYPE_GRAPHICS_BINDING_VULKAN2_KHR};
XrSessionCreateInfo sci = {.type = XR_TYPE_SESSION_CREATE_INFO, .next = &gpu, .systemId = system};
XrSession session;
xrCreateSession(instance, &sci, &session);

// the floor under where the app started. the world goes in here
XrReferenceSpaceCreateInfo rci = {
  .type = XR_TYPE_REFERENCE_SPACE_CREATE_INFO,
  .referenceSpaceType = XR_REFERENCE_SPACE_TYPE_LOCAL_FLOOR,
  .poseInReferenceSpace = {.orientation = {.w = 1}},
};
XrSpace world;
xrCreateReferenceSpace(session, &rci, &world);
```

what trips people up:

- an extension you didn't list in `xrCreateInstance` doesn't exist for that instance. list one the runtime lacks and the call fails with `XR_ERROR_EXTENSION_NOT_PRESENT`, so get the runtime's list first, as the first comment in the code says.[^instance]
- a runtime that only has 1.0 turns down `XR_API_VERSION_1_1`, and `xrCreateInstance` fails. a quest 3 or 3s on horizon os v83 is conformant to both.[^instance][^conformant]
- `xrCreateSession` fails until you've asked your graphics extension for its requirements, as the comment above the session says.[^session-create]

### the session

the runtime moves a session from state to state and tells you with events. you read them with `xrPollEvent`, and each `XrEventDataSessionStateChanged` carries the new state.[^lifecycle][^events]

> **interactive figure:** a diagram of the openxr session states, each box a state with what it means or what you call there. down the left is the way in, in cyan: idle, where you keep polling events; ready, where you call xrBeginSession and start the frame loop; synchronized, where your frames aren't shown yet; visible, where they show but input doesn't reach you; and focused, with frames and input. the way out is in amber: focus lost takes focused back to visible, and hidden takes visible back to synchronized. the runtime's stop takes synchronized to stopping, where you call xrEndSession, and the session goes back to idle. from idle, a finished session goes on to exiting, where you call xrDestroySession. loss pending can come from any state, and there too you call xrDestroySession, and maybe make a new session.

```c
// drain the queue every time around the loop
XrEventDataBuffer ev = {.type = XR_TYPE_EVENT_DATA_BUFFER};
while (xrPollEvent(instance, &ev) == XR_SUCCESS) {
  if (ev.type == XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED) {
    XrSessionState state = ((XrEventDataSessionStateChanged *)&ev)->state;
    if (state == XR_SESSION_STATE_READY) {
      XrSessionBeginInfo begin = {
        .type = XR_TYPE_SESSION_BEGIN_INFO,
        .primaryViewConfigurationType = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO,
      };
      xrBeginSession(session, &begin); // then start the frame loop
    } else if (state == XR_SESSION_STATE_STOPPING) {
      xrEndSession(session); // once the frame loop has stopped
    } else if (state == XR_SESSION_STATE_EXITING || state == XR_SESSION_STATE_LOSS_PENDING) {
      xrDestroySession(session);
    }
  } else if (ev.type == XR_TYPE_EVENT_DATA_REFERENCE_SPACE_CHANGE_PENDING) {
    XrEventDataReferenceSpaceChangePending *moved = (XrEventDataReferenceSpaceChangePending *)&ev;
    // a recenter: moved->referenceSpaceType gets a new origin from moved->changeTime on
  }
  ev = (XrEventDataBuffer){.type = XR_TYPE_EVENT_DATA_BUFFER}; // xrPollEvent wrote over the type
}
```

`PRIMARY_STEREO` is two views, one per eye: view 0 is the left eye, view 1 the right.[^views]

what trips people up:

- `xrBeginSession` only works in `READY`, and `xrEndSession` only in `STOPPING`. anywhere else they fail with `XR_ERROR_SESSION_NOT_READY` or `XR_ERROR_SESSION_NOT_STOPPING`.[^running]
- keep polling in `IDLE`. a paused app waits there, and the runtime brings it back through `READY`.[^lifecycle]
- `VISIBLE` without `FOCUSED` means something like a system pop-up is over your app. keep rendering at full rate: only the input is gone.[^states]
- destroy the session at `EXITING`, not while it runs. after `xrDestroySession`, nothing may touch the handle, on any thread.[^running]

### the frame loop

a frame is three calls. `xrWaitFrame` blocks until it's time to start the next frame, and says when that frame will be on the displays (`predictedDisplayTime`) and whether to draw at all (`shouldRender`). `xrBeginFrame` comes right before the gpu work. `xrEndFrame` hands the compositor your layers, with the display time and the blend mode.[^wait][^submit]

> **interactive figure:** one time around an openxr frame loop, as a column of steps. xrPollEvent drains the event queue: session state changes and recenters. xrWaitFrame blocks until it's time to start a frame, and returns predictedDisplayTime and shouldRender. xrBeginFrame comes right before the gpu work. render locates the views at the display time and, for each swapchain, acquires, waits on, draws and releases an image, only when shouldRender is true. when it's false, a dashed path skips render and goes straight to xrEndFrame, which takes the display time, the blend mode and the layers, and no layers is fine. then the loop goes back to xrPollEvent for the next frame.

```c
XrCompositionLayerProjectionView eyes[2] = {
  {.type = XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW},
  {.type = XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW},
};
XrCompositionLayerProjection projection = {
  .type = XR_TYPE_COMPOSITION_LAYER_PROJECTION,
  .space = world,
  .viewCount = 2,
  .views = eyes,
};

while (app_running) {
  poll_events(); // the block above
  if (!session_running) {
    wait_a_moment(); // nothing to draw yet
    continue;
  }
  XrFrameState frame = {.type = XR_TYPE_FRAME_STATE};
  xrWaitFrame(session, NULL, &frame); // blocks until it's time to start the next frame
  xrBeginFrame(session, NULL);        // right before the gpu work

  const XrCompositionLayerBaseHeader *layers[1];
  uint32_t count = 0;
  if (frame.shouldRender) {
    // xrLocateViews at frame.predictedDisplayTime: a pose and a fov for each eye, into eyes[i]
    // each eye's swapchain: xrAcquireSwapchainImage, xrWaitSwapchainImage, draw, xrReleaseSwapchainImage
    layers[count++] = (const XrCompositionLayerBaseHeader *)&projection;
  }
  XrFrameEndInfo end = {
    .type = XR_TYPE_FRAME_END_INFO,
    .displayTime = frame.predictedDisplayTime,
    .environmentBlendMode = XR_ENVIRONMENT_BLEND_MODE_OPAQUE,
    .layerCount = count,
    .layers = layers,
  };
  xrEndFrame(session, &end); // no layers is fine: the display clears
}
```

what trips people up:

- call `xrWaitFrame` once per frame. it can run on its own thread, but every stage of the frame should use the one display time it returned.[^wait]
- keep the loop going while `shouldRender` is false: begin and end the frame anyway, with no layers.[^wait]
- locate the views, the hands and the controllers at `predictedDisplayTime`, not now. the frame reaches the eyes later, and the prediction gets better the closer to that time you ask.[^locate]
- the compositor paints the layers in array order: the first one at the back, each over the one before.[^compositing]

### spaces

a pose in openxr is always one space measured in another. there's no global frame.[^spaces] the runtime gives you four reference spaces to start from, all with +y up. in `VIEW`, `LOCAL` and `LOCAL_FLOOR`, -z is forward and +x is to the right. `STAGE`'s x and z axes run along the edges of the play area:[^spaces]

| space         | origin                               | for                    |
| ------------- | ------------------------------------ | ---------------------- |
| `VIEW`        | your head, now                       | a reticle, a gaze ray  |
| `LOCAL`       | your head at the start, leveled      | content near the start |
| `LOCAL_FLOOR` | under `LOCAL`, on the floor          | standing content       |
| `STAGE`       | the play area's center, on the floor | room scale             |

> **interactive figure:** two drawings of the core reference spaces, with each thing at the same place from left to right in both. from the side: local sits at eye height where the app started, local_floor right under it on the floor, stage on the floor at the center of the play area, and view on your head, now, somewhere else. from above: the stage bounds are the area the user set up, with stage's origin at their center and its +x and -z axes along the edges. local is where you started, facing -z. view is you, now, facing another way.

`VIEW`, `LOCAL` and `LOCAL_FLOOR` are always there, `LOCAL_FLOOR` since 1.1. `STAGE` is optional, can't be located until the user has set one up, and gets its size from `xrGetReferenceSpaceBoundsRect`. `VIEW` is for things that follow the head: render the world with the poses from `xrLocateViews`.[^spaces]

what trips people up:

- recentering moves `LOCAL`. the event loop above hears about it first, with the time the new origin takes effect.[^spaces]
- a runtime that learns the room as it goes may nudge each space's origin to keep it in place, so the pose of something that never moved can still change from one frame to the next.[^spaces] anchors, below, are for content that has to stay put.
- content in `VIEW` space is head-locked. keep it small: big head-locked content is uncomfortable to look at.[^spaces]

### actions

input in openxr goes by what it means, not by button. you make an action like teleport, suggest which control triggers it on each controller you tested with, and read the action. the runtime has the last word on the binding: user preference, accessibility settings and the hardware that's actually there all count.[^actions][^bindings] this is the spec's own example, cut down:[^actions]

```c
XrActionSetCreateInfo setInfo = {
  .type = XR_TYPE_ACTION_SET_CREATE_INFO,
  .actionSetName = "gameplay",
  .localizedActionSetName = "gameplay",
};
XrActionSet gameplay;
xrCreateActionSet(instance, &setInfo, &gameplay);

// named for what it does, not for a button
XrActionCreateInfo actionInfo = {
  .type = XR_TYPE_ACTION_CREATE_INFO,
  .actionName = "teleport",
  .actionType = XR_ACTION_TYPE_BOOLEAN_INPUT,
  .localizedActionName = "teleport",
};
XrAction teleport;
xrCreateAction(gameplay, &actionInfo, &teleport);

// one suggestion per controller you tested with. the runtime may bind it elsewhere
XrPath profile, select;
xrStringToPath(instance, "/interaction_profiles/khr/simple_controller", &profile);
xrStringToPath(instance, "/user/hand/right/input/select/click", &select);
XrActionSuggestedBinding binding = {.action = teleport, .binding = select};
XrInteractionProfileSuggestedBinding suggested = {
  .type = XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING,
  .interactionProfile = profile,
  .countSuggestedBindings = 1,
  .suggestedBindings = &binding,
};
xrSuggestInteractionProfileBindings(instance, &suggested);

// once per session, after every suggestion. the sets can't change after this
XrSessionActionSetsAttachInfo attach = {
  .type = XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO,
  .countActionSets = 1,
  .actionSets = &gameplay,
};
xrAttachSessionActionSets(session, &attach);

// every frame
XrActiveActionSet active = {.actionSet = gameplay, .subactionPath = XR_NULL_PATH};
XrActionsSyncInfo sync = {
  .type = XR_TYPE_ACTIONS_SYNC_INFO,
  .countActiveActionSets = 1,
  .activeActionSets = &active,
};
xrSyncActions(session, &sync);

XrActionStateGetInfo get = {.type = XR_TYPE_ACTION_STATE_GET_INFO, .action = teleport};
XrActionStateBoolean state = {.type = XR_TYPE_ACTION_STATE_BOOLEAN};
xrGetActionStateBoolean(session, &get, &state);
if (state.changedSinceLastSync && state.currentState) start_teleport();
```

`khr/simple_controller` has no hardware of its own: a runtime that supports it maps select, menu, grip, aim and haptics onto whatever controller is there.[^profiles]

what trips people up:

- suggest every binding before `xrAttachSessionActionSets`. after it, the sets can't change, and both a second attach and a late suggestion fail.[^attach][^bindings]
- a binding is a hint. read the action, and don't assume which button it's on.[^bindings]
- call `xrSyncActions` once a frame. the interaction profile in use only changes there.[^bindings]
- a controller's position is an action too: a pose action, turned into a space with `xrCreateActionSpace` and located with `xrLocateSpace` like any other space.[^pose]

## hand tracking

`XR_EXT_hand_tracking` reports the joints of each hand, every frame. check `supportsHandTracking` in the system properties, make one tracker per hand, then locate its joints in a space at the frame's display time.[^hands]

there are 26 joints: the palm, the wrist, four on the thumb and five on each other finger. each has a pose and a radius, the distance from the joint to the skin in meters, which makes a ready collision sphere for a fingertip. every finger joint but the tip sits at the wrist end of the bone it's named for.[^hands]

> **interactive figure:** a schematic hand, fingers up, with the 26 joints of XR_EXT_hand_tracking drawn as dots and joined by lines. the palm, in the middle of the hand, and the wrist below it are amber. the thumb has four joints and each other finger five, in cyan, named on the little finger from the wrist out: metacarpal, proximal, intermediate, distal and tip. each finger's metacarpal joint sits in a fan close around the wrist, and the five tips are white.

```c
// an extension's functions aren't exported: load each one through xrGetInstanceProcAddr
PFN_xrCreateHandTrackerEXT pfnCreateHandTrackerEXT;
PFN_xrLocateHandJointsEXT pfnLocateHandJointsEXT;
xrGetInstanceProcAddr(instance, "xrCreateHandTrackerEXT", (PFN_xrVoidFunction *)&pfnCreateHandTrackerEXT);
xrGetInstanceProcAddr(instance, "xrLocateHandJointsEXT", (PFN_xrVoidFunction *)&pfnLocateHandJointsEXT);

XrHandTrackerCreateInfoEXT trackerInfo = {
  .type = XR_TYPE_HAND_TRACKER_CREATE_INFO_EXT,
  .hand = XR_HAND_RIGHT_EXT,
  .handJointSet = XR_HAND_JOINT_SET_DEFAULT_EXT,
};
XrHandTrackerEXT right;
pfnCreateHandTrackerEXT(session, &trackerInfo, &right);

// every frame
XrHandJointLocationEXT joints[XR_HAND_JOINT_COUNT_EXT];
XrHandJointLocationsEXT locations = {
  .type = XR_TYPE_HAND_JOINT_LOCATIONS_EXT,
  .jointCount = XR_HAND_JOINT_COUNT_EXT,
  .jointLocations = joints,
};
XrHandJointsLocateInfoEXT locateInfo = {
  .type = XR_TYPE_HAND_JOINTS_LOCATE_INFO_EXT,
  .baseSpace = world,
  .time = frame.predictedDisplayTime,
};
pfnLocateHandJointsEXT(right, &locateInfo, &locations);
if (locations.isActive) {
  XrHandJointLocationEXT tip = joints[XR_HAND_JOINT_INDEX_TIP_EXT];
  // tip.pose and tip.radius: a sphere at the fingertip, for pressing buttons
}
```

for pinching and poking, reach for actions before your own gesture code. `XR_EXT_hand_interaction` adds pinch, poke, aim and grip poses to every hand profile, and a profile of its own with a pinch value from 0 to 1, where 1 is finger and thumb touching. runtimes with controllers should offer that profile too, so one set of bindings covers both.[^hand-interaction]

```text
/interaction_profiles/ext/hand_interaction_ext   the profile
/user/hand/right/input/pinch_ext/value           0 to 1
/user/hand/right/input/pinch_ext/pose            where the pinch is
/user/hand/right/input/poke_ext/pose             the fingertip that pokes
```

what trips people up:

- the loader only exports the core functions. every extension function, like the two above, comes from `xrGetInstanceProcAddr`.[^procaddr]
- `isActive` false means no hand right now, or your app lost focus. every joint's valid flags are off then, so hide the hand instead of freezing it.[^hands]
- the palm joint isn't the grip pose. the palm is inside the hand, at the middle of the middle finger's metacarpal. grip is at the center of a held controller's handle, outside the hand.[^hands]
- the joints describe an empty hand with its full range of motion, even when a held controller is in the way. a runtime that can't see every finger fills in the rest.[^hands]
- on quest, hands only show up if the manifest asks for them, with the permission and the feature in the quest section below, and if the user has hand tracking turned on.[^quest-hands]

on visionos, arkit's `HandTrackingProvider` does this job. its skeleton has 27 joints: no palm, but two forearm joints, `forearmArm` and `forearmWrist`, next to `wrist`. it needs `NSHandsTrackingUsageDescription` in the info.plist, and it only runs while your app has a full space open.[^arkit-hands][^arkit-access]

```swift
let session = ARKitSession()
let hands = HandTrackingProvider()

// in a task on your immersive space's view, once the space is open
guard HandTrackingProvider.isSupported else { return }
try await session.run([hands])
for await update in hands.anchorUpdates {
    let hand = update.anchor
    guard hand.isTracked, let skeleton = hand.handSkeleton else { continue }
    let tip = skeleton.joint(.indexFingerTip)
    let worldFromTip = hand.originFromAnchorTransform * tip.anchorFromJointTransform
    // a fingertip collider goes at worldFromTip
}
```

## spatial anchors

an anchor is a pose the runtime pins to a real place. as the headset's map of the room gets better, the runtime adjusts each anchor on its own to keep it on its spot, so a thing drawn relative to its anchor stays on the desk. and unlike `LOCAL`, an anchor doesn't move when the user recenters.[^anchor]

> **interactive figure:** a room seen from above, with a desk along the top wall and two virtual mugs on it. the cyan mug was placed in local space; the amber one sits on an anchor. the app started with you near the middle of the room, facing the desk, and you have since walked to the right and turned to face the far wall. a button recenters: local space moves to where you stand and turns the way you face, and the cyan mug, which keeps its local coordinates, swings with it and ends up across the room by the far wall. the amber mug stays on the desk. the same button, now reading put it back, puts everything back.

where it lives on each platform:

|            | openxr                           | quest                     | visionos        |
| ---------- | -------------------------------- | ------------------------- | --------------- |
| make       | `xrCreateSpatialAnchorEXT`       | `xrCreateSpatialAnchorFB` | `WorldAnchor`   |
| keep       | `xrPersistSpatialEntityAsyncEXT` | `xrSaveSpacesMETA`        | automatic       |
| find again | by uuid                          | `xrDiscoverSpacesMETA`    | `anchorUpdates` |

on quest, an anchor has to be storable before it saves; on visionos, arkit saves it for you and hands back the ones nearby. the openxr column is `XR_EXT_spatial_anchor` and `XR_EXT_spatial_persistence`, both ratified by khronos: the cross-vendor way, on runtimes that ship them.[^anchor][^persist] meta's docs use meta's own: `XR_FB_spatial_entity` to make anchors, and meta's persistence and discovery extensions to save and find them. the persistence one replaces `XR_FB_spatial_entity_storage`, which the spec now calls obsolete.[^meta-anchors][^meta-persist] on quest, each call answers later with an event:

```c
// an anchor where the mug sits. the anchor arrives later, as an event
XrSpatialAnchorCreateInfoFB anchorInfo = {
  .type = XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_FB,
  .space = world,
  .poseInSpace = mugPose,
  .time = frame.predictedDisplayTime,
};
XrAsyncRequestIdFB request;
pfnCreateSpatialAnchorFB(session, &anchorInfo, &request);

// in the event loop
if (ev.type == XR_TYPE_EVENT_DATA_SPATIAL_ANCHOR_CREATE_COMPLETE_FB) {
  XrEventDataSpatialAnchorCreateCompleteFB *done = (XrEventDataSpatialAnchorCreateCompleteFB *)&ev;
  anchor = done->space; // and keep done->uuid: it finds the anchor again next time
}

// every frame: where the anchor is now, and the mug with it
XrSpaceLocation where = {.type = XR_TYPE_SPACE_LOCATION};
xrLocateSpace(anchor, world, frame.predictedDisplayTime, &where);

// to keep it across sessions, turn on its storable component
XrSpaceComponentStatusSetInfoFB storable = {
  .type = XR_TYPE_SPACE_COMPONENT_STATUS_SET_INFO_FB,
  .componentType = XR_SPACE_COMPONENT_TYPE_STORABLE_FB,
  .enabled = XR_TRUE,
};
pfnSetSpaceComponentStatusFB(anchor, &storable, &request);

// when XrEventDataSpaceSetStatusCompleteFB says it's on, save it
XrSpacesSaveInfoMETA save = {.type = XR_TYPE_SPACES_SAVE_INFO_META, .spaceCount = 1, .spaces = &anchor};
pfnSaveSpacesMETA(session, &save, &request);
```

meta's anchor sample also asks for the anchor permission in its manifest: the last line of the manifest under quest, below.[^anchor-sample] on visionos, a world tracking provider does it all, and needs no permission:[^apple-anchors][^arkit-access]

```swift
let session = ARKitSession()
let worldTracking = WorldTrackingProvider()

// in a task on your immersive space's view, once the space is open
try await session.run([worldTracking])

let anchor = WorldAnchor(originFromAnchorTransform: lampTransform)
try await worldTracking.addAnchor(anchor)
lamps[anchor.id] = lamp // what the anchor means is yours to keep

// this run and later ones: arkit hands back the anchors near you
for await update in worldTracking.anchorUpdates {
    switch update.event {
    case .added, .updated: place(lamps[update.anchor.id], at: update.anchor.originFromAnchorTransform)
    case .removed: hide(lamps[update.anchor.id])
    }
}
```

what trips people up:

- one anchor per group of things that hold still together. two anchors adjust apart, so a table and the lamp on it share one.[^anchor]
- destroy the anchors you're done with. the runtime keeps working to track every one.[^anchor]
- on quest, make an anchor within 3 m of what it holds. farther away, drift shows.[^meta-anchors]
- what persists is a uuid and a pose. what the anchor means, a lamp or a note, is yours to save under that uuid.[^meta-anchors][^apple-anchors]
- erasing and destroying differ. `xrEraseSpacesMETA` removes a saved anchor from storage; `xrDestroySpace` only lets go of it in this session.[^meta-anchors]

## passthrough

passthrough shows the room on a headset you can't see through: cameras film it, and the system draws it along with your frames. in core openxr, you pick how the composited image meets the world every frame, in `xrEndFrame`: `OPAQUE` for vr, `ADDITIVE` or `ALPHA_BLEND` for ar. `xrEnumerateEnvironmentBlendModes` lists what a system can do.[^blend]

quest does it with a layer instead, from `XR_FB_passthrough`. your app never sees the camera images. it submits a placeholder layer, `XrCompositionLayerPassthroughFB`, and the compositor draws the room there. the blend mode stays `OPAQUE`.[^meta-passthrough]

> **interactive figure:** a stack of three layers, in the order an app hands them to xrEndFrame for passthrough on quest. layers\[0], at the back in cyan, is the passthrough placeholder that the compositor fills with the room. layers\[1], in amber, is the app's projection layer: its eye images, where alpha 0 lets the room show once source alpha is on. layers\[2], on top in white, is a quad, a flat panel like a menu. the compositor paints them in array order, each over the last.

```c
// once: the feature (one per session), then a layer. both start running
XrPassthroughCreateInfoFB featureInfo = {
  .type = XR_TYPE_PASSTHROUGH_CREATE_INFO_FB,
  .flags = XR_PASSTHROUGH_IS_RUNNING_AT_CREATION_BIT_FB,
};
XrPassthroughFB feature;
pfnCreatePassthroughFB(session, &featureInfo, &feature);

XrPassthroughLayerCreateInfoFB layerInfo = {
  .type = XR_TYPE_PASSTHROUGH_LAYER_CREATE_INFO_FB,
  .passthrough = feature,
  .flags = XR_PASSTHROUGH_IS_RUNNING_AT_CREATION_BIT_FB,
  .purpose = XR_PASSTHROUGH_LAYER_PURPOSE_RECONSTRUCTION_FB,
};
XrPassthroughLayerFB room;
pfnCreatePassthroughLayerFB(session, &layerInfo, &room);

// every frame: the room first, so it's at the back, then your eyes with their alpha on
XrCompositionLayerPassthroughFB roomLayer = {
  .type = XR_TYPE_COMPOSITION_LAYER_PASSTHROUGH_FB,
  .flags = XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT,
  .space = XR_NULL_HANDLE,
  .layerHandle = room,
};
projection.layerFlags = XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT; // clear to alpha 0 where the room shows
const XrCompositionLayerBaseHeader *layers[] = {
  (const XrCompositionLayerBaseHeader *)&roomLayer,
  (const XrCompositionLayerBaseHeader *)&projection,
};
// then xrEndFrame with these two, and environmentBlendMode XR_ENVIRONMENT_BLEND_MODE_OPAQUE
```

what trips people up:

- without `com.oculus.feature.PASSTHROUGH` in the manifest, the passthrough extensions don't turn on.[^meta-passthrough]
- your projection layer covers the room unless it has alpha. set its source alpha flag, as the code does, and clear to alpha 0: without the flag, a layer's alpha counts as 1.[^compositing]
- one passthrough feature per session, and at most three passthrough layers at a time.[^fb-passthrough][^meta-passthrough]
- to hide the room, pause the layer with `xrPassthroughLayerPauseFB`. don't just leave it out of `xrEndFrame`.[^meta-passthrough]
- the camera images themselves: on a quest 3 or 3s with horizon os v74 or later, the passthrough camera api serves them through android's camera2, with the `HEADSET_CAMERA` permission and passthrough on.[^pca] on visionos, the main camera is an enterprise api, behind an entitlement and a license file.[^apple-camera]

on visionos, passthrough is where you start. an `ImmersiveSpace` opens in the `mixed` style, your content in the room. `progressive` replaces part of the room with a portal the user sizes with the digital crown, 120 to 360 degrees by default, and `full` replaces all of it except the user's arms and hands. in `progressive` and `full`, the system keeps a boundary about 1.5 m from where the head started: near it, the experience fades toward the room, and past it the app's icon takes its place.[^immersion][^hig]

```swift
@main
struct MyApp: App {
    @State private var style: ImmersionStyle = .mixed

    var body: some Scene {
        WindowGroup { ContentView() }
        ImmersiveSpace(id: "room") { RoomView() }
            .immersionStyle(selection: $style, in: .mixed, .progressive, .full)
    }
}
```

the user can always press and hold the digital crown to recenter, or double-click it to hide everything and see the room.[^hig]

## locomotion + comfort

in vr, the eyes can see motion the body doesn't feel. that sensation is vection, and its clash with the inner ear is what makes people sick. the inner ear senses changes in motion, not steady speed, so starts, stops and turns are the hard part.[^comfort]

give people choices, and start them on the gentle ones:[^prefs]

|             | how                           | comfort                            |
| ----------- | ----------------------------- | ---------------------------------- |
| teleport    | jump to where you aim         | gentle. can disorient              |
| slide       | glide with the stick          | can make people sick               |
| snap turn   | turn 30, 45 or 90° at once    | gentle. offer all three            |
| smooth turn | turn while the stick is held  | rough. let people set the speed    |
| vignette    | darken the edges while moving | less motion seen. can feel cramped |

the vignette row is from meta's optic flow guide.[^optic]

> **interactive figure:** a first-person view of a ring of posts, one every 30 degrees, seen through a 90 degree window. the post you started facing is cyan, and a white tick marks straight ahead. two buttons turn you left or right by 45 degrees, and a menu picks how: snap jumps there in one step, smooth slides there at 180 degrees a second, a quarter of a second for the turn, with a vignette darkening the edges while it moves. a slider sets the vignette's strength from 0 to 1, starting at 0.5, and shows what it covers while you drag it. under reduced motion, the smooth turn jumps too.

the rest of meta's advice, in short:

- default to teleport and snap turn, and let people switch to slide and smooth turn while the app runs. there's no system setting for it: each app keeps its own, and should remember the choice.[^prefs]
- keep speeds human. a walk is about 1.4 m/s, a run about 2.8 m/s.[^comfort]
- skip the easing. switch between fixed speeds at once (stopped, walking, running), so acceleration lasts as little as possible.[^comfort]
- people in a chair that doesn't swivel can't turn around. give them artificial turning.[^prefs]
- hold the frame rate. judder, when the image doesn't match the head, is uncomfortable on its own.[^comfort]
- ship three presets, recommended, comfortable and advanced, and test with many different people.[^bp]

in webxr, meta's immersive web sdk has these built in. it starts with snap turns of 45°, smooth turns at 180°/s, the vignette at 0.5 and a slide of up to 5 m/s, which is faster than the design guide's run.[^iwsdk-src] the figure above uses the turn defaults.

```js
import { LocomotionSystem, SessionMode, TurningMethod, World } from '@iwsdk/core';

const world = await World.create(document.getElementById('scene'), {
  xr: { sessionMode: SessionMode.ImmersiveVR },
  features: {
    // comfortAssistLevel is the vignette's strength, 0 to 1. 0 turns it off
    locomotion: { turningMethod: TurningMethod.SnapTurn, comfortAssistLevel: 0.5 },
  },
});

// from your comfort menu
const locomotion = world.getSystem(LocomotionSystem);
locomotion.config.turningAngle.value = 30; // the user's pick: 30, 45 or 90
locomotion.config.turningMethod.value = TurningMethod.SmoothTurn;
locomotion.config.turningSpeed.value = 120; // degrees a second
locomotion.config.slidingSpeed.value = 1.4; // a walk, in m/s
```

this follows meta's own examples for the sdk's `World` options and its locomotion settings.[^iwsdk]

## quest / visionos basics

### quest

a quest runs horizon os, which is built on android. you can build for it with unity, unreal, native c or c++ on openxr, meta's spatial sdk in kotlin, a plain android app, or the web.[^platforms] the native path, checked against meta's openxr sdk v85 and meta's docs as read on 28 october 2026:[^sdk][^device-setup][^adb]

1. join or make a team on the meta horizon developer dashboard, and verify your account with a phone number or a payment method.
2. turn on developer mode in the meta horizon app on your phone: headset icon > your headset > Headset Settings > Developer Mode.
3. plug the headset in with a usb-c data cable. in the headset, answer the usb debugging prompt with Always allow from this computer. on windows, install the oculus adb drivers first.
4. build a sample in android studio: File > Open, pick the sdk's `Samples/build.gradle`, then Run in the toolbar.

```sh
adb devices             # is the headset there?
adb install -r app.apk  # put your build on it, over the last one
adb tcpip 5555          # to drop the cable: switch adb to wi-fi,
adb connect <ip>:5555   # then connect to the headset's ip address
```

```xml
<!-- in the activity: this category makes it a vr app -->
<intent-filter>
  <action android:name="android.intent.action.MAIN" />
  <category android:name="org.khronos.openxr.intent.category.IMMERSIVE_HMD" />
  <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<!-- one line per feature you use -->
<uses-feature android:name="oculus.software.handtracking" android:required="false" />
<uses-permission android:name="com.oculus.permission.HAND_TRACKING" />
<uses-feature android:name="com.oculus.feature.PASSTHROUGH" android:required="true" />
<uses-permission android:name="com.oculus.permission.USE_ANCHOR_API" />
```

the lines come from meta's openxr page and the v85 samples.[^quest-openxr][^quest-hands][^anchor-sample][^meta-passthrough] on android, openxr also needs two steps before `xrCreateInstance`: get `xrInitializeLoaderKHR` from `xrGetInstanceProcAddr` with a null instance and call it with an `XrLoaderInitInfoAndroidKHR`, then list `XR_KHR_android_create_instance` and chain an `XrInstanceCreateInfoAndroidKHR` into the instance's create info. meta supports the khronos loader for android, `openxr_loader_for_android`, from 1.0.34.[^quest-openxr]

what trips people up:

- with both the cable and wi-fi connected, adb sees the headset twice. pick one with `adb -s <device id>`.[^adb]
- a build put on with `adb install` skips the usual install route, so cloud backup doesn't cover it.[^adb]
- developer mode needs a verified account on a developer team, and an adult one.[^device-setup]

### vision pro

apple vision pro runs visionos. an app is a set of swiftui scenes: windows for 2d, volumes for 3d, and an immersive space to fill the room. realitykit draws the 3d, and arkit gives you hands, planes and anchors. if you bring your own metal renderer, compositor services hands you the drawables and the frame timing, the job openxr's frame loop does.[^visionos][^first-app][^compositor] checked against xcode 27:[^xcode27][^run][^devicehub][^devmode]

1. get a mac with apple silicon running macos tahoe 26.6 or later, and xcode 27.
2. make a project: File > New > Project, then visionOS > App.
3. run it: pick a simulator or a device in the run destination menu, then Product > Run.
4. pair a vision pro: on it, Settings > General > Remote Devices. in xcode, Xcode > Open Developer Tool > Device Hub, then + > Pair Nearby Device, and type the pin it shows.
5. turn on developer mode on the vision pro: Settings > Privacy & Security > Developer Mode, then restart.
6. sign in for signing: Xcode > Settings > Apple Accounts, then pick a team in Signing & Capabilities.

in the simulator, in xcode 27's device hub, after you pick "Select to interact with the visionOS content" at the bottom of the canvas:[^sim]

| to                  | press                                |
| ------------------- | ------------------------------------ |
| look at something   | move the pointer over it             |
| tap (a pinch)       | click                                |
| pinch and hold      | click and hold                       |
| pinch and drag      | drag                                 |
| drag toward or away | shift-drag                           |
| walk                | W A S D, or the arrow keys           |
| go up, go down      | E, Q                                 |
| look around         | control-drag                         |
| reset the view      | Reset Camera, bottom right           |
| type into the app   | Device > Keyboard > Keyboard Capture |
| give the keys back  | esc                                  |

what trips people up:

- arkit data like hands and planes only flows while your app shows a full space, with other apps hidden. world tracking needs no permission. hands need `NSHandsTrackingUsageDescription`, and planes, images and scene reconstruction need `NSWorldSensingUsageDescription`.[^arkit-access]
- device hub 27 can't show or drive a real vision pro. to work next to xcode, use mac virtual display on the headset.[^xcode27][^sim]
- pairing over wi-fi needs ipv6 on the network.[^devicehub]
- developer mode only shows up in the vision pro's settings once you start pairing it, or if it was paired before.[^devmode]

### in a browser: webxr

webxr is the browser's xr api, a w3c candidate recommendation draft as of 9 june 2026.[^webxr] the quest browser runs it, passthrough included, and safari on visionos has run immersive webxr since safari 18.[^quest-webxr][^safari18] the session modes are `inline`, `immersive-vr` and `immersive-ar`, the last from the ar module.[^webxr][^ar-module] the reference spaces line up with openxr's:

| webxr           | openxr                       | origin                    |
| --------------- | ---------------------------- | ------------------------- |
| `viewer`        | `VIEW`                       | your head                 |
| `local`         | `LOCAL`                      | near you, when made       |
| `local-floor`   | `LOCAL_FLOOR`                | on the floor, near you    |
| `bounded-floor` | `STAGE`                      | on the floor, with bounds |
| `unbounded`     | `UNBOUNDED_MSFT`[^unbounded] | far from the start        |

```js
button.addEventListener('click', async () => {
  // immersive sessions have to start from a click like this one
  if (!(await navigator.xr?.isSessionSupported('immersive-vr'))) return;
  const session = await navigator.xr.requestSession('immersive-vr', { requiredFeatures: ['local-floor'] });
  const gl = canvas.getContext('webgl2', { xrCompatible: true });
  session.updateRenderState({ baseLayer: new XRWebGLLayer(session, gl) });
  const floor = await session.requestReferenceSpace('local-floor');

  session.requestAnimationFrame(function frame(time, xrFrame) {
    session.requestAnimationFrame(frame);
    const pose = xrFrame.getViewerPose(floor);
    if (!pose) return;
    const layer = session.renderState.baseLayer;
    gl.bindFramebuffer(gl.FRAMEBUFFER, layer.framebuffer);
    for (const view of pose.views) {
      const { x, y, width, height } = layer.getViewport(view);
      gl.viewport(x, y, width, height);
      draw(view.projectionMatrix, view.transform.inverse.matrix);
    }
  });
});
```

what trips people up:

- an immersive session needs a secure page and has to start from the user's own action, like a click on an enter vr button.[^webxr]
- an immersive session only gets `viewer` and `local` by default. ask for `local-floor` or `bounded-floor` in `requiredFeatures` or `optionalFeatures`.[^webxr]
- for passthrough in the quest browser, request `immersive-ar` and clear to a transparent color. an opaque clear hides the room.[^quest-webxr]

## pitfalls

- **one time per frame.** the `predictedDisplayTime` from `xrWaitFrame` is the time for everything in that frame: the views, the hands, the controllers, the anchors.[^wait][^locate]
- **ask before you use it.** extensions, blend modes, reference spaces and hand tracking each have an enumerate call or a system property to check first.[^instance][^blend][^spaces][^hands]
- **a simulator isn't a headset.** apple's simulators don't match a device's performance or features. try comfort, hands and passthrough on the real thing.[^run]
- **comfort is personal.** what one person shrugs off makes another sick. keep the comfortable options one menu away, and remember what each person picked.[^prefs][^bp]

[^intro]: [introduction.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/introduction.adoc) in the openxr 1.1.65 spec, lines 26 to 60: xr as the continuum that takes in vr, ar and mixed reality; openxr as the interface between an app and a runtime that handles composition, peripherals and tracking; and the order a program goes in, from instance to system to buffers to session and its loop.

[^version]: the openxr docs [changelog](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/CHANGELOG.Docs.md) at tag release-1.1.65: 1.1.65 came out on 2026-10-16. [xr.xml](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/registry/xr.xml) at the same tag sets `XR_CURRENT_API_VERSION` to 1.1.65, at line 159.

[^runtime]: [fundamentals.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/fundamentals.adoc), lines 199 to 204: a runtime implements the api, and only one can be active at a time.

[^system]: [system.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/system.adoc), lines 1 to 66: `xrGetSystem` picks a system by form factor, and `XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY` is a display on the head.

[^instance]: [instance.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/instance.adoc): extensions are enabled at `xrCreateInstance`, and one that can't be found fails it with `XR_ERROR_EXTENSION_NOT_PRESENT` (lines 226 to 234); an `apiVersion` the runtime doesn't support returns `XR_ERROR_API_VERSION_UNSUPPORTED` (lines 330 to 336).

[^conformant]: khronos's [list of conformant openxr products](https://www.khronos.org/conformance/adopters/conformant-products/openxr), read on 2026-10-28: meta's quest 3 and quest 3s on horizon os v83, conformant to openxr 1.0 and 1.1 on 2026-01-18.

[^session-create]: [session.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/session.adoc), lines 163 to 240: one `XrGraphicsBinding*` struct in the create info's next chain, and an error if the graphics extension's `xrGet*GraphicsRequirements` wasn't called first.

[^lifecycle]: [session.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/session.adoc), lines 16 to 104, and its lifecycle figure: the ten steps from a new session in `IDLE` to `xrDestroySession` at `EXITING`, the paused app waiting in `IDLE`, and `LOSS_PENDING` from any state. the diagram on this page redraws that figure, with a line in each box from the state descriptions in lines 499 to 648.

[^events]: [fundamentals.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/fundamentals.adoc), lines 1702 to 1790: events wait in a queue, the app reads them one at a time with `xrPollEvent`, and each call overwrites the buffer's type with the event's.

[^views]: [view_configurations.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/view_configurations.adoc), lines 30 to 60: `PRIMARY_STEREO` is two views, index 0 the left eye and 1 the right, picked at `xrBeginSession`.

[^running]: [session.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/session.adoc), lines 106 to 161: `xrBeginSession` only in `READY`, `xrEndSession` only in `STOPPING`, and why it's better to destroy a session at `EXITING`.

[^states]: [session.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/session.adoc), lines 574 to 590: a visible session without focus, for example under a modal pop-up, keeps rendering and submitting its layers.

[^wait]: [rendering.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/rendering.adoc), lines 764 to 905: `xrWaitFrame` throttles the loop and returns `predictedDisplayTime`, `predictedDisplayPeriod` and `shouldRender`; it can be called from any thread, once per frame, and every stage should use the same display time; and the loop keeps running with no layers while `shouldRender` is false.

[^submit]: [rendering.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/rendering.adoc), lines 910 to 1116: `xrBeginFrame` right before the gpu work, and `xrEndFrame` with a display time, a blend mode and the layers. no layers clears the display.

[^locate]: [rendering.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/rendering.adoc), lines 579 to 640: `xrLocateViews` predicts a pose and a field of view per view for a display time, and the prediction gets better the later you ask.

[^compositing]: [rendering.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/rendering.adoc), lines 1132 to 1146 (layers drawn in array order, the first one first, painter's algorithm) and 1174 to 1202 (without the source alpha flag a layer's alpha is 1, and how alpha blends a layer over the ones under it).

[^spaces]: [spaces.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/spaces.adoc), lines 1 to 330: poses are always between two spaces; runtimes may adjust origins as they learn the world; `VIEW`, `LOCAL`, `LOCAL_FLOOR` and `STAGE`, their origins and axes; the first three must be supported and `STAGE` is optional; recentering, and the event that comes before it; and large head-locked content being uncomfortable.

[^actions]: [input.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/input.adoc), lines 8 to 140: actions stand for what the app wants, not for hardware, and the runtime may pick a different control. the code on this page cuts down the spec's example there, which suggests a binding on a vendor profile and adds haptics.

[^bindings]: [input.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/input.adoc), lines 476 to 603: suggested bindings are hints, the interaction profile only changes in `xrSyncActions`, and suggesting for an attached set fails with `XR_ERROR_ACTIONSETS_ALREADY_ATTACHED`.

[^attach]: [input.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/input.adoc), lines 650 to 682: attaching makes the sets immutable, and a second `xrAttachSessionActionSets` on a session fails.

[^pose]: [input.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/input.adoc), lines 1119 to 1142: a pose action's location comes from an action space, made with `xrCreateActionSpace` and located with `xrLocateSpace`.

[^profiles]: [semantic_paths.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/semantic_paths.adoc), lines 665 to 686: the khronos simple controller profile, its five paths, and runtimes mapping it to the real hardware.

[^hands]: [ext_hand_tracking.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/extensions/ext/ext_hand_tracking.adoc), revision 4: `supportsHandTracking`, one tracker per hand, `xrLocateHandJointsEXT` at a time in a base space, the unobstructed range of motion, `isActive` and the valid flags, and the conventions section: 26 joints, named after the bone at their end away from the tip, the palm at the center of the middle finger's metacarpal and not the grip pose, and the radius as the distance to the skin. the figure's joint order is `XrHandJointEXT` in [xr.xml](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/registry/xr.xml), lines 7609 to 7636, and `hand-joints.test.ts`, next to the figure in `site/src/visuals/xr/`, checks its count.

[^hand-interaction]: [ext_hand_interaction.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/extensions/ext/ext_hand_interaction.adoc), revision 2: the aim, grip, pinch and poke poses on every hand profile, the `hand_interaction_ext` profile with `pinch_ext/value`, `aim_activate_ext/value` and `grasp_ext/value`, and runtimes with controllers mapping them to it.

[^procaddr]: [api_initialization.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/api_initialization.adoc), lines 24 to 55: the loader must export the core functions, and extension functions come from `xrGetInstanceProcAddr`.

[^quest-hands]: meta's [enable hand tracking](https://developers.meta.com/vr/documentation/native/android/mobile-hand-tracking/) page, read on 2026-10-28: without the `HAND_TRACKING` permission and the `oculus.software.handtracking` feature, an app sees no hands, and the user has to have hand tracking on. the [XrHandsFB sample's manifest](https://github.com/meta-quest/Meta-OpenXR-SDK/blob/v85/Samples/XrSamples/XrHandsFB/Projects/Android/AndroidManifest.xml) at v85, lines 19 to 23, has both, with the feature not required.

[^arkit-hands]: [HandTrackingProvider](https://developer.apple.com/documentation/arkit/handtrackingprovider) and [HandSkeleton.JointName](https://developer.apple.com/documentation/arkit/handskeleton/jointname) in apple's arkit docs: three forearm and wrist joints, four on the thumb and five on each finger, 27 in all, and no palm.

[^arkit-access]: [setting up access to arkit data](https://developer.apple.com/documentation/visionos/setting-up-access-to-arkit-data) in apple's docs: `NSHandsTrackingUsageDescription` and `NSWorldSensingUsageDescription`, world tracking without authorization, and arkit data only while the app shows a full space with other apps hidden.

[^anchor]: [ext_spatial_anchor.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/extensions/ext/ext_spatial_anchor.adoc), revision 1: anchors adjusted on their own to keep their place in the world, unaffected by recentering, `xrCreateSpatialAnchorEXT` in a spatial context, and the guidelines to share one anchor among things that don't move relative to each other and to destroy the ones you no longer use.

[^persist]: [ext_spatial_persistence.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/extensions/ext/ext_spatial_persistence.adoc) and its operations extension at the same tag: a persisted entity is known by a uuid across sessions, saved with `xrPersistSpatialEntityAsyncEXT` and found by uuid during discovery. both extensions are marked ratified in xr.xml.

[^meta-anchors]: meta's [spatial anchors features and lifecycle](https://developers.meta.com/vr/documentation/native/android/openxr-spatial-anchors-features-lifecycle/) page, updated 2024-05-27: a uuid per anchor, within 3 m for best results, `xrCreateSpatialAnchorFB`, `xrLocateSpace`, the storable component and `xrSaveSpacesMETA`, `xrDiscoverSpacesMETA`, and how erasing differs from destroying.

[^meta-persist]: [meta_spatial_entity_persistence.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/extensions/meta/meta_spatial_entity_persistence.adoc), lines 18 to 37: `XR_META_spatial_entity_persistence`, the next generation of meta's anchor storage, replacing `XR_FB_spatial_entity_storage` and its batch extension, which it calls obsolete, and used with `XR_META_spatial_entity_discovery`.

[^anchor-sample]: the [XrSpatialAnchor sample's manifest](https://github.com/meta-quest/Meta-OpenXR-SDK/blob/v85/Samples/XrSamples/XrSpatialAnchor/Projects/Android/AndroidManifest.xml) in meta's openxr sdk at v85, line 21: the `USE_ANCHOR_API` permission.

[^apple-anchors]: [tracking specific points in world space](https://developer.apple.com/documentation/visionos/tracking-points-in-world-space) and [WorldAnchor](https://developer.apple.com/documentation/arkit/worldanchor) in apple's docs: `addAnchor`, arkit keeping each anchor's uuid and pose across runs while the app keeps what it means, and updates only for nearby anchors.

[^blend]: [rendering.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/rendering.adoc), lines 1454 to 1520: `OPAQUE` for vr and `ADDITIVE` or `ALPHA_BLEND` for ar, chosen each frame in `xrEndFrame`, and `xrEnumerateEnvironmentBlendModes`.

[^meta-passthrough]: meta's [implement passthrough](https://developers.meta.com/vr/documentation/native/android/mobile-passthrough/) page, read on 2026-10-28: the compositor renders passthrough into a placeholder layer the app submits, the app can't see the images, the `com.oculus.feature.PASSTHROUGH` manifest line, up to three passthrough layers, the layer order putting it under or over, pausing instead of leaving a layer out, and quest requiring `XR_ENVIRONMENT_BLEND_MODE_OPAQUE`.

[^fb-passthrough]: [fb_passthrough.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/extensions/fb/fb_passthrough.adoc), revision 5: one `XrPassthroughFB` per session, and the passthrough layer's space set to `XR_NULL_HANDLE`.

[^pca]: meta's [passthrough camera api overview](https://developers.meta.com/vr/documentation/native/android/pca-native-overview/), updated 2026-10-07: quest 3 and 3s, horizon os v74 or later, android's camera2, the `horizonos.permission.HEADSET_CAMERA` or `android.permission.CAMERA` permission, and passthrough turned on.

[^apple-camera]: [accessing the main camera](https://developer.apple.com/documentation/visionos/accessing-the-main-camera) in apple's docs: an enterprise api with an entitlement, a license file and `NSMainCameraUsageDescription`.

[^immersion]: [ImmersionStyle](https://developer.apple.com/documentation/swiftui/immersionstyle) in apple's swiftui docs, with its [mixed](https://developer.apple.com/documentation/swiftui/immersionstyle/mixed), [progressive](https://developer.apple.com/documentation/swiftui/immersionstyle/progressive) and [full](https://developer.apple.com/documentation/swiftui/immersionstyle/full) styles: mixed is the default, progressive is a portal sized with the digital crown, and full hides passthrough except the upper limbs.

[^hig]: [immersive experiences](https://developer.apple.com/design/human-interface-guidelines/immersive-experiences) in apple's human interface guidelines: passthrough as camera video, the digital crown to recenter or to show the surroundings, the default progressive range of 120 to 360 degrees, and the boundary about 1.5 m from the starting head position.

[^comfort]: meta's [comfort and usability](https://developers.meta.com/vr/design/locomotion-comfort-usability/) page, updated 2025-12-17: vection, the vestibular organs answering changes in motion and not a constant speed, quantized speeds with instant changes, walking at about 1.4 m/s and running at about 2.8 m/s, judder, and seated users.

[^prefs]: meta's [locomotion user preferences](https://developers.meta.com/vr/design/locomotion-user-preferences/) page, updated 2026-09-08: teleport against slide and snap against smooth turn, snap angles of 30, 45 or 90 degrees, letting users set the smooth turn's speed, turning for people in chairs that don't rotate, and per-app settings that default to teleport and snap turn, switch while the app runs, and persist.

[^optic]: meta's [reducing optic flow](https://developers.meta.com/vr/resources/locomotion-design-reduce-optic-flow/) article, updated 2026-05-11: vignettes limit visible optic flow, and a narrower view can feel disorienting or claustrophobic.

[^bp]: meta's [locomotion best practices](https://developers.meta.com/vr/design/locomotion-best-practices/), updated 2025-12-17: smooth turning as an opt-in, testing with many different users, and the recommended, comfortable and advanced presets.

[^iwsdk-src]: the defaults in `@iwsdk/core` 1.0.1's [locomotion.js](https://cdn.jsdelivr.net/npm/@iwsdk/core@1.0.1/dist/locomotion/locomotion.js), lines 43 to 51: `comfortAssist` 0.5, `slidingSpeed` 5, `turningMethod` snap turn, `turningAngle` 45 and `turningSpeed` 180. the figure's numbers come from `site/src/visuals/xr/comfort.ts`, which `comfort.test.ts` pins.

[^iwsdk]: meta's immersive web sdk docs on [locomotion](https://developers.meta.com/vr/documentation/iwsdk/concepts/locomotion/) and [turning](https://developers.meta.com/vr/documentation/iwsdk/concepts/locomotion/turn/), updated 2026-09-04, and on [slide](https://developers.meta.com/vr/documentation/iwsdk/concepts/locomotion/slide/): the `World` locomotion option with `comfortAssistLevel`, and tuning `turningAngle`, `turningSpeed` and `slidingSpeed` through `world.getSystem(LocomotionSystem)`.

[^platforms]: meta's [platforms](https://developers.meta.com/vr/discover/platforms/) page, read on 2026-10-28: horizon os is built on android, and the paths are unity, unreal, native openxr, the meta spatial sdk, android apps, and the web with webxr.

[^sdk]: meta's [openxr mobile sdk](https://developers.meta.com/vr/downloads/package/oculus-openxr-mobile-sdk/) download page, version 85.0, and the [readme](https://github.com/meta-quest/Meta-OpenXR-SDK/blob/v85/README.md) at tag v85: the samples, and building them with android studio by opening `Samples/build.gradle`.

[^device-setup]: meta's [device setup](https://developers.meta.com/vr/documentation/native/android/mobile-device-setup/) page, updated 2026-08-06: a team and a verified account, being 18 or older, developer mode in the meta horizon app, the usb-c cable and "always allow from this computer", and the adb drivers for windows.

[^adb]: meta's [use adb with meta quest](https://developers.meta.com/vr/documentation/native/android/ts-adb/) page, read on 2026-10-28: `adb devices`, `adb install -r`, `adb tcpip 5555` and `adb connect`, `-s` when two devices show, and cloud backup skipping apps installed with adb.

[^quest-openxr]: meta's [openxr on android](https://developers.meta.com/vr/documentation/native/android/mobile-openxr/) page, updated 2025-01-23: the `IMMERSIVE_HMD` intent category, the khronos android loader (`org.khronos.openxr`) from 1.0.34, `xrInitializeLoaderKHR` with `XrLoaderInitInfoAndroidKHR`, and `XR_KHR_android_create_instance`.

[^visionos]: [visionos](https://developer.apple.com/documentation/visionos) in apple's docs: a mac with apple silicon, swiftui scenes from windows to spaces, realitykit for 3d, and arkit for the surroundings and custom gestures.

[^first-app]: [creating your first visionos app](https://developer.apple.com/documentation/visionos/creating-your-first-visionos-app) in apple's docs: File > New > Project, the visionOS app template, and windows for 2d content and volumes for 3d.

[^compositor]: [compositor services](https://developer.apple.com/documentation/compositorservices) in apple's docs: drawing to the displays with metal and your own engine, with a layer renderer that gives the frame timing and the textures.

[^xcode27]: the [xcode 27 release notes](https://developer.apple.com/documentation/xcode-release-notes/xcode-27-release-notes): the visionos 27 sdk, macos tahoe 26.6 or later, and device hub 27 not showing the video of, or sending input to, a physical apple vision pro. the [visionos 27 release notes](https://developer.apple.com/documentation/visionos-release-notes/visionos-27-release-notes) say the sdk comes with xcode 27.

[^run]: [running your app on simulated or physical devices](https://developer.apple.com/documentation/xcode/running-your-app-on-simulated-or-physical-devices) in apple's docs: the run destination menu, Product > Run, signing in Xcode > Settings > Apple Accounts, and simulators not matching a device's performance or features.

[^devicehub]: [managing your simulated and physical devices in device hub](https://developer.apple.com/documentation/xcode/managing-your-simulated-and-physical-devices-in-device-hub) in apple's docs: Xcode > Open Developer Tool > Device Hub, Pair Nearby Device, Settings > General > Remote Devices on visionos, ipv6, and the pin.

[^devmode]: [enabling developer mode on a device](https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device) in apple's docs: the switch in Privacy & Security, the restart, and the setting only appearing once pairing has started or the device was paired before.

[^sim]: [interacting with your visionos app in device hub](https://developer.apple.com/documentation/xcode/interacting-with-your-visionos-app-in-device-hub) in apple's docs: the gestures, the movement keys, control-drag, the reset camera button, keyboard capture, and mac virtual display for a physical device.

[^webxr]: [webxr device api](https://www.w3.org/TR/2026/CRD-webxr-20260609/), w3c candidate recommendation draft, 9 june 2026: the session modes, the reference space types, the default features for immersive sessions, the secure context, and the transient user activation an immersive request needs.

[^unbounded]: [msft_unbounded_reference_space.adoc](https://github.com/KhronosGroup/OpenXR-Docs/blob/release-1.1.65/specification/sources/chapters/extensions/msft/msft_unbounded_reference_space.adoc): the `UNBOUNDED_MSFT` reference space, for moving freely many meters from the start, its origin drifting to stay stable near the viewer.

[^ar-module]: [webxr augmented reality module, level 1](https://www.w3.org/TR/webxr-ar-module-1/), w3c candidate recommendation draft: `immersive-ar`.

[^safari18]: the [safari 18 release notes](https://developer.apple.com/documentation/safari-release-notes/safari-18-release-notes): immersive webxr on visionos.

[^quest-webxr]: meta's [webxr mixed reality](https://developers.meta.com/vr/documentation/web/webxr-mixed-reality/) page, read on 2026-10-28: `immersive-ar` for passthrough, drawing on a transparent background, and no access to the camera pixels.

## related

- game dev (soon)
- https://learning.anthnydas.com/games/unreal.md
- https://learning.anthnydas.com/graphics/three-js.md
