12 : position(x, y), extent(width, height) {}
17 return position == other.position && extent == other.extent;
23 return !(*
this == other);
27 template <
typename To>
30 return Rectangle<To>(position.template castTo<To>(), extent.template castTo<To>());
Represents a rectangle in 2D space.
Definition Rectangle.h:15
constexpr Rectangle()=default
\brif Initializes a Rectangle with position and extent set to {0, 0}.
constexpr bool operator!=(const Rectangle &other) const noexcept
Compares two Rectangle for inequality.
Definition Rectangle.h:21
constexpr Rectangle< To > castTo() const
Casts the rectangle to a rectangle with a different component type.
Definition Rectangle.h:28
constexpr bool operator==(const Rectangle &other) const noexcept
Compares two Rectangle for equality.
Definition Rectangle.h:15
A vector with two components.
Definition Vector2.h:13