Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3729 in orxonox.OLD for orxonox/trunk/src/story_entities/world.cc


Ignore:
Timestamp:
Apr 5, 2005, 11:51:15 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: simple animation is moving, but not realy what it should

File:
1 edited

Legend:

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

    r3727 r3729  
    3535#include "track_manager.h"
    3636#include "garbage_collector.h"
     37#include "simple_animation.h"
    3738
    3839#include "command_node.h"
     
    155156  delete this->lightMan;
    156157  delete this->trackManager;
     158
     159  //delete garbagecollecor
     160  //delete animator
    157161}
    158162
     
    188192  wi->init(this);
    189193  this->garbageCollector = GarbageCollector::getInstance();
     194  this->simpleAnimation = SimpleAnimation::getInstance();
    190195}
    191196
     
    394399        case DEBUG_WORLD_2:
    395400          {
     401            lightMan->setAmbientColor(.1,.1,.1);
     402            lightMan->addLight();
    396403            lightMan->setPosition(-5.0, 10.0, -40.0);
    397404            this->nullParent = NullParent::getInstance ();
     
    434441            this->glmis->step();
    435442
    436            
    437             WorldEntity* env = new Environment();
    438             env->setName ("env");
    439             this->spawn(env);
    440 
     443
     444            WorldEntity* a = new Environment();
     445            this->spawn(a, new Vector(200.0, -35.0, 5.0), new Quaternion());
     446
     447            WorldEntity* b = new Environment();
     448            this->localPlayer->addChild(b);
     449            b->setRelCoor(new Vector(10.0, 0.0, 0.0));
     450            this->spawn(b);
    441451           
     452            this->simpleAnimation = SimpleAnimation::getInstance();
     453
     454            /*
     455              frame->position = point;
     456              frame->orientation = orientation;
     457              frame->time = time;
     458              frame->mode = DEFAULT_ANIMATION_MODE;
     459            */
     460
     461            KeyFrame* f1 = new KeyFrame;
     462            f1->position = new Vector(10.0, 1.0, 1.0);
     463            f1->direction = new Quaternion();
     464            f1->time = 1.0;
     465            f1->mode = LINEAR;
     466
     467
     468            KeyFrame* f2 = new KeyFrame;
     469            f2->position = new Vector(10.0, 1.0, -1.0);
     470            f2->direction = new Quaternion();
     471            f2->time = 1.0;
     472            f2->mode = LINEAR;
     473
     474            this->simpleAnimation->animatorBegin();
     475            this->simpleAnimation->selectObject(b);
     476            this->simpleAnimation->addKeyFrame(f1);
     477            this->simpleAnimation->addKeyFrame(f2);
     478            this->simpleAnimation->animatorEnd();
     479
     480            this->simpleAnimation->start();
     481
    442482            /*
    443483            Vector* es = new Vector (10, 5, 0);
     
    850890      this->localCamera->tick(this->dt);
    851891      this->garbageCollector->tick(seconds);
     892      this->simpleAnimation->tick(seconds);
    852893    }
    853894  this->lastFrame = currentFrame;
Note: See TracChangeset for help on using the changeset viewer.