   Swept Circle vs Circular Arc
  hi,I'm trying to figure out how to calculate the time of intersection between a circle moving along a vector and a static arc. This problem can be transformed by shrinking the circle to a point, and "inflating" the arc -- then we just need to raycast vs the inflated arc. However, the problem is: which way should the arc be inflated? i.e do we increase or decrease the radius of the circle containing the arc?Right now I'm just doing both and using the earliest time of intersection, but this feels stupid since it's 2x as much work. I'm hoping that someone knows of a smarter way. thanks,Raigan   
  If you want to reduce the circle to a point then add its radius to the arc when doing the collisions. Two circles collide when their centers are within a distance of the sum of their radii, so the sum has to remain the same even though it doesn't matter which circle has what.   ;  Thanks; unfortunately that doesn't work!For example: imagine an arc shaped like a 'C' and a horizontally moving circle. If the circle is moving from left to right, then adding the circle's radius will give you the correct time of intersection: the ray will intersect with the "outside face" of the arc.But, if the circle is moving from right to left, adding the circle's radius will result in the reported time of intersection being incorrect (too large/late) -- in this case you need to *subtract* the radius to get the correct time of intersection, because the ray is intersecting with the "inside face" of the arc.With the circle-vs-circle case your solution works, because the ray must always hit the "outer" face of the circle; unfortunately this isn't always true for circle-vs-arc. I can't seem to find a rule which allows me to determine which case (add/subtract) I'm dealing with. Also, the usual texts (Ericson, Geometric Tools) don't have anything either.Thanks for trying though :)   ;  I think it's actually even more complicated.The swept-circle-vs-circle has already four possibilities IMHO:- two where the two circle lie beneath each other - two where one circle is within the otherThis is somewhat what you have experienced with your double calculation: In the first case you add the radii in the second you take the (absolute) difference. Two quartic equations, each of which can give up to two solutions. Then you filter out solutions where the contact point does not lie in your arc range (probably some min-max-angle definition).But I think you must also consider the endpoints of your arcs, which gives again (swept point, so ray-vs-circle) two quartic equations, thus four solutions.So this gives you up to eight solutions of which you take the first one in respect to time.You probably can optimize things with early rejection of solutions, but make sure you got all covered first. And don't get discouraged, hitting all cases in collision detection is tedious.Hope that helpsPS: Are you doing flipper-physics with this ? [smile] Just came to mind...   ;  Thanks!I'm already testing vs the endpoints, and actually everything is working great, I just figured that there might be a better/smarter way to test vs the arc than to calculate the TOI for both the sum and difference of the radii.. I guess not :(This is for a general collision detection system, nothing specific -- but definitely pinball is one useful application :)