OGRE 2.1
Object-Oriented Graphics Rendering Engine
|
An animation sequence. More...
#include <OgreAnimation.h>
Public Types | |
enum | InterpolationMode { IM_LINEAR , IM_SPLINE } |
The types of animation interpolation available. More... | |
typedef ConstVectorIterator< NodeTrackList > | NodeTrackIterator |
typedef vector< NodeAnimationTrack * >::type | NodeTrackList |
typedef ConstMapIterator< NumericTrackList > | NumericTrackIterator |
typedef map< unsignedshort, NumericAnimationTrack * >::type | NumericTrackList |
typedef ConstMapIterator< OldNodeTrackList > | OldNodeTrackIterator |
typedef map< unsignedshort, OldNodeAnimationTrack * >::type | OldNodeTrackList |
enum | RotationInterpolationMode { RIM_LINEAR , RIM_SPHERICAL } |
The types of rotational interpolation available. More... | |
typedef set< ushort >::type | TrackHandleList |
A list of track handles. | |
typedef ConstMapIterator< VertexTrackList > | VertexTrackIterator |
typedef map< unsignedshort, 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. | |
virtual | ~Animation () |
void | _applyBaseKeyFrame () |
Internal method to adjust keyframes relative to a base keyframe (. | |
void | _collectIdentityOldNodeTracks (TrackHandleList &tracks) const |
Internal method for collecting identity node tracks. | |
void | _destroyOldNodeTracks (const TrackHandleList &tracks) |
Internal method for destroy given node tracks. | |
const NodeTrackList & | _getNodeTrackList (void) const |
Fast access to NON-UPDATEABLE node track list. | |
const NumericTrackList & | _getNumericTrackList (void) const |
Fast access to NON-UPDATEABLE numeric track list. | |
const OldNodeTrackList & | _getOldNodeTrackList (void) const |
Fast access to NON-UPDATEABLE OldNode track list. | |
TimeIndex | _getTimeIndex (Real timePos) const |
Internal method used to convert time position to time index object. | |
const VertexTrackList & | _getVertexTrackList (void) const |
Fast access to NON-UPDATEABLE Vertex track list. | |
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. | |
void | _notifyContainer (AnimationContainer *c) |
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 | apply (Real timePos, Real weight=1.0, Real scale=1.0f) |
Applies an animation given a specific time point and weight. | |
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. | |
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 | 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. | |
void | applyToNode (OldNode *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 | 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. | |
Animation * | clone (const String &newName) const |
Clone this animation. | |
NodeAnimationTrack * | createNodeTrack (Node *node) |
Creates a new AnimationTrack automatically associated with a OldNode. | |
NodeAnimationTrack * | createNodeTrack (void) |
Creates a NodeAnimationTrack for animating a OldNode. | |
NumericAnimationTrack * | createNumericTrack (unsigned short handle) |
Creates a NumericAnimationTrack for animating any numeric value. | |
NumericAnimationTrack * | createNumericTrack (unsigned short handle, const AnimableValuePtr &anim) |
Creates a NumericAnimationTrack and associates it with an animable. | |
OldNodeAnimationTrack * | createOldNodeTrack (unsigned short handle) |
Creates a OldNodeAnimationTrack for animating a OldOldNode. | |
OldNodeAnimationTrack * | createOldNodeTrack (unsigned short handle, OldNode *node) |
Creates a new AnimationTrack automatically associated with a OldNode. | |
VertexAnimationTrack * | createVertexTrack (unsigned short handle, VertexAnimationType animType) |
Creates a VertexAnimationTrack for animating vertex position data. | |
VertexAnimationTrack * | createVertexTrack (unsigned short handle, VertexData *data, VertexAnimationType animType) |
Creates a VertexAnimationTrack and associates it with VertexData. | |
void | destroyAllNodeTracks (void) |
Removes and destroys all tracks making up this animation. | |
void | destroyAllNumericTracks (void) |
Removes and destroys all tracks making up this animation. | |
void | destroyAllOldNodeTracks (void) |
void | destroyAllTracks (void) |
Removes and destroys all tracks making up this animation. | |
void | destroyAllVertexTracks (void) |
Removes and destroys all tracks making up this animation. | |
void | destroyNodeTrack (unsigned short handle) |
Destroys the node track with the given handle. | |
void | destroyNumericTrack (unsigned short handle) |
Destroys the numeric track with the given handle. | |
void | destroyOldNodeTrack (unsigned short handle) |
Destroys the node track with the given handle. | |
void | destroyVertexTrack (unsigned short handle) |
Destroys the Vertex track with the given handle. | |
const String & | getBaseKeyFrameAnimationName () const |
If a base keyframe is being used, the Animation that provides that keyframe. | |
Real | getBaseKeyFrameTime () const |
If a base keyframe is being used, the time of that keyframe. | |
AnimationContainer * | getContainer () |
Retrieve the container of this animation. | |
InterpolationMode | getInterpolationMode (void) const |
Gets the current interpolation mode of this animation. | |
Real | getLength (void) const |
Gets the total length of the animation. | |
const String & | getName (void) const |
Gets the name of this animation. | |
NodeAnimationTrack * | getNodeTrack (size_t handle) const |
Gets a node track by it's handle. | |
NodeTrackIterator | getNodeTrackIterator (void) const |
Get non-updateable iterator over node tracks. | |
NumericAnimationTrack * | getNumericTrack (unsigned short handle) const |
Gets a numeric track by it's handle. | |
NumericTrackIterator | getNumericTrackIterator (void) const |
Get non-updateable iterator over node tracks. | |
size_t | getNumNodeTracks (void) const |
Gets the number of NodeAnimationTrack objects contained in this animation. | |
unsigned short | getNumNumericTracks (void) const |
Gets the number of NumericAnimationTrack objects contained in this animation. | |
size_t | getNumOldNodeTracks (void) const |
Gets the number of OldNodeAnimationTrack objects contained in this animation. | |
unsigned short | getNumVertexTracks (void) const |
Gets the number of VertexAnimationTrack objects contained in this animation. | |
OldNodeAnimationTrack * | getOldNodeTrack (unsigned short handle) const |
Gets a node track by it's handle. | |
OldNodeTrackIterator | getOldNodeTrackIterator (void) const |
Get non-updateable iterator over node tracks. | |
RotationInterpolationMode | getRotationInterpolationMode (void) const |
Gets the current rotation interpolation mode of this animation. | |
bool | getUseBaseKeyFrame () const |
Whether a base keyframe is being used for this Animation. | |
VertexAnimationTrack * | getVertexTrack (unsigned short handle) const |
Gets a Vertex track by it's handle. | |
VertexTrackIterator | getVertexTrackIterator (void) const |
Get non-updateable iterator over node tracks. | |
bool | hasNumericTrack (unsigned short handle) const |
Does a track exist with the given handle? | |
bool | hasOldNodeTrack (unsigned short handle) const |
Does a track exist with the given handle? | |
bool | hasVertexTrack (unsigned short handle) const |
Does a track exist with the given handle? | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete (void *ptr, void *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info | |
void * | operator new (size_t sz, void *ptr) |
placement operator new | |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info | |
void | optimise (bool discardIdentityNodeTracks=true) |
Optimise an animation by removing unnecessary tracks and keyframes. | |
void | setInterpolationMode (InterpolationMode im) |
Tells the animation how to interpolate between keyframes. | |
void | setLength (Real len) |
Sets the length of the animation. | |
void | setRotationInterpolationMode (RotationInterpolationMode im) |
Tells the animation how to interpolate rotations. | |
void | setUseBaseKeyFrame (bool useBaseKeyFrame, Real keyframeTime=0.0f, const String &baseAnimName=BLANKSTRING) |
Sets a base keyframe which for the skeletal / pose keyframes in this animation. | |
Static Public Member Functions | |
static InterpolationMode | getDefaultInterpolationMode (void) |
Gets the default interpolation mode for all animations. | |
static RotationInterpolationMode | getDefaultRotationInterpolationMode (void) |
Gets the default rotation interpolation mode for all animations. | |
static void | setDefaultInterpolationMode (InterpolationMode im) |
Sets the default animation interpolation mode. | |
static void | setDefaultRotationInterpolationMode (RotationInterpolationMode im) |
Sets the default rotation interpolation mode. | |
An animation sequence.
A list of track handles.
|
virtual |
void Ogre::v1::Animation::_applyBaseKeyFrame | ( | ) |
Internal method to adjust keyframes relative to a base keyframe (.
void Ogre::v1::Animation::_collectIdentityOldNodeTracks | ( | TrackHandleList & | tracks | ) | const |
Internal method for collecting identity node tracks.
tracks | A list of track handle of non-identity node tracks, where this method will remove non-identity node track handles. |
void Ogre::v1::Animation::_destroyOldNodeTracks | ( | const TrackHandleList & | tracks | ) |
Internal method for destroy given node tracks.
const NodeTrackList & Ogre::v1::Animation::_getNodeTrackList | ( | void | ) | const |
Fast access to NON-UPDATEABLE node track list.
const NumericTrackList & Ogre::v1::Animation::_getNumericTrackList | ( | void | ) | const |
Fast access to NON-UPDATEABLE numeric track list.
const OldNodeTrackList & Ogre::v1::Animation::_getOldNodeTrackList | ( | void | ) | const |
Fast access to NON-UPDATEABLE OldNode track list.
Internal method used to convert time position to time index object.
timePos | The time position. |
const VertexTrackList & Ogre::v1::Animation::_getVertexTrackList | ( | void | ) | const |
Fast access to NON-UPDATEABLE Vertex track list.
Internal method used to tell the animation that keyframe list has been changed, which may cause it to rebuild some internal data.
void Ogre::v1::Animation::_notifyContainer | ( | AnimationContainer * | c | ) |
void Ogre::v1::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.
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 |
Applies an animation given a specific time point and weight.
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. |
void Ogre::v1::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.
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. |
void Ogre::v1::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.
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. |
void Ogre::v1::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.
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. |
void Ogre::v1::Animation::applyToNode | ( | OldNode * | 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.
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. |
void Ogre::v1::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.
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. |
Clone this animation.
NodeAnimationTrack * Ogre::v1::Animation::createNodeTrack | ( | Node * | node | ) |
Creates a new AnimationTrack automatically associated with a OldNode.
NodeAnimationTrack * Ogre::v1::Animation::createNodeTrack | ( | void | ) |
Creates a NodeAnimationTrack for animating a OldNode.
handle | Handle to give the track, used for accessing the track later. Must be unique within this Animation. |
NumericAnimationTrack * Ogre::v1::Animation::createNumericTrack | ( | unsigned short | handle | ) |
Creates a NumericAnimationTrack for animating any numeric value.
handle | Handle to give the track, used for accessing the track later. Must be unique within this Animation. |
NumericAnimationTrack * Ogre::v1::Animation::createNumericTrack | ( | unsigned short | handle, |
const AnimableValuePtr & | anim | ||
) |
Creates a NumericAnimationTrack and associates it with an animable.
handle | Handle to give the track, used for accessing the track later. |
anim | Animable object link Must be unique within this Animation. |
OldNodeAnimationTrack * Ogre::v1::Animation::createOldNodeTrack | ( | unsigned short | handle | ) |
Creates a OldNodeAnimationTrack for animating a OldOldNode.
handle | Handle to give the track, used for accessing the track later. Must be unique within this Animation. |
OldNodeAnimationTrack * Ogre::v1::Animation::createOldNodeTrack | ( | unsigned short | handle, |
OldNode * | node | ||
) |
Creates a new AnimationTrack automatically associated with a OldNode.
VertexAnimationTrack * Ogre::v1::Animation::createVertexTrack | ( | unsigned short | handle, |
VertexAnimationType | animType | ||
) |
Creates a VertexAnimationTrack for animating vertex position data.
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, |
VertexAnimationTrack * Ogre::v1::Animation::createVertexTrack | ( | unsigned short | handle, |
VertexData * | data, | ||
VertexAnimationType | animType | ||
) |
Creates a VertexAnimationTrack and associates it with VertexData.
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. |
Removes and destroys all tracks making up this animation.
Removes and destroys all tracks making up this animation.
Removes and destroys all tracks making up this animation.
Removes and destroys all tracks making up this animation.
Destroys the node track with the given handle.
Destroys the numeric track with the given handle.
Destroys the node track with the given handle.
Destroys the Vertex track with the given handle.
If a base keyframe is being used, the Animation that provides that keyframe.
Real Ogre::v1::Animation::getBaseKeyFrameTime | ( | ) | const |
If a base keyframe is being used, the time of that keyframe.
AnimationContainer * Ogre::v1::Animation::getContainer | ( | ) |
Retrieve the container of this animation.
|
static |
Gets the default interpolation mode for all animations.
|
static |
Gets the default rotation interpolation mode for all animations.
InterpolationMode Ogre::v1::Animation::getInterpolationMode | ( | void | ) | const |
Gets the current interpolation mode of this animation.
NodeAnimationTrack * Ogre::v1::Animation::getNodeTrack | ( | size_t | handle | ) | const |
Gets a node track by it's handle.
|
inline |
Get non-updateable iterator over node tracks.
NumericAnimationTrack * Ogre::v1::Animation::getNumericTrack | ( | unsigned short | handle | ) | const |
Gets a numeric track by it's handle.
|
inline |
Get non-updateable iterator over node tracks.
Gets the number of NodeAnimationTrack objects contained in this animation.
Gets the number of NumericAnimationTrack objects contained in this animation.
Gets the number of OldNodeAnimationTrack objects contained in this animation.
Gets the number of VertexAnimationTrack objects contained in this animation.
OldNodeAnimationTrack * Ogre::v1::Animation::getOldNodeTrack | ( | unsigned short | handle | ) | const |
Gets a node track by it's handle.
|
inline |
Get non-updateable iterator over node tracks.
RotationInterpolationMode Ogre::v1::Animation::getRotationInterpolationMode | ( | void | ) | const |
Gets the current rotation interpolation mode of this animation.
bool Ogre::v1::Animation::getUseBaseKeyFrame | ( | ) | const |
Whether a base keyframe is being used for this Animation.
VertexAnimationTrack * Ogre::v1::Animation::getVertexTrack | ( | unsigned short | handle | ) | const |
Gets a Vertex track by it's handle.
|
inline |
Get non-updateable iterator over node tracks.
Does a track exist with the given handle?
Does a track exist with the given handle?
Does a track exist with the given handle?
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
Optimise an animation by removing unnecessary tracks and keyframes.
discardIdentityNodeTracks | If true, discard identity node tracks. |
|
static |
Sets the default animation interpolation mode.
|
static |
Sets the default rotation interpolation mode.
void Ogre::v1::Animation::setInterpolationMode | ( | InterpolationMode | im | ) |
Tells the animation how to interpolate between keyframes.
Sets the length of the animation.
void Ogre::v1::Animation::setRotationInterpolationMode | ( | RotationInterpolationMode | im | ) |
Tells the animation how to interpolate rotations.
void Ogre::v1::Animation::setUseBaseKeyFrame | ( | bool | useBaseKeyFrame, |
Real | keyframeTime = 0.0f , |
||
const String & | baseAnimName = BLANKSTRING |
||
) |
Sets a base keyframe which for the skeletal / pose keyframes in this animation.
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) |