History

Merge branch 'master' of https://github.com/highfidelity/hifi into remove-global-collision-and-update-examples

Howard Stearns committed 11 years ago

Commit 3c718af2 parents de44c56 92c55d631 files · +584 −258Browse files

Showing the changes to interface/src/Application.cpp (1 of 31 files). Show all

Unified · Split

interface/src/Application.cpp+14−1
@@ -687,6 +687,10 @@ Application::~Application() { · 686 unmodified lines
687687 // stop the glWidget frame timer so it doesn't call paintGL
688688 _glWidget->stopFrameTimer();
689689
690+ // remove avatars from physics engine
691+ DependencyManager::get<AvatarManager>()->clearOtherAvatars();
692+ _physicsEngine.deleteObjects(DependencyManager::get<AvatarManager>()->getObjectsToDelete());
693+
690694 DependencyManager::destroy<OffscreenUi>();
691695 DependencyManager::destroy<AvatarManager>();
692696 DependencyManager::destroy<AnimationCache>();
@@ -2150,7 +2154,7 @@ void Application::init() { · 1457 unmodified lines
21502154 _physicsEngine.init();
21512155
21522156 EntityTree* tree = _entities.getTree();
2153− _entitySimulation.init(tree, &_physicsEngine, &_shapeManager, &_entityEditSender);
2157+ _entitySimulation.init(tree, &_physicsEngine, &_entityEditSender);
21542158 tree->setSimulation(&_entitySimulation);
21552159
21562160 auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
@@ -2467,12 +2471,21 @@ void Application::update(float deltaTime) { · 310 unmodified lines
24672471 _physicsEngine.changeObjects(_entitySimulation.getObjectsToChange());
24682472 _entitySimulation.unlock();
24692473
2474+ AvatarManager* avatarManager = DependencyManager::get<AvatarManager>().data();
2475+ _physicsEngine.deleteObjects(avatarManager->getObjectsToDelete());
2476+ _physicsEngine.addObjects(avatarManager->getObjectsToAdd());
2477+ _physicsEngine.changeObjects(avatarManager->getObjectsToChange());
2478+
24702479 _physicsEngine.stepSimulation();
24712480
24722481 if (_physicsEngine.hasOutgoingChanges()) {
24732482 _entitySimulation.lock();
24742483 _entitySimulation.handleOutgoingChanges(_physicsEngine.getOutgoingChanges(), _physicsEngine.getSessionID());
24752484 _entitySimulation.unlock();
2485+
2486+ avatarManager->handleOutgoingChanges(_physicsEngine.getOutgoingChanges());
2487+ avatarManager->handleCollisionEvents(_physicsEngine.getCollisionEvents());
2488+
24762489 _physicsEngine.dumpStatsIfNecessary();
24772490 }
24782491 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t