History

Merge pull request #3488 from PhilipRosedale/master

Correct eye contact for Oculus users

Stephen Birarda committed 12 years ago

Commit 7c738ed2 parents 2f609bb f66f5658 files · +102 −47Browse files

Showing the changes to interface/src/Application.cpp (1 of 8 files). Show all

Unified · Split

interface/src/Application.cpp+16−4
@@ -1997,8 +1997,16 @@ void Application::updateMyAvatarLookAtPosition() { · 1996 unmodified lines
19971997 glm::vec3 lookAtSpot;
19981998 if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
19991999 // When I am in mirror mode, just look right at the camera (myself)
2000− lookAtSpot = _myCamera.getPosition();
2001−
2000+ if (!OculusManager::isConnected()) {
2001+ lookAtSpot = _myCamera.getPosition();
2002+ } else {
2003+ if (_myAvatar->isLookingAtLeftEye()) {
2004+ lookAtSpot = OculusManager::getLeftEyePosition();
2005+ } else {
2006+ lookAtSpot = OculusManager::getRightEyePosition();
2007+ }
2008+ }
2009+
20022010 } else {
20032011 AvatarSharedPointer lookingAt = _myAvatar->getLookAtTargetAvatar().toStrongRef();
20042012 if (lookingAt && _myAvatar != lookingAt.data()) {
@@ -2006,7 +2014,7 @@ void Application::updateMyAvatarLookAtPosition() { · 1 unmodified line
20062014 isLookingAtSomeone = true;
20072015 // If I am looking at someone else, look directly at one of their eyes
20082016 if (tracker) {
2009− // If tracker active, look at the eye for the side my gaze is biased toward
2017+ // If a face tracker is active, look at the eye for the side my gaze is biased toward
20102018 if (tracker->getEstimatedEyeYaw() > _myAvatar->getHead()->getFinalYaw()) {
20112019 // Look at their right eye
20122020 lookAtSpot = static_cast<Avatar*>(lookingAt.data())->getHead()->getRightEyePosition();
@@ -2016,7 +2024,11 @@ void Application::updateMyAvatarLookAtPosition() { · 3 unmodified lines
20162024 }
20172025 } else {
20182026 // Need to add randomly looking back and forth between left and right eye for case with no tracker
2019− lookAtSpot = static_cast<Avatar*>(lookingAt.data())->getHead()->getEyePosition();
2027+ if (_myAvatar->isLookingAtLeftEye()) {
2028+ lookAtSpot = static_cast<Avatar*>(lookingAt.data())->getHead()->getLeftEyePosition();
2029+ } else {
2030+ lookAtSpot = static_cast<Avatar*>(lookingAt.data())->getHead()->getRightEyePosition();
2031+ }
20202032 }
20212033 } else {
20222034 // I am not looking at anyone else, so just look forward

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t