aabb: add equality operator

This commit is contained in:
Danny Robson 2015-04-13 16:44:30 +10:00
parent e9c0ed3f5f
commit 241ad65df9
2 changed files with 13 additions and 1 deletions

View File

@ -170,7 +170,7 @@ AABB<S,T>::cover (point<S,T> p)
} }
//----------------------------------------------------------------------------- ///////////////////////////////////////////////////////////////////////////////
template <size_t S, typename T> template <size_t S, typename T>
AABB<S,T> AABB<S,T>
AABB<S,T>::operator+ (vector<S,T> v) const AABB<S,T>::operator+ (vector<S,T> v) const
@ -188,6 +188,16 @@ AABB<S,T>::operator- (vector<S,T> v) const
} }
///////////////////////////////////////////////////////////////////////////////
template <size_t S, typename T>
bool
AABB<S,T>::operator== (const AABB<S,T> rhs) const
{
return rhs.p0 == p0 && rhs.p1 == p1;
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
namespace debug { namespace debug {
template <size_t S, typename T> template <size_t S, typename T>

View File

@ -54,6 +54,8 @@ namespace util {
AABB<S,T> operator+ (vector<S,T>) const; AABB<S,T> operator+ (vector<S,T>) const;
AABB<S,T> operator- (vector<S,T>) const; AABB<S,T> operator- (vector<S,T>) const;
bool operator== (AABB) const;
point<S,T> p0; point<S,T> p0;
point<S,T> p1; point<S,T> p1;
}; };