Skip to main content
gamedev.net
🔒 Locked

Simultaneous AnimationSet Timing

Started by ms291052 Apr 12, 2005 at 11:02 PM 1 replies 1.3k views
Original Post
ms291052
ms291052
The way I understand animation in Direct3D 9 is that you have

LPD3DXANIMATIONCONTROLLER AnimController; //Assume Valid

AnimController->SetTrackAnimationSet(0, Anim1); //Anim1 and Anim2 are valid
AnimController->SetTrackAnimationSet(1, Anim2);

AnimController->SetTrackWeight(0, 0.5f);
AnimController->SetTrackWeight(1, 0.5f);

AnimController->SetTrackSpeed(0, 1.0f);
AnimController->SetTrackSpeed(1, 1.0f);

AnimController->SetTrackEnable(0, true);
AnimController->SetTrackEnable(1, true);

That said you also have timing with AnimController::AdvanceTime and AnimController::ResetTime Now, assume I have two animations of different lengths. Say I have run and jump. The mesh is running along and then the user presses a button and it's time to jump. The AnimController time is currently in the middle of the run animation, but I want it to be at 0 for the jump animation. Thus, a problem arises. Is it possible to set a TimeOffset or some such for each track, or have each track have a different associated time? Thank you for your time, ms
ms291052
ms291052
Bottom of page two -- bump?
Supernat02
Supernat02
This is in the SDK for the Reset function:
"This method is typically used when the global animation time value is nearing the maximum precision of DOUBLE storage, or 264 - 1."

You should just call AdvanceTime(). The animation should start from the beginning when it reaches the end. I believe you call SetTrackPosition(TrackNumber, 0.0f) when you want to start a track from the beginning. You may have to change 0.0f to GetTime() instead. I'm not completely clear on that.

Chris ByersMicrosoft DirectX MVP - 2005

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.