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
444 glViewport(MIRROR_VIEW_LEFT_PADDING, _glWidget->height() - MIRROR_VIEW_HEIGHT - MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT);444 glViewport(MIRROR_VIEW_LEFT_PADDING, _glWidget->height() - MIRROR_VIEW_HEIGHT - MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT);
445 glScissor(MIRROR_VIEW_LEFT_PADDING, _glWidget->height() - MIRROR_VIEW_HEIGHT - MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT);445 glScissor(MIRROR_VIEW_LEFT_PADDING, _glWidget->height() - MIRROR_VIEW_HEIGHT - MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT);
446 446
447 updateProjectionMatrix(_mirrorCamera);
448
447 glEnable(GL_SCISSOR_TEST);449 glEnable(GL_SCISSOR_TEST);
448 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);450 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
449 glPushMatrix();451 glPushMatrix();
@@ -453,6 +455,8 @@ void Application::paintGL() { · 3 unmodified lines
453 // reset Viewport455 // reset Viewport
454 glViewport(0, 0, _glWidget->width(), _glWidget->height());456 glViewport(0, 0, _glWidget->width(), _glWidget->height());
455 glDisable(GL_SCISSOR_TEST);457 glDisable(GL_SCISSOR_TEST);
458
459 updateProjectionMatrix();
456 }460 }
457 461
458 displayOverlay();462 displayOverlay();
@@ -485,11 +489,15 @@ void Application::resizeGL(int width, int height) { · 26 unmodified lines
485}489}
486 490
487void Application::updateProjectionMatrix() {491void Application::updateProjectionMatrix() {
492 updateProjectionMatrix(_myCamera);
493}
494
495void Application::updateProjectionMatrix(Camera& camera) {
488 glMatrixMode(GL_PROJECTION);496 glMatrixMode(GL_PROJECTION);
489 glLoadIdentity();497 glLoadIdentity();
490 498
491 // Tell our viewFrustum about this change, using the application camera499 // Tell our viewFrustum about this change, using the application camera
492 loadViewFrustum(_myCamera, _viewFrustum);500 loadViewFrustum(camera, _viewFrustum);
493 501
494 float left, right, bottom, top, nearVal, farVal;502 float left, right, bottom, top, nearVal, farVal;
495 glm::vec4 nearClipPlane, farClipPlane;503 glm::vec4 nearClipPlane, farClipPlane;
@@ -1631,7 +1639,7 @@ void Application::init() { · 1135 unmodified lines
1631 _myAvatar.setDisplayingLookatVectors(false); 1639 _myAvatar.setDisplayingLookatVectors(false);
1632 _mirrorCamera.setMode(CAMERA_MODE_MIRROR);1640 _mirrorCamera.setMode(CAMERA_MODE_MIRROR);
1633 _mirrorCamera.setModeShiftRate(1.0f);1641 _mirrorCamera.setModeShiftRate(1.0f);
1634 _mirrorCamera.setAspectRatio(MIRROR_VIEW_WIDTH / MIRROR_VIEW_HEIGHT);1642 _mirrorCamera.setAspectRatio((float)MIRROR_VIEW_WIDTH / (float)MIRROR_VIEW_HEIGHT);
1635 _mirrorCamera.setFieldOfView(DEFAULT_FIELD_OF_VIEW_DEGREES);1643 _mirrorCamera.setFieldOfView(DEFAULT_FIELD_OF_VIEW_DEGREES);
1636 1644
1637 OculusManager::connect();1645 OculusManager::connect();
@@ -2601,7 +2609,7 @@ void Application::displaySide(Camera& whichCamera) { · 963 unmodified lines
2601 glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR);2609 glMaterialfv(GL_FRONT, GL_SPECULAR, WHITE_SPECULAR_COLOR);
2602 2610
2603 // indicate what we'll be adding/removing in mouse mode, if anything2611 // 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) {
2605 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), 2613 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2606 "Application::displaySide() ... voxels TOOLS UX...");2614 "Application::displaySide() ... voxels TOOLS UX...");
2607 2615
@@ -2649,7 +2657,7 @@ void Application::displaySide(Camera& whichCamera) { · 41 unmodified lines
2649 glEnable(GL_LIGHTING);2657 glEnable(GL_LIGHTING);
2650 }2658 }
2651 2659
2652 if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelSelectMode) && _pasteMode) {2660 if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelSelectMode) && _pasteMode && whichCamera.getMode() != CAMERA_MODE_MIRROR) {
2653 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), 2661 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2654 "Application::displaySide() ... PASTE Preview...");2662 "Application::displaySide() ... PASTE Preview...");
2655 2663

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