Removing rigid bodies in BulletX

Marklar
Posts: 2
Joined: Sun Mar 09, 2008 9:50 pm

Removing rigid bodies in BulletX

Post by Marklar »

Hello,

I've posted this in the BulletX forums as well, however since they are not very active I was hoping I might get some help here instead.

I've been playing around with the C# port of Bullet and have run into a problem when trying to remove certain rigid bodies. In the simulation I have a floor, table and cup. You can shoot objects from the camera (currently spheres) as a test. When objects roll over the edge of the floor, and drop more than 20 units I remove them from the simulation. This works great as far as the spheres are concerned, you can shoot them and remove them as much as you want. However, once one of the spheres collides with the cup (which is a compound shape), the next rigid body, either the sphere or the cup, to be removed causes an out of range exception in UnionFind.Find(int i). I've traced it back to SimulationIslandManager.cs and it seems to me like the IslandTag is being set incorrectly, or not changed when the objects are removed. I could be completely wrong though.

Since I have never used Bullet before, I am not sure if this is a bug in the port, or if I am doing something incorrectly. Any pointers in the right direction would be much appreciated.

Thank you,
Marklar
Marklar
Posts: 2
Joined: Sun Mar 09, 2008 9:50 pm

Re: Removing rigid bodies in BulletX

Post by Marklar »

Well after a few weeks I finally figured the problem out. I thought I should leave a link to the solution just in case someone stumbles upon this post.

http://www.codeplex.com/xnadevru/Thread ... adId=23663

Marklar