From c9c19c61b54b15a0ea87ff80689f870179ee01ed Mon Sep 17 00:00:00 2001 From: Vasily Date: Mon, 29 Jul 2019 20:10:07 +0200 Subject: [PATCH] Revert "Reduce update rate of chaperone velocity modifiers" This reverts commit e712f4aa1f514d5875cb322a58f564362682612e. The issue turned out to be isolated to Linux, since it wasn't possible to reproduce the issue completely on Windows. An MVP for the bug can be found here https://github.com/username223/SteamVR-Manjaro-Sync-Crash The issue is very likely to be on SteamVR's end, since the issue doesn't appear on the same CPU running Windows. The fix for the issue in https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/252 is to by default turn off the offending feature. This doesn't fix anything, but it will prevent people from having OVRAS kill their performance just by running the application. --- src/tabcontrollers/ChaperoneTabController.cpp | 43 +++++++++---------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/tabcontrollers/ChaperoneTabController.cpp b/src/tabcontrollers/ChaperoneTabController.cpp index 066152b..d21fe0b 100644 --- a/src/tabcontrollers/ChaperoneTabController.cpp +++ b/src/tabcontrollers/ChaperoneTabController.cpp @@ -572,6 +572,27 @@ void ChaperoneTabController::eventLoopTick( float rightSpeed, float hmdSpeed ) { + m_chaperoneVelocityModifierCurrent = 1.0f; + if ( m_enableChaperoneVelocityModifier ) + { + float mod = m_chaperoneVelocityModifier + * std::max( { leftSpeed, rightSpeed, hmdSpeed } ); + if ( mod > 0.02f ) + { + m_chaperoneVelocityModifierCurrent += mod; + } + } + float newFadeDistance = m_fadeDistance * m_chaperoneVelocityModifierCurrent; + if ( m_fadeDistanceModified != newFadeDistance ) + { + m_fadeDistanceModified = newFadeDistance; + vr::VRSettings()->SetFloat( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_FadeDistance_Float, + m_fadeDistanceModified ); + vr::VRSettings()->Sync(); + } + if ( devicePoses ) { m_isHMDActive = false; @@ -664,28 +685,6 @@ void ChaperoneTabController::eventLoopTick( if ( settingsUpdateCounter >= k_chaperoneSettingsUpdateCounter ) { - m_chaperoneVelocityModifierCurrent = 1.0f; - if ( m_enableChaperoneVelocityModifier ) - { - float mod = m_chaperoneVelocityModifier - * std::max( { leftSpeed, rightSpeed, hmdSpeed } ); - if ( mod > 0.02f ) - { - m_chaperoneVelocityModifierCurrent += mod; - } - } - float newFadeDistance - = m_fadeDistance * m_chaperoneVelocityModifierCurrent; - if ( m_fadeDistanceModified != newFadeDistance ) - { - m_fadeDistanceModified = newFadeDistance; - vr::VRSettings()->SetFloat( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_FadeDistance_Float, - m_fadeDistanceModified ); - vr::VRSettings()->Sync(); - } - if ( parent->isDashboardVisible() ) { vr::EVRSettingsError vrSettingsError;