Showing the changes to interface/src/Application.cpp (1 of 6 files). Show all
Unified · Split
| @@ -57,6 +57,7 @@ · 56 unmodified lines | ||
| 57 | 57 | #include "Util.h" |
| 58 | 58 | #include "devices/LeapManager.h" |
| 59 | 59 | #include "devices/OculusManager.h" |
| 60 | +#include "devices/TV3DManager.h" | |
| 60 | 61 | #include "renderer/ProgramObject.h" |
| 61 | 62 | #include "ui/TextRenderer.h" |
| 62 | 63 | #include "InfoView.h" |
| @@ -439,7 +440,10 @@ void Application::paintGL() { · 376 unmodified lines | ||
| 439 | 440 | |
| 440 | 441 | if (OculusManager::isConnected()) { |
| 441 | 442 | OculusManager::display(whichCamera); |
| 442 | − | |
| 443 | + } else if (TV3DManager::isConnected()) { | |
| 444 | + _glowEffect.prepare(); | |
| 445 | + TV3DManager::display(whichCamera); | |
| 446 | + _glowEffect.render(); | |
| 443 | 447 | } else { |
| 444 | 448 | _glowEffect.prepare(); |
| 445 | 449 | |
| @@ -474,8 +478,10 @@ void Application::paintGL() { · 28 unmodified lines | ||
| 474 | 478 | _mirrorCamera.update(1.0f/_fps); |
| 475 | 479 | |
| 476 | 480 | // set the bounds of rear mirror view |
| 477 | − glViewport(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), _mirrorViewRect.width(), _mirrorViewRect.height()); | |
| 478 | − glScissor(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), _mirrorViewRect.width(), _mirrorViewRect.height()); | |
| 481 | + glViewport(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), | |
| 482 | + _mirrorViewRect.width(), _mirrorViewRect.height()); | |
| 483 | + glScissor(_mirrorViewRect.x(), _glWidget->height() - _mirrorViewRect.y() - _mirrorViewRect.height(), | |
| 484 | + _mirrorViewRect.width(), _mirrorViewRect.height()); | |
| 479 | 485 | bool updateViewFrustum = false; |
| 480 | 486 | updateProjectionMatrix(_mirrorCamera, updateViewFrustum); |
| 481 | 487 | glEnable(GL_SCISSOR_TEST); |
| @@ -506,7 +512,6 @@ void Application::paintGL() { · 24 unmodified lines | ||
| 506 | 512 | // restore absolute translations |
| 507 | 513 | _myAvatar.getSkeletonModel().setTranslation(absoluteSkeletonTranslation); |
| 508 | 514 | _myAvatar.getHead().getFaceModel().setTranslation(absoluteFaceTranslation); |
| 509 | − | |
| 510 | 515 | } else { |
| 511 | 516 | displaySide(_mirrorCamera, true); |
| 512 | 517 | } |
| @@ -531,7 +536,8 @@ void Application::paintGL() { · 18 unmodified lines | ||
| 531 | 536 | void Application::resetCamerasOnResizeGL(Camera& camera, int width, int height) { |
| 532 | 537 | if (OculusManager::isConnected()) { |
| 533 | 538 | OculusManager::configureCamera(camera, width, height); |
| 534 | − | |
| 539 | + } else if (TV3DManager::isConnected()) { | |
| 540 | + TV3DManager::configureCamera(camera, width, height); | |
| 535 | 541 | } else { |
| 536 | 542 | camera.setAspectRatio((float)width / height); |
| 537 | 543 | camera.setFieldOfView(Menu::getInstance()->getFieldOfView()); |
| @@ -910,7 +916,9 @@ void Application::keyPressEvent(QKeyEvent* event) { · 372 unmodified lines | ||
| 910 | 916 | case Qt::Key_J: |
| 911 | 917 | if (isShifted) { |
| 912 | 918 | _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() - 0.1f); |
| 913 | − | |
| 919 | + if (TV3DManager::isConnected()) { | |
| 920 | + TV3DManager::configureCamera(_myCamera, _glWidget->width(),_glWidget->height()); | |
| 921 | + } | |
| 914 | 922 | } else { |
| 915 | 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 | 928 | case Qt::Key_M: |
| 921 | 929 | if (isShifted) { |
| 922 | 930 | _viewFrustum.setFocalLength(_viewFrustum.getFocalLength() + 0.1f); |
| 931 | + if (TV3DManager::isConnected()) { | |
| 932 | + TV3DManager::configureCamera(_myCamera, _glWidget->width(),_glWidget->height()); | |
| 933 | + } | |
| 923 | 934 | |
| 924 | 935 | } else { |
| 925 | 936 | _myCamera.setEyeOffsetPosition(_myCamera.getEyeOffsetPosition() + glm::vec3(0.001, 0, 0)); |
| @@ -1839,6 +1850,13 @@ void Application::init() { · 913 unmodified lines | ||
| 1839 | 1850 | "trigger", |
| 1840 | 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 | 1861 | LeapManager::initialize(); |
| 1844 | 1862 | |
| @@ -2426,7 +2444,7 @@ void Application::updateCamera(float deltaTime) { · 581 unmodified lines | ||
| 2426 | 2444 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| 2427 | 2445 | PerformanceWarning warn(showWarnings, "Application::updateCamera()"); |
| 2428 | 2446 | |
| 2429 | − if (!OculusManager::isConnected()) { | |
| 2447 | + if (!OculusManager::isConnected() && !TV3DManager::isConnected()) { | |
| 2430 | 2448 | if (Menu::getInstance()->isOptionChecked(MenuOption::FullscreenMirror)) { |
| 2431 | 2449 | if (_myCamera.getMode() != CAMERA_MODE_MIRROR) { |
| 2432 | 2450 | _myCamera.setMode(CAMERA_MODE_MIRROR); |
| @@ -3811,7 +3829,7 @@ void Application::renderAvatars(bool forceRenderHead, bool selfAvatarOnly) { · 1378 unmodified lines | ||
| 3811 | 3829 | return; |
| 3812 | 3830 | } |
| 3813 | 3831 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), |
| 3814 | − "Application::displaySide() ... Avatars..."); | |
| 3832 | + "Application::renderAvatars()"); | |
| 3815 | 3833 | |
| 3816 | 3834 | if (!selfAvatarOnly) { |
| 3817 | 3835 | // Render avatars of other nodes |
| @@ -4100,7 +4118,7 @@ void Application::resetSensors() { · 282 unmodified lines | ||
| 4100 | 4118 | if (OculusManager::isConnected()) { |
| 4101 | 4119 | OculusManager::reset(); |
| 4102 | 4120 | } |
| 4103 | − | |
| 4121 | + | |
| 4104 | 4122 | QCursor::setPos(_headMouseX, _headMouseY); |
| 4105 | 4123 | _myAvatar.reset(); |
| 4106 | 4124 | _myTransmitter.resetLevels(); |