mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 03:04:33 +02:00
Add eye tracker class and menu item
This commit is contained in:
parent
70d155048f
commit
e0ca6eb5ed
6 changed files with 78 additions and 4 deletions
|
@ -108,12 +108,13 @@
|
|||
#include "audio/AudioScope.h"
|
||||
|
||||
#include "devices/DdeFaceTracker.h"
|
||||
#include "devices/EyeTracker.h"
|
||||
#include "devices/Faceshift.h"
|
||||
#include "devices/Leapmotion.h"
|
||||
#include "devices/RealSense.h"
|
||||
#include "devices/SDL2Manager.h"
|
||||
#include "devices/MIDIManager.h"
|
||||
#include "devices/OculusManager.h"
|
||||
#include "devices/RealSense.h"
|
||||
#include "devices/SDL2Manager.h"
|
||||
#include "devices/TV3DManager.h"
|
||||
|
||||
#include "scripting/AccountScriptingInterface.h"
|
||||
|
@ -261,14 +262,14 @@ bool setupEssentials(int& argc, char** argv) {
|
|||
auto scriptCache = DependencyManager::set<ScriptCache>();
|
||||
auto soundCache = DependencyManager::set<SoundCache>();
|
||||
auto faceshift = DependencyManager::set<Faceshift>();
|
||||
auto ddeFaceTracker = DependencyManager::set<DdeFaceTracker>();
|
||||
auto eyeTracker = DependencyManager::set<EyeTracker>();
|
||||
auto audio = DependencyManager::set<AudioClient>();
|
||||
auto audioScope = DependencyManager::set<AudioScope>();
|
||||
auto deferredLightingEffect = DependencyManager::set<DeferredLightingEffect>();
|
||||
auto textureCache = DependencyManager::set<TextureCache>();
|
||||
auto framebufferCache = DependencyManager::set<FramebufferCache>();
|
||||
|
||||
auto animationCache = DependencyManager::set<AnimationCache>();
|
||||
auto ddeFaceTracker = DependencyManager::set<DdeFaceTracker>();
|
||||
auto modelBlender = DependencyManager::set<ModelBlender>();
|
||||
auto avatarManager = DependencyManager::set<AvatarManager>();
|
||||
auto lodManager = DependencyManager::set<LODManager>();
|
||||
|
@ -635,6 +636,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
connect(ddeTracker.data(), &FaceTracker::muteToggled, this, &Application::faceTrackerMuteToggled);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IVIEWHMD
|
||||
auto eyeTracker = DependencyManager::get<EyeTracker>();
|
||||
eyeTracker->init();
|
||||
#endif
|
||||
|
||||
auto applicationUpdater = DependencyManager::get<AutoUpdater>();
|
||||
connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog);
|
||||
applicationUpdater->checkForUpdate();
|
||||
|
@ -2007,6 +2013,13 @@ void Application::setActiveFaceTracker() {
|
|||
#endif
|
||||
}
|
||||
|
||||
void Application::setActiveEyeTracker() {
|
||||
#ifdef HAVE_IVIEWHMD
|
||||
auto eyeTracker = DependencyManager::get<EyeTracker>();
|
||||
eyeTracker->setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::SMIEyeTracking));
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Application::exportEntities(const QString& filename, const QVector<EntityItemID>& entityIDs) {
|
||||
QVector<EntityItemPointer> entities;
|
||||
|
||||
|
@ -3408,6 +3421,7 @@ void Application::renderRearViewMirror(RenderArgs* renderArgs, const QRect& regi
|
|||
void Application::resetSensors() {
|
||||
DependencyManager::get<Faceshift>()->reset();
|
||||
DependencyManager::get<DdeFaceTracker>()->reset();
|
||||
DependencyManager::get<EyeTracker>()->reset();
|
||||
|
||||
OculusManager::reset();
|
||||
|
||||
|
|
|
@ -406,6 +406,8 @@ public slots:
|
|||
void resetSensors();
|
||||
void setActiveFaceTracker();
|
||||
|
||||
void setActiveEyeTracker();
|
||||
|
||||
void aboutApp();
|
||||
void showEditEntitiesHelp();
|
||||
|
||||
|
|
|
@ -437,6 +437,13 @@ Menu::Menu() {
|
|||
addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::AutoMuteAudio, 0, false);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IVIEWHMD
|
||||
MenuWrapper* eyeTrackingMenu = avatarDebugMenu->addMenu("Eye Tracking");
|
||||
QAction* smiEyeTracking = addCheckableActionToQMenuAndActionHash(eyeTrackingMenu, MenuOption::SMIEyeTracking, 0, false,
|
||||
qApp, SLOT(setActiveEyeTracker()));
|
||||
smiEyeTracking->setVisible(true);
|
||||
#endif
|
||||
|
||||
auto avatarManager = DependencyManager::get<AvatarManager>();
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::AvatarReceiveStats, 0, false,
|
||||
avatarManager.data(), SLOT(setShouldShowReceiveStats(bool)));
|
||||
|
|
|
@ -273,6 +273,7 @@ namespace MenuOption {
|
|||
const QString SixenseEnabled = "Enable Hydra Support";
|
||||
const QString SixenseMouseInput = "Enable Sixense Mouse Input";
|
||||
const QString ShiftHipsForIdleAnimations = "Shift hips for idle animations";
|
||||
const QString SMIEyeTracking = "SMI Eye Tracking";
|
||||
const QString Stars = "Stars";
|
||||
const QString Stats = "Stats";
|
||||
const QString StopAllScripts = "Stop All Scripts";
|
||||
|
|
21
interface/src/devices/EyeTracker.cpp
Normal file
21
interface/src/devices/EyeTracker.cpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// EyeTracker.cpp
|
||||
// interface/src/devices
|
||||
//
|
||||
// Created by David Rowe on 27 Jul 2015.
|
||||
// Copyright 2015 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include "EyeTracker.h"
|
||||
|
||||
void EyeTracker::init() {
|
||||
}
|
||||
|
||||
void EyeTracker::setEnabled(bool enabled) {
|
||||
}
|
||||
|
||||
void EyeTracker::reset() {
|
||||
}
|
29
interface/src/devices/EyeTracker.h
Normal file
29
interface/src/devices/EyeTracker.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// EyeTracker.h
|
||||
// interface/src/devices
|
||||
//
|
||||
// Created by David Rowe on 27 Jul 2015.
|
||||
// Copyright 2015 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#ifndef hifi_EyeTracker_h
|
||||
#define hifi_EyeTracker_h
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <DependencyManager.h>
|
||||
|
||||
class EyeTracker : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
SINGLETON_DEPENDENCY
|
||||
|
||||
public slots:
|
||||
void init();
|
||||
void setEnabled(bool enabled);
|
||||
void reset();
|
||||
};
|
||||
|
||||
#endif // hifi_EyeTracker_h
|
Loading…
Reference in a new issue