namespace EE::Math

Overview

namespace Math {

// namespaces

namespace EE::Math::easing;

// typedefs

typedef tPoint1d<Float> Point1d;
typedef tPoint2d<Float> Point2d;
typedef Line2<Float> Line2f;
typedef tOriginPoint<Float> OriginPoint;
typedef Polygon2<Float> Polygon2f;
typedef Quad2<Float> Quad2f;
typedef tRECT<unsigned int> Rectu;
typedef tRECT<Float> Rectf;
typedef tRECT<int> Rect;
typedef tSize<int> Sizei;
typedef tSize<unsigned int> Sizeu;
typedef tSize<Float> Sizef;
typedef Triangle2<Float> Triangle2f;
typedef Vector2<Int32> Vector2if;
typedef Vector2<int> Vector2i;
typedef Vector2<Float> Vector2f;
typedef Vector2<double> Vector2d;
typedef Vector2<float> Vector2ff;
typedef Vector2<Uint32> Vector2u;
typedef Vector3<int> Vector3i;
typedef Vector3<Float> Vector3f;
typedef Vector3<double> Vector3d;
typedef Vector3<float> Vector3ff;

// classes

class Ease;
class Interpolation1d;
class Interpolation2d;

template <typename T>
class Line2;

class MTRand;
class PerlinNoise;

template <typename T>
class Polygon2;

template <typename T>
class Quad2;

class Transform;
class Transformable;

template <typename T>
class Triangle2;

template <typename T>
class Vector2;

template <typename T>
class Vector3;

template <typename T>
class tOriginPoint;

template <typename T>
class tPoint1d;

template <typename T>
class tPoint2d;

template <typename T>
class tRECT;

template <typename T>
class tSize;

// global functions

Uint32 setRandomSeed(Uint32 seed);
Float randf(const Float& fMin = 0.0f, const Float& fMax = 1.0f);
int randi(const int& fMin = 0, const int& fMax = 1);
Float cosAng(const Float& Ang);
Float sinAng(const Float& Ang);
Float tanAng(const Float& Ang);
Float radians(const Float& Ang);
Float degrees(const Float& Radians);

template <typename T>
T nextPowOfTwo(T Size);

template <typename T>
T isPow2(T v);

template <typename T>
T round(T r);

template <typename T>
T roundUp(T r);

template <typename T>
T roundDown(T x);

template <typename T>
static T countDigits(T num);

template <typename T>
bool operator==(const tRECT<T>& R1, const tRECT<T>& R2);

template <typename T>
bool operator!=(const tRECT<T>& R1, const tRECT<T>& R2);

template <typename T>
tRECT<T> operator+(const tRECT<T>& R, T X);

template <typename T>
tRECT<T>& operator+=(tRECT<T>& R, T X);

template <typename T>
tRECT<T> operator-(const tRECT<T>& R, T X);

template <typename T>
tRECT<T>& operator-=(tRECT<T>& R, T X);

template <typename T>
tRECT<T> operator+(const tRECT<T>& R, tRECT<T> X);

template <typename T>
tRECT<T>& operator+=(tRECT<T>& R, tRECT<T> X);

template <typename T>
tRECT<T> operator-(const tRECT<T>& R, tRECT<T> X);

template <typename T>
tRECT<T>& operator-=(tRECT<T>& R, tRECT<T> X);

template <typename T, typename Y>
tRECT<T> operator*(const tRECT<T>& R, Y X);

template <typename T, typename Y>
tRECT<T>& operator*=(tRECT<T>& R, Y X);

template <typename T, typename Y>
tRECT<T>& operator*(tRECT<T>& R, Y X);

template <typename T, typename Y>
tRECT<T> operator/(const tRECT<T>& R, Y X);

template <typename T, typename Y>
tRECT<T>& operator/=(tRECT<T>& R, Y X);

template <typename T, typename Y>
tRECT<T>& operator/(tRECT<T>& R, Y X);

template <typename T>
Vector2<T> operator-(Vector2<T> X, const tRECT<T>& R);

template <typename T>
Vector2<T> operator+(Vector2<T> X, const tRECT<T>& R);

EE_API Transform operator*(const Transform& left, const Transform& right);
EE_API Transform& operator*=(Transform& left, const Transform& right);
EE_API Vector2f operator*(const Transform& left, const Vector2f& right);
EE_API bool operator==(const Transform& left, const Transform& right);
EE_API bool operator!=(const Transform& left, const Transform& right);

template <typename T>
Vector2<T> operator-(const Vector2<T>& V);

template <typename T>
Vector2<T>& operator+=(Vector2<T>& V1, const Vector2<T>& V2);

template <typename T>
Vector2<T>& operator-=(Vector2<T>& V1, const Vector2<T>& V2);

template <typename T>
Vector2<T> operator+(const Vector2<T>& V1, const Vector2<T>& V2);

template <typename T>
Vector2<T> operator+(const Vector2<T>& V1, T X);

template <typename T>
Vector2<T> operator-(const Vector2<T>& V1, const Vector2<T>& V2);

template <typename T>
Vector2<T> operator-(const Vector2<T>& V1, T X);

template <typename T>
Vector2<T> operator*(const Vector2<T>& V, T X);

template <typename T>
Vector2<T> operator*(T X, const Vector2<T>& V);

template <typename T>
Vector2<T> operator*(const Vector2<T>& V1, const Vector2<T>& V2);

template <typename T>
Vector2<T>& operator*=(Vector2<T>& V, T X);

template <typename T>
Vector2<T>& operator*=(Vector2<T>& V, const Vector2<T>& V2);

template <typename T>
Vector2<T> operator/(const Vector2<T>& V1, const Vector2<T>& V2);

template <typename T>
Vector2<T> operator/(const Vector2<T>& V, T X);

template <typename T>
Vector2<T>& operator/=(Vector2<T>& V, T X);

template <typename T>
bool operator==(const Vector2<T>& V1, const Vector2<T>& V2);

template <typename T>
bool operator==(const Vector2<T>& V1, const T& V);

template <typename T>
bool operator==(const T& V, const Vector2<T>& V1);

template <typename T>
bool operator!=(const Vector2<T>& V1, const Vector2<T>& V2);

template <typename T>
bool operator!=(const Vector2<T>& V1, const T& V);

template <typename T>
bool operator!=(const T& V, const Vector2<T>& V1);

template <typename T>
bool operator<(const Vector2<T>& V1, const Vector2<T>& V2);

template <typename T>
bool operator>(const Vector2<T>& V1, const Vector2<T>& V2);

template <typename T>
bool operator<=(const Vector2<T>& V1, const Vector2<T>& V2);

template <typename T>
bool operator>=(const Vector2<T>& V1, const Vector2<T>& V2);

template <typename T>
Vector3<T> operator-(const Vector3<T>& V);

template <typename T>
Vector3<T>& operator+=(Vector3<T>& V1, const Vector3<T>& V2);

template <typename T>
Vector3<T>& operator-=(Vector3<T>& V1, const Vector3<T>& V2);

template <typename T>
Vector3<T> operator+(const Vector3<T>& V1, const Vector3<T>& V2);

template <typename T>
Vector3<T> operator-(const Vector3<T>& V1, const Vector3<T>& V2);

template <typename T>
Vector3<T> operator*(const Vector3<T>& V, T X);

template <typename T>
Vector3<T> operator*(T X, const Vector3<T>& V);

template <typename T>
Vector3<T>& operator*=(Vector3<T>& V, T X);

template <typename T>
Vector3<T> operator/(const Vector3<T>& V, T X);

template <typename T>
Vector3<T>& operator/=(Vector3<T>& V, T X);

template <typename T>
bool operator==(const Vector3<T>& V1, const Vector3<T>& V2);

template <typename T>
bool operator!=(const Vector3<T>& V1, const Vector3<T>& V2);

} // namespace Math

Detailed Documentation

Global Functions

Uint32 setRandomSeed(Uint32 seed)

Set a Random Seed to the Randomizer

Float randf(const Float& fMin = 0.0f, const Float& fMax = 1.0f)

Generate a floating point random number

Parameters:

fMin

The minimun value

fMax

the maximun value

Returns:

The random number generated

int randi(const int& fMin = 0, const int& fMax = 1)

Generate a integer random number

Parameters:

fMin

The minimun value

fMax

the maximun value

Returns:

The random number generated

Float cosAng(const Float& Ang)

Cosine from an Angle in Degress

Float sinAng(const Float& Ang)

Sinus from an Angle in Degress

Float tanAng(const Float& Ang)

Tangen from an Angle in Degress

Float radians(const Float& Ang)

Convert an Angle from Degrees to Radians

Float degrees(const Float& Radians)

Convert an Angle from Math::Radians to Degrees

template <typename T>
T nextPowOfTwo(T Size)

Returns:

The next power of two of the given Size

template <typename T>
T isPow2(T v)

Returns:

If the number given is power of two

template <typename T>
T round(T r)

Round the number

template <typename T>
T roundUp(T r)

Round the number always to the upper value

template <typename T>
T roundDown(T x)

Round the number always to the lower value

template <typename T>
static T countDigits(T num)

Returns:

The number of digits in a number.