Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 11, 2005, 12:55:48 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: setClassID implemented in all files

File:
1 edited

Legend:

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

    r4479 r4597  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    2727using namespace std;
    2828
    29 
    3029/**
    3130   \brief standard constructor
     
    3332QuickAnimation::QuickAnimation (void)
    3433{
    35    this->setClassName("QuickAnimation");
     34   this->setClassID(CL_QUICK_ANIMATION, "QuickAnimation");
    3635
    3736   this->first = this->current = NULL;
     
    4746  this->current = this->first;
    4847  QuickKeyFrame delKF;
    49  
     48
    5049  while (this->current != NULL)
    5150    {
     
    5453      this->current = this->first;
    5554    }
    56 
    5755}
    5856
     
    7068      // if it is between some keyframes
    7169      if ((!this->current->next && this->current->position < position)
    72           || (this->current->position < position && this->current->next->position > position))
    73         break;
     70          || (this->current->position < position && this->current->next->position > position))
     71        break;
    7472      // if it is the same as an already existing keyframe
    7573      else if (this->current->position == position)
    76         return false;
     74        return false;
    7775      this->current = this->current->next;
    7876    }
     
    9290  newKey->value = value;
    9391  newKey->position = position;
    94  
     92
    9593  this->current = this->first;
    9694
     
    110108    {
    111109      if (this->current->position < position+region && this->current->position > position-region)
    112         {
    113           this->current->value = value;
    114           return true;
    115         }
    116       this->current = this->current->next; 
     110        {
     111          this->current->value = value;
     112          return true;
     113        }
     114      this->current = this->current->next;
    117115    }
    118116  this->current = this->first;
     
    122120/*
    123121  \param position The position where to find the Node to kill
    124  
     122
    125123  bool QuickAnimation::removeEntry(float position)
    126124  {
    127125  this->current = this->first;
    128   QuickKeyFrame* last = 
    129  
     126  QuickKeyFrame* last =
     127
    130128  while (this->current)
    131129  {
    132130  if (this->current->position == position)
    133131  {
    134  
    135  
     132
     133
    136134  }
    137   this->current = this->current->next; 
     135  this->current = this->current->next;
    138136  }
    139137  this->current = this->first;
     
    145143   \param position the position to get the value from :)
    146144*/
    147 float QuickAnimation::getValue(float position) 
     145float QuickAnimation::getValue(float position)
    148146{
    149147  if (unlikely(this->first == NULL))
     
    154152    {
    155153      if (unlikely(position < this->current->position))
    156         {
    157           if (position <= this->first->position)
    158             return this->first->value;
    159           this->current = this->first;
    160         }
     154        {
     155          if (position <= this->first->position)
     156            return this->first->value;
     157          this->current = this->first;
     158        }
    161159      while (likely(this->current->next != NULL && position > this->current->next->position))
    162         this->current = this->current->next;
     160        this->current = this->current->next;
    163161      if (this->current->next == NULL)
    164         return this->current->value;
    165                
     162        return this->current->value;
     163
    166164      return this->current->value + (this->current->next->value - this->current->value)
    167         * ((position-this->current->position) / (this->current->next->position -this->current->position));
     165        * ((position-this->current->position) / (this->current->next->position -this->current->position));
    168166    }
    169167}
Note: See TracChangeset for help on using the changeset viewer.