How to detect VR headset is mounted?

I am using Hoops Demo Viewer applifcation, I found the software can detect the VR headset is mounted or not (Visual Effects → Virtual Reality Button is enabled or not).

I tried to use the hps_openvr_sandbox project but I could not find the code related this function.

1 Like

Hey @vuhuyen128 -

I think you should start here: Virtual Reality — HOOPS Visualize HPS 2024 Documentation

Let me know if you have any other questions.

@gabriel.peragine Thank you for your reply.
I followed the tutorial and I confirmed that Hoops Visualize model is displayed inside the VR headset.
In my application, I want to get VR headset device is mounted or unmounted event. May be it is the same as the Vitural Reality button status in Hoops Demo Viewer application. If the VR headset is mounted, the button is enabled and if the VR headset is unmouted, the button is disabled.
I could not found the code and information related this function in the tutorial.
I will very happy if I can get any hint to implement this function.
Thank you.

Hey @vuhuyen128 which kind of VR headset are you trying to use ?

We use vr::VR_IsHmdPresent() (OpenVr framework) to know if we need to active or not the VR option.
The call is managed by the GUI framework by a pooling.
Does it answer your question ?

1 Like

@quentin.paris Thank you so much for your support.
I used meta quest 3 headset.
I will try as your advice. :saluting_face:

1 Like