Page 1 of 1

btBvhTriangleMeshShape jittering

Posted: Mon Feb 13, 2012 9:33 am
by digi12345
Hi,

I have a simple flat long box mesh that has many triangles. As an experiment, I am building the static body collision shape as a btBvhTriangleMeshShape. When I try to move a cube along this flat box, the box would jitter across. If I use a regular box collision shape, it would box very smoothly.

Since I want to use btBvhTriangleMeshShape, as I want to use more complicated static meshes, is there a way to fix this jittering for btBvhTriangleMeshShape collision shapes?

I've searched through the forums, and it seems like it could be some error with the collision normals between objects for btBvhTriangleMeshShape shapes, but there were no resolution to that thread. (http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=1814)

Any help is much appreciated.

Thanks.

Re: btBvhTriangleMeshShape jittering

Posted: Mon Feb 13, 2012 3:44 pm
by kloplop321
Does it jitter across triangles that are sufficiently large, or between triangles?

Re: btBvhTriangleMeshShape jittering

Posted: Mon Feb 13, 2012 5:35 pm
by digi12345
I tried both. It jitters across large triangles, and across edges on a high tessellated mesh. Sometimes as it moves across the plane it would look like it gets jammed into the plane then pop back out.

Re: btBvhTriangleMeshShape jittering

Posted: Mon Feb 13, 2012 6:53 pm
by kloplop321
Do you think you could do a recording to show it?

Re: btBvhTriangleMeshShape jittering

Posted: Tue Feb 14, 2012 5:56 pm
by digi12345
Here is a video capture: http://youtu.be/DbjSuR85g68

As you can see, it's a flat plane and I'm pushing this cube across, but it jitters and gets stuck along the plane. This won't happen if I make the collision shape a box, only if it is a mesh.

Re: btBvhTriangleMeshShape jittering

Posted: Tue Feb 14, 2012 6:22 pm
by kloplop321
Well that's obnoxious.

Can you implement and use a bullet debug drawer in wireframe?
It might be a precision error(which may be solved by changing bullet to double precision).

Re: btBvhTriangleMeshShape jittering

Posted: Wed Feb 15, 2012 2:15 am
by digi12345
I tried double precision ( rebuilding the libs ) but I still get the jittering.
Any immediate thoughts what could be wrong? The behavior is very similar to the issue discussed in (viewtopic.php?f=9&t=1814), but no final solution was presented in that thread.

Re: btBvhTriangleMeshShape jittering

Posted: Wed Feb 15, 2012 4:49 am
by kloplop321
Its unfortunate that it seems unresolved in that thread.
Though Issue 27, which Erwin started and marked as fixed might have a small patch.
http://code.google.com/p/bullet/issues/detail?id=27

I think it would be best if you recreated your scene using a bullet demo template so that those working on the core could have a precise reference to what is going on.