fbxsdk/core/math/fbxtransforms.h Source File

fbxtransforms.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_CORE_MATH_TRANSFORMS_H_
14 #define _FBXSDK_CORE_MATH_TRANSFORMS_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
35 {
36 public:
38  FbxLimits();
39 
41  FbxLimits& operator=(const FbxLimits& pLimits);
42 
46  bool GetActive() const;
47 
51  void SetActive(const bool pActive);
52 
56  bool GetMinXActive() const;
57 
61  bool GetMinYActive() const;
62 
66  bool GetMinZActive() const;
67 
73  void GetMinActive(bool& pXActive, bool& pYActive, bool& pZActive) const;
74 
78  FbxDouble3 GetMin() const;
79 
83  void SetMinXActive(bool pActive);
84 
88  void SetMinYActive(bool pActive);
89 
93  void SetMinZActive(bool pActive);
94 
100  void SetMinActive(bool pXActive, bool pYActive, bool pZActive);
101 
105  void SetMin(const FbxDouble3& pMin);
106 
110  bool GetMaxXActive() const;
111 
115  bool GetMaxYActive() const;
116 
120  bool GetMaxZActive() const;
121 
127  void GetMaxActive(bool& pXActive, bool& pYActive, bool& pZActive) const;
128 
132  FbxDouble3 GetMax() const;
133 
137  void SetMaxXActive(bool pActive);
138 
142  void SetMaxYActive(bool pActive);
143 
147  void SetMaxZActive(bool pActive);
148 
154  void SetMaxActive(bool pXActive, bool pYActive, bool pZActive);
155 
159  void SetMax(const FbxDouble3& pMax);
160 
165  bool GetAnyMinMaxActive() const;
166 
170  FbxDouble3 Apply(const FbxDouble3& pVector);
171 
172 /*****************************************************************************************************************************
173 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
174 *****************************************************************************************************************************/
175 #ifndef DOXYGEN_SHOULD_SKIP_THIS
176 private:
177  enum EMask {eActive=1<<0, eMinX=1<<1, eMinY=1<<2, eMinZ=1<<3, eMaxX=1<<4, eMaxY=1<<5, eMaxZ=1<<6, eAll=eMinX|eMinY|eMinZ|eMaxX|eMaxY|eMaxZ};
178 
179  FbxUInt8 mMask;
180  FbxDouble3 mMin;
181  FbxDouble3 mMax;
182 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
183 };
184 
186 {
187 public:
189 
190  FbxEuler::EOrder GetOrder() const;
191  void SetOrder(FbxEuler::EOrder pOrder);
192  void V2M(FbxAMatrix& pRM, const FbxVector4& pV);
193  void M2V(FbxVector4& pV, const FbxAMatrix& pRM);
194  bool V2VRef(FbxVector4& pVOut, const FbxVector4& pVIn, const FbxVector4& pVRef);
195 
196 private:
197  FbxEuler::EOrder mOrder;
198 };
199 
203 {
204 public:
205  enum EInheritType {eInheritRrSs, eInheritRSrs, eInheritRrs};
206 
207  FbxTransform();
208 
209  EInheritType GetInheritType() const;
210  void SetInheritType(EInheritType pType);
211  FbxLimits& GetTranslationLimits();
212  FbxLimits& GetRotationLimits();
213  FbxLimits& GetScalingLimits();
214  FbxRotationOrder& GetRotationOrder();
215  bool HasROffset() const;
216  bool HasRPivot() const;
217  bool HasSOffset() const;
218  bool HasSPivot() const;
219  bool HasPreRM() const;
220  bool HasPostRM() const;
221  void SetROffset(const FbxVector4& pROffset);
222  void SetRPivot(const FbxVector4& pRPivot);
223  void SetSOffset(const FbxVector4& pSOffset);
224  void SetSPivot(const FbxVector4& pSPivot);
225  void SetPreRM(const FbxVector4& pPreR);
226  void SetPostRM(const FbxVector4& pPostR);
227  bool GetRotationSpaceForLimitOnly() const;
228  void SetRotationSpaceForLimitOnly(bool pRotationSpaceForLimitOnly);
229 
230  void DoF2LT(FbxVector4& pLT, const FbxVector4& pDoF, const FbxAMatrix& pLRM, const FbxAMatrix& pLSM);
231  void LT2DoF(FbxVector4& pDoF, const FbxVector4& pLT, const FbxAMatrix& pLRM, const FbxAMatrix& pLSM);
232  void DoF2LRM(FbxAMatrix& pLRM, const FbxVector4& pRDoF, bool pForLimit=false);
233  void LRM2DoF(FbxVector4& pRDoF, const FbxAMatrix& pLRM, bool pForLimit=false);
234  void LSM2GSM(FbxAMatrix& pGSM, const FbxAMatrix& pPGSM, const FbxAMatrix& pLSM, const FbxAMatrix& pLRM, const FbxVector4& pPLS);
235  void GTRSM2GX(FbxAMatrix& pGX, const FbxVector4& pGT, const FbxAMatrix& pGRM, const FbxAMatrix& pGSM);
236 
237 private:
238  void SumPivots(FbxVector4& pSum, const FbxAMatrix& pLRM, const FbxAMatrix& pLSM);
239 
240  class RotationSpace
241  {
242  public:
243  enum EMask {eHasNothing=0, eHasPreRotM=1<<0, eHasPostRotM=1<<1};
244 
245  RotationSpace();
246 
247  bool HasPreRM() const;
248  bool HasPostRM() const;
249  void GetPreRM(FbxAMatrix& pPreRM) const;
250  void GetPostRM(FbxAMatrix& pPostRM) const;
251  void SetPreRM(const FbxVector4& pPreR);
252  void SetPostRM(const FbxVector4& pPostR);
253  void DoF2LRM(FbxAMatrix& pLRM, const FbxVector4& pRDoF);
254  void LRM2DoF(FbxVector4& pRDoF, const FbxAMatrix& pLRM);
255 
256  FbxUInt8 mMask;
257  FbxAMatrix mPreRM;
258  FbxAMatrix mPostRM;
259  FbxRotationOrder mRotationOrder;
260  };
261 
262  enum EMask {eHasNothing=0, eHasRotOffset=1<<0, eHasRotPivot=1<<1, eHasScaleOffset=1<<2, eHasScalePivot=1<<3};
263 
264  FbxUInt8 mMask;
265  EInheritType mInheritType;
266  FbxVector4 mROffset;
267  FbxVector4 mRPivot;
268  FbxVector4 mSOffset;
269  FbxVector4 mSPivot;
270  FbxLimits mTranslationLimits;
271  FbxLimits mRotationLimits;
272  FbxLimits mScalingLimits;
273  bool mRotationSpaceForLimitOnly;
274  RotationSpace mRotationSpace;
275 };
276 
277 FBXSDK_DLL bool FbxGetContinuousRotation(FbxVector4& pRes, const FbxVector4& pRot, const FbxVector4& pRef, const int* pOrder);
278 FBXSDK_DLL void FbxGetContinuousRotation(FbxVector4& pRes, const FbxVector4& pRot, const FbxVector4& pRef);
279 
280 #include <fbxsdk/fbxsdk_nsend.h>
281 
282 #endif /* _FBXSDK_CORE_MATH_TRANSFORMS_H_ */
FBX SDK environment definition.
Handle transform behaviors such as pivots, limits and offets, etc.
unsigned char FbxUInt8
Definition: fbxtypes.h:76
FbxLimits defines a limit range for one transform component, either translation, rotation or scaling...
Definition: fbxtransforms.h:34
A four double mathematic vector class.
Definition: fbxvector4.h:25
FBX SDK affine matrix class.
#define FBXSDK_DLL
Definition: fbxarch.h:173
bool FbxGetContinuousRotation(FbxVector4 &pRes, const FbxVector4 &pRot, const FbxVector4 &pRef, const int *pOrder)