Skip to content

Commit

Permalink
Chaperone Movement Fix 1.26.3 steamvr (#630)
Browse files Browse the repository at this point in the history
* fix chaperone move behavior for 1.26.x of open/steamvr fix a ui error with a warning on old app and external chaperone

---------

Co-authored-by: Chelsea Jaggi <feilen1000@gmail.com>
  • Loading branch information
ykeara and feilen authored Jun 28, 2023
1 parent b3c3659 commit f095d2d
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 25 deletions.
2 changes: 1 addition & 1 deletion build_scripts/compile_version_string.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.7.1-release
5.7.2-release
40 changes: 26 additions & 14 deletions src/res/qml/SettingsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,21 @@ MyStackViewPage {
seatedOldExternalWarning.visible = MoveCenterTabController.allowExternalEdits && checked
}
}
RowLayout{

MyText {
id: seatedOldExternalWarning
wrapMode: Text.WordWrap
font.pointSize: 20
color: "#FFA500"
text: "WARNING: 'Allow External App Chaperone Edits' + 'Old-Style Motion' + 'Enable Motion Features When in Seated Mode' active together may cause space center misalignment. Load the «Autosaved Profile» in the 'Chaperone' tab to fix."
horizontalAlignment: Text.AlignHCenter
Layout.leftMargin: 20
Layout.rightMargin: 20
Layout.preferredWidth: 900
//Layout.fillWidth: true
}
}

MyToggleButton {
id: universeCenteredRotationToggle
Expand Down Expand Up @@ -198,6 +213,13 @@ MyStackViewPage {
OverlayController.setExclusiveInputEnabled(this.checked, true)
}
}
MyToggleButton {
id: spaceAdjustChaperoneToggle
text: "Adjust Chaperone"
onCheckedChanged: {
MoveCenterTabController.adjustChaperone = this.checked
}
}

RowLayout {
Layout.fillWidth: true
Expand Down Expand Up @@ -286,20 +308,6 @@ MyStackViewPage {
Layout.fillWidth: true
}
}
RowLayout{

MyText {
id: seatedOldExternalWarning
wrapMode: Text.WordWrap
font.pointSize: 20
color: "#FFA500"
text: "WARNING: 'Allow External App Chaperone Edits' + 'Old-Style Motion' + 'Enable Motion Features When in Seated Mode' active together may cause space center misalignment. Load the «Autosaved Profile» in the 'Chaperone' tab to fix."
horizontalAlignment: Text.AlignHCenter
Layout.leftMargin: 20
Layout.rightMargin: 20
Layout.fillWidth: true
}
}
RowLayout{
Item {
Layout.fillWidth: true
Expand Down Expand Up @@ -358,6 +366,7 @@ MyStackViewPage {
oculusSdkToggleButton.checked = SettingsTabController.oculusSdkToggle
exclusiveInputToggleButton.checked = OverlayController.exclusiveInputEnabled
autoApplyChaperoneToggleButton.checked = OverlayController.autoApplyChaperoneEnabled
spaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone


seatedOldExternalWarning.visible = MoveCenterTabController.allowExternalEdits && MoveCenterTabController.oldStyleMotion
Expand Down Expand Up @@ -391,6 +400,9 @@ MyStackViewPage {
onUniverseCenteredRotationChanged: {
universeCenteredRotationToggle.checked = MoveCenterTabController.universeCenteredRotation
}
onAdjustChaperoneChanged:{
spaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone
}
}

Connections {
Expand Down
4 changes: 4 additions & 0 deletions src/settings/internal/settings_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ class SettingsController
SettingCategory::Playspace,
QtInfo{ "enableUncalMotion" },
false },
BoolSettingValue{ BoolSetting::PLAYSPACE_adjustChaperone3,
SettingCategory::Playspace,
QtInfo{ "adjustChaperone3" },
true },

BoolSettingValue{ BoolSetting::APPLICATION_disableVersionCheck,
SettingCategory::Application,
Expand Down
1 change: 1 addition & 0 deletions src/settings/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ enum class BoolSetting
PLAYSPACE_simpleRecenter,
PLAYSPACE_adjustChaperone2,
PLAYSPACE_enableUncalMotion,
PLAYSPACE_adjustChaperone3,

APPLICATION_disableVersionCheck,
APPLICATION_previousShutdownSafe,
Expand Down
26 changes: 16 additions & 10 deletions src/tabcontrollers/MoveCenterTabController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,12 @@ void MoveCenterTabController::setFrictionPercent( int value, bool notify )
bool MoveCenterTabController::adjustChaperone() const
{
return settings::getSetting(
settings::BoolSetting::PLAYSPACE_adjustChaperone2 );
settings::BoolSetting::PLAYSPACE_adjustChaperone3 );
}

void MoveCenterTabController::setAdjustChaperone( bool value, bool notify )
{
settings::setSetting( settings::BoolSetting::PLAYSPACE_adjustChaperone2,
settings::setSetting( settings::BoolSetting::PLAYSPACE_adjustChaperone3,
value );

if ( notify )
Expand Down Expand Up @@ -2767,9 +2767,14 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )

// As of SVR 1.13.1 The Chaperone will follow Universe Center NOT raw
// Center as such this should be off by defualt.
// As of SVR 1.26.3 The chaperone seems to Have reverted back to pre 1.13.1
// behavior
// as of SVR 1.26.3 instead of 2x offset we have 1x offset and universe
// centerS

if ( adjustChaperone() )
{
// outputLogPoses();
// make a copy of our bounds and
// reorient relative to new universe center

Expand Down Expand Up @@ -2798,21 +2803,22 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
// original origin
updatedBounds[quad].vCorners[corner].v[0]
-= offsetUniverseCenter.m[0][3]
- offsetUniverseCenter.m[0][3];
//- m_universeCenterForReset.m[0][3];
// but don't touch y=0 values to keep floor corners rooted
// down
// - offsetUniverseCenter.m[0][3];
- m_universeCenterForReset.m[0][3];
// but don't touch y=0 values to keep floor corners
// rooted down

if ( updatedBounds[quad].vCorners[corner].v[1] != 0 )
{
updatedBounds[quad].vCorners[corner].v[1]
-= offsetUniverseCenter.m[1][3]
- offsetUniverseCenter.m[1][3];
//- m_universeCenterForReset.m[1][3];
//- offsetUniverseCenter.m[1][3];
- m_universeCenterForReset.m[1][3];
}
updatedBounds[quad].vCorners[corner].v[2]
-= offsetUniverseCenter.m[2][3]
- offsetUniverseCenter.m[2][3];
//- m_universeCenterForReset.m[2][3];
// - offsetUniverseCenter.m[2][3];
- m_universeCenterForReset.m[2][3];

// rotate by universe center's yaw
rotateFloatCoordinates(
Expand Down

0 comments on commit f095d2d

Please sign in to comment.