A while ago I was considering my possibilities for implementing collisions between 2D shapes, and after much googling (which mostly turned up SAT), I came up with this:
let A, B = two shapes
let V = Speed of A relative to B
for a:point in vertices of A
for b:segment in segments of B
if segment(a, a+V) intersects b
return intersection point
return false
Now, I'm far from the smartest person out there, so I am 99.8% sure someone must have come up with that before me and, what's more important, since I didn't find anything describing this method, I assume it's a bad one.
Can anybody identify this algorithm and/or point me towards any literature on it explaining if, when and why it should be used?
I've failed to see any significant problems at first sight; all the complex calculations can be hoisted outside of the loops and then it's just matrix multiplications within both loops, and I couldn't find any algorithm that makes do without any nested loops over two sets of elements (be they vertices, segments or normals)
Feel free to trash-talk my algo all you like, I never expected it to be the second greatest discovery right after general relativity or anything ;)
PS: Sorry for the poor title, but I can hardly explain the entire algo in one line :)