Represents a 2D rectangle.
More...
|
float | _x |
| The x coordinate of the origin.
|
|
float | _y |
| The y coordinate of the origin.
|
|
float | _width |
| The full width of the rectangle.
|
|
float | _height |
| The full height of the rectangle.
|
|
Represents a 2D rectangle.
◆ Rectangle() [1/2]
nkMaths::Rectangle::Rectangle |
( |
| ) |
|
|
noexcept |
Default constructor. All members will be set to 0.
◆ Rectangle() [2/2]
nkMaths::Rectangle::Rectangle |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
width, |
|
|
float |
height |
|
) |
| |
|
noexcept |
Constructor.
- Parameters
-
x | The x component of the origin. |
y | The y component of the origin. |
width | The rectangle width. |
height | The rectangle height. |
◆ pointInside()
bool nkMaths::Rectangle::pointInside |
( |
Point |
point | ) |
const |
Checks if a point is inside the rectangle.
- Parameters
-
point | The point to check against the rectangle. |
- Returns
- If the point is inside (true) or not (false).
◆ operator+()
Overrides adding rectangles. Conceptually, sum components from the other rectangle with the calling one (origin + other.origin, dimensions + other.dimensions).
- Parameters
-
other | The rectangle to add. |
The documentation for this class was generated from the following file:
- Documentation/Headers/NilkinsMaths/Geometry/Rectangle.h