# Swept Bounding Circles - first collision

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

## Recommended Posts

Hi, I finished a sweep and prune function for my collision code, but I'm stuck at one point. My code returns a list of all the overlapping bounding circles -eg. 1-3, 2-1, 3-4, 2-4 But these are using swept circles and each circle can only hit one other circle. -eg. if 1-3, and 1-4, overlap, I must find whether 1 hits 3 first or whether 1 hits 4 first. Does anyone have a link to some article that discusses this point? When I get lots of objects moving, the interdependencies get really confusing. Thanks a lot -Cuppo

##### Share on other sites
This thread contains a somewhat documented algorithm for finding the time of first collision between two spheres. It assumes linear movement between the start position and the end position.

##### Share on other sites
Oops, forgot to mention what I actually had trouble on.

Thanks for the code ToohrVyk, I'll take some time to crawl through that. (Objective Caml !!??)

My real problem though, is in the broad-phase detection.

such as:

If the bounding boxes of :
1 overlaps 2 and
1 overlaps 3

say 1 hits 2 before 1 hits 3. You may think aha, therefore 1 collides with 2 and not with 3.

However: what if something else (say 4) hits 2 before 1 hits 2? Then the actual collisions are:
4 hits 2,
and 1 hits 3

I'm looking for a fast way to prune all these checks.

Has anyone ever read the "Kinetic Sweep and Prune" paper? Does it talk about what I'm looking for? I can't understand it right now, but if it does, I'll try and read it again.

Thanks
-Cuppo

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 10
• 9
• 9
• 11
• 11
• ### Forum Statistics

• Total Topics
633687
• Total Posts
3013327
×