I’m developing a game which will run into the SteamVR platform. I need to detect what model of HMD is the user using (Rift, VIVE, Windows MR device), so that I can change for example the Motion Controller models, and even their behavior depending on it.
I can see that there is a method ‘GEngine->XRSystem->GetSystemName()’ which returns the platform I’m running on (SteamVR), but I can’t see any way for obtaining the underlying HMD model or even the underlying motion controller types.
It should return the HMD name even if you are using SteamVR. I published a VR game on Steam which had different settings for Vive and Rift. I was using switch on the Node output and it was working without any issues.
I found a work around that’s adequate for my situation, maybe it’ll help someone else. It’s not ideal, but the IHeadMountedDisplay::MonitorInfo struct has a property for the MonitorName and you can switch or parse that name to determine which device you’re running. I tried it on a few Vives, a Vive Pro, and a Samsung Odyssey. I get a name starting with “LHR-” for the Vives and “WindowsHolographic” for the Samsung.
The Get HMD Device Name node will return the name of the VR system currently used. If you’ve enabled both Steam VR and Oculus plugins in your build, the engine will use the Oculus plugin if it detects an Oculus and Steam VR if it detects Vive. So in that case it will properly differentiate between Oculus and Vive. However, if the Oculus plugin is not enabled it will always return Steam VR.
There is a VR Expansion plugin available that has a function that returns the HMD manufacturer regardless of which plugin is running. If I’m not mistaken, it can also return strings for manufacturer and model if you want to have different settings for Vive and Vive pro for example.