Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3731 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Apr 6, 2005, 12:44:49 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: animation player now works for two keyframes.

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

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

    r3678 r3731  
    723723      printf(" Removing 1st reference from list:\t%11.2f\n", mi);
    724724     
    725      
     725
     726      printf("\nList operations tests: \t\t\t\t\t%i\n", LIST_MAX);
     727      list = new tList<char>();
     728      printf(" Adding[1..10] elements to list, found:\n");
     729      list->add("1");
     730      list->add("2");
     731      list->add("3");
     732      list->add("4");
     733      list->add("5");
     734      list->add("6");
     735      list->add("7");
     736      list->add("8");
     737      list->add("9");
     738      list->add("10");
     739     
     740      /*give list out */
     741      iterator = list->getIterator();
     742      name = iterator->nextElement();
     743      printf("  List Elements: \t\t");
     744      while( name != NULL)
     745        {
     746          printf("%s,", name);
     747          name = iterator->nextElement();
     748        }
     749      delete iterator;
     750      printf("\n");
     751     
     752     
     753      int c = 0;
     754      printf(" Going trough list with nextElement(el) func: ");
     755      name = list->firstElement();
     756      while(c < 20)
     757        {
     758          printf("%s,", name);
     759          name = list->nextElement(name);
     760          c++;
     761        }
     762      printf("\n");
     763     
     764
    726765     
    727766    }
  • orxonox/trunk/src/simple_animation.cc

    r3730 r3731  
    275275    case LINEAR:
    276276
    277       *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
     277      *this->tmpVect = *this->lastFrame->position - *this->currentFrame->position;
    278278      *this->tmpVect = *this->tmpVect * this->localTime / this->currentFrame->time;
    279       this->currentFrame->object->shiftCoor(*this->tmpVect - *this->lastPosition);
     279      //this->currentFrame->object->shiftCoor(*this->tmpVect - *this->lastPosition);
     280      this->currentFrame->object->setRelCoor(*this->currentFrame->position + *this->tmpVect);
    280281      *this->lastPosition = *this->tmpVect;
     282      //printf("shift vector: ");this->lastPosition->debug();
    281283      break;
    282284    case EXP:
  • orxonox/trunk/src/story_entities/world.cc

    r3730 r3731  
    443443
    444444
     445            /*
    445446            WorldEntity* a = new Environment();
    446447            this->localPlayer->addChild(a);
    447448            a->setRelCoor(new Vector(10.0, 2.0, 1.0));
    448449            this->spawn(a);
    449 
     450            */
    450451
    451452            WorldEntity* b = new Environment();
     
    454455            this->spawn(b);
    455456
     457            /*
    456458            WorldEntity* c = new Environment();
    457459            this->localPlayer->addChild(c);
    458460            c->setRelCoor(new Vector(10.0, 2.0, -1.0));
    459461            this->spawn(c);
    460 
     462            */
    461463           
    462464            this->simpleAnimation = SimpleAnimation::getInstance();
     
    482484            f2->mode = LINEAR;
    483485
     486            KeyFrame* f3 = new KeyFrame;
     487            f3->position = new Vector(10.0, 0.0, -1.0);
     488            f3->direction = new Quaternion();
     489            f3->time = 1.0;
     490            f3->mode = LINEAR;
     491
     492
    484493            this->simpleAnimation->animatorBegin();
    485494            this->simpleAnimation->selectObject(b);
    486495            this->simpleAnimation->addKeyFrame(f1);
    487496            this->simpleAnimation->addKeyFrame(f2);
     497            //this->simpleAnimation->addKeyFrame(f3);
     498            //this->simpleAnimation->addKeyFrame(f2);
    488499            this->simpleAnimation->animatorEnd();
    489500
Note: See TracChangeset for help on using the changeset viewer.