I'm just getting my hands dirty with Bullet at the moment. What I'm trying to do is to build kind of like a pasta jar sort of world (please google image "pasta glass jar"), where a bunch of solid bodies inside the cylinder collides with each other, and I'm wondering what's the best way to create the cylinder container world.
One of the sample codes that I found uses btBoxShape, and then with a forloop with getPlaneEquation to get each sides, building the world boundary 6-sided box with btStaticPlaneShape on each side. At least that's my understanding, the following is the part of the code.
Code: Select all
btBoxShape* worldBoxShape = new btBoxShape(btVector3(10,15,10));
///create 6 planes/half spaces
for (int i = 0 ; i < 6; i++)
{
btTransform groundTransform;
groundTransform.setIdentity();
groundTransform.setOrigin(btVector3(0,15,0));
btVector4 planeEq;
worldBoxShape->getPlaneEquation(planeEq,i);
btCollisionShape* groundShape = new btStaticPlaneShape(-planeEq,planeEq[3]);
... (adds the side as a world boundary)...
}