Ogre::Animation Class Reference
Core » Animation

An animation sequence. More...

`#include <OgreAnimation.h>`

Inheritance diagram for Ogre::Animation:
[legend]

## Public Types

enum | InterpolationMode { IM_LINEAR, IM_SPLINE }
| The types of animation interpolation available. More...
typedef ConstMapIterator< NodeTrackList > | NodeTrackIterator
typedef map< unsigned short, NodeAnimationTrack * >::type | NodeTrackList
typedef ConstMapIterator< NumericTrackList > | NumericTrackIterator
typedef map< unsigned short, NumericAnimationTrack * >::type | NumericTrackList
enum | RotationInterpolationMode { RIM_LINEAR, RIM_SPHERICAL }
| The types of rotational interpolation available. More...
typedef set< ushort >::type | TrackHandleList
| A list of track handles. More...
typedef ConstMapIterator< VertexTrackList > | VertexTrackIterator
typedef map< unsigned short, VertexAnimationTrack * >::type | VertexTrackList

## Public Member Functions

| Animation (const String &name, Real length)
| You should not use this constructor directly, use the parent object such as Skeleton instead. More...
virtual | ~Animation ()
void | _applyBaseKeyFrame ()
| Internal method to adjust keyframes relative to a base keyframe (. More...
void | _collectIdentityNodeTracks (TrackHandleList &tracks) const
| Internal method for collecting identity node tracks. More...
void | _destroyNodeTracks (const TrackHandleList &tracks)
| Internal method for destroy given node tracks. More...
const NodeTrackList & | _getNodeTrackList (void) const
| Fast access to NON-UPDATEABLE node track list. More...
const NumericTrackList & | _getNumericTrackList (void) const
| Fast access to NON-UPDATEABLE numeric track list. More...
TimeIndex | _getTimeIndex (Real timePos) const
| Internal method used to convert time position to time index object. More...
const VertexTrackList & | _getVertexTrackList (void) const
| Fast access to NON-UPDATEABLE Vertex track list. More...
void | _keyFrameListChanged (void)
| Internal method used to tell the animation that keyframe list has been changed, which may cause it to rebuild some internal data. More...
void | _notifyContainer (AnimationContainer *c)
void | apply (Real timePos, Real weight=1.0, Real scale=1.0f)
| Applies an animation given a specific time point and weight. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
Animation * | clone (const String &newName) const
| Clone this animation. More...
NodeAnimationTrack * | createNodeTrack (unsigned short handle)
| Creates a NodeAnimationTrack for animating a Node. More...
NodeAnimationTrack * | createNodeTrack (unsigned short handle, Node *node)
| Creates a new AnimationTrack automatically associated with a Node. More...
NumericAnimationTrack * | createNumericTrack (unsigned short handle)
| Creates a NumericAnimationTrack for animating any numeric value. More...
NumericAnimationTrack * | createNumericTrack (unsigned short handle, const AnimableValuePtr &anim)
| Creates a NumericAnimationTrack and associates it with an animable. More...
VertexAnimationTrack * | createVertexTrack (unsigned short handle, VertexAnimationType animType)
| Creates a VertexAnimationTrack for animating vertex position data. More...
VertexAnimationTrack * | createVertexTrack (unsigned short handle, VertexData *data, VertexAnimationType animType)
| Creates a VertexAnimationTrack and associates it with VertexData. More...
void | destroyAllNodeTracks (void)
| Removes and destroys all tracks making up this animation. More...
void | destroyAllNumericTracks (void)
| Removes and destroys all tracks making up this animation. More...
void | destroyAllTracks (void)
| Removes and destroys all tracks making up this animation. More...
void | destroyAllVertexTracks (void)
| Removes and destroys all tracks making up this animation. More...
void | destroyNodeTrack (unsigned short handle)
| Destroys the node track with the given handle. More...
void | destroyNumericTrack (unsigned short handle)
| Destroys the numeric track with the given handle. More...
void | destroyVertexTrack (unsigned short handle)
| Destroys the Vertex track with the given handle. More...
const String & | getBaseKeyFrameAnimationName () const
| If a base keyframe is being used, the Animation that provides that keyframe. More...
Real | getBaseKeyFrameTime () const
| If a base keyframe is being used, the time of that keyframe. More...
AnimationContainer * | getContainer ()
| Retrieve the container of this animation. More...
InterpolationMode | getInterpolationMode (void) const
| Gets the current interpolation mode of this animation. More...
Real | getLength (void) const
| Gets the total length of the animation. More...
const String & | getName (void) const
| Gets the name of this animation. More...
NodeAnimationTrack * | getNodeTrack (unsigned short handle) const
| Gets a node track by it's handle. More...
NodeTrackIterator | getNodeTrackIterator (void) const
| Get non-updateable iterator over node tracks. More...
NumericAnimationTrack * | getNumericTrack (unsigned short handle) const
| Gets a numeric track by it's handle. More...
NumericTrackIterator | getNumericTrackIterator (void) const
| Get non-updateable iterator over node tracks. More...
unsigned short | getNumNodeTracks (void) const
| Gets the number of NodeAnimationTrack objects contained in this animation. More...
unsigned short | getNumNumericTracks (void) const
| Gets the number of NumericAnimationTrack objects contained in this animation. More...
unsigned short | getNumVertexTracks (void) const
| Gets the number of VertexAnimationTrack objects contained in this animation. More...
RotationInterpolationMode | getRotationInterpolationMode (void) const
| Gets the current rotation interpolation mode of this animation. More...
bool | getUseBaseKeyFrame () const
| Whether a base keyframe is being used for this Animation. More...
VertexAnimationTrack * | getVertexTrack (unsigned short handle) const
| Gets a Vertex track by it's handle. More...
VertexTrackIterator | getVertexTrackIterator (void) const
| Get non-updateable iterator over node tracks. More...
bool | hasNodeTrack (unsigned short handle) const
| Does a track exist with the given handle? More...
bool | hasNumericTrack (unsigned short handle) const
| Does a track exist with the given handle? More...
bool | hasVertexTrack (unsigned short handle) const
| Does a track exist with the given handle? More...
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info More...
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new More...
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info More...
void * | operator new[] (size_t sz)
void | optimise (bool discardIdentityNodeTracks=true)
| Optimise an animation by removing unnecessary tracks and keyframes. More...
void | setInterpolationMode (InterpolationMode im)
| Tells the animation how to interpolate between keyframes. More...
void | setLength (Real len)
| Sets the length of the animation. More...
void | setRotationInterpolationMode (RotationInterpolationMode im)
| Tells the animation how to interpolate rotations. More...
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. More...

## Static Public Member Functions

static InterpolationMode | getDefaultInterpolationMode (void)
| Gets the default interpolation mode for all animations. More...
static RotationInterpolationMode | getDefaultRotationInterpolationMode (void)
| Gets the default rotation interpolation mode for all animations. More...
static void | setDefaultInterpolationMode (InterpolationMode im)
| Sets the default animation interpolation mode. More...
static void | setDefaultRotationInterpolationMode (RotationInterpolationMode im)
| Sets the default rotation interpolation mode. More...

## Protected Types

typedef vector< Real >::type | KeyFrameTimeList
| Global keyframe time list used to search global keyframe index. More...

## Protected Member Functions

void | buildKeyFrameTimeList (void) const
| Internal method to build global keyframe time list. More...
void | optimiseNodeTracks (bool discardIdentityTracks)
void | optimiseVertexTracks (void)

## Protected Attributes

String | mBaseKeyFrameAnimationName
Real | mBaseKeyFrameTime
AnimationContainer * | mContainer
InterpolationMode | mInterpolationMode
KeyFrameTimeList | mKeyFrameTimes
bool | mKeyFrameTimesDirty
| Dirty flag indicate that keyframe time list need to rebuild. More...
Real | mLength
String | mName
NodeTrackList | mNodeTrackList
| Node tracks, indexed by handle. More...
NumericTrackList | mNumericTrackList
| Numeric tracks, indexed by handle. More...
RotationInterpolationMode | mRotationInterpolationMode
bool | mUseBaseKeyFrame
VertexTrackList | mVertexTrackList
| Vertex tracks, indexed by handle. More...

## Static Protected Attributes

static InterpolationMode | msDefaultInterpolationMode
static RotationInterpolationMode | msDefaultRotationInterpolationMode

## Detailed Description

An animation sequence.

Remarks
  This class defines the interface for a sequence of animation, whether that be animation of a mesh, a path along a spline, or possibly more than one type of animation in one. An animation is made up of many 'tracks', which are the more specific types of animation.

  You should not create these animations directly. They will be created via a parent object which owns the animation, e.g. Skeleton.

Definition at line 92 of file OgreAnimation.h.

## Member Typedef Documentation

## KeyFrameTimeList

typedef vector<Real>::type Ogre::Animation::KeyFrameTimeList

protected

Global keyframe time list used to search global keyframe index.

Definition at line 523 of file OgreAnimation.h.

## NodeTrackIterator

typedef ConstMapIterator<NodeTrackList> Ogre::Animation::NodeTrackIterator

Definition at line 373 of file OgreAnimation.h.

## NodeTrackList

typedef map<unsigned short, NodeAnimationTrack*>::type Ogre::Animation::NodeTrackList

Definition at line 372 of file OgreAnimation.h.

## NumericTrackIterator

typedef ConstMapIterator<NumericTrackList> Ogre::Animation::NumericTrackIterator

Definition at line 376 of file OgreAnimation.h.

## NumericTrackList

typedef map<unsigned short, NumericAnimationTrack*>::type Ogre::Animation::NumericTrackList

Definition at line 375 of file OgreAnimation.h.

## TrackHandleList

typedef set<ushort>::type Ogre::Animation::TrackHandleList

A list of track handles.

Definition at line 424 of file OgreAnimation.h.

## VertexTrackIterator

typedef ConstMapIterator<VertexTrackList> Ogre::Animation::VertexTrackIterator

Definition at line 379 of file OgreAnimation.h.

## VertexTrackList

typedef map<unsigned short, VertexAnimationTrack*>::type Ogre::Animation::VertexTrackList

Definition at line 378 of file OgreAnimation.h.

## Member Enumeration Documentation

## InterpolationMode

enum Ogre::Animation::InterpolationMode

The types of animation interpolation available.

Enumerator
IM_LINEAR | Values are interpolated along straight lines.
IM_SPLINE | Values are interpolated along a spline, resulting in smoother changes in direction.

Definition at line 97 of file OgreAnimation.h.

## RotationInterpolationMode

enum Ogre::Animation::RotationInterpolationMode

The types of rotational interpolation available.

Enumerator
RIM_LINEAR | Values are interpolated linearly. This is faster but does not necessarily give a completely accurate result.
RIM_SPHERICAL | Values are interpolated spherically. This is more accurate but has a higher cost.

Definition at line 106 of file OgreAnimation.h.

## Constructor & Destructor Documentation

## Animation()

Ogre::Animation::Animation | ( | const String & | name,
|  | Real | length
| ) |  |

You should not use this constructor directly, use the parent object such as Skeleton instead.

Parameters

  name | The name of the animation, should be unique within it's parent (e.g. Skeleton)
  length | The length of the animation in seconds.

## ~Animation()

virtual Ogre::Animation::~Animation | ( |  | ) |

virtual

## Member Function Documentation

## _applyBaseKeyFrame()

void Ogre::Animation::_applyBaseKeyFrame | ( |  | ) |

Internal method to adjust keyframes relative to a base keyframe (.

See also
  setUseBaseKeyFrame) */

## _collectIdentityNodeTracks()

void Ogre::Animation::_collectIdentityNodeTracks | ( | TrackHandleList & | tracks | ) | const

Internal method for collecting identity node tracks.

Remarks
  This method remove non-identity node tracks form the track handle list.

Parameters

  tracks | A list of track handle of non-identity node tracks, where this method will remove non-identity node track handles.

## _destroyNodeTracks()

void Ogre::Animation::_destroyNodeTracks | ( | const TrackHandleList & | tracks | ) |

Internal method for destroy given node tracks.

## _getNodeTrackList()

const NodeTrackList& Ogre::Animation::_getNodeTrackList | ( | void |  | ) | const

Fast access to NON-UPDATEABLE node track list.

## _getNumericTrackList()

const NumericTrackList& Ogre::Animation::_getNumericTrackList | ( | void |  | ) | const

Fast access to NON-UPDATEABLE numeric track list.

## _getTimeIndex()

TimeIndex Ogre::Animation::_getTimeIndex | ( | Real | timePos | ) | const

Internal method used to convert time position to time index object.

Note
  The time index returns by this function are associated with state of the animation object, if the animation object altered (e.g. create/remove keyframe or track), all related time index will invalidated.

Parameters

  timePos | The time position.

Returns
  The time index object which contains wrapped time position (in relation to the whole animation sequence) and lower bound index of global keyframe time list.

## _getVertexTrackList()

const VertexTrackList& Ogre::Animation::_getVertexTrackList | ( | void |  | ) | const

Fast access to NON-UPDATEABLE Vertex track list.

## _keyFrameListChanged()

void Ogre::Animation::_keyFrameListChanged | ( | void |  | ) |

Internal method used to tell the animation that keyframe list has been changed, which may cause it to rebuild some internal data.

Definition at line 449 of file OgreAnimation.h.

References Ogre::StringUtil::BLANK.

## _notifyContainer()

void Ogre::Animation::_notifyContainer | ( | AnimationContainer * | c | ) |

## apply() [1/4]

void Ogre::Animation::apply | ( | Real | timePos,
|  | Real | weight = `1.0`,
|  | Real | scale = `1.0f`
| ) |  |

Applies an animation given a specific time point and weight.

Remarks
  Where you have associated animation tracks with objects, you can easily apply an animation to those objects by calling this method.

Parameters

  timePos | The time position in the animation to apply.
  weight | The influence to give to this track, 1.0 for full influence, less to blend with other animations.
  scale | The scale to apply to translations and scalings, useful for adapting an animation to a different size target.

## apply() [2/4]

void Ogre::Animation::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.

Remarks
  Where you have associated animation tracks with Node objects, you can easily apply an animation to those nodes by calling this method.

Parameters

  timePos | The time position in the animation to apply.
  weight | The influence to give to this track, 1.0 for full influence, less to blend with other animations.
  scale | The scale to apply to translations and scalings, useful for adapting an animation to a different size target.

## apply() [3/4]

void Ogre::Animation::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.

Remarks
  Where you have associated animation tracks with Node objects, you can easily apply an animation to those nodes by calling this method.

Parameters

  timePos | The time position in the animation to apply.
  weight | The influence to give to this track, 1.0 for full influence, less to blend with other animations.
  blendMask | The influence array defining additional per bone weights. These will be modulated with the weight factor.
  scale | The scale to apply to translations and scalings, useful for adapting an animation to a different size target.

## apply() [4/4]

void Ogre::Animation::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.

Parameters

  entity | The Entity to which this animation should be applied
  timePos | The time position in the animation to apply.
  weight | The weight at which the animation should be applied (only affects pose animation)
  software | Whether to populate the software morph vertex data
  hardware | Whether to populate the hardware morph vertex data

## applyToAnimable()

void Ogre::Animation::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.

Remarks
  It does not applies to actual attached animable values but rather uses all tracks for a single animable value.

Parameters

  timePos | The time position in the animation to apply.
  weight | The influence to give to this track, 1.0 for full influence, less to blend with other animations.
  scale | The scale to apply to translations and scalings, useful for adapting an animation to a different size target.

## applyToNode()

void Ogre::Animation::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.

Remarks
  It does not consider the actual node tracks are attached to. As such, it resembles the apply method for a given skeleton (see below).

Parameters

  timePos | The time position in the animation to apply.
  weight | The influence to give to this track, 1.0 for full influence, less to blend with other animations.
  scale | The scale to apply to translations and scalings, useful for adapting an animation to a different size target.

## applyToVertexData()

void Ogre::Animation::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.

Remarks
  It does not apply to the actual attached vertex data but rather uses all tracks for a given vertex data.

Parameters

  timePos | The time position in the animation to apply.
  weight | The influence to give to this track, 1.0 for full influence, less to blend with other animations.

## buildKeyFrameTimeList()

void Ogre::Animation::buildKeyFrameTimeList | ( | void |  | ) | const

protected

Internal method to build global keyframe time list.

## clone()

Animation* Ogre::Animation::clone | ( | const String & | newName | ) | const

Clone this animation.

Note
  The pointer returned from this method is the only one recorded, thus it is up to the caller to arrange for the deletion of this object.

## createNodeTrack() [1/2]

NodeAnimationTrack* Ogre::Animation::createNodeTrack | ( | unsigned short | handle | ) |

Creates a NodeAnimationTrack for animating a Node.

Parameters

  handle | Handle to give the track, used for accessing the track later. Must be unique within this Animation.

## createNodeTrack() [2/2]

NodeAnimationTrack* Ogre::Animation::createNodeTrack | ( | unsigned short | handle,
|  | Node * | node
| ) |  |

Creates a new AnimationTrack automatically associated with a Node.

Remarks
  This method creates a standard AnimationTrack, but also associates it with a target Node which will receive all keyframe effects.

Parameters

  handle | Numeric handle to give the track, used for accessing the track later. Must be unique within this Animation.
  node | A pointer to the Node object which will be affected by this track

## createNumericTrack() [1/2]

NumericAnimationTrack* Ogre::Animation::createNumericTrack | ( | unsigned short | handle | ) |

Creates a NumericAnimationTrack for animating any numeric value.

Parameters

  handle | Handle to give the track, used for accessing the track later. Must be unique within this Animation.

## createNumericTrack() [2/2]

NumericAnimationTrack* Ogre::Animation::createNumericTrack | ( | unsigned short | handle,
|  | const AnimableValuePtr & | anim
| ) |  |

Creates a NumericAnimationTrack and associates it with an animable.

Parameters

  handle | Handle to give the track, used for accessing the track later.
  anim | Animable object link Must be unique within this Animation.

## createVertexTrack() [1/2]

VertexAnimationTrack* Ogre::Animation::createVertexTrack | ( | unsigned short | handle,
|  | VertexAnimationType | animType
| ) |  |

Creates a VertexAnimationTrack for animating vertex position data.

Parameters

  handle | Handle to give the track, used for accessing the track later. Must be unique within this Animation, and is used to identify the target. For example when applied to a Mesh, the handle must reference the index of the geometry being modified; 0 for the shared geometry, and 1+ for SubMesh geometry with the same index-1.
  animType | Either morph or pose animation,

## createVertexTrack() [2/2]

VertexAnimationTrack* Ogre::Animation::createVertexTrack | ( | unsigned short | handle,
|  | VertexData * | data,
|  | VertexAnimationType | animType
| ) |  |

Creates a VertexAnimationTrack and associates it with VertexData.

Parameters

  handle | Handle to give the track, used for accessing the track later.
  data | VertexData object link
  animType | The animation type Must be unique within this Animation.

## destroyAllNodeTracks()

void Ogre::Animation::destroyAllNodeTracks | ( | void |  | ) |

Removes and destroys all tracks making up this animation.

## destroyAllNumericTracks()

void Ogre::Animation::destroyAllNumericTracks | ( | void |  | ) |

Removes and destroys all tracks making up this animation.

## destroyAllTracks()

void Ogre::Animation::destroyAllTracks | ( | void |  | ) |

Removes and destroys all tracks making up this animation.

## destroyAllVertexTracks()

void Ogre::Animation::destroyAllVertexTracks | ( | void |  | ) |

Removes and destroys all tracks making up this animation.

## destroyNodeTrack()

void Ogre::Animation::destroyNodeTrack | ( | unsigned short | handle | ) |

Destroys the node track with the given handle.

## destroyNumericTrack()

void Ogre::Animation::destroyNumericTrack | ( | unsigned short | handle | ) |

Destroys the numeric track with the given handle.

## destroyVertexTrack()

void Ogre::Animation::destroyVertexTrack | ( | unsigned short | handle | ) |

Destroys the Vertex track with the given handle.

## getBaseKeyFrameAnimationName()

const String& Ogre::Animation::getBaseKeyFrameAnimationName | ( |  | ) | const

If a base keyframe is being used, the Animation that provides that keyframe.

## getBaseKeyFrameTime()

Real Ogre::Animation::getBaseKeyFrameTime | ( |  | ) | const

If a base keyframe is being used, the time of that keyframe.

## getContainer()

AnimationContainer* Ogre::Animation::getContainer | ( |  | ) |

Retrieve the container of this animation.

## getDefaultInterpolationMode()

static InterpolationMode Ogre::Animation::getDefaultInterpolationMode | ( | void |  | ) |

static

Gets the default interpolation mode for all animations.

## getDefaultRotationInterpolationMode()

static RotationInterpolationMode Ogre::Animation::getDefaultRotationInterpolationMode | ( | void |  | ) |

static

Gets the default rotation interpolation mode for all animations.

## getInterpolationMode()

InterpolationMode Ogre::Animation::getInterpolationMode | ( | void |  | ) | const

Gets the current interpolation mode of this animation.

Remarks
  See setInterpolationMode for more info.

## getLength()

Real Ogre::Animation::getLength | ( | void |  | ) | const

Gets the total length of the animation.

## getName()

const String& Ogre::Animation::getName | ( | void |  | ) | const

Gets the name of this animation.

## getNodeTrack()

NodeAnimationTrack* Ogre::Animation::getNodeTrack | ( | unsigned short | handle | ) | const

Gets a node track by it's handle.

## getNodeTrackIterator()

NodeTrackIterator Ogre::Animation::getNodeTrackIterator | ( | void |  | ) | const

Get non-updateable iterator over node tracks.

Definition at line 385 of file OgreAnimation.h.

## getNumericTrack()

NumericAnimationTrack* Ogre::Animation::getNumericTrack | ( | unsigned short | handle | ) | const

Gets a numeric track by it's handle.

## getNumericTrackIterator()

NumericTrackIterator Ogre::Animation::getNumericTrackIterator | ( | void |  | ) | const

Get non-updateable iterator over node tracks.

Definition at line 392 of file OgreAnimation.h.

## getNumNodeTracks()

unsigned short Ogre::Animation::getNumNodeTracks | ( | void |  | ) | const

Gets the number of NodeAnimationTrack objects contained in this animation.

## getNumNumericTracks()

unsigned short Ogre::Animation::getNumNumericTracks | ( | void |  | ) | const

Gets the number of NumericAnimationTrack objects contained in this animation.

## getNumVertexTracks()

unsigned short Ogre::Animation::getNumVertexTracks | ( | void |  | ) | const

Gets the number of VertexAnimationTrack objects contained in this animation.

## getRotationInterpolationMode()

RotationInterpolationMode Ogre::Animation::getRotationInterpolationMode | ( | void |  | ) | const

Gets the current rotation interpolation mode of this animation.

Remarks
  See setRotationInterpolationMode for more info.

## getUseBaseKeyFrame()

bool Ogre::Animation::getUseBaseKeyFrame | ( |  | ) | const

Whether a base keyframe is being used for this Animation.

## getVertexTrack()

VertexAnimationTrack* Ogre::Animation::getVertexTrack | ( | unsigned short | handle | ) | const

Gets a Vertex track by it's handle.

## getVertexTrackIterator()

VertexTrackIterator Ogre::Animation::getVertexTrackIterator | ( | void |  | ) | const

Get non-updateable iterator over node tracks.

Definition at line 399 of file OgreAnimation.h.

## hasNodeTrack()

bool Ogre::Animation::hasNodeTrack | ( | unsigned short | handle | ) | const

Does a track exist with the given handle?

## hasNumericTrack()

bool Ogre::Animation::hasNumericTrack | ( | unsigned short | handle | ) | const

Does a track exist with the given handle?

## hasVertexTrack()

bool Ogre::Animation::hasVertexTrack | ( | unsigned short | handle | ) | const

Does a track exist with the given handle?

## operator delete() [1/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) |

inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

## operator delete() [2/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |
| ) |  |

inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

## operator delete() [3/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [1/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) |

inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [2/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

## operator new() [1/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

## operator new() [2/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) |

inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

## operator new() [3/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr
| ) |  |

inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

## operator new[]() [1/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

## operator new[]() [2/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) |

inherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

## optimise()

void Ogre::Animation::optimise | ( | bool | discardIdentityNodeTracks = `true` | ) |

Optimise an animation by removing unnecessary tracks and keyframes.

Remarks
  When you export an animation, it is possible that certain tracks have been keyframed but actually don't include anything useful - the keyframes include no transformation. These tracks can be completely eliminated from the animation and thus speed up the animation. In addition, if several keyframes in a row have the same value, then they are just adding overhead and can be removed.

Note
  Since track-less and identity track has difference behavior for accumulate animation blending if corresponding track presenting at other animation that is non-identity, and in normally this method didn't known about the situation of other animation, it can't deciding whether or not discards identity tracks. So there have a parameter allow you choose what you want, in case you aren't sure how to do that, you should use Skeleton::optimiseAllAnimations instead.

Parameters

  discardIdentityNodeTracks | If true, discard identity node tracks.

## optimiseNodeTracks()

void Ogre::Animation::optimiseNodeTracks | ( | bool | discardIdentityTracks | ) |

protected

## optimiseVertexTracks()

void Ogre::Animation::optimiseVertexTracks | ( | void |  | ) |

protected

## setDefaultInterpolationMode()

static void Ogre::Animation::setDefaultInterpolationMode | ( | InterpolationMode | im | ) |

static

Sets the default animation interpolation mode.

Remarks
  Every animation created after this option is set will have the new interpolation mode specified. You can also change the mode per animation by calling the setInterpolationMode method on the instance in question.

## setDefaultRotationInterpolationMode()

static void Ogre::Animation::setDefaultRotationInterpolationMode | ( | RotationInterpolationMode | im | ) |

static

Sets the default rotation interpolation mode.

Remarks
  Every animation created after this option is set will have the new interpolation mode specified. You can also change the mode per animation by calling the setInterpolationMode method on the instance in question.

## setInterpolationMode()

void Ogre::Animation::setInterpolationMode | ( | InterpolationMode | im | ) |

Tells the animation how to interpolate between keyframes.

Remarks
  By default, animations normally interpolate linearly between keyframes. This is fast, but when animations include quick changes in direction it can look a little unnatural because directions change instantly at keyframes. An alternative is to tell the animation to interpolate along a spline, which is more expensive in terms of calculation time, but looks smoother because major changes in direction are distributed around the keyframes rather than just at the keyframe.

  You can also change the default animation behaviour by calling Animation::setDefaultInterpolationMode.

## setLength()

void Ogre::Animation::setLength | ( | Real | len | ) |

Sets the length of the animation.

Note
  Changing the length of an animation may invalidate existing AnimationState instances which will need to be recreated.

## setRotationInterpolationMode()

void Ogre::Animation::setRotationInterpolationMode | ( | RotationInterpolationMode | im | ) |

Tells the animation how to interpolate rotations.

Remarks
  By default, animations interpolate linearly between rotations. This is fast but not necessarily completely accurate. If you want more accurate interpolation, use spherical interpolation, but be aware that it will incur a higher cost.

  You can also change the default rotation behaviour by calling Animation::setDefaultRotationInterpolationMode.

## setUseBaseKeyFrame()

void Ogre::Animation::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.

Remarks
  Skeletal and pose animation keyframes are expressed as deltas from a given base state. By default, that is the binding setup of the skeleton, or the object space mesh positions for pose animation. However, sometimes it is useful for animators to create animations with a different starting pose, because that's more convenient, and the animation is designed to simply be added to the existing animation state and not globally averaged with other animations (this is always the case with pose animations, but is activated for skeletal animations via ANIMBLEND_CUMULATIVE).

  In order for this to work, the keyframes need to be 're-based' against this new starting state, for example by treating the first keyframe as the reference point (and therefore representing no change). This can be achieved by applying the inverse of this reference keyframe against all other keyframes. Since this fundamentally changes the animation, this method just marks the animation as requiring this rebase, which is performed at the next Animation 'apply' call. This is to allow the Animation to be re-saved with this flag set, but without having altered the keyframes yet, so no data is lost unintentionally. If you wish to save the animation after the adjustment has taken place, you can (

See also
  _applyBaseKeyFrame)

Parameters

  useBaseKeyFrame | Whether a base keyframe should be used
  keyframeTime | The time corresponding to the base keyframe, if any
  baseAnimName | Optionally a different base animation (must contain the same tracks)

## Member Data Documentation

## mBaseKeyFrameAnimationName

String Ogre::Animation::mBaseKeyFrameAnimationName

protected

Definition at line 530 of file OgreAnimation.h.

## mBaseKeyFrameTime

Real Ogre::Animation::mBaseKeyFrameTime

protected

Definition at line 529 of file OgreAnimation.h.

## mContainer

AnimationContainer* Ogre::Animation::mContainer

protected

Definition at line 531 of file OgreAnimation.h.

## mInterpolationMode

InterpolationMode Ogre::Animation::mInterpolationMode

protected

Definition at line 516 of file OgreAnimation.h.

## mKeyFrameTimes

KeyFrameTimeList Ogre::Animation::mKeyFrameTimes

mutable protected

Definition at line 524 of file OgreAnimation.h.

## mKeyFrameTimesDirty

bool Ogre::Animation::mKeyFrameTimesDirty

mutable protected

Dirty flag indicate that keyframe time list need to rebuild.

Definition at line 526 of file OgreAnimation.h.

## mLength

Real Ogre::Animation::mLength

protected

Definition at line 514 of file OgreAnimation.h.

## mName

String Ogre::Animation::mName

protected

Definition at line 512 of file OgreAnimation.h.

## mNodeTrackList

NodeTrackList Ogre::Animation::mNodeTrackList

protected

Node tracks, indexed by handle.

Definition at line 507 of file OgreAnimation.h.

## mNumericTrackList

NumericTrackList Ogre::Animation::mNumericTrackList

protected

Numeric tracks, indexed by handle.

Definition at line 509 of file OgreAnimation.h.

## mRotationInterpolationMode

RotationInterpolationMode Ogre::Animation::mRotationInterpolationMode

protected

Definition at line 517 of file OgreAnimation.h.

## msDefaultInterpolationMode

InterpolationMode Ogre::Animation::msDefaultInterpolationMode

static protected

Definition at line 519 of file OgreAnimation.h.

## msDefaultRotationInterpolationMode

RotationInterpolationMode Ogre::Animation::msDefaultRotationInterpolationMode

static protected

Definition at line 520 of file OgreAnimation.h.

## mUseBaseKeyFrame

bool Ogre::Animation::mUseBaseKeyFrame

protected

Definition at line 528 of file OgreAnimation.h.

## mVertexTrackList

VertexTrackList Ogre::Animation::mVertexTrackList

protected

Vertex tracks, indexed by handle.

Definition at line 511 of file OgreAnimation.h.

The documentation for this class was generated from the following file:

- OgreAnimation.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.