Fix `CVector3f::canBeNormalized`

This commit is contained in:
Phillip Stephens 2017-11-18 01:17:40 -08:00
parent f370b22b3b
commit b94b2cdd02
2 changed files with 5 additions and 1 deletions

View File

@ -341,7 +341,10 @@ public:
inline bool isNormalized() const { return std::fabs(1.f - magSquared()) < 0.01f; } inline bool isNormalized() const { return std::fabs(1.f - magSquared()) < 0.01f; }
inline bool canBeNormalized() const { return !isNormalized(); } inline bool canBeNormalized() const
{
return (x < FLT_EPSILON || y < FLT_EPSILON || z < FLT_EPSILON);
}
inline bool isZero() const { return magSquared() <= 1.1920929e-7f; } inline bool isZero() const { return magSquared() <= 1.1920929e-7f; }

View File

@ -1,6 +1,7 @@
#ifndef MATH_HPP #ifndef MATH_HPP
#define MATH_HPP #define MATH_HPP
#include <float.h>
#undef min #undef min
#undef max #undef max