mirror of
https://github.com/g-truc/glm.git
synced 2024-11-29 11:24:35 +00:00
Added GLM_GTC_swizzle
This commit is contained in:
parent
872f23c5a9
commit
d5c4dc0aeb
@ -24,11 +24,11 @@ namespace glm
|
||||
|
||||
namespace gtc{
|
||||
//! GLM_GTC_swizzle extension
|
||||
namespace glm_gtc_swizzle{
|
||||
namespace swizzle{
|
||||
|
||||
|
||||
|
||||
}//namespace closest_point
|
||||
}//namespace swizzle
|
||||
}//namespace gtc
|
||||
}//namespace glm
|
||||
|
||||
|
@ -3,58 +3,48 @@ namespace gtc{
|
||||
namespace glm_gtc_swizzle
|
||||
{
|
||||
template <typename T>
|
||||
inline typename tvec4<T>::value_type swizzle
|
||||
inline T swizzle
|
||||
(
|
||||
detail::tvec4<T> const & v,
|
||||
comp x
|
||||
) const
|
||||
)
|
||||
{
|
||||
return v[x];
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline tvec2<T> tvec4<T>::swizzle
|
||||
inline detail::tvec2<T> swizzle
|
||||
(
|
||||
detail::tvec4<T> const & v,
|
||||
comp x, comp y
|
||||
) const
|
||||
)
|
||||
{
|
||||
return tvec2<T>(
|
||||
(*this)[x],
|
||||
(*this)[y]);
|
||||
return detail::tvec2<T>(
|
||||
v[x],
|
||||
v[y]);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline tvec3<T> tvec4<T>::swizzle
|
||||
inline detail::tvec3<T> swizzle
|
||||
(
|
||||
detail::tvec4<T> const & v,
|
||||
comp x, comp y, comp z
|
||||
) const
|
||||
)
|
||||
{
|
||||
return tvec3<T>(
|
||||
(*this)[x],
|
||||
(*this)[y],
|
||||
(*this)[z]);
|
||||
return detail::tvec3<T>(
|
||||
v[x],
|
||||
v[y],
|
||||
v[z]);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline tvec4<T> tvec4<T>::swizzle
|
||||
(
|
||||
detail::tvec4<T> const & v,
|
||||
comp x, comp y, comp z, comp w
|
||||
) const
|
||||
{
|
||||
return tvec4<T>(v[x], v[y], v[z], v[w]);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline tref4<T> swizzle
|
||||
inline detail::tref4<T> swizzle
|
||||
(
|
||||
detail::tvec4<T> const & v,
|
||||
comp x, comp y, comp z, comp w
|
||||
)
|
||||
{
|
||||
return tref4<T>(v[x], v[y], v[z], v[w]);
|
||||
return detail::tref4<T>(v[x], v[y], v[z], v[w]);
|
||||
}
|
||||
|
||||
}//namespace glm_gtc_swizzle
|
||||
|
Loading…
Reference in New Issue
Block a user