How to check if there was a collision between two rotated rectangles

Recently I had the need to determine whether or not two rotated rectangles were colliding. These rectangles were rotated around their centers and were of the form x, y, w, h, a, where a is the rotation angle in radians. I searched online for a bit and found out that one way is to convert the rectangles into a series of line segments and then use the Separating Axis Theorem to determine if there was an intersection....

September 12, 2021 · 8 min · Phretaddin