Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3980 in orxonox.OLD for orxonox


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

orxonox/trunk: started to implement the weapon change animation

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

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

    r3977 r3980  
    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_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);
     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);
    482482
    483483            //animation->addKeyFrame(Vector(0, 0, 0), Quaternion(), 1.0, ANIM_LINEAR);
  • orxonox/trunk/src/util/animation/animation3d.cc

    r3979 r3980  
    1515   2005-04-17: Benjamin Grauer
    1616          Rewritte all functions, so it will fit into the Animation-class
     17   2005-04-25: Patrick Boenzli
     18          Extended the framework to support quatSlerp rotations. Each frame now supports diff mov/rot types. Implemented mov/rot functions
    1719*/
    1820
     
    220222                          (this->nextKeyFrame->position - this->currentKeyFrame->position) *
    221223                          (timePassed/this->currentKeyFrame->duration));
    222 
    223   this->object->setRelDir(quatSlerp( this->nextKeyFrame->direction,
    224                                      this->currentKeyFrame->direction,
    225                                      timePassed/this->currentKeyFrame->duration) );
    226 
    227224}
    228225
     
    411408void Animation3D::rExp(float timePassed) const
    412409{
    413 
     410  PRINTF(0)("exp rotation function not implemented\n");
    414411}
    415412
     
    435432void Animation3D::rQuadratic(float timePassed) const
    436433{
     434  PRINTF(0)("quadratic rotation alg not implemented\n");
    437435}
    438436
     
    443441void Animation3D::rRandom(float timePassed) const
    444442{
    445 }
     443  PRINTF(0)("random rotation alg not implemented\n");
     444}
  • orxonox/trunk/src/world_entities/player.cc

    r3966 r3980  
    5252  //weapons:
    5353  this->weaponMan = new WeaponManager();
    54   Weapon* wpRight = new TestGun(this,Vector(-2.6, 0.1, 3.0), Quaternion(), 0);
     54  Weapon* wpRight = new TestGun(this, Vector(-2.6, 0.1, 3.0), Quaternion(), 0);
    5555  Weapon* wpLeft = new TestGun(this, Vector(-2.6, 0.1, -3.0), Quaternion(), 1);
    5656 
  • orxonox/trunk/src/world_entities/test_gun.cc

    r3888 r3980  
    4949  this->objectComponent1 = new PNode();
    5050  this->animation1 = new Animation3D(this->objectComponent1);
     51  //this->animation2 = new Animation3D(this);
    5152  parent->addChild(this->objectComponent1, PNODE_ALL);
    5253
    5354  this->animation1->setInfinity(ANIM_INF_CONSTANT);
    54   // ANIM_LINEAR was ANIM_NEG_EXP
     55  //this->animation2->setInfinity(ANIM_INF_CONSTANT);
    5556  if( this->leftRight == W_LEFT)
    5657    {
     
    6061      this->animation1->addKeyFrame(Vector(-3.0, 0.1, 3.0), Quaternion(), 0.5, ANIM_LINEAR);
    6162      this->animation1->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR);
     63
     64      //this->animation2->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_LINEAR);
     65      //this->animation2->addKeyFrame(Vector(-2.6, 0.1, 1.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_LINEAR);
    6266    }
    6367  else if( this->leftRight == W_RIGHT)
     
    6569      this->projectileOffset = Vector(1.0, 0.0, 0.5);
    6670
    67       this->animation1->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_LINEAR);
    68       this->animation1->addKeyFrame(Vector(-3.0, 0.1, -2.5), Quaternion(), 0.5, ANIM_LINEAR);
    69       this->animation1->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_LINEAR);
     71      this->animation1->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_NEG_EXP);
     72      this->animation1->addKeyFrame(Vector(-3.0, 0.1, -2.5), Quaternion(), 0.5, ANIM_NEG_EXP);
     73      this->animation1->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_NEG_EXP);
    7074    }
    7175}
     
    8993*/
    9094void TestGun::activate()
    91 {}
     95{
     96  printf("ACTIVATE \n");
     97  this->animation2->replay();
     98}
    9299
    93100
     
    100107*/
    101108void TestGun::deactivate()
    102 {}
     109{
     110  printf("DEACTIVATE\n");
     111}
    103112
    104113
Note: See TracChangeset for help on using the changeset viewer.