Make equals method symmetric

This commit is contained in:
savilli
2023-12-21 02:14:54 +01:00
committed by sfan5
parent b349266855
commit dda9b23c3d
3 changed files with 15 additions and 38 deletions

View File

@ -111,11 +111,10 @@ public:
//! Checks if this vector equals the other one.
/** Takes floating point rounding errors into account.
\param other Vector to compare with.
\param tolerance Epsilon value for both - comparing X and Y.
\return True if the two vector are (almost) equal, else false. */
bool equals(const vector2d<T>& other, const T tolerance = (T)ROUNDING_ERROR_f32 ) const
bool equals(const vector2d<T>& other) const
{
return core::equals(X, other.X, tolerance) && core::equals(Y, other.Y, tolerance);
return core::equals(X, other.X) && core::equals(Y, other.Y);
}
vector2d<T>& set(T nx, T ny) {X=nx; Y=ny; return *this; }