Alrite,
This is the stuff which I tried in one of the BulletDemos and it works fine....
Code: Select all
btCollisionShape* pBoxShape;
btCollisionShape* pCylinderShape;
btTransform childTransform;
m_pParentShape = new btCompoundShape;
btTransform parentTransform;
parentTransform.setIdentity();
parentTransform.setOrigin(btVector3(0, 5, 0));
//Body Part1
pBoxShape = new btBoxShape(btVector3(1.73667014, 0.848335028, 1.68590808));
childTransform.setIdentity();
childTransform.setOrigin(btVector3(0, 0.710668027, -1.82743204));
m_pParentShape->addChildShape(childTransform, pBoxShape);
//Body Part2
pBoxShape = new btBoxShape(btVector3(1.48286009, 1.10214508, 1.86357510));
childTransform.setIdentity();
childTransform.setOrigin(btVector3(0, 0.888335049, 0));
m_pParentShape->addChildShape(childTransform, pBoxShape);
//Body Part3
pBoxShape = new btBoxShape(btVector3(1.60976505, 0.340715021, 1.22905004));
childTransform.setIdentity();
childTransform.setOrigin(btVector3(0, 0.634525001, 1.71321750));
m_pParentShape->addChildShape(childTransform, pBoxShape);
//Wheel1
pCylinderShape = new btCylinderShape(btVector3(0.416858017, 0.213810027, 0.416858017));
//childTransform.setIdentity();
childTransform.getBasis().setRotation(btQuaternion(0, 0.707, 0.0, 1.0));
childTransform.setOrigin(btVector3(0.989859045, 0.225648522, 1.57362199));
m_pParentShape->addChildShape(childTransform, pCylinderShape);
//Wheel2
pCylinderShape = new btCylinderShape(btVector3(0.416858017, 0.213810027, 0.416858017));
//childTransform.setIdentity();
childTransform.getBasis().setRotation(btQuaternion(0, 0.707, 0.0, 1.0));
childTransform.setOrigin(btVector3(-0.989859045, 0.225648522, 1.57362199));
m_pParentShape->addChildShape(childTransform, pCylinderShape);
//Wheel3
pCylinderShape = new btCylinderShape(btVector3(0.416858017, 0.213810027, 0.416858017));
//childTransform.setIdentity();
childTransform.getBasis().setRotation(btQuaternion(0, 0.707, 0.0, 1.0));
childTransform.setOrigin(btVector3(0.989859045, 0.225648522, -1.57362199));
m_pParentShape->addChildShape(childTransform, pCylinderShape);
//Wheel4
pCylinderShape = new btCylinderShape(btVector3(0.416858017, 0.213810027, 0.416858017));
//childTransform.setIdentity();
childTransform.getBasis().setRotation(btQuaternion(0, 0.707, 0.0, 1.0));
childTransform.setOrigin(btVector3(-0.989859045, 0.225648522, -1.57362199));
m_pParentShape->addChildShape(childTransform, pCylinderShape);
m_collisionShapes.push_back(m_pParentShape);
m_pParentBody = DemoApplication::localCreateRigidBody(1.0f, parentTransform, m_pParentShape);
I've the same stuff in my game, running on the XBOX 360. I'm doing collision between this composite object and a static BvhTriangleMesh....