[solved] Spheres sinking into btBvhTriangleMesh

gabba
Posts: 9
Joined: Thu Mar 19, 2009 3:20 am

[solved] Spheres sinking into btBvhTriangleMesh

Post by gabba »

[solved]

Well duh. It turns out the problem was caused by the 3D model, which was made by one of my friends. The inside of the circular wall didn't have any polygons! No wonder the balls wanted to sink through, there was nothing to stop them. I was fooled by the Bullet view from the demos, which made everything look fine (as you can see below). In the end I got into modeling myself to test different configurations, and now this particular problem is solved.

********************

Hi All,

I have a multi-player pinball game project, in which the play area is to be represented by a btBvhTriangleMesh, and the balls, of course, by btSphereShape(s).

The current test table has very simple geometry: a dome, surrounded by a circular wall. As recommended, I feed all the triangles into a btTriangleMesh, from which I then construct a btBvhTriangleMesh. The mesh looks fine in wireframe view.

Here's the problem: balls dropped on the table (btSphereShapes of 1.0f radius), roll off the dome and come into contact with the wall. But, after stabilizing for a few seconds, they start being sucked inexorably into the wall! Sometimes they "realize their mistake" before it is too late and bounce off with enough force to jump across the table and fall into the void. Most of the time though, they sink completely into the wall and even start rolling around inside the edge of the table. Either case is annoying. As you can see:
Sinking - 3 balls misbehaving.jpg
Here's a wireframe view of the table, is there any obvious defect to the static model?
Sinking - wireframe view.jpg
Here's a last view from the side - this one is of a slightly irregular dome that's supposed to guide the balls to one of two holes. The sinking behavior is even worse with this one. You can also see some convex objects (the future flippers) that penetrated the btBvhTriangleMesh.
Sinking - side view, more irregular dome.jpg
The settings are all default, as in the Basic Demo. Standard gravity, nothing fancy with the units... Before reverting to the defaults I've tried random stuff such as playing with the CCD options, and reducing the collision margin of the static mesh to zero, to no avail.

So, any idea of how I could work around this problem? And is this a known problem in Bullet? I'm using Bullet 2.74 static libraries compiled in DebugDLL mode, under Windows XP and Visual Studio 2005 SP1. (But the behavior is strictly the same under linux, compiled with gcc.)
You do not have the required permissions to view the files attached to this post.