如何在统一中禁用Oculus Rift DK2陀螺仪?

时间:2015-11-27 09:19:03

标签: c# unity3d gyroscope oculus

我正在为Oculus Rift DK2设置更大的跟踪区域。禁用位置跟踪是没有问题的。但我无法禁用陀螺仪。 我正在使用OVRCameraRig预制件。我试图禁用该功能

UpdateAnchors();
Update()函数中的

。但轮换仍在更新。 我浏览了OVR的所有其他脚本并禁用了几个函数,但陀螺仪的roation-update仍在工作。

我在这里找到了一个解决方案OVR wiki,但我找不到setOrientation()函数...

有什么想法吗?谢谢!

编辑:Unity v5.2.3f1,Oculus Utilities v0.1.2.0,OVRPlugin v0.1.4.0。

1 个答案:

答案 0 :(得分:2)

建议使用这两种技术on the Oculus forums

在OVRC​​ameraRig.cs中添加到UpdateAnchors()的末尾:

$ python2
>>> help(print) # fail because print is a statement in python2
         ^
SyntaxError: invalid syntax
>>> from __future__ import print_function
>>> help(print)
>>> Help on built-in function print in module __builtin__:

print(...)
    print(value, ..., sep=' ', end='\n', file=sys.stdout)
.....

添加一个Awake功能并将此脚本设置为execute first

trackingSpace.FromOVRPose(centerEyeAnchor.ToOVRPose().Inverse());

我在Oculus Utilities v0.1.2,Unity 5.1.2p3和Oculus Runtime 0.6的干净项目中尝试了两种方法。第一个创造了一个不可接受的频闪效果,而第二个根本没有效果。也许它适用于较新版本的Unity。

我还尝试通过在Update,LateUpdate和EndOfFrame中将相机的旋转重置为零来进行黑客攻击,但这也无效。也许可以操纵Unity的事件顺序来解决这个问题。

相关问题