kfbxquaternion.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_KFBXMATH_KFBXQUATERNION_H
00005 #define FBXFILESDK_KFBXMATH_KFBXQUATERNION_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright (C) 2001 - 2009 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material 
00013  (collectively the "Data") in these files contain unpublished information 
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00015  Canada and United States of America federal copyright law and by international 
00016  treaties. 
00017  
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00028  
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE. 
00039 
00040 **************************************************************************************/
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042 
00043 #include <fbxfilesdk/kfbxmath/kfbxvector4.h>
00044 
00045 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00046 
00050 class KFBX_DLL KFbxQuaternion : public fbxDouble4
00051     {
00052 
00053     public:
00054 
00059 
00061         KFbxQuaternion();
00062 
00066         KFbxQuaternion(const KFbxQuaternion& pV);
00067 
00074         KFbxQuaternion(double pX, double pY, double pZ, double pW = 1.0);
00075         
00077         ~KFbxQuaternion();
00078 
00080 
00085         
00089         KFbxQuaternion& operator=(const KFbxQuaternion& pQuaternion);
00090         
00096         double& operator[](int pIndex);
00097 
00103         const double& operator[](int pIndex) const;
00104 
00110         double GetAt(int pIndex) const;
00111 
00117         void SetAt(int pIndex, double pValue);
00118 
00125         void Set(double pX, double pY, double pZ, double pW = 1.0);
00126         
00128 
00133         
00139         KFbxQuaternion operator+(double pValue) const;
00140 
00146         KFbxQuaternion operator-(double pValue) const;
00147 
00153         KFbxQuaternion operator*(double pValue) const;
00154 
00160         KFbxQuaternion operator/(double pValue) const;
00161 
00167         KFbxQuaternion& operator+=(double pValue);
00168 
00174         KFbxQuaternion& operator-=(double pValue);
00175 
00181         KFbxQuaternion& operator*=(double pValue);
00182 
00188         KFbxQuaternion& operator/=(double pValue);
00189         
00191 
00196 
00200         KFbxQuaternion operator-() const;
00201         
00207         KFbxQuaternion operator+(const KFbxQuaternion& pQuaternion) const;
00208 
00214         KFbxQuaternion operator-(const KFbxQuaternion& pQuaternion) const;
00215 
00221         KFbxQuaternion operator*(const KFbxQuaternion& pQuaternion) const;
00222 
00228         KFbxQuaternion operator/(const KFbxQuaternion& pQuaternion) const;
00229 
00235         KFbxQuaternion& operator+=(const KFbxQuaternion& pQuaternion);
00236 
00242         KFbxQuaternion& operator-=(const KFbxQuaternion& pQuaternion);
00243 
00249         KFbxQuaternion& operator*=(const KFbxQuaternion& pQuaternion);
00250         
00256         KFbxQuaternion& operator/=(const KFbxQuaternion& pQuaternion);
00257 
00262         KFbxQuaternion Product(const KFbxQuaternion& pQuaternion) const;
00263 
00266         void           Normalize();
00267 
00271         void           Conjugate();
00272 
00276         void           ComposeSphericalXYZ(const KFbxVector4 pEuler);
00277 
00281         KFbxVector4    DecomposeSphericalXYZ() const;
00282         
00284 
00289 
00294         bool operator==(const KFbxQuaternion & pV) const;
00295         
00300         bool operator!=(const KFbxQuaternion & pV) const;
00301         
00303 
00308 
00310         operator double* ();
00311 
00313         operator const double* () const;
00314         
00316 
00317 
00319     //
00320     //  WARNING!
00321     //
00322     //  Anything beyond these lines may not be documented accurately and is 
00323     //  subject to change without notice.
00324     //
00326 
00327     #ifndef DOXYGEN_SHOULD_SKIP_THIS    
00328         void GetKFbxQuaternionFromPositionToPosition(const KFbxVector4 &pP0, const KFbxVector4 &pP1);
00329     #endif //doxygen
00330 
00331     };
00332 
00333     inline EFbxType FbxTypeOf( KFbxQuaternion const &pItem )    { return eDOUBLE4; }
00334 
00335 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00336 
00337 #endif // FBXFILESDK_KFBXMATH_KFBXQUATERNION_H
00338