diff --git a/glm/core/_swizzle_func.hpp b/glm/core/_swizzle_func.hpp index faa98478..b9df96a8 100644 --- a/glm/core/_swizzle_func.hpp +++ b/glm/core/_swizzle_func.hpp @@ -38,7 +38,7 @@ #define GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \ SWIZZLED_TYPE A ## B ## C() CONST \ { \ - return SWIZZLED_TYPE(this->A, this->B, this->B); \ + return SWIZZLED_TYPE(this->A, this->B, this->C); \ } #define GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \ @@ -58,7 +58,7 @@ template \ SWIZZLED_TYPE CLASS_TYPE::A ## B ## C() CONST \ { \ - return SWIZZLED_TYPE(this->A, this->B, this->B); \ + return SWIZZLED_TYPE(this->A, this->B, this->C); \ } #define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(TMPL_TYPE, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \ @@ -98,8 +98,8 @@ GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B, A) #define GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ - GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C) \ - GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) + GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C) #define GLM_SWIZZLE_GEN_REF_FROM_VEC3(TMPL_TYPE, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE) \ GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, x, y, z) \ diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index 0bd8e990..701138fb 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -229,7 +229,7 @@ namespace detail { GLM_FUNC_DECL tref2(T & x, T & y); GLM_FUNC_DECL tref2(tref2 const & r); - GLM_FUNC_DECL tref2(tvec2 const & v); + GLM_FUNC_DECL explicit tref2(tvec2 const & v); GLM_FUNC_DECL tref2 & operator= (tref2 const & r); GLM_FUNC_DECL tref2 & operator= (tvec2 const & v); diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp index ea4c49e9..4b19b706 100644 --- a/glm/core/type_vec3.hpp +++ b/glm/core/type_vec3.hpp @@ -254,7 +254,7 @@ namespace detail { GLM_FUNC_DECL tref3(T & x, T & y, T & z); GLM_FUNC_DECL tref3(tref3 const & r); - GLM_FUNC_DECL tref3(tvec3 const & v); + GLM_FUNC_DECL explicit tref3(tvec3 const & v); GLM_FUNC_DECL tref3 & operator= (tref3 const & r); GLM_FUNC_DECL tref3 & operator= (tvec3 const & v); diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 440af9ea..78d20097 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -310,7 +310,7 @@ namespace detail { GLM_FUNC_DECL tref4(T & x, T & y, T & z, T & w); GLM_FUNC_DECL tref4(tref4 const & r); - GLM_FUNC_DECL tref4(tvec4 const & v); + GLM_FUNC_DECL explicit tref4(tvec4 const & v); GLM_FUNC_DECL tref4 & operator= (tref4 const & r); GLM_FUNC_DECL tref4 & operator= (tvec4 const & v); diff --git a/test/core/core_func_swizzle.cpp b/test/core/core_func_swizzle.cpp index 5b57a379..b56b707c 100644 --- a/test/core/core_func_swizzle.cpp +++ b/test/core/core_func_swizzle.cpp @@ -7,7 +7,7 @@ // File : test/core/core_func_swizzle.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -//#define GLM_FORCE_ONLY_XYZW +#define GLM_FORCE_ONLY_XYZW //#define GLM_FORCE_PURE #define GLM_MESSAGES #define GLM_SWIZZLE