Update SurroundProfiles.cpp

This commit is contained in:
Jack Andersen 2016-05-10 19:48:22 -10:00
parent 1102d50f8f
commit 02cfa9cf39
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));
}