Click or drag to resize
DigitalRuneKeyFrameAnimation<T> Class
Animates a value based on predefined key frames. (Base implementation.)
Inheritance Hierarchy
System.Object
  DigitalRune.Animation.Animation<T>
    DigitalRune.Animation.KeyFrameAnimation<T>
      More...

Namespace: DigitalRune.Animation
Assembly: DigitalRune.Animation (in DigitalRune.Animation.dll) Version: 1.4.0.0 (1.4.1.14427)
Syntax
public abstract class KeyFrameAnimation<T> : Animation<T>

Type Parameters

T
The type of the animation value.

The KeyFrameAnimation< T> type exposes the following members.

Constructors
  NameDescription
Protected methodKeyFrameAnimation<T>
Initializes a new instance of the KeyFrameAnimation< T> class.
Top
Methods
  NameDescription
Public methodCreateBlendAnimation (Inherited from Animation<T>.)
Public methodCreateInstance
Creates an animation instance that can be used to play back the animation. (For internal use only.)
(Inherited from Animation<T>.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetAnimationTime
Gets the animation time for the specified time on the timeline.
(Inherited from Animation<T>.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetState
Gets the state of the animation for the specified time on the timeline.
(Inherited from Animation<T>.)
Public methodGetTotalDuration
Gets the total length of the timeline.
(Overrides Animation<T>.GetTotalDuration().)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetValue
Gets the value of the animation at the specified time.
(Inherited from Animation<T>.)
Protected methodGetValueCore
Evaluates the animation function at the specified animation time.
(Overrides Animation<T>.GetValueCore(TimeSpan, T, T, T).)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyEnableInterpolation
Gets or sets a value indicating whether values between key frames are interpolated.
Public propertyFillBehavior
Gets or sets a value that specifies how the animation behaves when it reaches the end of its duration.
(Inherited from Animation<T>.)
Public propertyIsAdditive
Gets or sets a value indicating whether the output of the animation is added to the current value of the property that is being animated.
(Inherited from Animation<T>.)
Public propertyKeyFrames
Gets the collection of key frames.
Public propertyTargetObject
Gets or sets the object to which the animation is applied by default.
(Inherited from Animation<T>.)
Public propertyTargetProperty
Gets or sets the property to which the animation is applied by default.
(Inherited from Animation<T>.)
Public propertyTraits
Gets the traits of the animation values.
(Inherited from Animation<T>.)
Top
Remarks

A key frame animation contains a list of key frames (see property KeyFrames) that define the animation values at certain points in time. When the animation is played the class automatically looks up the animation value in the list of key frames.

Key Frame Interpolation: The property EnableInterpolation defines whether interpolation between key frames is enabled. When the property is set (default) the values between two key frames are interpolated. Each key frame animation class decides which type of a interpolation is most appropriate. For example, linear interpolation (LERP) is used for Single, Vector2F, Vector3F, etc. LERP is also used for QuaternionF (Spherical linear interpolation (SLERP) is not used for performance reasons). When interpolation is disabled, the animation returns the value of the previous key frame.

Please note that key frame animations (such as SingleKeyFrameAnimation, Vector2FKeyFrameAnimation, Vector3FKeyFrameAnimation, etc.) provide only limited control over interpolation between key frames. Curve-based animations (such as Curve2FAnimation, Path2FAnimation, Path3FAnimation, etc.) offer more advanced control: Curve-based animations allow to define an interpolation spline for each segment of the animation.

Cyclic Animations: A key frame animation, by default, runs until the last key frame is reached. The types TimelineClip and AnimationClip< T> can be used to repeat the entire key frame animation (or a certain clip) for a number of times using a certain loop-behavior (see LoopBehavior).

Important: The key frame animation requires that the key frames are sorted ascending by their time value. The method Sort() can be called to sort all key frames.

See Also
Inheritance Hierarchy
System.Object
  DigitalRune.Animation.Animation<T>
    DigitalRune.Animation.KeyFrameAnimation<T>
      DigitalRune.Animation.AvatarExpressionKeyFrameAnimation
      DigitalRune.Animation.ColorKeyFrameAnimation
      DigitalRune.Animation.QuaternionFKeyFrameAnimation
      DigitalRune.Animation.QuaternionKeyFrameAnimation
      DigitalRune.Animation.SingleKeyFrameAnimation
      DigitalRune.Animation.SrtKeyFrameAnimation
      DigitalRune.Animation.Vector2FKeyFrameAnimation
      DigitalRune.Animation.Vector2KeyFrameAnimation
      DigitalRune.Animation.Vector3FKeyFrameAnimation
      DigitalRune.Animation.Vector3KeyFrameAnimation
      DigitalRune.Animation.Vector4FKeyFrameAnimation
      DigitalRune.Animation.Vector4KeyFrameAnimation