History

Merge remote-tracking branch 'upstream/master' into menu

Stephen Birarda committed 13 years ago

Commit 98b144d2 parents 5b02125 6c1601c13 files · +303 −55Browse files

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

Unified · Split

interface/src/Application.cpp+15−11
@@ -1928,17 +1928,20 @@ void Application::updateAvatar(float deltaTime) { · 1927 unmodified lines
19281928 _headMouseY = min(_headMouseY, _glWidget->height());
19291929
19301930 const float MIDPOINT_OF_SCREEN = 0.5;
1931−
1932− // Set lookAtPosition if an avatar is at the center of the screen
1933− glm::vec3 screenCenterRayOrigin, screenCenterRayDirection;
1934− _viewFrustum.computePickRay(MIDPOINT_OF_SCREEN, MIDPOINT_OF_SCREEN, screenCenterRayOrigin, screenCenterRayDirection);
1935−
1936− glm::vec3 eyePosition;
19371931
1938− _isLookingAtOtherAvatar = isLookingAtOtherAvatar(screenCenterRayOrigin, screenCenterRayDirection, eyePosition);
1939− if (_isLookingAtOtherAvatar) {
1940− glm::vec3 myLookAtFromMouse(eyePosition);
1941− _myAvatar.getHead().setLookAtPosition(myLookAtFromMouse);
1932+ // Only use gyro to set lookAt if mouse hasn't selected an avatar
1933+ if (!_isLookingAtOtherAvatar) {
1934+
1935+ // Set lookAtPosition if an avatar is at the center of the screen
1936+ glm::vec3 screenCenterRayOrigin, screenCenterRayDirection;
1937+ _viewFrustum.computePickRay(MIDPOINT_OF_SCREEN, MIDPOINT_OF_SCREEN, screenCenterRayOrigin, screenCenterRayDirection);
1938+
1939+ glm::vec3 eyePosition;
1940+ _isLookingAtOtherAvatar = isLookingAtOtherAvatar(screenCenterRayOrigin, screenCenterRayDirection, eyePosition);
1941+ if (_isLookingAtOtherAvatar) {
1942+ glm::vec3 myLookAtFromMouse(eyePosition);
1943+ _myAvatar.getHead().setLookAtPosition(myLookAtFromMouse);
1944+ }
19421945 }
19431946
19441947 }
@@ -2343,6 +2346,7 @@ void Application::displaySide(Camera& whichCamera) { · 398 unmodified lines
23432346 if (!avatar->isInitialized()) {
23442347 avatar->init();
23452348 }
2349+ // Set lookAt to myCamera on client side if other avatars are looking at client
23462350 if (isLookingAtMyAvatar(avatar)) {
23472351 avatar->getHead().setLookAtPosition(_myCamera.getPosition());
23482352 }
@@ -3292,4 +3296,4 @@ void* Application::networkReceive(void* args) { · 943 unmodified lines
32923296 pthread_exit(0);
32933297 }
32943298 return NULL;
3295−}
3299+}

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