00001 00009 #ifndef _QUAT_H_ 00010 #define _QUAT_H_ 00011 00012 #include <math.h> 00013 #include "Point.h" 00014 00015 typedef double mat44[4][4]; 00016 00017 namespace MeshLib 00018 { 00019 00023 class CQrot 00024 { 00025 public: 00029 CQrot(){m_w=1; m_x=m_y=m_z=0;}; 00030 00039 CQrot( double w, double x, double y, double z) 00040 { 00041 m_w = w; 00042 m_x = x; 00043 m_y = y; 00044 m_z = z; 00045 }; 00046 00050 CQrot( const CQrot & q ) 00051 { 00052 m_w = q.m_w; 00053 m_x = q.m_x; 00054 m_y = q.m_y; 00055 m_z = q.m_z; 00056 } 00057 00061 CQrot & operator=(const CQrot & q) 00062 { 00063 m_w = q.m_w; 00064 m_x = q.m_x; 00065 m_y = q.m_y; 00066 m_z = q.m_z; 00067 return *this; 00068 } 00069 00072 ~CQrot(){}; 00073 00079 CQrot& operator^(double p); 00080 00084 void convert( double * m); 00085 00090 CPoint operator*( const CPoint & p ); 00091 00092 public: 00096 double m_w,m_x,m_y,m_z; 00100 void normalize(); 00106 CQrot operator*( const CQrot & q ) const; 00112 double operator^( const CQrot & q ) const; 00113 }; 00114 00115 } 00116 #endif