Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3433 in orxonox.OLD for orxonox/trunk/src/world.cc


Ignore:
Timestamp:
Mar 1, 2005, 2:36:56 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: merged back the trackManager to the trunk.
merged with command:
svn merge -r 3369:HEAD branches/trackManager trunk
resolved conflicts in world.cc additive differences.

File:
1 edited

Legend:

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

    r3429 r3433  
    1919#include "collision.h"
    2020#include "track_manager.h"
    21 #include "track.h"
    2221#include "player.h"
    2322#include "command_node.h"
     
    143142void World::destroy()
    144143{
     144  delete trackManager;
    145145}
    146146
     
    180180      trackManager->addPoint(Vector(30,0,5));
    181181      trackManager->addPoint(Vector(40,0,5));
    182       trackManager->setDuration(.5);
     182      trackManager->setDuration(2);
    183183      trackManager->setSavePoint();
    184184      trackManager->addPoint(Vector(50,10,10));
     
    187187      trackManager->addPoint(Vector(80,0,-10));
    188188      trackManager->addPoint(Vector(90,0,-10));
    189       trackManager->setDuration(.5);
     189      trackManager->setDuration(5);
    190190      trackManager->setSavePoint();
    191191      trackManager->addPoint(Vector(110,0,5));
     
    194194      trackManager->addPoint(Vector(140,0,-10));
    195195      trackManager->addPoint(Vector(150,0,-10));
    196       trackManager->setDuration(.5);
     196      trackManager->setDuration(3);
    197197      int fork11, fork12, fork13, fork14;
    198198      trackManager->fork(4, &fork11, &fork12, &fork13, &fork14);
     
    200200      trackManager->addPoint(Vector(170, 0, -15));
    201201      trackManager->addPoint(Vector(180, 0, -15));
     202      trackManager->setDuration(3);
    202203      trackManager->workOn(fork12);
    203204      trackManager->addPoint(Vector(170, 0, 10));
     
    205206      trackManager->addPoint(Vector(190,2,5));
    206207      trackManager->addPoint(Vector(200,2,5));
     208      trackManager->setDuration(7);
    207209      int fork21, fork22;
    208210      trackManager->fork(2, &fork21, &fork22);
     
    213215      trackManager->addPoint(Vector(250, 0, 0));
    214216      trackManager->addPoint(Vector(260, 0, 5));
     217      trackManager->setDuration(3);
    215218      trackManager->join(2, fork12, fork11);
    216219      trackManager->workOn(fork22);
     
    219222      trackManager->addPoint(Vector(240, 0, 10));
    220223      trackManager->addPoint(Vector(250, 0, 5));
     224      trackManager->setDuration(6);
    221225      trackManager->workOn(fork13);
    222226      trackManager->addPoint(Vector(200,-10,5));
    223227      trackManager->addPoint(Vector(250,-10,5));
    224       printf("fork14: %d\n", fork14);
     228      trackManager->setDuration(3);
    225229      trackManager->workOn(fork14);
    226230      trackManager->addPoint(Vector(200,15,0));
    227231      trackManager->addPoint(Vector(210,0,10));
    228 
    229 
    230 
     232      trackManager->setDuration(1);
    231233      trackManager->join(4, fork21, fork22, fork13, fork14);
    232 
     234      trackManager->workOn(10);
     235      trackManager->addPoint(Vector(250,-10,5));
     236      trackManager->addPoint(Vector(260,-10,5));
     237      trackManager->finalize();
     238     
    233239      /*monitor progress*/
    234240      this->glmis->step();
    235241
    236242      /*
    237       tmpCurve->addNode(Vector(10,0,-10));
    238       //tmpCurve->addNode(Vector(10,2,5));
    239       //tmpCurve->addNode(Vector(10,3,-5));
    240       //      tmpCurve->addNode(Vector(10,1,5));
    241       tmpCurve->addNode(Vector(10,0,5));
     243        tmpCurve->addNode(Vector(10,  -1,  -1));
     244        tmpCurve->addNode(Vector(10,  -2,   2));
     245        tmpCurve->addNode(Vector(10,   3,   3));
     246        tmpCurve->addNode(Vector(10,   4,  -4), 0);
     247        tmpCurve->addNode(Vector(10,  -1,  -1));
     248        tmpCurve->addNode(Vector(10,  -2,   2));
     249        tmpCurve->addNode(Vector(10,   3,   3));
     250        tmpCurve->addNode(Vector(10,   4,  -4), 0);
     251        tmpCurve->debug();
    242252      */
    243253      switch(this->debugWorldNr)
     
    254264            this->nullParent->setName ("NullParent");
    255265
    256             // create some path nodes
    257             this->pathnodes = new Vector[6];
    258             this->pathnodes[0] = Vector(0, 0, 0);
    259             this->pathnodes[1] = Vector(1000, 0, 0);
    260             //      this->pathnodes[2] = Vector(-100, 140, 0);
    261             //      this->pathnodes[3] = Vector(0, 180, 0);
    262             //      this->pathnodes[4] = Vector(100, 140, 0);
    263             //      this->pathnodes[5] = Vector(100, 40, 0);
    264            
    265             // create the tracks
    266             this->tracklen = 2;
    267             this->track = new Track[2];
    268             for( int i = 0; i < this->tracklen; i++)
    269               {
    270                 this->track[i] = Track( i, (i+1)%this->tracklen, &this->pathnodes[i], &this->pathnodes[(i+1)%this->tracklen]);
    271               }
    272266            // !\todo old track-system has to be removed
    273267
     
    281275            this->spawn (myPlayer);
    282276            this->localPlayer = myPlayer;
    283 
    284277            /*monitor progress*/
    285278            this->glmis->step();           
     
    309302            /*monitor progress*/
    310303            this->glmis->step();
     304
     305            trackManager->setBindSlave(env);
    311306
    312307            break;
     
    338333
    339334
    340 
    341             // create the tracks
    342             this->tracklen = 6;
    343             this->track = new Track[6];
    344             for( int i = 0; i < this->tracklen; i++)
    345               {
    346                 this->track[i] = Track( i, (i+1)%this->tracklen, &this->pathnodes[i], &this->pathnodes[(i+1)%this->tracklen]);
    347               }
    348335
    349336            // create a player
     
    543530    }
    544531  */ 
    545   //draw track
    546   glBegin(GL_LINES);
    547   glColor3f(0.0, 1.0, 1.0);
    548   for( int i = 0; i < tracklen; i++)
    549     {
    550       glVertex3f(pathnodes[i].x,pathnodes[i].y,pathnodes[i].z);
    551       glVertex3f(pathnodes[(i+1)%tracklen].x,pathnodes[(i+1)%tracklen].y,pathnodes[(i+1)%tracklen].z);
    552     }
    553   glEnd();
    554  
    555532  /*
    556533  glBegin(GL_LINE_STRIP);
     
    565542  trackManager->drawGraph(.01);
    566543  trackManager->debug(2);
    567   delete trackManager;
    568  
    569   /*
     544  /* 
    570545  glBegin(GL_LINES);
    571546  float i;
     
    678653          t = loc->part;
    679654         
    680           if( t >= tracklen )
     655          if( t >= traclen )
    681656            {
    682657              printf("An entity is out of the game area\n");
     
    736711void World::unload()
    737712{
    738   if( pathnodes) delete []pathnodes;
    739   if( track) delete []pathnodes;
    740 }
    741 
    742 
    743 void World::setTrackLen(Uint32 len)
    744 {
    745   this->tracklen = len;
    746 }
    747 
    748 int World::getTrackLen()
    749 {
    750   return this->tracklen;
    751 }
    752 
     713
     714}
    753715
    754716
     
    910872      this->update ();
    911873      this->localCamera->timeSlice(dt);
     874      this->trackManager->tick(dt);
    912875    }
    913876  this->lastFrame = currentFrame;
Note: See TracChangeset for help on using the changeset viewer.