Showing the changes to interface/src/Application.cpp (1 of 5 files). Show all
Unified · Split
| @@ -582,8 +582,8 @@ void Application::paintGL() { · 581 unmodified lines | ||
| 582 | 582 | |
| 583 | 583 | } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { |
| 584 | 584 | _myCamera.setTightness(0.0f); // Camera is directly connected to head without smoothing |
| 585 | − _myCamera.setTargetPosition(_myAvatar->getUprightHeadPosition()); | |
| 586 | − _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation()); | |
| 585 | + _myCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition()); | |
| 586 | + _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation()); | |
| 587 | 587 | |
| 588 | 588 | } else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) { |
| 589 | 589 | _myCamera.setTightness(0.0f); |
| @@ -594,17 +594,6 @@ void Application::paintGL() { · 4 unmodified lines | ||
| 594 | 594 | _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f))); |
| 595 | 595 | } |
| 596 | 596 | |
| 597 | − if (OculusManager::isConnected()) { | |
| 598 | − // Oculus in third person causes nausea, so only allow it if option is checked in dev menu | |
| 599 | − if (!Menu::getInstance()->isOptionChecked(MenuOption::AllowOculusCameraModeChange) || _myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) { | |
| 600 | − _myCamera.setDistance(0.0f); | |
| 601 | − _myCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition()); | |
| 602 | − _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation()); | |
| 603 | − } | |
| 604 | − _myCamera.setUpShift(0.0f); | |
| 605 | − _myCamera.setTightness(0.0f); // Camera is directly connected to head without smoothing | |
| 606 | − } | |
| 607 | − | |
| 608 | 597 | // Update camera position |
| 609 | 598 | _myCamera.update( 1.f/_fps ); |
| 610 | 599 | |
| @@ -638,7 +627,12 @@ void Application::paintGL() { · 27 unmodified lines | ||
| 638 | 627 | } |
| 639 | 628 | |
| 640 | 629 | if (OculusManager::isConnected()) { |
| 641 | − OculusManager::display(_myAvatar->getOrientation(), whichCamera); | |
| 630 | + //When in mirror mode, use camera rotation. Otherwise, use body rotation | |
| 631 | + if (whichCamera.getMode() == CAMERA_MODE_MIRROR) { | |
| 632 | + OculusManager::display(whichCamera.getRotation(), whichCamera.getPosition(), whichCamera); | |
| 633 | + } else { | |
| 634 | + OculusManager::display(_myAvatar->getWorldAlignedOrientation(), whichCamera.getPosition(), whichCamera); | |
| 635 | + } | |
| 642 | 636 | |
| 643 | 637 | } else if (TV3DManager::isConnected()) { |
| 644 | 638 | _glowEffect.prepare(); |