mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +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 isSimulating = Menu::getInstance()->isOptionChecked(MenuOption::SimulateEyeTracking);
|
||||
eyeTracker->setEnabled(isEyeTracking, isSimulating);
|
||||
if (isEyeTracking && !eyeTracker->isTracking()) {
|
||||
if (isEyeTracking && !eyeTracker->isEnabled()) {
|
||||
Menu::getInstance()->setIsOptionChecked(MenuOption::SMIEyeTracking, false);
|
||||
isEyeTracking = false;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <SharedUtil.h>
|
||||
|
||||
#include "InterfaceLogging.h"
|
||||
#include "OctreeConstants.h"
|
||||
|
||||
|
@ -36,6 +38,8 @@ EyeTracker::~EyeTracker() {
|
|||
|
||||
#ifdef HAVE_IVIEWHMD
|
||||
void EyeTracker::processData(smi_CallbackDataStruct* data) {
|
||||
_lastProcessDataTimestamp = usecTimestampNow();
|
||||
|
||||
if (!_isEnabled) {
|
||||
return;
|
||||
}
|
||||
|
@ -150,6 +154,11 @@ void EyeTracker::reset() {
|
|||
// 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
|
||||
void EyeTracker::calibrate(int points) {
|
||||
smi_CalibrationHMDStruct* calibrationHMDStruct;
|
||||
|
|
|
@ -34,7 +34,8 @@ public:
|
|||
void reset();
|
||||
|
||||
bool isInitialized() const { return _isInitialized; }
|
||||
bool isTracking() const { return _isEnabled; }
|
||||
bool isEnabled() const { return _isEnabled; }
|
||||
bool isTracking() const;
|
||||
bool isSimulating() const { return _isSimulating; }
|
||||
|
||||
glm::vec3 getLookAtPosition() const { return _lookAtPosition; } // From mid eye point in head frame.
|
||||
|
@ -52,6 +53,8 @@ private:
|
|||
bool _isEnabled = false;
|
||||
bool _isSimulating = false;
|
||||
|
||||
quint64 _lastProcessDataTimestamp;
|
||||
|
||||
glm::vec3 _lookAtPosition;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue