History

- fixed aspect ratio on mirror view - stop rendering voxel selectors on mirror view

stojce committed 13 years ago

Commit 890313b1 parent 7a0d8282 files · +13 −4Browse files

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

Unified · Split

interface/src/Application.cpp+12−4
@@ -444,6 +444,8 @@ void Application::paintGL() { · 443 unmodified lines
444444 glViewport(MIRROR_VIEW_LEFT_PADDING, _glWidget->height() - MIRROR_VIEW_HEIGHT - MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT);
445445 glScissor(MIRROR_VIEW_LEFT_PADDING, _glWidget->height() - MIRROR_VIEW_HEIGHT - MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT);
446446
447+ updateProjectionMatrix(_mirrorCamera);
448+
447449 glEnable(GL_SCISSOR_TEST);
448450 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
449451 glPushMatrix();
@@ -453,6 +455,8 @@ void Application::paintGL() { · 3 unmodified lines
453455 // reset Viewport
454456 glViewport(0, 0, _glWidget->width(), _glWidget->height());
455457 glDisable(GL_SCISSOR_TEST);
458+
459+ updateProjectionMatrix();
456460 }
457461
458462 displayOverlay();
@@ -485,11 +489,15 @@ void Application::resizeGL(int width, int height) { · 26 unmodified lines
485489 }
486490
487491 void Application::updateProjectionMatrix() {
492+ updateProjectionMatrix(_myCamera);
493+}
494+
495+void Application::updateProjectionMatrix(Camera& camera) {
488496 glMatrixMode(GL_PROJECTION);
489497 glLoadIdentity();
490498
491499 // Tell our viewFrustum about this change, using the application camera
492− loadViewFrustum(_myCamera, _viewFrustum);
500+ loadViewFrustum(camera, _viewFrustum);
493501
494502 float left, right, bottom, top, nearVal, farVal;
495503 glm::vec4 nearClipPlane, farClipPlane;
@@ -1631,7 +1639,7 @@ void Application::init() { · 1135 unmodified lines
16311639 _myAvatar.setDisplayingLookatVectors(false);
16321640 _mirrorCamera.setMode(CAMERA_MODE_MIRROR);
16331641 _mirrorCamera.setModeShiftRate(1.0f);
1634− _mirrorCamera.setAspectRatio(MIRROR_VIEW_WIDTH / MIRROR_VIEW_HEIGHT);
1642+ _mirrorCamera.setAspectRatio((float)MIRROR_VIEW_WIDTH / (float)MIRROR_VIEW_HEIGHT);
16351643 _mirrorCamera.setFieldOfView(DEFAULT_FIELD_OF_VIEW_DEGREES);
16361644
16371645 OculusManager::connect();
@@ -2601,7 +2609,7 @@ void Application::displaySide(Camera& whichCamera) { · 963 unmodified lines
26012609 glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR);
26022610
26032611 // indicate what we'll be adding/removing in mouse mode, if anything
2604− if (_mouseVoxel.s != 0) {
2612+ if (_mouseVoxel.s != 0 && whichCamera.getMode() != CAMERA_MODE_MIRROR) {
26052613 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
26062614 "Application::displaySide() ... voxels TOOLS UX...");
26072615
@@ -2649,7 +2657,7 @@ void Application::displaySide(Camera& whichCamera) { · 41 unmodified lines
26492657 glEnable(GL_LIGHTING);
26502658 }
26512659
2652− if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelSelectMode) && _pasteMode) {
2660+ if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelSelectMode) && _pasteMode && whichCamera.getMode() != CAMERA_MODE_MIRROR) {
26532661 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
26542662 "Application::displaySide() ... PASTE Preview...");
26552663

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