Page 1 of 1

btSphereShape friction

Posted: Wed Mar 13, 2013 12:49 am
by radubolovan
Hello.

I was making a huge btRigidBody that uses btBoxShape as ground and I have a cannon which fires spherical (using btSphereShape) bodies. Everything works fine, except after cannon balls hit the ground, they don't stop as expected (after awhile). As they don't use friction with the ground at all. They keep rolling and rolling until ... forever.

What should I do to make them work properly?

Thanks in advance.

Re: btSphereShape friction

Posted: Wed Mar 13, 2013 1:24 pm
by Adriano
You can try to add a damping:

ball->applyDamping(btScalar(0.8));
after the collision.

or

ball->setDamping(btScalar(0.0), btScalar(1.0));
when you create the body.

Re: btSphereShape friction

Posted: Wed Mar 13, 2013 7:31 pm
by radubolovan
Thank you Adriano for your reply.

I was solving this following RollingFrictionDemo sample though, using setFriction & setRollingFriction to btRigidBody objects. :)