#include <rectangle.hpp>
|
constexpr | Rectangle ()=default |
|
constexpr | Rectangle (float x, float y, float width, float height) |
|
constexpr | Rectangle (glm::vec2 position, glm::vec2 size) |
|
| ~Rectangle ()=default |
|
constexpr float | width () const |
| Obtains the width. More...
|
|
constexpr float | height () const |
| Obtains the height. More...
|
|
constexpr glm::vec2 | size () const |
| Obtains the current size of the rectangle. More...
|
|
constexpr void | size (glm::vec2 size) |
| Sets the size of the rectangle. More...
|
|
template<typename T > |
constexpr void | size (T x, T y) |
|
constexpr glm::vec2 | position () const |
| Obtains the current position of the rectangle. More...
|
|
constexpr void | position (glm::vec2 position) |
| Sets the base position of the rectangle, modifying it's size. More...
|
|
template<typename T > |
constexpr void | position (T x, T y) |
|
constexpr void | scale (glm::vec2 factor) |
| Scales the rectangle by factor. More...
|
|
template<typename T > |
constexpr void | scale (T x, T y) |
|
constexpr void | offset (glm::vec2 offset) |
| Offset the rectangle by the given parameter. More...
|
|
template<typename T > |
constexpr void | offset (T x, T y) |
|
constexpr bool | contains (glm::vec2 pos) const |
| Checks if the point is contains the point. More...
|
|
template<typename T > |
constexpr bool | contains (T x, T y) const |
|
constexpr bool | contains (const Rectangle &rect) const |
| Checks if the rectangle is contains the rectangle. More...
|
|
constexpr Rectangle | intersection (const Rectangle &rect) const |
| Obtains the intersection rectangle from two other rectangles R1 and R2. More...
|
|
constexpr Rectangle | join (const Rectangle &rect) const |
| Obtains the intersection rectangle from two other rectangles R1 and R2. More...
|
|
Definition at line 31 of file rectangle.hpp.
◆ Rectangle() [1/3]
constexpr Eng3D::Rectangle::Rectangle |
( |
| ) |
|
|
constexprdefault |
◆ Rectangle() [2/3]
constexpr Eng3D::Rectangle::Rectangle |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
width, |
|
|
float |
height |
|
) |
| |
|
inlineconstexpr |
◆ Rectangle() [3/3]
constexpr Eng3D::Rectangle::Rectangle |
( |
glm::vec2 |
position, |
|
|
glm::vec2 |
size |
|
) |
| |
|
inlineconstexpr |
◆ ~Rectangle()
Eng3D::Rectangle::~Rectangle |
( |
| ) |
|
|
default |
◆ contains() [1/3]
constexpr bool Eng3D::Rectangle::contains |
( |
const Rectangle & |
rect | ) |
const |
|
inlineconstexpr |
Checks if the rectangle is contains the rectangle.
- Parameters
-
rect | Rectangle to check (rectangle must be inside this rectangle) |
- Returns
- true Rectangle not in bounds
-
false Rectangle is in bounds
Definition at line 147 of file rectangle.hpp.
◆ contains() [2/3]
constexpr bool Eng3D::Rectangle::contains |
( |
glm::vec2 |
pos | ) |
const |
|
inlineconstexpr |
Checks if the point is contains the point.
- Parameters
-
pos | Position to check (rectangle must cover this point) |
- Returns
- true Rectangle not in bounds
-
false Rectangle is in bounds
Definition at line 134 of file rectangle.hpp.
◆ contains() [3/3]
template<typename T >
constexpr bool Eng3D::Rectangle::contains |
( |
T |
x, |
|
|
T |
y |
|
) |
| const |
|
inlineconstexpr |
◆ height()
constexpr float Eng3D::Rectangle::height |
( |
| ) |
const |
|
inlineconstexpr |
Obtains the height.
- Returns
- float Height of the rectangle
Definition at line 62 of file rectangle.hpp.
◆ intersection()
Obtains the intersection rectangle from two other rectangles R1 and R2.
- Parameters
-
rect | Second rectangle to perform the intersection for |
- Returns
- Rectangle Intersection area rectangle
Definition at line 157 of file rectangle.hpp.
◆ join()
Obtains the intersection rectangle from two other rectangles R1 and R2.
- Parameters
-
rect | Second rectangle to perform the intersection for |
- Returns
- Rectangle Intersection area rectangle
Definition at line 168 of file rectangle.hpp.
◆ offset() [1/2]
constexpr void Eng3D::Rectangle::offset |
( |
glm::vec2 |
offset | ) |
|
|
inlineconstexpr |
Offset the rectangle by the given parameter.
- Parameters
-
offset | Offset to apply to the rectangle |
Definition at line 118 of file rectangle.hpp.
◆ offset() [2/2]
template<typename T >
constexpr void Eng3D::Rectangle::offset |
( |
T |
x, |
|
|
T |
y |
|
) |
| |
|
inlineconstexpr |
◆ position() [1/3]
constexpr glm::vec2 Eng3D::Rectangle::position |
( |
| ) |
const |
|
inlineconstexpr |
Obtains the current position of the rectangle.
- Returns
- glm::vec2 The base position
Definition at line 86 of file rectangle.hpp.
◆ position() [2/3]
constexpr void Eng3D::Rectangle::position |
( |
glm::vec2 |
position | ) |
|
|
inlineconstexpr |
Sets the base position of the rectangle, modifying it's size.
- Parameters
-
Definition at line 92 of file rectangle.hpp.
◆ position() [3/3]
template<typename T >
constexpr void Eng3D::Rectangle::position |
( |
T |
x, |
|
|
T |
y |
|
) |
| |
|
inlineconstexpr |
◆ scale() [1/2]
constexpr void Eng3D::Rectangle::scale |
( |
glm::vec2 |
factor | ) |
|
|
inlineconstexpr |
Scales the rectangle by factor.
- Parameters
-
factor | Factor to scale rectangle by |
Definition at line 104 of file rectangle.hpp.
◆ scale() [2/2]
template<typename T >
constexpr void Eng3D::Rectangle::scale |
( |
T |
x, |
|
|
T |
y |
|
) |
| |
|
inlineconstexpr |
◆ size() [1/3]
constexpr glm::vec2 Eng3D::Rectangle::size |
( |
| ) |
const |
|
inlineconstexpr |
Obtains the current size of the rectangle.
- Returns
- glm::vec2 The size of the rectangle
Definition at line 68 of file rectangle.hpp.
◆ size() [2/3]
constexpr void Eng3D::Rectangle::size |
( |
glm::vec2 |
size | ) |
|
|
inlineconstexpr |
Sets the size of the rectangle.
- Parameters
-
Definition at line 74 of file rectangle.hpp.
◆ size() [3/3]
template<typename T >
constexpr void Eng3D::Rectangle::size |
( |
T |
x, |
|
|
T |
y |
|
) |
| |
|
inlineconstexpr |
◆ width()
constexpr float Eng3D::Rectangle::width |
( |
| ) |
const |
|
inlineconstexpr |
Obtains the width.
- Returns
- float Width of the rectangle
Definition at line 56 of file rectangle.hpp.
◆ bottom
float Eng3D::Rectangle::bottom = 0.f |
◆ left
float Eng3D::Rectangle::left = 0.f |
◆ right
float Eng3D::Rectangle::right = 0.f |
◆ top
float Eng3D::Rectangle::top = 0.f |
The documentation for this struct was generated from the following file: