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; }
176 unsigned short* firstKeyIndex = 0)
const;
298 Real weight = 1.0,
Real scale = 1.0f);
Animation * getParent() const
Returns the parent Animation object for this track.
virtual void apply(const TimeIndex &timeIndex, Real weight=1.0, Real scale=1.0f)
Applies an animation track to the designated target.
virtual bool getUseShortestRotationPath() const
Gets the method of rotation calculation.
A key frame in an animation sequence defined by an AnimationTrack.
virtual void setUseShortestRotationPath(bool useShortestPath)
Sets the method of rotation calculation.
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...
virtual void setAssociatedNode(Node *node)
Sets the associated Node object which will be automatically affected by calls to 'apply'.
virtual void applyToVertexData(VertexData *data, const TimeIndex &timeIndex, Real weight=1.0, const PoseList *poseList=0)
As the 'apply' method but applies to specified VertexData instead of associated data.
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 ...
virtual TransformKeyFrame * getNodeKeyFrame(unsigned short index) const
Returns the KeyFrame at the specified index.
virtual TransformKeyFrame * createNodeKeyFrame(Real timePos)
Creates a new KeyFrame and adds it to this animation at the given time index.
VertexPoseKeyFrame * getVertexPoseKeyFrame(unsigned short index) const
Returns the pose KeyFrame at the specified index.
TargetMode
The target animation mode.
VertexAnimationType
Type of vertex animation.
VertexAnimationTrack(Animation *parent, unsigned short handle, VertexAnimationType animType)
Constructor.
void _keyFrameDataChanged(void) const
Internal method used to tell the track that keyframe data has been changed, which may cause it to reb...
This class interpolates orientations (rotations) along a spline using derivatives of quaternions.
virtual bool hasNonZeroKeyFrames(void) const
Method to determine if this track has any KeyFrames which are doing anything useful - can be used to ...
void applyPoseToVertexData(const Pose *pose, VertexData *data, Real influence)
Utility method for applying pose animation.
Specialised KeyFrame which references a Mesh::Pose at a certain influence level, which stores offsets...
Specialised AnimationTrack for dealing with generic animable values.
virtual void apply(const TimeIndex &timeIndex, Real weight=1.0, Real scale=1.0f)
Applies an animation track to the designated target.
virtual void getInterpolatedKeyFrame(const TimeIndex &timeIndex, KeyFrame *kf) const
Gets a KeyFrame object which contains the interpolated transforms at the time index specified.
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
NodeAnimationTrack(Animation *parent, unsigned short handle, Node *targetNode)
Constructor, associates with a Node.
NumericAnimationTrack * _clone(Animation *newParent) const
Clone this track (internal use only)
virtual VertexMorphKeyFrame * createVertexMorphKeyFrame(Real timePos)
Creates a new morph KeyFrame and adds it to this animation at the given time index.
@ VAT_POSE
Pose animation is made up of a single delta pose keyframe.
virtual void removeAllKeyFrames(void)
Removes all the KeyFrames from this track.
Specialised AnimationTrack for dealing with changing vertex position information.
Real mTimePos
The time position (in relation to the whole animation sequence)
bool getVertexAnimationIncludesNormals() const
Whether the vertex animation (if present) includes normals.
NodeAnimationTrack * _clone(Animation *newParent) const
Clone this track (internal use only)
NumericKeyFrame * getNumericKeyFrame(unsigned short index) const
Returns the KeyFrame at the specified index.
A pose is a linked set of vertex offsets applying to one set of vertex data.
virtual void apply(const TimeIndex &timeIndex, Real weight=1.0, Real scale=1.0f)
Applies an animation track to the designated target.
virtual KeyFrame * createKeyFrameImpl(Real time)=0
Create a keyframe implementation - must be overridden.
Summary class collecting together vertex source information.
virtual void optimise(void)
Optimise the current track by removing any duplicate keyframes.
vector< Pose * >::type PoseList
VertexMorphKeyFrame * getVertexMorphKeyFrame(unsigned short index) const
Returns the morph KeyFrame at the specified index.
virtual ~NodeAnimationTrack()
Destructor.
VertexAnimationTrack * _clone(Animation *newParent) const
Clone this track (internal use only)
virtual KeyFrame * getKeyFrame(unsigned short index) const
Returns the KeyFrame at the specified index.
virtual void apply(const TimeIndex &timeIndex, Real weight=1.0, Real scale=1.0f)=0
Applies an animation track to the designated target.
Specialised AnimationTrack for dealing with node transforms.
VertexAnimationType getAnimationType(void) const
Get the type of vertex animation we're performing.
RotationalSpline rotationSpline
virtual bool getInterpolatedKeyFrame(const AnimationTrack *t, const TimeIndex &timeIndex, KeyFrame *kf)=0
Get an interpolated keyframe for this track at the given time.
A 'track' in an animation sequence, i.e.
virtual Node * getAssociatedNode(void) const
Returns a pointer to the associated Node object (if any).
KeyFrame * createKeyFrameImpl(Real time)
Create a keyframe implementation - must be overridden.
Real getTimePos(void) const
KeyFrameIndexMap mKeyFrameIndexMap
TimeIndex(Real timePos)
Construct time index object by the given time position.
virtual unsigned short getNumKeyFrames(void) const
Returns the number of keyframes in this animation.
VertexData * mTargetVertexData
Target to animate.
virtual VertexPoseKeyFrame * createVertexPoseKeyFrame(Real timePos)
Creates the single pose KeyFrame and adds it to this animation.
virtual void _buildKeyFrameIndexMap(const vector< Real >::type &keyFrameTimes)
Internal method to build keyframe time index map to translate global lower bound index to local lower...
virtual NumericKeyFrame * createNumericKeyFrame(Real timePos)
Creates a new KeyFrame and adds it to this animation at the given time index.
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.
AnimationTrack(Animation *parent, unsigned short handle)
Constructor.
SimpleSpline positionSpline
void _applyBaseKeyFrame(const KeyFrame *base)
Internal method to re-base the keyframes relative to a given keyframe.
VertexAnimationTrack(Animation *parent, unsigned short handle, VertexAnimationType animType, VertexData *targetData, TargetMode target=TM_SOFTWARE)
Constructor, associates with target VertexData and temp buffer (for software)
virtual void setAssociatedAnimable(const AnimableValuePtr &val)
Sets the associated animable object which will be automatically affected by calls to 'apply'.
VertexAnimationType mAnimationType
Animation type.
virtual void optimise(void)
Optimise the current track by removing any duplicate keyframes.
void applyToAnimable(const AnimableValuePtr &anim, const TimeIndex &timeIndex, Real weight=1.0, Real scale=1.0f)
Applies an animation track to a given animable value.
virtual KeyFrame * createKeyFrame(Real timePos)
Creates a new KeyFrame and adds it to this animation at the given time index.
KeyFrame * createKeyFrameImpl(Real time)
Create a keyframe implementation - must be overridden.
vector< KeyFrame * >::type KeyFrameList
virtual ~AnimationTrack()
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.
NodeAnimationTrack(Animation *parent, unsigned short handle)
Constructor.
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.
NumericAnimationTrack(Animation *parent, unsigned short handle, AnimableValuePtr &target)
Constructor, associates with an AnimableValue.
virtual void populateClone(AnimationTrack *clone) const
Internal method for clone implementation.
@ VAT_MORPH
Morph animation is made up of many interpolated snapshot keyframes.
@ TM_SOFTWARE
Interpolate vertex positions in software.
virtual void buildInterpolationSplines(void) const
virtual bool hasNonZeroKeyFrames(void) const
Method to determine if this track has any KeyFrames which are doing anything useful - can be used to ...
void _applyBaseKeyFrame(const KeyFrame *base)
Internal method to re-base the keyframes relative to a given keyframe.
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.
virtual void _collectKeyFrameTimes(vector< Real >::type &keyFrameTimes)
Internal method to collect keyframe times, in unique, ordered format.
NumericAnimationTrack(Animation *parent, unsigned short handle)
Constructor.
Time index object used to search keyframe at the given position.
virtual Real getKeyFramesAtTime(const TimeIndex &timeIndex, KeyFrame **keyFrame1, KeyFrame **keyFrame2, unsigned short *firstKeyIndex=0) const
Gets the 2 KeyFrame objects which are active at the time given, and the blend value between them.
void setTargetMode(TargetMode m)
Set the target mode.
virtual void getInterpolatedKeyFrame(const TimeIndex &timeIndex, KeyFrame *kf) const
Gets a KeyFrame object which contains the interpolated transforms at the time index specified.
virtual const AnimableValuePtr & getAssociatedAnimable(void) const
Returns a pointer to the associated animable object (if any).
virtual void getInterpolatedKeyFrame(const TimeIndex &timeIndex, KeyFrame *kf) const
Gets a KeyFrame object which contains the interpolated transforms at the time index specified.
virtual void applyToNode(Node *node, const TimeIndex &timeIndex, Real weight=1.0, Real scale=1.0f)
As the 'apply' method but applies to a specified Node instead of associated node.
virtual void removeKeyFrame(unsigned short index)
Removes a KeyFrame by it's index.
KeyFrame * createKeyFrameImpl(Real time)
Specialised keyframe creation.
virtual void getInterpolatedKeyFrame(const TimeIndex &timeIndex, KeyFrame *kf) const =0
Gets a KeyFrame object which contains the interpolated transforms at the time index specified.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.