00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_COREMORPHTRACK_H
00012 #define CAL_COREMORPHTRACK_H
00013
00014
00015
00016
00017
00018 #include "cal3d/global.h"
00019 #include "cal3d/matrix.h"
00020 #include "cal3d/vector.h"
00021 #include "cal3d/quaternion.h"
00022 #include "cal3d/coremorphkeyframe.h"
00023
00024
00025
00026
00027
00028 class CalCoreMorphKeyframe;
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class CAL3D_API CalCoreMorphTrack
00039 {
00040
00041 protected:
00042
00043 std::string m_morphName;
00044
00046 std::vector<CalCoreMorphKeyframe> m_keyframes;
00047 std::vector<CalCoreMorphKeyframe*> m_keyframesToDelete;
00048
00049
00050 public:
00051 CalCoreMorphTrack();
00052 virtual ~CalCoreMorphTrack();
00053
00054 bool create();
00055 void destroy();
00056
00057 bool getState(float time, float & weightOut);
00058
00059 std::string getMorphName() const;
00060 void setMorphName(std::string name);
00061
00062 int getCoreMorphKeyframeCount() const;
00063 void reserve(int);
00064
00065 CalCoreMorphKeyframe* getCoreMorphKeyframe(int idx);
00066 const CalCoreMorphKeyframe* getCoreMorphKeyframe(int idx) const;
00067
00068 bool addCoreMorphKeyframe(CalCoreMorphKeyframe *pCoreKeyframe);
00069
00070 const std::vector<CalCoreMorphKeyframe> & getVectorCoreMorphKeyframes() const;
00071 std::vector<CalCoreMorphKeyframe> & getVectorCoreMorphKeyframes();
00072
00073 void scale(float factor);
00074
00075 private:
00076 std::vector<CalCoreMorphKeyframe>::iterator getUpperBound(float time);
00077 };
00078
00079 #endif
00080
00081