Fixed ticket #111, missing swizzle operations

This commit is contained in:
Christophe Riccio 2011-09-30 16:16:55 +01:00
parent 21942860b9
commit d75db9b8e4
4 changed files with 41 additions and 0 deletions

View File

@ -178,6 +178,7 @@ namespace detail
GLM_FUNC_DECL tvec2<T> swizzle(comp X, comp Y) const; GLM_FUNC_DECL tvec2<T> swizzle(comp X, comp Y) const;
GLM_FUNC_DECL tvec3<T> swizzle(comp X, comp Y, comp Z) const; GLM_FUNC_DECL tvec3<T> swizzle(comp X, comp Y, comp Z) const;
GLM_FUNC_DECL tvec4<T> swizzle(comp X, comp Y, comp Z, comp W) const; GLM_FUNC_DECL tvec4<T> swizzle(comp X, comp Y, comp Z, comp W) const;
GLM_FUNC_DECL tref2<T> swizzle(comp X, comp Y);
GLM_FUNC_DECL tref3<T> swizzle(comp X, comp Y, comp Z); GLM_FUNC_DECL tref3<T> swizzle(comp X, comp Y, comp Z);
}; };

View File

@ -575,6 +575,18 @@ namespace detail
(*this)[w]); (*this)[w]);
} }
template <typename T>
GLM_FUNC_QUALIFIER tref2<T> tvec3<T>::swizzle
(
comp x,
comp y
)
{
return tref2<T>(
(*this)[x],
(*this)[y]);
}
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tref3<T> tvec3<T>::swizzle GLM_FUNC_QUALIFIER tref3<T> tvec3<T>::swizzle
( (

View File

@ -190,6 +190,8 @@ namespace detail
GLM_FUNC_DECL tvec2<T> swizzle(comp X, comp Y) const; GLM_FUNC_DECL tvec2<T> swizzle(comp X, comp Y) const;
GLM_FUNC_DECL tvec3<T> swizzle(comp X, comp Y, comp Z) const; GLM_FUNC_DECL tvec3<T> swizzle(comp X, comp Y, comp Z) const;
GLM_FUNC_DECL tvec4<T> swizzle(comp X, comp Y, comp Z, comp W) const; GLM_FUNC_DECL tvec4<T> swizzle(comp X, comp Y, comp Z, comp W) const;
GLM_FUNC_DECL tref2<T> swizzle(comp X, comp Y);
GLM_FUNC_DECL tref3<T> swizzle(comp X, comp Y, comp Z);
GLM_FUNC_DECL tref4<T> swizzle(comp X, comp Y, comp Z, comp W); GLM_FUNC_DECL tref4<T> swizzle(comp X, comp Y, comp Z, comp W);
}; };

View File

@ -632,6 +632,32 @@ namespace detail
(*this)[w]); (*this)[w]);
} }
template <typename T>
GLM_FUNC_QUALIFIER tref2<T> tvec4<T>::swizzle
(
comp x,
comp y
)
{
return tref2<T>(
(*this)[x],
(*this)[y]);
}
template <typename T>
GLM_FUNC_QUALIFIER tref3<T> tvec4<T>::swizzle
(
comp x,
comp y,
comp z
)
{
return tref3<T>(
(*this)[x],
(*this)[y],
(*this)[z]);
}
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tref4<T> tvec4<T>::swizzle GLM_FUNC_QUALIFIER tref4<T> tvec4<T>::swizzle
( (