Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4656 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jun 18, 2005, 7:09:19 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: minor quickAnim: changeEntry works again

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/particles/quick_animation.cc

    r4655 r4656  
    133133   \param value the new Value
    134134
     135   if the Entry at the in the region of the specified position is found, it will be changed.
     136    Otherwise a new KeyFrame will be created with value at position.
    135137   \todo rimplement
    136138*/
    137139void QuickAnimation::changeEntry(float position, float value, float region)
    138140{
    139 //   this->current = this->first;
    140 //   do
    141 //   {
    142 //     if (this->current->position < position+region && this->current->position > position-region)
    143 //     {
    144 //       this->current->value = value;
    145 //       return;
    146 //     }
    147 //     this->current = this->current->next;
    148 //   }  while (this->current != this->first);
    149 //
    150 //   this->current = this->first;
    151 
    152   this->addEntry(position, value);
     141
     142  if ((this->first->position > position + region) || this->first->prev->position < position - region || this->count == 0)
     143    this->addEntry(position, value);
     144  else
     145  {
     146    this->current = this->first;
     147    do
     148    {
     149      if (this->current->position > position + region)
     150      {
     151        this->addEntry(position, value);
     152        return;
     153      }
     154      if (this->current->position < position+region && this->current->position > position-region)
     155      {
     156        this->current->value = value;
     157        return;
     158      }
     159      this->current = this->current->next;
     160    }  while (this->current != this->first);
     161  }
    153162}
    154163
Note: See TracChangeset for help on using the changeset viewer.