Problems with PhysicsSimulator.Remove

Topics: Developer Forum, User Forum
Feb 25, 2010 at 10:55 AM

It seems that using PhysicsSimulator.Remove doesn't seem to remove things entirely from the simulation. I was using it (incorrectly, as I actually wanted to be calling .Dispose on bodies I wanted to destroy), and it seemed like after a while, there were still "ghosts" of objects being left in the simulator (Perhaps remaining in the broadphase or narrowphase colliders) I'm using the Selective Sweep collider and the the SAT collider. I'm sorry, but I don't have time to look into it now, but hopefully when this project is done I can take a look into what was causing it. Just a note though, if you want to delete objects from the simulator, call .Dispose on them (not PhysicsSimulator.Remove, like I was :) )

Feb 25, 2010 at 8:43 PM
f8k8 wrote:

It seems that using PhysicsSimulator.Remove doesn't seem to remove things entirely from the simulation. I was using it (incorrectly, as I actually wanted to be calling .Dispose on bodies I wanted to destroy), and it seemed like after a while, there were still "ghosts" of objects being left in the simulator (Perhaps remaining in the broadphase or narrowphase colliders) I'm using the Selective Sweep collider and the the SAT collider. I'm sorry, but I don't have time to look into it now, but hopefully when this project is done I can take a look into what was causing it. Just a note though, if you want to delete objects from the simulator, call .Dispose on them (not PhysicsSimulator.Remove, like I was :) )

I've had similar issues, I now remove my geoms/bodies directly from the PhysicsSimulator.GeomList/BodyList (not got a solution up to check if the property names are right).

I also use PhysicsSimulator.ProcessWithoutUpdate() (the method is something like that..) this basically forces the physics simulator to process the queues from removing/adding geoms/bodies to the simulator without processing collisions etc.

 

Hope some of this helps.