Group of Spheres

bdhsftv
Posts: 3
Joined: Mon Feb 22, 2010 1:12 am

Group of Spheres

Post by bdhsftv »

Hello,

I'm looking to group together a set of spheres, such that when the entire group is translated or rotated, all spheres in the group move, as if relative to the center point of the group. Is there a feature of bullet that would aide in this? I can see two things already, btCompoundShape or a constraint. A compound shape it does not seem is intended for its child shapes to be moved around a lot - I'm guessing you couldn't hook up rigid bodies to those child shapes. With constraints between spheres, I think I'm creating a lot of complexity (keeping spheres constrained in the right order - I imagine there'd be chaos if you hooked each one up to every other one.) as well as a lot of overhead. Anyone been down this road before?

Thanks :)
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Group of Spheres

Post by Erwin Coumans »

Can those spheres move independently?

Both btCompoundShape/single rigid body and constraints won't let those spheres move independently.

If they always move together, fixed relative to eachother, you can use a btCompoundShape and a single btRigidBody.

Can't you just move each sphere of the group manually, relative to the center of the group?
Thanks,
Erwin

Out of curiosity: what is the purpose of this?
bdhsftv
Posts: 3
Joined: Mon Feb 22, 2010 1:12 am

Re: Group of Spheres

Post by bdhsftv »

Wow thanks for such a fast response.

I'd like to build up a 3d environment consisting of points specified by the user. Once created in the world, I want the user to be able to freely move around one of these points or nodes. This works dandy in bullet using a btSphereShape for each node. I should note that the majority of the time the simulation doesn't even need to step - none of my core application relies on real-time physics interaction (forces, collisions) - though I'll probably step the simulation when moving a node around, so I can constrain it to the mouse and get that great effect. So again, I end up using bullet mostly for its representation of data and positioning things in space, and less for collision / dynamics.

Everything seems smooth up until I try to group nodes together, into an "object" that can be wholly translated and rotated. This seems to be more common in graphics frameworks, and I understand that this concept doesn't play nice in a physics world. Am I approaching this totally the wrong way or is this doable in bullet?

Thank you!