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.
btSphereShape friction
-
- Posts: 6
- Joined: Fri Mar 08, 2013 9:53 am
Re: btSphereShape friction
You can try to add a damping:
ball->applyDamping(btScalar(0.);
after the collision.
or
ball->setDamping(btScalar(0.0), btScalar(1.0));
when you create the body.
ball->applyDamping(btScalar(0.);
after the collision.
or
ball->setDamping(btScalar(0.0), btScalar(1.0));
when you create the body.
-
- Posts: 7
- Joined: Mon Dec 22, 2008 3:13 pm
Re: btSphereShape friction
Thank you Adriano for your reply.
I was solving this following RollingFrictionDemo sample though, using setFriction & setRollingFriction to btRigidBody objects.
I was solving this following RollingFrictionDemo sample though, using setFriction & setRollingFriction to btRigidBody objects.