diff --git a/glm/core/dummy.cpp b/glm/core/dummy.cpp index 07b5f15a..fd228c8c 100644 --- a/glm/core/dummy.cpp +++ b/glm/core/dummy.cpp @@ -33,53 +33,8 @@ #include "../glm.hpp" /* -template -class angle -{ -public: - typedef T value_type; - - angle(value_type const & x) : - data(x) - {} - -private: - value_type data; -}; - -typedef angle angle16; -typedef angle angle32; -typedef angle angle64; - -GLM_FUNC_DECL angle operator "" _rad_f(long double const radians) -{ - return static_cast(radians); -} - -GLM_FUNC_DECL angle operator "" _rad(long double const radians) -{ - return static_cast(radians); -} -GLM_FUNC_DECL angle operator "" _rad_l(long double const radians) -{ - return radians; -} - -GLM_FUNC_DECL angle operator "" _deg_f(long double const degrees) -{ - return static_cast(degrees) * static_cast(0.01745329251994329576923690768489L); -} - -GLM_FUNC_DECL angle operator "" _deg(long double const degrees) -{ - return static_cast(degrees) * static_cast(0.01745329251994329576923690768489L); -} - -GLM_FUNC_DECL angle operator "" _deg_l(long double const degrees) -{ - return degrees * 0.01745329251994329576923690768489L; -}*/ +*/ int main() { diff --git a/glm/gtc/angle.hpp b/glm/gtc/angle.hpp index bed3c9a3..f267039c 100644 --- a/glm/gtc/angle.hpp +++ b/glm/gtc/angle.hpp @@ -20,34 +20,75 @@ /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN /// THE SOFTWARE. /// -/// @ref core -/// @file glm/core/_angles.hpp -/// @date 2013-05-06 / 2013-05-06 +/// @ref gtc_angle +/// @file glm/gtc/angle.hpp +/// @date 2013-05-07 / 2012-05-07 /// @author Christophe Riccio +/// +/// @see core (dependence) +/// @see gtc_angle (dependence) +/// +/// @defgroup gtc_angle GLM_GTC_angle +/// @ingroup gtc +/// +/// @brief Handling angles in both radians and degrees. +/// +/// need to be included to use these features. /////////////////////////////////////////////////////////////////////////////////// -#ifndef glm_core_angles -#define glm_core_angles +#ifndef GLM_GTC_angle +#define GLM_GTC_angle GLM_VERSION namespace glm { template - class deg + class angle { public: + typedef T value_type; + angle(value_type const & x) : + data(x) + {} private: - T data; + value_type data; }; - template - T operator ""_deg(T const & degrees) - { - // returns radians - return degrees * T(0.01745329251994329576923690768489); + typedef angle angle16; + typedef angle angle32; + typedef angle angle64; + + GLM_FUNC_DECL angle operator "" _rad_f(long double const radians) + { + return static_cast(radians); + } + + GLM_FUNC_DECL angle operator "" _rad(long double const radians) + { + return static_cast(radians); + } + + GLM_FUNC_DECL angle operator "" _rad_l(long double const radians) + { + return radians; + } + + GLM_FUNC_DECL angle operator "" _deg_f(long double const degrees) + { + return static_cast(degrees) * static_cast(0.01745329251994329576923690768489L); + } + + GLM_FUNC_DECL angle operator "" _deg(long double const degrees) + { + return static_cast(degrees) * static_cast(0.01745329251994329576923690768489L); + } + + GLM_FUNC_DECL angle operator "" _deg_l(long double const degrees) + { + return degrees * 0.01745329251994329576923690768489L; } }//namespace glm -#endif//glm_core_angles +#endif//GLM_GTC_angle