title: How to handle multiple simultaneous elastic collisions?
body: <p>I'm computing the result by colliding pairs of 2D convex objects (without rotation), using <a href="http://en.wikipedia.org/wiki/Elastic_collision" rel="nofollow noreferrer">the basic equations on wikipedia</a>.  However, when there are dependencies, like two objects hitting another object at the same time:</p>
  
  <p><img src="https://i.stack.imgur.com/OvbxW.png" alt="enter image description here"></p>
  
  <p>Such as here, with objects 1 and 2 hitting 3 at the exact same time, the pair-wise approach fails.  Depending on the order I compute the collisions (1-3 first or 2-3 first), I will get different results.  Repeated iteration through the collisions will still give order dependent results.</p>
  
  <p>I already have it setup so I can figure out what objects are in contact with each other, so my code will know when computing one of these pairs that object 3 is colliding with another object at that moment (so the 1-3 collision will know about the 2-3 collision, and vice versa).  I'll know what edges/corners are in contact with what, as well.</p>
  
  <p>Whatever solution needs to be robust... For instance, if the setup is made more complicated like these 2 examples:</p>
  
  <p><img src="https://i.stack.imgur.com/0BzIp.png" alt="enter image description here"></p>
  
  <p>The process needs to be able to handle that and worse.  Any possible chain of simultaneous contacts/collisions.  I'll have all the data on hand describing them, so I "only" need to know how to resolve the general case of these systems.  I'm not doing anything with rotation currently, which simplifies things.</p>
  
  <p>It seems like it would involve grouping objects together, but the interference caused by edges that aren't orthogonal (see that last example with a hexagon) would seem to make that approach fail.</p>
  
  <p>I saw <a href="https://stackoverflow.com/questions/12575963/how-to-handle-simultaneous-collision-so-that-order-of-processing-does-not-matter">a similar question</a> that was asked before, but the answer given was never checked (dead end?).  I'm not sure how shock propagation would resolve my first example, either, as C is moving away after the first collision... so what shock is there to propagate? edit: Ok, I see now that simultaneous collisions and shock propagation are two different ideas, that's why it didn't seem useful.</p>