Slidey 2D box collisions?

BlitzMax Forums/BlitzMax Programming/Slidey 2D box collisions?

coffeedotbean(Posted 2015) [#1]
So I've been bouncing ideas around on how to easily achieve (box <> box) collisions with slidey reactions. Think 2D RTS units on a map swarming together, thought its not for an RTS.

I used an AABB method to detect an overlap between boxes and go a little further to detected which sides are overlapping and the direction to travel so only leading sides are checked - putting all that together results in;



Not perfect, as you can see chain reactions happen that push boxes away.

I am starting to think I need a different method to achieve this, some googling have turned up a few ideas though they all seem overly complicated.

Any one point me a good direction?


markcw(Posted 2015) [#2]
Probably bad question, but how does box2d manage this?


coffeedotbean(Posted 2015) [#3]
@Munch I looked at bruceys box2d, but its a little overkill for what I want to achieve.

But turns out a good nights sleep works wonders and I solved my issue still using AABB methods.




Kryzon(Posted 2015) [#4]
I think bounding circles and a simple penetration correction that is distributed between the two colliding entities could do what you what.