mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 01:22:25 +02:00
find and remove dangling pointers from _activeStaticBodies on remove
This commit is contained in:
parent
c6cde2d412
commit
9e7b68fead
1 changed files with 6 additions and 0 deletions
|
@ -289,6 +289,12 @@ void PhysicsEngine::processTransaction(PhysicsEngine::Transaction& transaction)
|
|||
bumpAndPruneContacts(object);
|
||||
btRigidBody* body = object->getRigidBody();
|
||||
if (body) {
|
||||
if (_activeStaticBodies.size() > 0) {
|
||||
std::set<btRigidBody*>::iterator itr = _activeStaticBodies.find(body);
|
||||
if (itr != _activeStaticBodies.end()) {
|
||||
_activeStaticBodies.erase(itr);
|
||||
}
|
||||
}
|
||||
removeDynamicsForBody(body);
|
||||
_dynamicsWorld->removeRigidBody(body);
|
||||
|
||||
|
|
Loading…
Reference in a new issue