|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.math.Rect
public final class Rect
An axis-aligned rectangle.
| Field Summary | |
|---|---|
static Rect |
EMPTY
The empty rect. |
static Rect |
MAX_VALUE
A rect that's as large as rects can get. |
static Rect |
ZERO
The zero rect. |
| Constructor Summary | |
|---|---|
Rect()
Creates an empty rectangle. |
|
Rect(Rect other)
Copy constructor. |
|
Rect(Vector2f minExtent,
Vector2f maxExtent)
Creates a rectangle with the values contained in the supplied minimum and maximum extents. |
|
| Method Summary | |
|---|---|
Rect |
add(Rect other)
Expands this rectangle to include the bounds of another rectangle. |
Rect |
add(Rect other,
Rect result)
Expands this rectangle to include the bounds of another rectangle, placing the result in the object provided. |
Rect |
add(Vector2f point)
Expands this rectangle to include the specified point. |
Rect |
add(Vector2f point,
Rect result)
Expands this rectangle to include the specified point, placing the result in the object provided. |
Rect |
addLocal(Rect other)
Expands this rectangle to include the bounds of another rectangle. |
Rect |
addLocal(Vector2f point)
Expands this rectangle in-place to include the specified point. |
boolean |
contains(float x,
float y)
Determines whether this rectangle contains the specified point. |
boolean |
contains(Rect other)
Determines whether this rectangle completely contains the specified rectangle. |
boolean |
contains(Vector2f point)
Determines whether this rectangle contains the specified point. |
boolean |
equals(Object other)
|
Rect |
expand(float x,
float y)
Expands the rectangle by the specified amounts. |
Rect |
expand(float x,
float y,
Rect result)
Expands the rectangle by the specified amounts, placing the result in the object provided. |
Rect |
expandLocal(float x,
float y)
Expands the rectangle in-place by the specified amounts. |
Rect |
fromPoints(Vector2f... points)
Initializes this rectangle with the extents of an array of points. |
Vector2f |
getCenter()
Returns the center of the rectangle as a new vector. |
Vector2f |
getCenter(Vector2f result)
Places the location of the center of the rectangle into the given result vector. |
float |
getHeight()
Returns the height of the rectangle. |
boolean |
getIntersection(Ray2D ray,
Vector2f result)
Finds the location of the (first) intersection between the specified ray and this rectangle. |
float |
getLongestEdge()
Returns the length of the rectangle's longest edge. |
Vector2f |
getMaximumExtent()
Returns a reference to the rectangle's maximum extent. |
Vector2f |
getMinimumExtent()
Returns a reference to the rectangle's minimum extent. |
Vector2f[] |
getPerimeterPath()
Returns a path that goes counter-clockwise around the rectangle, starting and ending at the minimum extent. |
float |
getShortestEdge()
Returns the length of the rectangle's shortest edge. |
Vector2f |
getVertex(int code)
Retrieves one of the four vertices of the rectangle. |
Vector2f |
getVertex(int code,
Vector2f result)
Retrieves one of the four vertices of the rectangle. |
float |
getWidth()
Returns the width of the rectangle. |
int |
hashCode()
|
Rect |
intersect(Rect other)
Finds the intersection between this rectangle and another rectangle. |
Rect |
intersect(Rect other,
Rect result)
Finds the intersection between this rectangle and another rectangle and places the result in the provided object. |
Rect |
intersectLocal(Rect other)
Finds the intersection between this rectangle and another rectangle and places the result in this rectangle. |
boolean |
intersects(Ray2D ray)
Determines whether the specified ray intersects this rectangle. |
boolean |
intersects(Rect other)
Determines whether this rectangle intersects the specified other rectangle. |
boolean |
isEmpty()
Determines whether the rect is empty (whether any of its minima are greater than their corresponding maxima). |
Rect |
set(Rect other)
Copies the parameters of another rectangle. |
Rect |
set(Vector2f minExtent,
Vector2f maxExtent)
Sets the rectangle parameters to the values contained in the supplied vectors. |
Rect |
setToEmpty()
Sets the parameters of the rectangle to the empty values ( Vector2f.MAX_VALUE and
Vector2f.MIN_VALUE for the minimum and maximum, respectively). |
String |
toString()
|
Rect |
transform(Transform2D transform)
Transforms this rectangle. |
Rect |
transform(Transform2D transform,
Rect result)
Transforms this rectangle, placing the result in the provided object. |
Rect |
transformLocal(Transform2D transform)
Transforms this rectangle in-place. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Rect ZERO
public static final Rect EMPTY
public static final Rect MAX_VALUE
| Constructor Detail |
|---|
public Rect(Vector2f minExtent,
Vector2f maxExtent)
public Rect(Rect other)
public Rect()
| Method Detail |
|---|
public Vector2f getMinimumExtent()
public Vector2f getMaximumExtent()
public Vector2f getCenter()
public Vector2f getCenter(Vector2f result)
public float getLongestEdge()
public float getShortestEdge()
public float getWidth()
public float getHeight()
public boolean isEmpty()
public Rect fromPoints(Vector2f... points)
public Rect addLocal(Vector2f point)
public Rect add(Vector2f point)
public Rect add(Vector2f point,
Rect result)
public Rect addLocal(Rect other)
public Rect add(Rect other)
public Rect add(Rect other,
Rect result)
public Rect intersectLocal(Rect other)
public Rect intersect(Rect other)
public Rect intersect(Rect other,
Rect result)
public Rect transformLocal(Transform2D transform)
public Rect transform(Transform2D transform)
public Rect transform(Transform2D transform,
Rect result)
public Rect expandLocal(float x,
float y)
public Rect expand(float x,
float y)
public Rect expand(float x,
float y,
Rect result)
public Rect setToEmpty()
Vector2f.MAX_VALUE and
Vector2f.MIN_VALUE for the minimum and maximum, respectively).
public Rect set(Rect other)
public Rect set(Vector2f minExtent,
Vector2f maxExtent)
public Vector2f[] getPerimeterPath()
public Vector2f getVertex(int code)
public Vector2f getVertex(int code,
Vector2f result)
public boolean contains(Vector2f point)
public boolean contains(float x,
float y)
public boolean contains(Rect other)
public boolean intersects(Rect other)
public boolean intersects(Ray2D ray)
public boolean getIntersection(Ray2D ray,
Vector2f result)
result - a vector to hold the location of the intersection.
public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||