SLProject 4.0.000
SLAnimTrack Class Referenceabstract

Abstract base class for SLAnimationTracks providing time and keyframe functions. More...

#include <SLAnimTrack.h>

Inheritance diagram for SLAnimTrack:
[legend]

Public Member Functions

 SLAnimTrack (SLAnimation *parent)
 
virtual ~SLAnimTrack ()
 
SLAnimKeyframecreateKeyframe (SLfloat time)
 
SLfloat getKeyframesAtTime (SLfloat time, SLAnimKeyframe **k1, SLAnimKeyframe **k2) const
 
virtual void calcInterpolatedKeyframe (SLfloat time, SLAnimKeyframe *keyframe) const =0
 
virtual void apply (SLfloat time, SLfloat weight=1.0f, SLfloat scale=1.0f)=0
 
virtual void drawVisuals (SLSceneView *sv)=0
 
SLint numKeyframes () const
 
SLAnimKeyframekeyframe (SLint index)
 

Protected Member Functions

virtual SLAnimKeyframecreateKeyframeImpl (SLfloat time)=0
 Keyframe creator function for derived implementations. More...
 

Protected Attributes

SLAnimation_animation
 parent animation that created this track More...
 
SLVKeyframe _keyframes
 keyframe list for this track More...
 

Detailed Description

Abstract base class for SLAnimationTracks providing time and keyframe functions.

An animation track is a specialized track that affects a single SLNode or an SLJoint of an SLAnimSkeleton by interpolating its transform. It holds therefore a list of SLKeyframe. For a smooth motion it can interpolate the transform at a given time between two neighboring SLKeyframe.

Constructor & Destructor Documentation

◆ SLAnimTrack()

SLAnimTrack::SLAnimTrack ( SLAnimation animation)

Constructor

◆ ~SLAnimTrack()

SLAnimTrack::~SLAnimTrack ( )
virtual

Destructor

Member Function Documentation

◆ apply()

virtual void SLAnimTrack::apply ( SLfloat  time,
SLfloat  weight = 1.0f,
SLfloat  scale = 1.0f 
)
pure virtual

Implemented in SLNodeAnimTrack.

◆ calcInterpolatedKeyframe()

virtual void SLAnimTrack::calcInterpolatedKeyframe ( SLfloat  time,
SLAnimKeyframe keyframe 
) const
pure virtual

Implemented in SLNodeAnimTrack.

◆ createKeyframe()

SLAnimKeyframe * SLAnimTrack::createKeyframe ( SLfloat  time)

Creates a new keyframed with the passed in timestamp.

Note
It is required that the keyframes are created in chronological order. since we currently don't sort the keyframe list they have to be sorted before being created.

◆ createKeyframeImpl()

virtual SLAnimKeyframe * SLAnimTrack::createKeyframeImpl ( SLfloat  time)
protectedpure virtual

Keyframe creator function for derived implementations.

Implemented in SLNodeAnimTrack.

◆ drawVisuals()

virtual void SLAnimTrack::drawVisuals ( SLSceneView sv)
pure virtual

Implemented in SLNodeAnimTrack.

◆ getKeyframesAtTime()

SLfloat SLAnimTrack::getKeyframesAtTime ( SLfloat  time,
SLAnimKeyframe **  k1,
SLAnimKeyframe **  k2 
) const

Get the two keyframes to the left or the right of the passed in timestamp. If keyframes will wrap around, if there is no keyframe after the passed in time then the k2 result will be the first keyframe in the list. If only one keyframe exists the two values will be equivalent.

Todo:
do we want to consider the edge case below or do we want imported animations to have to have a keyframe at 0.0 time? Is there a better solution for this problem? e.x: the astroboy animation looks wrong when doing this (but thats because it is **** and kf0 and kfn dont match up...

◆ keyframe()

SLAnimKeyframe * SLAnimTrack::keyframe ( SLint  index)

Getter for keyframes by index.

◆ numKeyframes()

SLint SLAnimTrack::numKeyframes ( ) const
inline

Member Data Documentation

◆ _animation

SLAnimation* SLAnimTrack::_animation
protected

parent animation that created this track

◆ _keyframes

SLVKeyframe SLAnimTrack::_keyframes
protected

keyframe list for this track


The documentation for this class was generated from the following files: