Made Cube/Rect more user-friendly

Former-commit-id: 13ac0b9f6428059596c98f636caf61afd2a436b7
This commit is contained in:
Lynix
2013-05-30 03:02:43 +02:00
parent e0229ab390
commit c99ab36ebe
4 changed files with 99 additions and 0 deletions

View File

@@ -15,8 +15,10 @@ class NzRect
{
public:
NzRect() = default;
NzRect(T Width, T Height);
NzRect(T X, T Y, T Width, T Height);
NzRect(const T rect[4]);
NzRect(const NzVector2<T>& size);
NzRect(const NzVector2<T>& vec1, const NzVector2<T>& vec2);
template<typename U> explicit NzRect(const NzRect<U>& rect);
NzRect(const NzRect& rect) = default;
@@ -42,9 +44,11 @@ class NzRect
NzRect& MakeZero();
NzRect& Set(T Width, T Height);
NzRect& Set(T X, T Y, T Width, T Height);
NzRect& Set(const T rect[4]);
NzRect& Set(const NzRect<T>& rect);
NzRect& Set(const NzVector2<T>& size);
NzRect& Set(const NzVector2<T>& vec1, const NzVector2<T>& vec2);
template<typename U> NzRect& Set(const NzRect<U>& rect);
@@ -54,8 +58,10 @@ class NzRect
T operator[](unsigned int i) const;
NzRect operator*(T scalar) const;
NzRect operator*(const NzVector2<T>& vec) const;
NzRect& operator*=(T scalar);
NzRect& operator*=(const NzVector2<T>& vec);
bool operator==(const NzRect& rect) const;
bool operator!=(const NzRect& rect) const;