00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KEOS_ANIMATEDMESHKF_H
00022 #define KEOS_ANIMATEDMESHKF_H
00023
00024 #include "KeosPrerequisites.h"
00025 #include "KeosMesh.h"
00026
00027 namespace Keos
00028 {
00029
00032 class CAnimationInfoKF
00033 {
00034 public:
00035 int Begin;
00036 int End;
00037 int Fps;
00038
00039 CAnimationInfoKF()
00040 {
00041 Begin = 0;
00042 End = 0;
00043 Fps = 0;
00044 }
00045
00046 CAnimationInfoKF(int nBegin, int nEnd, int nFps)
00047 {
00048 Begin = nBegin;
00049 End = nEnd;
00050 Fps = nFps;
00051 }
00052 };
00053
00054
00057 class KEOS_EXPORT CAnimatedMeshKF : public CMesh
00058 {
00059 public :
00060
00064 CAnimatedMeshKF(std::vector<CMeshGeom::TVertex> Frames);
00065
00068 ~CAnimatedMeshKF();
00069
00073 void Animate(float fPercent);
00074
00078 void SetAnimation(uint nAnimIndex) ;
00079
00082 uint GetAnimation()
00083 {
00084 return m_nCurrentAnimation;
00085 }
00086
00090 void AddAnimation(const CAnimationInfoKF& AnimationInfo);
00091
00094 size_t GetNumberOfAnimations()
00095 {
00096 return m_AnimationVector.size();
00097 }
00098
00099 private :
00100
00102 void LinearInterpolation();
00103
00105 std::vector<CMeshGeom::TVertex> m_Frames;
00106
00108 int m_nCurrFrame;
00109 int m_nNextFrame;
00110 float m_fInterp;
00111 float m_fPercent;
00112
00114 std::vector<CAnimationInfoKF> m_AnimationVector;
00115
00117 int m_nCurrentAnimation;
00118
00119 };
00120
00122 typedef CSmartPtr<CAnimatedMeshKF, CRefCount> TAnimatedMeshKFPtr;
00123
00124 }
00125
00126
00127 #endif // KEOS_ANIMATEDMESHKF_H