UE4, GearVR + Rift, will this work? — Oculus
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

UE4, GearVR + Rift, will this work?

saviorntsaviornt Posts: 1,951
NerveGear
edited September 2015 in Unreal Development
In the GameMode:

- Event BeginPlay
- Branch | Condition: Is in Low Persistence Mode
-- True
--- Set HUDClass: OculusHUD
-- False
--- Set HUDClass: Gear VR Global Menu

I'm sure you can see where I am going with this, so will this work? (I don't have a phone nor gearVR to test it)

Comments

  • cyberealitycybereality Posts: 26,156 Oculus Staff
    Are you trying to determine if the user is wearing a Rift or a Gear VR? I don't think that is the way to do it.

    Also, Gear VR uses low persistence as well.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • saviorntsaviornt Posts: 1,951
    NerveGear
    Are you trying to determine if the user is wearing a Rift or a Gear VR? I don't think that is the way to do it.

    Also, Gear VR uses low persistence as well.

    Yea, trying to determine which device is being used. I didn't know that the Gear used LP... is there a way to distinguish the two devices?

    I did see that Rama had a plugin that had an OS determination feature, should this be the way to go?


    edit: Found it, there is a "Get Platform Name" Node in blueprints that I can use \o/ -- it should work in theory, but theory I have found is much different than real-life.
  • opampopamp Posts: 326
    Hiro Protagonist
    The correct way would be to call GEngine->HMDDevice->GetHMDDeviceType();

    https://docs.unrealengine.com/latest/INT/API/Runtime/HeadMountedDisplay/EHMDDeviceType__Type/index.html

    example
    if ( GEngine->HMDDevice.IsValid() ) //check pointer is valid
    {
    EHMDDeviceType result = GEngine->HMDDevice->GetHMDDeviceType();
    if ( result == EHMDDeviceType::DT_OculusRift ) UE_LOG(LogTemp, Warning, TEXT("Device is Rift"));
    else if ( result == EHMDDeviceType::DT_GearVR ) UE_LOG(LogTemp, Warning, TEXT("Device is GearVR"));
    else UE_LOG(LogTemp, Warning, TEXT("Device is Other"));
    }
    else UE_LOG(LogTemp, Error, TEXT("No device found!"));
    
    DK2. Phenom 2 x4 4.2GHz,Asrock Extreme 3 970,8GB DDR3 1600, R9 270x 1180/1400.
  • saviorntsaviornt Posts: 1,951
    NerveGear
    That gives me an idea where to look, ty sir. I may open up the hood and make it blueprintable :lol:
Sign In or Register to comment.