Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DArmatureData Class Reference

The U4DArmatureData class represents the bone armature of the 3D entity. More...

Public Member Functions

 U4DArmatureData (U4DModel *uModel)
 Constructor for the class.
 
 ~U4DArmatureData ()
 Destructor for the class.
 
void addBoneToTree (U4DBoneData *uParent, U4DBoneData *uChild)
 Method which adds a bone to the armature tree. More...
 
void removeBoneFromTree (std::string uChildBoneName)
 Method which removes a bone from the armature tree. More...
 
void updateBoneIndexCount ()
 Method which updates the bone index count.
 
void setRootBone (U4DBoneData *uBoneData)
 Method which assigns a bone to be the root bone for the armature. More...
 
void setVertexWeightsAndBoneIndices ()
 Method which starts the bone sorting and prepares the attribute data (bone weight) of the bones.
 
void prepareAndSendBoneDataToBuffer (std::vector< U4DBoneData * > &uBoneDataContainer, int boneVertexWeightIndex)
 Method which sends bone weight and indices (attributes) to the opengl buffer. More...
 
void reHeapDown (std::vector< U4DBoneData * > &uBoneDataContainer, int boneVertexWeightIndex, int root, int bottom)
 Method use to heap-down sort the bones. More...
 
void heapSorting (std::vector< U4DBoneData * > &uBoneDataContainer, int boneVertexWeightIndex)
 Method to heap sort the bones. More...
 
void swap (std::vector< U4DBoneData * > &uBoneDataContainer, int uindex1, int uindex2)
 Method used to swap the bone's array index. More...
 
void setBoneDataContainer ()
 Method which adds bones to the armature bone container.
 
void setBoneAbsoluteSpace ()
 Method which sets the absolute space of the bone.
 
void setRestPoseMatrix ()
 Method which sets the rest pose matrix of each bone.
 

Public Attributes

U4DBoneDatarootBone
 Pointer to the bone representing the root bone.
 
U4DDualQuaternion bindShapeSpace
 Bind shape space of the armature.
 
std::vector< U4DBoneData * > boneDataContainer
 Container holding all bones belonging to the armature.
 

Detailed Description

The U4DArmatureData class represents the bone armature of the 3D entity.

Member Function Documentation

◆ addBoneToTree()

void U4DEngine::U4DArmatureData::addBoneToTree ( U4DBoneData uParent,
U4DBoneData uChild 
)

Method which adds a bone to the armature tree.

Parameters
uParentParent of the bone
uChildBone to add

◆ heapSorting()

void U4DEngine::U4DArmatureData::heapSorting ( std::vector< U4DBoneData * > &  uBoneDataContainer,
int  boneVertexWeightIndex 
)

Method to heap sort the bones.

Parameters
uBoneDataContainerArmature bone container
boneVertexWeightIndexBone vertex weight array index

◆ prepareAndSendBoneDataToBuffer()

void U4DEngine::U4DArmatureData::prepareAndSendBoneDataToBuffer ( std::vector< U4DBoneData * > &  uBoneDataContainer,
int  boneVertexWeightIndex 
)

Method which sends bone weight and indices (attributes) to the opengl buffer.

Parameters
uBoneDataContainerArmature bone container
boneVertexWeightIndexBone vertex weight array index

◆ reHeapDown()

void U4DEngine::U4DArmatureData::reHeapDown ( std::vector< U4DBoneData * > &  uBoneDataContainer,
int  boneVertexWeightIndex,
int  root,
int  bottom 
)

Method use to heap-down sort the bones.

Parameters
uBoneDataContainerArmature bone container
boneVertexWeightIndexBone vertex weight array index
rootindex of root bone
bottombottom index

◆ removeBoneFromTree()

void U4DEngine::U4DArmatureData::removeBoneFromTree ( std::string  uChildBoneName)

Method which removes a bone from the armature tree.

Parameters
uChildBoneNameBone to remove

◆ setRootBone()

void U4DEngine::U4DArmatureData::setRootBone ( U4DBoneData uBoneData)

Method which assigns a bone to be the root bone for the armature.

Parameters
uBoneDataBone to assign as root bone

◆ swap()

void U4DEngine::U4DArmatureData::swap ( std::vector< U4DBoneData * > &  uBoneDataContainer,
int  uindex1,
int  uindex2 
)

Method used to swap the bone's array index.

Parameters
uBoneDataContainerArmature bone container
uindex1Bone array index
uindex2Bone array index