diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp index 6d17b54e..497722ca 100644 --- a/glm/core/type_vec3.hpp +++ b/glm/core/type_vec3.hpp @@ -197,6 +197,7 @@ namespace detail GLM_FUNC_DECL tvec2 swizzle(comp X, comp Y) const; GLM_FUNC_DECL tvec3 swizzle(comp X, comp Y, comp Z) const; GLM_FUNC_DECL tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + GLM_FUNC_DECL tref2 swizzle(comp X, comp Y); GLM_FUNC_DECL tref3 swizzle(comp X, comp Y, comp Z); }; diff --git a/glm/core/type_vec3.inl b/glm/core/type_vec3.inl index 582e1ac6..08940e53 100644 --- a/glm/core/type_vec3.inl +++ b/glm/core/type_vec3.inl @@ -594,6 +594,18 @@ namespace detail (*this)[w]); } + template + GLM_FUNC_QUALIFIER tref2 tvec3::swizzle + ( + comp x, + comp y + ) + { + return tref2( + (*this)[x], + (*this)[y]); + } + template GLM_FUNC_QUALIFIER tref3 tvec3::swizzle ( diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 21d326a7..35923366 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -209,6 +209,8 @@ namespace detail GLM_FUNC_DECL tvec2 swizzle(comp X, comp Y) const; GLM_FUNC_DECL tvec3 swizzle(comp X, comp Y, comp Z) const; GLM_FUNC_DECL tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + GLM_FUNC_DECL tref2 swizzle(comp X, comp Y); + GLM_FUNC_DECL tref3 swizzle(comp X, comp Y, comp Z); GLM_FUNC_DECL tref4 swizzle(comp X, comp Y, comp Z, comp W); }; diff --git a/glm/core/type_vec4.inl b/glm/core/type_vec4.inl index 59a743cd..8196862a 100644 --- a/glm/core/type_vec4.inl +++ b/glm/core/type_vec4.inl @@ -651,6 +651,32 @@ namespace detail (*this)[w]); } + template + GLM_FUNC_QUALIFIER tref2 tvec4::swizzle + ( + comp x, + comp y + ) + { + return tref2( + (*this)[x], + (*this)[y]); + } + + template + GLM_FUNC_QUALIFIER tref3 tvec4::swizzle + ( + comp x, + comp y, + comp z + ) + { + return tref3( + (*this)[x], + (*this)[y], + (*this)[z]); + } + template GLM_FUNC_QUALIFIER tref4 tvec4::swizzle (