I'm slowly working my way through building a 2D physics simulator, using Box2D heavily for reference. I started with the integrator by having objects floating in space and allowing the user to apply forces at points. Next I implemented the broadphase collision detection algorithm to quickly detect AABB overlaps using spatial hashing. Now I am at the point where I have potential overlaps and I must determine the specific details of how the objects are overlapping.
From everything I've read, this information is returned in the form of a "contact manifold". This seems like the first tricky problem that I must solve. From what I understand, the contact manifold represents the region of contact if the two objects were just touching rather than overlapping. Is this the correct explanation of it, and if not, can somebody provide a clear explanation of what exactly the contact manifold represents? It appears that the "clipping method" is used to calculate this region, as in this tutorial: http://www.codezealot.org/archives/394. However, what about the case of curved surfaces? The tutorial mentions them at the end, but doesn't provide much information. My simulation supports circles, ellipses, and capsule shapes as well as convex polygons and line segments, which is a lot of potential combinations, many of which don't appear in engines like Box2D, so it would be good if I understand the goal of generating contact manifolds in general rather than just algorithms for specific shape combinations. For example, I haven't found code for capsule-polygon contact manifolds, but if I understood what the general goal I could try to derive it myself.
Anyway, in summary:
1) What exactly does a contact manifold represent? (Including: what do the contact points represent, when is there 1 and when is there 2, etc.)
2) What is the general (not too detailed) algorithm for finding a contact manifold between two convex shapes? (e.g. first use SAT to determine ____, etc.)
3) Could someone point me to some good references on this topic?
Contact manifolds (2D)
No replies to this topic