![]() |
SLProject 4.0.000
|
SLAnimation is the base container for all animation data. More...
#include <SLAnimation.h>
Protected Attributes | |
SLstring | _name |
name of the animation More... | |
SLfloat | _lengthSec |
duration of the animation in seconds More... | |
SLMNodeAnimTrack | _nodeAnimTracks |
map of all the node tracks in this animation More... | |
SLAnimation is the base container for all animation data.
SLAnimation is a container for multiple SLAnimTrack that build an animation. E.g. a walk animation would consist of all the SLAnimTrack that make a SLAnimSkeleton walk. It also knows the length of the animation.
An animation for a SLAnimSkeleton with n joints must consist of 1 to n SLNodeAnimTrack. The SLAnimation class keeps a map with index -> SLNodeAnimTrack pairs, the index for the SLNodeAnimTrack must match the index of a bone in the target SLAnimSkeleton. This method allows us to animate multiple identical, or similar SLSkeletons with the same SLAnimation.
SLAnimation::~SLAnimation | ( | ) |
Destructor
Returns true if node is the animationTarget of any of the SLNodeAnimationTracks in this animation.
void SLAnimation::apply | ( | SLAnimSkeleton * | skel, |
SLfloat | time, | ||
SLfloat | weight = 1.0f , |
||
SLfloat | scale = 1.0f |
||
) |
Applies all the tracks to their respective joints in the passed in skeleton.
Applies all animation tracks for the passed in timestamp, weight and scale.
void SLAnimation::applyToNode | ( | SLNode * | node, |
SLfloat | time, | ||
SLfloat | weight = 1.0f , |
||
SLfloat | scale = 1.0f |
||
) |
Applies all node tracks of this animation on a single node
SLNodeAnimTrack * SLAnimation::createNodeAnimTrack | ( | ) |
Creates a new SLNodeAnimationTrack with the next free handle.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrack | ( | SLuint | trackID | ) |
Creates a new SLNodeAnimationTrack with the passed in track id.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForEllipse | ( | SLNode * | target, |
SLfloat | radiusA, | ||
SLAxis | axisA, | ||
SLfloat | radiusB, | ||
SLAxis | axisB | ||
) |
Specialized SLNodeAnimationTrack creator for an elliptic node animation
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForRotation | ( | SLNode * | target, |
SLfloat | angleDeg, | ||
const SLVec3f & | axis | ||
) |
Specialized SLNodeAnimationTrack creator for a two keyframe rotation animation from 0° to angleDeg.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForRotation2 | ( | SLNode * | target, |
SLfloat | angleDeg0, | ||
SLfloat | angleDeg1, | ||
const SLVec3f & | axis | ||
) |
Specialized SLNodeAnimationTrack creator for 2 keyframes at angleDeg0 and angleDeg1.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForRotation3 | ( | SLNode * | target, |
SLfloat | angleDeg0, | ||
SLfloat | angleDeg1, | ||
SLfloat | angleDeg2, | ||
const SLVec3f & | axis | ||
) |
Specialized SLNodeAnimationTrack creator for 3 keyframes at angleDeg0, angleDeg1 and angleDeg2.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForRotation360 | ( | SLNode * | target, |
const SLVec3f & | axis | ||
) |
Specialized SLNodeAnimationTrack creator for a 360 deg. node rotation track with 3 keyframes from 0° to 180° to 360°.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForRotation4 | ( | SLNode * | target, |
SLfloat | angleDeg0, | ||
SLfloat | angleDeg1, | ||
SLfloat | angleDeg2, | ||
SLfloat | angleDeg3, | ||
const SLVec3f & | axis | ||
) |
Specialized SLNodeAnimationTrack creator for 4 keyframes at angleDeg0, angleDeg1, angleDeg2 and angleDeg3.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForScaling | ( | SLNode * | target, |
const SLVec3f & | endScale | ||
) |
Specialized SLNodeAnimationTrack creator for a two keyframe scaling animation
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForTranslation | ( | SLNode * | target, |
const SLVec3f & | endPos | ||
) |
Specialized SLNodeAnimationTrack creator for a two keyframe translation animation
void SLAnimation::drawNodeVisuals | ( | SLSceneView * | sv | ) |
Draws the visualizations of all node tracks
|
inline |
void SLAnimation::lengthSec | ( | SLfloat | lengthSec | ) |
Setter for the animation length
|
inline |
|
inline |
Returns the timestamp for the next keyframe in all of the tracks.
Returns the timestamp for the previous keyframe in all of the tracks.
void SLAnimation::resetNodes | ( | ) |
Resets all default animation targets to their initial state.
|
protected |
duration of the animation in seconds
|
protected |
name of the animation
|
protected |
map of all the node tracks in this animation