Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

orxonox/trunk: calculating box dimensions

File:
1 edited

Legend:

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

    r4573 r4576  
    166166     vectors
    167167  */
    168 
    169168  Matrix                V(3,3);                               //!< for eigenvectors
    170169  DiagonalMatrix        D(3);                                 //!< for eigenvalues   
    171170  SymmetricMatrix       C(3);                                 //!< for the covariance symmetrical matrix
    172   Vector**              axis;                                 //!< the references to the obb axis
     171  Vector**              axis = new Vector*[3];                //!< the references to the obb axis
    173172 
    174173  C(1,1) = covariance[0][0];
     
    196195  }
    197196
    198    //axis1 =
    199 
     197  axis[0] = new Vector(V(1, 1), V(2, 1), V(3, 1));
     198  axis[1] = new Vector(V(1, 2), V(2, 2), V(3, 2));
     199  axis[2] = new Vector(V(1, 3), V(2, 3), V(3, 3));
     200  box->axis = axis;
     201 
     202  printf("eigenvector: %f, %f, %f\n", V(1, 1), V(2, 1), V(3, 1));
     203  printf("eigenvector: %f, %f, %f\n", V(1, 2), V(2, 2), V(3, 2));
     204  printf("eigenvector: %f, %f, %f\n", V(1, 3), V(2, 3), V(3, 3));
     205
     206
     207  /* 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 
    200214}
    201215
     
    208222  for(int i = 0; i < 3; ++i)
    209223    {
    210       if( aLength < box->axis[i].len())
     224      if( aLength < box->axis[i]->len())
    211225        {
    212           aLength = box->axis[i].len();
     226          aLength = box->axis[i]->len();
    213227          axisNr = i;
    214228        }
Note: See TracChangeset for help on using the changeset viewer.