Documentation


basicFrames.h

Go to the documentation of this file.
00001 #ifndef animal_frame_h______________________________
00002 #define animal_frame_h______________________________
00003 
00004 
00005 namespace animal
00006 {
00007 //======================= Bases ==================================
00014 
00018 template<class Vec1, class Basis, class Vec2>
00019 void v_eq_project_vec( Vec1& v, const Basis& b, const Vec2& a );
00020 
00024 template<class Basis1, class Basis2>
00025 void b_eq_inverse( Basis1& b, const Basis2& a );
00026 
00029 template<class Basis,class Real>
00030 void b_eq_eulerX( Basis& b, Real a );
00031 
00034 template<class Basis,class Real>
00035 void b_eq_eulerY( Basis& b, Real a );
00036 
00039 template<class Basis,class Real>
00040 void b_eq_eulerZ( Basis& b, Real a );
00041 
00042 
00046 template<class Basis,class Real>
00047 void b_eq_eulerXYZ( Basis& b, Real a, Real b, Real c );
00048 
00049 /* TODO: 
00050 
00051 template<class Real, class Basis>
00052 void getEulerXYZ( Real& a, Real& b, Real& c, const Basis&b );
00053 
00054 template<class Real, class Basis>
00055 void b_eq_rotationAxisAngle( Basis& b, Real ax, Real ay, Real az, Real angle );
00056 
00057 template<class Real, class Basis>
00058 void getRotationAxisAngle( Real& ax, Real& ay, Real& az, Real& angle, const Basis& b);
00059 
00060 template<class Quaternion, class Basis>
00061 void getQuaternion( Quaternion& q, const Basis& b );
00062 
00063 template<class Quaternion, class Basis>
00064 void b_eq_quaternion( Basis& b, const Quaternion& q );
00065 */
00066 
00067 //======================= Frames ==================================
00068 
00069 
00070 /* Project point a from frame f to another frame.
00071 f (typically a basis and a translation vector) defines the reference frame of point a with respect to the other reference frame.
00072 \sa{f_eq_inverse}
00073 */
00074 template<class Vec1, class Frame, class Vec2>
00075 void v_eq_project_point( Vec1& v, const Frame& f, const Vec2& a );
00076 
00077 /* Compute inverse of frame transform a and stores it in f. 
00078 Frame f can then be used to project points to frame a.
00079 \pre{ a must not be singular }
00080 \sa{v_eq_project_point}
00081 */
00082 template<class Frame>
00083 void f_eq_inverse( Frame& f, const Frame& a );
00084 
00085 
00086 
00087 
00088 //======================= default Frame class =============================
00091 template<int N=3, class Real=float>
00092 struct Frame
00093 {
00094     typedef  Array<N,Real> Vec;     
00095     typedef Array< N,Vec > Basis; 
00096     
00098     Frame();
00099     
00101     Frame( const Basis& b, const Vec& t );
00102 
00103     Basis basis; 
00104     Vec displacement; 
00105 };
00106 
00108 template<class Basis, class Vec>
00109 const Vec& get_translation( const Frame<Basis,Vec>& f );
00110  
00112 template<class Basis, class Vec>
00113 Vec& set_translation( Frame<Basis,Vec>& f );
00114  
00116 template<class Basis, class Vec>
00117 const Basis& get_basis( const Frame<Basis,Vec>& f );
00118  
00120 template<class Basis, class Vec>
00121 Basis& set_basis( Frame<Basis,Vec>& f );
00122  
00126 }// animal
00127 
00128 
00129 
00130 
00131 #endif

Generated on Thu Dec 23 13:52:23 2004 by doxygen 1.3.6