Showing the changes to interface/src/Application.cpp (1 of 69 files). Show all
Unified · Split
| @@ -52,6 +52,7 @@ · 51 unmodified lines | |||
| 52 | #include <QMediaPlayer> | 52 | #include <QMediaPlayer> |
| 53 | #include <QMimeData> | 53 | #include <QMimeData> |
| 54 | #include <QMessageBox> | 54 | #include <QMessageBox> |
| 55 | #include <QJsonDocument> | ||
| 55 | 56 | ||
| 56 | #include <AddressManager.h> | 57 | #include <AddressManager.h> |
| 57 | #include <AccountManager.h> | 58 | #include <AccountManager.h> |
| @@ -75,7 +76,7 @@ · 17 unmodified lines | |||
| 75 | #include <PhysicsEngine.h> | 76 | #include <PhysicsEngine.h> |
| 76 | #include <ProgramObject.h> | 77 | #include <ProgramObject.h> |
| 77 | #include <ResourceCache.h> | 78 | #include <ResourceCache.h> |
| 78 | #include <ScriptCache.h> | 79 | //#include <ScriptCache.h> |
| 79 | #include <SettingHandle.h> | 80 | #include <SettingHandle.h> |
| 80 | #include <SoundCache.h> | 81 | #include <SoundCache.h> |
| 81 | #include <TextRenderer.h> | 82 | #include <TextRenderer.h> |
| @@ -220,7 +221,7 @@ bool setupEssentials(int& argc, char** argv) { · 138 unmodified lines | |||
| 220 | auto addressManager = DependencyManager::set<AddressManager>(); | 221 | auto addressManager = DependencyManager::set<AddressManager>(); |
| 221 | auto nodeList = DependencyManager::set<NodeList>(NodeType::Agent, listenPort); | 222 | auto nodeList = DependencyManager::set<NodeList>(NodeType::Agent, listenPort); |
| 222 | auto geometryCache = DependencyManager::set<GeometryCache>(); | 223 | auto geometryCache = DependencyManager::set<GeometryCache>(); |
| 223 | auto scriptCache = DependencyManager::set<ScriptCache>(); | 224 | //auto scriptCache = DependencyManager::set<ScriptCache>(); |
| 224 | auto soundCache = DependencyManager::set<SoundCache>(); | 225 | auto soundCache = DependencyManager::set<SoundCache>(); |
| 225 | auto glowEffect = DependencyManager::set<GlowEffect>(); | 226 | auto glowEffect = DependencyManager::set<GlowEffect>(); |
| 226 | auto faceshift = DependencyManager::set<Faceshift>(); | 227 | auto faceshift = DependencyManager::set<Faceshift>(); |
| @@ -417,8 +418,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 190 unmodified lines | |||
| 417 | 418 | ||
| 418 | // tell the NodeList instance who to tell the domain server we care about | 419 | // tell the NodeList instance who to tell the domain server we care about |
| 419 | nodeList->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer | 420 | nodeList->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer |
| 420 | << NodeType::EntityServer | 421 | << NodeType::EntityServer); |
| 421 | << NodeType::MetavoxelServer); | ||
| 422 | 422 | ||
| 423 | // connect to the packet sent signal of the _entityEditSender | 423 | // connect to the packet sent signal of the _entityEditSender |
| 424 | connect(&_entityEditSender, &EntityEditPacketSender::packetSent, this, &Application::packetSent); | 424 | connect(&_entityEditSender, &EntityEditPacketSender::packetSent, this, &Application::packetSent); |
| @@ -601,7 +601,7 @@ Application::~Application() { · 176 unmodified lines | |||
| 601 | DependencyManager::destroy<AnimationCache>(); | 601 | DependencyManager::destroy<AnimationCache>(); |
| 602 | DependencyManager::destroy<TextureCache>(); | 602 | DependencyManager::destroy<TextureCache>(); |
| 603 | DependencyManager::destroy<GeometryCache>(); | 603 | DependencyManager::destroy<GeometryCache>(); |
| 604 | DependencyManager::destroy<ScriptCache>(); | 604 | //DependencyManager::destroy<ScriptCache>(); |
| 605 | DependencyManager::destroy<SoundCache>(); | 605 | DependencyManager::destroy<SoundCache>(); |
| 606 | 606 | ||
| 607 | qInstallMessageHandler(NULL); // NOTE: Do this as late as possible so we continue to get our log messages | 607 | qInstallMessageHandler(NULL); // NOTE: Do this as late as possible so we continue to get our log messages |
| @@ -774,8 +774,9 @@ void Application::paintGL() { · 166 unmodified lines | |||
| 774 | 774 | ||
| 775 | { | 775 | { |
| 776 | PerformanceTimer perfTimer("renderOverlay"); | 776 | PerformanceTimer perfTimer("renderOverlay"); |
| 777 | // PrioVR will only work if renderOverlay is called, calibration is connected to Application::renderingOverlay() | ||
| 778 | _applicationOverlay.renderOverlay(true); | ||
| 777 | if (Menu::getInstance()->isOptionChecked(MenuOption::UserInterface)) { | 779 | if (Menu::getInstance()->isOptionChecked(MenuOption::UserInterface)) { |
| 778 | _applicationOverlay.renderOverlay(true); | ||
| 779 | _applicationOverlay.displayOverlayTexture(); | 780 | _applicationOverlay.displayOverlayTexture(); |
| 780 | } | 781 | } |
| 781 | } | 782 | } |
| @@ -1448,8 +1449,7 @@ void Application::sendPingPackets() { · 666 unmodified lines | |||
| 1448 | QByteArray pingPacket = DependencyManager::get<NodeList>()->constructPingPacket(); | 1449 | QByteArray pingPacket = DependencyManager::get<NodeList>()->constructPingPacket(); |
| 1449 | controlledBroadcastToNodes(pingPacket, NodeSet() | 1450 | controlledBroadcastToNodes(pingPacket, NodeSet() |
| 1450 | << NodeType::EntityServer | 1451 | << NodeType::EntityServer |
| 1451 | << NodeType::AudioMixer << NodeType::AvatarMixer | 1452 | << NodeType::AudioMixer << NodeType::AvatarMixer); |
| 1452 | << NodeType::MetavoxelServer); | ||
| 1453 | } | 1453 | } |
| 1454 | 1454 | ||
| 1455 | // Every second, check the frame rates and other stuff | 1455 | // Every second, check the frame rates and other stuff |
| @@ -1792,8 +1792,6 @@ void Application::init() { · 336 unmodified lines | |||
| 1792 | _entityClipboardRenderer.setViewFrustum(getViewFrustum()); | 1792 | _entityClipboardRenderer.setViewFrustum(getViewFrustum()); |
| 1793 | _entityClipboardRenderer.setTree(&_entityClipboard); | 1793 | _entityClipboardRenderer.setTree(&_entityClipboard); |
| 1794 | 1794 | ||
| 1795 | _metavoxels.init(); | ||
| 1796 | |||
| 1797 | _rearMirrorTools = new RearMirrorTools(_glWidget, _mirrorViewRect); | 1795 | _rearMirrorTools = new RearMirrorTools(_glWidget, _mirrorViewRect); |
| 1798 | 1796 | ||
| 1799 | connect(_rearMirrorTools, SIGNAL(closeView()), SLOT(closeMirrorView())); | 1797 | connect(_rearMirrorTools, SIGNAL(closeView()), SLOT(closeMirrorView())); |
| @@ -1956,16 +1954,6 @@ void Application::updateThreads(float deltaTime) { · 156 unmodified lines | |||
| 1956 | } | 1954 | } |
| 1957 | } | 1955 | } |
| 1958 | 1956 | ||
| 1959 | void Application::updateMetavoxels(float deltaTime) { | ||
| 1960 | PerformanceTimer perfTimer("updateMetavoxels"); | ||
| 1961 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); | ||
| 1962 | PerformanceWarning warn(showWarnings, "Application::updateMetavoxels()"); | ||
| 1963 | |||
| 1964 | if (Menu::getInstance()->isOptionChecked(MenuOption::Metavoxels)) { | ||
| 1965 | _metavoxels.simulate(deltaTime); | ||
| 1966 | } | ||
| 1967 | } | ||
| 1968 | |||
| 1969 | void Application::cameraMenuChanged() { | 1957 | void Application::cameraMenuChanged() { |
| 1970 | if (Menu::getInstance()->isOptionChecked(MenuOption::FullscreenMirror)) { | 1958 | if (Menu::getInstance()->isOptionChecked(MenuOption::FullscreenMirror)) { |
| 1971 | if (_myCamera.getMode() != CAMERA_MODE_MIRROR) { | 1959 | if (_myCamera.getMode() != CAMERA_MODE_MIRROR) { |
| @@ -2065,7 +2053,6 @@ void Application::update(float deltaTime) { · 93 unmodified lines | |||
| 2065 | 2053 | ||
| 2066 | DependencyManager::get<AvatarManager>()->updateOtherAvatars(deltaTime); //loop through all the other avatars and simulate them... | 2054 | DependencyManager::get<AvatarManager>()->updateOtherAvatars(deltaTime); //loop through all the other avatars and simulate them... |
| 2067 | 2055 | ||
| 2068 | updateMetavoxels(deltaTime); // update metavoxels | ||
| 2069 | updateCamera(deltaTime); // handle various camera tweaks like off axis projection | 2056 | updateCamera(deltaTime); // handle various camera tweaks like off axis projection |
| 2070 | updateDialogs(deltaTime); // update various stats dialogs if present | 2057 | updateDialogs(deltaTime); // update various stats dialogs if present |
| 2071 | updateCursor(deltaTime); // Handle cursor updates | 2058 | updateCursor(deltaTime); // Handle cursor updates |
| @@ -2815,14 +2802,6 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs · 743 unmodified lines | |||
| 2815 | float originSphereRadius = 0.05f; | 2802 | float originSphereRadius = 0.05f; |
| 2816 | DependencyManager::get<GeometryCache>()->renderSphere(originSphereRadius, 15, 15, glm::vec4(1.0f, 0.0f, 0.0f, 1.0f)); | 2803 | DependencyManager::get<GeometryCache>()->renderSphere(originSphereRadius, 15, 15, glm::vec4(1.0f, 0.0f, 0.0f, 1.0f)); |
| 2817 | 2804 | ||
| 2818 | // also, metavoxels | ||
| 2819 | if (Menu::getInstance()->isOptionChecked(MenuOption::Metavoxels)) { | ||
| 2820 | PerformanceTimer perfTimer("metavoxels"); | ||
| 2821 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | ||
| 2822 | "Application::displaySide() ... metavoxels..."); | ||
| 2823 | _metavoxels.render(); | ||
| 2824 | } | ||
| 2825 | |||
| 2826 | // render models... | 2805 | // render models... |
| 2827 | if (Menu::getInstance()->isOptionChecked(MenuOption::Entities)) { | 2806 | if (Menu::getInstance()->isOptionChecked(MenuOption::Entities)) { |
| 2828 | PerformanceTimer perfTimer("entities"); | 2807 | PerformanceTimer perfTimer("entities"); |
| @@ -3499,7 +3478,6 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 670 unmodified lines | |||
| 3499 | scriptEngine->registerGlobalObject("AnimationCache", DependencyManager::get<AnimationCache>().data()); | 3478 | scriptEngine->registerGlobalObject("AnimationCache", DependencyManager::get<AnimationCache>().data()); |
| 3500 | scriptEngine->registerGlobalObject("SoundCache", DependencyManager::get<SoundCache>().data()); | 3479 | scriptEngine->registerGlobalObject("SoundCache", DependencyManager::get<SoundCache>().data()); |
| 3501 | scriptEngine->registerGlobalObject("Account", AccountScriptingInterface::getInstance()); | 3480 | scriptEngine->registerGlobalObject("Account", AccountScriptingInterface::getInstance()); |
| 3502 | scriptEngine->registerGlobalObject("Metavoxels", &_metavoxels); | ||
| 3503 | 3481 | ||
| 3504 | scriptEngine->registerGlobalObject("GlobalServices", GlobalServicesScriptingInterface::getInstance()); | 3482 | scriptEngine->registerGlobalObject("GlobalServices", GlobalServicesScriptingInterface::getInstance()); |
| 3505 | qScriptRegisterMetaType(scriptEngine, DownloadInfoResultToScriptValue, DownloadInfoResultFromScriptValue); | 3483 | qScriptRegisterMetaType(scriptEngine, DownloadInfoResultToScriptValue, DownloadInfoResultFromScriptValue); |