-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mesh - Plane collisions have caveats #1234
Comments
How are you representing concave triangle meshes in Bullet? The recommended way is to use a convex decomposition of the mesh (for example using VHACD) and store the convex parts in a btCompoundShape. That should work reliably. Many meshes are convex anyway, so they should use btConvexHull. Those convex meshes would need to be tagged as convex. |
Our current But this does emphasize the potential value of making convex meshes a first-class shape type in DART, which has been proposed before (#872). |
So btGImpactMeshShape versus btStaticPlaneShape is not implemented/doesn't work in Bullet? I don't use btGImpactMeshShape, but it seems a rather easy thing to support collision against a plane. We could fix that on the Bullet side. How about filing an issue? |
Either that pair is not working as expected in Bullet, or there's a bug in DART's wrapper. It would probably be good to make a Bullet-only example of the failure to pinpoint whether it's a problem in Bullet (and if it turns out that the Bullet-only example works fine, then that'll be useful to indicate that we need to make a fix in how DART is using Bullet). |
As we've been using dartsim in ignition-physics, we've been finding that mesh-plane collisions need to meet a bunch of conditions to work properly, so I wanted to document that here.
The caveats depends on which collision detector is being used:
FCL
dartsim doesn't support planes in FCL at all currently, so all
PlaneShape
s are automatically converted into thin boxes.Bullet
While Bullet seems to work okay for collisions between plane/primitive pairs, it seems to always fail between plane/mesh pairs. Do not use the Bullet collision detector when you need meshes to collide with planes!
ODE
ODE seems to mostly work great for plane/mesh collisions, but for some reason it completely fails to detect collisions if the normal is facing directly along the X, Y, or Z axis (positively or negatively) while the offset is a negative value. I have no idea why that would be an edge case, but it happens consistently. If the normal vector is even microscopically rotated off one of those axes, it will detect collisions just fine with a negative offset.
So if you are using the ODE collision detector when colliding meshes with planes try to avoid using a negative offset for the
PlaneShape
!.I'll be submitting a PR to demonstrate these cases soon.
The text was updated successfully, but these errors were encountered: