示例#1
0
 // Subtracts the two sizes together
 public Size3f subtract(Size3f size)
 {
     return new Size3f(width-size.width, height-size.height, depth-size.depth);
 }
示例#2
0
 // Adds the two sizes together
 public Size3f add(Size3f size)
 {
     return new Size3f(width+size.width, height+size.height, depth+size.depth);
 }
示例#3
0
 // 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);
 }
示例#4
0
        // 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;
        }
示例#5
0
        // 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;
        }
示例#6
0
        // 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;
        }
示例#7
0
        // 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;
        }
示例#8
0
 // 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);
 }
示例#9
0
 public BVBox(Point3f pmMin, Size3f size)
     : this(pmMin, pmMin+size)
 {
 }
示例#10
0
 // 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);
 }
示例#11
0
 // 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);
 }
示例#12
0
 // 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);
 }
示例#13
0
 // Subtracts the point with a size to get another point
 public Point2f subtract(Size3f size)
 {
     return new Point2f(x-size.width, y-size.height);
 }
示例#14
0
 // Adds the point with a size to get another point
 public Point2f add(Size3f size)
 {
     return new Point2f(x+size.width, y+size.height);
 }
示例#15
0
 // 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);
 }
示例#16
0
 // 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);
 }