mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 16:36:54 +02:00
add menu option for sixense filter
This commit is contained in:
parent
09258cb17b
commit
1b1fdd3dc4
6 changed files with 34 additions and 6 deletions
|
@ -240,6 +240,9 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
|
||||||
// probably not the right long term solution. But for now, we're going to do this to
|
// probably not the right long term solution. But for now, we're going to do this to
|
||||||
// allow you to move a particle around in your hand
|
// allow you to move a particle around in your hand
|
||||||
_particleEditSender.setPacketsPerSecond(3000); // super high!!
|
_particleEditSender.setPacketsPerSecond(3000); // super high!!
|
||||||
|
|
||||||
|
// Set the sixense filtering
|
||||||
|
_sixenseManager.setFilter(Menu::getInstance()->isOptionChecked(MenuOption::FilterSixense));
|
||||||
}
|
}
|
||||||
|
|
||||||
Application::~Application() {
|
Application::~Application() {
|
||||||
|
|
|
@ -151,6 +151,7 @@ public:
|
||||||
SerialInterface* getSerialHeadSensor() { return &_serialHeadSensor; }
|
SerialInterface* getSerialHeadSensor() { return &_serialHeadSensor; }
|
||||||
Webcam* getWebcam() { return &_webcam; }
|
Webcam* getWebcam() { return &_webcam; }
|
||||||
Faceshift* getFaceshift() { return &_faceshift; }
|
Faceshift* getFaceshift() { return &_faceshift; }
|
||||||
|
SixenseManager* getSixenseManager() { return &_sixenseManager; }
|
||||||
BandwidthMeter* getBandwidthMeter() { return &_bandwidthMeter; }
|
BandwidthMeter* getBandwidthMeter() { return &_bandwidthMeter; }
|
||||||
QSettings* getSettings() { return _settings; }
|
QSettings* getSettings() { return _settings; }
|
||||||
Swatch* getSwatch() { return &_swatch; }
|
Swatch* getSwatch() { return &_swatch; }
|
||||||
|
|
|
@ -357,11 +357,17 @@ Menu::Menu() :
|
||||||
appInstance->getWebcam()->getGrabber(),
|
appInstance->getWebcam()->getGrabber(),
|
||||||
SLOT(setDepthOnly(bool)));
|
SLOT(setDepthOnly(bool)));
|
||||||
|
|
||||||
QMenu* raveGloveOptionsMenu = developerMenu->addMenu("Hand Options");
|
QMenu* handOptionsMenu = developerMenu->addMenu("Hand Options");
|
||||||
|
|
||||||
addCheckableActionToQMenuAndActionHash(raveGloveOptionsMenu, MenuOption::SimulateLeapHand);
|
addCheckableActionToQMenuAndActionHash(handOptionsMenu,
|
||||||
addCheckableActionToQMenuAndActionHash(raveGloveOptionsMenu, MenuOption::DisplayLeapHands, 0, true);
|
MenuOption::FilterSixense,
|
||||||
addCheckableActionToQMenuAndActionHash(raveGloveOptionsMenu, MenuOption::LeapDrive, 0, false);
|
0,
|
||||||
|
true,
|
||||||
|
appInstance->getSixenseManager(),
|
||||||
|
SLOT(setFilter(bool)));
|
||||||
|
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::SimulateLeapHand);
|
||||||
|
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayLeapHands, 0, true);
|
||||||
|
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::LeapDrive, 0, false);
|
||||||
|
|
||||||
|
|
||||||
QMenu* trackingOptionsMenu = developerMenu->addMenu("Tracking Options");
|
QMenu* trackingOptionsMenu = developerMenu->addMenu("Tracking Options");
|
||||||
|
|
|
@ -167,6 +167,7 @@ namespace MenuOption {
|
||||||
const QString DisableLowRes = "Disable Lower Resolution While Moving";
|
const QString DisableLowRes = "Disable Lower Resolution While Moving";
|
||||||
const QString DisplayFrustum = "Display Frustum";
|
const QString DisplayFrustum = "Display Frustum";
|
||||||
const QString DisplayLeapHands = "Display Leap Hands";
|
const QString DisplayLeapHands = "Display Leap Hands";
|
||||||
|
const QString FilterSixense = "Smooth Sixense Movement";
|
||||||
const QString DontRenderVoxels = "Don't call _voxels.render()";
|
const QString DontRenderVoxels = "Don't call _voxels.render()";
|
||||||
const QString DontCallOpenGLForVoxels = "Don't call glDrawRangeElementsEXT() for Voxels";
|
const QString DontCallOpenGLForVoxels = "Don't call glDrawRangeElementsEXT() for Voxels";
|
||||||
const QString EnableOcclusionCulling = "Enable Occlusion Culling";
|
const QString EnableOcclusionCulling = "Enable Occlusion Culling";
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
SixenseManager::SixenseManager() {
|
SixenseManager::SixenseManager() {
|
||||||
#ifdef HAVE_SIXENSE
|
#ifdef HAVE_SIXENSE
|
||||||
sixenseInit();
|
sixenseInit();
|
||||||
sixenseSetFilterEnabled(1);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +25,18 @@ SixenseManager::~SixenseManager() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SixenseManager::setFilter(bool filter) {
|
||||||
|
#ifdef HAVE_SIXENSE
|
||||||
|
if (filter) {
|
||||||
|
qDebug("Sixense Filter ON\n");
|
||||||
|
sixenseSetFilterEnabled(1);
|
||||||
|
} else {
|
||||||
|
qDebug("Sixense Filter OFF\n");
|
||||||
|
sixenseSetFilterEnabled(0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void SixenseManager::update(float deltaTime) {
|
void SixenseManager::update(float deltaTime) {
|
||||||
#ifdef HAVE_SIXENSE
|
#ifdef HAVE_SIXENSE
|
||||||
if (sixenseGetNumActiveControllers() == 0) {
|
if (sixenseGetNumActiveControllers() == 0) {
|
||||||
|
|
|
@ -10,13 +10,19 @@
|
||||||
#define __interface__SixenseManager__
|
#define __interface__SixenseManager__
|
||||||
|
|
||||||
/// Handles interaction with the Sixense SDK (e.g., Razer Hydra).
|
/// Handles interaction with the Sixense SDK (e.g., Razer Hydra).
|
||||||
class SixenseManager {
|
class SixenseManager : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
||||||
SixenseManager();
|
SixenseManager();
|
||||||
~SixenseManager();
|
~SixenseManager();
|
||||||
|
|
||||||
void update(float deltaTime);
|
void update(float deltaTime);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
void setFilter(bool filter);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__interface__SixenseManager__) */
|
#endif /* defined(__interface__SixenseManager__) */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue