Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4109 in orxonox.OLD


Ignore:
Timestamp:
May 7, 2005, 5:10:38 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: little error in model, and also a speed-fix in Array

Location:
orxonox/trunk/src/lib/graphics/importer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/importer/array.cc

    r3590 r4109  
    112112 
    113113/**
    114    \brief Gives back the array !! MUST be executed AFTER finalize.
    115    \returns The created array.
    116 */
    117 GLfloat* Array::getArray ()
    118 {
    119   return this->array;
    120 }
    121 
    122 /**
    123    \returns The Count of entries in the Array
    124 */
    125 int Array::getCount()
    126 {
    127   return this->entryCount;
    128 }
    129 
    130 /**
    131114   \brief Simple debug info about the Array
    132115*/
    133 void Array::debug ()
     116void Array::debug (void) const
    134117{
    135118  PRINT(0)("entryCount=%i, address=%p\n", this->entryCount, this->array);
  • orxonox/trunk/src/lib/graphics/importer/array.h

    r3590 r4109  
    2323  void addEntry(GLfloat entry0, GLfloat entry1, GLfloat entry2);
    2424 
    25   GLfloat* getArray ();
    26   int getCount();
    27   void debug(void);
     25  /** \returns The array */
     26  inline const GLfloat* getArray () const {return this->array;}
     27  /**   \returns The Count of entries in the Array*/
     28  inline int getCount(void)const {return this->entryCount;}
     29  void debug(void) const ;
    2830 private:
    2931  //! One entry of the Array
  • orxonox/trunk/src/lib/graphics/importer/model.cc

    r4108 r4109  
    3636ModelFaceElement::ModelFaceElement()
    3737{
     38  this->vertexNumber = -1;
     39  this->normalNumber = -1;
     40  this->texCoordNumber = -1;   
     41
    3842  this->next = NULL;
    3943}
     
    556560      if (vertex)
    557561        tmpElem->vertexNumber = atoi(vertex)-1;
    558       else
    559         tmpElem->vertexNumber = -1;
    560562      if (texture)
    561563        tmpElem->texCoordNumber = atoi(texture)-1;
    562       else
    563         tmpElem->texCoordNumber = -1;
    564564      if (normal)
    565565        tmpElem->normalNumber = atoi(normal)-1;
    566       else
    567         tmpElem->normalNumber = -1;
    568566
    569567      faceString += tmpLen;
     
    845843  if (elem->texCoordNumber != -1)
    846844    {
    847       if (likely(elem->texCoordNumber <= this->texCoordCount))
     845      if (likely(elem->texCoordNumber < this->texCoordCount))
    848846        glTexCoord2fv(this->vTexture->getArray() + elem->texCoordNumber * 2);
    849847      else
     
    853851  if (elem->normalNumber != -1)
    854852    {
    855     if (likely(elem->normalNumber <= this->normalCount))
     853    if (likely(elem->normalNumber < this->normalCount))
    856854      glNormal3fv(this->normals->getArray() + elem->normalNumber * 3);
    857855    else
     
    861859  if (elem->vertexNumber != -1)
    862860    {
    863       if (likely(elem->vertexNumber <= this->vertexCount))
     861      if (likely(elem->vertexNumber < this->vertexCount -1000))
    864862          glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3);
    865863      else
Note: See TracChangeset for help on using the changeset viewer.