title: Sliding AABB collision - getting stuck on edges
body: <p>I'm working on a 3D tile based game and I'm using AABB collision detection. For every cube that the player is intersecting, I find the axis along which the player is intersecting the cube the least, and push the player out of the cube along that axis.</p>
  
  <p>Depending on the order that the cubes are checked in, this can cause problems when sliding along the edge of multiple cubes. I have created a diagram that should explain the problem:</p>
  
  <p><a href="https://imgur.com/mmK0W.png" rel="noreferrer">http://imgur.com/mmK0W.png</a></p>
  
  <ul>
  <li>Arrow #1 is the attempted movement of the player. The other arrows are the collision response.</li>
  <li>In the left diagram, collision is tested against the right cube first, causing the player to be pushed to the left, and then upwards. (<strong>bad</strong>)</li>
  <li>In the right diagram, collision is tested against the left cube first, causing the player to be pushed upwards, at which point the player is no longer intersecting the other cube. (<strong>good</strong>)</li>
  </ul>
  
  <p>Any ideas on what the most efficient way to solve this might be? Or any better ways to handle the collision response?</p>
  
  <p>Thank you.</p>