Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 13, 2005, 11:16:33 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: merged the Trunk into the physics Branche again:
merged with command:
svn merge ../trunk physics -r 3953:HEAD
no important conflicts

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
  • orxonox/branches/physics/src/util/animation/t_animation.h

    r3953 r4178  
    4343  void setFuncToAnim(T* object, void (T::*funcToAnim)(float));
    4444
    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);
    4646
    4747  virtual void rewind();
     
    154154  if (duration <= 0.0)
    155155    duration = 1.0;
     156  if (animFunc == ANIM_NULL)
     157    animFunc = ANIM_DEFAULT_FUNCTION;
    156158
    157159  KeyFrameF* tmpKeyFrame;
     
    190192      if (localTime >= this->currentKeyFrame->duration)
    191193        {
    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();
    203212        }
    204213     
     
    235244      {
    236245        this->animFunc = &tAnimation<T>::negExp;
    237         float d = fabs(this->currentKeyFrame->value - this->nextKeyFrame->value);
    238246        expFactor =  - 1.0 / this->currentKeyFrame->duration * logf(DELTA_X);
    239247        break;
Note: See TracChangeset for help on using the changeset viewer.