Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 9, 2005, 12:21:08 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: compiles again, some smaller changes in the cd engine

File:
1 edited

Legend:

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

    r4557 r4560  
    5656{
    5757  this->bvElement = this->createBox();
    58   this->calculateBoxAttributes(box);
    59   this->forkBox(box);
     58  this->calculateBoxAttributes(this->bvElement, verticesList, length);
     59  this->forkBox(this->bvElement);
    6060}
    6161
     
    6767
    6868
    69 void OBBTreeNode::calculateBoxAttributes(OBB* box)
     69void OBBTreeNode::calculateBoxAttributes(OBB* box, sVec3D* verticesList, int length)
    7070{
    7171  float     facelet[length];                         //!< surface area of the i'th triangle of the convex hull
     
    7575  Vector    p, q, r;                                 //!< holder of the polygon data, much more conveniant to work with Vector than sVec3d
    7676  Vector    t1, t2;                                  //!< temporary values
    77   float     covariance[3][3];                        //!< the covariance matrix
     77  float**   covariance;                               //!< the covariance matrix
    7878   
    7979  this->numOfVertices = length;
     
    130130      printf(" |\n");
    131131    }
    132   printf("center: %f, %f, %f\n\n", centre.x, centre.y, centre.z);
     132  printf("center: %f, %f, %f\n\n", center.x, center.y, center.z);
    133133
    134134  for(int i = 0; i < length; i++)
     
    137137    }
    138138
    139 
     139   
     140  for(int i = 0; i < 3; ++i)
     141    {
    140142   
    141   box->covarianceMatrix = covariance;
    142   box->center = center;
     143      box->covarianceMatrix[i][0] = covariance[i][0];
     144      box->covarianceMatrix[i][1] = covariance[i][1];
     145      box->covarianceMatrix[i][3] = covariance[i][2];
     146    }
     147  *box->center = center;
    143148
    144149
     
    161166  for(int i = 0; i < 3; ++i)
    162167    {
    163       if( aLength < box->axis[i])
     168      if( aLength < box->axis[i].len())
    164169        {
    165           aLength = box->axis[i];
     170          aLength = box->axis[i].len();
    166171          axisNr = i;
    167172        }
     
    194199  this->bvElement->axis;
    195200 
    196   glBegin(GL_TRIANGLE);
    197   glVertex3f(this->bvElement->center );
    198   glEnd();
     201  //glBegin(GL_TRIANGLE);
     202  //glVertex3f(this->bvElement->center );
     203  //glEnd();
    199204}
    200205
Note: See TracChangeset for help on using the changeset viewer.