Go to the documentation of this file.
29 #ifndef __Animation_H__
30 #define __Animation_H__
421 void optimise(
bool discardIdentityNodeTracks =
true);
546 #endif // __Animation_H__
virtual Animation * getAnimation(const String &name) const =0
Retrieve an animation by name.
virtual ~AnimationContainer()
NumericTrackIterator getNumericTrackIterator(void) const
Get non-updateable iterator over node tracks.
void destroyAllVertexTracks(void)
Removes and destroys all tracks making up this animation.
NumericAnimationTrack * getNumericTrack(unsigned short handle) const
Gets a numeric track by it's handle.
NumericAnimationTrack * createNumericTrack(unsigned short handle)
Creates a NumericAnimationTrack for animating any numeric value.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
void applyToVertexData(VertexData *data, Real timePos, Real weight=1.0)
Applies all vertex tracks given a specific time point and weight to the specified vertex data.
InterpolationMode
The types of animation interpolation available.
String mBaseKeyFrameAnimationName
void destroyAllNumericTracks(void)
Removes and destroys all tracks making up this animation.
VertexAnimationTrack * getVertexTrack(unsigned short handle) const
Gets a Vertex track by it's handle.
const String & getBaseKeyFrameAnimationName() const
If a base keyframe is being used, the Animation that provides that keyframe.
void setUseBaseKeyFrame(bool useBaseKeyFrame, Real keyframeTime=0.0f, const String &baseAnimName=StringUtil::BLANK)
Sets a base keyframe which for the skeletal / pose keyframes in this animation.
static InterpolationMode getDefaultInterpolationMode(void)
Gets the default interpolation mode for all animations.
Real getLength(void) const
Gets the total length of the animation.
VertexAnimationTrack * createVertexTrack(unsigned short handle, VertexAnimationType animType)
Creates a VertexAnimationTrack for animating vertex position data.
VertexAnimationType
Type of vertex animation.
InterpolationMode getInterpolationMode(void) const
Gets the current interpolation mode of this animation.
VertexTrackIterator getVertexTrackIterator(void) const
Get non-updateable iterator over node tracks.
Animation * clone(const String &newName) const
Clone this animation.
Specialised AnimationTrack for dealing with generic animable values.
map< unsigned short, NumericAnimationTrack * >::type NumericTrackList
bool hasVertexTrack(unsigned short handle) const
Does a track exist with the given handle?
ConstMapIterator< NodeTrackList > NodeTrackIterator
@ IM_LINEAR
Values are interpolated along straight lines.
map< unsigned short, VertexAnimationTrack * >::type VertexTrackList
VertexAnimationTrack * createVertexTrack(unsigned short handle, VertexData *data, VertexAnimationType animType)
Creates a VertexAnimationTrack and associates it with VertexData.
Specialised AnimationTrack for dealing with changing vertex position information.
unsigned short getNumNumericTracks(void) const
Gets the number of NumericAnimationTrack objects contained in this animation.
static RotationInterpolationMode getDefaultRotationInterpolationMode(void)
Gets the default rotation interpolation mode for all animations.
virtual bool hasAnimation(const String &name) const =0
Returns whether this object contains the named animation.
Defines an instance of a discrete, movable object based on a Mesh.
virtual Animation * getAnimation(unsigned short index) const =0
Retrieve an animation by index.
NumericTrackList mNumericTrackList
Numeric tracks, indexed by handle.
TimeIndex _getTimeIndex(Real timePos) const
Internal method used to convert time position to time index object.
bool getUseBaseKeyFrame() const
Whether a base keyframe is being used for this Animation.
Summary class collecting together vertex source information.
void buildKeyFrameTimeList(void) const
Internal method to build global keyframe time list.
static void setDefaultRotationInterpolationMode(RotationInterpolationMode im)
Sets the default rotation interpolation mode.
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
NodeTrackList mNodeTrackList
Node tracks, indexed by handle.
bool mKeyFrameTimesDirty
Dirty flag indicate that keyframe time list need to rebuild.
void apply(Real timePos, Real weight=1.0, Real scale=1.0f)
Applies an animation given a specific time point and weight.
bool hasNodeTrack(unsigned short handle) const
Does a track exist with the given handle?
void destroyVertexTrack(unsigned short handle)
Destroys the Vertex track with the given handle.
ConstMapIterator< VertexTrackList > VertexTrackIterator
const String & getName(void) const
Gets the name of this animation.
Specialised AnimationTrack for dealing with node transforms.
void destroyNodeTrack(unsigned short handle)
Destroys the node track with the given handle.
NumericAnimationTrack * createNumericTrack(unsigned short handle, const AnimableValuePtr &anim)
Creates a NumericAnimationTrack and associates it with an animable.
@ RIM_LINEAR
Values are interpolated linearly.
RotationInterpolationMode mRotationInterpolationMode
vector< float >::type BoneBlendMask
Typedef for an array of float values used as a bone blend mask.
NodeTrackIterator getNodeTrackIterator(void) const
Get non-updateable iterator over node tracks.
void setRotationInterpolationMode(RotationInterpolationMode im)
Tells the animation how to interpolate rotations.
virtual void removeAnimation(const String &name)=0
Removes an Animation from this container.
Animation(const String &name, Real length)
You should not use this constructor directly, use the parent object such as Skeleton instead.
const NodeTrackList & _getNodeTrackList(void) const
Fast access to NON-UPDATEABLE node track list.
VertexTrackList mVertexTrackList
Vertex tracks, indexed by handle.
static InterpolationMode msDefaultInterpolationMode
void destroyNumericTrack(unsigned short handle)
Destroys the numeric track with the given handle.
void applyToAnimable(const AnimableValuePtr &anim, Real timePos, Real weight=1.0, Real scale=1.0f)
Applies all numeric tracks given a specific time point and weight to the specified animable value.
NodeAnimationTrack * createNodeTrack(unsigned short handle, Node *node)
Creates a new AnimationTrack automatically associated with a Node.
const NumericTrackList & _getNumericTrackList(void) const
Fast access to NON-UPDATEABLE numeric track list.
Real getBaseKeyFrameTime() const
If a base keyframe is being used, the time of that keyframe.
A collection of Bone objects used to animate a skinned mesh.
vector< Real >::type KeyFrameTimeList
Global keyframe time list used to search global keyframe index.
unsigned short getNumVertexTracks(void) const
Gets the number of VertexAnimationTrack objects contained in this animation.
KeyFrameTimeList mKeyFrameTimes
void _notifyContainer(AnimationContainer *c)
void destroyAllNodeTracks(void)
Removes and destroys all tracks making up this animation.
void destroyAllTracks(void)
Removes and destroys all tracks making up this animation.
AnimationContainer * getContainer()
Retrieve the container of this animation.
void optimiseNodeTracks(bool discardIdentityTracks)
RotationInterpolationMode
The types of rotational interpolation available.
void apply(Skeleton *skeleton, Real timePos, Real weight=1.0, Real scale=1.0f)
Applies all node tracks given a specific time point and weight to a given skeleton.
void optimise(bool discardIdentityNodeTracks=true)
Optimise an animation by removing unnecessary tracks and keyframes.
void _applyBaseKeyFrame()
Internal method to adjust keyframes relative to a base keyframe (.
void _destroyNodeTracks(const TrackHandleList &tracks)
Internal method for destroy given node tracks.
map< unsigned short, NodeAnimationTrack * >::type NodeTrackList
virtual Animation * createAnimation(const String &name, Real length)=0
Create a new animation with a given length owned by this container.
const VertexTrackList & _getVertexTrackList(void) const
Fast access to NON-UPDATEABLE Vertex track list.
float Real
Software floating point type.
InterpolationMode mInterpolationMode
void _keyFrameListChanged(void)
Internal method used to tell the animation that keyframe list has been changed, which may cause it to...
Concrete IteratorWrapper for const access to the underlying key-value container.
bool hasNumericTrack(unsigned short handle) const
Does a track exist with the given handle?
NodeAnimationTrack * getNodeTrack(unsigned short handle) const
Gets a node track by it's handle.
virtual unsigned short getNumAnimations(void) const =0
Gets the number of animations in this container.
static RotationInterpolationMode msDefaultRotationInterpolationMode
void apply(Skeleton *skeleton, Real timePos, float weight, const AnimationState::BoneBlendMask *blendMask, Real scale)
Applies all node tracks given a specific time point and weight to a given skeleton.
Class representing a general-purpose node an articulated scene graph.
AnimationContainer * mContainer
RotationInterpolationMode getRotationInterpolationMode(void) const
Gets the current rotation interpolation mode of this animation.
void applyToNode(Node *node, Real timePos, Real weight=1.0, Real scale=1.0f)
Applies all node tracks given a specific time point and weight to the specified node.
void _collectIdentityNodeTracks(TrackHandleList &tracks) const
Internal method for collecting identity node tracks.
unsigned short getNumNodeTracks(void) const
Gets the number of NodeAnimationTrack objects contained in this animation.
void setLength(Real len)
Sets the length of the animation.
void optimiseVertexTracks(void)
Time index object used to search keyframe at the given position.
ConstMapIterator< NumericTrackList > NumericTrackIterator
set< ushort >::type TrackHandleList
A list of track handles.
void apply(Entity *entity, Real timePos, Real weight, bool software, bool hardware)
Applies all vertex tracks given a specific time point and weight to a given entity.
void setInterpolationMode(InterpolationMode im)
Tells the animation how to interpolate between keyframes.
NodeAnimationTrack * createNodeTrack(unsigned short handle)
Creates a NodeAnimationTrack for animating a Node.
static void setDefaultInterpolationMode(InterpolationMode im)
Sets the default animation interpolation mode.
An animation container interface, which allows generic access to sibling animations.
Copyright © 2012 Torus Knot Software Ltd

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