diff --git a/source/Base/AABB.hpp b/source/Base/AABB.hpp index a1a2e810..6f055846 100644 --- a/source/Base/AABB.hpp +++ b/source/Base/AABB.hpp @@ -13,102 +13,340 @@ namespace SqMod { */ struct AABB { - // -------------------------------------------------------------------------------------------- + /* -------------------------------------------------------------------------------------------- + * ... + */ typedef SQFloat Value; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static const AABB NIL; static const AABB MIN; static const AABB MAX; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static SQChar Delim; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 min, max; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB(Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB(Value x, Value y, Value z); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB(const Vector3 & b); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB(const Vector3 & vmin, const Vector3 & vmax); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB(const Vector4 & b); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB(const Vector4 & vmin, const Vector4 & vmax); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB(const AABB & b); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB(AABB && b); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ ~AABB(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator = (const AABB & b); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator = (AABB && b); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator = (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator = (const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator = (const Vector4 & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator += (const AABB & b); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator -= (const AABB & b); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator *= (const AABB & b); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator /= (const AABB & b); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator %= (const AABB & b); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator += (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator -= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator *= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator /= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator %= (Value s); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator ++ (); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB & operator -- (); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator ++ (int); + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator -- (int); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator + (const AABB & b) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator - (const AABB & b) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator * (const AABB & b) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator / (const AABB & b) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator % (const AABB & b) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator + (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator - (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator * (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator / (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator % (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator + () const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB operator - () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator == (const AABB & b) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator != (const AABB & b) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator < (const AABB & b) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator > (const AABB & b) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator <= (const AABB & b) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator >= (const AABB & b) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQInteger Cmp(const AABB & b) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ const SQChar * ToString() const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value ns); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny, Value nz); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const AABB & b); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector3 & nmin, const Vector3 & nmax); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector4 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector4 & nmin, const Vector4 & nmax); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- - void Clear() { min.Clear(); max.Clear(); } - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ + void Clear() + { + min.Clear(); + max.Clear(); + } + + /* -------------------------------------------------------------------------------------------- + * ... + */ AABB Abs() const; }; diff --git a/source/Base/Circle.hpp b/source/Base/Circle.hpp index ce9d02fa..14c57665 100644 --- a/source/Base/Circle.hpp +++ b/source/Base/Circle.hpp @@ -13,108 +13,375 @@ namespace SqMod { */ struct Circle { - // -------------------------------------------------------------------------------------------- + /* -------------------------------------------------------------------------------------------- + * ... + */ typedef SQFloat Value; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static const Circle NIL; static const Circle MIN; static const Circle MAX; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static SQChar Delim; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f pos; Value rad; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle(Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle(const Vector2f & p); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle(const Vector2f & p, Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle(Value x, Value y, Value r); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle(const Circle & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle(Circle && c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ ~Circle(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator = (const Circle & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator = (Circle && c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator = (Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator = (const Vector2f & p); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator += (const Circle & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator -= (const Circle & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator *= (const Circle & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator /= (const Circle & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator %= (const Circle & c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator += (Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator -= (Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator *= (Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator /= (Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator %= (Value r); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator += (const Vector2f & p); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator -= (const Vector2f & p); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator *= (const Vector2f & p); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator /= (const Vector2f & p); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator %= (const Vector2f & p); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator ++ (); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle & operator -- (); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator ++ (int); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator -- (int); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator + (const Circle & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator - (const Circle & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator * (const Circle & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator / (const Circle & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator % (const Circle & c) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator + (Value r) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator - (Value r) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator * (Value r) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator / (Value r) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator % (Value r) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator + (const Vector2f & p) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator - (const Vector2f & p) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator * (const Vector2f & p) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator / (const Vector2f & p) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator % (const Vector2f & p) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator + () const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle operator - () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator == (const Circle & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator != (const Circle & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator < (const Circle & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator > (const Circle & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator <= (const Circle & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator >= (const Circle & c) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQInteger Cmp(const Circle & c) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ const SQChar * ToString() const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nr); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Circle & nc); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector2f & np); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector2f & np, Value nr); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny, Value nr); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value min, Value max, bool r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value xmin, Value xmax, Value ymin, Value ymax); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value rmin, Value rmax); - // -------------------------------------------------------------------------------------------- - void Clear() { pos.Clear(); rad = 0.0; } - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ + void Clear() + { + pos.Clear(); rad = 0.0; + } + + /* -------------------------------------------------------------------------------------------- + * ... + */ Circle Abs() const; }; diff --git a/source/Base/Color3.hpp b/source/Base/Color3.hpp index e0d501e6..3f80bc88 100644 --- a/source/Base/Color3.hpp +++ b/source/Base/Color3.hpp @@ -12,131 +12,464 @@ namespace SqMod { */ struct Color3 { - // -------------------------------------------------------------------------------------------- + /* -------------------------------------------------------------------------------------------- + * ... + */ typedef Uint8 Value; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static const Color3 NIL; static const Color3 MIN; static const Color3 MAX; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static SQChar Delim; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Value r, g, b; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3(Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3(Value r, Value g, Value b); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3(const Color4 & c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3(const SQChar * name); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3(const SQChar * str, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3(const Color3 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3(Color3 && c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ ~Color3(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator = (const Color3 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator = (Color3 && c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator = (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator = (const SQChar * name); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator = (const Color4 & c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator += (const Color3 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator -= (const Color3 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator *= (const Color3 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator /= (const Color3 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator %= (const Color3 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator &= (const Color3 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator |= (const Color3 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator ^= (const Color3 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator <<= (const Color3 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator >>= (const Color3 & c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator += (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator -= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator *= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator /= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator %= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator &= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator |= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator ^= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator <<= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator >>= (Value s); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator ++ (); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 & operator -- (); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator ++ (int); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator -- (int); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator + (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator - (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator * (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator / (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator % (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator & (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator | (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator ^ (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator << (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator >> (const Color3 & c) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator + (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator - (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator * (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator / (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator % (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator & (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator | (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator ^ (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator << (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator >> (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator + () const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator - () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color3 operator ~ () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator == (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator != (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator < (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator > (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator <= (const Color3 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator >= (const Color3 & c) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQInteger Cmp(const Color3 & c) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ const SQChar * ToString() const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value ns); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nr, Value ng, Value nb); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Color3 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Color4 & c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const SQChar * str, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void SetCol(const SQChar * name); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQUint32 GetRGB() const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ void SetRGB(SQUint32 p); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQUint32 GetRGBA() const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ void SetRGBA(SQUint32 p); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQUint32 GetARGB() const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ void SetARGB(SQUint32 p); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value min, Value max); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value rmin, Value rmax, Value gmin, Value gmax, Value bmin, Value bmax); - // -------------------------------------------------------------------------------------------- - void Clear() { r = 0, g = 0, b = 0; } - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ + void Clear() + { + r = 0, g = 0, b = 0; + } + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Random(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Inverse(); }; diff --git a/source/Base/Color4.hpp b/source/Base/Color4.hpp index 62827c74..2a662301 100644 --- a/source/Base/Color4.hpp +++ b/source/Base/Color4.hpp @@ -12,133 +12,474 @@ namespace SqMod { */ struct Color4 { - // -------------------------------------------------------------------------------------------- + /* -------------------------------------------------------------------------------------------- + * ... + */ typedef Uint8 Value; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static const Color4 NIL; static const Color4 MIN; static const Color4 MAX; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static SQChar Delim; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Value r, g, b, a; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4(Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4(Value r, Value g, Value b); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4(Value r, Value g, Value b, Value a); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4(const Color3 & c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4(const SQChar * name); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4(const SQChar * str, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4(const Color4 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4(Color4 && c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ ~Color4(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator = (const Color4 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator = (Color4 && c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator = (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator = (const SQChar * name); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator = (const Color3 & c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator += (const Color4 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator -= (const Color4 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator *= (const Color4 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator /= (const Color4 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator %= (const Color4 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator &= (const Color4 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator |= (const Color4 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator ^= (const Color4 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator <<= (const Color4 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator >>= (const Color4 & c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator += (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator -= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator *= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator /= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator %= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator &= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator |= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator ^= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator <<= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator >>= (Value s); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator ++ (); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 & operator -- (); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator ++ (int); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator -- (int); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator + (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator - (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator * (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator / (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator % (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator & (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator | (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator ^ (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator << (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator >> (const Color4 & c) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator + (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator - (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator * (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator / (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator % (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator & (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator | (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator ^ (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator << (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator >> (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator + () const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator - () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Color4 operator ~ () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator == (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator != (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator < (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator > (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator <= (const Color4 & c) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator >= (const Color4 & c) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQInteger Cmp(const Color4 & c) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ const SQChar * ToString() const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value ns); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nr, Value ng, Value nb); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nr, Value ng, Value nb, Value na); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Color4 & c); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Color3 & c); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const SQChar * name, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void SetCol(const SQChar * name); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQUint32 GetRGB() const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ void SetRGB(SQUint32 p); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQUint32 GetRGBA() const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ void SetRGBA(SQUint32 p); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQUint32 GetARGB() const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ void SetARGB(SQUint32 p); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value min, Value max); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value rmin, Value rmax, Value gmin, Value gmax, Value bmin, Value bmax, Value amin, Value amax); - // -------------------------------------------------------------------------------------------- - void Clear() { r = 0, g = 0, b = 0, a = 0; } - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ + void Clear() + { + r = 0, g = 0, b = 0, a = 0; + } + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Random(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Inverse(); }; diff --git a/source/Base/Quaternion.hpp b/source/Base/Quaternion.hpp index ccb47116..58634efb 100644 --- a/source/Base/Quaternion.hpp +++ b/source/Base/Quaternion.hpp @@ -12,99 +12,334 @@ namespace SqMod { */ struct Quaternion { - // -------------------------------------------------------------------------------------------- + /* -------------------------------------------------------------------------------------------- + * ... + */ typedef SQFloat Value; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static const Quaternion NIL; static const Quaternion MIN; static const Quaternion MAX; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static SQChar Delim; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Value x, y, z, w; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion(Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion(Value xv, Value yv, Value zv); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion(Value xv, Value yv, Value zv, Value wv); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion(const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion(const Vector4 & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion(const Quaternion & q); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion(Quaternion && q); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ ~Quaternion(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator = (const Quaternion & q); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator = (Quaternion && q); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator = (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator = (const Vector3 & q); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator = (const Vector4 & q); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator += (const Quaternion & q); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator -= (const Quaternion & q); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator *= (const Quaternion & q); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator /= (const Quaternion & q); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator %= (const Quaternion & q); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator += (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator -= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator *= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator /= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator %= (Value s); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator ++ (); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion & operator -- (); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator ++ (int); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator -- (int); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator + (const Quaternion & q) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator - (const Quaternion & q) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator * (const Quaternion & q) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator / (const Quaternion & q) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator % (const Quaternion & q) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator + (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator - (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator * (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator / (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator % (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator + () const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion operator - () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator == (const Quaternion & q) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator != (const Quaternion & q) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator < (const Quaternion & q) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator > (const Quaternion & q) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator <= (const Quaternion & q) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator >= (const Quaternion & q) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQInteger Cmp(const Quaternion & q) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ const SQChar * ToString() const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value ns); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny, Value nz); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny, Value nz, Value nw); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Quaternion & q); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector4 & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value min, Value max); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value zmin, Value zmax, Value wmin, Value wmax); - // -------------------------------------------------------------------------------------------- - void Clear() { x = 0.0, y = 0.0, z = 0.0, w = 0.0; } - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ + void Clear() + { + x = 0.0, y = 0.0, z = 0.0, w = 0.0; + } + + /* -------------------------------------------------------------------------------------------- + * ... + */ Quaternion Abs() const; }; diff --git a/source/Base/Shared.hpp b/source/Base/Shared.hpp index bd67a5a1..8bbc5c13 100644 --- a/source/Base/Shared.hpp +++ b/source/Base/Shared.hpp @@ -21,7 +21,9 @@ namespace SqMod { #undef PI #endif -// ------------------------------------------------------------------------------------------------ +/* ------------------------------------------------------------------------------------------------ + * ... +*/ const Float32 PI = 3.14159265359f; const Float32 RECIPROCAL_PI = 1.0f/PI; const Float32 HALF_PI = PI/2.0f; @@ -31,11 +33,15 @@ const Float32 HALF_PI = PI/2.0f; #undef PI64 #endif -// ------------------------------------------------------------------------------------------------ +/* ------------------------------------------------------------------------------------------------ + * ... +*/ const Float64 PI64 = 3.1415926535897932384626433832795028841971693993751; const Float64 RECIPROCAL_PI64 = 1.0/PI64; -// ------------------------------------------------------------------------------------------------ +/* ------------------------------------------------------------------------------------------------ + * ... +*/ const Float32 DEGTORAD = PI / 180.0f; const Float32 RADTODEG = 180.0f / PI; const Float64 DEGTORAD64 = PI64 / 180.0; diff --git a/source/Base/Sphere.hpp b/source/Base/Sphere.hpp index ba50fd36..00bad10e 100644 --- a/source/Base/Sphere.hpp +++ b/source/Base/Sphere.hpp @@ -13,108 +13,375 @@ namespace SqMod { */ struct Sphere { - // -------------------------------------------------------------------------------------------- + /* -------------------------------------------------------------------------------------------- + * ... + */ typedef SQFloat Value; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static const Sphere NIL; static const Sphere MIN; static const Sphere MAX; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static SQChar Delim; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 pos; Value rad; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere(Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere(const Vector3 & p); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere(const Vector3 & p, Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere(Value x, Value y, Value z, Value r); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere(const Sphere & s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere(Sphere && s); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ ~Sphere(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator = (const Sphere & s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator = (Sphere && s); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator = (Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator = (const Vector3 & p); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator += (const Sphere & s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator -= (const Sphere & s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator *= (const Sphere & s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator /= (const Sphere & s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator %= (const Sphere & s); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator += (Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator -= (Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator *= (Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator /= (Value r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator %= (Value r); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator += (const Vector3 & p); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator -= (const Vector3 & p); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator *= (const Vector3 & p); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator /= (const Vector3 & p); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator %= (const Vector3 & p); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator ++ (); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere & operator -- (); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator ++ (int); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator -- (int); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator + (const Sphere & s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator - (const Sphere & s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator * (const Sphere & s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator / (const Sphere & s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator % (const Sphere & s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator + (Value r) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator - (Value r) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator * (Value r) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator / (Value r) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator % (Value r) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator + (const Vector3 & p) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator - (const Vector3 & p) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator * (const Vector3 & p) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator / (const Vector3 & p) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator % (const Vector3 & p) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator + () const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere operator - () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator == (const Sphere & s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator != (const Sphere & s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator < (const Sphere & s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator > (const Sphere & s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator <= (const Sphere & s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator >= (const Sphere & s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQInteger Cmp(const Sphere & s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ const SQChar * ToString() const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nr); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Sphere & ns); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector3 & np); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector3 & np, Value nr); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny, Value nz); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny, Value nz, Value nr); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value min, Value max, bool r); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value zmin, Value zmax); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value zmin, Value zmax, Value rmin, Value rmax); - // -------------------------------------------------------------------------------------------- - void Clear() { pos.Clear(); rad = 0.0; } - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ + void Clear() + { + pos.Clear(); rad = 0.0; + } + + /* -------------------------------------------------------------------------------------------- + * ... + */ Sphere Abs() const; }; diff --git a/source/Base/Vector2f.hpp b/source/Base/Vector2f.hpp index 17cdf27e..b854f8f5 100644 --- a/source/Base/Vector2f.hpp +++ b/source/Base/Vector2f.hpp @@ -12,98 +12,329 @@ namespace SqMod { */ struct Vector2f { - // -------------------------------------------------------------------------------------------- + /* -------------------------------------------------------------------------------------------- + * ... + */ typedef SQFloat Value; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static const Vector2f NIL; static const Vector2f MIN; static const Vector2f MAX; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static SQChar Delim; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Value x, y; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f(Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f(Value xv, Value yv); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f(const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f(const Vector2u & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f(const Vector2f & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f(Vector2f && v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ ~Vector2f(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator = (const Vector2f & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator = (Vector2f && v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator = (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator = (const SQChar * values); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator = (const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator = (const Vector2u & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator += (const Vector2f & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator -= (const Vector2f & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator *= (const Vector2f & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator /= (const Vector2f & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator %= (const Vector2f & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator += (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator -= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator *= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator /= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator %= (Value s); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator ++ (); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f & operator -- (); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator ++ (int); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator -- (int); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator + (const Vector2f & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator - (const Vector2f & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator * (const Vector2f & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator / (const Vector2f & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator % (const Vector2f & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator + (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator - (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator * (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator / (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator % (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator + () const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f operator - () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator == (const Vector2f & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator != (const Vector2f & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator < (const Vector2f & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator > (const Vector2f & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator <= (const Vector2f & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator >= (const Vector2f & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQInteger Cmp(const Vector2f & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ const SQChar * ToString() const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value ns); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector2f & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector2u & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value min, Value max); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value xmin, Value xmax, Value ymin, Value ymax); - // -------------------------------------------------------------------------------------------- - void Clear() { x = 0.0, y = 0.0; } - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ + void Clear() + { + x = 0.0, y = 0.0; + } + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2f Abs() const; }; diff --git a/source/Base/Vector2i.hpp b/source/Base/Vector2i.hpp index a0e9eb1b..72e04881 100644 --- a/source/Base/Vector2i.hpp +++ b/source/Base/Vector2i.hpp @@ -12,120 +12,434 @@ namespace SqMod { */ struct Vector2i { - // -------------------------------------------------------------------------------------------- + /* -------------------------------------------------------------------------------------------- + * ... + */ typedef SQInt32 Value; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static const Vector2i NIL; static const Vector2i MIN; static const Vector2i MAX; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static SQChar Delim; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Value x, y; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i(Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i(Value xv, Value yv); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i(const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i(const Vector2f & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i(const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i(Vector2i && v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ ~Vector2i(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator = (const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator = (Vector2i && v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator = (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator = (const SQChar * values); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator = (const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator = (const Vector2f & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator += (const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator -= (const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator *= (const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator /= (const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator %= (const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator &= (const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator |= (const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator ^= (const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator <<= (const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator >>= (const Vector2i & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator += (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator -= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator *= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator /= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator %= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator &= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator |= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator ^= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator <<= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator >>= (Value s); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator ++ (); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i & operator -- (); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator ++ (int); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator -- (int); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator + (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator - (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator * (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator / (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator % (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator & (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator | (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator ^ (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator << (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator >> (const Vector2i & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator + (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator - (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator * (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator / (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator % (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator & (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator | (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator ^ (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator << (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator >> (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator + () const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator - () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i operator ~ () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator == (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator != (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator < (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator > (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator <= (const Vector2i & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator >= (const Vector2i & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQInteger Cmp(const Vector2i & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ const SQChar * ToString() const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value ns); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector2f & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value min, Value max); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value xmin, Value xmax, Value ymin, Value ymax); - // -------------------------------------------------------------------------------------------- - void Clear() { x = 0, y = 0; } - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ + void Clear() + { + x = 0, y = 0; + } + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2i Abs() const; }; diff --git a/source/Base/Vector2u.hpp b/source/Base/Vector2u.hpp index 6fe4dc79..0dd488ec 100644 --- a/source/Base/Vector2u.hpp +++ b/source/Base/Vector2u.hpp @@ -12,128 +12,434 @@ namespace SqMod { */ struct Vector2u { - // -------------------------------------------------------------------------------------------- + /* -------------------------------------------------------------------------------------------- + * ... + */ typedef SQUnsignedInteger32 Value; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static const Vector2u NIL; static const Vector2u MIN; static const Vector2u MAX; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static SQChar Delim; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Value x, y; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u(Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u(Value xv, Value yv); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u(const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u(const Vector2f & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u(const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u(Vector2u && v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ ~Vector2u(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator = (const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator = (Vector2u && v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator = (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator = (const SQChar * values); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator = (const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator = (const Vector2f & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator += (const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator -= (const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator *= (const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator /= (const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator %= (const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator &= (const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator |= (const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator ^= (const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator <<= (const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator >>= (const Vector2u & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator += (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator -= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator *= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator /= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator %= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator &= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator |= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator ^= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator <<= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator >>= (Value s); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator ++ (); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u & operator -- (); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator ++ (int); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator -- (int); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator + (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator + (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator - (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator - (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator * (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator * (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator / (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator / (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator % (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator % (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator & (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator & (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator | (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator | (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator ^ (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator ^ (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator << (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator << (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator >> (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator >> (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator + () const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator - () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u operator ~ () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator == (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator != (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator < (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator > (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator <= (const Vector2u & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator >= (const Vector2u & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQInteger Cmp(const Vector2u & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ const SQChar * ToString() const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value ns); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector2u & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector2i & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector2f & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value min, Value max); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value xmin, Value xmax, Value ymin, Value ymax); - // -------------------------------------------------------------------------------------------- - void Clear() { x = 0, y = 0; } - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ + void Clear() + { + x = 0, y = 0; + } + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector2u Abs() const; }; diff --git a/source/Base/Vector3.hpp b/source/Base/Vector3.hpp index 343e0eb4..a83680a4 100644 --- a/source/Base/Vector3.hpp +++ b/source/Base/Vector3.hpp @@ -12,97 +12,324 @@ namespace SqMod { */ struct Vector3 { - // -------------------------------------------------------------------------------------------- + /* -------------------------------------------------------------------------------------------- + * ... + */ typedef SQFloat Value; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static const Vector3 NIL; static const Vector3 MIN; static const Vector3 MAX; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static SQChar Delim; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Value x, y, z; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3(Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3(Value xv, Value yv, Value zv); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3(const Vector4 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3(const Quaternion & q); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3(const SQChar * values, char delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3(const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3(Vector3 && v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ ~Vector3(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator = (const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator = (Vector3 && v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator = (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator = (const Vector4 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator = (const Quaternion & q); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator += (const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator -= (const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator *= (const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator /= (const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator %= (const Vector3 & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator += (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator -= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator *= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator /= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator %= (Value s); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator ++ (); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 & operator -- (); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator ++ (int); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator -- (int); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator + (const Vector3 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator - (const Vector3 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator * (const Vector3 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator / (const Vector3 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator % (const Vector3 & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator + (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator - (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator * (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator / (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator % (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator + () const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 operator - () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator == (const Vector3 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator != (const Vector3 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator < (const Vector3 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator > (const Vector3 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator <= (const Vector3 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator >= (const Vector3 & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQInteger Cmp(const Vector3 & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ const SQChar * ToString() const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value ns); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny, Value nz); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector4 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Quaternion & q); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const SQChar * values, char delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value min, Value max); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value zmin, Value zmax); - // -------------------------------------------------------------------------------------------- - void Clear() { x = 0.0, y = 0.0, z = 0.0; } - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ + void Clear() + { + x = 0.0, y = 0.0, z = 0.0; + } + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector3 Abs() const; }; diff --git a/source/Base/Vector4.hpp b/source/Base/Vector4.hpp index 63df59c6..e90cfc20 100644 --- a/source/Base/Vector4.hpp +++ b/source/Base/Vector4.hpp @@ -12,99 +12,335 @@ namespace SqMod { */ struct Vector4 { - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ typedef SQFloat Value; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static const Vector4 NIL; static const Vector4 MIN; static const Vector4 MAX; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ static SQChar Delim; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Value x, y, z, w; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4(Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4(Value xv, Value yv, Value zv); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4(Value xv, Value yv, Value zv, Value wv); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4(const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4(const Quaternion & q); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4(const Vector4 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4(Vector4 && v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ ~Vector4(); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator = (const Vector4 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator = (Vector4 && v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator = (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator = (const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator = (const Quaternion & q); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator += (const Vector4 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator -= (const Vector4 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator *= (const Vector4 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator /= (const Vector4 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator %= (const Vector4 & v); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator += (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator -= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator *= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator /= (Value s); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator %= (Value s); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator ++ (); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 & operator -- (); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator ++ (int); + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator -- (int); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator + (const Vector4 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator - (const Vector4 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator * (const Vector4 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator / (const Vector4 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator % (const Vector4 & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator + (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator - (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator * (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator / (Value s) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator % (Value s) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator + () const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 operator - () const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator == (const Vector4 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator != (const Vector4 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator < (const Vector4 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator > (const Vector4 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator <= (const Vector4 & v) const; + + /* -------------------------------------------------------------------------------------------- + * ... + */ bool operator >= (const Vector4 & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ SQInteger Cmp(const Vector4 & v) const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ const SQChar * ToString() const; - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value ns); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny, Value nz); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(Value nx, Value ny, Value nz, Value nw); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector4 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Vector3 & v); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const Quaternion & q); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Set(const SQChar * values, SQChar delim); - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value min, Value max); + + /* -------------------------------------------------------------------------------------------- + * ... + */ void Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value zmin, Value zmax, Value wmin, Value wmax); - // -------------------------------------------------------------------------------------------- - void Clear() { x = 0.0, y = 0.0, z = 0.0, w = 0.0; } - // -------------------------------------------------------------------------------------------- + + /* -------------------------------------------------------------------------------------------- + * ... + */ + void Clear() + { + x = 0.0, y = 0.0, z = 0.0, w = 0.0; + } + + /* -------------------------------------------------------------------------------------------- + * ... + */ Vector4 Abs() const; };