Apply fix for reset button rotation from alpha-kung branch
This commit is contained in:
@@ -136,13 +136,20 @@ int MoveCenterTabController::rotation() const
|
||||
return m_rotation;
|
||||
}
|
||||
|
||||
int MoveCenterTabController::tempRotation() const
|
||||
{
|
||||
return m_tempRotation;
|
||||
}
|
||||
|
||||
void MoveCenterTabController::setRotation( int value, bool notify )
|
||||
{
|
||||
if ( m_rotation != value )
|
||||
{
|
||||
// float angle = (value - m_rotation) * 2 * M_PI / 360.0;
|
||||
// parent->RotateUniverseCenter((vr::TrackingUniverseOrigin)m_trackingUniverse,
|
||||
// angle, m_adjustChaperone);
|
||||
float angle = ( value - m_rotation ) * 2 * M_PI / 360.0;
|
||||
parent->RotateUniverseCenter(
|
||||
( vr::TrackingUniverseOrigin ) m_trackingUniverse,
|
||||
angle,
|
||||
m_adjustChaperone );
|
||||
m_rotation = value;
|
||||
if ( notify )
|
||||
{
|
||||
@@ -151,6 +158,15 @@ void MoveCenterTabController::setRotation( int value, bool notify )
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCenterTabController::setTempRotation( int value, bool notify )
|
||||
{
|
||||
m_tempRotation = value;
|
||||
if ( notify )
|
||||
{
|
||||
emit tempRotationChanged( m_tempRotation );
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCenterTabController::applyRotation()
|
||||
{
|
||||
if ( m_rotation != m_rotationOld )
|
||||
|
||||
@@ -25,6 +25,8 @@ class MoveCenterTabController : public QObject
|
||||
float offsetZ READ offsetZ WRITE setOffsetZ NOTIFY offsetZChanged )
|
||||
Q_PROPERTY(
|
||||
int rotation READ rotation WRITE setRotation NOTIFY rotationChanged )
|
||||
Q_PROPERTY( int tempRotation READ tempRotation WRITE setTempRotation NOTIFY
|
||||
tempRotationChanged )
|
||||
Q_PROPERTY( bool adjustChaperone READ adjustChaperone WRITE
|
||||
setAdjustChaperone NOTIFY adjustChaperoneChanged )
|
||||
Q_PROPERTY( bool moveShortcutRight READ moveShortcutRight WRITE
|
||||
@@ -49,6 +51,7 @@ private:
|
||||
float m_offsetY = 0.0f;
|
||||
float m_offsetZ = 0.0f;
|
||||
int m_rotation = 0;
|
||||
int m_tempRotation = 0;
|
||||
int m_rotationOld = 0;
|
||||
bool m_adjustChaperone = true;
|
||||
bool m_moveShortcutRightPressed = false;
|
||||
@@ -78,6 +81,7 @@ public:
|
||||
float offsetY() const;
|
||||
float offsetZ() const;
|
||||
int rotation() const;
|
||||
int tempRotation() const;
|
||||
bool adjustChaperone() const;
|
||||
bool moveShortcutRight() const;
|
||||
bool moveShortcutLeft() const;
|
||||
@@ -96,6 +100,8 @@ public slots:
|
||||
|
||||
void setRotation( int value, bool notify = true );
|
||||
|
||||
void setTempRotation( int value, bool notify = true );
|
||||
|
||||
void setAdjustChaperone( bool value, bool notify = true );
|
||||
|
||||
void setMoveShortcutRight( bool value, bool notify = true );
|
||||
@@ -119,6 +125,7 @@ signals:
|
||||
void offsetYChanged( float value );
|
||||
void offsetZChanged( float value );
|
||||
void rotationChanged( int value );
|
||||
void tempRotationChanged( int value );
|
||||
void adjustChaperoneChanged( bool value );
|
||||
void moveShortcutRightChanged( bool value );
|
||||
void moveShortcutLeftChanged( bool value );
|
||||
|
||||
Reference in New Issue
Block a user