Index: trunk/src/lib/graphics/importer/static_model.cc
===================================================================
--- trunk/src/lib/graphics/importer/static_model.cc	(revision 7676)
+++ trunk/src/lib/graphics/importer/static_model.cc	(revision 7711)
@@ -196,4 +196,5 @@
   this->buildTriangleList();
 
+  // write out the modelInfo data used for the collision detection!
   this->pModelInfo.pVertices = &this->vertices[0];
   this->pModelInfo.pNormals = &this->normals[0];
@@ -805,9 +806,11 @@
     this->buildVertexNormals();
 
-  int index = 0;                   //!< the counter for the triangle array
-  ModelFaceElement* tmpElem;       //!< the temporary faceelement reference
-  ModelFace* tmpFace;              //!< the temporary face referece
+  int                index = 0;                   //!< the counter for the triangle array
+  ModelFaceElement*  tmpElem;       //!< the temporary faceelement reference
+  ModelFace*         tmpFace;              //!< the temporary face referece
 
   bool warned = false;
+
+  this->pModelInfo.numTriangles = 0;
 
   /* count the number of triangles */
@@ -819,22 +822,16 @@
     while( tmpFace != NULL)
     {
-
       /* if its a triangle just add it to the list */
-      if( tmpFace->vertexCount == 3)
-      {
+      if( tmpFace->vertexCount == 3){
         ++this->pModelInfo.numTriangles;
       } /* if the polygon is a quad */
-      else if( tmpFace->vertexCount == 4)
-      {
+      else if( tmpFace->vertexCount == 4) {
         this->pModelInfo.numTriangles += 2;
       }
-      else if( tmpFace->vertexCount > 4)
-      {
-        if (!warned)
-        {
+      else if( tmpFace->vertexCount > 4) {
+        if (!warned)        {
           PRINTF(2)("This model (%s) got over 4 vertices per face <=> conflicts in the CD engine!\n", this->getName());
           warned = true;
         }
-        //exit(0);
       }
       tmpFace = tmpFace->next;
@@ -859,5 +856,4 @@
   while( this->currentGroup != NULL)
   {
-    // Putting Faces to GL
     tmpFace = this->currentGroup->firstFace;
     while( tmpFace != NULL)
@@ -870,8 +866,9 @@
         for( int j = 0; j < 3; ++j)
         {
-          this->pModelInfo.pTriangles[index].indexToVertices[j] = (unsigned int)tmpElem->vertexNumber /* * 3 */;
-          this->pModelInfo.pTriangles[index].indexToNormals[j] = (unsigned int)tmpElem->normalNumber /* * 3 */;
-          this->pModelInfo.pTriangles[index].indexToTexCoor[j] = (unsigned int)tmpElem->texCoordNumber /* * 3 */;
+          this->pModelInfo.pTriangles[index].indexToVertices[j] = (unsigned int)tmpElem->vertexNumber * 3 ;
+          this->pModelInfo.pTriangles[index].indexToNormals[j] = (unsigned int)tmpElem->normalNumber * 3 ;
+          this->pModelInfo.pTriangles[index].indexToTexCoor[j] = (unsigned int)tmpElem->texCoordNumber * 3 ;
           tmpElem = tmpElem->next;
+
         }
         ++index;
@@ -880,30 +877,30 @@
       {
 
-        this->pModelInfo.pTriangles[index].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber;
-        this->pModelInfo.pTriangles[index].indexToNormals[0] = (unsigned int)tmpElem->normalNumber;
-        this->pModelInfo.pTriangles[index].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber;
-
-        this->pModelInfo.pTriangles[index + 1].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber;
-        this->pModelInfo.pTriangles[index + 1].indexToNormals[0] = (unsigned int)tmpElem->normalNumber;
-        this->pModelInfo.pTriangles[index + 1].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber;
+        this->pModelInfo.pTriangles[index].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToNormals[0] = (unsigned int)tmpElem->normalNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber * 3;
+
+        this->pModelInfo.pTriangles[index + 1].indexToVertices[0] = (unsigned int)tmpElem->vertexNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToNormals[0] = (unsigned int)tmpElem->normalNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToTexCoor[0] = (unsigned int)tmpElem->texCoordNumber * 3;
         tmpElem = tmpElem->next;
 
-        this->pModelInfo.pTriangles[index].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber;
-        this->pModelInfo.pTriangles[index].indexToNormals[1] = (unsigned int)tmpElem->normalNumber;
-        this->pModelInfo.pTriangles[index].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber;
+        this->pModelInfo.pTriangles[index].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToNormals[1] = (unsigned int)tmpElem->normalNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber * 3;
         tmpElem = tmpElem->next;
 
-        this->pModelInfo.pTriangles[index].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber;
-        this->pModelInfo.pTriangles[index].indexToNormals[2] = (unsigned int)tmpElem->normalNumber;
-        this->pModelInfo.pTriangles[index].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber;
-
-        this->pModelInfo.pTriangles[index + 1].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber;
-        this->pModelInfo.pTriangles[index + 1].indexToNormals[2] = (unsigned int)tmpElem->normalNumber;
-        this->pModelInfo.pTriangles[index + 1].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber;
+        this->pModelInfo.pTriangles[index].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToNormals[2] = (unsigned int)tmpElem->normalNumber * 3;
+        this->pModelInfo.pTriangles[index].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber * 3;
+
+        this->pModelInfo.pTriangles[index + 1].indexToVertices[2] = (unsigned int)tmpElem->vertexNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToNormals[2] = (unsigned int)tmpElem->normalNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToTexCoor[2] = (unsigned int)tmpElem->texCoordNumber * 3;
         tmpElem = tmpElem->next;
 
-        this->pModelInfo.pTriangles[index + 1].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber;
-        this->pModelInfo.pTriangles[index + 1].indexToNormals[1] = (unsigned int)tmpElem->normalNumber;
-        this->pModelInfo.pTriangles[index + 1].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber;
+        this->pModelInfo.pTriangles[index + 1].indexToVertices[1] = (unsigned int)tmpElem->vertexNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToNormals[1] = (unsigned int)tmpElem->normalNumber * 3;
+        this->pModelInfo.pTriangles[index + 1].indexToTexCoor[1] = (unsigned int)tmpElem->texCoordNumber * 3;
 
         index += 2;
