OGRE-Next
3.0.0
Object-Oriented Graphics Rendering Engine
|
Instance of a Skeleton, main external interface for retrieving bone positions and applying animations. More...
#include <OgreSkeletonInstance.h>
Public Types | |
typedef vector< Bone >::type | BoneVec |
Public Member Functions | |
SkeletonInstance (const SkeletonDef *skeletonDef, BoneMemoryManager *boneMemoryManager) | |
~SkeletonInstance () | |
void | _decrementRefCount () |
void | _disableAnimation (SkeletonAnimation *animation) |
Internal use. Disables given animation. Input should belong to us and already being animated. More... | |
void | _enableAnimation (SkeletonAnimation *animation) |
Internal use. Enables given animation. Input should belong to us and not already animated. More... | |
FORCEINLINE const SimpleMatrixAf4x3 & | _getBoneFullTransform (size_t index) const |
Gets full transform of a bone by its index. More... | |
const void * | _getMemoryBlock () const |
const void * | _getMemoryUniqueOffset () const |
uint16 | _getRefCount () const |
const TransformArray & | _getTransformArray () const |
void | _incrementRefCount () |
void | _updateBoneStartTransforms () |
Updates the contents of SkeletonInstance::mBoneStartTransforms. More... | |
void | addAnimationsFromSkeleton (const String &skelName, const String &groupName) |
Add all animation clips found in skelName. More... | |
const ActiveAnimationsVec & | getActiveAnimations () const |
Returns all animations that are currently active. More... | |
SkeletonAnimation * | getAnimation (IdString name) |
Returns the requested animations. Throws if not found. O(N) Linear search. More... | |
const SkeletonAnimationVec & | getAnimations () const |
Return all animations associated with this skeleton. More... | |
SkeletonAnimationVec & | getAnimationsNonConst () |
Return all animations associated with this skeleton Be careful with this one! Do not insert/remove elements. More... | |
Bone * | getBone (IdString boneName) |
Gets the bone with given name. Throws if not found. More... | |
Bone * | getBone (size_t index) |
Gets the bone from its index. Don't overflow!. More... | |
const SkeletonDef * | getDefinition () const |
size_t | getNumBones () const |
Gets the number of bones. More... | |
Node * | getParentNode () const |
Returns our parent node. May be null. More... | |
void | getTransforms (SimpleMatrixAf4x3 *RESTRICT_ALIAS outTransform, const FastArray< unsigned short > &usedBones) const |
bool | hasAnimation (IdString name) const |
bool | hasBone (IdString name) const |
bool | isManualBone (Bone *bone) |
Returns true if the bone is manually controlled. More... | |
void | resetToPose () |
Resets the transform of all bones to the binding pose. Manual bones are not reset. More... | |
void | setManualBone (Bone *bone, bool isManual) |
Sets the given node to manual. More... | |
void | setParentNode (Node *parentNode) |
Sets our parent node so that our bones are in World space. More... | |
void | setSceneNodeAsParentOfBone (Bone *bone, SceneNode *nodeParent) |
Sets a regular SceneNode to be parent of this Bone for manually controlling a bone (e.g. More... | |
void | update () |
Instance of a Skeleton, main external interface for retrieving bone positions and applying animations.
To those interested in the original repository of OgreAnimation to obtain full history, go to: https://bitbucket.org/dark_sylinc/ogreanimation
typedef vector<Bone>::type Ogre::SkeletonInstance::BoneVec |
Ogre::SkeletonInstance::SkeletonInstance | ( | const SkeletonDef * | skeletonDef, |
BoneMemoryManager * | boneMemoryManager | ||
) |
Ogre::SkeletonInstance::~SkeletonInstance | ( | ) |
void Ogre::SkeletonInstance::_decrementRefCount | ( | ) |
void Ogre::SkeletonInstance::_disableAnimation | ( | SkeletonAnimation * | animation | ) |
Internal use. Disables given animation. Input should belong to us and already being animated.
void Ogre::SkeletonInstance::_enableAnimation | ( | SkeletonAnimation * | animation | ) |
Internal use. Enables given animation. Input should belong to us and not already animated.
|
inline |
Gets full transform of a bone by its index.
const void* Ogre::SkeletonInstance::_getMemoryBlock | ( | ) | const |
const void* Ogre::SkeletonInstance::_getMemoryUniqueOffset | ( | ) | const |
Referenced by Ogre::OrderSkeletonInstanceByMemory().
uint16 Ogre::SkeletonInstance::_getRefCount | ( | ) | const |
|
inline |
void Ogre::SkeletonInstance::_incrementRefCount | ( | ) |
void Ogre::SkeletonInstance::_updateBoneStartTransforms | ( | ) |
Updates the contents of SkeletonInstance::mBoneStartTransforms.
Needed when our memory manager performs a cleanup or similar memory change.
void Ogre::SkeletonInstance::addAnimationsFromSkeleton | ( | const String & | skelName, |
const String & | groupName | ||
) |
Add all animation clips found in skelName.
|
inline |
Returns all animations that are currently active.
SkeletonAnimation* Ogre::SkeletonInstance::getAnimation | ( | IdString | name | ) |
Returns the requested animations. Throws if not found. O(N) Linear search.
|
inline |
Return all animations associated with this skeleton.
|
inline |
Return all animations associated with this skeleton Be careful with this one! Do not insert/remove elements.
Gets the bone with given name. Throws if not found.
Bone* Ogre::SkeletonInstance::getBone | ( | size_t | index | ) |
Gets the bone from its index. Don't overflow!.
|
inline |
size_t Ogre::SkeletonInstance::getNumBones | ( | ) | const |
Gets the number of bones.
|
inline |
Returns our parent node. May be null.
void Ogre::SkeletonInstance::getTransforms | ( | SimpleMatrixAf4x3 *RESTRICT_ALIAS | outTransform, |
const FastArray< unsigned short > & | usedBones | ||
) | const |
bool Ogre::SkeletonInstance::hasAnimation | ( | IdString | name | ) | const |
bool Ogre::SkeletonInstance::hasBone | ( | IdString | name | ) | const |
bool Ogre::SkeletonInstance::isManualBone | ( | Bone * | bone | ) |
Returns true if the bone is manually controlled.
bone | Bone to query if manual. Must belong to this SkeletonInstance. |
void Ogre::SkeletonInstance::resetToPose | ( | ) |
Resets the transform of all bones to the binding pose. Manual bones are not reset.
void Ogre::SkeletonInstance::setManualBone | ( | Bone * | bone, |
bool | isManual | ||
) |
Sets the given node to manual.
Manual bones won't be reset to binding pose (see resetToPose) and thus are suitable for manual control. However if the bone is animated, you're responsible for resetting the position/rotation/scale before each call to
bone | Bone to set/unset to manual. Must belong to this SkeletonInstance (an assert is triggered on non-release builds). Behavior is undefined if node doesn't belong to this instance. |
isManual | True to set to manual, false to restore it. |
void Ogre::SkeletonInstance::setParentNode | ( | Node * | parentNode | ) |
Sets our parent node so that our bones are in World space.
Iterates through all our bones and sets the root bones
Sets a regular SceneNode to be parent of this Bone for manually controlling a bone (e.g.
have a bone follow a character). You may want to also call setManualBone as well to prevent animation on this bone.
nodeParent | Node to be parent of this scene node. Use a null pointer to remove the attachment. |
void Ogre::SkeletonInstance::update | ( | ) |