b2ContactManager.Collide() // This is the top level collision call for the time step. Here
// all the narrow phase collision is processed for the world
// contact list.
if overlap is deemed to persist by the broadphase, then b2Contact.Update is called. --> Evaluate(&m_manifold, xfA, xfB); and warm starting type stuff is carried out here.
if a new AABB overlaps is identified, b2ContactManager.AddPair is called, which in turn after a various checking
// Call the factory.
b2Contact* c = b2Contact::Create(fixtureA, indexA, fixtureB, indexB, m_allocator);
if (c == nullptr)
{
return;
}
b2Contact is a class that calls the collision detection method relevant to the particular pair of fixtures. For polygon vs polygon,
b2PolygonContact::Create
which eventually calls
void b2PolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB)
{
b2CollidePolygons( manifold, (b2PolygonShape*)m_fixtureA->GetShape(), xfA (b2PolygonShape*)m_fixtureB->GetShape(), xfB);
}