|
| PL_DECLARE_POD_TYPE () |
|
| plRectTemplate () |
| Default constructor does not initialize the data.
|
|
| plRectTemplate (Type x, Type y, Type width, Type height) |
| Constructor to set all values.
|
|
| plRectTemplate (Type width, Type height) |
| Initializes x and y with zero, width and height with the given values.
|
|
| plRectTemplate (const plVec2Template< Type > &vTopLeftPosition, const plVec2Template< Type > &vSize) |
| Initializes x and y from pos, width and height from vSize.
|
|
Type | Left () const |
| The smaller value along x.
|
|
Type | Right () const |
| The larger value along x.
|
|
Type | Top () const |
| The smaller value along y.
|
|
Type | Bottom () const |
| The larger value along y.
|
|
Type | GetX1 () const |
| The smaller value along x. Same as Left().
|
|
Type | GetX2 () const |
| The larger value along x. Same as Right().
|
|
Type | GetY1 () const |
| The smaller value along y. Same as Top().
|
|
Type | GetY2 () const |
| The larger value along y. Same as Bottom().
|
|
plVec2Template< Type > | GetMinCorner () const |
| Returns the minimum corner position. Same as GetTopLeft().
|
|
plVec2Template< Type > | GetMaxCorner () const |
| Returns the maximum corner position. Same as GetBottomRight().
|
|
plVec2Template< Type > | GetTopLeft () const |
| Returns the top left corner. Same as GetMinCorner().
|
|
plVec2Template< Type > | GetTopRight () const |
| Returns the top right corner.
|
|
plVec2Template< Type > | GetBottomLeft () const |
| Returns the bottom left corner.
|
|
plVec2Template< Type > | GetBottomRight () const |
| Returns the bottom right corner. Same as GetMaxCorner().
|
|
plVec2Template< Type > | GetCenter () const |
| Returns the center point of the rectangle.
|
|
plVec2Template< Type > | GetExtents () const |
| Returns the width and height as a vec2.
|
|
plVec2Template< Type > | GetHalfExtents () const |
| Returns the half width and half height as a vec2.
|
|
void | Grow (Type xy) |
| Increases the size of the rect in all directions.
|
|
bool | operator== (const plRectTemplate< Type > &rhs) const |
|
bool | operator!= (const plRectTemplate< Type > &rhs) const |
|
bool | IsValid () const |
| Checks whether the position and size contain valid values.
|
|
bool | HasNonZeroArea () const |
| Returns true if the area of the rectangle is non zero.
|
|
bool | Contains (const plVec2Template< Type > &vPoint) const |
| Returns true if the rectangle contains the provided point.
|
|
bool | Contains (const plRectTemplate< Type > &r) const |
|
bool | Overlaps (const plRectTemplate< Type > &other) const |
| Returns true if the rectangle overlaps the provided rectangle. Also returns true if the rectangles are contained within each other completely(no intersecting edges).
|
|
void | ExpandToInclude (const plRectTemplate< Type > &other) |
| Extends this rectangle so that the provided rectangle is completely contained within it.
|
|
void | ExpandToInclude (const plVec2Template< Type > &other) |
| Extends this rectangle so that the provided point is contained within it.
|
|
void | Clip (const plRectTemplate< Type > &clipRect) |
| Clips this rect so that it is fully inside the provided rectangle.
|
|
const plVec2Template< Type > | GetClampedPoint (const plVec2Template< Type > &vPoint) const |
| The given point is clamped to the area of the rect, i.e. it will be either inside the rect or on its edge and it will have the closest possible distance to the original point.
|
|
const plRectTemplate< Type > | GetClampedRect (const plRectTemplate< Type > &r) const |
| Clamps the given rect to the area of this rect and returns it.
|
|
void | SetCenter (Type tX, Type tY) |
| Sets the center of the rectangle.
|
|
void | Translate (Type tX, Type tY) |
| Moves the rectangle.
|
|
void | Scale (Type sX, Type sY) |
| Scales width and height, and moves the position as well.
|
|
template<typename Type>
class plRectTemplate< Type >
A simple rectangle class templated on the type for x, y and width, height.