Switch from Nz prefix to namespace Nz
What a huge commit Former-commit-id: 38ac5eebf70adc1180f571f6006192d28fb99897
This commit is contained in:
@@ -11,86 +11,89 @@
|
||||
#include <Nazara/Math/Enums.hpp>
|
||||
#include <Nazara/Math/Vector2.hpp>
|
||||
|
||||
template<typename T>
|
||||
class NzRect
|
||||
namespace Nz
|
||||
{
|
||||
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>& lengths);
|
||||
NzRect(const NzVector2<T>& vec1, const NzVector2<T>& vec2);
|
||||
template<typename U> explicit NzRect(const NzRect<U>& rect);
|
||||
NzRect(const NzRect& rect) = default;
|
||||
~NzRect() = default;
|
||||
template<typename T>
|
||||
class Rect
|
||||
{
|
||||
public:
|
||||
Rect() = default;
|
||||
Rect(T Width, T Height);
|
||||
Rect(T X, T Y, T Width, T Height);
|
||||
Rect(const T rect[4]);
|
||||
Rect(const Vector2<T>& lengths);
|
||||
Rect(const Vector2<T>& vec1, const Vector2<T>& vec2);
|
||||
template<typename U> explicit Rect(const Rect<U>& rect);
|
||||
Rect(const Rect& rect) = default;
|
||||
~Rect() = default;
|
||||
|
||||
bool Contains(T X, T Y) const;
|
||||
bool Contains(const NzVector2<T>& point) const;
|
||||
bool Contains(const NzRect& rect) const;
|
||||
bool Contains(T X, T Y) const;
|
||||
bool Contains(const Vector2<T>& point) const;
|
||||
bool Contains(const Rect& rect) const;
|
||||
|
||||
NzRect& ExtendTo(T X, T Y);
|
||||
NzRect& ExtendTo(const NzVector2<T>& point);
|
||||
NzRect& ExtendTo(const NzRect& rect);
|
||||
Rect& ExtendTo(T X, T Y);
|
||||
Rect& ExtendTo(const Vector2<T>& point);
|
||||
Rect& ExtendTo(const Rect& rect);
|
||||
|
||||
NzVector2<T> GetCenter() const;
|
||||
NzVector2<T> GetCorner(nzRectCorner corner) const;
|
||||
NzVector2<T> GetLengths() const;
|
||||
NzVector2<T> GetMaximum() const;
|
||||
NzVector2<T> GetMinimum() const;
|
||||
NzVector2<T> GetNegativeVertex(const NzVector2<T>& normal) const;
|
||||
NzVector2<T> GetPosition() const;
|
||||
NzVector2<T> GetPositiveVertex(const NzVector2<T>& normal) const;
|
||||
Vector2<T> GetCenter() const;
|
||||
Vector2<T> GetCorner(RectCorner corner) const;
|
||||
Vector2<T> GetLengths() const;
|
||||
Vector2<T> GetMaximum() const;
|
||||
Vector2<T> GetMinimum() const;
|
||||
Vector2<T> GetNegativeVertex(const Vector2<T>& normal) const;
|
||||
Vector2<T> GetPosition() const;
|
||||
Vector2<T> GetPositiveVertex(const Vector2<T>& normal) const;
|
||||
|
||||
bool Intersect(const NzRect& rect, NzRect* intersection = nullptr) const;
|
||||
bool Intersect(const Rect& rect, Rect* intersection = nullptr) const;
|
||||
|
||||
bool IsValid() const;
|
||||
bool IsValid() const;
|
||||
|
||||
NzRect& MakeZero();
|
||||
Rect& 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>& lengths);
|
||||
NzRect& Set(const NzVector2<T>& vec1, const NzVector2<T>& vec2);
|
||||
template<typename U> NzRect& Set(const NzRect<U>& rect);
|
||||
Rect& Set(T Width, T Height);
|
||||
Rect& Set(T X, T Y, T Width, T Height);
|
||||
Rect& Set(const T rect[4]);
|
||||
Rect& Set(const Rect<T>& rect);
|
||||
Rect& Set(const Vector2<T>& lengths);
|
||||
Rect& Set(const Vector2<T>& vec1, const Vector2<T>& vec2);
|
||||
template<typename U> Rect& Set(const Rect<U>& rect);
|
||||
|
||||
NzString ToString() const;
|
||||
String ToString() const;
|
||||
|
||||
NzRect& Translate(const NzVector2<T>& translation);
|
||||
Rect& Translate(const Vector2<T>& translation);
|
||||
|
||||
T& operator[](unsigned int i);
|
||||
T operator[](unsigned int i) const;
|
||||
T& operator[](unsigned int i);
|
||||
T operator[](unsigned int i) const;
|
||||
|
||||
NzRect operator*(T scalar) const;
|
||||
NzRect operator*(const NzVector2<T>& vec) const;
|
||||
NzRect operator/(T scalar) const;
|
||||
NzRect operator/(const NzVector2<T>& vec) const;
|
||||
Rect operator*(T scalar) const;
|
||||
Rect operator*(const Vector2<T>& vec) const;
|
||||
Rect operator/(T scalar) const;
|
||||
Rect operator/(const Vector2<T>& vec) const;
|
||||
|
||||
NzRect& operator*=(T scalar);
|
||||
NzRect& operator*=(const NzVector2<T>& vec);
|
||||
NzRect& operator/=(T scalar);
|
||||
NzRect& operator/=(const NzVector2<T>& vec);
|
||||
Rect& operator*=(T scalar);
|
||||
Rect& operator*=(const Vector2<T>& vec);
|
||||
Rect& operator/=(T scalar);
|
||||
Rect& operator/=(const Vector2<T>& vec);
|
||||
|
||||
bool operator==(const NzRect& rect) const;
|
||||
bool operator!=(const NzRect& rect) const;
|
||||
bool operator==(const Rect& rect) const;
|
||||
bool operator!=(const Rect& rect) const;
|
||||
|
||||
static NzRect Lerp(const NzRect& from, const NzRect& to, T interpolation);
|
||||
static NzRect Zero();
|
||||
static Rect Lerp(const Rect& from, const Rect& to, T interpolation);
|
||||
static Rect Zero();
|
||||
|
||||
T x, y, width, height;
|
||||
};
|
||||
T x, y, width, height;
|
||||
};
|
||||
|
||||
typedef Rect<double> Rectd;
|
||||
typedef Rect<float> Rectf;
|
||||
typedef Rect<int> Recti;
|
||||
typedef Rect<unsigned int> Rectui;
|
||||
typedef Rect<Int32> Recti32;
|
||||
typedef Rect<UInt32> Rectui32;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
std::ostream& operator<<(std::ostream& out, const NzRect<T>& rect);
|
||||
|
||||
typedef NzRect<double> NzRectd;
|
||||
typedef NzRect<float> NzRectf;
|
||||
typedef NzRect<int> NzRecti;
|
||||
typedef NzRect<unsigned int> NzRectui;
|
||||
typedef NzRect<nzInt32> NzRecti32;
|
||||
typedef NzRect<nzUInt32> NzRectui32;
|
||||
std::ostream& operator<<(std::ostream& out, const Nz::Rect<T>& rect);
|
||||
|
||||
#include <Nazara/Math/Rect.inl>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user