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
18881888 }
18891889 }
18901890
1891−const float HEAD_SPHERE_RADIUS = 0.07f;
1891+const float HEAD_SPHERE_RADIUS = 0.1f;
18921892
18931893 bool Application::isLookingAtMyAvatar(Avatar* avatar) {
1894− glm::vec3 theirLookat = avatar->getHead()->getLookAtPosition();
1895− glm::vec3 myHeadPosition = _myAvatar->getHead()->getPosition();
1896−
1897− if (pointInSphere(theirLookat, myHeadPosition, HEAD_SPHERE_RADIUS * _myAvatar->getScale())) {
1894+ glm::vec3 theirLookAt = avatar->getHead()->getLookAtPosition();
1895+ glm::vec3 myEyePosition = _myAvatar->getHead()->getEyePosition();
1896+ if (pointInSphere(theirLookAt, myEyePosition, HEAD_SPHERE_RADIUS * _myAvatar->getScale())) {
18981897 return true;
18991898 }
19001899 return false;
@@ -2000,21 +1999,23 @@ void Application::updateMyAvatarLookAtPosition() { · 99 unmodified lines
20001999 lookAtSpot = _myCamera.getPosition();
20012000
20022001 } else {
2003− if (_myAvatar->getLookAtTargetAvatar() && _myAvatar != _myAvatar->getLookAtTargetAvatar()) {
2002+ AvatarSharedPointer lookingAt = _myAvatar->getLookAtTargetAvatar().toStrongRef();
2003+ if (lookingAt && _myAvatar != lookingAt.data()) {
2004+
20042005 isLookingAtSomeone = true;
20052006 // If I am looking at someone else, look directly at one of their eyes
20062007 if (tracker) {
20072008 // If tracker active, look at the eye for the side my gaze is biased toward
20082009 if (tracker->getEstimatedEyeYaw() > _myAvatar->getHead()->getFinalYaw()) {
20092010 // Look at their right eye
2010− lookAtSpot = static_cast<Avatar*>(_myAvatar->getLookAtTargetAvatar())->getHead()->getRightEyePosition();
2011+ lookAtSpot = static_cast<Avatar*>(lookingAt.data())->getHead()->getRightEyePosition();
20112012 } else {
20122013 // Look at their left eye
2013− lookAtSpot = static_cast<Avatar*>(_myAvatar->getLookAtTargetAvatar())->getHead()->getLeftEyePosition();
2014+ lookAtSpot = static_cast<Avatar*>(lookingAt.data())->getHead()->getLeftEyePosition();
20142015 }
20152016 } else {
20162017 // 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();
20182019 }
20192020 } else {
20202021 // 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