Added assert to ensure lerp is used in the correct range of value

This commit is contained in:
Christophe Riccio 2012-12-23 12:34:55 +01:00
parent cd043f2ee2
commit 9926506c7f

View File

@ -480,6 +480,10 @@ namespace detail
T const & a T const & a
) )
{ {
// Lerp is only defined in [0, 1]
assert(a >= T(0));
assert(a <= T(1));
return x * (T(1) - a) + (y * a); return x * (T(1) - a) + (y * a);
} }