Convert m_turnComfortFactor to new settings API
This commit is contained in:
@@ -39,9 +39,6 @@ namespace advsettings
|
|||||||
{
|
{
|
||||||
void MoveCenterTabController::initStage1()
|
void MoveCenterTabController::initStage1()
|
||||||
{
|
{
|
||||||
m_turnComfortFactor = static_cast<unsigned int>( settings::getSetting(
|
|
||||||
settings::IntSetting::PLAYSPACE_turnComfortFactor ) );
|
|
||||||
|
|
||||||
m_heightToggleOffset = static_cast<float>( settings::getSetting(
|
m_heightToggleOffset = static_cast<float>( settings::getSetting(
|
||||||
settings::DoubleSetting::PLAYSPACE_heightToggleOffset ) );
|
settings::DoubleSetting::PLAYSPACE_heightToggleOffset ) );
|
||||||
m_gravityStrength = static_cast<float>( settings::getSetting(
|
m_gravityStrength = static_cast<float>( settings::getSetting(
|
||||||
@@ -631,23 +628,20 @@ void MoveCenterTabController::setDragComfortFactor( int value, bool notify )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned MoveCenterTabController::turnComfortFactor() const
|
int MoveCenterTabController::turnComfortFactor() const
|
||||||
{
|
{
|
||||||
return m_turnComfortFactor;
|
return settings::getSetting(
|
||||||
|
settings::IntSetting::PLAYSPACE_turnComfortFactor );
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveCenterTabController::setTurnComfortFactor( unsigned value,
|
void MoveCenterTabController::setTurnComfortFactor( int value, bool notify )
|
||||||
bool notify )
|
|
||||||
{
|
{
|
||||||
m_turnComfortFactor = value;
|
settings::setSetting( settings::IntSetting::PLAYSPACE_turnComfortFactor,
|
||||||
auto settings = OverlayController::appSettings();
|
value );
|
||||||
settings->beginGroup( "playspaceSettings" );
|
|
||||||
settings->setValue( "turnComfortFactor", m_turnComfortFactor );
|
|
||||||
settings->endGroup();
|
|
||||||
settings->sync();
|
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
emit turnComfortFactorChanged( m_turnComfortFactor );
|
emit turnComfortFactorChanged( value );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2912,8 +2906,8 @@ void MoveCenterTabController::eventLoopTick(
|
|||||||
// Smooth turn motion can cause sim-sickness so we check if the user
|
// Smooth turn motion can cause sim-sickness so we check if the user
|
||||||
// wants to skip frames to reduce vection. We use the factor squared
|
// wants to skip frames to reduce vection. We use the factor squared
|
||||||
// because of logarithmic human perception.
|
// because of logarithmic human perception.
|
||||||
if ( m_turnComfortFrameSkipCounter
|
if ( m_turnComfortFrameSkipCounter >= static_cast<unsigned>(
|
||||||
>= ( m_turnComfortFactor * m_turnComfortFactor ) )
|
( turnComfortFactor() * turnComfortFactor() ) ) )
|
||||||
{
|
{
|
||||||
updateHandTurn( devicePoses, angle );
|
updateHandTurn( devicePoses, angle );
|
||||||
m_turnComfortFrameSkipCounter = 0;
|
m_turnComfortFrameSkipCounter = 0;
|
||||||
|
|||||||
@@ -123,7 +123,6 @@ private:
|
|||||||
bool m_moveShortcutLeftPressed = false;
|
bool m_moveShortcutLeftPressed = false;
|
||||||
vr::TrackedDeviceIndex_t m_activeMoveController;
|
vr::TrackedDeviceIndex_t m_activeMoveController;
|
||||||
float m_lastControllerPosition[3];
|
float m_lastControllerPosition[3];
|
||||||
unsigned m_turnComfortFactor = 0;
|
|
||||||
bool m_heightToggle = false;
|
bool m_heightToggle = false;
|
||||||
float m_heightToggleOffset = -1.0f;
|
float m_heightToggleOffset = -1.0f;
|
||||||
float m_gravityFloor = 0.0f;
|
float m_gravityFloor = 0.0f;
|
||||||
@@ -226,7 +225,7 @@ public:
|
|||||||
bool dragBounds() const;
|
bool dragBounds() const;
|
||||||
bool turnBounds() const;
|
bool turnBounds() const;
|
||||||
int dragComfortFactor() const;
|
int dragComfortFactor() const;
|
||||||
unsigned turnComfortFactor() const;
|
int turnComfortFactor() const;
|
||||||
bool heightToggle() const;
|
bool heightToggle() const;
|
||||||
float heightToggleOffset() const;
|
float heightToggleOffset() const;
|
||||||
float gravityStrength() const;
|
float gravityStrength() const;
|
||||||
@@ -296,7 +295,7 @@ public slots:
|
|||||||
void setTurnBindRight( bool value, bool notify = true );
|
void setTurnBindRight( bool value, bool notify = true );
|
||||||
void setTurnBindLeft( bool value, bool notify = true );
|
void setTurnBindLeft( bool value, bool notify = true );
|
||||||
void setDragComfortFactor( int value, bool notify = true );
|
void setDragComfortFactor( int value, bool notify = true );
|
||||||
void setTurnComfortFactor( unsigned value, bool notify = true );
|
void setTurnComfortFactor( int value, bool notify = true );
|
||||||
void setDragBounds( bool value, bool notify = true );
|
void setDragBounds( bool value, bool notify = true );
|
||||||
void setTurnBounds( bool value, bool notify = true );
|
void setTurnBounds( bool value, bool notify = true );
|
||||||
void setHeightToggle( bool value, bool notify = true );
|
void setHeightToggle( bool value, bool notify = true );
|
||||||
@@ -348,7 +347,7 @@ signals:
|
|||||||
void dragBoundsChanged( bool value );
|
void dragBoundsChanged( bool value );
|
||||||
void turnBoundsChanged( bool value );
|
void turnBoundsChanged( bool value );
|
||||||
void dragComfortFactorChanged( int value );
|
void dragComfortFactorChanged( int value );
|
||||||
void turnComfortFactorChanged( unsigned value );
|
void turnComfortFactorChanged( int value );
|
||||||
void heightToggleChanged( bool value );
|
void heightToggleChanged( bool value );
|
||||||
void heightToggleOffsetChanged( float value );
|
void heightToggleOffsetChanged( float value );
|
||||||
void gravityStrengthChanged( float value );
|
void gravityStrengthChanged( float value );
|
||||||
|
|||||||
Reference in New Issue
Block a user