Template Function TRAP::Math::Mix(const Vec<L, T>&, const Vec<L, T>&, const Vec<L, U>&)#
Function Documentation#
-
template<u32 L, typename T, typename U>
constexpr Vec<L, T> TRAP::Math::Mix(const Vec<L, T> &x, const Vec<L, T> &y, const Vec<L, U> &a)# Linearly interpolate between the values.
If genTypeU is a floating scalar or vector: Returns x * (1.0f - 1) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1].
If genTypeU is a boolean scalar or vector: Select which vector each returned component comes from. For a component of ‘a’ that is false, the corresponding component of ‘x’ is returned. For a component of ‘a’ that is true, the corresponding component of ‘y’ is returned. Components of ‘x’ and ‘y’ that are not selected are allowed to be invalid floating point values and will have no effect on the results.
- Parameters:
x – Specify the start of the range in which to interpolate.
y – Specify the end of the range in which to interpolate.
a – SPecify the value to use to interpolate between x and y.
- Returns:
See description.