00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00031
00032 #pragma once
00033
00034 #include "../api_core.h"
00035 #include "../System/sharedptr.h"
00036
00037 class CL_Angle_Impl;
00038
00042 enum CL_AngleUnit
00043 {
00044 cl_degrees,
00045 cl_radians
00046 };
00047
00051 class CL_API_CORE CL_Angle
00052 {
00055 public:
00057 CL_Angle();
00058
00060 CL_Angle(float value, CL_AngleUnit unit);
00061
00067 static CL_Angle from_radians(float value);
00068
00074 static CL_Angle from_degrees(float value);
00075
00079 public:
00081 float to_degrees() const;
00082
00084 float to_radians() const;
00085
00089 public:
00091 void set_degrees(float degrees);
00092
00094 void set_radians(float radians);
00095
00097 void normalize();
00098
00100 void normalize_180();
00101
00105 public:
00107 void operator += (const CL_Angle &angle);
00108
00110 void operator -= (const CL_Angle &angle);
00111
00113 void operator *= (const CL_Angle &angle);
00114
00116 void operator /= (const CL_Angle &angle);
00117
00119 CL_Angle operator + (const CL_Angle &angle) const;
00120
00122 CL_Angle operator - (const CL_Angle &angle) const;
00123
00125 CL_Angle operator * (const CL_Angle &angle) const;
00126
00128 CL_Angle operator * (float value) const;
00129
00131 CL_Angle operator / (const CL_Angle &angle) const;
00132
00134 CL_Angle operator / (float value) const;
00135
00137 bool operator < (const CL_Angle &angle) const;
00138
00140 bool operator <= (const CL_Angle &angle) const;
00141
00143 bool operator > (const CL_Angle &angle) const;
00144
00146 bool operator >= (const CL_Angle &angle) const;
00147
00149 bool operator== (const CL_Angle &angle) const;
00150
00152 bool operator!= (const CL_Angle &angle) const;
00153
00157 private:
00158 float value_rad;
00159
00161 };
00162