Showing the changes to interface/src/Application.cpp (1 of 361 files). Show all
Unified · Split
| @@ -70,6 +70,7 @@ · 69 unmodified lines | ||
| 70 | 70 | #include <LogHandler.h> |
| 71 | 71 | #include <MainWindow.h> |
| 72 | 72 | #include <MessageDialog.h> |
| 73 | +#include <MessagesClient.h> | |
| 73 | 74 | #include <ModelEntityItem.h> |
| 74 | 75 | #include <NetworkAccessManager.h> |
| 75 | 76 | #include <NetworkingConstants.h> |
| @@ -86,6 +87,7 @@ · 10 unmodified lines | ||
| 86 | 87 | #include <RenderDeferredTask.h> |
| 87 | 88 | #include <ResourceCache.h> |
| 88 | 89 | #include <SceneScriptingInterface.h> |
| 90 | +#include <RecordingScriptingInterface.h> | |
| 89 | 91 | #include <ScriptCache.h> |
| 90 | 92 | #include <SoundCache.h> |
| 91 | 93 | #include <TextureCache.h> |
| @@ -94,13 +96,15 @@ · 2 unmodified lines | ||
| 94 | 96 | #include <UserActivityLogger.h> |
| 95 | 97 | #include <UUID.h> |
| 96 | 98 | #include <VrMenu.h> |
| 99 | +#include <recording/Deck.h> | |
| 100 | +#include <recording/Recorder.h> | |
| 97 | 101 | |
| 98 | 102 | #include "AnimDebugDraw.h" |
| 99 | 103 | #include "AudioClient.h" |
| 100 | 104 | #include "audio/AudioScope.h" |
| 101 | 105 | #include "avatar/AvatarManager.h" |
| 102 | 106 | #include "CrashHandler.h" |
| 103 | −#include "devices/3DConnexionClient.h" | |
| 107 | +#include "input-plugins/SpacemouseManager.h" | |
| 104 | 108 | #include "devices/DdeFaceTracker.h" |
| 105 | 109 | #include "devices/EyeTracker.h" |
| 106 | 110 | #include "devices/Faceshift.h" |
| @@ -132,6 +136,7 @@ · 25 unmodified lines | ||
| 132 | 136 | #endif |
| 133 | 137 | #include "Stars.h" |
| 134 | 138 | #include "ui/AddressBarDialog.h" |
| 139 | +#include "ui/RecorderDialog.h" | |
| 135 | 140 | #include "ui/AvatarInputs.h" |
| 136 | 141 | #include "ui/AssetUploadDialogFactory.h" |
| 137 | 142 | #include "ui/DataWebDialog.h" |
| @@ -298,6 +303,8 @@ bool setupEssentials(int& argc, char** argv) { · 160 unmodified lines | ||
| 298 | 303 | Setting::init(); |
| 299 | 304 | |
| 300 | 305 | // Set dependencies |
| 306 | + DependencyManager::set<recording::Deck>(); | |
| 307 | + DependencyManager::set<recording::Recorder>(); | |
| 301 | 308 | DependencyManager::set<AddressManager>(); |
| 302 | 309 | DependencyManager::set<NodeList>(NodeType::Agent, listenPort); |
| 303 | 310 | DependencyManager::set<GeometryCache>(); |
| @@ -322,6 +329,7 @@ bool setupEssentials(int& argc, char** argv) { · 18 unmodified lines | ||
| 322 | 329 | DependencyManager::set<ResourceCacheSharedItems>(); |
| 323 | 330 | DependencyManager::set<DesktopScriptingInterface>(); |
| 324 | 331 | DependencyManager::set<EntityScriptingInterface>(); |
| 332 | + DependencyManager::set<RecordingScriptingInterface>(); | |
| 325 | 333 | DependencyManager::set<WindowScriptingInterface>(); |
| 326 | 334 | DependencyManager::set<HMDScriptingInterface>(); |
| 327 | 335 | |
| @@ -335,6 +343,7 @@ bool setupEssentials(int& argc, char** argv) { · 7 unmodified lines | ||
| 335 | 343 | DependencyManager::set<PathUtils>(); |
| 336 | 344 | DependencyManager::set<InterfaceActionFactory>(); |
| 337 | 345 | DependencyManager::set<AssetClient>(); |
| 346 | + DependencyManager::set<MessagesClient>(); | |
| 338 | 347 | DependencyManager::set<UserInputMapper>(); |
| 339 | 348 | DependencyManager::set<controller::ScriptingInterface, ControllerScriptingInterface>(); |
| 340 | 349 | DependencyManager::set<InterfaceParentFinder>(); |
| @@ -449,6 +458,17 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 108 unmodified lines | ||
| 449 | 458 | audioIO->setOrientationGetter([this]{ return getMyAvatar()->getOrientationForAudio(); }); |
| 450 | 459 | |
| 451 | 460 | audioIO->moveToThread(audioThread); |
| 461 | + recording::Frame::registerFrameHandler(AudioConstants::AUDIO_FRAME_NAME, [=](recording::Frame::ConstPointer frame) { | |
| 462 | + audioIO->handleRecordedAudioInput(frame->data); | |
| 463 | + }); | |
| 464 | + | |
| 465 | + connect(audioIO.data(), &AudioClient::inputReceived, [](const QByteArray& audio){ | |
| 466 | + static auto recorder = DependencyManager::get<recording::Recorder>(); | |
| 467 | + if (recorder->isRecording()) { | |
| 468 | + static const recording::FrameType AUDIO_FRAME_TYPE = recording::Frame::registerFrameType(AudioConstants::AUDIO_FRAME_NAME); | |
| 469 | + recorder->recordFrame(AUDIO_FRAME_TYPE, audio); | |
| 470 | + } | |
| 471 | + }); | |
| 452 | 472 | |
| 453 | 473 | auto& audioScriptingInterface = AudioScriptingInterface::getInstance(); |
| 454 | 474 | |
| @@ -481,6 +501,14 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 26 unmodified lines | ||
| 481 | 501 | connect(assetThread, &QThread::started, assetClient.data(), &AssetClient::init); |
| 482 | 502 | assetThread->start(); |
| 483 | 503 | |
| 504 | + // Setup MessagesClient | |
| 505 | + auto messagesClient = DependencyManager::get<MessagesClient>(); | |
| 506 | + QThread* messagesThread = new QThread; | |
| 507 | + messagesThread->setObjectName("Messages Client Thread"); | |
| 508 | + messagesClient->moveToThread(messagesThread); | |
| 509 | + connect(messagesThread, &QThread::started, messagesClient.data(), &MessagesClient::init); | |
| 510 | + messagesThread->start(); | |
| 511 | + | |
| 484 | 512 | const DomainHandler& domainHandler = nodeList->getDomainHandler(); |
| 485 | 513 | |
| 486 | 514 | connect(&domainHandler, SIGNAL(hostnameChanged(const QString&)), SLOT(domainChanged(const QString&))); |
| @@ -547,7 +575,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 60 unmodified lines | ||
| 547 | 575 | |
| 548 | 576 | // tell the NodeList instance who to tell the domain server we care about |
| 549 | 577 | nodeList->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer |
| 550 | − << NodeType::EntityServer << NodeType::AssetServer); | |
| 578 | + << NodeType::EntityServer << NodeType::AssetServer << NodeType::MessagesMixer); | |
| 551 | 579 | |
| 552 | 580 | // connect to the packet sent signal of the _entityEditSender |
| 553 | 581 | connect(&_entityEditSender, &EntityEditPacketSender::packetSent, this, &Application::packetSent); |
| @@ -650,11 +678,14 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 96 unmodified lines | ||
| 650 | 678 | _applicationStateDevice->addInputVariant(QString("ComfortMode"), controller::StateController::ReadLambda([]() -> float { |
| 651 | 679 | return (float)Menu::getInstance()->isOptionChecked(MenuOption::ComfortMode); |
| 652 | 680 | })); |
| 681 | + _applicationStateDevice->addInputVariant(QString("Grounded"), controller::StateController::ReadLambda([]() -> float { | |
| 682 | + return (float)qApp->getMyAvatar()->getCharacterController()->onGround(); | |
| 683 | + })); | |
| 653 | 684 | |
| 654 | 685 | userInputMapper->registerDevice(_applicationStateDevice); |
| 655 | 686 | |
| 656 | 687 | // Setup the keyboardMouseDevice and the user input mapper with the default bindings |
| 657 | − userInputMapper->registerDevice(_keyboardMouseDevice); | |
| 688 | + userInputMapper->registerDevice(_keyboardMouseDevice->getInputDevice()); | |
| 658 | 689 | |
| 659 | 690 | |
| 660 | 691 | userInputMapper->loadDefaultMapping(userInputMapper->getStandardDeviceID()); |
| @@ -730,9 +761,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 69 unmodified lines | ||
| 730 | 761 | // Now that menu is initalized we can sync myAvatar with it's state. |
| 731 | 762 | getMyAvatar()->updateMotionBehaviorFromMenu(); |
| 732 | 763 | |
| 764 | +// FIXME spacemouse code still needs cleanup | |
| 733 | 765 | #if 0 |
| 734 | 766 | // the 3Dconnexion device wants to be initiliazed after a window is displayed. |
| 735 | − ConnexionClient::getInstance().init(); | |
| 767 | + SpacemouseManager::getInstance().init(); | |
| 736 | 768 | #endif |
| 737 | 769 | |
| 738 | 770 | auto& packetReceiver = nodeList->getPacketReceiver(); |
| @@ -804,8 +836,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 65 unmodified lines | ||
| 804 | 836 | |
| 805 | 837 | void Application::aboutToQuit() { |
| 806 | 838 | emit beforeAboutToQuit(); |
| 839 | + | |
| 807 | 840 | getActiveDisplayPlugin()->deactivate(); |
| 841 | + | |
| 808 | 842 | _aboutToQuit = true; |
| 843 | + | |
| 809 | 844 | cleanupBeforeQuit(); |
| 810 | 845 | } |
| 811 | 846 | |
| @@ -817,7 +852,6 @@ void Application::cleanupBeforeQuit() { · 5 unmodified lines | ||
| 817 | 852 | #ifdef HAVE_IVIEWHMD |
| 818 | 853 | DependencyManager::get<EyeTracker>()->setEnabled(false, true); |
| 819 | 854 | #endif |
| 820 | − | |
| 821 | 855 | AnimDebugDraw::getInstance().shutdown(); |
| 822 | 856 | |
| 823 | 857 | // FIXME: once we move to shared pointer for the INputDevice we shoud remove this naked delete: |
| @@ -831,8 +865,14 @@ void Application::cleanupBeforeQuit() { · 7 unmodified lines | ||
| 831 | 865 | |
| 832 | 866 | _entities.clear(); // this will allow entity scripts to properly shutdown |
| 833 | 867 | |
| 868 | + auto nodeList = DependencyManager::get<NodeList>(); | |
| 869 | + | |
| 870 | + // send the domain a disconnect packet, force stoppage of domain-server check-ins | |
| 871 | + nodeList->getDomainHandler().disconnect(); | |
| 872 | + nodeList->setIsShuttingDown(true); | |
| 873 | + | |
| 834 | 874 | // tell the packet receiver we're shutting down, so it can drop packets |
| 835 | − DependencyManager::get<NodeList>()->getPacketReceiver().setShouldDropPackets(true); | |
| 875 | + nodeList->getPacketReceiver().setShouldDropPackets(true); | |
| 836 | 876 | |
| 837 | 877 | _entities.shutdown(); // tell the entities system we're shutting down, so it will stop running scripts |
| 838 | 878 | ScriptEngine::stopAllScripts(this); // stop all currently running global scripts |
| @@ -852,9 +892,6 @@ void Application::cleanupBeforeQuit() { · 13 unmodified lines | ||
| 852 | 892 | saveSettings(); |
| 853 | 893 | _window->saveGeometry(); |
| 854 | 894 | |
| 855 | − // let the avatar mixer know we're out | |
| 856 | − MyAvatar::sendKillAvatar(); | |
| 857 | − | |
| 858 | 895 | // stop the AudioClient |
| 859 | 896 | QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), |
| 860 | 897 | "stop", Qt::BlockingQueuedConnection); |
| @@ -944,14 +981,12 @@ void Application::initializeGL() { · 83 unmodified lines | ||
| 944 | 981 | qCDebug(interfaceapp) << "Created Display Window."; |
| 945 | 982 | |
| 946 | 983 | // initialize glut for shape drawing; Qt apparently initializes it on OS X |
| 947 | − #ifndef __APPLE__ | |
| 948 | − static bool isInitialized = false; | |
| 949 | − if (isInitialized) { | |
| 984 | + if (_isGLInitialized) { | |
| 950 | 985 | return; |
| 951 | 986 | } else { |
| 952 | − isInitialized = true; | |
| 987 | + _isGLInitialized = true; | |
| 953 | 988 | } |
| 954 | − #endif | |
| 989 | + | |
| 955 | 990 | // Where the gpuContext is initialized and where the TRUE Backend is created and assigned |
| 956 | 991 | gpu::Context::init<gpu::GLBackend>(); |
| 957 | 992 | _gpuContext = std::make_shared<gpu::Context>(); |
| @@ -978,10 +1013,6 @@ void Application::initializeGL() { · 20 unmodified lines | ||
| 978 | 1013 | connect(&_octreeProcessor, &OctreePacketProcessor::packetVersionMismatch, this, &Application::notifyPacketVersionMismatch); |
| 979 | 1014 | _entityEditSender.initialize(_enableProcessOctreeThread); |
| 980 | 1015 | |
| 981 | − // call our timer function every second | |
| 982 | − connect(&pingTimer, &QTimer::timeout, this, &Application::ping); | |
| 983 | − pingTimer.start(1000); | |
| 984 | − | |
| 985 | 1016 | _idleLoopStdev.reset(); |
| 986 | 1017 | |
| 987 | 1018 | // update before the first render |
| @@ -992,6 +1023,7 @@ void Application::initializeGL() { · 4 unmodified lines | ||
| 992 | 1023 | |
| 993 | 1024 | void Application::initializeUi() { |
| 994 | 1025 | AddressBarDialog::registerType(); |
| 1026 | + RecorderDialog::registerType(); | |
| 995 | 1027 | ErrorDialog::registerType(); |
| 996 | 1028 | LoginDialog::registerType(); |
| 997 | 1029 | MessageDialog::registerType(); |
| @@ -1007,6 +1039,7 @@ void Application::initializeUi() { · 9 unmodified lines | ||
| 1007 | 1039 | offscreenUi->load("RootMenu.qml"); |
| 1008 | 1040 | auto scriptingInterface = DependencyManager::get<controller::ScriptingInterface>(); |
| 1009 | 1041 | offscreenUi->getRootContext()->setContextProperty("Controller", scriptingInterface.data()); |
| 1042 | + offscreenUi->getRootContext()->setContextProperty("MyAvatar", getMyAvatar()); | |
| 1010 | 1043 | _glWidget->installEventFilter(offscreenUi.data()); |
| 1011 | 1044 | VrMenu::load(); |
| 1012 | 1045 | VrMenu::executeQueuedLambdas(); |
| @@ -1035,10 +1068,7 @@ void Application::initializeUi() { · 22 unmodified lines | ||
| 1035 | 1068 | foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) { |
| 1036 | 1069 | QString name = inputPlugin->getName(); |
| 1037 | 1070 | if (name == KeyboardMouseDevice::NAME) { |
| 1038 | − auto kbm = static_cast<KeyboardMouseDevice*>(inputPlugin.data()); | |
| 1039 | − // FIXME incredibly evil.... _keyboardMouseDevice is now owned by | |
| 1040 | − // both a QSharedPointer and a std::shared_ptr | |
| 1041 | − _keyboardMouseDevice = std::shared_ptr<KeyboardMouseDevice>(kbm); | |
| 1071 | + _keyboardMouseDevice = std::dynamic_pointer_cast<KeyboardMouseDevice>(inputPlugin); | |
| 1042 | 1072 | } |
| 1043 | 1073 | } |
| 1044 | 1074 | updateInputModes(); |
| @@ -1063,7 +1093,9 @@ void Application::paintGL() { · 18 unmodified lines | ||
| 1063 | 1093 | _lastFramesPerSecondUpdate = now; |
| 1064 | 1094 | } |
| 1065 | 1095 | |
| 1066 | − idle(now); | |
| 1096 | + if (_isGLInitialized) { | |
| 1097 | + idle(now); | |
| 1098 | + } | |
| 1067 | 1099 | |
| 1068 | 1100 | PROFILE_RANGE(__FUNCTION__); |
| 1069 | 1101 | PerformanceTimer perfTimer("paintGL"); |
| @@ -1204,6 +1236,19 @@ void Application::paintGL() { · 134 unmodified lines | ||
| 1204 | 1236 | glm::vec3(0.0f, 0.0f, -1.0f) * MIRROR_FULLSCREEN_DISTANCE * _scaleMirror); |
| 1205 | 1237 | } |
| 1206 | 1238 | renderArgs._renderMode = RenderArgs::MIRROR_RENDER_MODE; |
| 1239 | + } else if (_myCamera.getMode() == CAMERA_MODE_ENTITY) { | |
| 1240 | + EntityItemPointer cameraEntity = _myCamera.getCameraEntityPointer(); | |
| 1241 | + if (cameraEntity != nullptr) { | |
| 1242 | + if (isHMDMode()) { | |
| 1243 | + glm::quat hmdRotation = extractRotation(myAvatar->getHMDSensorMatrix()); | |
| 1244 | + _myCamera.setRotation(cameraEntity->getRotation() * hmdRotation); | |
| 1245 | + glm::vec3 hmdOffset = extractTranslation(myAvatar->getHMDSensorMatrix()); | |
| 1246 | + _myCamera.setPosition(cameraEntity->getPosition() + (hmdRotation * hmdOffset)); | |
| 1247 | + } else { | |
| 1248 | + _myCamera.setRotation(cameraEntity->getRotation()); | |
| 1249 | + _myCamera.setPosition(cameraEntity->getPosition()); | |
| 1250 | + } | |
| 1251 | + } | |
| 1207 | 1252 | } |
| 1208 | 1253 | // Update camera position |
| 1209 | 1254 | if (!isHMDMode()) { |
| @@ -1577,8 +1622,9 @@ void Application::keyPressEvent(QKeyEvent* event) { · 367 unmodified lines | ||
| 1577 | 1622 | |
| 1578 | 1623 | case Qt::Key_X: |
| 1579 | 1624 | if (isMeta && isShifted) { |
| 1580 | − auto offscreenUi = DependencyManager::get<OffscreenUi>(); | |
| 1581 | − offscreenUi->load("TestControllers.qml"); | |
| 1625 | +// auto offscreenUi = DependencyManager::get<OffscreenUi>(); | |
| 1626 | +// offscreenUi->load("TestControllers.qml"); | |
| 1627 | + RecorderDialog::toggle(); | |
| 1582 | 1628 | } |
| 1583 | 1629 | break; |
| 1584 | 1630 | |
| @@ -1855,8 +1901,12 @@ void Application::focusOutEvent(QFocusEvent* event) { · 270 unmodified lines | ||
| 1855 | 1901 | inputPlugin->pluginFocusOutEvent(); |
| 1856 | 1902 | } |
| 1857 | 1903 | } |
| 1904 | + | |
| 1905 | +// FIXME spacemouse code still needs cleanup | |
| 1858 | 1906 | #if 0 |
| 1859 | − ConnexionData::getInstance().focusOutEvent(); | |
| 1907 | + //SpacemouseDevice::getInstance().focusOutEvent(); | |
| 1908 | + //SpacemouseManager::getInstance().getDevice()->focusOutEvent(); | |
| 1909 | + SpacemouseManager::getInstance().ManagerFocusOutEvent(); | |
| 1860 | 1910 | #endif |
| 1861 | 1911 | |
| 1862 | 1912 | // synthesize events for keys currently pressed, since we may not get their release events |
| @@ -2103,13 +2153,6 @@ bool Application::acceptSnapshot(const QString& urlString) { · 240 unmodified lines | ||
| 2103 | 2153 | return true; |
| 2104 | 2154 | } |
| 2105 | 2155 | |
| 2106 | −// Every second, send a ping, if menu item is checked. | |
| 2107 | −void Application::ping() { | |
| 2108 | − if (Menu::getInstance()->isOptionChecked(MenuOption::TestPing)) { | |
| 2109 | − DependencyManager::get<NodeList>()->sendPingPackets(); | |
| 2110 | − } | |
| 2111 | −} | |
| 2112 | − | |
| 2113 | 2156 | void Application::idle(uint64_t now) { |
| 2114 | 2157 | if (_aboutToQuit) { |
| 2115 | 2158 | return; // bail early, nothing to do here. |
| @@ -2649,8 +2692,8 @@ void Application::cycleCamera() { · 533 unmodified lines | ||
| 2649 | 2692 | menu->setIsOptionChecked(MenuOption::ThirdPerson, false); |
| 2650 | 2693 | menu->setIsOptionChecked(MenuOption::FullscreenMirror, true); |
| 2651 | 2694 | |
| 2652 | − } else if (menu->isOptionChecked(MenuOption::IndependentMode)) { | |
| 2653 | − // do nothing if in independe mode | |
| 2695 | + } else if (menu->isOptionChecked(MenuOption::IndependentMode) || menu->isOptionChecked(MenuOption::CameraEntityMode)) { | |
| 2696 | + // do nothing if in independent or camera entity modes | |
| 2654 | 2697 | return; |
| 2655 | 2698 | } |
| 2656 | 2699 | cameraMenuChanged(); // handle the menu change |
| @@ -2677,6 +2720,10 @@ void Application::cameraMenuChanged() { · 20 unmodified lines | ||
| 2677 | 2720 | if (_myCamera.getMode() != CAMERA_MODE_INDEPENDENT) { |
| 2678 | 2721 | _myCamera.setMode(CAMERA_MODE_INDEPENDENT); |
| 2679 | 2722 | } |
| 2723 | + } else if (Menu::getInstance()->isOptionChecked(MenuOption::CameraEntityMode)) { | |
| 2724 | + if (_myCamera.getMode() != CAMERA_MODE_ENTITY) { | |
| 2725 | + _myCamera.setMode(CAMERA_MODE_ENTITY); | |
| 2726 | + } | |
| 2680 | 2727 | } |
| 2681 | 2728 | } |
| 2682 | 2729 | |
| @@ -2799,7 +2846,7 @@ void Application::update(float deltaTime) { · 116 unmodified lines | ||
| 2799 | 2846 | float timeFactor = EXPECTED_FRAME_RATE * deltaTime; |
| 2800 | 2847 | myAvatar->setDriveKeys(PITCH, -1.0f * userInputMapper->getActionState(controller::Action::PITCH) / timeFactor); |
| 2801 | 2848 | myAvatar->setDriveKeys(YAW, -1.0f * userInputMapper->getActionState(controller::Action::YAW) / timeFactor); |
| 2802 | − myAvatar->setDriveKeys(STEP_YAW, -1.0f * userInputMapper->getActionState(controller::Action::STEP_YAW) / timeFactor); | |
| 2849 | + myAvatar->setDriveKeys(STEP_YAW, -1.0f * userInputMapper->getActionState(controller::Action::STEP_YAW)); | |
| 2803 | 2850 | } |
| 2804 | 2851 | } |
| 2805 | 2852 | myAvatar->setDriveKeys(ZOOM, userInputMapper->getActionState(controller::Action::TRANSLATE_CAMERA_Z)); |
| @@ -3498,10 +3545,6 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 692 unmodified lines | ||
| 3498 | 3545 | if (Menu::getInstance()->isOptionChecked(MenuOption::PhysicsShowHulls)) { |
| 3499 | 3546 | renderDebugFlags = (RenderArgs::DebugFlags) (renderDebugFlags | (int)RenderArgs::RENDER_DEBUG_HULLS); |
| 3500 | 3547 | } |
| 3501 | − if (Menu::getInstance()->isOptionChecked(MenuOption::PhysicsShowOwned)) { | |
| 3502 | − renderDebugFlags = | |
| 3503 | − (RenderArgs::DebugFlags) (renderDebugFlags | (int)RenderArgs::RENDER_DEBUG_SIMULATION_OWNERSHIP); | |
| 3504 | − } | |
| 3505 | 3548 | renderArgs->_debugFlags = renderDebugFlags; |
| 3506 | 3549 | //ViveControllerManager::getInstance().updateRendering(renderArgs, _main3DScene, pendingChanges); |
| 3507 | 3550 | } |
| @@ -3561,6 +3604,9 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 53 unmodified lines | ||
| 3561 | 3604 | renderContext._maxDrawnOverlay3DItems = sceneInterface->getEngineMaxDrawnOverlay3DItems(); |
| 3562 | 3605 | |
| 3563 | 3606 | renderContext._drawItemStatus = sceneInterface->doEngineDisplayItemStatus(); |
| 3607 | + if (Menu::getInstance()->isOptionChecked(MenuOption::PhysicsShowOwned)) { | |
| 3608 | + renderContext._drawItemStatus |= render::showNetworkStatusFlag; | |
| 3609 | + } | |
| 3564 | 3610 | renderContext._drawHitEffect = sceneInterface->doEngineDisplayHitEffect(); |
| 3565 | 3611 | |
| 3566 | 3612 | renderContext._occlusionStatus = Menu::getInstance()->isOptionChecked(MenuOption::DebugAmbientOcclusion); |
| @@ -4650,7 +4696,7 @@ DisplayPlugin* Application::getActiveDisplayPlugin() { · 1083 unmodified lines | ||
| 4650 | 4696 | updateDisplayMode(); |
| 4651 | 4697 | Q_ASSERT(_displayPlugin); |
| 4652 | 4698 | } |
| 4653 | − return _displayPlugin.data(); | |
| 4699 | + return _displayPlugin.get(); | |
| 4654 | 4700 | } |
| 4655 | 4701 | |
| 4656 | 4702 | const DisplayPlugin* Application::getActiveDisplayPlugin() const { |
| @@ -4690,10 +4736,10 @@ void Application::updateDisplayMode() { · 33 unmodified lines | ||
| 4690 | 4736 | bool first = true; |
| 4691 | 4737 | foreach(auto displayPlugin, displayPlugins) { |
| 4692 | 4738 | addDisplayPluginToMenu(displayPlugin, first); |
| 4693 | − QObject::connect(displayPlugin.data(), &DisplayPlugin::requestRender, [this] { | |
| 4739 | + QObject::connect(displayPlugin.get(), &DisplayPlugin::requestRender, [this] { | |
| 4694 | 4740 | paintGL(); |
| 4695 | 4741 | }); |
| 4696 | − QObject::connect(displayPlugin.data(), &DisplayPlugin::recommendedFramebufferSizeChanged, [this](const QSize & size) { | |
| 4742 | + QObject::connect(displayPlugin.get(), &DisplayPlugin::recommendedFramebufferSizeChanged, [this](const QSize & size) { | |
| 4697 | 4743 | resizeGL(); |
| 4698 | 4744 | }); |
| 4699 | 4745 | |
| @@ -4819,12 +4865,14 @@ void Application::updateInputModes() { · 119 unmodified lines | ||
| 4819 | 4865 | foreach(auto inputPlugin, inputPlugins) { |
| 4820 | 4866 | QString name = inputPlugin->getName(); |
| 4821 | 4867 | QAction* action = menu->getActionForOption(name); |
| 4822 | − if (action->isChecked() && !_activeInputPlugins.contains(inputPlugin)) { | |
| 4823 | − _activeInputPlugins.append(inputPlugin); | |
| 4824 | − newInputPlugins.append(inputPlugin); | |
| 4825 | − } else if (!action->isChecked() && _activeInputPlugins.contains(inputPlugin)) { | |
| 4826 | − _activeInputPlugins.removeOne(inputPlugin); | |
| 4827 | − removedInputPlugins.append(inputPlugin); | |
| 4868 | + | |
| 4869 | + auto it = std::find(std::begin(_activeInputPlugins), std::end(_activeInputPlugins), inputPlugin); | |
| 4870 | + if (action->isChecked() && it == std::end(_activeInputPlugins)) { | |
| 4871 | + _activeInputPlugins.push_back(inputPlugin); | |
| 4872 | + newInputPlugins.push_back(inputPlugin); | |
| 4873 | + } else if (!action->isChecked() && it != std::end(_activeInputPlugins)) { | |
| 4874 | + _activeInputPlugins.erase(it); | |
| 4875 | + removedInputPlugins.push_back(inputPlugin); | |
| 4828 | 4876 | } |
| 4829 | 4877 | } |
| 4830 | 4878 | |