Collisions on a triangle mesh with edges and falling through

Bob666
Posts: 3
Joined: Fri Apr 01, 2011 8:37 pm

Collisions on a triangle mesh with edges and falling through

Post by Bob666 »

Hi all

I have a strange problem. I use Bullet to calculate collisions for haptics. When using simple boxes and spheres from bullet, everything works as expected. I now need to use geometries to have mesh-to-mesh haptics, so I use the btTriangleMeshShape (which is generated by using osgBullet and OpenSceneGraph).

I then built a simple box geometry with 2 triangles per side to test it. When I now move my haptic pointer (a btSphereShape) onto a triangle, I can move around that triangle and have the proper force. But when I reach the edge between two triangles, I get a collision with the next triangle (both are flat and have the same normals) and a force holds it back from moving onto this next triangle. If I push harder, I fall through this next triangle and I get the same effect from the box inside.

However, when I move to an edge of the box (inside), where two triangles are 90 degrees, it works as expected, I reach on the triangle the next 90° triangle, have two collisions and can move further as it should.

Can you give me a hint what's going wrong?

Thanks for your help
Bob
Jonathan
Posts: 36
Joined: Sun Feb 10, 2013 6:52 pm

Re: Collisions on a triangle mesh with edges and falling thr

Post by Jonathan »

I hope someone can answer this because, if I'm understanding you correctly, I believe I have a similar problem. I even went through setting this extra functionality up:

http://www.bulletphysics.org/Bullet/php ... f=9&t=4603

... but it did not seem to help.

After a lot of fighting with it, I finally figured maybe it was due to some really massive triangles on a floor I had (50-100m)... so I instead added a big box collider where that floor is. Definitely more of a workaround rather than a fix. I wish I knew why btTriangleMesh is so picky. :(
Jonathan
Posts: 36
Joined: Sun Feb 10, 2013 6:52 pm

Re: Collisions on a triangle mesh with edges and falling thr

Post by Jonathan »

Okay, one thing I accidentally figured out is if you are exporting a triangle mesh from Blender, when importing it into your bullet code, it doesn't seem to retain the collision margin set in Blender.
I noticed when I manually increased the collision margin of a triangle mesh, the stability of the simulation GREATLY INCREASED.

I'm not sure if this helps your original problem, but it certainly fixes my problem with triangle meshes. :)