// Bone flags
enum
{
FLAG_FAKEBONE = 0x01,
};
// State blend mode
enum
{
BM_NORMAL = 0,
BM_COMBINE,
BM_EXCLUSIVE,
BM_ABSTRACK,
};
// Transition flag
enum
{
TRANS_POS_X = 0x01, // Position X
TRANS_POS_Y = 0x02, // Position Y
TRANS_POS_Z = 0x04, // Position Z
TRANS_POS = 0x07, // Position
TRANS_ORI = 0x08, // Orientation
TRANS_ALL = 0x0f, // All flags
};
// Struct used to save and load bone
struct BONEDATA
{
BYTE byFlags; // Bone flags
int iParent; // Parent bone's index
int iAnimJoint; // Animation joint's index
int iNumChild; // Number of children
A3DMATRIX4 matRelative; // the matrix bring vertex to parent space
A3DMATRIX4 matBoneInit; // Initial bone offset matrix
};
// A struct that will hold the state transition data for this bone.
struct TRANSITION
{
bool bDoTrans; // true, doing transition
DWORD dwTransMask; // Transition mask
A3DVECTOR3 vStartPos; // position of start state
A3DQUATERNION quStartRot; // orientation of start state
int iAllTime; // total transition time
int iCurTime; // time elapse of transition
};
// Blend state of bone
struct STATE
{
A3DQUATERNION quOrientation; // Blend orientation
A3DVECTOR3 vPos; // Blend position
float fWeight; // Weight of matrix
int iBlendMode; // Bone blend mode
};