0
\$\begingroup\$

Two intersecting polygons.

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?

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

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.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .