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
00032 class FXAPI FXMat3d {
00033 protected:
00034 FXVec3d m[3];
00035 public:
00036
00037 FXMat3d(){}
00038 FXMat3d(FXdouble w);
00039 FXMat3d(FXdouble a00,FXdouble a01,FXdouble a02,
00040 FXdouble a10,FXdouble a11,FXdouble a12,
00041 FXdouble a20,FXdouble a21,FXdouble a22);
00042 FXMat3d(const FXVec3d& a,const FXVec3d& b,const FXVec3d& c);
00043 FXMat3d(const FXMat3d& other);
00044
00045
00046 FXMat3d& operator=(const FXMat3d& other);
00047 FXMat3d& operator=(FXdouble w);
00048 FXMat3d& operator+=(const FXMat3d& w);
00049 FXMat3d& operator-=(const FXMat3d& w);
00050 FXMat3d& operator*=(FXdouble w);
00051 FXMat3d& operator*=(const FXMat3d& w);
00052 FXMat3d& operator/=(FXdouble w);
00053
00054
00055 FXVec3d& operator[](FXint i){return m[i];}
00056 const FXVec3d& operator[](FXint i) const {return m[i];}
00057
00058
00059 operator FXdouble*(){return m[0];}
00060 operator const FXdouble*() const {return m[0];}
00061
00062
00063 friend FXAPI FXMat3d operator+(const FXMat3d& a,const FXMat3d& b);
00064 friend FXAPI FXMat3d operator-(const FXMat3d& a,const FXMat3d& b);
00065 friend FXAPI FXMat3d operator-(const FXMat3d& a);
00066 friend FXAPI FXMat3d operator*(const FXMat3d& a,const FXMat3d& b);
00067 friend FXAPI FXMat3d operator*(FXdouble x,const FXMat3d& a);
00068 friend FXAPI FXMat3d operator*(const FXMat3d& a,FXdouble x);
00069 friend FXAPI FXMat3d operator/(const FXMat3d& a,FXdouble x);
00070 friend FXAPI FXMat3d operator/(FXdouble x,const FXMat3d& a);
00071
00072
00073 friend FXAPI FXVec3d operator*(const FXVec3d& v,const FXMat3d& m);
00074 friend FXAPI FXVec3d operator*(const FXMat3d& a,const FXVec3d& v);
00075
00076
00077 friend FXAPI FXVec2d operator*(const FXVec2d& v,const FXMat3d& m);
00078 friend FXAPI FXVec2d operator*(const FXMat3d& a,const FXVec2d& v);
00079
00080
00081 FXMat3d& eye();
00082
00083
00084 FXMat3d& rot(FXdouble c,FXdouble s);
00085 FXMat3d& rot(FXdouble phi);
00086
00087
00088 FXMat3d& trans(FXdouble tx,FXdouble ty);
00089
00090
00091 FXMat3d& scale(FXdouble sx,FXdouble sy);
00092 FXMat3d& scale(FXdouble s);
00093
00094
00095 friend FXAPI FXdouble det(const FXMat3d& m);
00096
00097
00098 friend FXAPI FXMat3d transpose(const FXMat3d& m);
00099
00100
00101 friend FXAPI FXMat3d invert(const FXMat3d& m);
00102
00103
00104 friend FXAPI FXStream& operator<<(FXStream& store,const FXMat3d& m);
00105
00106
00107 friend FXAPI FXStream& operator>>(FXStream& store,FXMat3d& m);
00108 };
00109
00110 }
00111
00112 #endif