I'm trying to remove a collision object after a collision occurred. To do this in my collision callback, I add the object to a removal queue that addresses the removal of the collision object before calling stepSimulation. Is there something I am doing wrong with my remove code or approach?

(3) This might be a memory leak depending on how you manage the BTRigidBody instances: you clear m_removeQueue before deleting the BTRigidBody pointers.

(4) Not a bug but an inefficiency: there is no need to loop over the bodies looking for a match if you already have the btRigidBody pointer via STRigidBody::getRigidBody(). In other words, I would expect the following code to work faster:

Sad to report, that didn't work. Removing the object did work, I declared a variable numCount to keep track of the number of collision objects. It does go down from 6 to 5 so the rigidbody/collision object is being removed. The error GDB detects it's calling "btRigidBody::saveKinematicState(float)", and the error message associated with it is "Calling Pure Virtual Method".