View Single Post
  #1  
Old 05-25-2010, 10:16 AM
hotspur1 hotspur1 is offline
Member
 
Join Date: Mar 2003
Location: Cambridge, MA
Posts: 54
removing objects that have collided

I am running a robotics simulation and I want to quit a particular trial after having grabbed an object. I am using the physics engine to detect collisions but when I try to remove the grasped object, I get a physics engine exception. I have a 60 Hz timer that drives the simulation rendering and a keyboard event which signals the end of the trial ('q' key). Within the keyboard callback, I tried to disable the collision notification for the two objects but it doesn't seem to work properly. I have a callback routine that should run when a collision event ends, but it doesn't occur. I am guessing that because it is dealing with a keyboard event callback, it cannot be interrupted by the collision ending event (when the notification is disabled).

I presume the exception then arises because the physics engine thinks that two objects are still in a collided state but one of them is no longer part of the scene graph. Is there a way to clear/reset the state of the physics engine so I am basically starting with a clean slate for each new trial?

Can I simply disable the physics engine, remove and add objects as needed, then start the physics engine again without starting in the previous state?

Thanks
Reply With Quote