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