8#ifndef GALAXY_MATH_RECT_HPP_
9#define GALAXY_MATH_RECT_HPP_
13#include <glm/vec2.hpp>
24 template<meta::is_arithmetic Type>
41 Rect(const Type x, const Type y, const Type width, const Type height) noexcept;
57 bool contains(const Type _x, const Type _y) const noexcept;
94 void set_top_left(const glm::vec<2, Type, glm::defaultp>& pos) noexcept;
126 glm::vec<2, Type, glm::defaultp>
get_center() const noexcept;
134 glm::vec<2, Type, glm::defaultp>
get_size() const noexcept;
140 auto operator<=>(const
Rect&) const noexcept = default;
188 template<
meta::is_arithmetic Type>
197 template<meta::is_arithmetic Type>
198 inline Rect<Type>::Rect(
const Type x,
const Type y,
const Type width,
const Type height) noexcept
206 template<meta::is_arithmetic Type>
211 template<meta::is_arithmetic Type>
218 template<meta::is_arithmetic Type>
224 template<meta::is_arithmetic Type>
234 template<meta::is_arithmetic Type>
240 template<meta::is_arithmetic Type>
247 template<meta::is_arithmetic Type>
253 template<meta::is_arithmetic Type>
259 template<meta::is_arithmetic Type>
265 template<meta::is_arithmetic Type>
271 template<meta::is_arithmetic Type>
277 template<meta::is_arithmetic Type>
281 return (value >= min) && (value <= max);
Represents a rectangle object.
bool intersects(const Rect< Type > &b) const noexcept
bool contains(const Type _x, const Type _y) const noexcept
bool overlaps(const Rect< Type > &b) noexcept
void set_top_left(const glm::vec< 2, Type, glm::defaultp > &pos) noexcept
Type get_right() const noexcept
bool value_in_range(const Type value, const Type min, const Type max) noexcept
glm::vec< 2, Type, glm::defaultp > get_size() const noexcept
~Rect() noexcept
Destructor.
glm::vec< 2, Type, glm::defaultp > get_top_left() const noexcept
Type get_bottom() const noexcept
glm::vec< 2, Type, glm::defaultp > get_center() const noexcept
Rect() noexcept
Constructor.
Rect< int > iRect
Type definition for an int rectangle.
Rect< float > fRect
Type definition for a floating point rectangle.