00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_COREANIMATION_H
00012 #define CAL_COREANIMATION_H
00013
00014 #include "cal3d/global.h"
00015 #include "cal3d/quaternion.h"
00016 #include "cal3d/refcounted.h"
00017 #include "cal3d/refptr.h"
00018
00019 struct CalAnimationCallback;
00020 class CalCoreTrack;
00021
00022 class CAL3D_API CalCoreAnimation : public cal3d::RefCounted
00023 {
00024 protected:
00025 ~CalCoreAnimation();
00026
00027 public:
00028 CalCoreAnimation();
00029
00030 bool addCoreTrack(CalCoreTrack *pCoreTrack);
00031 CalCoreTrack *getCoreTrack(int coreBoneId);
00032
00033 float getDuration() const;
00034 void setDuration(float duration);
00035 void scale(float factor);
00036 void setFilename(const std::string& filename);
00037 const std::string& getFilename(void) const;
00038 void setName(const std::string& name);
00039 const std::string& getName(void) const;
00040
00041 void registerCallback(CalAnimationCallback *callback,float min_interval);
00042 void removeCallback(CalAnimationCallback *callback);
00043
00044 unsigned int getTrackCount() const;
00045 std::list<CalCoreTrack *>& getListCoreTrack();
00046 unsigned int getTotalNumberOfKeyframes() const;
00047
00048 struct CallbackRecord
00049 {
00050 CalAnimationCallback *callback;
00051 float min_interval;
00052 };
00053
00054 std::vector<CallbackRecord>& getCallbackList() { return m_listCallbacks; }
00055
00056 private:
00057
00058 std::vector<CallbackRecord> m_listCallbacks;
00059
00060 float m_duration;
00061 std::list<CalCoreTrack *> m_listCoreTrack;
00062 std::string m_name;
00063 std::string m_filename;
00064 };
00065
00066 typedef cal3d::RefPtr<CalCoreAnimation> CalCoreAnimationPtr;
00067
00068 #endif
00069
00070