Return value clamped to range.
You can find more information in comments below.
template<class TYPE>
constexpr TYPE Clamp(const TYPE x, const TYPE min_val, const TYPE max_val); // Return x if it's between min_val and max_val. Return min_val if x is less than min_val. Return max_val if x is greater than max_val
template<class TYPE>
TVec1<TYPE> Clamp(const TVec1<TYPE> &v, const TYPE min_val, const TYPE max_val); // Return vector clamped to range
template<class TYPE>
TVec1<TYPE> Clamp(const TVec1<TYPE> &v, const TVec1<TYPE> &min_val, const TVec1<TYPE> &max_val); // Return vector clamped to range
template<class TYPE>
TVec2<TYPE> Clamp(const TVec2<TYPE> &v, const TYPE min_val, const TYPE max_val); // Return vector clamped to range
template<class TYPE>
TVec2<TYPE> Clamp(const TVec2<TYPE> &v, const TVec2<TYPE> &min_val, const TVec2<TYPE> &max_val); // Return vector clamped to range
template<class TYPE>
TVec3<TYPE> Clamp(const TVec3<TYPE> &v, const TYPE min_val, const TYPE max_val); // Return vector clamped to range
template<class TYPE>
TVec3<TYPE> Clamp(const TVec3<TYPE> &v, const TVec3<TYPE> &min_val, const TVec3<TYPE> &max_val); // Return vector clamped to range
template<class TYPE>
TVec4<TYPE> Clamp(const TVec4<TYPE> &v, const TYPE min_val, const TYPE max_val); // Return vector clamped to range
template<class TYPE>
TVec4<TYPE> Clamp(const TVec4<TYPE> &v, const TVec4<TYPE> &min_val, const TVec4<TYPE> &max_val); // Return vector clamped to range
Namespace: | ntl |
Include: |
NTL/Core/Utils.h (For non-object arguments) NTL/Core/Vec1.h (For TVec1 arguments) NTL/Core/Vec2.h (For TVec2 arguments) NTL/Core/Vec3.h (For TVec3 arguments) NTL/Core/Vec4.h (For TVec4 arguments) |