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 ,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(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(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 HFBEvaluateInfo BackgroundEvaluateInfo(HFBEvaluateInfo pSourceEvaluateInfo);
00134 void ResetConnectorSetup();
00135
00136 virtual FBCharacterManipulatorCtrlSet* CreateCharacterManipulatorCtrlSet(char* pName);
00137
00139 virtual double GetCharacterSolverVersion() { return 1.0; };
00140
00144 virtual int GetExtraFKCount() { return 0; }
00149 virtual const char* GetExtraFKNameAt(int pIndex) { return NULL; }
00154 virtual FBBodyPartId GetExtraFKBodyPartAt(int pIndex) { return kFBCtrlSetPartNone; }
00158 virtual int GetExtraBoneCount() { return 0; }
00163 virtual const char* GetExtraBoneNameAt(int pIndex) { return NULL; }
00168 virtual FBBodyPartId GetExtraBoneBodyPartAt(int pIndex) { return kFBCtrlSetPartNone; }
00169
00174 FBModel* GetExtraBoneModelAt(int pIndex);
00179 FBModelMarker* GetExtraFKModelAt(int pIndex);
00180
00181
00182
00187 void SetExtraBoneModelAt(FBModel* pModel, int pIndex);
00192 void SetExtraFKModelAt(FBModelMarker* pModel, int pIndex);
00193
00196 void ExtractOffsets();
00204 void GetTransformOffset( FBVector3d &pT, FBRVector &pR, FBSVector &pS, int pIndex );
00212 void SetTransformOffset( FBVector3d &pT, FBRVector &pR, FBSVector &pS, int pIndex );
00219 void GetParentRotationOffset( FBRVector &pR, int pIndex );
00226 void SetParentRotationOffset( FBRVector &pR, int pIndex );
00227
00233 virtual void CharacterPasteState( FBCharacter* pFromCharacter, FBCharacterPose* pPose, FBCharacterPoseOptions& pCharacterPoseOptions) {}
00234 };
00235
00236
00237
00238
00242 FBSDK_DLL int FBGetCharacterExternalSolverCount();
00243
00248 FBSDK_DLL const char* FBGetCharacterExternalSolverName(int pIndex);
00249
00254 FBSDK_DLL int FBGetCharacterExternalSolverIndex(char* pName);
00255
00261 FBSDK_DLL FBCharacterSolver* FBInstanciateCharacterExternalSolver(int pIndex, const char *pSolverName = NULL);
00262
00263
00264
00265 #ifdef FBSDKUseNamespace
00266 }
00267 #endif
00268 #endif