Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 11, 2005, 2:23:54 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/heightMap: merged trunk back to the heightMap branche
merged with command:
svn merge trunk/ branches/heightMap/ -r 4122:HEAD

Location:
orxonox/branches/heightMap/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/heightMap/src/world_entities/skybox.cc

    r4122 r4165  
    6666      PRINTF(0)("SkyBox is missing a proper 'MaterialSet'\n");
    6767    }
    68   if( this->model == NULL)
     68  if( this->skyModel == NULL)
    6969    {
    7070      PRINTF(0)("SkyBox model '%s' could not be loaded\n", string);
     
    7676{
    7777  this->setClassName("SkyBox");
     78  this->skyModel = NULL;
    7879  this->material = new Material*[6];
    79   for (int i = 0; i <6; i++)
     80  for (int i = 0; i < 6; i++)
    8081    {
    8182      this->material[i] = new Material();
     
    100101SkyBox::~SkyBox()
    101102{
    102   PRINTF(5)("Deleting the SkyBox\n");
     103  PRINTF(5)("Deleting SkyBox\n");
    103104  for (int i = 0; i < 6; i++)
    104105    delete this->material[i];
     
    179180  glTranslatef(r.x, r.y, r.z);
    180181
    181   this->model->draw();
     182  this->skyModel->draw();
    182183
    183184  glPopMatrix();
     
    192193void SkyBox::rebuild()
    193194{
    194   if (this->model)
    195     delete model;
    196   model = new Model();
    197 
    198   model->addVertex (-0.5*size, -0.5*size, 0.5*size); 
    199   model->addVertex (0.5*size, -0.5*size, 0.5*size);
    200   model->addVertex (-0.5*size, 0.5*size, 0.5*size);
    201   model->addVertex (0.5*size, 0.5*size, 0.5*size);
    202   model->addVertex (-0.5*size, 0.5*size, -0.5*size);
    203   model->addVertex (0.5*size, 0.5*size, -0.5*size);
    204   model->addVertex (-0.5*size, -0.5*size, -0.5*size);
    205   model->addVertex (0.5*size, -0.5*size, -0.5*size);
    206 
    207   model->addVertexTexture (0.0, 0.0);
    208   model->addVertexTexture (1.0, 0.0);
    209   model->addVertexTexture (1.0, 1.0);
    210   model->addVertexTexture (0.0, 1.0);
    211 
    212   model->addVertexNormal (0.0, 0.0, 1.0);
    213   model->addVertexNormal (0.0, 1.0, 0.0);
    214   model->addVertexNormal (0.0, 0.0, -1.0);
    215   model->addVertexNormal (0.0, -1.0, 0.0);
    216   model->addVertexNormal (1.0, 0.0, 0.0);
    217   model->addVertexNormal (-1.0, 0.0, 0.0);
    218 
    219   model->setMaterial(material[0]);
    220   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,1,3, 3,2,3, 5,3,3, 4,0,3); // top
    221   model->setMaterial(material[1]);
    222   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,3,1, 7,0,1, 1,1,1, 0,2,1); // bottom
    223   model->setMaterial(material[2]);
    224   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,2, 1,1,2, 3,2,2, 2,3,2); // left
    225   model->setMaterial(material[3]);
    226   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,0, 5,3,0, 7,0,0, 6,1,0); // right
    227   model->setMaterial(material[4]);
    228   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,6); // front
    229   model->setMaterial(material[5]);
    230   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back
     195  if (this->skyModel)
     196    delete skyModel;
     197  skyModel = new Model();
     198
     199  this->skyModel->addVertex (-0.5*size, -0.5*size, 0.5*size); 
     200  this->skyModel->addVertex (0.5*size, -0.5*size, 0.5*size);
     201  this->skyModel->addVertex (-0.5*size, 0.5*size, 0.5*size);
     202  this->skyModel->addVertex (0.5*size, 0.5*size, 0.5*size);
     203  this->skyModel->addVertex (-0.5*size, 0.5*size, -0.5*size);
     204  this->skyModel->addVertex (0.5*size, 0.5*size, -0.5*size);
     205  this->skyModel->addVertex (-0.5*size, -0.5*size, -0.5*size);
     206  this->skyModel->addVertex (0.5*size, -0.5*size, -0.5*size);
     207
     208  this->skyModel->addVertexTexture (0.0, 0.0);
     209  this->skyModel->addVertexTexture (1.0, 0.0);
     210  this->skyModel->addVertexTexture (1.0, 1.0);
     211  this->skyModel->addVertexTexture (0.0, 1.0);
     212
     213  this->skyModel->addVertexNormal (0.0, 0.0, 1.0);
     214  this->skyModel->addVertexNormal (0.0, 1.0, 0.0);
     215  this->skyModel->addVertexNormal (0.0, 0.0, -1.0);
     216  this->skyModel->addVertexNormal (0.0, -1.0, 0.0);
     217  this->skyModel->addVertexNormal (1.0, 0.0, 0.0);
     218  this->skyModel->addVertexNormal (-1.0, 0.0, 0.0);
     219
     220  this->skyModel->setMaterial(material[0]);
     221  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,1,3, 3,2,3, 5,3,3, 4,0,3); // top
     222  this->skyModel->setMaterial(material[1]);
     223  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,3,1, 7,0,1, 1,1,1, 0,2,1); // bottom
     224  this->skyModel->setMaterial(material[2]);
     225  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,2, 1,1,2, 3,2,2, 2,3,2); // left
     226  this->skyModel->setMaterial(material[3]);
     227  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,0, 5,3,0, 7,0,0, 6,1,0); // right
     228  this->skyModel->setMaterial(material[4]);
     229  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,6); // front
     230  this->skyModel->setMaterial(material[5]);
     231  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back
    231232 
    232   model->finalize();
    233 }
     233  this->skyModel->finalize();
     234}
  • orxonox/branches/heightMap/src/world_entities/skybox.h

    r4122 r4165  
    3939  void rebuild();
    4040
     41  Model* skyModel;        //!< A Model for the Sky. This must not be the same as the Model from WorldEntity, because it is not alocated through the ResourceManager.
    4142  Material **material;    //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back
    4243  float size;             //!< Size of the SkyBox. This should match the frustum maximum range.
  • orxonox/branches/heightMap/src/world_entities/terrain.cc

    r4090 r4165  
    109109void Terrain::init(void)
    110110{
    111    this->setClassName ("Terrain");
    112 
    113    this->objectList = 0;
     111  this->setClassName ("Terrain");
     112 
     113  this->objectList = 0;
    114114}
    115115
     
    130130  glMultMatrixf((float*)matrix);
    131131
    132   if (objectList)
    133     glCallList(objectList);
    134   else if (model)
    135     model->draw();
    136   //  this->model->draw();
     132  if (this->objectList)
     133    glCallList(this->objectList);
     134  else if (this->model)
     135    this->model->draw();
    137136  glPopMatrix();
    138137}
Note: See TracChangeset for help on using the changeset viewer.