xiangaodielian / bullet

Automatically exported from code.google.com/p/bullet
Other
0 stars 0 forks source link

Incorrect results from btSubSimplexConvexCast with degenerate Voronoi Simplex #707

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.Replace RaytestDemo.cpp with one of the attached files
2.Build demos
3.Run raytest demo

What is the expected output? What do you see instead?

In the first, I expect contact points on or near the box corner, but I instead 
see ray hits against the box more than a meter past the box.
In the second, I expect no contact points at all (since the entire ray is 
outside the box extents), but instead I see a contact point that is past the 
box.

What version of the product are you using? On what operating system?

2.81 rev 2613, win32

Please provide any additional information below.

The voronoi simplex is invalid (planar) in both cases, though it seems that a 
planar simplex can also result in a correct hit when the side of the box really 
should be hit.  The simplex seems to choose all 4 corners of the box, but this 
does not create a tetrahedron, so it sets the degenerate flag and 
btSubsimplexConvexCast::calcTimeOfImpact terminates with unpredictable lambda 
values that swing wildly with small changes in input (try small adjustments to 
yMod in the second example to see this).

Original issue reported on code.google.com by phlkn...@gmail.com on 11 Apr 2013 at 12:11

Attachments:

GoogleCodeExporter commented 9 years ago
One key aspect to reproducing this bug is that the ray must intersect the AABB 
of the target object to prevent broadphase culling, even though the incorrect 
contact points are well outside the AABB.  In the second example, I rotate the 
box around the Y axis to give a larger AABB, but a box in a compound without a 
btDbvt also allows this, and probably an object moving in the broadphase (with 
a purposely inflated AABB) would also allow this.

It also seems that the ray must have a moderately shallow angle with respect to 
one face of the box.  Additionally, it seems that there must be 4 planar points 
on a polytope to generate the planar simplex.  I use boxes, but a properly 
constructed convex hull would probably show the error as well.

Original comment by phlkn...@gmail.com on 11 Apr 2013 at 7:36

GoogleCodeExporter commented 9 years ago
Thanks for the reproduction case, I'll have a look at it later.

Right now I'm wrapping up the GPU rigid body pipeline and try to merge it with 
Bullet 2.x somehow.

Original comment by erwin.coumans on 11 Apr 2013 at 7:38

GoogleCodeExporter commented 9 years ago
See https://github.com/bulletphysics/bullet3/issues/93

Original comment by erwin.coumans on 30 Mar 2014 at 6:08