Control eyes only if in HMD view or simulating

This commit is contained in:
David Rowe 2015-07-29 11:14:00 -07:00
parent 1ae920368d
commit 76fe0c8764
3 changed files with 4 additions and 1 deletions

View file

@ -2295,7 +2295,7 @@ void Application::updateMyAvatarLookAtPosition() {
} else { } else {
lookAtSpot = _myCamera.getPosition() + OculusManager::getMidEyePosition(); 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. // Look at the point that the user is looking at.
lookAtSpot = _myAvatar->getHead()->getEyePosition() + lookAtSpot = _myAvatar->getHead()->getEyePosition() +
(_myAvatar->getHead()->getFinalOrientationInWorldFrame() * eyeTracker->getLookAtPosition()); (_myAvatar->getHead()->getFinalOrientationInWorldFrame() * eyeTracker->getLookAtPosition());

View file

@ -130,6 +130,7 @@ void EyeTracker::setEnabled(bool enabled, bool simulate) {
} }
_isEnabled = enabled && success; _isEnabled = enabled && success;
_isSimulating = _isEnabled && simulate;
if (!success) { if (!success) {
// Display error dialog after updating _isEnabled. // Display error dialog after updating _isEnabled.

View file

@ -28,6 +28,7 @@ public:
~EyeTracker(); ~EyeTracker();
bool isTracking() { return _isEnabled; } bool isTracking() { return _isEnabled; }
bool isSimulating() { return _isSimulating; }
glm::vec3 getLookAtPosition() { return _lookAtPosition; } // From mid eye point in head frame. glm::vec3 getLookAtPosition() { return _lookAtPosition; } // From mid eye point in head frame.
@ -43,6 +44,7 @@ private:
bool _isInitialized = false; bool _isInitialized = false;
bool _isEnabled = false; bool _isEnabled = false;
bool _isSimulating = false;
glm::vec3 _lookAtPosition; glm::vec3 _lookAtPosition;
}; };