Floating point version of the Rectangle structure, representing an axis-aligned rectangle in 2D space with floating-point precision. It is defined by its top-left corner (X, Y) and its dimensions (Width, Height).
More...
#include <Rectangle.hpp>
|
| constexpr | RectangleF (float x=0, float y=0, float w=0, float h=0) |
| | Constructs an axis-aligned rectangle with the specified top-left corner and dimensions. If no values are provided, it creates a rectangle at the origin with zero width and height.
|
| | RectangleF (Vector2 min, Vector2 max) |
| | Creates a rectangle from two points, where 'min' is the top-left corner and 'max' is the bottom-right corner. The width and height are calculated based on these points.
|
| Vector2 | TopLeft () const |
| | The top left corner of the rectangle.
|
| Vector2 | TopRight () const |
| | The top right corner of the rectangle.
|
| Vector2 | BottomLeft () const |
| | The bottom left corner of the rectangle.
|
| Vector2 | BottomRight () const |
| | The bottom right corner of the rectangle.
|
| Vector2 | Center () const |
| | The center point of the rectangle.
|
| bool | Contains (Vector2 p) const noexcept |
| | Does this rectangle contain the specified point p?
|
| float | Area () const noexcept |
| | Returns the area of the rectangle as a floating-point value.
|
| bool | operator== (const RectangleF &r) const =default |
| | Compares this rectangle with another rectangle for equality. Two rectangles are considered equal if they have the same top-left corner and dimensions.
|
| bool | operator!= (const RectangleF &r) const =default |
| | Compares this rectangle with another rectangle for inequality. Two rectangles are considered not equal if they differ in either their top-left corner or dimensions.
|
|
| float | X |
| | The X coordinate of the top-left corner of the rectangle.
|
| float | Y |
| | The Y coordinate of the top-left corner of the rectangle.
|
| float | Width |
| | The width of the rectangle.
|
| float | Height |
| | The height of the rectangle.
|
Floating point version of the Rectangle structure, representing an axis-aligned rectangle in 2D space with floating-point precision. It is defined by its top-left corner (X, Y) and its dimensions (Width, Height).
◆ RectangleF() [1/2]
| Engine3DRadSpace.Math::RectangleF::RectangleF |
( |
float | x = 0, |
|
|
float | y = 0, |
|
|
float | w = 0, |
|
|
float | h = 0 ) |
|
inlineexplicitconstexpr |
Constructs an axis-aligned rectangle with the specified top-left corner and dimensions. If no values are provided, it creates a rectangle at the origin with zero width and height.
- Parameters
-
| x | The X coordinate of the top-left corner of the rectangle. |
| y | The Y coordinate of the top-left corner of the rectangle. |
| w | The width of the rectangle. |
| h | The height of the rectangle. |
◆ RectangleF() [2/2]
| Engine3DRadSpace.Math::RectangleF::RectangleF |
( |
Vector2 | min, |
|
|
Vector2 | max ) |
|
inlineexplicit |
Creates a rectangle from two points, where 'min' is the top-left corner and 'max' is the bottom-right corner. The width and height are calculated based on these points.
- Parameters
-
| min | Minimal point (top-left corner) |
| max | Maximum point (bottom-right corner) |
◆ Area()
| float RectangleF::Area |
( |
| ) |
const |
|
noexcept |
Returns the area of the rectangle as a floating-point value.
- Returns
- Width*Height
◆ BottomLeft()
| Vector2 RectangleF::BottomLeft |
( |
| ) |
const |
The bottom left corner of the rectangle.
- Returns
- The bottom left corner.
◆ BottomRight()
| Vector2 RectangleF::BottomRight |
( |
| ) |
const |
The bottom right corner of the rectangle.
- Returns
- The bottom right corner.
◆ Center()
| Vector2 RectangleF::Center |
( |
| ) |
const |
The center point of the rectangle.
- Returns
- The center point.
◆ Contains()
Does this rectangle contain the specified point p?
- Parameters
-
| p | Point in floating point precision. |
- Returns
- True if the rectangle contains the point; otherwise, false.
◆ operator!=()
| bool Engine3DRadSpace.Math::RectangleF::operator!= |
( |
const RectangleF & | r | ) |
const |
|
default |
Compares this rectangle with another rectangle for inequality. Two rectangles are considered not equal if they differ in either their top-left corner or dimensions.
- Parameters
-
| r | The rectangle to compare with. |
- Returns
- True if the rectangles are not equal; otherwise, false.
◆ operator==()
| bool Engine3DRadSpace.Math::RectangleF::operator== |
( |
const RectangleF & | r | ) |
const |
|
default |
Compares this rectangle with another rectangle for equality. Two rectangles are considered equal if they have the same top-left corner and dimensions.
- Parameters
-
| r | The rectangle to compare with. |
- Returns
- True if the rectangles are equal; otherwise, false.
◆ TopLeft()
| Vector2 RectangleF::TopLeft |
( |
| ) |
const |
The top left corner of the rectangle.
- Returns
- The top left corner.
◆ TopRight()
| Vector2 RectangleF::TopRight |
( |
| ) |
const |
The top right corner of the rectangle.
- Returns
- The top right corner.
◆ Height
| float Engine3DRadSpace.Math::RectangleF::Height |
The height of the rectangle.
◆ Width
| float Engine3DRadSpace.Math::RectangleF::Width |
The width of the rectangle.
| float Engine3DRadSpace.Math::RectangleF::X |
The X coordinate of the top-left corner of the rectangle.
| float Engine3DRadSpace.Math::RectangleF::Y |
The Y coordinate of the top-left corner of the rectangle.
The documentation for this struct was generated from the following files: