I have a bounding box on my character, its position in the previous frame an the current frame. The bounding box is axis aligned.
My character is running around inside a cave, I have a list of points (lines) that represents the wall of the cave (not axis aligned)
I've got a coarse grained algorithm that tells me when some part of my character is likely to have collided with some part of the cave wall.
I do not have a fine grained algorithm to tell me specifically which line of the wall was collided with and at which point.
My current thought was that I could just create a line for each corner of the bounding box from its position in the previous frame, to its position in the current frame, then test each of these lines for intersections with any of the lines in the cave wall.
My google fu however hasn't shown me an easy formula for calculating intersections. Have I picked a bad way to do this, or am I just bad at search?
My game is written in scala, however I can read/translate most any c style language and many scripting languages, whatever you feel like answering in