16 #ifndef MATHFU_RECT_H_
17 #define MATHFU_RECT_H_
41 : pos(v.x, v.y), size(v.z, v.w) {}
49 inline Rect(T x = static_cast<T>(0), T y = static_cast<T>(0),
50 T width = static_cast<T>(0), T height = static_cast<T>(0))
51 : pos(x, y), size(width, height) {}
58 : pos(pos), size(size) {}
68 return (r1.pos == r2.pos && r1.size == r2.size);
82 #endif // MATHFU_RECT_H_
Definition: vector_2.h:24
Rect of type T containing position (pos) and width.
Definition: rect.h:33
Definition: vector_4.h:25
Rect(const Vector< T, 4 > &v)
Create a rect from a vector4 of the same type.
Definition: rect.h:40
Vector class and functions.
Rect(T x=static_cast< T >(0), T y=static_cast< T >(0), T width=static_cast< T >(0), T height=static_cast< T >(0))
Create a rect from x, y, width and height values.
Definition: rect.h:49
bool operator==(const Rect< T > &r1, const Rect< T > &r2)
Check if two rects are identical.
Definition: rect.h:67
bool operator!=(const Rect< T > &r1, const Rect< T > &r2)
Check if two rects are not identical.
Definition: rect.h:76
Rect(const Vector< T, 2 > &pos, const Vector< T, 2 > &size)
Create a rect from two vector2 representing position and size.
Definition: rect.h:57