History

resolve conflicts on merge with upstream/master

Stephen Birarda committed 11 years ago

Commit da3502e2 parents cf15cbc 625cc86160 files · +4323 −5031Browse files

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

Unified · Split

interface/src/Application.cpp+33−27
@@ -1014,6 +1014,7 @@ void Application::paintGL() { · 1013 unmodified lines
10141014
10151015 void Application::runTests() {
10161016 runTimingTests();
1017+ runUnitTests();
10171018 }
10181019
10191020 void Application::audioMuteToggled() {
@@ -2308,38 +2309,42 @@ void Application::updateMyAvatarLookAtPosition() { · 1288 unmodified lines
23082309 bool isLookingAtSomeone = false;
23092310 glm::vec3 lookAtSpot;
23102311 if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
2311− // When I am in mirror mode, just look right at the camera (myself)
2312+ // When I am in mirror mode, just look right at the camera (myself); don't switch gaze points because when physically
2313+ // looking in a mirror one's eyes appear steady.
23122314 if (!OculusManager::isConnected()) {
23132315 lookAtSpot = _myCamera.getPosition();
23142316 } else {
2315− if (_myAvatar->isLookingAtLeftEye()) {
2316− lookAtSpot = OculusManager::getLeftEyePosition();
2317− } else {
2318− lookAtSpot = OculusManager::getRightEyePosition();
2319− }
2317+ lookAtSpot = _myCamera.getPosition() + OculusManager::getMidEyePosition();
23202318 }
2321−
23222319 } else {
23232320 AvatarSharedPointer lookingAt = _myAvatar->getLookAtTargetAvatar().lock();
23242321 if (lookingAt && _myAvatar != lookingAt.get()) {
2325− isLookingAtSomeone = true;
23262322 // If I am looking at someone else, look directly at one of their eyes
2327− if (tracker && !tracker->isMuted()) {
2328− // If a face tracker is active, look at the eye for the side my gaze is biased toward
2329− if (tracker->getEstimatedEyeYaw() > _myAvatar->getHead()->getFinalYaw()) {
2330− // Look at their right eye
2331− lookAtSpot = static_cast<Avatar*>(lookingAt.get())->getHead()->getRightEyePosition();
2332− } else {
2333− // Look at their left eye
2334− lookAtSpot = static_cast<Avatar*>(lookingAt.get())->getHead()->getLeftEyePosition();
2323+ isLookingAtSomeone = true;
2324+ Head* lookingAtHead = static_cast<Avatar*>(lookingAt.get())->getHead();
2325+
2326+ const float MAXIMUM_FACE_ANGLE = 65.0f * RADIANS_PER_DEGREE;
2327+ glm::vec3 lookingAtFaceOrientation = lookingAtHead->getFinalOrientationInWorldFrame() * IDENTITY_FRONT;
2328+ glm::vec3 fromLookingAtToMe = glm::normalize(_myAvatar->getHead()->getEyePosition()
2329+ - lookingAtHead->getEyePosition());
2330+ float faceAngle = glm::angle(lookingAtFaceOrientation, fromLookingAtToMe);
2331+
2332+ if (faceAngle < MAXIMUM_FACE_ANGLE) {
2333+ // Randomly look back and forth between look targets
2334+ switch (_myAvatar->getEyeContactTarget()) {
2335+ case LEFT_EYE:
2336+ lookAtSpot = lookingAtHead->getLeftEyePosition();
2337+ break;
2338+ case RIGHT_EYE:
2339+ lookAtSpot = lookingAtHead->getRightEyePosition();
2340+ break;
2341+ case MOUTH:
2342+ lookAtSpot = lookingAtHead->getMouthPosition();
2343+ break;
23352344 }
23362345 } else {
2337− // Need to add randomly looking back and forth between left and right eye for case with no tracker
2338− if (_myAvatar->isLookingAtLeftEye()) {
2339− lookAtSpot = static_cast<Avatar*>(lookingAt.get())->getHead()->getLeftEyePosition();
2340− } else {
2341− lookAtSpot = static_cast<Avatar*>(lookingAt.get())->getHead()->getRightEyePosition();
2342− }
2346+ // Just look at their head (mid point between eyes)
2347+ lookAtSpot = lookingAtHead->getEyePosition();
23432348 }
23442349 } else {
23452350 // I am not looking at anyone else, so just look forward
@@ -2347,14 +2352,13 @@ void Application::updateMyAvatarLookAtPosition() { · 1 unmodified line
23472352 (_myAvatar->getHead()->getFinalOrientationInWorldFrame() * glm::vec3(0.0f, 0.0f, -TREE_SCALE));
23482353 }
23492354 }
2350− //
2351− // Deflect the eyes a bit to match the detected Gaze from 3D camera if active
2352− //
2353− if (tracker && !tracker->isMuted()) {
2355+
2356+ // Deflect the eyes a bit to match the detected gaze from Faceshift if active.
2357+ // DDE doesn't track eyes.
2358+ if (tracker && typeid(*tracker) == typeid(Faceshift) && !tracker->isMuted()) {
23542359 float eyePitch = tracker->getEstimatedEyePitch();
23552360 float eyeYaw = tracker->getEstimatedEyeYaw();
23562361 const float GAZE_DEFLECTION_REDUCTION_DURING_EYE_CONTACT = 0.1f;
2357− // deflect using Faceshift gaze data
23582362 glm::vec3 origin = _myAvatar->getHead()->getEyePosition();
23592363 float pitchSign = (_myCamera.getMode() == CAMERA_MODE_MIRROR) ? -1.0f : 1.0f;
23602364 float deflection = DependencyManager::get<Faceshift>()->getEyeDeflection();
@@ -3530,6 +3534,8 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 1169 unmodified lines
35303534 renderContext._maxDrawnTransparentItems = sceneInterface->getEngineMaxDrawnTransparentItems();
35313535 renderContext._maxDrawnOverlay3DItems = sceneInterface->getEngineMaxDrawnOverlay3DItems();
35323536
3537+ renderContext._drawItemStatus = sceneInterface->doEngineDisplayItemStatus();
3538+
35333539 renderArgs->_shouldRender = LODManager::shouldRender;
35343540
35353541 renderContext.args = renderArgs;