AnimationController Class |
Language: |
Controls animation functionality, connecting animation sets to the transformation frames being animated.
Visual Basic .NET NotInheritable Public Class AnimationController
Inherits Object
Implements ICloneable, IDisposableC# public sealed class AnimationController : Object,
ICloneable, IDisposableManaged C++ public __gc __sealed class AnimationController : public Object,
ICloneable, IDisposableJScript .NET public class AnimationController extends Object
implements IDisposable, ICloneable
The methods of this class mix multiple animations and modify blending parameters over time to enable smooth transitions and other effects.
An AnimationController is typically obtained from a valid DirectX (.x) file loaded into an AnimationRootFrame. This structure has an AnimationController property that exposes the AnimationController. The following C# code example demonstrates how to create an AnimationController from a file. The allocH variable is an instance of a class derived from AllocateHierarchy. The device variable is the current rendering Device.
[C#]The AnimationController can then be used to play and manipulate the animations loaded from the file.
... AnimationRootFrame animRoot = new AnimationRootFrame(); animRoot = Mesh.LoadHierarchyFromFile("tiny.x", MeshFlags.Managed, device, allocH, null); AnimationController animController = animRoot.AnimationController; ...An AnimationController class loaded from a file typically has a number of animation tracks, each of which is identified by an index value. Using SetTrackAnimationSet, an AnimationSet (or a class derived from one) can be assigned to a track. The AnimationController class can then blend the animations in different tracks to create one smooth animation.
The AnimationController class also provides methods that allow changes to be made to each track over time. Key values that enable or disable a track (KeyTrackEnable) or change a track's speed (KeyTrackSpeed), its position in time (KeyTrackPosition), its weight (KeyTrackWeight), and its blend values (KeyPriorityBlend) can be set for specific times.
Namespace Microsoft.DirectX.Direct3D Assembly Microsoft.DirectX.Direct3DX (microsoft.directx.direct3dx.dll) Strong Name Microsoft.DirectX.Direct3DX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Feedback? Please provide us with your comments on this topic.