如何在 A-FRAME 中强制禁用陀螺仪 [英] How to force disable Gyroscope in A-FRAME

查看:89
本文介绍了如何在 A-FRAME 中强制禁用陀螺仪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我们可以用最少的代码禁用移动设备中的陀螺仪吗?我试图禁用某些此属性 https://aframe.io/docs/1.0.0/components/look-controls.html 但没有一个用于禁用陀螺仪.我真的需要创建自己的 look-controls.js 吗?如果这是真的,我需要更改什么才能禁用陀螺仪.

I wonder can we disable the gyro in a mobile device, with minimal code? I tried to disable some of this property https://aframe.io/docs/1.0.0/components/look-controls.html but none is for disable gyro. Do I really need to create my own look-controls.js? If that's true what exactly do I need to change to disable the gyroscope.

推荐答案

有一个新的 magicWindowTrackingEnabled 属性在您可以使用的外观控件组件中.现在可以在 master builds以及即将推出的 A-Frame 1.1.0 版本.

There's a new magicWindowTrackingEnabled property in the look-controls component you can use. It's now available in master builds and the upcoming A-Frame 1.1.0 version.

使用主构建的工作示例:

Working example using a master build:

https://glitch.com/edit/#!/cliff-light-glasses?path=index.html%3A18%3A55

这篇关于如何在 A-FRAME 中强制禁用陀螺仪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆