Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3729 in orxonox.OLD for orxonox/trunk/src/simple_animation.cc


Ignore:
Timestamp:
Apr 5, 2005, 11:51:15 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: simple animation is moving, but not realy what it should

File:
1 edited

Legend:

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

    r3727 r3729  
    1919#include "simple_animation.h"
    2020#include "stdincl.h"
    21 #include "p_node.h"
    2221#include "vector.h"
     22#include "world_entity.h"
    2323
    2424using namespace std;
     
    5151
    5252   this->tmpVect = new Vector();
     53   this->lastPosition = new Vector();
    5354}
    5455
     
    7879   will be closed with AnimatiorEnd()
    7980*/
    80 void SimpleAnimation::AnimatorBegin()
     81void SimpleAnimation::animatorBegin()
    8182{
    8283  this->bDescriptive = true;
     
    9091   will be closed with AnimatiorEnd()
    9192*/
    92 void SimpleAnimation::AnimatorEnd()
     93void SimpleAnimation::animatorEnd()
    9394{
    9495  this->workingObject = NULL;
     
    111112   \brief adds a keyframe with properties
    112113   \param the point of the object
    113    \param and the orientation of it
     114   \param and the direction of it
    114115   \param at this time
    115116*/
    116 void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* orientation, float time)
     117void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* direction, float time)
    117118{
    118119  if( !this->bDescriptive)
     
    123124  KeyFrame* frame = new KeyFrame;
    124125  frame->position = point;
    125   frame->orientation = orientation;
     126  frame->direction = direction;
    126127  frame->time = time;
    127128  frame->mode = DEFAULT_ANIMATION_MODE;
     
    134135   \brief adds a keyframe with properties
    135136   \param the point of the object
    136    \param and the orientation of it
     137   \param and the direction of it
    137138   \param at this time
    138139   \param function of the velocity of the movement
    139140*/
    140 void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* orientation, float time, movementMode mode)
     141void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* direction, float time, movementMode mode)
    141142{
    142143  if( !this->bDescriptive)
     
    147148  KeyFrame* frame = new KeyFrame;
    148149  frame->position = point;
    149   frame->orientation = orientation;
     150  frame->direction = direction;
    150151  frame->time = time;
    151152  frame->mode = mode;
     
    259260  while( this->localTime > this->currentFrame->time)
    260261    {
    261       printf("SimpleAnimation::tick(...) - changing Frame");
     262      printf("SimpleAnimation::tick(...) - changing Frame\n");
     263      this->localTime -= this->currentFrame->time;
     264
     265      this->lastPosition = this->currentFrame->position;
    262266      this->lastFrame = this->currentFrame;
    263267      this->currentFrame = this->frames->nextElement(this->currentFrame);
    264       this->localTime -= this->currentFrame->time;
    265268    }
    266269 
     
    273276      *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
    274277      *this->tmpVect = *this->tmpVect * this->localTime / this->currentFrame->time;
    275       //this->setAbsCoordinate(this->tmpVect);
     278      this->currentFrame->object->shiftCoor(*this->tmpVect - *this->lastPosition);
     279      *this->lastPosition = *this->tmpVect;
    276280      break;
    277281    case EXP:
Note: See TracChangeset for help on using the changeset viewer.