Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3526 in orxonox.OLD for orxonox/trunk/src/story_entities


Ignore:
Timestamp:
Mar 13, 2005, 8:00:25 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: better ModelView-matrix transformations

Location:
orxonox/trunk/src/story_entities
Files:
2 edited

Legend:

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

    r3522 r3526  
    4141World::World (char* name)
    4242{
    43   this->setClassName ("World");
    44   this->worldName = name;
    45   this->debugWorldNr = -1;
    46   this->entities = new tList<WorldEntity>();
     43  this->init(name, -1);
    4744}
    4845
     
    5350World::World (int worldID)
    5451{
    55   this->debugWorldNr = worldID;
    56   this->worldName = NULL;
    57   this->entities = new tList<WorldEntity>();
     52  this->init(NULL, worldID);
    5853}
    5954
     
    9489  /* this->localPlayer hasn't to be deleted explicitly, it is
    9590     contained in entities*/
     91}
     92
     93/**
     94   \brief initializes a new World
     95*/
     96void World::init(char* name, int worldID)
     97{
     98  this->setClassName ("World");
     99
     100  this->worldName = name;
     101  this->debugWorldNr = worldID;
     102  this->entities = new tList<WorldEntity>();
     103
     104  // Enable default GL stuff
     105  glEnable(GL_DEPTH_TEST);
     106
    96107}
    97108
     
    289300  objectList = glGenLists(1);
    290301  glNewList (objectList, GL_COMPILE);
    291   glLoadIdentity();
     302
    292303  glColor3f(1.0,0,0);
    293   glBegin(GL_QUADS);
    294304
    295305  int sizeX = 100;
     
    338348      }
    339349
     350  glBegin(GL_QUADS);
    340351  int snowheight=3;
    341352  for ( int i = 0; i<sizeX; i+=1)
     
    410421      }
    411422  glEnd();
    412   /* 
    413   glBegin(GL_LINES);
    414   for( float x = -128.0; x < 128.0; x += 25.0)
    415     {
    416       for( float y = -128.0; y < 128.0; y += 25.0)
    417         {
    418           glColor3f(1,0,0);
    419           glVertex3f(x,y,-128.0);
    420           glVertex3f(x,y,0.0);
    421           glColor3f(0.5,0,0);
    422           glVertex3f(x,y,0.0);
    423           glVertex3f(x,y,128.0);
    424         }
    425     }
    426   for( float y = -128.0; y < 128.0; y += 25.0)
    427     {
    428       for( float z = -128.0; z < 128.0; z += 25.0)
    429         {
    430           glColor3f(0,1,0);
    431           glVertex3f(-128.0,y,z);
    432           glVertex3f(0.0,y,z);
    433           glColor3f(0,0.5,0);
    434           glVertex3f(0.0,y,z);
    435           glVertex3f(128.0,y,z);
    436         }
    437     }
    438   for( float x = -128.0; x < 128.0; x += 25.0)
    439     {
    440       for( float z = -128.0; z < 128.0; z += 25.0)
    441         {
    442           glColor3f(0,0,1);
    443           glVertex3f(x,-128.0,z);
    444           glVertex3f(x,0.0,z);
    445           glColor3f(0,0,0.5);
    446           glVertex3f(x,0.0,z);
    447           glVertex3f(x,128.0,z);
    448         }
    449      
    450     }
    451   */ 
    452   /*
    453   glBegin(GL_LINE_STRIP);
    454   glColor3f(1.0, 5.0, 1.0);
    455   for( int i = 0; i <= 30; i++)
    456     {
    457       glEvalCoord1f ((GLfloat) i/30.0);
    458     }
    459   glEnd();
    460   */
    461423
    462424  trackManager->drawGraph(.01);
    463425  trackManager->debug(2);
    464   /* 
    465   glBegin(GL_LINES);
    466   float i;
    467   for(i = 0.0; i<1; i+=.01)
    468     {
    469       printf("%f, %f, %f\n",tmpCurve->calcPos(i).x, tmpCurve->calcPos(i).y, tmpCurve->calcPos(i).z);
    470       glVertex3f(tmpCurve->calcPos(i).x, tmpCurve->calcPos(i).y, tmpCurve->calcPos(i).z);
    471     }
    472   glEnd();
    473   */
    474426  glEndList();
     427
     428
    475429  // LIGHT initialisation
    476430  light = Light::getInstance();
     
    635589  /* draw entities */
    636590  WorldEntity* entity;
     591  glLoadIdentity();
     592
    637593  entity = this->entities->enumerate();
    638594  while( entity != NULL )
  • orxonox/trunk/src/story_entities/world.h

    r3521 r3526  
    5757
    5858 private:
     59  void init(char* name, int worldID);
     60
    5961  Uint32 lastFrame;             //!< last time of frame
    6062  bool bQuitOrxonox;            //!< quit this application
Note: See TracChangeset for help on using the changeset viewer.