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

EulerAngleOps.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_EULER_ANGLE_OPS_H_
00007 #define _GMTL_EULER_ANGLE_OPS_H_
00008 
00009 #include <gmtl/EulerAngle.h>
00010 
00011 namespace gmtl
00012 {
00013 
00027 template<class DATA_TYPE, typename ROT_ORDER>
00028 inline bool operator==(const EulerAngle<DATA_TYPE, ROT_ORDER>& e1,
00029                        const EulerAngle<DATA_TYPE, ROT_ORDER>& e2)
00030 {
00031    // @todo metaprogramming.
00032    if (e1[0] != e2[0]) return false;
00033    if (e1[1] != e2[1]) return false;
00034    if (e1[2] != e2[2]) return false;
00035    return true;
00036 }
00037 
00046 template<class DATA_TYPE, typename ROT_ORDER>
00047 inline bool operator!=(const EulerAngle<DATA_TYPE, ROT_ORDER>& e1,
00048                        const EulerAngle<DATA_TYPE, ROT_ORDER>& e2)
00049 {
00050    return(! (e1 == e2));
00051 }
00052 
00065 template<class DATA_TYPE, typename ROT_ORDER>
00066 inline bool isEqual( const EulerAngle<DATA_TYPE, ROT_ORDER>& e1,
00067                      const EulerAngle<DATA_TYPE, ROT_ORDER>& e2,
00068                      const DATA_TYPE eps = 0 )
00069 {
00070    gmtlASSERT(eps >= (DATA_TYPE)0);
00071    
00072    // @todo metaprogramming.
00073    if (!Math::isEqual( e1[0], e2[0], eps )) return false;
00074    if (!Math::isEqual( e1[1], e2[1], eps )) return false;
00075    if (!Math::isEqual( e1[2], e2[2], eps )) return false;
00076    return true;
00077 }
00078 
00079 // @todo write isEquiv function for EulerAngle
00080 
00081 
00084 } // namespace
00085 
00086 #endif

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