Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3720 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Apr 5, 2005, 1:07:47 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: now implemented the speed distribution algorithms

Location:
orxonox/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/simple_animation.cc

    r3719 r3720  
    2020#include "stdincl.h"
    2121#include "p_node.h"
     22#include "vector.h"
    2223
    2324using namespace std;
     
    104105   this->currentFrame = NULL;
    105106   this->lastFrame = NULL;
     107
     108   this->tmpVect = new Vector();
    106109}
    107110
     
    253256    {
    254257      printf("SimpleAnimation::tick(...) - changing Frame");
     258      this->lastFrame = this->currentFrame;
    255259      this->currentFrame = this->frames->nextElement(this->currentFrame);
    256260      this->localTime -= this->currentFrame->time;
     
    258262 
    259263 
    260 
    261264  /* now animate it */
    262265  switch( this->mode)
    263266    {
    264267    case LINEAR:
    265      
     268
     269      *this->tmpVect = this->currentFrame->getAbsCoor() - this->lastFrame->getAbsCoor();
     270      *this->tmpVect = *this->tmpVect * this->localTime / this->currentFrame->time;
     271      //this->setAbsCoordinate(this->tmpVect);
    266272      break;
    267273    case EXP:
     
    269275      break;
    270276    case NEG_EXP:
    271      
     277      *this->tmpVect = this->currentFrame->getAbsCoor() - this->lastFrame->getAbsCoor();
     278      *this->tmpVect = *this->tmpVect * (1 - exp(- this->localTime / this->currentFrame->time));     
    272279      break;
    273280    case SIN:
    274      
     281      *this->tmpVect = this->currentFrame->getAbsCoor() - this->lastFrame->getAbsCoor();
     282      *this->tmpVect = *this->tmpVect * (1 - cos(- this->localTime / this->currentFrame->time));     
    275283      break;
    276284    case COS:
     
    278286      break;
    279287    case QUADRATIC:
    280      
     288      *this->tmpVect = this->currentFrame->getAbsCoor() - this->lastFrame->getAbsCoor();     
     289      *this->tmpVect = *this->tmpVect * 1/3 * ldexpf(this->localTime, 3);
    281290      break;
    282291    default:
  • orxonox/trunk/src/simple_animation.h

    r3719 r3720  
    6969  PNode* parent;
    7070 
     71  Vector* tmpVect;                 //<! this is the temporary vector save place
    7172
    7273};
Note: See TracChangeset for help on using the changeset viewer.