Jump to content
  • Advertisement
Sign in to follow this  
tensh

Finding circle intersections as group

This topic is 2966 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

Hi,

I have a set of circles stored in a quadtree and I want to find and store all intersections that occur.

I currently do a simple cull against the quadtree for each circle, but I'm thinking there might be a faster way to this since I want to do it for all circles (some kind of group calculation I guess). The method is called quite often so it's important that it runs fast.

I've looked around for a suitable algorithm without success, so I figured I'd see if anyone here has any ideas on how to improve the runtime.

Share this post


Link to post
Share on other sites
Advertisement
Use a sort-and-sweep algorithm on the axis-aligned bounding boxes of the circles. You say this is "called quite often". If you mean the circles are moving each frame and you need to know intersections after the motion, then the sort-and-sweep algorithm is effectively constant time per frame (relies on space and time coherency). I have a sample application for the AABB sort-and-sweep.

Share this post


Link to post
Share on other sites
Thanks for the reply. I've been busy with a few other things, but I'll take a look at it shortly and come back with feedback when I've tried it out!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!