I'm new to bullet, and I'm trying to build a simple game that has some colliding balls.
I'm setting the world this way:
Code: Select all
//
btBroadphaseInterface* broadphase = new btDbvtBroadphase();
// Set up the collision configuration and dispatcher
btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();
btCollisionDispatcher* dispatcher = new btCollisionDispatcher(collisionConfiguration);
// The actual physics solver
btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver;
// The world.
_world = new btDiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration);
_world->setGravity(btVector3(0, 0, -kGravity));
Sometimes the ball cross through the boundaries, sometimes not. Sometimes one ball cross through the other, sometimes not.
I notices that the most of time the collisions don't happen at high speed impact.
I tried using a fixed very low timestep, calling the stepSimulation method of _word severaltimes instead of calling only once, but it didn't work.
Can you help me with this issue?
Any hint I can follow in order to solve this problem?
Thank you very much!