Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3976 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Apr 26, 2005, 2:05:36 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: implemented cosine rotation function. still looks wicked

Location:
orxonox/trunk/src
Files:
2 edited

Legend:

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

    r3975 r3976  
    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_SINE);
    480             animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_LINEAR, ANIM_SINE);
    481             animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_LINEAR, ANIM_SINE);
     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);
    482482
    483483            //animation->addKeyFrame(Vector(0, 0, 0), Quaternion(), 1.0, ANIM_LINEAR);
  • orxonox/trunk/src/util/animation/animation3d.cc

    r3975 r3976  
    394394void Animation3D::rCosine(float timePassed) const
    395395{
     396  float scale = cos(M_PI * timePassed / this->currentKeyFrame->duration);
     397  this->object->setRelDir(quatSlerp( this->nextKeyFrame->direction,
     398                                     this->currentKeyFrame->direction,
     399                                     scale) );
    396400}
    397401
Note: See TracChangeset for help on using the changeset viewer.