|
|
| XII_DECLARE_POD_TYPE () |
| | xiiRectTemplate () |
| | Default constructor does not initialize the data.
|
|
| xiiRectTemplate (Type x, Type y, Type width, Type height) |
| | Constructor to set all values.
|
|
| xiiRectTemplate (Type width, Type height) |
| | Initializes x and y with zero, width and height with the given values.
|
|
| xiiRectTemplate (const xiiVec2Template< Type > &vTopLeftPosition, const xiiVec2Template< 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().
|
|
xiiVec2Template< Type > | GetMinCorner () const |
| | Returns the minimum corner position. Same as GetTopLeft().
|
|
xiiVec2Template< Type > | GetMaxCorner () const |
| | Returns the maximum corner position. Same as GetBottomRight().
|
|
xiiVec2Template< Type > | GetTopLeft () const |
| | Returns the top left corner. Same as GetMinCorner().
|
|
xiiVec2Template< Type > | GetTopRight () const |
| | Returns the top right corner.
|
|
xiiVec2Template< Type > | GetBottomLeft () const |
| | Returns the bottom left corner.
|
|
xiiVec2Template< Type > | GetBottomRight () const |
| | Returns the bottom right corner. Same as GetMaxCorner().
|
|
xiiVec2Template< Type > | GetCenter () const |
| | Returns the center point of the rectangle.
|
|
xiiVec2Template< Type > | GetExtents () const |
| | Returns the width and height as a vec2.
|
|
xiiVec2Template< 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 xiiRectTemplate< 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 xiiVec2Template< Type > &vPoint) const |
| | Returns true if the rectangle contains the provided point.
|
|
bool | Contains (const xiiRectTemplate< Type > &r) const |
| | Returns true if the rectangle contains the provided rectangle completely (no intersecting edges).
|
| bool | Overlaps (const xiiRectTemplate< Type > &other) const |
|
void | ExpandToInclude (const xiiRectTemplate< Type > &other) |
| | Extends this rectangle so that the provided rectangle is completely contained within it.
|
|
void | ExpandToInclude (const xiiVec2Template< Type > &other) |
| | Extends this rectangle so that the provided point is contained within it.
|
|
void | Clip (const xiiRectTemplate< Type > &clipRect) |
| | Clips this rect so that it is fully inside the provided rectangle.
|
| const xiiVec2Template< Type > | GetClampedPoint (const xiiVec2Template< Type > &vPoint) const |
| const xiiRectTemplate< Type > | GetClampedRect (const xiiRectTemplate< Type > &r) const |
| 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 xiiRectTemplate< Type >
Copyright (c) Theophilus Eriata. All Rights Reserved.
A simple rectangle class templated on the type for x, y and width, height.