teleport-controls doesn't work under Aframe 0.8.2 in VR mode

时间:2018-08-22 13:59:43

标签: javascript aframe webvr htc-vive

There is problem by using the teleport-controls under aframe 0.8.2. In VR mode with Vive there is only the curve shown after touching the trackpad of Vive controller. But the position of camera is not moved. In flat mode, the curve is shown and the position of camera is moved.

https://glitch.com/edit/#!/join/21f0cfd9-2fa0-49f3-910b-aedb91df3d3b

<a-scene background="color: #ECECEC">
  <a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9" shadow></a-box>
  <a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E" shadow></a-sphere>
  <a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D" shadow></a-cylinder>
  <a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4" shadow></a-plane>

  <a-entity id="left-hand"
    vive-controls="hand: left"
    teleport-controls
  >
  </a-entity>

  <a-entity id="right-hand"
    vive-controls="hand: right"
    teleport-controls
  >
  </a-entity>

Maybe has someone idea about it?

1 个答案:

答案 0 :(得分:1)

我会根据文档中的建议将其与摄影机绑定在一起使用,以将手和头部组合在一起。

<a-entity id="cameraRig">
  <!-- camera -->
  <a-entity id="head" camera wasd-controls look-controls></a-entity>
  <!-- hand controls -->
  <a-entity id="left-hand" teleport-controls="cameraRig: #cameraRig; teleportOrigin: #head;"></a-entity>
  <a-entity id="right-hand" teleport-controls="cameraRig: #cameraRig; teleportOrigin: #head;"></a-entity>
</a-entity>