1v13d/FxEngine/math/angle.h

65 lines
1.8 KiB
C++

#ifndef ANGLE_H
#define ANGLE_H
class FE_Angle
{
public:
FE_Angle();
FE_Angle(char angle);
FE_Angle(FE_Angle const& angle);
static void loadAll(); // précalcule les cosinus
FE_Angle& operator+=(const FE_Angle& a);
FE_Angle& operator+=(const char& a);
FE_Angle& operator++();
FE_Angle& operator-=(const FE_Angle& a);
FE_Angle& operator-=(const char& a);
FE_Angle& operator--();
FE_Angle& operator=(const char& a);
bool testEgalite(FE_Angle const& angle) const;
bool testEgalite(char const& angle) const;
bool testSuperieur(FE_Angle const& angle) const; // true si this > angle
bool testSuperieur(char const& angle) const;
float cos()const;
float sin()const;
float tan()const;
static float cos(char const angle);
static float sin(char const angle);
static float tan(char const angle);
static float cos(FE_Angle const& angle);
static float sin(FE_Angle const& angle);
static float tan(FE_Angle const& angle);
protected:
char m_currentValue;
static bool hasBeenLoadedBefore;
static double m_cos[256],m_sin[256],m_tan[256];
};
bool operator==(FE_Angle const& a, FE_Angle const& b);
bool operator>=(FE_Angle const& a, FE_Angle const& b);
bool operator<=(FE_Angle const& a, FE_Angle const& b);
bool operator> (FE_Angle const& a, FE_Angle const& b);
bool operator< (FE_Angle const& a, FE_Angle const& b);
bool operator==(FE_Angle const& a, char const& b);
bool operator>=(FE_Angle const& a, char const& b);
bool operator<=(FE_Angle const& a, char const& b);
bool operator> (FE_Angle const& a, char const& b);
bool operator< (FE_Angle const& a, char const& b);
FE_Angle operator+(FE_Angle const& a, FE_Angle const& b);
FE_Angle operator-(FE_Angle const& a, FE_Angle const& b);
FE_Angle operator+(FE_Angle const& a, char const& b);
FE_Angle operator-(FE_Angle const& a, char const& b);
#endif