I've implemented a simple disk-line segment collision detection and response algorithm. It's not swept, so if going fast enough it can clip, and fact that the collision detection occurs "after" the instant the disk hits the line (usually it'll've penetrated a tiny tiny amount in, because of how the physics works) can cause energy to leave the system, but the timestep is small enough and the colliders slow enough that it won't be a problem-- it's something I can do later.
It works perfectly with one segment. But with multiple it shows some pretty bad issues. It can escape a narrowing pair of lines like:
I heard I could try to only respond to the collision that the disk has done "first"-- the one with the least depth (in the image that's the lower line, I guess). But that did not fix the problem.
What about adding together all the collision normals and normalising it to get a new virtual surface to bounce off? A horizontal one. But then how would I handle things like mass and restitution? Would I just "average" them out and perform one collision? Would that still be physically correct? What do I do? Some advice about it would be helpful.
Where should I draw lines of abstraction in the whole process? What in the process should be generic, and what can I bring out of my code into other functions to return values to simplify it?