#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
Nevermind - I am using the <viztask>.waitEvent to wait for the COLLIDE_END_EVENT to occur before removing the target objects. I guess the problem was that the event did not occur before the call to remove the object, hence the exception in the physics engine.
You can close this thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
removing multiple objects | durf | Vizard | 7 | 08-05-2009 09:15 AM |
Semi-circle array containing target and distractor objects | ptjt255 | Vizard | 3 | 08-04-2009 03:09 AM |
multiple objects | durf | Vizard | 1 | 04-10-2009 01:42 PM |
Lightwave objects rotation problem | hosier | Vizard | 6 | 02-13-2009 12:04 PM |
Could not find plugin to load objects... | halley | Vizard | 1 | 05-30-2006 11:01 AM |