Deleting ODE Objects in scene
I'm trying to delete (or replace) ODE objects in my scene while my haptic simulation is running.
My ODE objects (and associated meshes) are as follows (generic code):
ODEObject = new cODEGenericBody(ODEWorld);
ODEmesh = new cMultiMesh();
I'd like to be able to press a key and have the old mesh deleted and a new mesh appear in its place. So far, I can't get the old mesh to delete from the scene.
ODEObject->setEnabled(false, true, true);
ODEmesh->setEnabled(false, true, true);
but the haptics are still there... i.e., my haptic device still bumps into the object even though its not there graphically.
I've tried to delete/remove children, etc:
//world->deleteChild(ODEWorld); //works, but crashes
But this doesn't work.
I feel like this should be an easy step and that I am missing something. If anyone has some advice or tips, I would be greatly appreciative.