History

When Faceshift is active, use its eye directions rather than the mouse ray.

Andrzej Kapolka committed 13 years ago

Commit 0d593c41 parent 697484d1 file · +11 −1Browse files

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

Unified · Split

interface/src/Application.cpp+11−1
@@ -1518,7 +1518,17 @@ void Application::update(float deltaTime) { · 1517 unmodified lines
15181518 // Set where I am looking based on my mouse ray (so that other people can see)
15191519 glm::vec3 lookAtSpot;
15201520
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);
15221532 if (_isLookingAtOtherAvatar) {
15231533 // If the mouse is over another avatar's head...
15241534 _myAvatar.getHead().setLookAtPosition(lookAtSpot);

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