History

Merge pull request #4768 from jherico/track-camera

Remove camera wobble caused by having a face tracker enabled

Philip Rosedale committed 11 years ago

Commit d52d3512 parents 457ae5b dc1b5a21 file · +9 −4Browse files

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

Unified · Split

interface/src/Application.cpp+9−4
@@ -824,13 +824,18 @@ void Application::paintGL() { · 823 unmodified lines
824 glEnable(GL_LINE_SMOOTH);824 glEnable(GL_LINE_SMOOTH);
825 825
826 if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) {826 if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) {
827 // Always use the default eye position, not the actual head eye position.
828 // Using the latter will cause the camera to wobble with idle animations,
829 // or with changes from the face tracker
830 _myCamera.setPosition(_myAvatar->getDefaultEyePosition());
827 if (!OculusManager::isConnected()) {831 if (!OculusManager::isConnected()) {
828 // If there isn't an HMD, match exactly to avatar's head832 // If not using an HMD, grab the camera orientation directly
829 _myCamera.setPosition(_myAvatar->getHead()->getEyePosition());
830 _myCamera.setRotation(_myAvatar->getHead()->getCameraOrientation());833 _myCamera.setRotation(_myAvatar->getHead()->getCameraOrientation());
831 } else {834 } else {
832 // For an HMD, set the base position and orientation to that of the avatar body835 // In an HMD, people can look up and down with their actual neck, and the
833 _myCamera.setPosition(_myAvatar->getDefaultEyePosition());836 // per-eye HMD pose will be applied later. So set the camera orientation
837 // to only the yaw, excluding pitch and roll, i.e. an orientation that
838 // is orthongonal to the (body's) Y axis
834 _myCamera.setRotation(_myAvatar->getWorldAlignedOrientation());839 _myCamera.setRotation(_myAvatar->getWorldAlignedOrientation());
835 }840 }
836 841