Welcome to MSDN Blogs Sign in | Join | Help

Nerd Herder

Dean Johnson’s blog about life on the XNA platform and tools team

Syndication

Avatar animation updates

Playback of one of the 31 built in animations is simple with the AvatarAnimation class. As I discussed in a previous post the BoneTransforms and Expression properties on the AvatarAnimation can be used with the AvatarRenderer.Draw method to animate an avatar. These two properties return the bone transforms and expression at a time in the animation based on the CurrentPosition property. CurrentPosition is a TimeSpan value that represents where in the animation playback is currently located. Valid values for CurrentPosition can be from zero to AvatarAnimation.Length.

There are two ways to set the CurrentPosition. The first and indirect way is to use the AvatarAnimation.Update(TimeSpan elapsedAnimationTime, bool loop) method that was used in the previous post. This allows the developer to specify the amount of time that has passed since the last update call. This delta can be provided by the gameTime.ElapsedGameTime parameter in the Game.Update method. It also allows the developer to specify if they want the animation to loop or not. The developer can also specify a negative elapsedAnimationTime value to play the animation backwards.

The other way is to use the CurrentPosition property directly. This allows the developer to implement any type of playback that they wish. While this is flexible it leaves managing looping and bounds checking to the developer.

Most developers will most likely use the Update method but the CurrentPosition property is exposed to allow for greater animation playback flexibility.

Published Thursday, May 14, 2009 8:40 PM by dejohn

Filed under: ,

Comments

# Avatar animation updates | Microsoft Share Point @ Thursday, May 14, 2009 4:17 PM

PingBack from http://microsoft-sharepoint.simplynetdev.com/avatar-animation-updates/

Avatar animation updates | Microsoft Share Point

# bayrak @ Friday, July 03, 2009 6:50 AM

Must be very good news for this avatar

bayrak

# re: Avatar animation updates @ Tuesday, July 21, 2009 5:36 AM

This is very good news was well informed that the followers of the issue I am. Thank you

reklam ajansı

# re: Avatar animation updates @ Monday, November 30, 2009 3:57 AM

This is very good news was well informed that the followers of the issue I am. Thank you .

web.tasarım

Anonymous comments are disabled
Page view tracker