3 #include "IAttributeFields.h" 21 ATTRIBUTE_DEFINE_CLASS(
Bone);
26 ATTRIBUTE_METHOD1(
Bone, GetRotName_s,
const char**) { *p1 = cls->GetRotName().c_str();
return S_OK; }
27 ATTRIBUTE_METHOD1(
Bone, GetTransName_s,
const char**) { *p1 = cls->GetTransName().c_str();
return S_OK; }
28 ATTRIBUTE_METHOD1(
Bone, GetScaleName_s,
const char**) { *p1 = cls->GetScaleName().c_str();
return S_OK; }
30 ATTRIBUTE_METHOD1(
Bone, IsBillBoarded_s,
bool*) { *p1 = cls->IsBillBoarded();
return S_OK; }
31 ATTRIBUTE_METHOD1(
Bone, IsPivotBone_s,
bool*) { *p1 = cls->IsPivotBone();
return S_OK; }
32 ATTRIBUTE_METHOD1(
Bone, IsOffsetMatrixBone_s,
bool*){ *p1 = cls->IsOffsetMatrixBone();
return S_OK; }
33 ATTRIBUTE_METHOD1(
Bone, IsTransformationNode_s,
bool*) { *p1 = cls->IsTransformationNode();
return S_OK; }
34 ATTRIBUTE_METHOD1(
Bone, IsStaticTransform_s,
bool*) { *p1 = cls->IsStaticTransform();
return S_OK; }
35 ATTRIBUTE_METHOD1(
Bone, IsAnimated_s,
bool*) { *p1 = cls->IsAnimated();
return S_OK; }
37 ATTRIBUTE_METHOD1(
Bone, SetOffsetMatrix_s,
const Matrix4&) { cls->SetOffsetMatrix(p1);
return S_OK; }
38 ATTRIBUTE_METHOD1(
Bone, SetStaticTransform_s,
const Matrix4&) { cls->SetStaticTransform(p1);
return S_OK; }
40 ATTRIBUTE_METHOD(
Bone, RemoveRedundentKeys_s) { cls->RemoveRedundentKeys();
return S_OK; }
42 ATTRIBUTE_METHOD1(
Bone, GetFinalMatrix_s,
Matrix4*) { *p1 = cls->GetFinalMatrix();
return S_OK; }
43 ATTRIBUTE_METHOD1(
Bone, GetFinalRotMatrix_s,
Matrix4*) { *p1 = cls->GetFinalRotMatrix();
return S_OK; }
44 ATTRIBUTE_METHOD1(
Bone, GetPivotRotMatrix_s,
Matrix4*) { *p1 = cls->GetPivotRotMatrix();
return S_OK; }
46 ATTRIBUTE_METHOD1(
Bone, GetPivotPoint_s,
Vector3*) { *p1 = cls->GetPivotPoint();
return S_OK; }
47 ATTRIBUTE_METHOD1(
Bone, GetAnimatedPivotPoint_s,
Vector3*) { *p1 = cls->GetAnimatedPivotPoint();
return S_OK; }
49 ATTRIBUTE_METHOD1(
Bone, SetFinalRot_s,
Quaternion) { cls->SetFinalRot(p1);
return S_OK; }
50 ATTRIBUTE_METHOD1(
Bone, GetFinalRot_s,
Quaternion*) { *p1 = cls->GetFinalRot();
return S_OK; }
52 ATTRIBUTE_METHOD1(
Bone, SetFinalTrans_s,
Vector3) { cls->SetFinalTrans(p1);
return S_OK; }
53 ATTRIBUTE_METHOD1(
Bone, GetFinalTrans_s,
Vector3*) { *p1 = cls->GetFinalTrans();
return S_OK; }
55 ATTRIBUTE_METHOD1(
Bone, SetFinalScaling_s,
Vector3) { cls->SetFinalScaling(p1);
return S_OK; }
56 ATTRIBUTE_METHOD1(
Bone, GetFinalScaling_s,
Vector3*) { *p1 = cls->GetFinalScaling();
return S_OK; }
58 ATTRIBUTE_METHOD1(
Bone, GetParentIndex_s,
int*) { *p1 = cls->GetParentIndex();
return S_OK; }
59 ATTRIBUTE_METHOD1(
Bone, GetBoneIndex_s,
int*) { *p1 = cls->GetBoneIndex();
return S_OK; }
61 ATTRIBUTE_METHOD1(
Bone, GetBoneID_s,
int*) { *p1 = cls->GetBoneID();
return S_OK; }
62 ATTRIBUTE_METHOD1(
Bone, SetBoneID_s,
int) { cls->SetBoneID(p1);
return S_OK; }
67 virtual void SetIdentifier(
const std::string& sID);
89 const std::string& GetName()
const;
90 void SetName(
const std::string& val);
125 void PostCalculateBoneMatrix();
134 int GetParentIndex()
const {
return parent; }
135 int GetBoneIndex()
const {
return nIndex; }
136 int GetBoneID()
const {
return nBoneID; }
137 int IsAttachment()
const;
140 void SetBoneID(
int val) { nBoneID = val; }
145 const Vector3 & GetFinalTrans()
const;
146 void SetFinalTrans(
const Vector3 &val);
148 const Vector3& GetFinalScaling()
const;
149 void SetFinalScaling(
const Vector3& val);
177 BONE_TRANSFORMATION_NODE = (0x1 << 6),
179 std::string m_sIdentifer;
180 std::string m_sRotName;
181 std::string m_sTransName;
182 std::string m_sScaleName;
183 const std::string& GetRotName();
184 const std::string& GetTransName();
185 const std::string& GetScaleName();
bool IsBillBoarded() const
whether the bone is billboarded
Definition: ParaXBone.h:70
void MakeDirty(bool bForce=false)
mark this bone as un-calculated bone.
Definition: ParaXBone.cpp:1168
an attribute class is a collection of attribute fields.
Definition: AttributeClass.h:10
bool CheckHasAnimation()
whether the bone contains animation data.
Definition: ParaXBone.cpp:1019
different physics engine has different winding order.
Definition: EventBinding.h:32
a single animated bone, it contains both the bone instance data and all animation data of the bone...
Definition: ParaXBone.h:15
virtual const std::string & GetIdentifier()
get the name or identifier.
Definition: ParaXBone.cpp:584
Implementation of a Quaternion, i.e.
Definition: ParaQuaternion.h:10
calculate bone matrix using offset matrix (which transform from mesh to local bone space) and SRT tra...
Definition: ParaXBone.h:173
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
bool IsStaticTransform() const
whether the bone has no animation and a static transform is used to transform from current bone space...
Definition: ParaXBone.h:76
BONE_FLAGS
Definition: ParaXBone.h:162
bool IsTransformationNode() const
whether the bone is transformation node
Definition: ParaXBone.h:78
Definition: animated.h:23
Vector3 GetAnimatedPivotPoint()
return the current pivot point
Definition: ParaXBone.cpp:1094
bool IsOffsetMatrixBone() const
whether calculate bone matrix using offset matrix (which transform from mesh to local bone space) and...
Definition: ParaXBone.h:74
bool GetExternalRot(IAttributeFields *pAnimInstance, Quaternion &outQuat)
get external rot quaternion from animation instance.
Definition: ParaXBone.cpp:1029
void AutoSetBoneInfoFromName()
automatically set bone id from bone name.
Definition: ParaXBone.cpp:758
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: ParaMatrix4.h:23
it presents a given in bone animation providers or parax local model bone animation pools ...
Definition: AnimInstanceBase.h:13
A common interface for all classes implementing IAttributeFields By implementing this class's virtual...
Definition: IAttributeFields.h:59
whether the bone is billboarded
Definition: ParaXBone.h:169
bool IsPivotBone() const
whether calculate bone matrix using each bone's pivot point and SRT transforms relative to the curren...
Definition: ParaXBone.h:72
virtual int InstallFields(CAttributeClass *pClass, bool bOverride)
this class should be implemented if one wants to add new attribute.
Definition: ParaXBone.cpp:1201
calculate bone matrix using each bone's pivot point and SRT transforms relative to the current bone...
Definition: ParaXBone.h:167
the bone has no animation and a static transform is used to transform from current bone space to its ...
Definition: ParaXBone.h:175
Matrix4 GetPivotRotMatrix()
similar to GetFinalRotMatrix(), except that it will remove rotation in its offset matrix...
Definition: ParaXBone.cpp:1152
const Vector3 & GetPivotPoint()
return the pivot point in binding space
Definition: ParaXBone.cpp:1088
bool IsAnimated()
whether bone is animated.
Definition: ParaXBone.cpp:1024
bool calcMatrix(Bone *allbones, const AnimIndex &CurrentAnim, const AnimIndex &BlendingAnim, float blendingFactor, IAttributeFields *pAnimInstance=NULL)
calc bone matrix and all of its parent bones.
Definition: ParaXBone.cpp:68
void SetOffsetMatrix(const Matrix4 &mat)
calling this function means that you want to use BONE_OFFSET_MATRIX for final bone matrix calculation...
Definition: ParaXBone.cpp:1000
static const int s_MaxBonesPerVertex
max number of bones per vertex, currently this is 4.
Definition: ParaXBone.h:230
BioVision Hierarchy (BVH) motion capture file serializer for ParaX file.
Definition: BVHSerializer.h:23
int GetAttachmentId() const
return -1 if it is not attachment id.
Definition: ParaXBone.cpp:1112
void SetStaticTransform(const Matrix4 &mat)
calling this function means that you want to use BONE_STATIC_TRANSFORM for final bone matrix calculat...
Definition: ParaXBone.cpp:1012
void RemoveRedundentKeys()
Always call this function after loading data from files.
Definition: ParaXBone.cpp:26