CVector3f/CVector2f: Fix isZero

This commit is contained in:
Luke Street 2020-09-16 00:41:47 -04:00
parent f99184556a
commit 58c8a902ac
2 changed files with 2 additions and 2 deletions

View File

@ -184,7 +184,7 @@ public:
return std::fabs(x()) >= FLT_EPSILON || std::fabs(y()) >= FLT_EPSILON; return std::fabs(x()) >= FLT_EPSILON || std::fabs(y()) >= FLT_EPSILON;
} }
[[nodiscard]] bool isZero() const { return magSquared() <= FLT_EPSILON; } [[nodiscard]] bool isZero() const { return mSimd[0] == 0.f && mSimd[1] == 0.f; }
[[nodiscard]] bool isEqu(const CVector2f& other, float epsilon = FLT_EPSILON) const { [[nodiscard]] bool isEqu(const CVector2f& other, float epsilon = FLT_EPSILON) const {
const CVector2f diffVec = other - *this; const CVector2f diffVec = other - *this;

View File

@ -162,7 +162,7 @@ public:
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);
} }
[[nodiscard]] bool isZero() const { return magSquared() <= FLT_EPSILON; } [[nodiscard]] bool isZero() const { return mSimd[0] == 0.f && mSimd[1] == 0.f && mSimd[2] == 0.f; }
void scaleToLength(float newLength) { void scaleToLength(float newLength) {
float length = magSquared(); float length = magSquared();