Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5704 in orxonox.OLD


Ignore:
Timestamp:
Nov 22, 2005, 2:07:49 PM (18 years ago)
Author:
patrick
Message:

collision_detection: removed some more unused variables

Location:
branches/collision_detection/src/lib/collision_detection
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/collision_detection/src/lib/collision_detection/bounding_volume.cc

    r5702 r5704  
    2929   this->setClassID(CL_BOUNDING_VOLUME, "BoundingVolume");
    3030   this->center = new Vector();
    31    this->bOrigVertices = true;
    3231   this->vertices = NULL;
    3332}
     
    4241  // delete what has to be deleted here
    4342  delete this->center;
    44 
    45   if( this->vertices && !this->bOrigVertices)
    46     delete[] this->vertices;
    4743 
    4844  if( this->triangleIndexes)
  • branches/collision_detection/src/lib/collision_detection/bounding_volume.h

    r5702 r5704  
    3636    const sVec3D*       vertices;                   //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred
    3737    int                 numOfVertices;              //!< number of vertices in the vertices buffer
    38     bool                bOrigVertices;              //!< is true if the vertices pointer points to the original model data - only important for deleting
    3938    const modelInfo*    modelInf;                   //!< Reference to the model's ModelInfo
    4039    const int*          triangleIndexes;            //!< Array with the triangle indexes in modelInfo
  • branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc

    r5703 r5704  
    116116  sVec3D* verticesList;
    117117
    118   PRINT(3)("\n");
    119118  PRINTF(3)("OBB Depth: %i, tree index: %i, numVertices: %i\n", depth, treeIndex, length);
    120119  this->depth = depth;
    121120
    122 
    123   this->bvElement = new OBB();
    124  
     121  this->bvElement = new OBB(); 
    125122  this->bvElement->modelInf = &modelInf;
    126123  this->bvElement->triangleIndexes = triangleIndexes;
    127124  this->bvElement->numTriangles = length;
    128125 
    129   PRINTF(3)("Created OBBox\n");
    130126  this->calculateBoxCovariance(this->bvElement, modelInf, triangleIndexes, length);
    131   PRINTF(3)("Calculated attributes1\n");
    132127  this->calculateBoxEigenvectors(this->bvElement, modelInf, triangleIndexes, length);
    133   PRINTF(3)("Calculated attributes2\n");
    134128  this->calculateBoxAxis(this->bvElement, modelInf, triangleIndexes, length);
    135   PRINTF(3)("Calculated attributes3\n");
    136 
    137   /* if this is the first node, the vertices data are the original ones of the model itself, so dont delete them in cleanup */
    138   if( this->treeIndex == 1)
    139     this->bvElement->bOrigVertices = true;
    140 
     129
     130  /* if this is the first node, the vertices data are the original ones of the model itself,
     131     so dont delete them in cleanup */
    141132  if( likely( this->depth > 0))
    142133  {
     
    179170void OBBTreeNode::spawnBVTree(const int depth, const sVec3D *verticesList, unsigned int length)
    180171{
    181   PRINT(3)("\n");
    182   PRINTF(3)("OBB Depth: %i, tree index: %i, numVertices: %i\n", depth, treeIndex, length);
    183   this->depth = depth;
    184 
    185 
    186   this->bvElement = new OBB();
    187   this->bvElement->vertices = verticesList;
    188   this->bvElement->numOfVertices = length;
    189   PRINTF(3)("Created OBBox\n");
    190   this->calculateBoxCovariance(this->bvElement, verticesList, length);
    191   PRINTF(3)("Calculated attributes1\n");
    192   this->calculateBoxEigenvectors(this->bvElement, verticesList, length);
    193   PRINTF(3)("Calculated attributes2\n");
    194   this->calculateBoxAxis(this->bvElement, verticesList, length);
    195   PRINTF(3)("Calculated attributes3\n");
    196 
    197   /* if this is the first node, the vertices data are the original ones of the model itself, so dont delete them in cleanup */
    198   if( this->treeIndex == 1)
    199     this->bvElement->bOrigVertices = true;
    200 
    201   if( likely( this->depth > 0))
    202   {
    203     this->forkBox(this->bvElement);
    204 
    205 
    206     if(this->tmpLen1 > 2)
    207     {
    208       OBBTreeNode* node1 = new OBBTreeNode(this->obbTree);
    209       this->nodeLeft = node1;
    210       this->nodeLeft->spawnBVTree(depth - 1, this->tmpVert1, this->tmpLen1);
    211     }
    212     else
    213     {
    214       PRINTF(3)("Aboarding tree walk: less than 3 vertices left\n");
    215     }
    216 
    217     if( this->tmpLen2 > 2)
    218     {
    219       OBBTreeNode* node2 = new OBBTreeNode(this->obbTree);
    220       this->nodeRight = node2;
    221       this->nodeRight->spawnBVTree(depth - 1, this->tmpVert2, this->tmpLen2);
    222     }
    223     else
    224     {
    225       PRINTF(3)("Abording tree walk: less than 3 vertices left\n");
    226     }
    227   }
     172//   PRINT(3)("\n");
     173//   PRINTF(3)("OBB Depth: %i, tree index: %i, numVertices: %i\n", depth, treeIndex, length);
     174//   this->depth = depth;
     175//
     176//
     177//   this->bvElement = new OBB();
     178//   this->bvElement->vertices = verticesList;
     179//   this->bvElement->numOfVertices = length;
     180//   PRINTF(3)("Created OBBox\n");
     181//   this->calculateBoxCovariance(this->bvElement, verticesList, length);
     182//   PRINTF(3)("Calculated attributes1\n");
     183//   this->calculateBoxEigenvectors(this->bvElement, verticesList, length);
     184//   PRINTF(3)("Calculated attributes2\n");
     185//   this->calculateBoxAxis(this->bvElement, verticesList, length);
     186//   PRINTF(3)("Calculated attributes3\n");
     187//
     188//
     189//
     190//   if( likely( this->depth > 0))
     191//   {
     192//     this->forkBox(this->bvElement);
     193//
     194//
     195//     if(this->tmpLen1 > 2)
     196//     {
     197//       OBBTreeNode* node1 = new OBBTreeNode(this->obbTree);
     198//       this->nodeLeft = node1;
     199//       this->nodeLeft->spawnBVTree(depth - 1, this->tmpVert1, this->tmpLen1);
     200//     }
     201//     else
     202//     {
     203//       PRINTF(3)("Aboarding tree walk: less than 3 vertices left\n");
     204//     }
     205//
     206//     if( this->tmpLen2 > 2)
     207//     {
     208//       OBBTreeNode* node2 = new OBBTreeNode(this->obbTree);
     209//       this->nodeRight = node2;
     210//       this->nodeRight->spawnBVTree(depth - 1, this->tmpVert2, this->tmpLen2);
     211//     }
     212//     else
     213//     {
     214//       PRINTF(3)("Abording tree walk: less than 3 vertices left\n");
     215//     }
     216//   }
    228217}
    229218
     
    235224void OBBTreeNode::calculateBoxCovariance(OBB* box, const sVec3D* verticesList, unsigned int length)
    236225{
     226  PRINTF(3)("Created OBBox\n");
     227 
    237228  float     facelet[length];                         //!< surface area of the i'th triangle of the convex hull
    238229  float     face = 0.0f;                             //!< surface area of the entire convex hull
     
    428419void OBBTreeNode::calculateBoxEigenvectors(OBB* box, const sVec3D* verticesList, unsigned int length)
    429420{
    430 
     421  PRINTF(3)("Calculated attributes1\n");
    431422  /* now getting spanning vectors of the sub-space:
    432423  the eigenvectors of a symmertric matrix, such as the
     
    484475void OBBTreeNode::calculateBoxAxis(OBB* box, const sVec3D* verticesList, unsigned int length)
    485476{
    486 
     477  PRINTF(3)("Calculated attributes3\n");
    487478  /* now get the axis length */
    488479  Line                ax[3];                                 //!< the axis
  • branches/collision_detection/src/lib/collision_detection/obb_tree_node.h

    r5703 r5704  
    2626  public:
    2727    OBBTreeNode(const OBBTree* tree);
     28    OBBTreeNode(const OBBTree* tree, bool bRoot);
    2829    virtual ~OBBTreeNode();
    2930
Note: See TracChangeset for help on using the changeset viewer.