00001 // GMTL is (C) Copyright 2001-2010 by Allen Bierbaum 00002 // Distributed under the GNU Lesser General Public License 2.1 with an 00003 // addendum covering inlined code. (See accompanying files LICENSE and 00004 // LICENSE.addendum or http://www.gnu.org/copyleft/lesser.txt) 00005 00006 #ifndef _GMTL_SPHEREOPS_H_ 00007 #define _GMTL_SPHEREOPS_H_ 00008 00009 #include <gmtl/Sphere.h> 00010 #include <gmtl/VecOps.h> 00011 #include <gmtl/Math.h> 00012 00013 namespace gmtl 00014 { 00015 00029 template< class DATA_TYPE > 00030 inline bool operator==( const Sphere<DATA_TYPE>& s1, const Sphere<DATA_TYPE>& s2 ) 00031 { 00032 return ( (s1.mCenter == s2.mCenter) && (s1.mRadius == s2.mRadius) ); 00033 } 00034 00043 template< class DATA_TYPE > 00044 inline bool operator!=( const Sphere<DATA_TYPE>& s1, const Sphere<DATA_TYPE>& s2 ) 00045 { 00046 return (! (s1 == s2)); 00047 } 00048 00060 template< class DATA_TYPE > 00061 inline bool isEqual( const Sphere<DATA_TYPE>& s1, const Sphere<DATA_TYPE>& s2, const DATA_TYPE& eps ) 00062 { 00063 gmtlASSERT( eps >= 0 ); 00064 return ( (isEqual(s1.mCenter, s2.mCenter, eps)) && 00065 (Math::isEqual(s1.mRadius, s2.mRadius, eps)) ); 00066 } 00069 } // namespace gmtl 00070 00071 #endif 00072