禁用触摸外观控制A-Frame

问题描述 投票:0回答:1

如何在 A 框架场景中禁用通过触摸查看控件环顾 360 度全景?

我的场景中有一个天空元素,我不想通过触摸输入环顾我的 360 度全景,而只想移动我的智能手机。 我尝试在相机上禁用 touchEnable 以及我在文档中看到的其他内容,但没有任何效果。

我正在 Windows 和 Android 中使用 Aframe 版本 1.5.0 进行测试

<a-scene ref={sceneRef} className="h-full" vr-mode-ui="enabled: false">

      <a-assets>
        <img id="360image" src={srcImg360} />
        <audio id="360audio" src={srcAudio360} preload="auto" />
      </a-assets>

      <a-sky
        ref={sphereRef}
        id="image-360"
        radius="10"
        src="#360image"
      ></a-sky>

      <a-entity
        camera
        look-controls="enabled: false; mouseEnabled: false; touchEnabled: false"
        ref={cameraRef}
      ></a-entity>

</a-scene>
three.js augmented-reality aframe
1个回答
0
投票

<!DOCTYPE html>
<html>
  <head>
    <script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
  </head>
  <body>
    <a-scene>
      <a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
      <a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
      <a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
      <a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
      <a-sky color="#ECECEC"></a-sky>
      <a-entity 
        position="0 1.6 1" 
        camera 
        look-controls="touchEnabled: false" wasd-controls>
      </a-entity>    
    </a-scene>
  </body>
</html>

可运行代码:https://glitch.com/edit/#!/debonair-mesquite-mass?path=index.html%3A1%3A0

© www.soinside.com 2019 - 2024. All rights reserved.