Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4678 in orxonox.OLD


Ignore:
Timestamp:
Jun 23, 2005, 11:32:19 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: removed redundant stuff

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/importer/model.h

    r4677 r4678  
    111111  inline const GLfloat* getVertexArray(void) const { return this->vertices->getArray(); };
    112112  /** \returns the VertexCount of this Model */
    113   inline unsigned int getVertexArrayCount(void) const { return this->vertexCount; };
     113  inline unsigned int getVertexCount(void) const { return this->vertexCount; };
    114114
    115115  /** \returns a Pointer to the Normals-Array, if it was deleted it returns NULL */
    116116  inline const GLfloat* getNormalsArray(void) const { return this->normals->getArray(); };
    117117  /** \returns the NormalsCount of this Model */
    118   inline unsigned int getNormalsArrayCount(void) const { return this->normalCount; };
     118  inline unsigned int getNormalsCount(void) const { return this->normalCount; };
    119119
    120120  /** \returns a Pointer to the TexCoord-Array, if it was deleted it returns NULL */
    121121  inline const GLfloat* getTexCoordArray(void) const { return this->vTexture->getArray(); };
    122122  /** \returns the TexCoord-Count of this Model */
    123   inline unsigned int getTexCoordArrayCount(void) const { return this->texCoordCount; };
     123  inline unsigned int getTexCoordCount(void) const { return this->texCoordCount; };
     124
     125  /** \returns the Count of Faces of this Model */
     126  inline unsigned int getFaceCount() const { return this->faceCount; };
    124127
    125128
     
    140143  void finalize(void);
    141144
    142   /** \returns The number of Vertices of the Model */
    143   inline int getVertexCount(void) const { return this->vertexCount; };
    144   /** \returns The number of Normals of the Model */
    145   inline int getNormalCount(void) const { return this->normalCount; };
    146   /** \returns The number of Texture Coordinates of the Model */
    147   inline int getTexCoordCount(void) const { return this->texCoordCount; };
    148   /** \returns The number of Faces of the entire Model */
    149   inline unsigned int getFaceCount() const { return this->faceCount; };
    150145
    151146 protected:
  • orxonox/trunk/src/lib/graphics/importer/primitive_model.cc

    r4468 r4678  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    2828
    2929   if you want to just display a Cube/Sphere/Cylinder/... without any material.
    30    
     30
    3131   \todo implement Cube/Sphere/Cylinder/...
    3232*/
     
    5959
    6060*/
    61 PrimitiveModel::~PrimitiveModel () 
     61PrimitiveModel::~PrimitiveModel ()
    6262{
    6363  // delete what has to be deleted here
     
    7171void PrimitiveModel::sphereModel(float size, unsigned int detail)
    7272{
    73   if (detail <= 0) 
     73  if (detail <= 0)
    7474    detail = 1;
    7575  size /= 2;
    7676  //  detail = 2; // make it even
    7777  float df = (float)detail;
    78  
     78
    7979  // defining the Vertices
    8080  for (float i = 0; i < df *2.0; i+=1.0)
     
    8282      float vi = i/df *PI;
    8383      for (float j = -df / 2.0 +1.0; j < df / 2.0; j+=1.0 *df/(df+1.0))
    84         {
    85           float vj = j/df *PI;
    86           this->addVertex(size * cos(vi) * cos(vj),
    87                           size * sin(vj),
    88                           size * sin(vi) * cos(vj));
    89           this->addVertexTexture(i / (df *2.0), (j-1.0)/(df)+.5);
    90         }
     84        {
     85          float vj = j/df *PI;
     86          this->addVertex(size * cos(vi) * cos(vj),
     87                          size * sin(vj),
     88                          size * sin(vi) * cos(vj));
     89          this->addVertexTexture(i / (df *2.0), (j-1.0)/(df)+.5);
     90        }
    9191    }
    9292  this->addVertex(0, -size, 0);
     
    100100    {
    101101      for (int j = 0; j <= detail; j++)
    102         {
    103          
    104           v1 = i*detail + j-1;
    105           v4 = i*detail + j;
    106          
    107           if (i == detail*2 -1)
    108             {
    109               v2 = j-1;
    110               v3 = j;
    111             }
    112           else
    113             {
    114               v2 = (i+1)*detail + j-1;
    115               v3 = (i+1)*detail + j;
    116             }
    117 
    118           if (j == 0)
    119             {
    120               v1 = this->getVertexCount()-2;
    121               this->addFace(3, VERTEX_TEXCOORD, v1, v1, v3, v3, v4, v4);
    122             }
    123           else if (j == detail)
    124             {
    125               v3 = this->getVertexCount()-1;
    126               this->addFace(3, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3);
    127             }
    128           else
    129             this->addFace(4, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3, v4, v4);
    130         }
     102        {
     103
     104          v1 = i*detail + j-1;
     105          v4 = i*detail + j;
     106
     107          if (i == detail*2 -1)
     108            {
     109              v2 = j-1;
     110              v3 = j;
     111            }
     112          else
     113            {
     114              v2 = (i+1)*detail + j-1;
     115              v3 = (i+1)*detail + j;
     116            }
     117
     118          if (j == 0)
     119            {
     120              v1 = this->getVertexCount() - 2;
     121              this->addFace(3, VERTEX_TEXCOORD, v1, v1, v3, v3, v4, v4);
     122            }
     123          else if (j == detail)
     124            {
     125              v3 = this->getVertexCount()-1;
     126              this->addFace(3, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3);
     127            }
     128          else
     129            this->addFace(4, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3, v4, v4);
     130        }
    131131    }
    132132}
     
    181181  this->addVertex(0,-size,0);
    182182  this->addVertex(0,size,0);
    183   if (detail <= 0) 
     183  if (detail <= 0)
    184184    detail = 1;
    185185  float df = (float)detail;
    186  
     186
    187187  // defining the Vertices
    188188  for (float i = 0; i < df; i+=1.0)
     
    190190      float vi = i/df *2.0*PI;
    191191      this->addVertex(size* sin(vi),
    192                       -size,
    193                       size* cos(vi));
     192                      -size,
     193                      size* cos(vi));
    194194    }
    195195
     
    200200      v1 = i+2;
    201201      if (i == detail -1)
    202         v2 = 2;
     202        v2 = 2;
    203203      else
    204         v2 = i+3;
     204        v2 = i+3;
    205205      this->addFace(3, VERTEX_ONLY, 0, v1, v2);
    206       this->addFace(3, VERTEX_ONLY, 1, v1, v2); 
     206      this->addFace(3, VERTEX_ONLY, 1, v1, v2);
    207207    }
    208208}
     
    219219    for (int j = 0; j < detail; j++)
    220220      {
    221         this->addVertex(((float)i/(float)(detail-1) -.5)*size,
    222                         0,
    223                         ((float)j/(float)(detail-1) -.5)*size);
    224         this->addVertexTexture((float)i/(float)(detail-1),
    225                                (float)j/(float)(detail-1));
     221        this->addVertex(((float)i/(float)(detail-1) -.5)*size,
     222                        0,
     223                        ((float)j/(float)(detail-1) -.5)*size);
     224        this->addVertexTexture((float)i/(float)(detail-1),
     225                               (float)j/(float)(detail-1));
    226226      }
    227227  //defining Faces
     
    230230    for (int j = 0; j < detail-1; j++)
    231231      {
    232         v1 = i*detail + j;
    233         v2 = (i+1)*detail + j;
    234         v3 = (i+1)*detail + (j+1);
    235         v4 = i*detail + (j+1);
    236         this->addFace(4, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3, v4, v4);
     232        v1 = i*detail + j;
     233        v2 = (i+1)*detail + j;
     234        v3 = (i+1)*detail + (j+1);
     235        v4 = i*detail + (j+1);
     236        this->addFace(4, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3, v4, v4);
    237237      }
    238238}
  • orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc

    r4675 r4678  
    5858
    5959  mod = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);
    60   CDEngine::getInstance()->debugSpawnTree(9, (sVec3D*)mod->getVertexArray(), mod->getVertexArrayCount());
     60  CDEngine::getInstance()->debugSpawnTree(9, (sVec3D*)mod->getVertexArray(), mod->getVertexCount());
    6161
    6262  /* ligths */
Note: See TracChangeset for help on using the changeset viewer.