diff --git a/src/res/qml/PlayspacePage.qml b/src/res/qml/PlayspacePage.qml index 0b03259..cc29c9a 100644 --- a/src/res/qml/PlayspacePage.qml +++ b/src/res/qml/PlayspacePage.qml @@ -530,11 +530,12 @@ MyStackViewPage { if (MoveCenterTabController.trackingUniverse === 0) { spaceModeText.text = "Sitting" spaceSeatedRecenter.visible = true - offsetsGroupBox.visible = MoveCenterTabController.enableSeatedMotion - rotationGroupBox.visible = MoveCenterTabController.enableSeatedMotion - resetButtonRow.visible = MoveCenterTabController.enableSeatedMotion - profileSection.visible = MoveCenterTabController.enableSeatedMotion - seatedDisableWarningText.visible = !MoveCenterTabController.enableSeatedMotion + var boolEnableSeatedMotion = MoveCenterTabController.enableSeatedMotion + offsetsGroupBox.visible = boolEnableSeatedMotion + rotationGroupBox.visible = boolEnableSeatedMotion + resetButtonRow.visible = boolEnableSeatedMotion + profileSection.visible = boolEnableSeatedMotion + seatedDisableWarningText.visible = !boolEnableSeatedMotion } else if (MoveCenterTabController.trackingUniverse === 1) { spaceModeText.text = "Standing" @@ -570,8 +571,9 @@ MyStackViewPage { spaceRotationSlider.value = ( MoveCenterTabController.rotation / 100 ) } onTempRotationChanged: { - spaceRotationSlider.value = ( MoveCenterTabController.tempRotation / 100 ) - spaceRotationText.text = ( MoveCenterTabController.tempRotation / 100 ) + "°" + var intTempRotation = MoveCenterTabController.tempRotation + spaceRotationSlider.value = ( intTempRotation / 100 ) + spaceRotationText.text = ( intTempRotation / 100 ) + "°" } onAdjustChaperoneChanged: { spaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone @@ -589,22 +591,24 @@ MyStackViewPage { if (MoveCenterTabController.trackingUniverse === 0) { spaceModeText.text = "Sitting" spaceSeatedRecenter.visible = true - offsetsGroupBox.visible = MoveCenterTabController.enableSeatedMotion - rotationGroupBox.visible = MoveCenterTabController.enableSeatedMotion - resetButtonRow.visible = MoveCenterTabController.enableSeatedMotion - profileSection.visible = MoveCenterTabController.enableSeatedMotion - seatedDisableWarningText.visible = !MoveCenterTabController.enableSeatedMotion + var boolEnableSeatedMotion = MoveCenterTabController.enableSeatedMotion + offsetsGroupBox.visible = boolEnableSeatedMotion + rotationGroupBox.visible = boolEnableSeatedMotion + resetButtonRow.visible = boolEnableSeatedMotion + profileSection.visible = boolEnableSeatedMotion + seatedDisableWarningText.visible = !boolEnableSeatedMotion } } onTrackingUniverseChanged: { if (MoveCenterTabController.trackingUniverse === 0) { spaceModeText.text = "Sitting" spaceSeatedRecenter.visible = true - offsetsGroupBox.visible = MoveCenterTabController.enableSeatedMotion - rotationGroupBox.visible = MoveCenterTabController.enableSeatedMotion - resetButtonRow.visible = MoveCenterTabController.enableSeatedMotion - profileSection.visible = MoveCenterTabController.enableSeatedMotion - seatedDisableWarningText.visible = !MoveCenterTabController.enableSeatedMotion + var boolEnableSeatedMotion = MoveCenterTabController.enableSeatedMotion + offsetsGroupBox.visible = boolEnableSeatedMotion + rotationGroupBox.visible = boolEnableSeatedMotion + resetButtonRow.visible = boolEnableSeatedMotion + profileSection.visible = boolEnableSeatedMotion + seatedDisableWarningText.visible = !boolEnableSeatedMotion } else if (MoveCenterTabController.trackingUniverse === 1) { spaceModeText.text = "Standing" spaceSeatedRecenter.visible = false diff --git a/src/res/qml/SettingsPage.qml b/src/res/qml/SettingsPage.qml index 6a15d22..138e5ae 100644 --- a/src/res/qml/SettingsPage.qml +++ b/src/res/qml/SettingsPage.qml @@ -165,6 +165,24 @@ MyStackViewPage { Layout.fillHeight: true } + RowLayout { + Layout.fillWidth: true + // set visible to true here in builds when we need a debug toggle checkbox, otherwise false when on master branch. + visible: false + + Item { + Layout.fillWidth: true + } + + MyToggleButton { + id: debugToggle + text: "Debug" + onCheckedChanged: { + OverlayController.setEnableDebug(checked, true) + } + } + + } Component.onCompleted: { settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled diff --git a/src/tabcontrollers/ChaperoneTabController.cpp b/src/tabcontrollers/ChaperoneTabController.cpp index 5192ef9..e708fcf 100644 --- a/src/tabcontrollers/ChaperoneTabController.cpp +++ b/src/tabcontrollers/ChaperoneTabController.cpp @@ -632,7 +632,7 @@ void ChaperoneTabController::eventLoopTick( if ( m_updateTicksChaperoneReload >= 500 ) { m_updateTicksChaperoneReload = 0; - LOG( WARNING ) << "Attempting to Reloading Chaperone Data"; + LOG( WARNING ) << "Attempting to reload chaperone data"; parent->chaperoneUtils().loadChaperoneData(); } } diff --git a/src/tabcontrollers/MoveCenterTabController.cpp b/src/tabcontrollers/MoveCenterTabController.cpp index b4066a8..bb7d200 100644 --- a/src/tabcontrollers/MoveCenterTabController.cpp +++ b/src/tabcontrollers/MoveCenterTabController.cpp @@ -158,6 +158,11 @@ void MoveCenterTabController::initStage1() { m_enableSeatedMotion = value.toBool(); } + value = settings->value( "simpleRecenter", m_simpleRecenter ); + if ( value.isValid() && !value.isNull() ) + { + m_simpleRecenter = value.toBool(); + } settings->endGroup(); reloadOffsetProfiles(); m_lastDragUpdateTimePoint = std::chrono::steady_clock::now(); @@ -351,6 +356,10 @@ void MoveCenterTabController::outputLogSettings() { LOG( INFO ) << "LOADED SETTINGS: Seated Motion Enabled"; } + if ( m_simpleRecenter ) + { + LOG( INFO ) << "LOADED SETTINGS: Simple Recenter Enabled"; + } if ( m_dragBounds ) { LOG( INFO ) << "LOADED SETTINGS: Space Drag Force Bounds Enabled"; @@ -1207,6 +1216,27 @@ void MoveCenterTabController::setEnableSeatedMotion( bool value, bool notify ) << m_enableSeatedMotion; } +bool MoveCenterTabController::simpleRecenter() const +{ + return m_simpleRecenter; +} + +void MoveCenterTabController::setSimpleRecenter( bool value, bool notify ) +{ + m_simpleRecenter = value; + auto settings = OverlayController::appSettings(); + settings->beginGroup( "playspaceSettings" ); + settings->setValue( "simpleRecenter", m_simpleRecenter ); + settings->endGroup(); + settings->sync(); + if ( notify ) + { + emit simpleRecenterChanged( m_simpleRecenter ); + } + LOG( INFO ) << "CHANGED SETTINGS: Simple Recenter Set: " + << m_simpleRecenter; +} + void MoveCenterTabController::modOffsetX( float value, bool notify ) { if ( !m_lockXToggle ) @@ -1253,7 +1283,18 @@ void MoveCenterTabController::incomingSeatedReset() { if ( m_enableSeatedMotion ) { - updateSeatedResetData(); + // if we didn't send the request from OVRAS, we need to send another + // ResetSeatedZeroPose(). It seems that only after this is sent from + // OVRAS does ReloadFromDisk return valid info on WMR. + if ( !m_selfRequestedSeatedRecenter && !m_simpleRecenter ) + { + m_selfRequestedSeatedRecenter = true; + vr::VRSystem()->ResetSeatedZeroPose(); + } + else + { + updateSeatedResetData(); + } } } @@ -1479,6 +1520,8 @@ void MoveCenterTabController::updateSeatedResetData() emit offsetZChanged( m_offsetZ ); emit rotationChanged( m_rotation ); vr::VRChaperoneSetup()->ReloadFromDisk( vr::EChaperoneConfigFile_Live ); + // done with this recenter, so set self request back to false for next time. + m_selfRequestedSeatedRecenter = false; // set pending update here, will be processed on next instance of motion or // running the reset() function. m_pendingSeatedRecenter = true; diff --git a/src/tabcontrollers/MoveCenterTabController.h b/src/tabcontrollers/MoveCenterTabController.h index af6a4ef..9d3d000 100644 --- a/src/tabcontrollers/MoveCenterTabController.h +++ b/src/tabcontrollers/MoveCenterTabController.h @@ -100,6 +100,8 @@ class MoveCenterTabController : public QObject setUniverseCenteredRotation NOTIFY universeCenteredRotationChanged ) Q_PROPERTY( bool enableSeatedMotion READ enableSeatedMotion WRITE setEnableSeatedMotion NOTIFY enableSeatedMotionChanged ) + Q_PROPERTY( bool simpleRecenter READ simpleRecenter WRITE setSimpleRecenter + NOTIFY simpleRecenterChanged ) private: OverlayController* parent; @@ -136,7 +138,6 @@ private: float m_gravityFloor = 0.0f; float m_gravityStrength = 9.8f; float m_flingStrength = 1.0f; - float m_seatedHeight = 1.0f; bool m_momentumSave = false; bool m_lockXToggle = false; bool m_lockYToggle = false; @@ -175,6 +176,7 @@ private: bool m_chaperoneCommitted = true; bool m_pendingZeroOffsets = true; bool m_pendingSeatedRecenter = false; + bool m_selfRequestedSeatedRecenter = false; bool m_dashWasOpenPreviousFrame = false; bool m_roomSetupModeDetected = false; bool m_seatedModeDetected = false; @@ -183,6 +185,7 @@ private: bool m_oldStyleMotion = false; bool m_universeCenteredRotation = false; bool m_enableSeatedMotion = false; + bool m_simpleRecenter = false; unsigned settingsUpdateCounter = 0; int m_hmdRotationStatsUpdateCounter = 0; unsigned m_dragComfortFrameSkipCounter = 0; @@ -255,6 +258,7 @@ public: bool oldStyleMotion() const; bool universeCenteredRotation() const; bool enableSeatedMotion() const; + bool simpleRecenter() const; bool isInitComplete() const; double getHmdYawTotal(); void resetHmdYawTotal(); @@ -331,6 +335,7 @@ public slots: void setOldStyleMotion( bool value, bool notify = true ); void setUniverseCenteredRotation( bool value, bool notify = true ); void setEnableSeatedMotion( bool value, bool notify = true ); + void setSimpleRecenter( bool value, bool notify = true ); void shutdown(); void reset(); @@ -375,6 +380,7 @@ signals: void oldStyleMotionChanged( bool value ); void universeCenteredRotationChanged( bool value ); void enableSeatedMotionChanged( bool value ); + void simpleRecenterChanged( bool value ); void offsetProfilesUpdated(); };