| 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 | |
| 12 | //! \file fbxconstraintsinglechainik.h |
| 13 | #ifndef _FBXSDK_SCENE_CONSTRAINT_SINGLE_CHAIN_IK_H_ |
| 14 | #define _FBXSDK_SCENE_CONSTRAINT_SINGLE_CHAIN_IK_H_ |
| 15 | |
| 16 | #include <fbxsdk/fbxsdk_def.h> |
| 17 | |
| 18 | #include <fbxsdk/scene/constraint/fbxconstraint.h> |
| 19 | |
| 20 | #include <fbxsdk/fbxsdk_nsbegin.h> |
| 21 | |
| 22 | /** \brief This constraint class contains methods for accessing the properties of a single chain IK constraint. |
| 23 | * \nosubgrouping |
| 24 | */ |
| 25 | class FBXSDK_DLL FbxConstraintSingleChainIK : public FbxConstraint |
| 26 | { |
| 27 | FBXSDK_OBJECT_DECLARE(FbxConstraintSingleChainIK, FbxConstraint); |
| 28 | |
| 29 | public: |
| 30 | /** Solver pole vector mode. |
| 31 | */ |
| 32 | enum ESolverMode |
| 33 | { |
| 34 | eRotatePlane, //! Rotate plane solver. |
| 35 | eSingleChain //! Single chain solver. |
| 36 | }; |
| 37 | |
| 38 | /** Pole vector mode. |
| 39 | */ |
| 40 | enum EPoleVectorMode |
| 41 | { |
| 42 | eVector, //! Pole vector type is vector. |
| 43 | eObject //! Pole vector type is object. |
| 44 | }; |
| 45 | |
| 46 | /** If the constraints read its animation on Translation and Scale for the nodes it constraints. |
| 47 | */ |
| 48 | enum EEvaluationMode |
| 49 | { |
| 50 | eNeverTS, //! The constraints never read its animation on translation and scale for the nodes. |
| 51 | eAutoDetect, //! The constraints read its animation on translation and scale for the nodes according to automatic detection. |
| 52 | eAlwaysTS //! The constraints always read its animation on translation and scale for the nodes. |
| 53 | }; |
| 54 | |
| 55 | /** |
| 56 | * \name Properties |
| 57 | */ |
| 58 | //@{ |
| 59 | /** This property handles pole vector type. |
| 60 | */ |
| 61 | FbxPropertyT<FbxEnum> PoleVectorType; |
| 62 | |
| 63 | /** This property handles solver type. |
| 64 | */ |
| 65 | FbxPropertyT<FbxEnum> SolverType; |
| 66 | |
| 67 | /** This property handles evaluate TS animation. |
| 68 | */ |
| 69 | FbxPropertyT<FbxEnum> EvaluateTSAnim; |
| 70 | |
| 71 | /** This property handles pole vector objects. |
| 72 | */ |
| 73 | FbxPropertyT<FbxReference> PoleVectorObjects; |
| 74 | |
| 75 | /** This property handles pole vector. |
| 76 | * |
| 77 | * Default value is (0, 1, 0). |
| 78 | */ |
| 79 | FbxPropertyT<FbxDouble3> PoleVector; |
| 80 | |
| 81 | /** This property handles twist value. |
| 82 | * |
| 83 | * Default value is 0. |
| 84 | */ |
| 85 | FbxPropertyT<FbxDouble> Twist; |
| 86 | |
| 87 | /** This property handles first joint object. |
| 88 | */ |
| 89 | FbxPropertyT<FbxReference> FirstJointObject; |
| 90 | |
| 91 | /** This property handles end joint object. |
| 92 | */ |
| 93 | FbxPropertyT<FbxReference> EndJointObject; |
| 94 | |
| 95 | /** This property handles effector object. |
| 96 | */ |
| 97 | FbxPropertyT<FbxReference> EffectorObject; |
| 98 | //@} |
| 99 | |
| 100 | /** Get the weight of a source. |
| 101 | * \param pObject Source object that we want the weight. |
| 102 | */ |
| 103 | double GetPoleVectorObjectWeight(const FbxObject* pObject) const; |
| 104 | |
| 105 | /** Add a source to the constraint. |
| 106 | * \param pObject New source object. |
| 107 | * \param pWeight Weight value of the source object expressed as a percentage. |
| 108 | * \remarks pWeight value is 100 percent by default. |
| 109 | */ |
| 110 | void AddPoleVectorObject(FbxObject* pObject, double pWeight = 100); |
| 111 | |
| 112 | /** Retrieve the constraint source count. |
| 113 | * \return Current constraint source count. |
| 114 | */ |
| 115 | int GetConstraintPoleVectorCount() const; |
| 116 | |
| 117 | /** Retrieve a constraint source object. |
| 118 | * \param pIndex Index of constraint source object. |
| 119 | * \return Current source at the specified index. |
| 120 | */ |
| 121 | FbxObject* GetPoleVectorObject(int pIndex) const; |
| 122 | |
| 123 | /** Set the first joint object. |
| 124 | * \param pObject The first joint object. |
| 125 | */ |
| 126 | void SetFirstJointObject(FbxObject* pObject); |
| 127 | |
| 128 | /** Retrieve the first joint object. |
| 129 | * \return Current first joint object. |
| 130 | */ |
| 131 | FbxObject* GetFirstJointObject() const; |
| 132 | |
| 133 | /** Set the end joint object. |
| 134 | * \param pObject The end joint object. |
| 135 | */ |
| 136 | void SetEndJointObject(FbxObject* pObject); |
| 137 | |
| 138 | /** Retrieve the end joint object. |
| 139 | * \return Current end joint object. |
| 140 | */ |
| 141 | FbxObject* GetEndJointObject() const; |
| 142 | |
| 143 | /** Set the effector object. |
| 144 | * \param pObject The effector object. |
| 145 | */ |
| 146 | void SetEffectorObject(FbxObject* pObject); |
| 147 | |
| 148 | /** Retrieve the effector object. |
| 149 | * \return Current effector object. |
| 150 | */ |
| 151 | FbxObject* GetEffectorObject() const; |
| 152 | |
| 153 | /***************************************************************************************************************************** |
| 154 | ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! ** |
| 155 | *****************************************************************************************************************************/ |
| 156 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 157 | protected: |
| 158 | virtual void ConstructProperties(bool pForceSet); |
| 159 | virtual EType GetConstraintType() const; |
| 160 | #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/ |
| 161 | }; |
| 162 | |
| 163 | inline EFbxType FbxTypeOf(const FbxConstraintSingleChainIK::EPoleVectorMode&){ return eFbxEnum; } |
| 164 | inline EFbxType FbxTypeOf(const FbxConstraintSingleChainIK::ESolverMode&){ return eFbxEnum; } |
| 165 | inline EFbxType FbxTypeOf(const FbxConstraintSingleChainIK::EEvaluationMode&){ return eFbxEnum; } |
| 166 | |
| 167 | #include <fbxsdk/fbxsdk_nsend.h> |
| 168 | |
| 169 | #endif /* _FBXSDK_SCENE_CONSTRAINT_SINGLE_CHAIN_IK_H_ */ |
| 170 | |