Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


intersection between circle and rectangle

This topic is 6518 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post

Link to post
Share on other sites
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.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!