mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:47:11 +02:00
When eye tracking data is lot for > N seconds handle as "not tracking"
Revert to default look-at behaviour and saccades until tracking resumes.
This commit is contained in:
parent
e2bf5cad3e
commit
ea03067a02
3 changed files with 14 additions and 2 deletions
|
@ -2050,7 +2050,7 @@ void Application::setActiveEyeTracker() {
|
||||||
bool isEyeTracking = Menu::getInstance()->isOptionChecked(MenuOption::SMIEyeTracking);
|
bool isEyeTracking = Menu::getInstance()->isOptionChecked(MenuOption::SMIEyeTracking);
|
||||||
bool isSimulating = Menu::getInstance()->isOptionChecked(MenuOption::SimulateEyeTracking);
|
bool isSimulating = Menu::getInstance()->isOptionChecked(MenuOption::SimulateEyeTracking);
|
||||||
eyeTracker->setEnabled(isEyeTracking, isSimulating);
|
eyeTracker->setEnabled(isEyeTracking, isSimulating);
|
||||||
if (isEyeTracking && !eyeTracker->isTracking()) {
|
if (isEyeTracking && !eyeTracker->isEnabled()) {
|
||||||
Menu::getInstance()->setIsOptionChecked(MenuOption::SMIEyeTracking, false);
|
Menu::getInstance()->setIsOptionChecked(MenuOption::SMIEyeTracking, false);
|
||||||
isEyeTracking = false;
|
isEyeTracking = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
#include <SharedUtil.h>
|
||||||
|
|
||||||
#include "InterfaceLogging.h"
|
#include "InterfaceLogging.h"
|
||||||
#include "OctreeConstants.h"
|
#include "OctreeConstants.h"
|
||||||
|
|
||||||
|
@ -36,6 +38,8 @@ EyeTracker::~EyeTracker() {
|
||||||
|
|
||||||
#ifdef HAVE_IVIEWHMD
|
#ifdef HAVE_IVIEWHMD
|
||||||
void EyeTracker::processData(smi_CallbackDataStruct* data) {
|
void EyeTracker::processData(smi_CallbackDataStruct* data) {
|
||||||
|
_lastProcessDataTimestamp = usecTimestampNow();
|
||||||
|
|
||||||
if (!_isEnabled) {
|
if (!_isEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -150,6 +154,11 @@ void EyeTracker::reset() {
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EyeTracker::isTracking() const {
|
||||||
|
static const quint64 ACTIVE_TIMEOUT_USECS = 2000000; // 2 secs
|
||||||
|
return (usecTimestampNow() - _lastProcessDataTimestamp < ACTIVE_TIMEOUT_USECS);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_IVIEWHMD
|
#ifdef HAVE_IVIEWHMD
|
||||||
void EyeTracker::calibrate(int points) {
|
void EyeTracker::calibrate(int points) {
|
||||||
smi_CalibrationHMDStruct* calibrationHMDStruct;
|
smi_CalibrationHMDStruct* calibrationHMDStruct;
|
||||||
|
|
|
@ -34,7 +34,8 @@ public:
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
bool isInitialized() const { return _isInitialized; }
|
bool isInitialized() const { return _isInitialized; }
|
||||||
bool isTracking() const { return _isEnabled; }
|
bool isEnabled() const { return _isEnabled; }
|
||||||
|
bool isTracking() const;
|
||||||
bool isSimulating() const { return _isSimulating; }
|
bool isSimulating() const { return _isSimulating; }
|
||||||
|
|
||||||
glm::vec3 getLookAtPosition() const { return _lookAtPosition; } // From mid eye point in head frame.
|
glm::vec3 getLookAtPosition() const { return _lookAtPosition; } // From mid eye point in head frame.
|
||||||
|
@ -52,6 +53,8 @@ private:
|
||||||
bool _isEnabled = false;
|
bool _isEnabled = false;
|
||||||
bool _isSimulating = false;
|
bool _isSimulating = false;
|
||||||
|
|
||||||
|
quint64 _lastProcessDataTimestamp;
|
||||||
|
|
||||||
glm::vec3 _lookAtPosition;
|
glm::vec3 _lookAtPosition;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue