mirror of
https://github.com/lubosz/overte.git
synced 2025-04-13 11:52:09 +02:00
remove from _physicalObjects list after transaction
This commit is contained in:
parent
bef053584b
commit
81f960a4bd
1 changed files with 1 additions and 1 deletions
|
@ -156,7 +156,6 @@ void PhysicalEntitySimulation::processChangedEntity(const EntityItemPointer& ent
|
|||
|
||||
// remove from the physical simulation
|
||||
_incomingChanges.remove(motionState);
|
||||
_physicalObjects.remove(motionState);
|
||||
removeOwnershipData(motionState);
|
||||
_entitiesToRemoveFromPhysics.insert(entity);
|
||||
if (canBeKinematic && entity->isMovingRelativeToParent()) {
|
||||
|
@ -443,6 +442,7 @@ void PhysicalEntitySimulation::buildPhysicsTransaction(PhysicsEngine::Transactio
|
|||
void PhysicalEntitySimulation::handleProcessedPhysicsTransaction(PhysicsEngine::Transaction& transaction) {
|
||||
// things on objectsToRemove are ready for delete
|
||||
for (auto object : transaction.objectsToRemove) {
|
||||
_physicalObjects.remove(object);
|
||||
delete object;
|
||||
}
|
||||
transaction.clear();
|
||||
|
|
Loading…
Reference in a new issue