/** * Returns a new infinite bounding box. * @return a new infinite bounding box. */ public static BoundingBox infinite() { BoundingBox bb = new BoundingBox(); bb.setInfinite(); return bb; }
/** * Expands this box to include the specified bounding sphere. * @param bs the bounding sphere. */ public void expandBy(BoundingSphere bs) { if (!bs.isInfinite()) { if (!bs.isEmpty()) { double r = bs.getRadius(); Point3 c = bs.getCenter(); double x = c.x; double y = c.y; double z = c.z; if (_xmin>x-r) _xmin = x-r; if (_ymin>y-r) _ymin = y-r; if (_zmin>z-r) _zmin = z-r; if (_xmax<x+r) _xmax = x+r; if (_ymax<y+r) _ymax = y+r; if (_zmax<z+r) _zmax = z+r; } } else { setInfinite(); } }