Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7385 in orxonox.OLD


Ignore:
Timestamp:
Apr 26, 2006, 4:37:58 PM (18 years ago)
Author:
bottac
Message:

Minor improvements (transparancy). Code formatting revised.

Location:
branches/bsp_model/src/lib/graphics/importer
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/graphics/importer/bsp_file.cc

    r7353 r7385  
    2020#include "debug.h"
    2121#include "material.h"
    22 #include "util/loading/resource_manager.h"
    23 
    2422#include "vertex_array_model.h"
    2523// Necessary ?
    2624#include "base_object.h"
    2725#include "vector.h"
     26#include "util/loading/resource_manager.h"
     27
     28#include <SDL/SDL_endian.h>
     29#include <SDL/SDL_image.h>
    2830
    2931using namespace std;
     
    3638}
    3739
    38 int BspFile::read(char* in_name)
     40int BspFile::read(char* name)
    3941{
    4042  int offset;
    4143  int size;
    4244  struct stat results;
    43    char name [300];
    44           strcpy(name,ResourceManager::getFullName(in_name).c_str());
     45  name = "/root/data/Kanti175.bsp";
    4546 
    4647   if (stat( name , &results) == 0)
     
    138139    // Get the brushSides
    139140    offset = ((int *)(header))[20];
    140     size    = ((int *)(header))[21];
     141    size    = SDL_SwapLE32(((int *)(header))[21]);
    141142    PRINTF(0)("BSP FILE: BrushSidesSize: %i Bytes. \n", size);
    142143    PRINTF(0)("BSP FILE: NumBrushSides: %i. \n", size / 8);
     
    324325void BspFile::load_textures()
    325326{
    326   const char* absFileName;
     327  char absFileName [228];
    327328  char fileName [228];
    328329  char ext [100];
    329330  struct stat results;
    330331
    331   this->Materials = new Material* [this->numTextures];
     332  this->Materials = new AMat[this->numTextures];
    332333  for(int i = 0 ; i < this->numTextures; i++)
    333334  {
     
    336337     // Check for tga
    337338    strcpy(fileName, &this->textures[8+ 72*i]);
    338     //strcpy (absFileName,"/root/data/trunk/");
     339    strcpy (absFileName,"/root/data/trunk/");
    339340    strcpy(ext, ".tga");
    340341    strncat (fileName, ext, strlen(fileName));
    341     //strncat(absFileName,fileName,strlen(fileName));
    342     absFileName = ResourceManager::getFullName(fileName).c_str();
     342    strncat(absFileName,fileName,strlen(fileName));
     343    // absFileName = ResourceManager::getFullName(fileName);
    343344 
    344345    if(stat( absFileName , &results) == 0)
     
    350351    // Check for TGA
    351352    strcpy(fileName, &this->textures[8+ 72*i]);
    352     //strcpy (absFileName,"/root/data/trunk/");
     353    strcpy (absFileName,"/root/data/trunk/");
    353354    strcpy(ext, ".TGA");
    354355    strncat (fileName, ext, strlen(fileName));
    355    // strncat(absFileName,fileName,strlen(fileName));
     356    strncat(absFileName,fileName,strlen(fileName));
    356357    // absFileName = ResourceManager::getFullName(fileName);
    357     absFileName = ResourceManager::getFullName(fileName).c_str();
     358
    358359    if(stat( absFileName , &results) == 0)
    359360    {
     
    364365    // Check for jpg
    365366    strcpy(fileName, &this->textures[8+ 72*i]);
    366     //strcpy (absFileName,"/root/data/trunk/");
     367    strcpy (absFileName,"/root/data/trunk/");
    367368    strcpy(ext, ".jpg");
    368369    strncat (fileName, ext, strlen(fileName));
    369     //strncat(absFileName,fileName,strlen(fileName));
     370    strncat(absFileName,fileName,strlen(fileName));
    370371    // absFileName = ResourceManager::getFullName(fileName);   
    371     absFileName = ResourceManager::getFullName(fileName).c_str();
    372372    if(stat( absFileName , &results) == 0)
    373373    {
     
    380380   // Check for JPG
    381381   strcpy(fileName, &this->textures[8+ 72*i]);
    382    //strcpy (absFileName,"/root/data/trunk/");
     382   strcpy (absFileName,"/root/data/trunk/");
    383383   strcpy(ext, ".JPG");
    384384   strncat (fileName, ext, strlen(fileName));
    385    //strncat(absFileName,fileName,strlen(fileName));
     385   strncat(absFileName,fileName,strlen(fileName));
    386386   // absFileName = ResourceManager::getFullName(fileName);
    387     absFileName = ResourceManager::getFullName(fileName).c_str();
    388387    if(stat( absFileName , &results) == 0)
    389388    {
     
    395394   // Check for jpeg
    396395    strcpy(fileName, &this->textures[8+ 72*i]);
    397     //strcpy (absFileName,"/root/data/trunk/");
     396    strcpy (absFileName,"/root/data/trunk/");
    398397    strcpy(ext, ".jpeg");
    399398    strncat (fileName, ext, strlen(fileName));
    400     //strncat(absFileName,fileName,strlen(fileName));
    401    //  absFileName = ResourceManager::getFullName(fileName);
    402     absFileName = ResourceManager::getFullName(fileName).c_str();
     399    strncat(absFileName,fileName,strlen(fileName));
     400    // absFileName = ResourceManager::getFullName(fileName);
    403401    if(stat( absFileName , &results) == 0)
    404402    {
     
    411409    // Check for JPEG
    412410    strcpy(fileName, &this->textures[8+ 72*i]);
    413     //strcpy (absFileName,"/root/data/trunk/");
     411    strcpy (absFileName,"/root/data/trunk/");
    414412    strcpy(ext, ".JPEG");
    415413    strncat (fileName, ext, strlen(fileName));
    416     //strncat(absFileName,fileName,strlen(fileName));
     414    strncat(absFileName,fileName,strlen(fileName));
    417415    // absFileName = ResourceManager::getFullName(fileName);
    418     absFileName = ResourceManager::getFullName(fileName).c_str();
    419416    PRINTF(0)("BSP FILE: %s . \n", absFileName);
    420417    if(stat( absFileName , &results) == 0)
     
    427424   // Check for bmp
    428425   strcpy(fileName, &this->textures[8+ 72*i]);
    429    //strcpy (absFileName,"/root/data/trunk/");
     426   strcpy (absFileName,"/root/data/trunk/");
    430427   strcpy(ext, ".bmp");
    431428   strncat (fileName, ext, strlen(fileName));
    432    //strncat(absFileName,fileName,strlen(fileName));
    433   //  absFileName = ResourceManager::getFullName(fileName);
    434     absFileName = ResourceManager::getFullName(fileName).c_str();
     429   strncat(absFileName,fileName,strlen(fileName));
     430   // absFileName = ResourceManager::getFullName(fileName);
    435431 
    436432    if(stat( absFileName , &results) == 0)
     
    443439   // Check for BMP
    444440    strcpy(fileName, &this->textures[8+ 72*i]);
    445     //strcpy (absFileName,"/root/data/trunk/");
     441    strcpy (absFileName,"/root/data/trunk/");
    446442    strcpy(ext, ".BMP");
    447443    strncat (fileName, ext, strlen(fileName));
    448   //  strncat(absFileName,fileName,strlen(fileName));
    449    //  absFileName = ResourceManager::getFullName(fileName);
    450     absFileName = ResourceManager::getFullName(fileName).c_str();
     444    strncat(absFileName,fileName,strlen(fileName));
     445    // absFileName = ResourceManager::getFullName(fileName);
    451446
    452447    if(stat( absFileName , &results) == 0)
     
    457452    }
    458453        //      Default Material
    459         this->Materials[i] = new Material();
    460         this->Materials[i]->setDiffuse(0.1,0.1,0.1);
    461         this->Materials[i]->setAmbient(0.1,0.1,0.1 );
    462         this->Materials[i]->setSpecular(0.4,0.4,0.4);
     454        this->Materials[i].mat = new Material();
     455        this->Materials[i].mat->setDiffuse(0.1,0.1,0.1);
     456        this->Materials[i].mat->setAmbient(0.1,0.1,0.1 );
     457        this->Materials[i].mat->setSpecular(0.4,0.4,0.4);
    463458        //this->Materials[i]->setShininess(100.0);
    464         this->Materials[i]->setTransparency(1.0);
    465         this->Materials[i]->setDiffuseMap("pictures/ground.tga");
    466         this->Materials[i]->setAmbientMap("pictures/ground.tga");
    467         this->Materials[i]->setSpecularMap("pictures/ground.tga");
     459        this->Materials[i].mat->setTransparency(1.0);
     460        this->Materials[i].mat->setDiffuseMap("pictures/ground.tga");
     461        this->Materials[i].mat->setAmbientMap("pictures/ground.tga");
     462        this->Materials[i].mat->setSpecularMap("pictures/ground.tga");
     463        this->Materials[i].alpha = false;
    468464  }
    469465}
    470466
    471467
    472 Material* BspFile::loadMat(char* mat)
     468AMat BspFile::loadMat(char* mat)
    473469{
     470  AMat tmpAMat;
     471  this->testSurf = NULL;
     472
     473  this->testSurf = IMG_Load(ResourceManager::getFullName(mat).c_str());
     474  if(this->testSurf != NULL)
     475        {
     476  if(this->testSurf->format->Amask != 0 ) tmpAMat.alpha = true;
     477  else                                 tmpAMat.alpha = false;
     478        }
     479  else   tmpAMat.alpha = false;
     480
    474481  Material* tmp = new Material();
    475482        tmp->setDiffuse(1.0,1.0,1.0);
     
    477484        tmp->setSpecular(1.0,1.0,1.0);
    478485   //   tmp->setShininess(.5);
    479         tmp->setTransparency(1.0);
     486   //   tmp->setTransparency(1.0);
    480487
    481488        tmp->setDiffuseMap(mat);
    482489        tmp->setAmbientMap(mat);
    483490        tmp->setSpecularMap(mat);
    484 
    485   return tmp;
     491 
     492  tmpAMat.mat = tmp;
     493
     494  return tmpAMat;
    486495}
    487496
  • branches/bsp_model/src/lib/graphics/importer/bsp_file.h

    r7353 r7385  
    11/*
    2    orxonox - the future of 3D-vertical-scrollers
    3 
    4    Copyright (C) 2006 orx
    5 
    6    This program is free software; you can redistribute it and/or modify
    7    it under the terms of the GNU General Public License as published by
    8    the Free Software Foundation; either version 2, or (at your option)
    9    any later version.
    10 
    11    ### File Specific:
    12    main-programmer: bottac@ee.ethz.ch
     2 orxonox - the future of 3D-vertical-scrollers
     3 
     4 Copyright (C) 2006 orx
     5 
     6 This program is free software; you can redistribute it and/or modify
     7 it under the terms of the GNU General Public License as published by
     8 the Free Software Foundation; either version 2, or (at your option)
     9 any later version.
     10 
     11 ### File Specific:
     12 main-programmer: bottac@ee.ethz.ch
    1313*/
    1414
    15 
     15class SDL_Surface;
    1616class BspTreeNode;
    1717class Vector;
     
    1919class VertexArrayModel;
    2020
    21 typedef struct 
     21typedef struct
    2222{
    2323  float x;
    2424  float y;
    2525  float z;
    26   float d;     
    27 } plane;
     26  float d;
     27}
     28plane;
    2829
    2930typedef struct
    3031{
    31    float mins [3]; //Bounding box min coord.
    32    float maxs [3]; //Bounding box max coord.
    33    int face; //First face for model.
    34    int n_faces; //Number of faces for model.
    35    int brush; //First brush for model.
    36    int n_brushes; //
    37 } model;
     32  float mins [ 3 ]; //Bounding box min coord.
     33  float maxs [ 3 ]; //Bounding box max coord.
     34  int face; //First face for model.
     35  int n_faces; //Number of faces for model.
     36  int brush; //First brush for model.
     37  int n_brushes; //
     38}
     39model;
    3840
    3941typedef struct
    4042{
    41    int plane; //Plane index.
    42    int left; //Children indices. Negative numbers are leaf indices: -(leaf+1).
    43    int right;
    44    int mins[3]; //Integer bounding box min coord.
    45    int maxs[3]; //Integer bounding box max coord.
    46 } node;
     43  int plane; //Plane index.
     44  int left; //Children indices. Negative numbers are leaf indices: -(leaf+1).
     45  int right;
     46  int mins[ 3 ]; //Integer bounding box min coord.
     47  int maxs[ 3 ]; //Integer bounding box max coord.
     48}
     49node;
    4750
    4851typedef struct
    4952{
    50    int cluster; //      Visdata cluster index.
    51    int area; //         Areaportal area.
    52    int mins[3]; // Integer bounding box min coord.
    53    int maxs[3]; // Integer bounding box max coord.
    54    int leafface; // First leafface for leaf.
    55    int n_leaffaces; //Number of leaffaces for leaf.
    56    int leafbrush_first; // leafbrush for leaf.
    57    int n_leafbrushes; // Number of leafbrushes for leaf.
    58 } leaf;
     53  int cluster; //       Visdata cluster index.
     54  int area; //  Areaportal area.
     55  int mins[ 3 ]; // Integer bounding box min coord.
     56  int maxs[ 3 ]; // Integer bounding box max coord.
     57  int leafface; // First leafface for leaf.
     58  int n_leaffaces; //Number of leaffaces for leaf.
     59  int leafbrush_first; // leafbrush for leaf.
     60  int n_leafbrushes; // Number of leafbrushes for leaf.
     61}
     62leaf;
    5963
    6064typedef struct
    6165{
    62     int brushside;      //First brushside for brush.
    63     int n_brushsides;   //Number of brushsides for brush.
    64     int texture;        //Texture index.
    65 } brush;
     66  int brushside;        //First brushside for brush.
     67  int n_brushsides;     //Number of brushsides for brush.
     68  int texture;  //Texture index.
     69}
     70brush;
    6671
    6772typedef struct
    6873{
    69     int plane; //Plane index.
    70     int texture;        //Texture index.
    71 } brushside;
     74  int plane; //Plane index.
     75  int texture;  //Texture index.
     76}
     77brushside;
    7278
    73  struct face
     79struct face
    7480{
    75     int texture;        // Texture index.
    76     int effect;         // Index into lump 12 (Effects), or -1.
    77     int type;   // Face type. 1=polygon, 2=patch, 3=mesh, 4=billboard
    78     int vertex;         // Index of first vertex.
    79     int n_vertexes; // Number of vertices.
    80     int meshvert;   // Index of first meshvert.
    81     int n_meshverts; // Number of meshverts.
    82     int lm_index;  // Lightmap index.
    83     int lm_start [2]; // Corner of this face's lightmap image in lightmap.
    84     int lm_size[2]; // Size of this face's lightmap image in lightmap.
    85     float lm_origin [3] ;//  World space origin of lightmap.
    86     float lm_vecs [2][3];// World space lightmap s and t unit vectors.
    87     float normal[3];// Surface normal.
    88     int size [2] ;// Patch dimensions.
     81  int texture;  // Texture index.
     82  int effect;   // Index into lump 12 (Effects), or -1.
     83  int type;     // Face type. 1=polygon, 2=patch, 3=mesh, 4=billboard
     84  int vertex;   // Index of first vertex.
     85  int n_vertexes; // Number of vertices.
     86  int meshvert;   // Index of first meshvert.
     87  int n_meshverts; // Number of meshverts.
     88  int lm_index;  // Lightmap index.
     89  int lm_start [ 2 ]; // Corner of this face's lightmap image in lightmap.
     90  int lm_size[ 2 ]; // Size of this face's lightmap image in lightmap.
     91  float lm_origin [ 3 ] ; //  World space origin of lightmap.
     92  float lm_vecs [ 2 ][ 3 ]; // World space lightmap s and t unit vectors.
     93  float normal[ 3 ]; // Surface normal.
     94  int size [ 2 ] ; // Patch dimensions.
    8995} ;
    9096
    9197typedef struct
    9298{
    93     float position[3]; // Vertex position.
    94     float texcoord[2][2]; // Vertex texture coordinates. 0=surface, 1=lightmap.
    95     float normal[3]; // Vertex normal.
    96     unsigned char color [4]; //  Vertex color. RGBA.
    97 }BspVertex;
     99  float position[ 3 ]; // Vertex position.
     100  float texcoord[ 2 ][ 2 ]; // Vertex texture coordinates. 0=surface, 1=lightmap.
     101  float normal[ 3 ]; // Vertex normal.
     102  unsigned char color [ 4 ]; //  Vertex color. RGBA.
     103}
     104BspVertex;
    98105
    99106typedef struct
    100107{
    101    int offset;
    102 } meshvert;
     108  int offset;
     109}
     110meshvert;
    103111
    104 typedef struct 
     112typedef struct
    105113{
    106  float position [3];
    107 } BspVec;
     114  float position [ 3 ];
     115}
     116BspVec;
    108117
    109 class  BspFile
     118typedef struct
    110119{
    111  public:
    112  BspFile();
    113  int read(char* name);
    114  void build_tree();
    115  void load_textures();
    116  void tesselate(int iface);
    117  BspTreeNode* get_root();
    118  Material * loadMat(char* mat);
     120  Material* mat;
     121  bool alpha;
     122}
     123AMat;
    119124
    120  BspTreeNode*  root;
    121  char header [280]; // Buffer for header of BSP-File
    122  char*  nodes; // Buffer to store BSP-Tree-Nodes       
    123  char*  leaves; // Buffer to store BSP-Tree-Leaves
    124  char*  planes; // Buffer to store planes separateing the space
    125  char*  bspModels; // Buffer to store BSP-Model-List
    126  char*  leafFaces;  // Buffer to store leafFaces
    127  char*  faces; //
    128  char*  leafBrushes; // Buffer to store brush indice
    129  char*  brushes; // Buffer to store  brushes
    130  char*  brushSides; //
    131  char*  vertice; //
    132  char*  meshverts;
    133  char*  visData;
    134  char* textures;
     125class BspFile
     126{
     127  friend class BspManager;
     128
     129public:
     130  BspFile();
     131  int read( char* name );
     132  void build_tree();
     133  void load_textures();
     134  void tesselate( int iface );
     135  BspTreeNode* get_root();
     136  AMat loadMat( char* mat );
    135137
    136138
    137  char*  patchVertice;
    138  char*  patchIndexes;
    139  char*  patchTrianglesPerRow;
    140  int**  patchRowIndexes;
    141  VertexArrayModel** VertexArrayModels;
    142  int       patchOffset;
     139private:
     140  BspTreeNode* root;
     141  char header [ 280 ];       //!< Buffer for header of BSP-File
     142  char* nodes;               //!< Buffer to store BSP-Tree-Nodes
     143  char* leaves;              //!< Buffer to store BSP-Tree-Leaves
     144  char* planes;              //!< Buffer to store planes separateing the space
     145  char* bspModels;           //!< Buffer to store BSP-Model-List
     146  char* leafFaces;           //!< Buffer to store leafFaces
     147  char* faces;               //!<
     148  char* leafBrushes;         //!< Buffer to store brush indice
     149  char* brushes;             //!< Buffer to store  brushes
     150  char* brushSides;          //!<
     151  char* vertice;             //!<
     152  char* meshverts;           //!<
     153  char* visData;             //!<
     154  char* textures;            //!<
    143155
    144  int numNodes;
    145  int numLeafs;
    146  int numVertex;
    147  int numPlanes;
    148  int numBspModels;
    149  int numLeafFaces;
    150  int numFaces;
    151  int numLeafBrushes;
    152  int numTextures;
    153  int numPatches;
    154  int numBrushSides;
    155  
    156  BspTreeNode*  build_tree_rec(int i);
    157  Material**           Materials;
    158156
    159  
     157  char* patchVertice;
     158  char* patchIndexes;
     159  char* patchTrianglesPerRow;
     160  int** patchRowIndexes;
     161  VertexArrayModel** VertexArrayModels;
     162  int patchOffset;
     163
     164  int numNodes;
     165  int numLeafs;
     166  int numVertex;
     167  int numPlanes;
     168  int numBspModels;
     169  int numLeafFaces;
     170  int numFaces;
     171  int numLeafBrushes;
     172  int numTextures;
     173  int numPatches;
     174  int numBrushSides;
     175
     176  BspTreeNode* build_tree_rec( int i );
     177  AMat* Materials;
     178  SDL_Surface* testSurf;
     179
    160180};
    161181
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc

    r7353 r7385  
    1717#include "bsp_file.h"
    1818#include "bsp_manager.h"
    19 #include "bsp_tree_node.h"
     19#include "bsp_tree_leaf.h"
    2020#include "p_node.h"
    2121#include "state.h"
     
    2323#include "material.h"
    2424#include "camera.h"
    25 
    2625#include "vertex_array_model.h"
    2726
    28 
    29 
    30 
     27// STL Containers
     28#include <vector>
     29#include <deque>
    3130
    3231
     
    3736        // open a BSP file
    3837        this->bspFile = new BspFile();
    39         this->bspFile->read("Kanti175.bsp");
     38        this->bspFile->read("/root/data/Kanti175.bsp");
    4039        this->bspFile->build_tree();
    4140        this->root  = this->bspFile->get_root();
     
    6463   // erase alreadyVisible
    6564   for(int i = 0; i < this->bspFile->numFaces; i++) this->alreadyVisible[i] = false;
    66  float tmp = 0;
     65        float tmp = 0;
     66   this->opal.clear();
     67   this->trasparent.clear();   
    6768  // Find all visible faces...
    6869
     
    110111                                        this->alreadyVisible[i] = true;
    111112                                }
    112                                 else */draw_face(f); // "visibleFaces.append(f)"
     113                                else */addFace(f); // "visibleFaces.append(f)"
    113114                        }
    114115                }
     
    150151                        if (!this->isAlreadyVisible(f) && f>=0)
    151152                        {
    152                                         this->draw_face(f);
     153                                        this->addFace(f);
    153154                                        this->alreadyVisible[f] = true;
    154155                        }
     
    161162
    162163    }//else
     164
     165while(!this->opal.empty())
     166{
     167 this->draw_face(this->opal.front());
     168  this->opal.pop_front();
     169}
     170while(!this->trasparent.empty())
     171{
     172 this->draw_face(this->trasparent.back());
     173 this->trasparent.pop_back();
     174}
    163175
    164176
     
    190202        if(this->lastTex != curFace.texture)
    191203        {
    192         this->bspFile->Materials[curFace.texture]->select();
     204        this->bspFile->Materials[curFace.texture].mat->select();
    193205        this->lastTex = curFace.texture;
    194206        }
     
    239251   // if(this->bspFile->Materials[curFace.texture] != NULL)     
    240252
    241         this->bspFile->Materials[2]->select();
     253        this->bspFile->Materials[2].mat->select();
    242254        this->lastTex = 2;
    243255
     
    266278                if(this->lastTex != Face->texture)
    267279                {
    268                 this->bspFile->Materials[Face->texture]->select();
     280                this->bspFile->Materials[Face->texture].mat->select();
    269281                this->lastTex = Face->texture;
    270282                }
     
    331343        {
    332344                dist = (node->plane.x * this->cam.x + node->plane.y*this->cam.y + node->plane.z*this->cam.z) - node->d;
    333                 if(dist > 1.0f)
     345                if(dist > 4.0f)
    334346                {
    335347                 checkCollision(node->left,cam);
    336348                 return;
    337349                }
    338                 if(dist < -1.0f)
     350                if(dist < -4.0f)
    339351                {
    340352                 checkCollision(node->right,cam);
    341353                 return;
    342354                }
    343                 if(dist<=1.0f && dist >= -1.0f)
     355                if(dist<=4.0f && dist >= -4.0f)
    344356                        {
    345357                        checkCollision(node->left,cam);
     
    357369
    358370       
    359 
     371/*
    360372        for(int i = 0; i < camLeaf.n_leafbrushes && i < 10; i++ )
    361373        {
     
    376388                }
    377389                       
    378         }
     390        } */
    379391       
    380392        }
     
    454466   glTexCoord2f(0.005f, 0.995f); glVertex3f(cam->x-1.0f, cam->y+ 1.0f, cam->z -1.0f);
    455467
    456 
    457 
    458                 glEnd();
    459 }
     468        glEnd();
     469}
     470
     471void BspManager::addFace(int f)
     472{
     473 face& curFace =  ((face *)(this->bspFile->faces))[f];
     474 if(this->bspFile->Materials[curFace.texture].alpha) this->trasparent.push_back(f);
     475 else this->opal.push_back(f);
     476}
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.h

    r7353 r7385  
    1212   main-programmer: bottac@ee.ethz.ch
    1313*/
     14
     15#include <vector>
     16#include <deque>
    1417
    1518
     
    4043 BspFile*  bspFile;
    4144 BspTreeNode* root;
    42  BspTreeNode* getLeaf(BspTreeNode*  node, Vector* cam);  // Traverses the tree
     45 const BspTreeNode* getLeaf(const BspTreeNode*  node, const Vector& cam) const;  // Traverses the tree
    4346 void  checkCollision(BspTreeNode* node, Vector* cam);
    4447 void drawDebugCube(Vector* cam);
     
    4851 bool * alreadyVisible;
    4952 bool isAlreadyVisible(int Face);
     53 void addFace(int Face);
    5054 int lastTex;
     55
     56
     57// Vectors to store the visible faces
     58 ::std::deque<int> trasparent; // the ones with transparancy go here
     59 ::std::deque<int> opal; // the others here.
     60
    5161};
    5262
Note: See TracChangeset for help on using the changeset viewer.