I'm working on a 2d physics simulation. It's a continuous time simulation, that is, it uses swept shapes over the time-frame and geometrical/vector 'analysis' to determine most immediate time of contact. The world is then stepped forward to that point and collisions are resolved before proceeding to step the world forward to the next time of collision.
I do not use relaxation techniques or any kind of intersection resolution. The objects are moved to contact states and contact events are resolved as collisions.
I have tried a CONTACT_RANGE of 0.001f down to 0.00001f. This value determines whether objects are in contact. Lowering this value leads to less overlap states, but presumably at some point, lowering the value further will lead to the simulation missing contact events because inaccuracies will lead to the systems of bodies being stepped into the discrete or overlap state.
Now, to the problem, the simulation seems to compute the outcome of collisions between 2 bodies (circles in the case I'm looking at), correctly. But I have not correctly dealt with 3 or more bodies being in contact.
In the past, I did not deal with momentum / KE correctly, but I did constrain velocities such that multi-body systems would not intersect in the next sub-frame. But now that I have a correct solution to 2 body collision, I want to do it properly for more bodies.
I'm not sure how to proceed. I have read an interesting suggestion, that in reality, no collisions are simultaneous, and they can be dealt with one after the other. Is this true ?
Could I simply compute the resultant velocity of a body from one contact, then do the same with the next contact etc?
And would that lead to the same solution as though I computed velocity in one step, from all contacts simultaneously?
Or do I need a single function for solving the velocity from multiple contacts?
Any guidance is appreciated.
Gavin