Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 26, 2005, 3:17:43 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: now there is a posibility to play only parts of the animation:
use anim→playNextKeyframes(count_of_keyframes_to_play); to make it work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/animation/t_animation.h

    r3979 r3982  
    192192      if (localTime >= this->currentKeyFrame->duration)
    193193        {
    194           // switching to the next Key-Frame
    195           this->localTime -= this->currentKeyFrame->duration;
    196 
    197           this->currentKeyFrame = this->nextKeyFrame;
    198           // checking, if we should still Play the animation
    199           if (this->currentKeyFrame == this->keyFrameList->lastElement())
    200             this->handleInfinity();
    201           this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
    202 
    203           printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value);
    204           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();
    205212        }
    206213     
Note: See TracChangeset for help on using the changeset viewer.