5#ifndef __IRR_RECT_H_INCLUDED__
6#define __IRR_RECT_H_INCLUDED__
9#include "dimension2d.h"
10#include "position2d.h"
38 rect(
const position2d<T>& upperLeft,
const position2d<T>& lowerRight)
225 return position2d<T>(
Specifies a 2 dimensional size.
Definition dimension2d.h:21
Rectangle template.
Definition rect.h:27
rect()
Default constructor creating empty rectangle at (0,0).
Definition rect.h:31
rect< T > operator+(const position2d< T > &pos) const
move right by given numbers
Definition rect.h:47
void addInternalPoint(const position2d< T > &p)
Adds a point to the rectangle.
Definition rect.h:241
T getArea() const
Returns size of rectangle.
Definition rect.h:97
void addInternalPoint(T x, T y)
Adds a point to the bounding rectangle.
Definition rect.h:251
dimension2d< T > getSize() const
Get the dimensions of the rectangle.
Definition rect.h:231
bool operator==(const rect< T > &other) const
equality operator
Definition rect.h:77
bool isPointInside(const position2d< T > &pos) const
Returns if a 2d point is within this rectangle.
Definition rect.h:105
bool constrainTo(const rect< T > &other)
Moves this rectangle to fit inside another one.
Definition rect.h:147
void repair()
If the lower right corner of the rect is smaller then the upper left, the points are swapped.
Definition rect.h:196
rect(const position2d< T > &pos, const dimension2d< U > &size)
Constructor with upper left corner and dimension.
Definition rect.h:43
void clipAgainst(const rect< T > &other)
Clips this rectangle with another one.
Definition rect.h:126
bool operator<(const rect< T > &other) const
compares size of rectangles
Definition rect.h:91
rect(const position2d< T > &upperLeft, const position2d< T > &lowerRight)
Constructor with two corners.
Definition rect.h:38
position2d< f32 > LowerRightCorner
Definition rect.h:267
rect< T > & operator-=(const position2d< T > &pos)
move left by given numbers
Definition rect.h:69
bool isRectCollided(const rect< T > &other) const
Check if the rectangle collides with another rectangle.
Definition rect.h:116
position2d< f32 > UpperLeftCorner
Definition rect.h:265
bool isValid() const
Returns if the rect is valid to draw.
Definition rect.h:216
T getHeight() const
Get height of rectangle.
Definition rect.h:190
T getWidth() const
Get width of rectangle.
Definition rect.h:184
bool operator!=(const rect< T > &other) const
inequality operator
Definition rect.h:84
rect< T > operator-(const position2d< T > &pos) const
move left by given numbers
Definition rect.h:62
rect(T x, T y, T x2, T y2)
Constructor with two corners.
Definition rect.h:34
rect< T > & operator+=(const position2d< T > &pos)
move right by given numbers
Definition rect.h:54
position2d< T > getCenter() const
Get the center of the rectangle.
Definition rect.h:223
Basic classes such as vectors, planes, arrays, lists, and so on can be found in this namespace.
Definition aabbox3d.h:15
rect< s32 > recti
Rectangle with int values.
Definition rect.h:273
rect< f32 > rectf
Rectangle with float values.
Definition rect.h:271
Everything in the Irrlicht Engine can be found in this namespace.
Definition Skylicht.h:33