Open Reality Reference Guide
fbcharacterpose.h
1 #ifndef __FBCHARACTERPOSE_H__
2 #define __FBCHARACTERPOSE_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/fbpose.h>
53 
54 #ifdef FBSDKUseNamespace
55  namespace FBSDKNamespace {
56 #endif
57 
62 
64 enum FBCharacterPoseFlag
65 {
66  kFBCharacterPoseNoFlag = 0,
67  kFBCharacterPoseMirror = 1,
68  kFBCharacterPoseGravity = 1<<1,
69  kFBCharacterPoseMatchTX = 1<<2,
70  kFBCharacterPoseMatchTY = 1<<3,
71  kFBCharacterPoseMatchTZ = 1<<4,
72  kFBCharacterPoseMatchR = 1<<5,
73  kFBCharacterPoseMatchPivot = 1<<6,
74  kFBCharacterPoseUseKeyingGroup = 1<<7,
75  kFBCharacterPoseMatchFKTranslation = 1<<8
76 };
77 
79 enum FBMirrorPlaneType
80 {
81  kFBMirrorPlaneTypeInvalid = -1,
82  kFBMirrorPlaneTypeAuto = 0,
83  kFBMirrorPlaneTypeZY,
84  kFBMirrorPlaneTypeXY,
85  kFBMirrorPlaneTypeXZ,
86  kFBMirrorPlaneTypeUser,
87  kFBMirrorPlaneTypeEquation,
88  kFBMirrorPlaneTypeCount
89 };
90 
92 enum FBCharacterPoseKeyingMode
93 {
94  kFBCharacterPoseKeyingModeInvalid = -1,
95  kFBCharacterPoseKeyingModeFullBody = 0,
96  kFBCharacterPoseKeyingModeBodyPart,
97  kFBCharacterPoseKeyingModeCount
98 };
99 
101 // FBCharacterPoseOptions
104 
119 {
120  public:
121 
126 
128  FBCharacterPoseKeyingMode mCharacterPoseKeyingMode;
129 
131  FBMirrorPlaneType mMirrorPlaneType;
132 
140 
143 
146 
150 
155  void SetFlag( FBCharacterPoseFlag pFlag, bool pValue );
156 
161  bool GetFlag( FBCharacterPoseFlag pFlag ) const;
162 
165  void ClearFlag();
166 
167  private:
168 
169  FBCharacterPoseFlag mFlags;
170 };
171 
173 // FBCharacterPose
176 
181 {
182  //--- Open Reality declaration.
184 
185  public:
191  FBCharacterPose( const char* pName, HIObject pObject=NULL );
192 
195  void ClearPose();
196 
200 
204 
208  void CopyPose( FBCharacter& pCharacter );
209 
213  void CopyPoseCharacter( FBCharacter& pCharacter );
214 
219 
223  void CopyPoseCharacterExtension( FBCharacterExtension& pCharacterExtension );
224 
231  void PastePose( FBCharacter& pCharacter, FBCharacterPoseOptions& pCharacterPoseOptions );
232 
238  void PastePoseCharacter( FBCharacter& pCharacter, FBCharacterPoseOptions& pCharacterPoseOptions );
239 
245  void PastePoseCharacterExtensions( FBCharacter& pCharacter, FBCharacterPoseOptions& pCharacterPoseOptions );
246 
252  void PastePoseCharacterExtension( FBCharacterExtension& pCharacterExtension, FBCharacterPoseOptions& pCharacterPoseOptions );
253 
258 
263  bool IsCharacterExtensionPoseStored( const char* pCharacterExtensionName );
264 
269  void CopyFrom( FBCharacterPose& pFromPose );
270 
275  void CopyPoseDataFrom( FBCharacterPose& pFromPose );
276 
281 
286 
291 
297 
302  FBObjectPose* GetCharacterExtensionPose( const char* pCharacterExtensionName );
303 
309  FBObjectPose* GetOrCreateCharacterExtensionPose( const char* pCharacterExtensionName );
310 
314  void RemoveCharacterExtensionPoseAt( int pIndex );
315 
319  void RemoveCharacterExtensionPose( const char* pCharacterExtensionName );
320 
326 
332  void GetMirrorPlaneEquation( FBVector4<double>& pMirrorPlaneEquation, FBCharacter& pCharacter, FBCharacterPoseOptions& pCharacterPoseOptions );
333 
339  void GetMirrorPlaneEquation( FBMatrix& pMirrorPlaneEquation, FBCharacter& pCharacter, FBCharacterPoseOptions& pCharacterPoseOptions );
340 
341 
346 
352 
360 
367  void GetExtraBoneTransform(FBVector3d &pT, FBVector3d &pR, FBVector3d &pS, int pIndex );
368 
374 
379 
380  private:
381 
383 
388  FBCharacterPose& operator=( const FBCharacterPose& );
390 };
391 
393 // Property List: CharacterPose
395 
398 {
399  public:
405  FBCharacterPose* operator[]( int pIndex );
406 };
407 
408 #ifdef FBSDKUseNamespace
409  }
410 #endif
411 
412 #endif /* __FBCHARACTERPOSE_H__ */
FBCharacterPoseOptions::mModelToMatch
FBModel * mModelToMatch
Model to match.
Definition: fbcharacterpose.h:125
FBVector3< double >
FBCharacterPose::GetMirrorPlaneEquation
void GetMirrorPlaneEquation(FBVector4< double > &pMirrorPlaneEquation, FBCharacter &pCharacter, FBCharacterPoseOptions &pCharacterPoseOptions)
Get the mirror plane equation that would be used to mirror according to the CharacterPoseOptions.
FBCharacterPose::GetExtraBoneParentRotationOffset
void GetExtraBoneParentRotationOffset(FBRVector &pR, int pIndex)
Get the extra bone transformation offset.
FBCharacterPoseOptions::mMirrorPlaneTiltAngle
double mMirrorPlaneTiltAngle
Mirror plane tilt angle in degrees (used when mMirrorPlaneType = kFBMirrorPlaneTypeUser).
Definition: fbcharacterpose.h:142
FBCharacterPose::GetCharacterExtensionPoseAt
FBObjectPose * GetCharacterExtensionPoseAt(int pIndex)
Get the pose of a character extension.
FBCharacterPose::CopyPoseCharacterExtensions
void CopyPoseCharacterExtensions(FBCharacter &pCharacter)
Copy the pose of only the character extensions (omit the character).
FBCharacterPoseOptions::mMirrorPlaneEquation
FBVector4< double > mMirrorPlaneEquation
Mirror plane equation (used when mMirrorPlaneType = kFBMirrorPlaneTypeEquation).
Definition: fbcharacterpose.h:139
FBCharacterPose::CopyPose
void CopyPose(FBCharacter &pCharacter)
Copy the pose of a character and its extensions.
FBCharacterPose::ApplyPoseCandidate
void ApplyPoseCandidate()
After setting the candidate on the skeleton node, calling this function will allow subsequent call to...
FBCharacterPoseOptions::mCharacterPoseKeyingMode
FBCharacterPoseKeyingMode mCharacterPoseKeyingMode
CharacterPoseKeyingMode (FullBody or BodyPart).
Definition: fbcharacterpose.h:128
FBCharacterPose::GetMirrorPlaneEquation
void GetMirrorPlaneEquation(FBMatrix &pMirrorPlaneEquation, FBCharacter &pCharacter, FBCharacterPoseOptions &pCharacterPoseOptions)
Get the mirror plane equation that would be used to mirror according to the CharacterPoseOptions.
FBSDK_DLL
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbconstraintlayout.h:48
FBCharacterPose::PastePoseCharacter
void PastePoseCharacter(FBCharacter &pCharacter, FBCharacterPoseOptions &pCharacterPoseOptions)
Paste the pose of only the character (omit the extensions).
fbpose.h
Access to poses.
FBVector4< double >
FBCharacterPose::GetExtraBoneTransform
void GetExtraBoneTransform(FBVector3d &pT, FBVector3d &pR, FBVector3d &pS, int pIndex)
Get the extra bone transformation.
FBCharacterPose::PastePoseCharacterExtension
void PastePoseCharacterExtension(FBCharacterExtension &pCharacterExtension, FBCharacterPoseOptions &pCharacterPoseOptions)
Paste the pose of a single character extension.
FBCharacterPose
Used to work with character poses.
Definition: fbcharacterpose.h:181
FBCharacterPose::PastePoseCharacterExtensions
void PastePoseCharacterExtensions(FBCharacter &pCharacter, FBCharacterPoseOptions &pCharacterPoseOptions)
Paste the pose of only the character extensions (omit the character).
FBCharacterPose::ClearCharacterExtensionsPose
void ClearCharacterExtensionsPose()
Clear only the pose of the character extensions (omit the character).
FBCharacterPose::GetExtraBoneModelAt
FBModel * GetExtraBoneModelAt(int pIndex)
Get the extra bone model at the specified index.
FBCharacterPose::CopyPoseCharacterExtensionsFrom
void CopyPoseCharacterExtensionsFrom(FBCharacterPose &pFromPose)
Copy the pose data of only the character extensions from a given pose.
FBCharacterPose::GetExtraBoneTransformOffset
void GetExtraBoneTransformOffset(FBVector3d &pT, FBVector3d &pR, FBVector3d &pS, int pIndex)
Get the extra bone transformation offset.
FBPose
Pose class.
Definition: fbpose.h:76
FBCharacterPoseOptions::FBCharacterPoseOptions
FBCharacterPoseOptions()
Constructor.
FBCharacterPose::GetExtraBoneCount
int GetExtraBoneCount()
Get the number of extra bones contained in the character pose.
FBCharacterPose::ClearCharacterPose
void ClearCharacterPose()
Clear only the pose of the character (omit the extensions).
FBCharacterPose::PastePose
void PastePose(FBCharacter &pCharacter, FBCharacterPoseOptions &pCharacterPoseOptions)
Paste the pose of a character and its extensions.
FBCharacter
A character is the link between a motion source and a character model.
Definition: fbcharacter.h:1388
FBPropertyListCharacterPose
PropertyList: CharacterPose.
Definition: fbcharacterpose.h:398
FBCharacterPoseOptions::ClearFlag
void ClearFlag()
Clear all flags.
FBCharacterPose::IsCharacterExtensionPoseStored
bool IsCharacterExtensionPoseStored(const char *pCharacterExtensionName)
Is the pose of the character extension stored in the pose?
FBCharacterExtension
Objects Grouping class.
Definition: fbcharacterextension.h:128
FBString
Basic string class.
Definition: fbstring.h:67
__FBClassDeclare
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
__FB_FORWARD
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
FBCharacterPoseOptions
Stores options for operations on poses.
Definition: fbcharacterpose.h:119
FBCharacterPose::CopyPoseCharacterExtension
void CopyPoseCharacterExtension(FBCharacterExtension &pCharacterExtension)
Copy the pose of a single character extension.
FBCharacterPose::CopyFrom
void CopyFrom(FBCharacterPose &pFromPose)
Copy everything from a given object.
FBCharacterPose::GetCharacterExtensionPose
FBObjectPose * GetCharacterExtensionPose(const char *pCharacterExtensionName)
Get the pose of a character extension.
FBMatrix
Four x Four (double) Matrix.
Definition: fbtypes.h:290
FBObjectPose
FBObjectPose class.
Definition: fbobjectpose.h:193
FBCharacterPoseOptions::mMirrorPlaneType
FBMirrorPlaneType mMirrorPlaneType
Mirror plane type.
Definition: fbcharacterpose.h:131
FBCharacterPose::RemoveCharacterExtensionPose
void RemoveCharacterExtensionPose(const char *pCharacterExtensionName)
Remove the pose of a character extension.
FBCharacterPoseOptions::SetFlag
void SetFlag(FBCharacterPoseFlag pFlag, bool pValue)
Set a flag value.
FBCharacterPose::GetOrCreateCharacterExtensionPose
FBObjectPose * GetOrCreateCharacterExtensionPose(const char *pCharacterExtensionName)
Get the pose of a character extension and create it if necessary.
FBCharacterPoseOptions::mMirrorPlanePanAngle
double mMirrorPlanePanAngle
Mirror plane pan angle in degrees (used when mMirrorPlaneType = kFBMirrorPlaneTypeUser).
Definition: fbcharacterpose.h:145
fbcomponent.h
Basic class definitions.
FBCharacterPose::CopyPoseCharacter
void CopyPoseCharacter(FBCharacter &pCharacter)
Copy the pose of only the character (omit the extensions).
FBPropertyListComponent
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:536
FBCharacterPose::FBCharacterPose
FBCharacterPose(const char *pName, HIObject pObject=NULL)
Public constructor.
FBCharacterPose::GetCharacterExtensionNameFromPose
FBString GetCharacterExtensionNameFromPose(FBObjectPose &pCharacterExtensionPose)
Get the name of the character extension for the specified pose.
FB_FORWARD
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
FBCharacterPose::GetCharacterExtensionPoseCount
int GetCharacterExtensionPoseCount()
Get the number of character extension stored in the pose.
FBPropertyListCharacterPose::operator[]
FBCharacterPose * operator[](int pIndex)
Get the character pose at pIndex.
FBCharacterPose::CopyPoseDataFrom
void CopyPoseDataFrom(FBCharacterPose &pFromPose)
Copy all the pose data from a given pose.
FBCharacterPose::IsCharacterPoseStored
bool IsCharacterPoseStored()
Is the pose of the character stored in the pose?
FBModel
Model class.
Definition: fbmodel.h:274
FBCharacterPoseOptions::GetFlag
bool GetFlag(FBCharacterPoseFlag pFlag) const
Get a flag value.
FBCharacterPose::RemoveCharacterExtensionPoseAt
void RemoveCharacterExtensionPoseAt(int pIndex)
Remove the pose of a character extension.
FBCharacterPose::CopyPoseCharacterFrom
void CopyPoseCharacterFrom(FBCharacterPose &pFromPose)
Copy the pose data of only the character from a given pose.
FBVector3d
class K_DLLIMPORT FBVector3< double > FBVector3d
3D vector.
Definition: fbtypes.h:438
FBCharacterPose::ClearPose
void ClearPose()
Clear all the data of the pose.