/// @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