fbxsdk/scene/fbxaxissystem.h Source File
 
 
 
fbxsdk/scene/fbxaxissystem.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_SCENE_AXIS_SYSTEM_H_
00014 #define _FBXSDK_SCENE_AXIS_SYSTEM_H_
00015 
00016 #include <fbxsdk/fbxsdk_def.h>
00017 
00018 #include <fbxsdk/core/base/fbxarray.h>
00019 #include <fbxsdk/core/base/fbxstring.h>
00020 
00021 #include <fbxsdk/fbxsdk_nsbegin.h>
00022 
00097 class FBXSDK_DLL FbxAxisSystem
00098 {
00099 public:
00100 
00103     enum EUpVector
00104         {
00105         eXAxis = 1,
00106         eYAxis = 2,
00107         eZAxis = 3
00108     };
00109     
00117     enum EFrontVector
00118         {
00119         eParityEven = 1,
00120         eParityOdd = 2
00121     };
00122 
00128     enum ECoordSystem
00129         {
00130         eRightHanded,
00131         eLeftHanded
00132     };
00133 
00137     enum EPreDefinedAxisSystem
00138         {
00139         eMayaZUp,                       
00140         eMayaYUp,                       
00141         eMax,                           
00142         eMotionBuilder,         
00143         eOpenGL,                        
00144         eDirectX,                       
00145         eLightwave                      
00146     };
00147 
00152                 FbxAxisSystem();
00153 
00159                 FbxAxisSystem(EUpVector pUpVector, EFrontVector pFrontVector, ECoordSystem pCoorSystem);
00160 
00164                 FbxAxisSystem(const FbxAxisSystem& pAxisSystem);
00165 
00169                 FbxAxisSystem(const EPreDefinedAxisSystem pAxisSystem);
00170 
00172                 virtual ~FbxAxisSystem();
00174 
00179 
00184     bool operator==(const FbxAxisSystem& pAxisSystem)const;
00185 
00190     bool operator!=(const FbxAxisSystem& pAxisSystem)const;
00192 
00196     FbxAxisSystem& operator=(const FbxAxisSystem& pAxisSystem);
00197 
00203 
00205     static const FbxAxisSystem MayaZUp;
00206 
00208     static const FbxAxisSystem MayaYUp;
00209 
00211     static const FbxAxisSystem Max;
00212 
00214     static const FbxAxisSystem Motionbuilder;
00215 
00217     static const FbxAxisSystem OpenGL;
00218 
00220     static const FbxAxisSystem DirectX;
00221 
00223     static const FbxAxisSystem Lightwave;
00225 
00229     void ConvertScene(FbxScene* pScene) const;
00230 
00237     void ConvertScene(FbxScene* pScene, FbxNode* pFbxRoot) const;
00238         
00243     EFrontVector GetFrontVector( int & pSign ) const;
00244 
00249     EUpVector GetUpVector( int & pSign ) const;
00250 
00254     ECoordSystem GetCoorSystem() const;
00255 
00263     void ConvertChildren(FbxNode* pRoot, const FbxAxisSystem& pSrcSystem) const;
00264 
00265 /*****************************************************************************************************************************
00266 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
00267 *****************************************************************************************************************************/
00268 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00269 protected:
00270         class AxisDef
00271         {
00272         public:
00273                 enum EAxis {eXAxis, eYAxis, eZAxis};
00274                 bool operator==(const AxisDef& pAxis) const { return (mAxis == pAxis.mAxis) && (mSign == pAxis.mSign); }
00275                 EAxis   mAxis;
00276                 int             mSign;
00277         };
00278 
00279     AxisDef mUpVector;
00280     AxisDef mFrontVector;
00281     AxisDef mCoorSystem;
00282 
00283     void ConvertTProperty(FbxArray<FbxNode*>& pNodes, const FbxAxisSystem& pFrom) const;
00284     void ConvertCurveNodes(FbxArray<FbxAnimCurveNode*>& pCurveNodes, const FbxAxisSystem& pFrom) const;
00285     void AdjustPreRotation(FbxNode* pNode, const FbxMatrix& pConversionRM) const;
00286     void AdjustPivots(FbxNode* pNode, const FbxMatrix& pConversionRM) const;
00287     void GetConversionMatrix(const FbxAxisSystem& pFrom, FbxMatrix& pConversionRM) const;
00288     void AdjustLimits(FbxNode* pNode, const FbxMatrix& pConversionRM) const;
00289     void AdjustPoses(FbxScene* pScene, const FbxMatrix& pConversionRM) const;
00290     void AdjustCamera(FbxNode* pNode, const FbxMatrix& pConversionRM ) const;
00291     void AdjustCluster(FbxNode* pNode, const FbxMatrix& pConversionRM) const;
00292     void ConvertChildren(FbxNode* pRoot, const FbxAxisSystem& pSrcSystem, bool pSubChildrenOnly) const;
00293 
00294     friend class FbxGlobalSettings;
00295 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
00296 };
00297 
00298 #include <fbxsdk/fbxsdk_nsend.h>
00299 
00300 #endif /* _FBXSDK_SCENE_AXIS_SYSTEM_H_ */