mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 07:36:36 +02:00
Moved toggleSixense out of Menu
Moved into SixenseManager
This commit is contained in:
parent
8a827dbb3e
commit
3bce8204da
5 changed files with 13 additions and 19 deletions
|
@ -1678,11 +1678,11 @@ void Application::init() {
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::SixenseEnabled)) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::SixenseEnabled)) {
|
||||||
// on OS X we only setup sixense if the user wants it on - this allows running without the hid_init crash
|
// on OS X we only setup sixense if the user wants it on - this allows running without the hid_init crash
|
||||||
// if hydra support is temporarily not required
|
// if hydra support is temporarily not required
|
||||||
Menu::getInstance()->toggleSixense(true);
|
SixenseManager::getInstance().toggleSixense(true);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// setup sixense
|
// setup sixense
|
||||||
Menu::getInstance()->toggleSixense(true);
|
SixenseManager::getInstance().toggleSixense(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// initialize our face trackers after loading the menu settings
|
// initialize our face trackers after loading the menu settings
|
||||||
|
|
|
@ -417,7 +417,7 @@ Menu::Menu() {
|
||||||
addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu,
|
addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu,
|
||||||
MenuOption::SixenseEnabled,
|
MenuOption::SixenseEnabled,
|
||||||
0, false,
|
0, false,
|
||||||
this,
|
&SixenseManager::getInstance(),
|
||||||
SLOT(toggleSixense(bool)));
|
SLOT(toggleSixense(bool)));
|
||||||
#endif
|
#endif
|
||||||
addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu,
|
addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu,
|
||||||
|
@ -1088,18 +1088,6 @@ void Menu::bumpSettings() {
|
||||||
|
|
||||||
const float DIALOG_RATIO_OF_WINDOW = 0.30f;
|
const float DIALOG_RATIO_OF_WINDOW = 0.30f;
|
||||||
|
|
||||||
void Menu::toggleSixense(bool shouldEnable) {
|
|
||||||
SixenseManager& sixenseManager = SixenseManager::getInstance();
|
|
||||||
|
|
||||||
if (shouldEnable && !sixenseManager.isInitialized()) {
|
|
||||||
sixenseManager.initialize();
|
|
||||||
sixenseManager.setFilter(isOptionChecked(MenuOption::FilterSixense));
|
|
||||||
sixenseManager.setLowVelocityFilter(isOptionChecked(MenuOption::LowVelocityFilter));
|
|
||||||
}
|
|
||||||
|
|
||||||
sixenseManager.setIsEnabled(shouldEnable);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Menu::displayNameLocationResponse(const QString& errorString) {
|
void Menu::displayNameLocationResponse(const QString& errorString) {
|
||||||
|
|
||||||
if (!errorString.isEmpty()) {
|
if (!errorString.isEmpty()) {
|
||||||
|
|
|
@ -141,9 +141,6 @@ public:
|
||||||
signals:
|
signals:
|
||||||
void scriptLocationChanged(const QString& newPath);
|
void scriptLocationChanged(const QString& newPath);
|
||||||
|
|
||||||
public slots:
|
|
||||||
void toggleSixense(bool shouldEnable);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void aboutApp();
|
void aboutApp();
|
||||||
void showEditEntitiesHelp();
|
void showEditEntitiesHelp();
|
||||||
|
|
|
@ -568,5 +568,14 @@ void SixenseManager::emulateMouse(PalmData* palm, int index) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SixenseManager::toggleSixense(bool shouldEnable) {
|
||||||
|
if (shouldEnable && !isInitialized()) {
|
||||||
|
initialize();
|
||||||
|
setFilter(Menu::getInstance()->isOptionChecked(MenuOption::FilterSixense));
|
||||||
|
setLowVelocityFilter(Menu::getInstance()->isOptionChecked(MenuOption::LowVelocityFilter));
|
||||||
|
}
|
||||||
|
setIsEnabled(shouldEnable);
|
||||||
|
}
|
||||||
|
|
||||||
#endif // HAVE_SIXENSE
|
#endif // HAVE_SIXENSE
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ public:
|
||||||
void setInvertButtons(bool invertSixenseButtons) { _invertButtons = invertSixenseButtons; }
|
void setInvertButtons(bool invertSixenseButtons) { _invertButtons = invertSixenseButtons; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
void toggleSixense(bool shouldEnable);
|
||||||
void setFilter(bool filter);
|
void setFilter(bool filter);
|
||||||
void setLowVelocityFilter(bool lowVelocityFilter) { _lowVelocityFilter = lowVelocityFilter; };
|
void setLowVelocityFilter(bool lowVelocityFilter) { _lowVelocityFilter = lowVelocityFilter; };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue