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\$
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\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.