#include <common.h>
Public Member Functions | |
constexpr | Rect () |
constexpr | Rect (const vec2 a, const vec2 b) |
Public Attributes | |
vec2 | min = vec2(std::numeric_limits<double>::infinity()) |
vec2 | max = vec2(-std::numeric_limits<double>::infinity()) |
Information | |
Details of the rectangle | |
constexpr vec2 | Size () const |
constexpr double | Area () const |
constexpr double | Scale () const |
constexpr vec2 | Center () const |
constexpr bool | Contains (const vec2 &p) const |
constexpr bool | Contains (const Rect &rect) const |
constexpr bool | DoesOverlap (const Rect &rect) const |
constexpr bool | IsEmpty () const |
constexpr bool | IsFinite () const |
Modification | |
void | Union (const vec2 p) |
constexpr Rect | Union (const Rect &rect) const |
constexpr Rect | operator+ (const vec2 shift) const |
Rect & | operator+= (const vec2 shift) |
constexpr Rect | operator* (const vec2 scale) const |
Rect & | operator*= (const vec2 scale) |
constexpr Rect | Transform (const mat2x3 &m) const |
Axis-aligned rectangular bounds.
Create a rectangle that contains the two given points.
Returns the absolute-largest coordinate value of any contained point.
Does this rectangle contain (includes on border) the given point?
Does this rectangle contain (includes equal) the given rectangle?
Does this rectangle overlap the one given (including equality)?
Expand this rectangle to include the given Rect.
Shift this rectangle by the given vector.
Scale this rectangle by the given vector.