mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
Control eyes only if in HMD view or simulating
This commit is contained in:
parent
1ae920368d
commit
76fe0c8764
3 changed files with 4 additions and 1 deletions
|
@ -2295,7 +2295,7 @@ void Application::updateMyAvatarLookAtPosition() {
|
|||
} else {
|
||||
lookAtSpot = _myCamera.getPosition() + OculusManager::getMidEyePosition();
|
||||
}
|
||||
} else if (eyeTracker->isTracking()) {
|
||||
} else if (eyeTracker->isTracking() && (isHMDMode() || eyeTracker->isSimulating())) {
|
||||
// Look at the point that the user is looking at.
|
||||
lookAtSpot = _myAvatar->getHead()->getEyePosition() +
|
||||
(_myAvatar->getHead()->getFinalOrientationInWorldFrame() * eyeTracker->getLookAtPosition());
|
||||
|
|
|
@ -130,6 +130,7 @@ void EyeTracker::setEnabled(bool enabled, bool simulate) {
|
|||
}
|
||||
|
||||
_isEnabled = enabled && success;
|
||||
_isSimulating = _isEnabled && simulate;
|
||||
|
||||
if (!success) {
|
||||
// Display error dialog after updating _isEnabled.
|
||||
|
|
|
@ -28,6 +28,7 @@ public:
|
|||
~EyeTracker();
|
||||
|
||||
bool isTracking() { return _isEnabled; }
|
||||
bool isSimulating() { return _isSimulating; }
|
||||
|
||||
glm::vec3 getLookAtPosition() { return _lookAtPosition; } // From mid eye point in head frame.
|
||||
|
||||
|
@ -43,6 +44,7 @@ private:
|
|||
|
||||
bool _isInitialized = false;
|
||||
bool _isEnabled = false;
|
||||
bool _isSimulating = false;
|
||||
|
||||
glm::vec3 _lookAtPosition;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue