I've been looking into bullet for some simulation of rigid bodies with multiple hulls or collision sections. For start i use infrastructure provided by BasicExample for some POCs. By creating two btConvexHulls and their bodies I get the exact shapes on screen. When I try to do the same via btCompoundShape::addChildShape() and then make a single body, there's nothing in the visualization.
Is this an issue in approach or a limit of a built in visualizer?
Code: Select all
btTransform t1;
m_collisionShapes.push_back(collisionModel->meshes[0]->generatedHull);
createRigidBody(0., t1, collisionModel->meshes[0]->generatedHull);
btTransform t2;
t2.setOrigin(btVector3(-0.5, 0, 0));
m_collisionShapes.push_back(collisionModel->meshes[1]->generatedHull);
createRigidBody(0., t2, collisionModel->meshes[1]->generatedHull);
Code: Select all
btCompoundShape * compound = new btCompoundShape();
btTransform t1;
compound->addChildShape(t1, collisionModel->meshes[0]->generatedHull);
btTransform t2;
t2.setOrigin(btVector3(-0.5, 0, 0));
compound->addChildShape(t2, collisionModel->meshes[1]->generatedHull);
btTransform testmodelTransform;
m_collisionShapes.push_back(compound);
createRigidBody(0., testmodelTransform, compound);