PDA

View Full Version : 2D rectangle circle collision


arctwelve
09-05-2005, 05:41 PM
How can I test if a circle and a rectangle have collided? I need the penetration depth to move out of collision.

TIA

Dia Kharrat
09-05-2005, 05:51 PM
Dave Eberly's site has great info about testing and calculating intersections:

http://www.geometrictools.com/Intersection.html

There's some code for "Intersection of rectangles and circles" on that page.