19 : _animation(animation)
70 assert(animationLength > 0.0f &&
"Animation length is invalid.");
85 if (time > animationLength)
86 time = fmod(time, animationLength);
90 time += animationLength;
105 for (
SLuint i = 0; i < numKf; ++i)
109 if (cur->
time() <= time)
128 t2 = animationLength + (*k2)->time();
161 time += animationLength;
163 return (time - t1) / (t2 - t1);
171 _animatedNode(nullptr),
172 _interpolationCurve(nullptr),
174 _rebuildInterpolationCurve(true)
216 translation = base + (kf2->
translation() - base) * t;
232 scale = base + (kf2->
scale() - base) * t;
#define SL_DB_AXIS
Draw the coordinate axis of a node.
SLQuat4< SLfloat > SLQuat4f
vector< SLVec4f > SLVVec4f
Base class for all animation keyframes.
Abstract base class for SLAnimationTracks providing time and keyframe functions.
SLAnimTrack(SLAnimation *parent)
virtual SLAnimKeyframe * createKeyframeImpl(SLfloat time)=0
Keyframe creator function for derived implementations.
SLAnimKeyframe * keyframe(SLint index)
SLAnimKeyframe * createKeyframe(SLfloat time)
SLAnimation * _animation
parent animation that created this track
SLfloat getKeyframesAtTime(SLfloat time, SLAnimKeyframe **k1, SLAnimKeyframe **k2) const
SLint numKeyframes() const
SLVKeyframe _keyframes
keyframe list for this track
SLAnimation is the base container for all animation data.
SLfloat lengthSec() const
The SLCurveBezier class implements a Bezier curve interpolation.
Base class for curves defined by multiple 3D points.
virtual SLVec3f evaluate(const SLfloat t)=0
virtual void draw(const SLMat4f &wm)=0
SLbool _rebuildInterpolationCurve
dirty flag of the Bezier curve
virtual void drawVisuals(SLSceneView *sv)
Draws all visualizations of node animations.
void interpolationCurve(SLCurve *curve)
virtual ~SLNodeAnimTrack()
SLCurve * _interpolationCurve
the translation interpolation curve
SLAnimInterpolation _translationInterpolation
interpolation mode for translations (Bezier or linear)
SLTransformKeyframe * createNodeKeyframe(SLfloat time)
SLNode * _animatedNode
the target node for this track_nodeID
void buildInterpolationCurve() const
virtual void applyToNode(SLNode *node, SLfloat time, SLfloat weight=1.0f, SLfloat scale=1.0f)
SLNodeAnimTrack(SLAnimation *parent)
virtual void calcInterpolatedKeyframe(SLfloat time, SLAnimKeyframe *keyframe) const
virtual void apply(SLfloat time, SLfloat weight=1.0f, SLfloat scale=1.0f)
virtual SLAnimKeyframe * createKeyframeImpl(SLfloat time)
SLNode represents a node in a hierarchical scene graph.
SLbool drawBit(SLuint bit)
void rotate(const SLQuat4f &rot, SLTransformSpace relativeTo=TS_object)
const SLMat4f & initialOM()
void translate(const SLVec3f &vec, SLTransformSpace relativeTo=TS_object)
SLQuat4< T > slerp(const SLQuat4< T > &q2, T t) const
SceneView class represents a dynamic real time 3D view onto the scene.
SLbool drawBit(SLuint bit)
void set(const T X, const T Y, const T Z)