I am a student and using bullet for doing some self-assembly simulation like this: http://youtu.be/0CcJTgPgxvw
What I need is when two components arrive at the right positions, combine them to make them become a new structure. I usd constraint for connecting two components (btGeneric6DofConstraint or btPoint2PointConstraint). However, it seems that it will merge islands and bounce when one object is being squeezed by others.
I have seted the CFM and ERP parameter like this:
Code: Select all
p2p=new btGeneric6DofConstraint(*molecules[IDs[1]].link,*molecules[IDs[2]].link,frameInA,frameInB,true);
m_dynamicsWorld->addConstraint(p2p);
p2p ->setBreakingImpulseThreshold(n_breakingImpulseThreshold);
for(p=0;p<6;p++)
{
p2p->setParam(BT_CONSTRAINT_STOP_CFM, 0.0, p);
p2p->setParam(BT_CONSTRAINT_STOP_ERP, 0.2, p);
}
Or should I used btCompoundShape instead of constraint?
Many thanks.