Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3739 in orxonox.OLD


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

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

Location:
orxonox/trunk/src
Files:
4 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}
  • orxonox/trunk/src/simple_animation.h

    r3738 r3739  
    9898  Vector* tmpVect;                 //<! this is the temporary vector save place -
    9999  WorldEntity* workingObject;      //<! this is a pointer to the current working object that has been selected via selectObject()
    100   Animator* workingAnimator;       //<! the animator with which you are currently working
     100  Animation* workingAnimator;       //<! the animator with which you are currently working
    101101  float deltaT;                    //<! this is a time constant for the movement
     102
     103  Animation* getAnimationFromWorldEntity(WorldEntity* entity);
    102104
    103105};
  • orxonox/trunk/src/story_entities/world.cc

    r3734 r3739  
    472472
    473473            KeyFrame* f1 = new KeyFrame;
    474             f1->position = new Vector(20.0, 1.0, -1.0);
     474            f1->position = new Vector(-1.1, 0.0, 2.6);
    475475            f1->direction = new Quaternion();
    476             f1->time = 0.3;
     476            f1->time = 1.0;
    477477            f1->mode = NEG_EXP;
    478478
    479479
    480480            KeyFrame* f2 = new KeyFrame;
    481             f2->position = new Vector(10.0, 1.0, 5.0);
     481            f2->position = new Vector(-2.1, 0.0, 2.6);
    482482            f2->direction = new Quaternion();
    483             f2->time = 0.5;
     483            f2->time = 0.1;
    484484            f2->mode = NEG_EXP;
    485485
    486486            KeyFrame* f3 = new KeyFrame;
    487             f3->position = new Vector(5.0, 2.0, -1.0);
     487            f3->position = new Vector(-1.1, 0.0, 2.6);
    488488            f3->direction = new Quaternion();
    489             f3->time = 0.5;
     489            f3->time = 0.2;
    490490            f3->mode = NEG_EXP;
    491491
     
    495495            this->simpleAnimation->addKeyFrame(f1);
    496496            this->simpleAnimation->addKeyFrame(f2);
    497             this->simpleAnimation->addKeyFrame(f3);
     497            //this->simpleAnimation->addKeyFrame(f3);
    498498            //this->simpleAnimation->addKeyFrame(f2);
    499499            this->simpleAnimation->animatorEnd();
  • orxonox/trunk/src/world_entities/environment.cc

    r3729 r3739  
    2929Environment::Environment () : WorldEntity()
    3030{
    31   this->model = (Model*) ResourceManager::getInstance()->load("sphere", RP_LEVEL);
     31  this->model = (Model*) ResourceManager::getInstance()->load("cube", RP_LEVEL);
    3232  //  this->model = new OBJModel("../data/models/fighter.obj");
    3333}
Note: See TracChangeset for help on using the changeset viewer.