From 6f67371bb1b46579ae837d0e0c61ac1b291be743 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sat, 13 Jan 2018 07:51:33 +0500 Subject: Directory renamed --- external/include/glm/gtx/wrap.inl | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 external/include/glm/gtx/wrap.inl (limited to 'external/include/glm/gtx/wrap.inl') diff --git a/external/include/glm/gtx/wrap.inl b/external/include/glm/gtx/wrap.inl new file mode 100644 index 0000000..941a803 --- /dev/null +++ b/external/include/glm/gtx/wrap.inl @@ -0,0 +1,58 @@ +/// @ref gtx_wrap +/// @file glm/gtx/wrap.inl + +namespace glm +{ + template class vecType> + GLM_FUNC_QUALIFIER vecType clamp(vecType const& Texcoord) + { + return glm::clamp(Texcoord, vecType(0), vecType(1)); + } + + template + GLM_FUNC_QUALIFIER genType clamp(genType const & Texcoord) + { + return clamp(tvec1(Texcoord)).x; + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType repeat(vecType const& Texcoord) + { + return glm::fract(Texcoord); + } + + template + GLM_FUNC_QUALIFIER genType repeat(genType const & Texcoord) + { + return repeat(tvec1(Texcoord)).x; + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType mirrorClamp(vecType const& Texcoord) + { + return glm::fract(glm::abs(Texcoord)); + } + + template + GLM_FUNC_QUALIFIER genType mirrorClamp(genType const & Texcoord) + { + return mirrorClamp(tvec1(Texcoord)).x; + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType mirrorRepeat(vecType const& Texcoord) + { + vecType const Abs = glm::abs(Texcoord); + vecType const Clamp = glm::mod(glm::floor(Abs), vecType(2)); + vecType const Floor = glm::floor(Abs); + vecType const Rest = Abs - Floor; + vecType const Mirror = Clamp + Rest; + return mix(Rest, vecType(1) - Rest, glm::greaterThanEqual(Mirror, vecType(1))); + } + + template + GLM_FUNC_QUALIFIER genType mirrorRepeat(genType const& Texcoord) + { + return mirrorRepeat(tvec1(Texcoord)).x; + } +}//namespace glm -- cgit v1.2.3