Forum Discussion
drash
12 years agoHeroic Explorer
How to detect DK1 vs DK2?
I decided I can't rely on Screen.currentResolution to tell me if the player is using a DK1 or DK2. I don't see a function exposed in OVRDevice that tells me the HMD's info. Does anyone know of a way to determine this?
11 Replies
Replies have been turned off for this discussion
- moltonExplorerI guess that vector3 that the getcameraorientationpositionwhatever function will be changing with the DK2, just set it to 0.0f,0.0f,0.0f and if it changes it's a DK2.
- cyberealityGrand ChampionYou can do this in C++, I'll have to check if there is a way in Unity.
- drashHeroic ExplorerThanks cyber, I appreciate it!
"molton" wrote:
I guess that vector3 that the getcameraorientationpositionwhatever function will be changing with the DK2, just set it to 0.0f,0.0f,0.0f and if it changes it's a DK2.
It's a nice idea, and something like that might work for now, but it probably won't help when it comes to distinguishing between DK2 and CV1. Thanks! - cyberealityGrand ChampionChecking position probably isn't going to be reliable because the SDK will still return plausible values (estimations based on neck-model). In any case, we should have this fixed in the upcoming release so you can query information from the headset.
- brantlewAdventurerIt seems like a very reasonable feature request. We'll get something explicit in there soon, but probably in the short term you will need to infer it.
- owenwpExpert ProtegeBeyond knowing whether it is a DK1 or DK2, it will be pretty important to know if the DK2 has valid position data or not at any given moment.
- cyberealityGrand ChampionYes, you can tell if the camera loses tracking (for example, the user moves outside of view).
- GeraldExpert ProtegeI guess this means we don't get access to the camera data? :(
PS: and can't we simply check what monitors are connected to the system? - jakeslack27Honored GuestWas this feature added to the latest SDK (0.4.2)? Is there an easy way to detect whether the Oculus in running positional tracking - ie DK1/DK2, or DK2 with camera disconnected?
- drashHeroic ExplorerI think in SDK 0.4.x, you can check the tracking state to see if the DK2 is being successfully tracked by the camera, but if this returns false, I'm not sure how you'd differentiate between "the camera is not plugged in" vs "the DK2 is out of range".
Here's how you'd check the tracking state:OVR.Hmd hmd = OVR.Hmd.GetHmd();
if(hmd != null)
{
OVR.ovrTrackingState trackingState = hmd.GetTrackingState();
//NOTE: There's probably a proper constant to use instead of this literal 2
if((trackingState.StatusFlags & 2) == 0)
{
//lost tracking
}
else
{
//currently tracking DK2
}
Note that I think this currently fails in 64-bit Windows builds in 0.4.2.
And while I'm here on this thread which I totally forgot about, here's how one can determine which HMD is being used:if(OVRDevice.IsHMDPresent())
{
OVR.ovrHmdType hmdType = OVRDevice.HMD.GetDesc().Type;
if(hmdType == OVR.ovrHmdType.ovrHmd_DK1)
{
//DK1
}
else if(hmdType == OVR.ovrHmdType.ovrHmd_DKHD)
{
//HD Prototype
}
else if(hmdType == OVR.ovrHmdType.ovrHmd_DK2)
{
//DK2
}
//etc
}
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 years ago
- 2 years agoAnonymous