Download

Auto-detect the type of HMD?

Hi!

Can you advise me please the robust way of HMD type detection (if exists)?

For example, I would know, does Oculus or SteamVR (HTC) is active on start…

Thank you in advance!

GetHMDDeviceType(); returns an EHMDDeviceType Enum;

Example,


if ( GEngine->HMDDevice.IsValid() ) //check pointer is valid
{		
	uint8 result = (uint8)GEngine->HMDDevice->GetHMDDeviceType();
	if ( result == (uint8)EHMDDeviceType::DT_OculusRift ) UE_LOG(LogTemp, Warning, TEXT("Device is Rift"));
	else if ( result == (uint8)EHMDDeviceType::DT_Morpheus ) UE_LOG(LogTemp, Warning, TEXT("Device is Morpheus"));
	else UE_LOG(LogTemp, Warning, TEXT("Device is Other"));
}
else 	UE_LOG(LogTemp, Error, TEXT("No device found!"));

Thank you, Opamp77!

I will make this as node into mine Blueprint library :slight_smile:

At this moment I am using around way - I am checking, does HMD is active -> get Controller IDs. If there is no IDs - then HMD is Oculus.

Thank you once again!