diff --git a/libraries/entities/src/SimpleEntitySimulation.cpp b/libraries/entities/src/SimpleEntitySimulation.cpp index b6e444a0a9..e4662638e3 100644 --- a/libraries/entities/src/SimpleEntitySimulation.cpp +++ b/libraries/entities/src/SimpleEntitySimulation.cpp @@ -22,13 +22,12 @@ void SimpleEntitySimulation::updateEntitiesInternal(const quint64& now) { SetOfEntities::iterator itemItr = _movingEntities.begin(); while (itemItr != _movingEntities.end()) { EntityItem* entity = *itemItr; - if (!entity->isMoving()) { - itemItr = _movingEntities.erase(itemItr); - _movableButStoppedEntities.insert(entity); - } else { + if (entity->isMoving()) { entity->simulate(now); _entitiesToSort.insert(entity); ++itemItr; + } else { + itemItr = _movingEntities.erase(itemItr); } } @@ -53,9 +52,7 @@ void SimpleEntitySimulation::updateEntitiesInternal(const quint64& now) { void SimpleEntitySimulation::addEntityInternal(EntityItem* entity) { if (entity->isMoving()) { _movingEntities.insert(entity); - } else if (entity->getCollisionsWillMove()) { - _movableButStoppedEntities.insert(entity); - } + } if (!entity->getSimulatorID().isNull()) { _hasSimulationOwnerEntities.insert(entity); } @@ -63,7 +60,6 @@ void SimpleEntitySimulation::addEntityInternal(EntityItem* entity) { void SimpleEntitySimulation::removeEntityInternal(EntityItem* entity) { _movingEntities.remove(entity); - _movableButStoppedEntities.remove(entity); _hasSimulationOwnerEntities.remove(entity); clearEntitySimulation(entity); } @@ -75,11 +71,8 @@ void SimpleEntitySimulation::changeEntityInternal(EntityItem* entity) { if (dirtyFlags & SIMPLE_SIMULATION_DIRTY_FLAGS) { if (entity->isMoving()) { _movingEntities.insert(entity); - } else if (entity->getCollisionsWillMove()) { - _movableButStoppedEntities.remove(entity); } else { _movingEntities.remove(entity); - _movableButStoppedEntities.remove(entity); } if (!entity->getSimulatorID().isNull()) { _hasSimulationOwnerEntities.insert(entity); @@ -90,7 +83,6 @@ void SimpleEntitySimulation::changeEntityInternal(EntityItem* entity) { void SimpleEntitySimulation::clearEntitiesInternal() { _movingEntities.clear(); - _movableButStoppedEntities.clear(); _hasSimulationOwnerEntities.clear(); } diff --git a/libraries/entities/src/SimpleEntitySimulation.h b/libraries/entities/src/SimpleEntitySimulation.h index b63047ef0e..454d168556 100644 --- a/libraries/entities/src/SimpleEntitySimulation.h +++ b/libraries/entities/src/SimpleEntitySimulation.h @@ -29,7 +29,6 @@ protected: virtual void clearEntitiesInternal(); SetOfEntities _movingEntities; - SetOfEntities _movableButStoppedEntities; SetOfEntities _hasSimulationOwnerEntities; };