I'm writing a small software where I have to collide shapes (2D) against other shapes. With collide I mean move (to specified direction) until collision occurs.
I'm have been trying to find algorithm to do that. I found a physics engine, which did it, but not the way I would have liked to. In my problem, shape has to stop just before collision.
I have a small picture of my problem:

I hope you could help me with this problem
