How is the Persistent Manifold Area computed in Bullet ?
Posted: Fri Nov 30, 2012 12:46 pm
Hello,
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 :
According to me, we can use the cross product magnitude to compute the area of a triangle ABC using the cross product AB^AC. However, in the above code, we have four different points ABCD and we compute the cross product AB^CD. What kind of area this gives us ?
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();
}