From 4a4af0b80e1e798be8f4bac6c6eaa57e4d008a49 Mon Sep 17 00:00:00 2001 From: Chris Helmich Date: Mon, 22 Jan 2018 11:28:55 +0900 Subject: [PATCH 1/7] added flags GLM_CONSTEXPR_CXX14 and GLM_CONSTEXPR_CTOR_CXX14 --- glm/detail/setup.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 8969678c..58cf0b2a 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -742,6 +742,14 @@ # define GLM_RELAXED_CONSTEXPR const #endif +#if GLM_LANG >= GLM_LANG_CXX14 +# define GLM_CONSTEXPR_CXX14 GLM_CONSTEXPR +# define GLM_CONSTEXPR_CTOR_CXX14 GLM_CONSTEXPR_CTOR +#else +# define GLM_CONSTEXPR_CXX14 +# define GLM_CONSTEXPR_CTOR_CXX14 +#endif + #if GLM_ARCH == GLM_ARCH_PURE # define GLM_CONSTEXPR_SIMD GLM_CONSTEXPR_CTOR #else From dee4f81bc746244d724e78e7cbe4ab12fb04282f Mon Sep 17 00:00:00 2001 From: Chris Helmich Date: Mon, 22 Jan 2018 11:29:00 +0900 Subject: [PATCH 2/7] added GLM_CONSTEXPR_CTOR_CXX14 flags to mat<>::ctors() --- glm/detail/type_mat2x2.hpp | 36 +++++++++++------------ glm/detail/type_mat2x2.inl | 34 ++++++++++----------- glm/detail/type_mat2x3.hpp | 36 +++++++++++------------ glm/detail/type_mat2x3.inl | 34 ++++++++++----------- glm/detail/type_mat2x4.hpp | 36 +++++++++++------------ glm/detail/type_mat2x4.inl | 34 ++++++++++----------- glm/detail/type_mat3x2.hpp | 36 +++++++++++------------ glm/detail/type_mat3x2.inl | 50 +++++++++++++++---------------- glm/detail/type_mat3x3.hpp | 36 +++++++++++------------ glm/detail/type_mat3x3.inl | 60 +++++++++++++++++++------------------- glm/detail/type_mat3x4.hpp | 36 +++++++++++------------ glm/detail/type_mat3x4.inl | 46 ++++++++++++++--------------- glm/detail/type_mat4x2.hpp | 36 +++++++++++------------ glm/detail/type_mat4x2.inl | 38 ++++++++++++------------ glm/detail/type_mat4x3.hpp | 36 +++++++++++------------ glm/detail/type_mat4x3.inl | 36 +++++++++++------------ glm/detail/type_mat4x4.hpp | 36 +++++++++++------------ glm/detail/type_mat4x4.inl | 40 ++++++++++++------------- 18 files changed, 348 insertions(+), 348 deletions(-) diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 1d64c059..82e68d84 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -34,44 +34,44 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<2, 2, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat(mat<2, 2, T, P> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, P> const& m); - GLM_FUNC_DECL explicit mat(T scalar); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( T const& x1, T const& y1, T const& x2, T const& y2); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( col_type const& v1, col_type const& v2); // -- Conversions -- template - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( U const& x1, V const& y1, M const& x2, N const& y2); template - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( vec<2, U, Q> const& v1, vec<2, V, Q> const& v2); // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index 011344bf..7eea2cbe 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -9,13 +9,13 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -24,21 +24,21 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 2, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<2, 2, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0); this->value[1] = col_type(0, scalar); } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat ( T const& x0, T const& y0, T const& x1, T const& y1 @@ -49,7 +49,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(col_type const& v0, col_type const& v1) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(col_type const& v0, col_type const& v1) { this->value[0] = v0; this->value[1] = v1; @@ -59,7 +59,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat ( X1 const& x1, Y1 const& y1, X2 const& x2, Y2 const& y2 @@ -71,7 +71,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) { this->value[0] = col_type(v1); this->value[1] = col_type(v2); @@ -81,63 +81,63 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 2, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<2, 2, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index 8f3e4feb..c74d1a5c 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -35,44 +35,44 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<2, 3, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat(mat<2, 3, T, P> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, P> const& m); - GLM_FUNC_DECL explicit mat(T scalar); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( T x0, T y0, T z0, T x1, T y1, T z1); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( col_type const& v0, col_type const& v1); // -- Conversions -- template - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2); template - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( vec<3, U, Q> const& v1, vec<3, V, Q> const& v2); // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index 9944654c..dc62d4de 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -7,13 +7,13 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -22,21 +22,21 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 3, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<2, 3, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0, 0); this->value[1] = col_type(0, scalar, 0); } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat ( T x0, T y0, T z0, T x1, T y1, T z1 @@ -47,7 +47,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(col_type const& v0, col_type const& v1) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(col_type const& v0, col_type const& v1) { this->value[0] = v0; this->value[1] = v1; @@ -59,7 +59,7 @@ namespace glm template< typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2> - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat ( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2 @@ -71,7 +71,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2) { this->value[0] = col_type(v1); this->value[1] = col_type(v2); @@ -81,63 +81,63 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 3, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<2, 3, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index 00e8d9b8..382f31ed 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -35,16 +35,16 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<2, 4, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat(mat<2, 4, T, P> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, P> const& m); - GLM_FUNC_DECL explicit mat(T scalar); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( col_type const& v0, col_type const& v1); @@ -53,28 +53,28 @@ namespace glm template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2> - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2); template - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( vec<4, U, Q> const& v1, vec<4, V, Q> const& v2); // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index 62fc5b1a..b1254c83 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -7,13 +7,13 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -22,14 +22,14 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 4, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<2, 4, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(T scalar) { value_type const Zero(0); this->value[0] = col_type(scalar, Zero, Zero, Zero); @@ -37,7 +37,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat ( T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1 @@ -48,7 +48,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(col_type const& v0, col_type const& v1) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(col_type const& v0, col_type const& v1) { this->value[0] = v0; this->value[1] = v1; @@ -60,7 +60,7 @@ namespace glm template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2> - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat ( X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2 @@ -72,7 +72,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2) { this->value[0] = col_type(v1); this->value[1] = col_type(v2); @@ -82,63 +82,63 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 4, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<2, 4, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 3fe00fda..67d7304d 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -35,17 +35,17 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<3, 2, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat(mat<3, 2, T, P> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, P> const& m); - GLM_FUNC_DECL explicit mat(T scalar); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( T x0, T y0, T x1, T y1, T x2, T y2); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( col_type const& v0, col_type const& v1, col_type const& v2); @@ -56,13 +56,13 @@ namespace glm typename X1, typename Y1, typename X2, typename Y2, typename X3, typename Y3> - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( X1 x1, Y1 y1, X2 x2, Y2 y2, X3 x3, Y3 y3); template - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3); @@ -70,16 +70,16 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index 5a64edbb..9091a74d 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -6,14 +6,14 @@ namespace glm // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat() + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -23,7 +23,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 2, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<3, 2, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -31,7 +31,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0); this->value[1] = col_type(0, scalar); @@ -39,7 +39,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat ( T x0, T y0, T x1, T y1, @@ -52,7 +52,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat ( col_type const& v0, col_type const& v1, @@ -71,7 +71,7 @@ namespace glm typename X1, typename Y1, typename X2, typename Y2, typename X3, typename Y3> - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat ( X1 x1, Y1 y1, X2 x2, Y2 y2, @@ -85,7 +85,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat ( vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, @@ -101,7 +101,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 2, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<3, 2, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -109,7 +109,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -117,7 +117,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -125,7 +125,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -133,7 +133,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -141,7 +141,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -149,7 +149,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -157,7 +157,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -165,7 +165,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -315,7 +315,7 @@ namespace glm return m; } - template + template GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m) { return mat<3, 2, T, Q>( @@ -353,7 +353,7 @@ namespace glm m[2] - scalar); } - template + template GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) { return mat<3, 2, T, Q>( @@ -362,7 +362,7 @@ namespace glm m1[2] - m2[2]); } - template + template GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar) { return mat<3, 2, T, Q>( @@ -371,7 +371,7 @@ namespace glm m[2] * scalar); } - template + template GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m) { return mat<3, 2, T, Q>( @@ -379,7 +379,7 @@ namespace glm m[1] * scalar, m[2] * scalar); } - + template GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v) { @@ -457,7 +457,7 @@ namespace glm m[2] / scalar); } - template + template GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m) { return mat<3, 2, T, Q>( @@ -474,7 +474,7 @@ namespace glm return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); } - template + template GLM_FUNC_QUALIFIER bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) { return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 9d4c5ded..55955621 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -34,17 +34,17 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<3, 3, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat(mat<3, 3, T, P> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, P> const& m); - GLM_FUNC_DECL explicit mat(T scalar); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( T x0, T y0, T z0, T x1, T y1, T z1, T x2, T y2, T z2); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( col_type const& v0, col_type const& v1, col_type const& v2); @@ -55,13 +55,13 @@ namespace glm typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3> - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2, X3 x3, Y3 y3, Z3 z3); template - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3); @@ -69,16 +69,16 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index 8be4cf4a..1f044e25 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -9,13 +9,13 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -25,7 +25,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 3, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<3, 3, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -33,7 +33,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0, 0); this->value[1] = col_type(0, scalar, 0); @@ -41,7 +41,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat ( T x0, T y0, T z0, T x1, T y1, T z1, @@ -54,7 +54,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat ( col_type const& v0, col_type const& v1, @@ -73,7 +73,7 @@ namespace glm typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3> - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat ( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2, @@ -84,10 +84,10 @@ namespace glm this->value[1] = col_type(static_cast(x2), value_type(y2), value_type(z2)); this->value[2] = col_type(static_cast(x3), value_type(y3), value_type(z3)); } - + template template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat ( vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, @@ -103,7 +103,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 3, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<3, 3, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -111,7 +111,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -119,7 +119,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -127,7 +127,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -135,7 +135,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -143,7 +143,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -151,7 +151,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -159,7 +159,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -167,7 +167,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -335,14 +335,14 @@ namespace glm GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m) { return mat<3, 3, T, Q>( - -m[0], + -m[0], -m[1], -m[2]); } // -- Binary arithmetic operators -- - template + template GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar) { return mat<3, 3, T, Q>( @@ -351,7 +351,7 @@ namespace glm m[2] + scalar); } - template + template GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m) { return mat<3, 3, T, Q>( @@ -360,7 +360,7 @@ namespace glm m[2] + scalar); } - template + template GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { return mat<3, 3, T, Q>( @@ -369,7 +369,7 @@ namespace glm m1[2] + m2[2]); } - template + template GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar) { return mat<3, 3, T, Q>( @@ -378,7 +378,7 @@ namespace glm m[2] - scalar); } - template + template GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m) { return mat<3, 3, T, Q>( @@ -387,7 +387,7 @@ namespace glm scalar - m[2]); } - template + template GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { return mat<3, 3, T, Q>( @@ -396,7 +396,7 @@ namespace glm m1[2] - m2[2]); } - template + template GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar) { return mat<3, 3, T, Q>( @@ -405,7 +405,7 @@ namespace glm m[2] * scalar); } - template + template GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m) { return mat<3, 3, T, Q>( @@ -414,7 +414,7 @@ namespace glm m[2] * scalar); } - template + template GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) { return typename mat<3, 3, T, Q>::col_type( @@ -423,7 +423,7 @@ namespace glm m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z); } - template + template GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m) { return typename mat<3, 3, T, Q>::row_type( @@ -432,7 +432,7 @@ namespace glm m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z); } - template + template GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { T const SrcA00 = m1[0][0]; diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index cfebd867..9507d5bf 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -35,17 +35,17 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<3, 4, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat(mat<3, 4, T, P> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, P> const& m); - GLM_FUNC_DECL explicit mat(T scalar); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1, T x2, T y2, T z2, T w2); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( col_type const& v0, col_type const& v1, col_type const& v2); @@ -56,13 +56,13 @@ namespace glm typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3> - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2, X3 x3, Y3 y3, Z3 z3, W3 w3); template - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3); @@ -70,16 +70,16 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index 28d3198f..fc251540 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -7,13 +7,13 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -23,7 +23,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 4, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<3, 4, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -31,7 +31,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0, 0, 0); this->value[1] = col_type(0, scalar, 0, 0); @@ -39,7 +39,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat ( T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1, @@ -52,7 +52,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat ( col_type const& v0, col_type const& v1, @@ -71,7 +71,7 @@ namespace glm typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3> - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat ( X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2, @@ -82,10 +82,10 @@ namespace glm this->value[1] = col_type(static_cast(x2), value_type(y2), value_type(z2), value_type(w2)); this->value[2] = col_type(static_cast(x3), value_type(y3), value_type(z3), value_type(w3)); } - + template template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat ( vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, @@ -96,12 +96,12 @@ namespace glm this->value[1] = col_type(v2); this->value[2] = col_type(v3); } - + // -- Matrix conversions -- template template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 4, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<3, 4, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -109,7 +109,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); @@ -117,7 +117,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -125,7 +125,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -133,7 +133,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -141,7 +141,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); @@ -149,7 +149,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -157,7 +157,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); @@ -165,7 +165,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -211,8 +211,8 @@ namespace glm return *this; } - template - template + template + template GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(U s) { this->value[0] += s; @@ -221,8 +221,8 @@ namespace glm return *this; } - template - template + template + template GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(mat<3, 4, U, Q> const& m) { this->value[0] += m[0]; diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index 0c9b3725..74f4c98f 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -35,18 +35,18 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<4, 2, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat(mat<4, 2, T, P> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, P> const& m); - GLM_FUNC_DECL explicit mat(T scalar); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( T x0, T y0, T x1, T y1, T x2, T y2, T x3, T y3); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( col_type const& v0, col_type const& v1, col_type const& v2, @@ -59,14 +59,14 @@ namespace glm typename X2, typename Y2, typename X3, typename Y3, typename X4, typename Y4> - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( X1 x1, Y1 y1, X2 x2, Y2 y2, X3 x3, Y3 y3, X4 x4, Y4 y4); template - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3, @@ -75,16 +75,16 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); // -- Unary arithmetic operators -- diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index cc496232..2485232b 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -6,14 +6,14 @@ namespace glm // -- Constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat() + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -24,7 +24,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 2, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<4, 2, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -33,7 +33,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0); this->value[1] = col_type(0, scalar); @@ -42,7 +42,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat ( T x0, T y0, T x1, T y1, @@ -57,7 +57,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat ( col_type const& v0, col_type const& v1, @@ -79,7 +79,7 @@ namespace glm typename X2, typename Y2, typename X3, typename Y3, typename X4, typename Y4> - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat ( X1 x1, Y1 y1, X2 x2, Y2 y2, @@ -92,10 +92,10 @@ namespace glm this->value[2] = col_type(static_cast(x3), value_type(y3)); this->value[3] = col_type(static_cast(x4), value_type(y4)); } - + template template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat ( vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, @@ -113,7 +113,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 2, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<4, 2, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -122,7 +122,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -131,7 +131,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -140,7 +140,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -149,7 +149,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -158,7 +158,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -167,7 +167,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -176,7 +176,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -185,7 +185,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index 09228b71..86a7e9c5 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -35,18 +35,18 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<4, 3, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat(mat<4, 3, T, P> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, P> const& m); - GLM_FUNC_DECL explicit mat(T const& x); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T const& x); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( T const& x0, T const& y0, T const& z0, T const& x1, T const& y1, T const& z1, T const& x2, T const& y2, T const& z2, T const& x3, T const& y3, T const& z3); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( col_type const& v0, col_type const& v1, col_type const& v2, @@ -59,14 +59,14 @@ namespace glm typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3, typename X4, typename Y4, typename Z4> - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( X1 const& x1, Y1 const& y1, Z1 const& z1, X2 const& x2, Y2 const& y2, Z2 const& z2, X3 const& x3, Y3 const& y3, Z3 const& z3, X4 const& x4, Y4 const& y4, Z4 const& z4); template - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3, @@ -75,16 +75,16 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); // -- Unary arithmetic operators -- diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index 4fe9a45d..cd1ae867 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -7,13 +7,13 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -24,7 +24,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 3, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<4, 3, T, P> const& m) { this->value[0] = m.value[0]; this->value[1] = m.value[1]; @@ -33,7 +33,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(T const& s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(T const& s) { this->value[0] = col_type(s, 0, 0); this->value[1] = col_type(0, s, 0); @@ -42,7 +42,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat ( T const& x0, T const& y0, T const& z0, T const& x1, T const& y1, T const& z1, @@ -57,7 +57,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat ( col_type const& v0, col_type const& v1, @@ -79,7 +79,7 @@ namespace glm typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3, typename X4, typename Y4, typename Z4> - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat ( X1 const& x1, Y1 const& y1, Z1 const& z1, X2 const& x2, Y2 const& y2, Z2 const& z2, @@ -92,10 +92,10 @@ namespace glm this->value[2] = col_type(static_cast(x3), value_type(y3), value_type(z3)); this->value[3] = col_type(static_cast(x4), value_type(y4), value_type(z4)); } - + template template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat ( vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, @@ -113,7 +113,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 3, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<4, 3, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -122,7 +122,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -131,7 +131,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -140,7 +140,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -149,7 +149,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -158,7 +158,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -167,7 +167,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -176,7 +176,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -185,7 +185,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index 92051725..f289aff8 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -34,18 +34,18 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL mat() GLM_DEFAULT; - GLM_FUNC_DECL mat(mat<4, 4, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat(mat<4, 4, T, P> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, P> const& m); - GLM_FUNC_DECL explicit mat(T const& x); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T const& x); + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( T const& x0, T const& y0, T const& z0, T const& w0, T const& x1, T const& y1, T const& z1, T const& w1, T const& x2, T const& y2, T const& z2, T const& w2, T const& x3, T const& y3, T const& z3, T const& w3); - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( col_type const& v0, col_type const& v1, col_type const& v2, @@ -58,14 +58,14 @@ namespace glm typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3, typename X4, typename Y4, typename Z4, typename W4> - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1, X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2, X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3, X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4); template - GLM_FUNC_DECL mat( + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3, @@ -74,16 +74,16 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index c8dbc17c..09804641 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -9,13 +9,13 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat() {} # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -26,7 +26,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 4, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<4, 4, T, P> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -35,7 +35,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(T const& s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(T const& s) { this->value[0] = col_type(s, 0, 0, 0); this->value[1] = col_type(0, s, 0, 0); @@ -44,7 +44,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat ( T const& x0, T const& y0, T const& z0, T const& w0, T const& x1, T const& y1, T const& z1, T const& w1, @@ -59,7 +59,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat ( col_type const& v0, col_type const& v1, @@ -75,7 +75,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 4, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<4, 4, U, P> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); @@ -85,13 +85,13 @@ namespace glm // -- Conversions -- - template + template template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3, typename X4, typename Y4, typename Z4, typename W4> - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat ( X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1, X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2, @@ -124,16 +124,16 @@ namespace glm this->value[2] = col_type(static_cast(x3), value_type(y3), value_type(z3), value_type(w3)); this->value[3] = col_type(static_cast(x4), value_type(y4), value_type(z4), value_type(w4)); } - + template template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat ( vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3, vec<4, V4, Q> const& v4 - ) + ) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); @@ -149,7 +149,7 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); @@ -158,7 +158,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -167,7 +167,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); @@ -176,7 +176,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); @@ -185,7 +185,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -194,7 +194,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); @@ -203,7 +203,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -212,7 +212,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); From 3aebd8f8fdbe6a0707bae48f059167f9518ee31c Mon Sep 17 00:00:00 2001 From: Chris Helmich Date: Mon, 22 Jan 2018 11:29:04 +0900 Subject: [PATCH 3/7] added GLM_CONSTEXPR_CXX14 flag to vec<>::operator= and mat<>::operator= --- glm/detail/type_mat2x2.hpp | 4 ++-- glm/detail/type_mat2x2.inl | 20 +++++++++--------- glm/detail/type_mat2x3.hpp | 4 ++-- glm/detail/type_mat2x3.inl | 42 +++++++++++++++++++------------------- glm/detail/type_mat2x4.hpp | 4 ++-- glm/detail/type_mat2x4.inl | 16 +++++++-------- glm/detail/type_mat3x2.hpp | 4 ++-- glm/detail/type_mat3x2.inl | 4 ++-- glm/detail/type_mat3x3.hpp | 4 ++-- glm/detail/type_mat3x3.inl | 4 ++-- glm/detail/type_mat3x4.hpp | 4 ++-- glm/detail/type_mat3x4.inl | 8 ++++---- glm/detail/type_mat4x2.hpp | 4 ++-- glm/detail/type_mat4x2.inl | 4 ++-- glm/detail/type_mat4x3.hpp | 4 ++-- glm/detail/type_mat4x3.inl | 4 ++-- glm/detail/type_mat4x4.hpp | 4 ++-- glm/detail/type_mat4x4.inl | 8 ++++---- glm/detail/type_vec1.inl | 4 ++-- glm/detail/type_vec2.hpp | 4 ++-- glm/detail/type_vec2.inl | 4 ++-- glm/detail/type_vec3.hpp | 4 ++-- glm/detail/type_vec3.inl | 4 ++-- glm/detail/type_vec4.hpp | 4 ++-- glm/detail/type_vec4.inl | 4 ++-- glm/ext/vec1.hpp | 4 ++-- 26 files changed, 89 insertions(+), 89 deletions(-) diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 82e68d84..ed9b782f 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -75,10 +75,10 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<2, 2, T, Q> & operator=(mat<2, 2, T, Q> const& v) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<2, 2, T, Q> & operator=(mat<2, 2, T, Q> const& v) GLM_DEFAULT; template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m); template GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(U s); template diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index 7eea2cbe..3c7fae56 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -38,7 +38,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat ( T const& x0, T const& y0, T const& x1, T const& y1 @@ -59,7 +59,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat ( X1 const& x1, Y1 const& y1, X2 const& x2, Y2 const& y2 @@ -68,7 +68,7 @@ namespace glm this->value[0] = col_type(static_cast(x1), value_type(y1)); this->value[1] = col_type(static_cast(x2), value_type(y2)); } - + template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) @@ -101,7 +101,7 @@ namespace glm this->value[1] = col_type(m[1]); } - template + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); @@ -163,7 +163,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -173,7 +173,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -294,7 +294,7 @@ namespace glm GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m) { return mat<2, 2, T, Q>( - -m[0], + -m[0], -m[1]); } @@ -424,7 +424,7 @@ namespace glm m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]); } - template + template GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar) { return mat<2, 2, T, Q>( @@ -432,7 +432,7 @@ namespace glm m[1] / scalar); } - template + template GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m) { return mat<2, 2, T, Q>( @@ -454,7 +454,7 @@ namespace glm template GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { + { mat<2, 2, T, Q> m1_copy(m1); return m1_copy /= m2; } diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index c74d1a5c..657f5fd8 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -76,10 +76,10 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<2, 3, T, Q> & operator=(mat<2, 3, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<2, 3, T, Q> & operator=(mat<2, 3, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m); template GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(U s); template diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index dc62d4de..119674cc 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -28,15 +28,15 @@ namespace glm this->value[1] = m.value[1]; } - template + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(T scalar) { this->value[0] = col_type(scalar, 0, 0); this->value[1] = col_type(0, scalar, 0); } - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat ( T x0, T y0, T z0, T x1, T y1, T z1 @@ -46,7 +46,7 @@ namespace glm this->value[1] = col_type(x1, y1, z1); } - template + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(col_type const& v0, col_type const& v1) { this->value[0] = v0; @@ -59,7 +59,7 @@ namespace glm template< typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat ( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2 @@ -68,7 +68,7 @@ namespace glm this->value[0] = col_type(static_cast(x1), value_type(y1), value_type(z1)); this->value[1] = col_type(static_cast(x2), value_type(y2), value_type(z2)); } - + template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2) @@ -87,56 +87,56 @@ namespace glm this->value[1] = col_type(m[1]); } - template + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } - template + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } - template + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) { this->value[0] = col_type(m[0]); this->value[1] = col_type(m[1]); } - template + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); } - template + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) { this->value[0] = m[0]; @@ -163,7 +163,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -173,7 +173,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -286,7 +286,7 @@ namespace glm // -- Binary arithmetic operators -- - template + template GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar) { return mat<2, 3, T, Q>( @@ -294,7 +294,7 @@ namespace glm m[1] + scalar); } - template + template GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) { return mat<2, 3, T, Q>( @@ -302,7 +302,7 @@ namespace glm m1[1] + m2[1]); } - template + template GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar) { return mat<2, 3, T, Q>( @@ -310,7 +310,7 @@ namespace glm m[1] - scalar); } - template + template GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) { return mat<2, 3, T, Q>( @@ -318,7 +318,7 @@ namespace glm m1[1] - m2[1]); } - template + template GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar) { return mat<2, 3, T, Q>( diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index 382f31ed..a3cd52d6 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -78,10 +78,10 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<2, 4, T, Q> & operator=(mat<2, 4, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<2, 4, T, Q> & operator=(mat<2, 4, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m); template GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(U s); template diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index b1254c83..851ad30d 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -69,7 +69,7 @@ namespace glm this->value[0] = col_type(static_cast(x1), value_type(y1), value_type(z1), value_type(w1)); this->value[1] = col_type(static_cast(x2), value_type(y2), value_type(z2), value_type(w2)); } - + template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2) @@ -164,7 +164,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -174,7 +174,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -281,7 +281,7 @@ namespace glm GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m) { return mat<2, 4, T, Q>( - -m[0], + -m[0], -m[1]); } @@ -295,7 +295,7 @@ namespace glm m[1] + scalar); } - template + template GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) { return mat<2, 4, T, Q>( @@ -303,7 +303,7 @@ namespace glm m1[1] + m2[1]); } - template + template GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar) { return mat<2, 4, T, Q>( @@ -327,7 +327,7 @@ namespace glm m[1] * scalar); } - template + template GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m) { return mat<2, 4, T, Q>( @@ -426,7 +426,7 @@ namespace glm m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]); } - template + template GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar) { return mat<2, 4, T, Q>( diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 67d7304d..7320a48a 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -83,10 +83,10 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<3, 2, T, Q> & operator=(mat<3, 2, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 2, T, Q> & operator=(mat<3, 2, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m); template GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(U s); template diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index 9091a74d..a8458eab 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -192,7 +192,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -203,7 +203,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 55955621..942ecefe 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -82,10 +82,10 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<3, 3, T, Q> & operator=(mat<3, 3, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q> & operator=(mat<3, 3, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m); template GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(U s); template diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index 1f044e25..1f5fadc3 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -194,7 +194,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -205,7 +205,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index 9507d5bf..3489ef96 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -83,10 +83,10 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<3, 4, T, Q> & operator=(mat<3, 4, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 4, T, Q> & operator=(mat<3, 4, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m); template GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(U s); template diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index fc251540..e0194238 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -192,7 +192,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -201,9 +201,9 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, U, Q> const& m) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index 74f4c98f..ed8b7b31 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -88,10 +88,10 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<4, 2, T, Q> & operator=(mat<4, 2, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<4, 2, T, Q> & operator=(mat<4, 2, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m); template GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(U s); template diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index 2485232b..f7668350 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -213,7 +213,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -225,7 +225,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index 86a7e9c5..3d956c09 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -88,10 +88,10 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<4, 3, T, Q> & operator=(mat<4, 3, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<4, 3, T, Q> & operator=(mat<4, 3, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m); template GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(U s); template diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index cd1ae867..9add287f 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -213,7 +213,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, T, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -225,7 +225,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index f289aff8..a1a11e31 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -87,10 +87,10 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<4, 4, T, Q> & operator=(mat<4, 4, T, Q> const& m) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<4, 4, T, Q> & operator=(mat<4, 4, T, Q> const& m) GLM_DEFAULT; template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m); template GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(U s); template diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index 09804641..aa7b6b29 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -240,7 +240,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, T, Q> const& m) { //memcpy could be faster //memcpy(&this->value, &m.value, 16 * sizeof(valType)); @@ -252,9 +252,9 @@ namespace glm } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, U, Q> const& m) + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, U, Q> const& m) { //memcpy could be faster //memcpy(&this->value, &m.value, 16 * sizeof(valType)); diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index e59606f1..719bf31f 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -77,7 +77,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, T, Q> const& v) { this->x = v.x; return *this; @@ -86,7 +86,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, U, Q> const& v) { this->x = static_cast(v.x); return *this; diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 78e70019..79eb9741 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -128,10 +128,10 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL vec& operator=(vec const& v) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec& operator=(vec const& v) GLM_DEFAULT; template - GLM_FUNC_DECL vec& operator=(vec<2, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec& operator=(vec<2, U, Q> const& v); template GLM_FUNC_DECL vec& operator+=(U scalar); template diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index d82d22ea..48cb71b5 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -95,7 +95,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, T, Q> const& v) { this->x = v.x; this->y = v.y; @@ -105,7 +105,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, U, Q> const& v) { this->x = static_cast(v.x); this->y = static_cast(v.y); diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 3669ccde..f12acb72 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -149,10 +149,10 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL vec & operator=(vec const& v) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec & operator=(vec const& v) GLM_DEFAULT; template - GLM_FUNC_DECL vec & operator=(vec<3, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec & operator=(vec<3, U, Q> const& v); template GLM_FUNC_DECL vec & operator+=(U scalar); template diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 75488c4e..0624cbb7 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -124,7 +124,7 @@ namespace glm # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, T, Q> const& v) { this->x = v.x; this->y = v.y; @@ -135,7 +135,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, U, Q> const& v) { this->x = static_cast(v.x); this->y = static_cast(v.y); diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 3e338bc4..78be52ee 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -194,10 +194,10 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL vec<4, T, Q>& operator=(vec<4, T, Q> const& v) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec<4, T, Q>& operator=(vec<4, T, Q> const& v) GLM_DEFAULT; template - GLM_FUNC_DECL vec<4, T, Q>& operator=(vec<4, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec<4, T, Q>& operator=(vec<4, U, Q> const& v); template GLM_FUNC_DECL vec<4, T, Q>& operator+=(U scalar); template diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 2bad9aee..653e9781 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -339,7 +339,7 @@ namespace detail # if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, T, Q> const& v) { this->x = v.x; this->y = v.y; @@ -351,7 +351,7 @@ namespace detail template template - GLM_FUNC_QUALIFIER vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, U, Q> const& v) { this->x = static_cast(v.x); this->y = static_cast(v.y); diff --git a/glm/ext/vec1.hpp b/glm/ext/vec1.hpp index f3bb1e34..56aee68d 100644 --- a/glm/ext/vec1.hpp +++ b/glm/ext/vec1.hpp @@ -138,10 +138,10 @@ namespace glm */ // -- Unary arithmetic operators -- - GLM_FUNC_DECL vec & operator=(vec const& v) GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec & operator=(vec const& v) GLM_DEFAULT; template - GLM_FUNC_DECL vec & operator=(vec<1, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec & operator=(vec<1, U, Q> const& v); template GLM_FUNC_DECL vec & operator+=(U scalar); template From 5fe5f32edd4ddc15569e2330a0d7bcc74c60df56 Mon Sep 17 00:00:00 2001 From: Vitali Parkhomenko Date: Mon, 19 Mar 2018 18:25:45 +0300 Subject: [PATCH 4/7] Added creating a derived matrix from the rotation matrix. Creating a derived matrix from the rotation matrix about the x-, y-, and z-axis. --- glm/gtx/euler_angles.hpp | 18 ++++++++++++++ glm/gtx/euler_angles.inl | 51 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/glm/gtx/euler_angles.hpp b/glm/gtx/euler_angles.hpp index e66e9281..1bb87101 100644 --- a/glm/gtx/euler_angles.hpp +++ b/glm/gtx/euler_angles.hpp @@ -46,6 +46,24 @@ namespace glm GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZ( T const& angleZ); + /// Creates a 3D 4 * 4 homogeneous derived matrix from the rotation matrix about X-axis. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> derivedEulerAngleX( + T const & angleX, T const & angularVelocityX); + + /// Creates a 3D 4 * 4 homogeneous derived matrix from the rotation matrix about Y-axis. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> derivedEulerAngleY( + T const & angleY, T const & angularVelocityY); + + /// Creates a 3D 4 * 4 homogeneous derived matrix from the rotation matrix about Z-axis. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> derivedEulerAngleZ( + T const & angleZ, T const & angularVelocityZ); + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y). /// @see gtx_euler_angles template diff --git a/glm/gtx/euler_angles.inl b/glm/gtx/euler_angles.inl index 24efedeb..2637ad3c 100644 --- a/glm/gtx/euler_angles.inl +++ b/glm/gtx/euler_angles.inl @@ -53,6 +53,57 @@ namespace glm T(0), T(0), T(0), T(1)); } + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> derivedEulerAngleX + ( + T const & angleX, + T const & angularVelocityX + ) + { + T cosX = glm::cos(angleX) * angularVelocityX; + T sinX = glm::sin(angleX) * angularVelocityX; + + return mat<4, 4, T, defaultp>( + T(0), T(0), T(0), T(0), + T(0),-sinX, cosX, T(0), + T(0),-cosX,-sinX, T(0), + T(0), T(0), T(0), T(0)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> derivedEulerAngleY + ( + T const & angleY, + T const & angularVelocityY + ) + { + T cosY = glm::cos(angleY) * angularVelocityY; + T sinY = glm::sin(angleY) * angularVelocityY; + + return mat<4, 4, T, defaultp>( + -sinY, T(0), -cosY, T(0), + T(0), T(0), T(0), T(0), + cosY, T(0), -sinY, T(0), + T(0), T(0), T(0), T(0)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> derivedEulerAngleZ + ( + T const & angleZ, + T const & angularVelocityZ + ) + { + T cosZ = glm::cos(angleZ) * angularVelocityZ; + T sinZ = glm::sin(angleZ) * angularVelocityZ; + + return mat<4, 4, T, defaultp>( + -sinZ, cosZ, T(0), T(0), + -cosZ, -sinZ, T(0), T(0), + T(0), T(0), T(0), T(0), + T(0), T(0), T(0), T(0)); + } + template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXY ( From 5361f5e4ecab6e461d773f9fe0f5fb48c11649a2 Mon Sep 17 00:00:00 2001 From: Vitali Parkhomenko Date: Mon, 19 Mar 2018 18:43:01 +0300 Subject: [PATCH 5/7] Added creating a rotation matrix from Euler angles Creating a rotation matrix for 10 sequences of rotation axes: z-x-z, x-y-x, y-z-y, z-y-z, x-z-x, y-x-y, y-z-x, z-x-y, x-z-y, z-y-x. --- glm/gtx/euler_angles.hpp | 80 +++++++++ glm/gtx/euler_angles.inl | 350 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 430 insertions(+) diff --git a/glm/gtx/euler_angles.hpp b/glm/gtx/euler_angles.hpp index 1bb87101..0ec9a848 100644 --- a/glm/gtx/euler_angles.hpp +++ b/glm/gtx/euler_angles.hpp @@ -122,6 +122,86 @@ namespace glm T const& pitch, T const& roll); + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXZX( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXYX( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYXY( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYZY( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZYZ( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZXZ( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXZY( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYZX( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZYX( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZXY( + T const & t1, + T const & t2, + T const & t3); + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). /// @see gtx_euler_angles template diff --git a/glm/gtx/euler_angles.inl b/glm/gtx/euler_angles.inl index 2637ad3c..a7cd9873 100644 --- a/glm/gtx/euler_angles.inl +++ b/glm/gtx/euler_angles.inl @@ -252,6 +252,356 @@ namespace glm return Result; } + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXZX + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c2; + Result[0][1] = c1 * s2; + Result[0][2] = s1 * s2; + Result[0][3] = static_cast(0); + Result[1][0] =-c3 * s2; + Result[1][1] = c1 * c2 * c3 - s1 * s3; + Result[1][2] = c1 * s3 + c2 * c3 * s1; + Result[1][3] = static_cast(0); + Result[2][0] = s2 * s3; + Result[2][1] =-c3 * s1 - c1 * c2 * s3; + Result[2][2] = c1 * c3 - c2 * s1 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXYX + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c2; + Result[0][1] = s1 * s2; + Result[0][2] =-c1 * s2; + Result[0][3] = static_cast(0); + Result[1][0] = s2 * s3; + Result[1][1] = c1 * c3 - c2 * s1 * s3; + Result[1][2] = c3 * s1 + c1 * c2 * s3; + Result[1][3] = static_cast(0); + Result[2][0] = c3 * s2; + Result[2][1] =-c1 * s3 - c2 * c3 * s1; + Result[2][2] = c1 * c2 * c3 - s1 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYXY + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c3 - c2 * s1 * s3; + Result[0][1] = s2* s3; + Result[0][2] =-c3 * s1 - c1 * c2 * s3; + Result[0][3] = static_cast(0); + Result[1][0] = s1 * s2; + Result[1][1] = c2; + Result[1][2] = c1 * s2; + Result[1][3] = static_cast(0); + Result[2][0] = c1 * s3 + c2 * c3 * s1; + Result[2][1] =-c3 * s2; + Result[2][2] = c1 * c2 * c3 - s1 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYZY + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c2 * c3 - s1 * s3; + Result[0][1] = c3 * s2; + Result[0][2] =-c1 * s3 - c2 * c3 * s1; + Result[0][3] = static_cast(0); + Result[1][0] =-c1 * s2; + Result[1][1] = c2; + Result[1][2] = s1 * s2; + Result[1][3] = static_cast(0); + Result[2][0] = c3 * s1 + c1 * c2 * s3; + Result[2][1] = s2 * s3; + Result[2][2] = c1 * c3 - c2 * s1 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZYZ + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c2 * c3 - s1 * s3; + Result[0][1] = c1 * s3 + c2 * c3 * s1; + Result[0][2] =-c3 * s2; + Result[0][3] = static_cast(0); + Result[1][0] =-c3 * s1 - c1 * c2 * s3; + Result[1][1] = c1 * c3 - c2 * s1 * s3; + Result[1][2] = s2 * s3; + Result[1][3] = static_cast(0); + Result[2][0] = c1 * s2; + Result[2][1] = s1 * s2; + Result[2][2] = c2; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZXZ + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c3 - c2 * s1 * s3; + Result[0][1] = c3 * s1 + c1 * c2 * s3; + Result[0][2] = s2 *s3; + Result[0][3] = static_cast(0); + Result[1][0] =-c1 * s3 - c2 * c3 * s1; + Result[1][1] = c1 * c2 * c3 - s1 * s3; + Result[1][2] = c3 * s2; + Result[1][3] = static_cast(0); + Result[2][0] = s1 * s2; + Result[2][1] =-c1 * s2; + Result[2][2] = c2; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXZY + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c2 * c3; + Result[0][1] = s1 * s3 + c1 * c3 * s2; + Result[0][2] = c3 * s1 * s2 - c1 * s3; + Result[0][3] = static_cast(0); + Result[1][0] =-s2; + Result[1][1] = c1 * c2; + Result[1][2] = c2 * s1; + Result[1][3] = static_cast(0); + Result[2][0] = c2 * s3; + Result[2][1] = c1 * s2 * s3 - c3 * s1; + Result[2][2] = c1 * c3 + s1 * s2 *s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYZX + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c2; + Result[0][1] = s2; + Result[0][2] =-c2 * s1; + Result[0][3] = static_cast(0); + Result[1][0] = s1 * s3 - c1 * c3 * s2; + Result[1][1] = c2 * c3; + Result[1][2] = c1 * s3 + c3 * s1 * s2; + Result[1][3] = static_cast(0); + Result[2][0] = c3 * s1 + c1 * s2 * s3; + Result[2][1] =-c2 * s3; + Result[2][2] = c1 * c3 - s1 * s2 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZYX + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c2; + Result[0][1] = c2 * s1; + Result[0][2] =-s2; + Result[0][3] = static_cast(0); + Result[1][0] = c1 * s2 * s3 - c3 * s1; + Result[1][1] = c1 * c3 + s1 * s2 * s3; + Result[1][2] = c2 * s3; + Result[1][3] = static_cast(0); + Result[2][0] = s1 * s3 + c1 * c3 * s2; + Result[2][1] = c3 * s1 * s2 - c1 * s3; + Result[2][2] = c2 * c3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZXY + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c3 - s1 * s2 * s3; + Result[0][1] = c3 * s1 + c1 * s2 * s3; + Result[0][2] =-c2 * s3; + Result[0][3] = static_cast(0); + Result[1][0] =-c2 * s1; + Result[1][1] = c1 * c2; + Result[1][2] = s2; + Result[1][3] = static_cast(0); + Result[2][0] = c1 * s3 + c3 * s1 * s2; + Result[2][1] = s1 * s3 - c1 * c3 * s2; + Result[2][2] = c2 * c3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + template GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> yawPitchRoll ( From 15fb58aacb62a827dbce74ce1f000136d0edc085 Mon Sep 17 00:00:00 2001 From: Vitali Parkhomenko Date: Mon, 19 Mar 2018 18:48:18 +0300 Subject: [PATCH 6/7] Added extraction of Euler angles from rotation matrix. Extraction of Euler angles from rotation matrix for 11 sequences of rotation axes: z-x-z, x-y-x, y-z-y, z-y-z, x-z-x, y-x-y, y-z-x, z-x-y, x-z-y, z-y-x, y-x-z. --- glm/gtx/euler_angles.hpp | 91 +++++++++++++++++++ glm/gtx/euler_angles.inl | 187 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 278 insertions(+) diff --git a/glm/gtx/euler_angles.hpp b/glm/gtx/euler_angles.hpp index 0ec9a848..beb612a3 100644 --- a/glm/gtx/euler_angles.hpp +++ b/glm/gtx/euler_angles.hpp @@ -9,6 +9,9 @@ /// Include to use the features of this extension. /// /// Build matrices from Euler angles. +/// +/// Extraction of Euler angles from rotation matrix. +/// Based on the original paper 2014 Mike Day - Extracting Euler Angles from a Rotation Matrix. #pragma once @@ -238,6 +241,94 @@ namespace glm T & t2, T & t3); + /// Extracts the (Y * X * Z) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleYXZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (X * Z * X) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleXZX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (X * Y * X) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleXYX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Y * X * Y) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleYXY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Y * Z * Y) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleYZY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Z * Y * Z) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleZYZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Z * X * Z) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleZXZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (X * Z * Y) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleXZY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Y * Z * X) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleYZX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Z * Y * X) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleZYX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Z * X * Y) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleZXY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + /// @} }//namespace glm diff --git a/glm/gtx/euler_angles.inl b/glm/gtx/euler_angles.inl index a7cd9873..fff9e90e 100644 --- a/glm/gtx/euler_angles.inl +++ b/glm/gtx/euler_angles.inl @@ -710,4 +710,191 @@ namespace glm t2 = -T2; t3 = -T3; } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleYXZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[2][0], M[2][2]); + T C2 = glm::sqrt(M[0][1]*M[0][1] + M[1][1]*M[1][1]); + T T2 = glm::atan2(-M[2][1], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[1][2] - C1*M[1][0], C1*M[0][0] - S1*M[0][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleXZX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[0][2], M[0][1]); + T S2 = glm::sqrt(M[1][0]*M[1][0] + M[2][0]*M[2][0]); + T T2 = glm::atan2(S2, M[0][0]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(C1*M[1][2] - S1*M[1][1], C1*M[2][2] - S1*M[2][1]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleXYX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[0][1], -M[0][2]); + T S2 = glm::sqrt(M[1][0]*M[1][0] + M[2][0]*M[2][0]); + T T2 = glm::atan2(S2, M[0][0]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(-C1*M[2][1] - S1*M[2][2], C1*M[1][1] + S1*M[1][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleYXY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[1][0], M[1][2]); + T S2 = glm::sqrt(M[0][1]*M[0][1] + M[2][1]*M[2][1]); + T T2 = glm::atan2(S2, M[1][1]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(C1*M[2][0] - S1*M[2][2], C1*M[0][0] - S1*M[0][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleYZY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[1][2], -M[1][0]); + T S2 = glm::sqrt(M[0][1]*M[0][1] + M[2][1]*M[2][1]); + T T2 = glm::atan2(S2, M[1][1]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(-S1*M[0][0] - C1*M[0][2], S1*M[2][0] + C1*M[2][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleZYZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[2][1], M[2][0]); + T S2 = glm::sqrt(M[0][2]*M[0][2] + M[1][2]*M[1][2]); + T T2 = glm::atan2(S2, M[2][2]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(C1*M[0][1] - S1*M[0][0], C1*M[1][1] - S1*M[1][0]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleZXZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[2][0], -M[2][1]); + T S2 = glm::sqrt(M[0][2]*M[0][2] + M[1][2]*M[1][2]); + T T2 = glm::atan2(S2, M[2][2]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(-C1*M[1][0] - S1*M[1][1], C1*M[0][0] + S1*M[0][1]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleXZY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[1][2], M[1][1]); + T C2 = glm::sqrt(M[0][0]*M[0][0] + M[2][0]*M[2][0]); + T T2 = glm::atan2(-M[1][0], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[0][1] - C1*M[0][2], C1*M[2][2] - S1*M[2][1]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleYZX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(-M[0][2], M[0][0]); + T C2 = glm::sqrt(M[1][1]*M[1][1] + M[2][1]*M[2][1]); + T T2 = glm::atan2(M[0][1], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[1][0] + C1*M[1][2], S1*M[2][0] + C1*M[2][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleZYX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[0][1], M[0][0]); + T C2 = glm::sqrt(M[1][2]*M[1][2] + M[2][2]*M[2][2]); + T T2 = glm::atan2(-M[0][2], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[2][0] - C1*M[2][1], C1*M[1][1] - S1*M[1][0]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleZXY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(-M[1][0], M[1][1]); + T C2 = glm::sqrt(M[0][2]*M[0][2] + M[2][2]*M[2][2]); + T T2 = glm::atan2(M[1][2], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(C1*M[2][0] + S1*M[2][1], C1*M[0][0] + S1*M[0][1]); + t1 = T1; + t2 = T2; + t3 = T3; + } }//namespace glm From a74cd55d8d60f3fc895e694c9258923ac13d83f6 Mon Sep 17 00:00:00 2001 From: Vitali Parkhomenko Date: Fri, 23 Mar 2018 14:27:35 +0300 Subject: [PATCH 7/7] #744 Added tests --- test/gtx/gtx_euler_angle.cpp | 210 +++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) diff --git a/test/gtx/gtx_euler_angle.cpp b/test/gtx/gtx_euler_angle.cpp index 98ed343e..348f5818 100644 --- a/test/gtx/gtx_euler_angle.cpp +++ b/test/gtx/gtx_euler_angle.cpp @@ -2,10 +2,14 @@ #define GLM_ENABLE_EXPERIMENTAL #include +#include +#include #include #include #include #include +#include +#include namespace test_eulerAngleX { @@ -136,6 +140,62 @@ namespace test_eulerAngleZ } }//namespace test_eulerAngleZ +namespace test_derivedEulerAngles +{ + bool epsilonEqual(glm::mat4 const& mat1, glm::mat4 const& mat2, glm::mat4::value_type const& epsilon) + { + return glm::all(glm::epsilonEqual(mat1[0], mat2[0], epsilon)) ? + ( + glm::all(glm::epsilonEqual(mat1[1], mat2[1], epsilon)) ? + ( + glm::all(glm::epsilonEqual(mat1[2], mat2[2], epsilon)) ? + ( + glm::all(glm::epsilonEqual(mat1[3], mat2[3], epsilon)) ? true : false + ) : false + ) : false + ) : false; + } + + template + int test(RotationFunc rotationFunc, TestDerivedFunc testDerivedFunc, const glm::vec3& basis) + { + int Error = 0; + + typedef glm::vec3::value_type value; + value const zeroAngle(0.0f); + value const Angle(glm::pi() * 0.75f); + value const negativeAngle(-Angle); + value const zeroAngleVelocity(0.0f); + value const AngleVelocity(glm::pi() * 0.27f); + value const negativeAngleVelocity(-AngleVelocity); + + typedef std::pair AngleAndAngleVelocity; + std::vector testPairs; + testPairs.push_back(AngleAndAngleVelocity(zeroAngle, zeroAngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(zeroAngle, AngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(zeroAngle, negativeAngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(Angle, zeroAngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(Angle, AngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(Angle, negativeAngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(negativeAngle, zeroAngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(negativeAngle, AngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(negativeAngle, negativeAngleVelocity)); + + for (size_t i = 0, size = testPairs.size(); i < size; ++i) + { + AngleAndAngleVelocity const& pair = testPairs.at(i); + + glm::mat4 const W = glm::matrixCross4(basis * pair.second); + glm::mat4 const rotMt = glm::transpose(rotationFunc(pair.first)); + glm::mat4 const derivedRotM = testDerivedFunc(pair.first, pair.second); + + Error += epsilonEqual(W, derivedRotM * rotMt, 0.00001f) ? 0 : 1; + } + + return Error; + } +}//namespace test_derivedEulerAngles + namespace test_eulerAngleXY { int test() @@ -310,13 +370,140 @@ namespace test_eulerAngleYXZ } }//namespace eulerAngleYXZ +namespace test_eulerAngles +{ + template + int test(TestRotationFunc testRotationFunc, glm::vec3 const& I, glm::vec3 const& J, glm::vec3 const& K) + { + int Error = 0; + + typedef glm::mat4::value_type value; + value const minAngle(-glm::pi()); + value const maxAngle(glm::pi()); + value const maxAngleWithDelta(maxAngle - 0.0000001f); + value const minMidAngle(-glm::pi() * 0.5f); + value const maxMidAngle(glm::pi() * 0.5f); + + std::vector testEulerAngles; + testEulerAngles.push_back(glm::vec3(1.046f, 0.52f, -0.785f)); + testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, minAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, maxAngle)); + + for (size_t i = 0, size = testEulerAngles.size(); i < size; ++i) + { + glm::vec3 const& angles = testEulerAngles.at(i); + glm::mat4 const rotationEuler = testRotationFunc(angles.x, angles.y, angles.z); + + glm::mat4 rotationDumb = glm::diagonal4x4(glm::mat4::col_type(1.0f)); + rotationDumb = glm::rotate(rotationDumb, angles.x, I); + rotationDumb = glm::rotate(rotationDumb, angles.y, J); + rotationDumb = glm::rotate(rotationDumb, angles.z, K); + + glm::vec4 const V(1.0f,1.0f,1.0f,1.0f); + glm::vec4 const V1 = rotationEuler * V; + glm::vec4 const V2 = rotationDumb * V; + + Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; + } + + return Error; + } +}//namespace test_extractsEulerAngles + +namespace test_extractsEulerAngles +{ + template + int test(RotationFunc rotationFunc, TestExtractionFunc testExtractionFunc) + { + int Error = 0; + + typedef glm::mat4::value_type value; + value const minAngle(-glm::pi()); + value const maxAngle(glm::pi()); + value const maxAngleWithDelta(maxAngle - 0.0000001f); + value const minMidAngle(-glm::pi() * 0.5f); + value const maxMidAngle(glm::pi() * 0.5f); + + std::vector testEulerAngles; + testEulerAngles.push_back(glm::vec3(1.046f, 0.52f, -0.785f)); + testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, minAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, maxAngle)); + + for (size_t i = 0, size = testEulerAngles.size(); i < size; ++i) + { + glm::vec3 const& angles = testEulerAngles.at(i); + glm::mat4 const rotation = rotationFunc(angles.x, angles.y, angles.z); + + glm::vec3 extractedEulerAngles(0.0f); + testExtractionFunc(rotation, extractedEulerAngles.x, extractedEulerAngles.y, extractedEulerAngles.z); + glm::mat4 const extractedRotation = rotationFunc(extractedEulerAngles.x, extractedEulerAngles.y, extractedEulerAngles.z); + + glm::vec4 const V(1.0f,1.0f,1.0f,1.0f); + glm::vec4 const V1 = rotation * V; + glm::vec4 const V2 = extractedRotation * V; + + Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; + } + + return Error; + } +}//namespace test_extractsEulerAngles + int main() { int Error = 0; + typedef glm::mat4::value_type value; + glm::vec3 const X(1.0f, 0.0f, 0.0f); + glm::vec3 const Y(0.0f, 1.0f, 0.0f); + glm::vec3 const Z(0.0f, 0.0f, 1.0f); + Error += test_eulerAngleX::test(); Error += test_eulerAngleY::test(); Error += test_eulerAngleZ::test(); + + Error += test_derivedEulerAngles::test(glm::eulerAngleX, glm::derivedEulerAngleX, X); + Error += test_derivedEulerAngles::test(glm::eulerAngleY, glm::derivedEulerAngleY, Y); + Error += test_derivedEulerAngles::test(glm::eulerAngleZ, glm::derivedEulerAngleZ, Z); + Error += test_eulerAngleXY::test(); Error += test_eulerAngleYX::test(); Error += test_eulerAngleXZ::test(); @@ -325,5 +512,28 @@ int main() Error += test_eulerAngleZY::test(); Error += test_eulerAngleYXZ::test(); + Error += test_eulerAngles::test(glm::eulerAngleXZX, X, Z, X); + Error += test_eulerAngles::test(glm::eulerAngleXYX, X, Y, X); + Error += test_eulerAngles::test(glm::eulerAngleYXY, Y, X, Y); + Error += test_eulerAngles::test(glm::eulerAngleYZY, Y, Z, Y); + Error += test_eulerAngles::test(glm::eulerAngleZYZ, Z, Y, Z); + Error += test_eulerAngles::test(glm::eulerAngleZXZ, Z, X, Z); + Error += test_eulerAngles::test(glm::eulerAngleXZY, X, Z, Y); + Error += test_eulerAngles::test(glm::eulerAngleYZX, Y, Z, X); + Error += test_eulerAngles::test(glm::eulerAngleZYX, Z, Y, X); + Error += test_eulerAngles::test(glm::eulerAngleZXY, Z, X, Y); + + Error += test_extractsEulerAngles::test(glm::eulerAngleYXZ, glm::extractEulerAngleYXZ); + Error += test_extractsEulerAngles::test(glm::eulerAngleXZX, glm::extractEulerAngleXZX); + Error += test_extractsEulerAngles::test(glm::eulerAngleXYX, glm::extractEulerAngleXYX); + Error += test_extractsEulerAngles::test(glm::eulerAngleYXY, glm::extractEulerAngleYXY); + Error += test_extractsEulerAngles::test(glm::eulerAngleYZY, glm::extractEulerAngleYZY); + Error += test_extractsEulerAngles::test(glm::eulerAngleZYZ, glm::extractEulerAngleZYZ); + Error += test_extractsEulerAngles::test(glm::eulerAngleZXZ, glm::extractEulerAngleZXZ); + Error += test_extractsEulerAngles::test(glm::eulerAngleXZY, glm::extractEulerAngleXZY); + Error += test_extractsEulerAngles::test(glm::eulerAngleYZX, glm::extractEulerAngleYZX); + Error += test_extractsEulerAngles::test(glm::eulerAngleZYX, glm::extractEulerAngleZYX); + Error += test_extractsEulerAngles::test(glm::eulerAngleZXY, glm::extractEulerAngleZXY); + return Error; }