I'm trying to add compound objects into our game, and I'm seeing some odd behavior that I'm not sure how to get around, short of using dynamic mesh objects.
I create a compound object to model a dart, using the following code to create the shape.
Code: Select all
btCompoundShape * compoundShape = new btCompoundShape();
btTransform tr;
tr.setIdentity();
tr.setOrigin(btVector3(0,0.33567*10,0));
compoundShape->addChildShape(tr,new btBoxShape(btVector3(0.0207*10,0.0923*10,0.0207*10)));
tr.setOrigin(btVector3(0.043*10,0.226*10,0));
compoundShape->addChildShape(tr,new btBoxShape(btVector3(0.07335*10,0.1273*10,0.0127*10)));
tr.setOrigin(btVector3(-0.043*10,0.226*10,0));
compoundShape->addChildShape(tr,new btBoxShape(btVector3(-0.07335*10,0.1273*10,0.0127*10)));
tr.setOrigin(btVector3(0,0.226*10,0.043*10));
compoundShape->addChildShape(tr,new btBoxShape(btVector3(0.0127*10,0.1273*10,0.07335*10)));
tr.setOrigin(btVector3(0,0.226*10,-0.043*10));
compoundShape->addChildShape(tr,new btBoxShape(btVector3(0.0127*10,0.1273*10,-0.07335*10)));
tr.setOrigin(btVector3(0,0.0996542*10,0));
compoundShape->addChildShape(tr,new btBoxShape(btVector3(0.0326*10,0.125126*10,0.0326*10)));
tr.setOrigin(btVector3(0,-0.010882*10,0));
compoundShape->addChildShape(tr,new btBoxShape(btVector3(0.01246*10,0.0959464*10,0.01246*10)));
Thanks. Let me know if you need more info.
- Alex