Showing the changes to interface/src/Application.cpp (1 of 46 files). Show all
Unified · Split
| @@ -208,7 +208,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 207 unmodified lines | |||
| 208 | _justStarted(true), | 208 | _justStarted(true), |
| 209 | _physicsEngine(glm::vec3(0.0f)), | 209 | _physicsEngine(glm::vec3(0.0f)), |
| 210 | _entities(true, this, this), | 210 | _entities(true, this, this), |
| 211 | _entityCollisionSystem(), | ||
| 212 | _entityClipboardRenderer(false, this, this), | 211 | _entityClipboardRenderer(false, this, this), |
| 213 | _entityClipboard(), | 212 | _entityClipboard(), |
| 214 | _viewFrustum(), | 213 | _viewFrustum(), |
| @@ -1688,17 +1687,16 @@ void Application::init() { · 1473 unmodified lines | |||
| 1688 | _entities.init(); | 1687 | _entities.init(); |
| 1689 | _entities.setViewFrustum(getViewFrustum()); | 1688 | _entities.setViewFrustum(getViewFrustum()); |
| 1690 | 1689 | ||
| 1691 | EntityTree* entityTree = _entities.getTree(); | 1690 | EntityTree* tree = _entities.getTree(); |
| 1692 | 1691 | _physicsEngine.setEntityTree(tree); | |
| 1693 | _entityCollisionSystem.init(&_entityEditSender, entityTree, &_avatarManager); | 1692 | tree->setSimulation(&_physicsEngine); |
| 1694 | 1693 | _physicsEngine.init(&_entityEditSender); | |
| 1695 | entityTree->setSimulation(&_entityCollisionSystem); | ||
| 1696 | 1694 | ||
| 1697 | connect(&_entityCollisionSystem, &EntityCollisionSystem::entityCollisionWithEntity, | 1695 | connect(&_physicsEngine, &EntitySimulation::entityCollisionWithEntity, |
| 1698 | ScriptEngine::getEntityScriptingInterface(), &EntityScriptingInterface::entityCollisionWithEntity); | 1696 | ScriptEngine::getEntityScriptingInterface(), &EntityScriptingInterface::entityCollisionWithEntity); |
| 1699 | 1697 | ||
| 1700 | // connect the _entityCollisionSystem to our EntityTreeRenderer since that's what handles running entity scripts | 1698 | // connect the _entityCollisionSystem to our EntityTreeRenderer since that's what handles running entity scripts |
| 1701 | connect(&_entityCollisionSystem, &EntityCollisionSystem::entityCollisionWithEntity, | 1699 | connect(&_physicsEngine, &EntitySimulation::entityCollisionWithEntity, |
| 1702 | &_entities, &EntityTreeRenderer::entityCollisionWithEntity); | 1700 | &_entities, &EntityTreeRenderer::entityCollisionWithEntity); |
| 1703 | 1701 | ||
| 1704 | // connect the _entities (EntityTreeRenderer) to our script engine's EntityScriptingInterface for firing | 1702 | // connect the _entities (EntityTreeRenderer) to our script engine's EntityScriptingInterface for firing |
| @@ -1719,10 +1717,6 @@ void Application::init() { · 14 unmodified lines | |||
| 1719 | connect(_rearMirrorTools, SIGNAL(shrinkView()), SLOT(shrinkMirrorView())); | 1717 | connect(_rearMirrorTools, SIGNAL(shrinkView()), SLOT(shrinkMirrorView())); |
| 1720 | connect(_rearMirrorTools, SIGNAL(resetView()), SLOT(resetSensors())); | 1718 | connect(_rearMirrorTools, SIGNAL(resetView()), SLOT(resetSensors())); |
| 1721 | 1719 | ||
| 1722 | EntityTree* tree = _entities.getTree(); | ||
| 1723 | _physicsEngine.setEntityTree(tree); | ||
| 1724 | tree->setSimulation(&_physicsEngine); | ||
| 1725 | _physicsEngine.init(&_entityEditSender); | ||
| 1726 | // make sure our texture cache knows about window size changes | 1720 | // make sure our texture cache knows about window size changes |
| 1727 | DependencyManager::get<TextureCache>()->associateWithWidget(glCanvas.data()); | 1721 | DependencyManager::get<TextureCache>()->associateWithWidget(glCanvas.data()); |
| 1728 | 1722 | ||
| @@ -2044,9 +2038,6 @@ void Application::update(float deltaTime) { · 315 unmodified lines | |||
| 2044 | // NOTE: the _entities.update() call below will wait for lock | 2038 | // NOTE: the _entities.update() call below will wait for lock |
| 2045 | // and will simulate entity motion (the EntityTree has been given an EntitySimulation). | 2039 | // and will simulate entity motion (the EntityTree has been given an EntitySimulation). |
| 2046 | _entities.update(); // update the models... | 2040 | _entities.update(); // update the models... |
| 2047 | // The _entityCollisionSystem.updateCollisions() call below merely tries for lock, | ||
| 2048 | // and on failure it skips collision detection. | ||
| 2049 | _entityCollisionSystem.updateCollisions(); // collide the entities... | ||
| 2050 | } | 2041 | } |
| 2051 | 2042 | ||
| 2052 | { | 2043 | { |