Showing the changes to interface/src/Application.cpp (1 of 46 files). Show all
Unified · Split
| @@ -2199,6 +2199,9 @@ void Application::init() { · 2198 unmodified lines | |||
| 2199 | // initialize the GlowEffect with our widget | 2199 | // initialize the GlowEffect with our widget |
| 2200 | bool glow = Menu::getInstance()->isOptionChecked(MenuOption::EnableGlowEffect); | 2200 | bool glow = Menu::getInstance()->isOptionChecked(MenuOption::EnableGlowEffect); |
| 2201 | DependencyManager::get<GlowEffect>()->init(glow); | 2201 | DependencyManager::get<GlowEffect>()->init(glow); |
| 2202 | |||
| 2203 | // Make sure any new sounds are loaded as soon as know about them. | ||
| 2204 | connect(tree, &EntityTree::newCollisionSoundURL, DependencyManager::get<SoundCache>().data(), &SoundCache::getSound); | ||
| 2202 | } | 2205 | } |
| 2203 | 2206 | ||
| 2204 | void Application::closeMirrorView() { | 2207 | void Application::closeMirrorView() { |
| @@ -2502,19 +2505,20 @@ void Application::update(float deltaTime) { · 297 unmodified lines | |||
| 2502 | _entitySimulation.unlock(); | 2505 | _entitySimulation.unlock(); |
| 2503 | 2506 | ||
| 2504 | avatarManager->handleOutgoingChanges(_physicsEngine.getOutgoingChanges()); | 2507 | avatarManager->handleOutgoingChanges(_physicsEngine.getOutgoingChanges()); |
| 2505 | avatarManager->handleCollisionEvents(_physicsEngine.getCollisionEvents()); | 2508 | auto collisionEvents = _physicsEngine.getCollisionEvents(); |
| 2509 | avatarManager->handleCollisionEvents(collisionEvents); | ||
| 2506 | 2510 | ||
| 2507 | _physicsEngine.dumpStatsIfNecessary(); | 2511 | _physicsEngine.dumpStatsIfNecessary(); |
| 2508 | } | ||
| 2509 | } | ||
| 2510 | 2512 | ||
| 2511 | if (!_aboutToQuit) { | 2513 | if (!_aboutToQuit) { |
| 2512 | PerformanceTimer perfTimer("entities"); | 2514 | PerformanceTimer perfTimer("entities"); |
| 2513 | // Collision events (and their scripts) must not be handled when we're locked, above. (That would risk deadlock.) | 2515 | // Collision events (and their scripts) must not be handled when we're locked, above. (That would risk deadlock.) |
| 2514 | _entitySimulation.handleCollisionEvents(_physicsEngine.getCollisionEvents()); | 2516 | _entitySimulation.handleCollisionEvents(collisionEvents); |
| 2515 | // NOTE: the _entities.update() call below will wait for lock | 2517 | // NOTE: the _entities.update() call below will wait for lock |
| 2516 | // and will simulate entity motion (the EntityTree has been given an EntitySimulation). | 2518 | // and will simulate entity motion (the EntityTree has been given an EntitySimulation). |
| 2517 | _entities.update(); // update the models... | 2519 | _entities.update(); // update the models... |
| 2520 | } | ||
| 2521 | } | ||
| 2518 | } | 2522 | } |
| 2519 | 2523 | ||
| 2520 | { | 2524 | { |