diff --git a/.circleci/config.yml b/.circleci/config.yml index c4fc182..09ad979 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,6 +66,9 @@ jobs: - run: name: Install bear/clang-tidy command: sudo apt-get install bear clang-tidy -y + - run: + name: Install SDL libs + command: sudo apt-get install libsdl2-2.0-0 -y - run: name: Set up qtchooser command: qtchooser -install opt-qt512 /opt/qt512/bin/qmake diff --git a/build_scripts/compile_version_string.txt b/build_scripts/compile_version_string.txt index 160afd5..e6e318c 100644 --- a/build_scripts/compile_version_string.txt +++ b/build_scripts/compile_version_string.txt @@ -1 +1 @@ -5.0.2-dev \ No newline at end of file +5.1.0-release \ No newline at end of file diff --git a/build_scripts/qt/resources.pri b/build_scripts/qt/resources.pri index 259cd38..6bf55e6 100644 --- a/build_scripts/qt/resources.pri +++ b/build_scripts/qt/resources.pri @@ -8,16 +8,24 @@ RESOURCES += src/res/resources.qrc DISTFILES += \ src/res/sounds/alarm01.wav \ + src/res/sounds/click.wav \ + src/res/sounds/focus.wav \ src/res/img/audio/microphone/ptt_notification.png \ src/res/img/audio/microphone/ptt_notification.svg \ src/res/img/battery/* \ src/res/img/icons/* \ + src/res/img/video/* \ + src/res/img/chaperone/* \ src/res/qml/qmldir \ src/res/qml/audio_page/* \ src/res/qml/ChaperonePage.qml \ src/res/qml/ChaperoneWarningsPage.qml \ src/res/qml/chaperone_page/* \ src/res/qml/chaperone_page/change_orientation/* \ + src/res/qml/chaperone_page/chaperone_additional/* \ + src/res/qml/chaperone_page/chaperone_additional/chaperoneboundscolor/* \ + src/res/qml/chaperone_page/chaperone_additional/chaperonetype/* \ + src/res/qml/chaperone_page/chaperone_additional/chaperonemisc/* \ src/res/qml/FixFloorPage.qml \ src/res/qml/PlayspacePage.qml \ src/res/qml/motion_page/* \ @@ -47,10 +55,10 @@ DISTFILES += \ src/res/qml/video_page/profiles/* \ src/res/qml/video_page/dialogboxes/* \ src/res/qml/video_page/overlaycolorbright/* \ - src/res/qml/rotation_page/* \ - src/res/qml/rotation_page/redirected/* \ - src/res/qml/rotation_page/snap_turn/* \ - src/res/qml/rotation_page/space_turn/* \ + src/res/qml/rotation_page/* \ + src/res/qml/rotation_page/redirected/* \ + src/res/qml/rotation_page/snap_turn/* \ + src/res/qml/rotation_page/space_turn/* \ src/res/qml/common/* win32:RC_ICONS += src/res/img/icons/advicon256px.ico diff --git a/build_scripts/qt/sources.pri b/build_scripts/qt/sources.pri index dbff1e8..28658c7 100644 --- a/build_scripts/qt/sources.pri +++ b/build_scripts/qt/sources.pri @@ -9,10 +9,12 @@ SOURCES += src/main.cpp\ src/tabcontrollers/SteamVRTabController.cpp \ src/tabcontrollers/UtilitiesTabController.cpp \ src/tabcontrollers/VideoTabController.cpp \ - src/tabcontrollers/RotationTabController.cpp\ + src/tabcontrollers/RotationTabController.cpp\ src/utils/ChaperoneUtils.cpp \ src/openvr/openvr_init.cpp \ src/openvr/ivrinput.cpp \ + src/openvr/ovr_settings_wrapper.cpp \ + src/openvr/ovr_overlay_wrapper.cpp \ src/utils/setup.cpp \ src/utils/paths.cpp \ src/utils/FrameRateUtils.cpp \ @@ -34,7 +36,7 @@ HEADERS += src/overlaycontroller.h \ src/tabcontrollers/UtilitiesTabController.h \ src/tabcontrollers/VideoTabController.h \ src/tabcontrollers/audiomanager/AudioManager.h \ - src/tabcontrollers/RotationTabController.h\ + src/tabcontrollers/RotationTabController.h\ src/keyboard_input/keyboard_input.h \ src/media_keys/media_keys.h \ src/utils/Matrix.h \ @@ -46,6 +48,8 @@ HEADERS += src/overlaycontroller.h \ src/openvr/ivrinput_action_set.h \ src/openvr/ivrinput_input_source.h \ src/openvr/ivrinput.h \ + src/openvr/ovr_settings_wrapper.h \ + src/openvr/ovr_overlay_wrapper.h \ src/utils/setup.h \ src/utils/paths.h \ src/utils/FrameRateUtils.h \ diff --git a/src/openvr/ovr_overlay_wrapper.cpp b/src/openvr/ovr_overlay_wrapper.cpp new file mode 100644 index 0000000..0af3a8b --- /dev/null +++ b/src/openvr/ovr_overlay_wrapper.cpp @@ -0,0 +1,199 @@ +#include "ovr_overlay_wrapper.h" + +namespace ovr_overlay_wrapper +{ +OverlayError createOverlay( const std::string overlayKey, + const std::string overlayName, + vr::VROverlayHandle_t* overlayHandle, + std::string customErrorMsg ) +{ + vr::VROverlayError oError = vr::VROverlay()->CreateOverlay( + overlayKey.c_str(), overlayName.c_str(), overlayHandle ); + if ( oError == vr::VROverlayError_None ) + { + return OverlayError::NoError; + } + else + { + LOG( ERROR ) << "Could not create overlay: " << overlayName + << "because " + << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) + << " " << customErrorMsg; + return OverlayError::UndefinedError; + } +} + +OverlayError setOverlayColor( vr::VROverlayHandle_t overlayHandle, + float red, + float green, + float blue, + std::string customErrorMsg ) +{ + vr::VROverlayError oError + = vr::VROverlay()->SetOverlayColor( overlayHandle, red, green, blue ); + if ( oError == vr::VROverlayError_None ) + { + return OverlayError::NoError; + } + else + { + LOG( ERROR ) << "Error setting Overlay Color For " + << getOverlayKey( overlayHandle ) << " with error: " + << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) + << " " << customErrorMsg; + return OverlayError::UndefinedError; + } +} + +OverlayError setOverlayAlpha( vr::VROverlayHandle_t overlayHandle, + float alpha, + std::string customErrorMsg ) +{ + vr::VROverlayError oError + = vr::VROverlay()->SetOverlayAlpha( overlayHandle, alpha ); + if ( oError == vr::VROverlayError_None ) + { + return OverlayError::NoError; + } + else + { + LOG( ERROR ) << "Error setting Overlay Alpha For " + << getOverlayKey( overlayHandle ) << " with error: " + << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) + << " " << customErrorMsg; + return OverlayError::UndefinedError; + } +} + +OverlayError setOverlayWidthInMeters( vr::VROverlayHandle_t overlayHandle, + float widthInMeters, + std::string customErrorMsg ) +{ + vr::VROverlayError oError = vr::VROverlay()->SetOverlayWidthInMeters( + overlayHandle, widthInMeters ); + if ( oError == vr::VROverlayError_None ) + { + return OverlayError::NoError; + } + else + { + LOG( ERROR ) << "Error setting overlay width For " + << getOverlayKey( overlayHandle ) << " with error: " + << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) + << " " << customErrorMsg; + return OverlayError::UndefinedError; + } +} + +OverlayError setOverlayFromFile( vr::VROverlayHandle_t overlayHandle, + std::string fileName, + std::string customErrorMsg ) +{ + { + const auto overlayPath = paths::binaryDirectoryFindFile( fileName ); + if ( overlayPath.has_value() ) + { + vr::VROverlayError oError = vr::VROverlay()->SetOverlayFromFile( + overlayHandle, overlayPath->c_str() ); + if ( oError == vr::VROverlayError_None ) + { + return OverlayError::NoError; + } + else + { + LOG( ERROR ) + << "Error setting Overlay from file For " + << getOverlayKey( overlayHandle ) << " with error: " + << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) + << " " << customErrorMsg; + return OverlayError::UndefinedError; + } + } + else + { + LOG( ERROR ) << "File not Found: " << fileName << customErrorMsg; + return OverlayError::UndefinedError; + } + } +} + +OverlayError showOverlay( vr::VROverlayHandle_t overlayHandle, + std::string customErrorMsg ) +{ + vr::VROverlayError oError = vr::VROverlay()->ShowOverlay( overlayHandle ); + if ( oError == vr::VROverlayError_None ) + { + return OverlayError::NoError; + } + else + { + LOG( ERROR ) << "Error showing overlay For " + << getOverlayKey( overlayHandle ) << " with error: " + << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) + << " " << customErrorMsg; + return OverlayError::UndefinedError; + } +} + +OverlayError hideOverlay( vr::VROverlayHandle_t overlayHandle, + std::string customErrorMsg ) +{ + vr::VROverlayError oError = vr::VROverlay()->HideOverlay( overlayHandle ); + if ( oError == vr::VROverlayError_None ) + { + return OverlayError::NoError; + } + else + { + LOG( ERROR ) << "Error hiding overlay For " + << getOverlayKey( overlayHandle ) << " with error: " + << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) + << " " << customErrorMsg; + return OverlayError::UndefinedError; + } +} + +OverlayError setOverlayTransformAbsolute( + vr::VROverlayHandle_t overlayHandle, + vr::ETrackingUniverseOrigin trackingOrigin, + const vr::HmdMatrix34_t* trackingOriginToOverlayTransform, + std::string customErrorMsg ) +{ + vr::VROverlayError oError = vr::VROverlay()->SetOverlayTransformAbsolute( + overlayHandle, trackingOrigin, trackingOriginToOverlayTransform ); + if ( oError == vr::VROverlayError_None ) + { + return OverlayError::NoError; + } + else + { + LOG( ERROR ) << "Error setting Overlay Position For " + << getOverlayKey( overlayHandle ) << " with error: " + << vr::VROverlay()->GetOverlayErrorNameFromEnum( oError ) + << " " << customErrorMsg; + return OverlayError::UndefinedError; + } +} + +std::string getOverlayKey( vr::VROverlayHandle_t overlayHandle ) +{ + // max size as of ovr 1.11.11 128 bytes + const uint32_t bufferMax = vr::k_unVROverlayMaxKeyLength; + char cStringOut[bufferMax]; + vr::EVROverlayError oErrorOut; + vr::VROverlay()->GetOverlayKey( + overlayHandle, cStringOut, bufferMax, &oErrorOut ); + std::string output = cStringOut; + if ( oErrorOut == vr::VROverlayError_None ) + { + return output; + } + else + { + std::string errorName + = vr::VROverlay()->GetOverlayErrorNameFromEnum( oErrorOut ); + return ( "can't get name:" + errorName ); + } +} + +} // namespace ovr_overlay_wrapper diff --git a/src/openvr/ovr_overlay_wrapper.h b/src/openvr/ovr_overlay_wrapper.h new file mode 100644 index 0000000..3152946 --- /dev/null +++ b/src/openvr/ovr_overlay_wrapper.h @@ -0,0 +1,58 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include "../utils/paths.h" + +/* Wrapper For OpenVR's IVR settings class, allows us to do our error logging + * while also minimizing code + * + */ +namespace ovr_overlay_wrapper +{ +// might make sense to mirror ovr's errors exactly, but for now this is more +// than sufficient +enum class OverlayError +{ + NoError, + UndefinedError, + +}; + +OverlayError createOverlay( const std::string overlayKey, + const std::string overlayName, + vr::VROverlayHandle_t* overlayHandle, + std::string customErrorMsg = "" ); + +OverlayError setOverlayColor( vr::VROverlayHandle_t overlayHandle, + float red, + float green, + float blue, + std::string customErrorMsg = "" ); +OverlayError setOverlayAlpha( vr::VROverlayHandle_t overlayHandle, + float alpha, + std::string customErrorMsg = "" ); + +OverlayError setOverlayWidthInMeters( vr::VROverlayHandle_t overlayHandle, + float widthInMeters, + std::string customErrorMsg = "" ); +OverlayError setOverlayFromFile( vr::VROverlayHandle_t overlayHandle, + std::string fileName, + std::string customErrorMsg = "" ); +OverlayError showOverlay( vr::VROverlayHandle_t overlayHandle, + std::string customErrorMsg = "" ); +OverlayError hideOverlay( vr::VROverlayHandle_t overlayHandle, + std::string customErrorMsg = "" ); +OverlayError setOverlayTransformAbsolute( + vr::VROverlayHandle_t overlayHandle, + vr::ETrackingUniverseOrigin trackingOrigin, + const vr::HmdMatrix34_t* trackingOriginToOverlayTransform, + std::string customErrorMsg = "" ); + +std::string getOverlayKey( vr::VROverlayHandle_t overlayHandle ); + +} // namespace ovr_overlay_wrapper diff --git a/src/openvr/ovr_settings_wrapper.cpp b/src/openvr/ovr_settings_wrapper.cpp new file mode 100644 index 0000000..a09a168 --- /dev/null +++ b/src/openvr/ovr_settings_wrapper.cpp @@ -0,0 +1,148 @@ +#include "ovr_settings_wrapper.h" + +namespace ovr_settings_wrapper +{ +SettingsError handleErrors( std::string settingsKey, + vr::EVRSettingsError error, + std::string customErrorMsg ) +{ + if ( error != vr::VRSettingsError_None ) + { + LOG( ERROR ) << "Could not access \"" << settingsKey << "\" setting: " + << vr::VRSettings()->GetSettingsErrorNameFromEnum( error ) + << " " << customErrorMsg; + + return SettingsError::UndefinedError; + } + return SettingsError::NoError; +} + +std::pair getBool( std::string section, + std::string settingsKey, + std::string customErrorMsg ) + +{ + bool value; + vr::EVRSettingsError error; + value = vr::VRSettings()->GetBool( + section.c_str(), settingsKey.c_str(), &error ); + SettingsError e = handleErrors( settingsKey, error, customErrorMsg ); + std::pair p( e, value ); + return p; +} + +std::pair getInt32( std::string section, + std::string settingsKey, + std::string customErrorMsg ) + +{ + int value; + vr::EVRSettingsError error; + value = static_cast( vr::VRSettings()->GetInt32( + section.c_str(), settingsKey.c_str(), &error ) ); + SettingsError e = handleErrors( settingsKey, error, customErrorMsg ); + std::pair p( e, value ); + return p; +} + +std::pair getFloat( std::string section, + std::string settingsKey, + std::string customErrorMsg ) + +{ + float value; + vr::EVRSettingsError error; + value = vr::VRSettings()->GetFloat( + section.c_str(), settingsKey.c_str(), &error ); + handleErrors( settingsKey, error, customErrorMsg ); + SettingsError e = handleErrors( settingsKey, error, customErrorMsg ); + std::pair p( e, value ); + return p; +} + +std::pair getString( std::string section, + std::string settingsKey, + std::string customErrorMsg ) + +{ + vr::EVRSettingsError error; + // This appears to be correct value as set in CVRSettingHelper as of + // ovr 1.11.11 + const uint32_t bufferMax = 4096; + char cStringOut[bufferMax]; + + vr::VRSettings()->GetString( + section.c_str(), settingsKey.c_str(), cStringOut, bufferMax, &error ); + handleErrors( settingsKey, error, customErrorMsg ); + std::string value = cStringOut; + SettingsError e = handleErrors( settingsKey, error, customErrorMsg ); + std::pair p( e, value ); + return p; +} + +// Setters + +SettingsError setBool( std::string section, + std::string settingsKey, + bool value, + std::string customErrorMsg ) +{ + vr::EVRSettingsError error; + vr::VRSettings()->SetBool( + section.c_str(), settingsKey.c_str(), value, &error ); + return handleErrors( settingsKey, error, customErrorMsg ); +} + +SettingsError setInt32( std::string section, + std::string settingsKey, + int value, + std::string customErrorMsg ) +{ + vr::EVRSettingsError error; + vr::VRSettings()->SetInt32( section.c_str(), + settingsKey.c_str(), + static_cast( value ), + &error ); + return handleErrors( settingsKey, error, customErrorMsg ); +} + +SettingsError setFloat( std::string section, + std::string settingsKey, + float value, + std::string customErrorMsg ) +{ + vr::EVRSettingsError error; + vr::VRSettings()->SetFloat( + section.c_str(), settingsKey.c_str(), value, &error ); + return handleErrors( settingsKey, error, customErrorMsg ); +} + +SettingsError setString( std::string section, + std::string settingsKey, + char* value, + std::string customErrorMsg ) +{ + vr::EVRSettingsError error; + vr::VRSettings()->SetString( + section.c_str(), settingsKey.c_str(), value, &error ); + return handleErrors( settingsKey, error, customErrorMsg ); +} + +SettingsError removeSection( std::string section, std::string customErrorMsg ) +{ + vr::EVRSettingsError error; + vr::VRSettings()->RemoveSection( section.c_str(), &error ); + return handleErrors( "section", error, customErrorMsg ); +} + +SettingsError removeKeyInSection( std::string section, + std::string settingsKey, + std::string customErrorMsg ) +{ + vr::EVRSettingsError error; + vr::VRSettings()->RemoveKeyInSection( + section.c_str(), settingsKey.c_str(), &error ); + return handleErrors( settingsKey, error, customErrorMsg ); +} + +} // namespace ovr_settings_wrapper diff --git a/src/openvr/ovr_settings_wrapper.h b/src/openvr/ovr_settings_wrapper.h new file mode 100644 index 0000000..01fb465 --- /dev/null +++ b/src/openvr/ovr_settings_wrapper.h @@ -0,0 +1,66 @@ +#pragma once + +#include +#include +#include +#include +#include + +/* Wrapper For OpenVR's IVR settings class, allows us to do our error logging + * while also minimizing code + * + */ +namespace ovr_settings_wrapper +{ +// might make sense to mirror ovr's errors exactly, but for now this is more +// than sufficient +enum class SettingsError +{ + NoError, + UndefinedError, + +}; + +std::pair getBool( std::string section, + std::string settingsKey, + std::string customErrorMsg = "" ); + +std::pair getInt32( std::string section, + std::string settingsKey, + std::string customErrorMsg = "" ); + +std::pair getFloat( std::string section, + std::string settingsKey, + std::string customErrorMsg = "" ); +std::pair getString( std::string section, + std::string settingsKey, + std::string customErrorMsg + = "" ); + +SettingsError setBool( std::string section, + std::string settingsKey, + bool value, + std::string customErrorMsg = "" ); +SettingsError setInt32( std::string section, + std::string settingsKey, + int value, + std::string customErrorMsg = "" ); +SettingsError setFloat( std::string section, + std::string settingsKey, + float value, + std::string customErrorMsg = "" ); +SettingsError setString( std::string section, + std::string settingsKey, + char* value, + std::string customErrorMsg = "" ); + +SettingsError removeSection( std::string section, + std::string customErrorMsg = "" ); +SettingsError removeKeyInSection( std::string section, + std::string settingsKey, + std::string customErrorMsg = "" ); + +SettingsError handleErrors( std::string settingsKey, + vr::EVRSettingsError, + std::string customErrorMsg ); +} // namespace ovr_settings_wrapper diff --git a/src/overlaycontroller.cpp b/src/overlaycontroller.cpp index 00e87be..21297ab 100644 --- a/src/overlaycontroller.cpp +++ b/src/overlaycontroller.cpp @@ -69,35 +69,35 @@ OverlayController::OverlayController( bool desktopMode, m_runtimePathUrl = QUrl::fromLocalFile( tempRuntimePath ); LOG( INFO ) << "VR Runtime Path: " << m_runtimePathUrl.toLocalFile(); - QString activationSoundFile = m_runtimePathUrl.toLocalFile().append( - "/content/panorama/sounds/activation.wav" ); - QFileInfo activationSoundFileInfo( activationSoundFile ); - if ( activationSoundFileInfo.exists() && activationSoundFileInfo.isFile() ) + constexpr auto clickSoundURL = "res/sounds/click.wav"; + const auto activationSoundFile + = paths::binaryDirectoryFindFile( clickSoundURL ); + + if ( activationSoundFile.has_value() ) { - m_activationSoundEffect.setSource( - QUrl::fromLocalFile( activationSoundFile ) ); - m_activationSoundEffect.setVolume( 1.0 ); + m_activationSoundEffect.setSource( QUrl::fromLocalFile( + QString::fromStdString( ( *activationSoundFile ) ) ) ); + m_activationSoundEffect.setVolume( 0.7 ); } else { LOG( ERROR ) << "Could not find activation sound file " - << activationSoundFile; + << clickSoundURL; } + constexpr auto focusChangedSoundURL = "res/sounds/focus.wav"; + const auto focusChangedSoundFile + = paths::binaryDirectoryFindFile( focusChangedSoundURL ); - QString focusChangedSoundFile = m_runtimePathUrl.toLocalFile().append( - "/content/panorama/sounds/focus_change.wav" ); - QFileInfo focusChangedSoundFileInfo( focusChangedSoundFile ); - if ( focusChangedSoundFileInfo.exists() - && focusChangedSoundFileInfo.isFile() ) + if ( focusChangedSoundFile.has_value() ) { - m_focusChangedSoundEffect.setSource( - QUrl::fromLocalFile( focusChangedSoundFile ) ); - m_focusChangedSoundEffect.setVolume( 1.0 ); + m_focusChangedSoundEffect.setSource( QUrl::fromLocalFile( + QString::fromStdString( ( *focusChangedSoundFile ) ) ) ); + m_focusChangedSoundEffect.setVolume( 0.7 ); } else { - LOG( ERROR ) << "Could not find focus changed sound file " - << focusChangedSoundFile; + LOG( ERROR ) << "Could not find focus Changed sound file " + << focusChangedSoundURL; } constexpr auto alarmFileName = "res/sounds/alarm01.wav"; @@ -1144,13 +1144,13 @@ void OverlayController::mainEventLoop() rightSpeed = std::sqrt( vel[0] * vel[0] + vel[1] * vel[1] + vel[2] * vel[2] ); } + auto universe = vr::VRCompositor()->GetTrackingSpace(); - m_moveCenterTabController.eventLoopTick( - vr::VRCompositor()->GetTrackingSpace(), devicePoses ); + m_moveCenterTabController.eventLoopTick( universe, devicePoses ); m_utilitiesTabController.eventLoopTick(); m_statisticsTabController.eventLoopTick( devicePoses, leftSpeed, rightSpeed ); - m_chaperoneTabController.eventLoopTick( devicePoses ); + m_chaperoneTabController.eventLoopTick( universe, devicePoses ); m_audioTabController.eventLoopTick(); m_rotationTabController.eventLoopTick( devicePoses ); @@ -1160,6 +1160,7 @@ void OverlayController::mainEventLoop() m_steamVRTabController.dashboardLoopTick(); m_fixFloorTabController.dashboardLoopTick( devicePoses ); m_videoTabController.dashboardLoopTick(); + m_chaperoneTabController.dashboardLoopTick(); } if ( m_ulOverlayThumbnailHandle != vr::k_ulOverlayHandleInvalid ) diff --git a/src/res/img/chaperone/centermark.png b/src/res/img/chaperone/centermark.png new file mode 100644 index 0000000..44ddeab Binary files /dev/null and b/src/res/img/chaperone/centermark.png differ diff --git a/src/res/img/chaperone/centermarkl1.png b/src/res/img/chaperone/centermarkl1.png new file mode 100644 index 0000000..88d99f0 Binary files /dev/null and b/src/res/img/chaperone/centermarkl1.png differ diff --git a/src/res/img/chaperone/centermarkl2.png b/src/res/img/chaperone/centermarkl2.png new file mode 100644 index 0000000..0b6e4df Binary files /dev/null and b/src/res/img/chaperone/centermarkl2.png differ diff --git a/src/res/img/chaperone/centermarkl3.png b/src/res/img/chaperone/centermarkl3.png new file mode 100644 index 0000000..f554af6 Binary files /dev/null and b/src/res/img/chaperone/centermarkl3.png differ diff --git a/src/res/img/chaperone/centermarkr1.png b/src/res/img/chaperone/centermarkr1.png new file mode 100644 index 0000000..4ab9f37 Binary files /dev/null and b/src/res/img/chaperone/centermarkr1.png differ diff --git a/src/res/img/chaperone/centermarkr2.png b/src/res/img/chaperone/centermarkr2.png new file mode 100644 index 0000000..5a2849c Binary files /dev/null and b/src/res/img/chaperone/centermarkr2.png differ diff --git a/src/res/img/chaperone/centermarkr3.png b/src/res/img/chaperone/centermarkr3.png new file mode 100644 index 0000000..1d6865c Binary files /dev/null and b/src/res/img/chaperone/centermarkr3.png differ diff --git a/src/res/qml/chaperone_page/ChaperonePage.qml b/src/res/qml/chaperone_page/ChaperonePage.qml index 6f3c883..758b72e 100644 --- a/src/res/qml/chaperone_page/ChaperonePage.qml +++ b/src/res/qml/chaperone_page/ChaperonePage.qml @@ -443,7 +443,7 @@ MyStackViewPage { text: "Center Marker" Layout.fillWidth: false onCheckedChanged: { - ChaperoneTabController.setCenterMarker(this.checked, false) + ChaperoneTabController.setCenterMarkerNew(this.checked, false) } } @@ -485,16 +485,31 @@ MyStackViewPage { Item { Layout.fillWidth: true } } + RowLayout { + Layout.fillWidth: true + MyPushButton { + id: chaperoneWarningsConfigButton + text: "Proximity Warning Settings" + Layout.preferredWidth: 350 + onClicked: { + MyResources.playFocusChangedSound() + mainView.push(chaperoneWarningsPage) + } + } + Item {Layout.fillWidth: true} - MyPushButton { - id: chaperoneWarningsConfigButton - text: "Proximity Warning Settings" - Layout.preferredWidth: 350 - onClicked: { - MyResources.playFocusChangedSound() - mainView.push(chaperoneWarningsPage) + MyPushButton { + id: chaperoneAdditionalButton + text: "Additional Chaperone Settings" + Layout.preferredWidth: 400 + + onClicked: { + MyResources.playFocusChangedSound() + mainView.push(chaperoneAdditionalPage) + } } } + ChangeOrientationGroupBox { } @@ -540,7 +555,7 @@ MyStackViewPage { chaperoneHeightSlider.value = h } chaperoneHeightText.text = h - chaperoneCenterMarkerToggle.checked = ChaperoneTabController.centerMarker + chaperoneCenterMarkerToggle.checked = ChaperoneTabController.centerMarkerNew chaperonePlaySpaceToggle.checked = ChaperoneTabController.playSpaceMarker chaperoneForceBoundsToggle.checked = ChaperoneTabController.forceBounds chaperoneDisableChaperone.checked = ChaperoneTabController.disableChaperone @@ -581,8 +596,8 @@ MyStackViewPage { chaperoneHeightText.text = h } - onCenterMarkerChanged: { - chaperoneCenterMarkerToggle.checked = ChaperoneTabController.centerMarker + onCenterMarkerNewChanged: { + chaperoneCenterMarkerToggle.checked = ChaperoneTabController.centerMarkerNew } onPlaySpaceMarkerChanged: { chaperonePlaySpaceToggle.checked = ChaperoneTabController.playSpaceMarker diff --git a/src/res/qml/chaperone_page/change_orientation/ChangeOrientationGroupBox.qml b/src/res/qml/chaperone_page/change_orientation/ChangeOrientationGroupBox.qml index 07622de..a03d4b3 100644 --- a/src/res/qml/chaperone_page/change_orientation/ChangeOrientationGroupBox.qml +++ b/src/res/qml/chaperone_page/change_orientation/ChangeOrientationGroupBox.qml @@ -42,7 +42,7 @@ GroupBox { val = -180; } spaceRotationSlider.value = val - spaceRotationText.text = val + spaceRotationText.text = val.toFixed(2) + "°" } } @@ -55,7 +55,7 @@ GroupBox { Layout.fillWidth: true onValueChanged: { var val = this.value - spaceRotationText.text = val + spaceRotationText.text = val.toFixed(2) + "°" } } @@ -69,7 +69,7 @@ GroupBox { val = 180; } spaceRotationSlider.value = val - spaceRotationText.text = val + spaceRotationText.text = val.toFixed(2) + "°" } } @@ -83,7 +83,7 @@ GroupBox { function onInputEvent(input) { var val = parseFloat(input) if (!isNaN(val)) { - spaceRotationText.text = val + "°" + spaceRotationText.text = val.toFixed(2) + "°" spaceRotationSlider.value = val } } diff --git a/src/res/qml/chaperone_page/chaperone_additional/ChaperoneAdditionalPage.qml b/src/res/qml/chaperone_page/chaperone_additional/ChaperoneAdditionalPage.qml new file mode 100644 index 0000000..ce66c44 --- /dev/null +++ b/src/res/qml/chaperone_page/chaperone_additional/ChaperoneAdditionalPage.qml @@ -0,0 +1,39 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.3 +import QtQuick.Dialogs 1.2 +import ovras.advsettings 1.0 +import "." // QTBUG-34418, singletons require explicit import to load qmldir file +import "../../common" +import "chaperoneboundscolor" +import "chaperonetype" +import "chaperonemisc" + +MyStackViewPage { + headerText: "Additional Chaperone Settings" + content: ColumnLayout { + spacing: 10 + + ChaperoneBoundsColorGroupBox{ + id: chaperoneBoundsColorGroupBox + } + ChaperoneTypeGroupBox{ + id:chaperoneTypeGroupBox + } + ChaperoneMiscGroupBox{ + id:chaperoneMiscGroupBox + } + + Item { + Layout.fillHeight: true + } + + } + + +} + + + + //TODO content + diff --git a/src/res/qml/chaperone_page/chaperone_additional/chaperoneboundscolor/ChaperoneBoundsColorGroupBox.qml b/src/res/qml/chaperone_page/chaperone_additional/chaperoneboundscolor/ChaperoneBoundsColorGroupBox.qml new file mode 100644 index 0000000..1f759fb --- /dev/null +++ b/src/res/qml/chaperone_page/chaperone_additional/chaperoneboundscolor/ChaperoneBoundsColorGroupBox.qml @@ -0,0 +1,199 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.3 +import ovras.advsettings 1.0 +import "../../../common" +import "." // QTBUG-34418, singletons require explicit import to load qmldir file + +GroupBox { + id: chaperoneBoundsColorGroupBox + Layout.fillWidth: true + + label: MyText { + leftPadding: 10 + text: "Chaperone Color" + bottomPadding: -10 + } + background: Rectangle { + color: "transparent" + border.color: "#ffffff" + radius: 8 + } + + ColumnLayout { + anchors.fill: parent + + Rectangle { + color: "#ffffff" + height: 1 + Layout.fillWidth: true + Layout.bottomMargin: 5 + } + + RowLayout{ + + MyText { + text: "Red:" + horizontalAlignment: Text.AlignRight + Layout.preferredWidth: 75 + } + + MySlider { + id: chaperoneColorRedSlider + from: 0 + to: 255 + stepSize: 5 + value: 0 + Layout.fillWidth: true + onPositionChanged: { + var val = (this.value).toFixed(0) + colorRedText.text = val + ChaperoneTabController.setChaperoneColorR(val, true) + } + } + + MyTextField { + id: colorRedText + text: "0" + keyBoardUID: 320 + Layout.preferredWidth: 100 + Layout.leftMargin: 10 + horizontalAlignment: Text.AlignHCenter + function onInputEvent(input) { + var val = parseInt(input) + if (!isNaN(val)) { + if (val < 0) { + val = 0 + } else if (val > 255) { + val = 255 + } + ChaperoneTabController.setChaperoneColorR(val, true) + chaperoneColorRedSlider.value = val + } + text = val + } + } + + Item{ + Layout.preferredWidth: 200 + } + MyText { + text: "Green:" + horizontalAlignment: Text.AlignRight + Layout.preferredWidth: 75 + } + + MySlider { + id: chaperoneColorGreenSlider + from: 0 + to: 255 + stepSize: 5 + value: 255 + Layout.fillWidth: true + onPositionChanged: { + var val = (this.value).toFixed(0) + colorGreenText.text = val + ChaperoneTabController.setChaperoneColorG(val, true) + } + } + + MyTextField { + id: colorGreenText + text: "255" + keyBoardUID: 321 + Layout.preferredWidth: 100 + Layout.leftMargin: 10 + horizontalAlignment: Text.AlignHCenter + function onInputEvent(input) { + var val = parseInt(input) + if (!isNaN(val)) { + if (val < 0) { + val = 0 + } else if (val > 255) { + val = 255 + } + ChaperoneTabController.setChaperoneColorG(val, true) + chaperoneColorGreenSlider.value = val + } + text = val + } + } + + } + RowLayout{ + MyText { + text: "Blue:" + horizontalAlignment: Text.AlignRight + Layout.preferredWidth: 75 + } + + MySlider { + id: chaperoneColorBlueSlider + from: 0 + to: 255 + stepSize: 5 + value: 255 + Layout.preferredWidth: 250 + onPositionChanged: { + var val = (this.value).toFixed(0) + colorBlueText.text = val + ChaperoneTabController.setChaperoneColorB(val, true) + } + } + + MyTextField { + id: colorBlueText + text: "255" + keyBoardUID: 322 + Layout.preferredWidth: 100 + Layout.leftMargin: 10 + horizontalAlignment: Text.AlignHCenter + function onInputEvent(input) { + var val = parseInt(input) + if (!isNaN(val)) { + if (val < 0) { + val = 0 + } else if (val > 255) { + val = 255 + } + ChaperoneTabController.setChaperoneColorB(val, true) + chaperoneColorBlueSlider.value = val + } + text = val + } + } + } + } + Component.onCompleted: { + // set up var here to prevent double call to c++ from qml + var redValue = ChaperoneTabController.chaperoneColorR + var greenValue = ChaperoneTabController.chaperoneColorG + var blueValue = ChaperoneTabController.chaperoneColorB + colorRedText.text = redValue + colorGreenText.text = greenValue + colorBlueText.text = blueValue + chaperoneColorRedSlider.value = redValue + chaperoneColorGreenSlider.value = greenValue + chaperoneColorBlueSlider.value = blueValue + + } + + Connections { + target: ChaperoneTabController + onChaperoneColorRChanged:{ + var redValue = ChaperoneTabController.chaperoneColorR + colorRedText.text = redValue + chaperoneColorRedSlider.value = redValue + } + onChaperoneColorGChanged:{ + var greenValue = ChaperoneTabController.chaperoneColorG + colorGreenText.text = greenValue + chaperoneColorGreenSlider.value = greenValue + } + onChaperoneColorBChanged:{ + var blueValue = ChaperoneTabController.chaperoneColorB + colorBlueText.text = blueValue + chaperoneColorBlueSlider.value = blueValue + } + } +} diff --git a/src/res/qml/chaperone_page/chaperone_additional/chaperonemisc/ChaperoneMiscGroupBox.qml b/src/res/qml/chaperone_page/chaperone_additional/chaperonemisc/ChaperoneMiscGroupBox.qml new file mode 100644 index 0000000..daa533e --- /dev/null +++ b/src/res/qml/chaperone_page/chaperone_additional/chaperonemisc/ChaperoneMiscGroupBox.qml @@ -0,0 +1,80 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.3 +import ovras.advsettings 1.0 +import "../../../common" +import "." // QTBUG-34418, singletons require explicit import to load qmldir file +GroupBox { + id: chaperoneMiscGroupBox + Layout.fillWidth: true + + label: MyText { + leftPadding: 10 + text: "Misc:" + bottomPadding: -10 + } + background: Rectangle { + color: "transparent" + border.color: "#ffffff" + radius: 8 + } + + ColumnLayout { + anchors.fill: parent + + Rectangle { + color: "#ffffff" + height: 1 + Layout.fillWidth: true + Layout.bottomMargin: 5 + } + + RowLayout { + spacing: 16 + + MyToggleButton { + id: chaperoneFloorToggleBtn + text: "Floor Bounds Always On" + Layout.preferredWidth: 375 + onCheckedChanged: { + ChaperoneTabController.setChaperoneFloorToggle(this.checked, false) + } + } + + + MyToggleButton { + id: legacyCenterMarkerbtn + text: "Legacy Center Marker" + Layout.preferredWidth: 375 + onCheckedChanged: { + ChaperoneTabController.setCenterMarker(this.checked, false) + } + } + + MyPushButton{ + id:btnResetOrientation + text: "Reset Turn Counter" + onClicked: { + StatisticsTabController.statsRotationResetClicked() + } + } + + } + + } + + Component.onCompleted: { + chaperoneFloorToggleBtn.checked = ChaperoneTabController.chaperoneFloorToggle + legacyCenterMarkerbtn.checked = ChaperoneTabController.centerMarker + } + + Connections { + target: ChaperoneTabController + onChaperoneFloorToggleChanged:{ + chaperoneFloorToggleBtn.checked = ChaperoneTabController.chaperoneFloorToggle + } + onCenterMarkerChanged:{ + legacyCenterMarkerbtn.checked = ChaperoneTabController.centermarker + } + } +} diff --git a/src/res/qml/chaperone_page/chaperone_additional/chaperonetype/ChaperoneTypeGroupBox.qml b/src/res/qml/chaperone_page/chaperone_additional/chaperonetype/ChaperoneTypeGroupBox.qml new file mode 100644 index 0000000..da6e780 --- /dev/null +++ b/src/res/qml/chaperone_page/chaperone_additional/chaperonetype/ChaperoneTypeGroupBox.qml @@ -0,0 +1,127 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.3 +import ovras.advsettings 1.0 +import "../../../common" +import "." // QTBUG-34418, singletons require explicit import to load qmldir file + +GroupBox { + id: chaperoneTypeGroupBox + Layout.fillWidth: true + + label: MyText { + leftPadding: 10 + text: "Chaperone Style" + bottomPadding: -10 + } + background: Rectangle { + color: "transparent" + border.color: "#ffffff" + radius: 8 + } + + ColumnLayout { + anchors.fill: parent + + Rectangle { + color: "#ffffff" + height: 1 + Layout.fillWidth: true + Layout.bottomMargin: 5 + } + + RowLayout{ + ButtonGroup { id: chaperoneTypeExclGroup + exclusive: true} + MyRadioButton { + id: denseRadio + text: qsTr("Dense") + ButtonGroup.group: chaperoneTypeExclGroup + Layout.preferredWidth: 200 + onCheckedChanged: { + if(checked){ + MyResources.playActivationSound() + ChaperoneTabController.setCollisionBoundStyle(0) + } + } + } + MyRadioButton { + id: medRadio + text: qsTr("Med") + ButtonGroup.group: chaperoneTypeExclGroup + Layout.preferredWidth: 200 + onCheckedChanged: { + if(checked){ + MyResources.playActivationSound() + ChaperoneTabController.setCollisionBoundStyle(1) + } + } + } + MyRadioButton { + id: squaresRadio + text: qsTr("Squares") + ButtonGroup.group: chaperoneTypeExclGroup + Layout.preferredWidth: 200 + onCheckedChanged: { + if(checked){ + MyResources.playActivationSound() + ChaperoneTabController.setCollisionBoundStyle(2) + } + } + } + MyRadioButton { + id: sparseRadio + text: qsTr("Sparse") + ButtonGroup.group: chaperoneTypeExclGroup + Layout.preferredWidth: 200 + onCheckedChanged: { + if(checked){ + MyResources.playActivationSound() + ChaperoneTabController.setCollisionBoundStyle(3) + } + } + } + MyRadioButton { + id: floorRadio + text: qsTr("Floor Only") + ButtonGroup.group: chaperoneTypeExclGroup + Layout.preferredWidth: 200 + onCheckedChanged: { + if(checked){ + MyResources.playActivationSound() + ChaperoneTabController.setCollisionBoundStyle(4) + } + } + } + } + + + } + Component.onCompleted: { + // set up var here to prevent double call to c++ from qml + var collisiontype = ChaperoneTabController.collisionBoundStyle + switch(collisiontype){ + case 0: denseRadio.checked = true; break; + case 1: medRadio.checked = true; break; + case 2: squaresRadio.checked = true; break; + case 3: sparseRadio.checked = true; break + case 4: floorRadio.checked = true; break; + } + + } + + Connections { + target: ChaperoneTabController + onCollisionBoundStyleChanged:{ + var collisiontype = ChaperoneTabController.collisionBoundStyle + switch(collisiontype){ + case 0: denseRadio.checked = true; break; + case 1: medRadio.checked = true; break; + case 2: squaresRadio.checked = true; break; + case 3: sparseRadio.checked = true; break + case 4: floorRadio.checked = true; break; + } + } + + } +} diff --git a/src/res/qml/common/MyRadioButton.qml b/src/res/qml/common/MyRadioButton.qml new file mode 100644 index 0000000..8ffa650 --- /dev/null +++ b/src/res/qml/common/MyRadioButton.qml @@ -0,0 +1,24 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.0 +import "." // QTBUG-34418, singletons require explicit import to load qmldir file + +RadioButton { + hoverEnabled: true + contentItem: MyText { + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: parent.text + color: parent.enabled ? "#ffffff" : "#909090" + } + onHoveredChanged: { + if (hovered) { + forceActiveFocus() + } else { + focus = false + } + } + + onClicked: { + MyResources.playActivationSound() + } +} diff --git a/src/res/qml/common/MySlider.qml b/src/res/qml/common/MySlider.qml index 84ce328..797de79 100644 --- a/src/res/qml/common/MySlider.qml +++ b/src/res/qml/common/MySlider.qml @@ -48,7 +48,7 @@ Slider { onValueChanged: { if (activeFocus) { - MyResources.playActivationSound() + //MyResources.playActivationSound() } } } diff --git a/src/res/qml/common/mainwidget.qml b/src/res/qml/common/mainwidget.qml index a0d0520..bbb6a79 100644 --- a/src/res/qml/common/mainwidget.qml +++ b/src/res/qml/common/mainwidget.qml @@ -9,6 +9,7 @@ import "../video_page" import "../chaperone_page" import "../steamvr_page" import "../rotation_page" +import "../chaperone_page/chaperone_additional" Rectangle { id: root @@ -35,6 +36,11 @@ Rectangle { visible: false } + property ChaperoneAdditionalPage chaperoneAdditionalPage: ChaperoneAdditionalPage{ + stackView: mainView + visible: false + } + property PlayspacePage playspacePage: PlayspacePage { stackView: mainView visible: false diff --git a/src/res/qml/video_page/brightness/BrightnessGroupBox.qml b/src/res/qml/video_page/brightness/BrightnessGroupBox.qml index 9371cfa..7729f7f 100644 --- a/src/res/qml/video_page/brightness/BrightnessGroupBox.qml +++ b/src/res/qml/video_page/brightness/BrightnessGroupBox.qml @@ -59,9 +59,6 @@ GroupBox { onPositionChanged: { var val = (this.value * 100) brightnessValueText.text = Math.round(val) + "%" - } - onValueChanged: { - VideoTabController.setBrightnessOpacityValue(value.toFixed(2), true) } } @@ -76,12 +73,13 @@ GroupBox { function onInputEvent(input) { var val = parseFloat(input) if (!isNaN(val)) { - if (val < 10) { - val = 10 + if (val < 3.0) { + val = 3.0 } else if (val > 100.0) { val = 100.0 } - var v = (val/100).toFixed(2) + var v = (val/100) + VideoTabController.setBrightnessOpacityValue(v.toFixed(2), true) brightnessSlider.value = v } text = Math.round(VideoTabController.brightnessOpacityValue * 100) + "%" @@ -91,7 +89,9 @@ GroupBox { } Component.onCompleted: { - brightnessSlider.value = VideoTabController.brightnessOpacityValue + var brightvalue = VideoTabController.brightnessOpacityValue + brightnessSlider.value = brightvalue + brightnessValueText.text = Math.round(brightvalue*100)+ "%" brightnessToggle.checked = VideoTabController.brightnessEnabled } @@ -99,7 +99,9 @@ GroupBox { target: VideoTabController onBrightnessOpacityValueChanged: { - brightnessSlider.value = VideoTabController.brightnessOpacityValue + var brightvalue = VideoTabController.brightnessOpacityValue + brightnessSlider.value = brightvalue + brightnessValueText.text = Math.round(brightvalue*100)+ "%" } onBrightnessEnabledChanged: { brightnessToggle.checked = VideoTabController.brightnessEnabled diff --git a/src/res/sounds/alarm01.wav b/src/res/sounds/alarm01.wav index d96fb23..c31214c 100644 Binary files a/src/res/sounds/alarm01.wav and b/src/res/sounds/alarm01.wav differ diff --git a/src/res/sounds/click.wav b/src/res/sounds/click.wav new file mode 100644 index 0000000..21795e9 Binary files /dev/null and b/src/res/sounds/click.wav differ diff --git a/src/res/sounds/focus.wav b/src/res/sounds/focus.wav new file mode 100644 index 0000000..d56c06c Binary files /dev/null and b/src/res/sounds/focus.wav differ diff --git a/src/settings/internal/settings_controller.h b/src/settings/internal/settings_controller.h index add6b42..2a0a11c 100644 --- a/src/settings/internal/settings_controller.h +++ b/src/settings/internal/settings_controller.h @@ -370,6 +370,11 @@ private: SettingCategory::Chaperone, QtInfo{ "disableChaperone" }, false }, + BoolSettingValue{ BoolSetting::CHAPERONE_centerMarkerNew, + SettingCategory::Chaperone, + QtInfo{ "centerMarkerNew" }, + false }, + BoolSettingValue{ BoolSetting::ROTATION_autoturnEnabled, SettingCategory::Rotation, QtInfo{ "autoturnEnabled" }, diff --git a/src/settings/settings.h b/src/settings/settings.h index 11dba11..a018c83 100644 --- a/src/settings/settings.h +++ b/src/settings/settings.h @@ -49,6 +49,7 @@ enum class BoolSetting CHAPERONE_chaperoneAlarmSoundAdjustVolume, CHAPERONE_chaperoneShowDashboardEnabled, CHAPERONE_disableChaperone, + CHAPERONE_centerMarkerNew, ROTATION_autoturnEnabled, ROTATION_autoturnUseCornerAngle, diff --git a/src/tabcontrollers/ChaperoneTabController.cpp b/src/tabcontrollers/ChaperoneTabController.cpp index 9274735..fc30c79 100644 --- a/src/tabcontrollers/ChaperoneTabController.cpp +++ b/src/tabcontrollers/ChaperoneTabController.cpp @@ -11,6 +11,7 @@ namespace advsettings { void ChaperoneTabController::initStage1() { + m_trackingUniverse = vr::VRCompositor()->GetTrackingSpace(); if ( disableChaperone() ) { setFadeDistance( 0.0f, true ); @@ -19,12 +20,30 @@ void ChaperoneTabController::initStage1() reloadChaperoneProfiles(); m_chaperoneSettingsUpdateCounter = utils::adjustUpdateRate( k_chaperoneSettingsUpdateCounter ); - eventLoopTick( nullptr ); + initFloorOverlay(); + eventLoopTick( m_trackingUniverse, nullptr ); } void ChaperoneTabController::initStage2( OverlayController* var_parent ) { this->parent = var_parent; + // Cludge Fix for now, but its not getting called for some reason w/ QML + setCenterMarkerNew( centerMarkerNew() ); + updateChaperoneSettings(); // force one update of OVR saved settings to make + // sure our m_ variables are correct +} + +void ChaperoneTabController::dashboardLoopTick() +{ + if ( settingsUpdateCounter >= m_chaperoneSettingsUpdateCounter ) + { + updateChaperoneSettings(); + settingsUpdateCounter = 0; + } + else + { + settingsUpdateCounter++; + } } ChaperoneTabController::~ChaperoneTabController() @@ -70,61 +89,22 @@ void ChaperoneTabController::handleChaperoneWarnings( float distance ) if ( distance <= activationDistance && m_isHMDActive && !m_chaperoneSwitchToBeginnerActive ) { - vr::EVRSettingsError vrSettingsError; - m_chaperoneSwitchToBeginnerLastStyle = vr::VRSettings()->GetInt32( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_Style_Int32, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) - << "Could not read \"" - << vr::k_pch_CollisionBounds_Style_Int32 << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - vr::VRSettings()->SetInt32( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_Style_Int32, - vr::COLLISION_BOUNDS_STYLE_BEGINNER, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) - << "Could not set \"" - << vr::k_pch_CollisionBounds_Style_Int32 - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_chaperoneSwitchToBeginnerActive = true; - } - } + // Instead of backing out at every stage, this will log errors, but + // proceed forward. + m_chaperoneSwitchToBeginnerLastStyle = collisionBoundStyle(); + // IMPORTANT DO NOT NOTIFY IF WE SWITCH BECAUSE WARNINGS + setCollisionBoundStyle( + static_cast( vr::COLLISION_BOUNDS_STYLE_BEGINNER ), + false, + true ); + m_chaperoneSwitchToBeginnerActive = true; } else if ( ( distance > activationDistance || !m_isHMDActive ) && m_chaperoneSwitchToBeginnerActive ) { - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetInt32( vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_Style_Int32, - m_chaperoneSwitchToBeginnerLastStyle, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) - << "Could not set \"" - << vr::k_pch_CollisionBounds_Style_Int32 << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_chaperoneSwitchToBeginnerActive = false; - } + setCollisionBoundStyle( m_chaperoneSwitchToBeginnerLastStyle, + true ); + m_chaperoneSwitchToBeginnerActive = false; } } @@ -253,8 +233,17 @@ void ChaperoneTabController::handleChaperoneWarnings( float distance ) } void ChaperoneTabController::eventLoopTick( + vr::ETrackingUniverseOrigin universe, vr::TrackedDevicePose_t* devicePoses ) { + m_trackingUniverse = universe; + // Update overlay should only run After move center tab controller is + // initialized. + // As such this protects it from running during initstage 1. + if ( centerMarkerNew() && devicePoses != nullptr ) + { + updateOverlay(); + } if ( devicePoses ) { m_isHMDActive = false; @@ -335,6 +324,8 @@ void ChaperoneTabController::eventLoopTick( else { // attempts to reload chaperone data once per ~5 seconds. + // TODO still need to figure out a proper way to handle this + // failure. m_updateTicksChaperoneReload++; if ( m_updateTicksChaperoneReload >= 500 ) { @@ -344,72 +335,18 @@ void ChaperoneTabController::eventLoopTick( } } } - - if ( settingsUpdateCounter >= m_chaperoneSettingsUpdateCounter ) - { - if ( parent->isDashboardVisible() ) - { - updateChaperoneSettings(); - } - settingsUpdateCounter = 0; - } - else - { - settingsUpdateCounter++; - } } void ChaperoneTabController::updateChaperoneSettings() { - vr::EVRSettingsError vrSettingsError; - float vis = static_cast( - vr::VRSettings()->GetInt32( vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_ColorGammaA_Int32, - &vrSettingsError ) ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"" - << vr::k_pch_CollisionBounds_ColorGammaA_Int32 - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - setBoundsVisibility( vis / 255.0f ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"" - << vr::k_pch_CollisionBounds_FadeDistance_Float - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - auto cm = vr::VRSettings()->GetBool( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_CenterMarkerOn_Bool, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"" - << vr::k_pch_CollisionBounds_CenterMarkerOn_Bool - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - setCenterMarker( cm ); - auto ps - = vr::VRSettings()->GetBool( vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_PlaySpaceOn_Bool, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"" - << vr::k_pch_CollisionBounds_PlaySpaceOn_Bool - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - setPlaySpaceMarker( ps ); + setBoundsVisibility( static_cast( chaperoneColorA() ) / 255.0f ); + setFadeDistance( fadeDistance(), true ); + setCenterMarker( centerMarker() ); + setPlaySpaceMarker( playSpaceMarker() ); + setChaperoneColorR( chaperoneColorR() ); + setChaperoneColorG( chaperoneColorG() ); + setChaperoneColorB( chaperoneColorB() ); + setCollisionBoundStyle( collisionBoundStyle() ); } float ChaperoneTabController::boundsVisibility() const @@ -429,10 +366,9 @@ void ChaperoneTabController::setBoundsVisibility( float value, bool notify ) { m_visibility = value; } - vr::VRSettings()->SetInt32( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_ColorGammaA_Int32, - static_cast( 255 * m_visibility ) ); + setChaperoneColorA( static_cast( 255 * m_visibility ), notify ); + ovr_overlay_wrapper::setOverlayAlpha( + m_chaperoneFloorOverlayHandle, m_visibility, "" ); if ( notify ) { @@ -441,8 +377,18 @@ void ChaperoneTabController::setBoundsVisibility( float value, bool notify ) } } -float ChaperoneTabController::fadeDistance() const +float ChaperoneTabController::fadeDistance() { + std::pair p + = ovr_settings_wrapper::getFloat( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_FadeDistance_Float, + "" ); + if ( p.first == ovr_settings_wrapper::SettingsError::NoError ) + { + m_fadeDistance = p.second; + return p.second; + } return m_fadeDistance; } @@ -451,10 +397,12 @@ void ChaperoneTabController::setFadeDistance( float value, bool notify ) if ( fabs( static_cast( m_fadeDistance - value ) ) > 0.005 ) { m_fadeDistance = value; - vr::VRSettings()->SetFloat( + ovr_settings_wrapper::setFloat( vr::k_pch_CollisionBounds_Section, vr::k_pch_CollisionBounds_FadeDistance_Float, - m_fadeDistance ); + m_fadeDistance, + "" ); + // On failure do Nothing if ( notify ) { emit fadeDistanceChanged( m_fadeDistance ); @@ -462,8 +410,19 @@ void ChaperoneTabController::setFadeDistance( float value, bool notify ) } } -float ChaperoneTabController::height() const +float ChaperoneTabController::height() { + std::pair p + = ovr_settings_wrapper::getFloat( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_WallHeight_Float, + "" ); + if ( p.first == ovr_settings_wrapper::SettingsError::NoError ) + { + m_height = p.second; + return p.second; + } + return m_height; } @@ -472,6 +431,11 @@ void ChaperoneTabController::setHeight( float value, bool notify ) if ( fabs( static_cast( m_height - value ) ) > 0.005 ) { m_height = value; + ovr_settings_wrapper::setFloat( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_WallHeight_Float, + m_height, + "" ); parent->m_moveCenterTabController.setBoundsBasisHeight( m_height ); if ( notify ) { @@ -492,8 +456,19 @@ void ChaperoneTabController::updateHeight( float value, bool notify ) } } -bool ChaperoneTabController::centerMarker() const +bool ChaperoneTabController::centerMarker() { + std::pair p + = ovr_settings_wrapper::getBool( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_CenterMarkerOn_Bool, + "" ); + if ( p.first == ovr_settings_wrapper::SettingsError::NoError ) + { + m_centerMarker = p.second; + return p.second; + } + return m_centerMarker; } @@ -502,10 +477,12 @@ void ChaperoneTabController::setCenterMarker( bool value, bool notify ) if ( m_centerMarker != value ) { m_centerMarker = value; - vr::VRSettings()->SetBool( + ovr_settings_wrapper::setBool( vr::k_pch_CollisionBounds_Section, vr::k_pch_CollisionBounds_CenterMarkerOn_Bool, - m_centerMarker ); + m_centerMarker, + "" ); + if ( notify ) { emit centerMarkerChanged( m_centerMarker ); @@ -513,8 +490,19 @@ void ChaperoneTabController::setCenterMarker( bool value, bool notify ) } } -bool ChaperoneTabController::playSpaceMarker() const +bool ChaperoneTabController::playSpaceMarker() { + std::pair p + = ovr_settings_wrapper::getBool( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_PlaySpaceOn_Bool, + "" ); + if ( p.first == ovr_settings_wrapper::SettingsError::NoError ) + { + m_playSpaceMarker = p.second; + return p.second; + } + return m_playSpaceMarker; } @@ -523,9 +511,12 @@ void ChaperoneTabController::setPlaySpaceMarker( bool value, bool notify ) if ( m_playSpaceMarker != value ) { m_playSpaceMarker = value; - vr::VRSettings()->SetBool( vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_PlaySpaceOn_Bool, - m_playSpaceMarker ); + ovr_settings_wrapper::setBool( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_PlaySpaceOn_Bool, + m_playSpaceMarker, + "" ); + // On Error Do Nothing if ( notify ) { emit playSpaceMarkerChanged( m_playSpaceMarker ); @@ -535,6 +526,7 @@ void ChaperoneTabController::setPlaySpaceMarker( bool value, bool notify ) bool ChaperoneTabController::forceBounds() const { + // todo ivrchaperonewrapper return m_forceBounds; } @@ -604,6 +596,98 @@ float ChaperoneTabController::chaperoneShowDashboardDistance() const settings::DoubleSetting::CHAPERONE_showDashboardDistance ) ); } +int ChaperoneTabController::chaperoneColorR() +{ + std::pair p + = ovr_settings_wrapper::getInt32( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_ColorGammaR_Int32, + "" ); + if ( p.first != ovr_settings_wrapper::SettingsError::NoError ) + { + return m_chaperoneColorR; + } + m_chaperoneColorR = p.second; + return m_chaperoneColorR; +} +int ChaperoneTabController::chaperoneColorG() +{ + std::pair p + = ovr_settings_wrapper::getInt32( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_ColorGammaG_Int32, + "" ); + if ( p.first != ovr_settings_wrapper::SettingsError::NoError ) + { + return m_chaperoneColorG; + } + m_chaperoneColorG = p.second; + return m_chaperoneColorG; +} +int ChaperoneTabController::chaperoneColorB() +{ + std::pair p + = ovr_settings_wrapper::getInt32( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_ColorGammaB_Int32, + "" ); + if ( p.first != ovr_settings_wrapper::SettingsError::NoError ) + { + return m_chaperoneColorB; + } + m_chaperoneColorB = p.second; + return m_chaperoneColorB; +} +// aka transparancy +int ChaperoneTabController::chaperoneColorA() const +{ + std::pair p + = ovr_settings_wrapper::getInt32( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_ColorGammaA_Int32, + "" ); + if ( p.first != ovr_settings_wrapper::SettingsError::NoError ) + { + return 255; + } + return p.second; +} + +bool ChaperoneTabController::chaperoneFloorToggle() +{ + std::pair p + = ovr_settings_wrapper::getBool( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_GroundPerimeterOn_Bool, + "" ); + if ( p.first != ovr_settings_wrapper::SettingsError::NoError ) + { + return false; + } + return p.second; +} + +int ChaperoneTabController::collisionBoundStyle() +{ + std::pair p + = ovr_settings_wrapper::getInt32( vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_Style_Int32, + "" ); + if ( p.first != ovr_settings_wrapper::SettingsError::NoError ) + { + return m_collisionBoundStyle; + } + m_collisionBoundStyle = p.second; + return m_collisionBoundStyle; +} + +bool ChaperoneTabController::centerMarkerNew() +{ + bool temp = settings::getSetting( + settings::BoolSetting::CHAPERONE_centerMarkerNew ); + return temp; +} + Q_INVOKABLE unsigned ChaperoneTabController::getChaperoneProfileCount() { return static_cast( chaperoneProfiles.size() ); @@ -635,6 +719,198 @@ void ChaperoneTabController::setForceBounds( bool value, bool notify ) } } +void ChaperoneTabController::setChaperoneColorR( int value, bool notify ) +{ + if ( value != m_chaperoneColorR ) + { + if ( value > 255 ) + { + value = 255; + LOG( WARNING ) << "Red Channel larger than 255, setting to 255"; + } + else if ( value < 0 ) + { + value = 0; + LOG( WARNING ) << "Red Channel smaller than 0, setting to 0"; + } + m_chaperoneColorR = value; + ovr_settings_wrapper::setInt32( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_ColorGammaR_Int32, + m_chaperoneColorR, + "" ); + updateOverlayColor(); + if ( notify ) + { + emit chaperoneColorRChanged( value ); + } + } +} + +void ChaperoneTabController::setChaperoneColorG( int value, bool notify ) +{ + if ( value != m_chaperoneColorG ) + { + if ( value > 255 ) + { + value = 255; + LOG( WARNING ) << "Green Channel larger than 255, setting to 255"; + } + else if ( value < 0 ) + { + value = 0; + LOG( WARNING ) << "Green Channel smaller than 0, setting to 0"; + } + m_chaperoneColorG = value; + ovr_settings_wrapper::setInt32( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_ColorGammaG_Int32, + m_chaperoneColorG, + "" ); + updateOverlayColor(); + if ( notify ) + { + emit chaperoneColorGChanged( value ); + } + } +} + +void ChaperoneTabController::setChaperoneColorB( int value, bool notify ) +{ + if ( value != m_chaperoneColorB ) + { + if ( value > 255 ) + { + value = 255; + LOG( WARNING ) << "Blue Channel larger than 255, setting to 255"; + } + else if ( value < 0 ) + { + value = 0; + LOG( WARNING ) << "Blue Channel smaller than 0, setting to 0"; + } + m_chaperoneColorB = value; + ovr_settings_wrapper::setInt32( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_ColorGammaB_Int32, + m_chaperoneColorB, + "" ); + updateOverlayColor(); + if ( notify ) + { + emit chaperoneColorBChanged( value ); + } + } +} +void ChaperoneTabController::updateOverlayColor() +{ + float chapColorR = static_cast( m_chaperoneColorR ) / 255.0f; + float chapColorG = static_cast( m_chaperoneColorG ) / 255.0f; + float chapColorB = static_cast( m_chaperoneColorB ) / 255.0f; + ovr_overlay_wrapper::setOverlayColor( + m_chaperoneFloorOverlayHandle, chapColorR, chapColorG, chapColorB, "" ); +} + +void ChaperoneTabController::setChaperoneColorA( int value, bool notify ) +{ + if ( value > 255 ) + { + value = 255; + LOG( WARNING ) << "Alpha Channel larger than 255, setting to 255"; + } + else if ( value < 0 ) + { + value = 0; + LOG( WARNING ) << "Alpha Channel smaller than 0, setting to 0"; + } + ovr_settings_wrapper::setInt32( vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_ColorGammaA_Int32, + value, + "" ); + if ( notify ) + { + emit chaperoneColorAChanged( value ); + } +} + +void ChaperoneTabController::setCenterMarkerNew( bool value, bool notify ) +{ + settings::setSetting( settings::BoolSetting::CHAPERONE_centerMarkerNew, + value ); + if ( value ) + { + ovr_overlay_wrapper::showOverlay( m_chaperoneFloorOverlayHandle ); + } + else + { + ovr_overlay_wrapper::hideOverlay( m_chaperoneFloorOverlayHandle ); + } + + if ( notify ) + { + emit centerMarkerNewChanged( value ); + } +} + +void ChaperoneTabController::setChaperoneFloorToggle( bool value, bool notify ) +{ + if ( value != m_chaperoneFloorToggle ) + { + m_chaperoneFloorToggle = value; + ovr_settings_wrapper::setInt32( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_GroundPerimeterOn_Bool, + m_chaperoneFloorToggle, + "" ); + if ( notify ) + { + emit chaperoneFloorToggleChanged( value ); + } + } +} + +void ChaperoneTabController::setCollisionBoundStyle( int value, + bool notify, + bool isTemp ) +{ + if ( value != m_collisionBoundStyle ) + { + if ( vr::COLLISION_BOUNDS_STYLE_COUNT < value ) + { + value = 0; + LOG( WARNING ) + << "Invalid Collision Bound Value (>count), set to beginner"; + } + else if ( value < 0 ) + { + value = 0; + LOG( WARNING ) + << "Invalid Collision Bound Value (<0), set to beginner"; + } + if ( !isTemp ) + { + if ( m_chaperoneSwitchToBeginnerActive ) + { + m_chaperoneSwitchToBeginnerLastStyle + = static_cast( value ); + } + else + { + m_collisionBoundStyle = value; + } + } + + ovr_settings_wrapper::setInt32( vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_Style_Int32, + m_collisionBoundStyle, + "" ); + if ( notify ) + { + emit collisionBoundStyleChanged( value ); + } + } +} + void ChaperoneTabController::setChaperoneSwitchToBeginnerEnabled( bool value, bool notify ) { @@ -642,19 +918,11 @@ void ChaperoneTabController::setChaperoneSwitchToBeginnerEnabled( bool value, { if ( !value && m_chaperoneSwitchToBeginnerActive ) { - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetInt32( vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_Style_Int32, - m_chaperoneSwitchToBeginnerLastStyle, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) - << "Could not set \"" - << vr::k_pch_CollisionBounds_Style_Int32 << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } + ovr_settings_wrapper::setInt32( + vr::k_pch_CollisionBounds_Section, + vr::k_pch_CollisionBounds_Style_Int32, + m_chaperoneSwitchToBeginnerLastStyle, + "" ); } m_chaperoneSwitchToBeginnerActive = false; @@ -853,7 +1121,7 @@ void ChaperoneTabController::setDisableChaperone( bool value, bool notify ) { settings::setSetting( settings::DoubleSetting::CHAPERONE_fadeDistanceRemembered, - static_cast( value ) ); + static_cast( m_fadeDistance ) ); setFadeDistance( 0.0f, true ); } @@ -881,7 +1149,7 @@ void ChaperoneTabController::flipOrientation( double degrees ) double rad = 0; rad = degrees * ( M_PI / 180.0 ); - parent->RotateUniverseCenter( vr::TrackingUniverseStanding, + parent->RotateUniverseCenter( m_trackingUniverse, static_cast( rad ) ); parent->m_moveCenterTabController.zeroOffsets(); } @@ -907,7 +1175,6 @@ void ChaperoneTabController::addChaperoneProfile( bool includeForceBounds, bool includesProximityWarningSettings ) { - vr::EVRSettingsError vrSettingsError; ChaperoneProfile* profile = nullptr; for ( auto& p : chaperoneProfiles ) { @@ -959,6 +1226,7 @@ void ChaperoneTabController::addChaperoneProfile( if ( includeCenterMarker ) { profile->centerMarker = m_centerMarker; + profile->centerMarkerNew = centerMarkerNew(); } profile->includesPlaySpaceMarker = includePlaySpaceMarker; if ( includePlaySpaceMarker ) @@ -968,75 +1236,21 @@ void ChaperoneTabController::addChaperoneProfile( profile->includesFloorBoundsMarker = includeFloorBounds; if ( includeFloorBounds ) { - // TODO disabled until we add support on page back in - /*profile->floorBoundsMarker = vr::VRSettings()->GetBool( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_GroundPerimeterOn_Bool, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"" - << vr::k_pch_CollisionBounds_GroundPerimeterOn_Bool - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - }*/ + profile->floorBoundsMarker = m_chaperoneFloorToggle; } profile->includesBoundsColor = includeBoundsColor; if ( includeBoundsColor ) { - profile->boundsColor[0] = vr::VRSettings()->GetInt32( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_ColorGammaR_Int32, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"" - << vr::k_pch_CollisionBounds_ColorGammaR_Int32 - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - profile->boundsColor[1] = vr::VRSettings()->GetInt32( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_ColorGammaG_Int32, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"" - << vr::k_pch_CollisionBounds_ColorGammaG_Int32 - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - profile->boundsColor[2] = vr::VRSettings()->GetInt32( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_ColorGammaB_Int32, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"" - << vr::k_pch_CollisionBounds_ColorGammaB_Int32 - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } + profile->boundsColor[0] = chaperoneColorR(); + profile->boundsColor[1] = chaperoneColorG(); + profile->boundsColor[2] = chaperoneColorB(); } profile->includesChaperoneStyle = includeChaperoneStyle; if ( includeChaperoneStyle ) { profile->chaperoneStyle - = vr::VRSettings()->GetInt32( vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_Style_Int32, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"" - << vr::k_pch_CollisionBounds_Style_Int32 - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } + + = m_collisionBoundStyle; } profile->includesForceBounds = includeForceBounds; if ( includeForceBounds ) @@ -1065,6 +1279,7 @@ void ChaperoneTabController::addChaperoneProfile( profile->chaperoneShowDashboardDistance = chaperoneShowDashboardDistance(); } + saveChaperoneProfiles(); emit chaperoneProfilesUpdated(); } @@ -1101,6 +1316,7 @@ void ChaperoneTabController::applyChaperoneProfile( unsigned index ) if ( profile.includesCenterMarker ) { setCenterMarker( profile.centerMarker ); + setCenterMarkerNew( profile.centerMarkerNew ); } if ( profile.includesPlaySpaceMarker ) { @@ -1108,33 +1324,17 @@ void ChaperoneTabController::applyChaperoneProfile( unsigned index ) } if ( profile.includesFloorBoundsMarker ) { - // TODO disabled until we control it better. - /* vr::VRSettings()->SetBool( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_GroundPerimeterOn_Bool, - profile.floorBoundsMarker ); - */ + setChaperoneFloorToggle( profile.floorBoundsMarker ); } if ( profile.includesBoundsColor ) { - vr::VRSettings()->SetInt32( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_ColorGammaR_Int32, - profile.boundsColor[0] ); - vr::VRSettings()->SetInt32( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_ColorGammaG_Int32, - profile.boundsColor[1] ); - vr::VRSettings()->SetInt32( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_ColorGammaB_Int32, - profile.boundsColor[2] ); + setChaperoneColorR( profile.boundsColor[0] ); + setChaperoneColorG( profile.boundsColor[1] ); + setChaperoneColorB( profile.boundsColor[2] ); } if ( profile.includesChaperoneStyle ) { - vr::VRSettings()->SetInt32( vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_Style_Int32, - profile.chaperoneStyle ); + setCollisionBoundStyle( profile.chaperoneStyle, true ); } if ( profile.includesForceBounds ) { @@ -1261,59 +1461,8 @@ void ChaperoneTabController::applyAutosavedProfile() void ChaperoneTabController::reset() { - vr::EVRSettingsError vrSettingsError; - - vr::VRSettings()->RemoveKeyInSection( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_ColorGammaA_Int32, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"" - << vr::k_pch_CollisionBounds_ColorGammaA_Int32 - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_FadeDistance_Float, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"" - << vr::k_pch_CollisionBounds_FadeDistance_Float - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_CenterMarkerOn_Bool, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"" - << vr::k_pch_CollisionBounds_CenterMarkerOn_Bool - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_PlaySpaceOn_Bool, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"" - << vr::k_pch_CollisionBounds_PlaySpaceOn_Bool - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } + ovr_settings_wrapper::removeSection( vr::k_pch_CollisionBounds_Section, + "Reseting Collision Section" ); setForceBounds( false ); @@ -1397,6 +1546,127 @@ void ChaperoneTabController::addRightHapticClick( bool rightHapticClickPressed ) } } +void ChaperoneTabController::initFloorOverlay() +{ + std::string overlayFloorMarkerKey + = std::string( application_strings::applicationKey ) + ".floormarker"; + ovr_overlay_wrapper::OverlayError overlayError + = ovr_overlay_wrapper::createOverlay( overlayFloorMarkerKey, + overlayFloorMarkerKey, + &m_chaperoneFloorOverlayHandle, + "" ); + if ( overlayError == ovr_overlay_wrapper::OverlayError::NoError ) + { + ovr_overlay_wrapper::setOverlayFromFile( + m_chaperoneFloorOverlayHandle, m_floorMarkerFN, "" ); + ovr_overlay_wrapper::setOverlayWidthInMeters( + m_chaperoneFloorOverlayHandle, 0.5f ); + updateOverlayColor(); + ovr_overlay_wrapper::setOverlayAlpha( + m_chaperoneFloorOverlayHandle, m_visibility, "" ); + } + else + { + LOG( ERROR ) << "overlay Not initialized"; + // TODO Set Failure variable. + } +} + +void ChaperoneTabController::updateOverlay() +{ + if ( m_trackingUniverse != vr::TrackingUniverseRawAndUncalibrated ) + { + float xoff = -( parent->m_moveCenterTabController.offsetX() ); + float yoff = -( parent->m_moveCenterTabController.offsetY() ); + float zoff = -( parent->m_moveCenterTabController.offsetZ() ); + /* Rotation on Y Axis + * {cos t, 0, sin t} + * {0, 1, 0} + * {-sin t, 0 cost t} + */ + + vr::HmdMatrix34_t updateTransform = { { { 1.0f, 0.0f, 0.0f, xoff }, + { 0.0f, 0.0f, 1.0f, yoff }, + { 0.0f, -1.0f, 0.0f, zoff } } }; + ovr_overlay_wrapper::setOverlayTransformAbsolute( + m_chaperoneFloorOverlayHandle, + m_trackingUniverse, + &updateTransform, + "" ); + checkOverlayRotation(); + } +} + +void ChaperoneTabController::checkOverlayRotation() +{ + // can only turn so quickly soooo roughly .5 secondish update should be fine + if ( m_rotationUpdateCounter > 45 ) + { + m_rotationUpdateCounter = 0; + float rotation = parent->m_statisticsTabController.hmdRotations(); + int rotationNext; + if ( rotation > 0 ) + { + rotation = rotation + 0.5f; + int fullRotation = static_cast( rotation ); + switch ( fullRotation ) + { + case 0: + m_floorMarkerFN = "/res/img/chaperone/centermark.png"; + rotationNext = 0; + break; + case 1: + m_floorMarkerFN = "/res/img/chaperone/centermarkr1.png"; + rotationNext = 1; + break; + case 2: + m_floorMarkerFN = "/res/img/chaperone/centermarkr2.png"; + rotationNext = 2; + break; + + default: + + m_floorMarkerFN = "/res/img/chaperone/centermarkr3.png"; + rotationNext = 3; + } + } + else + { + rotation = rotation + 0.5f; + int fullRotation = static_cast( std::floor( rotation ) ); + switch ( fullRotation ) + { + case 0: + m_floorMarkerFN = "/res/img/chaperone/centermark.png"; + rotationNext = 0; + break; + case -1: + m_floorMarkerFN = "/res/img/chaperone/centermarkl1.png"; + rotationNext = -1; + break; + case -2: + m_floorMarkerFN = "/res/img/chaperone/centermarkl2.png"; + rotationNext = -2; + break; + default: + m_floorMarkerFN = "/res/img/chaperone/centermarkl3.png"; + rotationNext = -3; + } + } + + if ( rotationNext != m_rotationCurrent ) + { + m_rotationCurrent = rotationNext; + ovr_overlay_wrapper::setOverlayFromFile( + m_chaperoneFloorOverlayHandle, m_floorMarkerFN, "" ); + } + } + else + { + m_rotationUpdateCounter++; + } +} + void ChaperoneTabController::setProxState( bool value ) { if ( value ) @@ -1412,19 +1682,7 @@ void ChaperoneTabController::shutdown() if ( isChaperoneSwitchToBeginnerEnabled() && m_chaperoneSwitchToBeginnerActive ) { - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetInt32( vr::k_pch_CollisionBounds_Section, - vr::k_pch_CollisionBounds_Style_Int32, - m_chaperoneSwitchToBeginnerLastStyle, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"" - << vr::k_pch_CollisionBounds_Style_Int32 - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } + setCollisionBoundStyle( m_chaperoneSwitchToBeginnerLastStyle, false ); } } diff --git a/src/tabcontrollers/ChaperoneTabController.h b/src/tabcontrollers/ChaperoneTabController.h index 003ee03..a5823f5 100644 --- a/src/tabcontrollers/ChaperoneTabController.h +++ b/src/tabcontrollers/ChaperoneTabController.h @@ -11,9 +11,13 @@ #include "../utils/ChaperoneUtils.h" #include "../settings/settings_object.h" #include "MoveCenterTabController.h" +#include "../openvr/ovr_overlay_wrapper.h" +#include "../openvr/ovr_settings_wrapper.h" +#include class QQuickWindow; // application namespace + namespace advsettings { // forward declaration @@ -65,6 +69,7 @@ struct ChaperoneProfile : settings::ISettingsObject float chaperoneAlarmSoundDistance = 0.0f; bool enableChaperoneShowDashboard = false; float chaperoneShowDashboardDistance = 0.0f; + bool centerMarkerNew = false; virtual settings::SettingsObjectData saveSettings() const override { @@ -139,6 +144,7 @@ struct ChaperoneProfile : settings::ISettingsObject o.addValue( static_cast( chaperoneAlarmSoundDistance ) ); o.addValue( enableChaperoneShowDashboard ); o.addValue( static_cast( chaperoneShowDashboardDistance ) ); + o.addValue( centerMarkerNew ); return o; } @@ -230,6 +236,7 @@ struct ChaperoneProfile : settings::ISettingsObject enableChaperoneShowDashboard = obj.getNextValueOrDefault( false ); chaperoneShowDashboardDistance = static_cast( obj.getNextValueOrDefault( 0.0 ) ); + centerMarkerNew = obj.getNextValueOrDefault( false ); } virtual std::string settingsName() const override @@ -298,7 +305,20 @@ class ChaperoneTabController : public QObject float chaperoneShowDashboardDistance READ chaperoneShowDashboardDistance WRITE setChaperoneShowDashboardDistance NOTIFY chaperoneShowDashboardDistanceChanged ) - + Q_PROPERTY( int chaperoneColorR READ chaperoneColorR WRITE + setChaperoneColorR NOTIFY chaperoneColorRChanged ) + Q_PROPERTY( int chaperoneColorG READ chaperoneColorG WRITE + setChaperoneColorG NOTIFY chaperoneColorGChanged ) + Q_PROPERTY( int chaperoneColorB READ chaperoneColorB WRITE + setChaperoneColorB NOTIFY chaperoneColorBChanged ) + Q_PROPERTY( int chaperoneColorA READ chaperoneColorA WRITE + setChaperoneColorA NOTIFY chaperoneColorAChanged ) + Q_PROPERTY( int collisionBoundStyle READ collisionBoundStyle WRITE + setCollisionBoundStyle NOTIFY collisionBoundStyleChanged ) + Q_PROPERTY( bool chaperoneFloorToggle READ chaperoneFloorToggle WRITE + setChaperoneFloorToggle NOTIFY chaperoneFloorToggleChanged ) + Q_PROPERTY( bool centerMarkerNew READ centerMarkerNew WRITE + setCenterMarkerNew NOTIFY centerMarkerNewChanged ) private: OverlayController* parent; @@ -329,6 +349,14 @@ private: bool m_leftHapticClickActivated = false; bool m_rightHapticClickActivated = false; + int m_chaperoneColorR = 0; + int m_chaperoneColorG = 255; + int m_chaperoneColorB = 255; + + int m_collisionBoundStyle = 0; + + bool m_chaperoneFloorToggle = false; + bool m_autosaveComplete = false; int m_updateTicksChaperoneReload = 0; @@ -340,25 +368,53 @@ private: vr::VRInputValueHandle_t m_leftInputHandle; vr::VRInputValueHandle_t m_rightInputHandle; + vr::VROverlayHandle_t m_chaperoneFloorOverlayHandle + = vr::k_ulOverlayHandleInvalid; + std::vector chaperoneProfiles; + std::string m_floorMarkerFN = "/res/img/chaperone/centermark.png"; + void initFloorOverlay(); + void updateOverlay(); + void updateOverlayColor(); + void checkOverlayRotation(); + int m_rotationUpdateCounter = 0; + int m_rotationCurrent = 0; + bool m_overlayNeedsUpdate = false; + + vr::ETrackingUniverseOrigin m_trackingUniverse + = vr::TrackingUniverseRawAndUncalibrated; + public: ~ChaperoneTabController(); void initStage1(); void initStage2( OverlayController* parent ); - void eventLoopTick( vr::TrackedDevicePose_t* devicePoses ); + void eventLoopTick( vr::ETrackingUniverseOrigin universe, + vr::TrackedDevicePose_t* devicePoses ); + void dashboardLoopTick(); void handleChaperoneWarnings( float distance ); float boundsVisibility() const; - float fadeDistance() const; - float height() const; - bool centerMarker() const; - bool playSpaceMarker() const; + float fadeDistance(); + float height(); + bool centerMarker(); + bool playSpaceMarker(); bool forceBounds() const; bool disableChaperone() const; + int chaperoneColorR(); + int chaperoneColorG(); + int chaperoneColorB(); + int chaperoneColorA() const; + + bool centerMarkerNew(); + + bool chaperoneFloorToggle(); + + int collisionBoundStyle(); + void setRightHapticActionHandle( vr::VRActionHandle_t handle ); void setLeftHapticActionHandle( vr::VRActionHandle_t handle ); void setRightInputHandle( vr::VRInputValueHandle_t handle ); @@ -419,6 +475,18 @@ public slots: void setChaperoneShowDashboardEnabled( bool value, bool notify = true ); void setChaperoneShowDashboardDistance( float value, bool notify = true ); + void setChaperoneColorR( int value, bool notify = true ); + void setChaperoneColorG( int value, bool notify = true ); + void setChaperoneColorB( int value, bool notify = true ); + void setChaperoneColorA( int value, bool notify = true ); + + void setCenterMarkerNew( bool value, bool notify = true ); + + void setCollisionBoundStyle( int value, + bool notify = true, + bool isTemp = false ); + void setChaperoneFloorToggle( bool value, bool notify = true ); + void flipOrientation( double degrees = 180 ); void reloadFromDisk(); @@ -464,6 +532,16 @@ signals: void chaperoneShowDashboardEnabledChanged( bool value ); void chaperoneShowDashboardDistanceChanged( float value ); + void chaperoneColorRChanged( int value ); + void chaperoneColorGChanged( int value ); + void chaperoneColorBChanged( int value ); + void chaperoneColorAChanged( int value ); + + void collisionBoundStyleChanged( int value ); + + void chaperoneFloorToggleChanged( bool value ); + void centerMarkerNewChanged( bool value ); + void chaperoneProfilesUpdated(); }; diff --git a/src/tabcontrollers/VideoTabController.cpp b/src/tabcontrollers/VideoTabController.cpp index 23eaa7d..374be47 100644 --- a/src/tabcontrollers/VideoTabController.cpp +++ b/src/tabcontrollers/VideoTabController.cpp @@ -319,7 +319,7 @@ void VideoTabController::setBrightnessOpacityValue( float percvalue, settings::setSetting( settings::DoubleSetting::VIDEO_brightnessOpacityValue, static_cast( percvalue ) ); - if ( realvalue >= 0.97f || realvalue <= 0.00f ) + if ( realvalue >= 0.9999f || realvalue < 0.00f ) { LOG( WARNING ) << "alpha value is invalid setting to 1.0"; settings::setSetting( diff --git a/third-party/openvr/bin/linux32/libopenvr_api.so b/third-party/openvr/bin/linux32/libopenvr_api.so index 6d7c2d3..c4fa5ad 100644 Binary files a/third-party/openvr/bin/linux32/libopenvr_api.so and b/third-party/openvr/bin/linux32/libopenvr_api.so differ diff --git a/third-party/openvr/bin/linux32/libopenvr_api.so.dbg b/third-party/openvr/bin/linux32/libopenvr_api.so.dbg index 3015231..aaccc90 100644 Binary files a/third-party/openvr/bin/linux32/libopenvr_api.so.dbg and b/third-party/openvr/bin/linux32/libopenvr_api.so.dbg differ diff --git a/third-party/openvr/bin/linux64/libopenvr_api.so b/third-party/openvr/bin/linux64/libopenvr_api.so index 32cc89c..05df827 100644 Binary files a/third-party/openvr/bin/linux64/libopenvr_api.so and b/third-party/openvr/bin/linux64/libopenvr_api.so differ diff --git a/third-party/openvr/bin/linux64/libopenvr_api.so.dbg b/third-party/openvr/bin/linux64/libopenvr_api.so.dbg index 367173b..84adf34 100644 Binary files a/third-party/openvr/bin/linux64/libopenvr_api.so.dbg and b/third-party/openvr/bin/linux64/libopenvr_api.so.dbg differ diff --git a/third-party/openvr/bin/win32/openvr_api.dll b/third-party/openvr/bin/win32/openvr_api.dll index b89d07b..b09c549 100644 Binary files a/third-party/openvr/bin/win32/openvr_api.dll and b/third-party/openvr/bin/win32/openvr_api.dll differ diff --git a/third-party/openvr/bin/win32/openvr_api.pdb b/third-party/openvr/bin/win32/openvr_api.pdb index 408303e..bb50bfe 100644 Binary files a/third-party/openvr/bin/win32/openvr_api.pdb and b/third-party/openvr/bin/win32/openvr_api.pdb differ diff --git a/third-party/openvr/bin/win64/openvr_api.dll b/third-party/openvr/bin/win64/openvr_api.dll index 902b6c7..ab3d881 100644 Binary files a/third-party/openvr/bin/win64/openvr_api.dll and b/third-party/openvr/bin/win64/openvr_api.dll differ diff --git a/third-party/openvr/bin/win64/openvr_api.pdb b/third-party/openvr/bin/win64/openvr_api.pdb index ec1a257..f49a132 100644 Binary files a/third-party/openvr/bin/win64/openvr_api.pdb and b/third-party/openvr/bin/win64/openvr_api.pdb differ diff --git a/third-party/openvr/headers/openvr.h b/third-party/openvr/headers/openvr.h index 7f593f3..ec26ef4 100644 --- a/third-party/openvr/headers/openvr.h +++ b/third-party/openvr/headers/openvr.h @@ -15,8 +15,8 @@ namespace vr { static const uint32_t k_nSteamVRVersionMajor = 1; - static const uint32_t k_nSteamVRVersionMinor = 10; - static const uint32_t k_nSteamVRVersionBuild = 30; + static const uint32_t k_nSteamVRVersionMinor = 11; + static const uint32_t k_nSteamVRVersionBuild = 11; } // namespace vr // vrtypes.h @@ -746,7 +746,7 @@ enum EVREventType //VREvent_DashboardThumbSelected = 504, // Sent to the overlay manager - data is overlay - No longer sent VREvent_DashboardRequested = 505, // Sent to the overlay manager - data is overlay VREvent_ResetDashboard = 506, // Send to the overlay manager - VREvent_RenderToast = 507, // Send to the dashboard to render a toast - data is the notification ID + //VREvent_RenderToast = 507, // Send to the dashboard to render a toast - data is the notification ID -- no longer sent VREvent_ImageLoaded = 508, // Sent to overlays when a SetOverlayRaw or SetOverlayFromFile call finishes loading VREvent_ShowKeyboard = 509, // Sent to keyboard renderer in the dashboard to invoke it VREvent_HideKeyboard = 510, // Sent to keyboard renderer in the dashboard to hide it @@ -816,6 +816,8 @@ enum EVREventType VREvent_LastKnownSectionSettingChanged = 867, VREvent_DismissedWarningsSectionSettingChanged = 868, VREvent_GpuSpeedSectionSettingChanged = 869, + VREvent_WindowsMRSectionSettingChanged = 870, + VREvent_OtherSectionSettingChanged = 871, VREvent_StatusUpdate = 900, @@ -2736,6 +2738,10 @@ namespace vr static const char * const k_pch_Null_SecondsFromVsyncToPhotons_Float = "secondsFromVsyncToPhotons"; static const char * const k_pch_Null_DisplayFrequency_Float = "displayFrequency"; + //----------------------------------------------------------------------------- + // Windows MR keys + static const char * const k_pch_WindowsMR_Section = "driver_holographic"; + //----------------------------------------------------------------------------- // user interface keys static const char * const k_pch_UserInterface_Section = "userinterface"; @@ -2778,6 +2784,7 @@ namespace vr static const char * const k_pch_CollisionBounds_CenterMarkerOn_Bool = "CollisionBoundsCenterMarkerOn"; static const char * const k_pch_CollisionBounds_PlaySpaceOn_Bool = "CollisionBoundsPlaySpaceOn"; static const char * const k_pch_CollisionBounds_FadeDistance_Float = "CollisionBoundsFadeDistance"; + static const char * const k_pch_CollisionBounds_WallHeight_Float = "CollisionBoundsWallHeight"; static const char * const k_pch_CollisionBounds_ColorGammaR_Int32 = "CollisionBoundsColorGammaR"; static const char * const k_pch_CollisionBounds_ColorGammaG_Int32 = "CollisionBoundsColorGammaG"; static const char * const k_pch_CollisionBounds_ColorGammaB_Int32 = "CollisionBoundsColorGammaB"; @@ -2813,6 +2820,8 @@ namespace vr static const char * const k_pch_audio_PlaybackMirrorDevice_String = "playbackMirrorDevice"; static const char * const k_pch_audio_PlaybackMirrorDeviceName_String = "playbackMirrorDeviceName"; static const char * const k_pch_audio_OldPlaybackMirrorDevice_String = "onPlaybackMirrorDevice"; + static const char * const k_pch_audio_ActiveMirrorDevice_String = "activePlaybackMirrorDevice"; + static const char * const k_pch_audio_EnablePlaybackMirrorIndependentVolume_Bool = "enablePlaybackMirrorIndependentVolume"; static const char * const k_pch_audio_LastHmdPlaybackDeviceId_String = "lastHmdPlaybackDeviceId"; static const char * const k_pch_audio_VIVEHDMIGain = "viveHDMIGain"; @@ -2831,7 +2840,6 @@ namespace vr static const char * const k_pch_Dashboard_Section = "dashboard"; static const char * const k_pch_Dashboard_EnableDashboard_Bool = "enableDashboard"; static const char * const k_pch_Dashboard_ArcadeMode_Bool = "arcadeMode"; - static const char * const k_pch_Dashboard_UseWebSettings = "useWebSettings"; static const char * const k_pch_Dashboard_Position = "position"; static const char * const k_pch_Dashboard_DesktopScale = "desktopScale"; static const char * const k_pch_Dashboard_DashboardScale = "dashboardScale"; @@ -3033,7 +3041,7 @@ public: /** Sets the Play Area in the working copy. */ virtual void SetWorkingPlayAreaSize( float sizeX, float sizeZ ) = 0; - /** Sets the Collision Bounds in the working copy. */ + /** Sets the Collision Bounds in the working copy. Note: ceiling height is ignored. */ virtual void SetWorkingCollisionBoundsInfo( VR_ARRAY_COUNT(unQuadsCount) HmdQuad_t *pQuadsBuffer, uint32_t unQuadsCount ) = 0; /** Sets the Collision Bounds in the working copy. */ @@ -4162,6 +4170,15 @@ enum EVRRenderModelError VRRenderModelError_InvalidTexture = 400, }; +enum EVRRenderModelTextureFormat +{ + VRRenderModelTextureFormat_RGBA8_SRGB = 0, // RGBA with 8 bits per channel per pixel. Data size is width * height * 4ub + VRRenderModelTextureFormat_BC2, + VRRenderModelTextureFormat_BC4, + VRRenderModelTextureFormat_BC7, + VRRenderModelTextureFormat_BC7_SRGB +}; + /** A single vertex in a render model */ struct RenderModel_Vertex_t { @@ -4180,7 +4197,8 @@ struct RenderModel_Vertex_t struct RenderModel_TextureMap_t { uint16_t unWidth, unHeight; // width and height of the texture map in pixels - const uint8_t *rubTextureMapData; // Map texture data. All textures are RGBA with 8 bits per channel per pixel. Data size is width * height * 4ub + const uint8_t *rubTextureMapData; // Map texture data. + EVRRenderModelTextureFormat format; // Refer to EVRRenderModelTextureFormat }; #if defined(__linux__) || defined(__APPLE__) #pragma pack( pop ) diff --git a/third-party/openvr/headers/openvr_api.cs b/third-party/openvr/headers/openvr_api.cs index 5abb193..db9893f 100644 --- a/third-party/openvr/headers/openvr_api.cs +++ b/third-party/openvr/headers/openvr_api.cs @@ -4403,7 +4403,6 @@ public enum EVREventType VREvent_DashboardDeactivated = 503, VREvent_DashboardRequested = 505, VREvent_ResetDashboard = 506, - VREvent_RenderToast = 507, VREvent_ImageLoaded = 508, VREvent_ShowKeyboard = 509, VREvent_HideKeyboard = 510, @@ -4462,6 +4461,8 @@ public enum EVREventType VREvent_LastKnownSectionSettingChanged = 867, VREvent_DismissedWarningsSectionSettingChanged = 868, VREvent_GpuSpeedSectionSettingChanged = 869, + VREvent_WindowsMRSectionSettingChanged = 870, + VREvent_OtherSectionSettingChanged = 871, VREvent_StatusUpdate = 900, VREvent_WebInterface_InstallDriverCompleted = 950, VREvent_MCImageUpdated = 1000, @@ -5168,6 +5169,14 @@ public enum EVRRenderModelError NotEnoughTexCoords = 308, InvalidTexture = 400, } +public enum EVRRenderModelTextureFormat +{ + RGBA8_SRGB = 0, + BC2 = 1, + BC4 = 2, + BC7 = 3, + BC7_SRGB = 4, +} public enum EVRNotificationType { Transient = 0, @@ -5947,6 +5956,7 @@ public enum EVRDebugError public ushort unWidth; public ushort unHeight; public IntPtr rubTextureMapData; // const uint8_t * + public EVRRenderModelTextureFormat format; } // This structure is for backwards binary compatibility on Linux and OSX only [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct RenderModel_TextureMap_t_Packed @@ -5954,17 +5964,20 @@ public enum EVRDebugError public ushort unWidth; public ushort unHeight; public IntPtr rubTextureMapData; // const uint8_t * + public EVRRenderModelTextureFormat format; public RenderModel_TextureMap_t_Packed(RenderModel_TextureMap_t unpacked) { this.unWidth = unpacked.unWidth; this.unHeight = unpacked.unHeight; this.rubTextureMapData = unpacked.rubTextureMapData; + this.format = unpacked.format; } public void Unpack(ref RenderModel_TextureMap_t unpacked) { unpacked.unWidth = this.unWidth; unpacked.unHeight = this.unHeight; unpacked.rubTextureMapData = this.rubTextureMapData; + unpacked.format = this.format; } } [StructLayout(LayoutKind.Sequential)] public struct RenderModel_t @@ -7072,6 +7085,7 @@ public class OpenVR public const string k_pch_Null_RenderHeight_Int32 = "renderHeight"; public const string k_pch_Null_SecondsFromVsyncToPhotons_Float = "secondsFromVsyncToPhotons"; public const string k_pch_Null_DisplayFrequency_Float = "displayFrequency"; + public const string k_pch_WindowsMR_Section = "driver_holographic"; public const string k_pch_UserInterface_Section = "userinterface"; public const string k_pch_UserInterface_StatusAlwaysOnTop_Bool = "StatusAlwaysOnTop"; public const string k_pch_UserInterface_MinimizeToTray_Bool = "MinimizeToTray"; @@ -7100,6 +7114,7 @@ public class OpenVR public const string k_pch_CollisionBounds_CenterMarkerOn_Bool = "CollisionBoundsCenterMarkerOn"; public const string k_pch_CollisionBounds_PlaySpaceOn_Bool = "CollisionBoundsPlaySpaceOn"; public const string k_pch_CollisionBounds_FadeDistance_Float = "CollisionBoundsFadeDistance"; + public const string k_pch_CollisionBounds_WallHeight_Float = "CollisionBoundsWallHeight"; public const string k_pch_CollisionBounds_ColorGammaR_Int32 = "CollisionBoundsColorGammaR"; public const string k_pch_CollisionBounds_ColorGammaG_Int32 = "CollisionBoundsColorGammaG"; public const string k_pch_CollisionBounds_ColorGammaB_Int32 = "CollisionBoundsColorGammaB"; @@ -7129,6 +7144,8 @@ public class OpenVR public const string k_pch_audio_PlaybackMirrorDevice_String = "playbackMirrorDevice"; public const string k_pch_audio_PlaybackMirrorDeviceName_String = "playbackMirrorDeviceName"; public const string k_pch_audio_OldPlaybackMirrorDevice_String = "onPlaybackMirrorDevice"; + public const string k_pch_audio_ActiveMirrorDevice_String = "activePlaybackMirrorDevice"; + public const string k_pch_audio_EnablePlaybackMirrorIndependentVolume_Bool = "enablePlaybackMirrorIndependentVolume"; public const string k_pch_audio_LastHmdPlaybackDeviceId_String = "lastHmdPlaybackDeviceId"; public const string k_pch_audio_VIVEHDMIGain = "viveHDMIGain"; public const string k_pch_Power_Section = "power"; @@ -7141,7 +7158,6 @@ public class OpenVR public const string k_pch_Dashboard_Section = "dashboard"; public const string k_pch_Dashboard_EnableDashboard_Bool = "enableDashboard"; public const string k_pch_Dashboard_ArcadeMode_Bool = "arcadeMode"; - public const string k_pch_Dashboard_UseWebSettings = "useWebSettings"; public const string k_pch_Dashboard_Position = "position"; public const string k_pch_Dashboard_DesktopScale = "desktopScale"; public const string k_pch_Dashboard_DashboardScale = "dashboardScale"; diff --git a/third-party/openvr/headers/openvr_api.json b/third-party/openvr/headers/openvr_api.json index dd2d972..0dbec84 100644 --- a/third-party/openvr/headers/openvr_api.json +++ b/third-party/openvr/headers/openvr_api.json @@ -390,7 +390,6 @@ ,{"name": "VREvent_DashboardDeactivated","value": "503"} ,{"name": "VREvent_DashboardRequested","value": "505"} ,{"name": "VREvent_ResetDashboard","value": "506"} - ,{"name": "VREvent_RenderToast","value": "507"} ,{"name": "VREvent_ImageLoaded","value": "508"} ,{"name": "VREvent_ShowKeyboard","value": "509"} ,{"name": "VREvent_HideKeyboard","value": "510"} @@ -449,6 +448,8 @@ ,{"name": "VREvent_LastKnownSectionSettingChanged","value": "867"} ,{"name": "VREvent_DismissedWarningsSectionSettingChanged","value": "868"} ,{"name": "VREvent_GpuSpeedSectionSettingChanged","value": "869"} + ,{"name": "VREvent_WindowsMRSectionSettingChanged","value": "870"} + ,{"name": "VREvent_OtherSectionSettingChanged","value": "871"} ,{"name": "VREvent_StatusUpdate","value": "900"} ,{"name": "VREvent_WebInterface_InstallDriverCompleted","value": "950"} ,{"name": "VREvent_MCImageUpdated","value": "1000"} @@ -1108,6 +1109,13 @@ ,{"name": "VRRenderModelError_NotEnoughTexCoords","value": "308"} ,{"name": "VRRenderModelError_InvalidTexture","value": "400"} ]} +, {"enumname": "vr::EVRRenderModelTextureFormat","values": [ + {"name": "VRRenderModelTextureFormat_RGBA8_SRGB","value": "0"} + ,{"name": "VRRenderModelTextureFormat_BC2","value": "1"} + ,{"name": "VRRenderModelTextureFormat_BC4","value": "2"} + ,{"name": "VRRenderModelTextureFormat_BC7","value": "3"} + ,{"name": "VRRenderModelTextureFormat_BC7_SRGB","value": "4"} +]} , {"enumname": "vr::EVRNotificationType","values": [ {"name": "EVRNotificationType_Transient","value": "0"} ,{"name": "EVRNotificationType_Persistent","value": "1"} @@ -1532,6 +1540,8 @@ "constname": "k_pch_Null_SecondsFromVsyncToPhotons_Float","consttype": "const char *const", "constval": "secondsFromVsyncToPhotons"} ,{ "constname": "k_pch_Null_DisplayFrequency_Float","consttype": "const char *const", "constval": "displayFrequency"} +,{ + "constname": "k_pch_WindowsMR_Section","consttype": "const char *const", "constval": "driver_holographic"} ,{ "constname": "k_pch_UserInterface_Section","consttype": "const char *const", "constval": "userinterface"} ,{ @@ -1588,6 +1598,8 @@ "constname": "k_pch_CollisionBounds_PlaySpaceOn_Bool","consttype": "const char *const", "constval": "CollisionBoundsPlaySpaceOn"} ,{ "constname": "k_pch_CollisionBounds_FadeDistance_Float","consttype": "const char *const", "constval": "CollisionBoundsFadeDistance"} +,{ + "constname": "k_pch_CollisionBounds_WallHeight_Float","consttype": "const char *const", "constval": "CollisionBoundsWallHeight"} ,{ "constname": "k_pch_CollisionBounds_ColorGammaR_Int32","consttype": "const char *const", "constval": "CollisionBoundsColorGammaR"} ,{ @@ -1646,6 +1658,10 @@ "constname": "k_pch_audio_PlaybackMirrorDeviceName_String","consttype": "const char *const", "constval": "playbackMirrorDeviceName"} ,{ "constname": "k_pch_audio_OldPlaybackMirrorDevice_String","consttype": "const char *const", "constval": "onPlaybackMirrorDevice"} +,{ + "constname": "k_pch_audio_ActiveMirrorDevice_String","consttype": "const char *const", "constval": "activePlaybackMirrorDevice"} +,{ + "constname": "k_pch_audio_EnablePlaybackMirrorIndependentVolume_Bool","consttype": "const char *const", "constval": "enablePlaybackMirrorIndependentVolume"} ,{ "constname": "k_pch_audio_LastHmdPlaybackDeviceId_String","consttype": "const char *const", "constval": "lastHmdPlaybackDeviceId"} ,{ @@ -1670,8 +1686,6 @@ "constname": "k_pch_Dashboard_EnableDashboard_Bool","consttype": "const char *const", "constval": "enableDashboard"} ,{ "constname": "k_pch_Dashboard_ArcadeMode_Bool","consttype": "const char *const", "constval": "arcadeMode"} -,{ - "constname": "k_pch_Dashboard_UseWebSettings","consttype": "const char *const", "constval": "useWebSettings"} ,{ "constname": "k_pch_Dashboard_Position","consttype": "const char *const", "constval": "position"} ,{ @@ -2117,7 +2131,8 @@ ,{"struct": "vr::RenderModel_TextureMap_t","fields": [ { "fieldname": "unWidth", "fieldtype": "uint16_t"}, { "fieldname": "unHeight", "fieldtype": "uint16_t"}, -{ "fieldname": "rubTextureMapData", "fieldtype": "const uint8_t *"}]} +{ "fieldname": "rubTextureMapData", "fieldtype": "const uint8_t *"}, +{ "fieldname": "format", "fieldtype": "enum vr::EVRRenderModelTextureFormat"}]} ,{"struct": "vr::RenderModel_t","fields": [ { "fieldname": "rVertexData", "fieldtype": "const struct vr::RenderModel_Vertex_t *"}, { "fieldname": "unVertexCount", "fieldtype": "uint32_t"}, diff --git a/third-party/openvr/headers/openvr_capi.h b/third-party/openvr/headers/openvr_capi.h index 6feb2c6..625b8da 100644 --- a/third-party/openvr/headers/openvr_capi.h +++ b/third-party/openvr/headers/openvr_capi.h @@ -63,66 +63,66 @@ typedef uint64_t VRInputValueHandle_t; // OpenVR Constants -static const unsigned int k_nDriverNone = 4294967295; -static const unsigned int k_unMaxDriverDebugResponseSize = 32768; -static const unsigned int k_unTrackedDeviceIndex_Hmd = 0; -static const unsigned int k_unMaxTrackedDeviceCount = 64; -static const unsigned int k_unTrackedDeviceIndexOther = 4294967294; -static const unsigned int k_unTrackedDeviceIndexInvalid = 4294967295; -static const unsigned long k_ulInvalidPropertyContainer = 0; -static const unsigned int k_unInvalidPropertyTag = 0; -static const unsigned long k_ulInvalidDriverHandle = 0; -static const unsigned int k_unFloatPropertyTag = 1; -static const unsigned int k_unInt32PropertyTag = 2; -static const unsigned int k_unUint64PropertyTag = 3; -static const unsigned int k_unBoolPropertyTag = 4; -static const unsigned int k_unStringPropertyTag = 5; -static const unsigned int k_unErrorPropertyTag = 6; -static const unsigned int k_unDoublePropertyTag = 7; -static const unsigned int k_unHmdMatrix34PropertyTag = 20; -static const unsigned int k_unHmdMatrix44PropertyTag = 21; -static const unsigned int k_unHmdVector3PropertyTag = 22; -static const unsigned int k_unHmdVector4PropertyTag = 23; -static const unsigned int k_unHmdVector2PropertyTag = 24; -static const unsigned int k_unHmdQuadPropertyTag = 25; -static const unsigned int k_unHiddenAreaPropertyTag = 30; -static const unsigned int k_unPathHandleInfoTag = 31; -static const unsigned int k_unActionPropertyTag = 32; -static const unsigned int k_unInputValuePropertyTag = 33; -static const unsigned int k_unWildcardPropertyTag = 34; -static const unsigned int k_unHapticVibrationPropertyTag = 35; -static const unsigned int k_unSkeletonPropertyTag = 36; -static const unsigned int k_unSpatialAnchorPosePropertyTag = 40; -static const unsigned int k_unJsonPropertyTag = 41; -static const unsigned int k_unActiveActionSetPropertyTag = 42; -static const unsigned int k_unOpenVRInternalReserved_Start = 1000; -static const unsigned int k_unOpenVRInternalReserved_End = 10000; -static const unsigned int k_unMaxPropertyStringSize = 32768; -static const unsigned long k_ulInvalidActionHandle = 0; -static const unsigned long k_ulInvalidActionSetHandle = 0; -static const unsigned long k_ulInvalidInputValueHandle = 0; -static const unsigned int k_unControllerStateAxisCount = 5; -static const unsigned long k_ulOverlayHandleInvalid = 0; -static const unsigned int k_unMaxDistortionFunctionParameters = 8; -static const unsigned int k_unScreenshotHandleInvalid = 0; +static const unsigned long k_nDriverNone = 4294967295; +static const unsigned long k_unMaxDriverDebugResponseSize = 32768; +static const unsigned long k_unTrackedDeviceIndex_Hmd = 0; +static const unsigned long k_unMaxTrackedDeviceCount = 64; +static const unsigned long k_unTrackedDeviceIndexOther = 4294967294; +static const unsigned long k_unTrackedDeviceIndexInvalid = 4294967295; +static const unsigned long long k_ulInvalidPropertyContainer = 0; +static const unsigned long k_unInvalidPropertyTag = 0; +static const unsigned long long k_ulInvalidDriverHandle = 0; +static const unsigned long k_unFloatPropertyTag = 1; +static const unsigned long k_unInt32PropertyTag = 2; +static const unsigned long k_unUint64PropertyTag = 3; +static const unsigned long k_unBoolPropertyTag = 4; +static const unsigned long k_unStringPropertyTag = 5; +static const unsigned long k_unErrorPropertyTag = 6; +static const unsigned long k_unDoublePropertyTag = 7; +static const unsigned long k_unHmdMatrix34PropertyTag = 20; +static const unsigned long k_unHmdMatrix44PropertyTag = 21; +static const unsigned long k_unHmdVector3PropertyTag = 22; +static const unsigned long k_unHmdVector4PropertyTag = 23; +static const unsigned long k_unHmdVector2PropertyTag = 24; +static const unsigned long k_unHmdQuadPropertyTag = 25; +static const unsigned long k_unHiddenAreaPropertyTag = 30; +static const unsigned long k_unPathHandleInfoTag = 31; +static const unsigned long k_unActionPropertyTag = 32; +static const unsigned long k_unInputValuePropertyTag = 33; +static const unsigned long k_unWildcardPropertyTag = 34; +static const unsigned long k_unHapticVibrationPropertyTag = 35; +static const unsigned long k_unSkeletonPropertyTag = 36; +static const unsigned long k_unSpatialAnchorPosePropertyTag = 40; +static const unsigned long k_unJsonPropertyTag = 41; +static const unsigned long k_unActiveActionSetPropertyTag = 42; +static const unsigned long k_unOpenVRInternalReserved_Start = 1000; +static const unsigned long k_unOpenVRInternalReserved_End = 10000; +static const unsigned long k_unMaxPropertyStringSize = 32768; +static const unsigned long long k_ulInvalidActionHandle = 0; +static const unsigned long long k_ulInvalidActionSetHandle = 0; +static const unsigned long long k_ulInvalidInputValueHandle = 0; +static const unsigned long k_unControllerStateAxisCount = 5; +static const unsigned long long k_ulOverlayHandleInvalid = 0; +static const unsigned long k_unMaxDistortionFunctionParameters = 8; +static const unsigned long k_unScreenshotHandleInvalid = 0; static const char * IVRSystem_Version = "IVRSystem_021"; static const char * IVRExtendedDisplay_Version = "IVRExtendedDisplay_001"; static const char * IVRTrackedCamera_Version = "IVRTrackedCamera_006"; -static const unsigned int k_unMaxApplicationKeyLength = 128; +static const unsigned long k_unMaxApplicationKeyLength = 128; static const char * k_pch_MimeType_HomeApp = "vr/home"; static const char * k_pch_MimeType_GameTheater = "vr/game_theater"; static const char * IVRApplications_Version = "IVRApplications_007"; static const char * IVRChaperone_Version = "IVRChaperone_003"; static const char * IVRChaperoneSetup_Version = "IVRChaperoneSetup_006"; static const char * IVRCompositor_Version = "IVRCompositor_026"; -static const unsigned int k_unVROverlayMaxKeyLength = 128; -static const unsigned int k_unVROverlayMaxNameLength = 128; -static const unsigned int k_unMaxOverlayCount = 128; -static const unsigned int k_unMaxOverlayIntersectionMaskPrimitivesCount = 32; +static const unsigned long k_unVROverlayMaxKeyLength = 128; +static const unsigned long k_unVROverlayMaxNameLength = 128; +static const unsigned long k_unMaxOverlayCount = 128; +static const unsigned long k_unMaxOverlayIntersectionMaskPrimitivesCount = 32; static const char * IVROverlay_Version = "IVROverlay_024"; static const char * IVROverlayView_Version = "IVROverlayView_003"; -static const unsigned int k_unHeadsetViewMaxWidth = 3840; -static const unsigned int k_unHeadsetViewMaxHeight = 2160; +static const unsigned long k_unHeadsetViewMaxWidth = 3840; +static const unsigned long k_unHeadsetViewMaxHeight = 2160; static const char * k_pchHeadsetViewOverlayKey = "system.HeadsetView"; static const char * IVRHeadsetView_Version = "IVRHeadsetView_001"; static const char * k_pch_Controller_Component_GDC2015 = "gdc2015"; @@ -131,9 +131,9 @@ static const char * k_pch_Controller_Component_Tip = "tip"; static const char * k_pch_Controller_Component_HandGrip = "handgrip"; static const char * k_pch_Controller_Component_Status = "status"; static const char * IVRRenderModels_Version = "IVRRenderModels_006"; -static const unsigned int k_unNotificationTextMaxSize = 256; +static const unsigned long k_unNotificationTextMaxSize = 256; static const char * IVRNotifications_Version = "IVRNotifications_002"; -static const unsigned int k_unMaxSettingsKeyLength = 128; +static const unsigned long k_unMaxSettingsKeyLength = 128; static const char * IVRSettings_Version = "IVRSettings_003"; static const char * k_pch_SteamVR_Section = "steamvr"; static const char * k_pch_SteamVR_RequireHmd_String = "requireHmd"; @@ -232,6 +232,7 @@ static const char * k_pch_Null_RenderWidth_Int32 = "renderWidth"; static const char * k_pch_Null_RenderHeight_Int32 = "renderHeight"; static const char * k_pch_Null_SecondsFromVsyncToPhotons_Float = "secondsFromVsyncToPhotons"; static const char * k_pch_Null_DisplayFrequency_Float = "displayFrequency"; +static const char * k_pch_WindowsMR_Section = "driver_holographic"; static const char * k_pch_UserInterface_Section = "userinterface"; static const char * k_pch_UserInterface_StatusAlwaysOnTop_Bool = "StatusAlwaysOnTop"; static const char * k_pch_UserInterface_MinimizeToTray_Bool = "MinimizeToTray"; @@ -260,6 +261,7 @@ static const char * k_pch_CollisionBounds_GroundPerimeterOn_Bool = "CollisionBou static const char * k_pch_CollisionBounds_CenterMarkerOn_Bool = "CollisionBoundsCenterMarkerOn"; static const char * k_pch_CollisionBounds_PlaySpaceOn_Bool = "CollisionBoundsPlaySpaceOn"; static const char * k_pch_CollisionBounds_FadeDistance_Float = "CollisionBoundsFadeDistance"; +static const char * k_pch_CollisionBounds_WallHeight_Float = "CollisionBoundsWallHeight"; static const char * k_pch_CollisionBounds_ColorGammaR_Int32 = "CollisionBoundsColorGammaR"; static const char * k_pch_CollisionBounds_ColorGammaG_Int32 = "CollisionBoundsColorGammaG"; static const char * k_pch_CollisionBounds_ColorGammaB_Int32 = "CollisionBoundsColorGammaB"; @@ -289,6 +291,8 @@ static const char * k_pch_audio_EnablePlaybackMirror_Bool = "enablePlaybackMirro static const char * k_pch_audio_PlaybackMirrorDevice_String = "playbackMirrorDevice"; static const char * k_pch_audio_PlaybackMirrorDeviceName_String = "playbackMirrorDeviceName"; static const char * k_pch_audio_OldPlaybackMirrorDevice_String = "onPlaybackMirrorDevice"; +static const char * k_pch_audio_ActiveMirrorDevice_String = "activePlaybackMirrorDevice"; +static const char * k_pch_audio_EnablePlaybackMirrorIndependentVolume_Bool = "enablePlaybackMirrorIndependentVolume"; static const char * k_pch_audio_LastHmdPlaybackDeviceId_String = "lastHmdPlaybackDeviceId"; static const char * k_pch_audio_VIVEHDMIGain = "viveHDMIGain"; static const char * k_pch_Power_Section = "power"; @@ -301,7 +305,6 @@ static const char * k_pch_Power_PauseCompositorOnStandby_Bool = "pauseCompositor static const char * k_pch_Dashboard_Section = "dashboard"; static const char * k_pch_Dashboard_EnableDashboard_Bool = "enableDashboard"; static const char * k_pch_Dashboard_ArcadeMode_Bool = "arcadeMode"; -static const char * k_pch_Dashboard_UseWebSettings = "useWebSettings"; static const char * k_pch_Dashboard_Position = "position"; static const char * k_pch_Dashboard_DesktopScale = "desktopScale"; static const char * k_pch_Dashboard_DashboardScale = "dashboardScale"; @@ -335,17 +338,17 @@ static const char * k_pch_GpuSpeed_Section = "GpuSpeed"; static const char * IVRScreenshots_Version = "IVRScreenshots_001"; static const char * IVRResources_Version = "IVRResources_001"; static const char * IVRDriverManager_Version = "IVRDriverManager_001"; -static const unsigned int k_unMaxActionNameLength = 64; -static const unsigned int k_unMaxActionSetNameLength = 64; -static const unsigned int k_unMaxActionOriginCount = 16; -static const unsigned int k_unMaxBoneNameLength = 32; +static const unsigned long k_unMaxActionNameLength = 64; +static const unsigned long k_unMaxActionSetNameLength = 64; +static const unsigned long k_unMaxActionOriginCount = 16; +static const unsigned long k_unMaxBoneNameLength = 32; static const int k_nActionSetOverlayGlobalPriorityMin = 16777216; static const int k_nActionSetOverlayGlobalPriorityMax = 33554431; static const int k_nActionSetPriorityReservedMin = 33554432; static const char * IVRInput_Version = "IVRInput_010"; -static const unsigned long k_ulInvalidIOBufferHandle = 0; +static const unsigned long long k_ulInvalidIOBufferHandle = 0; static const char * IVRIOBuffer_Version = "IVRIOBuffer_002"; -static const unsigned int k_ulInvalidSpatialAnchorHandle = 0; +static const unsigned long k_ulInvalidSpatialAnchorHandle = 0; static const char * IVRSpatialAnchors_Version = "IVRSpatialAnchors_001"; static const char * IVRDebug_Version = "IVRDebug_001"; @@ -727,7 +730,6 @@ typedef enum EVREventType EVREventType_VREvent_DashboardDeactivated = 503, EVREventType_VREvent_DashboardRequested = 505, EVREventType_VREvent_ResetDashboard = 506, - EVREventType_VREvent_RenderToast = 507, EVREventType_VREvent_ImageLoaded = 508, EVREventType_VREvent_ShowKeyboard = 509, EVREventType_VREvent_HideKeyboard = 510, @@ -786,6 +788,8 @@ typedef enum EVREventType EVREventType_VREvent_LastKnownSectionSettingChanged = 867, EVREventType_VREvent_DismissedWarningsSectionSettingChanged = 868, EVREventType_VREvent_GpuSpeedSectionSettingChanged = 869, + EVREventType_VREvent_WindowsMRSectionSettingChanged = 870, + EVREventType_VREvent_OtherSectionSettingChanged = 871, EVREventType_VREvent_StatusUpdate = 900, EVREventType_VREvent_WebInterface_InstallDriverCompleted = 950, EVREventType_VREvent_MCImageUpdated = 1000, @@ -1540,6 +1544,15 @@ typedef enum EVRRenderModelError EVRRenderModelError_VRRenderModelError_InvalidTexture = 400, } EVRRenderModelError; +typedef enum EVRRenderModelTextureFormat +{ + EVRRenderModelTextureFormat_VRRenderModelTextureFormat_RGBA8_SRGB = 0, + EVRRenderModelTextureFormat_VRRenderModelTextureFormat_BC2 = 1, + EVRRenderModelTextureFormat_VRRenderModelTextureFormat_BC4 = 2, + EVRRenderModelTextureFormat_VRRenderModelTextureFormat_BC7 = 3, + EVRRenderModelTextureFormat_VRRenderModelTextureFormat_BC7_SRGB = 4, +} EVRRenderModelTextureFormat; + typedef enum EVRNotificationType { EVRNotificationType_Transient = 0, @@ -2233,6 +2246,7 @@ typedef struct RenderModel_TextureMap_t uint16_t unWidth; uint16_t unHeight; uint8_t * rubTextureMapData; // const uint8_t * + enum EVRRenderModelTextureFormat format; } RenderModel_TextureMap_t; #if defined(__linux__) || defined(__APPLE__) diff --git a/third-party/openvr/headers/openvr_driver.h b/third-party/openvr/headers/openvr_driver.h index e2a757c..8982f46 100644 --- a/third-party/openvr/headers/openvr_driver.h +++ b/third-party/openvr/headers/openvr_driver.h @@ -15,8 +15,8 @@ namespace vr { static const uint32_t k_nSteamVRVersionMajor = 1; - static const uint32_t k_nSteamVRVersionMinor = 10; - static const uint32_t k_nSteamVRVersionBuild = 30; + static const uint32_t k_nSteamVRVersionMinor = 11; + static const uint32_t k_nSteamVRVersionBuild = 11; } // namespace vr // vrtypes.h @@ -746,7 +746,7 @@ enum EVREventType //VREvent_DashboardThumbSelected = 504, // Sent to the overlay manager - data is overlay - No longer sent VREvent_DashboardRequested = 505, // Sent to the overlay manager - data is overlay VREvent_ResetDashboard = 506, // Send to the overlay manager - VREvent_RenderToast = 507, // Send to the dashboard to render a toast - data is the notification ID + //VREvent_RenderToast = 507, // Send to the dashboard to render a toast - data is the notification ID -- no longer sent VREvent_ImageLoaded = 508, // Sent to overlays when a SetOverlayRaw or SetOverlayFromFile call finishes loading VREvent_ShowKeyboard = 509, // Sent to keyboard renderer in the dashboard to invoke it VREvent_HideKeyboard = 510, // Sent to keyboard renderer in the dashboard to hide it @@ -816,6 +816,8 @@ enum EVREventType VREvent_LastKnownSectionSettingChanged = 867, VREvent_DismissedWarningsSectionSettingChanged = 868, VREvent_GpuSpeedSectionSettingChanged = 869, + VREvent_WindowsMRSectionSettingChanged = 870, + VREvent_OtherSectionSettingChanged = 871, VREvent_StatusUpdate = 900, @@ -2318,6 +2320,10 @@ namespace vr static const char * const k_pch_Null_SecondsFromVsyncToPhotons_Float = "secondsFromVsyncToPhotons"; static const char * const k_pch_Null_DisplayFrequency_Float = "displayFrequency"; + //----------------------------------------------------------------------------- + // Windows MR keys + static const char * const k_pch_WindowsMR_Section = "driver_holographic"; + //----------------------------------------------------------------------------- // user interface keys static const char * const k_pch_UserInterface_Section = "userinterface"; @@ -2360,6 +2366,7 @@ namespace vr static const char * const k_pch_CollisionBounds_CenterMarkerOn_Bool = "CollisionBoundsCenterMarkerOn"; static const char * const k_pch_CollisionBounds_PlaySpaceOn_Bool = "CollisionBoundsPlaySpaceOn"; static const char * const k_pch_CollisionBounds_FadeDistance_Float = "CollisionBoundsFadeDistance"; + static const char * const k_pch_CollisionBounds_WallHeight_Float = "CollisionBoundsWallHeight"; static const char * const k_pch_CollisionBounds_ColorGammaR_Int32 = "CollisionBoundsColorGammaR"; static const char * const k_pch_CollisionBounds_ColorGammaG_Int32 = "CollisionBoundsColorGammaG"; static const char * const k_pch_CollisionBounds_ColorGammaB_Int32 = "CollisionBoundsColorGammaB"; @@ -2395,6 +2402,8 @@ namespace vr static const char * const k_pch_audio_PlaybackMirrorDevice_String = "playbackMirrorDevice"; static const char * const k_pch_audio_PlaybackMirrorDeviceName_String = "playbackMirrorDeviceName"; static const char * const k_pch_audio_OldPlaybackMirrorDevice_String = "onPlaybackMirrorDevice"; + static const char * const k_pch_audio_ActiveMirrorDevice_String = "activePlaybackMirrorDevice"; + static const char * const k_pch_audio_EnablePlaybackMirrorIndependentVolume_Bool = "enablePlaybackMirrorIndependentVolume"; static const char * const k_pch_audio_LastHmdPlaybackDeviceId_String = "lastHmdPlaybackDeviceId"; static const char * const k_pch_audio_VIVEHDMIGain = "viveHDMIGain"; @@ -2413,7 +2422,6 @@ namespace vr static const char * const k_pch_Dashboard_Section = "dashboard"; static const char * const k_pch_Dashboard_EnableDashboard_Bool = "enableDashboard"; static const char * const k_pch_Dashboard_ArcadeMode_Bool = "arcadeMode"; - static const char * const k_pch_Dashboard_UseWebSettings = "useWebSettings"; static const char * const k_pch_Dashboard_Position = "position"; static const char * const k_pch_Dashboard_DesktopScale = "desktopScale"; static const char * const k_pch_Dashboard_DashboardScale = "dashboardScale"; @@ -2700,8 +2708,11 @@ namespace vr // Projection matrix used to render the depth buffer. vr::HmdMatrix44_t mProjection; + + // Hmd pose used to render this layer. + vr::HmdMatrix34_t mHmdPose; }; - virtual void SubmitLayer( const SubmitLayerPerEye_t( &perEye )[ 2 ], const vr::HmdMatrix34_t *pPose ) {} + virtual void SubmitLayer( const SubmitLayerPerEye_t( &perEye )[ 2 ] ) {} /** Submits queued layers for display. */ virtual void Present( vr::SharedTextureHandle_t syncTexture ) {} @@ -2713,7 +2724,7 @@ namespace vr virtual void GetFrameTiming( DriverDirectMode_FrameTiming *pFrameTiming ) {} }; - static const char *IVRDriverDirectModeComponent_Version = "IVRDriverDirectModeComponent_005"; + static const char *IVRDriverDirectModeComponent_Version = "IVRDriverDirectModeComponent_006"; } diff --git a/third-party/openvr/lib/linux32/libopenvr_api.so b/third-party/openvr/lib/linux32/libopenvr_api.so index 33d0db3..50851bc 100644 Binary files a/third-party/openvr/lib/linux32/libopenvr_api.so and b/third-party/openvr/lib/linux32/libopenvr_api.so differ diff --git a/third-party/openvr/lib/linux64/libopenvr_api.so b/third-party/openvr/lib/linux64/libopenvr_api.so index 94fd0b9..84adf34 100644 Binary files a/third-party/openvr/lib/linux64/libopenvr_api.so and b/third-party/openvr/lib/linux64/libopenvr_api.so differ diff --git a/ver/versioncheck.json b/ver/versioncheck.json index 1f00c03..b01db08 100644 --- a/ver/versioncheck.json +++ b/ver/versioncheck.json @@ -1 +1 @@ -{ "major": 5, "minor": 0, "patch": 2, "updateMessage": "", "optionalMessage": "" } \ No newline at end of file +{ "major": 5, "minor": 1, "patch": 0, "updateMessage": "", "optionalMessage": "" } \ No newline at end of file