I'm currently trying to integrate a collison detection into my physics simulation (large static sphere and a smaller dynamic box which is falling onto it). I'm using a simulation tick callback to gather the contact information. Now I have the problem that for some initial positions of the box I do not get a contact point with a distance below 0, although the box is bouncing off the sphere.
One of this cases occurs if I use the following values:
Code: Select all
//Sphere
btCollisionShape* sphereShape = new btSphereShape(btScalar(20));
btScalar sphereMass(0.f);
btTransform sphereTransform;
sphereTransform.setOrigin(btVector3(0, 0, 0));
//Box
btCollisionShape* boxShape = new btBoxShape(btVector3(1, 1, 1));
btScalar boxMass(1.f);
btTransform boxTransform;
startTransform.boxTransform(btVector3(18, 25, 0));
I hope someone can help me. Thanks!