Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

orxonox/branches/textEngine: amimate: rewind works

File:
1 edited

Legend:

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

    r3785 r3786  
    6666
    6767  // animation functions
    68   float random(float time) const;
    69   float constant(float time) const;
    70   float linear(float time) const;
    71   float sine(float time) const;
     68  float random(float timePassed) const;
     69  float constant(float timePassed) const;
     70  float linear(float timePassed) const;
     71  float sine(float timePassed) const;
    7272
    7373
     
    7979
    8080  bool bHasKeys;
     81  bool bPlay;
    8182
     83  float localTime;
    8284  AnimKeyFrame* currentKeyFrame;
    8385  AnimKeyFrame* nextKeyFrame;
     
    137139void Animation<T>::tick(float time)
    138140{
    139   (this->object->*(funcToAnim))((this->*animFunc)(time));
     141  this->localTime += time;
     142  if (localTime >= this->currentKeyFrame->duration)
     143    {
     144      this->localTime = 0;
     145      this->currentKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
     146      this->nextKeyFrame = this->keyFrameList->nextElement(this->nextKeyFrame);
     147      printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value);
     148
     149
     150    }
     151
     152  (this->object->*(funcToAnim))((this->*animFunc)(this->localTime));
    140153}
    141154
Note: See TracChangeset for help on using the changeset viewer.