added apply button to rotate playspace instead of automatically rotating
This commit is contained in:
@@ -113,15 +113,23 @@ int MoveCenterTabController::rotation() const {
|
||||
|
||||
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) {
|
||||
if (notify) {
|
||||
emit rotationChanged(m_rotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCenterTabController::applyRotation() {
|
||||
if (m_rotation != m_rotationOld) {
|
||||
float angle = (m_rotationOld - m_rotation) * 2 * M_PI / 360.0;
|
||||
parent->RotateUniverseCenter((vr::TrackingUniverseOrigin)m_trackingUniverse, angle, m_adjustChaperone);
|
||||
m_rotationOld = m_rotation;
|
||||
}
|
||||
}
|
||||
|
||||
bool MoveCenterTabController::adjustChaperone() const {
|
||||
return m_adjustChaperone;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class MoveCenterTabController : public QObject {
|
||||
Q_PROPERTY(float offsetX READ offsetX WRITE setOffsetX NOTIFY offsetXChanged)
|
||||
Q_PROPERTY(float offsetY READ offsetY WRITE setOffsetY NOTIFY offsetYChanged)
|
||||
Q_PROPERTY(float offsetZ READ offsetZ WRITE setOffsetZ NOTIFY offsetZChanged)
|
||||
Q_PROPERTY(int rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
|
||||
Q_PROPERTY(int rotation READ rotation WRITE setRotation NOTIFY rotationChanged )
|
||||
Q_PROPERTY(bool adjustChaperone READ adjustChaperone WRITE setAdjustChaperone NOTIFY adjustChaperoneChanged)
|
||||
Q_PROPERTY(bool moveShortcutRight READ moveShortcutRight WRITE setMoveShortcutRight NOTIFY moveShortcutRightChanged)
|
||||
Q_PROPERTY(bool moveShortcutLeft READ moveShortcutLeft WRITE setMoveShortcutLeft NOTIFY moveShortcutLeftChanged)
|
||||
@@ -37,6 +37,7 @@ private:
|
||||
float m_offsetY = 0.0f;
|
||||
float m_offsetZ = 0.0f;
|
||||
int m_rotation = 0;
|
||||
int m_rotationOld = 0;
|
||||
bool m_adjustChaperone = true;
|
||||
bool m_moveShortcutRightPressed = false;
|
||||
bool m_moveShortcutLeftPressed = false;
|
||||
@@ -80,7 +81,7 @@ public slots:
|
||||
void setOffsetY(float value, bool notify = true);
|
||||
void setOffsetZ(float value, bool notify = true);
|
||||
|
||||
void setRotation(int value, bool notify = true);
|
||||
void setRotation(int value , bool notify = true);
|
||||
|
||||
void setAdjustChaperone(bool value, bool notify = true);
|
||||
|
||||
@@ -96,6 +97,7 @@ public slots:
|
||||
void setLockY(bool value, bool notify = true);
|
||||
void setLockZ(bool value, bool notify = true);
|
||||
|
||||
void applyRotation();
|
||||
void reset();
|
||||
|
||||
signals:
|
||||
|
||||
Reference in New Issue
Block a user