52 constexpr Rect() =
default;
71 constexpr explicit operator Rect<U>()
const;
151#include <SFML/Graphics/Rect.inl>
Utility class for manipulating 2D axis aligned rectangles.
constexpr Rect(Vector2< T > position, Vector2< T > size)
Construct the rectangle from position and size.
constexpr bool operator!=(const Rect< T > &lhs, const Rect< T > &rhs)
Overload of binary operator!=
constexpr Rect()=default
Default constructor.
constexpr std::optional< Rect< T > > findIntersection(const Rect< T > &rectangle) const
Check the intersection between two rectangles.
constexpr bool operator==(const Rect< T > &lhs, const Rect< T > &rhs)
Overload of binary operator==
constexpr Vector2< T > getCenter() const
Get the position of the center of the rectangle.
constexpr bool contains(Vector2< T > point) const
Check if a point is inside the rectangle's area.
Class template for manipulating 2-dimensional vectors.