From fb3a41995a7255925da1e4e07d07e47ab871a689 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 25 Jan 2012 18:36:04 +0000 Subject: [PATCH] Ticket #137, added constexpr support --- glm/core/_detail.hpp | 7 ++++++ glm/core/type_mat2x2.hpp | 14 +++++------ glm/core/type_mat2x2.inl | 2 +- glm/core/type_mat2x3.hpp | 7 +++--- glm/core/type_mat2x3.inl | 2 +- glm/core/type_mat2x4.hpp | 7 +++--- glm/core/type_mat2x4.inl | 2 +- glm/core/type_mat3x2.hpp | 7 +++--- glm/core/type_mat3x2.inl | 2 +- glm/core/type_mat3x3.hpp | 7 +++--- glm/core/type_mat3x3.inl | 2 +- glm/core/type_mat3x4.hpp | 7 +++--- glm/core/type_mat3x4.inl | 2 +- glm/core/type_mat4x2.hpp | 7 +++--- glm/core/type_mat4x2.inl | 2 +- glm/core/type_mat4x3.hpp | 7 +++--- glm/core/type_mat4x3.inl | 2 +- glm/core/type_mat4x4.hpp | 7 +++--- glm/core/type_mat4x4.inl | 2 +- glm/core/type_vec1.hpp | 4 ++-- glm/core/type_vec1.inl | 2 +- glm/core/type_vec2.hpp | 4 ++-- glm/core/type_vec2.inl | 2 +- glm/core/type_vec3.hpp | 4 ++-- glm/core/type_vec3.inl | 2 +- glm/core/type_vec4.hpp | 4 ++-- glm/core/type_vec4.inl | 2 +- glm/gtc/reciprocal.hpp | 2 +- glm/gtc/ulp.hpp | 2 +- glm/gtx/constants.hpp | 50 ++++++++++++++++++++-------------------- glm/gtx/constants.inl | 50 ++++++++++++++++++++-------------------- 31 files changed, 119 insertions(+), 104 deletions(-) diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index b842dea2..ecc9250e 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -444,6 +444,7 @@ namespace detail # define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct # define GLM_RESTRICT __declspec(restrict) # define GLM_RESTRICT_VAR __restrict +# define GLM_CONSTEXPR #elif((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) # define GLM_DEPRECATED __attribute__((__deprecated__)) # define GLM_ALIGN(x) __attribute__((aligned(x))) @@ -457,12 +458,18 @@ namespace detail # endif # define GLM_RESTRICT __restrict__ # define GLM_RESTRICT_VAR __restrict__ +# if((GLM_COMPILER >= GLM_COMPILER_GCC47) && ((GLM_LANG & GLM_LANG_CXX0X) == GLM_LANG_CXX0X)) +# define GLM_CONSTEXPR constexpr +# else +# define GLM_CONSTEXPR +# endif #else # define GLM_DEPRECATED # define GLM_ALIGN # define GLM_ALIGNED_STRUCT(x) # define GLM_RESTRICT # define GLM_RESTRICT_VAR +# define GLM_CONSTEXPR #endif//GLM_COMPILER #endif//glm_core_detail diff --git a/glm/core/type_mat2x2.hpp b/glm/core/type_mat2x2.hpp index 0f0c9669..14c7ecd5 100644 --- a/glm/core/type_mat2x2.hpp +++ b/glm/core/type_mat2x2.hpp @@ -53,27 +53,27 @@ namespace detail template struct tmat2x2 { - // Implementation detail + // Implementation detail enum ctor{null}; typedef T value_type; typedef std::size_t size_type; typedef tvec2 col_type; typedef tvec2 row_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); - typedef tmat2x2 type; typedef tmat2x2 transpose_type; + + static GLM_FUNC_DECL size_type col_size(); + static GLM_FUNC_DECL size_type row_size(); - GLM_FUNC_DECL size_type length() const; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; public: - // Implementation detail + // Implementation detail GLM_FUNC_DECL tmat2x2 _inverse() const; private: ////////////////////////////////////// - // Implementation detail + // Implementation detail col_type value[2]; public: diff --git a/glm/core/type_mat2x2.inl b/glm/core/type_mat2x2.inl index a6227297..41630804 100644 --- a/glm/core/type_mat2x2.inl +++ b/glm/core/type_mat2x2.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tmat2x2::size_type tmat2x2::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2::size_type tmat2x2::length() const { return 2; } diff --git a/glm/core/type_mat2x3.hpp b/glm/core/type_mat2x3.hpp index e69828b6..aebf99cc 100644 --- a/glm/core/type_mat2x3.hpp +++ b/glm/core/type_mat2x3.hpp @@ -58,12 +58,13 @@ namespace detail typedef std::size_t size_type; typedef tvec3 col_type; typedef tvec2 row_type; - GLM_FUNC_DECL size_type length() const; + typedef tmat2x3 type; + typedef tmat3x2 transpose_type; + static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); - typedef tmat2x3 type; - typedef tmat3x2 transpose_type; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; private: // Data diff --git a/glm/core/type_mat2x3.inl b/glm/core/type_mat2x3.inl index 49246087..96a82f17 100644 --- a/glm/core/type_mat2x3.inl +++ b/glm/core/type_mat2x3.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tmat2x3::size_type tmat2x3::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3::size_type tmat2x3::length() const { return 2; } diff --git a/glm/core/type_mat2x4.hpp b/glm/core/type_mat2x4.hpp index 7740a3d3..8c1f5c59 100644 --- a/glm/core/type_mat2x4.hpp +++ b/glm/core/type_mat2x4.hpp @@ -58,12 +58,13 @@ namespace detail typedef std::size_t size_type; typedef tvec4 col_type; typedef tvec2 row_type; - GLM_FUNC_DECL size_type length() const; + typedef tmat2x4 type; + typedef tmat4x2 transpose_type; + static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); - typedef tmat2x4 type; - typedef tmat4x2 transpose_type; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; private: // Data diff --git a/glm/core/type_mat2x4.inl b/glm/core/type_mat2x4.inl index 39c82251..1fe4194d 100644 --- a/glm/core/type_mat2x4.inl +++ b/glm/core/type_mat2x4.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tmat2x4::size_type tmat2x4::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4::size_type tmat2x4::length() const { return 2; } diff --git a/glm/core/type_mat3x2.hpp b/glm/core/type_mat3x2.hpp index 2e9a0823..117a82f2 100644 --- a/glm/core/type_mat3x2.hpp +++ b/glm/core/type_mat3x2.hpp @@ -58,12 +58,13 @@ namespace detail typedef std::size_t size_type; typedef tvec2 col_type; typedef tvec3 row_type; - GLM_FUNC_DECL size_type length() const; + typedef tmat3x2 type; + typedef tmat2x3 transpose_type; + static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); - typedef tmat3x2 type; - typedef tmat2x3 transpose_type; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; private: // Data diff --git a/glm/core/type_mat3x2.inl b/glm/core/type_mat3x2.inl index 05c7ed61..33a90e81 100644 --- a/glm/core/type_mat3x2.inl +++ b/glm/core/type_mat3x2.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tmat3x2::size_type tmat3x2::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2::size_type tmat3x2::length() const { return 3; } diff --git a/glm/core/type_mat3x3.hpp b/glm/core/type_mat3x3.hpp index a4cbd95e..2ae56b3a 100644 --- a/glm/core/type_mat3x3.hpp +++ b/glm/core/type_mat3x3.hpp @@ -58,12 +58,13 @@ namespace detail typedef std::size_t size_type; typedef tvec3 col_type; typedef tvec3 row_type; - GLM_FUNC_DECL size_type length() const; + typedef tmat3x3 type; + typedef tmat3x3 transpose_type; + static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); - typedef tmat3x3 type; - typedef tmat3x3 transpose_type; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; public: /// Implementation detail diff --git a/glm/core/type_mat3x3.inl b/glm/core/type_mat3x3.inl index d94ad05c..95ba360d 100644 --- a/glm/core/type_mat3x3.inl +++ b/glm/core/type_mat3x3.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tmat3x3::size_type tmat3x3::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3::size_type tmat3x3::length() const { return 3; } diff --git a/glm/core/type_mat3x4.hpp b/glm/core/type_mat3x4.hpp index 34cf48a6..af131102 100644 --- a/glm/core/type_mat3x4.hpp +++ b/glm/core/type_mat3x4.hpp @@ -58,12 +58,13 @@ namespace detail typedef std::size_t size_type; typedef tvec4 col_type; typedef tvec3 row_type; - GLM_FUNC_DECL size_type length() const; + typedef tmat3x4 type; + typedef tmat4x3 transpose_type; + static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); - typedef tmat3x4 type; - typedef tmat4x3 transpose_type; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; private: // Data diff --git a/glm/core/type_mat3x4.inl b/glm/core/type_mat3x4.inl index caf5a8b9..29e446cc 100644 --- a/glm/core/type_mat3x4.inl +++ b/glm/core/type_mat3x4.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tmat3x4::size_type tmat3x4::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4::size_type tmat3x4::length() const { return 3; } diff --git a/glm/core/type_mat4x2.hpp b/glm/core/type_mat4x2.hpp index d6a264d3..1f131254 100644 --- a/glm/core/type_mat4x2.hpp +++ b/glm/core/type_mat4x2.hpp @@ -58,12 +58,13 @@ namespace detail typedef std::size_t size_type; typedef tvec2 col_type; typedef tvec4 row_type; - GLM_FUNC_DECL size_type length() const; + typedef tmat4x2 type; + typedef tmat2x4 transpose_type; + static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); - typedef tmat4x2 type; - typedef tmat2x4 transpose_type; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; private: // Data diff --git a/glm/core/type_mat4x2.inl b/glm/core/type_mat4x2.inl index 582bb3c8..f522ae8c 100644 --- a/glm/core/type_mat4x2.inl +++ b/glm/core/type_mat4x2.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tmat4x2::size_type tmat4x2::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2::size_type tmat4x2::length() const { return 4; } diff --git a/glm/core/type_mat4x3.hpp b/glm/core/type_mat4x3.hpp index aaf8f1cd..ead8cfb2 100644 --- a/glm/core/type_mat4x3.hpp +++ b/glm/core/type_mat4x3.hpp @@ -58,12 +58,13 @@ namespace detail typedef std::size_t size_type; typedef tvec3 col_type; typedef tvec4 row_type; - GLM_FUNC_DECL size_type length() const; + typedef tmat4x3 type; + typedef tmat3x4 transpose_type; + static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); - typedef tmat4x3 type; - typedef tmat3x4 transpose_type; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; private: // Data diff --git a/glm/core/type_mat4x3.inl b/glm/core/type_mat4x3.inl index badd92eb..5846bde1 100644 --- a/glm/core/type_mat4x3.inl +++ b/glm/core/type_mat4x3.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tmat4x3::size_type tmat4x3::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3::size_type tmat4x3::length() const { return 4; } diff --git a/glm/core/type_mat4x4.hpp b/glm/core/type_mat4x4.hpp index 5599a206..607d3d3c 100644 --- a/glm/core/type_mat4x4.hpp +++ b/glm/core/type_mat4x4.hpp @@ -58,12 +58,13 @@ namespace detail typedef std::size_t size_type; typedef tvec4 col_type; typedef tvec4 row_type; - GLM_FUNC_DECL size_type length() const; + typedef tmat4x4 type; + typedef tmat4x4 transpose_type; + static GLM_FUNC_DECL size_type col_size(); static GLM_FUNC_DECL size_type row_size(); - typedef tmat4x4 type; - typedef tmat4x4 transpose_type; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; public: /// Implementation detail diff --git a/glm/core/type_mat4x4.inl b/glm/core/type_mat4x4.inl index 47cc30a6..838fb993 100644 --- a/glm/core/type_mat4x4.inl +++ b/glm/core/type_mat4x4.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tmat4x4::size_type tmat4x4::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4::size_type tmat4x4::length() const { return 4; } diff --git a/glm/core/type_vec1.hpp b/glm/core/type_vec1.hpp index 2011e3ff..862dbc37 100644 --- a/glm/core/type_vec1.hpp +++ b/glm/core/type_vec1.hpp @@ -54,11 +54,11 @@ namespace detail typedef T value_type; typedef std::size_t size_type; - GLM_FUNC_DECL size_type length() const; - typedef tvec1 type; typedef tvec1 bool_type; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; + ////////////////////////////////////// // Data diff --git a/glm/core/type_vec1.inl b/glm/core/type_vec1.inl index 781f89da..7214bf2f 100644 --- a/glm/core/type_vec1.inl +++ b/glm/core/type_vec1.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tvec1::size_type tvec1::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec1::size_type tvec1::length() const { return 1; } diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index 00972536..597cba12 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -53,11 +53,11 @@ namespace detail typedef T value_type; typedef std::size_t size_type; - GLM_FUNC_DECL size_type length() const; - typedef tvec2 type; typedef tvec2 bool_type; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; + ////////////////////////////////////// // Data diff --git a/glm/core/type_vec2.inl b/glm/core/type_vec2.inl index ac2b0b5e..1a3ef2ca 100644 --- a/glm/core/type_vec2.inl +++ b/glm/core/type_vec2.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tvec2::size_type tvec2::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec2::size_type tvec2::length() const { return 2; } diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp index 3177b342..59dc49fc 100644 --- a/glm/core/type_vec3.hpp +++ b/glm/core/type_vec3.hpp @@ -53,11 +53,11 @@ namespace detail typedef T value_type; typedef std::size_t size_type; - GLM_FUNC_DECL size_type length() const; - typedef tvec3 type; typedef tvec3 bool_type; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; + ////////////////////////////////////// // Data diff --git a/glm/core/type_vec3.inl b/glm/core/type_vec3.inl index 3fe670b6..566266a9 100644 --- a/glm/core/type_vec3.inl +++ b/glm/core/type_vec3.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tvec3::size_type tvec3::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec3::size_type tvec3::length() const { return 3; } diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 31cd9940..8aad76f9 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -53,11 +53,11 @@ namespace detail typedef T value_type; typedef std::size_t size_type; - GLM_FUNC_DECL size_type length() const; - typedef tvec4 type; typedef tvec4 bool_type; + GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const; + ////////////////////////////////////// // Data diff --git a/glm/core/type_vec4.inl b/glm/core/type_vec4.inl index b8ca8427..8944c9db 100644 --- a/glm/core/type_vec4.inl +++ b/glm/core/type_vec4.inl @@ -30,7 +30,7 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER typename tvec4::size_type tvec4::length() const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec4::size_type tvec4::length() const { return 4; } diff --git a/glm/gtc/reciprocal.hpp b/glm/gtc/reciprocal.hpp index 641bec14..fa777793 100644 --- a/glm/gtc/reciprocal.hpp +++ b/glm/gtc/reciprocal.hpp @@ -32,7 +32,7 @@ /// /// @brief Define secant, cosecant and cotangent functions. /// -/// need to be included to use these functionalities. +/// need to be included to use these features. /////////////////////////////////////////////////////////////////////////////////// #ifndef GLM_GTC_reciprocal diff --git a/glm/gtc/ulp.hpp b/glm/gtc/ulp.hpp index efcb4a5c..33e54b9b 100644 --- a/glm/gtc/ulp.hpp +++ b/glm/gtc/ulp.hpp @@ -33,7 +33,7 @@ /// @brief Allow the measurement of the accuracy of a function against a reference /// implementation. This extension works on floating-point data and provide results /// in ULP. -/// need to be included to use these functionalities. +/// need to be included to use these features. /////////////////////////////////////////////////////////////////////////////////// #ifndef GLM_GTC_ulp diff --git a/glm/gtx/constants.hpp b/glm/gtx/constants.hpp index 173af69e..cf85e4e7 100644 --- a/glm/gtx/constants.hpp +++ b/glm/gtx/constants.hpp @@ -56,127 +56,127 @@ namespace glm /// @todo Implement epsilon for half-precision floating point type. /// @see gtx_constants template - T epsilon(); + GLM_CONSTEXPR T epsilon(); /// Return 0. /// @see gtx_constants template - T zero(); + GLM_CONSTEXPR T zero(); /// Return 1. /// @see gtx_constants template - T one(); + GLM_CONSTEXPR T one(); /// Return the pi constant. /// @see gtx_constants template - T pi(); + GLM_CONSTEXPR T pi(); /// Return square root of pi. /// @see gtx_constants template - T root_pi(); + GLM_CONSTEXPR T root_pi(); /// Return pi / 2. /// @see gtx_constants template - T half_pi(); + GLM_CONSTEXPR T half_pi(); /// Return pi / 4. /// @see gtx_constants template - T quarter_pi(); + GLM_CONSTEXPR T quarter_pi(); /// Return 1 / pi. /// @see gtx_constants template - T one_over_pi(); + GLM_CONSTEXPR T one_over_pi(); /// Return 2 / pi. /// @see gtx_constants template - T two_over_pi(); + GLM_CONSTEXPR T two_over_pi(); /// Return 2 / sqrt(pi). /// @see gtx_constants template - T two_over_root_pi(); + GLM_CONSTEXPR T two_over_root_pi(); /// Return 1 / sqrt(2). /// @see gtx_constants template - T one_over_root_two(); + GLM_CONSTEXPR T one_over_root_two(); /// Return sqrt(pi / 2). /// @see gtx_constants template - T root_half_pi(); + GLM_CONSTEXPR T root_half_pi(); /// Return sqrt(2 * pi). /// @see gtx_constants template - T root_two_pi(); + GLM_CONSTEXPR T root_two_pi(); /// Return sqrt(ln(4)). /// @see gtx_constants template - T root_ln_four(); + GLM_CONSTEXPR T root_ln_four(); /// Return e constant. /// @see gtx_constants template - T e(); + GLM_CONSTEXPR T e(); /// Return Euler's constant. /// @see gtx_constants template - T euler(); + GLM_CONSTEXPR T euler(); /// Return sqrt(2). /// @see gtx_constants template - T root_two(); + GLM_CONSTEXPR T root_two(); /// Return sqrt(3). /// @see gtx_constants template - T root_three(); + GLM_CONSTEXPR T root_three(); /// Return sqrt(5). /// @see gtx_constants template - T root_five(); + GLM_CONSTEXPR T root_five(); /// Return ln(2). /// @see gtx_constants template - T ln_two(); + GLM_CONSTEXPR T ln_two(); /// Return ln(10). /// @see gtx_constants template - T ln_ten(); + GLM_CONSTEXPR T ln_ten(); /// Return ln(ln(2)). /// @see gtx_constants template - T ln_ln_two(); + GLM_CONSTEXPR T ln_ln_two(); /// Return 1 / 3. /// @see gtx_constants template - T third(); + GLM_CONSTEXPR T third(); /// Return 2 / 3. /// @see gtx_constants template - T two_thirds(); + GLM_CONSTEXPR T two_thirds(); /// Return the golden ratio constant. /// @see gtx_constants template - T golden_ratio(); + GLM_CONSTEXPR T golden_ratio(); /// @} } //namespace glm diff --git a/glm/gtx/constants.inl b/glm/gtx/constants.inl index 7494875d..2b3f2354 100644 --- a/glm/gtx/constants.inl +++ b/glm/gtx/constants.inl @@ -29,151 +29,151 @@ namespace glm { template - GLM_FUNC_QUALIFIER T epsilon() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T epsilon() { return std::numeric_limits::epsilon(); } template - GLM_FUNC_QUALIFIER T zero() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T zero() { return T(0); } template - GLM_FUNC_QUALIFIER T one() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T one() { return T(1); } template - GLM_FUNC_QUALIFIER T pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T pi() { return T(3.14159265358979323846264338327950288); } template - GLM_FUNC_QUALIFIER T root_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_pi() { return T(1.772453850905516027); } template - GLM_FUNC_QUALIFIER T half_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T half_pi() { return T(1.57079632679489661923132169163975144); } template - GLM_FUNC_QUALIFIER T quarter_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T quarter_pi() { return T(0.785398163397448309615660845819875721); } template - GLM_FUNC_QUALIFIER T one_over_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T one_over_pi() { return T(0.318309886183790671537767526745028724); } template - GLM_FUNC_QUALIFIER T two_over_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T two_over_pi() { return T(0.636619772367581343075535053490057448); } template - GLM_FUNC_QUALIFIER T two_over_root_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T two_over_root_pi() { return T(1.12837916709551257389615890312154517); } template - GLM_FUNC_QUALIFIER T one_over_root_two() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T one_over_root_two() { return T(0.707106781186547524400844362104849039); } template - GLM_FUNC_QUALIFIER T root_half_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_half_pi() { return T(1.253314137315500251); } template - GLM_FUNC_QUALIFIER T root_two_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_two_pi() { return T(2.506628274631000502); } template - GLM_FUNC_QUALIFIER T root_ln_four() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_ln_four() { return T(1.17741002251547469); } template - GLM_FUNC_QUALIFIER T e() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T e() { return T(2.71828182845904523536); } template - GLM_FUNC_QUALIFIER T euler() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T euler() { return T(0.577215664901532860606); } template - GLM_FUNC_QUALIFIER T root_two() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_two() { return T(1.41421356237309504880168872420969808); } template - GLM_FUNC_QUALIFIER T root_three() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_three() { return T(1.73205080756887729352744634150587236); } template - GLM_FUNC_QUALIFIER T root_five() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_five() { return T(2.23606797749978969640917366873127623); } template - GLM_FUNC_QUALIFIER T ln_two() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T ln_two() { return T(0.693147180559945309417232121458176568); } template - GLM_FUNC_QUALIFIER T ln_ten() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T ln_ten() { return T(2.30258509299404568401799145468436421); } template - GLM_FUNC_QUALIFIER T ln_ln_two() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T ln_ln_two() { return T(-0.3665129205816643); } template - GLM_FUNC_QUALIFIER T third() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T third() { return T(0.3333333333333333333333333333333333333333); } template - GLM_FUNC_QUALIFIER T two_thirds() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T two_thirds() { return T(0.666666666666666666666666666666666666667); } template - GLM_FUNC_QUALIFIER T golden_ratio() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T golden_ratio() { return T(1.61803398874989484820458683436563811); }