mirror of
https://github.com/g-truc/glm.git
synced 2025-04-07 22:40:17 +00:00
Fixed ticket #111, missing swizzle operations
This commit is contained in:
parent
21942860b9
commit
d75db9b8e4
4 changed files with 41 additions and 0 deletions
|
@ -178,6 +178,7 @@ namespace detail
|
|||
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 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);
|
||||
};
|
||||
|
||||
|
|
|
@ -575,6 +575,18 @@ namespace detail
|
|||
(*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>
|
||||
GLM_FUNC_QUALIFIER tref3<T> tvec3<T>::swizzle
|
||||
(
|
||||
|
|
|
@ -190,6 +190,8 @@ namespace detail
|
|||
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 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);
|
||||
};
|
||||
|
||||
|
|
|
@ -632,6 +632,32 @@ namespace detail
|
|||
(*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>
|
||||
GLM_FUNC_QUALIFIER tref4<T> tvec4<T>::swizzle
|
||||
(
|
||||
|
|
Loading…
Add table
Reference in a new issue