fbxsdk/core/math/fbxquaternion.h Source File
 
 
 
fbxsdk/core/math/fbxquaternion.h
Go to the documentation of this file.
00001 /****************************************************************************************
00002  
00003    Copyright (C) 2013 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_QUATERNION_H_
00014 #define _FBXSDK_CORE_MATH_QUATERNION_H_
00015 
00016 #include <fbxsdk/fbxsdk_def.h>
00017 
00018 #include <fbxsdk/core/math/fbxvector4.h>
00019 
00020 #include <fbxsdk/fbxsdk_nsbegin.h>
00021 
00027 class FBXSDK_DLL FbxQuaternion : public FbxDouble4
00028 {
00029 public:
00037                 FbxQuaternion();
00038 
00042                 FbxQuaternion(const FbxQuaternion& pV);
00043 
00050                 FbxQuaternion(double pX, double pY, double pZ, double pW = 1.0);
00051                     
00053                 ~FbxQuaternion();
00055 
00063                 FbxQuaternion& operator=(const FbxQuaternion& pQuaternion);
00064                     
00070                 double& operator[](int pIndex);
00071 
00077                 const double& operator[](int pIndex) const;
00078 
00084                 double GetAt(int pIndex) const;
00085 
00091                 void SetAt(int pIndex, double pValue);
00092 
00099                 void Set(double pX, double pY, double pZ, double pW = 1.0);
00101 
00110                 FbxQuaternion operator+(double pValue) const;
00111 
00116                 FbxQuaternion operator-(double pValue) const;
00117 
00123                 FbxQuaternion operator*(double pValue) const;
00124 
00130                 FbxQuaternion operator/(double pValue) const;
00131 
00136                 FbxQuaternion& operator+=(double pValue);
00137 
00142                 FbxQuaternion& operator-=(double pValue);
00143 
00149                 FbxQuaternion& operator*=(double pValue);
00150 
00156                 FbxQuaternion& operator/=(double pValue);
00158 
00166                 FbxQuaternion operator-() const;
00167                     
00173                 FbxQuaternion operator+(const FbxQuaternion& pQuaternion) const;
00174 
00180                 FbxQuaternion operator-(const FbxQuaternion& pQuaternion) const;
00181 
00187                 FbxQuaternion operator*(const FbxQuaternion& pOther) const;
00188 
00194                 FbxQuaternion operator/(const FbxQuaternion& pOther) const;
00195 
00201                 FbxQuaternion& operator+=(const FbxQuaternion& pQuaternion);
00202 
00208                 FbxQuaternion& operator-=(const FbxQuaternion& pQuaternion);
00209 
00215                 FbxQuaternion& operator*=(const FbxQuaternion& pOther);
00216                         
00222                 FbxQuaternion& operator/=(const FbxQuaternion& pOther);
00223 
00228                 FbxQuaternion Product(const FbxQuaternion& pOther) const;
00229 
00234                 double DotProduct(const FbxQuaternion& pQuaternion) const;
00235 
00238                 void Normalize();
00239 
00243                 void Conjugate();
00244 
00248                 double Length();
00249 
00255                 void Inverse();
00256 
00260                 void ComposeSphericalXYZ(const FbxVector4 pEuler);
00261 
00265                 FbxVector4 DecomposeSphericalXYZ() const;
00267 
00276                 bool operator==(const FbxQuaternion & pV) const;
00277                     
00282                 bool operator!=(const FbxQuaternion & pV) const;
00284 
00289 
00290                 operator double* ();
00291 
00293                 operator const double* () const;
00295 
00306                 int Compare(const FbxQuaternion &pQ2, const double pThreshold = FBXSDK_TOLERANCE) const;
00308 
00309 /*****************************************************************************************************************************
00310 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
00311 *****************************************************************************************************************************/
00312 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00313     void GetQuaternionFromPositionToPosition(const FbxVector4 &pP0, const FbxVector4 &pP1);
00314 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
00315 };
00316 
00317 #include <fbxsdk/fbxsdk_nsend.h>
00318 
00319 #endif /* _FBXSDK_CORE_MATH_QUATERNION_H_ */