Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4814 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection


Ignore:
Timestamp:
Jul 7, 2005, 3:27:46 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: the vertices data and the obb trees now get deleted, in the resume at the end (Class_list) there are still a number of references, will track this down now

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

Legend:

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

    r4562 r4814  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    2525   \brief standard constructor
    2626*/
    27 BoundingVolume::BoundingVolume () 
     27BoundingVolume::BoundingVolume ()
    2828{
    29    this->setClassID(CL_BOUNDING_VOLUME, "BoundingVolume"); 
     29   this->setClassID(CL_BOUNDING_VOLUME, "BoundingVolume");
    3030   this->center = new Vector();
     31   this->bOrigVertices = false;
    3132}
    3233
     
    3637
    3738*/
    38 BoundingVolume::~BoundingVolume () 
     39BoundingVolume::~BoundingVolume ()
    3940{
    4041  // delete what has to be deleted here
  • orxonox/trunk/src/lib/collision_detection/bounding_volume.h

    r4635 r4814  
    3636    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
    3839};
    3940
  • orxonox/trunk/src/lib/collision_detection/bv_tree_node.cc

    r4541 r4814  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    2424   \brief standard constructor
    2525*/
    26 BVTreeNode::BVTreeNode () 
     26BVTreeNode::BVTreeNode ()
    2727{
    28    this->setClassID(CL_BV_TREE_NODE, "BVTreeNode"); 
     28   this->setClassID(CL_BV_TREE_NODE, "BVTreeNode");
    2929
    3030}
     
    3535
    3636*/
    37 BVTreeNode::~BVTreeNode () 
     37BVTreeNode::~BVTreeNode ()
    3838{
    39   // delete what has to be deleted here
    4039}
    4140
  • orxonox/trunk/src/lib/collision_detection/obb.cc

    r4704 r4814  
    3232   this->halfLength = new float[3];
    3333   this->bCollided = false;
     34   this->vertices = NULL;
    3435}
    3536
     
    4142OBB::~OBB ()
    4243{
    43   // delete what has to be deleted here
    4444  delete [] this->axis;
    4545  delete [] this->halfLength;
     46
     47  if( this->vertices && !this->bOrigVertices)
     48  {
     49//     for(int i = 0; i < this->numOfVertices; i++)
     50//       delete [] this->vertices[i];
     51    delete this->vertices;
     52    this->vertices = NULL;
     53  }
    4654}
    4755
  • orxonox/trunk/src/lib/collision_detection/obb.h

    r4702 r4814  
    3535  float            covarianceMatrix[3][3];     //!< the covariance matrix
    3636
    37   bool                bCollided;                  //!< is true if this obb has collided
     37  bool             bCollided;                  //!< is true if this obb has collided
    3838
    3939};
  • orxonox/trunk/src/lib/collision_detection/obb_tree.cc

    r4702 r4814  
    8787OBBTree::~OBBTree ()
    8888{
    89   // delete what has to be deleted here
     89  delete this->rootNode;
    9090}
    9191
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4813 r4814  
    5050  this->nodeLeft = NULL;
    5151  this->nodeRight = NULL;
     52  this->bvElement = NULL;
    5253
    5354  if(coMat == NULL)
     
    7980OBBTreeNode::~OBBTreeNode ()
    8081{
    81 
    82   delete [] this->vertices;
    83 
    84   delete this->bvElement;
    85   delete this->nodeLeft;
    86   delete this->nodeRight;
     82  if( this->nodeLeft)
     83  {
     84    delete this->nodeLeft;
     85    this->nodeLeft = NULL;
     86  }
     87  if( this->nodeRight)
     88  {
     89    delete this->nodeRight;
     90    this->nodeRight = NULL;
     91  }
     92  printf("deleting nr %i obbTreeNode\n", this->getIndex());
     93  if( this->bvElement)
     94    delete this->bvElement;
     95  this->bvElement = NULL;
    8796}
    8897
     
    113122  PRINTF(3)("Calculated attributes3\n");
    114123
     124  /* if this is the first node, the vertices data are the original ones of the model itself, so dont delete them in cleanup */
     125  if( this->treeIndex == 1)
     126    this->bvElement->bOrigVertices = true;
    115127
    116128  if( likely( this->depth > 0))
Note: See TracChangeset for help on using the changeset viewer.