Code: Select all
btCollisionShape* boxshape = new btBoxShape(btVector3(box_width, box_height, box_length));
btCollisionShape* boxshape2 = new btBoxShape(btVector3(box_width, box_height, box_length));
compound->addChildShape(startTransform,boxshape);
compound->addChildShape(startTransform,boxshape2);
compound->calculateLocalInertia(compmass, compfallInertia);
btRigidBody::btRigidBodyConstructionInfo fallRigidBodyCI(compmass, compfallMotionState, compound, compfallInertia);
btRigidBody* fallRigidBody = new btRigidBody(fallRigidBodyCI);
dynamicsWorld->addRigidBody(fallRigidBody);