Esempio n. 1
0
 //--------------------------------------------------------------------------
 void
 FLevelFile::loadAnimations( const HRCFilePtr &model, const AnimationList &animations )
 {
     AFileManager    &a_mgr( AFileManager::getSingleton() );
     AnimationList::const_iterator it    ( animations.begin() )
                                 , it_end( animations.end()   );
     while( it != it_end )
     {
         String animation_name;
         StringUtil::splitBase( it->name, animation_name );
         StringUtil::toLowerCase( animation_name );
         String animation_filename( animation_name + FF7::EXT_A );
         AFilePtr    animation( a_mgr.load( animation_filename, model->getGroup() ) );
         animation_name = FF7::NameLookup::animation( animation_name );
         Ogre::LogManager::getSingleton().stream()
             << " Adding Animation: " << animation_name;
         animation->addTo( model->getSkeleton(), animation_name );
         ++it;
     }
 }
	//-----------------------------------------------------------------------------
	void XsiSkeletonExporter::createAnimations(Skeleton* pSkel, 
		DeformerMap& deformers, float fps, AnimationList& animList, AxisAlignedBox& AABBPadding)
	{
		for (AnimationList::iterator ai = animList.begin(); ai != animList.end(); ++ai)
		{
			AnimationEntry& animEntry = *ai;

			// Note that we don't know if this time period includes bone animation
			// but we sample it anyway just in case; animation optimisation will
			// eliminate anything that's redundant
			// A little wasteful perhaps, but it's the only guaranteed way to pick
			// up all the potentially derived effects on deformers

			float animLength = (float)(animEntry.endFrame - animEntry.startFrame) / fps;
			StringUtil::StrStreamType str;
			str << "Creating animation " << animEntry.animationName << 
				" with length " << animLength << " seconds";
			LogOgreAndXSI(str.str());
			Animation* anim = pSkel->createAnimation(animEntry.animationName, animLength);

			createAnimationTracksSampled(anim, animEntry, deformers, fps, AABBPadding);
			
		}
	}
///Удаление анимации
  void RemoveAnimation (AnimationImpl* animation)
  {
    animations.erase (stl::remove (animations.begin (), animations.end (), animation), animations.end ());
  }