Check that proxy-shape is part of broad-phase before updating it in RigidBody

This commit is contained in:
Daniel Chappuis 2019-03-11 11:12:42 +01:00
parent 0e563f0283
commit 061469a539

View File

@ -552,6 +552,9 @@ void RigidBody::updateBroadPhaseState() const {
// For all the proxy collision shapes of the body
for (ProxyShape* shape = mProxyCollisionShapes; shape != nullptr; shape = shape->mNext) {
// If the proxy-shape shape is still part of the broad-phase
if (shape->getBroadPhaseId() != -1) {
// Recompute the world-space AABB of the collision shape
AABB aabb;
shape->getCollisionShape()->computeAABB(aabb, mTransform * shape->getLocalToBodyTransform());
@ -560,6 +563,7 @@ void RigidBody::updateBroadPhaseState() const {
mWorld.mCollisionDetection.updateProxyCollisionShape(shape, aabb, displacement);
}
}
}
#ifdef IS_PROFILING_ACTIVE