Swap default to unchecked enable seated motion and add debug states
This commit is contained in:
@@ -159,10 +159,10 @@ void MoveCenterTabController::initStage1()
|
||||
{
|
||||
m_enableSeatedOffsetsRecenter = value.toBool();
|
||||
}
|
||||
value = settings->value( "disableSeatedMotion", m_disableSeatedMotion );
|
||||
value = settings->value( "enableSeatedMotion", m_enableSeatedMotion );
|
||||
if ( value.isValid() && !value.isNull() )
|
||||
{
|
||||
m_disableSeatedMotion = value.toBool();
|
||||
m_enableSeatedMotion = value.toBool();
|
||||
}
|
||||
settings->endGroup();
|
||||
reloadOffsetProfiles();
|
||||
@@ -357,9 +357,9 @@ void MoveCenterTabController::outputLogSettings()
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: Seated Offsets Recenter Enabled";
|
||||
}
|
||||
if ( m_disableSeatedMotion )
|
||||
if ( m_enableSeatedMotion )
|
||||
{
|
||||
LOG( INFO ) << "LOADED SETTINGS: Seated Motion Disabled";
|
||||
LOG( INFO ) << "LOADED SETTINGS: Seated Motion Enabled";
|
||||
}
|
||||
if ( m_dragBounds )
|
||||
{
|
||||
@@ -1220,25 +1220,25 @@ bool MoveCenterTabController::isInitComplete() const
|
||||
return m_initComplete;
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::disableSeatedMotion() const
|
||||
bool MoveCenterTabController::enableSeatedMotion() const
|
||||
{
|
||||
return m_disableSeatedMotion;
|
||||
return m_enableSeatedMotion;
|
||||
}
|
||||
|
||||
void MoveCenterTabController::setDisableSeatedMotion( bool value, bool notify )
|
||||
void MoveCenterTabController::setEnableSeatedMotion( bool value, bool notify )
|
||||
{
|
||||
m_disableSeatedMotion = value;
|
||||
m_enableSeatedMotion = value;
|
||||
auto settings = OverlayController::appSettings();
|
||||
settings->beginGroup( "playspaceSettings" );
|
||||
settings->setValue( "disableSeatedMotion", m_disableSeatedMotion );
|
||||
settings->setValue( "enableSeatedMotion", m_enableSeatedMotion );
|
||||
settings->endGroup();
|
||||
settings->sync();
|
||||
if ( notify )
|
||||
{
|
||||
emit disableSeatedMotionChanged( m_disableSeatedMotion );
|
||||
emit enableSeatedMotionChanged( m_enableSeatedMotion );
|
||||
}
|
||||
LOG( INFO ) << "CHANGED SETTINGS: Disable Seated Motion Set: "
|
||||
<< m_disableSeatedMotion;
|
||||
LOG( INFO ) << "CHANGED SETTINGS: Enable Seated Motion Set: "
|
||||
<< m_enableSeatedMotion;
|
||||
}
|
||||
|
||||
void MoveCenterTabController::modOffsetX( float value, bool notify )
|
||||
@@ -1285,7 +1285,12 @@ void MoveCenterTabController::shutdown()
|
||||
|
||||
void MoveCenterTabController::incomingSeatedReset()
|
||||
{
|
||||
if ( !m_disableSeatedMotion )
|
||||
if ( parent->enableDebug() && parent->debugState() == 2 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_enableSeatedMotion )
|
||||
{
|
||||
updateSeatedResetData();
|
||||
}
|
||||
@@ -1487,7 +1492,10 @@ void MoveCenterTabController::clampVelocity( double* velocity )
|
||||
|
||||
void MoveCenterTabController::updateSeatedResetData()
|
||||
{
|
||||
reset();
|
||||
if ( !( parent->enableDebug() && parent->debugState() == 1 ) )
|
||||
{
|
||||
reset();
|
||||
}
|
||||
vr::VRChaperoneSetup()->RevertWorkingCopy();
|
||||
vr::TrackedDevicePose_t devicePosesStanding[vr::k_unMaxTrackedDeviceCount];
|
||||
vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(
|
||||
@@ -1527,6 +1535,38 @@ void MoveCenterTabController::updateSeatedResetData()
|
||||
emit rotationChanged( m_rotation );
|
||||
}
|
||||
|
||||
if ( parent->enableDebug() )
|
||||
{
|
||||
switch ( parent->debugState() )
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(
|
||||
&m_seatedCenterForReset );
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
vr::VRChaperoneSetup()->GetWorkingSeatedZeroPoseToRawTrackingPose(
|
||||
&m_seatedCenterForReset );
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
vr::VRChaperoneSetup()->GetLiveSeatedZeroPoseToRawTrackingPose(
|
||||
&m_seatedCenterForReset );
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
m_seatedCenterForReset
|
||||
= vr::VRSystem()
|
||||
->GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned checkQuadCount = 0;
|
||||
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo( nullptr,
|
||||
&checkQuadCount );
|
||||
@@ -3030,10 +3070,6 @@ void MoveCenterTabController::eventLoopTick(
|
||||
// m_roomSetupModeDetected is set to false in zeroOffsets() if it's
|
||||
// successful.
|
||||
}
|
||||
else if ( m_seatedModeDetected && m_disableSeatedMotion )
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
setTrackingUniverse( int( universe ) );
|
||||
@@ -3054,6 +3090,13 @@ void MoveCenterTabController::eventLoopTick(
|
||||
m_hmdRotationStatsUpdateCounter++;
|
||||
}
|
||||
|
||||
// stop everything before processing motion if we're in seated mode and
|
||||
// don't have seated motion enabled
|
||||
if ( m_seatedModeDetected && !m_enableSeatedMotion )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// only update dynamic motion if the dash is closed
|
||||
if ( !parent->isDashboardVisible() )
|
||||
{
|
||||
|
||||
@@ -102,8 +102,8 @@ class MoveCenterTabController : public QObject
|
||||
bool enableSeatedOffsetsRecenter READ enableSeatedOffsetsRecenter WRITE
|
||||
setEnableSeatedOffsetsRecenter NOTIFY
|
||||
enableSeatedOffsetsRecenterChanged )
|
||||
Q_PROPERTY( bool disableSeatedMotion READ disableSeatedMotion WRITE
|
||||
setDisableSeatedMotion NOTIFY disableSeatedMotionChanged )
|
||||
Q_PROPERTY( bool enableSeatedMotion READ enableSeatedMotion WRITE
|
||||
setEnableSeatedMotion NOTIFY enableSeatedMotionChanged )
|
||||
|
||||
private:
|
||||
OverlayController* parent;
|
||||
@@ -186,7 +186,7 @@ private:
|
||||
bool m_oldStyleMotion = false;
|
||||
bool m_universeCenteredRotation = false;
|
||||
bool m_enableSeatedOffsetsRecenter = false;
|
||||
bool m_disableSeatedMotion = false;
|
||||
bool m_enableSeatedMotion = false;
|
||||
unsigned settingsUpdateCounter = 0;
|
||||
int m_hmdRotationStatsUpdateCounter = 0;
|
||||
unsigned m_dragComfortFrameSkipCounter = 0;
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
bool oldStyleMotion() const;
|
||||
bool universeCenteredRotation() const;
|
||||
bool enableSeatedOffsetsRecenter() const;
|
||||
bool disableSeatedMotion() const;
|
||||
bool enableSeatedMotion() const;
|
||||
bool isInitComplete() const;
|
||||
double getHmdYawTotal();
|
||||
void resetHmdYawTotal();
|
||||
@@ -333,7 +333,7 @@ public slots:
|
||||
void setOldStyleMotion( bool value, bool notify = true );
|
||||
void setUniverseCenteredRotation( bool value, bool notify = true );
|
||||
void setEnableSeatedOffsetsRecenter( bool value, bool notify = true );
|
||||
void setDisableSeatedMotion( bool value, bool notify = true );
|
||||
void setEnableSeatedMotion( bool value, bool notify = true );
|
||||
|
||||
void shutdown();
|
||||
void reset();
|
||||
@@ -377,7 +377,7 @@ signals:
|
||||
void oldStyleMotionChanged( bool value );
|
||||
void universeCenteredRotationChanged( bool value );
|
||||
void enableSeatedOffsetsRecenterChanged( bool value );
|
||||
void disableSeatedMotionChanged( bool value );
|
||||
void enableSeatedMotionChanged( bool value );
|
||||
|
||||
void offsetProfilesUpdated();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user