Basic questions

petervesti
Posts: 1
Joined: Fri Feb 08, 2008 2:26 am

Basic questions

Post by petervesti »

Hey all.

I have recently started developing a game using XNA and the BulletX port to C#. It seems to be working great but I have encountered a problem which annoys me quite a bit.

To begin with I just created functions to spawn some spheres and one to remove a sphere. Spawning them works perfectly but the game sometimes crashes when I try to delete the spheres but sometimes it works fine.

The error is triggered by the world.StepSimulation(1.0f / 60.0f, 1) call (ArgumentOutOfRangeException)

The way I try to remove the spheres is by world.RemoveRigidBody(_activeBalls[ballsRemaining() - 1]) where _activeBalls is an array of RigidBody

I guess I can't just remove RigidBodies like that? or is it because I might be calling it in a substep or?

I really could use some basic information about rigidbody, collisionobject and maybe constraints - so any links to some basic tutorials would be highly appreciated. I have been googling around but haven't been able to come up with something yet.

Thanks in advance
- Peter