maths: allow mix's t to lie outside [0,1] a little
This commit is contained in:
parent
c9dea18881
commit
deb787847c
@ -688,8 +688,9 @@ namespace util {
|
|||||||
std::enable_if_t<std::is_floating_point<T>::value, U>
|
std::enable_if_t<std::is_floating_point<T>::value, U>
|
||||||
mix (U a, U b, T t)
|
mix (U a, U b, T t)
|
||||||
{
|
{
|
||||||
assert (t >= 0);
|
// give some tolerance for floating point rounding
|
||||||
assert (t <= 1);
|
assert (t >= -0.00001f);
|
||||||
|
assert (t <= 1.00001f);
|
||||||
|
|
||||||
return a * (1 - t) + b * t;
|
return a * (1 - t) + b * t;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user