Jump to content
  • Advertisement

Archived

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

fupp

intersection between circle and rectangle

This topic is 6341 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
Advertisement
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

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!