Changeset 4178 in orxonox.OLD for orxonox/branches/physics/src/util/animation/t_animation.h
- Timestamp:
- May 13, 2005, 11:16:33 PM (19 years ago)
- Location:
- orxonox/branches/physics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics
- Property svn:externals
-
old new 1 data http://svn.orxonox.ethz.ch/data 1
-
- Property svn:externals
-
orxonox/branches/physics/src/util/animation/t_animation.h
r3953 r4178 43 43 void setFuncToAnim(T* object, void (T::*funcToAnim)(float)); 44 44 45 void addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc = ANIM_ LINEAR);45 void addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc = ANIM_DEFAULT_FUNCTION); 46 46 47 47 virtual void rewind(); … … 154 154 if (duration <= 0.0) 155 155 duration = 1.0; 156 if (animFunc == ANIM_NULL) 157 animFunc = ANIM_DEFAULT_FUNCTION; 156 158 157 159 KeyFrameF* tmpKeyFrame; … … 190 192 if (localTime >= this->currentKeyFrame->duration) 191 193 { 192 // switching to the next Key-Frame 193 this->localTime -= this->currentKeyFrame->duration; 194 195 this->currentKeyFrame = this->nextKeyFrame; 196 // checking, if we should still Play the animation 197 if (this->currentKeyFrame == this->keyFrameList->lastElement()) 198 this->handleInfinity(); 199 this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame); 200 201 printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value); 202 this->setAnimFunc(this->currentKeyFrame->animFunc); 194 if (likely(this->keyFramesToPlay != 0)) 195 { 196 if (unlikely(this->keyFramesToPlay > 0)) 197 --this->keyFramesToPlay; 198 // switching to the next Key-Frame 199 this->localTime -= this->currentKeyFrame->duration; 200 201 this->currentKeyFrame = this->nextKeyFrame; 202 // checking, if we should still Play the animation 203 if (this->currentKeyFrame == this->keyFrameList->lastElement()) 204 this->handleInfinity(); 205 this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame); 206 207 printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value); 208 this->setAnimFunc(this->currentKeyFrame->animFunc); 209 } 210 else 211 this->pause(); 203 212 } 204 213 … … 235 244 { 236 245 this->animFunc = &tAnimation<T>::negExp; 237 float d = fabs(this->currentKeyFrame->value - this->nextKeyFrame->value);238 246 expFactor = - 1.0 / this->currentKeyFrame->duration * logf(DELTA_X); 239 247 break;
Note: See TracChangeset
for help on using the changeset viewer.