Code a function to tese if 2 rotated rectangles are colliding.
Function CheckRotatedBoxes(ByVal x1 As Single, ByVal y1 As Single, ByVal x1width As Single, ByVal y1height As Single, ByVal rot1 As Single, ByVal x2 As Single, ByVal y2 As Single, ByVal x2width As Single, ByVal y2height As Single, ByVal rot2 As Single) as Boolean
x1 - left position of box 1
y1 - top position of box 1
x1width - width of box 1
y1height - height of box 1
rot1 - Rotation in degrees (0-359) of box 1
x2 - left position of box 2
y2 - top position of box 2
x2width - width of box 2
y2height - height of box 2
rot2 - Rotation in degrees (0-359) of box 2
Routine returns True or False if colliding.
Here's the problem. This is going to be used in a game so it has to be fast enough. If possible I would like to see a demo working before selecting you.
Since I can't pay for code that is too slow, I am willing to release half the funds when the source is delivered, I will test the code and if it is acceptable I will release the other half. If it is not, you will be asked to optimize the code further.
0 · ·