mirror of https://github.com/AxioDL/zeus.git
Minor fixes
This commit is contained in:
parent
bf416af1ed
commit
82c2a2d85b
|
@ -152,12 +152,12 @@ public:
|
|||
|
||||
static CVector3f slerp(const CVector3f& a, const CVector3f& b, CRelAngle clampAngle);
|
||||
|
||||
bool isNormalized() const { return std::fabs(1.f - magSquared()) < 0.01f; }
|
||||
bool isNormalized() const { return std::fabs(1.f - magSquared()) <= FLT_EPSILON; }
|
||||
|
||||
bool canBeNormalized() const {
|
||||
if (std::isinf(x()) || std::isinf(y()) || std::isinf(z()))
|
||||
return false;
|
||||
return std::fabs(x()) >= FLT_EPSILON || std::fabs(y()) >= FLT_EPSILON || std::fabs(z()) >= FLT_EPSILON;
|
||||
return !(std::fabs(x()) < FLT_EPSILON && std::fabs(y()) < FLT_EPSILON && std::fabs(z()) < FLT_EPSILON);
|
||||
}
|
||||
|
||||
bool isZero() const { return magSquared() <= FLT_EPSILON; }
|
||||
|
|
|
@ -157,15 +157,15 @@ typename std::enable_if<std::is_enum<E>::value, int>::type PopCount(E e) {
|
|||
return PopCount(static_cast<typename std::underlying_type<E>::type>(e));
|
||||
}
|
||||
|
||||
bool close_enough(const CVector3f& a, const CVector3f& b, float epsilon = 0.000099999997f);
|
||||
bool close_enough(const CVector3f& a, const CVector3f& b, float epsilon = FLT_EPSILON);
|
||||
|
||||
bool close_enough(const CVector2f& a, const CVector2f& b, float epsilon = 0.000099999997f);
|
||||
bool close_enough(const CVector2f& a, const CVector2f& b, float epsilon = FLT_EPSILON);
|
||||
|
||||
inline bool close_enough(float a, float b, double epsilon = 0.000009999999747378752) {
|
||||
inline bool close_enough(float a, float b, double epsilon = FLT_EPSILON) {
|
||||
return std::fabs(a - b) < epsilon;
|
||||
}
|
||||
|
||||
inline bool close_enough(double a, double b, double epsilon = 0.000009999999747378752) {
|
||||
inline bool close_enough(double a, double b, double epsilon = FLT_EPSILON) {
|
||||
return std::fabs(a - b) < epsilon;
|
||||
}
|
||||
} // namespace zeus
|
||||
|
|
Loading…
Reference in New Issue