BOX2: added compare operators

This commit is contained in:
Tomasz Włostowski 2018-10-10 17:26:00 +02:00
parent 9b027628ef
commit 576b918351
1 changed files with 18 additions and 0 deletions
include/math

View File

@ -496,6 +496,24 @@ public:
{
return sqrt( SquaredDistance( aBox ) );
}
bool operator==( const BOX2<Vec>& aOther ) const
{
auto t1 ( *this );
auto t2 ( aOther );
t1.Normalize();
t2.Normalize();
return ( t1.m_Pos == t2.m_Pos && t1.m_Size == t2.m_Size );
}
bool operator!=( const BOX2<Vec>& aOther ) const
{
auto t1 ( *this );
auto t2 ( aOther );
t1.Normalize();
t2.Normalize();
return ( t1.m_Pos != t2.m_Pos || t1.m_Size != t2.m_Size );
}
};
/* Default specializations */