Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 26, 2005, 3:16:28 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: animatin3d changed linear mov mode to shiftCoor implementation

File:
1 edited

Legend:

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

    r3980 r3981  
    117117
    118118  tmpKeyFrame->position = position;
     119  //tmpKeyFrame->lastPosition = position;
    119120  tmpKeyFrame->direction = direction;
    120121  tmpKeyFrame->duration = duration;
     
    170171    case ANIM_LINEAR:
    171172      this->animFuncMov = &Animation3D::mLinear;
     173      this->object->setRelCoor(this->currentKeyFrame->position);
     174      this->currentKeyFrame->lastPosition = Vector();
    172175      break;
    173176    case ANIM_SINE:
     
    219222void Animation3D::mLinear(float timePassed) const
    220223{
    221   this->object->setRelCoor(this->currentKeyFrame->position +
    222                           (this->nextKeyFrame->position - this->currentKeyFrame->position) *
    223                           (timePassed/this->currentKeyFrame->duration));
     224  Vector v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * (timePassed/this->currentKeyFrame->duration);
     225  this->object->shiftCoor(v - this->currentKeyFrame->lastPosition);
     226  this->currentKeyFrame->lastPosition = v;
    224227}
    225228
Note: See TracChangeset for help on using the changeset viewer.