Forum Discussion
cgd82
9 years agoHonored Guest
Trouble getting ovr_GetInputState() to detect Remote Disconnects
I am working on a UE4.12.5 Win64 project with Oculus SDK 1.8.0.
About a month ago I implemented this simple function for determining if an Oculus Remote is connected:
This code used to work all of the time, but sometime within the last few weeks it started malfunctioning. Now it almost always returns true, the ONLY time it returns false is for several ticks after dismissing the Oculus Home screen (if the Remote is disconnected.)
so I am wondering what could possibly be the culprit for this issue? The Oculus firmware has changed several times, maybe that broke it, or maybe there is an Oculus process that we should call every frame that we may have accidentally removed from our gameloop? Any ideas on how to resolve this issue would be appreciated.
(I do NOT believe this is an SDK issue because the same bug occurs in
1.7.0 and 1.8.0. I do NOT believe it is an Unreal issue because we have
not updated from UE4.12.5 since this code was implemented.)
About a month ago I implemented this simple function for determining if an Oculus Remote is connected:
bool FOculusRiftHMD::GetOculusRemoteConnected()
{
//IOculusRiftPlugin& OculusRiftPlugin = IOculusRiftPlugin::Get();
FOvrSessionShared::AutoSession OvrSession(IOculusRiftPlugin::Get().GetSession());
//UE_CLOG(OVR_DEBUG_LOGGING, LogOcInput, Log, TEXT("SendControllerEvents: OvrSession = %p"), ovrSession(OvrSession));
if (OvrSession && FApp::HasVRFocus())
{
ovrInputState OvrInput;
//ovrTrackingState OvrTrackingState;
ovrResult OvrRes = ovr_GetInputState(OvrSession, ovrControllerType_Remote, &OvrInput);
return OVR_SUCCESS(OvrRes);
}
return false;
}This code used to work all of the time, but sometime within the last few weeks it started malfunctioning. Now it almost always returns true, the ONLY time it returns false is for several ticks after dismissing the Oculus Home screen (if the Remote is disconnected.)
so I am wondering what could possibly be the culprit for this issue? The Oculus firmware has changed several times, maybe that broke it, or maybe there is an Oculus process that we should call every frame that we may have accidentally removed from our gameloop? Any ideas on how to resolve this issue would be appreciated.
(I do NOT believe this is an SDK issue because the same bug occurs in
1.7.0 and 1.8.0. I do NOT believe it is an Unreal issue because we have
not updated from UE4.12.5 since this code was implemented.)
No RepliesBe the first to reply
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago