Go to the documentation of this file.
29 #ifndef __AnimationTrack_H__
30 #define __AnimationTrack_H__
65 static const uint INVALID_KEY_INDEX = (
uint)-1;
72 , mKeyIndex(INVALID_KEY_INDEX)
89 return mKeyIndex != INVALID_KEY_INDEX;
146 unsigned short getHandle(
void)
const {
return mHandle; }
149 virtual unsigned short getNumKeyFrames(
void)
const;
152 virtual KeyFrame* getKeyFrame(
unsigned short index)
const;
176 unsigned short* firstKeyIndex = 0)
const;
188 virtual void removeKeyFrame(
unsigned short index);
191 virtual void removeAllKeyFrames(
void);
203 virtual void getInterpolatedKeyFrame(
const TimeIndex& timeIndex,
KeyFrame* kf)
const = 0;
212 virtual void apply(
const TimeIndex& timeIndex,
Real weight = 1.0,
Real scale = 1.0f) = 0;
284 virtual void getInterpolatedKeyFrame(
const TimeIndex& timeIndex,
KeyFrame* kf)
const;
287 virtual void apply(
const TimeIndex& timeIndex,
Real weight = 1.0,
Real scale = 1.0f);
298 Real weight = 1.0,
Real scale = 1.0f);
345 virtual Node* getAssociatedNode(
void)
const;
348 virtual void setAssociatedNode(
Node* node);
351 virtual void applyToNode(
Node* node,
const TimeIndex& timeIndex,
Real weight = 1.0,
355 virtual void setUseShortestRotationPath(
bool useShortestPath);
358 virtual bool getUseShortestRotationPath()
const;
361 virtual void getInterpolatedKeyFrame(
const TimeIndex& timeIndex,
KeyFrame* kf)
const;
364 virtual void apply(
const TimeIndex& timeIndex,
Real weight = 1.0,
Real scale = 1.0f);
367 void _keyFrameDataChanged(
void)
const;
377 virtual bool hasNonZeroKeyFrames(
void)
const;
380 virtual void optimise(
void);
385 void _applyBaseKeyFrame(
const KeyFrame* base);
391 virtual void buildInterpolationSplines(
void)
const;
496 VertexData* targetData, TargetMode target = TM_SOFTWARE);
502 bool getVertexAnimationIncludesNormals()
const;
519 virtual void getInterpolatedKeyFrame(
const TimeIndex& timeIndex,
KeyFrame* kf)
const;
522 virtual void apply(
const TimeIndex& timeIndex,
Real weight = 1.0,
Real scale = 1.0f);
526 virtual void applyToVertexData(
VertexData* data,
551 virtual bool hasNonZeroKeyFrames(
void)
const;
554 virtual void optimise(
void);
559 void _applyBaseKeyFrame(
const KeyFrame* base);
Animation * getParent() const
Returns the parent Animation object for this track.
A key frame in an animation sequence defined by an AnimationTrack.
void setAssociatedVertexData(VertexData *data)
Sets the associated VertexData which this track will update.
TimeIndex(Real timePos, uint keyIndex)
Construct time index object by the given time position and global keyframe index.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Specialised KeyFrame which stores any numeric value.
virtual bool hasNonZeroKeyFrames(void) const
Method to determine if this track has any KeyFrames which are doing anything useful - can be used to ...
TargetMode
The target animation mode.
VertexAnimationType
Type of vertex animation.
This class interpolates orientations (rotations) along a spline using derivatives of quaternions.
Specialised KeyFrame which references a Mesh::Pose at a certain influence level, which stores offsets...
Specialised AnimationTrack for dealing with generic animable values.
unsigned short getHandle(void) const
Get the handle associated with this track.
virtual void _keyFrameDataChanged(void) const
Internal method used to tell the track that keyframe data has been changed, which may cause it to reb...
TargetMode getTargetMode(void) const
Get the target mode.
uint getKeyIndex(void) const
@ VAT_POSE
Pose animation is made up of a single delta pose keyframe.
Specialised AnimationTrack for dealing with changing vertex position information.
Real mTimePos
The time position (in relation to the whole animation sequence)
A pose is a linked set of vertex offsets applying to one set of vertex data.
Summary class collecting together vertex source information.
vector< Pose * >::type PoseList
Specialised AnimationTrack for dealing with node transforms.
VertexAnimationType getAnimationType(void) const
Get the type of vertex animation we're performing.
RotationalSpline rotationSpline
A 'track' in an animation sequence, i.e.
Real getTimePos(void) const
KeyFrameIndexMap mKeyFrameIndexMap
TimeIndex(Real timePos)
Construct time index object by the given time position.
VertexData * mTargetVertexData
Target to animate.
A very simple spline class which implements the Catmull-Rom class of splines.
virtual void _applyBaseKeyFrame(const KeyFrame *base)
Internal method to re-base the keyframes relative to a given keyframe.
SimpleSpline positionSpline
VertexAnimationType mAnimationType
Animation type.
vector< KeyFrame * >::type KeyFrameList
bool mUseShortestRotationPath
Defines if rotation is done using shortest path.
VertexData * getAssociatedVertexData(void) const
Gets the associated VertexData which this track will update.
virtual void optimise(void)
Optimise the current track by removing any duplicate keyframes.
vector< ushort >::type KeyFrameIndexMap
Map used to translate global keyframe time lower bound index to local lower bound index.
TargetMode mTargetMode
Mode to apply.
Listener allowing you to override certain behaviour of a track, for example to drive animation proced...
float Real
Software floating point type.
@ VAT_MORPH
Morph animation is made up of many interpolated snapshot keyframes.
@ TM_SOFTWARE
Interpolate vertex positions in software.
bool hasKeyIndex(void) const
Specialised KeyFrame which stores absolute vertex positions for a complete buffer,...
AnimableValuePtr mTargetAnim
Target to animate.
uint mKeyIndex
The global keyframe index (in relation to the whole animation sequence) that used to convert to local...
Class representing a general-purpose node an articulated scene graph.
virtual void setListener(Listener *l)
Set a listener for this track.
Time index object used to search keyframe at the given position.
void setTargetMode(TargetMode m)
Set the target mode.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15