Recursive btCompoundShape oddities

User avatar
goosesensor
Posts: 15
Joined: Tue Jul 17, 2018 3:50 am
Location: Santa Cruz, CA

Recursive btCompoundShape oddities

Post by goosesensor »

I've read that creating a hierarchy of btCompoundShapes should work, but I'm having an issue with it.

My tree looks like this:

Code: Select all

                                         btCompoundShape
								
                              /                 |                 \
					
(btSphereShape, btCompoundShape) (btSphereShape, btCompoundShape) (btSphereShape, btCompoundShape)
		
                       |                                |                                |
									
       (btSphereShape, btCompoundShape)  (btSphereShape, btCompoundShape)   (btSphereShape, btCompoundShape)
		      
                              |                                  |                                  |
					
                        (btSphereShape)                    (btSphereShape)                     (btSphereShape)
Each leaf is a btSphereShape. Each internal node is a btCompoundShape, with one btSphereShape child, and one btCompoundShape.

It's hard to see in the below gif, but debug drawing shows that all visual sphere meshes also have the expected green collision mesh in the correct location. However, all of the spheres at 2+ levels deep do not interact with the dynamic body being projected out of the camera. The root (white) sphere and its three immediate child btSphereShapes do interact as expected.

Image

I have checked the code which creates this tree many, many times and am left scratching my head. I think it's expecially strange that the debug shape is drawn but the body still isn't interacted with. Are there special considerations when nesting btCompoundShapes?