added a destructor to OdeWorld::Object to clean up the ODE body and geometries
git-svn-id: svn://anubis/misc/OdeWorld@170 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
parent
8f95a9fed4
commit
e9d8872826
@ -168,6 +168,14 @@ OdeWorld::Object::Object(const OdeWorld::Object & orig)
|
||||
}
|
||||
}
|
||||
|
||||
OdeWorld::Object::~Object()
|
||||
{
|
||||
for (int i = 0, sz = m_geoms.size(); i < sz; i++)
|
||||
dGeomDestroy(m_geoms[i]);
|
||||
if (m_body != 0)
|
||||
dBodyDestroy(m_body);
|
||||
}
|
||||
|
||||
dGeomID OdeWorld::Object::cloneGeom(dGeomID geom, dBodyID body)
|
||||
{
|
||||
dGeomID id = 0;
|
||||
|
@ -18,6 +18,7 @@ class OdeWorld
|
||||
public:
|
||||
Object(bool is_static, dWorldID world, dSpaceID space);
|
||||
Object(const Object & orig);
|
||||
~Object();
|
||||
|
||||
void loadPhy(const std::string & path);
|
||||
void setPosition(double x, double y, double z);
|
||||
@ -62,7 +63,6 @@ class OdeWorld
|
||||
dWorldID m_world;
|
||||
dSpaceID m_space;
|
||||
dJointGroupID m_contactJointGroup;
|
||||
std::map<std::string, dGeomID> m_objects;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user