Go to the
documentation of this file.
00001 #ifndef __FBCHARACTERSOLVER_H__
00002 #define __FBCHARACTERSOLVER_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00045 #include <kaydaradef.h>
00046 #ifndef FBSDK_DLL
00047
00050 #define FBSDK_DLL K_DLLIMPORT
00051 #endif
00052
00053 #include <fbsdk/fbcomponent.h>
00054 #include <fbsdk/fbcore.h>
00055 #include <fbsdk/fbcharactermanipulator.h>
00056 #include <fbsdk/fbcharacter.h>
00057 #include <fbsdk/fbcharacterpose.h>
00058 #include <fbsdk/fbobjectpose.h>
00059
00060 #ifdef FBSDKUseNamespace
00061 namespace FBSDKNamespace {
00062 #endif
00063
00064 FB_DEFINE_COMPONENT( FBSDK_DLL, CharacterSolver );
00065
00073 #define FBRegisterCharacterSolver( UniqueNameStr, ClassName, Label, Description, IconFilename ) \
00074 HIObject RegisterCharacterSolver##ClassName##Create( HIObject ,const char* pName,void * ) \
00075 { \
00076 ClassName *Class = new ClassName(pName); \
00077 Class->UniqueName = UniqueNameStr; \
00078 if (Class->FBCreate()) { \
00079 return Class->GetHIObject(); \
00080 } else { \
00081 delete Class; \
00082 return NULL; \
00083 } \
00084 } \
00085 \
00086 FBLibraryModule( ClassName ) \
00087 { \
00088 FBRegisterObject( ClassName##R1,"FbxStorable/CharacterSolver",UniqueNameStr,Description,RegisterCharacterSolver##ClassName##Create, true, IconFilename ); \
00089 FBRegisterObject( ClassName##R2,"Character/Solvers",UniqueNameStr,Description,RegisterCharacterSolver##ClassName##Create,true, IconFilename ); \
00090 }
00091
00097 #define FBCharacterSolverDeclare( ClassName, Parent ) \
00098 FBClassDeclare( ClassName, Parent ); \
00099 public: \
00100 ClassName(const char* pName):Parent(pName) { FBClassInit; } \
00101 private:
00102
00106 #define FBCharacterSolverImplementation( ThisComponent ) \
00107 FBClassImplementation( ThisComponent )
00108
00110
00112 __FB_FORWARD( FBCharacterSolver);
00113
00115 class FBSDK_DLL FBCharacterSolver : public FBConstraint
00116 {
00117 __FBClassDeclare( FBCharacterSolver,FBConstraint );
00118 public:
00123 FBCharacterSolver(const char* pName, HIObject pObject=NULL);
00124
00125 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00126 IObject_Declare(K_IMPLEMENTATION);
00127 #endif
00128
00129 int mEvaluationId;
00130 FBPropertyCharacter TargetCharacter;
00131 FBPropertyComponent Source;
00132
00139 FBEvaluateInfo* BackgroundEvaluateInfoBegin(FBEvaluateInfo* pSourceEvaluateInfo, bool pEvaluateCandidates=false);
00140
00147 FBEvaluateInfo* BackgroundEvaluateInfoRecursiveBegin(FBEvaluateInfo* pSourceEvaluateInfo, bool pForceUpdateLocals=false);
00148
00150 void BackgroundEvaluateInfoEnd(FBEvaluateInfo* pBackgroundEvaluateInfo);
00151
00159 bool BackgroundEvaluateInfoNotify(FBEvaluateInfo* pBackgroundEvaluateInfo, kBackgroundEvaluationCallback pFunction, void* pCustomData=NULL);
00160
00161 void ResetConnectorSetup();
00162
00163 virtual FBCharacterManipulatorCtrlSet* CreateCharacterManipulatorCtrlSet(const char* pName);
00164
00166 virtual double GetCharacterSolverVersion() { return 1.0; };
00167
00171 virtual int GetExtraFKCount() { return 0; }
00176 virtual const char* GetExtraFKNameAt(int pIndex) { return NULL; }
00181 virtual FBBodyPartId GetExtraFKBodyPartAt(int pIndex) { return kFBCtrlSetPartNone; }
00185 virtual int GetExtraBoneCount() { return 0; }
00190 virtual const char* GetExtraBoneNameAt(int pIndex) { return NULL; }
00195 virtual FBBodyPartId GetExtraBoneBodyPartAt(int pIndex) { return kFBCtrlSetPartNone; }
00196
00201 FBModel* GetExtraBoneModelAt(int pIndex);
00206 FBModelMarker* GetExtraFKModelAt(int pIndex);
00207
00208
00209
00214 void SetExtraBoneModelAt(FBModel* pModel, int pIndex);
00219 void SetExtraFKModelAt(FBModelMarker* pModel, int pIndex);
00220
00223 void ExtractOffsets();
00231 void GetTransformOffset( FBVector3d &pT, FBRVector &pR, FBSVector &pS, int pIndex );
00239 void SetTransformOffset( FBVector3d &pT, FBRVector &pR, FBSVector &pS, int pIndex );
00246 void GetParentRotationOffset( FBRVector &pR, int pIndex );
00253 void SetParentRotationOffset( FBRVector &pR, int pIndex );
00254
00260 virtual void CharacterPasteState( FBCharacter* pFromCharacter, FBCharacterPose* pPose, FBCharacterPoseOptions& pCharacterPoseOptions) {}
00261
00266 virtual void ResetExtraProperties() {};
00267
00270 bool GetRigAlign();
00271
00274 bool GetDoubleSolve();
00275 };
00276
00277
00278
00279
00283 FBSDK_DLL int FBGetCharacterExternalSolverCount();
00284
00289 FBSDK_DLL const char* FBGetCharacterExternalSolverName(int pIndex);
00290
00295 FBSDK_DLL int FBGetCharacterExternalSolverIndex(const char* pName);
00296
00302 FBSDK_DLL FBCharacterSolver* FBInstanciateCharacterExternalSolver(int pIndex, const char *pSolverName = NULL);
00303
00304
00305
00306 #ifdef FBSDKUseNamespace
00307 }
00308 #endif
00309 #endif