3DXI Animation Keys

Extracted keys are stored in the IGameKey class that maintains a list for all the Key types: bezier, TCB, linear and sampled. Data is accessed depending on the controller type. The code sample below retrieves all the bezier keys for position:

IGameControl pGC;

IGameKeyTab BezKeys;
If(pGC->GetBezierKeys(BezKeys, IGAME_POS))
{
    for(int i = 0;i<BezKeys.Count();i++)
    {
        if(Type== IGAME_POS || Type== IGAME_POINT3)
        {
            Point3 k = BezKeys[i].bezierKey.pval;
             //use data here
        }
    }
}

Because this sample uses bezier position data, the IGameControl::GetBezierKeys() method is used with the IGAME_POS flag. If successful, BezKeys contains a list of keys used to access the bezierKey members. This list is maintained by IGameKey.