mirror of
https://github.com/overte-org/overte.git
synced 2025-07-17 08:56:47 +02:00
Merge pull request #14346 from AndrewMeadows/fix-crash-19654
Case 19654: fix crash in btCollisionWorld::updateSingleAabb()
This commit is contained in:
commit
4489efa58b
2 changed files with 15 additions and 8 deletions
|
@ -305,15 +305,16 @@ bool ObjectMotionState::handleHardAndEasyChanges(uint32_t& flags, PhysicsEngine*
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (_shape == newShape) {
|
|
||||||
// the shape didn't actually change, so we clear the DIRTY_SHAPE flag
|
|
||||||
flags &= ~Simulation::DIRTY_SHAPE;
|
|
||||||
// and clear the reference we just created
|
|
||||||
getShapeManager()->releaseShape(_shape);
|
|
||||||
} else {
|
} else {
|
||||||
_body->setCollisionShape(const_cast<btCollisionShape*>(newShape));
|
if (_shape == newShape) {
|
||||||
setShape(newShape);
|
// the shape didn't actually change, so we clear the DIRTY_SHAPE flag
|
||||||
|
flags &= ~Simulation::DIRTY_SHAPE;
|
||||||
|
// and clear the reference we just created
|
||||||
|
getShapeManager()->releaseShape(_shape);
|
||||||
|
} else {
|
||||||
|
_body->setCollisionShape(const_cast<btCollisionShape*>(newShape));
|
||||||
|
setShape(newShape);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags & EASY_DIRTY_PHYSICS_FLAGS) {
|
if (flags & EASY_DIRTY_PHYSICS_FLAGS) {
|
||||||
|
|
|
@ -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 (body->isStaticObject() && _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