00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013 #ifndef _FBXSDK_SCENE_CONSTRAINT_CONTROL_SET_H_
00014 #define _FBXSDK_SCENE_CONSTRAINT_CONTROL_SET_H_
00015
00016 #include <fbxsdk/fbxsdk_def.h>
00017
00018 #include <fbxsdk/scene/constraint/fbxcharacter.h>
00019 #include <fbxsdk/core/math/fbxaffinematrix.h>
00020 #include <fbxsdk/core/base/fbxstring.h>
00021
00022 #include <fbxsdk/fbxsdk_nsbegin.h>
00023
00024 class FbxNode;
00025 class FbxManager;
00026 class FbxControlSetPlug;
00027
00033 class FBXSDK_DLL FbxControlSetLink
00034 {
00035 public:
00037 FbxControlSetLink();
00038
00042 FbxControlSetLink(const FbxControlSetLink& pControlSetLink);
00043
00047 FbxControlSetLink& operator=(const FbxControlSetLink& pControlSetLink);
00048
00053 void Reset();
00054
00056 FbxNode* mNode;
00057
00060 FbxString mTemplateName;
00061 };
00062
00066 class FBXSDK_DLL FbxEffector
00067 {
00068 public:
00069 enum ESetId
00070 {
00071 eDefaultSet,
00072 eAux1Set,
00073 eAux2Set,
00074 eAux3Set,
00075 eAux4Set,
00076 eAux5Set,
00077 eAux6Set,
00078 eAux7Set,
00079 eAux8Set,
00080 eAux9Set,
00081 eAux10Set,
00082 eAux11Set,
00083 eAux12Set,
00084 eAux13Set,
00085 eAux14Set,
00086 eSetIdCount
00087 };
00088
00089 enum ENodeId
00090 {
00091 eHips,
00092 eLeftAnkle,
00093 eRightAnkle,
00094 eLeftWrist,
00095 eRightWrist,
00096 eLeftKnee,
00097 eRightKnee,
00098 eLeftElbow,
00099 eRightElbow,
00100 eChestOrigin,
00101 eChestEnd,
00102 eLeftFoot,
00103 eRightFoot,
00104 eLeftShoulder,
00105 eRightShoulder,
00106 eHead,
00107 eLeftHip,
00108 eRightHip,
00109 eLeftHand,
00110 eRightHand,
00111 eLeftHandThumb,
00112 eLeftHandIndex,
00113 eLeftHandMiddle,
00114 eLeftHandRing,
00115 eLeftHandPinky,
00116 eLeftHandExtraFinger,
00117 eRightHandThumb,
00118 eRightHandIndex,
00119 eRightHandMiddle,
00120 eRightHandRing,
00121 eRightHandPinky,
00122 eRightHandExtraFinger,
00123 eLeftFootThumb,
00124 eLeftFootIndex,
00125 eLeftFootMiddle,
00126 eLeftFootRing,
00127 eLeftFootPinky,
00128 eLeftFootExtraFinger,
00129 eRightFootThumb,
00130 eRightFootIndex,
00131 eRightFootMiddle,
00132 eRightFootRing,
00133 eRightFootPinky,
00134 eRightFootExtraFinger,
00135 eNodeIdCount
00136 };
00137
00139 FbxEffector();
00140
00144 FbxEffector& operator=(const FbxEffector& pEffector);
00145
00150 void Reset();
00151
00153 FbxNode* mNode;
00154
00156 bool mShow;
00157
00159
00160
00161
00162
00163
00164
00166 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00167
00168
00169 bool mTActive;
00170 bool mRActive;
00171 bool mCandidateTActive;
00172 bool mCandidateRActive;
00173 #endif
00174 };
00175
00193 class FBXSDK_DLL FbxControlSet
00194 {
00195 public:
00199 void Reset();
00200
00206 enum EType
00207 {
00208 eNone,
00209 eFkIk,
00210 eIkOnly
00211 };
00212
00216 void SetType(EType pType);
00217
00221 EType GetType() const;
00222
00226 void SetUseAxis(bool pUseAxis);
00227
00231 bool GetUseAxis() const;
00232
00236 void SetLockTransform(bool pLockTransform);
00237
00241 bool GetLockTransform()const;
00242
00246 void SetLock3DPick(bool pLock3DPick);
00247
00251 bool GetLock3DPick() const;
00252
00262 bool SetControlSetLink(FbxCharacter::ENodeId pCharacterNodeId, const FbxControlSetLink& pControlSetLink);
00263
00273 bool GetControlSetLink(FbxCharacter::ENodeId pCharacterNodeId, FbxControlSetLink* pControlSetLink = NULL) const;
00274
00280 bool SetEffector(FbxEffector::ENodeId pEffectorNodeId, FbxEffector pEffector);
00281
00287 bool GetEffector(FbxEffector::ENodeId pEffectorNodeId, FbxEffector* pEffector = NULL);
00288
00295 bool SetEffectorAux(FbxEffector::ENodeId pEffectorNodeId, FbxNode* pNode, FbxEffector::ESetId pEffectorSetId=FbxEffector::eAux1Set);
00296
00303 bool GetEffectorAux(FbxEffector::ENodeId pEffectorNodeId, FbxNode** pNode=NULL, FbxEffector::ESetId pEffectorSetId=FbxEffector::eAux1Set) const;
00304
00309 static char* GetEffectorNodeName(FbxEffector::ENodeId pEffectorNodeId);
00310
00316 static FbxEffector::ENodeId GetEffectorNodeId(char* pEffectorNodeName);
00317
00319
00320
00321
00322
00323
00324
00326 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00327 void FromPlug(FbxControlSetPlug *pPlug);
00328 void ToPlug(FbxControlSetPlug *pPlug);
00329
00330 private:
00331 FbxControlSet();
00332 ~FbxControlSet();
00333
00334 FbxCharacter* mCharacter;
00335 EType mType;
00336 bool mUseAxis;
00337 bool mLockTransform;
00338 bool mLock3DPick;
00339 FbxControlSetLink mControlSetLink[FbxCharacter::eNodeIdCount];
00340 FbxEffector mEffector[FbxEffector::eNodeIdCount];
00341 FbxNode* mEffectorAux[FbxEffector::eNodeIdCount][FbxEffector::eSetIdCount-1];
00342
00343 FBXSDK_FRIEND_NEW();
00344 friend class FbxCharacter;
00345 friend class FbxNode;
00346 #endif
00347 };
00348
00352 class FBXSDK_DLL FbxControlSetPlug : public FbxObject
00353 {
00354 FBXSDK_OBJECT_DECLARE(FbxControlSetPlug, FbxObject);
00355
00356 public:
00358 FbxPropertyT<FbxControlSet::EType> ControlSetType;
00359
00361 FbxPropertyT<FbxBool> UseAxis;
00362
00364 FbxPropertyT<FbxReference> Character;
00365
00374 FbxError& GetError();
00375
00377 enum EErrorCode
00378 {
00379 eError,
00380 eErrorCount
00381 };
00382
00386 EErrorCode GetLastErrorID() const;
00387
00391 const char* GetLastErrorString() const;
00393
00394 protected:
00395 FbxControlSetPlug(FbxManager& pManager, char const* pName);
00396 virtual void Construct(const FbxControlSetPlug* pFrom);
00397
00398 virtual FbxStringList GetTypeFlags() const;
00399
00400 private:
00401 FbxArray<FbxProperty> mFKBuf;
00402 FbxArray<FbxProperty> mIKBuf;
00403
00404 FbxError mError;
00405
00406 friend class FbxScene;
00407 friend class FbxControlSet;
00408 };
00409
00410 inline EFbxType FbxTypeOf(const FbxControlSet::EType&){ return eFbxEnum; }
00411
00412 #include <fbxsdk/fbxsdk_nsend.h>
00413
00414 #endif