-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use hand-controls, don't rotate on teleport
and comments
- Loading branch information
Showing
1 changed file
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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() { | ||
|
@@ -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> | ||
|
||
|