Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Apr 26, 2005, 12:31:54 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: animation3d now ANIM_COSINE works also

File:
1 edited

Legend:

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

    r3965 r3967  
    271271
    272272
     273/**
     274   \brief a cosine interpolation between this keyframe and the next one
     275   \param timePassed The time passed since this Keyframe began
     276
     277   \todo implement
     278*/
     279void Animation3D::cosine(float timePassed) const
     280{
     281  this->object->setRelCoor( this->nextKeyFrame->position -
     282                            (this->nextKeyFrame->position - this->currentKeyFrame->position) *
     283                            (1.0 + cos( M_PI * timePassed / this->currentKeyFrame->duration))/2.0);
     284
     285}
     286
     287
    273288/*
    274   if (timePassed * 2.0 < this->currentKeyFrame->duration)
    275     return this->currentKeyFrame->value + (this->nextKeyFrame->value - this->currentKeyFrame->value)
    276       * sin( M_PI * timePassed / this->currentKeyFrame->duration)/2;
    277   else
    278     return this->nextKeyFrame->value - (this->nextKeyFrame->value - this->currentKeyFrame->value)
    279       * sin( M_PI * (1.0 - timePassed / this->currentKeyFrame->duration))/2;
    280 
    281 */
    282 
    283 /**
    284    \brief a cosine interpolation between this keyframe and the next one
    285    \param timePassed The time passed since this Keyframe began
    286 
    287    \todo implement
    288 */
    289 void Animation3D::cosine(float timePassed) const
    290 {
    291   this->linear(timePassed);
    292 }
     289 return ((this->nextKeyFrame->value + this->currentKeyFrame->value) +
     290    (this->currentKeyFrame->value - this->nextKeyFrame->value) *
     291    cos( M_PI * timePassed / this->currentKeyFrame->duration))/2;
     292*/
    293293
    294294/**
Note: See TracChangeset for help on using the changeset viewer.