简体   繁体   English

在 Unity 中检测 Oculus Quest 1 和 2 耳机

[英]Detect Oculus Quest 1 & 2 Headsets in Unity

I'm looking for a way to detect the name of the headset being used in my VR app.我正在寻找一种方法来检测我的 VR 应用程序中使用的耳机名称。 I need to distinguish between the Quest 1 & 2 in order to implement the different controller mappings.为了实现不同的 controller 映射,我需要区分Quest 1 和 2 Methods like XRDevice.model or OVRPlugin.productName don't provide any name lists in the documentation and since the quest 2 is a new model I haven't found information on it anywhere. XRDevice.model 或 OVRPlugin.productName 等方法未在文档中提供任何名称列表,并且由于任务 2 是新的 model,因此我在任何地方都找不到有关它的信息。 Any help would be appreciated.任何帮助,将不胜感激。

If you are running on the Quest 2 directly (as opposed to Oculus Link) you can use如果您直接在 Quest 2 上运行(而不是 Oculus Link),您可以使用

OVRPlugin.SystemHeadset headset = OVRPlugin.GetSystemHeadsetType();
if(headset==OVRPlugin.SystemHeadset.Oculus_Quest){
// Quest 1 stuff here
}else if (headset==(OVRPlugin.SystemHeadset.Oculus_Quest+1)){
// Quest 2 stuff here
}

They haven't added Oculus Quest 2 to the SystemHeadset enum yet, but it has a "Placeholder_9" in its place.他们还没有将 Oculus Quest 2 添加到 SystemHeadset 枚举中,但它有一个“Placeholder_9”。 I just prefer the "+1" for clarity.为了清楚起见,我只是更喜欢“+1”。

If you are using the link, it will return Oculus_Link_Quest for Quest 1 and I assume (Oculus_Link_Quest+1) for Quest 2. But I haven't confirmed that.如果您使用该链接,它将返回 Oculus_Link_Quest 用于 Quest 1,我假设 (Oculus_Link_Quest+1) 用于 Quest 2。但我尚未确认。

Edit: As of 2020-12-06, both Quest1 and Quest2 return "Oculus_Link_Quest" if you're using Oculus Link.编辑:截至 2020 年 12 月 6 日,如果您使用的是 Oculus Link,则 Quest1 和 Quest2 都会返回“Oculus_Link_Quest”。

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

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