Fixed joint in bullet physics

bindumol
Posts: 15
Joined: Thu May 08, 2008 9:55 am
Location: India, Kerala

Fixed joint in bullet physics

Post by bindumol »

Hi,
I am using Irrlicht and bullet physics for developing applications. I have mesh objects of
btTriangleMesh* triangleMesh and i convert it into

btConvexTriangleMeshShape* MeshShape = new btConvexTriangleMeshShape(triangleMesh);
btCollisionShape *Shape = MeshShape ;

as collision shapes.

1. In my application there is i need one fixed constraint between two bodis and one of it is also linked to another body(3rd body).
how i can make a fixed joint in bullet physics?
2. How i can find the axis of the 3rd body and rotate the fourth body in the basis of 3rd one considering it as also fixed.
I made it by using hingeconstraint in bullet physics but the pivot point is not correct....how it is possible ...
please help me...
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Fixed joint in bullet physics

Post by Erwin Coumans »

Code: Select all

1. In my application there is i need one fixed constraint between two bodis and one of it is also linked to another body(3rd body). 
how i can make a fixed joint in bullet physics?
You can fix two collision shapes into one body, using a btCompoundShape. If you really need a fixed constaint (why?) you can use a btGeneric6DofConstraint, and lock all axis (set min and max for linear/angular all to zero).
2. How i can find the axis of the 3rd body and rotate the fourth body in the basis of 3rd one considering it as also fixed.
I made it by using hingeconstraint in bullet physics but the pivot point is not correct....how it is possible ...
Position/orientation of pivots can be easily set within a modeler, such as Blender. It can directly export constraint and rigid bodies to COLLADA.

Alternatively, describe the object and pivot transform all in world space, and then transform the pivot in local space, using the inverse world transform of the object:

Code: Select all

btVector3 pivotLocalSpace = rigidbody->getCenterOfMassTransform().inverse()(pivotWorldSpace);
Hope this helps,
Erwin
jbacon
Posts: 11
Joined: Wed May 13, 2009 12:30 pm

Re: Fixed joint in bullet physics

Post by jbacon »

Hi,

I'm having the same issue, and the reason is that I have a system where the user can add/remove
objects from some base body that propel it forward (like a jet engine) it'd be a major hassle to insert
and merge collisionshapes at every (dis)connect, much easier to connect objects via fixed constraints.
BUT the constraints are quite 'soft' even when lin and ang min/max values are all zero. is there any way
to make a fixed constraint perfectly rigid (without resorting to making a compoundShape) ?

thanks,

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

Re: Fixed joint in bullet physics

Post by Erwin Coumans »

Unfortunately the only way is btCompoundShape. The Bullet/Demos/FractureDemo shows how to glue/break objects.
I'll try to make it easier to add glue/breakable compounds in a future SDK.

Fixed constraints will not be very rigid, it is a limitation of the current iterative constraint solver.
Thanks,
Erwin
jbacon
Posts: 11
Joined: Wed May 13, 2009 12:30 pm

Re: Fixed joint in bullet physics

Post by jbacon »

thanks for the quick reply, Erwin !
Ill have a look at the demo.
jbacon
Posts: 11
Joined: Wed May 13, 2009 12:30 pm

Re: Fixed joint in bullet physics

Post by jbacon »

by the way, if I want to *maximize* stiffness of a bt6DOFGenericConstraint for instance,
how do I access the relevant parameters ?

thanks,

J
User avatar
Dr.Shepherd
Posts: 168
Joined: Tue Jan 04, 2011 11:47 pm

Re: Fixed joint in bullet physics

Post by Dr.Shepherd »

Look into Yann's post in

http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=6792

check out the ERP and CFM parameters in a constraint solver