History

Add condition to updateAvatar() where if another avatar's head is at the center of the screen, the lookAtPosition is set to the eye level of that avatar.

Mark Peng committed 13 years ago

Commit f145a1e1 parent 39092171 file · +11 −0Browse files

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

Unified · Split

interface/src/Application.cpp+11−0
@@ -2016,6 +2016,17 @@ void Application::updateAvatar(float deltaTime) { · 2015 unmodified lines
20162016 _headMouseY = max(_headMouseY, 0);
20172017 _headMouseY = min(_headMouseY, _glWidget->height());
20182018
2019+ // Set lookAtPosition if an avatar is at the center of the screen
2020+
2021+ glm::vec3 screenCenterRayOrigin, screenCenterRayDirection;
2022+ _viewFrustum.computePickRay(0.5, 0.5, screenCenterRayOrigin, screenCenterRayDirection);
2023+
2024+ glm::vec3 eyePosition;
2025+ if (isLookingAtOtherAvatar(screenCenterRayOrigin, screenCenterRayDirection, eyePosition)) {
2026+ glm::vec3 myLookAtFromMouse(eyePosition);
2027+ _myAvatar.getHead().setLookAtPosition(myLookAtFromMouse);
2028+ }
2029+
20192030 }
20202031
20212032 if (OculusManager::isConnected()) {

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