- Timestamp:
- Apr 13, 2005, 3:44:38 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/animation.cc
r3790 r3794 86 86 } 87 87 88 void Anim::setInfinity(ANIM_INFINITY p reInfinity, ANIM_INFINITY postInfinity)88 void Anim::setInfinity(ANIM_INFINITY postInfinity) 89 89 { 90 this->preInfinity = preInfinity;91 90 this->postInfinity = postInfinity; 92 91 } -
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) -
orxonox/trunk/src/story_entities/world.cc
r3790 r3794 38 38 #include "garbage_collector.h" 39 39 #include "simple_animation.h" 40 #include "animation.h" 40 41 41 42 #include "command_node.h" … … 368 369 testText->setBindNode(tn); 369 370 370 /* 371 tmpAnim = new Animation<Text>(testText, &Text::setBlending); 372 tmpAnim->addKeyFrame(0.0, 1.0, ANIM_LINEAR); 373 tmpAnim->addKeyFrame(1.0, 1.0, ANIM_LINEAR); 374 tmpAnim->addKeyFrame(0.0, 1.0, ANIM_LINEAR); 375 tmpAnim->addKeyFrame(1.0, 1.0, ANIM_LINEAR); 376 tmpAnim->setInfinity(ANIM_INF_CONSTANT, ANIM_INF_REWIND); 377 */ 371 testAnim = new tAnim<Text>(testText, &Text::setBlending); 372 testAnim->addKeyFrame(0.0, 1.0, ANIM_LINEAR); 373 testAnim->addKeyFrame(1.0, 1.0, ANIM_LINEAR); 374 testAnim->addKeyFrame(0.0, 1.0, ANIM_LINEAR); 375 testAnim->addKeyFrame(1.0, 1.0, ANIM_LINEAR); 376 testAnim->setInfinity(ANIM_INF_REWIND); 377 378 378 break; 379 379 } … … 939 939 this->garbageCollector->tick(seconds); 940 940 this->simpleAnimation->tick(seconds); 941 942 // testAnim->tick(seconds); 941 943 942 944 } -
orxonox/trunk/src/story_entities/world.h
r3790 r3794 24 24 class GarbageCollector; 25 25 class SimpleAnimation; 26 26 class Anim; 27 27 class Text; 28 28 … … 99 99 GLMenuImageScreen* glmis; //!< The Level-Loader Display 100 100 101 Anim* testAnim; 101 102 Text* testText; //!< A text to Test the TextEngine; 102 103
Note: See TracChangeset
for help on using the changeset viewer.