adds first pass api client functionality, updates manifest to include entire app
This commit is contained in:
parent
b516b526ba
commit
51a6d89cea
@ -67,6 +67,8 @@
|
||||
<div id="map-view"></div>
|
||||
<div id="player-map-icon"><div class="playerMapIcon"><div>👤</div></div></div>
|
||||
<script language="javascript">
|
||||
var player;
|
||||
|
||||
var globalZoom = 19; // default zoom level
|
||||
|
||||
var globalPosition = new THREE.Vector3();
|
||||
@ -138,9 +140,15 @@ AFRAME.registerComponent('camera-logger', {
|
||||
}
|
||||
});
|
||||
|
||||
document.querySelector('#debug-view').innerHTML = "<p>Time: " + this.data.seconds
|
||||
+ "</p><p>Camera Position: (" + worldPos.x.toFixed(6) + ", " + worldPos.y.toFixed(2) + ", " + worldPos.z.toFixed(6) + ")</p>"
|
||||
+ "</p><p>Distance to marker[0]: " + globalMap.distance(currentPosition, globalMarkers[0]._latlng).toFixed(1) + " meters</p>";
|
||||
var debugText = "<p>Time: " + this.data.seconds + "</p>\n";
|
||||
debugText += "<p>Position: " + worldPos.x.toFixed(6) + ", " + worldPos.z.toFixed(6) + "</p>\n";
|
||||
debugText += "<p>Distance to marker[0]: " + globalMap.distance(currentPosition, globalMarkers[0]._latlng).toFixed(1) + " meters</p>\n";
|
||||
|
||||
if (player && player.nickname) {
|
||||
debugText = "<p><strong>You are " + player.nickname + "</strong></p>\n" + debugText;
|
||||
}
|
||||
|
||||
document.querySelector('#debug-view').innerHTML = debugText;
|
||||
});
|
||||
},
|
||||
|
||||
@ -157,6 +165,14 @@ AFRAME.registerComponent('camera-logger', {
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
// fetch player info from API
|
||||
fetch("https://wander.reclaim.technology/webserver/api/me.php").then((response) => {
|
||||
return response.text();
|
||||
}).then((playerJSON) => {
|
||||
player = JSON.parse(playerJSON);
|
||||
});
|
||||
|
||||
</script>
|
||||
<div id="ar-view">
|
||||
<a-scene vr-mode-ui='enabled: false' arjs='sourceType: webcam; videoTexture: true; debugUIEnabled: true' renderer='antialias: true; alpha: true'>
|
||||
|
@ -14,5 +14,6 @@
|
||||
}
|
||||
],
|
||||
"start_url": "https://wander.reclaim.technology/webserver/play/",
|
||||
"scope": "https://wander.reclaim.technology/",
|
||||
"display": "fullscreen"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user