Aframe Camera Switch 仅适用于非 VR 模式

Aframe Camera Switch only works in non VR mode

现在正在研究一个研究项目,用 Aframe 构建一些场景。如果用户进入门进入下一个场景,我会尝试在我的 Aframe 场景中的不同相机之间切换。我有两个以下相机装备,每个场景一个:

<a-entity id="cameraRig" position="10 4 20">
<a-entity id="head" position="0 2 0" camera="" look-controls="pointerLockEnabled:true">
<a-cursor far="30"></a-cursor>
    <a-entity position="0.1 -0.4 0"
      raycaster="objects: .selectable; far: 2"
      teleport-extras
      teleport-controls=
        "cameraRig: #cameraRig;
        teleportOrigin: #head;
        startEvents:starttouch;
        endEvents:endtouch;
        curveShootingSpeed:30;
        hitCylinderRadius:0.3;
        collisionEntities: #tele">
    </a-entity>
 </a-entity>
</a-entity>

这是我更改相机的脚本:

function Hell() {
 document.getElementById('scene1').setAttribute('visible', 'false');
 document.getElementById('hell').setAttribute('visible', 'true');

 var standartCam = document.querySelector('#head');
 standartCam.setAttribute('camera', 'active', false);

 var hellCamera = document.querySelector('#head2');
 hellCamera.setAttribute('camera', 'active', true);
 }

在我进入 VR 模式之前,Switch 一直有效,然后 Camera 根本没有切换。

我试图为第一个 CameraRig 设置一个新位置,但这会导致传送组件出现错误,其中相机会跳到它应该传送到的对象下方。

我怎样才能让它工作?感谢您的帮助。

经过数小时的尝试和错误,我找到了解决方案。 我使用的是 aframe.io/releases/0.8.0。 我切换到 0.7.0 并且它有效。 它也适用于 0.8.2.