My Project
|
The class stands for the bone or frame in the character's skeleton. More...
#include <Bone.h>
Public Types | |
enum | LineType { NOT_INTERP =0, LINEAR, HERMITE, BEZIER } |
Linear Type (0:don't interpret;1:linear;2:hermite;3:bezier) More... | |
enum | MotionType { KGRT =0, KGSC =1, KGTR =2, MAX_MOTION =3 } |
LiXizhi: this is the order defined by X file template. More... | |
Public Member Functions | |
void | Read (TypePointer inP, int inSize) |
int | GetGeosetID () |
int | GetGeosetAnimID () |
void | SetGeosetAlpha (float alpha) |
float | GetGeosetAlpha () |
char * | GetBoneName () |
int | GetObjectID () |
int | GetParentID () |
D3DXMATRIX * | GetFinalTransformMatrix () |
D3DXMATRIX * | GetCombinedTransformMatrix () |
D3DXMATRIX * | CalcTransformMatrix (D3DXVECTOR3 *center, const AnimInfo &animInfo, const D3DXMATRIX *parentMatrix) |
D3DXMATRIX * | TransformMatrixMultiply (const D3DXMATRIX *matrix) |
Public Attributes | |
int | objectID |
int | parentID |
the object ID, which is the same as the its index in the skeleton list | |
int | nextID |
the object ID of its parent bone | |
D3DXMATRIX | localMatrix |
the object ID of its next bone in the skeleton.-1 if it is the last bone | |
D3DXMATRIX | combinedMatrix |
the localMatrix in the bone pose. localMatrix is used if no animation or translation keyframes is available for this bone | |
D3DXMATRIX | offsetMatrix |
combinedMatrix will transform the vertices from the local bone space to its character space. | |
D3DXMATRIX | finalMatrix |
offsetMatrix will transform original mesh vertice from their bone pose to local bone space. | |
Friends | |
class | CMDXModel |
by default it is 1.0 | |
class | CSkeleton |
The class stands for the bone or frame in the character's skeleton.
Animation data for the associated bone is also managed by this class. It supports motion blending between bone poses. Bone matrices are updated from parent to children, through the CalcTransformMatrix() function.
Fixes0.0:animation warping is added.modify Keyframe search now uses binary search, instead of linear search However, there are still some unfixed problems. Meshes can hidded and unhidden using alpha frames. We should prohibit motion warping between hidden frame and unhidden frames. Yet all bones are calculated regardless of whether they are visible or not in current frame. Fixes0.1: Now scaling animation is enabled. However, I will only support linear transformation, even if hermite or bezier may be preferred. I may add support for the latter in the future. Fixes0.2: Currently, animation uses offset matrix instead of pivot point. In the original pivot point approach, each bone will store a pivot point in the character mesh space. and the animation of the vertices bound to a certain bone is calculated by applying RST(rotation|Scaling|translation ) around its pivot point in the character space. In the current approach, an offset matrix is used instead of the pivot points offsetmatrix will first transform vertices to the local bone space, then RST is applied from child bones to parent bones around the (0,0,0) point. This second approach is formal, and agrees with many 3D animation format such as X-file.
LiXizhi: this is the order defined by X file template.
Rotation, Scaling, Translation Motion Keyframe Data