mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-10 17:30:12 +00:00
Add a destructor to ColladaConverter.
Two minor fixes to ColladaConverter as well.
This commit is contained in:
parent
e746310596
commit
bce0047986
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user