mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 02:36:54 +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 "audio/AudioScope.h"
|
||||||
|
|
||||||
#include "devices/DdeFaceTracker.h"
|
#include "devices/DdeFaceTracker.h"
|
||||||
|
#include "devices/EyeTracker.h"
|
||||||
#include "devices/Faceshift.h"
|
#include "devices/Faceshift.h"
|
||||||
#include "devices/Leapmotion.h"
|
#include "devices/Leapmotion.h"
|
||||||
#include "devices/RealSense.h"
|
|
||||||
#include "devices/SDL2Manager.h"
|
|
||||||
#include "devices/MIDIManager.h"
|
#include "devices/MIDIManager.h"
|
||||||
#include "devices/OculusManager.h"
|
#include "devices/OculusManager.h"
|
||||||
|
#include "devices/RealSense.h"
|
||||||
|
#include "devices/SDL2Manager.h"
|
||||||
#include "devices/TV3DManager.h"
|
#include "devices/TV3DManager.h"
|
||||||
|
|
||||||
#include "scripting/AccountScriptingInterface.h"
|
#include "scripting/AccountScriptingInterface.h"
|
||||||
|
@ -261,14 +262,14 @@ bool setupEssentials(int& argc, char** argv) {
|
||||||
auto scriptCache = DependencyManager::set<ScriptCache>();
|
auto scriptCache = DependencyManager::set<ScriptCache>();
|
||||||
auto soundCache = DependencyManager::set<SoundCache>();
|
auto soundCache = DependencyManager::set<SoundCache>();
|
||||||
auto faceshift = DependencyManager::set<Faceshift>();
|
auto faceshift = DependencyManager::set<Faceshift>();
|
||||||
|
auto ddeFaceTracker = DependencyManager::set<DdeFaceTracker>();
|
||||||
|
auto eyeTracker = DependencyManager::set<EyeTracker>();
|
||||||
auto audio = DependencyManager::set<AudioClient>();
|
auto audio = DependencyManager::set<AudioClient>();
|
||||||
auto audioScope = DependencyManager::set<AudioScope>();
|
auto audioScope = DependencyManager::set<AudioScope>();
|
||||||
auto deferredLightingEffect = DependencyManager::set<DeferredLightingEffect>();
|
auto deferredLightingEffect = DependencyManager::set<DeferredLightingEffect>();
|
||||||
auto textureCache = DependencyManager::set<TextureCache>();
|
auto textureCache = DependencyManager::set<TextureCache>();
|
||||||
auto framebufferCache = DependencyManager::set<FramebufferCache>();
|
auto framebufferCache = DependencyManager::set<FramebufferCache>();
|
||||||
|
|
||||||
auto animationCache = DependencyManager::set<AnimationCache>();
|
auto animationCache = DependencyManager::set<AnimationCache>();
|
||||||
auto ddeFaceTracker = DependencyManager::set<DdeFaceTracker>();
|
|
||||||
auto modelBlender = DependencyManager::set<ModelBlender>();
|
auto modelBlender = DependencyManager::set<ModelBlender>();
|
||||||
auto avatarManager = DependencyManager::set<AvatarManager>();
|
auto avatarManager = DependencyManager::set<AvatarManager>();
|
||||||
auto lodManager = DependencyManager::set<LODManager>();
|
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);
|
connect(ddeTracker.data(), &FaceTracker::muteToggled, this, &Application::faceTrackerMuteToggled);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_IVIEWHMD
|
||||||
|
auto eyeTracker = DependencyManager::get<EyeTracker>();
|
||||||
|
eyeTracker->init();
|
||||||
|
#endif
|
||||||
|
|
||||||
auto applicationUpdater = DependencyManager::get<AutoUpdater>();
|
auto applicationUpdater = DependencyManager::get<AutoUpdater>();
|
||||||
connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog);
|
connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog);
|
||||||
applicationUpdater->checkForUpdate();
|
applicationUpdater->checkForUpdate();
|
||||||
|
@ -2007,6 +2013,13 @@ void Application::setActiveFaceTracker() {
|
||||||
#endif
|
#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) {
|
bool Application::exportEntities(const QString& filename, const QVector<EntityItemID>& entityIDs) {
|
||||||
QVector<EntityItemPointer> entities;
|
QVector<EntityItemPointer> entities;
|
||||||
|
|
||||||
|
@ -3408,6 +3421,7 @@ void Application::renderRearViewMirror(RenderArgs* renderArgs, const QRect& regi
|
||||||
void Application::resetSensors() {
|
void Application::resetSensors() {
|
||||||
DependencyManager::get<Faceshift>()->reset();
|
DependencyManager::get<Faceshift>()->reset();
|
||||||
DependencyManager::get<DdeFaceTracker>()->reset();
|
DependencyManager::get<DdeFaceTracker>()->reset();
|
||||||
|
DependencyManager::get<EyeTracker>()->reset();
|
||||||
|
|
||||||
OculusManager::reset();
|
OculusManager::reset();
|
||||||
|
|
||||||
|
|
|
@ -406,6 +406,8 @@ public slots:
|
||||||
void resetSensors();
|
void resetSensors();
|
||||||
void setActiveFaceTracker();
|
void setActiveFaceTracker();
|
||||||
|
|
||||||
|
void setActiveEyeTracker();
|
||||||
|
|
||||||
void aboutApp();
|
void aboutApp();
|
||||||
void showEditEntitiesHelp();
|
void showEditEntitiesHelp();
|
||||||
|
|
||||||
|
|
|
@ -437,6 +437,13 @@ Menu::Menu() {
|
||||||
addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::AutoMuteAudio, 0, false);
|
addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::AutoMuteAudio, 0, false);
|
||||||
#endif
|
#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>();
|
auto avatarManager = DependencyManager::get<AvatarManager>();
|
||||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::AvatarReceiveStats, 0, false,
|
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::AvatarReceiveStats, 0, false,
|
||||||
avatarManager.data(), SLOT(setShouldShowReceiveStats(bool)));
|
avatarManager.data(), SLOT(setShouldShowReceiveStats(bool)));
|
||||||
|
|
|
@ -273,6 +273,7 @@ namespace MenuOption {
|
||||||
const QString SixenseEnabled = "Enable Hydra Support";
|
const QString SixenseEnabled = "Enable Hydra Support";
|
||||||
const QString SixenseMouseInput = "Enable Sixense Mouse Input";
|
const QString SixenseMouseInput = "Enable Sixense Mouse Input";
|
||||||
const QString ShiftHipsForIdleAnimations = "Shift hips for idle animations";
|
const QString ShiftHipsForIdleAnimations = "Shift hips for idle animations";
|
||||||
|
const QString SMIEyeTracking = "SMI Eye Tracking";
|
||||||
const QString Stars = "Stars";
|
const QString Stars = "Stars";
|
||||||
const QString Stats = "Stats";
|
const QString Stats = "Stats";
|
||||||
const QString StopAllScripts = "Stop All Scripts";
|
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