Fixed Connection between objects

User avatar
rewb0rn
Posts: 13
Joined: Tue Feb 02, 2010 11:48 pm
Location: Berlin, Germany

Fixed Connection between objects

Post by rewb0rn »

Hi,

I model a game where users can attach several addons to their vehicles. The addons should be physically fixed to the vehicle but have their own health etc so I need to check for collisions individually and cant use a CompoundShape. It seems that there is no such thing as a fixed joint or fixed constraint which I know exists in ode. So what would be the best way to model this in bullet? Just taking some constraint and set the tolerance to zero seems a bit of overkill to me, but would of course be acceptable if there is no alternative yet.

Thank you.
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Fixed Connection between objects

Post by Flix »

Never tried this, but I think a btFixedConstraint should be useful inside the Bullet library.

I'd simply derive it from the generic dof6 constraint (locking all the degrees of freedom).

Have you tried it? Does it work?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Fixed Connection between objects

Post by Erwin Coumans »

You could just use the btGeneric6DofConstraint and set all limits to zero, making it a fixed joint.
so I need to check for collisions individually and cant use a CompoundShape
Why not? You have access to the child shape index during the contact callback. A btCompoundShape seems the best choice.
Cheers,
Erwin
User avatar
rewb0rn
Posts: 13
Joined: Tue Feb 02, 2010 11:48 pm
Location: Berlin, Germany

Re: Fixed Connection between objects

Post by rewb0rn »

Good to know, thanks!
B_old
Posts: 79
Joined: Tue Sep 26, 2006 1:10 pm

Re: Fixed Connection between objects

Post by B_old »

I am interested in this as well, but maybe on a more general basis.

What would be best way to fix/detach an arbitrary number of rigid bodies to another body at runtime.
I would expect the fixing is fastest if you add constraints to the simulation. But one problem is, that you can disable collision between two linked objects, but not between all objects that are fixed to the same body. Right? This could be a big problem with overlapping objects. Another problem is, that constraints aren't really 100% fixed if a lot of force is involved.

Another solution would be to use compound shapes. But then you have to create a new shape every time a new body is fixed to another. And you have to be careful with objects that share the same shape (literally).

I guess compound shapes are the only way to do it perfectly, but it is also a lot more involved to get it right. What do you think?