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,"Browsing/Templates/Solvers",Label,Description,RegisterCharacterSolver##ClassName##Create,true,
IconFilename ); \
00090
FBRegisterObject(
ClassName##R3,"Character/Solvers",UniqueNameStr,Description,RegisterCharacterSolver##ClassName##Create,true,
IconFilename ); \
00091 }
00092
00098
#define
FBCharacterSolverDeclare( ClassName, Parent ) \ 00099
FBClassDeclare( ClassName, Parent ); \
00100
public: \ 00101
ClassName(char *
pName):Parent(pName) { FBClassInit; } \ 00102
private:
00103
00107
#define
FBCharacterSolverImplementation( ThisComponent ) \ 00108
FBClassImplementation( ThisComponent )
00109
00111
00113
__FB_FORWARD(
FBCharacterSolver);
00114
00116 class FBSDK_DLL
FBCharacterSolver :
public FBConstraint 00117 {
00118
__FBClassDeclare(
FBCharacterSolver,
FBConstraint );
00119
public:
00124
FBCharacterSolver(
char *pName, HIObject pObject=NULL);
00125
00126
#ifndef
DOXYGEN_SHOULD_SKIP_THIS 00127 IObject_Declare(Implementation);
00128
#endif 00129
00130
int mEvaluationId;
00131
FBPropertyCharacter TargetCharacter;
00132
FBPropertyComponent
Source;
00133
00134
virtual FBCharacterManipulatorCtrlSet*
CreateCharacterManipulatorCtrlSet(
char* pName);
00135
00139
virtual int GetExtraFKCount() {
return 0; }
00144
virtual const char*
GetExtraFKNameAt(
int pIndex) {
return NULL; }
00149
virtual FBBodyPartId
GetExtraFKBodyPartAt(
int pIndex) {
return kFBCtrlSetPartNone; }
00153
virtual int GetExtraBoneCount() {
return 0; }
00158
virtual const char*
GetExtraBoneNameAt(
int pIndex) {
return NULL; }
00163
virtual FBBodyPartId
GetExtraBoneBodyPartAt(
int pIndex)
{
return kFBCtrlSetPartNone; }
00164
00169
FBModel* GetExtraBoneModelAt(
int pIndex);
00174
FBModelMarker*
GetExtraFKModelAt(
int pIndex);
00175
00176
00177
00182
void SetExtraBoneModelAt(
FBModel* pModel,
int pIndex);
00187
void
SetExtraFKModelAt(
FBModelMarker* pModel,
int pIndex);
00188
00191
void ExtractOffsets();
00199
void GetTransformOffset(
FBVector3d &pT,
FBRVector &pR,
FBSVector &pS,
int pIndex );
00207
void
SetTransformOffset(
FBVector3d &pT,
FBRVector &pR,
FBSVector &pS,
int pIndex );
00214
void
GetParentRotationOffset(
FBRVector &pR,
int pIndex );
00221
void
SetParentRotationOffset(
FBRVector &pR,
int pIndex );
00222
00228
virtual void CharacterPasteState(
FBCharacter* pFromCharacter,
FBCharacterPose* pPose,
FBCharacterPoseOptions&
pCharacterPoseOptions) {}
00229 };
00230
00231
00232
00233
00237
FBSDK_DLL
int
FBGetCharacterExternalSolverCount();
00238
00243
FBSDK_DLL
const char*
FBGetCharacterExternalSolverName(
int pIndex);
00244
00249
FBSDK_DLL
int
FBGetCharacterExternalSolverIndex(
char* pName);
00250
00256
FBSDK_DLL
FBCharacterSolver*
FBInstanciateCharacterExternalSolver(
int pIndex,
const
char *pSolverName = NULL);
00257
00258
00259
00260
#ifdef
FBSDKUseNamespace 00261 }
00262
#endif 00263
#endif