AnimationController Class |
Language: |
Controls animation functionality, connecting animation sets to the transformation frames being animated.
Visual Basic NotInheritable Public Class AnimationController
Inherits Object
Implements ICloneable, IDisposableC# public sealed class AnimationController : Object, ICloneable, IDisposable C++ public ref class AnimationController sealed : Object, ICloneable, IDisposable JScript public final class AnimationController extends Object implements ICloneable, IDisposable
ObjectAnimationController
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.900.0, Culture=neutral, PublicKeyToken=d3231b57b74a1492
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.