I've always wondered how collision detection like this was achieved, and I've always wondered what the response would be. Do they perform line-line intersection tests for each line making up the two polygons? If it'd make the question any more specific, how does Box2D handle this?
1 Answer
2D collisions with non-rectangular shapes are often detected using the Separating Axis Theorem (tutorial here). Look it up, there are a lot of good articles on the subject.
Box2D uses it as part of the solution for their collision system, for a more in-depth view read their manual.