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);
Specialised KeyFrame which stores absolute vertex positions for a complete buffer, designed to be interpolated with other keys in the same track.
This class interpolates orientations (rotations) along a spline using derivatives of quaternions...
float Real
Software floating point type.
A key frame in an animation sequence defined by an AnimationTrack.
unsigned short getHandle(void) const
Get the handle associated with this track.
vector< KeyFrame * >::type KeyFrameList
virtual void setListener(Listener *l)
Set a listener for this track.
Morph animation is made up of many interpolated snapshot keyframes.
virtual void _keyFrameDataChanged(void) const
Internal method used to tell the track that keyframe data has been changed, which may cause it to reb...
Specialised AnimationTrack for dealing with generic animable values.
Specialised AnimationTrack for dealing with node transforms.
A pose is a linked set of vertex offsets applying to one set of vertex data.
TargetMode mTargetMode
Mode to apply.
void setAssociatedVertexData(VertexData *data)
Sets the associated VertexData which this track will update.
Animation * getParent() const
Returns the parent Animation object for this track.
bool mUseShortestRotationPath
Defines if rotation is done using shortest path.
vector< Pose * >::type PoseList
TargetMode getTargetMode(void) const
Get the target mode.
bool hasKeyIndex(void) const
Listener allowing you to override certain behaviour of a track, for example to drive animation proced...
Pose animation is made up of a single delta pose keyframe.
RotationalSpline rotationSpline
VertexAnimationType getAnimationType(void) const
Get the type of vertex animation we're performing.
Time index object used to search keyframe at the given position.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Real mTimePos
The time position (in relation to the whole animation sequence)
A 'track' in an animation sequence, i.e.
virtual void optimise(void)
Optimise the current track by removing any duplicate keyframes.
VertexAnimationType mAnimationType
Animation type.
Specialised AnimationTrack for dealing with changing vertex position information. ...
uint mKeyIndex
The global keyframe index (in relation to the whole animation sequence) that used to convert to local...
Summary class collecting together vertex source information.
Real getTimePos(void) const
vector< ushort >::type KeyFrameIndexMap
Map used to translate global keyframe time lower bound index to local lower bound index...
TimeIndex(Real timePos, uint keyIndex)
Construct time index object by the given time position and global keyframe index. ...
KeyFrameIndexMap mKeyFrameIndexMap
A very simple spline class which implements the Catmull-Rom class of splines.
SimpleSpline positionSpline
Specialised KeyFrame which references a Mesh::Pose at a certain influence level, which stores offsets...
TimeIndex(Real timePos)
Construct time index object by the given time position.
Interpolate vertex positions in software.
AnimableValuePtr mTargetAnim
Target to animate.
VertexData * mTargetVertexData
Target to animate.
Specialised KeyFrame which stores any numeric value.
void setTargetMode(TargetMode m)
Set the target mode.
VertexAnimationType
Type of vertex animation.
TargetMode
The target animation mode.
Class representing a general-purpose node an articulated scene graph.
VertexData * getAssociatedVertexData(void) const
Gets the associated VertexData which this track will update.
virtual void _applyBaseKeyFrame(const KeyFrame *base)
Internal method to re-base the keyframes relative to a given keyframe.
uint getKeyIndex(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 ...