Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

AxisAngleOps.h

Go to the documentation of this file.
00001 /************************************************************** ggt-head beg
00002  *
00003  * GGT: Generic Graphics Toolkit
00004  *
00005  * Original Authors:
00006  *   Allen Bierbaum
00007  *
00008  * -----------------------------------------------------------------
00009  * File:          $RCSfile: AxisAngleOps.h,v $
00010  * Date modified: $Date: 2003/03/03 00:54:04 $
00011  * Version:       $Revision: 1.3 $
00012  * -----------------------------------------------------------------
00013  *
00014  *********************************************************** ggt-head end */
00015 /*************************************************************** ggt-cpr beg
00016 *
00017 * GGT: The Generic Graphics Toolkit
00018 * Copyright (C) 2001,2002 Allen Bierbaum 
00019 *
00020 * This library is free software; you can redistribute it and/or
00021 * modify it under the terms of the GNU Lesser General Public
00022 * License as published by the Free Software Foundation; either
00023 * version 2.1 of the License, or (at your option) any later version.
00024 *
00025 * This library is distributed in the hope that it will be useful,
00026 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00027 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00028 * Lesser General Public License for more details.
00029 *
00030 * You should have received a copy of the GNU Lesser General Public
00031 * License along with this library; if not, write to the Free Software
00032 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00033 *
00034  ************************************************************ ggt-cpr end */
00035 #ifndef EULER_ANGLE_OPS
00036 #define EULER_ANGLE_OPS
00037 
00038 #include <gmtl/AxisAngle.h>
00039 
00040 namespace gmtl
00041 {
00042 
00056 template<class DATA_TYPE>
00057 inline bool operator==(const AxisAngle<DATA_TYPE>& a1,
00058                        const AxisAngle<DATA_TYPE>& a2)
00059 {
00060    // @todo metaprogramming.
00061    if (a1[0] != a2[0]) return false;
00062    if (a1[1] != a2[1]) return false;
00063    if (a1[2] != a2[2]) return false;
00064    if (a1[3] != a2[3]) return false;
00065    return true;
00066 }
00067 
00076 template<class DATA_TYPE>
00077 inline bool operator!=(const AxisAngle<DATA_TYPE>& a1,
00078                        const AxisAngle<DATA_TYPE>& a2)
00079 {
00080    return !(a1 == a2);
00081 }
00082 
00095 template<class DATA_TYPE>
00096 inline bool isEqual( const AxisAngle<DATA_TYPE>& a1,
00097                      const AxisAngle<DATA_TYPE>& a2, 
00098                      const DATA_TYPE& eps = (DATA_TYPE)0 )
00099 {
00100    gmtlASSERT( eps >= (DATA_TYPE)0 );
00101    
00102    // @todo metaprogramming.
00103    if (!Math::isEqual( a1[0], a2[0], eps )) return false;
00104    if (!Math::isEqual( a1[1], a2[1], eps )) return false;
00105    if (!Math::isEqual( a1[2], a2[2], eps )) return false;
00106    if (!Math::isEqual( a1[3], a2[3], eps )) return false;
00107    return true;
00108 }
00109 
00110 // @todo write isEquiv function for AxisAngle
00111 
00112 
00115 } // namespace
00116 
00117 #endif

Generated on Mon Apr 7 15:28:54 2003 for GenericMathTemplateLibrary by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002