com.triangularpixels.rebirth.geometry2d
Class IntRectangle
java.lang.Object
com.triangularpixels.rebirth.geometry2d.IntRectangle
public class IntRectangle
- extends Object
A 2d, axis-aligned rectangle with integer precision.
IntRectangle
public IntRectangle()
IntRectangle
public IntRectangle(int width,
int height)
IntRectangle
public IntRectangle(int x,
int y,
int width,
int height)
IntRectangle
public IntRectangle(IntRectangle other)
getX
public int getX()
getY
public int getY()
getWidth
public int getWidth()
getHeight
public int getHeight()
left
public int left()
right
public int right()
bottom
public int bottom()
top
public int top()
setX
public void setX(int x)
setY
public void setY(int y)
setWidth
public void setWidth(int width)
setHeight
public void setHeight(int height)
intersects
public boolean intersects(IntRectangle other)
- Test to see if two rectangles intersect.
For integer rectangles, two rectangles are counted as intersecting if they share an edge
(e.g. a rectangle from 0->10 on the x axis intersects a rectangle from 10->20)
area
public int area()
equals
public boolean equals(Object rhs)
- Overrides:
equals in class Object
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2009 TriangularPixels.com. All Rights Reserved.