javascriptaugmented-realitymultiplayerwebxr

How to share WebXR Anchors over the network?


I'm trying to share anchors from WebXR over the network with other clients. However, they only have one property, anchorSpace, which itself doesn't have any properties:

hitTestResult.createAnchor().then((anchor) => {
  console.log(anchor)
});

The above code produces following output in the console:

XRAnchor {anchorSpace: XRSpace}
  anchorSpace: XRSpace
    [[Prototype]]: XRSpace
  [[Prototype]]: XRAnchor

Stringifying the anchor using JSON.stringify() returns the following:

{}

Is there any way to send anchors (or XRSpaces) from one client to the other? And how can XRAnchor and XRSpace even work if they seemingly don't store any data?


Solution

  • Anchors are currently explicitly not-persistent or sharable. - @AdaRoseCannon (Feb 9, 2022) in https://github.com/immersive-web/anchors/issues/71#issuecomment-1033705978