From 9f160966aeb2e0fb884a95e27f07eb676665e010 Mon Sep 17 00:00:00 2001 From: Rik Cabanier Date: Fri, 18 Nov 2022 09:52:24 -0800 Subject: [PATCH] print persistent anchors --- anchors.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/anchors.html b/anchors.html index f50c6cb..7fff0b4 100644 --- a/anchors.html +++ b/anchors.html @@ -99,7 +99,7 @@ textExitXRTitle: isARAvailable ? "EXIT AR" : "EXIT VR", }); document.querySelector('header').appendChild(xrButton.domElement); - + xrButton.enabled = supported; if (!supported) { isVRAvailable = false; @@ -291,6 +291,13 @@ if (session.isImmersive && first_time) { first_time = false; + if (session.persistentAnchors) { + let anchors = session.persistentAnchors; + console.log("known anchors:") + for (let i = 0; i < anchors.length; i++) { + console.log(i + ": " + anchors[i]); + } + } if (localStorage.getItem("anchors") !== null) { let anchors = JSON.parse(localStorage.anchors); for (let i = 0; i < anchors.length; i++) {