# How do 2D physics engines solve the problem of resolving collisions along tiled walls/floors in non-grid-based worlds?

I've been working on implementing my SAT algorithm which has been coming along well, but I've found that I'm at a wall when it comes to its actual use. There are plenty of questions regarding this issue on this site, but most of them either have no clear, good answer or have a solution based on checking grid positions.

To restate the problem that I and many others are having, if you have a tiled surface, like a wall or a floor, consisting of several smaller component rectangles, and you traverse along them with another rectangle with force being applied into that structure, there are cases where the object gets caught on a false collision on an edge that faces the inside of the shape.

I have spent a lot of time thinking about how I could possibly solve this without having to resort to a grid-based system, and I realized that physics engines do this properly. What I want to know is how they do this. What do physics engines do beyond basic SAT that allows this kind of proper collision resolution in complex environments? I've been looking through the source code to Box2D trying to find out how they do it but it's not quite as easy as looking at a Collision() method. I think I'm not good enough at physics to know what they're doing mathematically and not good enough at programming to know what they're doing programmatically. This is what I aim to fix.

• I'm not sure what your question is. SAT is pretty robust for any kind of collision detection. There are other algorithms but, for most purposes, it is not needed. If there is a error in your collision detection, it's most likely because you didn't implement SAT properly, or working with polytopes that are non-convex. Nov 20, 2012 at 10:14
• The issue I'm having is covered here and here and, to some extent, here. As far as I can tell this IS a problem that will happen with SAT and needs to be solved. If I'm wrong, then please save me a lot of anguish and tell me how
– ssb
Nov 20, 2012 at 10:23
• Also somewhat covered here
– ssb
Nov 20, 2012 at 10:25
• Oh, I think I get it. The problem you are having isn't really an issue with SAT, it's collision resolution that you need. To have decent collision resolution is not always easy. I recommend this book: books.google.be/books/about/… Nov 20, 2012 at 10:26
• Thanks for clarifying that, I edited my post to change the language a bit.
– ssb
Nov 20, 2012 at 10:35