History

Merge branch 'master' of https://github.com/worklist/hifi

Andrzej Kapolka committed 12 years ago

Commit f2687972 parents 9641ca1 569425d1 file · +10 −7Browse files

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

Unified · Split

interface/src/Application.cpp+10−7
@@ -79,8 +79,10 @@ const int MIRROR_VIEW_TOP_PADDING = 5; · 78 unmodified lines
79const int MIRROR_VIEW_LEFT_PADDING = 10;79const int MIRROR_VIEW_LEFT_PADDING = 10;
80const int MIRROR_VIEW_WIDTH = 265;80const int MIRROR_VIEW_WIDTH = 265;
81const int MIRROR_VIEW_HEIGHT = 215;81const int MIRROR_VIEW_HEIGHT = 215;
82const float MAX_ZOOM_DISTANCE = 0.3f;82const float MIRROR_FULLSCREEN_DISTANCE = 0.2f;
83const float MIN_ZOOM_DISTANCE = 2.0f;83const float MIRROR_REARVIEW_DISTANCE = 0.3f;
84const float MIRROR_REARVIEW_BODY_DISTANCE = 1.f;
85
84 86
85void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) {87void 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 position390 // 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 level443 } 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 the446 // 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 origin447 // face/body so that the average eye position lies at the origin

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t