the collision is ocurring because the objects are deflected but the bodies are not coming to the callback
here follow some code i use on creation of the collision objects
the shot sphere
Code: Select all
colShape = new btSphereShape(2); // 2
btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform);
btVector3 localInertia(0, 0, 0);
if (isDynamic) colShape->calculateLocalInertia(mass, localInertia);
//using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects
btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform);
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, myMotionState, colShape, localInertia);
btRigidBody* body = new btRigidBody(rbInfo);
dynamicsWorld->addRigidBody(body, COL_PRFR, COL_GRND | COL_BUILD | COL_DEBRIS | COL_ENSP );
Code: Select all
colShape = new btSphereShape( 2 * 1. );
btScalar mass(16.f);
startTransform.setOrigin(pos);
btRigidBody* body = createRigidBody(dynamicsWorld, mass, startTransform, colShape, COL_ENSP, COL_GRND | COL_BUILD | COL_DEBRIS | COL_SHIP | COL_PRFR | COL_ENSP );
Can anyone can help ?
Peace for all