From f29129509c93a27a91001cd6576b5c292e5221f8 Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Fri, 19 Feb 2016 17:06:35 -0500 Subject: [PATCH] Introduce the ability to allow most explicit conversions to be implicit - Use the new GLM_IMPLICIT_CONVERSION_CTOR #define - By default GLM_EXPLICIT_CONV is defined as "explicit" - #define GLM_IMPLICIT_CONVERSION_CTOR defines it as empty --- glm/detail/setup.hpp | 6 ++++++ glm/detail/type_mat2x2.hpp | 16 ++++++++-------- glm/detail/type_mat2x3.hpp | 16 ++++++++-------- glm/detail/type_mat2x4.hpp | 16 ++++++++-------- glm/detail/type_mat3x2.hpp | 16 ++++++++-------- glm/detail/type_mat3x3.hpp | 16 ++++++++-------- glm/detail/type_mat3x4.hpp | 16 ++++++++-------- glm/detail/type_mat4x2.hpp | 16 ++++++++-------- glm/detail/type_mat4x3.hpp | 16 ++++++++-------- glm/detail/type_mat4x4.hpp | 16 ++++++++-------- glm/detail/type_vec1.hpp | 6 +++--- glm/detail/type_vec2.hpp | 4 ++-- glm/detail/type_vec3.hpp | 10 +++++----- glm/detail/type_vec4.hpp | 22 +++++++++++----------- glm/gtc/quaternion.hpp | 8 ++++---- glm/gtx/dual_quaternion.hpp | 4 ++-- 16 files changed, 105 insertions(+), 99 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 3f65eb44..18904f89 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -942,6 +942,12 @@ # define GLM_RELAXED_CONSTEXPR const #endif +#ifdef GLM_IMPLICIT_CONVERSION_CTOR +# define GLM_EXPLICIT_CONV +#else +# define GLM_EXPLICIT_CONV explicit +#endif + #ifdef GLM_FORCE_EXPLICIT_CTOR # define GLM_EXPLICIT explicit #else diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 9df68720..e9ef38dd 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -102,14 +102,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x2 const & m); - GLM_FUNC_DECL explicit tmat2x2(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x2(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x2(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x2(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x2(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x2(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x2(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x2(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x2(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index 493548f4..672ed717 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -99,14 +99,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x3 const & m); - GLM_FUNC_DECL explicit tmat2x3(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x3(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x3(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x3(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x3(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x3(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x3(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x3(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x3(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index e15714ca..e352efc3 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -101,14 +101,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x4 const & m); - GLM_FUNC_DECL explicit tmat2x4(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x4(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x4(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x4(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x4(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x4(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x4(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x4(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat2x4(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 63e0a659..050cbc24 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -106,14 +106,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat3x2 const & m); - GLM_FUNC_DECL explicit tmat3x2(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x2(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x2(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x2(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x2(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x2(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x2(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x2(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x2(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 799d645d..e9546421 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -110,14 +110,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat3x3 const & m); - GLM_FUNC_DECL explicit tmat3x3(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x3(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x3(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x3(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x3(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x3(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x3(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x3(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x3(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index 7453673b..63c16d19 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -106,14 +106,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat3x4 const & m); - GLM_FUNC_DECL explicit tmat3x4(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x4(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x4(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x4(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x4(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x4(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x4(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x4(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat3x4(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index 8cb7d70e..ebdbd085 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -111,14 +111,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat4x2 const & m); - GLM_FUNC_DECL explicit tmat4x2(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat4x3 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x2(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x2(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x2(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x2(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x2(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x2(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x2(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x2(tmat3x4 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index 0a5de95b..3ff7c6e9 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -111,14 +111,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat4x3 const & m); - GLM_FUNC_DECL explicit tmat4x3(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x3(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x3(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x3(tmat4x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x3(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x3(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x3(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x3(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x3(tmat3x4 const & x); // -- Accesses -- diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index a90a5978..7fc04a41 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -115,14 +115,14 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat4x4 const & m); - GLM_FUNC_DECL explicit tmat4x4(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat4x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x4(tmat2x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x4(tmat3x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x4(tmat2x3 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x4(tmat3x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x4(tmat2x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x4(tmat4x2 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x4(tmat3x4 const & x); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tmat4x4(tmat4x3 const & x); // -- Accesses -- diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index 833468d8..22f729b5 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -126,13 +126,13 @@ namespace glm /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec1(tvec2 const & v); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec1(tvec2 const & v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec1(tvec3 const & v); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec1(tvec3 const & v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec1(tvec4 const & v); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec1(tvec4 const & v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 1d857ac7..1188ceb7 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -138,10 +138,10 @@ namespace glm /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec2(tvec3 const & v); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec2(tvec3 const & v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec2(tvec4 const & v); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec2(tvec4 const & v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index d4d8ff6a..4e6ee1d7 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -143,19 +143,19 @@ namespace glm /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec3(tvec2 const & a, B const & b); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec3(tvec2 const & a, B const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec3(tvec2 const & a, tvec1 const & b); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec3(tvec2 const & a, tvec1 const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec3(A const & a, tvec2 const & b); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec3(A const & a, tvec2 const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec3(tvec1 const & a, tvec2 const & b); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec3(tvec1 const & a, tvec2 const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec3(tvec4 const & v); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec3(tvec4 const & v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index f26350c6..5a504455 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -208,37 +208,37 @@ namespace detail /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec2 const & a, B b, C c); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec4(tvec2 const & a, B b, C c); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec2 const & a, tvec1 const & b, tvec1 const & c); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec4(tvec2 const & a, tvec1 const & b, tvec1 const & c); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(A a, tvec2 const & b, C c); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec4(A a, tvec2 const & b, C c); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec1 const & a, tvec2 const & b, tvec1 const & c); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec4(tvec1 const & a, tvec2 const & b, tvec1 const & c); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(A a, B b, tvec2 const & c); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec4(A a, B b, tvec2 const & c); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec1 const & a, tvec1 const & b, tvec2 const & c); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec4(tvec1 const & a, tvec1 const & b, tvec2 const & c); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec3 const & a, B b); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec4(tvec3 const & a, B b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec3 const & a, tvec1 const & b); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec4(tvec3 const & a, tvec1 const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(A a, tvec3 const & b); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec4(A a, tvec3 const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec1 const & a, tvec3 const & b); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec4(tvec1 const & a, tvec3 const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4(tvec2 const & a, tvec2 const & b); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tvec4(tvec2 const & a, tvec2 const & b); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index daf9cc19..b83e2cc2 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -144,12 +144,12 @@ namespace glm /// @param v A second normalized axis /// @see gtc_quaternion /// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors - GLM_FUNC_DECL explicit tquat(tvec3 const & u, tvec3 const & v); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tquat(tvec3 const & u, tvec3 const & v); /// Build a quaternion from euler angles (pitch, yaw, roll), in radians. - GLM_FUNC_DECL explicit tquat(tvec3 const & eulerAngles); - GLM_FUNC_DECL explicit tquat(tmat3x3 const & m); - GLM_FUNC_DECL explicit tquat(tmat4x4 const & m); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tquat(tvec3 const & eulerAngles); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tquat(tmat3x3 const & m); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tquat(tmat4x4 const & m); // -- Unary arithmetic operators -- diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index c62fcda4..4378c8ba 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -112,8 +112,8 @@ namespace glm template GLM_FUNC_DECL GLM_EXPLICIT tdualquat(tdualquat const & q); - GLM_FUNC_DECL explicit tdualquat(tmat2x4 const & holder_mat); - GLM_FUNC_DECL explicit tdualquat(tmat3x4 const & aug_mat); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tdualquat(tmat2x4 const & holder_mat); + GLM_FUNC_DECL GLM_EXPLICIT_CONV tdualquat(tmat3x4 const & aug_mat); // -- Unary arithmetic operators --