fbsdk/fbcharactermanipulator.h Source File

fbcharactermanipulator.h
Go to the documentation of this file.
1 #ifndef __FBCHARACTERMANIPULATOR_H__
2 #define __FBCHARACTERMANIPULATOR_H__
3 /**************************************************************************
4  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5  All Rights Reserved.
6 
7  The coded instructions, statements, computer programs, and/or related
8  material (collectively the "Data") in these files contain unpublished
9  information proprietary to Autodesk, Inc. and/or its licensors, which is
10  protected by Canada and United States of America federal copyright law
11  and by international treaties.
12 
13  The Data may not be disclosed or distributed to third parties, in whole
14  or in part, without the prior written consent of Autodesk, Inc.
15  ("Autodesk").
16 
17  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24  FREE.
25 
26  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36 
37 **************************************************************************/
38 
43 #include <kaydaradef.h>
44 #ifndef FBSDK_DLL
45 
48  #define FBSDK_DLL K_DLLIMPORT
49 #endif
50 
51 #include <fbsdk/fbcomponent.h>
52 #include <fbsdk/fbcore.h>
53 #include <fbsdk/fbcharacter.h>
54 
55 #ifdef FBSDKUseNamespace
56  namespace FBSDKNamespace {
57 #endif
58 
60 // Return value for manipulation functions
64 {
68 };
69 
72 {
76 };
77 
80 {
83 };
84 
87 {
94 };
95 
98 {
102 };
103 
106 {
113 };
114 
117 {
122 };
123 
126 {
131 };
132 
133 FB_DEFINE_COMPONENT( FBSDK_DLL, CharacterManipulator );
134 FB_DEFINE_COMPONENT( FBSDK_DLL, CharacterManipulatorCtrlSet );
135 
137 // FBCharacterManipulator
139 
163 
166 {
168 public:
173  FBCharacterManipulator(const char* pName, HIObject pObject=NULL);
174 
180  virtual FBManipulationGetResult TranslationIsEditable( bool &pEditable, FBReferencialType pRefType ) = 0;
181 
182  // Manipulation Get/Set
190  virtual FBManipulationSetResult TranslationSet( FBTVector &pT, FBReferencialType pRefType, FBSetType pSetType, FBSetWhat pSetWhat ) = 0;
197  virtual FBManipulationGetResult TranslationGet( FBTVector &pT, FBReferencialType pRefType, FBManipPivot pPivot = FBManipPivotObjectTranslation ) = 0;
198 
199  // Manipulation
204  virtual FBManipulationStartResult TranslationStartManipulation( FBReferencialType pRefType, const FBTime* pTime = NULL ) = 0;
207  virtual void TranslationStopManipulation () = 0;
208 
209 
210  //Rotation
216  virtual FBManipulationGetResult RotationIsEditable( bool &pEditable, FBReferencialType pRefType ) = 0;
217 
218  /* Matrix Get/Set */
226  virtual FBManipulationSetResult RotationSet( FBMatrix &pRM, FBReferencialType pRefType, FBSetType pSetType, bool pOnlyRoot = false ) = 0;
232  virtual FBManipulationGetResult RotationGet( FBMatrix &pRM, FBReferencialType pRefType ) = 0;
233 
234  /* Manipulation */
239  virtual FBManipulationStartResult RotationStartManipulation( FBReferencialType pRefType ) = 0;
242  virtual void RotationStopManipulation () = 0;
243 
244  //Scaling
249  virtual FBManipulationGetResult ScalingIsEditable( bool &pEditable ) = 0;
250 
251  /* Manipulation Get/Set*/
259  virtual FBManipulationSetResult ScalingSet( FBSVector &pS, FBReferencialType pRefType, FBSetType pSetType, FBSetWhat pSetWhat ) = 0;
265  virtual FBManipulationGetResult ScalingGet( FBSVector &pS, FBReferencialType pRefType ) = 0;
266 
267  /* Manipulation */
272  virtual FBManipulationStartResult ScalingStartManipulation( FBReferencialType pRefType ) = 0;
275  virtual void ScalingStopManipulation () = 0;
276 
280  bool IsReleasePinPressed();
281 
285  FBModel *GetManipulatedNode();
286 
290  FBManipMode GetManipulatorMode();
291 };
292 
298 #define FBCharacterManipulatorCtrlSetDeclare( ClassName, Parent ) \
299  FBClassDeclare( ClassName, Parent ); \
300  public: \
301  ClassName(const char* pName):Parent(pName) { FBClassInit; } \
302  private:
303 
307 #define FBCharacterManipulatorCtrlSetImplementation( ThisComponent ) \
308  FBClassImplementation( ThisComponent )
309 
311 // FBCharacterManipulatorCtrlSet
313 __FB_FORWARD( FBCharacterManipulatorCtrlSet);
314 
317 {
319 public:
324  FBCharacterManipulatorCtrlSet(const char* pName, HIObject pObject=NULL);
325 
329  FBCharacter * GetCharacter();
330 
335  virtual void AllocateState(FBCharacter* pCharacter);
336 
340  virtual void DeallocateState();
341 
345  bool IsFullBody();
346 
350  bool IsFullBodyNoPull();
351 
355  bool IsBodyPart();
356 
360  bool IsReachOverride();
361 
365  bool IsStiffnessOverride();
366 
370  bool IsIKPivotUse();
371 
374  virtual void SyncCharacter(FBEvaluateInfo *pEvalInfo);
375 
379  FBEffectorId GetManipulatedEffectorId();
380 
384  FBEffectorId GetManipulatedEffectorIdForRotation();
385 
389  FBEffectorId GetManipulatedEffectorIdForTranslation();
390 
394  FBEffectorSetID GetEffectorSet();
395 
399  FBBodyNodeId GetManipulatedBodyNode();
400 
405  bool IsDescendantPulling(FBEffectorId pEffectorId);
406 
411  int GetDescendantEffectorCount(FBEffectorId pEffectorId);
412 
418  FBEffectorId GetDescendantEffector(FBEffectorId pEffectorId, int pIndex);
419 
424  float GetEffectorReachTValue(int pEffectorId);
429  void SetEffectorReachTValue(int pEffectorId, float pValue);
430 
435  float GetEffectorPullValue(int pEffectorId);
440  void SetEffectorPullValue(int pEffectorId, float pValue);
441 
446  void TranslationSetGlobal(FBTVector pVector, int pEffectorId);
451  void TranslationSetLocal(FBTVector pVector, int pEffectorId);
452 
453  //For the following function, please see the description in the parent class.
454  //Translation
455  virtual FBManipulationGetResult TranslationIsEditable( bool &pEditable, FBReferencialType pRefType );
456  // Manipulation Get/Set
457  virtual FBManipulationSetResult TranslationSet( FBTVector &pT, FBReferencialType pRefType, FBSetType pSetType, FBSetWhat pSetWhat );
458  virtual FBManipulationGetResult TranslationGet( FBTVector &pT, FBReferencialType pRefType, FBManipPivot pPivot = FBManipPivotObjectTranslation );
459  // Manipulation
460  virtual FBManipulationStartResult TranslationStartManipulation( FBReferencialType pRefType, const FBTime* pTime = NULL );
461  void TranslationStopManipulation ();
462 
463  //Rotation
464  virtual FBManipulationGetResult RotationIsEditable( bool &pEditable, FBReferencialType pRefType );
465  /* Matrix Get/Set */
466  virtual FBManipulationSetResult RotationSet( FBMatrix &pRM, FBReferencialType pRefType, FBSetType pSetType, bool pOnlyRoot = false );
467  virtual FBManipulationGetResult RotationGet( FBMatrix &pRM, FBReferencialType pRefType );
468  /* Manipulation */
469  virtual FBManipulationStartResult RotationStartManipulation( FBReferencialType pRefType );
470  virtual void RotationStopManipulation ();
471 
472  //Scaling
473  virtual FBManipulationGetResult ScalingIsEditable( bool &pEditable );
474  /* Manipulation Get/Set*/
475  virtual FBManipulationGetResult ScalingGet( FBSVector &pS, FBReferencialType pRefType );
476  virtual FBManipulationSetResult ScalingSet( FBSVector &pS, FBReferencialType pRefType, FBSetType pSetType, FBSetWhat pSetWhat );
477  /* Manipulation */
478  virtual FBManipulationStartResult ScalingStartManipulation( FBReferencialType pRefType );
479  virtual void ScalingStopManipulation ();
480 };
481 
482 #ifdef FBSDKUseNamespace
483  }
484 #endif
485 #endif
FBEffectorSetID
Effector ID identifier.
Definition: fbcharacter.h:415
Model class.
Definition: fbmodel.h:273
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
Definition: fbproperties.h:139
FBManipulationGetResult
Manipulation Get Result.
Return this value when you have set the value.
Return this value when you don't want handle the request, another manipulator will try to handle it...
Do nothing with the value.
Four x Four (double) Matrix.
Definition: fbtypes.h:289
Set the XYZ components of the value.
#define NULL
Definition: kaydara.h:169
Consider the rotation of the pivot.
FBManipulationStartResult
Manipulation Start Result.
AnimationNodeNotify evaluation information.
FBSetWhat
Specify what part of the provided value should be used.
Contains definitions for devices, boxes and models.
Set only the X component of the value.
Return this value to prevent other manipulator to handle the request.
MotionBuilder SDK base class.
Definition: fbcomponent.h:668
FBEffectorId
All effector nodes.
Definition: fbcharacter.h:363
This value means that the manipulation will be done, but the manipulation will not be undoable...
Manipulation will be skipped.
Set only the Z component of the value.
Three dimensional scaling vector.
Definition: fbtypes.h:565
FBBodyNodeId
All body nodes.
Definition: fbcharacter.h:124
Translation Manipulation Mode.
FBManipMode
Manipulator Mode.
Set the value directly.
Return this value when you can provided the requested value.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
Character Manipulator class.
A character is the link between a motion source and a character model.
Definition: fbcharacter.h:1229
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
Set all components of the value.
FBManipulationSetResult
Manipulation Set Result.
This is the default value to return, means that you will handle the manipulation. ...
Basic class definitions.
Time data structure.
Definition: fbtime.h:86
Do nothing with the value.
Unknown Manipulation Mode.
Local additive rotation.
Set only the Y component of the value.
Referential is in global coordinate.
FBReferencialType
Specify the referential when a manipulation function is called.
Contains definitions for actors, characters, and marker sets In Development.
Add the provided value to the original value.
Global additive rotation.
Consider the translation of the pivot.
Referential is in local coordinate.
FBManipPivot
Specify how the pivot should be interpreted.
FBSetType
Specify what to do with the provided value.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Consider the scaling of the pivot.
Return this value when you cannot provided the requested value, another manipulator will try to provi...