dynamically create and remove objects
is it possible to dynamically create or to remove objects in the scene?
For example, I have a mesh_sphere created at the beginning.
If I press "2", then two ODE shperes will be created with its imageModel set as mesh_sphere;
Then if I press "1", one of the ODE sphere will be removed from the scene;
Please Log in or Create an account to join the conversation.
You should be able to remove them from the scene. Since this framework uses the ODE dynamics engine, please check the ODE documentation if you are encountering problems.
Please Log in or Create an account to join the conversation.
Here is my solution to a similar problem:
// Show an object and activate it (or not)
void activate_object(cODEGenericBody* ODEObject, bool activate)
{
if (activate)
{
ODEObject->setEnabled(true,true);
ODEObject->enableDynamics();
ODEObject->setGhostEnabled(false);
}
else
{
ODEObject->setGhostEnabled(true);
ODEObject->disableDynamics();
ODEObject->setEnabled(false,true);
};
}
Please Log in or Create an account to join the conversation.
Hi, I have a similar issue and this solution doesn't work. For some reason the ODEObject is only removed graphically, NOT haptically. I've also looked through the ODE documentation and I have been unable to find a way to remove ODEobjects from my scene.
If anyone can provide more details on how they were able to remove ODEobjects from their scene I would appreciate it.
Please Log in or Create an account to join the conversation.
Also, my ODEObjects are set to createDynamicMesh = true. They are static. Testing it as false (moveable object on the scene), lets me disable it haptically and graphically.
So, how do I do this when the object is static? Can I? Do I have to rebuild my code to use a different approach?
Please Log in or Create an account to join the conversation.