fbxsdk/scene/geometry/fbxnode.h Source File

fbxnode.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_SCENE_GEOMETRY_NODE_H_
14 #define _FBXSDK_SCENE_GEOMETRY_NODE_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
18 #include <fbxsdk/core/fbxobject.h>
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
23 class FbxStatus;
24 class FbxNodeAttribute;
25 class FbxCachedEffect;
26 class FbxLODGroup;
27 class FbxNull;
28 class FbxMarker;
29 class FbxSkeleton;
30 class FbxGeometry;
31 class FbxMesh;
32 class FbxNurbs;
33 class FbxNurbsCurve;
34 class FbxLine;
35 class FbxNurbsSurface;
37 class FbxPatch;
38 class FbxCamera;
39 class FbxCameraStereo;
40 class FbxCameraSwitcher;
41 class FbxLight;
43 class FbxSubDiv;
44 class FbxCharacter;
45 class FbxSurfaceMaterial;
46 class FbxAnimStack;
48 
73 {
75 
76 public:
84  FbxNode* GetParent();
85  const FbxNode* GetParent() const;
86 
94  bool AddChild(FbxNode* pNode);
95 
100  FbxNode* RemoveChild(FbxNode* pNode);
101 
106  int GetChildCount(bool pRecursive = false) const;
107 
112  FbxNode* GetChild(int pIndex);
113 
118  const FbxNode* GetChild(int pIndex) const;
119 
127  FbxNode* FindChild(const char* pName, bool pRecursive=true, bool pInitial=false);
129 
157  void SetTarget(FbxNode* pNode);
158 
162  FbxNode* GetTarget() const;
163 
167  void SetPostTargetRotation(FbxVector4 pVector);
168 
172  FbxVector4 GetPostTargetRotation() const;
173 
177  void SetTargetUp(FbxNode* pNode);
178 
182  FbxNode* GetTargetUp() const;
183 
187  void SetTargetUpVector(FbxVector4 pVector);
188 
192  FbxVector4 GetTargetUpVector() const;
194 
212  void SetVisibility(bool pIsVisible);
213 
219  bool GetVisibility() const;
220 
228  {
234  eFullShading
235  };
236 
240  void SetShadingMode(EShadingMode pShadingMode);
241 
245  EShadingMode GetShadingMode() const;
247 
261  FbxNodeAttribute* SetNodeAttribute(FbxNodeAttribute* pNodeAttribute);
262 
268  FbxNodeAttribute* GetNodeAttribute();
269 
275  const FbxNodeAttribute* GetNodeAttribute() const;
276 
278  int GetNodeAttributeCount() const;
279 
284  int GetDefaultNodeAttributeIndex() const;
285 
292  bool SetDefaultNodeAttributeIndex(int pIndex, FbxStatus* pStatus = NULL);
293 
298  FbxNodeAttribute* GetNodeAttributeByIndex(int pIndex);
299 
304  const FbxNodeAttribute* GetNodeAttributeByIndex(int pIndex) const;
305 
314  int GetNodeAttributeIndex(FbxNodeAttribute* pNodeAttribute, FbxStatus* pStatus = NULL) const;
315 
327  bool AddNodeAttribute(FbxNodeAttribute* pNodeAttribute, FbxStatus* pStatus = NULL);
328 
333  FbxNodeAttribute* RemoveNodeAttribute(FbxNodeAttribute* pNodeAttribute);
334 
343  FbxNodeAttribute* RemoveNodeAttributeByIndex(int pIndex);
344 
350  FbxCachedEffect* GetCachedEffect();
351 
357  FbxLODGroup* GetLodGroup();
358 
364  FbxNull* GetNull();
365 
371  FbxMarker* GetMarker();
372 
378  FbxSkeleton* GetSkeleton();
379 
396  FbxGeometry* GetGeometry();
397 
406  FbxMesh* GetMesh();
407 
416  FbxNurbs* GetNurbs();
417 
426  FbxNurbsSurface* GetNurbsSurface();
427 
436  FbxNurbsCurve* GetNurbsCurve();
437 
446  FbxLine* GetLine();
447 
456  FbxTrimNurbsSurface* GetTrimNurbsSurface();
457 
466  FbxSubDiv* GetSubdiv();
467 
476  FbxPatch* GetPatch();
477 
483  FbxCamera* GetCamera();
484  const FbxCamera* GetCamera() const;
485 
491  FbxCameraStereo* GetCameraStereo();
492 
498  FbxCameraSwitcher* GetCameraSwitcher();
499 
505  FbxLight* GetLight();
506  const FbxLight* GetLight() const;
507 
513  FbxOpticalReference* GetOpticalReference();
515 
529  void SetTransformationInheritType(FbxTransform::EInheritType pInheritType);
530 
532  void GetTransformationInheritType(FbxTransform::EInheritType& pInheritType) const;
534 
654  {
656  eDestinationPivot
657  };
658 
662  {
664  ePivotReference
665  };
666 
671  void SetPivotState(EPivotSet pPivotSet, EPivotState pPivotState);
672 
679  void GetPivotState(EPivotSet pPivotSet, EPivotState& pPivotState) const;
680 
686  void SetRotationOrder(EPivotSet pPivotSet, EFbxRotationOrder pRotationOrder);
687 
692  void GetRotationOrder(EPivotSet pPivotSet, EFbxRotationOrder& pRotationOrder) const;
693 
703  void SetUseRotationSpaceForLimitOnly(EPivotSet pPivotSet, bool pUseForLimitOnly);
704 
709  bool GetUseRotationSpaceForLimitOnly(EPivotSet pPivotSet) const;
710 
716  void SetRotationActive(bool pVal);
717 
721  bool GetRotationActive() const;
722 
729  void SetQuaternionInterpolation(EPivotSet pPivotSet, EFbxQuatInterpMode pQuatIterp);
730 
735  EFbxQuatInterpMode GetQuaternionInterpolation(EPivotSet pPivotSet) const;
736 
745  void SetRotationStiffness(FbxVector4 pRotationStiffness);
746 
750  FbxVector4 GetRotationStiffness() const;
751 
760  void SetMinDampRange(FbxVector4 pMinDampRange);
761 
765  FbxVector4 GetMinDampRange() const;
766 
775  void SetMaxDampRange(FbxVector4 pMaxDampRange);
776 
780  FbxVector4 GetMaxDampRange() const;
781 
790  void SetMinDampStrength(FbxVector4 pMinDampStrength);
791 
795  FbxVector4 GetMinDampStrength() const;
796 
805  void SetMaxDampStrength(FbxVector4 pMaxDampStrength);
806 
810  FbxVector4 GetMaxDampStrength() const;
811 
817  void SetPreferedAngle(FbxVector4 pPreferedAngle);
818 
822  FbxVector4 GetPreferedAngle() const;
823 
829  void SetRotationOffset(EPivotSet pPivotSet, FbxVector4 pVector);
830 
836  const FbxVector4& GetRotationOffset(EPivotSet pPivotSet) const;
837 
844  void SetRotationPivot(EPivotSet pPivotSet, FbxVector4 pVector);
845 
852  const FbxVector4& GetRotationPivot(EPivotSet pPivotSet) const;
853 
860  void SetPreRotation(EPivotSet pPivotSet, FbxVector4 pVector);
861 
868  const FbxVector4& GetPreRotation(EPivotSet pPivotSet) const;
869 
876  void SetPostRotation(EPivotSet pPivotSet, FbxVector4 pVector);
877 
884  const FbxVector4& GetPostRotation(EPivotSet pPivotSet) const;
885 
891  void SetScalingOffset(EPivotSet pPivotSet, FbxVector4 pVector);
892 
898  const FbxVector4& GetScalingOffset(EPivotSet pPivotSet) const;
899 
906  void SetScalingPivot(EPivotSet pPivotSet, FbxVector4 pVector);
907 
914  const FbxVector4& GetScalingPivot(EPivotSet pPivotSet) const;
915 
924  void SetGeometricTranslation(EPivotSet pPivotSet, FbxVector4 pVector);
925 
930  FbxVector4 GetGeometricTranslation(EPivotSet pPivotSet) const;
931 
940  void SetGeometricRotation(EPivotSet pPivotSet, FbxVector4 pVector);
941 
946  FbxVector4 GetGeometricRotation(EPivotSet pPivotSet) const;
947 
956  void SetGeometricScaling(EPivotSet pPivotSet, FbxVector4 pVector);
957 
962  FbxVector4 GetGeometricScaling(EPivotSet pPivotSet) const;
963 
970  void ResetPivotSet( FbxNode::EPivotSet pPivotSet );
971 
1001  void ConvertPivotAnimationRecursive(FbxAnimStack* pAnimStack, EPivotSet pConversionTarget, double pFrameRate, bool pKeyReduce=true);
1002 
1016  void ResetPivotSetAndConvertAnimation(double pFrameRate=30.0, bool pKeyReduce=false, bool pToNodeCenter=true, bool pForceResetLimits=false);
1017 
1021  void SetRotationPivotAsCenterRecursive(FbxVector4 pParentGeometricOffset=FbxVector4());
1023 
1030  FbxAnimEvaluator* GetAnimationEvaluator() const;
1031 
1040  FbxAMatrix& EvaluateGlobalTransform(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
1041 
1053  FbxAMatrix& EvaluateLocalTransform(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
1054 
1064  FbxVector4& EvaluateLocalTranslation(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
1065 
1075  FbxVector4& EvaluateLocalRotation(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
1076 
1086  FbxVector4& EvaluateLocalScaling(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
1087 
1095  bool EvaluateGlobalBoundingBoxMinMaxCenter(FbxVector4& pBBoxMin, FbxVector4& pBBoxMax, FbxVector4& pBBoxCenter, const FbxTime& pTime=FBXSDK_TIME_INFINITE);
1096 
1105  bool EvaluateRayIntersectionPoint(FbxVector4& pOut, const FbxVector4& pRayOrigin, const FbxVector4& pRayDir, bool pCulling=false, const FbxTime& pTime=FBXSDK_TIME_INFINITE);
1107 
1115  int GetCharacterLinkCount() const;
1116 
1129  bool GetCharacterLink(int pIndex, FbxCharacter** pCharacter, int* pCharacterLinkType, int* pNodeId, int* pNodeSubId);
1130 
1142  int FindCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId) const;
1144 
1158  bool GetAnimationInterval(FbxTimeSpan& pInterval, FbxAnimStack* pAnimStack=NULL, int pAnimLayerId=0);
1159 
1168  int AddMaterial(FbxSurfaceMaterial* pMaterial);
1169 
1174  bool RemoveMaterial(FbxSurfaceMaterial* pMaterial);
1175 
1182  int GetMaterialCount() const;
1183 
1188  FbxSurfaceMaterial* GetMaterial(int pIndex) const;
1189 
1192  void RemoveAllMaterials();
1193 
1199  int GetMaterialIndex(const char* pName) const;
1201 
1214 
1223 
1232 
1252 
1271 
1272 
1281 
1290 
1299 
1308 
1317 
1331 
1340 
1349 
1359 
1369 
1370 
1380 
1390 
1400 
1410 
1419 
1430 
1439 
1448 
1457 
1466 
1475 
1484 
1500 
1509 
1518 
1528 
1538 
1548 
1558 
1568 
1578 
1587 
1601 
1610 
1619 
1629 
1639 
1649 
1659 
1669 
1679 
1688 
1697 
1706 
1707  // IK Settings
1709 
1718 
1727 
1736 
1745 
1754 
1763 
1772 
1781 
1790 
1799 
1808 
1817 
1826 
1835 
1844 
1846 
1854 
1862 
1886 
1895 
1904 
1913 
1925 
1926 /*****************************************************************************************************************************
1927 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
1928 *****************************************************************************************************************************/
1929 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1930  class FBXSDK_DLL Pivot
1931  {
1932  public:
1933  static const FbxVector4 sZeroVector;
1934  static const FbxVector4 sOneVector;
1935 
1936  Pivot()
1937  {
1938  mRotationOffset = NULL;
1939  mRotationPivot = NULL;
1940  mPreRotation = NULL;
1941  mPostRotation = NULL;
1942  mScalingOffset = NULL;
1943  mScalingPivot = NULL;
1944  mGeometricTranslation = NULL;
1945  mGeometricRotation = NULL;
1946  mGeometricScaling = NULL;
1947  Reset();
1948  }
1949  ~Pivot() { Reset(); }
1950 
1951  void Reset()
1952  {
1953  FBX_SAFE_DELETE(mRotationOffset);
1954  FBX_SAFE_DELETE(mRotationPivot);
1955  FBX_SAFE_DELETE(mPreRotation);
1956  FBX_SAFE_DELETE(mPostRotation);
1957  FBX_SAFE_DELETE(mScalingOffset);
1958  FBX_SAFE_DELETE(mScalingPivot);
1959  FBX_SAFE_DELETE(mGeometricTranslation);
1960  FBX_SAFE_DELETE(mGeometricRotation);
1961  FBX_SAFE_DELETE(mGeometricScaling);
1962  mRotationOrder = eEulerXYZ;
1963  mRotationSpaceForLimitOnly = false;
1964  mPivotState = FbxNode::ePivotReference;
1965  mQuaternionInterpolate = eQuatInterpOff;
1966  }
1967 
1968  inline const FbxVector4& GetRotationOffset() const { return (mRotationOffset) ? *mRotationOffset : sZeroVector; }
1969  inline void SetRotationOffset(const FbxVector4& pV)
1970  {
1971  if( !mRotationOffset )
1972  {
1973  #if defined(__GNUC__) && (__GNUC__ < 4)
1974  mRotationOffset = FbxNew< FbxVector4 >((FbxVector4&)pV);
1975  #else
1976  mRotationOffset = FbxNew< FbxVector4 >(pV);
1977  #endif
1978  }
1979  else
1980  {
1981  *mRotationOffset = pV;
1982  }
1983  }
1984 
1985  inline const FbxVector4& GetRotationPivot() const { return (mRotationPivot) ? *mRotationPivot : sZeroVector; }
1986  inline void SetRotationPivot(const FbxVector4& pV)
1987  {
1988  if( !mRotationPivot )
1989  {
1990  #if defined(__GNUC__) && (__GNUC__ < 4)
1991  mRotationPivot = FbxNew< FbxVector4 >((FbxVector4&)pV);
1992  #else
1993  mRotationPivot = FbxNew< FbxVector4 >(pV);
1994  #endif
1995  }
1996  else
1997  {
1998  *mRotationPivot = pV;
1999  }
2000  }
2001 
2002  inline const FbxVector4& GetPreRotation() const { return (mPreRotation) ? *mPreRotation : sZeroVector; }
2003  inline void SetPreRotation(const FbxVector4& pV)
2004  {
2005  if( !mPreRotation )
2006  {
2007  #if defined(__GNUC__) && (__GNUC__ < 4)
2008  mPreRotation = FbxNew< FbxVector4 >((FbxVector4&)pV);
2009  #else
2010  mPreRotation = FbxNew< FbxVector4 >(pV);
2011  #endif
2012  }
2013  else
2014  {
2015  *mPreRotation = pV;
2016  }
2017  }
2018 
2019  inline const FbxVector4& GetPostRotation() const { return (mPostRotation) ? *mPostRotation : sZeroVector; }
2020  inline void SetPostRotation(const FbxVector4& pV)
2021  {
2022  if( !mPostRotation )
2023  {
2024  #if defined(__GNUC__) && (__GNUC__ < 4)
2025  mPostRotation = FbxNew< FbxVector4 >((FbxVector4&)pV);
2026  #else
2027  mPostRotation = FbxNew< FbxVector4 >(pV);
2028  #endif
2029  }
2030  else
2031  {
2032  *mPostRotation = pV;
2033  }
2034  }
2035 
2036  inline const FbxVector4& GetScalingOffset() const { return (mScalingOffset) ? *mScalingOffset : sZeroVector; }
2037  inline void SetScalingOffset(const FbxVector4& pV)
2038  {
2039  if( !mScalingOffset )
2040  {
2041  #if defined(__GNUC__) && (__GNUC__ < 4)
2042  mScalingOffset = FbxNew< FbxVector4 >((FbxVector4&)pV);
2043  #else
2044  mScalingOffset = FbxNew< FbxVector4 >(pV);
2045  #endif
2046  }
2047  else
2048  {
2049  *mScalingOffset = pV;
2050  }
2051  }
2052 
2053  inline const FbxVector4& GetScalingPivot() const { return (mScalingPivot) ? *mScalingPivot : sZeroVector; }
2054  inline void SetScalingPivot(const FbxVector4& pV)
2055  {
2056  if( !mScalingPivot )
2057  {
2058  #if defined(__GNUC__) && (__GNUC__ < 4)
2059  mScalingPivot = FbxNew< FbxVector4 >((FbxVector4&)pV);
2060  #else
2061  mScalingPivot = FbxNew< FbxVector4 >(pV);
2062  #endif
2063  }
2064  else
2065  {
2066  *mScalingPivot = pV;
2067  }
2068  }
2069 
2070  inline const FbxVector4& GetGeometricTranslation() const { return (mGeometricTranslation) ? *mGeometricTranslation : sZeroVector; }
2071  inline void SetGeometricTranslation(const FbxVector4& pV)
2072  {
2073  if( !mGeometricTranslation )
2074  {
2075  #if defined(__GNUC__) && (__GNUC__ < 4)
2076  mGeometricTranslation = FbxNew< FbxVector4 >((FbxVector4&)pV);
2077  #else
2078  mGeometricTranslation = FbxNew< FbxVector4 >(pV);
2079  #endif
2080  }
2081  else
2082  {
2083  *mGeometricTranslation = pV;
2084  }
2085  }
2086 
2087  inline const FbxVector4& GetGeometricRotation() const { return (mGeometricRotation) ? *mGeometricRotation : sZeroVector; }
2088  inline void SetGeometricRotation(const FbxVector4& pV)
2089  {
2090  if( !mGeometricRotation )
2091  {
2092  #if defined(__GNUC__) && (__GNUC__ < 4)
2093  mGeometricRotation = FbxNew< FbxVector4 >((FbxVector4&)pV);
2094  #else
2095  mGeometricRotation = FbxNew< FbxVector4 >(pV);
2096  #endif
2097  }
2098  else
2099  {
2100  *mGeometricRotation = pV;
2101  }
2102  }
2103 
2104  inline const FbxVector4& GetGeometricScaling() const { return (mGeometricScaling) ? *mGeometricScaling : sOneVector; }
2105  inline void SetGeometricScaling(const FbxVector4& pV)
2106  {
2107  if( !mGeometricScaling )
2108  {
2109  #if defined(__GNUC__) && (__GNUC__ < 4)
2110  mGeometricScaling = FbxNew< FbxVector4 >((FbxVector4&)pV);
2111  #else
2112  mGeometricScaling = FbxNew< FbxVector4 >(pV);
2113  #endif
2114  }
2115  else
2116  {
2117  *mGeometricScaling = pV;
2118  }
2119  }
2120 
2121  inline EFbxRotationOrder GetRotationOrder() const { return mRotationOrder; }
2122  inline void SetRotationOrder(EFbxRotationOrder pROrder) { mRotationOrder = pROrder; }
2123  inline bool GetRotationSpaceForLimitOnly() const { return mRotationSpaceForLimitOnly; }
2124  inline void SetRotationSpaceForLimitOnly(bool pVal) { mRotationSpaceForLimitOnly = pVal; }
2125  inline EFbxQuatInterpMode GetQuaternionInterpolate() const { return mQuaternionInterpolate; }
2126  inline void SetQuaternionInterpolate(EFbxQuatInterpMode pVal) { mQuaternionInterpolate = pVal; }
2127  inline FbxNode::EPivotState GetPivotState() const { return mPivotState; }
2128  inline void SetPivotState(FbxNode::EPivotState pVal) { mPivotState = pVal; }
2129 
2130  private:
2131  FbxVector4* mRotationOffset;
2132  FbxVector4* mRotationPivot;
2133  FbxVector4* mPreRotation;
2134  FbxVector4* mPostRotation;
2135  FbxVector4* mScalingOffset;
2136  FbxVector4* mScalingPivot;
2137  FbxVector4* mGeometricTranslation;
2138  FbxVector4* mGeometricRotation;
2139  FbxVector4* mGeometricScaling;
2140  EFbxRotationOrder mRotationOrder;
2141  bool mRotationSpaceForLimitOnly;
2142  EFbxQuatInterpMode mQuaternionInterpolate;
2143  FbxNode::EPivotState mPivotState;
2144  };
2145 
2146  class FBXSDK_DLL Pivots
2147  {
2148  public:
2149  Pivots()
2150  {
2151  for( int i = 0; i < 2; i++ )
2152  {
2153  mIsDefault[i] = true;
2154  mPivotState[i] = FbxNode::ePivotReference;
2155  mPivot[i] = NULL;
2156  }
2157  }
2158 
2159  ~Pivots()
2160  {
2161  FbxDelete(mPivot[0]);
2162  FbxDelete(mPivot[1]);
2163  }
2164 
2165  Pivot& Get(int id)
2166  {
2167  FBX_ASSERT(id == 0 || id == 1);
2168  if (mPivot[id] == NULL && mIsDefault[id])
2169  {
2170  smDefaultPivot.SetPivotState(mPivotState[id]);
2171  return smDefaultPivot;
2172  }
2173 
2174  if (!mPivot[id])
2175  mPivot[id] = FbxNew< Pivot >();
2176 
2177  FBX_ASSERT(mPivot[id] != NULL);
2178  if (mPivot[id])
2179  mPivot[id]->SetPivotState(mPivotState[id]);
2180 
2181  return *mPivot[id];
2182  }
2183 
2184  #define MACRO_PIVOT_VECTOR_FCTS(name, defVect) \
2185  inline const FbxVector4& Get##name(int id) const \
2186  {\
2187  FBX_ASSERT(id == 0 || id == 1); \
2188  Pivot* p = mPivot[id]; \
2189  if (p == NULL) p = &smDefaultPivot; \
2190  return p->Get##name(); \
2191  }\
2192  inline void Set##name(int id, const FbxVector4& pV) \
2193  {\
2194  FBX_ASSERT(id == 0 || id == 1); \
2195  if (mIsDefault[id] && pV[0] == defVect[0] && pV[1] == defVect[1] && pV[2] == defVect[2]) return; \
2196  mIsDefault[id] = false; \
2197  Get(id).Set##name(pV); \
2198  }
2199 
2200  MACRO_PIVOT_VECTOR_FCTS(RotationOffset, Pivot::sZeroVector);
2201  MACRO_PIVOT_VECTOR_FCTS(RotationPivot, Pivot::sZeroVector);
2202  MACRO_PIVOT_VECTOR_FCTS(PreRotation, Pivot::sZeroVector);
2203  MACRO_PIVOT_VECTOR_FCTS(PostRotation, Pivot::sZeroVector);
2204  MACRO_PIVOT_VECTOR_FCTS(ScalingOffset, Pivot::sZeroVector);
2205  MACRO_PIVOT_VECTOR_FCTS(ScalingPivot, Pivot::sZeroVector);
2206  MACRO_PIVOT_VECTOR_FCTS(GeometricTranslation, Pivot::sZeroVector);
2207  MACRO_PIVOT_VECTOR_FCTS(GeometricRotation, Pivot::sZeroVector);
2208  MACRO_PIVOT_VECTOR_FCTS(GeometricScaling, Pivot::sOneVector);
2209 
2210  #define MACRO_PIVOT_BOOL_FCTS(name) \
2211  inline bool Get##name(int id) const \
2212  {\
2213  FBX_ASSERT(id == 0 || id == 1); \
2214  Pivot* p = mPivot[id]; \
2215  if (p == NULL) p = &smDefaultPivot; \
2216  return p->Get##name(); \
2217  }\
2218  inline void Set##name(int id, bool pV) \
2219  {\
2220  FBX_ASSERT(id == 0 || id == 1); \
2221  mIsDefault[id] = false; \
2222  Get(id).Set##name(pV); \
2223  }
2224 
2225  MACRO_PIVOT_BOOL_FCTS(RotationSpaceForLimitOnly);
2226 
2227  inline EFbxQuatInterpMode GetQuaternionInterpolate(int id) const
2228  {
2229  FBX_ASSERT(id == 0 || id == 1);
2230  Pivot* p = mPivot[id];
2231  if (p == NULL) p = &smDefaultPivot;
2232  return p->GetQuaternionInterpolate();
2233  }
2234 
2235  inline void SetQuaternionInterpolate(int id, EFbxQuatInterpMode pV)
2236  {
2237  FBX_ASSERT(id == 0 || id == 1);
2238  // If pivot has default values, and we want to set default eQuatInterpOff,
2239  // return to avoid allocating memory for the pivot (in Get(id).)
2240  if (mIsDefault[id] && pV == eQuatInterpOff) return;
2241  mIsDefault[id] = false;
2242  Get(id).SetQuaternionInterpolate(pV);
2243  }
2244 
2245  inline EFbxRotationOrder GetRotationOrder(int id) const
2246  {
2247  FBX_ASSERT(id == 0 || id == 1);
2248  Pivot* p = mPivot[id];
2249  if (p == NULL) p = &smDefaultPivot;
2250  return p->GetRotationOrder();
2251  }
2252 
2253  inline void SetRotationOrder(int id, EFbxRotationOrder pROrder)
2254  {
2255  FBX_ASSERT(id == 0 || id == 1);
2256  // If pivot has default values, and we want to set default rotation order eEulerXYZ,
2257  // return to avoid allocating memory for the pivot (in Get(id).)
2258  if (mIsDefault[id] && pROrder == eEulerXYZ) return;
2259  mIsDefault[id] = false;
2260  Get(id).SetRotationOrder(pROrder);
2261  }
2262 
2263  inline FbxNode::EPivotState GetPivotState(int id) const
2264  {
2265  FBX_ASSERT(id == 0 || id == 1);
2266  return mPivotState[id];
2267  }
2268 
2269  inline void SetPivotState(int id, FbxNode::EPivotState pVal)
2270  {
2271  FBX_ASSERT(id == 0 || id == 1);
2272  if (pVal == FbxNode::ePivotReference) return;
2273  mPivotState[id] = pVal;
2274  if (mPivot[id])
2275  mPivot[id]->SetPivotState(pVal);
2276  }
2277 
2278  #undef MACRO_PIVOT_VECTOR_FCTS
2279  #undef MACRO_PIVOT_BOOL_FCTS
2280 
2281  void Reset()
2282  {
2283  smDefaultPivot.Reset();
2284  for (int i = 0; i < 2; i++)
2285  {
2286  mIsDefault[i] = true;
2287  mPivotState[i] = FbxNode::ePivotReference;
2288  if (mPivot[i]) mPivot[i]->Reset();
2289  }
2290  }
2291 
2292  private:
2293  Pivot* mPivot[2];
2294  FbxNode::EPivotState mPivotState[2];
2295  bool mIsDefault[2];
2296  static Pivot smDefaultPivot;
2297  };
2298 
2299  class FBXSDK_DLL LinkToCharacter
2300  {
2301  public:
2302  bool operator==(LinkToCharacter& pLinkToCharacter)
2303  {
2304  if (mCharacter == pLinkToCharacter.mCharacter &&
2305  mType == pLinkToCharacter.mType &&
2306  mIndex == pLinkToCharacter.mIndex &&
2307  mSubIndex == pLinkToCharacter.mSubIndex)
2308  {
2309  return true;
2310  }
2311  else return false;
2312  }
2313 
2314  FbxCharacter* mCharacter;
2315  int mType;
2316  int mIndex;
2317  int mSubIndex;
2318  };
2319 
2320  void AddChildName(char* pChildName);
2321  char* GetChildName(FbxUInt pIndex) const;
2322  FbxUInt GetChildNameCount() const;
2323 
2324  FbxTransform& GetTransform();
2325  FbxLimits& GetTranslationLimits();
2326  FbxLimits& GetRotationLimits();
2327  FbxLimits& GetScalingLimits();
2328  Pivots& GetPivots();
2329 
2330  void UpdatePivotsAndLimitsFromProperties();
2331  void UpdatePropertiesFromPivotsAndLimits();
2332 
2333  void SetRotationActiveProperty(bool pVal);
2334  void PivotSetToMBTransform(EPivotSet pPivotSet);
2335 
2336  int AddCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId);
2337  int RemoveCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId);
2338 
2339  // Duplicate this node as well as all its node attributes and the Target and UpTarget objects.
2340  FbxNode* DeepCloneWithNodeAttributes();
2341 
2342  virtual FbxObject& Copy(const FbxObject& pObject);
2343  virtual const char* GetTypeName() const;
2344  virtual FbxStringList GetTypeFlags() const;
2345  virtual bool PropertyNotify(EPropertyNotifyType pType, FbxProperty& pProperty);
2346 
2347  enum ECullingType
2348  {
2349  eCullingOff,
2350  eCullingOnCCW,
2351  eCullingOnCW
2352  };
2353 
2354  ECullingType mCullingType;
2355  bool mCorrectInheritType;
2356 
2357 protected:
2358  virtual void Construct(const FbxObject* pFrom);
2359  virtual void ConstructProperties(bool pForceSet);
2360  virtual void Destruct(bool pRecursive);
2361 
2362  void Reset();
2363  bool GetAnimationIntervalRecursive(FbxTimeSpan& pTimeInterval, FbxAnimLayer* pAnimLayer);
2364 
2365 private:
2366  typedef FbxSet<FbxHandle> GeomInstSet;
2367 
2368  void ResetLimitsRecursive(FbxNode* pNode);
2369 
2370  void ConvertPivotAnimationRecurseLoop(FbxAnimStack* pAnimStack, const EPivotSet pConversionTarget, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet);
2371  void ConvertPivotAnimation(FbxAnimStack* pAnimStack, const EPivotSet pConversionTarget, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet);
2372  bool ConvertPivotAnimation_SetupMatrixConverter(FbxAnimCurveFilterMatrixConverter& pConverter, const EPivotSet& pSrcSet, const EPivotSet& pDstSet, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet);
2373  void ConvertPivotAnimation_ApplyGeometryPivot(const EPivotSet& pSrcSet, const EPivotSet& pDstSet, GeomInstSet& pGeomInstSet);
2374 
2375  FbxTransform mTransform;
2376  Pivots mPivots;
2377  FbxObject* mAnimCurveNodeContainer;
2378  FbxArray<FbxString*> mChildrenNameList;
2379  FbxVector4 mPostTargetRotation;
2380  FbxVector4 mTargetUpVector;
2381  FbxNode::EShadingMode mShadingMode;
2382  FbxArray<LinkToCharacter> mLinkToCharacter;
2383 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
2384 };
2385 
2389 
2390 #include <fbxsdk/fbxsdk_nsend.h>
2391 
2392 #endif /* _FBXSDK_SCENE_GEOMETRY_NODE_H_ */
FbxPropertyT< FbxEuler::EOrder > RotationOrder
This property contains the rotation order information of the node.
Definition: fbxnode.h:1418
unsigned int FbxUInt
Definition: fbxtypes.h:40
The animation layer is a collection of animation curve nodes.
Definition: fbxanimlayer.h:30
#define FBXSDK_OBJECT_DECLARE(Class, Parent)
Macro used to declare a new class derived from FbxObject.
Definition: fbxobject.h:61
FbxPropertyT< EFbxQuatInterpMode > QuaternionInterpolate
This property contains the quaternion interpolate flag of the node.
Definition: fbxnode.h:1280
Solid geometries rendered with the scene lights.
Definition: fbxnode.h:232
FBX SDK environment definition.
The Animation stack is a collection of animation layers.
Definition: fbxanimstack.h:37
The source pivot context.
Definition: fbxnode.h:655
FbxPropertyT< FbxBool > ScalingMinY
This property enables or disables the limit on scaling Y.
Definition: fbxnode.h:1638
FbxPropertyT< FbxBool > TranslationMaxX
This property enables or disables the limit on translation X.
Definition: fbxnode.h:1389
#define eEulerXYZ
Definition: fbxmath.h:110
FbxPropertyT< FbxDouble3 > RotationMax
This property sets the maximum rotation values the object can occupy on each individual axis...
Definition: fbxnode.h:1517
FbxPropertyT< FbxBool > RotationMaxY
This property enables or disables the limit on rotation Y.
Definition: fbxnode.h:1567
FbxPropertyT< FbxBool > TranslationMaxY
This property enables or disables the limit on translation Y.
Definition: fbxnode.h:1399
EPivotSet
Pivot context identifier.
Definition: fbxnode.h:653
EFbxQuatInterpMode
Quaternion interpolation modes.
Definition: fbxmath.h:121
#define NULL
Definition: fbxarch.h:210
FbxPropertyT< FbxBool > RotationSpaceForLimitOnly
This property contains the rotation space for limit only flag of the node.
Definition: fbxnode.h:1429
Array that stores pairs of FbxString and a pointer.
This class contains material settings.
This node attribute contains the properties of an optical reference.
FbxPropertyT< FbxBool > ScalingMinX
This property activates or disables the limit on scaling X.
Definition: fbxnode.h:1628
FbxPropertyT< FbxDouble3 > ScalingPivot
This property contains the scaling pivot information of the node.
Definition: fbxnode.h:1316
void FbxDelete(T *p)
Deletion policy for pointer template classes that uses the FbxDelete() function.
Definition: fbxnew.h:341
This node attribute contains methods for accessing the properties of a camera switcher.
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:26
FbxPropertyT< FbxBool > TranslationMinY
This property enables or disables the limit on translation Y.
Definition: fbxnode.h:1368
FbxPropertyT< FbxBool > VisibilityInheritance
This property contains the visibility inheritance flag that allow applications to modify the Visibili...
Definition: fbxnode.h:1270
Do not evaluate using quaternion interpolation.
Definition: fbxmath.h:123
FbxPropertyT< FbxDouble3 > ScalingOffset
This property contains the scaling offset information of the node.
Definition: fbxnode.h:1307
The pivot context with this state is not used during the node transform computation but can be access...
Definition: fbxnode.h:664
FbxPropertyT< FbxReference > UpVectorProperty
This property contains the up vector property of the node.
Definition: fbxnode.h:1861
FbxPropertyT< FbxDouble3 > GeometricTranslation
This property contains geometric translation information of the node.
Definition: fbxnode.h:1687
Handle transform behaviors such as pivots, limits and offets, etc.
FbxPropertyT< FbxDouble > PreferedAngleX
This property contains the x component of the preferred angle of the node.
Definition: fbxnode.h:1825
This node attribute contains the properties of a marker.
Definition: fbxmarker.h:26
FbxPropertyT< FbxDouble > MaxDampStrengthZ
This property contains the z component of the maximum damp strength of the node.
Definition: fbxnode.h:1816
The pivot context with this state is affecting the node's transform computation.
Definition: fbxnode.h:663
#define FBXSDK_TIME_INFINITE
Definition: fbxtime.h:23
FbxPropertyT< FbxBool > ScalingMinZ
This property enables or disables the limit on scaling Z.
Definition: fbxnode.h:1648
FbxPropertyT< FbxDouble > MinDampRangeY
This property contains the y component of the minimum damp range angles of the node.
Definition: fbxnode.h:1726
FbxPropertyT< FbxDouble3 > RotationMin
This property sets the minimum rotation values the object can occupy on each individual axis...
Definition: fbxnode.h:1508
FbxPropertyT< FbxDouble3 > LclScaling
This property contains the scaling information of the node.
Definition: fbxnode.h:1231
FbxPropertyT< FbxDouble3 > PostRotation
This property contains post-rotation information of the node.
Definition: fbxnode.h:1483
FbxPropertyT< FbxTransform::EInheritType > InheritType
This property contains inherit type information of the node.
Definition: fbxnode.h:1586
FbxPropertyT< FbxInt > DefaultAttributeIndex
This property contains default attribute index information of the node.
Definition: fbxnode.h:1903
#define EFbxRotationOrder
Rotation order flags.
Definition: fbxmath.h:109
FbxPropertyT< FbxDouble > Visibility
This property contains the visibility information of the node.
Definition: fbxnode.h:1251
FbxPropertyT< FbxDouble > AxisLen
This property contains axis length information of the node.
Definition: fbxnode.h:1465
EFbxType
Type identifier constants.
FbxPropertyT< FbxBool > RotationActive
This property enables or disables the limit on rotation.
Definition: fbxnode.h:1499
Class to encapsulate time units.
Definition: fbxtime.h:44
FbxPropertyT< FbxDouble3 > PreRotation
This property contains pre-rotation information of the node.
Definition: fbxnode.h:1474
FbxPropertyT< FbxDouble > RotationStiffnessY
This property contains the y value of the rotation stiffness of the node.
Definition: fbxnode.h:1447
The base class of most FBX objects.
Definition: fbxobject.h:157
FbxPropertyT< FbxDouble > MaxDampRangeZ
This property contains the z component of the maximum damp range angles of the node.
Definition: fbxnode.h:1762
FbxLimits defines a limit range for one transform component, either translation, rotation or scaling...
Definition: fbxtransforms.h:34
FbxPropertyT< FbxBool > TranslationMinZ
This property enables or disables the limit on translation Z.
Definition: fbxnode.h:1379
FbxPropertyT< FbxBool > ScalingActive
This property enables or disables the limit on scaling.
Definition: fbxnode.h:1600
FbxPropertyT< FbxDouble > MaxDampStrengthX
This property contains the x component of the maximum damp strength of the node.
Definition: fbxnode.h:1798
EShadingMode
Shading modes.
Definition: fbxnode.h:227
FbxTrimNurbsSurface describes a NURBS surface with regions trimmed or cut away with trimming boundari...
Represents an element in the scene graph.
Definition: fbxnode.h:72
A patch is a type of node attribute with parametric surface.
Definition: fbxpatch.h:26
FbxPropertyT< FbxDouble > MinDampStrengthY
This property contains the y component of the minimum damp strength of the node.
Definition: fbxnode.h:1780
FbxPropertyT< FbxBool > TranslationActive
This property enables or disables the limit on translation.
Definition: fbxnode.h:1330
This node attribute contains methods for accessing the properties of a light.
Definition: fbxlight.h:27
FbxPropertyT< FbxDouble > MinDampRangeX
This property contains the x component of the minimum damp range angles of the node.
Definition: fbxnode.h:1717
FbxPropertyT< FbxDouble3 > ScalingMax
This property sets the maximum scaling values the object can occupy on each individual axis...
Definition: fbxnode.h:1618
FbxPropertyT< FbxBool > RotationMaxX
This property enables or disables the limit on rotation X.
Definition: fbxnode.h:1557
FbxPropertyT< FbxBool > Show
This property contains the show information of the node.
Definition: fbxnode.h:1885
FbxPropertyT< FbxDouble > MinDampRangeZ
This property contains the z component of the minimum damp range angles of the node.
Definition: fbxnode.h:1735
This class implements an efficient set based on value comparison, which stores values.
Definition: fbxset.h:25
A NURBS surface is a type of parametric geometry.
FbxPropertyT< FbxDouble3 > RotationOffset
This property contains the rotation offset information of the node.
Definition: fbxnode.h:1289
FbxPropertyT< FbxBool > TranslationMaxZ
This property enables or disables the limit on translation Z.
Definition: fbxnode.h:1409
FbxPropertyT< FbxDouble3 > LclTranslation
This property contains the translation information of the node.
Definition: fbxnode.h:1213
FbxPropertyT< FbxDouble > MaxDampRangeY
This property contains the y component of the maximum damp range angles of the node.
Definition: fbxnode.h:1753
FbxPropertyT< FbxDouble3 > GeometricRotation
This property contains geometric rotation information of the node.
Definition: fbxnode.h:1696
FbxPropertyT< FbxBool > RotationMinY
This property enables or disables the limit on rotation Y.
Definition: fbxnode.h:1537
FbxPropertyT< FbxReference > LookAtProperty
This property contains lookat property of the node.
Definition: fbxnode.h:1853
FbxPropertyT< FbxDouble3 > TranslationMax
This property sets the maximum translation values the object can occupy on each individual axis...
Definition: fbxnode.h:1348
FbxPropertyT< FbxBool > TranslationMinX
This property enables or disables the limit on translation X.
Definition: fbxnode.h:1358
FbxPropertyT< FbxBool > ScalingMaxX
This property enables or disables the limit on scaling X.
Definition: fbxnode.h:1658
FbxPropertyT< FbxDouble3 > TranslationMin
This property sets the minimum translation values the object can occupy on each individual axis...
Definition: fbxnode.h:1339
The principal interface for animation evaluators.
EFbxType FbxTypeOf(const FbxEuler::EOrder &)
Definition: fbxnode.h:2386
FbxPropertyT< FbxDouble > MinDampStrengthZ
This property contains the z component of the minimum damp strength of the node.
Definition: fbxnode.h:1789
Enumeration.
Class to hold user properties.
Definition: fbxproperty.h:37
FbxPropertyT< FbxBool > LODBox
This property contains level of detail mode information of the node.
Definition: fbxnode.h:1923
A four double mathematic vector class.
Definition: fbxvector4.h:25
FBX SDK affine matrix class.
FbxPropertyT< FbxDouble > MinDampStrengthX
This property contains the x component of the minimum damp strength of the node.
Definition: fbxnode.h:1771
Solid geometries rendered faceted - using the system light.
Definition: fbxnode.h:231
#define FBX_SAFE_DELETE(p)
Definition: fbxsdk_def.h:50
FbxPropertyT< FbxDouble > PreferedAngleY
This property contains the y component of the preferred angle of the node.
Definition: fbxnode.h:1834
This node attribute contains methods for accessing the properties of a camera.
Definition: fbxcamera.h:34
FbxPropertyT< FbxDouble3 > GeometricScaling
This property contains geometric scaling information of the node.
Definition: fbxnode.h:1705
FbxPropertyT< FbxBool > RotationMinX
This property enables or disables the limit on rotation X.
Definition: fbxnode.h:1527
FbxPropertyT< FbxDouble > PreferedAngleZ
This property contains the z component of the preferred angle of the node.
Definition: fbxnode.h:1843
#define FBXSDK_DLL
Definition: fbxarch.h:173
A NURBS surface is a type of parametric geometry.
Definition: fbxnurbs.h:31
A Non-Uniform Rational B-Spline (NURBS) curve is a type of parametric geometry.
Definition: fbxnurbscurve.h:60
This node attribute contains the properties of a null node.
Definition: fbxnull.h:25
A cached effect is a type of node attribute to represent certain type of effect by an cache object...
FbxPropertyT< FbxBool > Freeze
This property contains manipulation state information of the node.
Definition: fbxnode.h:1912
This class specializes a node attribute to represent the elements forming "bone" chains.
Definition: fbxskeleton.h:34
A Character is a person or animal with pre-defined skeleton system.
Definition: fbxcharacter.h:91
Class to encapsulate time intervals.
Definition: fbxtime.h:508
The base class of geometric objects that support control point deformations (e.g. ...
Definition: fbxgeometry.h:45
FbxPropertyT< FbxDouble > RotationStiffnessZ
This property contains the z value of the rotation stiffness of the node.
Definition: fbxnode.h:1456
FbxPropertyT< FbxDouble3 > ScalingMin
This property sets the minimum scaling values the object can occupy on each individual axis...
Definition: fbxnode.h:1609
FbxPropertyT< FbxBool > ScalingMaxY
This property enables or disables the limit on scaling Y.
Definition: fbxnode.h:1668
FbxPropertyT< FbxBool > RotationMinZ
This property enables or disables the limit on rotation Z.
Definition: fbxnode.h:1547
FbxPropertyT< FbxDouble3 > LclRotation
This property contains the rotation information of the node.
Definition: fbxnode.h:1222
FbxPropertyT< FbxDouble > RotationStiffnessX
This property contains the x value of the rotation stiffness of the node.
Definition: fbxnode.h:1438
Solid geometries rendered with smooth textured surfaces - using system light.
Definition: fbxnode.h:233
FbxPropertyT< FbxDouble3 > RotationPivot
This property contains the rotation pivot information of the node.
Definition: fbxnode.h:1298
This class is the base class to all types of node attributes.
FbxPropertyT< FbxDouble > MaxDampRangeX
This property contains the x component of the maximum damp range angles of the node.
Definition: fbxnode.h:1744
FbxPropertyT< FbxDouble > MaxDampStrengthY
This property contains the y component of the maximum damp strength of the node.
Definition: fbxnode.h:1807
FbxPropertyT< FbxBool > RotationMaxZ
This property enables or disables the limit on rotation Z.
Definition: fbxnode.h:1577
FbxPropertyT< FbxBool > NegativePercentShapeSupport
This property contains negative percent shape support information of the node.
Definition: fbxnode.h:1894
This template class is used to contain user properties of specific data types.
Definition: fbxproperty.h:1124
FbxPropertyT< FbxBool > ScalingMaxZ
This property enables or disables the limit on scaling Z.
Definition: fbxnode.h:1678
Solid geometries rendered with smooth surfaces - using the system light.
Definition: fbxnode.h:229
A line is a geometry made of points.
Definition: fbxline.h:34
EPivotState
Pivot context state.
Definition: fbxnode.h:661
Geometries displayed in wire frame.
Definition: fbxnode.h:230
A mesh is a geometry made of polygons.
Definition: fbxmesh.h:32
This node attribute contains methods for accessing the properties of a stereo camera.