ABSTRACT

This chapter provides some of the Box2D Collision Module code that readers probably don’t need to mess with in the normal course of making a game with Box2D. It focuses on into contacts and contact manifolds more carefully. A contact feature is a very small structure that indicates which features, either vertices or edges, on the colliding bodies are actually doing the colliding. A manifold point structure b2ManifoldPoint stores the information associated with a contact point inside a contact manifold. The contact manifold and the world manifold are both needed in MyStarMarker. BeginContact gets called from within a physics time step when a contact begins. EndContact gets called from within a physics time step when a contact ends. The aim of broad-phase collision detection is to construct a list of object pairs that may collide with a small number of false positives and no false negatives.