C# Class Protogame.Animation

A default implementation of IAnimation.
Inheritance: IAnimation
显示文件 Open project: RedpointGames/Protogame

Public Methods

Method Description
Animation ( string name, double ticksPerSecond, double durationInTicks, Vector3>.IDictionary translationForBones, Quaternion>.IDictionary rotationForBones, Vector3>.IDictionary scaleForBones ) : System

Initializes a new instance of the Animation class.

Apply ( IModel model, double frame ) : void

Applies the animation at a specified time to the model.

Apply ( IModel model, float totalSeconds, float multiply ) : void

Applies the animation at a specified time to the model.

Render ( IRenderContext renderContext, IEffect effect, IEffectParameterSet effectParameterSet, Matrix transform, IModel model, TimeSpan secondFraction, float multiply ) : void

Modifies the specified model to align to this animation at the specified frame and then renders it.

Render ( IRenderContext renderContext, IEffect effect, IEffectParameterSet effectParameterSet, Matrix transform, IModel model, double frame ) : void

Modifies the specified model to align to this animation at the specified frame and then renders it.

Render ( IRenderContext renderContext, IEffect effect, IEffectParameterSet effectParameterSet, Matrix transform, IModel model, float totalSeconds, float multiply ) : void

Modifies the specified model to align to this animation at the specified frame and then renders it.

Private Methods

Method Description
FindSurroundingTickValues ( IList keys, double current, double &previous, double &next ) : void

Finds the nearest previous and next floating point number to the specified floating point number using a binary search algorithm.

Method Details

Animation() public method

Initializes a new instance of the Animation class.
public Animation ( string name, double ticksPerSecond, double durationInTicks, Vector3>.IDictionary translationForBones, Quaternion>.IDictionary rotationForBones, Vector3>.IDictionary scaleForBones ) : System
name string /// The name of the animation. ///
ticksPerSecond double /// The ticks per second, or rate at which this animation plays. ///
durationInTicks double /// The duration in ticks, or total number of frames that this animation has. ///
translationForBones Vector3>.IDictionary /// The translation keys applicable to the animation. ///
rotationForBones Quaternion>.IDictionary /// The rotation keys applicable to the animation. ///
scaleForBones Vector3>.IDictionary /// The scale keys applicable to the application. ///
return System

Apply() public method

Applies the animation at a specified time to the model.
public Apply ( IModel model, double frame ) : void
model IModel /// The model to apply the animation to. ///
frame double /// The frame to draw at. ///
return void

Apply() public method

Applies the animation at a specified time to the model.
public Apply ( IModel model, float totalSeconds, float multiply ) : void
model IModel /// The model to apply the animation to. ///
totalSeconds float /// The time elapsed. ///
multiply float /// The multiplication factor to apply to the animation speed. ///
return void

Render() public method

Modifies the specified model to align to this animation at the specified frame and then renders it.
public Render ( IRenderContext renderContext, IEffect effect, IEffectParameterSet effectParameterSet, Matrix transform, IModel model, TimeSpan secondFraction, float multiply ) : void
renderContext IRenderContext /// The current render context. ///
effect IEffect
effectParameterSet IEffectParameterSet
transform Matrix /// The world transformation to apply. ///
model IModel /// The model to update. ///
secondFraction TimeSpan /// The time elapsed. ///
multiply float /// The multiplication factor to apply to the animation speed. ///
return void

Render() public method

Modifies the specified model to align to this animation at the specified frame and then renders it.
public Render ( IRenderContext renderContext, IEffect effect, IEffectParameterSet effectParameterSet, Matrix transform, IModel model, double frame ) : void
renderContext IRenderContext /// The current render context. ///
effect IEffect
effectParameterSet IEffectParameterSet
transform Matrix /// The world transformation to apply. ///
model IModel /// The model to update. ///
frame double /// The frame to draw at. ///
return void

Render() public method

Modifies the specified model to align to this animation at the specified frame and then renders it.
public Render ( IRenderContext renderContext, IEffect effect, IEffectParameterSet effectParameterSet, Matrix transform, IModel model, float totalSeconds, float multiply ) : void
renderContext IRenderContext /// The current render context. ///
effect IEffect
effectParameterSet IEffectParameterSet
transform Matrix /// The world transformation to apply. ///
model IModel /// The model to update. ///
totalSeconds float /// The time elapsed. ///
multiply float /// The multiplication factor to apply to the animation speed. ///
return void