This commit is contained in:
Jack Andersen 2016-05-11 11:31:00 -10:00
commit 233c53ac57
1 changed files with 3 additions and 1 deletions

View File

@ -12,7 +12,9 @@ static float Dot(const Vector3f& a, const Vector3f& b)
static float Length(const Vector3f& a)
{
if (a[0] <= FLT_EPSILON && a[1] <= FLT_EPSILON && a[2] <= FLT_EPSILON)
if (std::fabs(a[0]) <= FLT_EPSILON &&
std::fabs(a[1]) <= FLT_EPSILON &&
std::fabs(a[2]) <= FLT_EPSILON)
return 0.f;
return std::sqrt(Dot(a, a));
}