/* * Deletes any edges to a vertex in a binary tree */ void deleteEdges(binTreeNode_t * pBinaryNode, int tarVertID) { /* delete the edge in this node */ if(pBinaryNode->value != NULL) { deleteNode((linkedList_t *) pBinaryNode->value, tarVertID); } /* run this function recursivly on all children */ if(pBinaryNode->left != NULL) { deleteEdges(pBinaryNode->left, tarVertID); } if(pBinaryNode->right != NULL) { deleteEdges(pBinaryNode->right, tarVertID); } }
RigidBody::~RigidBody() { // delete our faces, edges, vertices, and normals deleteFaces(); deleteEdges(edges); // Since nonParallelEdges is a list of pointers to some // of the edge objects in "edges" (i.e. re-use of same // edge objects) we don't need to delete them again, just // clear the list. nonParallelEdges.clear(); deleteVectorList(verticesWorld); deleteVectorList(verticesObject); deleteVectorList(normalsWorld); deleteVectorList(normalsObject); hlDeleteShapes(shapeId, 1); }