Taos API Reference
    Preparing search index...

    Module xr

    WebXR (VR/AR) integration for the Taos engine, built on the experimental WebGPU-WebXR binding (XRGPUBinding): the immersive session, per-eye views, controllers, hit-testing, anchors, depth sensing, and light estimation. See TODO/webxr-integration.md.

    webxr.d.ts ships the ambient type slices these modules use — it is picked up automatically by the TypeScript program, no import needed.

    Classes

    XrAnchors

    WebXR anchors helper. An anchor is a point the AR runtime keeps locked to the real world across frames, correcting for drift as its room model improves — so virtual objects placed on a table stay on the table. Without an anchor, content fixed in reference-space coordinates slowly slides as tracking refines.

    XrDepth

    WebXR depth sensing helper — the real world's per-pixel depth, used for occlusion (real objects hiding virtual ones) and physics-against-the-room.

    XrHitTest

    WebXR hit-test helper for placing virtual content on real-world surfaces.

    XrControllers

    Tracks the XR session's input sources (controllers, hands) and refreshes their grip / target-ray poses and gamepad button/axis state each frame.

    XrLightEstimation

    WebXR lighting estimation helper: reads the AR runtime's estimate of the real environment's lighting so virtual objects are lit to match the room — a dominant directional term (sun/lamp) plus an order-2 spherical-harmonics ambient. Pipe the directional term into a DirectionalLight via applyToDirectional, and the SH into an ambient/IBL probe.

    XrSession

    Thin wrapper over a WebGPU-backed immersive WebXR session: owns the XRSession, the XRGPUBinding, the projection layer and the reference space, and turns each XRFrame into a list of XrEyeViews the engine can render. This is the single place that touches the (draft) WebGPU-XR API; everything downstream is plain Taos Mat4 / GPUTexture.

    Interfaces

    XrAnchorEntry

    One tracked anchor and its latest resolved pose.

    XrController

    Per-frame snapshot of one tracked XR input source (controller / hand).

    XrLightSample

    Real-world lighting sampled from the AR runtime this frame.

    XrEyeView

    One eye's per-frame view state, ready to hand to the engine.

    XrSessionOptions