// Adds the point with the size to get another point public Point3i add(Point3i pt) { return new Point3i((int)width+pt.x, (int)height+pt.y, (int)depth+pt.z); }
// Gets the maximum value of the point public static Point3i max(Point3i value, Point3i max) { // Variables Point3i temp= value; if(value.x> max.x) temp.x= max.x; if(value.y> max.y) temp.y= max.y; if(value.z> max.y) temp.z= max.z; return temp; }
// Gets the minimum value of the point public static Point3i min(Point3i value, Point3i min) { // Variables Point3i temp= value; if(value.x< min.x) temp.x= min.x; if(value.y< min.y) temp.y= min.y; if(value.z< min.z) temp.z= min.z; return temp; }
// Clamps the point to the given min and max bounds public static Point3i clamp(Point3i value, Point3i min, Point3i max) { // Variables Point3i temp= value; if(value.x< min.x) temp.x= min.x; else if(value.x> max.x) temp.x= max.x; if(value.y< min.y) temp.y= min.y; else if(value.y> max.y) temp.y= max.y; if(value.z< min.z) temp.z= min.z; else if(value.z> max.z) temp.z= max.z; return temp; }
// Gets the most minimum point of the two given points public static Point3i getMostMin(Point3i val1, Point3i val2) { // Variables Point3i pt= Point3i.ORIGIN; if(val1.x< val2.x) pt.x= val1.x; else pt.x= val2.x; if(val1.y< val2.y) pt.y= val1.y; else pt.y= val2.y; if(val1.z< val2.z) pt.z= val1.z; else pt.z= val2.z; return pt; }
// Finds if the given 3d point is inside the volume public abstract bool contains(ref Point3i pt);
// Subtracts the two points to get a vector pointing in between both public Vector3 subtract(Point3i pt) { return new Vector3((float)(x-pt.x), (float)(y-pt.y), 0f-(float)pt.z); }
// Gets the midpoint of the two points public Point3f getMidpoint(Point3i pt) { return new Point3f((x+(float)pt.x)/2f, (y+(float)pt.y)/2f, (z+(float)pt.z)/2f); }
// Subtracts the two points to get a vector pointing in between both public Vector3 subtract(Point3i pt) { return new Vector3(x-(float)pt.x, y-(float)pt.y, z-(float)pt.z); }
// Finds if the two points are equal public bool equals(Point3i pt) { return (x== pt.x && y== pt.y && z== pt.z); }
// Finds if the two points are equal public bool equals(Point3i pt) { return ((int)x== pt.x && (int)y== pt.y && (int)z== pt.z); }
// Subtracts the point with the vector to get a new point public Point3i subtract(Point3i pt) { return new Point3i((int)x-pt.x, (int)y-pt.y, 0-pt.z); }
// Adds the point with the vector to get a new point public Point3i add(Point3i pt) { return new Point3i((int)x+pt.x, (int)y+pt.y, pt.z); }
public virtual bool contains(Point3i pt) { return contains(ref pt); }
// Subtracts the point with the size to get another point public Point3i subtract(Point3i pt) { return new Point3i((int)width-pt.x, (int)height-pt.y, (int)depth-pt.z); }
// Gets the midpoint of the two points public Point3f getMidpoint(Point3i pt) { return new Point3f((float)(x+pt.x)/2f, (float)(y+pt.y)/2f, (float)(0+pt.z)/2f); }
// Finds if the given 3d point is inside the volume public override bool contains(ref Point3i pt) { return contains((float)pt.x, (float)pt.y); }
// Multiples a 3d point to affect it public Point3i multiply(Point3i pt) { return new Point3i ( (int)(xx*pt.x+yx*pt.y+zx*pt.z+ox), (int)(xy*pt.x+yy*pt.y+zy*pt.z+oy), (int)(xz*pt.x+yz*pt.y+zz*pt.z+oz) ); }