mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 15:39:57 +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
|
// remove from the physical simulation
|
||||||
_incomingChanges.remove(motionState);
|
_incomingChanges.remove(motionState);
|
||||||
_physicalObjects.remove(motionState);
|
|
||||||
removeOwnershipData(motionState);
|
removeOwnershipData(motionState);
|
||||||
_entitiesToRemoveFromPhysics.insert(entity);
|
_entitiesToRemoveFromPhysics.insert(entity);
|
||||||
if (canBeKinematic && entity->isMovingRelativeToParent()) {
|
if (canBeKinematic && entity->isMovingRelativeToParent()) {
|
||||||
|
@ -443,6 +442,7 @@ void PhysicalEntitySimulation::buildPhysicsTransaction(PhysicsEngine::Transactio
|
||||||
void PhysicalEntitySimulation::handleProcessedPhysicsTransaction(PhysicsEngine::Transaction& transaction) {
|
void PhysicalEntitySimulation::handleProcessedPhysicsTransaction(PhysicsEngine::Transaction& transaction) {
|
||||||
// things on objectsToRemove are ready for delete
|
// things on objectsToRemove are ready for delete
|
||||||
for (auto object : transaction.objectsToRemove) {
|
for (auto object : transaction.objectsToRemove) {
|
||||||
|
_physicalObjects.remove(object);
|
||||||
delete object;
|
delete object;
|
||||||
}
|
}
|
||||||
transaction.clear();
|
transaction.clear();
|
||||||
|
|
Loading…
Reference in a new issue