Add a destructor to ColladaConverter.
Two minor fixes to ColladaConverter as well.
This commit is contained in:
@@ -154,6 +154,17 @@ m_use32bitIndices(true),
|
|||||||
m_use4componentVertices(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)
|
bool ColladaConverter::load(const char* orgfilename)
|
||||||
@@ -211,6 +222,8 @@ void ColladaConverter::reset ()
|
|||||||
if (m_collada)
|
if (m_collada)
|
||||||
delete m_collada;
|
delete m_collada;
|
||||||
|
|
||||||
|
DAE::cleanup ();
|
||||||
|
|
||||||
m_collada = NULL;
|
m_collada = NULL;
|
||||||
m_dom = NULL;
|
m_dom = NULL;
|
||||||
}
|
}
|
||||||
@@ -2898,7 +2911,7 @@ void ColladaConverter::ConvertRigidBodyRef( btRigidBodyInput& rbInput,btRigidBod
|
|||||||
{
|
{
|
||||||
//ReadGeometry( );
|
//ReadGeometry( );
|
||||||
domGeometryRef lib = libgeom->getGeometry_array()[i];
|
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
|
//found convex_hull geometry
|
||||||
domMesh *meshElement = lib->getMesh();//linkedGeom->getMesh();
|
domMesh *meshElement = lib->getMesh();//linkedGeom->getMesh();
|
||||||
@@ -3238,7 +3251,10 @@ const char* ColladaConverter::getName (btRigidBody* body)
|
|||||||
if (!rbci)
|
if (!rbci)
|
||||||
return NULL;
|
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)
|
void ColladaConverter::registerConstraint(btTypedConstraint* constraint, const char* name)
|
||||||
@@ -3293,4 +3309,4 @@ const char* ColladaConverter::getName (btTypedConstraint* constraint)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return rcci->m_domRigidConstraint->getSid();
|
return rcci->m_domRigidConstraint->getSid();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ protected:
|
|||||||
void syncOrAddConstraint (btTypedConstraint* constraint);
|
void syncOrAddConstraint (btTypedConstraint* constraint);
|
||||||
public:
|
public:
|
||||||
ColladaConverter(btDynamicsWorld* dynaWorld);
|
ColladaConverter(btDynamicsWorld* dynaWorld);
|
||||||
|
virtual ~ColladaConverter ();
|
||||||
|
|
||||||
///load a COLLADA .dae file
|
///load a COLLADA .dae file
|
||||||
bool load(const char* filename);
|
bool load(const char* filename);
|
||||||
|
|||||||
Reference in New Issue
Block a user