JugiMap Framework
|
Rectangle. More...
#include <jmCommon.h>
Public Member Functions | |
Rect () | |
Constructs an empty 'null' rectangle. More... | |
Rect (T xMin, T yMin, T xMax, T yMax) | |
Constructs a rectangle from the given minimum and maximum coordinates. More... | |
Rect (const Vec2< T > &_min, const Vec2< T > &_max) | |
Constructs a rectangle from the given minimum and maximum vectors . More... | |
bool | operator== (const Rect< T > &r) const |
Returns true if this rectangle is equal to the given rectangle r; otherwise returns false. More... | |
bool | operator!= (const Rect< T > &r) const |
Returns true if this rectangle is not equal to the given rectangle r; otherwise returns false. More... | |
bool | Equals (const Rect< T > &r, float epsilon=0.00001f) const |
T | GetWidth () const |
Returns the width of this rectangle. More... | |
T | GetHeight () const |
Returns the height of this rectangle. More... | |
Rect< T > | Unite (const Rect< T > &r) const |
Returns a rectangle formed by uniting this rectangle with the given rectangle r. More... | |
Rect< T > | Expand (const Vec2< T > &v) const |
Returns a rectangle formed by expanding this rectangle by the given vector v. More... | |
Vec2< T > | GetSize () const |
Returns a vector storing the size of this rectangle; the width is stored in x and the height is stored in y More... | |
Vec2< T > | GetCenter () const |
Returns a vector storing the center point of this rectangle. More... | |
bool | IsEmpty () |
Returns true if the minimum and maximum coordinates are equal; otherwise returns false. More... | |
bool | IsValid () |
Returns true if the maximum coordinate is bigger or equal to the minimum coordinate; otherwise returns false. More... | |
bool | Contains (const Vec2< T > &v) const |
Returns true if the given vector point v is inside this rectangle; otherwise returns false. More... | |
bool | Contains (const Rect< T > &r) const |
Returns true if the given rectangle r is inside this rectangle; otherwise returns false. More... | |
bool | Intersects (const Rect< T > &r) const |
Returns true if the given rectangle r is intersects this rectangle; otherwise returns false. More... | |
Public Attributes | |
Vec2< T > | min |
The minimum coordinate (the left-top corner when y coordinate points downward). More... | |
Vec2< T > | max |
The maximum coordinate (the right-bottom corner when y coordinate points downward). More... | |
Rectangle.
|
inline |
Constructs an empty 'null' rectangle.
Constructs a rectangle from the given minimum and maximum coordinates.
Constructs a rectangle from the given minimum and maximum vectors .
Returns true if this rectangle is equal to the given rectangle r; otherwise returns false.
Returns true if this rectangle is not equal to the given rectangle r; otherwise returns false.
Returns true if this rectangle is equal to the given rectangle r; otherwise returns false. For floating-point types: two compared numbers are considered equal if their difference is smaller then the given epsilon.
|
inline |
Returns the width of this rectangle.
|
inline |
Returns the height of this rectangle.
Returns a rectangle formed by uniting this rectangle with the given rectangle r.
Returns a rectangle formed by expanding this rectangle by the given vector v.
Returns a vector storing the size of this rectangle; the width is stored in x and the height is stored in y
|
inline |
Returns true if the minimum and maximum coordinates are equal; otherwise returns false.
|
inline |
Returns true if the maximum coordinate is bigger or equal to the minimum coordinate; otherwise returns false.
Returns true if the given vector point v is inside this rectangle; otherwise returns false.
Returns true if the given rectangle r is inside this rectangle; otherwise returns false.
Returns true if the given rectangle r is intersects this rectangle; otherwise returns false.