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