cleanup of Stan Melax ConvexHull utility, all memory allocations go through btAlignedAlloc/btAlignedFree, instead of new/delete.

It can be moved into Bullet/src now.
This commit is contained in:
erwin.coumans
2008-04-10 05:36:17 +00:00
parent 7066c43d79
commit 03d846add0
4 changed files with 260 additions and 793 deletions

View File

@@ -70,14 +70,13 @@ btShapeHull::btShapeHull (const btConvexShape* shape)
{
m_shape = shape;
m_vertices.clear ();
m_indices = NULL;
m_indices.clear();
m_numIndices = 0;
}
btShapeHull::~btShapeHull ()
{
if (m_indices)
delete [] m_indices;
m_indices.clear();
m_vertices.clear ();
}
@@ -130,13 +129,13 @@ btShapeHull::buildHull (btScalar margin)
for (i = 0; i < hr.mNumOutputVertices; i++)
{
m_vertices[i] = hr.mOutputVertices[i];
m_vertices[i] = hr.m_OutputVertices[i];
}
m_numIndices = hr.mNumIndices;
m_indices = new unsigned int [m_numIndices];
m_indices.resize(m_numIndices);
for (i = 0; i < m_numIndices; i++)
{
m_indices[i] = hr.mIndices[i];
m_indices[i] = hr.m_Indices[i];
}
// free temporary hull result that we just copied