# [DX9] Get track progress of skinned mesh?

This topic is 2849 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi folks ! This probably (hopefully) isn't too complicated but I wanted to make sure I get it right. Is there any way, given a linearly advancing time variable, that I could check how far along an animation track a skinned mesh is in the animation? I know that I can get the complete animation period as a double using ID3DXAnimationSet::GetPeriod() (measured in seconds?), but as I update the mesh I would like to check if the animation has exceeded its period so that I can change from let's say a finished "spell-casting" animation into "idle", rather than having it loop on forever. Thanks very much for any help on this !

##### Share on other sites
LPD3DXANIMATIONSET pASTrack = NULL;pAC->GetTrackAnimationSet( m_dwCurrentTrack, &pASTrack );if( pASTrack ){    D3DXTRACK_DESC td;    pAC->GetTrackDesc( m_dwCurrentTrack, &td );    if( td.Position > pASTrack->GetPeriod() - EPSILON)    {        // Animation is within EPSILON of its end.    }}