Go to the
documentation of this file.
00001 #ifndef __FBCHARACTERPOSE_H__
00002 #define __FBCHARACTERPOSE_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
00043 #include <kaydaradef.h>
00044 #ifndef FBSDK_DLL
00045
00048 #define FBSDK_DLL K_DLLIMPORT
00049 #endif
00050
00051 #include <fbsdk/fbcomponent.h>
00052 #include <fbsdk/fbpose.h>
00053
00054 #ifdef FBSDKUseNamespace
00055 namespace FBSDKNamespace {
00056 #endif
00057
00058 FB_FORWARD( FBCharacter )
00059 FB_FORWARD( FBCharacterExtension )
00060 FB_FORWARD( FBObjectPose )
00061 FB_FORWARD( FBModel )
00062
00063
00064 enum FBCharacterPoseFlag
00065 {
00066 kFBCharacterPoseNoFlag = 0,
00067 kFBCharacterPoseMirror = 1,
00068 kFBCharacterPoseGravity = 1<<1,
00069 kFBCharacterPoseMatchTX = 1<<2,
00070 kFBCharacterPoseMatchTY = 1<<3,
00071 kFBCharacterPoseMatchTZ = 1<<4,
00072 kFBCharacterPoseMatchR = 1<<5,
00073 kFBCharacterPoseMatchPivot = 1<<6,
00074 kFBCharacterPoseUseKeyingGroup = 1<<7
00075 };
00076
00078 enum FBMirrorPlaneType
00079 {
00080 kFBMirrorPlaneTypeInvalid = -1,
00081 kFBMirrorPlaneTypeAuto = 0,
00082 kFBMirrorPlaneTypeZY,
00083 kFBMirrorPlaneTypeXY,
00084 kFBMirrorPlaneTypeXZ,
00085 kFBMirrorPlaneTypeUser,
00086 kFBMirrorPlaneTypeEquation,
00087 kFBMirrorPlaneTypeCount
00088 };
00089
00091 enum FBCharacterPoseKeyingMode
00092 {
00093 kFBCharacterPoseKeyingModeInvalid = -1,
00094 kFBCharacterPoseKeyingModeFullBody = 0,
00095 kFBCharacterPoseKeyingModeBodyPart,
00096 kFBCharacterPoseKeyingModeCount
00097 };
00098
00100
00102 FB_FORWARD( FBCharacterPoseOptions );
00103
00117 class FBSDK_DLL FBCharacterPoseOptions
00118 {
00119 public:
00120
00124 FBModel* mModelToMatch;
00125
00127 FBCharacterPoseKeyingMode mCharacterPoseKeyingMode;
00128
00130 FBMirrorPlaneType mMirrorPlaneType;
00131
00138 FBVector4<double> mMirrorPlaneEquation;
00139
00141 double mMirrorPlaneTiltAngle;
00142
00144 double mMirrorPlanePanAngle;
00145
00148 FBCharacterPoseOptions();
00149
00154 void SetFlag( FBCharacterPoseFlag pFlag, bool pValue );
00155
00160 bool GetFlag( FBCharacterPoseFlag pFlag );
00161
00164 void ClearFlag();
00165
00166 private:
00167
00168 FBCharacterPoseFlag mFlags;
00169 };
00170
00172
00174 __FB_FORWARD( FBCharacterPose );
00175
00179 class FBSDK_DLL FBCharacterPose : public FBPose
00180 {
00181
00182 __FBClassDeclare( FBCharacterPose, FBPose );
00183
00184 public:
00190 FBCharacterPose( char* pName, HIObject pObject = NULL );
00191
00194 void ClearPose();
00195
00198 void ClearCharacterPose();
00199
00202 void ClearCharacterExtensionsPose();
00203
00207 void CopyPose( FBCharacter& pCharacter );
00208
00212 void CopyPoseCharacter( FBCharacter& pCharacter );
00213
00217 void CopyPoseCharacterExtensions( FBCharacter& pCharacter );
00218
00222 void CopyPoseCharacterExtension( FBCharacterExtension& pCharacterExtension );
00223
00230 void PastePose( FBCharacter& pCharacter, FBCharacterPoseOptions& pCharacterPoseOptions );
00231
00237 void PastePoseCharacter( FBCharacter& pCharacter, FBCharacterPoseOptions& pCharacterPoseOptions );
00238
00244 void PastePoseCharacterExtensions( FBCharacter& pCharacter, FBCharacterPoseOptions& pCharacterPoseOptions );
00245
00251 void PastePoseCharacterExtension( FBCharacterExtension& pCharacterExtension, FBCharacterPoseOptions& pCharacterPoseOptions );
00252
00256 bool IsCharacterPoseStored();
00257
00262 bool IsCharacterExtensionPoseStored( const char* pCharacterExtensionName );
00263
00268 void CopyFrom( FBCharacterPose& pFromPose );
00269
00274 void CopyPoseDataFrom( FBCharacterPose& pFromPose );
00275
00279 void CopyPoseCharacterFrom( FBCharacterPose& pFromPose );
00280
00284 void CopyPoseCharacterExtensionsFrom( FBCharacterPose& pFromPose );
00285
00289 int GetCharacterExtensionPoseCount();
00290
00295 FBObjectPose* GetCharacterExtensionPoseAt( int pIndex );
00296
00301 FBObjectPose* GetCharacterExtensionPose( const char* pCharacterExtensionName );
00302
00308 FBObjectPose* GetOrCreateCharacterExtensionPose( const char* pCharacterExtensionName );
00309
00313 void RemoveCharacterExtensionPoseAt( int pIndex );
00314
00318 void RemoveCharacterExtensionPose( const char* pCharacterExtensionName );
00319
00324 FBString GetCharacterExtensionNameFromPose( FBObjectPose& pCharacterExtensionPose );
00325
00331 void GetMirrorPlaneEquation( FBVector4<double>& pMirrorPlaneEquation, FBCharacter& pCharacter, FBCharacterPoseOptions& pCharacterPoseOptions );
00332
00338 void GetMirrorPlaneEquation( FBMatrix& pMirrorPlaneEquation, FBCharacter& pCharacter, FBCharacterPoseOptions& pCharacterPoseOptions );
00339
00340
00344 int GetExtraBoneCount();
00345
00350 FBModel* GetExtraBoneModelAt(int pIndex);
00351
00358 void GetExtraBoneTransformOffset(FBVector3d &pT, FBVector3d &pR, FBVector3d &pS, int pIndex );
00359
00366 void GetExtraBoneTransform(FBVector3d &pT, FBVector3d &pR, FBVector3d &pS, int pIndex );
00367
00372 void GetExtraBoneParentRotationOffset( FBRVector &pR, int pIndex );
00373
00377 void ApplyPoseCandidate();
00378
00379 private:
00380
00382
00386 FBCharacterPose( const FBCharacterPose& );
00387 FBCharacterPose& operator=( const FBCharacterPose& );
00389 };
00390
00392
00394
00396 class FBSDK_DLL FBPropertyListCharacterPose : public FBPropertyListComponent
00397 {
00398 public:
00399 FBPropertyListCharacterPose();
00404 FBCharacterPose* operator[]( int pIndex );
00405 };
00406
00407 #ifdef FBSDKUseNamespace
00408 }
00409 #endif
00410
00411 #endif