Axmol Engine 2.4.0-258ceca
|
Rectangle area. More...
#include <Rect.h>
Public Member Functions | |
constexpr | Rect () |
Constructor an empty Rect. | |
constexpr | Rect (float x, float y, float width, float height) |
Constructor a rect. | |
constexpr | Rect (const Vec2 &pos, const Vec2 &dimension) |
Constructor a rect. | |
constexpr | Rect (const Rect &other) |
Copy constructor. | |
Rect & | operator= (const Rect &other) |
@js NA @lua NA | |
constexpr void | setRect (float x, float y, float width, float height) |
Set the x, y, width and height of Rect. | |
float | getMinX () const |
Get the left of the rect. | |
float | getMidX () const |
Get the X coordinate of center point. | |
float | getMaxX () const |
Get the right of rect. | |
float | getMinY () const |
Get the bottom of rect. | |
float | getMidY () const |
Get the Y coordinate of center point. | |
float | getMaxY () const |
Get top of rect. | |
bool | equals (const Rect &rect) const |
Compare two rects. | |
bool | containsPoint (const Vec2 &point) const |
Check if the points is contained in the rect. | |
bool | intersectsRect (const Rect &rect) const |
Check the intersect status of two rects. | |
bool | intersectsCircle (const Vec2 ¢er, float radius) const |
Check the intersect status of the rect and a circle. | |
Rect | unionWithRect (const Rect &rect) const |
Get the min rect which can contain this and rect. | |
void | merge (const Rect &rect) |
Compute the min rect which can contain this and rect, assign it to this. | |
Public Attributes | |
Vec2 | origin |
Low left point of rect. | |
Vec2 | size |
Width and height of the rect. | |
Static Public Attributes | |
static const Rect | ZERO |
An empty Rect. | |
Rectangle area.
|
inlineconstexpr |
Constructor a rect.
@js NA
|
inlineconstexpr |
Set the x, y, width and height of Rect.
@js NA @lua NA
|
inline |
Get the left of the rect.
@js NA return the leftmost x-value of current rect
|
inline |
Get the X coordinate of center point.
@js NA return the midpoint x-value of current rect
|
inline |
Get the right of rect.
@js NA return the rightmost x-value of current rect
|
inline |
Get the bottom of rect.
@js NA return the bottommost y-value of current rect
|
inline |
Get the Y coordinate of center point.
@js NA return the midpoint y-value of current rect
|
inline |
Get top of rect.
@js NA return the topmost y-value of current rect
|
inline |
Compare two rects.
@js NA
|
inline |
Check if the points is contained in the rect.
@js NA
|
inline |
Check the intersect status of two rects.
@js NA
bool intersectsCircle | ( | const Vec2 & | center, |
float | radius ) const |
Check the intersect status of the rect and a circle.
@js NA
Get the min rect which can contain this and rect.
@js NA @lua NA