Showing the changes to interface/src/Application.cpp (1 of 46 files). Show all
Unified · Split
| @@ -1151,14 +1151,27 @@ void Application::paintGL() { · 1150 unmodified lines | ||
| 1151 | 1151 | } |
| 1152 | 1152 | |
| 1153 | 1153 | } else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) { |
| 1154 | − _myCamera.setRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f))); | |
| 1155 | − _myCamera.setPosition(_myAvatar->getDefaultEyePosition() + | |
| 1156 | − glm::vec3(0, _raiseMirror * _myAvatar->getScale(), 0) + | |
| 1157 | − (_myAvatar->getOrientation() * glm::quat(glm::vec3(0.0f, _rotateMirror, 0.0f))) * | |
| 1158 | − glm::vec3(0.0f, 0.0f, -1.0f) * MIRROR_FULLSCREEN_DISTANCE * _scaleMirror); | |
| 1154 | + if (isHMDMode()) { | |
| 1155 | + glm::quat hmdRotation = extractRotation(_myAvatar->getHMDSensorMatrix()); | |
| 1156 | + _myCamera.setRotation(_myAvatar->getWorldAlignedOrientation() | |
| 1157 | + * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f)) * hmdRotation); | |
| 1158 | + glm::vec3 hmdOffset = extractTranslation(_myAvatar->getHMDSensorMatrix()); | |
| 1159 | + _myCamera.setPosition(_myAvatar->getDefaultEyePosition() | |
| 1160 | + + glm::vec3(0, _raiseMirror * _myAvatar->getScale(), 0) | |
| 1161 | + + (_myAvatar->getOrientation() * glm::quat(glm::vec3(0.0f, _rotateMirror, 0.0f))) * | |
| 1162 | + glm::vec3(0.0f, 0.0f, -1.0f) * MIRROR_FULLSCREEN_DISTANCE * _scaleMirror | |
| 1163 | + + (_myAvatar->getOrientation() * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f))) * hmdOffset); | |
| 1164 | + } else { | |
| 1165 | + _myCamera.setRotation(_myAvatar->getWorldAlignedOrientation() | |
| 1166 | + * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f))); | |
| 1167 | + _myCamera.setPosition(_myAvatar->getDefaultEyePosition() | |
| 1168 | + + glm::vec3(0, _raiseMirror * _myAvatar->getScale(), 0) | |
| 1169 | + + (_myAvatar->getOrientation() * glm::quat(glm::vec3(0.0f, _rotateMirror, 0.0f))) * | |
| 1170 | + glm::vec3(0.0f, 0.0f, -1.0f) * MIRROR_FULLSCREEN_DISTANCE * _scaleMirror); | |
| 1171 | + } | |
| 1159 | 1172 | renderArgs._renderMode = RenderArgs::MIRROR_RENDER_MODE; |
| 1160 | 1173 | } |
| 1161 | − // Update camera position | |
| 1174 | + // Update camera position | |
| 1162 | 1175 | if (!isHMDMode()) { |
| 1163 | 1176 | _myCamera.update(1.0f / _fps); |
| 1164 | 1177 | } |
| @@ -2600,11 +2613,7 @@ void Application::updateMyAvatarLookAtPosition() { · 1435 unmodified lines | ||
| 2600 | 2613 | if (_myCamera.getMode() == CAMERA_MODE_MIRROR) { |
| 2601 | 2614 | // When I am in mirror mode, just look right at the camera (myself); don't switch gaze points because when physically |
| 2602 | 2615 | // looking in a mirror one's eyes appear steady. |
| 2603 | − if (!isHMD) { | |
| 2604 | − lookAtSpot = _myCamera.getPosition(); | |
| 2605 | − } else { | |
| 2606 | − lookAtSpot = _myCamera.getPosition() + transformPoint(_myAvatar->getSensorToWorldMatrix(), extractTranslation(getHMDSensorPose())); | |
| 2607 | − } | |
| 2616 | + lookAtSpot = _myCamera.getPosition(); | |
| 2608 | 2617 | } else if (eyeTracker->isTracking() && (isHMD || eyeTracker->isSimulating())) { |
| 2609 | 2618 | // Look at the point that the user is looking at. |
| 2610 | 2619 | if (isHMD) { |