Search code examples
bulletbulletphysics

Is it possible to use a btCompoundShape as a child shape of a different btCompoundShape?


The question is fairly self explanatory. I am left with the need for a single btRigidBody made up of an incredibly large number of btBoxShape primitives. The way my program is written currently lends itself rather well to the setup I described in the question where there are multiple btCompoundShape objects that contain these btBoxShape primitives, and all of them can feed into one over arching btCompoundShape which is the shape that would then by used by the btRigidBody.

Unfortunately, it will take some time to implement, and I am hoping to have a yes or no answer before I begin so that I can go about other means if necessary. That being said, if no answer is forthcoming I will go ahead anyway and answer my own question here after attempting the implementation myself.


Solution

  • Yes, you can add a btCompoundShape child shape to a btCompoundShape: it allows recursion.