Fix issue in ContactManifoldSet.cpp

This commit is contained in:
Daniel Chappuis 2017-08-31 22:42:19 +02:00
parent e725af80b6
commit a655ffb462

View File

@ -60,6 +60,8 @@ void ContactManifoldSet::addContactManifold(const ContactManifoldInfo* contactMa
} }
else { else {
bool addNewManifold = true;
// If there are too much contact manifolds in the set // If there are too much contact manifolds in the set
if (mNbManifolds >= mNbMaxManifolds) { if (mNbManifolds >= mNbMaxManifolds) {
@ -72,15 +74,21 @@ void ContactManifoldSet::addContactManifold(const ContactManifoldInfo* contactMa
// Remove the manifold // Remove the manifold
removeManifold(minDepthManifold); removeManifold(minDepthManifold);
}
else {
// The manifold we do not want to get is the new one. Therefore, we do not add it to the set
addNewManifold = false;
}
}
// If we need to add the new contact manifold
if (addNewManifold) {
// Create a new contact manifold // Create a new contact manifold
createManifold(contactManifoldInfo); createManifold(contactManifoldInfo);
} }
} }
// Create a new contact manifold
createManifold(contactManifoldInfo);
}
} }
// Update a previous similar manifold with a new one // Update a previous similar manifold with a new one