guard sixense from updating before activated

This commit is contained in:
Brad Hefta-Gaub 2015-10-14 15:32:10 -07:00
parent f051a84dc6
commit 4107f4ea9f
2 changed files with 8 additions and 0 deletions

View file

@ -122,6 +122,7 @@ void SixenseManager::activate() {
#endif
loadSettings();
sixenseInit();
_activated = true;
#endif
}
@ -138,6 +139,7 @@ void SixenseManager::deactivate() {
#endif
sixenseExit();
_activated = false;
#ifdef __APPLE__
delete _sixenseLibrary;
@ -157,6 +159,9 @@ void SixenseManager::setSixenseFilter(bool filter) {
}
void SixenseManager::update(float deltaTime, bool jointsCaptured) {
if (!_activated) {
return;
}
#ifdef HAVE_SIXENSE
_buttonPressedMap.clear();

View file

@ -117,6 +117,9 @@ private:
static const QString NAME;
static const QString HYDRA_ID_STRING;
bool _activated = false;
};
#endif // hifi_SixenseManager_h