|
| Rect () |
| Default constructor, all zeros.
|
|
| Rect (T xx, T yy, T ww, T hh) |
| Constructs a rectangle from top-left point and size.
|
|
| Rect (const Vector2< T > &topLeft, const Vector2< T > &size) |
| Constructs a rectangle from top-left point and size as two Vector2
|
|
| Rect (const Vector2< T > &topLeft, T ww, T hh) |
| Constructs a rectangle from top-left point and size, the first as aVector2
|
|
| Rect (T xx, T yy, const Vector2< T > &size) |
| Constructs a rectangle from top-left point and size, the second as aVector2
|
|
| Rect (const Rect &other) |
|
Rect & | operator= (const Rect &other) |
|
Vector2< T > | center () const |
| Calculates the center of the rectangle.
|
|
Vector2< T > | min () const |
| Calculates the minimum coordinates of the rectangle.
|
|
Vector2< T > | max () const |
| Calculates the maximum coordinates of the rectangle.
|
|
void | set (T xx, T yy, T ww, T hh) |
| Sets rectangle top-left point and size.
|
|
void | set (const Vector2< T > &topLeft, const Vector2< T > &size) |
| Sets rectangle top-left point and size as two Vector2
|
|
void | set (const Vector2< T > &topLeft, T ww, T hh) |
| Sets rectangle top-left point and size, the first as aVector2
|
|
void | set (T xx, T yy, const Vector2< T > &size) |
| Sets rectangle top-left point and size, the second as aVector2
|
|
void | setCenter (float cx, float cy) |
| Retains rectangle size but moves its center to another position.
|
|
void | setCenter (const Vector2< T > ¢er) |
| Retains rectangle size but moves its center to another position with a Vector2
|
|
void | setSize (float ww, float hh) |
| Retains rectangle center but changes its size.
|
|
void | setSize (const Vector2< T > &size) |
| Retains rectangle center but changes its size with a Vector2
|
|
void | setCenterSize (T xx, T yy, T ww, T hh) |
| Sets rectangle center and size.
|
|
void | setCenterSize (const Vector2< T > ¢er, const Vector2< T > &size) |
| Sets rectangle center and size as two Vector2
|
|
void | setCenterSize (const Vector2< T > ¢er, T ww, T hh) |
| Sets rectangle center and size, the first as aVector2
|
|
void | setCenterSize (T xx, T yy, const Vector2< T > &size) |
| Sets rectangle center and size, the second as aVector2
|
|
void | setMinMax (T minX, T minY, T maxX, T maxY) |
| Sets rectangle minimum and maximum coordinates.
|
|
void | setMinMax (const Vector2< T > &min, const Vector2< T > &max) |
| Sets rectangle minimum and maximum coordinates as two Vector2
|
|
void | setMinMax (const Vector2< T > &min, T maxX, T maxY) |
| Sets rectangle minimum and maximum coordinates, the first as aVector2
|
|
void | setMinMax (T minX, T minY, const Vector2< T > &max) |
| Sets rectangle minimum and maximum coordinates, the second as aVector2
|
|
void | invertSize () |
| Inverts rectangle size and moves (x, y) to a different angle.
|
|
bool | contains (T px, T py) const |
|
bool | contains (const Vector2< T > &p) const |
|
bool | contains (const Rect< T > &rect) const |
|
bool | overlaps (const Rect< T > &rect) const |
|
void | intersect (const Rect< T > &rect) |
| Intersects this rectangle with the other rectangle.
|
|
bool | operator== (const Rect &rect) const |
| Eqality operator.
|
|
template<class S > |
Rect< T > | convertType (const Rect< S > &other) |
|
|
template<class S > |
static Rect | convertType (const Rect< S > &other) |
|
static Rect | fromCenterSize (T xx, T yy, T ww, T hh) |
| Creates a rectangle from center and size.
|
|
static Rect | fromCenterSize (const Vector2< T > ¢er, const Vector2< T > &size) |
| Creates a rectangle from center and size as two Vector2
|
|
static Rect | fromCenterSize (const Vector2< T > ¢er, T ww, T hh) |
| Creates a rectangle from center and size, the first as aVector2
|
|
static Rect | fromCenterSize (T xx, T yy, const Vector2< T > &size) |
| Creates a rectangle from center and size, the second as aVector2
|
|
static Rect | fromMinMax (T minX, T minY, T maxX, T maxY) |
| Creates a rectangle from minimum and maximum coordinates.
|
|
static Rect | fromMinMax (const Vector2< T > &min, const Vector2< T > &max) |
| Creates a rectangle from minimum and maximum coordinates as two Vector2
|
|
static Rect | fromMinMax (const Vector2< T > &min, T maxX, T maxY) |
| Creates a rectangle from minimum and maximum coordinates, the first as aVector2
|
|
static Rect | fromMinMax (T minX, T minY, const Vector2< T > &max) |
| Creates a rectangle from minimum and maximum coordinates, the second as aVector2
|
|
template<class T>
class ncine::Rect< T >
A template based rectangle in a two dimensional space.