mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 15:58:35 +02:00
Move Sixense related members out of Menu
Moved to SixenseManager
This commit is contained in:
parent
ef5cfdc3ab
commit
47babc2d40
4 changed files with 19 additions and 15 deletions
|
@ -135,10 +135,6 @@ public:
|
||||||
void setFieldOfView(float fieldOfView) { _fieldOfView = fieldOfView; bumpSettings(); }
|
void setFieldOfView(float fieldOfView) { _fieldOfView = fieldOfView; bumpSettings(); }
|
||||||
float getRealWorldFieldOfView() const { return _realWorldFieldOfView; }
|
float getRealWorldFieldOfView() const { return _realWorldFieldOfView; }
|
||||||
void setRealWorldFieldOfView(float realWorldFieldOfView) { _realWorldFieldOfView = realWorldFieldOfView; bumpSettings(); }
|
void setRealWorldFieldOfView(float realWorldFieldOfView) { _realWorldFieldOfView = realWorldFieldOfView; bumpSettings(); }
|
||||||
float getSixenseReticleMoveSpeed() const { return _sixenseReticleMoveSpeed; }
|
|
||||||
void setSixenseReticleMoveSpeed(float sixenseReticleMoveSpeed) { _sixenseReticleMoveSpeed = sixenseReticleMoveSpeed; bumpSettings(); }
|
|
||||||
bool getInvertSixenseButtons() const { return _invertSixenseButtons; }
|
|
||||||
void setInvertSixenseButtons(bool invertSixenseButtons) { _invertSixenseButtons = invertSixenseButtons; bumpSettings(); }
|
|
||||||
|
|
||||||
QString getSnapshotsLocation() const;
|
QString getSnapshotsLocation() const;
|
||||||
void setSnapshotsLocation(QString snapshotsLocation) { _snapshotsLocation = snapshotsLocation; bumpSettings(); }
|
void setSnapshotsLocation(QString snapshotsLocation) { _snapshotsLocation = snapshotsLocation; bumpSettings(); }
|
||||||
|
@ -215,8 +211,7 @@ private:
|
||||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||||
SpeechRecognizer _speechRecognizer;
|
SpeechRecognizer _speechRecognizer;
|
||||||
#endif
|
#endif
|
||||||
float _sixenseReticleMoveSpeed = DEFAULT_SIXENSE_RETICLE_MOVE_SPEED;
|
|
||||||
bool _invertSixenseButtons = DEFAULT_INVERT_SIXENSE_MOUSE_BUTTONS;
|
|
||||||
bool _hasLoginDialogDisplayed = false;
|
bool _hasLoginDialogDisplayed = false;
|
||||||
|
|
||||||
int _maxOctreePacketsPerSecond = DEFAULT_MAX_OCTREE_PPS;
|
int _maxOctreePacketsPerSecond = DEFAULT_MAX_OCTREE_PPS;
|
||||||
|
|
|
@ -301,7 +301,7 @@ const float RANGE_MULT = (MAX_PIXEL_RANGE_MULT - MIN_PIXEL_RANGE_MULT) * 0.01;
|
||||||
//Returns a multiplier to be applied to the cursor range for the controllers
|
//Returns a multiplier to be applied to the cursor range for the controllers
|
||||||
float SixenseManager::getCursorPixelRangeMult() const {
|
float SixenseManager::getCursorPixelRangeMult() const {
|
||||||
//scales (0,100) to (MINIMUM_PIXEL_RANGE_MULT, MAXIMUM_PIXEL_RANGE_MULT)
|
//scales (0,100) to (MINIMUM_PIXEL_RANGE_MULT, MAXIMUM_PIXEL_RANGE_MULT)
|
||||||
return Menu::getInstance()->getSixenseReticleMoveSpeed() * RANGE_MULT + MIN_PIXEL_RANGE_MULT;
|
return _reticleMoveSpeed * RANGE_MULT + MIN_PIXEL_RANGE_MULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SIXENSE
|
#ifdef HAVE_SIXENSE
|
||||||
|
@ -459,7 +459,7 @@ void SixenseManager::emulateMouse(PalmData* palm, int index) {
|
||||||
|
|
||||||
unsigned int deviceID = index == 0 ? CONTROLLER_0_EVENT : CONTROLLER_1_EVENT;
|
unsigned int deviceID = index == 0 ? CONTROLLER_0_EVENT : CONTROLLER_1_EVENT;
|
||||||
|
|
||||||
if (Menu::getInstance()->getInvertSixenseButtons()) {
|
if (_invertButtons) {
|
||||||
bumperButton = Qt::LeftButton;
|
bumperButton = Qt::LeftButton;
|
||||||
triggerButton = Qt::RightButton;
|
triggerButton = Qt::RightButton;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -55,6 +55,11 @@ public:
|
||||||
void update(float deltaTime);
|
void update(float deltaTime);
|
||||||
float getCursorPixelRangeMult() const;
|
float getCursorPixelRangeMult() const;
|
||||||
|
|
||||||
|
float getReticleMoveSpeed() const { return _reticleMoveSpeed; }
|
||||||
|
void setReticleMoveSpeed(float sixenseReticleMoveSpeed) { _reticleMoveSpeed = sixenseReticleMoveSpeed; }
|
||||||
|
bool getInvertButtons() const { return _invertButtons; }
|
||||||
|
void setInvertButtons(bool invertSixenseButtons) { _invertButtons = invertSixenseButtons; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void setFilter(bool filter);
|
void setFilter(bool filter);
|
||||||
|
@ -102,6 +107,9 @@ private:
|
||||||
|
|
||||||
bool _lowVelocityFilter;
|
bool _lowVelocityFilter;
|
||||||
bool _controllersAtBase;
|
bool _controllersAtBase;
|
||||||
|
|
||||||
|
float _reticleMoveSpeed = DEFAULT_SIXENSE_RETICLE_MOVE_SPEED;
|
||||||
|
bool _invertButtons = DEFAULT_INVERT_SIXENSE_MOUSE_BUTTONS;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_SixenseManager_h
|
#endif // hifi_SixenseManager_h
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
|
||||||
#include <devices/Faceshift.h>
|
#include <devices/Faceshift.h>
|
||||||
|
#include <devices/SixenseManager.h>
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "Audio.h"
|
#include "Audio.h"
|
||||||
|
@ -163,9 +164,9 @@ void PreferencesDialog::loadPreferences() {
|
||||||
|
|
||||||
ui.oculusUIAngularSizeSpin->setValue(qApp->getApplicationOverlay().getOculusUIAngularSize());
|
ui.oculusUIAngularSizeSpin->setValue(qApp->getApplicationOverlay().getOculusUIAngularSize());
|
||||||
|
|
||||||
ui.sixenseReticleMoveSpeedSpin->setValue(menuInstance->getSixenseReticleMoveSpeed());
|
SixenseManager& sixense = SixenseManager::getInstance();
|
||||||
|
ui.sixenseReticleMoveSpeedSpin->setValue(sixense.getReticleMoveSpeed());
|
||||||
ui.invertSixenseButtonsCheckBox->setChecked(menuInstance->getInvertSixenseButtons());
|
ui.invertSixenseButtonsCheckBox->setChecked(sixense.getInvertButtons());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,10 +245,10 @@ void PreferencesDialog::savePreferences() {
|
||||||
Menu::getInstance()->setMaxOctreePacketsPerSecond(ui.maxOctreePPSSpin->value());
|
Menu::getInstance()->setMaxOctreePacketsPerSecond(ui.maxOctreePPSSpin->value());
|
||||||
|
|
||||||
qApp->getApplicationOverlay().setOculusUIAngularSize(ui.oculusUIAngularSizeSpin->value());
|
qApp->getApplicationOverlay().setOculusUIAngularSize(ui.oculusUIAngularSizeSpin->value());
|
||||||
|
|
||||||
Menu::getInstance()->setSixenseReticleMoveSpeed(ui.sixenseReticleMoveSpeedSpin->value());
|
SixenseManager& sixense = SixenseManager::getInstance();
|
||||||
|
sixense.setReticleMoveSpeed(ui.sixenseReticleMoveSpeedSpin->value());
|
||||||
Menu::getInstance()->setInvertSixenseButtons(ui.invertSixenseButtonsCheckBox->isChecked());
|
sixense.setInvertButtons(ui.invertSixenseButtonsCheckBox->isChecked());
|
||||||
|
|
||||||
auto audio = DependencyManager::get<Audio>();
|
auto audio = DependencyManager::get<Audio>();
|
||||||
MixedProcessedAudioStream& stream = audio->getReceivedAudioStream();
|
MixedProcessedAudioStream& stream = audio->getReceivedAudioStream();
|
||||||
|
|
Loading…
Reference in a new issue