Set friction doesn't change anything.

Post Reply
@ntares
Posts: 5
Joined: Thu May 12, 2011 8:25 am

Set friction doesn't change anything.

Post by @ntares » Thu May 12, 2011 8:35 am

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

@ntares
Posts: 5
Joined: Thu May 12, 2011 8:25 am

Re: Set friction doesn't change anything.

Post by @ntares » Thu May 12, 2011 9:20 am

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:

DannyChapman
Posts: 85
Joined: Sun Jan 07, 2007 4:29 pm
Location: Oxford, England
Contact:

Re: Set friction doesn't change anything.

Post by DannyChapman » Fri May 13, 2011 8:37 am

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.

tea
Posts: 6
Joined: Mon Jul 18, 2011 6:42 pm
Contact:

Re: Set friction doesn't change anything.

Post by tea » Sun Dec 25, 2011 12:29 pm

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;

}

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

Re: Set friction doesn't change anything.

Post by Dr.Shepherd » Sun Dec 25, 2011 6:21 pm

So what values did you try out ? Can you list all here ?

Post Reply