kfbxquaternion.h

Go to the documentation of this file.
00001 /****************************************************************************************
00002 
00003    Copyright (C) 2010 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 
00015 #ifndef FBXFILESDK_KFBXMATH_KFBXQUATERNION_H
00016 #define FBXFILESDK_KFBXMATH_KFBXQUATERNION_H
00017 
00018 #include <fbxfilesdk/fbxfilesdk_def.h>
00019 
00020 #include <fbxfilesdk/kfbxmath/kfbxvector4.h>
00021 
00022 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00023 
00029 class KFBX_DLL KFbxQuaternion : public fbxDouble4
00030     {
00031 
00032     public:
00033 
00038 
00040         KFbxQuaternion();
00041 
00045         KFbxQuaternion(const KFbxQuaternion& pV);
00046 
00053         KFbxQuaternion(double pX, double pY, double pZ, double pW = 1.0);
00054         
00056         ~KFbxQuaternion();
00057 
00059 
00064         
00068         KFbxQuaternion& operator=(const KFbxQuaternion& pQuaternion);
00069         
00075         double& operator[](int pIndex);
00076 
00082         const double& operator[](int pIndex) const;
00083 
00089         double GetAt(int pIndex) const;
00090 
00096         void SetAt(int pIndex, double pValue);
00097 
00104         void Set(double pX, double pY, double pZ, double pW = 1.0);
00105         
00107 
00112         
00118         KFbxQuaternion operator+(double pValue) const;
00119 
00125         KFbxQuaternion operator-(double pValue) const;
00126 
00132         KFbxQuaternion operator*(double pValue) const;
00133 
00139         KFbxQuaternion operator/(double pValue) const;
00140 
00146         KFbxQuaternion& operator+=(double pValue);
00147 
00153         KFbxQuaternion& operator-=(double pValue);
00154 
00160         KFbxQuaternion& operator*=(double pValue);
00161 
00167         KFbxQuaternion& operator/=(double pValue);
00168         
00170 
00175 
00179         KFbxQuaternion operator-() const;
00180         
00186         KFbxQuaternion operator+(const KFbxQuaternion& pQuaternion) const;
00187 
00193         KFbxQuaternion operator-(const KFbxQuaternion& pQuaternion) const;
00194 
00200         KFbxQuaternion operator*(const KFbxQuaternion& pQuaternion) const;
00201 
00207         KFbxQuaternion operator/(const KFbxQuaternion& pQuaternion) const;
00208 
00214         KFbxQuaternion& operator+=(const KFbxQuaternion& pQuaternion);
00215 
00221         KFbxQuaternion& operator-=(const KFbxQuaternion& pQuaternion);
00222 
00228         KFbxQuaternion& operator*=(const KFbxQuaternion& pQuaternion);
00229         
00235         KFbxQuaternion& operator/=(const KFbxQuaternion& pQuaternion);
00236 
00241         KFbxQuaternion Product(const KFbxQuaternion& pQuaternion) const;
00242 
00247         double DotProduct(const KFbxQuaternion& pQuaternion) const;
00248 
00251         void Normalize();
00252 
00256         void Conjugate();
00257 
00261         double Length();
00262 
00267         void Inverse();
00268 
00272         void ComposeSphericalXYZ(const KFbxVector4 pEuler);
00273 
00277         KFbxVector4 DecomposeSphericalXYZ() const;
00278         
00280 
00285 
00290         bool operator==(const KFbxQuaternion & pV) const;
00291         
00296         bool operator!=(const KFbxQuaternion & pV) const;
00297         
00299 
00304 
00306         operator double* ();
00307 
00309         operator const double* () const;
00310         
00312 
00313 
00315     //
00316     //  WARNING!
00317     //
00318     //  Anything beyond these lines may not be documented accurately and is 
00319     //  subject to change without notice.
00320     //
00322 
00323     #ifndef DOXYGEN_SHOULD_SKIP_THIS    
00324         void GetKFbxQuaternionFromPositionToPosition(const KFbxVector4 &pP0, const KFbxVector4 &pP1);
00325     #endif //doxygen
00326 
00327     };
00328 
00329     inline EFbxType FbxTypeOf( KFbxQuaternion const &pItem )    { return eDOUBLE4; }
00330 
00331 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00332 
00333 #endif // FBXFILESDK_KFBXMATH_KFBXQUATERNION_H
00334