Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 10, 2005, 2:52:46 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: box dimension alg implemented, got some incontinuities

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4576 r4578  
    136136    }
    137137
    138  
    139   printf("Covariance Matrix:\n");
     138    printf("\nVertex Data:\n");
     139    for(int i = 0; i < length; i++)
     140    {
     141      printf("vertex %i: %f, %f, %f\n", i, verticesList[i][0], verticesList[i][1], verticesList[i][2]);
     142    }
     143 
     144  printf("\nCovariance Matrix:\n");
    140145  for(int j = 0; j < 3; ++j)
    141146    {
     
    206211
    207212  /* now get the axis length */
    208   Line                ax1(*box->center, *box->axis[0]);      //!< the the axis representation
    209   Line                ax2(*box->center, *box->axis[1]);      //!< the the axis representation
    210   Line                ax3(*box->center, *box->axis[2]);      //!< the the axis representation
    211  
    212 
    213  
     213  Line                ax[3];                                 //!< the axis
     214  float*              halfLength = new float[3];             //!< half length of the axis
     215  float               tmpLength;                             //!< tmp save point for the length
     216 
     217  ax[0].r = *box->center; ax[0].a = *box->axis[0];
     218  ax[1].r = *box->center; ax[1].a = *box->axis[1];
     219  ax[2].r = *box->center; ax[2].a = *box->axis[2];
     220
     221  for(int i = 0; i < 3; ++i)
     222  {
     223    for(int j = 0; j < length; ++j)
     224    {
     225      tmpLength = ax[i].distancePoint(vertices[j]);
     226      if( tmpLength > halfLength[i])
     227        halfLength[i] = tmpLength;
     228    }
     229  }
     230
     231  printf("we got length: \n");
     232  for(int i = 0; i < 3; ++i)
     233    printf("length[%i] = %f\n", i, halfLength[i]);
    214234}
    215235
Note: See TracChangeset for help on using the changeset viewer.