Click or drag to resize
DigitalRuneSkeletonKeyFrameAnimation Class
Animates a SkeletonPose based on predefined key frames.
Inheritance Hierarchy
SystemObject
  DigitalRune.Animation.CharacterSkeletonKeyFrameAnimation

Namespace: DigitalRune.Animation.Character
Assembly: DigitalRune.Animation (in DigitalRune.Animation.dll) Version: 1.4.0.0 (1.4.1.14427)
Syntax
public class SkeletonKeyFrameAnimation : IAnimation<SkeletonPose>, 
	IAnimation, ITimeline

The SkeletonKeyFrameAnimation type exposes the following members.

Constructors
  NameDescription
Public methodSkeletonKeyFrameAnimation
Initializes a new instance of the SkeletonKeyFrameAnimation class.
Top
Methods
  NameDescription
Public methodAddKeyFrame
Adds a key frame for the specified bone.
Public methodClear
Removes all key frames and bone weights.
Public methodClone
Clones this instance.
Public methodCompress
Compresses the animation using a simple lossy compression algorithm.
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 methodFreeze
Prepares this animation for runtime usage. (Must be called after all key frames have been added!)
Public methodGetAnimationTime
Gets the animation time for the specified time on the timeline.
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.
Public methodGetTotalDuration
Gets the total length of the timeline.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetValue
Gets the value of the animation at the specified time.
Public methodGetWeight
Gets the weight for a specific bone animation channel.
Public methodIsBoneAnimated
Determines whether this animation animates the specified bone.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetWeight
Sets the weight for a specific bone animation channel.
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.
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.
Public propertyIsFrozen
Gets a value indicating whether this animation is frozen.
Public propertyTargetObject
Gets or sets the property to which the animation is applied by default.
Public propertyTargetProperty
Gets or sets the property to which the animation is applied by default.
Public propertyTraits
Gets the traits of the animation values.
Top
Explicit Interface Implementations
Remarks

The SkeletonKeyFrameAnimation is an optimized KeyFrameAnimationT for character animation. A SkeletonKeyFrameAnimation instance animates the bone transforms of a SkeletonPose. It can animate a single bone (e.g. only the head), several bones (e.g. an upper body animation) or all bones of skeleton at once.

A SkeletonKeyFrameAnimation is defined by adding key frames calling the method AddKeyFrame(Int32, TimeSpan, SrtTransform) for the animated bones. The animation controls a bone if at least one key frame for the bone has been added (see also IsBoneAnimated(Int32)). After adding all key frames, Freeze must be called. Freeze optimizes the animation data for fast access at runtime.

When key frames are added after calling Freeze, the animation is automatically reset into an editable state. All internal optimizations will be discarded! Freeze needs to be called again after all key frames are added.

Bone Channel Weights:
A weight can be set for each animated bone (see SetWeight(Int32, Single)). If the weight is 0, the bone is not animated. If the weight is 1, the bone is animated and replaces all preceding animations in the animation composition chain. If the weight is less than 1, the bone animation is blended with preceding animations.

Weights can be modified before and after Freeze. For example, weights can be modified while the animation is running.

Key Frame Interpolation:
A key frame animation contains a list of key frames 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. 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 using linear interpolation.

Cyclic Animations:
A skeleton key frame animation, by default, runs until the last key frame is reached. The types TimelineClip and AnimationClipT 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).

The first and the last key frame need to be identical to achieve a smooth cyclic interpolation.

See Also