Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Apr 7, 2005, 10:13:42 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: weapon now works perfectly: it shoots and moves to it. now i will have to change the projectile model itself….

File:
1 edited

Legend:

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

    r3744 r3752  
    7373  delete iterator;
    7474  delete this->frames;
     75  singletonRef = NULL;
    7576}
    7677
     
    118119void SimpleAnimation::selectObject(WorldEntity* entity)
    119120{
    120   printf("SimpleAnimation::selectObject() - selecing active object\n");
    121121  Animation* anim = getAnimationFromWorldEntity(entity);
    122122  if( anim == NULL)
    123123    {
    124       printf("SimpleAnimation::selectObject() - object not found, creating one\n");
    125124      anim = new Animation;
    126125      anim->object = entity;
     
    128127      anim->tmpVect = new Vector();
    129128      anim->frames = new tList<KeyFrame>();
     129      anim->animMode = LOOP;
    130130      bRunning = false;
    131131      deltaT = 0.0;
    132132      this->animators->add(anim);
    133133    }
    134   else
    135     printf("SimpleAnimation::selectObject() - animation already existent, using it\n");
    136134  this->workingAnimator = anim;
    137   printf("SimpleAnimation::selectObject() - selection completed\n");
    138135}
    139136
     
    203200}
    204201
     202
     203void SimpleAnimation::setAnimationMode(animationMode mode)
     204{
     205  if( !this->bDescriptive || this->workingAnimator == NULL)
     206    {
     207      PRINTF(1)("SimpleAnimation: executing animation code outside a AnimationBegin()/AnimationEnd() - ignoring\n");
     208      return;
     209    }
     210  this->workingAnimator->animMode = mode;
     211}
    205212
    206213/**
     
    323330              anim->lastFrame = anim->currentFrame;
    324331              anim->currentFrame = anim->frames->nextElement(anim->currentFrame);
     332              if( anim->currentFrame == anim->frames->firstElement() && anim->animMode == SINGLE)
     333                {
     334                  anim->bRunning = false;
     335                  return;
     336                }
    325337              anim->movMode = anim->currentFrame->mode;
    326338              if( anim->movMode == NEG_EXP)
     
    335347            {
    336348            case LINEAR:
    337              
    338349              *anim->tmpVect = *anim->currentFrame->position - *anim->lastFrame->position;
    339350              *anim->tmpVect = *anim->tmpVect * anim->localTime / anim->currentFrame->time;
Note: See TracChangeset for help on using the changeset viewer.