History

made calculateAverageEyePosition private, changed to getEyePosition() where used outside head

Philip Rosedale committed 12 years ago

Commit 5aecbe61 parent 00fdc374 files · +15 −14Browse files

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

Unified · Split

interface/src/Application.cpp+7−7
@@ -611,10 +611,10 @@ void Application::paintGL() { · 610 unmodified lines
611 if (OculusManager::isConnected()) {611 if (OculusManager::isConnected()) {
612 _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _scaleMirror);612 _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _scaleMirror);
613 _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f)));613 _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f)));
614 _myCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition() + glm::vec3(0, _raiseMirror * _myAvatar->getScale(), 0));614 _myCamera.setTargetPosition(_myAvatar->getHead()->getEyePosition() + glm::vec3(0, _raiseMirror * _myAvatar->getScale(), 0));
615 } else {615 } else {
616 _myCamera.setTightness(0.0f);616 _myCamera.setTightness(0.0f);
617 glm::vec3 eyePosition = _myAvatar->getHead()->calculateAverageEyePosition();617 glm::vec3 eyePosition = _myAvatar->getHead()->getFilteredEyePosition();
618 float headHeight = eyePosition.y - _myAvatar->getPosition().y;618 float headHeight = eyePosition.y - _myAvatar->getPosition().y;
619 _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _scaleMirror);619 _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _scaleMirror);
620 _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight + (_raiseMirror * _myAvatar->getScale()), 0));620 _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight + (_raiseMirror * _myAvatar->getScale()), 0));
@@ -1910,14 +1910,14 @@ void Application::updateMyAvatarLookAtPosition() { · 1289 unmodified lines
1910 }1910 }
1911 } else {1911 } else {
1912 // I am not looking at anyone else, so just look forward1912 // I am not looking at anyone else, so just look forward
1913 lookAtSpot = _myAvatar->getHead()->calculateAverageEyePosition() + 1913 lookAtSpot = _myAvatar->getHead()->getEyePosition() +
1914 (_myAvatar->getHead()->getFinalOrientationInWorldFrame() * glm::vec3(0.f, 0.f, -TREE_SCALE));1914 (_myAvatar->getHead()->getFinalOrientationInWorldFrame() * glm::vec3(0.f, 0.f, -TREE_SCALE));
1915 }1915 }
1916 // TODO: Add saccade to mouse pointer when stable, IF not looking at someone (since we know we are looking at it)1916 // TODO: Add saccade to mouse pointer when stable, IF not looking at someone (since we know we are looking at it)
1917 /*1917 /*
1918 const float FIXED_MIN_EYE_DISTANCE = 0.3f;1918 const float FIXED_MIN_EYE_DISTANCE = 0.3f;
1919 float minEyeDistance = FIXED_MIN_EYE_DISTANCE + (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON ? 0.0f :1919 float minEyeDistance = FIXED_MIN_EYE_DISTANCE + (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON ? 0.0f :
1920 glm::distance(_mouseRayOrigin, _myAvatar->getHead()->calculateAverageEyePosition()));1920 glm::distance(_mouseRayOrigin, _myAvatar->getHead()->getAverageEyePosition()));
1921 lookAtSpot = _mouseRayOrigin + _mouseRayDirection * qMax(minEyeDistance, distance);1921 lookAtSpot = _mouseRayOrigin + _mouseRayDirection * qMax(minEyeDistance, distance);
1922 */1922 */
1923 1923
@@ -1930,7 +1930,7 @@ void Application::updateMyAvatarLookAtPosition() { · 6 unmodified lines
1930 float eyeYaw = tracker->getEstimatedEyeYaw();1930 float eyeYaw = tracker->getEstimatedEyeYaw();
1931 const float GAZE_DEFLECTION_REDUCTION_DURING_EYE_CONTACT = 0.1f;1931 const float GAZE_DEFLECTION_REDUCTION_DURING_EYE_CONTACT = 0.1f;
1932 // deflect using Faceshift gaze data1932 // deflect using Faceshift gaze data
1933 glm::vec3 origin = _myAvatar->getHead()->calculateAverageEyePosition();1933 glm::vec3 origin = _myAvatar->getHead()->getEyePosition();
1934 float pitchSign = (_myCamera.getMode() == CAMERA_MODE_MIRROR) ? -1.0f : 1.0f;1934 float pitchSign = (_myCamera.getMode() == CAMERA_MODE_MIRROR) ? -1.0f : 1.0f;
1935 float deflection = Menu::getInstance()->getFaceshiftEyeDeflection();1935 float deflection = Menu::getInstance()->getFaceshiftEyeDeflection();
1936 if (isLookingAtSomeone) {1936 if (isLookingAtSomeone) {
@@ -2934,7 +2934,7 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 997 unmodified lines
2934 _mirrorCamera.setTargetPosition(glm::vec3());2934 _mirrorCamera.setTargetPosition(glm::vec3());
2935 2935
2936 } else {2936 } else {
2937 _mirrorCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition());2937 _mirrorCamera.setTargetPosition(_myAvatar->getHead()->getEyePosition());
2938 }2938 }
2939 }2939 }
2940 _mirrorCamera.setAspectRatio((float)region.width() / region.height());2940 _mirrorCamera.setAspectRatio((float)region.width() / region.height());
@@ -2963,7 +2963,7 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 22 unmodified lines
2963 _myAvatar->getSkeletonModel().getNeckPosition(neckPosition);2963 _myAvatar->getSkeletonModel().getNeckPosition(neckPosition);
2964 2964
2965 // get the eye position relative to the body2965 // get the eye position relative to the body
2966 glm::vec3 eyePosition = _myAvatar->getHead()->calculateAverageEyePosition(); 2966 glm::vec3 eyePosition = _myAvatar->getHead()->getEyePosition();
2967 float eyeHeight = eyePosition.y - _myAvatar->getPosition().y;2967 float eyeHeight = eyePosition.y - _myAvatar->getPosition().y;
2968 2968
2969 // set the translation of the face relative to the neck position2969 // set the translation of the face relative to the neck position

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