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,10 @@ 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 | glViewport(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), |
| 478 | glScissor(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), _mirrorViewRect.width(), _mirrorViewRect.height()); | 482 | _mirrorViewRect.width(), _mirrorViewRect.height()); |
| 483 | glScissor(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), | ||
| 484 | _mirrorViewRect.width(), _mirrorViewRect.height()); | ||
| 479 | bool updateViewFrustum = false; | 485 | bool updateViewFrustum = false; |
| 480 | updateProjectionMatrix(_mirrorCamera, updateViewFrustum); | 486 | updateProjectionMatrix(_mirrorCamera, updateViewFrustum); |
| 481 | glEnable(GL_SCISSOR_TEST); | 487 | glEnable(GL_SCISSOR_TEST); |
| @@ -506,7 +512,6 @@ void Application::paintGL() { · 24 unmodified lines | |||
| 506 | // restore absolute translations | 512 | // restore absolute translations |
| 507 | _myAvatar.getSkeletonModel().setTranslation(absoluteSkeletonTranslation); | 513 | _myAvatar.getSkeletonModel().setTranslation(absoluteSkeletonTranslation); |
| 508 | _myAvatar.getHead().getFaceModel().setTranslation(absoluteFaceTranslation); | 514 | _myAvatar.getHead().getFaceModel().setTranslation(absoluteFaceTranslation); |
| 509 | |||
| 510 | } else { | 515 | } else { |
| 511 | displaySide(_mirrorCamera, true); | 516 | displaySide(_mirrorCamera, true); |
| 512 | } | 517 | } |
| @@ -531,7 +536,8 @@ void Application::paintGL() { · 18 unmodified lines | |||
| 531 | void Application::resetCamerasOnResizeGL(Camera& camera, int width, int height) { | 536 | void Application::resetCamerasOnResizeGL(Camera& camera, int width, int height) { |
| 532 | if (OculusManager::isConnected()) { | 537 | if (OculusManager::isConnected()) { |
| 533 | OculusManager::configureCamera(camera, width, height); | 538 | OculusManager::configureCamera(camera, width, height); |
| 534 | 539 | } else if (TV3DManager::isConnected()) { | |
| 540 | TV3DManager::configureCamera(camera, width, height); | ||
| 535 | } else { | 541 | } else { |
| 536 | camera.setAspectRatio((float)width / height); | 542 | camera.setAspectRatio((float)width / height); |
| 537 | camera.setFieldOfView(Menu::getInstance()->getFieldOfView()); | 543 | camera.setFieldOfView(Menu::getInstance()->getFieldOfView()); |
| @@ -910,7 +916,9 @@ void Application::keyPressEvent(QKeyEvent* event) { · 372 unmodified lines | |||
| 910 | case Qt::Key_J: | 916 | case Qt::Key_J: |
| 911 | if (isShifted) { | 917 | if (isShifted) { |
| 912 | _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() - 0.1f); | 918 | _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() - 0.1f); |
| 913 | 919 | if (TV3DManager::isConnected()) { | |
| 920 | TV3DManager::configureCamera(_myCamera, _glWidget->width(),_glWidget->height()); | ||
| 921 | } | ||
| 914 | } else { | 922 | } else { |
| 915 | _myCamera.setEyeOffsetPosition(_myCamera.getEyeOffsetPosition() + glm::vec3(-0.001, 0, 0)); | 923 | _myCamera.setEyeOffsetPosition(_myCamera.getEyeOffsetPosition() + glm::vec3(-0.001, 0, 0)); |
| 916 | } | 924 | } |
| @@ -920,6 +928,9 @@ void Application::keyPressEvent(QKeyEvent* event) { · 3 unmodified lines | |||
| 920 | case Qt::Key_M: | 928 | case Qt::Key_M: |
| 921 | if (isShifted) { | 929 | if (isShifted) { |
| 922 | _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() + 0.1f); | 930 | _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() + 0.1f); |
| 931 | if (TV3DManager::isConnected()) { | ||
| 932 | TV3DManager::configureCamera(_myCamera, _glWidget->width(),_glWidget->height()); | ||
| 933 | } | ||
| 923 | 934 | ||
| 924 | } else { | 935 | } else { |
| 925 | _myCamera.setEyeOffsetPosition(_myCamera.getEyeOffsetPosition() + glm::vec3(0.001, 0, 0)); | 936 | _myCamera.setEyeOffsetPosition(_myCamera.getEyeOffsetPosition() + glm::vec3(0.001, 0, 0)); |
| @@ -1839,6 +1850,13 @@ void Application::init() { · 913 unmodified lines | |||
| 1839 | "trigger", | 1850 | "trigger", |
| 1840 | Qt::QueuedConnection); | 1851 | Qt::QueuedConnection); |
| 1841 | } | 1852 | } |
| 1853 | |||
| 1854 | TV3DManager::connect(); | ||
| 1855 | if (TV3DManager::isConnected()) { | ||
| 1856 | QMetaObject::invokeMethod(Menu::getInstance()->getActionForOption(MenuOption::Fullscreen), | ||
| 1857 | "trigger", | ||
| 1858 | Qt::QueuedConnection); | ||
| 1859 | } | ||
| 1842 | 1860 | ||
| 1843 | LeapManager::initialize(); | 1861 | LeapManager::initialize(); |
| 1844 | 1862 | ||
| @@ -2426,7 +2444,7 @@ void Application::updateCamera(float deltaTime) { · 581 unmodified lines | |||
| 2426 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); | 2444 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| 2427 | PerformanceWarning warn(showWarnings, "Application::updateCamera()"); | 2445 | PerformanceWarning warn(showWarnings, "Application::updateCamera()"); |
| 2428 | 2446 | ||
| 2429 | if (!OculusManager::isConnected()) { | 2447 | if (!OculusManager::isConnected() && !TV3DManager::isConnected()) { |
| 2430 | if (Menu::getInstance()->isOptionChecked(MenuOption::FullscreenMirror)) { | 2448 | if (Menu::getInstance()->isOptionChecked(MenuOption::FullscreenMirror)) { |
| 2431 | if (_myCamera.getMode() != CAMERA_MODE_MIRROR) { | 2449 | if (_myCamera.getMode() != CAMERA_MODE_MIRROR) { |
| 2432 | _myCamera.setMode(CAMERA_MODE_MIRROR); | 2450 | _myCamera.setMode(CAMERA_MODE_MIRROR); |
| @@ -3811,7 +3829,7 @@ void Application::renderAvatars(bool forceRenderHead, bool selfAvatarOnly) { · 1378 unmodified lines | |||
| 3811 | return; | 3829 | return; |
| 3812 | } | 3830 | } |
| 3813 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | 3831 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), |
| 3814 | "Application::displaySide() ... Avatars..."); | 3832 | "Application::renderAvatars()"); |
| 3815 | 3833 | ||
| 3816 | if (!selfAvatarOnly) { | 3834 | if (!selfAvatarOnly) { |
| 3817 | // Render avatars of other nodes | 3835 | // Render avatars of other nodes |
| @@ -4100,7 +4118,7 @@ void Application::resetSensors() { · 282 unmodified lines | |||
| 4100 | if (OculusManager::isConnected()) { | 4118 | if (OculusManager::isConnected()) { |
| 4101 | OculusManager::reset(); | 4119 | OculusManager::reset(); |
| 4102 | } | 4120 | } |
| 4103 | 4121 | ||
| 4104 | QCursor::setPos(_headMouseX, _headMouseY); | 4122 | QCursor::setPos(_headMouseX, _headMouseY); |
| 4105 | _myAvatar.reset(); | 4123 | _myAvatar.reset(); |
| 4106 | _myTransmitter.resetLevels(); | 4124 | _myTransmitter.resetLevels(); |