Merge pull request #176 from OpenVR-Advanced-Settings/alpha-kung
Settings Tab Option: Old-Style Motion
This commit is contained in:
@@ -378,6 +378,7 @@ Allows users to temporarily move and rotate the center of the playspace. This al
|
||||
- **Autostart:** Allows you to enable/disable auto start.
|
||||
- **Force Revive Page:** No Longer Supported Does Nothing.
|
||||
- **Allow External App Chaperone Edits:** Incorporates changes to the chaperone and universe center made by other applications. These changes could come from anywhere, including apps with unpredictable interactions with Advanced Settings. Therefore, this option opens the potential for chaperone misalignment or corruption. However it also allows other chaperone tweaking tools to function in tandem with Advanced Settings. **This option should only be checked if required for compatibility with other apps.** *Note: Changes will only take effect when offsets and rotation are all zero.*
|
||||
- **Old-Style Motion:** Uses the old system of writing the chaperone universe center and bounds to disk every frame. Use this option only if you experience issues with playspace motion such as snapping back to reset position after releasing a space-drag. This old mode is smooth on most systems but is in theory less performant than the normal method.
|
||||
|
||||
<a name="how_to_compile"></a>
|
||||
# How to Compile
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 57 KiB |
@@ -34,6 +34,14 @@ MyStackViewPage {
|
||||
}
|
||||
}
|
||||
|
||||
MyToggleButton {
|
||||
id: oldStyleMotionToggle
|
||||
text: "Old-Style Motion (per-frame disk writes)"
|
||||
onCheckedChanged: {
|
||||
MoveCenterTabController.setOldStyleMotion(checked, true)
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
@@ -42,6 +50,7 @@ MyStackViewPage {
|
||||
settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled
|
||||
forceReviveToggle.checked = SettingsTabController.forceRevivePage
|
||||
allowExternalEditsToggle.checked = MoveCenterTabController.allowExternalEdits
|
||||
oldStyleMotionToggle.checked = MoveCenterTabController.oldStyleMotion
|
||||
}
|
||||
|
||||
Connections {
|
||||
@@ -59,6 +68,9 @@ MyStackViewPage {
|
||||
onAllowExternalEditsChanged: {
|
||||
allowExternalEditsToggle.checked = MoveCenterTabController.allowExternalEdits
|
||||
}
|
||||
onOldStyleMotionChanged: {
|
||||
oldStyleMotionToggle.checked = MoveCenterTabController.oldStyleMotion
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,11 @@ void MoveCenterTabController::initStage1()
|
||||
{
|
||||
m_allowExternalEdits = value.toBool();
|
||||
}
|
||||
value = settings->value( "oldStyleMotion", m_oldStyleMotion );
|
||||
if ( value.isValid() && !value.isNull() )
|
||||
{
|
||||
m_oldStyleMotion = value.toBool();
|
||||
}
|
||||
settings->endGroup();
|
||||
m_lastDragUpdateTimePoint = std::chrono::steady_clock::now();
|
||||
m_lastGravityUpdateTimePoint = std::chrono::steady_clock::now();
|
||||
@@ -139,6 +144,61 @@ void MoveCenterTabController::initStage2( OverlayController* var_parent,
|
||||
this->parent = var_parent;
|
||||
this->widget = var_widget;
|
||||
zeroOffsets();
|
||||
outputLogSettings();
|
||||
}
|
||||
|
||||
void MoveCenterTabController::outputLogSettings()
|
||||
{
|
||||
if ( !m_adjustChaperone )
|
||||
{
|
||||
LOG( WARNING ) << "LOADED SETTINGS: Adjust Chaperone DISABLED";
|
||||
}
|
||||
if ( m_settingsRightHandDragEnabled )
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: Right Hand Space-Drag Bind Enabled";
|
||||
}
|
||||
if ( m_settingsLeftHandDragEnabled )
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: Left Hand Space-Drag Bind Enabled";
|
||||
}
|
||||
if ( m_settingsRightHandTurnEnabled )
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: Right Hand Space-Turn Bind Enabled";
|
||||
}
|
||||
if ( m_settingsLeftHandTurnEnabled )
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: Left Hand Space-Turn Bind Enabled";
|
||||
}
|
||||
if ( m_dragComfortFactor > 0 )
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: Space-Drag Comfort Factor = "
|
||||
<< m_dragComfortFactor;
|
||||
}
|
||||
if ( m_turnComfortFactor > 0 )
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: Space-Turn Comfort Factor = "
|
||||
<< m_turnComfortFactor;
|
||||
}
|
||||
if ( m_lockXToggle )
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: X Axis Locked";
|
||||
}
|
||||
if ( m_lockYToggle )
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: Y Axis Locked";
|
||||
}
|
||||
if ( m_lockZToggle )
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: Z Axis Locked";
|
||||
}
|
||||
if ( m_allowExternalEdits )
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: Allow External Edits Enabled";
|
||||
}
|
||||
if ( m_oldStyleMotion )
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: Old-Style Motion Enabled";
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCenterTabController::outputLogPoses()
|
||||
@@ -263,6 +323,7 @@ void MoveCenterTabController::setTrackingUniverse( int value, bool notify )
|
||||
if ( notify )
|
||||
{
|
||||
emit trackingUniverseChanged( m_trackingUniverse );
|
||||
LOG( INFO ) << "Tracking Universe: " << m_trackingUniverse;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -434,6 +495,15 @@ void MoveCenterTabController::setAdjustChaperone( bool value, bool notify )
|
||||
{
|
||||
emit adjustChaperoneChanged( m_adjustChaperone );
|
||||
}
|
||||
if ( !m_adjustChaperone )
|
||||
{
|
||||
LOG( WARNING ) << "CHANGED SETTINGS: Adjust Chaperone DISABLED";
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG( INFO ) << "CHANGED SETTINGS: Adjust Chaperone Set: "
|
||||
<< m_adjustChaperone;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,6 +524,8 @@ void MoveCenterTabController::setMoveShortcutRight( bool value, bool notify )
|
||||
{
|
||||
emit moveShortcutRightChanged( m_settingsRightHandDragEnabled );
|
||||
}
|
||||
LOG( INFO ) << "CHANGED SETTINGS: Right Hand Space-Drag Bind Enable Set: "
|
||||
<< m_settingsRightHandDragEnabled;
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::moveShortcutLeft() const
|
||||
@@ -473,6 +545,8 @@ void MoveCenterTabController::setMoveShortcutLeft( bool value, bool notify )
|
||||
{
|
||||
emit moveShortcutLeftChanged( m_settingsLeftHandDragEnabled );
|
||||
}
|
||||
LOG( INFO ) << "CHANGED SETTINGS: Left Hand Space-Drag Bind Enable Set: "
|
||||
<< m_settingsLeftHandDragEnabled;
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::turnBindLeft() const
|
||||
@@ -492,6 +566,8 @@ void MoveCenterTabController::setTurnBindLeft( bool value, bool notify )
|
||||
{
|
||||
emit turnBindLeftChanged( m_settingsLeftHandTurnEnabled );
|
||||
}
|
||||
LOG( INFO ) << "CHANGED SETTINGS: Left Hand Space-Turn Bind Enable Set: "
|
||||
<< m_settingsLeftHandTurnEnabled;
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::turnBindRight() const
|
||||
@@ -511,6 +587,8 @@ void MoveCenterTabController::setTurnBindRight( bool value, bool notify )
|
||||
{
|
||||
emit turnBindRightChanged( m_settingsRightHandTurnEnabled );
|
||||
}
|
||||
LOG( INFO ) << "CHANGED SETTINGS: Right Hand Space-Turn Bind Enable Set: "
|
||||
<< m_settingsRightHandTurnEnabled;
|
||||
}
|
||||
|
||||
unsigned MoveCenterTabController::dragComfortFactor() const
|
||||
@@ -795,6 +873,35 @@ void MoveCenterTabController::setAllowExternalEdits( bool value, bool notify )
|
||||
{
|
||||
emit allowExternalEditsChanged( m_allowExternalEdits );
|
||||
}
|
||||
LOG( INFO ) << "CHANGED SETTINGS: Allow External Edits Set: "
|
||||
<< m_allowExternalEdits;
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::oldStyleMotion() const
|
||||
{
|
||||
return m_oldStyleMotion;
|
||||
}
|
||||
|
||||
void MoveCenterTabController::setOldStyleMotion( bool value, bool notify )
|
||||
{
|
||||
// detect incoming change to old style, and hide working set
|
||||
if ( value && !m_oldStyleMotion )
|
||||
{
|
||||
vr::VRChaperoneSetup()->HideWorkingSetPreview();
|
||||
}
|
||||
|
||||
m_oldStyleMotion = value;
|
||||
auto settings = OverlayController::appSettings();
|
||||
settings->beginGroup( "playspaceSettings" );
|
||||
settings->setValue( "oldStyleMotion", m_oldStyleMotion );
|
||||
settings->endGroup();
|
||||
settings->sync();
|
||||
if ( notify )
|
||||
{
|
||||
emit oldStyleMotionChanged( m_oldStyleMotion );
|
||||
}
|
||||
LOG( INFO ) << "CHANGED SETTINGS: Old-Style Motion Set: "
|
||||
<< m_oldStyleMotion;
|
||||
}
|
||||
|
||||
void MoveCenterTabController::modOffsetX( float value, bool notify )
|
||||
@@ -2259,8 +2366,17 @@ void MoveCenterTabController::updateSpace()
|
||||
vr::VRChaperoneSetup()->SetWorkingStandingZeroPoseToRawTrackingPose(
|
||||
&offsetUniverseCenter );
|
||||
|
||||
vr::VRChaperoneSetup()->ShowWorkingSetPreview();
|
||||
m_chaperoneCommitted = false;
|
||||
if ( m_oldStyleMotion )
|
||||
{
|
||||
vr::VRChaperoneSetup()->CommitWorkingCopy(
|
||||
vr::EChaperoneConfigFile_Live );
|
||||
m_chaperoneCommitted = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
vr::VRChaperoneSetup()->ShowWorkingSetPreview();
|
||||
m_chaperoneCommitted = false;
|
||||
}
|
||||
|
||||
// loadChaperoneData( false ), false so that we don't load live data, and
|
||||
// reference the working set instead.
|
||||
|
||||
@@ -73,6 +73,8 @@ class MoveCenterTabController : public QObject
|
||||
setShowLogMatricesButton NOTIFY showLogMatricesButtonChanged )
|
||||
Q_PROPERTY( bool allowExternalEdits READ allowExternalEdits WRITE
|
||||
setAllowExternalEdits NOTIFY allowExternalEditsChanged )
|
||||
Q_PROPERTY( bool oldStyleMotion READ oldStyleMotion WRITE setOldStyleMotion
|
||||
NOTIFY oldStyleMotionChanged )
|
||||
|
||||
private:
|
||||
OverlayController* parent;
|
||||
@@ -148,6 +150,7 @@ private:
|
||||
bool m_seatedModeDetected = false;
|
||||
bool m_showLogMatricesButton = false;
|
||||
bool m_allowExternalEdits = false;
|
||||
bool m_oldStyleMotion = false;
|
||||
unsigned settingsUpdateCounter = 0;
|
||||
int m_hmdRotationStatsUpdateCounter = 0;
|
||||
unsigned m_dragComfortFrameSkipCounter = 0;
|
||||
@@ -172,6 +175,7 @@ private:
|
||||
void applyChaperoneResetData();
|
||||
void saveUncommittedChaperone();
|
||||
void outputLogHmdMatrix( vr::HmdMatrix34_t hmdMatrix );
|
||||
void outputLogSettings();
|
||||
|
||||
public:
|
||||
void initStage1();
|
||||
@@ -204,6 +208,7 @@ public:
|
||||
bool lockZToggle() const;
|
||||
bool showLogMatricesButton() const;
|
||||
bool allowExternalEdits() const;
|
||||
bool oldStyleMotion() const;
|
||||
double getHmdYawTotal();
|
||||
void resetHmdYawTotal();
|
||||
void incomingSeatedReset();
|
||||
@@ -264,6 +269,7 @@ public slots:
|
||||
void setLockZ( bool value, bool notify = true );
|
||||
void setShowLogMatricesButton( bool value, bool notify = true );
|
||||
void setAllowExternalEdits( bool value, bool notify = true );
|
||||
void setOldStyleMotion( bool value, bool notify = true );
|
||||
|
||||
void shutdown();
|
||||
void reset();
|
||||
@@ -297,6 +303,7 @@ signals:
|
||||
void requireLockZChanged( bool value );
|
||||
void showLogMatricesButtonChanged( bool value );
|
||||
void allowExternalEditsChanged( bool value );
|
||||
void oldStyleMotionChanged( bool value );
|
||||
};
|
||||
|
||||
} // namespace advsettings
|
||||
|
||||
Reference in New Issue
Block a user