Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7665 in orxonox.OLD for branches/cd/src


Ignore:
Timestamp:
May 18, 2006, 1:24:56 AM (19 years ago)
Author:
patrick
Message:

cd: getting hotter here. problem seems to be in the modelInfo structure

Location:
branches/cd/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cd/src/lib/collision_detection/obb_tree_node.cc

    r7660 r7665  
    131131    for(int j = 0; j < 3; ++j)
    132132    {
    133       PRINTF(2)("  vertex[%i]: %f, %f, %f\n", j, (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[j]])[0],
     133      PRINTF(2)("  vertex[%i]: %f, %f, %f\n", j,
     134      (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[j]])[0],
    134135      (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[j]])[1],
    135136      (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[i]].indexToVertices[j]])[2]);
     
    137138  }
    138139
     140  PRINT(0)("\n\n\n");
     141  for( int i = 0; i < this->bvElement->modelInf->numVertices*3; i+=3)
     142    PRINTF(0)(  "vertex[%i]: %f, %f, %f\n", i, this->bvElement->modelInf->pVertices[i],
     143               this->bvElement->modelInf->pVertices[i+1],
     144               this->bvElement->modelInf->pVertices[i+2]);
    139145
    140146
     
    280286  /* calculate the axis */
    281287  covMat.getEigenVectors(axis[0], axis[1], axis[2] );
    282   box.axis[0] = axis[0];
    283   box.axis[1] = axis[1];
    284   box.axis[2] = axis[2];
     288//   box.axis[0] = axis[0];
     289//   box.axis[1] = axis[1];
     290//   box.axis[2] = axis[2];
    285291
    286292  box.axis[0] = Vector(1,0,0);
     
    319325  float               centerOffset[3];
    320326
    321 
    322 
    323327  /* get the maximal dimensions of the body in all directions */
    324328  /* for the initialisation the value just has to be inside of the polygon soup -> first vertices (rand) */
     
    335339    maxLength[k] = p->distancePoint(tmpVec);
    336340    minLength[k] = p->distancePoint(tmpVec);
    337 
     341    PRINT(0)("axis[%i]: %f %f %f\n", k, box.axis[k].x, box.axis[k].y, box.axis[k].z);
    338342
    339343    for( int j = 0; j < length; ++j) {
     
    341345        tmpVec = &modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]];
    342346        tmpLength = p->distancePoint(tmpVec);
     347        PRINT(0)("vertex normal vec: %i, (%f, %f, %f) distance = %f\n", k, (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]])[0],
     348        (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]])[1],
     349        (&modelInf.pVertices[modelInf.pTriangles[triangleIndexes[j]].indexToVertices[i]])[2],
     350        tmpLength);
    343351        if( tmpLength > maxLength[k])
    344352          maxLength[k] = tmpLength;
     
    393401  }
    394402
    395   // FIXME: += anstatt -= ????????? verwirr
    396403  box.center.x += centerOffset[0];
    397404  box.center.y += centerOffset[1];
     
    710717        glBegin(GL_POINTS);
    711718        glColor3f(0.3, 0.8, 0.54);
    712         for( int i = 0; i < this->bvElement->modelInf->numVertices*3; i+=3)
    713           glVertex3f(this->bvElement->modelInf->pVertices[i],
    714                      this->bvElement->modelInf->pVertices[i+1],
    715                      this->bvElement->modelInf->pVertices[i+2]);
     719        for( int i = 0; i < this->bvElement->modelInf->numTriangles; ++i)
     720        {
     721          PRINTF(2)("triangle[%i]\n", i);
     722          for(int j = 0; j < 3; ++j)
     723          {
     724            glVertex3f(
     725                (&this->bvElement->modelInf->pVertices[this->bvElement->modelInf->pTriangles[i].indexToVertices[j]])[0],
     726                (&this->bvElement->modelInf->pVertices[this->bvElement->modelInf->pTriangles[i].indexToVertices[j]])[1],
     727                (&this->bvElement->modelInf->pVertices[this->bvElement->modelInf->pTriangles[i].indexToVertices[j]])[2]);
     728          }
     729        }
     730
     731//         for( int i = 0; i < this->bvElement->modelInf->numVertices*3; i+=3)
     732//           glVertex3f(this->bvElement->modelInf->pVertices[i],
     733//                      this->bvElement->modelInf->pVertices[i+1],
     734//                      this->bvElement->modelInf->pVertices[i+2]);
    716735        glEnd();
    717736      }
  • branches/cd/src/subprojects/collision_detection/collision_detection.cc

    r7660 r7665  
    267267  while( entity != NULL)
    268268  {
    269     //if( likely(drawModel))
     269    if( likely(drawModel))
    270270      entity->draw();
    271271    entity->drawBVTree(depth, drawMode);
Note: See TracChangeset for help on using the changeset viewer.