Showing the changes to interface/src/Application.cpp (1 of 6 files). Show all
Unified · Split
| @@ -57,6 +57,7 @@ · 56 unmodified lines | |||
| 57 | #include "Util.h" | 57 | #include "Util.h" |
| 58 | #include "devices/LeapManager.h" | 58 | #include "devices/LeapManager.h" |
| 59 | #include "devices/OculusManager.h" | 59 | #include "devices/OculusManager.h" |
| 60 | #include "devices/TV3DManager.h" | ||
| 60 | #include "renderer/ProgramObject.h" | 61 | #include "renderer/ProgramObject.h" |
| 61 | #include "ui/TextRenderer.h" | 62 | #include "ui/TextRenderer.h" |
| 62 | #include "InfoView.h" | 63 | #include "InfoView.h" |
| @@ -439,7 +440,10 @@ void Application::paintGL() { · 376 unmodified lines | |||
| 439 | 440 | ||
| 440 | if (OculusManager::isConnected()) { | 441 | if (OculusManager::isConnected()) { |
| 441 | OculusManager::display(whichCamera); | 442 | OculusManager::display(whichCamera); |
| 442 | 443 | } else if (TV3DManager::isConnected()) { | |
| 444 | _glowEffect.prepare(); | ||
| 445 | TV3DManager::display(whichCamera); | ||
| 446 | _glowEffect.render(); | ||
| 443 | } else { | 447 | } else { |
| 444 | _glowEffect.prepare(); | 448 | _glowEffect.prepare(); |
| 445 | 449 | ||
| @@ -474,8 +478,13 @@ void Application::paintGL() { · 28 unmodified lines | |||
| 474 | _mirrorCamera.update(1.0f/_fps); | 478 | _mirrorCamera.update(1.0f/_fps); |
| 475 | 479 | ||
| 476 | // set the bounds of rear mirror view | 480 | // set the bounds of rear mirror view |
| 477 | glViewport(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), _mirrorViewRect.width(), _mirrorViewRect.height()); | 481 | float mirrorX = _mirrorViewRect.x(); |
| 478 | glScissor(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), _mirrorViewRect.width(), _mirrorViewRect.height()); | 482 | float mirrorY = _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(); |
| 483 | float mirrorW = _mirrorViewRect.width(); | ||
| 484 | float mirrorH = _mirrorViewRect.height(); | ||
| 485 | |||
| 486 | glViewport(mirrorX, mirrorY, mirrorW, mirrorH); | ||
| 487 | glScissor(mirrorX, mirrorY, mirrorW, mirrorH); | ||
| 479 | bool updateViewFrustum = false; | 488 | bool updateViewFrustum = false; |
| 480 | updateProjectionMatrix(_mirrorCamera, updateViewFrustum); | 489 | updateProjectionMatrix(_mirrorCamera, updateViewFrustum); |
| 481 | glEnable(GL_SCISSOR_TEST); | 490 | glEnable(GL_SCISSOR_TEST); |
| @@ -501,14 +510,18 @@ void Application::paintGL() { · 19 unmodified lines | |||
| 501 | _myAvatar.getSkeletonModel().setTranslation(_myAvatar.getHead().getFaceModel().getTranslation() - | 510 | _myAvatar.getSkeletonModel().setTranslation(_myAvatar.getHead().getFaceModel().getTranslation() - |
| 502 | neckPosition); | 511 | neckPosition); |
| 503 | 512 | ||
| 504 | displaySide(_mirrorCamera, true); | 513 | //displaySide(_mirrorCamera, true); |
| 514 | displaySide(whichCamera); | ||
| 515 | |||
| 505 | 516 | ||
| 506 | // restore absolute translations | 517 | // restore absolute translations |
| 507 | _myAvatar.getSkeletonModel().setTranslation(absoluteSkeletonTranslation); | 518 | _myAvatar.getSkeletonModel().setTranslation(absoluteSkeletonTranslation); |
| 508 | _myAvatar.getHead().getFaceModel().setTranslation(absoluteFaceTranslation); | 519 | _myAvatar.getHead().getFaceModel().setTranslation(absoluteFaceTranslation); |
| 509 | 520 | ||
| 510 | } else { | 521 | } else { |
| 511 | displaySide(_mirrorCamera, true); | 522 | //displaySide(_mirrorCamera, true); |
| 523 | displaySide(whichCamera); | ||
| 524 | |||
| 512 | } | 525 | } |
| 513 | glPopMatrix(); | 526 | glPopMatrix(); |
| 514 | 527 | ||
| @@ -531,7 +544,8 @@ void Application::paintGL() { · 16 unmodified lines | |||
| 531 | void Application::resetCamerasOnResizeGL(Camera& camera, int width, int height) { | 544 | void Application::resetCamerasOnResizeGL(Camera& camera, int width, int height) { |
| 532 | if (OculusManager::isConnected()) { | 545 | if (OculusManager::isConnected()) { |
| 533 | OculusManager::configureCamera(camera, width, height); | 546 | OculusManager::configureCamera(camera, width, height); |
| 534 | 547 | } else if (TV3DManager::isConnected()) { | |
| 548 | TV3DManager::configureCamera(camera, width, height); | ||
| 535 | } else { | 549 | } else { |
| 536 | camera.setAspectRatio((float)width / height); | 550 | camera.setAspectRatio((float)width / height); |
| 537 | camera.setFieldOfView(Menu::getInstance()->getFieldOfView()); | 551 | camera.setFieldOfView(Menu::getInstance()->getFieldOfView()); |
| @@ -910,7 +924,9 @@ void Application::keyPressEvent(QKeyEvent* event) { · 372 unmodified lines | |||
| 910 | case Qt::Key_J: | 924 | case Qt::Key_J: |
| 911 | if (isShifted) { | 925 | if (isShifted) { |
| 912 | _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() - 0.1f); | 926 | _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() - 0.1f); |
| 913 | 927 | if (TV3DManager::isConnected()) { | |
| 928 | TV3DManager::configureCamera(_myCamera, _glWidget->width(),_glWidget->height()); | ||
| 929 | } | ||
| 914 | } else { | 930 | } else { |
| 915 | _myCamera.setEyeOffsetPosition(_myCamera.getEyeOffsetPosition() + glm::vec3(-0.001, 0, 0)); | 931 | _myCamera.setEyeOffsetPosition(_myCamera.getEyeOffsetPosition() + glm::vec3(-0.001, 0, 0)); |
| 916 | } | 932 | } |
| @@ -920,6 +936,9 @@ void Application::keyPressEvent(QKeyEvent* event) { · 3 unmodified lines | |||
| 920 | case Qt::Key_M: | 936 | case Qt::Key_M: |
| 921 | if (isShifted) { | 937 | if (isShifted) { |
| 922 | _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() + 0.1f); | 938 | _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() + 0.1f); |
| 939 | if (TV3DManager::isConnected()) { | ||
| 940 | TV3DManager::configureCamera(_myCamera, _glWidget->width(),_glWidget->height()); | ||
| 941 | } | ||
| 923 | 942 | ||
| 924 | } else { | 943 | } else { |
| 925 | _myCamera.setEyeOffsetPosition(_myCamera.getEyeOffsetPosition() + glm::vec3(0.001, 0, 0)); | 944 | _myCamera.setEyeOffsetPosition(_myCamera.getEyeOffsetPosition() + glm::vec3(0.001, 0, 0)); |
| @@ -1828,6 +1847,13 @@ void Application::init() { · 902 unmodified lines | |||
| 1828 | "trigger", | 1847 | "trigger", |
| 1829 | Qt::QueuedConnection); | 1848 | Qt::QueuedConnection); |
| 1830 | } | 1849 | } |
| 1850 | |||
| 1851 | TV3DManager::connect(); | ||
| 1852 | if (TV3DManager::isConnected()) { | ||
| 1853 | QMetaObject::invokeMethod(Menu::getInstance()->getActionForOption(MenuOption::Fullscreen), | ||
| 1854 | "trigger", | ||
| 1855 | Qt::QueuedConnection); | ||
| 1856 | } | ||
| 1831 | 1857 | ||
| 1832 | LeapManager::initialize(); | 1858 | LeapManager::initialize(); |
| 1833 | 1859 | ||
| @@ -2415,7 +2441,7 @@ void Application::updateCamera(float deltaTime) { · 581 unmodified lines | |||
| 2415 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); | 2441 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| 2416 | PerformanceWarning warn(showWarnings, "Application::updateCamera()"); | 2442 | PerformanceWarning warn(showWarnings, "Application::updateCamera()"); |
| 2417 | 2443 | ||
| 2418 | if (!OculusManager::isConnected()) { | 2444 | if (!OculusManager::isConnected() && !TV3DManager::isConnected()) { |
| 2419 | if (Menu::getInstance()->isOptionChecked(MenuOption::FullscreenMirror)) { | 2445 | if (Menu::getInstance()->isOptionChecked(MenuOption::FullscreenMirror)) { |
| 2420 | if (_myCamera.getMode() != CAMERA_MODE_MIRROR) { | 2446 | if (_myCamera.getMode() != CAMERA_MODE_MIRROR) { |
| 2421 | _myCamera.setMode(CAMERA_MODE_MIRROR); | 2447 | _myCamera.setMode(CAMERA_MODE_MIRROR); |
| @@ -3800,7 +3826,7 @@ void Application::renderAvatars(bool forceRenderHead, bool selfAvatarOnly) { · 1378 unmodified lines | |||
| 3800 | return; | 3826 | return; |
| 3801 | } | 3827 | } |
| 3802 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | 3828 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), |
| 3803 | "Application::displaySide() ... Avatars..."); | 3829 | "Application::renderAvatars()"); |
| 3804 | 3830 | ||
| 3805 | if (!selfAvatarOnly) { | 3831 | if (!selfAvatarOnly) { |
| 3806 | // Render avatars of other nodes | 3832 | // Render avatars of other nodes |
| @@ -4089,7 +4115,7 @@ void Application::resetSensors() { · 282 unmodified lines | |||
| 4089 | if (OculusManager::isConnected()) { | 4115 | if (OculusManager::isConnected()) { |
| 4090 | OculusManager::reset(); | 4116 | OculusManager::reset(); |
| 4091 | } | 4117 | } |
| 4092 | 4118 | ||
| 4093 | QCursor::setPos(_headMouseX, _headMouseY); | 4119 | QCursor::setPos(_headMouseX, _headMouseY); |
| 4094 | _myAvatar.reset(); | 4120 | _myAvatar.reset(); |
| 4095 | _myTransmitter.resetLevels(); | 4121 | _myTransmitter.resetLevels(); |