kfbxvector4.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_KFBXMATH_KFBXVECTOR4_H
00005 #define FBXFILESDK_KFBXMATH_KFBXVECTOR4_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright (C) 2001 - 2010 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/components/kbaselib/klib/karrayul.h>
00044 
00045 #include <fbxfilesdk/kfbxplugins/kfbxtypes.h>
00046 
00047 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00048 class KFbxQuaternion;
00052     class KFBX_DLL KFbxVector4 : public fbxDouble4
00053     {
00054 
00055     public:
00056 
00061 
00063     KFbxVector4();
00064 
00068     KFbxVector4(const KFbxVector4& pVector4);
00069 
00076     KFbxVector4(double pX, double pY, double pZ, double pW = 1.0);
00077 
00081     KFbxVector4(const double pValue[4]);
00082 
00087     KFbxVector4(const fbxDouble3& pValue);
00088 
00090     ~KFbxVector4();
00091 
00093 
00098     
00103     KFbxVector4& operator=(const KFbxVector4& pVector4);
00104 
00109     KFbxVector4& operator=(const double* pValue);
00110     
00116     KFbxVector4& operator=(const fbxDouble3& pValue);
00117 
00123     double& operator[](int pIndex);
00124 
00130     const double & operator[](int pIndex) const;
00131 
00137     double GetAt(int pIndex) const;
00138 
00144     void SetAt(int pIndex, double pValue);
00145 
00152     void Set(double pX, double pY, double pZ, double pW = 1.0);
00153     
00155 
00160 
00166     KFbxVector4 operator+(double pValue) const;
00167 
00173     KFbxVector4 operator-(double pValue) const;
00174 
00180     KFbxVector4 operator*(double pValue) const;
00181 
00187     KFbxVector4 operator/(double pValue) const;
00188 
00194     KFbxVector4& operator+=(double pValue);
00195 
00201     KFbxVector4& operator-=(double pValue);
00202 
00208     KFbxVector4& operator*=(double pValue);
00209 
00215     KFbxVector4& operator/=(double pValue);
00216     
00218 
00223 
00227     KFbxVector4 operator-() const;
00228     
00234     KFbxVector4 operator+(const KFbxVector4& pVector) const;
00235 
00241     KFbxVector4 operator-(const KFbxVector4& pVector) const;
00242 
00248     KFbxVector4 operator*(const KFbxVector4& pVector) const;
00249 
00255     KFbxVector4 operator/(const KFbxVector4& pVector) const;
00256 
00262     KFbxVector4& operator+=(const KFbxVector4& pVector);
00263 
00269     KFbxVector4& operator-=(const KFbxVector4& pVector);
00270 
00276     KFbxVector4& operator*=(const KFbxVector4& pVector);
00277     
00283     KFbxVector4& operator/=(const KFbxVector4& pVector);
00284 
00290     double DotProduct(const KFbxVector4& pVector) const;
00291 
00297     KFbxVector4 CrossProduct(const KFbxVector4& pVector) const;
00298 
00307     static bool AxisAlignmentInEulerAngle(const KFbxVector4 & pAB, 
00308                                           const KFbxVector4 & pA, 
00309                                           const KFbxVector4 & pB, 
00310                                           KFbxVector4& pAngles);
00311     
00313 
00318 
00323     bool operator==(const KFbxVector4 & pVector) const;
00324 
00329     bool operator!=(const KFbxVector4 & pVector) const;
00330     
00332 
00337 
00342     double Length() const;
00343 
00348     double SquareLength() const;
00349 
00355     double Distance(const KFbxVector4& pVector) const;
00356 
00360     void Normalize();
00361 
00362 
00366     void SetXYZ(const KFbxQuaternion pQuat);
00367 
00369 
00374 
00376     operator double* ();
00377 
00379     operator const double* () const;
00380 
00382 
00383     // Fix value like 1.#IND, 1.#INF, nan, and inf
00384     void FixWeirdValue();
00385 
00387     //
00388     //  WARNING!
00389     //
00390     //  Anything beyond these lines may not be documented accurately and is 
00391     //  subject to change without notice.
00392     //
00394 
00395     #ifndef DOXYGEN_SHOULD_SKIP_THIS    
00396 
00397 
00398 
00399     #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00400 
00401     };
00402 
00403     typedef  class KFBX_DLL KArrayTemplate<KFbxVector4>             KArrayKFbxVector4;
00404     typedef KFbxVector4* HKFbxVector4;
00405 
00406     inline EFbxType FbxTypeOf( KFbxVector4  const &pItem )  { return eDOUBLE4; }
00407 
00408 
00409 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00410 
00411 #endif // FBXFILESDK_KFBXMATH_KFBXVECTOR4_H
00412