• Advertisement
Sign in to follow this  

[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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement

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.
}
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement