// Subtracts the two sizes together public Size3f subtract(Size3f size) { return new Size3f(width-size.width, height-size.height, depth-size.depth); }
// Adds the two sizes together public Size3f add(Size3f size) { return new Size3f(width+size.width, height+size.height, depth+size.depth); }
// Finds if the two sizes are equal to each other public bool equals(Size3f size) { return (width== size.width && height== size.height && depth== size.depth); }
// Gets the maximum value of the size public static Size3f max(Size3f value, Size3f max) { // Variables Size3f temp= value; if(value.width> max.width) temp.width= max.width; if(value.height> max.height) temp.height= max.height; if(value.depth> max.depth) temp.depth= max.depth; return temp; }
// Gets the minimum value of the size public static Size3f min(Size3f value, Size3f min) { // Variables Size3f temp= value; if(value.width< min.width) temp.width= min.width; if(value.height< min.height) temp.height= min.height; if(value.depth< min.depth) temp.depth= min.depth; return temp; }
// Clamps the size to the given min and max bounds public static Size3f clamp(Size3f value, Size3f min, Size3f max) { // Variables Size3f temp= value; if(value.width< min.width) temp.width= min.width; else if(value.width> max.width) temp.width= max.width; if(value.height< min.height) temp.height= min.height; else if(value.height> max.height) temp.height= max.height; if(value.depth< min.depth) temp.depth= min.depth; else if(value.depth> max.depth) temp.depth= max.depth; return temp; }
// Gets the most minimum size of the two given sizes public static Size3f getMostMin(Size3f val1, Size3f val2) { // Variables Size3f size= Size3f.NO_SIZE; if(val1.width< val2.width) size.width= val1.width; else size.width= val2.width; if(val1.height< val2.height) size.height= val1.height; else size.height= val2.height; if(val1.depth< val2.depth) size.depth= val1.depth; else size.depth= val2.depth; return size; }
// Subtracts the point with a size to get another point public Point2i subtract(Size3f size) { return new Point2i(x-(int)size.width, y-(int)size.height); }
public BVBox(Point3f pmMin, Size3f size) : this(pmMin, pmMin+size) { }
// Subtracts the point with a size to get another point public Point3f subtract(Size3f size) { return new Point3f(x-size.width, y-size.height, z-size.depth); }
// Adds the point with a size to get another point public Point2i add(Size3f size) { return new Point2i(x+(int)size.width, y+(int)size.height); }
// Adds the point with a size to get another point public Point3f add(Size3f size) { return new Point3f(x+size.width, y+size.height, z+size.depth); }
// Subtracts the point with a size to get another point public Point2f subtract(Size3f size) { return new Point2f(x-size.width, y-size.height); }
// Adds the point with a size to get another point public Point2f add(Size3f size) { return new Point2f(x+size.width, y+size.height); }
// Subtracts the point with a size to get another point public Point3i subtract(Size3f size) { return new Point3i(x-(int)size.width, y-(int)size.height, z-(int)size.depth); }
// Adds the point with a size to get another point public Point3i add(Size3f size) { return new Point3i(x+(int)size.width, y+(int)size.height, z+(int)size.depth); }