public int compare(Node o1, Node o2) {
Point3 p1 = o1.bound.center();
Point3 p2 = o2.bound.center();
switch (this.axis) {
case X_AXIS: return Double.compare(p1.x(), p2.x());
case Y_AXIS: return Double.compare(p1.y(), p2.y());
case Z_AXIS: return Double.compare(p1.z(), p2.z());
}
throw new UnsupportedOperationException("invalid axis");