• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

RayOps.h

Go to the documentation of this file.
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_RAYOPS_H_
00007 #define _GMTL_RAYOPS_H_
00008 
00009 #include <gmtl/Ray.h>
00010 
00011 namespace gmtl {
00012 
00013 //--- Ray Comparitor ---//
00022 template< class DATA_TYPE >
00023 inline bool operator==( const Ray<DATA_TYPE>& ls1, const Ray<DATA_TYPE>& ls2 )
00024 {
00025    return ( (ls1.mOrigin == ls2.mOrigin) && (ls1.mDir == ls2.mDir) );
00026 }
00027 
00036 template< class DATA_TYPE >
00037 inline bool operator!=( const Ray<DATA_TYPE>& ls1,
00038                         const Ray<DATA_TYPE>& ls2 )
00039 {
00040    return ( ! (ls1 == ls2) );
00041 }
00042 
00055 template< class DATA_TYPE >
00056 inline bool isEqual( const Ray<DATA_TYPE>& ls1,
00057                      const Ray<DATA_TYPE>& ls2,
00058                      const DATA_TYPE& eps )
00059 {
00060    gmtlASSERT( eps >= 0 );
00061    return ( (isEqual(ls1.mOrigin, ls2.mOrigin, eps)) &&
00062             (isEqual(ls1.mDir, ls2.mDir, eps)) );
00063 }
00064 
00065 } // namespace gmtl
00066 #endif

Generated on Sun Sep 19 2010 14:35:14 for GenericMathTemplateLibrary by  doxygen 1.7.1