Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3858 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Apr 17, 2005, 3:27:54 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: moved the infinity-handling into animation.cc

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/animation.cc

    r3853 r3858  
    7070
    7171/**
     72   \brief handles the Animation if it gets out of boundraries eg. if animation is finished.
     73*/
     74void Animation::handleInfinity(void)
     75{
     76  switch (this->postInfinity)
     77    {
     78    case ANIM_INF_CONSTANT:
     79      this->localTime = 0.0;
     80      this->bRunning = false;
     81      break;
     82    case ANIM_INF_REPLAY:
     83      this->replay();
     84      break;
     85    case ANIM_INF_DELETE: // this will possibly never be made
     86      //this->bDelete;
     87      break;
     88    }
     89}
     90
     91/**
    7292   \brief plays the animation back from the current Time forward
    7393*/
  • orxonox/trunk/src/animation.h

    r3853 r3858  
    2525
    2626//! An enumerator describing what the animation should do after the last keyframe.
     27/**
     28   ANIM_INF_CONSTANT stays at the end of the animation
     29   ANIM_INF_REWIND loops back to the beginning and replays the animation
     30*/
    2731typedef enum ANIM_INFINITY {ANIM_INF_CONSTANT,
    28                             ANIM_INF_LINEAR,
    29                             ANIM_INF_PINGPONG,
    30                             ANIM_INF_REWIND};//, ANIM_DELETE}
     32                            ANIM_INF_REPLAY,
     33                            ANIM_INF_DELETE};//, ANIM_INF_LINEAR, ANIM_INF_PINGPONG;
    3134
    3235//! A Struct for Keyframes that simply hold a float
     
    7376  Animation(void);
    7477
     78  void handleInfinity(void);
    7579  // variables
    7680  float localTime;                //!< The Time passed since the beginning of the currentKeyFrame.
     
    8185  bool bHandled;                  //!< If this Animation is handled by the AnimationPlayer.
    8286  bool bRunning;                  //!< If the animation is running
     87  //  bool bDelete;                   //!< If true, the animation will be deleted through the AnimationPlayer.
    8388};
    8489
  • orxonox/trunk/src/animation3d.cc

    r3857 r3858  
    126126          // checking, if we should still Play the animation
    127127          if (this->currentKeyFrame == this->keyFrameList->lastElement())
    128             {
    129               switch (this->postInfinity)
    130                 {
    131                 case ANIM_INF_CONSTANT:
    132                   this->localTime = 0.0;
    133                   this->bRunning = false;
    134                   break;
    135                 case ANIM_INF_REWIND:
    136                   this->replay();
    137                   break;
    138                 }
    139             }
     128            this->handleInfinity();
    140129          this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
    141130          this->setAnimFunc(this->currentKeyFrame->animFunc);     
  • orxonox/trunk/src/t_animation.h

    r3857 r3858  
    185185          // checking, if we should still Play the animation
    186186          if (this->currentKeyFrame == this->keyFrameList->lastElement())
    187             {
    188               switch (this->postInfinity)
    189                 {
    190                 case ANIM_INF_CONSTANT:
    191                   this->localTime = 0.0;
    192                   this->bRunning = false;
    193                   break;
    194                 case ANIM_INF_REWIND:
    195                   this->replay();
    196                   break;
    197                 }
    198             }
     187            this->handleInfinity();
    199188          this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
    200189          printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value);
Note: See TracChangeset for help on using the changeset viewer.