Page 1 of 1

Set friction doesn't change anything.

Posted: Thu May 12, 2011 8:35 am
by @ntares
Hi, I work in a project wich use Bullet for 3D physics. When I tried some value for friction in Blender, like 5.0 for support and for the box, I have a great friction.

But When I try to change friction in our engine, I cannot see any difference :

I put the friction coef to 5.0 for both support and object ( I have test with 5000.0 :)) like that :

btDefaultMotionState * myMotionState = new btDefaultMotionState(myTransform);
btRigidBody::btRigidBodyConstructionInfo myBoxRigidBodyConstructionInfo( mass, myMotionState, shape, localInertia );
myBoxRigidBodyConstructionInfo.m_friction = 5.0;
_RigidBody = new btRigidBody(myBoxRigidBodyConstructionInfo);

And if I get the friction on the Rigidbody during the process, I have the good value. (5.0)

Is there any other place where I must set something?

Have you any idea for my problem?


Thanks

Re: Set friction doesn't change anything.

Posted: Thu May 12, 2011 9:20 am
by @ntares
Okay, I have search a lot, and I think this is a scale problem.

For example, I have big object, and realy small mass.

for example :
size = 35.0, 35.0, 35.0 (which are in meter by default in Bullet)

mass = 1.0 (which are in kilo I suppose)

So I have an object as big as a Boat, and as light as a milk bottle !

Do you think this is a problem ? :mrgreen:

Re: Set friction doesn't change anything.

Posted: Fri May 13, 2011 8:37 am
by DannyChapman
The behaviour of rigid bodies _should_ be independent of the overall mass scaling (so if you multiply the masses of all objects by some constant, it shouldn't change the behaviour). Physics engines will probably not be that perfect, but I would have thought would be OK for what you describe (can't be sure as I don't actually use Bullet).

However... your friction value is really high. If all objects have that value, and the bullet friction values combine by multiplying, then contacts will have a friction coefficient of 5*5 = 25. That means the friction force can be 25 times the normal force. More usual values will be around 1 (a bit more or less) - e.g. see http://www.engineeringtoolbox.com/frict ... d_778.html. A value of 25 is so big that you're probably not seeing any slipping anyway, in which case increasing it further will not have a visible effect.

Re: Set friction doesn't change anything.

Posted: Sun Dec 25, 2011 12:29 pm
by tea
Max combined friction is clamped to [-10, 10]

in btManifoldResult.cpp:

inline btScalar calculateCombinedFriction(const btCollisionObject* body0,const btCollisionObject* body1)
{
btScalar friction = body0->getFriction() * body1->getFriction();

const btScalar MAX_FRICTION = btScalar(10.);
if (friction < -MAX_FRICTION)
friction = -MAX_FRICTION;
if (friction > MAX_FRICTION)
friction = MAX_FRICTION;
return friction;

}

Re: Set friction doesn't change anything.

Posted: Sun Dec 25, 2011 6:21 pm
by Dr.Shepherd
So what values did you try out ? Can you list all here ?