mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +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
|
||||
// allow you to move a particle around in your hand
|
||||
_particleEditSender.setPacketsPerSecond(3000); // super high!!
|
||||
|
||||
// Set the sixense filtering
|
||||
_sixenseManager.setFilter(Menu::getInstance()->isOptionChecked(MenuOption::FilterSixense));
|
||||
}
|
||||
|
||||
Application::~Application() {
|
||||
|
|
|
@ -151,6 +151,7 @@ public:
|
|||
SerialInterface* getSerialHeadSensor() { return &_serialHeadSensor; }
|
||||
Webcam* getWebcam() { return &_webcam; }
|
||||
Faceshift* getFaceshift() { return &_faceshift; }
|
||||
SixenseManager* getSixenseManager() { return &_sixenseManager; }
|
||||
BandwidthMeter* getBandwidthMeter() { return &_bandwidthMeter; }
|
||||
QSettings* getSettings() { return _settings; }
|
||||
Swatch* getSwatch() { return &_swatch; }
|
||||
|
|
|
@ -357,11 +357,17 @@ Menu::Menu() :
|
|||
appInstance->getWebcam()->getGrabber(),
|
||||
SLOT(setDepthOnly(bool)));
|
||||
|
||||
QMenu* raveGloveOptionsMenu = developerMenu->addMenu("Hand Options");
|
||||
QMenu* handOptionsMenu = developerMenu->addMenu("Hand Options");
|
||||
|
||||
addCheckableActionToQMenuAndActionHash(raveGloveOptionsMenu, MenuOption::SimulateLeapHand);
|
||||
addCheckableActionToQMenuAndActionHash(raveGloveOptionsMenu, MenuOption::DisplayLeapHands, 0, true);
|
||||
addCheckableActionToQMenuAndActionHash(raveGloveOptionsMenu, MenuOption::LeapDrive, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(handOptionsMenu,
|
||||
MenuOption::FilterSixense,
|
||||
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");
|
||||
|
|
|
@ -167,6 +167,7 @@ namespace MenuOption {
|
|||
const QString DisableLowRes = "Disable Lower Resolution While Moving";
|
||||
const QString DisplayFrustum = "Display Frustum";
|
||||
const QString DisplayLeapHands = "Display Leap Hands";
|
||||
const QString FilterSixense = "Smooth Sixense Movement";
|
||||
const QString DontRenderVoxels = "Don't call _voxels.render()";
|
||||
const QString DontCallOpenGLForVoxels = "Don't call glDrawRangeElementsEXT() for Voxels";
|
||||
const QString EnableOcclusionCulling = "Enable Occlusion Culling";
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
SixenseManager::SixenseManager() {
|
||||
#ifdef HAVE_SIXENSE
|
||||
sixenseInit();
|
||||
sixenseSetFilterEnabled(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -26,6 +25,18 @@ SixenseManager::~SixenseManager() {
|
|||
#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) {
|
||||
#ifdef HAVE_SIXENSE
|
||||
if (sixenseGetNumActiveControllers() == 0) {
|
||||
|
|
|
@ -10,13 +10,19 @@
|
|||
#define __interface__SixenseManager__
|
||||
|
||||
/// Handles interaction with the Sixense SDK (e.g., Razer Hydra).
|
||||
class SixenseManager {
|
||||
class SixenseManager : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
SixenseManager();
|
||||
~SixenseManager();
|
||||
|
||||
void update(float deltaTime);
|
||||
|
||||
public slots:
|
||||
|
||||
void setFilter(bool filter);
|
||||
};
|
||||
|
||||
#endif /* defined(__interface__SixenseManager__) */
|
||||
|
||||
|
|
Loading…
Reference in a new issue