Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3733 in orxonox.OLD


Ignore:
Timestamp:
Apr 6, 2005, 11:24:17 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: SimpleAnimation - the NEG_EXP function works also now.

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

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

    r3732 r3733  
    5252   this->tmpVect = new Vector();
    5353   this->lastPosition = new Vector();
     54   this->deltaT = 0.2;
    5455}
    5556
     
    269270      this->currentFrame = this->frames->nextElement(this->currentFrame);
    270271      this->mode = this->currentFrame->mode;
     272      if( this->mode == NEG_EXP)
     273        {
     274          *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
     275          deltaT = 1/this->currentFrame->time * logf(1.0 + 100.0/this->tmpVect->len());
     276        }
    271277    }
    272278
     
    286292    case NEG_EXP:
    287293      *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
    288       *this->tmpVect = *this->tmpVect * (1 - exp(- this->localTime / this->currentFrame->time));     
     294      *this->tmpVect = *this->tmpVect * (1 - exp(- this->localTime * this->deltaT));     
    289295      this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect);
    290296      *this->lastPosition = *this->tmpVect;
  • orxonox/trunk/src/simple_animation.h

    r3729 r3733  
    6767
    6868  static SimpleAnimation* singletonRef;
     69  bool bDescriptive;               //<! is true, when AnimatorBegin() was executed but no AnimatorEnd() yet: in describtive mode: pass commands
    6970  bool bRunning;                   //<! is set, when the animation is running
    7071  tList<KeyFrame>* frames;         //<! where keyframes are stored in
     
    7879  Vector* tmpVect;                 //<! this is the temporary vector save place -
    7980  WorldEntity* workingObject;      //<! this is a pointer to the current working object that has been selected via selectObject()
    80   bool bDescriptive;               //<! is true, when AnimatorBegin() was executed but no AnimatorEnd() yet: in describtive mode: pass commands
     81  float deltaT;                    //<! this is a time constant for the movement
     82
    8183};
    8284
  • orxonox/trunk/src/story_entities/world.cc

    r3732 r3733  
    474474            f1->position = new Vector(10.0, 1.0, -1.0);
    475475            f1->direction = new Quaternion();
    476             f1->time = 1.0;
    477             f1->mode = SIN;
     476            f1->time = 0.5;
     477            f1->mode = NEG_EXP;
    478478
    479479
     
    481481            f2->position = new Vector(10.0, 1.0, 1.0);
    482482            f2->direction = new Quaternion();
    483             f2->time = 1.0;
    484             f2->mode = SIN;
     483            f2->time = 0.5;
     484            f2->mode = NEG_EXP;
    485485
    486486            KeyFrame* f3 = new KeyFrame;
    487487            f3->position = new Vector(5.0, 1.0, -1.0);
    488488            f3->direction = new Quaternion();
    489             f3->time = 1.0;
    490             f3->mode = SIN;
     489            f3->time = 0.5;
     490            f3->mode = NEG_EXP;
    491491
    492492
Note: See TracChangeset for help on using the changeset viewer.