MDN self-hosted library · e01.org

XRAnchorSet

WebXR Device API

WebXR Device API

The XRAnchorSet interface exposes a collection of anchors. Its instances are returned by XRFrame.trackedAnchors and are Set-like objects.

Instance properties

See Set for details.

Instance 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

Browser compatibility

See also

  • XRAnchor
  • XRFrame.trackedAnchors