00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef CAL_MIXER_H
00013 #define CAL_MIXER_H
00014
00015
00016
00017
00018
00019 #include "cal3d/global.h"
00020
00021
00022
00023
00024
00025 class CalModel;
00026 class CalAnimation;
00027 class CalAnimationAction;
00028 class CalAnimationCycle;
00029
00030
00031
00032
00033
00097 class CAL3D_API CalAbstractMixer
00098 {
00099 public:
00100 CalAbstractMixer() {}
00101 virtual ~CalAbstractMixer() {}
00102
00103
00111 virtual bool isDefaultMixer() { return false; }
00112
00113
00130 virtual void updateAnimation(float deltaTime) = 0;
00131
00132
00148 virtual void updateSkeleton() = 0;
00149 };
00150
00151
00152 class CAL3D_API CalMixer : public CalAbstractMixer
00153 {
00154 public:
00155 CalMixer(CalModel* pModel);
00156 virtual ~CalMixer();
00157
00158 virtual bool isDefaultMixer() { return true; }
00159 bool blendCycle(int id, float weight, float delay);
00160 bool clearCycle(int id, float delay);
00161 bool executeAction(int id, float delayIn, float delayOut, float weightTarget = 1.0f, bool autoLock=false);
00162 bool removeAction(int id);
00163 virtual void updateAnimation(float deltaTime);
00164 virtual void updateSkeleton();
00165 float getAnimationTime();
00166 float getAnimationDuration();
00167 void setAnimationTime(float animationTime);
00168 void setTimeFactor(float timeFactor);
00169 float getTimeFactor();
00170 CalModel *getCalModel();
00171 std::vector<CalAnimation *> &getAnimationVector();
00172 std::list<CalAnimationAction *> &getAnimationActionList();
00173 std::list<CalAnimationCycle *> &getAnimationCycle();
00174
00175 protected:
00176 CalModel *m_pModel;
00177 std::vector<CalAnimation *> m_vectorAnimation;
00178 std::list<CalAnimationAction *> m_listAnimationAction;
00179 std::list<CalAnimationCycle *> m_listAnimationCycle;
00180 float m_animationTime;
00181 float m_animationDuration;
00182 float m_timeFactor;
00183 };
00184
00185 #endif
00186
00187