Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3786 in orxonox.OLD for orxonox/branches/textEngine/src/animation.cc


Ignore:
Timestamp:
Apr 13, 2005, 2:17:16 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/textEngine: amimate: rewind works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/textEngine/src/animation.cc

    r3785 r3786  
    3333
    3434  // setting default values
     35  this->localTime = 0.0;
    3536  this->animFunc = &Anim::linear;
    3637  this->currentKeyFrame = tmpKeyFrame;
     
    7071      if (this->currentKeyFrame == this->nextKeyFrame)
    7172        this->nextKeyFrame = tmpKeyFrame;
     73      this->keyFrameList->add(tmpKeyFrame);
     74
    7275    }
    7376  else
     
    8083  tmpKeyFrame->animFunc = animFunc;
    8184 
    82   this->keyFrameList->add(tmpKeyFrame);
    8385}
    8486
     
    106108      this->animFunc = &Anim::sine;
    107109      break;
    108 
    109110    }
    110111}
     
    112113
    113114// animation functions
    114 float Anim::random(float time) const
     115float Anim::random(float timePassed) const
    115116{
    116117  return (float)rand()/(float)RAND_MAX;
    117118}
    118119
    119 float Anim::constant(float time) const
     120float Anim::constant(float timePassed) const
    120121{
    121122  return this->currentKeyFrame->value;
    122123}
    123124
    124 float Anim::linear(float time) const
     125float Anim::linear(float timePassed) const
    125126{
    126127  return this->nextKeyFrame->value - (this->nextKeyFrame->value - this->currentKeyFrame->value)
    127     * (time*100.0 / this->currentKeyFrame->duration);
     128    * (timePassed / this->currentKeyFrame->duration);
    128129  //  PRINTF(0)("value is %f, %p %p\n", val, this->currentKeyFrame, this->nextKeyFrame);
    129130  //  return val;
    130131}
    131132
    132 float Anim::sine(float time) const
     133float Anim::sine(float timePassed) const
    133134{
    134 
     135 
    135136}
Note: See TracChangeset for help on using the changeset viewer.