History

Merge pull request #3479 from PhilipRosedale/master

Improved eye contact, audio driven mouth and brows, linear audio scope

Brad Hefta-Gaub committed 12 years ago

Commit 0775e9d2 parents 9878cdd fcc5eb912 files · +82 −48Browse files

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

Unified · Split

interface/src/Application.cpp+10−9
@@ -1888,13 +1888,12 @@ void Application::shrinkMirrorView() { · 1887 unmodified lines
1888 }1888 }
1889}1889}
1890 1890
1891const float HEAD_SPHERE_RADIUS = 0.07f;1891const float HEAD_SPHERE_RADIUS = 0.1f;
1892 1892
1893bool Application::isLookingAtMyAvatar(Avatar* avatar) {1893bool Application::isLookingAtMyAvatar(Avatar* avatar) {
1894 glm::vec3 theirLookat = avatar->getHead()->getLookAtPosition();1894 glm::vec3 theirLookAt = avatar->getHead()->getLookAtPosition();
1895 glm::vec3 myHeadPosition = _myAvatar->getHead()->getPosition();1895 glm::vec3 myEyePosition = _myAvatar->getHead()->getEyePosition();
1896 1896 if (pointInSphere(theirLookAt, myEyePosition, HEAD_SPHERE_RADIUS * _myAvatar->getScale())) {
1897 if (pointInSphere(theirLookat, myHeadPosition, HEAD_SPHERE_RADIUS * _myAvatar->getScale())) {
1898 return true;1897 return true;
1899 }1898 }
1900 return false;1899 return false;
@@ -2000,21 +1999,23 @@ void Application::updateMyAvatarLookAtPosition() { · 99 unmodified lines
2000 lookAtSpot = _myCamera.getPosition();1999 lookAtSpot = _myCamera.getPosition();
2001 2000
2002 } else {2001 } else {
2003 if (_myAvatar->getLookAtTargetAvatar() && _myAvatar != _myAvatar->getLookAtTargetAvatar()) {2002 AvatarSharedPointer lookingAt = _myAvatar->getLookAtTargetAvatar().toStrongRef();
2003 if (lookingAt && _myAvatar != lookingAt.data()) {
2004
2004 isLookingAtSomeone = true;2005 isLookingAtSomeone = true;
2005 // If I am looking at someone else, look directly at one of their eyes2006 // If I am looking at someone else, look directly at one of their eyes
2006 if (tracker) {2007 if (tracker) {
2007 // If tracker active, look at the eye for the side my gaze is biased toward2008 // If tracker active, look at the eye for the side my gaze is biased toward
2008 if (tracker->getEstimatedEyeYaw() > _myAvatar->getHead()->getFinalYaw()) {2009 if (tracker->getEstimatedEyeYaw() > _myAvatar->getHead()->getFinalYaw()) {
2009 // Look at their right eye2010 // Look at their right eye
2010 lookAtSpot = static_cast<Avatar*>(_myAvatar->getLookAtTargetAvatar())->getHead()->getRightEyePosition();2011 lookAtSpot = static_cast<Avatar*>(lookingAt.data())->getHead()->getRightEyePosition();
2011 } else {2012 } else {
2012 // Look at their left eye2013 // Look at their left eye
2013 lookAtSpot = static_cast<Avatar*>(_myAvatar->getLookAtTargetAvatar())->getHead()->getLeftEyePosition();2014 lookAtSpot = static_cast<Avatar*>(lookingAt.data())->getHead()->getLeftEyePosition();
2014 }2015 }
2015 } else {2016 } else {
2016 // Need to add randomly looking back and forth between left and right eye for case with no tracker2017 // Need to add randomly looking back and forth between left and right eye for case with no tracker
2017 lookAtSpot = static_cast<Avatar*>(_myAvatar->getLookAtTargetAvatar())->getHead()->getEyePosition();2018 lookAtSpot = static_cast<Avatar*>(lookingAt.data())->getHead()->getEyePosition();
2018 }2019 }
2019 } else {2020 } else {
2020 // I am not looking at anyone else, so just look forward2021 // 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