Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1518,7 +1518,17 @@ void Application::update(float deltaTime) { · 1517 unmodified lines | |||
| 1518 | // Set where I am looking based on my mouse ray (so that other people can see) | 1518 | // Set where I am looking based on my mouse ray (so that other people can see) |
| 1519 | glm::vec3 lookAtSpot; | 1519 | glm::vec3 lookAtSpot; |
| 1520 | 1520 | ||
| 1521 | _isLookingAtOtherAvatar = isLookingAtOtherAvatar(mouseRayOrigin, mouseRayDirection, lookAtSpot); | 1521 | // if we have faceshift, use that to compute the lookat direction |
| 1522 | glm::vec3 lookAtRayOrigin = mouseRayOrigin, lookAtRayDirection = mouseRayDirection; | ||
| 1523 | if (_faceshift.isActive()) { | ||
| 1524 | lookAtRayOrigin = _myAvatar.getHead().calculateAverageEyePosition(); | ||
| 1525 | float averagePitch = (_faceshift.getEyeGazeLeftPitch() + _faceshift.getEyeGazeRightPitch()) / 2.0f; | ||
| 1526 | float averageYaw = (_faceshift.getEyeGazeLeftYaw() + _faceshift.getEyeGazeRightYaw()) / 2.0f; | ||
| 1527 | lookAtRayDirection = _myAvatar.getHead().getOrientation() * | ||
| 1528 | glm::quat(glm::vec3(averagePitch, averageYaw, 0.0f)) * glm::vec3(0.0f, 0.0f, -1.0f); | ||
| 1529 | } | ||
| 1530 | |||
| 1531 | _isLookingAtOtherAvatar = isLookingAtOtherAvatar(lookAtRayOrigin, lookAtRayDirection, lookAtSpot); | ||
| 1522 | if (_isLookingAtOtherAvatar) { | 1532 | if (_isLookingAtOtherAvatar) { |
| 1523 | // If the mouse is over another avatar's head... | 1533 | // If the mouse is over another avatar's head... |
| 1524 | _myAvatar.getHead().setLookAtPosition(lookAtSpot); | 1534 | _myAvatar.getHead().setLookAtPosition(lookAtSpot); |