cleanup PhysicalEntitySimulation::_outgoingChanges

This commit is contained in:
Andrew Meadows 2015-05-05 16:51:07 -07:00
parent d4701b4310
commit 50f73602f6
2 changed files with 8 additions and 6 deletions

View file

@ -68,6 +68,7 @@ void PhysicalEntitySimulation::removeEntityInternal(EntityItem* entity) {
motionState->clearEntity();
entity->setPhysicsInfo(nullptr);
_pendingRemoves.insert(motionState);
_outgoingChanges.remove(motionState);
}
}
@ -81,6 +82,7 @@ void PhysicalEntitySimulation::changeEntityInternal(EntityItem* entity) {
_pendingChanges.remove(motionState);
_physicalObjects.remove(motionState);
_pendingRemoves.insert(motionState);
_outgoingChanges.remove(motionState);
if (entity->isMoving()) {
_simpleKinematicEntities.insert(entity);
}

View file

@ -37,11 +37,11 @@ public:
protected: // only called by EntitySimulation
// overrides for EntitySimulation
void updateEntitiesInternal(const quint64& now);
void addEntityInternal(EntityItem* entity);
void removeEntityInternal(EntityItem* entity);
void changeEntityInternal(EntityItem* entity);
void clearEntitiesInternal();
virtual void updateEntitiesInternal(const quint64& now);
virtual void addEntityInternal(EntityItem* entity);
virtual void removeEntityInternal(EntityItem* entity);
virtual void changeEntityInternal(EntityItem* entity);
virtual void clearEntitiesInternal();
public:
VectorOfMotionStates& getObjectsToDelete();
@ -58,7 +58,7 @@ private:
SetOfEntityMotionStates _pendingChanges; // EntityMotionStates already in PhysicsEngine that need their physics changed
// outgoing changes
QSet<EntityMotionState*> _outgoingChanges; // EntityMotionStates for which we need to send updates to entity-server
SetOfEntityMotionStates _outgoingChanges; // EntityMotionStates for which we need to send updates to entity-server
SetOfMotionStates _physicalObjects; // MotionStates of entities in PhysicsEngine
VectorOfMotionStates _tempVector; // temporary array reference, valid immediately after getObjectsToRemove() (and friends)