Skip to main content
gamedev.net
🔒 Locked

intersection between circle and rectangle

Started by fupp Jan 13, 2001 at 1:34 PM 0 replies 350+ views
Original Post
fupp
fupp
Hello everyone, Given a circle of radius r and a quad (x0,y0) ( x1,y1) (x2, y2) (x3, y3) what would be the fastest way of determining if they intersect? I have figured out a way using the distance from a line example in the comp.graphics.algorithms faq but it seems rather convoluted. This is basically to provide collision detection in a 2D enviroment for a ball hitting a quad which can be rotated through any angle. Any help would be appreciated. Thankyou for your time.
Fahad
Fahad
Briefly.
do a point in rectangle test. but rather than checking if the center of the circle is exactly in the reactangle, check if it is radius away from it.

Fahad

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.