For each axis, compute whether the intervals spanned by the two boxes are...
0 -1: separatedoverlapped (minA >< maxB or minB >& maxA > minB)
1 0: adjacent (minA == maxB or minB == maxA)
2+1: overlappedseparated (minA < maxB & maxA > minBmaxB or minB < maxA & maxB > minBmaxA)
Return the leastgreatest result you found on any axis.
(ie. The boxes are "overlapping" only if theytheir intervals overlap on all axesevery axis. Being "adjacent" on any axis trumps overlapped, and "separated" trumps all)
The numbers I used to label the cases are arbitrary - I picked -1,0,1 to represent the sign of the distance between the boxes: positive if separated, negative if overlapped, and exactly zero if just in contact.