Add a destructor to ColladaConverter.

Two minor fixes to ColladaConverter as well.
This commit is contained in:
john.mccutchan 2008-04-28 21:53:10 +00:00
parent e746310596
commit bce0047986
2 changed files with 20 additions and 3 deletions

View File

@ -154,6 +154,17 @@ m_use32bitIndices(true),
m_use4componentVertices(true)
{
}
ColladaConverter::~ColladaConverter ()
{
if (m_collada)
delete m_collada;
DAE::cleanup ();
m_collada = NULL;
m_dom = NULL;
}
bool ColladaConverter::load(const char* orgfilename)
@ -211,6 +222,8 @@ void ColladaConverter::reset ()
if (m_collada)
delete m_collada;
DAE::cleanup ();
m_collada = NULL;
m_dom = NULL;
}
@ -2898,7 +2911,7 @@ void ColladaConverter::ConvertRigidBodyRef( btRigidBodyInput& rbInput,btRigidBod
{
//ReadGeometry( );
domGeometryRef lib = libgeom->getGeometry_array()[i];
if (!strcmp(lib->getId(),urlref2))
if (!strcmp(lib->getId(),urlref2+1)) // skip the # at the front of urlref2
{
//found convex_hull geometry
domMesh *meshElement = lib->getMesh();//linkedGeom->getMesh();
@ -3238,7 +3251,10 @@ const char* ColladaConverter::getName (btRigidBody* body)
if (!rbci)
return NULL;
return rbci->m_node->getSid();
if (rbci->m_node->getId())
return rbci->m_node->getId();
else
return rbci->m_node->getSid();
}
void ColladaConverter::registerConstraint(btTypedConstraint* constraint, const char* name)
@ -3293,4 +3309,4 @@ const char* ColladaConverter::getName (btTypedConstraint* constraint)
return NULL;
return rcci->m_domRigidConstraint->getSid();
}
}

View File

@ -150,6 +150,7 @@ protected:
void syncOrAddConstraint (btTypedConstraint* constraint);
public:
ColladaConverter(btDynamicsWorld* dynaWorld);
virtual ~ColladaConverter ();
///load a COLLADA .dae file
bool load(const char* filename);