5#ifndef __IRR_RECT_H_INCLUDED__
6#define __IRR_RECT_H_INCLUDED__
Axis aligned bounding box in 3d dimensional space.
T getArea() const
Get the surface area of the box in squared units.
rect()
Default constructor creating empty rectangle at (0,0)
rect< T > operator+(const position2d< T > &pos) const
move right by given numbers
void addInternalPoint(const position2d< T > &p)
Adds a point to the rectangle.
T getArea() const
Returns size of rectangle.
void addInternalPoint(T x, T y)
Adds a point to the bounding rectangle.
dimension2d< T > getSize() const
Get the dimensions of the rectangle.
bool operator==(const rect< T > &other) const
equality operator
bool isPointInside(const position2d< T > &pos) const
Returns if a 2d point is within this rectangle.
bool constrainTo(const rect< T > &other)
Moves this rectangle to fit inside another one.
void repair()
If the lower right corner of the rect is smaller then the upper left, the points are swapped.
rect(const position2d< T > &pos, const dimension2d< U > &size)
Constructor with upper left corner and dimension.
void clipAgainst(const rect< T > &other)
Clips this rectangle with another one.
bool operator<(const rect< T > &other) const
compares size of rectangles
rect(const position2d< T > &upperLeft, const position2d< T > &lowerRight)
Constructor with two corners.
position2d< T > LowerRightCorner
Lower right corner.
rect< T > & operator-=(const position2d< T > &pos)
move left by given numbers
bool isRectCollided(const rect< T > &other) const
Check if the rectangle collides with another rectangle.
position2d< T > UpperLeftCorner
Upper left corner.
bool isValid() const
Returns if the rect is valid to draw.
T getHeight() const
Get height of rectangle.
T getWidth() const
Get width of rectangle.
bool operator!=(const rect< T > &other) const
inequality operator
rect< T > operator-(const position2d< T > &pos) const
move left by given numbers
rect(T x, T y, T x2, T y2)
Constructor with two corners.
rect< T > & operator+=(const position2d< T > &pos)
move right by given numbers
position2d< T > getCenter() const
Get the center of the rectangle.
rect< s32 > recti
Rectangle with int values.
rect< f32 > rectf
Rectangle with float values.
Everything in the Irrlicht Engine can be found in this namespace.