AABB algorithm to compute the minimum bounding rectangles of different shapes usefull for pretesting collisions