JigLibJS icon indicating copy to clipboard operation
JigLibJS copied to clipboard

friction between sphere and plane

Open hero101111 opened this issue 13 years ago • 2 comments

Hi,

I've made a little scenario consisting of a sphere and a plane (with normal (0, 1, 0) and distance 0, so the xOz plane). The system has a gravity of [0, -9, 0]. The ball is positioned slightly above (in the positive Y direction) the plane with an initial velocity on the X-axis. There is a friction coefficient set for both the ball and the plane. I would expect the ball to 'fall' onto the plane and continue its movement in parallel with the X-axis, but slowly decreasing its velocity because of the friction. I am unable to obtain this behavior using the friction parameter. No matter what I set for the friction parameters, the system behaves as if there were no friction at all. I am curious why this happens.

I've pasted the code here: http://pastebin.com/x8sTYRaD

Regards, Gabriel

hero101111 avatar Apr 07 '11 14:04 hero101111

Have you tried increasing the mass of the sphere? did you try setting the friction to 1 for both the plane and the sphere? It may be a bug but I'm not sure the set up would result in a very big slowdown due to friction.

Assuming the units are SI, that would mean the sphere has a mass of 1k but has a diameter of 2m and no linear damping for air resistance. I would expect that to behave like a giant polystyrene ball and keep on going for miles before stopping due to friction(unless the friction was very high).

I do think there is something up with the plane/sphere interaction since if you replace the plane with a box it behaves quite differently. I'll investigate further when I get a chance.

supereggbert avatar Apr 07 '11 15:04 supereggbert

Just notice you had system.integrate(1); that is much much to high for a good sim, try lowering!

supereggbert avatar Apr 07 '11 16:04 supereggbert