Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4674 in orxonox.OLD


Ignore:
Timestamp:
Jun 23, 2005, 10:02:31 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: the bounding boxes are now aligned to the vertices, finally! Now it realy looks reasonable - now comes collision detection itself … hehhehehehehe

Location:
orxonox/trunk/src/lib/collision_detection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/lin_alg.h

    r4630 r4674  
    2727int     i,j,ip,iq;
    2828
    29 void *vmblock1 = NULL;
     29// void *vmblock1 = NULL;
    3030
    3131  //allocate vectors B, Z
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4673 r4674  
    149149  Vector    t1, t2;                                  //!< temporary values
    150150  float     covariance[3][3];                        //!< the covariance matrix
    151   int       mode = 3;                                //!< mode = 0: vertex soup, no connections, mode = 1: 3 following verteces build a triangle
     151  int       mode = 0;                                //!< mode = 0: vertex soup, no connections, mode = 1: 3 following verteces build a triangle
    152152
    153153  this->numOfVertices = length;
     
    305305
    306306
    307 //   PRINTF(3)("\nCovariance Matrix:\n");
    308 //   for(int j = 0; j < 3; ++j)
    309 //   {
    310 //     PRINTF(3)(" |");
    311 //     for(int k = 0; k < 3; ++k)
    312 //     {
    313 //       PRINTF(3)(" \b%f ", covariance[j][k]);
    314 //     }
    315 //     PRINTF(3)(" |\n");
    316 //   }
     307  PRINTF(0)("\nCovariance Matrix:\n");
     308  for(int j = 0; j < 3; ++j)
     309  {
     310    PRINT(0)(" |");
     311    for(int k = 0; k < 3; ++k)
     312    {
     313      PRINT(0)(" \b%f ", covariance[j][k]);
     314    }
     315    PRINT(0)(" |\n");
     316  }
     317
    317318  PRINTF(3)("center: %f, %f, %f\n", center.x, center.y, center.z);
    318319
    319320
    320 //   for(int i = 0; i < 3; ++i)
    321 //   {
    322 //     box->covarianceMatrix[i][0] = covariance[i][0];
    323 //     box->covarianceMatrix[i][1] = covariance[i][1];
    324 //     box->covarianceMatrix[i][3] = covariance[i][2];
    325 //   }
     321  for(int i = 0; i < 3; ++i)
     322  {
     323    box->covarianceMatrix[i][0] = covariance[i][0];
     324    box->covarianceMatrix[i][1] = covariance[i][1];
     325    box->covarianceMatrix[i][2] = covariance[i][2];
     326  }
    326327  *box->center = center;
    327328  PRINTF(3)("-- Written Result to obb\n");
     
    368369  PRINTF(3)("-- Got Axis\n");
    369370
    370   PRINTF(3)("eigenvector: %f, %f, %f\n", box->axis[0].x, box->axis[0].y, box->axis[0].z);
    371   PRINTF(3)("eigenvector: %f, %f, %f\n", box->axis[1].x, box->axis[1].y, box->axis[1].z);
    372   PRINTF(3)("eigenvector: %f, %f, %f\n", box->axis[2].x, box->axis[2].y, box->axis[2].z);
     371  PRINTF(0)("eigenvector: %f, %f, %f\n", box->axis[0].x, box->axis[0].y, box->axis[0].z);
     372  PRINTF(0)("eigenvector: %f, %f, %f\n", box->axis[1].x, box->axis[1].y, box->axis[1].z);
     373  PRINTF(0)("eigenvector: %f, %f, %f\n", box->axis[2].x, box->axis[2].y, box->axis[2].z);
    373374}
    374375
     
    455456   for(int i = 0; i < 3; ++i)
    456457     {
    457        PRINTF(0)("max: %f, min: %f \n", maxLength[i], minLength[i]);
     458       PRINTF(3)("max: %f, min: %f \n", maxLength[i], minLength[i]);
    458459       centerOffset[i] = (maxLength[i] + minLength[i]) / 2.0f; // min length is negatie
    459460       newHalfLength[i] = (maxLength[i] - minLength[i]) / 2.0f; // min length is negative
    460        //PRINTF(0)("Center Orig: %f, %f, %f ---- new: %f, %f, %f", box->center[]);
    461461       *box->center +=  (box->axis[i] * centerOffset[i]);            // update the new center vector
    462        //PRINTF(0)("Center Translation Operation: halfLength old: %f, new: %f\n", halfLength[i], center[i]);
    463462       halfLength[i] = newHalfLength[i];
    464463     }
     
    638637
    639638  /* draw world axes */
    640 //   glBegin(GL_LINES);
    641 //   glColor3f(0.0, 0.4, 0.3);
    642 //   glVertex3f(0.0, 0.0, 0.0);
    643 //   glVertex3f(3.0, 0.0, 0.0);
    644 //
    645 //   glVertex3f(0.0, 0.0, 0.0);
    646 //   glVertex3f(0.0, 3.0, 0.0);
    647 //
    648 //   glVertex3f(0.0, 0.0, 0.0);
    649 //   glVertex3f(0.0, 0.0, 3.0);
    650 //   glEnd();
     639  glBegin(GL_LINES);
     640  glColor3f(0.0, 0.4, 0.3);
     641  glVertex3f(0.0, 0.0, 0.0);
     642  glVertex3f(3.0, 0.0, 0.0);
     643
     644  glVertex3f(0.0, 0.0, 0.0);
     645  glVertex3f(0.0, 3.0, 0.0);
     646
     647  glVertex3f(0.0, 0.0, 0.0);
     648  glVertex3f(0.0, 0.0, 3.0);
     649  glEnd();
    651650
    652651
     
    677676
    678677
     678  /* DRAW POLYGONS */
    679679  if( drawMode & DRAW_BV_POLYGON || drawMode & DRAW_ALL || drawMode & DRAW_BV_BLENDED)
    680680  {
     
    802802  }
    803803
     804  /* DRAW SEPARATING PLANE */
    804805  if( drawMode & DRAW_SEPARATING_PLANE || drawMode & DRAW_ALL)
    805806  {
Note: See TracChangeset for help on using the changeset viewer.