Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -382,6 +382,20 @@ void Application::paintGL() { · 381 unmodified lines | ||
| 382 | 382 | } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { |
| 383 | 383 | _myCamera.setTargetPosition(_myAvatar.getUprightHeadPosition()); |
| 384 | 384 | _myCamera.setTargetRotation(_myAvatar.getHead().getCameraOrientation()); |
| 385 | + | |
| 386 | + } else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) { | |
| 387 | + _myCamera.setTightness(0.0f); | |
| 388 | + _myCamera.setDistance(0.3f); | |
| 389 | + glm::vec3 targetPosition = _myAvatar.getUprightHeadPosition(); | |
| 390 | + if (_myAvatar.getHead().getBlendFace().isActive()) { | |
| 391 | + // make sure we're aligned to the blend face eyes | |
| 392 | + glm::vec3 leftEyePosition, rightEyePosition; | |
| 393 | + if (_myAvatar.getHead().getBlendFace().getEyePositions(leftEyePosition, rightEyePosition, true)) { | |
| 394 | + targetPosition = (leftEyePosition + rightEyePosition) * 0.5f; | |
| 395 | + } | |
| 396 | + } | |
| 397 | + _myCamera.setTargetPosition(targetPosition); | |
| 398 | + _myCamera.setTargetRotation(_myAvatar.getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f))); | |
| 385 | 399 | } |
| 386 | 400 | |
| 387 | 401 | // Update camera position |
| @@ -893,7 +907,11 @@ void Application::keyPressEvent(QKeyEvent* event) { · 505 unmodified lines | ||
| 893 | 907 | updateProjectionMatrix(); |
| 894 | 908 | break; |
| 895 | 909 | case Qt::Key_H: |
| 896 | − Menu::getInstance()->triggerOption(MenuOption::Mirror); | |
| 910 | + if (isShifted) { | |
| 911 | + Menu::getInstance()->triggerOption(MenuOption::Mirror); | |
| 912 | + } else { | |
| 913 | + Menu::getInstance()->triggerOption(MenuOption::FullscreenMirror); | |
| 914 | + } | |
| 897 | 915 | break; |
| 898 | 916 | case Qt::Key_F: |
| 899 | 917 | if (isShifted) { |
| @@ -2135,7 +2153,12 @@ void Application::update(float deltaTime) { · 1235 unmodified lines | ||
| 2135 | 2153 | } |
| 2136 | 2154 | |
| 2137 | 2155 | if (!OculusManager::isConnected()) { |
| 2138 | − if (Menu::getInstance()->isOptionChecked(MenuOption::FirstPerson)) { | |
| 2156 | + if (Menu::getInstance()->isOptionChecked(MenuOption::FullscreenMirror)) { | |
| 2157 | + if (_myCamera.getMode() != CAMERA_MODE_MIRROR) { | |
| 2158 | + _myCamera.setMode(CAMERA_MODE_MIRROR); | |
| 2159 | + _myCamera.setModeShiftRate(100.0f); | |
| 2160 | + } | |
| 2161 | + } else if (Menu::getInstance()->isOptionChecked(MenuOption::FirstPerson)) { | |
| 2139 | 2162 | if (_myCamera.getMode() != CAMERA_MODE_FIRST_PERSON) { |
| 2140 | 2163 | _myCamera.setMode(CAMERA_MODE_FIRST_PERSON); |
| 2141 | 2164 | _myCamera.setModeShiftRate(1.0f); |