00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00034 #include "../SO3Animation/SO3VertexAnimation.h"
00035 #include "../SO3Animation/SO3VertexAnimationTrack.h"
00036 #include "../SO3SceneGraph/SO3Entity.h"
00037 #include "../SO3SceneGraph/SO3Skeleton.h"
00038
00039 namespace SO3
00040 {
00041
00042 SVertexAnimation::SVertexAnimation(SScene* scene, std::string animationName, SEntity* entity, unsigned short id) : SAnim(scene, animationName, entity, id, SAnim::SO3_VERTEX_ANIM)
00043 {
00044 mOgreEntity = entity->getOgreEntityPointer();
00045 ogreAnimation = mOgreEntity->getMesh()->getAnimation(id);
00046
00047 int i=0;
00048 Ogre::Animation::VertexTrackIterator iOgreVertexTracks = ogreAnimation->getVertexTrackIterator();
00049 while(iOgreVertexTracks.hasMoreElements())
00050 {
00051 Ogre::VertexAnimationTrack* ogreVertexTrack = iOgreVertexTracks.getNext();
00052 std::string animationTrackName = animationName+".vertexTrack_"+boost::lexical_cast<std::string>(ogreVertexTrack->getHandle());
00053 SAnimTrack* animationTrack = new SVertexAnimationTrack(animationTrackName, this, ogreVertexTrack->getHandle());
00054 AddAnimationTrack(animationTrack);
00055 i++;
00056 }
00057 }
00058
00059 SVertexAnimation::SVertexAnimation() : SAnim(0, "", 0, 0, SO3_UNKNOWN_ANIM)
00060 {
00061
00062 }
00063
00064 SVertexAnimation::~SVertexAnimation()
00065 {
00066 }
00067
00068 Ogre::AnimationState* SVertexAnimation::_GetOgreAnimationState()
00069 {
00070 return mOgreEntity->getAnimationState(name);
00071 }
00072
00073 }