XRAnchorSet

The XRAnchorSet interface exposes a collection of anchors. It is returned by XRFrame.trackedAnchors and is a Set-like object.

Properties

See Set for details.

Methods

See Set for details.

Examples

Handling anchor tracking loss

const trackedAnchors = frame.trackedAnchors;

for (const anchor of previousFrameAnchors) {
  if (!trackedAnchors.has(anchor)) {
    // Handle anchor tracking loss
  }
}

Specifications

Specification
WebXR Anchors Module (WebXR Anchors)
# xranchorset

Browser compatibility

BCD tables only load in the browser

See also