Skip to content

Commit

Permalink
print persistent anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
cabanier committed Nov 18, 2022
1 parent 7d9d390 commit 9f16096
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion anchors.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
textExitXRTitle: isARAvailable ? "EXIT AR" : "EXIT VR",
});
document.querySelector('header').appendChild(xrButton.domElement);

xrButton.enabled = supported;
if (!supported) {
isVRAvailable = false;
Expand Down Expand Up @@ -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++) {
Expand Down

0 comments on commit 9f16096

Please sign in to comment.