fbxmatrix.h

Go to the documentation of this file.
00001 /****************************************************************************************
00002  
00003    Copyright (C) 2012 Autodesk, Inc.
00004    All rights reserved.
00005  
00006    Use of this software is subject to the terms of the Autodesk license agreement
00007    provided at the time of installation or download, or which otherwise accompanies
00008    this software in either electronic or hard copy form.
00009  
00010 ****************************************************************************************/
00011 
00013 #ifndef _FBXSDK_CORE_MATH_MATRIX_H_
00014 #define _FBXSDK_CORE_MATH_MATRIX_H_
00015 
00016 #include <fbxsdk/fbxsdk_def.h>
00017 
00018 #include <fbxsdk/core/math/fbxvector4.h>
00019 
00020 #include <fbxsdk/fbxsdk_nsbegin.h>
00021 
00022 class FbxAMatrix;
00023 
00027 class FBXSDK_DLL FbxMatrix : public FbxDouble4x4
00028 {
00029 public:
00034 
00035         FbxMatrix();
00036 
00040         FbxMatrix(const FbxMatrix& pM);
00041 
00047         FbxMatrix(const FbxVector4& pT, const FbxVector4& pR, const FbxVector4& pS);
00048 
00054         FbxMatrix(const FbxVector4& pT, const FbxQuaternion& pQ, const FbxVector4& pS);
00055 
00062         FbxMatrix(const FbxVector4& pRow0, const FbxVector4& pRow1, const FbxVector4& pRow2, const FbxVector4& pRow3);
00063 
00082         FbxMatrix(  const double& p00, const double& p10, const double& p20, const double& p30,
00083                     const double& p01, const double& p11, const double& p21, const double& p31,
00084                     const double& p02, const double& p12, const double& p22, const double& p32,
00085                     const double& p03, const double& p13, const double& p23, const double& p33);
00086 
00090         FbxMatrix(const FbxAMatrix& pM);
00091             
00093         ~FbxMatrix ();
00095 
00105         double Get(int pY, int pX) const;
00106 
00111         FbxVector4 GetRow(int pY) const;
00112 
00117         FbxVector4 GetColumn(int pX) const;
00118 
00124         void Set(int pY, int pX, double pValue);
00125 
00127         void SetIdentity();
00128 
00134         void SetTRS(const FbxVector4& pT, const FbxVector4& pR, const FbxVector4& pS);
00135 
00141         void SetTQS(const FbxVector4& pT, const FbxQuaternion& pQ, const FbxVector4& pS);
00142 
00147         void SetRow(int pY, const FbxVector4& pRow);
00148 
00153         void SetColumn(int pX, const FbxVector4& pColumn);
00154 
00163         void GetElements(FbxVector4& pTranslation, FbxQuaternion& pRotation, FbxVector4& pShearing, FbxVector4& pScaling, double& pSign) const;
00164 
00168         FbxMatrix& operator=(const FbxMatrix& pMatrix);
00170 
00178         FbxMatrix operator-() const;
00179 
00184         FbxMatrix operator+(const FbxMatrix& pMatrix) const;
00185 
00190         FbxMatrix operator-(const FbxMatrix& pMatrix) const;
00191 
00196         FbxMatrix operator*(const FbxMatrix& pMatrix) const;
00197 
00202         FbxMatrix& operator+=(const FbxMatrix& pMatrix);
00203 
00208         FbxMatrix& operator-=(const FbxMatrix& pMatrix);
00209 
00214         FbxMatrix& operator*=(const FbxMatrix& pMatrix);
00215 
00219         FbxMatrix Inverse() const;
00220 
00224         FbxMatrix Transpose() const;
00226 
00235         FbxVector4 MultNormalize(const FbxVector4& pVector) const;
00237 
00246         bool operator==(const FbxMatrix & pM) const;
00247 
00252         bool operator==(const FbxAMatrix & pM) const;
00253 
00258         bool operator!=(const FbxMatrix & pM) const;
00259 
00264         bool operator!=(const FbxAMatrix & pM) const;
00266 
00271 
00272         operator double* ();
00273 
00275         operator const double* () const;
00276 
00278         typedef const double(kDouble44)[4][4] ;
00279 
00281         inline kDouble44 & Double44() const { return *((kDouble44 *)&mData); }
00283 
00285 //
00286 //  WARNING!
00287 //
00288 //  Anything beyond these lines may not be documented accurately and is 
00289 //  subject to change without notice.
00290 //
00292 #ifndef DOXYGEN_SHOULD_SKIP_THIS    
00293     int Compare(const FbxMatrix pM, const double pThreshold = FBXSDK_TOLERANCE) const;
00294     int Compare(const FbxAMatrix pM, const double pThreshold = FBXSDK_TOLERANCE) const;
00295 
00296     FbxMatrix operator*(double pValue) const;
00297     FbxMatrix& operator*=(double pValue);
00298 
00299     double LUDecomposition(FbxVector4& pVector);
00300     FbxMatrix LUMult(FbxMatrix pM, const FbxVector4& pVector) const;
00301     double Determinant() const;
00302 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00303 };
00304 
00305 #include <fbxsdk/fbxsdk_nsend.h>
00306 
00307 #endif /* _FBXSDK_CORE_MATH_MATRIX_H_ */