SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
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.
Definition at line 32 of file SLAnimation.h.
Constructor
Definition at line 16 of file SLAnimation.cpp.
SLAnimation::~SLAnimation | ( | ) |
Destructor
Definition at line 23 of file SLAnimation.cpp.
Returns true if node is the animationTarget of any of the SLNodeAnimationTracks in this animation.
Definition at line 83 of file SLAnimation.cpp.
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.
Definition at line 140 of file SLAnimation.cpp.
Applies all animation tracks for the passed in timestamp, weight and scale.
Definition at line 121 of file SLAnimation.cpp.
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
Definition at line 129 of file SLAnimation.cpp.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrack | ( | ) |
Creates a new SLNodeAnimationTrack with the next free handle.
Definition at line 94 of file SLAnimation.cpp.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrack | ( | SLuint | trackID | ) |
Creates a new SLNodeAnimationTrack with the passed in track id.
Definition at line 108 of file SLAnimation.cpp.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForEllipse | ( | SLNode * | target, |
SLfloat | radiusA, | ||
SLAxis | axisA, | ||
SLfloat | radiusB, | ||
SLAxis | axisB | ||
) |
Specialized SLNodeAnimationTrack creator for an elliptic node animation
Definition at line 309 of file SLAnimation.cpp.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForRotation | ( | SLNode * | target, |
SLfloat | angleDeg, | ||
const SLVec3f & | axis | ||
) |
Specialized SLNodeAnimationTrack creator for a two keyframe rotation animation from 0° to angleDeg.
Definition at line 184 of file SLAnimation.cpp.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForRotation2 | ( | SLNode * | target, |
SLfloat | angleDeg0, | ||
SLfloat | angleDeg1, | ||
const SLVec3f & | axis | ||
) |
Specialized SLNodeAnimationTrack creator for 2 keyframes at angleDeg0 and angleDeg1.
Definition at line 199 of file SLAnimation.cpp.
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.
Definition at line 220 of file SLAnimation.cpp.
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°.
Definition at line 274 of file SLAnimation.cpp.
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.
Definition at line 245 of file SLAnimation.cpp.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForScaling | ( | SLNode * | target, |
const SLVec3f & | endScale | ||
) |
Specialized SLNodeAnimationTrack creator for a two keyframe scaling animation
Definition at line 295 of file SLAnimation.cpp.
SLNodeAnimTrack * SLAnimation::createNodeAnimTrackForTranslation | ( | SLNode * | target, |
const SLVec3f & | endPos | ||
) |
Specialized SLNodeAnimationTrack creator for a two keyframe translation animation
Definition at line 170 of file SLAnimation.cpp.
void SLAnimation::drawNodeVisuals | ( | SLSceneView * | sv | ) |
Draws the visualizations of all node tracks
Definition at line 154 of file SLAnimation.cpp.
|
inline |
Definition at line 72 of file SLAnimation.h.
Setter for the animation length
Definition at line 31 of file SLAnimation.cpp.
|
inline |
Definition at line 71 of file SLAnimation.h.
Definition at line 75 of file SLAnimation.h.
Returns the timestamp for the next keyframe in all of the tracks.
Definition at line 38 of file SLAnimation.cpp.
Returns the timestamp for the previous keyframe in all of the tracks.
Definition at line 57 of file SLAnimation.cpp.
void SLAnimation::resetNodes | ( | ) |
Resets all default animation targets to their initial state.
Definition at line 162 of file SLAnimation.cpp.
|
protected |
duration of the animation in seconds
Definition at line 80 of file SLAnimation.h.
|
protected |
name of the animation
Definition at line 79 of file SLAnimation.h.
|
protected |
map of all the node tracks in this animation
Definition at line 81 of file SLAnimation.h.