Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3981 in orxonox.OLD for orxonox/trunk/src/util/animation


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

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

Location:
orxonox/trunk/src/util/animation
Files:
2 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
  • orxonox/trunk/src/util/animation/animation3d.h

    r3979 r3981  
    1818  float duration;                   //!< The duration of this KeyFrame
    1919  Vector position;                  //!< The position of this KeyFrame
     20  Vector lastPosition;
    2021  Quaternion direction;             //!< The direction of this KeyFrame
    2122  ANIM_FUNCTION animFuncMov;        //!< with whitch function to iterate movement to the next KeyFrame3D
Note: See TracChangeset for help on using the changeset viewer.