Bullet: Collision Shapes

Is there any way to make a collision shape auto-size to the model I attached to it?

For example if I have a model and I attach it to a node that has a box shape and I want to automatically set the size of the box in such a way that the model is completely covered by it.

Is there any way to do this automatically? If not how would I go about making code that does this to box shapes? I can’t find any method that gives me the size of a model in panda units and I can’t do it using setScale, since setScale is relative to the model original size.

Also is it just me or bullet shapes are really inconvenient to create? Bullet shapes assume that the center of the model is its (0,0,0) coordinates, but in most cases the (0,0,0) is actually the “feet” of the model.

I don’t think there’s an auto-best-fit method available. You can use getTightBounds() to get the dimensions of the model (returns extreme points of the bounding box), which you can use to create your box.

This is a convention common to most physics engines. The reason is that it is very convenient to have the centre of mass at (0,0,0).