00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_ANIMATION_H
00012 #define CAL_ANIMATION_H
00013
00014
00015 #include "cal3d/global.h"
00016
00017
00018 class CalCoreAnimation;
00019 class CalModel;
00020
00021 class CAL3D_API CalAnimation
00022 {
00023 public:
00024 enum Type
00025 {
00026 TYPE_NONE = 0,
00027 TYPE_CYCLE,
00028 TYPE_POSE,
00029 TYPE_ACTION
00030 };
00031
00032 enum State
00033 {
00034 STATE_NONE = 0,
00035 STATE_SYNC,
00036 STATE_ASYNC,
00037 STATE_IN,
00038 STATE_STEADY,
00039 STATE_OUT,
00040 STATE_STOPPED
00041 };
00042
00043 protected:
00044 CalAnimation(CalCoreAnimation* pCoreAnimation);
00045 public:
00046 virtual ~CalAnimation() { }
00047
00048 CalCoreAnimation *getCoreAnimation();
00049 State getState();
00050 float getTime();
00051 Type getType();
00052 float getWeight();
00053 void setTime(float time);
00054 void setTimeFactor(float timeFactor);
00055 float getTimeFactor();
00056
00057 void checkCallbacks(float animationTime,CalModel *model);
00058 void completeCallbacks(CalModel *model);
00059
00060 protected:
00061 void setType(Type type) {
00062 m_type = type;
00063 }
00064
00065 void setState(State state) {
00066 m_state = state;
00067 }
00068
00069 void setWeight(float weight) {
00070 m_weight = weight;
00071 }
00072
00073
00074 private:
00075
00076 CalCoreAnimation *m_pCoreAnimation;
00077 std::vector<float> m_lastCallbackTimes;
00078 Type m_type;
00079 State m_state;
00080 float m_time;
00081 float m_timeFactor;
00082 float m_weight;
00083 };
00084
00085 #endif
00086
00087