Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Apr 26, 2005, 12:38:20 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: fixed two major bugs in the animation3d framework (addKeyFrame, tick issues), added shoot animation again. one of both animation is still placed at the wrong place, since the weapons are not symmetrical

File:
1 edited

Legend:

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

    r3985 r3986  
    4646  this->animFuncMov = &Animation3D::mLinear;
    4747  this->animFuncRot = &Animation3D::rLinear;
     48
     49  this->bRunning = false;
    4850}
    4951
     
    172174  switch (animFuncMov)
    173175    {
    174     default:
    175176    case ANIM_CONSTANT:
    176177      this->animFuncMov = &Animation3D::mConstant;
     
    197198      this->animFuncMov = &Animation3D::mNegExp;
    198199      this->expFactorMov = -1.0 / this->currentKeyFrame->duration * logf(DELTA_X_3D);
     200      this->currentKeyFrame->lastPosition = Vector();
    199201      break;
    200202    case ANIM_QUADRATIC:
     
    204206      this->animFuncMov = &Animation3D::mRandom;
    205207      break;
     208    default:
     209      break;
    206210    }
    207211}
     
    215219void Animation3D::mConstant(float timePassed) const
    216220{
    217   this->object->setRelCoor(this->currentKeyFrame->position);
     221  //this->object->setRelCoor(this->currentKeyFrame->position);
    218222
    219223  /*
     
    296300void Animation3D::mNegExp(float timePassed) const
    297301{
     302  Vector v;
     303  v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * (1.0 - expf(- timePassed * expFactorMov));
     304  this->object->shiftCoor(v - this->currentKeyFrame->lastPosition);
     305  this->currentKeyFrame->lastPosition = v;
     306
     307  /*
    298308  this->object->setRelCoor( this->currentKeyFrame->position +
    299309                            (this->nextKeyFrame->position - this->currentKeyFrame->position) *
    300310                            (1.0 - expf(- timePassed * expFactorMov)) );
     311  */
    301312}
    302313
     
    320331void Animation3D::mRandom(float timePassed) const
    321332{
     333  /*
    322334  this->object->setRelCoor(this->currentKeyFrame->position +
    323335                           (this->nextKeyFrame->position - this->currentKeyFrame->position) * (float)rand()/(float)RAND_MAX);
    324336  this->object->setRelDir(this->currentKeyFrame->direction +
    325337                          (this->nextKeyFrame->direction - this->currentKeyFrame->direction)* (float)rand()/(float)RAND_MAX);
     338  */
    326339}
    327340
     
    338351  switch (animFuncRot)
    339352    {
    340    default:
     353    default:
    341354    case ANIM_CONSTANT:
    342355      this->animFuncRot = &Animation3D::rConstant;
     356      printf("a;sdlfkja;lskdjf;alskjdf;lasjdf;lasjdf;lasjdf;lajsdf\n");
    343357      break;
    344358    case ANIM_LINEAR:
     
    364378      this->animFuncRot = &Animation3D::rRandom;
    365379      break;
     380
    366381    }
    367382}
Note: See TracChangeset for help on using the changeset viewer.