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(Implementation);
00127 #endif
00128
00129 int mEvaluationId;
00130 FBPropertyCharacter TargetCharacter;
00131 FBPropertyComponent Source;
00132
00133 FBEvaluateInfo* BackgroundEvaluateInfoBegin(FBEvaluateInfo* pSourceEvaluateInfo);
00134 void BackgroundEvaluateInfoEnd(FBEvaluateInfo* pBackgroundEvaluateInfo);
00135 void ResetConnectorSetup();
00136
00137 virtual FBCharacterManipulatorCtrlSet* CreateCharacterManipulatorCtrlSet(const char* pName);
00138
00140 virtual double GetCharacterSolverVersion() { return 1.0; };
00141
00145 virtual int GetExtraFKCount() { return 0; }
00150 virtual const char* GetExtraFKNameAt(int pIndex) { return NULL; }
00155 virtual FBBodyPartId GetExtraFKBodyPartAt(int pIndex) { return kFBCtrlSetPartNone; }
00159 virtual int GetExtraBoneCount() { return 0; }
00164 virtual const char* GetExtraBoneNameAt(int pIndex) { return NULL; }
00169 virtual FBBodyPartId GetExtraBoneBodyPartAt(int pIndex) { return kFBCtrlSetPartNone; }
00170
00175 FBModel* GetExtraBoneModelAt(int pIndex);
00180 FBModelMarker* GetExtraFKModelAt(int pIndex);
00181
00182
00183
00188 void SetExtraBoneModelAt(FBModel* pModel, int pIndex);
00193 void SetExtraFKModelAt(FBModelMarker* pModel, int pIndex);
00194
00197 void ExtractOffsets();
00205 void GetTransformOffset( FBVector3d &pT, FBRVector &pR, FBSVector &pS, int pIndex );
00213 void SetTransformOffset( FBVector3d &pT, FBRVector &pR, FBSVector &pS, int pIndex );
00220 void GetParentRotationOffset( FBRVector &pR, int pIndex );
00227 void SetParentRotationOffset( FBRVector &pR, int pIndex );
00228
00234 virtual void CharacterPasteState( FBCharacter* pFromCharacter, FBCharacterPose* pPose, FBCharacterPoseOptions& pCharacterPoseOptions) {}
00235
00236 bool GetRigAlign();
00237 };
00238
00239
00240
00241
00245 FBSDK_DLL int FBGetCharacterExternalSolverCount();
00246
00251 FBSDK_DLL const char* FBGetCharacterExternalSolverName(int pIndex);
00252
00257 FBSDK_DLL int FBGetCharacterExternalSolverIndex(const char* pName);
00258
00264 FBSDK_DLL FBCharacterSolver* FBInstanciateCharacterExternalSolver(int pIndex, const char *pSolverName = NULL);
00265
00266
00267
00268 #ifdef FBSDKUseNamespace
00269 }
00270 #endif
00271 #endif