How can I check to see if only one side of a rectangle is colliding with another?
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
|
by checking 2 rectangles relative speed, you can tell which sides are colliding. for example if one is going up and the other one is going down, it's obvious that only top edge of the first rectangle can collide with the second rectangle. after that check it's a normal AABB collision detection. you can also check for edges going to collide by checking rectangle position. consider two rectangles, the first one can only collide with top edge of second one only if it's y position is height than others. |
|||||||||
|
