fbxconstraintparent.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /****************************************************************************************
  2. Copyright (C) 2015 Autodesk, Inc.
  3. All rights reserved.
  4. Use of this software is subject to the terms of the Autodesk license agreement
  5. provided at the time of installation or download, or which otherwise accompanies
  6. this software in either electronic or hard copy form.
  7. ****************************************************************************************/
  8. //! \file fbxconstraintparent.h
  9. #ifndef _FBXSDK_SCENE_CONSTRAINT_PARENT_H_
  10. #define _FBXSDK_SCENE_CONSTRAINT_PARENT_H_
  11. #include <fbxsdk/fbxsdk_def.h>
  12. #include <fbxsdk/scene/constraint/fbxconstraint.h>
  13. #include <fbxsdk/fbxsdk_nsbegin.h>
  14. /** The parent constraint creates a parent-to-child relationship between any two objects, from any two hierarchies.
  15. * It creates the same relationship as the parent-to-child relationships found in hierarchies.
  16. * You can use this constraint to connect objects without changing hierarchies.
  17. * \nosubgrouping
  18. */
  19. class FBXSDK_DLL FbxConstraintParent : public FbxConstraint
  20. {
  21. FBXSDK_OBJECT_DECLARE(FbxConstraintParent, FbxConstraint);
  22. public:
  23. /**
  24. * \name Properties
  25. */
  26. //@{
  27. /** This property handles whether to affect the translation of the constrained object along X axis.
  28. *
  29. * Default value is true.
  30. */
  31. FbxPropertyT<FbxBool> AffectTranslationX;
  32. /** This property handles whether to affect the translation of the constrained object along Y axis.
  33. *
  34. * Default value is true.
  35. */
  36. FbxPropertyT<FbxBool> AffectTranslationY;
  37. /** This property handles whether to affect the translation of the constrained object along Z axis.
  38. *
  39. * Default value is true.
  40. */
  41. FbxPropertyT<FbxBool> AffectTranslationZ;
  42. /** This property handles whether to affect the rotation of the constrained object around X axis.
  43. *
  44. * Default value is true.
  45. */
  46. FbxPropertyT<FbxBool> AffectRotationX;
  47. /** This property handles whether to affect the rotation of the constrained object around Y axis.
  48. *
  49. * Default value is true.
  50. */
  51. FbxPropertyT<FbxBool> AffectRotationY;
  52. /** This property handles whether to affect the rotation of the constrained object around Z axis.
  53. *
  54. * Default value is true.
  55. */
  56. FbxPropertyT<FbxBool> AffectRotationZ;
  57. /** This property handles whether to affect the scaling of the constrained object along X axis.
  58. *
  59. * Default value is true.
  60. */
  61. FbxPropertyT<FbxBool> AffectScalingX;
  62. /** This property handles whether to affect the scaling of the constrained object along Y axis.
  63. *
  64. * Default value is true.
  65. */
  66. FbxPropertyT<FbxBool> AffectScalingY;
  67. /** This property handles whether to affect the scaling of the constrained object along Z axis.
  68. *
  69. * Default value is true.
  70. */
  71. FbxPropertyT<FbxBool> AffectScalingZ;
  72. /** This property used to access constraint sources.
  73. * A constrained object is an object whose position, orientation, and so on is driven by one or more constraint sources.
  74. */
  75. FbxPropertyT<FbxReference> ConstraintSources;
  76. /** This property used to access constrained object.
  77. * A constrained object is an object whose position, orientation, and so on is driven by one or more constraint sources.
  78. */
  79. FbxPropertyT<FbxReference> ConstrainedObject;
  80. //@}
  81. /** Set the translation offset of the specified constraint source.
  82. * \param pObject The specified constraint source.
  83. * \param pTranslation The new offset vector.
  84. */
  85. void SetTranslationOffset(FbxObject* pObject, FbxVector4 pTranslation);
  86. /** Retrieve the translation offset of the specified constraint source.
  87. * \param pObject The specified constraint source.
  88. * \return The current translation offset.
  89. */
  90. FbxVector4 GetTranslationOffset(const FbxObject* pObject) const;
  91. /** Set the rotation offset of the specified constraint source.
  92. * \param pObject The specified constraint source.
  93. * \param pRotation The new offset vector.
  94. */
  95. virtual void SetRotationOffset(const FbxObject* pObject, FbxVector4 pRotation);
  96. /** Retrieve the rotation offset of the specified constraint source.
  97. * \param pObject The specified constraint source.
  98. * \return The current translation offset.
  99. */
  100. FbxVector4 GetRotationOffset(const FbxObject* pObject) const;
  101. /** Add a constraint source to the constraint.
  102. * \param pObject New constraint source.
  103. * \param pWeight Weight of the constraint source.
  104. */
  105. void AddConstraintSource(FbxObject* pObject, double pWeight = 100);
  106. /** Retrieve the constraint source count.
  107. * \return Current constraint source count.
  108. */
  109. int GetConstraintSourceCount() const;
  110. /** Retrieve a constraint source object.
  111. * \param pIndex Index of the constraint source.
  112. * \return The constraint source at the specified index.
  113. */
  114. FbxObject* GetConstraintSource(int pIndex) const;
  115. /** Set the constrained object.
  116. * \param pObject The constrained object.
  117. */
  118. void SetConstrainedObject(FbxObject* pObject);
  119. /** Retrieve the constrained object.
  120. * \return Current constrained object.
  121. */
  122. FbxObject* GetConstrainedObject() const;
  123. /*****************************************************************************************************************************
  124. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  125. *****************************************************************************************************************************/
  126. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  127. protected:
  128. virtual void ConstructProperties(bool pForceSet);
  129. virtual EType GetConstraintType() const;
  130. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  131. };
  132. #include <fbxsdk/fbxsdk_nsend.h>
  133. #endif /* _FBXSDK_SCENE_CONSTRAINT_PARENT_H_ */