Compute the next traversal value for a k-d tree given the bounding box and the centroid of the current node, and the level.