How can I solve this SAT direct corner intersection edge case?

Posted by ssb on Game Development See other posts from Game Development or by ssb
Published on 2012-11-18T03:00:52Z Indexed on 2012/11/18 11:28 UTC
Read the original article Hit count: 234

Filed under:
|
|

I have a working SAT implementation, but I am running into a problem where direct collisions at a corner do not work for tiled surfaces. That is, it clips on the surface when going in a certain direction because it gets hung up on one of the tiles, and so, for example, if I walk across a floor while holding both down and left, the player will stop when meeting the next shape because the player will be colliding with the right side rather than with the top of the floor tile.

This illustration shows what I mean:

SAT errors

The top block will translate right first and then up.

I have checked here and here which are helpful, but this does not address what I should do in a situation where I don't have a tile-based world. My usage of the term "tile" before isn't really accurate since what I'm doing here is manually placing square obstacles next to each other, not assigning them spots on a grid.

What can I do to fix this?

© Game Development or respective owner

Related posts about XNA

Related posts about c#