LinearJoint, HOW, please HELP?

XMight
Posts: 32
Joined: Tue Feb 22, 2011 1:00 pm

LinearJoint, HOW, please HELP?

Post by XMight »

I have two objects, one soft and one hard. I want to attach the soft to the hard, or viceversa, doesn't matter. I use the simple code

Code: Select all

	btSoftBody::LJoint::Specs	lj;
	lj.position	=	myJointPos;
	psb0->appendLinearJoint(lj,psb1);
I have a problem, this causes both soft and rigid body to rise up in the air, and after that to fall (I need them just to fall to the ground, this happens if no joint is added). I do not apply any velocity at all. Also the distance between the soft and the rigid body is not preserved(I want them to be pretty close). What I do wrong?

Also, what joint position I must specify, what is this anyway? I wasn't able to find anywhere what I must assign to this!
XMight
Posts: 32
Joined: Tue Feb 22, 2011 1:00 pm

Re: LinearJoint, HOW, please HELP?

Post by XMight »

Actually I found that the jump is caused by split(1).

Can someone explain what do these parameters?

split, cfm and erp? How I'm supposed to know what these mean if no documentation on this is present at all?
ProfessionalUser
Posts: 14
Joined: Fri Oct 14, 2011 12:10 am

Re: LinearJoint, HOW, please HELP?

Post by ProfessionalUser »

"split, cfm and erp? How I'm supposed to know what these mean if no documentation on this is present at all?"

+1
User avatar
Yann
Posts: 52
Joined: Wed Sep 28, 2011 8:36 am
Location: France

Re: LinearJoint, HOW, please HELP?

Post by Yann »

I dunno about 'split', but here is about cfm (constraint force mixing) and erp(error reduction parameter):

If CFM is set to zero (which is the default value), the constraint will be hard.
If CFM is set to a positive value, it will be possible to violate the constraint by "pushing on it"
(for example, for contact constraints by forcing the two contacting objects together).
In other words the constraint will be soft, and the softness will increase as CFM increases.
What is actually happening here is that the constraint is allowed to be violated by an amount proportional
to CFM times the restoring force that is needed to enforce the constraint.
Note that setting CFM to a negative value can have undesirable bad effects, such as instability. Don't do it.

The ERP specifies what proportion of the joint error will be fixed during the next simulation step.
If ERP=0 then no correcting force is applied and the bodies will eventually drift apart as the simulation proceeds.
If ERP=1 then the simulation will attempt to fix all joint error during the next time step.
However, setting ERP=1 is not recommended, as the joint error will not be completely fixed due to various internal approximations.
A value of ERP=0.1 to 0.8 is recommended (0.2 is the default).

Now to set the ERB and CFM values of your constraints, use the methods

Code: Select all

constraint->setParam(BT_CONSTRAINT_STOP_CFM, myCFMvalue, index)
constraint->setParam(BT_CONSTRAINT_STOP_ERP, myERPvalue, index)
where index 0-2 are for linear constraints, 3-5 for angular constraints

If you want to get more information on each, here is an article that explains it quite well (sorry, it's on the ODE wiki, but that's the only place where I could find it): http://opende.sourceforge.net/wiki/inde ... oncepts%29
singularPoint
Posts: 6
Joined: Wed Aug 08, 2012 7:24 pm

Re: LinearJoint, HOW, please HELP?

Post by singularPoint »

Yan fellow, you saved my day!

Bullet should have a webpage where definitions and concepts can be placed by the community in a more organized fashion. I found all kinds of good advices and little tutorials mixed up in different discussions. This is quite a hassle when you start from ground.
User avatar
Yann
Posts: 52
Joined: Wed Sep 28, 2011 8:36 am
Location: France

Re: LinearJoint, HOW, please HELP?

Post by Yann »

There is one, it's the wiki ;)
http://bulletphysics.org/mediawiki-1.5.8