Creeping spheres on a triangulated mesh

chucksspencer
Posts: 35
Joined: Wed Jun 25, 2008 2:52 pm

Creeping spheres on a triangulated mesh

Post by chucksspencer »

I'm working on a little billiards game in which we're using a btBvhTriangleMeshShape for the table and rails.

Ever since I upgraded from 2.71 to 2.75 it seems that the balls (btSphereShapes) won't stop rolling correctly once set in motion.

If any ball gets above a certain (unknown) speed it seems like its damping never slows it to a halt. It slows most of the way down but it keeps rolling slowly and won't stop until it collides with something (even then sometimes it still keeps rolling). If I put that same ball on another flat surface that isn't a btBvhTriangleMeshShape (eg a btBoxShape) its roll decelerates to a stop as expected. Seems possibly jitter-related though they don't appear to be jittering. Somehow the mesh is introducing unwanted velocities to the balls.

Increasing the frame rate of the simulation seems to help. I updated to the most recent trunk of 2.75 and that seems to have helped reduce (but not eliminate) the problem.

Anyone have any ideas why this is happening - or better still a good solution? Turning the linear and angular damping way up works, but then the balls don't behave as desired in other regards. What activation state should the btBvhTriangleMeshShape's body be set to?

Thanks as always!
chucksspencer
Posts: 35
Joined: Wed Jun 25, 2008 2:52 pm

Re: Creeping spheres on a triangulated mesh

Post by chucksspencer »

I tried substituting the btGImpactMeshShape per this discussion: http://bulletphysics.com/Bullet/phpBB3/ ... f=9&t=3701, and at first glance at least that seems to have helped.

When static, how does the performance of the btGImpactMeshShape compare to the btBvhTriangleMeshShape?