Option to gently fade chaperone to disabled below a certain height (#622)

* Option to fade out chaperone when HMD goes below a configured height

Useful for setups in which you have a seat just outside your VR space,
or like to sit in the middle of your space for any amount of time. Will
fade out the boundaries to 0% opacity over 5 seconds, 5 seconds after
you sit down. Standing back up to the configured height will make them
pop back in immediately.

Can be found under Chaperone -> Additional Settings.

* Update format.sh to require clang-format v10

* Use fade distance instead of opacity, opacity inconsistently applied

* Bugfixes (#624)

* stop crashing on HMD Init Errors, as well as bypass force quit on all steamvr Init Errors

* add qtc clang to gitignore

* add app volume adjustment

* adjust app volume placement in menu

* fix type error

* increment version

* fix version number

---------

Co-authored-by: ykeara <ykeara1@gmail.com>
This commit is contained in:
Chelsea Jaggi
2023-05-17 14:21:59 -05:00
committed by GitHub
co-authored by ykeara
parent 65b5aace06
commit 1cfd9ff104
14 changed files with 340 additions and 14 deletions
+23 -2
View File
@@ -69,6 +69,7 @@ OverlayController::OverlayController( bool desktopMode,
m_runtimePathUrl = QUrl::fromLocalFile( tempRuntimePath );
LOG( INFO ) << "VR Runtime Path: " << m_runtimePathUrl.toLocalFile();
const double initVol = soundVolume();
constexpr auto clickSoundURL = "res/sounds/click.wav";
const auto activationSoundFile
= paths::binaryDirectoryFindFile( clickSoundURL );
@@ -77,7 +78,7 @@ OverlayController::OverlayController( bool desktopMode,
{
m_activationSoundEffect.setSource( QUrl::fromLocalFile(
QString::fromStdString( ( *activationSoundFile ) ) ) );
m_activationSoundEffect.setVolume( 0.7 );
m_activationSoundEffect.setVolume( initVol );
}
else
{
@@ -92,7 +93,7 @@ OverlayController::OverlayController( bool desktopMode,
{
m_focusChangedSoundEffect.setSource( QUrl::fromLocalFile(
QString::fromStdString( ( *focusChangedSoundFile ) ) ) );
m_focusChangedSoundEffect.setVolume( 0.7 );
m_focusChangedSoundEffect.setVolume( initVol );
}
else
{
@@ -1648,6 +1649,26 @@ void OverlayController::setKeyboardPos()
vr::VROverlay()->SetKeyboardPositionForOverlay( m_ulOverlayHandle, empty );
}
void OverlayController::setSoundVolume( double value, bool notify )
{
m_activationSoundEffect.setVolume( value );
m_focusChangedSoundEffect.setVolume( value );
// leaving alarm sound alone for now as chaperone warning setting effects it
// m_alarm01SoundEffect.setVolume( value);
settings::setSetting( settings::DoubleSetting::APPLICATION_appVolume,
value );
if ( notify )
{
emit soundVolumeChanged( value );
}
}
double OverlayController::soundVolume() const
{
return settings::getSetting(
settings::DoubleSetting::APPLICATION_appVolume );
}
void OverlayController::playActivationSound()
{
if ( !m_noSound )