Fix NaN in geom::slerp

This commit is contained in:
Nikita Lisitsa 2022-11-19 01:57:33 +03:00
parent c72b19d54e
commit 445ac3419e

View file

@ -370,7 +370,7 @@ namespace psemek::geom
// sin(x) Taylor series is less than the minimum value representable by T
static auto const threshold = std::pow(6 * std::numeric_limits<T>::min(), T{1}/T{3});
auto const omega = std::acos(dot(normalized(v0), normalized(v1)));
auto const omega = angle(normalized(v0), normalized(v1));
// NB: the case of omega ~ pi is ambiguous and isn't handled in any special way