Share via


AnimationController Class (Microsoft.DirectX.Direct3D)

Controls animation functionality, connecting animation sets to the transformation frames being animated.

Definition

Visual Basic NotInheritable Public Class AnimationController
    Inherits ObjectLeave Site
    Implements ICloneableLeave Site, IDisposableLeave Site
C# public sealed class AnimationController : ObjectLeave Site, ICloneableLeave Site, IDisposableLeave Site
C++ public ref class AnimationController sealed : ObjectLeave Site, ICloneableLeave Site, IDisposableLeave Site
JScript public final class AnimationController extends ObjectLeave Site implements ICloneableLeave Site, IDisposableLeave Site

Members Table

The following table lists the members exposed by the object.

Events

Event Description
Disposing Occurs when the Dispose method is called or when the AnimationController object is finalized and collected by the garbage collector of the .NET common language runtime.

Methods

Method Description
AdvanceTime Animates the mesh and advances the global animation time by a specified amount.
AnimationController Initializes a new instance of the AnimationController class.
Clone Clones, or copies, an animation controller.
Dispose Immediately releases the unmanaged resources used by the AnimationController object.
Equals Returns a value that indicates whether the current instance is equal to a specified object.
Finalize Allows the AnimationController object to free resources before it is destroyed by the garbage collector.
GetAnimationSet Retrieves the animation set.
GetCurrentPriorityBlend Returns an event handle to a priority blend event that is currently running.
GetCurrentTrackEvent Returns an event handle to the event that is currently running on the specified animation track.
GetEventDescription Retrieves a description of a specified animation event.
GetHashCode Returns the hash code for the current instance.
GetObjectByValue This member supports the infrastructure for Microsoft DirectX 9.0 for Managed Code and is not intended to be used directly from your code.
GetTrackAnimationSet Retrieves the animation set for a given track.
GetTrackDescription Retrieves the description for a track.
GetUpcomingPriorityBlend Returns an event handle to the next priority blend event scheduled to occur after a specified event.
GetUpcomingTrackEvent Returns an event handle to the next event scheduled to occur after a specified event on an animation track.
IsEventValid Determines whether a specified event handle is valid and an animation event has completed.
KeyPriorityBlend Sets blending event keys for the specified animation track.
KeyTrackEnable Sets an event key that enables or disables an animation track.
KeyTrackPosition Sets an event key that changes the local time of an animation track.
KeyTrackSpeed Sets an event key that changes the local time of an animation track.
KeyTrackWeight Sets an event key that changes the weight of an animation track.
static (Shared in Visual Basic) op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
static (Shared in Visual Basic) op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
raise_Disposing Raises the Microsoft.DirectX.Direct3D.AnimationController.Disposing event when called from within a derived class.
RegisterAnimationOutput Adds an animation output to the animation controller and registers objects for scale, rotate, and translate (SRT) transformations.
RegisterAnimationSet Adds an animation set to the animation controller.
ResetTime Resets the global animation time to zero. Any pending events retain their original schedules, but in the new time frame.
SetTrackAnimationSet Applies the animation set to the specified track.
SetTrackDescription Sets the track description.
SetTrackEnable Enables or disables a track in the animation controller.
SetTrackPosition Sets the track to the specified local animation time.
SetTrackPriority Sets the priority blending weight for the specified animation track.
SetTrackSpeed Sets the priority blending weight for the specified animation track.
SetTrackWeight Sets the track weight, which is used to determine how to blend multiple tracks together.
UnkeyAllPriorityBlends Removes all scheduled priority blend events from the animation controller.
UnkeyAllTrackEvents Removes all events from a specified animation track.
UnkeyEvent Removes a specified event from an animation track, preventing the event from being run.
UnregisterAnimationOutput Removes an animation output from the animation controller.
UnregisterAnimationSet Removes an animation set from the animation controller.
UpdateUnmanagedPointer Updates the unmanaged pointer for this AnimationController object. This method supports the Microsoft .NET Framework infrastructure and is not intended to be used directly in your code.
ValidateEvent Determines whether a specified event handle is valid and the animation event has completed.

Properties

Property Description
Disposed Gets a value that indicates whether the object is disposed.
MaxNumberAnimationOutputs Retrieves the maximum number of animation outputs the controller can support.
MaxNumberAnimationSets Retrieves the maximum number of animation sets the controller can support.
MaxNumberEvents Retrieves the maximum number of events the controller can support.
MaxNumberTracks Retrieves the maximum number of tracks in the mixer.
NumberAnimationSets Returns the number of animation sets currently registered in the animation controller.
PriorityBlend Retrieves or sets the track blending weight.
Time Retrieves the local animation time.
UnmanagedComPointer Returns the unmanaged Component Object Model (COM) ID3DXAnimationController interface pointer.

Inheritance Hierarchy

ObjectLeave Site

AnimationController

Remarks

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#]  ...
    AnimationRootFrame animRoot = new AnimationRootFrame();

    animRoot = Mesh.LoadHierarchyFromFile("tiny.x", MeshFlags.Managed, device, allocH, null);
    
    AnimationController animController = animRoot.AnimationController;
  ...

The AnimationController can then be used to play and manipulate the animations loaded from the file.

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.

Class Information

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