How should I specify friction between two materials?

Post Reply
Night Elf
Posts: 4
Joined: Thu Aug 14, 2008 9:21 pm

How should I specify friction between two materials?

Post by Night Elf »

Hi. I'm new to Bullet and, having worked with Newton in the past, I'm having a hard time understanding how friction works here...

In Newton you can specify friction on a material pair basis. You define two materials and then say what the friction is between those two. This corresponds to how I understand friction to work (I must admit I'm far from a physics expert...)

In Bullet, however, you can only specify the friction of a body. So if you set a large friction, that body sticks to everything and if you set a low friction it always slides on any surface. What should I do if I want to have different friction coefficients between different bodies (so that, for example, a box stays on another when I move the one in the bottom, but at the same time the bottom box slides without much effort on the floor)?
pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

Re: How should I specify friction between two materials?

Post by pico »

Hi,

you can set the friction to 0.1 for the ground. Set it to 0.9 for the box. So the box will slide on the floor but boxes ontop of each other will have strong friction.
As far as i know frictions will be multiplied internally by each other.

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

Re: How should I specify friction between two materials?

Post by Erwin Coumans »

Indeed, by default the friction coefficients are multiplied.

You can, however, use a 2D table or your own friction combiner, like Newton, in a contact point callback.

See CustomMaterialCombinerCallback in Bullet/Demos/ConcaveDemo/ConcavePhysicsDemo.cpp for an example implementation.
Hope this helps,
Erwin
Post Reply