Updated GLM_GTC_swizzle extension + tests
This commit is contained in:
@@ -42,10 +42,15 @@ namespace glm
|
||||
comp x, comp y, comp z);
|
||||
|
||||
template <typename T>
|
||||
inline detail::tref4<T> swizzle(
|
||||
detail::tvec4<T> swizzle(
|
||||
detail::tvec4<T> const & v,
|
||||
comp x, comp y, comp z, comp w);
|
||||
|
||||
template <typename T>
|
||||
detail::tref4<T> swizzle(
|
||||
detail::tvec4<T> & v,
|
||||
comp x, comp y, comp z, comp w);
|
||||
|
||||
}//namespace swizzle
|
||||
}//namespace gtc
|
||||
}//namespace glm
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace glm{
|
||||
namespace gtc{
|
||||
namespace glm_gtc_swizzle
|
||||
namespace swizzle
|
||||
{
|
||||
template <typename T>
|
||||
inline T swizzle
|
||||
@@ -38,15 +38,97 @@ namespace glm_gtc_swizzle
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline detail::tref4<T> swizzle
|
||||
inline detail::tvec4<T> swizzle
|
||||
(
|
||||
detail::tvec4<T> const & v,
|
||||
comp x, comp y, comp z, comp w
|
||||
)
|
||||
{
|
||||
return detail::tvec4<T>(v[x], v[y], v[z], v[w]);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline detail::tref4<T> swizzle
|
||||
(
|
||||
detail::tvec4<T> & v,
|
||||
comp x, comp y, comp z, comp w
|
||||
)
|
||||
{
|
||||
return detail::tref4<T>(v[x], v[y], v[z], v[w]);
|
||||
}
|
||||
|
||||
}//namespace glm_gtc_swizzle
|
||||
template <comp X>
|
||||
inline int swizzle
|
||||
(
|
||||
detail::tvec4<int> const & v
|
||||
)
|
||||
{
|
||||
return v[X];
|
||||
}
|
||||
|
||||
template <comp X>
|
||||
inline float swizzle
|
||||
(
|
||||
detail::tvec4<float> const & v
|
||||
)
|
||||
{
|
||||
return v[X];
|
||||
}
|
||||
|
||||
template <comp X, comp Y>
|
||||
inline detail::tvec2<int> swizzle
|
||||
(
|
||||
detail::tvec4<int> const & v
|
||||
)
|
||||
{
|
||||
return detail::tvec2<int>(v[X], v[Y]);
|
||||
}
|
||||
|
||||
template <comp X, comp Y>
|
||||
inline detail::tvec2<float> swizzle
|
||||
(
|
||||
detail::tvec4<float> const & v
|
||||
)
|
||||
{
|
||||
return detail::tvec2<float>(v[X], v[Y]);
|
||||
}
|
||||
|
||||
template <comp X, comp Y, comp Z>
|
||||
inline detail::tvec3<int> swizzle
|
||||
(
|
||||
detail::tvec4<int> const & v
|
||||
)
|
||||
{
|
||||
return detail::tvec3<int>(v[X], v[Y], v[Z]);
|
||||
}
|
||||
|
||||
template <comp X, comp Y, comp Z>
|
||||
inline detail::tvec3<float> swizzle
|
||||
(
|
||||
detail::tvec4<float> const & v
|
||||
)
|
||||
{
|
||||
return detail::tvec3<float>(v[X], v[Y], v[Z]);
|
||||
}
|
||||
|
||||
template <comp X, comp Y, comp Z, comp W>
|
||||
inline detail::tvec4<int> swizzle
|
||||
(
|
||||
detail::tvec4<int> const & v
|
||||
)
|
||||
{
|
||||
return detail::tvec4<int>(v[X], v[Y], v[Z], v[W]);
|
||||
}
|
||||
|
||||
template <comp X, comp Y, comp Z, comp W>
|
||||
inline detail::tvec4<float> swizzle
|
||||
(
|
||||
detail::tvec4<float> const & v
|
||||
)
|
||||
{
|
||||
return detail::tvec4<float>(v[X], v[Y], v[Z], v[W]);
|
||||
}
|
||||
|
||||
}//namespace swizzle
|
||||
}//namespace gtc
|
||||
}//namespace glm
|
||||
|
||||
Reference in New Issue
Block a user