We will use the previous code as base to print all animations that our entity has.
At the end of the
createScene()
function, get all the animations that the model has as a set:Ogre::AnimationStateSet* set = _SinbadEnt->getAllAnimationStates();
Then define an iterator and init it with the iterator of the set:
Ogre::AnimationStateIterator iter = set->getAnimationStateIterator();
And, finally, iterate over all animations and print their names:
while(iter.hasMoreElements()) { std::cout << iter.getNext()->getAnimationName() << std::endl; }
Compile and run the application. After starting the application and loading the scene, you should see the following text in the console of the application:
Dance
DrawSwords
HandsClosed
HandsRelaxed
IdleBase
IdleTop
JumpEnd
JumpLoop
JumpStart
RunBase
RunTop
SliceHorizontal
SliceVertical