简体   繁体   English

如何关闭单击/触摸以在 A-Frame 中拖动控件?

[英]How can I turn off click/touch to drag controls in A-Frame?

I'm using a-frame and I would like to turn off the default looking around behaviour of the mouse or finger when you click and drag to look around.我正在使用框架,我想在您单击并拖动以环顾四周时关闭鼠标或手指的默认环视行为。 I want to take control of scrolling and move around the 3D space when the user scrolls instead.当用户滚动时,我想控制滚动并在 3D 空间中移动。 How can I stop that default behaviour?我怎样才能停止这种默认行为?

So far I have this:到目前为止,我有这个:

 <a-camera position="0 5 8" fov="50" touchEnabled="false" wasd-controls-enabled="false" look-controls="false" touchEnabled="false">

But none of these attributes makes any difference to that default behaviour.但是这些属性都不会对默认行为产生任何影响。

I do still need click/tapping on objects to work with the raycaster so turning off EVERYTHING mouse/touch related would be no good, I just want to turn off click/touch to drag and look around.我仍然需要单击/轻敲对象才能使用光线投射器,因此关闭所有与鼠标/触摸相关的东西都不好,我只想关闭单击/触摸以拖动和环顾四周。

THANKS谢谢

Replace the look-controls="false" attribute with look-controls-enabled="false"look-controls-enabled="false"替换look-controls="false"属性

<a-camera position="0 5 8" fov="50" touchEnabled="false" wasd-controls-enabled="false" look-controls-enabled="false" touchEnabled="false">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM