00001 #ifndef __FBCHARACTERMANIPULATOR_H__
00002 #define __FBCHARACTERMANIPULATOR_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/fbcore.h>
00053 #include <fbsdk/fbcharacter.h>
00054
00055 #ifdef FBSDKUseNamespace
00056 namespace FBSDKNamespace {
00057 #endif
00058
00060
00063 enum FBManipulationStartResult
00064 {
00065 kFBManipulationOK,
00066 kFBManipulationOKNoUndo,
00067 kFBManipulationRefuse
00068 };
00069
00071 enum FBManipulationGetResult
00072 {
00073 kFBManipulationGetDone,
00074 kFBManipulationGetContinue,
00075 kFBManipulationGetFail
00076 };
00077
00079 enum FBManipulationSetResult
00080 {
00081 kFBManipulationSetContinue,
00082 kFBManipulationSetFail
00083 };
00084
00086 enum FBReferencialType
00087 {
00088 FBRefTypeNone,
00089 FBRefTypeGlobal,
00090 FBRefTypeLocal,
00091 FBRefTypeLayer,
00092 FBRefTypeSumLayers,
00093 FBRefTypeParent,
00094 };
00095
00097 enum FBSetType
00098 {
00099 FBSetTypeNone,
00100 FBSetTypeExact,
00101 FBSetTypeCumulative,
00102 };
00103
00105 enum FBSetWhat
00106 {
00107 FBSetWhatNone,
00108 FBSetWhatX,
00109 FBSetWhatY,
00110 FBSetWhatZ,
00111 FBSetWhatXYZ,
00112 FBSetWhatAll,
00113 };
00114
00116 enum FBManipPivot
00117 {
00118 FBManipPivotObjectTranslation,
00119 FBManipPivotObjectRotation,
00120 FBManipPivotObjectScaling,
00121 FBManipPivotObjectUnknown
00122 };
00123
00125 enum FBManipMode
00126 {
00127 FBManip_EditorOther,
00128 FBManip_EditorTranslation,
00129 FBManip_EditorRotation,
00130 FBManip_EditorScaling
00131 };
00132
00133 FB_DEFINE_COMPONENT( FBSDK_DLL, CharacterManipulator );
00134 FB_DEFINE_COMPONENT( FBSDK_DLL, CharacterManipulatorCtrlSet );
00135
00137
00139
00162 __FB_FORWARD( FBCharacterManipulator);
00163
00165 class FBSDK_DLL FBCharacterManipulator : public FBComponent
00166 {
00167 __FBClassDeclare( FBCharacterManipulator,FBComponent );
00168 public:
00173 FBCharacterManipulator(char *pName, HIObject pObject=NULL);
00174
00180 virtual FBManipulationGetResult TranslationIsEditable( bool &pEditable, FBReferencialType pRefType ) = 0;
00181
00182
00190 virtual FBManipulationSetResult TranslationSet( FBTVector &pT, FBReferencialType pRefType, FBSetType pSetType, FBSetWhat pSetWhat ) = 0;
00197 virtual FBManipulationGetResult TranslationGet( FBTVector &pT, FBReferencialType pRefType, FBManipPivot pPivot = FBManipPivotObjectTranslation ) = 0;
00198
00199
00204 virtual FBManipulationStartResult TranslationStartManipulation( FBReferencialType pRefType ) = 0;
00207 virtual void TranslationStopManipulation () = 0;
00208
00209
00210
00216 virtual FBManipulationGetResult RotationIsEditable( bool &pEditable, FBReferencialType pRefType ) = 0;
00217
00218
00226 virtual FBManipulationSetResult RotationSet( FBMatrix &pRM, FBReferencialType pRefType, FBSetType pSetType, bool pOnlyRoot = false ) = 0;
00232 virtual FBManipulationGetResult RotationGet( FBMatrix &pRM, FBReferencialType pRefType ) = 0;
00233
00234
00239 virtual FBManipulationStartResult RotationStartManipulation( FBReferencialType pRefType ) = 0;
00242 virtual void RotationStopManipulation () = 0;
00243
00244
00249 virtual FBManipulationGetResult ScalingIsEditable( bool &pEditable ) = 0;
00250
00251
00259 virtual FBManipulationSetResult ScalingSet( FBSVector &pS, FBReferencialType pRefType, FBSetType pSetType, FBSetWhat pSetWhat ) = 0;
00265 virtual FBManipulationGetResult ScalingGet( FBSVector &pS, FBReferencialType pRefType ) = 0;
00266
00267
00272 virtual FBManipulationStartResult ScalingStartManipulation( FBReferencialType pRefType ) = 0;
00275 virtual void ScalingStopManipulation () = 0;
00276
00280 bool IsReleasePinPressed();
00281
00285 FBModel *GetManipulatedNode();
00286
00290 FBManipMode GetManipulatorMode();
00291 };
00292
00298 #define FBCharacterManipulatorCtrlSetDeclare( ClassName, Parent ) \
00299 FBClassDeclare( ClassName, Parent ); \
00300 public: \
00301 ClassName(char * pName):Parent(pName) { FBClassInit; } \
00302 private:
00303
00307 #define FBCharacterManipulatorCtrlSetImplementation( ThisComponent ) \
00308 FBClassImplementation( ThisComponent )
00309
00311
00313 __FB_FORWARD( FBCharacterManipulatorCtrlSet);
00314
00316 class FBSDK_DLL FBCharacterManipulatorCtrlSet : public FBCharacterManipulator
00317 {
00318 __FBClassDeclare( FBCharacterManipulatorCtrlSet,FBCharacterManipulator );
00319 public:
00324 FBCharacterManipulatorCtrlSet(char *pName, HIObject pObject=NULL);
00325
00329 FBCharacter * GetCharacter();
00330
00335 virtual void AllocateState(FBCharacter* pCharacter);
00336
00340 virtual void DeallocateState();
00341
00345 bool IsFullBody();
00346
00350 bool IsBodyPart();
00351
00355 bool IsReachOverride();
00356
00360 bool IsStiffnessOverride();
00361
00365 bool IsIKPivotUse();
00366
00369 virtual void SyncCharacter(FBEvaluateInfo *pEvalInfo);
00370
00374 FBEffectorId GetManipulatedEffectorId();
00375
00379 FBEffectorId GetManipulatedEffectorIdForRotation();
00380
00384 FBEffectorId GetManipulatedEffectorIdForTranslation();
00385
00389 FBEffectorSetID GetEffectorSet();
00390
00394 FBBodyNodeId GetManipulatedBodyNode();
00395
00400 bool IsDescendantPulling(FBEffectorId pEffectorId);
00401
00406 int GetDescendantEffectorCount(FBEffectorId pEffectorId);
00407
00413 FBEffectorId GetDescendantEffector(FBEffectorId pEffectorId, int pIndex);
00414
00419 float GetEffectorReachTValue(int pEffectorId);
00424 void SetEffectorReachTValue(int pEffectorId, float pValue);
00425
00430 float GetEffectorPullValue(int pEffectorId);
00435 void SetEffectorPullValue(int pEffectorId, float pValue);
00436
00441 void TranslationSetGlobal(FBTVector pVector, int pEffectorId);
00446 void TranslationSetLocal(FBTVector pVector, int pEffectorId);
00447
00448
00449
00450 virtual FBManipulationGetResult TranslationIsEditable( bool &pEditable, FBReferencialType pRefType );
00451
00452 virtual FBManipulationSetResult TranslationSet( FBTVector &pT, FBReferencialType pRefType, FBSetType pSetType, FBSetWhat pSetWhat );
00453 virtual FBManipulationGetResult TranslationGet( FBTVector &pT, FBReferencialType pRefType, FBManipPivot pPivot = FBManipPivotObjectTranslation );
00454
00455 virtual FBManipulationStartResult TranslationStartManipulation( FBReferencialType pRefType );
00456 void TranslationStopManipulation ();
00457
00458
00459 virtual FBManipulationGetResult RotationIsEditable( bool &pEditable, FBReferencialType pRefType );
00460
00461 virtual FBManipulationSetResult RotationSet( FBMatrix &pRM, FBReferencialType pRefType, FBSetType pSetType, bool pOnlyRoot = false );
00462 virtual FBManipulationGetResult RotationGet( FBMatrix &pRM, FBReferencialType pRefType );
00463
00464 virtual FBManipulationStartResult RotationStartManipulation( FBReferencialType pRefType );
00465 virtual void RotationStopManipulation ();
00466
00467
00468 virtual FBManipulationGetResult ScalingIsEditable( bool &pEditable );
00469
00470 virtual FBManipulationGetResult ScalingGet( FBSVector &pS, FBReferencialType pRefType );
00471 virtual FBManipulationSetResult ScalingSet( FBSVector &pS, FBReferencialType pRefType, FBSetType pSetType, FBSetWhat pSetWhat );
00472
00473 virtual FBManipulationStartResult ScalingStartManipulation( FBReferencialType pRefType );
00474 virtual void ScalingStopManipulation ();
00475 };
00476
00477 #ifdef FBSDKUseNamespace
00478 }
00479 #endif
00480 #endif