C# 클래스 Axiom.Animating.AnimationTrack

A 'track' in an animation sequence, ie a sequence of keyframes which affect a certain type of object that can be animated.
This class is intended as a base for more complete classes which will actually animate specific types of object, e.g. a bone in a skeleton to affect skeletal animation. An animation will likely include multiple tracks each of which can be made up of many KeyFrame instances. Note that the use of tracks allows each animable object to have it's own number of keyframes, i.e. you do not have to have the maximum number of keyframes for all animable objects just to cope with the most animated one.

Since the most common animable object is a Node, there are options in this class for associating the track with a Node which will receive keyframe updates automatically when the 'apply' method is called.

파일 보기 프로젝트 열기: WolfgangSt/axiom 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
handle ushort
keyFrameList KeyFrameList
maxKeyFrameTime float
parent Animation

공개 메소드들

메소드 설명
Apply ( float time ) : void

Overloaded Apply method.

Apply ( float time, float weight, bool accumulate, float scale ) : void

Applies an animation track to the designated target.

CreateKeyFrame ( float time ) : KeyFrame

Creates a new KeyFrame and adds it to this animation at the given time index.

It is better to create KeyFrames in time order. Creating them out of order can result in expensive reordering processing. Note that a KeyFrame at time index 0.0 is always created for you, so you don't need to create this one, just access it using KeyFrames[0];

CreateKeyFrameImpl ( float time ) : KeyFrame

Create a keyframe implementation - must be overridden

GetInterpolatedKeyFrame ( float time, KeyFrame kf ) : KeyFrame

Gets a KeyFrame object which contains the interpolated transforms at the time index specified.

The KeyFrame objects held by this class are transformation snapshots at discrete points in time. Normally however, you want to interpolate between these keyframes to produce smooth movement, and this method allows you to do this easily. In animation terminology this is called 'tweening'.

GetKeyFramesAtTime ( float time, KeyFrame &keyFrame1, KeyFrame &keyFrame2, short &firstKeyIndex ) : float

Gets the 2 KeyFrame objects which are active at the time given, and the blend value between them.

At any point in time in an animation, there are either 1 or 2 keyframes which are 'active', 1 if the time index is exactly on a keyframe, 2 at all other times i.e. the keyframe before and the keyframe after.

GetTransformKeyFrame ( int index ) : TransformKeyFrame

Creates a new KeyFrame and adds it to this animation at the given time index.

HasNonZeroKeyFrames ( ) : bool

Method to determine if this track has any KeyFrames which are doing anything useful - can be used to determine if this track can be optimised out.

OnKeyFrameDataChanged ( ) : void

Called internally when keyframes belonging to this track are changed, in order to trigger a rebuild of the animation splines.

Optimise ( ) : void

Optimise the current track by removing any duplicate keyframes.

RemoveAllKeyFrames ( ) : void

Removes all key frames from this animation track.

RemoveKeyFrame ( int index ) : void

Removes the keyframe at the specified index.

비공개 메소드들

메소드 설명
AnimationTrack ( Animation parent ) : System

Internal constructor, to prevent direction instantiation. Should be created via a call to the CreateTrack method of an Animation.

AnimationTrack ( Animation parent, ushort handle ) : System

메소드 상세

Apply() 공개 메소드

Overloaded Apply method.
public Apply ( float time ) : void
time float
리턴 void

Apply() 공개 추상적인 메소드

Applies an animation track to the designated target.
public abstract Apply ( float time, float weight, bool accumulate, float scale ) : void
time float The time position in the animation to apply.
weight float The influence to give to this track, 1.0 for full influence, /// less to blend with other animations.
accumulate bool Don't make weights relative to overall weights applied, /// make them absolute and just add.
scale float The scale to apply to translations and scalings, useful for /// adapting an animation to a different size target.
리턴 void

CreateKeyFrame() 공개 메소드

Creates a new KeyFrame and adds it to this animation at the given time index.
It is better to create KeyFrames in time order. Creating them out of order can result in expensive reordering processing. Note that a KeyFrame at time index 0.0 is always created for you, so you don't need to create this one, just access it using KeyFrames[0];
public CreateKeyFrame ( float time ) : KeyFrame
time float Time within the animation at which this keyframe will lie.
리턴 KeyFrame

CreateKeyFrameImpl() 공개 추상적인 메소드

Create a keyframe implementation - must be overridden
public abstract CreateKeyFrameImpl ( float time ) : KeyFrame
time float
리턴 KeyFrame

GetInterpolatedKeyFrame() 공개 추상적인 메소드

Gets a KeyFrame object which contains the interpolated transforms at the time index specified.
The KeyFrame objects held by this class are transformation snapshots at discrete points in time. Normally however, you want to interpolate between these keyframes to produce smooth movement, and this method allows you to do this easily. In animation terminology this is called 'tweening'.
public abstract GetInterpolatedKeyFrame ( float time, KeyFrame kf ) : KeyFrame
time float The time (in relation to the whole animation sequence)
kf KeyFrame Keyframe object to store results
리턴 KeyFrame

GetKeyFramesAtTime() 공개 메소드

Gets the 2 KeyFrame objects which are active at the time given, and the blend value between them.
At any point in time in an animation, there are either 1 or 2 keyframes which are 'active', 1 if the time index is exactly on a keyframe, 2 at all other times i.e. the keyframe before and the keyframe after.
public GetKeyFramesAtTime ( float time, KeyFrame &keyFrame1, KeyFrame &keyFrame2, short &firstKeyIndex ) : float
time float The time index in seconds.
keyFrame1 KeyFrame Receive the keyframe just before or at this time index.
keyFrame2 KeyFrame Receive the keyframe just after this time index.
firstKeyIndex short If supplied, will receive the index of the 'from' keyframe incase the caller needs it.
리턴 float

GetTransformKeyFrame() 공개 메소드

Creates a new KeyFrame and adds it to this animation at the given time index.
public GetTransformKeyFrame ( int index ) : TransformKeyFrame
index int
리턴 TransformKeyFrame

HasNonZeroKeyFrames() 공개 메소드

Method to determine if this track has any KeyFrames which are doing anything useful - can be used to determine if this track can be optimised out.
public HasNonZeroKeyFrames ( ) : bool
리턴 bool

OnKeyFrameDataChanged() 공개 메소드

Called internally when keyframes belonging to this track are changed, in order to trigger a rebuild of the animation splines.
public OnKeyFrameDataChanged ( ) : void
리턴 void

Optimise() 공개 메소드

Optimise the current track by removing any duplicate keyframes.
public Optimise ( ) : void
리턴 void

RemoveAllKeyFrames() 공개 메소드

Removes all key frames from this animation track.
public RemoveAllKeyFrames ( ) : void
리턴 void

RemoveKeyFrame() 공개 메소드

Removes the keyframe at the specified index.
public RemoveKeyFrame ( int index ) : void
index int Index of the keyframe to remove from this track.
리턴 void

프로퍼티 상세

handle 보호되어 있는 프로퍼티

Handle of this animation track.
protected ushort handle
리턴 ushort

keyFrameList 보호되어 있는 프로퍼티

Collection of key frames in this track.
protected KeyFrameList keyFrameList
리턴 KeyFrameList

maxKeyFrameTime 보호되어 있는 프로퍼티

Maximum keyframe time.
protected float maxKeyFrameTime
리턴 float

parent 보호되어 있는 프로퍼티

Animation that owns this track.
protected Animation,Axiom.Animating parent
리턴 Animation