I am studying the implementation of the persistent contact manifold in Bullet in the file btPersistentManifold.cpp.
At some point, if the contact cache is full, we want to keep the new contact point, the contact point with the deepest penetration depth and then, we choose the points that maximize the area of the manifold. As we can see in the btPersistentManifold::sortCachedPoints() method, the magnitude of the cross product is used to compute an area. For instance, we have the following code :
Code: Select all
if (maxPenetrationIndex != 0)
{
btVector3 a0 = pt.m_localPointA-m_pointCache[1].m_localPointA;
btVector3 b0 = m_pointCache[3].m_localPointA-m_pointCache[2].m_localPointA;
btVector3 cross = a0.cross(b0);
res0 = cross.length2();
}