WebXR Anchors Module
Jump to navigation
Jump to search
Status | ED |
---|---|
Last Updated | 30 September 2021 |
Editor(s) | Piotr Bialecki |
CG or WG? | WG |
The WebXR Anchors module enables applications to ask the underlying XR system to track changes to a particular three-dimensional pose (position and orientation) as the system’s understanding of the world changes. This allows the application to adjust the location of the virtual objects that it placed in the scene in a way that helps with maintaining the illusion that the placed objects are really present in the user’s environment.
WebIDL
[SecureContext, Exposed=Window]
interface XRAnchor {
readonly attribute XRSpace anchorSpace;
Promise<DOMString> requestPersistentHandle();
undefined delete();
};
partial interface XRFrame {
Promise<XRAnchor> createAnchor(XRRigidTransform pose, XRSpace space);
};
partial interface XRSession {
Promise<XRAnchor> restorePersistentAnchor(DOMString uuid);
Promise<undefined> deletePersistentAnchor(DOMString uuid);
};
partial interface XRHitTestResult {
Promise<XRAnchor> createAnchor();
};
[Exposed=Window]
interface XRAnchorSet {
readonly setlike<XRAnchor>;
};
partial interface XRFrame {
[SameObject] readonly attribute XRAnchorSet trackedAnchors;
};