![]() |
galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
|
Represents a rectangle object. More...
#include <Rect.hpp>
Inheritance diagram for galaxy::Rect< Type >:
Collaboration diagram for galaxy::Rect< Type >:Public Member Functions | |
| Rect () noexcept | |
| Constructor. | |
| Rect (const Type x, const Type y, const Type width, const Type height) noexcept | |
| Argument constructor. | |
| ~Rect () noexcept | |
| Destructor. | |
| bool | contains (const Type _x, const Type _y) const noexcept |
| Does the rectangle contain the point (x, y). | |
| bool | contains (const Rect< Type > &b) const noexcept |
| Does the rectangle contain another rectangle. | |
| bool | overlaps (const Rect< Type > &b) noexcept |
| Do the rectangles a and b overlap. | |
| bool | intersects (const Rect< Type > &b) const noexcept |
| Do two rectangles intersect. | |
| void | set_top_left (const glm::vec< 2, Type, glm::defaultp > &pos) noexcept |
| Set the top-left position. | |
| Type | get_right () const noexcept |
| Get top right corner. | |
| Type | get_bottom () const noexcept |
| Get bottom left corner. | |
| glm::vec< 2, Type, glm::defaultp > | get_top_left () const noexcept |
| Get the upper-left coordinate. | |
| glm::vec< 2, Type, glm::defaultp > | get_center () const noexcept |
| Gets the center of the rectangle. | |
| glm::vec< 2, Type, glm::defaultp > | get_size () const noexcept |
| Gets width and height of rectangle. | |
| auto | operator<=> (const Rect &) const noexcept=default |
| Comparison operator. | |
Public Attributes | |
| Type | m_xpos |
| X position. | |
| Type | m_ypos |
| Y position. | |
| Type | m_width |
| Width of rectangle. | |
| Type | m_height |
| Height of rectangle. | |
Private Member Functions | |
| bool | value_in_range (const Type value, const Type min, const Type max) noexcept |
| Private function to determine if value is in range. Inclusive. Credits: https://stackoverflow.com/a/306379. | |
Represents a rectangle object.
| Type | Arithmetic type to use for a rectangle. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
nodiscarddefaultnoexcept |
Comparison operator.
|
inlinenodiscardprivatenoexcept |
Private function to determine if value is in range. Inclusive. Credits: https://stackoverflow.com/a/306379.
| value | Value to check if in the min-max range. |
| min | Lower range. |
| max | Upper range. |
Definition at line 278 of file Rect.hpp.
Here is the caller graph for this function:| Type galaxy::Rect< Type >::m_xpos |
| Type galaxy::Rect< Type >::m_ypos |
| Type galaxy::Rect< Type >::m_width |
| Type galaxy::Rect< Type >::m_height |