Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3855 in orxonox.OLD for orxonox/trunk/src/world_entities/test_gun.cc


Ignore:
Timestamp:
Apr 17, 2005, 2:46:27 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: animation of weapon reimplemented (but only with Linear interpolation.
doxy-tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/test_gun.cc

    r3852 r3855  
    5454
    5555  this->dummy1 = new WorldEntity(); // a world entity that is not drawed: use this for the weapon
    56   this->animaton = new Animation3D(dummy1);
    57 
     56  this->animation = new Animation3D(dummy1);
     57
     58  parent->addChild(this->dummy1, PNODE_ALL);
     59
     60  this->animation->setInfinity(ANIM_INF_CONSTANT);
     61  // ANIM_LINEAR was ANIM_NEG_EXP
     62  if( this->leftRight == 0)
     63    {
     64      this->animation->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR);
     65      this->animation->addKeyFrame(Vector(-3.0, 0.1, 3.0), Quaternion(), 0.5, ANIM_LINEAR);
     66      this->animation->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR);
     67    }
     68  else if( this->leftRight == 1)
     69    {
     70      this->animation->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_LINEAR);
     71      this->animation->addKeyFrame(Vector(-3.0, 0.1, -2.5), Quaternion(), 0.5, ANIM_LINEAR);
     72      this->animation->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_LINEAR);
     73    }
    5874  /*
    59   parent->addChild(this->dummy1, PNODE_ALL);
    60 
    61  
    62   this->animator->animatorBegin();
    63   this->animator->selectObject(this->dummy1);
    64   this->animator->setAnimationMode(SINGLE);
    65   if( this->leftRight == 0)
    66     {
    67       this->animator->addKeyFrame(new Vector(-2.6, 0.1, 3.0), new Quaternion(), 0.0, NEG_EXP);
    68       this->animator->addKeyFrame(new Vector(-3.0, 0.1, 3.0), new Quaternion(), 0.1, NEG_EXP);
    69       this->animator->addKeyFrame(new Vector(-2.6, 0.1, 3.0), new Quaternion(), 0.5, NEG_EXP);
    70     }
    71   else if( this->leftRight == 1)
    72     {
    73       this->animator->addKeyFrame(new Vector(-2.6, 0.1, -2.5), new Quaternion(), 0.0, NEG_EXP);
    74       this->animator->addKeyFrame(new Vector(-3.0, 0.1, -2.5), new Quaternion(), 0.1, NEG_EXP);
    75       this->animator->addKeyFrame(new Vector(-2.6, 0.1, -2.5), new Quaternion(), 0.5, NEG_EXP);
    76     }
    77   this->animator->animatorEnd();
     75  if( this->leftRight == 0)
     76    {
     77      this->animation->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.0, ANIM_NEG_EXP);
     78      this->animation->addKeyFrame(Vector(-3.0, 0.1, 3.0), Quaternion(), 0.1, ANIM_NEG_EXP);
     79      this->animation->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.5, ANIM_NEG_EXP);
     80    }
     81  else if( this->leftRight == 1)
     82    {
     83      this->animation->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.0, ANIM_NEG_EXP);
     84      this->animation->addKeyFrame(Vector(-3.0, 0.1, -2.5), Quaternion(), 0.1, ANIM_NEG_EXP);
     85      this->animation->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.5, ANIM_NEG_EXP);
     86    }
    7887  */
    7988}
     
    134143  this->localTime = 0;
    135144 
    136   /*
    137     this->animator->animatorBegin();
    138     this->animator->selectObject(this->dummy1);
    139     this->animator->start();
    140     this->animator->animatorEnd();
    141   */
     145  this->animation->replay();
    142146}
    143147
Note: See TracChangeset for help on using the changeset viewer.