btBvhTriangleMeshShape jittering

Post Reply
digi12345
Posts: 13
Joined: Mon Aug 15, 2011 5:43 pm

btBvhTriangleMeshShape jittering

Post by digi12345 » Mon Feb 13, 2012 9:33 am

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.

kloplop321
Posts: 55
Joined: Sun Jan 01, 2012 7:37 pm

Re: btBvhTriangleMeshShape jittering

Post by kloplop321 » Mon Feb 13, 2012 3:44 pm

Does it jitter across triangles that are sufficiently large, or between triangles?

digi12345
Posts: 13
Joined: Mon Aug 15, 2011 5:43 pm

Re: btBvhTriangleMeshShape jittering

Post by digi12345 » Mon Feb 13, 2012 5:35 pm

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.

kloplop321
Posts: 55
Joined: Sun Jan 01, 2012 7:37 pm

Re: btBvhTriangleMeshShape jittering

Post by kloplop321 » Mon Feb 13, 2012 6:53 pm

Do you think you could do a recording to show it?

digi12345
Posts: 13
Joined: Mon Aug 15, 2011 5:43 pm

Re: btBvhTriangleMeshShape jittering

Post by digi12345 » Tue Feb 14, 2012 5:56 pm

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.

kloplop321
Posts: 55
Joined: Sun Jan 01, 2012 7:37 pm

Re: btBvhTriangleMeshShape jittering

Post by kloplop321 » Tue Feb 14, 2012 6:22 pm

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).

digi12345
Posts: 13
Joined: Mon Aug 15, 2011 5:43 pm

Re: btBvhTriangleMeshShape jittering

Post by digi12345 » Wed Feb 15, 2012 2:15 am

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.

kloplop321
Posts: 55
Joined: Sun Jan 01, 2012 7:37 pm

Re: btBvhTriangleMeshShape jittering

Post by kloplop321 » Wed Feb 15, 2012 4:49 am

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.

Post Reply