Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 25, 2005, 11:45:57 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: implemented neg_exp function again. better than ever :)

File:
1 edited

Legend:

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

    r3876 r3964  
    134134          if( this->currentKeyFrame->animFunc == ANIM_NEG_EXP)
    135135            {
    136               this->tmpVect = this->nextKeyFrame->position - this->currentKeyFrame->position;
    137               this->deltaT = 1/this->currentKeyFrame->duration * logf(1.0 + 600.0/this->tmpVect.len());
     136
    138137            }
    139138        }
     
    206205    case ANIM_NEG_EXP:
    207206      this->animFunc = &Animation3D::negExp;
     207      //this->tmpVect = this->nextKeyFrame->position - this->currentKeyFrame->position;
     208      //this->deltaT = 1/this->currentKeyFrame->duration * logf(1.0 + 600.0/this->tmpVect.len());
     209      this->expFactor = -1.0 / this->currentKeyFrame->duration * logf(DELTA_X_3D);
     210        //(this->currentKeyFrame->position - this->nextKeyFrame->position)
     211
     212      /*
     213        float d = fabs(this->currentKeyFrame->value - this->nextKeyFrame->value);
     214        expFactor =  - 1.0 / this->currentKeyFrame->duration * logf(DELTA_X);
     215
     216      */
    208217      break;
    209218    case ANIM_QUADRATIC:
     
    284293void Animation3D::negExp(float timePassed) const
    285294{
    286   this->linear(timePassed);
    287 }
     295  this->object->setRelCoor( this->currentKeyFrame->position +
     296                            (this->nextKeyFrame->position - this->currentKeyFrame->position) *
     297                            (1.0 - expf(- timePassed * expFactor)) );
     298}
     299
     300/*
     301  float d = this->currentKeyFrame->value - this->nextKeyFrame->value;
     302  float e = d * (1.0 - expf(- timePassed * expFactor));
     303  return  this->currentKeyFrame->value - e;
     304*/
     305
    288306
    289307/**
Note: See TracChangeset for help on using the changeset viewer.