Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3977 in orxonox.OLD


Ignore:
Timestamp:
Apr 26, 2005, 2:11:29 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: implemented neg_exp rotation also now

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/story_entities/world.cc

    r3976 r3977  
    477477            animation->setInfinity(ANIM_INF_REPLAY);
    478478
    479             animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_LINEAR, ANIM_COSINE);
    480             animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_LINEAR, ANIM_COSINE);
    481             animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_LINEAR, ANIM_COSINE);
     479            animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_LINEAR, ANIM_NEG_EXP);
     480            animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_LINEAR, ANIM_NEG_EXP);
     481            animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_LINEAR, ANIM_NEG_EXP);
    482482
    483483            //animation->addKeyFrame(Vector(0, 0, 0), Quaternion(), 1.0, ANIM_LINEAR);
  • orxonox/trunk/src/util/animation/animation3d.cc

    r3976 r3977  
    174174    case ANIM_NEG_EXP:
    175175      this->animFuncMov = &Animation3D::mNegExp;
    176       this->expFactor = -1.0 / this->currentKeyFrame->duration * logf(DELTA_X_3D);
     176      this->expFactorMov = -1.0 / this->currentKeyFrame->duration * logf(DELTA_X_3D);
    177177      break;
    178178    case ANIM_QUADRATIC:
     
    252252
    253253
    254 /*
    255  return ((this->nextKeyFrame->value + this->currentKeyFrame->value) +
    256     (this->currentKeyFrame->value - this->nextKeyFrame->value) *
    257     cos( M_PI * timePassed / this->currentKeyFrame->duration))/2;
    258 */
    259254
    260255/**
     
    276271  this->object->setRelCoor( this->currentKeyFrame->position +
    277272                            (this->nextKeyFrame->position - this->currentKeyFrame->position) *
    278                             (1.0 - expf(- timePassed * expFactor)) );
     273                            (1.0 - expf(- timePassed * expFactorMov)) );
    279274}
    280275
     
    334329    case ANIM_NEG_EXP:
    335330      this->animFuncRot = &Animation3D::rNegExp;
     331      this->expFactorRot = -1.0 / this->currentKeyFrame->duration * logf(DELTA_X_3D);
    336332      break;
    337333    case ANIM_QUADRATIC:
     
    351347void Animation3D::rConstant(float timePassed) const
    352348{
     349  this->object->setRelDir(this->currentKeyFrame->direction);
    353350}
    354351
     
    401398
    402399
    403 /*
    404  return ((this->nextKeyFrame->value + this->currentKeyFrame->value) +
    405     (this->currentKeyFrame->value - this->nextKeyFrame->value) *
    406     cos( M_PI * timePassed / this->currentKeyFrame->duration))/2;
    407 */
    408400
    409401/**
     
    422414void Animation3D::rNegExp(float timePassed) const
    423415{
     416  float scale = (1.0 - expf(- timePassed * expFactorRot));
     417  this->object->setRelDir(quatSlerp( this->nextKeyFrame->direction,
     418                                     this->currentKeyFrame->direction,
     419                                     scale) );
    424420}
    425421
  • orxonox/trunk/src/util/animation/animation3d.h

    r3973 r3977  
    7373  Vector tmpVect;        //!< what for??
    7474  float deltaT;          //!< ??
    75   float expFactor;
     75  float expFactorMov;
     76  float expFactorRot;
    7677};
Note: See TracChangeset for help on using the changeset viewer.