DanielChappuis / reactphysics3d

Open source C++ physics engine library in 3D
http://www.reactphysics3d.com
zlib License
1.51k stars 217 forks source link

Convex polygon gets stuck/jibbles around #92

Closed Paril closed 5 years ago

Paril commented 5 years ago

https://i.imgur.com/zQiGJUb.png

I'm not sure how to exactly explain this one, but I have a sample! convexmesh.obj.txt

With this obj file in the testbed, "Collision Shapes" shows the behavior. For some reason, some corners of the rectangle sink into the ground and/or slide. The mesh is convex and seems simple enough, not sure why it's exhibiting this behavior.

DanielChappuis commented 5 years ago

Hello,

This mesh has coplanar faces. As explained in the documentation, creating a convex mesh with coplanar faces should be avoided. A convex mesh should be created with the minimum number of faces. In your case, it should be a convex mesh with 6 quad faces and not 8 triangular faces. Actually this kind of shape should be created with a BoxShape and not a convex mesh.

I hope this helps.

DanielChappuis commented 5 years ago

Did you try with a mesh without any coplanar faces ? Can I close this issue ?

Paril commented 5 years ago

Ah I see. I must have skipped over that in my reading. I was triangulating meshes rather than using polygonal faces, so that'd explain why my convex models were messing up.