WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   removing objects that have collided (https://forum.worldviz.com/showthread.php?t=2752)

hotspur1 05-25-2010 10:16 AM

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

hotspur1 05-26-2010 10:02 AM

Nevermind - I am using the .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


All times are GMT -7. The time now is 05:02 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC