Template Function TRAP::Math::Clamp(const Vec<L, T>&, const Vec<L, T>&, const Vec<L, T>&)#

Function Documentation#

template<u32 L, typename T>
constexpr Vec<L, T> TRAP::Math::Clamp(const Vec<L, T> &x, const Vec<L, T> &minVal, const Vec<L, T> &maxVal)#

Constrain x to lie between minVal and maxVal.

Parameters:
  • x – Specify the value to constrain.

  • minVal – Specify the lower end of the range into which to constrain x.

  • maxVal – Specify the upper end of the range into which to constrain x.

Returns:

Min(Max(x, minval), maxVal) for each component in x using the floating-point values minval and maxVal.