ValveSoftware / openvr

OpenVR SDK
http://steamvr.com
BSD 3-Clause "New" or "Revised" License
6.09k stars 1.28k forks source link

Shown non-dashboard overlay with mouse input blocks input to main scene #1429

Open OptoCloud opened 4 years ago

OptoCloud commented 4 years ago

Hi, I'm trying to make a in-game non-dashboard overlay that accepts mouse input. This overlay is shown/hidden by clicking a button on the controller, and should accept mouse input when visible.

So i call:

vr::VROverlay()->SetOverlayInputMethod(m_overlay, vr::VROverlayInputMethod_Mouse);
vr::VROverlay()->SetOverlayFlag(m_overlay, vr::VROverlayFlags_MakeOverlaysInteractiveIfVisible, true);

This however also blocks all input to the vr game when activated Is there any way i can toggle some flag so that the user can still interact with the game when the overlay is shown? The alternative is that i get all poses, and the overlay offset, and do ray-casting to the screen manually which is way outside my expertise Thanks

YabbaTroll commented 4 years ago

I had this same problem when I tried to have an overlay appear whenever a trigger was >20% pressed. The overlay would flicker on and off as whenever it was visible input from the trigger would be ignored.

My solution was to use IVROverlay::ComputeOverlayIntersection, which seems to do all of the work of that last part you wrote for you.