I'm using only the bullet collision detection (there's no collision response, bodies may penetrate each other). It works fine, until a body has a linear velocity of 0 for about 3 seconds. After that, it doesn't move at all, no matter what linear velocity I set - like it's stuck.
Here are some details on how I use bullet:
- I use btDbvtBroadphase, btSequentialImpulseConstraintSolver and btDiscreteDynamicsWorld.
- I derived my own dispatcher from btCollisionDispatcher which calls setNearCallback in it's constructor and emits a signal in the near callback function. It does, not call btCollisionDispatcher::defaultNearCallback.
- After creating the world, I call world->getPairCache()->setOverlapFilterCallback(&callback);, where callback is derived from btOverlapFilterCallback. I use this for deciding which bodies can collide with each other.
- Since the game I'm working on is 2D, each body gets a constraint exactly like the one in the FAQ entry on this topic.
- I set the bodies' velocity using setLinearVelocity. Each body has a custom motion state derived from btMotionState which updates the sprite which is connected to the body. The objects' position might be updated externally by the game. Since I've found no other way to inform the body about that position change, I just call body->setMotionState(&motion_state); where motion_state is the same motion state it had before. The body then calls getWorldTransform and the position is updated (maybe this is my mistake)?