Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -1531,14 +1531,15 @@ void Application::update(float deltaTime) { · 1530 unmodified lines | |||
| 1531 | // Set where I am looking based on my mouse ray (so that other people can see) | 1531 | // Set where I am looking based on my mouse ray (so that other people can see) |
| 1532 | glm::vec3 lookAtSpot; | 1532 | glm::vec3 lookAtSpot; |
| 1533 | 1533 | ||
| 1534 | // Update faceshift | ||
| 1535 | _faceshift.update(); | ||
| 1536 | |||
| 1534 | // if we have faceshift, use that to compute the lookat direction | 1537 | // if we have faceshift, use that to compute the lookat direction |
| 1535 | glm::vec3 lookAtRayOrigin = mouseRayOrigin, lookAtRayDirection = mouseRayDirection; | 1538 | glm::vec3 lookAtRayOrigin = mouseRayOrigin, lookAtRayDirection = mouseRayDirection; |
| 1536 | if (_faceshift.isActive()) { | 1539 | if (_faceshift.isActive()) { |
| 1537 | lookAtRayOrigin = _myAvatar.getHead().calculateAverageEyePosition(); | 1540 | lookAtRayOrigin = _myAvatar.getHead().calculateAverageEyePosition(); |
| 1538 | float averagePitch = (_faceshift.getEyeGazeLeftPitch() + _faceshift.getEyeGazeRightPitch()) / 2.0f; | 1541 | lookAtRayDirection = _myAvatar.getHead().getOrientation() * glm::quat(glm::radians(glm::vec3( |
| 1539 | float averageYaw = (_faceshift.getEyeGazeLeftYaw() + _faceshift.getEyeGazeRightYaw()) / 2.0f; | 1542 | _faceshift.getEstimatedEyePitch(), _faceshift.getEstimatedEyeYaw(), 0.0f))) * glm::vec3(0.0f, 0.0f, -1.0f); |
| 1540 | lookAtRayDirection = _myAvatar.getHead().getOrientation() * | ||
| 1541 | glm::quat(glm::radians(glm::vec3(averagePitch, averageYaw, 0.0f))) * glm::vec3(0.0f, 0.0f, -1.0f); | ||
| 1542 | } | 1543 | } |
| 1543 | 1544 | ||
| 1544 | _isLookingAtOtherAvatar = isLookingAtOtherAvatar(lookAtRayOrigin, lookAtRayDirection, lookAtSpot); | 1545 | _isLookingAtOtherAvatar = isLookingAtOtherAvatar(lookAtRayOrigin, lookAtRayDirection, lookAtSpot); |
| @@ -1707,8 +1708,6 @@ void Application::update(float deltaTime) { · 162 unmodified lines | |||
| 1707 | _serialHeadSensor.readData(deltaTime); | 1708 | _serialHeadSensor.readData(deltaTime); |
| 1708 | } | 1709 | } |
| 1709 | 1710 | ||
| 1710 | // Update transmitter | ||
| 1711 | |||
| 1712 | // Sample hardware, update view frustum if needed, and send avatar data to mixer/nodes | 1711 | // Sample hardware, update view frustum if needed, and send avatar data to mixer/nodes |
| 1713 | updateAvatar(deltaTime); | 1712 | updateAvatar(deltaTime); |
| 1714 | 1713 | ||