Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -79,8 +79,10 @@ const int MIRROR_VIEW_TOP_PADDING = 5; · 78 unmodified lines | |||
| 79 | const int MIRROR_VIEW_LEFT_PADDING = 10; | 79 | const int MIRROR_VIEW_LEFT_PADDING = 10; |
| 80 | const int MIRROR_VIEW_WIDTH = 265; | 80 | const int MIRROR_VIEW_WIDTH = 265; |
| 81 | const int MIRROR_VIEW_HEIGHT = 215; | 81 | const int MIRROR_VIEW_HEIGHT = 215; |
| 82 | const float MAX_ZOOM_DISTANCE = 0.3f; | 82 | const float MIRROR_FULLSCREEN_DISTANCE = 0.2f; |
| 83 | const float MIN_ZOOM_DISTANCE = 2.0f; | 83 | const float MIRROR_REARVIEW_DISTANCE = 0.3f; |
| 84 | const float MIRROR_REARVIEW_BODY_DISTANCE = 1.f; | ||
| 85 | |||
| 84 | 86 | ||
| 85 | void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) { | 87 | void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) { |
| 86 | fprintf(stdout, "%s", message.toLocal8Bit().constData()); | 88 | fprintf(stdout, "%s", message.toLocal8Bit().constData()); |
| @@ -379,11 +381,12 @@ void Application::paintGL() { · 292 unmodified lines | |||
| 379 | 381 | ||
| 380 | } else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) { | 382 | } else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) { |
| 381 | _myCamera.setTightness(0.0f); | 383 | _myCamera.setTightness(0.0f); |
| 382 | _myCamera.setDistance(MAX_ZOOM_DISTANCE); | 384 | float headHeight = _myAvatar.getHead().calculateAverageEyePosition().y - _myAvatar.getPosition().y; |
| 383 | _myCamera.setTargetPosition(_myAvatar.getHead().calculateAverageEyePosition()); | 385 | _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _myAvatar.getScale()); |
| 386 | _myCamera.setTargetPosition(_myAvatar.getPosition() + glm::vec3(0, headHeight, 0)); | ||
| 384 | _myCamera.setTargetRotation(_myAvatar.getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f))); | 387 | _myCamera.setTargetRotation(_myAvatar.getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f))); |
| 385 | } | 388 | } |
| 386 | 389 | ||
| 387 | // Update camera position | 390 | // Update camera position |
| 388 | _myCamera.update( 1.f/_fps ); | 391 | _myCamera.update( 1.f/_fps ); |
| 389 | 392 | ||
| @@ -435,10 +438,10 @@ void Application::paintGL() { · 45 unmodified lines | |||
| 435 | 438 | ||
| 436 | bool eyeRelativeCamera = false; | 439 | bool eyeRelativeCamera = false; |
| 437 | if (_rearMirrorTools->getZoomLevel() == BODY) { | 440 | if (_rearMirrorTools->getZoomLevel() == BODY) { |
| 438 | _mirrorCamera.setDistance(MIN_ZOOM_DISTANCE); | 441 | _mirrorCamera.setDistance(MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar.getScale()); |
| 439 | _mirrorCamera.setTargetPosition(_myAvatar.getChestJointPosition()); | 442 | _mirrorCamera.setTargetPosition(_myAvatar.getChestJointPosition()); |
| 440 | } else { // HEAD zoom level | 443 | } else { // HEAD zoom level |
| 441 | _mirrorCamera.setDistance(MAX_ZOOM_DISTANCE); | 444 | _mirrorCamera.setDistance(MIRROR_REARVIEW_DISTANCE * _myAvatar.getScale()); |
| 442 | if (_myAvatar.getSkeletonModel().isActive() && _myAvatar.getHead().getFaceModel().isActive()) { | 445 | if (_myAvatar.getSkeletonModel().isActive() && _myAvatar.getHead().getFaceModel().isActive()) { |
| 443 | // as a hack until we have a better way of dealing with coordinate precision issues, reposition the | 446 | // as a hack until we have a better way of dealing with coordinate precision issues, reposition the |
| 444 | // face/body so that the average eye position lies at the origin | 447 | // face/body so that the average eye position lies at the origin |