mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-24 21:50:22 +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);
|
bumpAndPruneContacts(object);
|
||||||
btRigidBody* body = object->getRigidBody();
|
btRigidBody* body = object->getRigidBody();
|
||||||
if (body) {
|
if (body) {
|
||||||
|
if (_activeStaticBodies.size() > 0) {
|
||||||
|
std::set<btRigidBody*>::iterator itr = _activeStaticBodies.find(body);
|
||||||
|
if (itr != _activeStaticBodies.end()) {
|
||||||
|
_activeStaticBodies.erase(itr);
|
||||||
|
}
|
||||||
|
}
|
||||||
removeDynamicsForBody(body);
|
removeDynamicsForBody(body);
|
||||||
_dynamicsWorld->removeRigidBody(body);
|
_dynamicsWorld->removeRigidBody(body);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue