Changeset 4814 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jul 7, 2005, 3:27:46 PM (19 years ago)
- 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 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 25 25 \brief standard constructor 26 26 */ 27 BoundingVolume::BoundingVolume () 27 BoundingVolume::BoundingVolume () 28 28 { 29 this->setClassID(CL_BOUNDING_VOLUME, "BoundingVolume"); 29 this->setClassID(CL_BOUNDING_VOLUME, "BoundingVolume"); 30 30 this->center = new Vector(); 31 this->bOrigVertices = false; 31 32 } 32 33 … … 36 37 37 38 */ 38 BoundingVolume::~BoundingVolume () 39 BoundingVolume::~BoundingVolume () 39 40 { 40 41 // delete what has to be deleted here -
orxonox/trunk/src/lib/collision_detection/bounding_volume.h
r4635 r4814 36 36 sVec3D* vertices; //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred 37 37 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 38 39 }; 39 40 -
orxonox/trunk/src/lib/collision_detection/bv_tree_node.cc
r4541 r4814 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 24 24 \brief standard constructor 25 25 */ 26 BVTreeNode::BVTreeNode () 26 BVTreeNode::BVTreeNode () 27 27 { 28 this->setClassID(CL_BV_TREE_NODE, "BVTreeNode"); 28 this->setClassID(CL_BV_TREE_NODE, "BVTreeNode"); 29 29 30 30 } … … 35 35 36 36 */ 37 BVTreeNode::~BVTreeNode () 37 BVTreeNode::~BVTreeNode () 38 38 { 39 // delete what has to be deleted here40 39 } 41 40 -
orxonox/trunk/src/lib/collision_detection/obb.cc
r4704 r4814 32 32 this->halfLength = new float[3]; 33 33 this->bCollided = false; 34 this->vertices = NULL; 34 35 } 35 36 … … 41 42 OBB::~OBB () 42 43 { 43 // delete what has to be deleted here44 44 delete [] this->axis; 45 45 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 } 46 54 } 47 55 -
orxonox/trunk/src/lib/collision_detection/obb.h
r4702 r4814 35 35 float covarianceMatrix[3][3]; //!< the covariance matrix 36 36 37 bool 37 bool bCollided; //!< is true if this obb has collided 38 38 39 39 }; -
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4702 r4814 87 87 OBBTree::~OBBTree () 88 88 { 89 // delete what has to be deleted here89 delete this->rootNode; 90 90 } 91 91 -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4813 r4814 50 50 this->nodeLeft = NULL; 51 51 this->nodeRight = NULL; 52 this->bvElement = NULL; 52 53 53 54 if(coMat == NULL) … … 79 80 OBBTreeNode::~OBBTreeNode () 80 81 { 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; 87 96 } 88 97 … … 113 122 PRINTF(3)("Calculated attributes3\n"); 114 123 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; 115 127 116 128 if( likely( this->depth > 0))
Note: See TracChangeset
for help on using the changeset viewer.