diff --git a/src/Math/Vector.h b/src/Math/Vector.h index 3ec9a3d69..ffeac7f40 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -22,6 +22,8 @@ #include #include +#include "constants.h" + namespace Magnum { namespace Math { /** @brief Vector */ @@ -80,7 +82,10 @@ template class Vector { /** @brief Equality operator */ inline bool operator==(const Vector& other) const { - return memcmp(_data, other.data(), size*sizeof(T)) == 0; + for(size_t pos = 0; pos != size; ++pos) + if(std::abs(at(pos) - other.at(pos)) >= EPSILON) return false; + + return true; } /** @brief Non-equality operator */