00001 #ifndef __FBOBJECTPOSE_H__
00002 #define __FBOBJECTPOSE_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
00060 enum FBPoseTransformType
00061 {
00062 kFBPoseTransformInvalid = -1,
00063 kFBPoseTransformLocal = 0,
00064 kFBPoseTransformGlobal,
00065 kFBPoseTransformLocalRef,
00066 kFBPoseTransformTypeCount
00067 };
00068
00070 enum FBObjectPoseOptionsFlag
00071 {
00072 kFBObjectPoseOptionsNoFlag = 0,
00073 kFBObjectPoseOptionsTranslationX= 1,
00074 kFBObjectPoseOptionsTranslationY= 1<<1,
00075 kFBObjectPoseOptionsTranslationZ= 1<<2,
00076 kFBObjectPoseOptionsRotation = 1<<3,
00077 kFBObjectPoseOptionsScaling = 1<<4,
00078 };
00079
00081 enum FBObjectPoseMirrorOptionsFlag
00082 {
00083 kFBObjectPoseMirrorOptionsNoFlag = 0,
00084 kFBObjectPoseMirrorOptionsUpdateLocal = 1,
00085 kFBObjectPoseMirrorOptionsUpdateLocalMirrorParent = 1<<1,
00086 kFBObjectPoseMirrorOptionsUpdateLocalRef = 1<<2,
00087 kFBObjectPoseMirrorOptionsUpdateLocalRefMirrorRef = 1<<3,
00088 };
00089
00091
00093 FB_FORWARD( FBObjectPoseOptions );
00094
00098 class FBSDK_DLL FBObjectPoseOptions
00099 {
00100 public:
00101
00103 FBPoseTransformType mPoseTransformType;
00104
00106 FBTVector mReferenceGT;
00107
00109 FBMatrix mReferenceGRM;
00110
00112 FBMatrix mReferenceGSM;
00113
00116 FBObjectPoseOptions();
00117
00122 void SetFlag( FBObjectPoseOptionsFlag pFlag, bool pValue );
00123
00128 bool GetFlag( FBObjectPoseOptionsFlag pFlag );
00129
00132 void ClearFlag();
00133
00134 private:
00135
00136 FBObjectPoseOptionsFlag mFlags;
00137 };
00138
00140
00142 FB_FORWARD( FBObjectPoseMirrorOptions );
00143
00147 class FBSDK_DLL FBObjectPoseMirrorOptions
00148 {
00149 public:
00150
00157 FBVector4<double> mMirrorPlaneEquation;
00158
00161 FBObjectPoseMirrorOptions();
00162
00167 void SetFlag( FBObjectPoseMirrorOptionsFlag pFlag, bool pValue );
00168
00173 bool GetFlag( FBObjectPoseMirrorOptionsFlag pFlag );
00174
00177 void ClearFlag();
00178
00179 private:
00180
00181 FBObjectPoseMirrorOptionsFlag mFlags;
00182 };
00183
00185
00187 __FB_FORWARD( FBObjectPose );
00188
00192 class FBSDK_DLL FBObjectPose : public FBPose
00193 {
00194
00195 __FBClassDeclare( FBObjectPose, FBPose );
00196
00197 public:
00203 FBObjectPose( char* pName, HIObject pObject = NULL );
00204
00207 void ClearPose();
00208
00212 bool IsPropertyPoseable( FBProperty &pProperty );
00213
00219 void CopyObjectPose( const char* pObjectName, FBComponent& pObject );
00220
00226 void CopyPropertyPose( const char* pObjectName, FBProperty& pProperty );
00227
00234 void PasteObjectPose( const char* pObjectName, FBComponent& pObject );
00235
00242 void PastePropertyPose( const char* pObjectName, FBProperty& pProperty );
00243
00250 void SetPropertyValue( const char* pObjectName, const char* pPropertyName, double* pValue, int pSize );
00251
00258 void GetPropertyValue( double* pValue, int pSize, const char* pObjectName, const char* pPropertyName );
00259
00265 bool IsPropertyStored( const char* pObjectName, const char* pPropertyName );
00266
00273 void CopyTransform( const char* pObjectName, FBComponent& pObject, FBObjectPoseOptions& pObjectPoseOptions );
00274
00282 void PasteTransform( const char* pObjectName, FBComponent& pObject, FBObjectPoseOptions& pObjectPoseOptions, HFBEvaluateInfo pEvaluateInfo = NULL );
00283
00291 void SetTransform( FBTVector& pT, FBMatrix& pRM, FBMatrix& pSM, const char* pObjectName, FBPoseTransformType pPoseTransformType );
00292
00301 bool GetTransform( FBTVector& pT, FBMatrix& pRM, FBMatrix& pSM, const char* pObjectName, FBPoseTransformType pPoseTransformType );
00302
00309 bool IsTransformStored( const char* pObjectName, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
00310
00316 void MultTransformAllObjects( FBMatrix& pGX, FBModelTransformationMatrix pTransformAttribute, FBPoseTransformType pPoseTransformType );
00317
00324 void MultTransform( const char* pObjectName, FBMatrix& pGX, FBModelTransformationMatrix pTransformAttribute, FBPoseTransformType pPoseTransformType );
00325
00329 void MirrorPoseAllObjects( FBObjectPoseMirrorOptions& pObjectPoseMirrorOptions );
00330
00335 void MirrorPose( const char* pObjectName, FBObjectPoseMirrorOptions& pObjectPoseMirrorOptions );
00336
00343 void RemoveStanceOffsetAllObjects( FBObjectPose& pStancePose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
00344
00352 void RemoveStanceOffset( const char* pObjectName, FBObjectPose& pStancePose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
00353
00360 void AddStanceOffsetAllObjects( FBObjectPose& pStancePose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
00361
00369 void AddStanceOffset( const char* pObjectName, FBObjectPose& pStancePose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
00370
00380 static void MirrorRetargetPoseAllObjects
00381 (
00382 FBObjectPose& pDstPose,
00383 FBObjectPose& pSrcPose,
00384 FBObjectPose& pDstStancePose,
00385 FBObjectPose& pSrcStancePose,
00386 FBVector4<double>& pMirrorPlaneEquation
00387 );
00388
00400 static void MirrorRetargetPose
00401 (
00402 FBObjectPose& pDstPose,
00403 FBObjectPose& pSrcPose,
00404 FBObjectPose& pDstStancePose,
00405 FBObjectPose& pSrcStancePose,
00406 FBVector4<double>& pMirrorPlaneEquation,
00407 const char* pDstObjectName,
00408 const char* pSrcObjectName
00409 );
00410
00415 void CopyFrom( FBObjectPose& pFromPose );
00416
00421 void CopyPoseDataFrom( FBObjectPose& pFromPose );
00422
00428 void CopyPoseAllObjectsTransformFrom( FBObjectPose& pFromPose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
00429
00436 void CopyPoseTransformFrom( FBObjectPose& pFromPose, const char* pObjectName, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
00437
00438 private:
00439
00441
00445 FBObjectPose( const FBObjectPose& );
00446 FBObjectPose& operator=( const FBObjectPose& );
00448 };
00449
00451
00453
00455 class FBSDK_DLL FBPropertyListObjectPose : public FBPropertyListComponent
00456 {
00457 public:
00458 FBPropertyListObjectPose();
00463 FBObjectPose* operator[]( int pIndex );
00464 };
00465
00467
00469
00475 FBSDK_DLL void GetPlaneEquation( FBVector4<double>& pPlaneEquation, const FBTVector& pPlaneNormalVector, const FBTVector& pPointOnPlane );
00476
00482 FBSDK_DLL void GetPlaneEquation( FBVector4<double>& pPlaneEquation, const FBTVector& pPointOnPlane, const FBMatrix& pPlaneRM );
00483
00488 FBSDK_DLL void GetPlaneRotation( FBMatrix& pPlaneRM, const FBVector4<double>& pPlaneEquation );
00489
00494 FBSDK_DLL void NormalizePlaneEquation( FBVector4<double>& pNormalizedPlaneEquation, FBVector4<double>& pPlaneEquation );
00495
00505 FBSDK_DLL void MirrorTransform( FBTVector& pMirrorT, FBMatrix& pMirrorRM, FBMatrix& pMirrorSM, const FBTVector& pT, const FBMatrix& pRM, const FBMatrix& pSM, const FBVector4<double>& pPlaneEquation );
00506
00512 FBSDK_DLL void MirrorTransformT( FBTVector& pMirrorT, const FBTVector& pT, const FBVector4<double>& pPlaneEquation );
00513
00519 FBSDK_DLL void MirrorTransformR( FBMatrix& pMirrorRM, const FBMatrix& pRM, const FBVector4<double>& pPlaneEquation );
00520
00521
00522 #ifdef FBSDKUseNamespace
00523 }
00524 #endif
00525
00526 #endif