XRAnchorSet

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

We'd love to hear more about your role and the company you work for
Please help us by answering a few questions.

Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.

Die XRAnchorSet-Schnittstelle bietet Zugriff auf eine Sammlung von Ankern. Ihre Instanzen werden durch XRFrame.trackedAnchors zurückgegeben und sind set-ähnliche Objekte.

Instanz-Eigenschaften

Siehe Set für Details.

Instanz-Methoden

Siehe Set für Details.

Beispiele

Umgang mit dem Verlust der Ankerverfolgung

js
const trackedAnchors = frame.trackedAnchors;

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

Spezifikationen

Specification
WebXR Anchors Module
# xranchorset

Browser-Kompatibilität

Siehe auch