kfbxaxissystem.h
Go to the documentation of this file.00001
00004 #ifndef _KFbxAxisSystem_h
00005 #define _KFbxAxisSystem_h
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include <kaydaradef.h>
00043 #ifndef KFBX_DLL
00044 #define KFBX_DLL K_DLLIMPORT
00045 #endif
00046
00047 #include <kaydara.h>
00048
00049 #include <klib/karrayul.h>
00050 #include <klib/kstring.h>
00051
00052 #ifndef MB_FBXSDK
00053 #include <kbaselib_nsuse.h>
00054 #endif
00055
00056 #include <kfcurve/kfcurve_forward.h>
00057 #ifndef MB_FBXSDK
00058 #include <kfcurve/kfcurve_nsuse.h>
00059 #endif
00060
00061 #include <kfbxmath/kfbxmatrix.h>
00062
00063 #include <fbxfilesdk_nsbegin.h>
00064
00065 class KFbxNode;
00066 class KFbxScene;
00067
00072 class KFBX_DLL KFbxAxisSystem
00073 {
00074 public:
00075
00081 enum eUpVector {
00082 XAxis = 1,
00083 YAxis = 2,
00084 ZAxis = 3
00085 };
00086
00087
00088
00089
00090
00091
00092 enum eFrontVector {
00093 ParityEven = 1,
00094 ParityOdd = 2
00095 };
00096
00097 enum eCoorSystem {
00098 RightHanded = 0,
00099 LeftHanded = 1
00100 };
00101
00102 enum ePreDefinedAxisSystem {
00103 eMayaZUp = 0,
00104 eMayaYUp,
00105 eMax,
00106 eMotionBuilder,
00107 eOpenGL,
00108 eDirectX,
00109 eLightwave
00110 };
00111
00112 KFbxAxisSystem(eUpVector pUpVector, eFrontVector pFrontVector, eCoorSystem pCoorSystem);
00113 KFbxAxisSystem(const KFbxAxisSystem& pAxisSystem);
00114 KFbxAxisSystem(const ePreDefinedAxisSystem pAxisSystem);
00115 virtual ~KFbxAxisSystem();
00116
00117 bool operator==(const KFbxAxisSystem& pAxisSystem)const;
00118 bool operator!=(const KFbxAxisSystem& pAxisSystem)const;
00119 KFbxAxisSystem& operator=(const KFbxAxisSystem& pAxisSystem);
00120
00121 static const KFbxAxisSystem MayaZUp;
00122 static const KFbxAxisSystem MayaYUp;
00123 static const KFbxAxisSystem Max;
00124 static const KFbxAxisSystem Motionbuilder;
00125 static const KFbxAxisSystem OpenGL;
00126 static const KFbxAxisSystem DirectX;
00127 static const KFbxAxisSystem Lightwave;
00128
00133 void ConvertScene(KFbxScene* pScene) const;
00134
00142 void ConvertScene(KFbxScene* pScene, KFbxNode* pFbxRoot) const;
00143
00147 eUpVector GetUpVector( int & pSign ) const;
00148
00151 eCoorSystem GetCoorSystem() const;
00152
00158 void ConvertChildren(KFbxNode* pRoot, const KFbxAxisSystem& pSrcSystem) const;
00159
00161
00162
00163
00164
00165
00166
00168
00169 protected:
00170
00171 class KFbxAxis
00172 {
00173 public:
00174 enum eAxis {
00175 eXAxis = 0, eYAxis, eZAxis
00176 };
00177
00178 eAxis mAxis;
00179 int mSign;
00180
00181 bool operator==(const KFbxAxis& pAxis)const
00182 {
00183 return mAxis == pAxis.mAxis && mSign == pAxis.mSign;
00184 }
00185 };
00186
00187 KFbxAxis mUpVector;
00188 KFbxAxis mFrontVector;
00189 KFbxAxis mCoorSystem;
00190
00191 protected:
00193
00194
00195
00196 void ConvertFCurve(KArrayTemplate<KFCurveNode*>& pFCurves, const KFbxAxisSystem& pFrom)const;
00197
00198
00199 void AdjustPreRotation(KFbxNode* pNode, const KFbxMatrix& pConversionRM)const;
00200
00201 void AdjustPivots(KFbxNode* pNode, const KFbxMatrix& pConversionRM)const;
00202
00203 void GetConversionMatrix(const KFbxAxisSystem& pFrom, KFbxMatrix& pConversionRM)const;
00204
00205 void AdjustLimits(KFbxNode* pNode, const KFbxMatrix& pConversionRM)const;
00206
00207 void AdjustPoses(KFbxScene* pScene, const KFbxMatrix& pConversionRM) const;
00208
00209 void AdjustCamera(KFbxNode* pNode, const KFbxMatrix& pConversionRM ) const;
00210
00211 void AdjustCluster(KFbxNode* pNode, const KFbxMatrix& pConversionRM) const;
00212
00213 void ConvertChildren(KFbxNode* pRoot, const KFbxAxisSystem& pSrcSystem, bool pSubChildrenOnly) const;
00214
00215 friend class KFbxReaderFbx;
00216 friend class KFbxReaderFbx6;
00217 friend class KFbxWriterFbx;
00218 friend class KFbxWriterFbx6;
00219
00220 friend class KFbxGlobalSettings;
00221 };
00222
00223 #include <fbxfilesdk_nsend.h>
00224
00225
00226 #endif // _KFbxAxisSystem_h