OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::SkeletonAnimation Class Reference

Represents the instance of a Skeletal animation based on its definition. More...

#include <OgreSkeletonAnimation.h>

+ Inheritance diagram for Ogre::SkeletonAnimation:
+ Collaboration diagram for Ogre::SkeletonAnimation:

Public Member Functions

 SkeletonAnimation (const SkeletonAnimationDef *definition, const FastArray< size_t > *slotStarts, SkeletonInstance *owner)
 
void _applyAnimation (const TransformArray &boneTransforms)
 
void addFrame (Real frames)
 Plays the animation forward (or backwards if negative) More...
 
void addTime (Real time)
 Plays the animation forward (or backwards if negative) More...
 
Real getBoneWeight (IdString boneName) const
 Gets the current per-bone weight of a particular bone. More...
 
RealgetBoneWeightPtr (IdString boneName)
 Gets a pointer current per-bone weight of a particular bone. More...
 
Real getCurrentFrame (Real time) const
 Gets the current animation frame, in frames. More...
 
Real getCurrentTime (Real time) const
 Gets the current animation time, in seconds. Prefer using getCurrentFrame. More...
 
bool getEnabled (void) const
 
bool getLoop (void) const
 Returns current loop setting. More...
 
IdString getName (void) const
 
void initialize (void)
 Call this function before using the animation! 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 setBoneWeight (IdString boneName, Real weight)
 Sets the per-bone weight to a particular bone. More...
 
void setEnabled (bool bEnable)
 Enables or disables this animation. A disabled animation won't be processed at all. More...
 
void setLoop (bool bLoop)
 Loop setting. More...
 

Public Attributes

bool mEnabled
 
Real mFrameRate
 
bool mLoop
 
SkeletonInstancemOwner
 
FastArray< size_t > const * mSlotStarts
 
Real mWeight
 

Protected Attributes

RawSimdUniquePtr< ArrayReal,
MEMCATEGORY_ANIMATION
mBoneWeights
 
Real mCurrentFrame
 
KnownKeyFramesVec mLastKnownKeyFrames
 One per track. More...
 
IdString mName
 

Private Attributes

SkeletonAnimationDef const * mDefinition
 

Detailed Description

Represents the instance of a Skeletal animation based on its definition.

Definition at line 54 of file OgreSkeletonAnimation.h.

Constructor & Destructor Documentation

Ogre::SkeletonAnimation::SkeletonAnimation ( const SkeletonAnimationDef definition,
const FastArray< size_t > *  slotStarts,
SkeletonInstance owner 
)

Member Function Documentation

void Ogre::SkeletonAnimation::_applyAnimation ( const TransformArray boneTransforms)
void Ogre::SkeletonAnimation::addFrame ( Real  frames)

Plays the animation forward (or backwards if negative)

Parameters
framesFrames to advance, in frames
void Ogre::SkeletonAnimation::addTime ( Real  time)
inline

Plays the animation forward (or backwards if negative)

Parameters
timeTime to advance, in seconds

Definition at line 84 of file OgreSkeletonAnimation.h.

Real Ogre::SkeletonAnimation::getBoneWeight ( IdString  boneName) const

Gets the current per-bone weight of a particular bone.

Parameters
boneNameThe name of the bone to get. If this animation doesn't affect that bone (or the name is invalid) this function returns 0.
Returns
The weight of the specified bone. 0 if not found.
Real* Ogre::SkeletonAnimation::getBoneWeightPtr ( IdString  boneName)

Gets a pointer current per-bone weight of a particular bone.

Useful if you intend to have read/write access to this value very often.

Remarks
If returnPtr is the return value to bone[0], do not assume that returnPtr+1 affects bone[1] or even any other bone. Doing so the behavior is underfined and most likely you could be affecting the contents of other SkeletonInstances.
Parameters
boneNameThe name of the bone to get. If this animation doesn't affect that bone (or the name is invalid) this function returns a null pointer.
Returns
The pointer to the bone weight of the specified bone. Null pointer if not found.
Real Ogre::SkeletonAnimation::getCurrentFrame ( Real  time) const
inline

Gets the current animation frame, in frames.

Definition at line 96 of file OgreSkeletonAnimation.h.

Real Ogre::SkeletonAnimation::getCurrentTime ( Real  time) const
inline

Gets the current animation time, in seconds. Prefer using getCurrentFrame.

Definition at line 93 of file OgreSkeletonAnimation.h.

bool Ogre::SkeletonAnimation::getEnabled ( void  ) const
inline

Definition at line 150 of file OgreSkeletonAnimation.h.

bool Ogre::SkeletonAnimation::getLoop ( void  ) const
inline

Returns current loop setting.

setLoop.

Definition at line 109 of file OgreSkeletonAnimation.h.

IdString Ogre::SkeletonAnimation::getName ( void  ) const
inline

Definition at line 98 of file OgreSkeletonAnimation.h.

void Ogre::SkeletonAnimation::initialize ( void  )

Call this function before using the animation!

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

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

Definition at line 108 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

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

Definition at line 119 of file OgreMemoryAllocatedObject.h.

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

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

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

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

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

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

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

Definition at line 91 of file OgreMemoryAllocatedObject.h.

void Ogre::SkeletonAnimation::setBoneWeight ( IdString  boneName,
Real  weight 
)

Sets the per-bone weight to a particular bone.

Useful for fine control over animation strength on a set of nodes (i.e. an arm)

Remarks
By default all bone weights are set to 1.0
Parameters
boneNameThe name of the bone to set. If this animation doesn't affect that bone (or the name is invalid) this function does nothing.
weightWeight to apply to this particular bone. Note that the animation multiplies this value against the global mWeight to obtain the final weight. Normal range is between [0; 1] but not necessarily.
void Ogre::SkeletonAnimation::setEnabled ( bool  bEnable)

Enables or disables this animation. A disabled animation won't be processed at all.

void Ogre::SkeletonAnimation::setLoop ( bool  bLoop)
inline

Loop setting.

Looped animations will wrap back to zero when reaching the animation length or go back to the animation length if playing backwards. Non-looped animations will stop at the animation length (or at 0 if backwards) but won't be disabled.

Definition at line 105 of file OgreSkeletonAnimation.h.

Member Data Documentation

RawSimdUniquePtr<ArrayReal, MEMCATEGORY_ANIMATION> Ogre::SkeletonAnimation::mBoneWeights
protected

Definition at line 58 of file OgreSkeletonAnimation.h.

Real Ogre::SkeletonAnimation::mCurrentFrame
protected

Definition at line 59 of file OgreSkeletonAnimation.h.

SkeletonAnimationDef const* Ogre::SkeletonAnimation::mDefinition
private

Definition at line 56 of file OgreSkeletonAnimation.h.

bool Ogre::SkeletonAnimation::mEnabled

Definition at line 65 of file OgreSkeletonAnimation.h.

Real Ogre::SkeletonAnimation::mFrameRate

Definition at line 61 of file OgreSkeletonAnimation.h.

KnownKeyFramesVec Ogre::SkeletonAnimation::mLastKnownKeyFrames
protected

One per track.

Definition at line 71 of file OgreSkeletonAnimation.h.

bool Ogre::SkeletonAnimation::mLoop

Definition at line 64 of file OgreSkeletonAnimation.h.

IdString Ogre::SkeletonAnimation::mName
protected

Definition at line 68 of file OgreSkeletonAnimation.h.

SkeletonInstance* Ogre::SkeletonAnimation::mOwner

Definition at line 66 of file OgreSkeletonAnimation.h.

FastArray<size_t> const* Ogre::SkeletonAnimation::mSlotStarts

Definition at line 63 of file OgreSkeletonAnimation.h.

Real Ogre::SkeletonAnimation::mWeight

Definition at line 62 of file OgreSkeletonAnimation.h.


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