First of all, I don’t know if Urho already does something like this, if so please let me know.
Bullet’s wiki says different rigid bodies can use the same collision shape. (bulletphysics.org/mediawiki- … ion_Shapes)
I’d like to suggest having a CollisionShape cache that stores unique shape instances, and when a user tries to create a collision shape, the cache will check if there’s already an instance for it to use.
CollisionShape can have a “unique” flag to exclude it from caching, in cases where it’s going to be modified after creation.
If the user tries to modify a shape it can automatically become unique. It will help to reduce complexity and prevent unexpected behavior for inexperienced users.
If the user wants to modify the shape and still cache it, he’ll have to create the modified shape as a new shape to have it cached.
I argue that in the vast majority of the cases the user will use the same collision shape for every prefab type, creating redundant duplicates of the shape for every instance.
So caching shapes by default makes sense.