Skip to content

Commit

Permalink
use hand-controls, don't rotate on teleport
Browse files Browse the repository at this point in the history
and comments
  • Loading branch information
kfarr committed Oct 11, 2023
1 parent c994452 commit a00bdcd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/aframe-blink-controls.min.js"></script>

<script>
// this makes the same camera rig setup work in VR and desktop modes
// this could be a new component, such as "swap desktop and vr controls" and put in init section
window.addEventListener("DOMContentLoaded", function() {
const sceneEl = document.querySelector("a-scene");
sceneEl.addEventListener("enter-vr", function() {
Expand Down Expand Up @@ -78,8 +80,8 @@

<a-entity id="cameraRig" position="0 10 30" data-layer-name="Viewer" cursor-teleport="cameraRig: #cameraRig; cameraHead: #camera;" look-controls="reverseMouseDrag: true" wasd-controls="enabled: true">
<a-entity id="camera" camera="far: 1000" position="0 1.6 0" ></a-entity>
<a-entity id="leftHand" oculus-touch-controls="hand: left;" blink-controls="cameraRig: #cameraRig; teleportOrigin: #camera; button: trigger"></a-entity>
<a-entity id="rightHand" oculus-touch-controls="hand: right" blink-controls="cameraRig: #cameraRig; teleportOrigin: #camera;"></a-entity>
<a-entity id="leftHand" hand-controls="hand: left;" blink-controls="cameraRig: #cameraRig; teleportOrigin: #camera; rotateOnTeleport:false;"></a-entity>
<a-entity id="rightHand" hand-controls="hand: right" blink-controls="cameraRig: #cameraRig; teleportOrigin: #camera; rotateOnTeleport:false;"></a-entity>
<a-entity id="screenshot" class="no-pause" screentock visible="false"></a-entity>
</a-entity>

Expand Down

0 comments on commit a00bdcd

Please sign in to comment.