History

The basic billboard behavior, closes #1864.

Andrzej Kapolka committed 12 years ago

Commit ac026091 parent 8d0152714 files · +146 −19Browse files

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

Unified · Split

interface/src/Application.cpp+9−3
@@ -98,6 +98,7 @@ const int MIRROR_VIEW_HEIGHT = 215; · 97 unmodified lines
9898 const float MIRROR_FULLSCREEN_DISTANCE = 0.35f;
9999 const float MIRROR_REARVIEW_DISTANCE = 0.65f;
100100 const float MIRROR_REARVIEW_BODY_DISTANCE = 2.3f;
101+const float MIRROR_FIELD_OF_VIEW = 30.0f;
101102
102103 const QString CHECK_VERSION_URL = "http://highfidelity.io/latestVersion.xml";
103104 const QString SKIP_FILENAME = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/hifi.skipversion";
@@ -2688,7 +2689,7 @@ QImage Application::renderAvatarBillboard() { · 2584 unmodified lines
26882689
26892690 glDisable(GL_BLEND);
26902691
2691− const int BILLBOARD_SIZE = 128;
2692+ const int BILLBOARD_SIZE = 64;
26922693 renderRearViewMirror(QRect(0, _glWidget->height() - BILLBOARD_SIZE, BILLBOARD_SIZE, BILLBOARD_SIZE), true);
26932694
26942695 QImage image(BILLBOARD_SIZE, BILLBOARD_SIZE, QImage::Format_ARGB32);
@@ -3621,13 +3622,17 @@ void Application::renderCoverageMapsRecursively(CoverageMap* map) { · 926 unmodified lines
36213622 void Application::renderRearViewMirror(const QRect& region, bool billboard) {
36223623 bool eyeRelativeCamera = false;
36233624 if (billboard) {
3624− const float BILLBOARD_DISTANCE = 5.0f;
3625+ _mirrorCamera.setFieldOfView(BILLBOARD_FIELD_OF_VIEW);
36253626 _mirrorCamera.setDistance(BILLBOARD_DISTANCE * _myAvatar->getScale());
36263627 _mirrorCamera.setTargetPosition(_myAvatar->getPosition());
3628+
36273629 } else if (_rearMirrorTools->getZoomLevel() == BODY) {
3630+ _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW);
36283631 _mirrorCamera.setDistance(MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar->getScale());
36293632 _mirrorCamera.setTargetPosition(_myAvatar->getChestPosition());
3633+
36303634 } else { // HEAD zoom level
3635+ _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW);
36313636 _mirrorCamera.setDistance(MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale());
36323637 if (_myAvatar->getSkeletonModel().isActive() && _myAvatar->getHead()->getFaceModel().isActive()) {
36333638 // as a hack until we have a better way of dealing with coordinate precision issues, reposition the
@@ -3639,7 +3644,8 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 5 unmodified lines
36393644 _mirrorCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition());
36403645 }
36413646 }
3642−
3647+ _mirrorCamera.setAspectRatio((float)region.width() / region.height());
3648+
36433649 _mirrorCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f)));
36443650 _mirrorCamera.update(1.0f/_fps);
36453651

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