Showing the changes to interface/src/Application.cpp (1 of 38 files). Show all
Unified · Split
| @@ -2124,6 +2124,9 @@ void Application::init() { · 2123 unmodified lines | |||
| 2124 | // initialize the GlowEffect with our widget | 2124 | // initialize the GlowEffect with our widget |
| 2125 | bool glow = Menu::getInstance()->isOptionChecked(MenuOption::EnableGlowEffect); | 2125 | bool glow = Menu::getInstance()->isOptionChecked(MenuOption::EnableGlowEffect); |
| 2126 | DependencyManager::get<GlowEffect>()->init(glow); | 2126 | DependencyManager::get<GlowEffect>()->init(glow); |
| 2127 | |||
| 2128 | // Make sure any new sounds are loaded as soon as know about them. | ||
| 2129 | connect(tree, &EntityTree::newCollisionSoundURL, DependencyManager::get<SoundCache>().data(), &SoundCache::getSound); | ||
| 2127 | } | 2130 | } |
| 2128 | 2131 | ||
| 2129 | void Application::closeMirrorView() { | 2132 | void Application::closeMirrorView() { |
| @@ -2427,19 +2430,20 @@ void Application::update(float deltaTime) { · 297 unmodified lines | |||
| 2427 | _entitySimulation.unlock(); | 2430 | _entitySimulation.unlock(); |
| 2428 | 2431 | ||
| 2429 | avatarManager->handleOutgoingChanges(_physicsEngine.getOutgoingChanges()); | 2432 | avatarManager->handleOutgoingChanges(_physicsEngine.getOutgoingChanges()); |
| 2430 | avatarManager->handleCollisionEvents(_physicsEngine.getCollisionEvents()); | 2433 | auto collisionEvents = _physicsEngine.getCollisionEvents(); |
| 2434 | avatarManager->handleCollisionEvents(collisionEvents); | ||
| 2431 | 2435 | ||
| 2432 | _physicsEngine.dumpStatsIfNecessary(); | 2436 | _physicsEngine.dumpStatsIfNecessary(); |
| 2433 | } | ||
| 2434 | } | ||
| 2435 | 2437 | ||
| 2436 | if (!_aboutToQuit) { | 2438 | if (!_aboutToQuit) { |
| 2437 | PerformanceTimer perfTimer("entities"); | 2439 | PerformanceTimer perfTimer("entities"); |
| 2438 | // Collision events (and their scripts) must not be handled when we're locked, above. (That would risk deadlock.) | 2440 | // Collision events (and their scripts) must not be handled when we're locked, above. (That would risk deadlock.) |
| 2439 | _entitySimulation.handleCollisionEvents(_physicsEngine.getCollisionEvents()); | 2441 | _entitySimulation.handleCollisionEvents(collisionEvents); |
| 2440 | // NOTE: the _entities.update() call below will wait for lock | 2442 | // NOTE: the _entities.update() call below will wait for lock |
| 2441 | // and will simulate entity motion (the EntityTree has been given an EntitySimulation). | 2443 | // and will simulate entity motion (the EntityTree has been given an EntitySimulation). |
| 2442 | _entities.update(); // update the models... | 2444 | _entities.update(); // update the models... |
| 2445 | } | ||
| 2446 | } | ||
| 2443 | } | 2447 | } |
| 2444 | 2448 | ||
| 2445 | { | 2449 | { |