00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FXMAT3D_H
00025 #define FXMAT3D_H
00026
00027
00028 namespace FX {
00029
00030
00031 class FXQuatd;
00032
00033
00035 class FXAPI FXMat3d {
00036 protected:
00037 FXVec3d m[3];
00038 public:
00039
00041 FXMat3d(){}
00042
00044 FXMat3d(const FXMat3d& other);
00045
00047 FXMat3d(FXdouble w);
00048
00050 FXMat3d(FXdouble a00,FXdouble a01,FXdouble a02,
00051 FXdouble a10,FXdouble a11,FXdouble a12,
00052 FXdouble a20,FXdouble a21,FXdouble a22);
00053
00055 FXMat3d(const FXVec3d& a,const FXVec3d& b,const FXVec3d& c);
00056
00058 FXMat3d(const FXQuatd& quat);
00059
00061 FXMat3d& operator=(const FXMat3d& other);
00062 FXMat3d& operator=(FXdouble w);
00063
00065 FXMat3d& set(const FXMat3d& other);
00066
00068 FXMat3d& set(FXdouble w);
00069
00071 FXMat3d& set(FXdouble a00,FXdouble a01,FXdouble a02,
00072 FXdouble a10,FXdouble a11,FXdouble a12,
00073 FXdouble a20,FXdouble a21,FXdouble a22);
00074
00076 FXMat3d& set(const FXVec3d& a,const FXVec3d& b,const FXVec3d& c);
00077
00079 FXMat3d& set(const FXQuatd& quat);
00080
00082 FXMat3d& operator+=(const FXMat3d& w);
00083 FXMat3d& operator-=(const FXMat3d& w);
00084 FXMat3d& operator*=(FXdouble w);
00085 FXMat3d& operator*=(const FXMat3d& w);
00086 FXMat3d& operator/=(FXdouble w);
00087
00089 FXVec3d& operator[](FXint i){return m[i];}
00090 const FXVec3d& operator[](FXint i) const {return m[i];}
00091
00093 operator FXdouble*(){return m[0];}
00094 operator const FXdouble*() const {return m[0];}
00095
00097 FXMat3d operator-() const;
00098
00100 FXMat3d operator+(const FXMat3d& w) const;
00101 FXMat3d operator-(const FXMat3d& w) const;
00102 FXMat3d operator*(const FXMat3d& w) const;
00103
00105 FXVec3d operator*(const FXVec3d& v) const;
00106 FXVec2d operator*(const FXVec2d& v) const;
00107
00109 friend FXAPI FXMat3d operator*(FXdouble x,const FXMat3d& a);
00110 friend FXAPI FXMat3d operator*(const FXMat3d& a,FXdouble x);
00111 friend FXAPI FXMat3d operator/(const FXMat3d& a,FXdouble x);
00112 friend FXAPI FXMat3d operator/(FXdouble x,const FXMat3d& a);
00113
00115 FXMat3d& eye();
00116
00118 FXMat3d& rot(FXdouble c,FXdouble s);
00119 FXMat3d& rot(FXdouble phi);
00120
00122 FXMat3d& trans(FXdouble tx,FXdouble ty);
00123
00125 FXMat3d& scale(FXdouble sx,FXdouble sy);
00126 FXMat3d& scale(FXdouble s);
00127
00129 FXdouble det() const;
00130
00132 FXMat3d transpose() const;
00133
00135 FXMat3d invert() const;
00136
00138 friend FXAPI FXStream& operator<<(FXStream& store,const FXMat3d& m);
00139
00141 friend FXAPI FXStream& operator>>(FXStream& store,FXMat3d& m);
00142 };
00143
00144 extern FXAPI FXMat3d operator*(FXdouble x,const FXMat3d& a);
00145 extern FXAPI FXMat3d operator*(const FXMat3d& a,FXdouble x);
00146 extern FXAPI FXMat3d operator/(const FXMat3d& a,FXdouble x);
00147 extern FXAPI FXMat3d operator/(FXdouble x,const FXMat3d& a);
00148
00149 extern FXAPI FXStream& operator<<(FXStream& store,const FXMat3d& m);
00150 extern FXAPI FXStream& operator>>(FXStream& store,FXMat3d& m);
00151
00152 }
00153
00154 #endif