Is there a concept of a collection in Bullet?

Post Reply
brownboy147
Posts: 2
Joined: Tue Feb 08, 2011 11:26 am

Is there a concept of a collection in Bullet?

Post by brownboy147 »

Hi all,

I'm adding support for Bullet to an existing game engine.

My current physics engine has a concept of a System, which is a collection of bodies and joints.
For example, a rag-doll would be a System.
The system plays no part in the simulation itself, it's merely a convenient way of accessing a collection of objects as a whole from the game code.

Another example might be a particle system, where you might want to find the centre of mass of the particle system by spinning through the objects.

My question... Is there a similar concept in Bullet?
I've looked through the docs and can't see anything jumping out at me.
Not a major issue if there's not, since it's pretty trivial for me to write my own. But thought I'd check, since this is likely something that other users have come across.
No point in me reinventing the wheel :)

Thanks, and regards.
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York
Contact:

Re: Is there a concept of a collection in Bullet?

Post by sparkprime »

There is btCompoundShape but this is not a collection of things linked by constraints, rather it is defining a new shape to be the union of its child shapes. AFAIK there is nothing the corresponds to a collection of rigid bodies linked by constraints. Any rigid body can be constrained to any other rigid body at any time. It would not be hard to define such a collection though if you are working in a set up where the constraints are less flexible.
brownboy147
Posts: 2
Joined: Tue Feb 08, 2011 11:26 am

Re: Is there a concept of a collection in Bullet?

Post by brownboy147 »

Thanks for the info sparkprime.

I figured that was probably the case, but wanted to be sure before writing code that duplicates available functionality.

Cheers
Post Reply