History

Fix rearview mirror camera

Philip Rosedale committed 12 years ago

Commit 12349a81 parent 00c182a1 file · +4 −4Browse files

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

Unified · Split

interface/src/Application.cpp+4−4
@@ -3099,12 +3099,12 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 3098 unmodified lines
30993099 if (billboard) {
31003100 _mirrorCamera.setFieldOfView(BILLBOARD_FIELD_OF_VIEW); // degees
31013101 _mirrorCamera.setPosition(_myAvatar->getPosition() +
3102− _myAvatar->getOrientation() * glm::vec3(0.f, 0.f, 1.0f) * BILLBOARD_DISTANCE * _myAvatar->getScale());
3102+ _myAvatar->getOrientation() * glm::vec3(0.f, 0.f, -1.0f) * BILLBOARD_DISTANCE * _myAvatar->getScale());
31033103
31043104 } else if (_rearMirrorTools->getZoomLevel() == BODY) {
31053105 _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees
31063106 _mirrorCamera.setPosition(_myAvatar->getChestPosition() +
3107− _myAvatar->getOrientation() * glm::vec3(0.f, 0.f, 1.0f) * MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar->getScale());
3107+ _myAvatar->getOrientation() * glm::vec3(0.f, 0.f, -1.0f) * MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar->getScale());
31083108
31093109 } else { // HEAD zoom level
31103110 _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees
@@ -3112,11 +3112,11 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 1 unmodified line
31123112 // as a hack until we have a better way of dealing with coordinate precision issues, reposition the
31133113 // face/body so that the average eye position lies at the origin
31143114 eyeRelativeCamera = true;
3115− _mirrorCamera.setPosition(glm::vec3());
3115+ _mirrorCamera.setPosition(_myAvatar->getOrientation() * glm::vec3(0.f, 0.f, -1.0f) * MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale());
31163116
31173117 } else {
31183118 _mirrorCamera.setPosition(_myAvatar->getHead()->getEyePosition() +
3119− _myAvatar->getOrientation() * glm::vec3(0.f, 0.f, 1.0f) * MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale());
3119+ _myAvatar->getOrientation() * glm::vec3(0.f, 0.f, -1.0f) * MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale());
31203120 }
31213121 }
31223122 _mirrorCamera.setAspectRatio((float)region.width() / region.height());

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