All tracked anchors (creation order).
Adopt an already-created XRAnchor (e.g. from
XrHitTest.anchorCurrentHit).
Anchor a hit-test result (placement on the struck real surface). Returns
null if the 'anchors' feature isn't enabled or anchoring fails.
Anchor an explicit pose in a given space (defaults to the session reference
space). Needs the current XRFrame because createAnchor lives on it.
Refresh every anchor's matrix from its tracked space, and prune anchors
the runtime has dropped (no longer in frame.trackedAnchors). Call once per
XRFrame.
Delete all anchors.
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.
Create anchors from an XrHitTest result (placement on a real surface) or from an arbitrary pose, then call update every
XRFrameand read each entry'smatrixto position the corresponding object. Requires a session created with the'anchors'feature.Part of the AR half of the WebXR integration — see TODO/webxr-integration.md.