Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3739 in orxonox.OLD for orxonox/trunk/src/simple_animation.cc


Ignore:
Timestamp:
Apr 7, 2005, 12:33:01 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: worked on simpleanimation - not yet done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/simple_animation.cc

    r3738 r3739  
    101101
    102102
     103/*
     104  Vector* lastPosition;
     105  Vector* tmpVect;
     106  tList<KeyFrame>* frames;
     107  animationMode animMode;
     108  movementMode movMode;
     109  bool bRunning;
     110  float deltaT;
     111*/
     112
    103113/**
    104114   \brief select an object to work on by using this function
     
    107117void SimpleAnimation::selectObject(WorldEntity* entity)
    108118{
    109   this->workingObject = entity;
     119  Animation* anim = getAnimationFromWorldEntity(entity);
     120  if( anim == NULL)
     121    {
     122      printf("SimpleAnimation::selectObject() - object not found, creating one\n");
     123      anim = new Animation;
     124      anim->object = entity;
     125      anim->lastPosition = new Vector();
     126      anim->tmpVect = new Vector();
     127      frames = new tList<KeyFrame>();
     128      bRunning = false;
     129      deltaT = 0.0;
     130      this->animators->add(anim);
     131    }
     132  this->workingAnimator = anim;
    110133}
    111134
     
    323346  delete anim;
    324347}
     348
     349
     350
     351Animation* SimpleAnimation::getAnimationFromWorldEntity(WorldEntity* entity)
     352{
     353  tIterator<Animation>* iterator = this->animators->getIterator();
     354  Animation* anim = iterator->nextElement();
     355  while( anim != NULL)
     356    {
     357      if( anim->object == entity)
     358        return anim;
     359      anim = iterator->nextElement();
     360    }
     361  delete iterator;
     362  return NULL;
     363}
Note: See TracChangeset for help on using the changeset viewer.