1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00
SqMod/source/Base/Vector2f.hpp

344 lines
10 KiB
C++
Raw Normal View History

2015-09-30 02:56:11 +02:00
#ifndef _BASE_VECTOR2F_HPP_
#define _BASE_VECTOR2F_HPP_
// ------------------------------------------------------------------------------------------------
#include "Config.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
* ...
*/
struct Vector2f
{
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
typedef SQFloat Value;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
static const Vector2f NIL;
static const Vector2f MIN;
static const Vector2f MAX;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
static SQChar Delim;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
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);
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
~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;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2f Abs() const;
2015-09-30 02:56:11 +02:00
};
} // Namespace:: SqMod
#endif // _BASE_VECTOR2F_HPP_