Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8816 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 27, 2006, 12:48:57 AM (18 years ago)
Author:
patrick
Message:

spl: generic npc walking function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/world_entities/npcs/generic_npc.cc

    r8815 r8816  
    148148
    149149  // check if this is the current goal
    150   if( this->destCoor != destCoor && this->destDir != destDir)
     150  if( this->destCoor != destCoor || this->destDir != destDir)
    151151  {
    152152    this->destCoor = destCoor;
     
    159159
    160160    this->currentAnim = new Animation3D(this);
    161     this->currentAnim->addKeyFrame(this->getAbsCoor(), this->getAbsDir(), 0.0f);
    162     this->currentAnim->addKeyFrame(this->destCoor, this->destDir, time);
     161    this->currentAnim->addKeyFrame(this->getAbsCoor(), this->getAbsDir(), 0.1f, ANIM_LINEAR, ANIM_LINEAR);
     162    this->currentAnim->addKeyFrame(this->destCoor, this->destDir, time, ANIM_LINEAR, ANIM_LINEAR);
     163
     164    this->currentAnim->setInfinity(ANIM_INF_CONSTANT);
     165    this->currentAnim->play();
    163166
    164167    this->setAnimation(RUN, MD2_ANIM_LOOP);
     
    183186{
    184187  Quaternion q = this->getAbsDir();
    185  
     188
    186189  printf("%s moving to %f, %f, %f \n",this->getName(),x,y,z);
    187190
     
    336339  if( likely(this->getModel(0) != NULL))
    337340    ((InteractiveModel*)this->getModel(0))->tick(time);
     341
     342  // tick this animation
     343  if( this->currentAnim != NULL)
     344    this->currentAnim->tick(time);
    338345}
    339346
Note: See TracChangeset for help on using the changeset viewer.