Changeset 3794 in orxonox.OLD for orxonox/trunk/src/animation.h
- Timestamp:
- Apr 13, 2005, 3:44:38 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/animation.h
r3790 r3794 51 51 { 52 52 public: 53 virtual ~Anim(void); 54 55 void setInfinity(ANIM_INFINITY postInfinity = ANIM_INF_CONSTANT); 56 53 57 void addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc = ANIM_LINEAR); 54 void setInfinity(ANIM_INFINITY preInfinity = ANIM_INF_CONSTANT,55 ANIM_INFINITY postInfinity = ANIM_INF_CONSTANT);56 58 void setAnimFunc(ANIM_FUNCTION animFunc); 59 60 void play(); // equals resume(); 61 void stop(); 62 void pause(); 63 void replay(); 64 65 virtual void tick(float time) = 0; 57 66 58 67 protected: 59 68 Anim(void); 60 virtual ~Anim(void);61 69 62 70 static tList<Anim>* animatorList; 63 64 virtual void tick(float time) = 0;65 66 67 71 68 72 // animation functions … … 76 80 // ANIM_FUNCTION animFunc; 77 81 float (Anim::*animFunc)(float) const; 78 ANIM_INFINITY preInfinity; 82 79 83 ANIM_INFINITY postInfinity; 80 84 … … 90 94 91 95 //! A Class to handle some animation for single floated values. 92 template<class T> class Animation: public Anim96 template<class T> class tAnim : public Anim 93 97 { 94 98 public: 95 Animation(T* object = NULL, void (T::*funcToAnim)(float) = NULL);96 virtual ~ Animation();99 tAnim(T* object = NULL, void (T::*funcToAnim)(float) = NULL); 100 virtual ~tAnim(); 97 101 98 102 void setFuncToAnim(T* object, void (T::*funcToAnim)(float)); … … 112 116 */ 113 117 template<class T> 114 Animation<T>::Animation(T* object, void (T::*funcToAnim)(float))118 tAnim<T>::tAnim (T* object, void (T::*funcToAnim)(float)) 115 119 { 116 120 this->setFuncToAnim(object, funcToAnim); … … 123 127 */ 124 128 template<class T> 125 Animation<T>::~Animation()129 tAnim<T>::~tAnim () 126 130 { 127 131 // delete what has to be deleted here … … 130 134 131 135 template<class T> 132 void Animation<T>::setFuncToAnim(T* object, void (T::*funcToAnim)(float))136 void tAnim<T>::setFuncToAnim(T* object, void (T::*funcToAnim)(float)) 133 137 { 134 138 this->object = object; … … 138 142 139 143 template<class T> 140 void Animation<T>::tick(float time)144 void tAnim<T>::tick(float time) 141 145 { 142 146 if (this->bRunning)
Note: See TracChangeset
for help on using the changeset viewer.