00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FXMAT3F_H
00022 #define FXMAT3F_H
00023
00024
00025 namespace FX {
00026
00027
00028 class FXQuatf;
00029 class FXMat4f;
00030
00031
00032
00033 class FXAPI FXMat3f {
00034 protected:
00035 FXVec3f m[3];
00036 public:
00037
00038
00039 FXMat3f(){}
00040
00041
00042 FXMat3f(FXfloat s);
00043
00044
00045 FXMat3f(const FXMat3f& s);
00046
00047
00048 FXMat3f(const FXMat4f& s);
00049
00050
00051 FXMat3f(const FXfloat s[]);
00052
00053
00054 FXMat3f(FXfloat a,FXfloat b,FXfloat c);
00055
00056
00057 FXMat3f(FXfloat a00,FXfloat a01,FXfloat a02,
00058 FXfloat a10,FXfloat a11,FXfloat a12,
00059 FXfloat a20,FXfloat a21,FXfloat a22);
00060
00061
00062 FXMat3f(const FXVec3f& a,const FXVec3f& b,const FXVec3f& c);
00063
00064
00065 FXMat3f(const FXQuatf& quat);
00066
00067
00068 FXMat3f& operator=(FXfloat s);
00069
00070
00071 FXMat3f& operator=(const FXMat3f& s);
00072 FXMat3f& operator=(const FXMat4f& s);
00073
00074
00075 FXMat3f& operator=(const FXfloat s[]);
00076
00077
00078 FXMat3f& set(FXfloat s);
00079
00080
00081 FXMat3f& set(const FXMat3f& s);
00082
00083
00084 FXMat3f& set(const FXMat4f& s);
00085
00086
00087 FXMat3f& set(const FXfloat s[]);
00088
00089
00090 FXMat3f& set(FXfloat a,FXfloat b,FXfloat c);
00091
00092
00093 FXMat3f& set(FXfloat a00,FXfloat a01,FXfloat a02,
00094 FXfloat a10,FXfloat a11,FXfloat a12,
00095 FXfloat a20,FXfloat a21,FXfloat a22);
00096
00097
00098 FXMat3f& set(const FXVec3f& a,const FXVec3f& b,const FXVec3f& c);
00099
00100
00101 FXMat3f& set(const FXQuatf& quat);
00102
00103
00104 FXMat3f& operator+=(const FXMat3f& w);
00105 FXMat3f& operator-=(const FXMat3f& w);
00106 FXMat3f& operator*=(const FXMat3f& w);
00107 FXMat3f& operator*=(FXfloat w);
00108 FXMat3f& operator/=(FXfloat w);
00109
00110
00111 FXVec3f& operator[](FXint i){return m[i];}
00112 const FXVec3f& operator[](FXint i) const {return m[i];}
00113
00114
00115 operator FXfloat*(){return m[0];}
00116 operator const FXfloat*() const {return m[0];}
00117
00118
00119 FXMat3f operator-() const;
00120
00121
00122 FXMat3f& identity();
00123
00124
00125 FXbool isIdentity() const;
00126
00127
00128 FXMat3f& rot(FXfloat c,FXfloat s);
00129 FXMat3f& rot(FXfloat phi);
00130
00131
00132 FXMat3f& trans(FXfloat tx,FXfloat ty);
00133
00134
00135 FXMat3f& scale(FXfloat sx,FXfloat sy);
00136 FXMat3f& scale(FXfloat s);
00137
00138
00139 FXfloat det() const;
00140
00141
00142 FXMat3f transpose() const;
00143
00144
00145 FXMat3f invert() const;
00146 };
00147
00148
00149
00150 extern FXAPI FXVec2f operator*(const FXMat3f& m,const FXVec2f& v);
00151 extern FXAPI FXVec3f operator*(const FXMat3f& m,const FXVec3f& v);
00152
00153
00154 extern FXAPI FXVec2f operator*(const FXVec2f& v,const FXMat3f& m);
00155 extern FXAPI FXVec3f operator*(const FXVec3f& v,const FXMat3f& m);
00156
00157
00158 extern FXAPI FXMat3f operator+(const FXMat3f& a,const FXMat3f& b);
00159 extern FXAPI FXMat3f operator-(const FXMat3f& a,const FXMat3f& b);
00160
00161
00162 extern FXAPI FXMat3f operator*(const FXMat3f& a,const FXMat3f& b);
00163
00164
00165 extern FXAPI FXMat3f operator*(FXfloat x,const FXMat3f& a);
00166 extern FXAPI FXMat3f operator*(const FXMat3f& a,FXfloat x);
00167 extern FXAPI FXMat3f operator/(const FXMat3f& a,FXfloat x);
00168 extern FXAPI FXMat3f operator/(FXfloat x,const FXMat3f& a);
00169
00170
00171 extern FXAPI FXbool operator==(const FXMat3f& a,const FXMat3f& b);
00172 extern FXAPI FXbool operator!=(const FXMat3f& a,const FXMat3f& b);
00173 extern FXAPI FXbool operator==(const FXMat3f& a,FXfloat n);
00174 extern FXAPI FXbool operator!=(const FXMat3f& a,FXfloat n);
00175 extern FXAPI FXbool operator==(FXfloat n,const FXMat3f& a);
00176 extern FXAPI FXbool operator!=(FXfloat n,const FXMat3f& a);
00177
00178
00179 extern FXAPI FXStream& operator<<(FXStream& store,const FXMat3f& m);
00180
00181
00182 extern FXAPI FXStream& operator>>(FXStream& store,FXMat3f& m);
00183
00184 }
00185
00186 #endif