I\'m trying to find the most efficient way to check if 2 arbitrarily sized cubes collide with each other. The sides of the cubes are not necessarily all equal in length (a b
Since both boxes are axis-aligned you can just compare their extents:
return (a.max_x() >= b.min_x() and a.min_x() <= b.max_x())
and (a.max_y() >= b.min_y() and a.min_y() <= b.max_y())
and (a.max_z() >= b.min_z() and a.min_z() <= b.max_z())