FMath/FMMatrix44.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2005-2006 Feeling Software Inc.
00003     MIT License: http://www.opensource.org/licenses/mit-license.php
00004 */
00005 
00011 #ifndef _FM_MATRIX44_H_
00012 #define _FM_MATRIX44_H_
00013 
00019 class FCOLLADA_EXPORT FMMatrix44
00020 {
00021 public:
00022     float m[4][4];  
00033     FMMatrix44(const float* _m);
00034 
00040     #ifndef _DEBUG
00041     FMMatrix44() {}
00042     #else
00043     FMMatrix44() { memset(m, 55, 16 * sizeof(float)); }
00044     #endif 
00045 
00055     operator float*() { return &m[0][0]; }
00056 
00066     operator const float*() const { return &m[0][0]; }
00067 
00074     float* operator[](int a) { return m[a]; }
00075 
00082     const float* operator[](int a) const { return m[a]; }
00083 
00091     FMMatrix44& operator=(const FMMatrix44& copy);
00092 
00098     FMMatrix44 Transposed() const;
00099 
00105     FMMatrix44 Inverted() const;
00106     
00117     void Decompose(FMVector3& Scale, FMVector3& Rotation, FMVector3& Translation, float& inverted) const;
00118 
00125     FMVector3 TransformCoordinate(const FMVector3& coordinate) const;
00126 
00133     FMVector3 TransformVector(const FMVector3& v) const;
00134 
00140     FMVector3 GetTranslation() const;
00141 
00142 public:
00143     static FMMatrix44 Identity; 
00154     static FMMatrix44 TranslationMatrix(const FMVector3& translation);
00155 
00164     static FMMatrix44 AxisRotationMatrix(const FMVector3& axis, float angle);
00165 };
00166 
00174 FMMatrix44 FCOLLADA_EXPORT operator*(const FMMatrix44& m1, const FMMatrix44& m2);
00175 
00182 bool IsEquivalent(const FMMatrix44& m1, const FMMatrix44& m2);
00183 
00190 inline bool operator==(const FMMatrix44& m1, const FMMatrix44& m2) { return IsEquivalent(m1, m2); }
00191 
00193 typedef vector<FMMatrix44> FMMatrix44List;
00194 
00195 #endif // _FM_MATRIX44_H_

Generated on Fri May 12 16:44:39 2006 for FCollada by  doxygen 1.4.6-NO