How to fix two rigidbodies ?

momoreda
Posts: 25
Joined: Mon Oct 08, 2007 2:09 pm
Location: France

How to fix two rigidbodies ?

Post by momoreda »

Hi

I want to know how can I do to fix two rigidbodies and avoid all displacements? I used btGeneric6DofConstraint and have blocked all axis and all rotations, but it does not work because as soon as I apply great force they are no longer together. (This an example. In my model there is much bodies)


Thank you for your help
Hamstray
Posts: 15
Joined: Thu Jan 11, 2007 7:45 pm

Re: How to fix two rigidbodies ?

Post by Hamstray »

Usually by placing both shapes into a compound shape. Constraints are currently not stable enough.
momoreda
Posts: 25
Joined: Mon Oct 08, 2007 2:09 pm
Location: France

Re: How to fix two rigidbodies ?

Post by momoreda »

Hey !

Thank you for the answer. I'm agree with you that constraints "joints" are currently not stable enough. In Demos existing in Bullet Compound shape is used for storing objects. So can you can briefly explain to me how to use Compound shape?

Thanks a lot

M
momoreda
Posts: 25
Joined: Mon Oct 08, 2007 2:09 pm
Location: France

Re: How to fix two rigidbodies ?

Post by momoreda »

It is possible to model in BULLET an object In the form T?

I am a mechanical engineer, so i do not know how work btcompoundshape to build complex objects?
Hamstray
Posts: 15
Joined: Thu Jan 11, 2007 7:45 pm

Re: How to fix two rigidbodies ?

Post by Hamstray »

you add the sub shapes with the addChildShape function.
void btCompoundShape::addChildShape(const btTransform& localTransform,btCollisionShape* shape);
(keep in mind that you have to take care of allocation/deallocation of the child shapes yourself)

The origin of your compound shape should be it's center of gravity.
If you want to make a T you would just add two btBoxShape objects and offset them vertically.

You use the btCompoundShape just like any other btCollisionShape object ( pass them to btRigidBody() )
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: How to fix two rigidbodies ?

Post by Erwin Coumans »

Combining multiple collision shapes into a single btRigidBody using a btCompoundShape is recommended, if it suits your need.
Constraints are currently not stable enough.
Constraints should be stable enough to fix two bodies, you can use the btGenericD6Constraint. Just make sure to disable collisions between the two fixed bodies.

Can you reproduce/show why you think constraints are not stable enough? It might be a setup/configuration problem. We probably should add some fixed constraint in the ConstraintDemo.

Thanks,
Erwin
Hamstray
Posts: 15
Joined: Thu Jan 11, 2007 7:45 pm

Re: How to fix two rigidbodies ?

Post by Hamstray »

Well, probably it is stable enough for only 2 objects. I haven't tested that. However if you have several bodies linked together (such as in a skeleton) the constraints seem to give in.
ola
Posts: 169
Joined: Sun Jan 14, 2007 7:56 pm
Location: Norway

Re: How to fix two rigidbodies ?

Post by ola »

Actually, I've had some trouble with using a fixed constraint too.

Last summer I made a 3 stage rocket that I sent up into orbit, and fixed the stages to each other with the generic 6DOF constraint. Only the active stage had a force applied on it. It worked well then, but I checked again some weeks back and it seems it doesn't work very well anymore. I think this constraint was rewritten some months back, and I think that might have something to do with it. What happens is that the constraint appears much less rigid with all DOF fixed, than it did before. The rocket wobbles about and most of the force/energy is lost so that the rocket barely launches at all.

Best regards,
Ola
momoreda
Posts: 25
Joined: Mon Oct 08, 2007 2:09 pm
Location: France

Re: How to fix two rigidbodies ?

Post by momoreda »

Hi !

Quick question !

How I do to create a joint (Hinge) between two bodies btCompoundshape?

I try to make like a joint between two rigidbodies, but i can't Control it.

Thanks a lot
TheNinja
Posts: 4
Joined: Thu Dec 06, 2007 11:59 am
Location: Austria

Re: How to fix two rigidbodies ?

Post by TheNinja »

We've got some stability problem, too. But I have to admit we didn't try all the bounciness fixes so far.

For our Hexapod we are using 18 servos (hinge joints) and a btGeneric6DofConstraint to keep the servos fixed while they are not moving to a new angle.

I don't know much about the internal calculations, but I guess a special btFixedJoint would give quite a performance and stability boost.

Here is a video of our project (yes, we already fixed the friction by now ;) )
http://www.youtube.com/watch?v=aKE7ppG3EoM